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

17 lines
438 B
TypeScript

interface UseDownloadBlobOptions {
/** 下载文件的自定义文件名(不含后缀),默认为当前时间戳 */
name?: string;
/** Blob 对象的 MIME 类型,默认为 Excel 类型 */
type?: string;
/** 请求时携带的查询参数对象 */
params?: Record<string, any>;
}
/**
* 下载Blob流文件
*/
export default function useDownloadBlob(
url: string,
options?: UseDownloadBlobOptions
): Promise<any>;