happy-dom 2.54.0 → 3.1.0
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.
Potentially problematic release.
This version of happy-dom might be problematic. Click here for more details.
- package/README.md +26 -6
- package/lib/async-task-manager/AsyncTaskManager.js +34 -78
- package/lib/async-task-manager/AsyncTaskManager.js.map +1 -1
- package/lib/attribute/Attr.js +19 -28
- package/lib/attribute/Attr.js.map +1 -1
- package/lib/config/ElementTag.d.ts +2 -1
- package/lib/config/ElementTag.js +16 -15
- package/lib/config/ElementTag.js.map +1 -1
- package/lib/config/NonImplemenetedElementClasses.js +0 -1
- package/lib/config/NonImplemenetedElementClasses.js.map +1 -1
- package/lib/cookie/CookieUtility.js +21 -26
- package/lib/cookie/CookieUtility.js.map +1 -1
- package/lib/css/CSS.js +12 -18
- package/lib/css/CSS.js.map +1 -1
- package/lib/css/CSSParser.js +29 -33
- package/lib/css/CSSParser.js.map +1 -1
- package/lib/css/CSSRule.js +24 -29
- package/lib/css/CSSRule.js.map +1 -1
- package/lib/css/CSSStyleDeclaration.js +4516 -6005
- package/lib/css/CSSStyleDeclaration.js.map +1 -1
- package/lib/css/CSSStyleSheet.js +17 -59
- package/lib/css/CSSStyleSheet.js.map +1 -1
- package/lib/css/CSSUnitValue.js +4 -5
- package/lib/css/CSSUnitValue.js.map +1 -1
- package/lib/css/MediaList.js +23 -28
- package/lib/css/MediaList.js.map +1 -1
- package/lib/css/rules/CSSFontFaceRule.js +6 -24
- package/lib/css/rules/CSSFontFaceRule.js.map +1 -1
- package/lib/css/rules/CSSKeyframeRule.js +14 -36
- package/lib/css/rules/CSSKeyframeRule.js.map +1 -1
- package/lib/css/rules/CSSKeyframesRule.js +31 -54
- package/lib/css/rules/CSSKeyframesRule.js.map +1 -1
- package/lib/css/rules/CSSMediaRule.js +29 -56
- package/lib/css/rules/CSSMediaRule.js.map +1 -1
- package/lib/css/rules/CSSStyleRule.js +16 -38
- package/lib/css/rules/CSSStyleRule.js.map +1 -1
- package/lib/custom-element/CustomElementRegistry.js +21 -24
- package/lib/custom-element/CustomElementRegistry.js.map +1 -1
- package/lib/dom-implementation/DOMImplementation.js +12 -13
- package/lib/dom-implementation/DOMImplementation.js.map +1 -1
- package/lib/dom-parser/DOMParser.js +29 -35
- package/lib/dom-parser/DOMParser.js.map +1 -1
- package/lib/dom-token-list/DOMTokenList.js +64 -79
- package/lib/dom-token-list/DOMTokenList.js.map +1 -1
- package/lib/event/DataTransfer.js +4 -5
- package/lib/event/DataTransfer.js.map +1 -1
- package/lib/event/DataTransferItem.js +7 -8
- package/lib/event/DataTransferItem.js.map +1 -1
- package/lib/event/DataTransferItemList.js +10 -11
- package/lib/event/DataTransferItemList.js.map +1 -1
- package/lib/event/Event.js +11 -15
- package/lib/event/Event.js.map +1 -1
- package/lib/event/EventTarget.js +14 -16
- package/lib/event/EventTarget.js.map +1 -1
- package/lib/event/IUIEventInit.d.ts +2 -2
- package/lib/event/UIEvent.d.ts +2 -2
- package/lib/event/UIEvent.js +25 -46
- package/lib/event/UIEvent.js.map +1 -1
- package/lib/event/events/AnimationEvent.js +11 -29
- package/lib/event/events/AnimationEvent.js.map +1 -1
- package/lib/event/events/CustomEvent.js +9 -31
- package/lib/event/events/CustomEvent.js.map +1 -1
- package/lib/event/events/ErrorEvent.js +15 -34
- package/lib/event/events/ErrorEvent.js.map +1 -1
- package/lib/event/events/FocusEvent.js +7 -26
- package/lib/event/events/FocusEvent.js.map +1 -1
- package/lib/event/events/InputEvent.js +13 -32
- package/lib/event/events/InputEvent.js.map +1 -1
- package/lib/event/events/KeyboardEvent.js +27 -46
- package/lib/event/events/KeyboardEvent.js.map +1 -1
- package/lib/event/events/MouseEvent.js +33 -52
- package/lib/event/events/MouseEvent.js.map +1 -1
- package/lib/event/events/PointerEvent.js +25 -44
- package/lib/event/events/PointerEvent.js.map +1 -1
- package/lib/event/events/ProgressEvent.js +11 -30
- package/lib/event/events/ProgressEvent.js.map +1 -1
- package/lib/event/events/StorageEvent.js +13 -32
- package/lib/event/events/StorageEvent.js.map +1 -1
- package/lib/event/events/WheelEvent.js +16 -35
- package/lib/event/events/WheelEvent.js.map +1 -1
- package/lib/exception/DOMException.js +5 -24
- package/lib/exception/DOMException.js.map +1 -1
- package/lib/fetch/FetchHandler.js +18 -22
- package/lib/fetch/FetchHandler.js.map +1 -1
- package/lib/fetch/Headers.js +3 -23
- package/lib/fetch/Headers.js.map +1 -1
- package/lib/fetch/Request.js +61 -81
- package/lib/fetch/Request.js.map +1 -1
- package/lib/fetch/ResourceFetchHandler.js +18 -67
- package/lib/fetch/ResourceFetchHandler.js.map +1 -1
- package/lib/fetch/Response.js +61 -81
- package/lib/fetch/Response.js.map +1 -1
- package/lib/file/Blob.js +29 -78
- package/lib/file/Blob.js.map +1 -1
- package/lib/file/File.js +9 -27
- package/lib/file/File.js.map +1 -1
- package/lib/file/FileReader.js +57 -78
- package/lib/file/FileReader.js.map +1 -1
- package/lib/history/History.js +32 -37
- package/lib/history/History.js.map +1 -1
- package/lib/index.d.ts +5 -3
- package/lib/index.js +71 -69
- package/lib/index.js.map +1 -1
- package/lib/location/Location.js +11 -28
- package/lib/location/Location.js.map +1 -1
- package/lib/location/RelativeURL.js +5 -8
- package/lib/location/RelativeURL.js.map +1 -1
- package/lib/location/URL.js +46 -59
- package/lib/location/URL.js.map +1 -1
- package/lib/match-media/MediaQueryList.js +28 -54
- package/lib/match-media/MediaQueryList.js.map +1 -1
- package/lib/mutation-observer/MutationListener.js +3 -4
- package/lib/mutation-observer/MutationListener.js.map +1 -1
- package/lib/mutation-observer/MutationObserver.js +12 -13
- package/lib/mutation-observer/MutationObserver.js.map +1 -1
- package/lib/mutation-observer/MutationRecord.js +3 -4
- package/lib/mutation-observer/MutationRecord.js.map +1 -1
- package/lib/navigator/MimeType.js +5 -6
- package/lib/navigator/MimeType.js.map +1 -1
- package/lib/navigator/MimeTypeArray.js +10 -11
- package/lib/navigator/MimeTypeArray.js.map +1 -1
- package/lib/navigator/Navigator.js +7 -8
- package/lib/navigator/Navigator.js.map +1 -1
- package/lib/navigator/Plugin.js +10 -11
- package/lib/navigator/Plugin.js.map +1 -1
- package/lib/navigator/PluginArray.js +12 -13
- package/lib/navigator/PluginArray.js.map +1 -1
- package/lib/nodes/character-data/CharacterData.js +119 -184
- package/lib/nodes/character-data/CharacterData.js.map +1 -1
- package/lib/nodes/character-data/CharacterDataUtility.js +12 -15
- package/lib/nodes/character-data/CharacterDataUtility.js.map +1 -1
- package/lib/nodes/child-node/ChildNodeUtility.js +24 -45
- package/lib/nodes/child-node/ChildNodeUtility.js.map +1 -1
- package/lib/nodes/child-node/NonDocumentChildNodeUtility.js +9 -12
- package/lib/nodes/child-node/NonDocumentChildNodeUtility.js.map +1 -1
- package/lib/nodes/comment/Comment.js +20 -43
- package/lib/nodes/comment/Comment.js.map +1 -1
- package/lib/nodes/document/Document.d.ts +3 -3
- package/lib/nodes/document/Document.js +334 -461
- package/lib/nodes/document/Document.js.map +1 -1
- package/lib/nodes/document/DocumentReadyStateManager.js +16 -19
- package/lib/nodes/document/DocumentReadyStateManager.js.map +1 -1
- package/lib/nodes/document/IDocument.d.ts +2 -2
- package/lib/nodes/document-fragment/DocumentFragment.js +93 -153
- package/lib/nodes/document-fragment/DocumentFragment.js.map +1 -1
- package/lib/nodes/document-type/DocumentType.js +22 -45
- package/lib/nodes/document-type/DocumentType.js.map +1 -1
- package/lib/nodes/element/DOMRect.js +3 -4
- package/lib/nodes/element/DOMRect.js.map +1 -1
- package/lib/nodes/element/Element.js +367 -496
- package/lib/nodes/element/Element.js.map +1 -1
- package/lib/nodes/element/HTMLCollection.js +4 -24
- package/lib/nodes/element/HTMLCollection.js.map +1 -1
- package/lib/nodes/element/HTMLCollectionFactory.js +6 -9
- package/lib/nodes/element/HTMLCollectionFactory.js.map +1 -1
- package/lib/nodes/element/Range.js +89 -114
- package/lib/nodes/element/Range.js.map +1 -1
- package/lib/nodes/html-base-element/HTMLBaseElement.d.ts +42 -0
- package/lib/nodes/html-base-element/HTMLBaseElement.js +62 -0
- package/lib/nodes/html-base-element/HTMLBaseElement.js.map +1 -0
- package/lib/nodes/html-base-element/IHTMLBaseElement.d.ts +19 -0
- package/lib/nodes/html-base-element/IHTMLBaseElement.js +3 -0
- package/lib/nodes/html-base-element/IHTMLBaseElement.js.map +1 -0
- package/lib/nodes/html-document/HTMLDocument.js +3 -23
- package/lib/nodes/html-document/HTMLDocument.js.map +1 -1
- package/lib/nodes/html-element/DatasetUtility.js +9 -12
- package/lib/nodes/html-element/DatasetUtility.js.map +1 -1
- package/lib/nodes/html-element/HTMLElement.js +232 -290
- package/lib/nodes/html-element/HTMLElement.js.map +1 -1
- package/lib/nodes/html-form-element/HTMLFormElement.js +170 -235
- package/lib/nodes/html-form-element/HTMLFormElement.js.map +1 -1
- package/lib/nodes/html-image-element/HTMLImageElement.js +178 -237
- package/lib/nodes/html-image-element/HTMLImageElement.js.map +1 -1
- package/lib/nodes/html-image-element/Image.js +7 -27
- package/lib/nodes/html-image-element/Image.js.map +1 -1
- package/lib/nodes/html-input-element/HTMLInputElement.js +705 -872
- package/lib/nodes/html-input-element/HTMLInputElement.js.map +1 -1
- package/lib/nodes/html-input-element/HTMLInputElementValueSanitizer.js +9 -12
- package/lib/nodes/html-input-element/HTMLInputElementValueSanitizer.js.map +1 -1
- package/lib/nodes/html-input-element/HTMLInputElementValueStepping.js +5 -8
- package/lib/nodes/html-input-element/HTMLInputElementValueStepping.js.map +1 -1
- package/lib/nodes/html-input-element/ValidityState.js +47 -69
- package/lib/nodes/html-input-element/ValidityState.js.map +1 -1
- package/lib/nodes/html-label-element/HTMLLabelElement.js +53 -87
- package/lib/nodes/html-label-element/HTMLLabelElement.js.map +1 -1
- package/lib/nodes/html-link-element/HTMLLinkElement.js +197 -252
- package/lib/nodes/html-link-element/HTMLLinkElement.js.map +1 -1
- package/lib/nodes/html-meta-element/HTMLMetaElement.js +66 -102
- package/lib/nodes/html-meta-element/HTMLMetaElement.js.map +1 -1
- package/lib/nodes/html-script-element/HTMLScriptElement.js +145 -193
- package/lib/nodes/html-script-element/HTMLScriptElement.js.map +1 -1
- package/lib/nodes/html-script-element/ScriptUtility.js +58 -112
- package/lib/nodes/html-script-element/ScriptUtility.js.map +1 -1
- package/lib/nodes/html-slot-element/HTMLSlotElement.js +33 -65
- package/lib/nodes/html-slot-element/HTMLSlotElement.js.map +1 -1
- package/lib/nodes/html-style-element/HTMLStyleElement.js +75 -109
- package/lib/nodes/html-style-element/HTMLStyleElement.js.map +1 -1
- package/lib/nodes/html-template-element/HTMLTemplateElement.js +60 -99
- package/lib/nodes/html-template-element/HTMLTemplateElement.js.map +1 -1
- package/lib/nodes/html-text-area-element/HTMLTextAreaElement.js +349 -444
- package/lib/nodes/html-text-area-element/HTMLTextAreaElement.js.map +1 -1
- package/lib/nodes/html-unknown-element/HTMLUnknownElement.js +17 -37
- package/lib/nodes/html-unknown-element/HTMLUnknownElement.js.map +1 -1
- package/lib/nodes/node/INode.d.ts +1 -0
- package/lib/nodes/node/Node.d.ts +6 -0
- package/lib/nodes/node/Node.js +193 -244
- package/lib/nodes/node/Node.js.map +1 -1
- package/lib/nodes/node/NodeList.js +4 -24
- package/lib/nodes/node/NodeList.js.map +1 -1
- package/lib/nodes/node/NodeListFactory.js +6 -9
- package/lib/nodes/node/NodeListFactory.js.map +1 -1
- package/lib/nodes/parent-node/ParentNodeUtility.js +43 -78
- package/lib/nodes/parent-node/ParentNodeUtility.js.map +1 -1
- package/lib/nodes/shadow-root/ShadowRoot.js +53 -83
- package/lib/nodes/shadow-root/ShadowRoot.js.map +1 -1
- package/lib/nodes/svg-document/SVGDocument.js +3 -23
- package/lib/nodes/svg-document/SVGDocument.js.map +1 -1
- package/lib/nodes/svg-element/DOMMatrix.js +3 -4
- package/lib/nodes/svg-element/DOMMatrix.js.map +1 -1
- package/lib/nodes/svg-element/SVGAngle.js +10 -11
- package/lib/nodes/svg-element/SVGAngle.js.map +1 -1
- package/lib/nodes/svg-element/SVGAnimatedRect.js +4 -5
- package/lib/nodes/svg-element/SVGAnimatedRect.js.map +1 -1
- package/lib/nodes/svg-element/SVGElement.js +58 -93
- package/lib/nodes/svg-element/SVGElement.js.map +1 -1
- package/lib/nodes/svg-element/SVGGraphicsElement.js +14 -32
- package/lib/nodes/svg-element/SVGGraphicsElement.js.map +1 -1
- package/lib/nodes/svg-element/SVGLength.js +16 -17
- package/lib/nodes/svg-element/SVGLength.js.map +1 -1
- package/lib/nodes/svg-element/SVGNumber.js +3 -4
- package/lib/nodes/svg-element/SVGNumber.js.map +1 -1
- package/lib/nodes/svg-element/SVGPoint.js +3 -4
- package/lib/nodes/svg-element/SVGPoint.js.map +1 -1
- package/lib/nodes/svg-element/SVGRect.js +3 -4
- package/lib/nodes/svg-element/SVGRect.js.map +1 -1
- package/lib/nodes/svg-element/SVGSVGElement.js +187 -248
- package/lib/nodes/svg-element/SVGSVGElement.js.map +1 -1
- package/lib/nodes/svg-element/SVGTransform.js +16 -17
- package/lib/nodes/svg-element/SVGTransform.js.map +1 -1
- package/lib/nodes/text/Text.js +20 -43
- package/lib/nodes/text/Text.js.map +1 -1
- package/lib/nodes/xml-document/XMLDocument.js +3 -23
- package/lib/nodes/xml-document/XMLDocument.js.map +1 -1
- package/lib/query-selector/QuerySelector.js +36 -44
- package/lib/query-selector/QuerySelector.js.map +1 -1
- package/lib/query-selector/SelectorItem.js +62 -66
- package/lib/query-selector/SelectorItem.js.map +1 -1
- package/lib/resize-observer/ResizeObserver.js +8 -11
- package/lib/resize-observer/ResizeObserver.js.map +1 -1
- package/lib/screen/Screen.js +3 -4
- package/lib/screen/Screen.js.map +1 -1
- package/lib/selection/Selection.js +29 -30
- package/lib/selection/Selection.js.map +1 -1
- package/lib/storage/Storage.js +22 -27
- package/lib/storage/Storage.js.map +1 -1
- package/lib/tree-walker/NodeFilterMask.js +1 -1
- package/lib/tree-walker/NodeFilterMask.js.map +1 -1
- package/lib/tree-walker/TreeWalker.js +30 -33
- package/lib/tree-walker/TreeWalker.js.map +1 -1
- package/lib/window/GlobalWindow.d.ts +84 -0
- package/lib/window/GlobalWindow.js +90 -0
- package/lib/window/GlobalWindow.js.map +1 -0
- package/lib/window/IWindow.d.ts +37 -18
- package/lib/window/VMGlobalPropertyScript.d.ts +2 -0
- package/lib/window/VMGlobalPropertyScript.js +65 -0
- package/lib/window/VMGlobalPropertyScript.js.map +1 -0
- package/lib/window/Window.d.ts +78 -105
- package/lib/window/Window.js +277 -489
- package/lib/window/Window.js.map +1 -1
- package/lib/xml-parser/XMLParser.js +65 -71
- package/lib/xml-parser/XMLParser.js.map +1 -1
- package/lib/xml-serializer/XMLSerializer.js +30 -37
- package/lib/xml-serializer/XMLSerializer.js.map +1 -1
- package/package.json +6 -7
- package/src/config/ElementTag.ts +2 -1
- package/src/config/NonImplemenetedElementClasses.ts +0 -1
- package/src/dom-parser/DOMParser.ts +4 -5
- package/src/event/IUIEventInit.ts +2 -2
- package/src/event/UIEvent.ts +2 -2
- package/src/fetch/FetchHandler.ts +3 -3
- package/src/fetch/ResourceFetchHandler.ts +3 -3
- package/src/index.ts +7 -3
- package/src/nodes/document/Document.ts +4 -4
- package/src/nodes/document/IDocument.ts +2 -2
- package/src/nodes/html-base-element/HTMLBaseElement.ts +61 -0
- package/src/nodes/html-base-element/IHTMLBaseElement.ts +21 -0
- package/src/nodes/html-link-element/HTMLLinkElement.ts +8 -2
- package/src/nodes/html-script-element/ScriptUtility.ts +4 -4
- package/src/nodes/node/INode.ts +1 -0
- package/src/nodes/node/Node.ts +14 -0
- package/src/window/GlobalWindow.ts +82 -0
- package/src/window/IWindow.ts +33 -12
- package/src/window/VMGlobalPropertyScript.ts +62 -0
- package/src/window/Window.ts +115 -173
- package/tsconfig.json +1 -1
- package/lib/window/AsyncWindow.d.ts +0 -10
- package/lib/window/AsyncWindow.js +0 -38
- package/lib/window/AsyncWindow.js.map +0 -1
- package/src/window/AsyncWindow.ts +0 -17
@@ -0,0 +1,84 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import Window from './Window';
|
3
|
+
/**
|
4
|
+
* Browser window.
|
5
|
+
*
|
6
|
+
* Reference:
|
7
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/Window.
|
8
|
+
*/
|
9
|
+
export default class GlobalWindow extends Window {
|
10
|
+
ArrayBuffer: ArrayBufferConstructor;
|
11
|
+
Boolean: BooleanConstructor;
|
12
|
+
Buffer: typeof Buffer;
|
13
|
+
DataView: DataViewConstructor;
|
14
|
+
Date: DateConstructor;
|
15
|
+
Error: ErrorConstructor;
|
16
|
+
EvalError: EvalErrorConstructor;
|
17
|
+
Float32Array: Float32ArrayConstructor;
|
18
|
+
Float64Array: Float64ArrayConstructor;
|
19
|
+
GLOBAL: any;
|
20
|
+
Infinity: number;
|
21
|
+
Int16Array: Int16ArrayConstructor;
|
22
|
+
Int32Array: Int32ArrayConstructor;
|
23
|
+
Int8Array: Int8ArrayConstructor;
|
24
|
+
Intl: typeof Intl;
|
25
|
+
JSON: JSON;
|
26
|
+
Map: MapConstructor;
|
27
|
+
Math: Math;
|
28
|
+
NaN: number;
|
29
|
+
Number: NumberConstructor;
|
30
|
+
Promise: PromiseConstructor;
|
31
|
+
RangeError: RangeErrorConstructor;
|
32
|
+
ReferenceError: ReferenceErrorConstructor;
|
33
|
+
RegExp: RegExpConstructor;
|
34
|
+
Reflect: ArrayBufferConstructor;
|
35
|
+
Set: SetConstructor;
|
36
|
+
Symbol: SymbolConstructor;
|
37
|
+
SyntaxError: SyntaxErrorConstructor;
|
38
|
+
String: StringConstructor;
|
39
|
+
TypeError: TypeErrorConstructor;
|
40
|
+
URIError: URIErrorConstructor;
|
41
|
+
Uint16Array: Uint16ArrayConstructor;
|
42
|
+
Uint32Array: Uint32ArrayConstructor;
|
43
|
+
Uint8Array: Uint8ArrayConstructor;
|
44
|
+
Uint8ClampedArray: Uint8ClampedArrayConstructor;
|
45
|
+
WeakMap: WeakMapConstructor;
|
46
|
+
WeakSet: WeakSetConstructor;
|
47
|
+
clearImmediate: typeof clearImmediate;
|
48
|
+
decodeURI: typeof decodeURI;
|
49
|
+
decodeURIComponent: typeof decodeURIComponent;
|
50
|
+
encodeURI: typeof encodeURI;
|
51
|
+
encodeURIComponent: typeof encodeURIComponent;
|
52
|
+
escape: typeof escape;
|
53
|
+
global: NodeJS.Global & typeof globalThis;
|
54
|
+
isFinite: typeof isFinite;
|
55
|
+
isNaN: typeof isNaN;
|
56
|
+
parseFloat: typeof parseFloat;
|
57
|
+
parseInt: typeof parseInt;
|
58
|
+
process: NodeJS.Process;
|
59
|
+
root: ArrayBufferConstructor;
|
60
|
+
setImmediate: typeof setImmediate;
|
61
|
+
queueMicrotask: typeof queueMicrotask;
|
62
|
+
undefined: ArrayBufferConstructor;
|
63
|
+
unescape: typeof unescape;
|
64
|
+
gc: any;
|
65
|
+
v8debug: any;
|
66
|
+
AbortController: {
|
67
|
+
new (): AbortController;
|
68
|
+
prototype: AbortController;
|
69
|
+
};
|
70
|
+
AbortSignal: {
|
71
|
+
new (): AbortSignal;
|
72
|
+
prototype: AbortSignal;
|
73
|
+
};
|
74
|
+
Array: ArrayConstructor;
|
75
|
+
Object: ObjectConstructor;
|
76
|
+
Function: FunctionConstructor;
|
77
|
+
/**
|
78
|
+
* Evaluates code.
|
79
|
+
*
|
80
|
+
* @param code Code.
|
81
|
+
* @returns Result.
|
82
|
+
*/
|
83
|
+
eval(code: string): unknown;
|
84
|
+
}
|
@@ -0,0 +1,90 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const Window_1 = __importDefault(require("./Window"));
|
7
|
+
/**
|
8
|
+
* Browser window.
|
9
|
+
*
|
10
|
+
* Reference:
|
11
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/Window.
|
12
|
+
*/
|
13
|
+
class GlobalWindow extends Window_1.default {
|
14
|
+
constructor() {
|
15
|
+
super(...arguments);
|
16
|
+
// Node.js Globals
|
17
|
+
this.ArrayBuffer = globalThis.ArrayBuffer;
|
18
|
+
this.Boolean = globalThis.Boolean;
|
19
|
+
this.Buffer = globalThis.global ? globalThis.global.Buffer : Buffer;
|
20
|
+
this.DataView = globalThis.DataView;
|
21
|
+
this.Date = globalThis.Date;
|
22
|
+
this.Error = globalThis.Error;
|
23
|
+
this.EvalError = globalThis.EvalError;
|
24
|
+
this.Float32Array = globalThis.Float32Array;
|
25
|
+
this.Float64Array = globalThis.Float64Array;
|
26
|
+
this.GLOBAL = globalThis.GLOBAL;
|
27
|
+
this.Infinity = globalThis.Infinity;
|
28
|
+
this.Int16Array = globalThis.Int16Array;
|
29
|
+
this.Int32Array = globalThis.Int32Array;
|
30
|
+
this.Int8Array = globalThis.Int8Array;
|
31
|
+
this.Intl = globalThis.Intl;
|
32
|
+
this.JSON = globalThis.JSON;
|
33
|
+
this.Map = globalThis.Map;
|
34
|
+
this.Math = globalThis.Math;
|
35
|
+
this.NaN = globalThis.NaN;
|
36
|
+
this.Number = globalThis.Number;
|
37
|
+
this.Promise = globalThis.Promise;
|
38
|
+
this.RangeError = globalThis.RangeError;
|
39
|
+
this.ReferenceError = globalThis.ReferenceError;
|
40
|
+
this.RegExp = globalThis.RegExp;
|
41
|
+
this.Reflect = globalThis.ArrayBuffer;
|
42
|
+
this.Set = globalThis.Set;
|
43
|
+
this.Symbol = globalThis.Symbol;
|
44
|
+
this.SyntaxError = globalThis.SyntaxError;
|
45
|
+
this.String = globalThis.String;
|
46
|
+
this.TypeError = globalThis.TypeError;
|
47
|
+
this.URIError = globalThis.URIError;
|
48
|
+
this.Uint16Array = globalThis.Uint16Array;
|
49
|
+
this.Uint32Array = globalThis.Uint32Array;
|
50
|
+
this.Uint8Array = globalThis.Uint8Array;
|
51
|
+
this.Uint8ClampedArray = globalThis.Uint8ClampedArray;
|
52
|
+
this.WeakMap = globalThis.WeakMap;
|
53
|
+
this.WeakSet = globalThis.WeakSet;
|
54
|
+
this.clearImmediate = globalThis.clearImmediate;
|
55
|
+
this.decodeURI = globalThis.decodeURI;
|
56
|
+
this.decodeURIComponent = globalThis.decodeURIComponent;
|
57
|
+
this.encodeURI = globalThis.encodeURI;
|
58
|
+
this.encodeURIComponent = globalThis.encodeURIComponent;
|
59
|
+
this.escape = globalThis.escape;
|
60
|
+
this.global = globalThis.global;
|
61
|
+
this.isFinite = globalThis.isFinite;
|
62
|
+
this.isNaN = globalThis.isNaN;
|
63
|
+
this.parseFloat = globalThis.parseFloat;
|
64
|
+
this.parseInt = globalThis.parseInt;
|
65
|
+
this.process = globalThis.process;
|
66
|
+
this.root = globalThis.ArrayBuffer;
|
67
|
+
this.setImmediate = globalThis.setImmediate;
|
68
|
+
this.queueMicrotask = globalThis.queueMicrotask;
|
69
|
+
this.undefined = globalThis.ArrayBuffer;
|
70
|
+
this.unescape = globalThis.unescape;
|
71
|
+
this.gc = globalThis.gc;
|
72
|
+
this.v8debug = globalThis.v8debug;
|
73
|
+
this.AbortController = globalThis.AbortController;
|
74
|
+
this.AbortSignal = globalThis.AbortSignal;
|
75
|
+
this.Array = globalThis.Array;
|
76
|
+
this.Object = globalThis.Object;
|
77
|
+
this.Function = globalThis.Function;
|
78
|
+
}
|
79
|
+
/**
|
80
|
+
* Evaluates code.
|
81
|
+
*
|
82
|
+
* @param code Code.
|
83
|
+
* @returns Result.
|
84
|
+
*/
|
85
|
+
eval(code) {
|
86
|
+
return eval(code);
|
87
|
+
}
|
88
|
+
}
|
89
|
+
exports.default = GlobalWindow;
|
90
|
+
//# sourceMappingURL=GlobalWindow.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"GlobalWindow.js","sourceRoot":"","sources":["../../src/window/GlobalWindow.ts"],"names":[],"mappings":"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"}
|
package/lib/window/IWindow.d.ts
CHANGED
@@ -12,6 +12,7 @@ import Element from '../nodes/element/Element';
|
|
12
12
|
import HTMLTemplateElement from '../nodes/html-template-element/HTMLTemplateElement';
|
13
13
|
import HTMLFormElement from '../nodes/html-form-element/HTMLFormElement';
|
14
14
|
import HTMLElement from '../nodes/html-element/HTMLElement';
|
15
|
+
import IHTMLElement from '../nodes/html-element/IHTMLElement';
|
15
16
|
import HTMLUnknownElement from '../nodes/html-unknown-element/HTMLUnknownElement';
|
16
17
|
import HTMLInputElement from '../nodes/html-input-element/HTMLInputElement';
|
17
18
|
import HTMLTextAreaElement from '../nodes/html-text-area-element/HTMLTextAreaElement';
|
@@ -20,6 +21,7 @@ import HTMLStyleElement from '../nodes/html-style-element/HTMLStyleElement';
|
|
20
21
|
import HTMLSlotElement from '../nodes/html-slot-element/HTMLSlotElement';
|
21
22
|
import HTMLLabelElement from '../nodes/html-label-element/HTMLLabelElement';
|
22
23
|
import HTMLMetaElement from '../nodes/html-meta-element/HTMLMetaElement';
|
24
|
+
import HTMLBaseElement from '../nodes/html-base-element/HTMLBaseElement';
|
23
25
|
import SVGSVGElement from '../nodes/svg-element/SVGSVGElement';
|
24
26
|
import SVGElement from '../nodes/svg-element/SVGElement';
|
25
27
|
import HTMLScriptElement from '../nodes/html-script-element/HTMLScriptElement';
|
@@ -62,14 +64,8 @@ import ErrorEvent from '../event/events/ErrorEvent';
|
|
62
64
|
import StorageEvent from '../event/events/StorageEvent';
|
63
65
|
import Screen from '../screen/Screen';
|
64
66
|
import AsyncTaskManager from '../async-task-manager/AsyncTaskManager';
|
65
|
-
import IResponse from '../fetch/IResponse';
|
66
|
-
import IResponseInit from '../fetch/IResponseInit';
|
67
|
-
import IRequest from '../fetch/IRequest';
|
68
|
-
import IRequestInit from '../fetch/IRequestInit';
|
69
|
-
import IHeaders from '../fetch/IHeaders';
|
70
67
|
import Storage from '../storage/Storage';
|
71
68
|
import NodeFilter from '../tree-walker/NodeFilter';
|
72
|
-
import Window from './Window';
|
73
69
|
import HTMLCollection from '../nodes/element/HTMLCollection';
|
74
70
|
import NodeList from '../nodes/node/NodeList';
|
75
71
|
import Selection from '../selection/Selection';
|
@@ -79,11 +75,19 @@ import MimeType from '../navigator/MimeType';
|
|
79
75
|
import MimeTypeArray from '../navigator/MimeTypeArray';
|
80
76
|
import Plugin from '../navigator/Plugin';
|
81
77
|
import PluginArray from '../navigator/PluginArray';
|
78
|
+
import IResponseInit from '../fetch/IResponseInit';
|
79
|
+
import IRequest from '../fetch/IRequest';
|
80
|
+
import IHeaders from '../fetch/IHeaders';
|
81
|
+
import IRequestInit from '../fetch/IRequestInit';
|
82
|
+
import IResponse from '../fetch/IResponse';
|
83
|
+
import MediaQueryList from '../match-media/MediaQueryList';
|
84
|
+
import Window from './Window';
|
82
85
|
import { URLSearchParams } from 'url';
|
86
|
+
import { Performance } from 'perf_hooks';
|
83
87
|
/**
|
84
|
-
* Window.
|
88
|
+
* Window without dependencies to server side specific packages.
|
85
89
|
*/
|
86
|
-
export default interface IWindow extends IEventTarget {
|
90
|
+
export default interface IWindow extends IEventTarget, NodeJS.Global {
|
87
91
|
readonly happyDOM: {
|
88
92
|
whenAsyncComplete: () => Promise<void>;
|
89
93
|
cancelAsync: () => void;
|
@@ -103,6 +107,7 @@ export default interface IWindow extends IEventTarget {
|
|
103
107
|
readonly HTMLSlotElement: typeof HTMLSlotElement;
|
104
108
|
readonly HTMLLabelElement: typeof HTMLLabelElement;
|
105
109
|
readonly HTMLMetaElement: typeof HTMLMetaElement;
|
110
|
+
readonly HTMLBaseElement: typeof HTMLBaseElement;
|
106
111
|
readonly SVGSVGElement: typeof SVGSVGElement;
|
107
112
|
readonly SVGElement: typeof SVGElement;
|
108
113
|
readonly Image: typeof Image;
|
@@ -141,15 +146,6 @@ export default interface IWindow extends IEventTarget {
|
|
141
146
|
readonly Location: typeof Location;
|
142
147
|
readonly CustomElementRegistry: typeof CustomElementRegistry;
|
143
148
|
readonly Window: typeof Window;
|
144
|
-
readonly Headers: {
|
145
|
-
new (init?: string[][] | Record<string, string> | IHeaders): IHeaders;
|
146
|
-
};
|
147
|
-
readonly Request: {
|
148
|
-
new (input: string | IRequest, init?: IRequestInit): IRequest;
|
149
|
-
};
|
150
|
-
readonly Response: {
|
151
|
-
new (body?: unknown | null, init?: IResponseInit): IResponse;
|
152
|
-
};
|
153
149
|
readonly XMLSerializer: typeof XMLSerializer;
|
154
150
|
readonly ResizeObserver: typeof ResizeObserver;
|
155
151
|
readonly CSSStyleSheet: typeof CSSStyleSheet;
|
@@ -171,6 +167,15 @@ export default interface IWindow extends IEventTarget {
|
|
171
167
|
readonly MimeTypeArray: typeof MimeTypeArray;
|
172
168
|
readonly Plugin: typeof Plugin;
|
173
169
|
readonly PluginArray: typeof PluginArray;
|
170
|
+
readonly Headers: {
|
171
|
+
new (init?: string[][] | Record<string, string> | IHeaders): IHeaders;
|
172
|
+
};
|
173
|
+
readonly Request: {
|
174
|
+
new (input: string | IRequest, init?: IRequestInit): IRequest;
|
175
|
+
};
|
176
|
+
readonly Response: {
|
177
|
+
new (body?: unknown | null, init?: IResponseInit): IResponse;
|
178
|
+
};
|
174
179
|
onload: (event: Event) => void;
|
175
180
|
onerror: (event: ErrorEvent) => void;
|
176
181
|
readonly document: Document;
|
@@ -189,6 +194,7 @@ export default interface IWindow extends IEventTarget {
|
|
189
194
|
readonly innerHeight: number;
|
190
195
|
readonly sessionStorage: Storage;
|
191
196
|
readonly localStorage: Storage;
|
197
|
+
readonly performance: Performance;
|
192
198
|
/**
|
193
199
|
* Evaluates code.
|
194
200
|
*
|
@@ -202,7 +208,13 @@ export default interface IWindow extends IEventTarget {
|
|
202
208
|
* @param element Element.
|
203
209
|
* @returns CSS style declaration.
|
204
210
|
*/
|
205
|
-
getComputedStyle(element:
|
211
|
+
getComputedStyle(element: IHTMLElement): CSSStyleDeclaration;
|
212
|
+
/**
|
213
|
+
* Returns selection.
|
214
|
+
*
|
215
|
+
* @returns Selection.
|
216
|
+
*/
|
217
|
+
getSelection(): Selection;
|
206
218
|
/**
|
207
219
|
* Scrolls to a particular set of coordinates.
|
208
220
|
*
|
@@ -225,6 +237,13 @@ export default interface IWindow extends IEventTarget {
|
|
225
237
|
left?: number;
|
226
238
|
behavior?: string;
|
227
239
|
} | number, y?: number): void;
|
240
|
+
/**
|
241
|
+
* Returns a new MediaQueryList object that can then be used to determine if the document matches the media query string.
|
242
|
+
*
|
243
|
+
* @param mediaQueryString A string specifying the media query to parse into a MediaQueryList.
|
244
|
+
* @returns A new MediaQueryList.
|
245
|
+
*/
|
246
|
+
matchMedia(mediaQueryString: string): MediaQueryList;
|
228
247
|
/**
|
229
248
|
* Sets a timer which executes a function once the timer expires.
|
230
249
|
*
|
@@ -0,0 +1,2 @@
|
|
1
|
+
declare const _default: "\nthis.ArrayBuffer = globalThis.ArrayBuffer;\nthis.Boolean = globalThis.Boolean;\nthis.DataView = globalThis.DataView;\nthis.Date = globalThis.Date;\nthis.Error = globalThis.Error;\nthis.EvalError = globalThis.EvalError;\nthis.Float32Array = globalThis.Float32Array;\nthis.Float64Array = globalThis.Float64Array;\nthis.GLOBAL = globalThis.GLOBAL;\nthis.Infinity = globalThis.Infinity;\nthis.Int16Array = globalThis.Int16Array;\nthis.Int32Array = globalThis.Int32Array;\nthis.Int8Array = globalThis.Int8Array;\nthis.Intl = globalThis.Intl;\nthis.JSON = globalThis.JSON;\nthis.Map = globalThis.Map;\nthis.Math = globalThis.Math;\nthis.NaN = globalThis.NaN;\nthis.Number = globalThis.Number;\nthis.Promise = globalThis.Promise;\nthis.RangeError = globalThis.RangeError;\nthis.ReferenceError = globalThis.ReferenceError;\nthis.RegExp = globalThis.RegExp;\nthis.Reflect = globalThis.Reflect;\nthis.Set = globalThis.Set;\nthis.Symbol = globalThis.Symbol;\nthis.SyntaxError = globalThis.SyntaxError;\nthis.String = globalThis.String;\nthis.TypeError = globalThis.TypeError;\nthis.URIError = globalThis.URIError;\nthis.Uint16Array = globalThis.Uint16Array;\nthis.Uint32Array = globalThis.Uint32Array;\nthis.Uint8Array = globalThis.Uint8Array;\nthis.Uint8ClampedArray = globalThis.Uint8ClampedArray;\nthis.WeakMap = globalThis.WeakMap;\nthis.WeakSet = globalThis.WeakSet;\nthis.clearImmediate = globalThis.clearImmediate;\nthis.decodeURI = globalThis.decodeURI;\nthis.decodeURIComponent = globalThis.decodeURIComponent;\nthis.encodeURI = globalThis.encodeURI;\nthis.encodeURIComponent = globalThis.encodeURIComponent;\nthis.escape = globalThis.escape;\nthis.global = globalThis.global;\nthis.isFinite = globalThis.isFinite;\nthis.isNaN = globalThis.isNaN;\nthis.parseFloat = globalThis.parseFloat;\nthis.parseInt = globalThis.parseInt;\nthis.process = globalThis.process;\nthis.root = globalThis.root;\nthis.setImmediate = globalThis.setImmediate;\nthis.queueMicrotask = globalThis.queueMicrotask;\nthis.undefined = globalThis.undefined;\nthis.unescape = globalThis.unescape;\nthis.gc = globalThis.gc;\nthis.v8debug = globalThis.v8debug;\nthis.AbortController = globalThis.AbortController;\nthis.AbortSignal = globalThis.AbortSignal;\nthis.Array = globalThis.Array;\nthis.Object = globalThis.Object;\nthis.Function = globalThis.Function;\n";
|
2
|
+
export default _default;
|
@@ -0,0 +1,65 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.default = `
|
4
|
+
this.ArrayBuffer = globalThis.ArrayBuffer;
|
5
|
+
this.Boolean = globalThis.Boolean;
|
6
|
+
this.DataView = globalThis.DataView;
|
7
|
+
this.Date = globalThis.Date;
|
8
|
+
this.Error = globalThis.Error;
|
9
|
+
this.EvalError = globalThis.EvalError;
|
10
|
+
this.Float32Array = globalThis.Float32Array;
|
11
|
+
this.Float64Array = globalThis.Float64Array;
|
12
|
+
this.GLOBAL = globalThis.GLOBAL;
|
13
|
+
this.Infinity = globalThis.Infinity;
|
14
|
+
this.Int16Array = globalThis.Int16Array;
|
15
|
+
this.Int32Array = globalThis.Int32Array;
|
16
|
+
this.Int8Array = globalThis.Int8Array;
|
17
|
+
this.Intl = globalThis.Intl;
|
18
|
+
this.JSON = globalThis.JSON;
|
19
|
+
this.Map = globalThis.Map;
|
20
|
+
this.Math = globalThis.Math;
|
21
|
+
this.NaN = globalThis.NaN;
|
22
|
+
this.Number = globalThis.Number;
|
23
|
+
this.Promise = globalThis.Promise;
|
24
|
+
this.RangeError = globalThis.RangeError;
|
25
|
+
this.ReferenceError = globalThis.ReferenceError;
|
26
|
+
this.RegExp = globalThis.RegExp;
|
27
|
+
this.Reflect = globalThis.Reflect;
|
28
|
+
this.Set = globalThis.Set;
|
29
|
+
this.Symbol = globalThis.Symbol;
|
30
|
+
this.SyntaxError = globalThis.SyntaxError;
|
31
|
+
this.String = globalThis.String;
|
32
|
+
this.TypeError = globalThis.TypeError;
|
33
|
+
this.URIError = globalThis.URIError;
|
34
|
+
this.Uint16Array = globalThis.Uint16Array;
|
35
|
+
this.Uint32Array = globalThis.Uint32Array;
|
36
|
+
this.Uint8Array = globalThis.Uint8Array;
|
37
|
+
this.Uint8ClampedArray = globalThis.Uint8ClampedArray;
|
38
|
+
this.WeakMap = globalThis.WeakMap;
|
39
|
+
this.WeakSet = globalThis.WeakSet;
|
40
|
+
this.clearImmediate = globalThis.clearImmediate;
|
41
|
+
this.decodeURI = globalThis.decodeURI;
|
42
|
+
this.decodeURIComponent = globalThis.decodeURIComponent;
|
43
|
+
this.encodeURI = globalThis.encodeURI;
|
44
|
+
this.encodeURIComponent = globalThis.encodeURIComponent;
|
45
|
+
this.escape = globalThis.escape;
|
46
|
+
this.global = globalThis.global;
|
47
|
+
this.isFinite = globalThis.isFinite;
|
48
|
+
this.isNaN = globalThis.isNaN;
|
49
|
+
this.parseFloat = globalThis.parseFloat;
|
50
|
+
this.parseInt = globalThis.parseInt;
|
51
|
+
this.process = globalThis.process;
|
52
|
+
this.root = globalThis.root;
|
53
|
+
this.setImmediate = globalThis.setImmediate;
|
54
|
+
this.queueMicrotask = globalThis.queueMicrotask;
|
55
|
+
this.undefined = globalThis.undefined;
|
56
|
+
this.unescape = globalThis.unescape;
|
57
|
+
this.gc = globalThis.gc;
|
58
|
+
this.v8debug = globalThis.v8debug;
|
59
|
+
this.AbortController = globalThis.AbortController;
|
60
|
+
this.AbortSignal = globalThis.AbortSignal;
|
61
|
+
this.Array = globalThis.Array;
|
62
|
+
this.Object = globalThis.Object;
|
63
|
+
this.Function = globalThis.Function;
|
64
|
+
`;
|
65
|
+
//# sourceMappingURL=VMGlobalPropertyScript.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"VMGlobalPropertyScript.js","sourceRoot":"","sources":["../../src/window/VMGlobalPropertyScript.ts"],"names":[],"mappings":";;AAAA,kBAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6Dd,CAAC"}
|
package/lib/window/Window.d.ts
CHANGED
@@ -20,6 +20,7 @@ import HTMLStyleElement from '../nodes/html-style-element/HTMLStyleElement';
|
|
20
20
|
import HTMLSlotElement from '../nodes/html-slot-element/HTMLSlotElement';
|
21
21
|
import HTMLLabelElement from '../nodes/html-label-element/HTMLLabelElement';
|
22
22
|
import HTMLMetaElement from '../nodes/html-meta-element/HTMLMetaElement';
|
23
|
+
import HTMLBaseElement from '../nodes/html-base-element/HTMLBaseElement';
|
23
24
|
import SVGSVGElement from '../nodes/svg-element/SVGSVGElement';
|
24
25
|
import SVGElement from '../nodes/svg-element/SVGElement';
|
25
26
|
import HTMLScriptElement from '../nodes/html-script-element/HTMLScriptElement';
|
@@ -74,17 +75,20 @@ import HTMLCollection from '../nodes/element/HTMLCollection';
|
|
74
75
|
import NodeList from '../nodes/node/NodeList';
|
75
76
|
import MediaQueryList from '../match-media/MediaQueryList';
|
76
77
|
import Selection from '../selection/Selection';
|
77
|
-
import * as PerfHooks from 'perf_hooks';
|
78
78
|
import Navigator from '../navigator/Navigator';
|
79
79
|
import MimeType from '../navigator/MimeType';
|
80
80
|
import MimeTypeArray from '../navigator/MimeTypeArray';
|
81
81
|
import Plugin from '../navigator/Plugin';
|
82
82
|
import PluginArray from '../navigator/PluginArray';
|
83
83
|
import { URLSearchParams } from 'url';
|
84
|
+
import * as PerfHooks from 'perf_hooks';
|
84
85
|
/**
|
85
|
-
*
|
86
|
+
* Browser window.
|
87
|
+
*
|
88
|
+
* Reference:
|
89
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/Window.
|
86
90
|
*/
|
87
|
-
export default class Window extends EventTarget implements IWindow
|
91
|
+
export default class Window extends EventTarget implements IWindow {
|
88
92
|
readonly happyDOM: {
|
89
93
|
whenAsyncComplete: () => Promise<void>;
|
90
94
|
cancelAsync: () => void;
|
@@ -105,6 +109,7 @@ export default class Window extends EventTarget implements IWindow, NodeJS.Globa
|
|
105
109
|
readonly HTMLLabelElement: typeof HTMLLabelElement;
|
106
110
|
readonly HTMLSlotElement: typeof HTMLSlotElement;
|
107
111
|
readonly HTMLMetaElement: typeof HTMLMetaElement;
|
112
|
+
readonly HTMLBaseElement: typeof HTMLBaseElement;
|
108
113
|
readonly SVGSVGElement: typeof SVGSVGElement;
|
109
114
|
readonly SVGElement: typeof SVGElement;
|
110
115
|
readonly Text: typeof Text;
|
@@ -180,6 +185,17 @@ export default class Window extends EventTarget implements IWindow, NodeJS.Globa
|
|
180
185
|
readonly MimeTypeArray: typeof MimeTypeArray;
|
181
186
|
readonly Plugin: typeof Plugin;
|
182
187
|
readonly PluginArray: typeof PluginArray;
|
188
|
+
readonly Headers: {
|
189
|
+
new (init?: IHeadersInit): IHeaders;
|
190
|
+
};
|
191
|
+
readonly Request: {
|
192
|
+
new (input: string | {
|
193
|
+
href: string;
|
194
|
+
} | IRequest, init?: IRequestInit): IRequest;
|
195
|
+
};
|
196
|
+
readonly Response: {
|
197
|
+
new (body?: NodeJS.ReadableStream | null, init?: IResponseInit): IResponse;
|
198
|
+
};
|
183
199
|
onload: (event: Event) => void;
|
184
200
|
onerror: (event: ErrorEvent) => void;
|
185
201
|
readonly document: Document;
|
@@ -200,130 +216,81 @@ export default class Window extends EventTarget implements IWindow, NodeJS.Globa
|
|
200
216
|
readonly sessionStorage: Storage;
|
201
217
|
readonly localStorage: Storage;
|
202
218
|
readonly performance: PerfHooks.Performance;
|
203
|
-
ArrayBuffer:
|
204
|
-
Boolean:
|
205
|
-
Buffer:
|
206
|
-
DataView:
|
207
|
-
Date:
|
208
|
-
Error:
|
209
|
-
EvalError:
|
210
|
-
Float32Array:
|
211
|
-
Float64Array:
|
219
|
+
ArrayBuffer: any;
|
220
|
+
Boolean: any;
|
221
|
+
Buffer: typeof globalThis.Buffer;
|
222
|
+
DataView: any;
|
223
|
+
Date: any;
|
224
|
+
Error: any;
|
225
|
+
EvalError: any;
|
226
|
+
Float32Array: any;
|
227
|
+
Float64Array: any;
|
212
228
|
GLOBAL: any;
|
213
|
-
Infinity:
|
214
|
-
Int16Array:
|
215
|
-
Int32Array:
|
216
|
-
Int8Array:
|
217
|
-
Intl:
|
218
|
-
JSON:
|
219
|
-
Map:
|
220
|
-
Math:
|
221
|
-
NaN:
|
222
|
-
Number:
|
223
|
-
Promise:
|
224
|
-
RangeError:
|
225
|
-
ReferenceError:
|
226
|
-
RegExp:
|
227
|
-
Reflect:
|
228
|
-
Set:
|
229
|
-
Symbol:
|
230
|
-
SyntaxError:
|
231
|
-
String:
|
232
|
-
TypeError:
|
233
|
-
URIError:
|
234
|
-
Uint16Array:
|
235
|
-
Uint32Array:
|
236
|
-
Uint8Array:
|
237
|
-
Uint8ClampedArray:
|
238
|
-
WeakMap:
|
239
|
-
WeakSet:
|
229
|
+
Infinity: any;
|
230
|
+
Int16Array: any;
|
231
|
+
Int32Array: any;
|
232
|
+
Int8Array: any;
|
233
|
+
Intl: any;
|
234
|
+
JSON: any;
|
235
|
+
Map: any;
|
236
|
+
Math: any;
|
237
|
+
NaN: any;
|
238
|
+
Number: any;
|
239
|
+
Promise: any;
|
240
|
+
RangeError: any;
|
241
|
+
ReferenceError: any;
|
242
|
+
RegExp: any;
|
243
|
+
Reflect: any;
|
244
|
+
Set: any;
|
245
|
+
Symbol: any;
|
246
|
+
SyntaxError: any;
|
247
|
+
String: any;
|
248
|
+
TypeError: any;
|
249
|
+
URIError: any;
|
250
|
+
Uint16Array: any;
|
251
|
+
Uint32Array: any;
|
252
|
+
Uint8Array: any;
|
253
|
+
Uint8ClampedArray: any;
|
254
|
+
WeakMap: any;
|
255
|
+
WeakSet: any;
|
240
256
|
clearImmediate: any;
|
241
|
-
decodeURI:
|
242
|
-
decodeURIComponent:
|
243
|
-
encodeURI:
|
244
|
-
encodeURIComponent:
|
245
|
-
escape:
|
257
|
+
decodeURI: any;
|
258
|
+
decodeURIComponent: any;
|
259
|
+
encodeURI: any;
|
260
|
+
encodeURIComponent: any;
|
261
|
+
escape: any;
|
246
262
|
global: any;
|
247
|
-
isFinite:
|
248
|
-
isNaN:
|
249
|
-
parseFloat:
|
250
|
-
parseInt:
|
263
|
+
isFinite: any;
|
264
|
+
isNaN: any;
|
265
|
+
parseFloat: any;
|
266
|
+
parseInt: any;
|
251
267
|
process: any;
|
252
268
|
root: any;
|
253
269
|
setImmediate: any;
|
254
|
-
queueMicrotask:
|
270
|
+
queueMicrotask: any;
|
255
271
|
undefined: any;
|
256
|
-
unescape:
|
272
|
+
unescape: any;
|
257
273
|
gc: any;
|
258
274
|
v8debug: any;
|
259
|
-
AbortController:
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
new (): AbortSignal;
|
265
|
-
prototype: AbortSignal;
|
266
|
-
};
|
267
|
-
private _objectClass;
|
268
|
-
private _arrayClass;
|
269
|
-
private _functionClass;
|
275
|
+
AbortController: any;
|
276
|
+
AbortSignal: any;
|
277
|
+
Array: any;
|
278
|
+
Object: any;
|
279
|
+
Function: any;
|
270
280
|
/**
|
271
281
|
* Constructor.
|
272
282
|
*/
|
273
283
|
constructor();
|
274
|
-
/**
|
275
|
-
* Returns Object class.
|
276
|
-
*
|
277
|
-
* @returns Object class.
|
278
|
-
*/
|
279
|
-
get Object(): typeof globalThis.Object;
|
280
|
-
/**
|
281
|
-
* Returns Array class.
|
282
|
-
*
|
283
|
-
* @returns Array class.
|
284
|
-
*/
|
285
|
-
get Array(): typeof globalThis.Array;
|
286
|
-
/**
|
287
|
-
* Returns Function class.
|
288
|
-
*
|
289
|
-
* @returns Function class.
|
290
|
-
*/
|
291
|
-
get Function(): typeof globalThis.Function;
|
292
284
|
/**
|
293
285
|
* The CSS interface holds useful CSS-related methods.
|
294
286
|
*
|
295
287
|
* @returns CSS interface.
|
296
288
|
*/
|
297
289
|
get CSS(): CSS;
|
298
|
-
/**
|
299
|
-
* Returns Headers class.
|
300
|
-
*
|
301
|
-
* @returns Headers.
|
302
|
-
*/
|
303
|
-
get Headers(): {
|
304
|
-
new (init?: IHeadersInit): IHeaders;
|
305
|
-
};
|
306
|
-
/**
|
307
|
-
* Returns Request class.
|
308
|
-
*
|
309
|
-
* @returns Request.
|
310
|
-
*/
|
311
|
-
get Request(): {
|
312
|
-
new (input: string | {
|
313
|
-
href: string;
|
314
|
-
} | IRequest, init?: IRequestInit): IRequest;
|
315
|
-
};
|
316
|
-
/**
|
317
|
-
* Returns Response class.
|
318
|
-
*
|
319
|
-
* @returns Response.
|
320
|
-
*/
|
321
|
-
get Response(): {
|
322
|
-
new (body?: NodeJS.ReadableStream | null, init?: IResponseInit): IResponse;
|
323
|
-
};
|
324
290
|
/**
|
325
291
|
* Evaluates code.
|
326
292
|
*
|
293
|
+
* @override
|
327
294
|
* @param code Code.
|
328
295
|
* @returns Result.
|
329
296
|
*/
|
@@ -335,6 +302,12 @@ export default class Window extends EventTarget implements IWindow, NodeJS.Globa
|
|
335
302
|
* @returns CSS style declaration.
|
336
303
|
*/
|
337
304
|
getComputedStyle(element: HTMLElement): CSSStyleDeclaration;
|
305
|
+
/**
|
306
|
+
* Returns selection.
|
307
|
+
*
|
308
|
+
* @returns Selection.
|
309
|
+
*/
|
310
|
+
getSelection(): Selection;
|
338
311
|
/**
|
339
312
|
* Scrolls to a particular set of coordinates.
|
340
313
|
*
|