@whitesev/utils 1.0.2 → 1.0.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.
Files changed (59) hide show
  1. package/dist/index.amd.js +1814 -6002
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.cjs.js +1430 -5616
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.esm.js +1427 -5611
  7. package/dist/index.esm.js.map +1 -1
  8. package/dist/index.iife.js +1814 -6003
  9. package/dist/index.iife.js.map +1 -1
  10. package/dist/index.system.js +1826 -6017
  11. package/dist/index.system.js.map +1 -1
  12. package/dist/index.umd.js +1814 -6006
  13. package/dist/index.umd.js.map +1 -1
  14. package/dist/src/UtilsCore.d.ts +7 -0
  15. package/dist/src/ajaxHooker/ajaxHooker.d.ts +6 -0
  16. package/dist/src/{Utils.d.ts → index.d.ts} +206 -1
  17. package/index.ts +1 -1
  18. package/package.json +37 -35
  19. package/rollup.config.js +14 -1
  20. package/src/GBKEncoder.ts +2 -0
  21. package/src/UtilsCore.ts +9 -0
  22. package/src/UtilsGMCookie.ts +1 -1
  23. package/src/ajaxHooker/ajaxHooker.js +574 -0
  24. package/src/{Utils.ts → index.ts} +267 -17
  25. package/tsconfig.json +1 -2
  26. package/dist/src/ajaxHooker.d.ts +0 -6
  27. package/src/GBKEncoder.js +0 -111
  28. package/src/ajaxHooker.js +0 -558
  29. package/src/types/DOMUtils.d.ts +0 -188
  30. package/src/types/UtilsCore.d.ts +0 -7
  31. package/src/types/global.d.ts +0 -58
  32. /package/dist/src/{Dictionary.d.ts → Dictionary/Dictionary.d.ts} +0 -0
  33. /package/dist/src/{Hooks.d.ts → Hooks/Hooks.d.ts} +0 -0
  34. /package/dist/src/{Httpx.d.ts → Httpx/Httpx.d.ts} +0 -0
  35. /package/dist/src/{LockFunction.d.ts → LockFunction/LockFunction.d.ts} +0 -0
  36. /package/dist/src/{Log.d.ts → Log/Log.d.ts} +0 -0
  37. /package/dist/src/{Progress.d.ts → Progress/Progress.d.ts} +0 -0
  38. /package/dist/src/{UtilsGMMenu.d.ts → UtilsGMMenu/UtilsGMMenu.d.ts} +0 -0
  39. /package/dist/src/{indexedDB.d.ts → indexedDB/indexedDB.d.ts} +0 -0
  40. /package/dist/src/{tryCatch.d.ts → tryCatch/tryCatch.d.ts} +0 -0
  41. /package/src/{Dictionary.js → Dictionary/Dictionary.js} +0 -0
  42. /package/src/{types/Dictionary.d.ts → Dictionary/index.d.ts} +0 -0
  43. /package/src/{Hooks.js → Hooks/Hooks.js} +0 -0
  44. /package/src/{types/Hook.d.ts → Hooks/index.d.ts} +0 -0
  45. /package/src/{Httpx.js → Httpx/Httpx.js} +0 -0
  46. /package/src/{types/Httpx.d.ts → Httpx/index.d.ts} +0 -0
  47. /package/src/{LockFunction.js → LockFunction/LockFunction.js} +0 -0
  48. /package/src/{types/LockFunction.d.ts → LockFunction/index.d.ts} +0 -0
  49. /package/src/{Log.js → Log/Log.js} +0 -0
  50. /package/src/{types/Log.d.ts → Log/index.d.ts} +0 -0
  51. /package/src/{Progress.js → Progress/Progress.js} +0 -0
  52. /package/src/{types/Progress.d.ts → Progress/index.d.ts} +0 -0
  53. /package/src/{UtilsGMMenu.js → UtilsGMMenu/UtilsGMMenu.js} +0 -0
  54. /package/src/{types/UtilsGMMenu.d.ts → UtilsGMMenu/index.d.ts} +0 -0
  55. /package/src/{types/AjaxHooker.d.ts → ajaxHooker/index.d.ts} +0 -0
  56. /package/src/{types/Indexdb.d.ts → indexedDB/index.d.ts} +0 -0
  57. /package/src/{indexedDB.js → indexedDB/indexedDB.js} +0 -0
  58. /package/src/{types/TryCatch.d.ts → tryCatch/index.d.ts} +0 -0
  59. /package/src/{tryCatch.js → tryCatch/tryCatch.js} +0 -0
