25 lines
		
	
	
		
			549 B
		
	
	
	
		
			TypeScript
		
	
	
		
		
			
		
	
	
			25 lines
		
	
	
		
			549 B
		
	
	
	
		
			TypeScript
		
	
	
|  | export interface UploadFile { | ||
|  |   /** 原始文件对象 */ | ||
|  |   originFileObj?: File; | ||
|  |   [key: string]: any; | ||
|  | } | ||
|  | 
 | ||
|  | interface UseImportFileOptions { | ||
|  |   /** 要上传的文件数组 */ | ||
|  |   files: UploadFile[]; | ||
|  |   /** 额外携带的参数对象 */ | ||
|  |   params?: Record<string, any>; | ||
|  | } | ||
|  | 
 | ||
|  | export interface ImportFileOptions { | ||
|  |   url: string; | ||
|  |   options: UseImportFileOptions; | ||
|  | } | ||
|  | 
 | ||
|  | export type ImportFileFunction = (url: string, options: UseImportFileOptions) => Promise<any>; | ||
|  | 
 | ||
|  | /** | ||
|  |  * 导入文件 | ||
|  |  */ | ||
|  | export default function useImportFile(): [boolean, ImportFileFunction]; |