@iimm/shared
Version:
shared utils on browser and react env
10 lines (9 loc) • 516 B
TypeScript
declare type InputFile = string | Blob | File | ArrayBuffer;
interface ICallbacks {
onDownloadSuccess?: (file: InputFile, fileName?: string) => void | Promise<void>;
onDownloadFail?: (file: InputFile, fileName?: string) => void | Promise<void>;
onDownloadStart?: (file: InputFile, fileName?: string) => void | boolean;
}
/** 将传入的file下载 */
export declare const generateFileDownload: (file: InputFile, fileName?: string, extension?: string, callbacks?: ICallbacks) => void;
export {};