@whitesev/domutils 1.6.4 → 1.6.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.
@@ -1296,11 +1296,11 @@ export class DOMUtilsEvent {
1296
1296
  selector: K,
1297
1297
  parent?: Element | Document | DocumentFragment | ShadowRoot
1298
1298
  ): HTMLElementTagNameMap[K] | undefined;
1299
- selector<E extends Element = Element>(
1299
+ selector<E extends Element = HTMLElement>(
1300
1300
  selector: string,
1301
1301
  parent?: Element | Document | DocumentFragment | ShadowRoot
1302
1302
  ): E | undefined;
1303
- selector<E extends Element = Element>(
1303
+ selector<E extends Element = HTMLElement>(
1304
1304
  selector: string,
1305
1305
  parent?: Element | Document | DocumentFragment | ShadowRoot
1306
1306
  ) {
@@ -1331,11 +1331,11 @@ export class DOMUtilsEvent {
1331
1331
  selector: K,
1332
1332
  parent?: Element | Document | DocumentFragment | ShadowRoot
1333
1333
  ): HTMLElementTagNameMap[K][];
1334
- selectorAll<E extends Element = Element>(
1334
+ selectorAll<E extends Element = HTMLElement>(
1335
1335
  selector: string,
1336
1336
  parent?: Element | Document | DocumentFragment | ShadowRoot
1337
1337
  ): E[];
1338
- selectorAll<E extends Element = Element>(
1338
+ selectorAll<E extends Element = HTMLElement>(
1339
1339
  selector: string,
1340
1340
  parent?: Element | Document | DocumentFragment | ShadowRoot
1341
1341
  ) {
package/src/WindowApi.ts CHANGED
@@ -8,10 +8,10 @@ export class WindowApi {
8
8
  globalThis: globalThis,
9
9
  self: self,
10
10
  top: top!,
11
- setTimeout: globalThis.setTimeout,
12
- clearTimeout: globalThis.clearTimeout,
13
- setInterval: globalThis.setInterval,
14
- clearInterval: globalThis.clearInterval,
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
15
  };
16
16
  /** 使用的配置 */
17
17
  private api: Required<WindowApiOption>;
@@ -27,8 +27,7 @@ export class WindowApi {
27
27
  if (!option) {
28
28
  option = Object.assign({}, this.defaultApi);
29
29
  }
30
- // @ts-ignore
31
- this.api = Object.assign({}, option);
30
+ this.api = Object.assign({}, option as Required<WindowApiOption>);
32
31
  }
33
32
  get document() {
34
33
  return this.api.document;