@whitesev/domutils 1.9.2 → 1.9.3
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/README.md +58 -58
- package/dist/index.amd.js +40 -22
- package/dist/index.amd.js.map +1 -1
- package/dist/index.amd.min.js +1 -1
- package/dist/index.amd.min.js.map +1 -1
- package/dist/index.cjs.js +40 -22
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +40 -22
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +40 -22
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.system.js +40 -22
- package/dist/index.system.js.map +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/dist/index.umd.js +40 -22
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/types/DOMUtilsCSSProperty.d.ts +36 -36
- package/dist/types/src/types/DOMUtilsEvent.d.ts +420 -420
- package/dist/types/src/types/WindowApi.d.ts +14 -14
- package/dist/types/src/types/env.d.ts +10 -10
- package/dist/types/src/types/global.d.ts +1 -1
- package/dist/types/src/types/gm.d.ts +2 -2
- package/index.ts +3 -3
- package/package.json +21 -22
- package/src/CommonUtils.ts +163 -163
- package/src/ElementAnimate.ts +290 -290
- package/src/ElementEvent.ts +1569 -1569
- package/src/ElementHandler.ts +43 -43
- package/src/ElementSelector.ts +307 -289
- package/src/ElementWait.ts +742 -742
- package/src/GlobalData.ts +5 -5
- package/src/OriginPrototype.ts +5 -5
- package/src/Utils.ts +388 -388
- package/src/WindowApi.ts +59 -59
- package/src/index.ts +2052 -2052
- package/src/types/DOMUtilsCSSProperty.d.ts +36 -36
- package/src/types/DOMUtilsEvent.d.ts +420 -420
- package/src/types/WindowApi.d.ts +14 -14
- package/src/types/env.d.ts +10 -10
- package/src/types/global.d.ts +1 -1
- package/src/types/gm.d.ts +2 -2
package/src/WindowApi.ts
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import type { WindowApiOption } from "./types/WindowApi";
|
|
2
|
-
|
|
3
|
-
export class WindowApi {
|
|
4
|
-
/** 默认的配置 */
|
|
5
|
-
private defaultApi: Required<WindowApiOption> = {
|
|
6
|
-
document: document,
|
|
7
|
-
window: window,
|
|
8
|
-
globalThis: globalThis,
|
|
9
|
-
self: self,
|
|
10
|
-
top: top!,
|
|
11
|
-
setTimeout: globalThis.setTimeout.bind(globalThis),
|
|
12
|
-
setInterval: globalThis.setInterval.bind(globalThis),
|
|
13
|
-
clearTimeout: globalThis.clearTimeout.bind(globalThis),
|
|
14
|
-
clearInterval: globalThis.clearInterval.bind(globalThis),
|
|
15
|
-
};
|
|
16
|
-
/** 使用的配置 */
|
|
17
|
-
private api: Required<WindowApiOption>;
|
|
18
|
-
constructor(option?: WindowApiOption) {
|
|
19
|
-
if (option) {
|
|
20
|
-
if (option.globalThis == null) {
|
|
21
|
-
option.globalThis = option.window;
|
|
22
|
-
}
|
|
23
|
-
if (option.self == null) {
|
|
24
|
-
option.self = option.window;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
if (!option) {
|
|
28
|
-
option = Object.assign({}, this.defaultApi);
|
|
29
|
-
}
|
|
30
|
-
this.api = Object.assign({}, option as Required<WindowApiOption>);
|
|
31
|
-
}
|
|
32
|
-
get document() {
|
|
33
|
-
return this.api.document;
|
|
34
|
-
}
|
|
35
|
-
get window() {
|
|
36
|
-
return this.api.window;
|
|
37
|
-
}
|
|
38
|
-
get globalThis() {
|
|
39
|
-
return this.api.globalThis;
|
|
40
|
-
}
|
|
41
|
-
get self() {
|
|
42
|
-
return this.api.self;
|
|
43
|
-
}
|
|
44
|
-
get top() {
|
|
45
|
-
return this.api.top;
|
|
46
|
-
}
|
|
47
|
-
get setTimeout() {
|
|
48
|
-
return this.api.setTimeout;
|
|
49
|
-
}
|
|
50
|
-
get clearTimeout() {
|
|
51
|
-
return this.api.clearTimeout;
|
|
52
|
-
}
|
|
53
|
-
get setInterval() {
|
|
54
|
-
return this.api.setInterval;
|
|
55
|
-
}
|
|
56
|
-
get clearInterval() {
|
|
57
|
-
return this.api.clearInterval;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
1
|
+
import type { WindowApiOption } from "./types/WindowApi";
|
|
2
|
+
|
|
3
|
+
export class WindowApi {
|
|
4
|
+
/** 默认的配置 */
|
|
5
|
+
private defaultApi: Required<WindowApiOption> = {
|
|
6
|
+
document: document,
|
|
7
|
+
window: window,
|
|
8
|
+
globalThis: globalThis,
|
|
9
|
+
self: self,
|
|
10
|
+
top: top!,
|
|
11
|
+
setTimeout: globalThis.setTimeout.bind(globalThis),
|
|
12
|
+
setInterval: globalThis.setInterval.bind(globalThis),
|
|
13
|
+
clearTimeout: globalThis.clearTimeout.bind(globalThis),
|
|
14
|
+
clearInterval: globalThis.clearInterval.bind(globalThis),
|
|
15
|
+
};
|
|
16
|
+
/** 使用的配置 */
|
|
17
|
+
private api: Required<WindowApiOption>;
|
|
18
|
+
constructor(option?: WindowApiOption) {
|
|
19
|
+
if (option) {
|
|
20
|
+
if (option.globalThis == null) {
|
|
21
|
+
option.globalThis = option.window;
|
|
22
|
+
}
|
|
23
|
+
if (option.self == null) {
|
|
24
|
+
option.self = option.window;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (!option) {
|
|
28
|
+
option = Object.assign({}, this.defaultApi);
|
|
29
|
+
}
|
|
30
|
+
this.api = Object.assign({}, option as Required<WindowApiOption>);
|
|
31
|
+
}
|
|
32
|
+
get document() {
|
|
33
|
+
return this.api.document;
|
|
34
|
+
}
|
|
35
|
+
get window() {
|
|
36
|
+
return this.api.window;
|
|
37
|
+
}
|
|
38
|
+
get globalThis() {
|
|
39
|
+
return this.api.globalThis;
|
|
40
|
+
}
|
|
41
|
+
get self() {
|
|
42
|
+
return this.api.self;
|
|
43
|
+
}
|
|
44
|
+
get top() {
|
|
45
|
+
return this.api.top;
|
|
46
|
+
}
|
|
47
|
+
get setTimeout() {
|
|
48
|
+
return this.api.setTimeout;
|
|
49
|
+
}
|
|
50
|
+
get clearTimeout() {
|
|
51
|
+
return this.api.clearTimeout;
|
|
52
|
+
}
|
|
53
|
+
get setInterval() {
|
|
54
|
+
return this.api.setInterval;
|
|
55
|
+
}
|
|
56
|
+
get clearInterval() {
|
|
57
|
+
return this.api.clearInterval;
|
|
58
|
+
}
|
|
59
|
+
}
|