export interface DownloadOptions { /** 下载文件名,不传则从 URL 自动提取 */ filename?: string; /** 是否通过 fetch 转 Blob 下载(用于跨域或需要鉴权的资源),默认 false */ fetch?: boolean; /** 请求头(仅在 fetch 为 true 时生效) */ headers?: Record; /** fetch 请求凭证(如 cookie),仅在 fetch 为 true 时生效 */ credentials?: RequestCredentials; } /** * 下载 URL 对应的文件 * @param url 文件地址 * @param options 配置项 * @returns Promise */ export declare function downloadFile(url: string, options?: DownloadOptions): Promise; export default downloadFile;