nhanh-pure-function 3.0.6-beta.3 → 3.0.6-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/File/index.d.ts +17 -7
- package/dist/index.cjs.js +3 -3
- package/dist/index.es.js +1135 -1126
- package/package.json +1 -1
package/dist/File/index.d.ts
CHANGED
|
@@ -7,18 +7,28 @@ export declare function _File_Read(src: string): Promise<string>;
|
|
|
7
7
|
/**
|
|
8
8
|
* 下载文件并支持进度监控、超时控制和主动中止
|
|
9
9
|
*
|
|
10
|
-
* @param {
|
|
11
|
-
* @param {string}
|
|
12
|
-
* @param {
|
|
13
|
-
* @param {
|
|
14
|
-
* @param {number} [
|
|
15
|
-
* @
|
|
10
|
+
* @param {Object} options - 下载配置选项
|
|
11
|
+
* @param {string} options.href - 文件的 URL 路径或下载地址,需确保跨域权限或同源
|
|
12
|
+
* @param {string} [options.fileName] - 可选,指定导出的文件名(不含扩展名时会自动从 href 提取)
|
|
13
|
+
* @param {Function} [options.onProgress] - 可选,下载进度回调函数
|
|
14
|
+
* @param {number} [options.onProgress.progress] - 进度百分比(0-100)
|
|
15
|
+
* @param {number} [options.timeout=30000] - 可选,超时时间(毫秒),默认 30 秒
|
|
16
|
+
* @param {boolean} [options.autoDownload=true] - 可选,是否自动执行下载操作,默认 true
|
|
17
|
+
* @returns {Object} 返回包含以下属性的对象:
|
|
16
18
|
* - promise: Promise 对象,成功时 resolve 下载的 Blob 数据,失败时 reject 错误信息
|
|
17
19
|
* - abort: 中止下载的函数,调用后会触发 abort 错误
|
|
20
|
+
* - download: 手动执行下载的函数(当 autoDownload 为 false 时使用)
|
|
18
21
|
*/
|
|
19
|
-
export declare function _File_Download(
|
|
22
|
+
export declare function _File_Download(options: {
|
|
23
|
+
href: string;
|
|
24
|
+
fileName?: string;
|
|
25
|
+
onProgress?: (progress: number) => void;
|
|
26
|
+
timeout?: number;
|
|
27
|
+
autoDownload?: boolean;
|
|
28
|
+
}): {
|
|
20
29
|
promise: Promise<Blob>;
|
|
21
30
|
abort: () => false | void;
|
|
31
|
+
download: () => void;
|
|
22
32
|
};
|
|
23
33
|
/**
|
|
24
34
|
* 创建文件并下载
|