@@ -1,188 +0,0 @@
1
- /**
2
- * 鼠标事件
3
- * + https://blog.csdn.net/weixin_68658847/article/details/126939879
4
- */
5
-
6
- 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
- type DOMUtils_MouseEventType = keyof DOMUtils_MouseEvent;
19
- /**
20
- * 鼠标事件
21
- */
22
- interface DOMUtils_KeyboardEvent {
23
- keydown: KeyboardEvent;
24
- keypress: KeyboardEvent;
25
- keyup: KeyboardEvent;
26
- }
27
- type DOMUtils_KeyboardEventType = keyof DOMUtils_KeyboardEvent;
28
- /**
29
- * 框架/对象事件
30
- */
31
- 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
- type DOMUtils_Frame_Object_EventType = keyof DOMUtils_Frame_Object_Event;
44
- /**
45
- * 表单事件
46
- */
47
- 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
- type DOMUtils_FormEventType = keyof DOMUtils_FormEvent;
58
-
59
- /**
60
- * 剪贴板事件
61
- */
62
- interface DOMUtils_ClipboardEvent {
63
- copy: ClipboardEvent;
64
- cut: ClipboardEvent;
65
- paste: ClipboardEvent;
66
- }
67
- type DOMUtils_ClipboardEventType = keyof DOMUtils_ClipboardEvent;
68
-
69
- /**
70
- * 打印事件
71
- */
72
- interface DOMUtils_PrintEvent {
73
- afterprint: Event;
74
- beforeprint: Event;
75
- }
76
- type DOMUtils_PrintEventType = keyof DOMUtils_PrintEvent;
77
-
78
- /**
79
- * 拖动事件
80
- */
81
- 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
- type DOMUtils_DragEventType = keyof DOMUtils_DragEvent;
91
-
92
- /**
93
- * 多媒体(Media)事件
94
- */
95
- 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
- type DOMUtils_MediaEventType = keyof DOMUtils_MediaEvent;
120
-
121
- /**
122
- * 动画事件
123
- */
124
- interface DOMUtils_AnimationEvent {
125
- animationend: AnimationEvent;
126
- animationiteration: AnimationEvent;
127
- animationstart: AnimationEvent;
128
- }
129
- type DOMUtils_AnimationEventType = keyof DOMUtils_AnimationEvent;
130
-
131
- /**
132
- * 过渡事件
133
- */
134
- interface DOMUtils_TransitionEvent {
135
- transitionend: TransitionEvent;
136
- }
137
- type DOMUtils_TransitionEventType = keyof DOMUtils_TransitionEvent;
138
-
139
- /**
140
- * 触摸事件
141
- */
142
- interface DOMUtils_TouchEvent {
143
- touchstart: TouchEvent;
144
- touchmove: TouchEvent;
145
- touchend: TouchEvent;
146
- touchcancel: TouchEvent;
147
- touchenter: TouchEvent;
148
- touchleave: TouchEvent;
149
- }
150
- type DOMUtils_TouchEventType = keyof DOMUtils_TouchEvent;
151
- /**
152
- * 其它事件
153
- */
154
- 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
- type DOMUtils_OtherEventType = keyof DOMUtils_OtherEvent;
168
-
169
- /**
170
- * 全部事件
171
- */
172
- 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
- declare type DOMUtils_EventType = keyof DOMUtils_Event;
@@ -1,7 +0,0 @@
1
- declare interface UtilsCoreOption {
2
- document: Document;
3
- window: Window;
4
- globalThis: typeof globalThis;
5
- self: typeof globalThis;
6
- top: Window;
7
- }
@@ -1,58 +0,0 @@
1
- declare var unsafeWindow: Window & typeof globalThis;
2
-
3
- type JSTypeMap = {
4
- string: string;
5
- number: number;
6
- boolean: boolean;
7
- object: object;
8
- symbol: symbol;
9
- bigint: bigint;
10
- undefined: undefined;
11
- null: null;
12
- };
13
-
14
- type JSTypeNames = keyof JSTypeMap;
15
-
16
- type ArgsType<T extends JSTypeNames[]> = {
17
- [I in keyof T]: JSTypeMap[T[I]];
18
- };
19
-
20
- /**
21
- * 空对象
22
- *
23
- * 类似
24
- * {
25
- * "xxx": string,
26
- * }
27
- */
28
- declare interface UtilsNestedObjectWithToString<V extends any> {
29
- [key: string]: V | NestedObjectWithToString<V>;
30
- toString(): string;
31
- }
32
- declare interface AnyObject {
33
- [key: string]: any | AnyObject;
34
- toString(): string;
35
- }
36
-
37
- declare interface Vue2Context extends AnyObject {
38
- _isVue: true;
39
- $options: UtilsNestedObjectWithToString;
40
- $parent: Vue2Context;
41
- $root: Vue2Context;
42
- $children: Vue2Context[];
43
- $vnode: UtilsNestedObjectWithToString;
44
- $slots: UtilsNestedObjectWithToString;
45
- $scopedSlots: UtilsNestedObjectWithToString;
46
- $attrs: UtilsNestedObjectWithToString;
47
- $listeners: UtilsNestedObjectWithToString;
48
- $store: UtilsNestedObjectWithToString;
49
- $watch: (
50
- key: string | string[],
51
- handler: (this: any, newVal: any, oldVal: any) => void,
52
- options?: {
53
- immediate?: boolean;
54
- deep?: boolean;
55
- }
56
- ) => void;
57
- $el: Element;
58
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes