xframelib 0.7.3 → 0.7.6

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.
Files changed (72) hide show
  1. package/README.md +23 -18
  2. package/dist/api/Token.d.ts +15 -15
  3. package/dist/api/User.d.ts +49 -49
  4. package/dist/api/index.d.ts +2 -2
  5. package/dist/assets/output-ad5f5cbf.css +307 -0
  6. package/dist/controls/collapsepanel/VCollapsiblePanel.vue.d.ts +27 -27
  7. package/dist/controls/collapsepanel/VCollapsiblePanelGroup.vue.d.ts +33 -33
  8. package/dist/controls/collapsepanel/color.util.d.ts +1 -1
  9. package/dist/controls/collapsepanel/composables/store.d.ts +7 -7
  10. package/dist/controls/collapsepanel/constant.d.ts +1 -1
  11. package/dist/controls/collapsepanel/index.d.ts +3 -3
  12. package/dist/controls/layoutcontainer/LayoutManager.d.ts +133 -112
  13. package/dist/controls/layoutcontainer/index.d.ts +3 -3
  14. package/dist/controls/layoutcontainer/layout.vue.d.ts +61 -60
  15. package/dist/controls/splitpanes/index.d.ts +3 -3
  16. package/dist/controls/vuewindow/SinglePointerEvent.d.ts +23 -23
  17. package/dist/controls/vuewindow/dom.d.ts +16 -16
  18. package/dist/controls/vuewindow/draggable_helper.d.ts +20 -20
  19. package/dist/controls/vuewindow/index.d.ts +6 -6
  20. package/dist/controls/vuewindow/resizable_helper.d.ts +16 -16
  21. package/dist/controls/vuewindow/style.d.ts +110 -110
  22. package/dist/controls/vuewindow/window/Button.vue.d.ts +29 -29
  23. package/dist/controls/vuewindow/window/index.vue.d.ts +211 -211
  24. package/dist/controls/vuewindow/window/utils.d.ts +17 -17
  25. package/dist/controls/vuewindow/z_element.d.ts +11 -11
  26. package/dist/core/Global.d.ts +2 -2
  27. package/dist/core/IModel.d.ts +46 -46
  28. package/dist/core/Init.d.ts +20 -20
  29. package/dist/core/MsgHelper.d.ts +13 -13
  30. package/dist/core/SysEvents.d.ts +24 -24
  31. package/dist/core/index.d.ts +4 -4
  32. package/dist/hprose/HproseClient.d.ts +20 -20
  33. package/dist/hprose/ProxyClient.d.ts +39 -39
  34. package/dist/hprose/index.d.ts +11 -11
  35. package/dist/index.cjs +10 -5
  36. package/dist/index.css +96 -81
  37. package/dist/index.d.ts +11 -11
  38. package/dist/index.js +10 -5
  39. package/dist/mitt/index.d.ts +25 -25
  40. package/dist/model/Config.d.ts +151 -151
  41. package/dist/model/Constants.d.ts +19 -19
  42. package/dist/model/IRole.d.ts +89 -89
  43. package/dist/model/IUserModel.d.ts +67 -67
  44. package/dist/model/Layout.d.ts +83 -83
  45. package/dist/model/index.d.ts +5 -5
  46. package/dist/permission/RoleSysRightHelper.d.ts +27 -27
  47. package/dist/permission/filter.d.ts +45 -45
  48. package/dist/permission/index.d.ts +4 -4
  49. package/dist/permission/register.d.ts +24 -24
  50. package/dist/permission/right.d.ts +15 -15
  51. package/dist/utils/AxiosHelper.d.ts +58 -58
  52. package/dist/utils/BigFileDownload.d.ts +117 -117
  53. package/dist/utils/CodeHelper.d.ts +14 -14
  54. package/dist/utils/Color.d.ts +74 -74
  55. package/dist/utils/FileDownload.d.ts +36 -36
  56. package/dist/utils/FileUpload.d.ts +90 -90
  57. package/dist/utils/H5Tool.d.ts +158 -150
  58. package/dist/utils/IsTool.d.ts +101 -101
  59. package/dist/utils/JQuery.d.ts +41 -41
  60. package/dist/utils/LockHelper.d.ts +17 -17
  61. package/dist/utils/SignalRClient.d.ts +8 -8
  62. package/dist/utils/Storage.d.ts +66 -66
  63. package/dist/utils/StringUtils.d.ts +15 -15
  64. package/dist/utils/Time.d.ts +11 -11
  65. package/dist/utils/TokenHelper.d.ts +18 -18
  66. package/dist/utils/URLTool.d.ts +18 -18
  67. package/dist/utils/ValidateTool.d.ts +149 -149
  68. package/dist/utils/WaterMark.d.ts +10 -10
  69. package/dist/utils/XXTEA.d.ts +15 -15
  70. package/dist/utils/index.d.ts +21 -21
  71. package/dist/utils/uuid.d.ts +3 -3
  72. package/package.json +19 -19
