export interface FileDownloadOptions { /** 下载模式:link(默认)、fetch(blob下载)、iframe */ mode?: "link" | "fetch" | "iframe"; /** 文件名(link/fetch 模式有效) */ fileName?: string; /** 进度回调 `0~1`(仅 fetch 模式) */ onProgress?: (progress: number) => void; /** 请求头(仅 fetch 模式) */ headers?: Record; /** 请求超时毫秒(仅 fetch 模式,默认 60000) */ timeout?: number; } /** * 文件下载,支持多种下载模式 * * @example * // 默认 标签下载 * fileDownload('https://example.com/file.pdf') * * // fetch blob 下载(支持进度回调) * fileDownload('https://example.com/file.pdf', { * mode: 'fetch', * fileName: 'myfile.pdf', * onProgress: (p) => console.log(`${Math.round(p * 100)}%`), * }) * * // iframe 下载 * fileDownload('https://example.com/file.pdf', { mode: 'iframe' }) */ export declare const fileDownload: (url: string, options?: FileDownloadOptions) => Promise;