zy-react-library/hooks/useDownloadFile/index.d.ts

15 lines
462 B
TypeScript

export interface DownloadFileOptions {
/** 下载文件的URL */
url: string;
/** 下载文件的自定义文件名 */
name?: string;
}
export type DownloadFileFunction = (options: DownloadFileOptions) => void;
/**
* 下载文件
*/
export default function useDownloadFile(returnType: "array"): [boolean, DownloadFileFunction];
export default function useDownloadFile(returnType?: "object"): { loading: boolean; downloadFile: DownloadFileFunction };