@@ -1,117 +1,117 @@
1
- /**
2
- * 下载文件信息模型
3
- */
4
- export interface IFileMeta {
5
- id?: string;
6
- name: string;
7
- length: number;
8
- downloadID: string;
9
- chunkSize?: number;
10
- }
11
- /**
12
- * 文件下载事件
13
- */
14
- export type FileDownloadEvent = 'init' | 'info' | 'error' | 'downloadProgress' | 'saveProgress' | 'success';
15
- /**
16
- * 大文件分片/断点续传下载
17
- */
18
- export declare class BigFileDownload {
19
- private fileID;
20
- private downloadURL?;
21
- ChunkUnitM: number;
22
- private chunkByteSize;
23
- private totalChunks;
24
- private currentDB?;
25
- private keys?;
26
- private fileMetaData;
27
- private finishNum;
28
- private eventTarget;
29
- private cancelSource;
30
- private isStarting;
31
- private fileName?;
32
- private cacheSize;
33
- private requestTimeout;
34
- /**
35
- *
36
- * @param fileID
37
- * @param downloadURL 下载链接(可空)
38
- * @param chunkSizeM 分片大小,默认为3M
39
- * @param cacheNum 缓存大小
40
- * @param requestTimeoutMS 请求超时时间(毫秒)默认为60s
41
- */
42
- constructor(fileID: string, downloadURL?: string | undefined, chunkSizeM?: number, cacheNum?: number, requestTimeoutMS?: number);
43
- /**
44
- * 订阅事件
45
- */
46
- on(eventName: FileDownloadEvent, fn: (event: any) => void): void;
47
- /**
48
- * 发送消息
49
- */
50
- private dispatch;
51
- /**
52
- * 抛出异常信息
53
- * @param data 异常描述
54
- */
55
- private dispatchError;
56
- /**
57
- * 推送文字进度
58
- * @param data 文字消息
59
- */
60
- private dispatchInfo;
61
- /**
62
- * Get请求获取文件元数据信息
63
- * @param baseURL 根URL路径
64
- * @param apiPath 方法路径
65
- * @param queryParams 请求参数
66
- * @returns IFileMeta
67
- */
68
- queryDownloadFileMeta(baseURL: string, apiPath?: string, queryParams?: any): Promise<IFileMeta | null>;
69
- /**
70
- *获取本地的File元数据信息
71
- */
72
- getIFileMeta(): Promise<IFileMeta | null>;
73
- /**
74
- * 初始化信息
75
- */
76
- private initIndexDB;
77
- /**
78
- * 初始化要下载的文件元数据
79
- * @param url 下载路径
80
- * @returns
81
- */
82
- init(fileMeta: IFileMeta): Promise<void>;
83
- /**
84
- * 获取分片大小
85
- * @returns
86
- */
87
- getTotalChunks(): number;
88
- /**
89
- * 暂停下载
90
- */
91
- pause(): void;
92
- /**
93
- * 重新开始
94
- */
95
- restart(): void;
96
- /**
97
- * 删除下载任务
98
- */
99
- delete(): void;
100
- sleep(ms: any): Promise<unknown>;
101
- /**
102
- * 开始分段下载
103
- */
104
- download(downloadAPI?: string, baseURL?: string): Promise<void>;
105
- /**
106
- * 下载完成进度
107
- */
108
- private downloadProgress;
109
- /**
110
- * 输出保存文件进度-分片统计
111
- */
112
- private outputProgress;
113
- /**
114
- * 保存文件
115
- */
116
- private savefile;
117
- }
1
+ /**
2
+ * 下载文件信息模型
3
+ */
4
+ export interface IFileMeta {
5
+ id?: string;
6
+ name: string;
7
+ length: number;
8
+ downloadID: string;
9
+ chunkSize?: number;
10
+ }
11
+ /**
12
+ * 文件下载事件
13
+ */
14
+ export type FileDownloadEvent = 'init' | 'info' | 'error' | 'downloadProgress' | 'saveProgress' | 'success';
15
+ /**
16
+ * 大文件分片/断点续传下载
17
+ */
18
+ export declare class BigFileDownload {
19
+ private fileID;
20
+ private downloadURL?;
21
+ ChunkUnitM: number;
22
+ private chunkByteSize;
23
+ private totalChunks;
24
+ private currentDB?;
25
+ private keys?;
26
+ private fileMetaData;
27
+ private finishNum;
28
+ private eventTarget;
29
+ private cancelSource;
30
+ private isStarting;
31
+ private fileName?;
32
+ private cacheSize;
33
+ private requestTimeout;
34
+ /**
35
+ *
36
+ * @param fileID
37
+ * @param downloadURL 下载链接(可空)
38
+ * @param chunkSizeM 分片大小,默认为3M
39
+ * @param cacheNum 缓存大小
40
+ * @param requestTimeoutMS 请求超时时间(毫秒)默认为60s
41
+ */
42
+ constructor(fileID: string, downloadURL?: string | undefined, chunkSizeM?: number, cacheNum?: number, requestTimeoutMS?: number);
43
+ /**
44
+ * 订阅事件
45
+ */
46
+ on(eventName: FileDownloadEvent, fn: (event: any) => void): void;
47
+ /**
48
+ * 发送消息
49
+ */
50
+ private dispatch;
51
+ /**
52
+ * 抛出异常信息
53
+ * @param data 异常描述
54
+ */
55
+ private dispatchError;
56
+ /**
57
+ * 推送文字进度
58
+ * @param data 文字消息
59
+ */
60
+ private dispatchInfo;
61
+ /**
62
+ * Get请求获取文件元数据信息
63
+ * @param baseURL 根URL路径
64
+ * @param apiPath 方法路径
65
+ * @param queryParams 请求参数
66
+ * @returns IFileMeta
67
+ */
68
+ queryDownloadFileMeta(baseURL: string, apiPath?: string, queryParams?: any): Promise<IFileMeta | null>;
69
+ /**
70
+ *获取本地的File元数据信息
71
+ */
72
+ getIFileMeta(): Promise<IFileMeta | null>;
73
+ /**
74
+ * 初始化信息
75
+ */
76
+ private initIndexDB;
77
+ /**
78
+ * 初始化要下载的文件元数据
79
+ * @param url 下载路径
80
+ * @returns
81
+ */
82
+ init(fileMeta: IFileMeta): Promise<void>;
83
+ /**
84
+ * 获取分片大小
85
+ * @returns
86
+ */
87
+ getTotalChunks(): number;
88
+ /**
89
+ * 暂停下载
90
+ */
91
+ pause(): void;
92
+ /**
93
+ * 重新开始
94
+ */
95
+ restart(): void;
96
+ /**
97
+ * 删除下载任务
98
+ */
99
+ delete(): void;
100
+ sleep(ms: any): Promise<unknown>;
101
+ /**
102
+ * 开始分段下载
103
+ */
104
+ download(downloadAPI?: string, baseURL?: string): Promise<void>;
105
+ /**
106
+ * 下载完成进度
107
+ */
108
+ private downloadProgress;
109
+ /**
110
+ * 输出保存文件进度-分片统计
111
+ */
112
+ private outputProgress;
113
+ /**
114
+ * 保存文件
115
+ */
116
+ private savefile;
117
+ }
@@ -1,14 +1,14 @@
1
- import { ISysRightOptions } from '../permission/register';
2
- /**
3
- * 输出动态Icon图标列表文件
4
- * @param iconArray
5
- * @param filePath
6
- */
7
- declare function writeIconifyList(iconArray: string[], filePath?: string): void;
8
- /**
9
- * 导出系统功能权限文件
10
- * @param options 系统权限参数对象
11
- * @param filename 文件名(无需后缀)
12
- */
13
- declare function writeSysRoleRight(options: ISysRightOptions, filename: string): void;
14
- export { writeIconifyList, writeSysRoleRight };
1
+ import { ISysRightOptions } from '../permission/register';
2
+ /**
3
+ * 输出动态Icon图标列表文件
4
+ * @param iconArray
5
+ * @param filePath
6
+ */
7
+ declare function writeIconifyList(iconArray: string[], filePath?: string): void;
8
+ /**
9
+ * 导出系统功能权限文件
10
+ * @param options 系统权限参数对象
11
+ * @param filename 文件名(无需后缀)
12
+ */
13
+ declare function writeSysRoleRight(options: ISysRightOptions, filename: string): void;
14
+ export { writeIconifyList, writeSysRoleRight };
@@ -1,74 +1,74 @@
1
- /**
2
- * rgb转十六进制
3
- * @param colorRGB rgb颜色值
4
- * @returns
5
- */
6
- export declare function getHexColor(colorRGB: string): string;
7
- /**
8
- * 十六进制转RGB
9
- * @param color16 十六进制颜色值
10
- * @returns
11
- */
12
- export declare function getRGBColor(color16: string): string;
13
- /**
14
- * 解决十六进制短颜色问题
15
- * @param colorHex 十六进制颜色
16
- * @returns
17
- */
18
- export declare function getLongHexColor(colorHex: string): string;
19
- export declare enum EnumColor {
20
- RGBA = 0,
21
- Hex = 1,
22
- Hsla = 2
23
- }
24
- /**
25
- * 判断是否是16进制颜色
26
- * @param colorStr 颜色字符串
27
- * @returns
28
- */
29
- export declare function isEnumColor(colorStr: string): EnumColor | undefined;
30
- export declare function getRGBColorFromHSLA(colorHSLA: string): string | undefined;
31
- /**
32
- * 判断是否 十六进制颜色值.
33
- * 输入形式可为 #fff000 #f00
34
- *
35
- * @param String color 十六进制颜色值
36
- * @return Boolean
37
- */
38
- export declare function isHexColor(color: string): boolean;
39
- /**
40
- * RGB 颜色值转换为 十六进制颜色值.
41
- * r, g, 和 b 需要在 [0, 255] 范围内
42
- *
43
- * @return String 类似#ff00ff
44
- * @param r
45
- * @param g
46
- * @param b
47
- */
48
- export declare function rgbToHex(r: number, g: number, b: number): string;
49
- /**
50
- * Transform a HEX color to its RGB representation
51
- * @param {string} hex The color to transform
52
- * @returns The RGB representation of the passed color
53
- */
54
- export declare function hexToRGB(hex: string): string;
55
- export declare function colorIsDark(color: string): boolean | undefined;
56
- /**
57
- * Darkens a HEX color given the passed percentage
58
- * @param {string} color The color to process
59
- * @param {number} amount The amount to change the color by
60
- * @returns {string} The HEX representation of the processed color
61
- */
62
- export declare function darken(color: string, amount: number): string;
63
- /**
64
- * Lightens a 6 char HEX color according to the passed percentage
65
- * @param {string} color The color to change
66
- * @param {number} amount The amount to change the color by
67
- * @returns {string} The processed color represented as HEX
68
- */
69
- export declare function lighten(color: string, amount: number): string;
70
- /**
71
- * Determines what the best text color is (black or white) based con the contrast with the background
72
- * @param hexColor - Last selected color by the user
73
- */
74
- export declare function calculateBestTextColor(hexColor: string): "#000000" | "#FFFFFF";
1
+ /**
2
+ * rgb转十六进制
3
+ * @param colorRGB rgb颜色值
4
+ * @returns
5
+ */
6
+ export declare function getHexColor(colorRGB: string): string;
7
+ /**
8
+ * 十六进制转RGB
9
+ * @param color16 十六进制颜色值
10
+ * @returns
11
+ */
12
+ export declare function getRGBColor(color16: string): string;
13
+ /**
14
+ * 解决十六进制短颜色问题
15
+ * @param colorHex 十六进制颜色
16
+ * @returns
17
+ */
18
+ export declare function getLongHexColor(colorHex: string): string;
19
+ export declare enum EnumColor {
20
+ RGBA = 0,
21
+ Hex = 1,
22
+ Hsla = 2
23
+ }
24
+ /**
25
+ * 判断是否是16进制颜色
26
+ * @param colorStr 颜色字符串
27
+ * @returns
28
+ */
29
+ export declare function isEnumColor(colorStr: string): EnumColor | undefined;
30
+ export declare function getRGBColorFromHSLA(colorHSLA: string): string | undefined;
31
+ /**
32
+ * 判断是否 十六进制颜色值.
33
+ * 输入形式可为 #fff000 #f00
34
+ *
35
+ * @param String color 十六进制颜色值
36
+ * @return Boolean
37
+ */
38
+ export declare function isHexColor(color: string): boolean;
39
+ /**
40
+ * RGB 颜色值转换为 十六进制颜色值.
41
+ * r, g, 和 b 需要在 [0, 255] 范围内
42
+ *
43
+ * @return String 类似#ff00ff
44
+ * @param r
45
+ * @param g
46
+ * @param b
47
+ */
48
+ export declare function rgbToHex(r: number, g: number, b: number): string;
49
+ /**
50
+ * Transform a HEX color to its RGB representation
51
+ * @param {string} hex The color to transform
52
+ * @returns The RGB representation of the passed color
53
+ */
54
+ export declare function hexToRGB(hex: string): string;
55
+ export declare function colorIsDark(color: string): boolean | undefined;
56
+ /**
57
+ * Darkens a HEX color given the passed percentage
58
+ * @param {string} color The color to process
59
+ * @param {number} amount The amount to change the color by
60
+ * @returns {string} The HEX representation of the processed color
61
+ */
62
+ export declare function darken(color: string, amount: number): string;
63
+ /**
64
+ * Lightens a 6 char HEX color according to the passed percentage
65
+ * @param {string} color The color to change
66
+ * @param {number} amount The amount to change the color by
67
+ * @returns {string} The processed color represented as HEX
68
+ */
69
+ export declare function lighten(color: string, amount: number): string;
70
+ /**
71
+ * Determines what the best text color is (black or white) based con the contrast with the background
72
+ * @param hexColor - Last selected color by the user
73
+ */
74
+ export declare function calculateBestTextColor(hexColor: string): "#000000" | "#FFFFFF";
@@ -1,36 +1,36 @@
1
- /**
2
- * 下载文件
3
- * @param content 文本或二进制文件
4
- * @param filename 文件名
5
- */
6
- declare const Download: (content: string | any, filename: string) => void;
7
- /**
8
- * URL方式保存文件到本地
9
- * @param data 文件的blob数据
10
- * @param name 文件名
11
- */
12
- declare function SaveAs(data: string | any, name: string): void;
13
- /**
14
- * JSON对象下载为.json文件
15
- * @param jsonObject Json对象
16
- * @param jsonID 名称(不需要后缀名)
17
- */
18
- declare const JsonDownload: (jsonObject: object, jsonID: string) => void;
19
- /**
20
- * 从Web上下载文件
21
- * (通过axios下载)
22
- * @param requestUrl URL下载地址
23
- * @param fileName 文件名
24
- */
25
- declare const HttpDownload: (axios: any, requestUrl: string, fileName: string) => void;
26
- /**
27
- * 根据文件地址下载文件
28
- * (网站内部文件或外部图片地址)
29
- * @param {*} sUrl
30
- */
31
- declare function DownloadByUrl({ url, target, fileName }: {
32
- url: string;
33
- target?: '_self' | '_blank';
34
- fileName?: string;
35
- }): Promise<boolean>;
36
- export { Download, SaveAs, JsonDownload, HttpDownload, DownloadByUrl };
1
+ /**
2
+ * 下载文件
3
+ * @param content 文本或二进制文件
4
+ * @param filename 文件名
5
+ */
6
+ declare const Download: (content: string | any, filename: string) => void;
7
+ /**
8
+ * URL方式保存文件到本地
9
+ * @param data 文件的blob数据
10
+ * @param name 文件名
11
+ */
12
+ declare function SaveAs(data: string | any, name: string): void;
13
+ /**
14
+ * JSON对象下载为.json文件
15
+ * @param jsonObject Json对象
16
+ * @param jsonID 名称(不需要后缀名)
17
+ */
18
+ declare const JsonDownload: (jsonObject: object, jsonID: string) => void;
19
+ /**
20
+ * 从Web上下载文件
21
+ * (通过axios下载)
22
+ * @param requestUrl URL下载地址
23
+ * @param fileName 文件名
24
+ */
25
+ declare const HttpDownload: (axios: any, requestUrl: string, fileName: string) => void;
26
+ /**
27
+ * 根据文件地址下载文件
28
+ * (网站内部文件或外部图片地址)
29
+ * @param {*} sUrl
30
+ */
31
+ declare function DownloadByUrl({ url, target, fileName }: {
32
+ url: string;
33
+ target?: '_self' | '_blank';
34
+ fileName?: string;
35
+ }): Promise<boolean>;
36
+ export { Download, SaveAs, JsonDownload, HttpDownload, DownloadByUrl };
@@ -1,90 +1,90 @@
1
- import { XhrHeaders } from 'xhr';
2
- export type FileEventName = 'attempt' | 'attemptFailure' | 'chunkSuccess' | 'error' | 'offline' | 'online' | 'progress' | 'success';
3
- export type AllowedMethods = 'PUT' | 'POST' | 'PATCH';
4
- /**
5
- * 文件上传配置
6
- */
7
- export interface FileUploadOptions {
8
- endpoint: string | ((file?: File) => Promise<string>);
9
- file: File;
10
- method?: AllowedMethods;
11
- headers?: XhrHeaders;
12
- maxFileSize?: number;
13
- chunkSize?: number;
14
- attempts?: number;
15
- /**
16
- * 单位:秒
17
- */
18
- delayBeforeAttempt?: number;
19
- md5?: string;
20
- }
21
- /**
22
- * 文件上传类
23
- */
24
- export declare class FileUpload {
25
- endpoint: string | ((file?: File) => Promise<string>);
26
- file: File;
27
- headers: XhrHeaders;
28
- method: AllowedMethods;
29
- chunkSize: number;
30
- attempts: number;
31
- delayBeforeAttempt: number;
32
- md5: string;
33
- private chunk?;
34
- private chunkCount;
35
- private chunkByteSize;
36
- private maxFileBytes;
37
- private endpointValue?;
38
- private totalChunks;
39
- private attemptCount;
40
- private offline;
41
- private paused;
42
- private success;
43
- private currentXhr?;
44
- private reader;
45
- private eventTarget;
46
- private fileName;
47
- constructor(options: FileUploadOptions);
48
- /**
49
- * 订阅事件
50
- */
51
- on(FileEventName: FileEventName, fn: (event: any) => void): void;
52
- abort(): void;
53
- pause(): void;
54
- resume(): void;
55
- /**
56
- * 发送消息
57
- */
58
- private dispatch;
59
- /**
60
- *验证参数的正确性
61
- */
62
- private validateOptions;
63
- /**
64
- * Endpoint can either be a URL or a function that returns a promise that resolves to a string.
65
- */
66
- private getEndpoint;
67
- /**
68
- * Get portion of the file of x bytes corresponding to chunkSize
69
- */
70
- private getChunk;
71
- private xhrPromise;
72
- /**
73
- * Send chunk of the file with appropriate headers and add post parameters if it's last chunk
74
- */
75
- private sendChunk;
76
- /**
77
- * 失败处理和尝试
78
- */
79
- private manageRetries;
80
- /**
81
- * 进行分片上传,并处理错误和重试
82
- */
83
- private sendChunks;
84
- }
85
- /**
86
- * 创建文件上传对象方法
87
- * @param options
88
- * @returns
89
- */
90
- export declare const createFileUpload: (options: FileUploadOptions) => FileUpload;
1
+ import { XhrHeaders } from 'xhr';
2
+ export type FileEventName = 'attempt' | 'attemptFailure' | 'chunkSuccess' | 'error' | 'offline' | 'online' | 'progress' | 'success';
3
+ export type AllowedMethods = 'PUT' | 'POST' | 'PATCH';
4
+ /**
5
+ * 文件上传配置
6
+ */
7
+ export interface FileUploadOptions {
8
+ endpoint: string | ((file?: File) => Promise<string>);
9
+ file: File;
10
+ method?: AllowedMethods;
11
+ headers?: XhrHeaders;
12
+ maxFileSize?: number;
13
+ chunkSize?: number;
14
+ attempts?: number;
15
+ /**
16
+ * 单位:秒
17
+ */
18
+ delayBeforeAttempt?: number;
19
+ md5?: string;
20
+ }
21
+ /**
22
+ * 文件上传类
23
+ */
24
+ export declare class FileUpload {
25
+ endpoint: string | ((file?: File) => Promise<string>);
26
+ file: File;
27
+ headers: XhrHeaders;
28
+ method: AllowedMethods;
29
+ chunkSize: number;
30
+ attempts: number;
31
+ delayBeforeAttempt: number;
32
+ md5: string;
33
+ private chunk?;
34
+ private chunkCount;
35
+ private chunkByteSize;
36
+ private maxFileBytes;
37
+ private endpointValue?;
38
+ private totalChunks;
39
+ private attemptCount;
40
+ private offline;
41
+ private paused;
42
+ private success;
43
+ private currentXhr?;
44
+ private reader;
45
+ private eventTarget;
46
+ private fileName;
47
+ constructor(options: FileUploadOptions);
48
+ /**
49
+ * 订阅事件
50
+ */
51
+ on(FileEventName: FileEventName, fn: (event: any) => void): void;
52
+ abort(): void;
53
+ pause(): void;
54
+ resume(): void;
55
+ /**
56
+ * 发送消息
57
+ */
58
+ private dispatch;
59
+ /**
60
+ *验证参数的正确性
61
+ */
62
+ private validateOptions;
63
+ /**
64
+ * Endpoint can either be a URL or a function that returns a promise that resolves to a string.
65
+ */
66
+ private getEndpoint;
67
+ /**
68
+ * Get portion of the file of x bytes corresponding to chunkSize
69
+ */
70
+ private getChunk;
71
+ private xhrPromise;
72
+ /**
73
+ * Send chunk of the file with appropriate headers and add post parameters if it's last chunk
74
+ */
75
+ private sendChunk;
76
+ /**
77
+ * 失败处理和尝试
78
+ */
79
+ private manageRetries;
80
+ /**
81
+ * 进行分片上传,并处理错误和重试
82
+ */
83
+ private sendChunks;
84
+ }
85
+ /**
86
+ * 创建文件上传对象方法
87
+ * @param options
88
+ * @returns
89
+ */
90
+ export declare const createFileUpload: (options: FileUploadOptions) => FileUpload;