happy-dom 8.9.0 → 9.0.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 +2 -2
- package/lib/cookie/CookieJar.js +1 -1
- package/lib/cookie/CookieJar.js.map +1 -1
- package/lib/dom-token-list/DOMTokenList.js +24 -20
- package/lib/dom-token-list/DOMTokenList.js.map +1 -1
- package/lib/event/EventTarget.js +6 -3
- package/lib/event/EventTarget.js.map +1 -1
- package/lib/exception/DOMExceptionNameEnum.d.ts +5 -1
- package/lib/exception/DOMExceptionNameEnum.js +4 -0
- package/lib/exception/DOMExceptionNameEnum.js.map +1 -1
- package/lib/fetch/AbortController.d.ts +19 -0
- package/lib/fetch/AbortController.js +30 -0
- package/lib/fetch/AbortController.js.map +1 -0
- package/lib/fetch/AbortSignal.d.ts +25 -0
- package/lib/fetch/AbortSignal.js +51 -0
- package/lib/fetch/AbortSignal.js.map +1 -0
- package/lib/fetch/Fetch.d.ts +117 -0
- package/lib/fetch/Fetch.js +530 -0
- package/lib/fetch/Fetch.js.map +1 -0
- package/lib/fetch/Headers.d.ts +81 -3
- package/lib/fetch/Headers.js +139 -24
- package/lib/fetch/Headers.js.map +1 -1
- package/lib/fetch/Request.d.ts +56 -32
- package/lib/fetch/Request.js +165 -110
- package/lib/fetch/Request.js.map +1 -1
- package/lib/fetch/{ResourceFetchHandler.d.ts → ResourceFetch.d.ts} +1 -1
- package/lib/fetch/{ResourceFetchHandler.js → ResourceFetch.js} +5 -5
- package/lib/fetch/ResourceFetch.js.map +1 -0
- package/lib/fetch/Response.d.ts +60 -26
- package/lib/fetch/Response.js +196 -104
- package/lib/fetch/Response.js.map +1 -1
- package/lib/fetch/data-uri/DataURIParser.d.ts +20 -0
- package/lib/fetch/data-uri/DataURIParser.js +60 -0
- package/lib/fetch/data-uri/DataURIParser.js.map +1 -0
- package/lib/fetch/multipart/MultipartFormDataParser.d.ts +40 -0
- package/lib/fetch/multipart/MultipartFormDataParser.js +81 -0
- package/lib/fetch/multipart/MultipartFormDataParser.js.map +1 -0
- package/lib/fetch/multipart/MultipartReader.d.ts +49 -0
- package/lib/fetch/multipart/MultipartReader.js +178 -0
- package/lib/fetch/multipart/MultipartReader.js.map +1 -0
- package/lib/fetch/types/IHeaders.d.ts +71 -0
- package/lib/fetch/{IHeaders.js.map → types/IHeaders.js.map} +1 -1
- package/lib/fetch/types/IHeadersInit.js.map +1 -0
- package/lib/fetch/types/IRequest.d.ts +60 -0
- package/lib/fetch/{IRequest.js.map → types/IRequest.js.map} +1 -1
- package/lib/fetch/types/IRequestBody.d.ts +7 -0
- package/lib/fetch/{IBody.js → types/IRequestBody.js} +1 -1
- package/lib/fetch/types/IRequestBody.js.map +1 -0
- package/lib/fetch/types/IRequestCredentials.d.ts +2 -0
- package/lib/fetch/types/IRequestCredentials.js +3 -0
- package/lib/fetch/types/IRequestCredentials.js.map +1 -0
- package/lib/fetch/{RequestInfo.d.ts → types/IRequestInfo.d.ts} +2 -2
- package/lib/fetch/types/IRequestInfo.js +3 -0
- package/lib/fetch/types/IRequestInfo.js.map +1 -0
- package/lib/fetch/types/IRequestInit.d.ts +21 -0
- package/lib/fetch/types/IRequestInit.js.map +1 -0
- package/lib/fetch/types/IRequestRedirect.d.ts +2 -0
- package/lib/fetch/types/IRequestRedirect.js +3 -0
- package/lib/fetch/types/IRequestRedirect.js.map +1 -0
- package/lib/fetch/types/IRequestReferrerPolicy.d.ts +2 -0
- package/lib/fetch/types/IRequestReferrerPolicy.js +3 -0
- package/lib/fetch/types/IRequestReferrerPolicy.js.map +1 -0
- package/lib/fetch/types/IResponse.d.ts +27 -0
- package/lib/fetch/{IResponse.js.map → types/IResponse.js.map} +1 -1
- package/lib/fetch/types/IResponseBody.d.ts +7 -0
- package/lib/fetch/types/IResponseBody.js +3 -0
- package/lib/fetch/types/IResponseBody.js.map +1 -0
- package/lib/fetch/types/IResponseInit.d.ts +9 -0
- package/lib/fetch/types/IResponseInit.js.map +1 -0
- package/lib/fetch/utilities/FetchBodyUtility.d.ts +44 -0
- package/lib/fetch/utilities/FetchBodyUtility.js +156 -0
- package/lib/fetch/utilities/FetchBodyUtility.js.map +1 -0
- package/lib/fetch/utilities/FetchCORSUtility.d.ts +12 -0
- package/lib/fetch/utilities/FetchCORSUtility.js +20 -0
- package/lib/fetch/utilities/FetchCORSUtility.js.map +1 -0
- package/lib/fetch/utilities/FetchRequestHeaderUtility.d.ts +12 -0
- package/lib/fetch/utilities/FetchRequestHeaderUtility.js +45 -0
- package/lib/fetch/utilities/FetchRequestHeaderUtility.js.map +1 -0
- package/lib/fetch/utilities/FetchRequestReferrerUtility.d.ts +55 -0
- package/lib/fetch/utilities/FetchRequestReferrerUtility.js +194 -0
- package/lib/fetch/utilities/FetchRequestReferrerUtility.js.map +1 -0
- package/lib/fetch/utilities/FetchRequestValidationUtility.d.ts +38 -0
- package/lib/fetch/utilities/FetchRequestValidationUtility.js +70 -0
- package/lib/fetch/utilities/FetchRequestValidationUtility.js.map +1 -0
- package/lib/file/Blob.d.ts +2 -2
- package/lib/file/Blob.js +1 -1
- package/lib/file/Blob.js.map +1 -1
- package/lib/file/File.d.ts +2 -1
- package/lib/file/File.js.map +1 -1
- package/lib/form-data/FormData.d.ts +98 -0
- package/lib/form-data/FormData.js +212 -0
- package/lib/form-data/FormData.js.map +1 -0
- package/lib/index.d.ts +14 -1
- package/lib/index.js +20 -2
- package/lib/index.js.map +1 -1
- package/lib/nodes/document/Document.d.ts +5 -17
- package/lib/nodes/document/Document.js +11 -54
- package/lib/nodes/document/Document.js.map +1 -1
- package/lib/nodes/document/IDocument.d.ts +1 -1
- package/lib/nodes/document-fragment/DocumentFragment.d.ts +3 -14
- package/lib/nodes/document-fragment/DocumentFragment.js +7 -51
- package/lib/nodes/document-fragment/DocumentFragment.js.map +1 -1
- package/lib/nodes/document-fragment/IDocumentFragment.d.ts +2 -1
- package/lib/nodes/element/Element.d.ts +8 -8
- package/lib/nodes/element/Element.js +28 -45
- package/lib/nodes/element/Element.js.map +1 -1
- package/lib/nodes/element/ElementUtility.d.ts +32 -0
- package/lib/nodes/element/ElementUtility.js +105 -0
- package/lib/nodes/element/ElementUtility.js.map +1 -0
- package/lib/nodes/element/HTMLCollection.d.ts +26 -3
- package/lib/nodes/element/HTMLCollection.js +51 -0
- package/lib/nodes/element/HTMLCollection.js.map +1 -1
- package/lib/nodes/element/IHTMLCollection.d.ts +9 -2
- package/lib/nodes/html-anchor-element/HTMLAnchorElement.js +24 -24
- package/lib/nodes/html-anchor-element/HTMLAnchorElement.js.map +1 -1
- package/lib/nodes/html-base-element/HTMLBaseElement.js +4 -4
- package/lib/nodes/html-base-element/HTMLBaseElement.js.map +1 -1
- package/lib/nodes/html-button-element/HTMLButtonElement.d.ts +79 -3
- package/lib/nodes/html-button-element/HTMLButtonElement.js +158 -10
- package/lib/nodes/html-button-element/HTMLButtonElement.js.map +1 -1
- package/lib/nodes/html-button-element/IHTMLButtonElement.d.ts +28 -2
- package/lib/nodes/html-dialog-element/HTMLDialogElement.js +3 -3
- package/lib/nodes/html-dialog-element/HTMLDialogElement.js.map +1 -1
- package/lib/nodes/html-element/HTMLElement.js +12 -12
- package/lib/nodes/html-element/HTMLElement.js.map +1 -1
- package/lib/nodes/html-form-element/HTMLFormControlsCollection.d.ts +32 -0
- package/lib/nodes/html-form-element/HTMLFormControlsCollection.js +58 -0
- package/lib/nodes/html-form-element/HTMLFormControlsCollection.js.map +1 -0
- package/lib/nodes/html-form-element/HTMLFormElement.d.ts +37 -17
- package/lib/nodes/html-form-element/HTMLFormElement.js +128 -37
- package/lib/nodes/html-form-element/HTMLFormElement.js.map +1 -1
- package/lib/nodes/html-form-element/IHTMLFormControlsCollection.d.ts +25 -0
- package/lib/nodes/html-form-element/IHTMLFormControlsCollection.js +3 -0
- package/lib/nodes/html-form-element/IHTMLFormControlsCollection.js.map +1 -0
- package/lib/nodes/html-form-element/IHTMLFormElement.d.ts +16 -6
- package/lib/nodes/html-form-element/IRadioNodeList.d.ts +15 -0
- package/lib/nodes/html-form-element/IRadioNodeList.js +3 -0
- package/lib/nodes/html-form-element/IRadioNodeList.js.map +1 -0
- package/lib/nodes/html-form-element/RadioNodeList.d.ts +16 -0
- package/lib/nodes/html-form-element/RadioNodeList.js +28 -0
- package/lib/nodes/html-form-element/RadioNodeList.js.map +1 -0
- package/lib/nodes/html-image-element/HTMLImageElement.js +19 -19
- package/lib/nodes/html-image-element/HTMLImageElement.js.map +1 -1
- package/lib/nodes/html-input-element/HTMLInputElement.d.ts +43 -19
- package/lib/nodes/html-input-element/HTMLInputElement.js +206 -111
- package/lib/nodes/html-input-element/HTMLInputElement.js.map +1 -1
- package/lib/nodes/html-input-element/IHTMLInputElement.d.ts +14 -1
- package/lib/nodes/html-label-element/HTMLLabelElement.js +3 -7
- package/lib/nodes/html-label-element/HTMLLabelElement.js.map +1 -1
- package/lib/nodes/html-link-element/HTMLLinkElement.js +21 -21
- package/lib/nodes/html-link-element/HTMLLinkElement.js.map +1 -1
- package/lib/nodes/html-media-element/HTMLMediaElement.js +21 -21
- package/lib/nodes/html-media-element/HTMLMediaElement.js.map +1 -1
- package/lib/nodes/html-meta-element/HTMLMetaElement.js +8 -8
- package/lib/nodes/html-meta-element/HTMLMetaElement.js.map +1 -1
- package/lib/nodes/html-opt-group-element/HTMLOptGroupElement.js +6 -6
- package/lib/nodes/html-opt-group-element/HTMLOptGroupElement.js.map +1 -1
- package/lib/nodes/html-option-element/HTMLOptionElement.d.ts +3 -4
- package/lib/nodes/html-option-element/HTMLOptionElement.js +26 -29
- package/lib/nodes/html-option-element/HTMLOptionElement.js.map +1 -1
- package/lib/nodes/html-script-element/HTMLScriptElement.js +16 -16
- package/lib/nodes/html-script-element/HTMLScriptElement.js.map +1 -1
- package/lib/nodes/html-script-element/ScriptUtility.js +5 -5
- package/lib/nodes/html-script-element/ScriptUtility.js.map +1 -1
- package/lib/nodes/{html-option-element → html-select-element}/HTMLOptionsCollection.d.ts +5 -6
- package/lib/nodes/{html-option-element → html-select-element}/HTMLOptionsCollection.js.map +1 -1
- package/lib/nodes/html-select-element/HTMLSelectElement.d.ts +42 -41
- package/lib/nodes/html-select-element/HTMLSelectElement.js +134 -138
- package/lib/nodes/html-select-element/HTMLSelectElement.js.map +1 -1
- package/lib/nodes/{html-option-element → html-select-element}/IHTMLOptionsCollection.d.ts +4 -5
- package/lib/nodes/html-select-element/IHTMLOptionsCollection.js.map +1 -0
- package/lib/nodes/html-select-element/IHTMLSelectElement.d.ts +22 -2
- package/lib/nodes/html-slot-element/HTMLSlotElement.js +2 -2
- package/lib/nodes/html-slot-element/HTMLSlotElement.js.map +1 -1
- package/lib/nodes/html-style-element/HTMLStyleElement.js +7 -7
- package/lib/nodes/html-style-element/HTMLStyleElement.js.map +1 -1
- package/lib/nodes/html-text-area-element/HTMLTextAreaElement.d.ts +55 -2
- package/lib/nodes/html-text-area-element/HTMLTextAreaElement.js +150 -40
- package/lib/nodes/html-text-area-element/HTMLTextAreaElement.js.map +1 -1
- package/lib/nodes/html-text-area-element/IHTMLTextAreaElement.d.ts +16 -0
- package/lib/nodes/node/Node.d.ts +12 -1
- package/lib/nodes/node/Node.js +50 -4
- package/lib/nodes/node/Node.js.map +1 -1
- package/lib/nodes/node/NodeList.d.ts +2 -3
- package/lib/nodes/node/NodeList.js.map +1 -1
- package/lib/nodes/parent-node/IParentNode.d.ts +4 -4
- package/lib/nodes/parent-node/ParentNodeUtility.d.ts +3 -3
- package/lib/nodes/parent-node/ParentNodeUtility.js +13 -11
- package/lib/nodes/parent-node/ParentNodeUtility.js.map +1 -1
- package/lib/nodes/text/Text.d.ts +13 -0
- package/lib/nodes/text/Text.js +30 -0
- package/lib/nodes/text/Text.js.map +1 -1
- package/lib/query-selector/QuerySelector.js +2 -2
- package/lib/query-selector/QuerySelector.js.map +1 -1
- package/lib/query-selector/SelectorItem.js +2 -0
- package/lib/query-selector/SelectorItem.js.map +1 -1
- package/lib/validity-state/ValidityState.d.ts +87 -0
- package/lib/validity-state/ValidityState.js +171 -0
- package/lib/validity-state/ValidityState.js.map +1 -0
- package/lib/window/GlobalWindow.d.ts +0 -8
- package/lib/window/GlobalWindow.js +0 -2
- package/lib/window/GlobalWindow.js.map +1 -1
- package/lib/window/INodeJSGlobal.d.ts +71 -0
- package/lib/window/INodeJSGlobal.js +2 -0
- package/lib/window/INodeJSGlobal.js.map +1 -0
- package/lib/window/IWindow.d.ts +30 -10
- package/lib/window/Window.d.ts +36 -20
- package/lib/window/Window.js +16 -9
- package/lib/window/Window.js.map +1 -1
- package/lib/xml-http-request/XMLHttpRequest.js +20 -12
- package/lib/xml-http-request/XMLHttpRequest.js.map +1 -1
- package/lib/xml-parser/XMLParser.js +1 -1
- package/lib/xml-parser/XMLParser.js.map +1 -1
- package/package.json +2 -3
- package/src/cookie/CookieJar.ts +1 -1
- package/src/dom-token-list/DOMTokenList.ts +24 -20
- package/src/event/EventTarget.ts +7 -3
- package/src/exception/DOMExceptionNameEnum.ts +5 -1
- package/src/fetch/AbortController.ts +26 -0
- package/src/fetch/AbortSignal.ts +44 -0
- package/src/fetch/Fetch.ts +666 -0
- package/src/fetch/Headers.ts +151 -3
- package/src/fetch/Request.ts +226 -94
- package/src/fetch/{ResourceFetchHandler.ts → ResourceFetch.ts} +3 -3
- package/src/fetch/Response.ts +252 -89
- package/src/fetch/data-uri/DataURIParser.ts +66 -0
- package/src/fetch/multipart/MultipartFormDataParser.ts +113 -0
- package/src/fetch/multipart/MultipartReader.ts +217 -0
- package/src/fetch/types/IHeaders.ts +80 -0
- package/src/fetch/types/IRequest.ts +65 -0
- package/src/fetch/types/IRequestBody.ts +15 -0
- package/src/fetch/types/IRequestCredentials.ts +2 -0
- package/src/fetch/types/IRequestInfo.ts +6 -0
- package/src/fetch/types/IRequestInit.ts +21 -0
- package/src/fetch/types/IRequestRedirect.ts +3 -0
- package/src/fetch/types/IRequestReferrerPolicy.ts +11 -0
- package/src/fetch/types/IResponse.ts +27 -0
- package/src/fetch/types/IResponseBody.ts +15 -0
- package/src/fetch/types/IResponseInit.ts +10 -0
- package/src/fetch/utilities/FetchBodyUtility.ts +175 -0
- package/src/fetch/utilities/FetchCORSUtility.ts +18 -0
- package/src/fetch/utilities/FetchRequestHeaderUtility.ts +47 -0
- package/src/fetch/utilities/FetchRequestReferrerUtility.ts +241 -0
- package/src/fetch/utilities/FetchRequestValidationUtility.ts +82 -0
- package/src/file/Blob.ts +2 -2
- package/src/file/File.ts +5 -1
- package/src/form-data/FormData.ts +237 -0
- package/src/index.ts +27 -1
- package/src/nodes/document/Document.ts +23 -64
- package/src/nodes/document/IDocument.ts +1 -1
- package/src/nodes/document-fragment/DocumentFragment.ts +9 -59
- package/src/nodes/document-fragment/IDocumentFragment.ts +2 -1
- package/src/nodes/element/Element.ts +43 -56
- package/src/nodes/element/ElementUtility.ts +137 -0
- package/src/nodes/element/HTMLCollection.ts +60 -3
- package/src/nodes/element/IHTMLCollection.ts +10 -2
- package/src/nodes/html-anchor-element/HTMLAnchorElement.ts +24 -24
- package/src/nodes/html-base-element/HTMLBaseElement.ts +4 -4
- package/src/nodes/html-button-element/HTMLButtonElement.ts +184 -10
- package/src/nodes/html-button-element/IHTMLButtonElement.ts +31 -2
- package/src/nodes/html-dialog-element/HTMLDialogElement.ts +3 -3
- package/src/nodes/html-element/HTMLElement.ts +12 -12
- package/src/nodes/html-form-element/HTMLFormControlsCollection.ts +76 -0
- package/src/nodes/html-form-element/HTMLFormElement.ts +147 -41
- package/src/nodes/html-form-element/IHTMLFormControlsCollection.ts +45 -0
- package/src/nodes/html-form-element/IHTMLFormElement.ts +17 -6
- package/src/nodes/html-form-element/IRadioNodeList.ts +16 -0
- package/src/nodes/html-form-element/RadioNodeList.ts +24 -0
- package/src/nodes/html-image-element/HTMLImageElement.ts +19 -19
- package/src/nodes/html-input-element/HTMLInputElement.ts +232 -113
- package/src/nodes/html-input-element/IHTMLInputElement.ts +20 -1
- package/src/nodes/html-label-element/HTMLLabelElement.ts +3 -7
- package/src/nodes/html-link-element/HTMLLinkElement.ts +21 -21
- package/src/nodes/html-media-element/HTMLMediaElement.ts +21 -21
- package/src/nodes/html-meta-element/HTMLMetaElement.ts +8 -8
- package/src/nodes/html-opt-group-element/HTMLOptGroupElement.ts +6 -6
- package/src/nodes/html-option-element/HTMLOptionElement.ts +29 -30
- package/src/nodes/html-script-element/HTMLScriptElement.ts +16 -16
- package/src/nodes/html-script-element/ScriptUtility.ts +5 -5
- package/src/nodes/{html-option-element → html-select-element}/HTMLOptionsCollection.ts +5 -9
- package/src/nodes/html-select-element/HTMLSelectElement.ts +159 -170
- package/src/nodes/{html-option-element → html-select-element}/IHTMLOptionsCollection.ts +4 -8
- package/src/nodes/html-select-element/IHTMLSelectElement.ts +25 -2
- package/src/nodes/html-slot-element/HTMLSlotElement.ts +2 -2
- package/src/nodes/html-style-element/HTMLStyleElement.ts +7 -7
- package/src/nodes/html-text-area-element/HTMLTextAreaElement.ts +174 -41
- package/src/nodes/html-text-area-element/IHTMLTextAreaElement.ts +18 -0
- package/src/nodes/node/Node.ts +61 -6
- package/src/nodes/node/NodeList.ts +2 -3
- package/src/nodes/parent-node/IParentNode.ts +7 -4
- package/src/nodes/parent-node/ParentNodeUtility.ts +25 -15
- package/src/nodes/text/Text.ts +38 -0
- package/src/query-selector/QuerySelector.ts +2 -2
- package/src/query-selector/SelectorItem.ts +3 -0
- package/src/validity-state/ValidityState.ts +211 -0
- package/src/window/GlobalWindow.ts +0 -2
- package/src/window/INodeJSGlobal.ts +70 -0
- package/src/window/IWindow.ts +32 -10
- package/src/window/Window.ts +37 -20
- package/src/xml-http-request/XMLHttpRequest.ts +27 -26
- package/src/xml-parser/XMLParser.ts +1 -1
- package/lib/fetch/FetchHandler.d.ts +0 -18
- package/lib/fetch/FetchHandler.js +0 -83
- package/lib/fetch/FetchHandler.js.map +0 -1
- package/lib/fetch/IAbortSignal.d.ts +0 -16
- package/lib/fetch/IAbortSignal.js +0 -4
- package/lib/fetch/IAbortSignal.js.map +0 -1
- package/lib/fetch/IBody.d.ts +0 -17
- package/lib/fetch/IBody.js.map +0 -1
- package/lib/fetch/IHeaders.d.ts +0 -18
- package/lib/fetch/IHeadersInit.js.map +0 -1
- package/lib/fetch/IRequest.d.ts +0 -18
- package/lib/fetch/IRequestInit.d.ts +0 -16
- package/lib/fetch/IRequestInit.js.map +0 -1
- package/lib/fetch/IResponse.d.ts +0 -20
- package/lib/fetch/IResponseInit.d.ts +0 -9
- package/lib/fetch/IResponseInit.js.map +0 -1
- package/lib/fetch/RequestInfo.js +0 -3
- package/lib/fetch/RequestInfo.js.map +0 -1
- package/lib/fetch/ResourceFetchHandler.js.map +0 -1
- package/lib/form-data/IFormData.d.ts +0 -32
- package/lib/form-data/IFormData.js +0 -3
- package/lib/form-data/IFormData.js.map +0 -1
- package/lib/location/RelativeURL.d.ts +0 -15
- package/lib/location/RelativeURL.js +0 -19
- package/lib/location/RelativeURL.js.map +0 -1
- package/lib/nodes/element/HTMLCollectionFactory.d.ts +0 -21
- package/lib/nodes/element/HTMLCollectionFactory.js +0 -31
- package/lib/nodes/element/HTMLCollectionFactory.js.map +0 -1
- package/lib/nodes/html-option-element/IHTMLOptionsCollection.js.map +0 -1
- package/lib/nodes/node/NodeListFactory.d.ts +0 -21
- package/lib/nodes/node/NodeListFactory.js +0 -31
- package/lib/nodes/node/NodeListFactory.js.map +0 -1
- package/lib/nodes/validity-state/ValidityState.d.ts +0 -52
- package/lib/nodes/validity-state/ValidityState.js +0 -81
- package/lib/nodes/validity-state/ValidityState.js.map +0 -1
- package/src/fetch/FetchHandler.ts +0 -90
- package/src/fetch/IAbortSignal.ts +0 -34
- package/src/fetch/IBody.ts +0 -18
- package/src/fetch/IHeaders.ts +0 -18
- package/src/fetch/IRequest.ts +0 -59
- package/src/fetch/IRequestInit.ts +0 -41
- package/src/fetch/IResponse.ts +0 -22
- package/src/fetch/IResponseInit.ts +0 -10
- package/src/fetch/RequestInfo.ts +0 -6
- package/src/form-data/IFormData.ts +0 -33
- package/src/location/RelativeURL.ts +0 -17
- package/src/nodes/element/HTMLCollectionFactory.ts +0 -31
- package/src/nodes/node/NodeListFactory.ts +0 -31
- package/src/nodes/validity-state/ValidityState.ts +0 -84
- /package/lib/fetch/{IHeaders.js → types/IHeaders.js} +0 -0
- /package/lib/fetch/{IHeadersInit.d.ts → types/IHeadersInit.d.ts} +0 -0
- /package/lib/fetch/{IHeadersInit.js → types/IHeadersInit.js} +0 -0
- /package/lib/fetch/{IRequest.js → types/IRequest.js} +0 -0
- /package/lib/fetch/{IRequestInit.js → types/IRequestInit.js} +0 -0
- /package/lib/fetch/{IResponse.js → types/IResponse.js} +0 -0
- /package/lib/fetch/{IResponseInit.js → types/IResponseInit.js} +0 -0
- /package/lib/nodes/{html-option-element → html-select-element}/HTMLOptionsCollection.js +0 -0
- /package/lib/nodes/{html-option-element → html-select-element}/IHTMLOptionsCollection.js +0 -0
- /package/src/fetch/{IHeadersInit.ts → types/IHeadersInit.ts} +0 -0
@@ -0,0 +1,171 @@
|
|
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 HTMLInputElement_1 = __importDefault(require("../nodes/html-input-element/HTMLInputElement"));
|
7
|
+
const HTMLTextAreaElement_1 = __importDefault(require("../nodes/html-text-area-element/HTMLTextAreaElement"));
|
8
|
+
const EMAIL_REGEXP = /^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/;
|
9
|
+
const URL_REGEXP = /^(?:(?:https?|HTTPS?|ftp|FTP):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-zA-Z\u00a1-\uffff0-9]-*)*[a-zA-Z\u00a1-\uffff0-9]+)(?:\.(?:[a-zA-Z\u00a1-\uffff0-9]-*)*[a-zA-Z\u00a1-\uffff0-9]+)*)(?::\d{2,5})?(?:[\/?#]\S*)?$/;
|
10
|
+
/**
|
11
|
+
* Input validity state.
|
12
|
+
*
|
13
|
+
* Based on:
|
14
|
+
* https://github.com/cferdinandi/validate/blob/master/src/js/_validityState.polyfill.js
|
15
|
+
*
|
16
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/ValidityState
|
17
|
+
*/
|
18
|
+
class ValidityState {
|
19
|
+
/**
|
20
|
+
* Constructor.
|
21
|
+
*
|
22
|
+
* @param element Input element.
|
23
|
+
*/
|
24
|
+
constructor(element) {
|
25
|
+
this.element = element;
|
26
|
+
}
|
27
|
+
/**
|
28
|
+
* Returns validity.
|
29
|
+
*
|
30
|
+
* @returns "true" if valid.
|
31
|
+
*/
|
32
|
+
get badInput() {
|
33
|
+
return (this.element instanceof HTMLInputElement_1.default &&
|
34
|
+
(this.element.type === 'number' || this.element.type === 'range') &&
|
35
|
+
this.element.value.length > 0 &&
|
36
|
+
!/^[-+]?(?:\d+|\d*[.,]\d+)$/.test(this.element.value));
|
37
|
+
}
|
38
|
+
/**
|
39
|
+
* Returns validity.
|
40
|
+
*
|
41
|
+
* @returns "true" if valid.
|
42
|
+
*/
|
43
|
+
get customError() {
|
44
|
+
return this.element.validationMessage.length > 0;
|
45
|
+
}
|
46
|
+
/**
|
47
|
+
* Returns validity.
|
48
|
+
*
|
49
|
+
* @returns "true" if valid.
|
50
|
+
*/
|
51
|
+
get patternMismatch() {
|
52
|
+
return (this.element instanceof HTMLInputElement_1.default &&
|
53
|
+
this.element.hasAttribute('pattern') &&
|
54
|
+
this.element.value.length > 0 &&
|
55
|
+
this.element.value.replace(new RegExp(this.element.getAttribute('pattern')), '').length > 0);
|
56
|
+
}
|
57
|
+
/**
|
58
|
+
* Returns validity.
|
59
|
+
*
|
60
|
+
* @returns "true" if valid.
|
61
|
+
*/
|
62
|
+
get rangeOverflow() {
|
63
|
+
return (this.element instanceof HTMLInputElement_1.default &&
|
64
|
+
this.element.hasAttribute('max') &&
|
65
|
+
(this.element.type === 'number' || this.element.type === 'range') &&
|
66
|
+
this.element.value.length > 0 &&
|
67
|
+
Number(this.element.value) > Number(this.element.getAttribute('max')));
|
68
|
+
}
|
69
|
+
/**
|
70
|
+
* Returns validity.
|
71
|
+
*
|
72
|
+
* @returns "true" if valid.
|
73
|
+
*/
|
74
|
+
get rangeUnderflow() {
|
75
|
+
return (this.element instanceof HTMLInputElement_1.default &&
|
76
|
+
this.element.hasAttribute('min') &&
|
77
|
+
(this.element.type === 'number' || this.element.type === 'range') &&
|
78
|
+
this.element.value.length > 0 &&
|
79
|
+
Number(this.element.value) < Number(this.element.getAttribute('min')));
|
80
|
+
}
|
81
|
+
/**
|
82
|
+
* Returns validity.
|
83
|
+
*
|
84
|
+
* @returns "true" if valid.
|
85
|
+
*/
|
86
|
+
get stepMismatch() {
|
87
|
+
return (this.element instanceof HTMLInputElement_1.default &&
|
88
|
+
(this.element.type === 'number' || this.element.type === 'range') &&
|
89
|
+
((this.element.hasAttribute('step') &&
|
90
|
+
this.element.getAttribute('step') !== 'any' &&
|
91
|
+
Number(this.element.value) % Number(this.element.getAttribute('step')) !== 0) ||
|
92
|
+
(!this.element.hasAttribute('step') && Number(this.element.value) % 1 !== 0)));
|
93
|
+
}
|
94
|
+
/**
|
95
|
+
* Returns validity.
|
96
|
+
*
|
97
|
+
* @returns "true" if valid.
|
98
|
+
*/
|
99
|
+
get tooLong() {
|
100
|
+
return ((this.element instanceof HTMLInputElement_1.default || this.element instanceof HTMLTextAreaElement_1.default) &&
|
101
|
+
this.element.maxLength > 0 &&
|
102
|
+
this.element.value.length > this.element.maxLength);
|
103
|
+
}
|
104
|
+
/**
|
105
|
+
* Returns validity.
|
106
|
+
*
|
107
|
+
* @returns "true" if valid.
|
108
|
+
*/
|
109
|
+
get tooShort() {
|
110
|
+
return ((this.element instanceof HTMLInputElement_1.default || this.element instanceof HTMLTextAreaElement_1.default) &&
|
111
|
+
this.element.minLength > 0 &&
|
112
|
+
this.element.value.length > 0 &&
|
113
|
+
this.element.value.length < this.element.minLength);
|
114
|
+
}
|
115
|
+
/**
|
116
|
+
* Returns validity.
|
117
|
+
*
|
118
|
+
* @returns "true" if valid.
|
119
|
+
*/
|
120
|
+
get typeMismatch() {
|
121
|
+
return (this.element instanceof HTMLInputElement_1.default &&
|
122
|
+
this.element.value.length > 0 &&
|
123
|
+
((this.element.type === 'email' && !EMAIL_REGEXP.test(this.element.value)) ||
|
124
|
+
(this.element.type === 'url' && !URL_REGEXP.test(this.element.value))));
|
125
|
+
}
|
126
|
+
/**
|
127
|
+
* Returns validity.
|
128
|
+
*
|
129
|
+
* @returns "true" if valid.
|
130
|
+
*/
|
131
|
+
get valueMissing() {
|
132
|
+
if (!this.element.required) {
|
133
|
+
return false;
|
134
|
+
}
|
135
|
+
if (this.element instanceof HTMLInputElement_1.default) {
|
136
|
+
if (this.element.type === 'checkbox') {
|
137
|
+
return !this.element.checked;
|
138
|
+
}
|
139
|
+
else if (this.element.type === 'radio') {
|
140
|
+
if (this.element.checked) {
|
141
|
+
return false;
|
142
|
+
}
|
143
|
+
if (!this.element.name) {
|
144
|
+
return true;
|
145
|
+
}
|
146
|
+
const root = this.element._formNode || this.element.getRootNode();
|
147
|
+
return !root || !root.querySelector(`input[name="${this.element.name}"]:checked`);
|
148
|
+
}
|
149
|
+
}
|
150
|
+
return this.element.value.length === 0;
|
151
|
+
}
|
152
|
+
/**
|
153
|
+
* Returns validity.
|
154
|
+
*
|
155
|
+
* @returns "true" if valid.
|
156
|
+
*/
|
157
|
+
get valid() {
|
158
|
+
return (!this.badInput &&
|
159
|
+
!this.customError &&
|
160
|
+
!this.patternMismatch &&
|
161
|
+
!this.rangeOverflow &&
|
162
|
+
!this.rangeUnderflow &&
|
163
|
+
!this.stepMismatch &&
|
164
|
+
!this.tooLong &&
|
165
|
+
!this.tooShort &&
|
166
|
+
!this.typeMismatch &&
|
167
|
+
!this.valueMissing);
|
168
|
+
}
|
169
|
+
}
|
170
|
+
exports.default = ValidityState;
|
171
|
+
//# sourceMappingURL=ValidityState.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ValidityState.js","sourceRoot":"","sources":["../../src/validity-state/ValidityState.ts"],"names":[],"mappings":";;;;;AAEA,oGAA4E;AAG5E,8GAAsF;AAItF,MAAM,YAAY,GACjB,ggBAAggB,CAAC;AAClgB,MAAM,UAAU,GACf,0bAA0b,CAAC;AAE5b;;;;;;;GAOG;AACH,MAAqB,aAAa;IAOjC;;;;OAIG;IACH,YACC,OAA2F;QAE3F,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACH,IAAW,QAAQ;QAClB,OAAO,CACN,IAAI,CAAC,OAAO,YAAY,0BAAgB;YACxC,CAAC,IAAI,CAAC,OAAO,CAAC,IA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OAAO,CAAC,IAAI,KAAK,OAAO,EAAE;gBACzC,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;oBACzB,OAAO,KAAK,CAAC;iBACb;gBACD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;oBACvB,OAAO,IAAI,CAAC;iBACZ;gBACD,MAAM,IAAI,GACS,IAAI,CAAC,OAAO,CAAC,SAAS,IAAiB,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;gBACrF,OAAO,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,eAAe,IAAI,CAAC,OAAO,CAAC,IAAI,YAAY,CAAC,CAAC;aAClF;SACD;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACH,IAAW,KAAK;QACf,OAAO,CACN,CAAC,IAAI,CAAC,QAAQ;YACd,CAAC,IAAI,CAAC,WAAW;YACjB,CAAC,IAAI,CAAC,eAAe;YACrB,CAAC,IAAI,CAAC,aAAa;YACnB,CAAC,IAAI,CAAC,cAAc;YACpB,CAAC,IAAI,CAAC,YAAY;YAClB,CAAC,IAAI,CAAC,OAAO;YACb,CAAC,IAAI,CAAC,QAAQ;YACd,CAAC,IAAI,CAAC,YAAY;YAClB,CAAC,IAAI,CAAC,YAAY,CAClB,CAAC;IACH,CAAC;CACD;AA5LD,gCA4LC"}
|
@@ -65,14 +65,6 @@ export default class GlobalWindow extends Window {
|
|
65
65
|
unescape: typeof unescape;
|
66
66
|
gc: any;
|
67
67
|
v8debug: any;
|
68
|
-
AbortController: {
|
69
|
-
new (): AbortController;
|
70
|
-
prototype: AbortController;
|
71
|
-
};
|
72
|
-
AbortSignal: {
|
73
|
-
new (): AbortSignal;
|
74
|
-
prototype: AbortSignal;
|
75
|
-
};
|
76
68
|
Array: ArrayConstructor;
|
77
69
|
Object: ObjectConstructor;
|
78
70
|
Function: FunctionConstructor;
|
@@ -70,8 +70,6 @@ class GlobalWindow extends Window_1.default {
|
|
70
70
|
this.unescape = globalThis.unescape;
|
71
71
|
this.gc = globalThis.gc;
|
72
72
|
this.v8debug = globalThis.v8debug;
|
73
|
-
this.AbortController = globalThis.AbortController;
|
74
|
-
this.AbortSignal = globalThis.AbortSignal;
|
75
73
|
this.Array = globalThis.Array;
|
76
74
|
this.Object = globalThis.Object;
|
77
75
|
this.Function = globalThis.Function;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"GlobalWindow.js","sourceRoot":"","sources":["../../src/window/GlobalWindow.ts"],"names":[],"mappings":";;;;;AAAA,sDAA8B;AAE9B;;;;;GAKG;AACH,MAAqB,YAAa,SAAQ,gBAAM;IAAhD;;QACC,kBAAkB;QACX,gBAAW,GAAG,UAAU,CAAC,WAAW,CAAC;QACrC,YAAO,GAAG,UAAU,CAAC,OAAO,CAAC;QAC7B,WAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;QAC/D,aAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;QAC/B,SAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QACvB,UAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QACzB,cAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACjC,iBAAY,GAAG,UAAU,CAAC,YAAY,CAAC;QACvC,iBAAY,GAAG,UAAU,CAAC,YAAY,CAAC;QACvC,WAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAC3B,aAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;QAC/B,eAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACnC,eAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACnC,cAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACjC,SAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QACvB,SAAI,GAAG,UAAU,CAAC,IAAI,CAAC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,UAAU,CAAC,kBAAkB,CAAC;QACnD,cAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACjC,uBAAkB,GAAG,UAAU,CAAC,kBAAkB,CAAC;QACnD,WAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAC3B,WAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAC3B,aAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;QAC/B,UAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QACzB,eAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACnC,aAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;QAC/B,YAAO,GAAG,UAAU,CAAC,OAAO,CAAC;QAC7B,SAAI,GAAG,UAAU,CAAC,WAAW,CAAC;QAC9B,iBAAY,GAAG,UAAU,CAAC,YAAY,CAAC;QACvC,mBAAc,GAAG,UAAU,CAAC,cAAc,CAAC;QAC3C,cAAS,GAAG,UAAU,CAAC,WAAW,CAAC;QACnC,aAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;QAC/B,OAAE,GAAG,UAAU,CAAC,EAAE,CAAC;QACnB,YAAO,GAAG,UAAU,CAAC,OAAO,CAAC;QAC7B,UAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QACzB,WAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAC3B,aAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;IAoBvC,CAAC;IAlBA;;;;;OAKG;IACI,IAAI,CAAC,IAAY;QACvB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACO,eAAe;QACxB,aAAa;IACd,CAAC;CACD;AAhFD,+BAgFC"}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
/// <reference types="node" />
|
3
|
+
/// <reference types="node" />
|
4
|
+
interface INodeJSGlobal {
|
5
|
+
Array: typeof Array;
|
6
|
+
ArrayBuffer: typeof ArrayBuffer;
|
7
|
+
Boolean: typeof Boolean;
|
8
|
+
Buffer: typeof Buffer;
|
9
|
+
DataView: typeof DataView;
|
10
|
+
Date: typeof Date;
|
11
|
+
Error: typeof Error;
|
12
|
+
EvalError: typeof EvalError;
|
13
|
+
Float32Array: typeof Float32Array;
|
14
|
+
Float64Array: typeof Float64Array;
|
15
|
+
Function: typeof Function;
|
16
|
+
Infinity: typeof Infinity;
|
17
|
+
Int16Array: typeof Int16Array;
|
18
|
+
Int32Array: typeof Int32Array;
|
19
|
+
Int8Array: typeof Int8Array;
|
20
|
+
Intl: typeof Intl;
|
21
|
+
JSON: typeof JSON;
|
22
|
+
Map: MapConstructor;
|
23
|
+
Math: typeof Math;
|
24
|
+
NaN: typeof NaN;
|
25
|
+
Number: typeof Number;
|
26
|
+
Object: typeof Object;
|
27
|
+
Promise: typeof Promise;
|
28
|
+
RangeError: typeof RangeError;
|
29
|
+
ReferenceError: typeof ReferenceError;
|
30
|
+
RegExp: typeof RegExp;
|
31
|
+
Set: SetConstructor;
|
32
|
+
String: typeof String;
|
33
|
+
Symbol: Function;
|
34
|
+
SyntaxError: typeof SyntaxError;
|
35
|
+
TypeError: typeof TypeError;
|
36
|
+
URIError: typeof URIError;
|
37
|
+
Uint16Array: typeof Uint16Array;
|
38
|
+
Uint32Array: typeof Uint32Array;
|
39
|
+
Uint8Array: typeof Uint8Array;
|
40
|
+
Uint8ClampedArray: typeof Uint8ClampedArray;
|
41
|
+
WeakMap: WeakMapConstructor;
|
42
|
+
WeakSet: WeakSetConstructor;
|
43
|
+
clearImmediate: (immediateId: NodeJS.Immediate) => void;
|
44
|
+
clearInterval: (intervalId: NodeJS.Timeout) => void;
|
45
|
+
clearTimeout: (timeoutId: NodeJS.Timeout) => void;
|
46
|
+
decodeURI: typeof decodeURI;
|
47
|
+
decodeURIComponent: typeof decodeURIComponent;
|
48
|
+
encodeURI: typeof encodeURI;
|
49
|
+
encodeURIComponent: typeof encodeURIComponent;
|
50
|
+
/**
|
51
|
+
* @deprecated
|
52
|
+
*/
|
53
|
+
escape: (str: string) => string;
|
54
|
+
eval: typeof eval;
|
55
|
+
global: NodeJS.Global;
|
56
|
+
isFinite: typeof isFinite;
|
57
|
+
isNaN: typeof isNaN;
|
58
|
+
parseFloat: typeof parseFloat;
|
59
|
+
parseInt: typeof parseInt;
|
60
|
+
setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => NodeJS.Immediate;
|
61
|
+
setInterval: (callback: (...args: any[]) => void, ms?: number, ...args: any[]) => NodeJS.Timeout;
|
62
|
+
setTimeout: (callback: (...args: any[]) => void, ms?: number, ...args: any[]) => NodeJS.Timeout;
|
63
|
+
queueMicrotask: typeof queueMicrotask;
|
64
|
+
undefined: typeof undefined;
|
65
|
+
/**
|
66
|
+
* @deprecated
|
67
|
+
*/
|
68
|
+
unescape: (str: string) => string;
|
69
|
+
gc: () => void;
|
70
|
+
v8debug?: any;
|
71
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"INodeJSGlobal.js","sourceRoot":"","sources":["../../src/window/INodeJSGlobal.ts"],"names":[],"mappings":"AAAA,uDAAuD"}
|
package/lib/window/IWindow.d.ts
CHANGED
@@ -68,6 +68,7 @@ import CSSKeyframeRule from '../css/rules/CSSKeyframeRule';
|
|
68
68
|
import CSSKeyframesRule from '../css/rules/CSSKeyframesRule';
|
69
69
|
import CSSMediaRule from '../css/rules/CSSMediaRule';
|
70
70
|
import CSSStyleRule from '../css/rules/CSSStyleRule';
|
71
|
+
import CSSSupportsRule from '../css/rules/CSSSupportsRule';
|
71
72
|
import PointerEvent from '../event/events/PointerEvent';
|
72
73
|
import MouseEvent from '../event/events/MouseEvent';
|
73
74
|
import FocusEvent from '../event/events/FocusEvent';
|
@@ -86,6 +87,7 @@ import AsyncTaskManager from '../async-task-manager/AsyncTaskManager';
|
|
86
87
|
import Storage from '../storage/Storage';
|
87
88
|
import NodeFilter from '../tree-walker/NodeFilter';
|
88
89
|
import HTMLCollection from '../nodes/element/HTMLCollection';
|
90
|
+
import HTMLFormControlsCollection from '../nodes/html-form-element/HTMLFormControlsCollection';
|
89
91
|
import NodeList from '../nodes/node/NodeList';
|
90
92
|
import Selection from '../selection/Selection';
|
91
93
|
import IEventTarget from '../event/IEventTarget';
|
@@ -94,11 +96,11 @@ import MimeType from '../navigator/MimeType';
|
|
94
96
|
import MimeTypeArray from '../navigator/MimeTypeArray';
|
95
97
|
import Plugin from '../navigator/Plugin';
|
96
98
|
import PluginArray from '../navigator/PluginArray';
|
97
|
-
import IResponseInit from '../fetch/IResponseInit';
|
98
|
-
import IRequest from '../fetch/IRequest';
|
99
|
-
import IHeaders from '../fetch/IHeaders';
|
100
|
-
import IRequestInit from '../fetch/IRequestInit';
|
101
|
-
import IResponse from '../fetch/IResponse';
|
99
|
+
import IResponseInit from '../fetch/types/IResponseInit';
|
100
|
+
import IRequest from '../fetch/types/IRequest';
|
101
|
+
import IHeaders from '../fetch/types/IHeaders';
|
102
|
+
import IRequestInit from '../fetch/types/IRequestInit';
|
103
|
+
import IResponse from '../fetch/types/IResponse';
|
102
104
|
import Range from '../range/Range';
|
103
105
|
import MediaQueryList from '../match-media/MediaQueryList';
|
104
106
|
import XMLHttpRequest from '../xml-http-request/XMLHttpRequest';
|
@@ -112,12 +114,21 @@ import { Performance } from 'perf_hooks';
|
|
112
114
|
import IElement from '../nodes/element/IElement';
|
113
115
|
import ProcessingInstruction from '../nodes/processing-instruction/ProcessingInstruction';
|
114
116
|
import IHappyDOMSettings from './IHappyDOMSettings';
|
115
|
-
import RequestInfo from '../fetch/
|
117
|
+
import RequestInfo from '../fetch/types/IRequestInfo';
|
116
118
|
import FileList from '../nodes/html-input-element/FileList';
|
119
|
+
import Stream from 'stream';
|
120
|
+
import FormData from '../form-data/FormData';
|
121
|
+
import AbortController from '../fetch/AbortController';
|
122
|
+
import AbortSignal from '../fetch/AbortSignal';
|
123
|
+
import IResponseBody from '../fetch/types/IResponseBody';
|
124
|
+
import IRequestInfo from '../fetch/types/IRequestInfo';
|
125
|
+
import IHeadersInit from '../fetch/types/IHeadersInit';
|
126
|
+
import RadioNodeList from '../nodes/html-form-element/RadioNodeList';
|
127
|
+
import ValidityState from '../validity-state/ValidityState';
|
117
128
|
/**
|
118
129
|
* Window without dependencies to server side specific packages.
|
119
130
|
*/
|
120
|
-
export default interface IWindow extends IEventTarget,
|
131
|
+
export default interface IWindow extends IEventTarget, INodeJSGlobal {
|
121
132
|
readonly happyDOM: {
|
122
133
|
whenAsyncComplete: () => Promise<void>;
|
123
134
|
cancelAsync: () => void;
|
@@ -204,6 +215,7 @@ export default interface IWindow extends IEventTarget, NodeJS.Global {
|
|
204
215
|
readonly Screen: typeof Screen;
|
205
216
|
readonly Storage: typeof Storage;
|
206
217
|
readonly HTMLCollection: typeof HTMLCollection;
|
218
|
+
readonly HTMLFormControlsCollection: typeof HTMLFormControlsCollection;
|
207
219
|
readonly NodeList: typeof NodeList;
|
208
220
|
readonly CSSUnitValue: typeof CSSUnitValue;
|
209
221
|
readonly CSS: CSS;
|
@@ -214,6 +226,7 @@ export default interface IWindow extends IEventTarget, NodeJS.Global {
|
|
214
226
|
readonly CSSKeyframesRule: typeof CSSKeyframesRule;
|
215
227
|
readonly CSSMediaRule: typeof CSSMediaRule;
|
216
228
|
readonly CSSStyleRule: typeof CSSStyleRule;
|
229
|
+
readonly CSSSupportsRule: typeof CSSSupportsRule;
|
217
230
|
readonly Selection: typeof Selection;
|
218
231
|
readonly Navigator: typeof Navigator;
|
219
232
|
readonly MimeType: typeof MimeType;
|
@@ -221,13 +234,13 @@ export default interface IWindow extends IEventTarget, NodeJS.Global {
|
|
221
234
|
readonly Plugin: typeof Plugin;
|
222
235
|
readonly PluginArray: typeof PluginArray;
|
223
236
|
readonly Headers: {
|
224
|
-
new (init?:
|
237
|
+
new (init?: IHeadersInit): IHeaders;
|
225
238
|
};
|
226
239
|
readonly Request: {
|
227
|
-
new (input:
|
240
|
+
new (input: IRequestInfo, init?: IRequestInit): IRequest;
|
228
241
|
};
|
229
242
|
readonly Response: {
|
230
|
-
new (body?:
|
243
|
+
new (body?: IResponseBody | null, init?: IResponseInit): IResponse;
|
231
244
|
};
|
232
245
|
readonly Range: typeof Range;
|
233
246
|
readonly DOMRect: typeof DOMRect;
|
@@ -235,6 +248,13 @@ export default interface IWindow extends IEventTarget, NodeJS.Global {
|
|
235
248
|
readonly XMLHttpRequestUpload: typeof XMLHttpRequestUpload;
|
236
249
|
readonly XMLHttpRequestEventTarget: typeof XMLHttpRequestEventTarget;
|
237
250
|
readonly FileList: typeof FileList;
|
251
|
+
readonly ReadableStream: typeof Stream.Readable;
|
252
|
+
readonly WritableStream: typeof Stream.Writable;
|
253
|
+
readonly FormData: typeof FormData;
|
254
|
+
readonly AbortController: typeof AbortController;
|
255
|
+
readonly AbortSignal: typeof AbortSignal;
|
256
|
+
readonly RadioNodeList: typeof RadioNodeList;
|
257
|
+
readonly ValidityState: typeof ValidityState;
|
238
258
|
onload: (event: Event) => void;
|
239
259
|
onerror: (event: ErrorEvent) => void;
|
240
260
|
readonly document: Document;
|
package/lib/window/Window.d.ts
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
/// <reference types="node" />
|
3
3
|
/// <reference types="node" />
|
4
4
|
/// <reference types="node" />
|
5
|
+
/// <reference types="node" />
|
5
6
|
import CustomElementRegistry from '../custom-element/CustomElementRegistry';
|
6
7
|
import Document from '../nodes/document/Document';
|
7
8
|
import HTMLDocument from '../nodes/html-document/HTMLDocument';
|
@@ -67,6 +68,7 @@ import CSSKeyframeRule from '../css/rules/CSSKeyframeRule';
|
|
67
68
|
import CSSKeyframesRule from '../css/rules/CSSKeyframesRule';
|
68
69
|
import CSSMediaRule from '../css/rules/CSSMediaRule';
|
69
70
|
import CSSStyleRule from '../css/rules/CSSStyleRule';
|
71
|
+
import CSSSupportsRule from '../css/rules/CSSSupportsRule';
|
70
72
|
import MouseEvent from '../event/events/MouseEvent';
|
71
73
|
import PointerEvent from '../event/events/PointerEvent';
|
72
74
|
import FocusEvent from '../event/events/FocusEvent';
|
@@ -80,15 +82,16 @@ import ErrorEvent from '../event/events/ErrorEvent';
|
|
80
82
|
import StorageEvent from '../event/events/StorageEvent';
|
81
83
|
import Screen from '../screen/Screen';
|
82
84
|
import AsyncTaskManager from '../async-task-manager/AsyncTaskManager';
|
83
|
-
import IResponse from '../fetch/IResponse';
|
84
|
-
import IResponseInit from '../fetch/IResponseInit';
|
85
|
-
import IRequest from '../fetch/IRequest';
|
86
|
-
import IRequestInit from '../fetch/IRequestInit';
|
87
|
-
import IHeaders from '../fetch/IHeaders';
|
88
|
-
import IHeadersInit from '../fetch/IHeadersInit';
|
85
|
+
import IResponse from '../fetch/types/IResponse';
|
86
|
+
import IResponseInit from '../fetch/types/IResponseInit';
|
87
|
+
import IRequest from '../fetch/types/IRequest';
|
88
|
+
import IRequestInit from '../fetch/types/IRequestInit';
|
89
|
+
import IHeaders from '../fetch/types/IHeaders';
|
90
|
+
import IHeadersInit from '../fetch/types/IHeadersInit';
|
89
91
|
import Storage from '../storage/Storage';
|
90
92
|
import IWindow from './IWindow';
|
91
93
|
import HTMLCollection from '../nodes/element/HTMLCollection';
|
94
|
+
import HTMLFormControlsCollection from '../nodes/html-form-element/HTMLFormControlsCollection';
|
92
95
|
import NodeList from '../nodes/node/NodeList';
|
93
96
|
import MediaQueryList from '../match-media/MediaQueryList';
|
94
97
|
import Selection from '../selection/Selection';
|
@@ -105,9 +108,17 @@ import Attr from '../nodes/attr/Attr';
|
|
105
108
|
import NamedNodeMap from '../named-node-map/NamedNodeMap';
|
106
109
|
import IElement from '../nodes/element/IElement';
|
107
110
|
import ProcessingInstruction from '../nodes/processing-instruction/ProcessingInstruction';
|
108
|
-
import RequestInfo from '../fetch/
|
111
|
+
import RequestInfo from '../fetch/types/IRequestInfo';
|
109
112
|
import FileList from '../nodes/html-input-element/FileList';
|
113
|
+
import Stream from 'stream';
|
114
|
+
import FormData from '../form-data/FormData';
|
115
|
+
import AbortController from '../fetch/AbortController';
|
116
|
+
import AbortSignal from '../fetch/AbortSignal';
|
117
|
+
import IResponseBody from '../fetch/types/IResponseBody';
|
118
|
+
import IRequestInfo from '../fetch/types/IRequestInfo';
|
110
119
|
import IHappyDOMOptions from './IHappyDOMOptions';
|
120
|
+
import RadioNodeList from '../nodes/html-form-element/RadioNodeList';
|
121
|
+
import ValidityState from '../validity-state/ValidityState';
|
111
122
|
/**
|
112
123
|
* Browser window.
|
113
124
|
*
|
@@ -222,6 +233,7 @@ export default class Window extends EventTarget implements IWindow {
|
|
222
233
|
readonly Storage: typeof Storage;
|
223
234
|
readonly URLSearchParams: typeof URLSearchParams;
|
224
235
|
readonly HTMLCollection: typeof HTMLCollection;
|
236
|
+
readonly HTMLFormControlsCollection: typeof HTMLFormControlsCollection;
|
225
237
|
readonly NodeList: typeof NodeList;
|
226
238
|
readonly CSSUnitValue: typeof CSSUnitValue;
|
227
239
|
readonly CSSRule: typeof CSSRule;
|
@@ -231,6 +243,7 @@ export default class Window extends EventTarget implements IWindow {
|
|
231
243
|
readonly CSSKeyframesRule: typeof CSSKeyframesRule;
|
232
244
|
readonly CSSMediaRule: typeof CSSMediaRule;
|
233
245
|
readonly CSSStyleRule: typeof CSSStyleRule;
|
246
|
+
readonly CSSSupportsRule: typeof CSSSupportsRule;
|
234
247
|
readonly Selection: typeof Selection;
|
235
248
|
readonly Navigator: typeof Navigator;
|
236
249
|
readonly MimeType: typeof MimeType;
|
@@ -242,16 +255,22 @@ export default class Window extends EventTarget implements IWindow {
|
|
242
255
|
new (init?: IHeadersInit): IHeaders;
|
243
256
|
};
|
244
257
|
readonly DOMRect: typeof DOMRect;
|
258
|
+
readonly RadioNodeList: typeof RadioNodeList;
|
259
|
+
readonly ValidityState: typeof ValidityState;
|
245
260
|
readonly Request: {
|
246
|
-
new (input:
|
247
|
-
href: string;
|
248
|
-
} | IRequest, init?: IRequestInit): IRequest;
|
261
|
+
new (input: IRequestInfo, init?: IRequestInit): IRequest;
|
249
262
|
};
|
250
263
|
readonly Response: {
|
251
|
-
new (body?:
|
264
|
+
new (body?: IResponseBody, init?: IResponseInit): IResponse;
|
252
265
|
};
|
253
266
|
readonly XMLHttpRequestUpload: typeof XMLHttpRequestUpload;
|
254
267
|
readonly XMLHttpRequestEventTarget: typeof XMLHttpRequestEventTarget;
|
268
|
+
readonly ReadableStream: typeof Stream.Readable;
|
269
|
+
readonly WritableStream: typeof Stream.Writable;
|
270
|
+
readonly TransformStream: typeof Stream.Transform;
|
271
|
+
readonly AbortController: typeof AbortController;
|
272
|
+
readonly AbortSignal: typeof AbortSignal;
|
273
|
+
readonly FormData: typeof FormData;
|
255
274
|
readonly XMLHttpRequest: any;
|
256
275
|
readonly DOMParser: any;
|
257
276
|
readonly Range: any;
|
@@ -320,6 +339,9 @@ export default class Window extends EventTarget implements IWindow {
|
|
320
339
|
decodeURIComponent: any;
|
321
340
|
encodeURI: any;
|
322
341
|
encodeURIComponent: any;
|
342
|
+
/**
|
343
|
+
* @deprecated
|
344
|
+
*/
|
323
345
|
escape: any;
|
324
346
|
global: any;
|
325
347
|
isFinite: any;
|
@@ -331,11 +353,12 @@ export default class Window extends EventTarget implements IWindow {
|
|
331
353
|
setImmediate: any;
|
332
354
|
queueMicrotask: any;
|
333
355
|
undefined: any;
|
356
|
+
/**
|
357
|
+
* @deprecated
|
358
|
+
*/
|
334
359
|
unescape: any;
|
335
360
|
gc: any;
|
336
361
|
v8debug: any;
|
337
|
-
AbortController: any;
|
338
|
-
AbortSignal: any;
|
339
362
|
Array: any;
|
340
363
|
Object: any;
|
341
364
|
Function: any;
|
@@ -436,7 +459,6 @@ export default class Window extends EventTarget implements IWindow {
|
|
436
459
|
/**
|
437
460
|
* Sets a timer which executes a function once the timer expires.
|
438
461
|
*
|
439
|
-
* @override
|
440
462
|
* @param callback Function to be executed.
|
441
463
|
* @param [delay=0] Delay in ms.
|
442
464
|
* @param args Arguments passed to the callback function.
|
@@ -446,14 +468,12 @@ export default class Window extends EventTarget implements IWindow {
|
|
446
468
|
/**
|
447
469
|
* Cancels a timeout previously established by calling setTimeout().
|
448
470
|
*
|
449
|
-
* @override
|
450
471
|
* @param id ID of the timeout.
|
451
472
|
*/
|
452
473
|
clearTimeout(id: NodeJS.Timeout): void;
|
453
474
|
/**
|
454
475
|
* Calls a function with a fixed time delay between each call.
|
455
476
|
*
|
456
|
-
* @override
|
457
477
|
* @param callback Function to be executed.
|
458
478
|
* @param [delay=0] Delay in ms.
|
459
479
|
* @param args Arguments passed to the callback function.
|
@@ -463,14 +483,12 @@ export default class Window extends EventTarget implements IWindow {
|
|
463
483
|
/**
|
464
484
|
* Cancels a timed repeating action which was previously established by a call to setInterval().
|
465
485
|
*
|
466
|
-
* @override
|
467
486
|
* @param id ID of the interval.
|
468
487
|
*/
|
469
488
|
clearInterval(id: NodeJS.Timeout): void;
|
470
489
|
/**
|
471
490
|
* Mock animation frames with timeouts.
|
472
491
|
*
|
473
|
-
* @override
|
474
492
|
* @param callback Callback.
|
475
493
|
* @returns Timeout ID.
|
476
494
|
*/
|
@@ -478,14 +496,12 @@ export default class Window extends EventTarget implements IWindow {
|
|
478
496
|
/**
|
479
497
|
* Mock animation frames with timeouts.
|
480
498
|
*
|
481
|
-
* @override
|
482
499
|
* @param id Timeout ID.
|
483
500
|
*/
|
484
501
|
cancelAnimationFrame(id: NodeJS.Timeout): void;
|
485
502
|
/**
|
486
503
|
* This method provides an easy, logical way to fetch resources asynchronously across the network.
|
487
504
|
*
|
488
|
-
* @override
|
489
505
|
* @param url URL.
|
490
506
|
* @param [init] Init.
|
491
507
|
* @returns Promise.
|