@whitesev/utils 2.8.0 → 2.8.2

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 (71) hide show
  1. package/README.md +176 -176
  2. package/dist/index.amd.js +896 -875
  3. package/dist/index.amd.js.map +1 -1
  4. package/dist/index.cjs.js +896 -875
  5. package/dist/index.cjs.js.map +1 -1
  6. package/dist/index.esm.js +896 -875
  7. package/dist/index.esm.js.map +1 -1
  8. package/dist/index.iife.js +896 -875
  9. package/dist/index.iife.js.map +1 -1
  10. package/dist/index.system.js +896 -875
  11. package/dist/index.system.js.map +1 -1
  12. package/dist/index.umd.js +896 -875
  13. package/dist/index.umd.js.map +1 -1
  14. package/dist/types/src/CommonUtil.d.ts +59 -59
  15. package/dist/types/src/DOMUtils.d.ts +1 -1
  16. package/dist/types/src/Dictionary.d.ts +1 -1
  17. package/dist/types/src/Httpx.d.ts +2 -2
  18. package/dist/types/src/Progress.d.ts +0 -4
  19. package/dist/types/src/TryCatch.d.ts +2 -2
  20. package/dist/types/src/Utils.d.ts +365 -365
  21. package/dist/types/src/UtilsGMCookie.d.ts +2 -2
  22. package/dist/types/src/UtilsGMMenu.d.ts +1 -1
  23. package/dist/types/src/indexedDB.d.ts +3 -3
  24. package/dist/types/src/types/Event.d.ts +188 -188
  25. package/dist/types/src/types/Httpx.d.ts +1344 -1343
  26. package/dist/types/src/types/Log.d.ts +19 -19
  27. package/dist/types/src/types/Progress.d.ts +20 -20
  28. package/dist/types/src/types/React.d.ts +119 -119
  29. package/dist/types/src/types/TryCatch.d.ts +9 -9
  30. package/dist/types/src/types/UtilsGMCookie.d.ts +93 -93
  31. package/dist/types/src/types/UtilsGMMenu.d.ts +77 -77
  32. package/dist/types/src/types/Vue2.d.ts +166 -166
  33. package/dist/types/src/types/WindowApi.d.ts +14 -14
  34. package/dist/types/src/types/ajaxHooker.d.ts +151 -151
  35. package/dist/types/src/types/env.d.ts +7 -2
  36. package/dist/types/src/types/global.d.ts +31 -31
  37. package/index.ts +3 -0
  38. package/package.json +19 -8
  39. package/src/ColorConversion.ts +105 -106
  40. package/src/CommonUtil.ts +280 -279
  41. package/src/DOMUtils.ts +251 -272
  42. package/src/Dictionary.ts +153 -154
  43. package/src/GBKEncoder.ts +108 -112
  44. package/src/Hooks.ts +73 -81
  45. package/src/Httpx.ts +1457 -1466
  46. package/src/LockFunction.ts +62 -62
  47. package/src/Log.ts +258 -259
  48. package/src/ModuleRaid.js +1 -0
  49. package/src/Progress.ts +108 -114
  50. package/src/TryCatch.ts +86 -86
  51. package/src/Utils.ts +4773 -4825
  52. package/src/UtilsCommon.ts +14 -14
  53. package/src/UtilsGMCookie.ts +254 -261
  54. package/src/UtilsGMMenu.ts +445 -454
  55. package/src/Vue.ts +233 -229
  56. package/src/WindowApi.ts +59 -59
  57. package/src/ajaxHooker/ajaxHooker.js +1 -0
  58. package/src/indexedDB.ts +497 -502
  59. package/src/types/Event.d.ts +188 -188
  60. package/src/types/Httpx.d.ts +1344 -1343
  61. package/src/types/Log.d.ts +19 -19
  62. package/src/types/Progress.d.ts +20 -20
  63. package/src/types/React.d.ts +119 -119
  64. package/src/types/TryCatch.d.ts +9 -9
  65. package/src/types/UtilsGMCookie.d.ts +93 -93
  66. package/src/types/UtilsGMMenu.d.ts +77 -77
  67. package/src/types/Vue2.d.ts +166 -166
  68. package/src/types/WindowApi.d.ts +14 -14
  69. package/src/types/ajaxHooker.d.ts +151 -151
  70. package/src/types/env.d.ts +7 -2
  71. package/src/types/global.d.ts +31 -31
