UNPKG

@iimm/shared

Version:

shared utils on browser and react env

14 lines (13 loc) 552 B
type InputFile = string | Blob | File | ArrayBuffer; type Options = { onDownloadSuccess?: (file: InputFile, fileName?: string) => void | Promise<void>; onDownloadFail?: (file: InputFile, fileName?: string) => void | Promise<void>; onDownloadStart?: (file: InputFile, fileName?: string) => void | boolean; /** * @default 50 */ maxFileNameLength?: number; }; /** 将传入的file下载 */ export declare const generateFileDownload: (file: InputFile, name?: string, extension?: string, options?: Options) => void; export {};