@ctrl/dom 0.0.0-stage → 0.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.
- package/LICENSE +21 -0
- package/NOTICE +338 -0
- package/README.md +362 -2
- package/dist/aria/_chunks/roles-list-CYZF-l9K.js +1503 -0
- package/dist/aria/_chunks/roles-list-D4WCyRO_.cjs +1754 -0
- package/dist/aria/index.cjs +232 -0
- package/dist/aria/index.js +198 -0
- package/dist/aria/internal.cjs +69 -0
- package/dist/aria/internal.js +30 -0
- package/dist/aria/types/accname.d.ts +40 -0
- package/dist/aria/types/data/aria-query.d.ts +61 -0
- package/dist/aria/types/data/aria-query.generated.d.ts +2 -0
- package/dist/aria/types/forms.d.ts +25 -0
- package/dist/aria/types/hidden.d.ts +38 -0
- package/dist/aria/types/index.d.ts +46 -0
- package/dist/aria/types/internal.d.ts +15 -0
- package/dist/aria/types/role.d.ts +27 -0
- package/dist/aria/types/roles-list.d.ts +18 -0
- package/dist/aria/types/states.d.ts +29 -0
- package/dist/aria/types/style.d.ts +18 -0
- package/dist/aria/types/tree.d.ts +20 -0
- package/dist/bridge/index.cjs +3 -0
- package/dist/bridge/index.js +4 -0
- package/dist/bridge/internal.cjs +3 -0
- package/dist/bridge/internal.js +4 -0
- package/dist/cli/_chunks/report-DdncYfuJ.js +93 -0
- package/dist/cli/ctrl-dom.js +199 -0
- package/dist/cli/jest-reporter.js +55 -0
- package/dist/cli/vitest-reporter.js +81 -0
- package/dist/dom/_chunks/src-DWP2w3IQ.js +47516 -0
- package/dist/dom/index.js +3 -0
- package/dist/dom/internal.js +434 -0
- package/dist/dom/types/collections/DOMStringMap.d.ts +8 -0
- package/dist/dom/types/collections/DOMTokenList.d.ts +33 -0
- package/dist/dom/types/collections/HTMLCollection.d.ts +62 -0
- package/dist/dom/types/collections/NamedNodeMap.d.ts +22 -0
- package/dist/dom/types/collections/NodeList.d.ts +43 -0
- package/dist/dom/types/collections/indexed.d.ts +8 -0
- package/dist/dom/types/collections/iterator.d.ts +8 -0
- package/dist/dom/types/css/CSS.d.ts +21 -0
- package/dist/dom/types/css/CSSStyleDeclaration.d.ts +57 -0
- package/dist/dom/types/css/cascade.d.ts +159 -0
- package/dist/dom/types/css/colors.d.ts +28 -0
- package/dist/dom/types/css/computed.d.ts +22 -0
- package/dist/dom/types/css/cssom.d.ts +363 -0
- package/dist/dom/types/css/data/properties.d.ts +1 -0
- package/dist/dom/types/css/declarations.d.ts +40 -0
- package/dist/dom/types/css/index.d.ts +5 -0
- package/dist/dom/types/css/inline-count.d.ts +2 -0
- package/dist/dom/types/css/internal.d.ts +11 -0
- package/dist/dom/types/css/layout-mode.d.ts +4 -0
- package/dist/dom/types/css/layout.d.ts +63 -0
- package/dist/dom/types/css/media.d.ts +55 -0
- package/dist/dom/types/css/parser.d.ts +93 -0
- package/dist/dom/types/css/properties.d.ts +28 -0
- package/dist/dom/types/css/resize-observer.d.ts +19 -0
- package/dist/dom/types/css/selector-info.d.ts +13 -0
- package/dist/dom/types/css/shorthands.d.ts +33 -0
- package/dist/dom/types/css/stylesheets.d.ts +93 -0
- package/dist/dom/types/css/supports.d.ts +4 -0
- package/dist/dom/types/css/tokenizer.d.ts +91 -0
- package/dist/dom/types/css/values.d.ts +91 -0
- package/dist/dom/types/css/view.d.ts +44 -0
- package/dist/dom/types/events/DataTransfer.d.ts +62 -0
- package/dist/dom/types/events/Event.d.ts +115 -0
- package/dist/dom/types/events/EventTarget.d.ts +22 -0
- package/dist/dom/types/events/UIEvents.d.ts +308 -0
- package/dist/dom/types/events/activation.d.ts +7 -0
- package/dist/dom/types/events/convert.d.ts +16 -0
- package/dist/dom/types/events/createEvent.d.ts +3 -0
- package/dist/dom/types/events/dispatch.d.ts +39 -0
- package/dist/dom/types/events/events.d.ts +200 -0
- package/dist/dom/types/events/fire.d.ts +21 -0
- package/dist/dom/types/events/handlers.d.ts +14 -0
- package/dist/dom/types/events/listeners.d.ts +32 -0
- package/dist/dom/types/events/report.d.ts +10 -0
- package/dist/dom/types/html/HTMLElement.d.ts +126 -0
- package/dist/dom/types/html/MathMLElement.d.ts +6 -0
- package/dist/dom/types/html/SVGElement.d.ts +145 -0
- package/dist/dom/types/html/anchor.d.ts +16 -0
- package/dist/dom/types/html/aria-reflection.d.ts +14 -0
- package/dist/dom/types/html/collection.d.ts +5 -0
- package/dist/dom/types/html/custom-elements.d.ts +129 -0
- package/dist/dom/types/html/elements.d.ts +202 -0
- package/dist/dom/types/html/events.d.ts +22 -0
- package/dist/dom/types/html/focus.d.ts +63 -0
- package/dist/dom/types/html/forms/FileList.d.ts +1 -0
- package/dist/dom/types/html/forms/FormData.d.ts +7 -0
- package/dist/dom/types/html/forms/HTMLButtonElement.d.ts +36 -0
- package/dist/dom/types/html/forms/HTMLFieldSetElement.d.ts +29 -0
- package/dist/dom/types/html/forms/HTMLFormElement.d.ts +61 -0
- package/dist/dom/types/html/forms/HTMLInputElement.d.ts +204 -0
- package/dist/dom/types/html/forms/HTMLLabelElement.d.ts +15 -0
- package/dist/dom/types/html/forms/HTMLOptionElement.d.ts +61 -0
- package/dist/dom/types/html/forms/HTMLOutputElement.d.ts +74 -0
- package/dist/dom/types/html/forms/HTMLSelectElement.d.ts +96 -0
- package/dist/dom/types/html/forms/HTMLTextAreaElement.d.ts +82 -0
- package/dist/dom/types/html/forms/autofill.d.ts +10 -0
- package/dist/dom/types/html/forms/collections.d.ts +112 -0
- package/dist/dom/types/html/forms/common.d.ts +36 -0
- package/dist/dom/types/html/forms/face.d.ts +59 -0
- package/dist/dom/types/html/forms/form-associated.d.ts +46 -0
- package/dist/dom/types/html/forms/form-submission.d.ts +55 -0
- package/dist/dom/types/html/forms/index.d.ts +17 -0
- package/dist/dom/types/html/forms/input-type.d.ts +50 -0
- package/dist/dom/types/html/forms/microsyntaxes.d.ts +52 -0
- package/dist/dom/types/html/forms/state.d.ts +54 -0
- package/dist/dom/types/html/forms/ui.d.ts +35 -0
- package/dist/dom/types/html/forms/user-validity.d.ts +19 -0
- package/dist/dom/types/html/forms/validation.d.ts +76 -0
- package/dist/dom/types/html/index.d.ts +13 -0
- package/dist/dom/types/html/innerText.d.ts +9 -0
- package/dist/dom/types/html/interactive.d.ts +43 -0
- package/dist/dom/types/html/invokers.d.ts +39 -0
- package/dist/dom/types/html/media.d.ts +86 -0
- package/dist/dom/types/html/reflect.d.ts +67 -0
- package/dist/dom/types/html/registry.d.ts +9 -0
- package/dist/dom/types/html/resources.d.ts +55 -0
- package/dist/dom/types/html/shared.d.ts +22 -0
- package/dist/dom/types/html/slot.d.ts +15 -0
- package/dist/dom/types/html/template.d.ts +18 -0
- package/dist/dom/types/html/top-layer.d.ts +73 -0
- package/dist/dom/types/index.d.ts +50 -0
- package/dist/dom/types/internal.d.ts +61 -0
- package/dist/dom/types/keys.d.ts +209 -0
- package/dist/dom/types/nodes/Attr.d.ts +25 -0
- package/dist/dom/types/nodes/CharacterData.d.ts +35 -0
- package/dist/dom/types/nodes/Document.d.ts +169 -0
- package/dist/dom/types/nodes/DocumentFragment.d.ts +12 -0
- package/dist/dom/types/nodes/DocumentType.d.ts +17 -0
- package/dist/dom/types/nodes/Element.d.ts +142 -0
- package/dist/dom/types/nodes/Node.d.ts +112 -0
- package/dist/dom/types/nodes/NodeImpl.d.ts +90 -0
- package/dist/dom/types/nodes/ShadowRoot.d.ts +43 -0
- package/dist/dom/types/nodes/attr-nodes.d.ts +8 -0
- package/dist/dom/types/nodes/attributes.d.ts +46 -0
- package/dist/dom/types/nodes/cache.d.ts +38 -0
- package/dist/dom/types/nodes/character-data.d.ts +5 -0
- package/dist/dom/types/nodes/clone.d.ts +5 -0
- package/dist/dom/types/nodes/constants.d.ts +52 -0
- package/dist/dom/types/nodes/create.d.ts +42 -0
- package/dist/dom/types/nodes/derived.d.ts +26 -0
- package/dist/dom/types/nodes/inspect.d.ts +2 -0
- package/dist/dom/types/nodes/mixins.d.ts +41 -0
- package/dist/dom/types/nodes/names.d.ts +15 -0
- package/dist/dom/types/nodes/slots.d.ts +38 -0
- package/dist/dom/types/nodes/tags.d.ts +8 -0
- package/dist/dom/types/nodes/traverse.d.ts +21 -0
- package/dist/dom/types/nodes/tree.d.ts +47 -0
- package/dist/dom/types/observers/MutationObserver.d.ts +33 -0
- package/dist/dom/types/observers/MutationRecord.d.ts +17 -0
- package/dist/dom/types/observers/queue.d.ts +45 -0
- package/dist/dom/types/parser/entities-data.d.ts +3 -0
- package/dist/dom/types/parser/entities.d.ts +11 -0
- package/dist/dom/types/parser/index.d.ts +34 -0
- package/dist/dom/types/parser/tags.d.ts +182 -0
- package/dist/dom/types/parser/tokenizer.d.ts +109 -0
- package/dist/dom/types/parser/treebuilder.d.ts +271 -0
- package/dist/dom/types/parser/xml.d.ts +14 -0
- package/dist/dom/types/selectors/compile.d.ts +154 -0
- package/dist/dom/types/selectors/filter.d.ts +21 -0
- package/dist/dom/types/selectors/html-predicates.d.ts +1 -0
- package/dist/dom/types/selectors/index.d.ts +16 -0
- package/dist/dom/types/selectors/internal.d.ts +87 -0
- package/dist/dom/types/selectors/parser.d.ts +310 -0
- package/dist/dom/types/selectors/serialize.d.ts +20 -0
- package/dist/dom/types/selectors/state.d.ts +43 -0
- package/dist/dom/types/serializer/index.d.ts +29 -0
- package/dist/dom/types/trace.d.ts +51 -0
- package/dist/dom/types/traversal/Range.d.ts +113 -0
- package/dist/dom/types/traversal/Selection.d.ts +45 -0
- package/dist/dom/types/traversal/TreeWalker.d.ts +77 -0
- package/dist/dom/types/traversal/live.d.ts +46 -0
- package/dist/dom/types/webidl-runtime.d.ts +18 -0
- package/dist/dom/types/webidl.d.ts +34 -0
- package/dist/dom/types/window/DOMStringList.d.ts +14 -0
- package/dist/dom/types/window/FileList.d.ts +11 -0
- package/dist/dom/types/window/FileReader.d.ts +27 -0
- package/dist/dom/types/window/History.d.ts +43 -0
- package/dist/dom/types/window/Location.d.ts +46 -0
- package/dist/dom/types/window/Navigator.d.ts +79 -0
- package/dist/dom/types/window/Screen.d.ts +27 -0
- package/dist/dom/types/window/Storage.d.ts +28 -0
- package/dist/dom/types/window/Window.d.ts +329 -0
- package/dist/dom/types/window/abort.d.ts +4 -0
- package/dist/dom/types/window/browsing-context.d.ts +12 -0
- package/dist/dom/types/window/clock.d.ts +153 -0
- package/dist/dom/types/window/compat.d.ts +34 -0
- package/dist/dom/types/window/cookies.d.ts +21 -0
- package/dist/dom/types/window/current.d.ts +7 -0
- package/dist/dom/types/window/document.d.ts +19 -0
- package/dist/dom/types/window/events.d.ts +11 -0
- package/dist/dom/types/window/fallbacks.d.ts +20 -0
- package/dist/dom/types/window/geometry.d.ts +133 -0
- package/dist/dom/types/window/globals.d.ts +7 -0
- package/dist/dom/types/window/hooks.d.ts +22 -0
- package/dist/dom/types/window/host-originals.d.ts +9 -0
- package/dist/dom/types/window/interfaces.d.ts +13 -0
- package/dist/dom/types/window/isolation.d.ts +20 -0
- package/dist/dom/types/window/media.d.ts +33 -0
- package/dist/dom/types/window/not-implemented.d.ts +23 -0
- package/dist/dom/types/window/observers.d.ts +42 -0
- package/dist/dom/types/window/origin.d.ts +3 -0
- package/dist/dom/types/window/timers.d.ts +28 -0
- package/dist/dom/types/window/xhr.d.ts +108 -0
- package/dist/jest-dom/_chunks/matchers-CDnnXUfG.js +2211 -0
- package/dist/jest-dom/_chunks/matchers-D988Ducb.cjs +2516 -0
- package/dist/jest-dom/index.cjs +5 -0
- package/dist/jest-dom/index.js +6 -0
- package/dist/jest-dom/jest-globals.cjs +6 -0
- package/dist/jest-dom/jest-globals.js +7 -0
- package/dist/jest-dom/matchers.cjs +53 -0
- package/dist/jest-dom/matchers.js +3 -0
- package/dist/jest-dom/types/bun.d.ts +13 -0
- package/dist/jest-dom/types/index.d.ts +3 -0
- package/dist/jest-dom/types/jest-globals.d.ts +13 -0
- package/dist/jest-dom/types/jest.d.ts +15 -0
- package/dist/jest-dom/types/matchers-standalone.d.ts +32 -0
- package/dist/jest-dom/types/matchers.d.ts +1079 -0
- package/dist/jest-dom/types/package.json +1 -0
- package/dist/jest-dom/types/vitest.d.ts +16 -0
- package/dist/jest-dom/vitest.cjs +6 -0
- package/dist/jest-dom/vitest.js +7 -0
- package/dist/react/_chunks/pure-DZ97z2oT.cjs +498 -0
- package/dist/react/_chunks/pure-PtE2hivW.js +420 -0
- package/dist/react/dont-cleanup-after-each.cjs +3 -0
- package/dist/react/dont-cleanup-after-each.js +4 -0
- package/dist/react/index.cjs +47 -0
- package/dist/react/index.js +35 -0
- package/dist/react/pure.cjs +17 -0
- package/dist/react/pure.js +5 -0
- package/dist/react/types/act-compat.d.ts +6 -0
- package/dist/react/types/config.d.ts +9 -0
- package/dist/react/types/dont-cleanup-after-each.d.ts +1 -0
- package/dist/react/types/dtl.d.ts +1 -0
- package/dist/react/types/fire-event.d.ts +3 -0
- package/dist/react/types/index.d.ts +1 -0
- package/dist/react/types/pure.d.ts +136 -0
- package/dist/register/index.js +11 -0
- package/dist/register/pure.js +147 -0
- package/dist/register/types/index.d.ts +1 -0
- package/dist/register/types/pure.d.ts +36 -0
- package/dist/testing-library/_chunks/aria-snapshot-diff-D7PzpXew.cjs +1170 -0
- package/dist/testing-library/_chunks/aria-snapshot-diff-Q8Wj33K0.js +985 -0
- package/dist/testing-library/agent.cjs +721 -0
- package/dist/testing-library/agent.js +713 -0
- package/dist/testing-library/index.cjs +2469 -0
- package/dist/testing-library/index.js +2390 -0
- package/dist/testing-library/types/agent.d.ts +56 -0
- package/dist/testing-library/types/aria-role.d.ts +99 -0
- package/dist/testing-library/types/aria-snapshot.d.ts +43 -0
- package/dist/testing-library/types/config.d.ts +27 -0
- package/dist/testing-library/types/events.d.ts +118 -0
- package/dist/testing-library/types/get-node-text.d.ts +1 -0
- package/dist/testing-library/types/get-queries-for-element.d.ts +182 -0
- package/dist/testing-library/types/index.d.ts +24 -0
- package/dist/testing-library/types/matches.d.ts +46 -0
- package/dist/testing-library/types/pretty-dom.d.ts +37 -0
- package/dist/testing-library/types/queries.d.ts +315 -0
- package/dist/testing-library/types/query-helpers.d.ts +112 -0
- package/dist/testing-library/types/role-helpers.d.ts +19 -0
- package/dist/testing-library/types/screen.d.ts +30 -0
- package/dist/testing-library/types/suggestions.d.ts +46 -0
- package/dist/testing-library/types/wait-for-element-to-be-removed.d.ts +6 -0
- package/dist/testing-library/types/wait-for.d.ts +12 -0
- package/dist/user-event/index.cjs +3910 -0
- package/dist/user-event/index.js +3885 -0
- package/dist/user-event/types/clipboard/copy.d.ts +2 -0
- package/dist/user-event/types/clipboard/cut.d.ts +2 -0
- package/dist/user-event/types/clipboard/index.d.ts +3 -0
- package/dist/user-event/types/clipboard/paste.d.ts +3 -0
- package/dist/user-event/types/convenience/click.d.ts +5 -0
- package/dist/user-event/types/convenience/hover.d.ts +4 -0
- package/dist/user-event/types/convenience/index.d.ts +3 -0
- package/dist/user-event/types/convenience/tab.d.ts +4 -0
- package/dist/user-event/types/ctrl-dom.d.ts +50 -0
- package/dist/user-event/types/document/UI.d.ts +35 -0
- package/dist/user-event/types/document/copySelection.d.ts +2 -0
- package/dist/user-event/types/document/getValueOrTextContent.d.ts +2 -0
- package/dist/user-event/types/document/index.d.ts +5 -0
- package/dist/user-event/types/document/interceptor.d.ts +20 -0
- package/dist/user-event/types/document/patchFocus.d.ts +7 -0
- package/dist/user-event/types/document/prepareDocument.d.ts +2 -0
- package/dist/user-event/types/document/trackValue.d.ts +13 -0
- package/dist/user-event/types/dom-types.d.ts +56 -0
- package/dist/user-event/types/event/behavior/click.d.ts +1 -0
- package/dist/user-event/types/event/behavior/cut.d.ts +1 -0
- package/dist/user-event/types/event/behavior/index.d.ts +8 -0
- package/dist/user-event/types/event/behavior/keydown.d.ts +1 -0
- package/dist/user-event/types/event/behavior/keypress.d.ts +1 -0
- package/dist/user-event/types/event/behavior/keyup.d.ts +1 -0
- package/dist/user-event/types/event/behavior/paste.d.ts +1 -0
- package/dist/user-event/types/event/behavior/registry.d.ts +9 -0
- package/dist/user-event/types/event/createEvent.d.ts +8 -0
- package/dist/user-event/types/event/dispatchEvent.d.ts +6 -0
- package/dist/user-event/types/event/eventMap.d.ts +265 -0
- package/dist/user-event/types/event/focus.d.ts +6 -0
- package/dist/user-event/types/event/index.d.ts +7 -0
- package/dist/user-event/types/event/input.d.ts +3 -0
- package/dist/user-event/types/event/radio.d.ts +5 -0
- package/dist/user-event/types/event/selection/getInputRange.d.ts +6 -0
- package/dist/user-event/types/event/selection/getTargetTypeAndSelection.d.ts +11 -0
- package/dist/user-event/types/event/selection/index.d.ts +15 -0
- package/dist/user-event/types/event/selection/modifySelection.d.ts +9 -0
- package/dist/user-event/types/event/selection/modifySelectionPerMouse.d.ts +8 -0
- package/dist/user-event/types/event/selection/moveSelection.d.ts +5 -0
- package/dist/user-event/types/event/selection/resolveCaretPosition.d.ts +9 -0
- package/dist/user-event/types/event/selection/selectAll.d.ts +6 -0
- package/dist/user-event/types/event/selection/setSelection.d.ts +11 -0
- package/dist/user-event/types/event/selection/setSelectionPerMouse.d.ts +9 -0
- package/dist/user-event/types/event/selection/setSelectionRange.d.ts +7 -0
- package/dist/user-event/types/event/selection/updateSelectionOnFocus.d.ts +6 -0
- package/dist/user-event/types/event/types.d.ts +21 -0
- package/dist/user-event/types/event/wrapEvent.d.ts +2 -0
- package/dist/user-event/types/index.d.ts +6 -0
- package/dist/user-event/types/keyboard/index.d.ts +3 -0
- package/dist/user-event/types/keyboard/keyMap.d.ts +5 -0
- package/dist/user-event/types/keyboard/parseKeyDef.d.ts +17 -0
- package/dist/user-event/types/options.d.ts +121 -0
- package/dist/user-event/types/pointer/index.d.ts +29 -0
- package/dist/user-event/types/pointer/keyMap.d.ts +2 -0
- package/dist/user-event/types/pointer/parseKeyDef.d.ts +6 -0
- package/dist/user-event/types/setup/api.d.ts +23 -0
- package/dist/user-event/types/setup/directApi.d.ts +25 -0
- package/dist/user-event/types/setup/dtl.d.ts +20 -0
- package/dist/user-event/types/setup/index.d.ts +22 -0
- package/dist/user-event/types/setup/setup.d.ts +45 -0
- package/dist/user-event/types/setup/wrapAsync.d.ts +4 -0
- package/dist/user-event/types/system/index.d.ts +13 -0
- package/dist/user-event/types/system/keyLocation.d.ts +11 -0
- package/dist/user-event/types/system/keyboard.d.ts +46 -0
- package/dist/user-event/types/system/pointer/buttons.d.ts +25 -0
- package/dist/user-event/types/system/pointer/device.d.ts +8 -0
- package/dist/user-event/types/system/pointer/index.d.ts +21 -0
- package/dist/user-event/types/system/pointer/mouse.d.ts +31 -0
- package/dist/user-event/types/system/pointer/pointer.d.ts +32 -0
- package/dist/user-event/types/system/pointer/shared.d.ts +21 -0
- package/dist/user-event/types/utility/clear.d.ts +3 -0
- package/dist/user-event/types/utility/index.d.ts +4 -0
- package/dist/user-event/types/utility/selectOptions.d.ts +4 -0
- package/dist/user-event/types/utility/type.d.ts +10 -0
- package/dist/user-event/types/utility/upload.d.ts +6 -0
- package/dist/user-event/types/utils/click/isClickableInput.d.ts +17 -0
- package/dist/user-event/types/utils/dataTransfer/Blob.d.ts +4 -0
- package/dist/user-event/types/utils/dataTransfer/Clipboard.d.ts +12 -0
- package/dist/user-event/types/utils/dataTransfer/DataTransfer.d.ts +3 -0
- package/dist/user-event/types/utils/dataTransfer/FileList.d.ts +2 -0
- package/dist/user-event/types/utils/edit/isContentEditable.d.ts +8 -0
- package/dist/user-event/types/utils/edit/isEditable.d.ts +26 -0
- package/dist/user-event/types/utils/edit/maxLength.d.ts +16 -0
- package/dist/user-event/types/utils/edit/setFiles.d.ts +11 -0
- package/dist/user-event/types/utils/edit/timeValue.d.ts +5 -0
- package/dist/user-event/types/utils/focus/cursor.d.ts +5 -0
- package/dist/user-event/types/utils/focus/getActiveElement.d.ts +3 -0
- package/dist/user-event/types/utils/focus/getTabDestination.d.ts +2 -0
- package/dist/user-event/types/utils/focus/isFocusable.d.ts +2 -0
- package/dist/user-event/types/utils/focus/selection.d.ts +9 -0
- package/dist/user-event/types/utils/focus/selector.d.ts +1 -0
- package/dist/user-event/types/utils/index.d.ts +29 -0
- package/dist/user-event/types/utils/keyDef/readNextDescriptor.d.ts +21 -0
- package/dist/user-event/types/utils/misc/cloneEvent.d.ts +2 -0
- package/dist/user-event/types/utils/misc/findClosest.d.ts +2 -0
- package/dist/user-event/types/utils/misc/getDocumentFromNode.d.ts +2 -0
- package/dist/user-event/types/utils/misc/getTreeDiff.d.ts +2 -0
- package/dist/user-event/types/utils/misc/getWindow.d.ts +2 -0
- package/dist/user-event/types/utils/misc/isDescendantOrSelf.d.ts +2 -0
- package/dist/user-event/types/utils/misc/isDisabled.d.ts +2 -0
- package/dist/user-event/types/utils/misc/isElementType.d.ts +6 -0
- package/dist/user-event/types/utils/misc/isVisible.d.ts +2 -0
- package/dist/user-event/types/utils/misc/level.d.ts +9 -0
- package/dist/user-event/types/utils/misc/wait.d.ts +6 -0
- package/dist/user-event/types/utils/pointer/cssPointerEvents.d.ts +4 -0
- package/dist/vitest-environment/failure-snapshot.js +42 -0
- package/dist/vitest-environment/index.js +185 -0
- package/dist/vitest-environment/plugin.js +90 -0
- package/dist/vitest-environment/types/failure-snapshot.d.ts +1 -0
- package/dist/vitest-environment/types/index.d.ts +29 -0
- package/dist/vitest-environment/types/plugin.d.ts +33 -0
- package/jest-preset.cjs +17 -0
- package/package.json +177 -3
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
export interface DOMPointInit {
|
|
2
|
+
x?: number;
|
|
3
|
+
y?: number;
|
|
4
|
+
z?: number;
|
|
5
|
+
w?: number;
|
|
6
|
+
}
|
|
7
|
+
import { $height, $is2D, $m, $rects, $w, $width, $x, $y, $z } from "../keys.js";
|
|
8
|
+
export declare class DOMPointReadOnly {
|
|
9
|
+
[$x]: number;
|
|
10
|
+
[$y]: number;
|
|
11
|
+
[$z]: number;
|
|
12
|
+
[$w]: number;
|
|
13
|
+
constructor(x?: number, y?: number, z?: number, w?: number);
|
|
14
|
+
static fromPoint(other?: DOMPointInit): DOMPointReadOnly;
|
|
15
|
+
get x(): number;
|
|
16
|
+
get y(): number;
|
|
17
|
+
get z(): number;
|
|
18
|
+
get w(): number;
|
|
19
|
+
matrixTransform(matrix: DOMMatrixReadOnly): DOMPoint;
|
|
20
|
+
toJSON(): Required<DOMPointInit>;
|
|
21
|
+
}
|
|
22
|
+
export declare class DOMPoint extends DOMPointReadOnly {
|
|
23
|
+
static fromPoint(other?: DOMPointInit): DOMPoint;
|
|
24
|
+
get x(): number;
|
|
25
|
+
set x(v: number);
|
|
26
|
+
get y(): number;
|
|
27
|
+
set y(v: number);
|
|
28
|
+
get z(): number;
|
|
29
|
+
set z(v: number);
|
|
30
|
+
get w(): number;
|
|
31
|
+
set w(v: number);
|
|
32
|
+
}
|
|
33
|
+
export interface DOMRectInit {
|
|
34
|
+
x?: number;
|
|
35
|
+
y?: number;
|
|
36
|
+
width?: number;
|
|
37
|
+
height?: number;
|
|
38
|
+
}
|
|
39
|
+
export declare class DOMRectReadOnly {
|
|
40
|
+
[$x]: number;
|
|
41
|
+
[$y]: number;
|
|
42
|
+
[$width]: number;
|
|
43
|
+
[$height]: number;
|
|
44
|
+
constructor(x?: number, y?: number, width?: number, height?: number);
|
|
45
|
+
static fromRect(other?: DOMRectInit): DOMRectReadOnly;
|
|
46
|
+
get x(): number;
|
|
47
|
+
get y(): number;
|
|
48
|
+
get width(): number;
|
|
49
|
+
get height(): number;
|
|
50
|
+
get top(): number;
|
|
51
|
+
get right(): number;
|
|
52
|
+
get bottom(): number;
|
|
53
|
+
get left(): number;
|
|
54
|
+
toJSON(): Record<string, number>;
|
|
55
|
+
}
|
|
56
|
+
export declare class DOMRect extends DOMRectReadOnly {
|
|
57
|
+
static fromRect(other?: DOMRectInit): DOMRect;
|
|
58
|
+
get x(): number;
|
|
59
|
+
set x(v: number);
|
|
60
|
+
get y(): number;
|
|
61
|
+
set y(v: number);
|
|
62
|
+
get width(): number;
|
|
63
|
+
set width(v: number);
|
|
64
|
+
get height(): number;
|
|
65
|
+
set height(v: number);
|
|
66
|
+
}
|
|
67
|
+
/** https://drafts.fxtf.org/geometry/#domrectlist */
|
|
68
|
+
export declare class DOMRectList {
|
|
69
|
+
[$rects]: DOMRect[];
|
|
70
|
+
[index: number]: DOMRect;
|
|
71
|
+
constructor(rects?: DOMRect[]);
|
|
72
|
+
get length(): number;
|
|
73
|
+
item(index: number): DOMRect | null;
|
|
74
|
+
[Symbol.iterator](): IterableIterator<DOMRect>;
|
|
75
|
+
}
|
|
76
|
+
/** https://drafts.fxtf.org/geometry/#dommatrixreadonly — storage is column-major m11..m44. */
|
|
77
|
+
export declare class DOMMatrixReadOnly {
|
|
78
|
+
[$m]: number[];
|
|
79
|
+
[$is2D]: boolean;
|
|
80
|
+
constructor(init?: string | number[]);
|
|
81
|
+
static fromMatrix(other?: Partial<Record<string, number>>): DOMMatrixReadOnly;
|
|
82
|
+
static fromFloat64Array(array: Float64Array): DOMMatrixReadOnly;
|
|
83
|
+
static fromFloat32Array(array: Float32Array): DOMMatrixReadOnly;
|
|
84
|
+
get a(): number;
|
|
85
|
+
get b(): number;
|
|
86
|
+
get c(): number;
|
|
87
|
+
get d(): number;
|
|
88
|
+
get e(): number;
|
|
89
|
+
get f(): number;
|
|
90
|
+
get m11(): number;
|
|
91
|
+
get m12(): number;
|
|
92
|
+
get m13(): number;
|
|
93
|
+
get m14(): number;
|
|
94
|
+
get m21(): number;
|
|
95
|
+
get m22(): number;
|
|
96
|
+
get m23(): number;
|
|
97
|
+
get m24(): number;
|
|
98
|
+
get m31(): number;
|
|
99
|
+
get m32(): number;
|
|
100
|
+
get m33(): number;
|
|
101
|
+
get m34(): number;
|
|
102
|
+
get m41(): number;
|
|
103
|
+
get m42(): number;
|
|
104
|
+
get m43(): number;
|
|
105
|
+
get m44(): number;
|
|
106
|
+
get is2D(): boolean;
|
|
107
|
+
get isIdentity(): boolean;
|
|
108
|
+
multiply(other: DOMMatrixReadOnly): DOMMatrix;
|
|
109
|
+
translate(tx?: number, ty?: number, tz?: number): DOMMatrix;
|
|
110
|
+
scale(sx?: number, sy?: number, sz?: number): DOMMatrix;
|
|
111
|
+
/** 2D inverse (3D matrices other than affine 2D return NaN-filled matrices, as unsupported). */
|
|
112
|
+
inverse(): DOMMatrix;
|
|
113
|
+
transformPoint(point?: DOMPointInit): DOMPoint;
|
|
114
|
+
toFloat64Array(): Float64Array;
|
|
115
|
+
toFloat32Array(): Float32Array;
|
|
116
|
+
toJSON(): Record<string, number | boolean>;
|
|
117
|
+
toString(): string;
|
|
118
|
+
}
|
|
119
|
+
export declare class DOMMatrix extends DOMMatrixReadOnly {
|
|
120
|
+
static fromMatrix(other?: Partial<Record<string, number>>): DOMMatrix;
|
|
121
|
+
get a(): number;
|
|
122
|
+
set a(v: number);
|
|
123
|
+
get b(): number;
|
|
124
|
+
set b(v: number);
|
|
125
|
+
get c(): number;
|
|
126
|
+
set c(v: number);
|
|
127
|
+
get d(): number;
|
|
128
|
+
set d(v: number);
|
|
129
|
+
get e(): number;
|
|
130
|
+
set e(v: number);
|
|
131
|
+
get f(): number;
|
|
132
|
+
set f(v: number);
|
|
133
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Window } from "./Window.js";
|
|
2
|
+
/**
|
|
3
|
+
* Make `window` the host global, exposing what its compat profile allows (window/compat.ts).
|
|
4
|
+
* Returns `uninstall()`, which restores every property it replaced, the shared prototypes'
|
|
5
|
+
* profile-gated members and the previously current window.
|
|
6
|
+
*/
|
|
7
|
+
export declare function installGlobals(window: Window, target?: Record<PropertyKey, unknown>): () => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Element } from "../nodes/Element.js";
|
|
2
|
+
import type { Window } from "./Window.js";
|
|
3
|
+
export interface MediaFeatureEnvironment {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
devicePixelRatio: number;
|
|
7
|
+
/** "screen" for windows; "print" while printing (never, here). */
|
|
8
|
+
mediaType: string;
|
|
9
|
+
/** Per-window overrides from `createWindow({ mediaFeatures })`, e.g. { "prefers-color-scheme": "dark" }. */
|
|
10
|
+
features: Record<string, string | number> | null;
|
|
11
|
+
}
|
|
12
|
+
export interface WindowHooks {
|
|
13
|
+
/** css: https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle */
|
|
14
|
+
getComputedStyle: ((element: Element, pseudoElement: string | null | undefined, window: Window) => unknown) | null;
|
|
15
|
+
/** css: evaluate a media query list (https://drafts.csswg.org/mediaqueries/#evaluating) against `env`. */
|
|
16
|
+
evaluateMediaQuery: ((query: string, env: MediaFeatureEnvironment) => boolean) | null;
|
|
17
|
+
/** html-elements: create the window's CustomElementRegistry on first `window.customElements` access. */
|
|
18
|
+
createCustomElementRegistry: ((window: Window) => unknown) | null;
|
|
19
|
+
/** css: how computed colors serialize ("specified" keeps the author's text, "rgb" resolves). */
|
|
20
|
+
setComputedColorMode: ((mode: "specified" | "rgb") => void) | null;
|
|
21
|
+
}
|
|
22
|
+
export declare const windowHooks: WindowHooks;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const hostOriginals: Map<string, unknown>;
|
|
2
|
+
/** Record `value` as the host's original for `key` (first capture wins). */
|
|
3
|
+
export declare function recordHostOriginal(key: string, value: unknown): void;
|
|
4
|
+
/**
|
|
5
|
+
* The bound Window methods installGlobals puts on a host global (`window.getComputedStyle` there
|
|
6
|
+
* is `Window.prototype.getComputedStyle.bind(window)`), so code can tell them from user
|
|
7
|
+
* replacements and spies by identity.
|
|
8
|
+
*/
|
|
9
|
+
export declare const installedWindowMethods: WeakSet<object>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Called once by src/index.ts with its module namespace. */
|
|
2
|
+
export declare function registerDomNamespace(namespace: object): void;
|
|
3
|
+
/** name → interface object (or namespace object such as CSS). */
|
|
4
|
+
export type InterfaceMap = Record<string, unknown>;
|
|
5
|
+
/** The NOT_ON_WINDOW interface objects, for installGlobals. */
|
|
6
|
+
export declare function optInInterfaces(): InterfaceMap;
|
|
7
|
+
export declare function ensureInterfaces(proto: object, fallbacks?: InterfaceMap): InterfaceMap;
|
|
8
|
+
type EventConstructor = new (type: string, init?: Record<string, unknown>) => import("../events/Event.js").Event;
|
|
9
|
+
/** An Event subclass exported by `@ctrl/dom` (events area), looked up lazily. */
|
|
10
|
+
export declare function eventInterface(name: string): EventConstructor;
|
|
11
|
+
/** Look up an optional public export of `@ctrl/dom` by name (lazy: areas land in parallel). */
|
|
12
|
+
export declare function domExport<T = unknown>(name: string): T | undefined;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Record the pristine interface state (first call wins; later calls are no-ops). */
|
|
2
|
+
export declare function captureInterfaceBaseline(): void;
|
|
3
|
+
type RealmGlobal = {
|
|
4
|
+
Object: ObjectConstructor;
|
|
5
|
+
Reflect: typeof Reflect;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Make properties a test file defines on interface objects and prototypes configurable, so
|
|
9
|
+
* `restoreInterfaces()` can undo them. `Object.defineProperty`/`defineProperties` default to
|
|
10
|
+
* non-configurable: shadow-dom-testing-library adds `ShadowRoot.prototype.outerHTML` that way,
|
|
11
|
+
* the getter outlived its file, and the next file in the worker crashed reading
|
|
12
|
+
* `ShadowRoot.prototype.outerHTML` (it calls the getter on the prototype). Patches `realm`'s own
|
|
13
|
+
* `Object.defineProperty`, `Object.defineProperties` and `Reflect.defineProperty` (a test file's
|
|
14
|
+
* vm global has its own intrinsics; @ctrl/dom's code in the outer realm is unaffected). Call after
|
|
15
|
+
* `captureInterfaceBaseline()`. docs/deviations.md.
|
|
16
|
+
*/
|
|
17
|
+
export declare function guardInterfaceDefinitions(realm: RealmGlobal): void;
|
|
18
|
+
/** Undo every change made to interface objects/prototypes since the baseline. Returns how many properties were restored. */
|
|
19
|
+
export declare function restoreInterfaces(): number;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { EventTarget } from "../events/EventTarget.js";
|
|
2
|
+
import type { AddEventListenerOptions, EventListenerOrEventListenerObject } from "../webidl.js";
|
|
3
|
+
import { type MediaFeatureEnvironment } from "./hooks.js";
|
|
4
|
+
import type { Window } from "./Window.js";
|
|
5
|
+
import { $matches, $media, $onchange, $window } from "../keys.js";
|
|
6
|
+
export declare class MediaQueryList extends EventTarget {
|
|
7
|
+
[$window]: Window;
|
|
8
|
+
[$media]: string;
|
|
9
|
+
/** Last value change listeners were told about. */
|
|
10
|
+
[$matches]: boolean;
|
|
11
|
+
[$onchange]: EventListenerOrEventListenerObject | null;
|
|
12
|
+
constructor(window: Window, media: string);
|
|
13
|
+
/** https://drafts.csswg.org/cssom-view/#dom-mediaquerylist-media */
|
|
14
|
+
get media(): string;
|
|
15
|
+
/** https://drafts.csswg.org/cssom-view/#dom-mediaquerylist-matches */
|
|
16
|
+
get matches(): boolean;
|
|
17
|
+
/** https://drafts.csswg.org/cssom-view/#dom-mediaquerylist-addlistener */
|
|
18
|
+
addListener(callback: EventListenerOrEventListenerObject | null): void;
|
|
19
|
+
removeListener(callback: EventListenerOrEventListenerObject | null): void;
|
|
20
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;
|
|
21
|
+
get onchange(): EventListenerOrEventListenerObject | null;
|
|
22
|
+
set onchange(value: EventListenerOrEventListenerObject | null);
|
|
23
|
+
_watch(): void;
|
|
24
|
+
get [Symbol.toStringTag](): string;
|
|
25
|
+
}
|
|
26
|
+
/** https://drafts.csswg.org/cssom-view/#evaluate-media-queries-and-report-changes */
|
|
27
|
+
export declare function reportMediaQueryChanges(window: Window): void;
|
|
28
|
+
export declare function mediaEnvironment(window: Window): MediaFeatureEnvironment;
|
|
29
|
+
export declare function evaluateMediaQuery(query: string, window: Window): boolean;
|
|
30
|
+
type Features = Record<string, string | number> | undefined;
|
|
31
|
+
/** https://drafts.csswg.org/mediaqueries-5/#mq-list — true if any query in the list matches. */
|
|
32
|
+
export declare function evaluateMediaQueryList(list: string, env: MediaFeatureEnvironment, features?: Features): boolean;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface NotImplementedError extends Error {
|
|
2
|
+
/** "not implemented" (jsdom 26) or "not-implemented" (jsdom 30), as jsdom sets it. */
|
|
3
|
+
type: string;
|
|
4
|
+
}
|
|
5
|
+
/** Receives each diagnostic, with the profile that produced it (environments forward per jsdom version). */
|
|
6
|
+
export type NotImplementedHandler = (error: NotImplementedError, compat: "jsdom-26" | "jsdom-30") => void;
|
|
7
|
+
/** Install (or with null, remove) the receiver of jsdom-profile "Not implemented" diagnostics. */
|
|
8
|
+
export declare function setNotImplementedHandler(next: NotImplementedHandler | null): void;
|
|
9
|
+
/** Whether a report would go anywhere (lets callers skip the work of deciding). */
|
|
10
|
+
export declare function notImplementedActive(): boolean;
|
|
11
|
+
/** An operation jsdom reports: its jsdom 26 wording, then its jsdom 30 wording. */
|
|
12
|
+
export type Operation = readonly [string, string];
|
|
13
|
+
/** https://github.com/jsdom/jsdom/blob/30.1.3/lib/jsdom/living/window/navigation.js (navigateFetch) */
|
|
14
|
+
export declare const NAVIGATION: Operation;
|
|
15
|
+
/** jsdom's getComputedStyle with a non-empty pseudoElt (the pseudo-element is ignored there). */
|
|
16
|
+
export declare const COMPUTED_STYLE_PSEUDO: Operation;
|
|
17
|
+
/**
|
|
18
|
+
* A method jsdom stubs: "window.alert", "HTMLMediaElement.prototype.play" in jsdom 26;
|
|
19
|
+
* "Window's alert() method", "HTMLMediaElement's play() method" in jsdom 30 (notImplementedMethod).
|
|
20
|
+
*/
|
|
21
|
+
export declare function stubbedMethod(iface: string, name: string): Operation;
|
|
22
|
+
/** Report `operation` for `window` (a Window, or null for a document without one, which jsdom skips too). */
|
|
23
|
+
export declare function reportNotImplemented(window: object | null, operation: Operation): void;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Element } from "../nodes/Element.js";
|
|
2
|
+
import { $callback, $targets } from "../keys.js";
|
|
3
|
+
type ResizeObserverCallback = (entries: unknown[], observer: ResizeObserver) => void;
|
|
4
|
+
type IntersectionObserverCallback = (entries: unknown[], observer: IntersectionObserver) => void;
|
|
5
|
+
/** @internal Set by css/resize-observer.ts (layout-lite delivery); null hooks mean "no layout". */
|
|
6
|
+
export declare const resizeObserverHooks: {
|
|
7
|
+
observe: ((observer: ResizeObserver, target: Element, box: string) => void) | null;
|
|
8
|
+
unobserve: ((observer: ResizeObserver, target: Element) => void) | null;
|
|
9
|
+
disconnect: ((observer: ResizeObserver) => void) | null;
|
|
10
|
+
};
|
|
11
|
+
export declare class ResizeObserver {
|
|
12
|
+
[$callback]: ResizeObserverCallback;
|
|
13
|
+
[$targets]: Set<Element>;
|
|
14
|
+
constructor(callback: ResizeObserverCallback);
|
|
15
|
+
observe(target: Element, options?: {
|
|
16
|
+
box?: string;
|
|
17
|
+
}): void;
|
|
18
|
+
unobserve(target: Element): void;
|
|
19
|
+
disconnect(): void;
|
|
20
|
+
get [Symbol.toStringTag](): string;
|
|
21
|
+
}
|
|
22
|
+
export interface IntersectionObserverInit {
|
|
23
|
+
root?: Element | null;
|
|
24
|
+
rootMargin?: string;
|
|
25
|
+
scrollMargin?: string;
|
|
26
|
+
threshold?: number | number[];
|
|
27
|
+
}
|
|
28
|
+
export declare class IntersectionObserver {
|
|
29
|
+
[$callback]: IntersectionObserverCallback;
|
|
30
|
+
[$targets]: Set<Element>;
|
|
31
|
+
readonly root: Element | null;
|
|
32
|
+
readonly rootMargin: string;
|
|
33
|
+
readonly scrollMargin: string;
|
|
34
|
+
readonly thresholds: readonly number[];
|
|
35
|
+
constructor(callback: IntersectionObserverCallback, options?: IntersectionObserverInit);
|
|
36
|
+
observe(target: Element): void;
|
|
37
|
+
unobserve(target: Element): void;
|
|
38
|
+
disconnect(): void;
|
|
39
|
+
takeRecords(): unknown[];
|
|
40
|
+
get [Symbol.toStringTag](): string;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Window } from "./Window.js";
|
|
2
|
+
type ClearFunction = (handle: never) => void;
|
|
3
|
+
/** The pending host timers of one window. */
|
|
4
|
+
export declare class TimerList {
|
|
5
|
+
handles: Map<unknown, ClearFunction>;
|
|
6
|
+
sweepAt: number;
|
|
7
|
+
constructor();
|
|
8
|
+
}
|
|
9
|
+
/** Remember `handle` (created by a host whose clear function is `clear`) on `window`. */
|
|
10
|
+
export declare function trackTimer(window: Window, handle: unknown, clear: ClearFunction): void;
|
|
11
|
+
/** close(): clear every timer still pending on `window`. */
|
|
12
|
+
export declare function clearTimers(window: Window): void;
|
|
13
|
+
/**
|
|
14
|
+
* https://html.spec.whatwg.org/#timer-initialisation-steps, delegated to `host` (the window's
|
|
15
|
+
* current host global, so fake timers apply): returns 0 and schedules nothing once the window
|
|
16
|
+
* is closed (jsdom), otherwise the host's handle, tracked so close() clears it.
|
|
17
|
+
*/
|
|
18
|
+
export declare function startTimer(window: Window, host: Record<string, unknown>, repeat: boolean, handler: unknown, timeout: unknown, args: unknown[]): unknown;
|
|
19
|
+
/**
|
|
20
|
+
* Make the `setTimeout`/`setInterval` of `target` (the global `window` is installed on, e.g. a
|
|
21
|
+
* Jest test file's vm global) window-owned: timers created through them are tracked on
|
|
22
|
+
* `window` and cleared by `window.close()`, and once the window is closed they return 0 without
|
|
23
|
+
* scheduling (like jsdom's per-window timers). The replacements are plain writable data
|
|
24
|
+
* properties, so @sinonjs/fake-timers can install over them and restore them. Fake timers
|
|
25
|
+
* installed on `target` are never tracked (they do not call through). Returns `restore()`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function trackGlobalTimers(window: Window, target: Record<PropertyKey, unknown>): () => void;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { ClientRequest } from "node:http";
|
|
2
|
+
import { EventTarget } from "../events/EventTarget.js";
|
|
3
|
+
import { Document } from "../nodes/Document.js";
|
|
4
|
+
import type { Window } from "./Window.js";
|
|
5
|
+
import { $xhr } from "../keys.js";
|
|
6
|
+
type Task = NonNullable<ReturnType<Window["_closeable"]>>;
|
|
7
|
+
declare class XhrState {
|
|
8
|
+
window: Window | null;
|
|
9
|
+
state: number;
|
|
10
|
+
send: boolean;
|
|
11
|
+
sync: boolean;
|
|
12
|
+
method: string;
|
|
13
|
+
url: URL | null;
|
|
14
|
+
/** Author request headers by lowercase name: [name as first set, combined value]. */
|
|
15
|
+
headers: Map<string, [string, string]>;
|
|
16
|
+
timeout: number;
|
|
17
|
+
withCredentials: boolean;
|
|
18
|
+
upload: XMLHttpRequestUpload;
|
|
19
|
+
uploadComplete: boolean;
|
|
20
|
+
uploadListener: boolean;
|
|
21
|
+
/** Request body bytes (upload progress). */
|
|
22
|
+
uploadTotal: number;
|
|
23
|
+
responseType: string;
|
|
24
|
+
overrideMime: string | null;
|
|
25
|
+
/** The response is a network error (status 0, no headers, no body). */
|
|
26
|
+
error: boolean;
|
|
27
|
+
status: number;
|
|
28
|
+
statusText: string;
|
|
29
|
+
responseURL: string;
|
|
30
|
+
/** Raw response header list: [lowercase name, value] per field line. */
|
|
31
|
+
responseHeaders: Array<[string, string]>;
|
|
32
|
+
chunks: Buffer[];
|
|
33
|
+
received: number;
|
|
34
|
+
bytesCache: Uint8Array | null;
|
|
35
|
+
textCache: string | null;
|
|
36
|
+
/** responseType-specific response object; `undefined` until computed (null is a valid result). */
|
|
37
|
+
object: unknown;
|
|
38
|
+
generation: number;
|
|
39
|
+
request: ClientRequest | null;
|
|
40
|
+
timer: Task | null;
|
|
41
|
+
startedAt: number;
|
|
42
|
+
closeTask: Task | null;
|
|
43
|
+
constructor(window: Window | null, upload: XMLHttpRequestUpload);
|
|
44
|
+
}
|
|
45
|
+
/** https://xhr.spec.whatwg.org/#xmlhttprequesteventtarget */
|
|
46
|
+
export declare class XMLHttpRequestEventTarget extends EventTarget {
|
|
47
|
+
constructor();
|
|
48
|
+
}
|
|
49
|
+
/** https://xhr.spec.whatwg.org/#xmlhttprequestupload */
|
|
50
|
+
export declare class XMLHttpRequestUpload extends XMLHttpRequestEventTarget {
|
|
51
|
+
constructor(token?: unknown);
|
|
52
|
+
}
|
|
53
|
+
/** https://xhr.spec.whatwg.org/#interface-xmlhttprequest */
|
|
54
|
+
export declare class XMLHttpRequest extends XMLHttpRequestEventTarget {
|
|
55
|
+
static readonly UNSENT = 0;
|
|
56
|
+
static readonly OPENED = 1;
|
|
57
|
+
static readonly HEADERS_RECEIVED = 2;
|
|
58
|
+
static readonly LOADING = 3;
|
|
59
|
+
static readonly DONE = 4;
|
|
60
|
+
readonly UNSENT: 0;
|
|
61
|
+
readonly OPENED: 1;
|
|
62
|
+
readonly HEADERS_RECEIVED: 2;
|
|
63
|
+
readonly LOADING: 3;
|
|
64
|
+
readonly DONE: 4;
|
|
65
|
+
[$xhr]: XhrState;
|
|
66
|
+
/** https://xhr.spec.whatwg.org/#constructors — the relevant global is the current window. */
|
|
67
|
+
constructor();
|
|
68
|
+
/** https://xhr.spec.whatwg.org/#dom-xmlhttprequest-readystate */
|
|
69
|
+
get readyState(): number;
|
|
70
|
+
/** https://xhr.spec.whatwg.org/#dom-xmlhttprequest-open */
|
|
71
|
+
open(method: string, url: string, async?: boolean, username?: string | null, password?: string | null): void;
|
|
72
|
+
/** https://xhr.spec.whatwg.org/#dom-xmlhttprequest-setrequestheader */
|
|
73
|
+
setRequestHeader(name: string, value: string): void;
|
|
74
|
+
/** https://xhr.spec.whatwg.org/#dom-xmlhttprequest-timeout */
|
|
75
|
+
get timeout(): number;
|
|
76
|
+
set timeout(value: number);
|
|
77
|
+
/** https://xhr.spec.whatwg.org/#dom-xmlhttprequest-withcredentials */
|
|
78
|
+
get withCredentials(): boolean;
|
|
79
|
+
set withCredentials(value: boolean);
|
|
80
|
+
/** https://xhr.spec.whatwg.org/#dom-xmlhttprequest-upload */
|
|
81
|
+
get upload(): XMLHttpRequestUpload;
|
|
82
|
+
/** https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send */
|
|
83
|
+
send(body?: unknown): void;
|
|
84
|
+
/** https://xhr.spec.whatwg.org/#dom-xmlhttprequest-abort */
|
|
85
|
+
abort(): void;
|
|
86
|
+
/** https://xhr.spec.whatwg.org/#dom-xmlhttprequest-responseurl */
|
|
87
|
+
get responseURL(): string;
|
|
88
|
+
/** https://xhr.spec.whatwg.org/#dom-xmlhttprequest-status */
|
|
89
|
+
get status(): number;
|
|
90
|
+
/** https://xhr.spec.whatwg.org/#dom-xmlhttprequest-statustext */
|
|
91
|
+
get statusText(): string;
|
|
92
|
+
/** https://xhr.spec.whatwg.org/#dom-xmlhttprequest-getresponseheader */
|
|
93
|
+
getResponseHeader(name: string): string | null;
|
|
94
|
+
/** https://xhr.spec.whatwg.org/#dom-xmlhttprequest-getallresponseheaders */
|
|
95
|
+
getAllResponseHeaders(): string;
|
|
96
|
+
/** https://xhr.spec.whatwg.org/#dom-xmlhttprequest-overridemimetype */
|
|
97
|
+
overrideMimeType(mime: string): void;
|
|
98
|
+
/** https://xhr.spec.whatwg.org/#dom-xmlhttprequest-responsetype */
|
|
99
|
+
get responseType(): string;
|
|
100
|
+
set responseType(value: string);
|
|
101
|
+
/** https://xhr.spec.whatwg.org/#dom-xmlhttprequest-response */
|
|
102
|
+
get response(): unknown;
|
|
103
|
+
/** https://xhr.spec.whatwg.org/#dom-xmlhttprequest-responsetext */
|
|
104
|
+
get responseText(): string;
|
|
105
|
+
/** https://xhr.spec.whatwg.org/#dom-xmlhttprequest-responsexml */
|
|
106
|
+
get responseXML(): Document | null;
|
|
107
|
+
}
|
|
108
|
+
export {};
|