29 lines
727 B
TypeScript
29 lines
727 B
TypeScript
|
|
export interface GetFileOptions {
|
||
|
|
/** 文件类型 */
|
||
|
|
eqType: number;
|
||
|
|
/** 外键ID */
|
||
|
|
eqForeignKey: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface FileItem {
|
||
|
|
/** 文件路径 */
|
||
|
|
filePath: string;
|
||
|
|
/** 文件名称 */
|
||
|
|
fileName: string;
|
||
|
|
/** 文件ID */
|
||
|
|
id: string;
|
||
|
|
/** 文件URL(由addingPrefixToFile函数添加) */
|
||
|
|
url: string;
|
||
|
|
/** 文件名称(由addingPrefixToFile函数添加) */
|
||
|
|
name: string;
|
||
|
|
[key: string]: any;
|
||
|
|
}
|
||
|
|
|
||
|
|
export type GetFileFunction = (options: GetFileOptions) => Promise<FileItem[]>;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 获取文件
|
||
|
|
*/
|
||
|
|
export default function useGetFile(returnType: "array"): [boolean, GetFileFunction];
|
||
|
|
export default function useGetFile(returnType?: "object"): { loading: boolean; getFile: GetFileFunction };
|