@@ -18,12 +18,12 @@ export declare class UtilsGMCookie {
18
18
  * + cookies object[]
19
19
  * + error string|undefined
20
20
  **/
21
- list(option: UtilsGMCookieListOptions | {}, callback?: (data: UtilsGMCookieResult[], error?: Error) => void): void;
21
+ list(option: UtilsGMCookieListOptions | object, callback?: (data: UtilsGMCookieResult[], error?: Error) => void): void;
22
22
  /**
23
23
  * 获取多组Cookie
24
24
  * @param option 配置
25
25
  **/
26
- getList(option: UtilsGMCookieListOptions | {}): UtilsGMCookieResult[];
26
+ getList(option: UtilsGMCookieListOptions | object): UtilsGMCookieResult[];
27
27
  /**
28
28
  * 设置Cookie
29
29
  * @param option 配置
@@ -76,7 +76,7 @@ export declare class GMMenu {
76
76
  * 根据键值获取callback函数
77
77
  * @param menuKey 菜单-键key
78
78
  */
79
- getCallBack(menuKey: string): Function | undefined;
79
+ getCallBack(menuKey: string): ((...args: any[]) => any) | undefined;
80
80
  /**
81
81
  * 获取当enable为true时默认显示在菜单中前面的emoji图标
82
82
  */
@@ -22,7 +22,7 @@ export declare class indexedDB {
22
22
  * @param key 数据key
23
23
  * @param value 数据值
24
24
  */
25
- save<T extends any>(key: string, value: T): Promise<{
25
+ save<T = any>(key: string, value: T): Promise<{
26
26
  /** 本操作是否成功 */
27
27
  success: boolean;
28
28
  /** 状态码 */
@@ -56,7 +56,7 @@ export declare class indexedDB {
56
56
  * 根据key获取值
57
57
  * @param key 数据key
58
58
  */
59
- get<T extends any>(key: string): Promise<{
59
+ get<T = any>(key: string): Promise<{
60
60
  /** 本操作是否成功 */
61
61
  success: boolean;
62
62
  /** 状态码 */
@@ -80,7 +80,7 @@ export declare class indexedDB {
80
80
  * 正则获取数据
81
81
  * @param key 数据key,可以是正则
82
82
  */
83
- regexpGet<T extends any>(key: string | RegExp): Promise<{
83
+ regexpGet<T = any>(key: string | RegExp): Promise<{
84
84
  /** 本操作是否成功 */
85
85
  success: boolean;
86
86
  /** 状态码 */
@@ -1,188 +1,188 @@
1
- /**
2
- * 鼠标事件
3
- * + https://blog.csdn.net/weixin_68658847/article/details/126939879
4
- */
5
-
6
- declare interface DOMUtils_MouseEvent {
7
- click: MouseEvent | PointerEvent;
8
- contextmenu: MouseEvent | PointerEvent;
9
- dblclick: MouseEvent | PointerEvent;
10
- mousedown: MouseEvent | PointerEvent;
11
- mouseenter: MouseEvent | PointerEvent;
12
- mouseleave: MouseEvent | PointerEvent;
13
- mousemove: MouseEvent | PointerEvent;
14
- mouseover: MouseEvent | PointerEvent;
15
- mouseout: MouseEvent | PointerEvent;
16
- mouseup: MouseEvent | PointerEvent;
17
- }
18
- declare type DOMUtils_MouseEventType = keyof DOMUtils_MouseEvent;
19
- /**
20
- * 鼠标事件
21
- */
22
- declare interface DOMUtils_KeyboardEvent {
23
- keydown: KeyboardEvent;
24
- keypress: KeyboardEvent;
25
- keyup: KeyboardEvent;
26
- }
27
- declare type DOMUtils_KeyboardEventType = keyof DOMUtils_KeyboardEvent;
28
- /**
29
- * 框架/对象事件
30
- */
31
- declare interface DOMUtils_Frame_Object_Event {
32
- abort: Event;
33
- beforeunload: Event;
34
- error: Event;
35
- hashchange: Event;
36
- load: Event;
37
- pageshow: Event;
38
- pagehide: Event;
39
- resize: Event;
40
- scroll: Event;
41
- unload: Event;
42
- }
43
- declare type DOMUtils_Frame_Object_EventType = keyof DOMUtils_Frame_Object_Event;
44
- /**
45
- * 表单事件
46
- */
47
- declare interface DOMUtils_FormEvent {
48
- blur: Event;
49
- change: Event;
50
- focus: Event;
51
- focusin: Event;
52
- focusout: Event;
53
- input: Event;
54
- reset: Event;
55
- search: Event;
56
- }
57
- declare type DOMUtils_FormEventType = keyof DOMUtils_FormEvent;
58
-
59
- /**
60
- * 剪贴板事件
61
- */
62
- declare interface DOMUtils_ClipboardEvent {
63
- copy: ClipboardEvent;
64
- cut: ClipboardEvent;
65
- paste: ClipboardEvent;
66
- }
67
- declare type DOMUtils_ClipboardEventType = keyof DOMUtils_ClipboardEvent;
68
-
69
- /**
70
- * 打印事件
71
- */
72
- declare interface DOMUtils_PrintEvent {
73
- afterprint: Event;
74
- beforeprint: Event;
75
- }
76
- declare type DOMUtils_PrintEventType = keyof DOMUtils_PrintEvent;
77
-
78
- /**
79
- * 拖动事件
80
- */
81
- declare interface DOMUtils_DragEvent {
82
- drag: DragEvent;
83
- dragend: DragEvent;
84
- dragenter: DragEvent;
85
- dragleave: DragEvent;
86
- dragover: DragEvent;
87
- dragstart: DragEvent;
88
- drop: DragEvent;
89
- }
90
- declare type DOMUtils_DragEventType = keyof DOMUtils_DragEvent;
91
-
92
- /**
93
- * 多媒体(Media)事件
94
- */
95
- declare interface DOMUtils_MediaEvent {
96
- abort: Event;
97
- canplay: Event;
98
- canplaythrough: Event;
99
- durationchange: Event;
100
- emptied: Event;
101
- ended: Event;
102
- error: Event;
103
- loadeddata: Event;
104
- loadedmetadata: Event;
105
- loadstart: Event;
106
- pause: Event;
107
- play: Event;
108
- playing: Event;
109
- progress: Event;
110
- ratechange: Event;
111
- seeked: Event;
112
- seeking: Event;
113
- stalled: Event;
114
- suspend: Event;
115
- timeupdate: Event;
116
- volumechange: Event;
117
- waiting: Event;
118
- }
119
- declare type DOMUtils_MediaEventType = keyof DOMUtils_MediaEvent;
120
-
121
- /**
122
- * 动画事件
123
- */
124
- declare interface DOMUtils_AnimationEvent {
125
- animationend: AnimationEvent;
126
- animationiteration: AnimationEvent;
127
- animationstart: AnimationEvent;
128
- }
129
- declare type DOMUtils_AnimationEventType = keyof DOMUtils_AnimationEvent;
130
-
131
- /**
132
- * 过渡事件
133
- */
134
- declare interface DOMUtils_TransitionEvent {
135
- transitionend: TransitionEvent;
136
- }
137
- declare type DOMUtils_TransitionEventType = keyof DOMUtils_TransitionEvent;
138
-
139
- /**
140
- * 触摸事件
141
- */
142
- declare interface DOMUtils_TouchEvent {
143
- touchstart: TouchEvent;
144
- touchmove: TouchEvent;
145
- touchend: TouchEvent;
146
- touchcancel: TouchEvent;
147
- touchenter: TouchEvent;
148
- touchleave: TouchEvent;
149
- }
150
- declare type DOMUtils_TouchEventType = keyof DOMUtils_TouchEvent;
151
- /**
152
- * 其它事件
153
- */
154
- declare interface DOMUtils_OtherEvent {
155
- message: Event;
156
- online: Event;
157
- offline: Event;
158
- popstate: Event;
159
- show: Event;
160
- storage: Event;
161
- toggle: Event;
162
- wheel: Event;
163
- propertychange: Event;
164
- fullscreenchange: Event;
165
- DOMContentLoaded: Event;
166
- }
167
- declare type DOMUtils_OtherEventType = keyof DOMUtils_OtherEvent;
168
-
169
- /**
170
- * 全部事件
171
- */
172
- export declare type DOMUtils_Event = DOMUtils_MouseEvent &
173
- DOMUtils_KeyboardEvent &
174
- DOMUtils_Frame_Object_Event &
175
- DOMUtils_FormEvent &
176
- DOMUtils_ClipboardEvent &
177
- DOMUtils_PrintEvent &
178
- DOMUtils_DragEvent &
179
- DOMUtils_MediaEvent &
180
- DOMUtils_AnimationEvent &
181
- DOMUtils_TransitionEvent &
182
- DOMUtils_TouchEvent &
183
- DOMUtils_OtherEvent;
184
-
185
- /**
186
- * 事件类型
187
- */
188
- export declare type DOMUtils_EventType = keyof DOMUtils_Event;
1
+ /**
2
+ * 鼠标事件
3
+ * + https://blog.csdn.net/weixin_68658847/article/details/126939879
4
+ */
5
+
6
+ declare interface DOMUtils_MouseEvent {
7
+ click: MouseEvent | PointerEvent;
8
+ contextmenu: MouseEvent | PointerEvent;
9
+ dblclick: MouseEvent | PointerEvent;
10
+ mousedown: MouseEvent | PointerEvent;
11
+ mouseenter: MouseEvent | PointerEvent;
12
+ mouseleave: MouseEvent | PointerEvent;
13
+ mousemove: MouseEvent | PointerEvent;
14
+ mouseover: MouseEvent | PointerEvent;
15
+ mouseout: MouseEvent | PointerEvent;
16
+ mouseup: MouseEvent | PointerEvent;
17
+ }
18
+ declare type DOMUtils_MouseEventType = keyof DOMUtils_MouseEvent;
19
+ /**
20
+ * 鼠标事件
21
+ */
22
+ declare interface DOMUtils_KeyboardEvent {
23
+ keydown: KeyboardEvent;
24
+ keypress: KeyboardEvent;
25
+ keyup: KeyboardEvent;
26
+ }
27
+ declare type DOMUtils_KeyboardEventType = keyof DOMUtils_KeyboardEvent;
28
+ /**
29
+ * 框架/对象事件
30
+ */
31
+ declare interface DOMUtils_Frame_Object_Event {
32
+ abort: Event;
33
+ beforeunload: Event;
34
+ error: Event;
35
+ hashchange: Event;
36
+ load: Event;
37
+ pageshow: Event;
38
+ pagehide: Event;
39
+ resize: Event;
40
+ scroll: Event;
41
+ unload: Event;
42
+ }
43
+ declare type DOMUtils_Frame_Object_EventType = keyof DOMUtils_Frame_Object_Event;
44
+ /**
45
+ * 表单事件
46
+ */
47
+ declare interface DOMUtils_FormEvent {
48
+ blur: Event;
49
+ change: Event;
50
+ focus: Event;
51
+ focusin: Event;
52
+ focusout: Event;
53
+ input: Event;
54
+ reset: Event;
55
+ search: Event;
56
+ }
57
+ declare type DOMUtils_FormEventType = keyof DOMUtils_FormEvent;
58
+
59
+ /**
60
+ * 剪贴板事件
61
+ */
62
+ declare interface DOMUtils_ClipboardEvent {
63
+ copy: ClipboardEvent;
64
+ cut: ClipboardEvent;
65
+ paste: ClipboardEvent;
66
+ }
67
+ declare type DOMUtils_ClipboardEventType = keyof DOMUtils_ClipboardEvent;
68
+
69
+ /**
70
+ * 打印事件
71
+ */
72
+ declare interface DOMUtils_PrintEvent {
73
+ afterprint: Event;
74
+ beforeprint: Event;
75
+ }
76
+ declare type DOMUtils_PrintEventType = keyof DOMUtils_PrintEvent;
77
+
78
+ /**
79
+ * 拖动事件
80
+ */
81
+ declare interface DOMUtils_DragEvent {
82
+ drag: DragEvent;
83
+ dragend: DragEvent;
84
+ dragenter: DragEvent;
85
+ dragleave: DragEvent;
86
+ dragover: DragEvent;
87
+ dragstart: DragEvent;
88
+ drop: DragEvent;
89
+ }
90
+ declare type DOMUtils_DragEventType = keyof DOMUtils_DragEvent;
91
+
92
+ /**
93
+ * 多媒体(Media)事件
94
+ */
95
+ declare interface DOMUtils_MediaEvent {
96
+ abort: Event;
97
+ canplay: Event;
98
+ canplaythrough: Event;
99
+ durationchange: Event;
100
+ emptied: Event;
101
+ ended: Event;
102
+ error: Event;
103
+ loadeddata: Event;
104
+ loadedmetadata: Event;
105
+ loadstart: Event;
106
+ pause: Event;
107
+ play: Event;
108
+ playing: Event;
109
+ progress: Event;
110
+ ratechange: Event;
111
+ seeked: Event;
112
+ seeking: Event;
113
+ stalled: Event;
114
+ suspend: Event;
115
+ timeupdate: Event;
116
+ volumechange: Event;
117
+ waiting: Event;
118
+ }
119
+ declare type DOMUtils_MediaEventType = keyof DOMUtils_MediaEvent;
120
+
121
+ /**
122
+ * 动画事件
123
+ */
124
+ declare interface DOMUtils_AnimationEvent {
125
+ animationend: AnimationEvent;
126
+ animationiteration: AnimationEvent;
127
+ animationstart: AnimationEvent;
128
+ }
129
+ declare type DOMUtils_AnimationEventType = keyof DOMUtils_AnimationEvent;
130
+
131
+ /**
132
+ * 过渡事件
133
+ */
134
+ declare interface DOMUtils_TransitionEvent {
135
+ transitionend: TransitionEvent;
136
+ }
137
+ declare type DOMUtils_TransitionEventType = keyof DOMUtils_TransitionEvent;
138
+
139
+ /**
140
+ * 触摸事件
141
+ */
142
+ declare interface DOMUtils_TouchEvent {
143
+ touchstart: TouchEvent;
144
+ touchmove: TouchEvent;
145
+ touchend: TouchEvent;
146
+ touchcancel: TouchEvent;
147
+ touchenter: TouchEvent;
148
+ touchleave: TouchEvent;
149
+ }
150
+ declare type DOMUtils_TouchEventType = keyof DOMUtils_TouchEvent;
151
+ /**
152
+ * 其它事件
153
+ */
154
+ declare interface DOMUtils_OtherEvent {
155
+ message: Event;
156
+ online: Event;
157
+ offline: Event;
158
+ popstate: Event;
159
+ show: Event;
160
+ storage: Event;
161
+ toggle: Event;
162
+ wheel: Event;
163
+ propertychange: Event;
164
+ fullscreenchange: Event;
165
+ DOMContentLoaded: Event;
166
+ }
167
+ declare type DOMUtils_OtherEventType = keyof DOMUtils_OtherEvent;
168
+
169
+ /**
170
+ * 全部事件
171
+ */
172
+ export declare type DOMUtils_Event = DOMUtils_MouseEvent &
173
+ DOMUtils_KeyboardEvent &
174
+ DOMUtils_Frame_Object_Event &
175
+ DOMUtils_FormEvent &
176
+ DOMUtils_ClipboardEvent &
177
+ DOMUtils_PrintEvent &
178
+ DOMUtils_DragEvent &
179
+ DOMUtils_MediaEvent &
180
+ DOMUtils_AnimationEvent &
181
+ DOMUtils_TransitionEvent &
182
+ DOMUtils_TouchEvent &
183
+ DOMUtils_OtherEvent;
184
+
185
+ /**
186
+ * 事件类型
187
+ */
188
+ export declare type DOMUtils_EventType = keyof DOMUtils_Event;