@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,91 @@
|
|
|
1
|
+
import { TK_COMMA, TK_DELIM, TK_DIMENSION, TK_FUNCTION, TK_HASH, TK_IDENT, TK_NUMBER, TK_PERCENTAGE, TK_STRING, TK_URL } from "./tokenizer.js";
|
|
2
|
+
/** One top-level component value of a declaration value. */
|
|
3
|
+
export declare class Comp {
|
|
4
|
+
type: number;
|
|
5
|
+
/** Source text of the whole component (a function includes its arguments). */
|
|
6
|
+
text: string;
|
|
7
|
+
/** Lowercased ident / function name / unit; "" otherwise. */
|
|
8
|
+
lower: string;
|
|
9
|
+
num: number;
|
|
10
|
+
isInteger: boolean;
|
|
11
|
+
/** Decoded string/url value. */
|
|
12
|
+
value: string;
|
|
13
|
+
constructor(type: number, text: string, lower: string, num: number, isInteger: boolean, value: string);
|
|
14
|
+
}
|
|
15
|
+
/** Separator pseudo-type for whitespace between components (kept so callers can rebuild text). */
|
|
16
|
+
export declare const COMP_SPACE = 100;
|
|
17
|
+
/**
|
|
18
|
+
* Splits a value into top-level components. Whitespace runs become a single COMP_SPACE;
|
|
19
|
+
* commas and "/" are kept as their own components. Returns null when the value can never be
|
|
20
|
+
* valid (bad tokens, unbalanced closers, top-level `;`, `!` or `{}` blocks).
|
|
21
|
+
*/
|
|
22
|
+
export declare function splitComponents(value: string): Comp[] | null;
|
|
23
|
+
/** Splits components on COMP_SPACE (top-level whitespace) into groups; commas/slashes stay as their own groups' members. */
|
|
24
|
+
export declare function significant(comps: Comp[]): Comp[];
|
|
25
|
+
/** https://drafts.csswg.org/cssom/#serialize-a-css-component-value (<number>) */
|
|
26
|
+
export declare function formatNumber(n: number): string;
|
|
27
|
+
export declare function isLengthUnit(lowerUnit: string): boolean;
|
|
28
|
+
export declare const G_LENGTH = 1;
|
|
29
|
+
export declare const G_PERCENT = 2;
|
|
30
|
+
export declare const G_NUMBER = 4;
|
|
31
|
+
export declare const G_INTEGER = 8;
|
|
32
|
+
export declare const G_COLOR = 16;
|
|
33
|
+
export declare const G_TIME = 32;
|
|
34
|
+
export declare const G_ANGLE = 64;
|
|
35
|
+
export declare const G_STRING = 128;
|
|
36
|
+
export declare const G_URL = 256;
|
|
37
|
+
export declare const G_NONNEG = 1024;
|
|
38
|
+
/** Any value that passes the token sanity check; kept verbatim. */
|
|
39
|
+
export declare const G_ANY = 2048;
|
|
40
|
+
/** Comma-separated list of values (each up to `max` components). */
|
|
41
|
+
export declare const G_LIST = 4096;
|
|
42
|
+
/** Per-property value grammar for single-component (or N-component repeated) values. */
|
|
43
|
+
export declare class Grammar {
|
|
44
|
+
types: number;
|
|
45
|
+
keywords: Set<string>;
|
|
46
|
+
/** Allowed (lowercase) function names besides math functions. */
|
|
47
|
+
fns: Set<string>;
|
|
48
|
+
/** Maximum number of space-separated components (each matching this grammar). */
|
|
49
|
+
max: number;
|
|
50
|
+
/** For max > 1: collapse repeated values like jsdom (`auto auto` is still invalid for width since max is 1). */
|
|
51
|
+
constructor(types: number, keywords: Set<string>, fns: Set<string>, max: number);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Compiles a grammar spec: space-separated items. Type codes: L length, P percentage, N
|
|
55
|
+
* number, I integer, C color, T time, A angle, S string, U url, `+` suffix = non-negative;
|
|
56
|
+
* `name()` = allowed function; `*N` = up to N components; `#` = comma-separated list;
|
|
57
|
+
* anything else is a keyword.
|
|
58
|
+
*/
|
|
59
|
+
export declare function grammar(spec: string): Grammar;
|
|
60
|
+
/** Grammar for a property name (ANY when we do not validate the property). */
|
|
61
|
+
export declare function grammarFor(name: string): Grammar;
|
|
62
|
+
export declare function isCSSWideKeyword(lower: string): boolean;
|
|
63
|
+
/** Normalizes one component against a grammar; null if it does not match. */
|
|
64
|
+
export declare function normalizeComponent(c: Comp, g: Grammar): string | null;
|
|
65
|
+
/**
|
|
66
|
+
* Specified-value serialization of a <gradient> (https://drafts.csswg.org/css-images-4/#gradients,
|
|
67
|
+
* https://drafts.csswg.org/cssom/#serialize-a-css-component-value): function name, keywords and
|
|
68
|
+
* units lower-cased, color stops serialized as colors, arguments joined with ", ", and the
|
|
69
|
+
* default line / shape / position omitted (`to bottom`, `ellipse`, `farthest-corner`,
|
|
70
|
+
* `at center`) like jsdom. Returns null when the gradient has an empty argument or fewer than
|
|
71
|
+
* two color stops; other unrecognized arguments are kept as written.
|
|
72
|
+
*/
|
|
73
|
+
export declare function normalizeGradient(c: Comp): string | null;
|
|
74
|
+
/** https://drafts.csswg.org/cssom/#serialize-a-string */
|
|
75
|
+
export declare function serializeString(s: string): string;
|
|
76
|
+
/** https://drafts.csswg.org/cssom/#serialize-a-url */
|
|
77
|
+
export declare function serializeUrl(s: string): string;
|
|
78
|
+
/** Value contains a var() reference anywhere (pending-substitution value). */
|
|
79
|
+
export declare function containsVar(value: string): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Parses and normalizes a longhand value. Returns the specified-value serialization or null
|
|
82
|
+
* if the value is invalid for the property. `name` must be a lowercase property name (or a
|
|
83
|
+
* custom property).
|
|
84
|
+
*/
|
|
85
|
+
export declare function normalizeLonghand(name: string, value: string): string | null;
|
|
86
|
+
/** Matches a component list against a (possibly repeated) grammar. */
|
|
87
|
+
export declare function normalizeComps(comps: Comp[], g: Grammar): string | null;
|
|
88
|
+
/** Custom property values are kept verbatim (trimmed) — https://drafts.csswg.org/css-variables-2/#serializing-custom-props */
|
|
89
|
+
export declare function normalizeCustom(value: string): string | null;
|
|
90
|
+
/** Re-exported token type ids used by shorthand parsers. */
|
|
91
|
+
export { TK_COMMA, TK_DELIM, TK_DIMENSION, TK_FUNCTION, TK_HASH, TK_IDENT, TK_NUMBER, TK_PERCENTAGE, TK_STRING, TK_URL, };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { NodeImpl } from "../nodes/NodeImpl.js";
|
|
2
|
+
import { DOMRect, DOMRectList } from "../window/geometry.js";
|
|
3
|
+
export interface CheckVisibilityOptions {
|
|
4
|
+
checkOpacity?: boolean;
|
|
5
|
+
checkVisibilityCSS?: boolean;
|
|
6
|
+
contentVisibilityAuto?: boolean;
|
|
7
|
+
opacityProperty?: boolean;
|
|
8
|
+
visibilityProperty?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** https://drafts.csswg.org/cssom-view/#dom-element-checkvisibility */
|
|
11
|
+
export declare function checkVisibility(el: NodeImpl, options?: CheckVisibilityOptions | null): boolean;
|
|
12
|
+
export declare function getScrollTop(el: NodeImpl): number;
|
|
13
|
+
export declare function getScrollLeft(el: NodeImpl): number;
|
|
14
|
+
export declare function setScrollTop(el: NodeImpl, v: unknown): void;
|
|
15
|
+
export declare function setScrollLeft(el: NodeImpl, v: unknown): void;
|
|
16
|
+
/** scroll()/scrollTo() and scrollBy() argument handling (https://drafts.csswg.org/cssom-view/#dom-element-scroll). */
|
|
17
|
+
export declare function scrollElement(el: NodeImpl, by: boolean, x: unknown, y: unknown, argc: number): void;
|
|
18
|
+
/**
|
|
19
|
+
* https://drafts.csswg.org/cssom-view/#dom-htmlelement-offsetparent — needs only the tree and
|
|
20
|
+
* computed `display`/`position`, no layout. Allocation-free for elements without author styles.
|
|
21
|
+
*/
|
|
22
|
+
export declare function offsetParent(el: NodeImpl): NodeImpl | null;
|
|
23
|
+
/** https://drafts.csswg.org/cssom-view/#dom-element-getboundingclientrect */
|
|
24
|
+
export declare function boundingClientRect(el: NodeImpl): DOMRect;
|
|
25
|
+
/** https://drafts.csswg.org/cssom-view/#dom-element-getclientrects — one rect per box (no line fragments). */
|
|
26
|
+
export declare function clientRects(el: NodeImpl): DOMRectList;
|
|
27
|
+
/** https://drafts.csswg.org/cssom-view/#dom-element-clienttop and the client/scroll sizes after it. */
|
|
28
|
+
export declare function elementMetric(el: NodeImpl, m: number): number;
|
|
29
|
+
/** https://drafts.csswg.org/cssom-view/#dom-htmlelement-offsettop and siblings (layout positions, transforms ignored). */
|
|
30
|
+
export declare function offsetMetric(el: NodeImpl, m: number): number;
|
|
31
|
+
/**
|
|
32
|
+
* https://drafts.csswg.org/cssom-view/#dom-element-scrollintoview — with layout-lite, scrolls each
|
|
33
|
+
* scroll container ancestor (innermost first) so the element's border box is in view. The window
|
|
34
|
+
* is not scrolled.
|
|
35
|
+
*/
|
|
36
|
+
export declare function scrollElementIntoView(el: NodeImpl, arg: unknown): void;
|
|
37
|
+
/** Installs offsetParent and offset* on HTMLElement (replacing html's always-null/zero stubs). */
|
|
38
|
+
export declare function installHTMLElementView(HTMLElementClass: {
|
|
39
|
+
prototype: object;
|
|
40
|
+
}): void;
|
|
41
|
+
/** Installs the style-aware CSSOM View members on Element (replacing the core's layout-free stubs). */
|
|
42
|
+
export declare function installElementView(ElementClass: {
|
|
43
|
+
prototype: object;
|
|
44
|
+
}): void;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type FileList } from "../html/forms/FileList.js";
|
|
2
|
+
import { $data, $dropEffect, $effectAllowed, $file, $files, $items, $kind, $owner, $type, $types } from "../keys.js";
|
|
3
|
+
/** https://html.spec.whatwg.org/#the-datatransferitem-interface */
|
|
4
|
+
export declare class DataTransferItem {
|
|
5
|
+
/** "string" | "file", or "" once removed from its list. */
|
|
6
|
+
[$kind]: string;
|
|
7
|
+
[$type]: string;
|
|
8
|
+
[$data]: string;
|
|
9
|
+
[$file]: File | null;
|
|
10
|
+
constructor();
|
|
11
|
+
get kind(): string;
|
|
12
|
+
get type(): string;
|
|
13
|
+
/** https://html.spec.whatwg.org/#dom-datatransferitem-getasstring */
|
|
14
|
+
getAsString(callback: ((data: string) => void) | null): void;
|
|
15
|
+
/** https://html.spec.whatwg.org/#dom-datatransferitem-getasfile */
|
|
16
|
+
getAsFile(): File | null;
|
|
17
|
+
webkitGetAsEntry(): null;
|
|
18
|
+
}
|
|
19
|
+
/** https://html.spec.whatwg.org/#the-datatransferitemlist-interface */
|
|
20
|
+
export declare class DataTransferItemList {
|
|
21
|
+
[index: number]: DataTransferItem;
|
|
22
|
+
[$items]: DataTransferItem[];
|
|
23
|
+
[$owner]: DataTransfer | null;
|
|
24
|
+
constructor();
|
|
25
|
+
get length(): number;
|
|
26
|
+
/** https://html.spec.whatwg.org/#dom-datatransferitemlist-add */
|
|
27
|
+
add(data: string | File, type?: string): DataTransferItem | null;
|
|
28
|
+
/** https://html.spec.whatwg.org/#dom-datatransferitemlist-remove */
|
|
29
|
+
remove(index: number): void;
|
|
30
|
+
/** https://html.spec.whatwg.org/#dom-datatransferitemlist-clear */
|
|
31
|
+
clear(): void;
|
|
32
|
+
[Symbol.iterator](): IterableIterator<DataTransferItem>;
|
|
33
|
+
/** @internal Re-sync own index properties and invalidate the owner's cached views. */
|
|
34
|
+
_changed(): void;
|
|
35
|
+
}
|
|
36
|
+
/** https://html.spec.whatwg.org/#the-datatransfer-interface */
|
|
37
|
+
export declare class DataTransfer {
|
|
38
|
+
[$dropEffect]: string;
|
|
39
|
+
[$effectAllowed]: string;
|
|
40
|
+
[$items]: DataTransferItemList;
|
|
41
|
+
[$types]: readonly string[] | null;
|
|
42
|
+
[$files]: FileList | null;
|
|
43
|
+
/** https://html.spec.whatwg.org/#dom-datatransfer */
|
|
44
|
+
constructor();
|
|
45
|
+
get dropEffect(): string;
|
|
46
|
+
set dropEffect(value: string);
|
|
47
|
+
get effectAllowed(): string;
|
|
48
|
+
set effectAllowed(value: string);
|
|
49
|
+
get items(): DataTransferItemList;
|
|
50
|
+
/** https://html.spec.whatwg.org/#dom-datatransfer-setdragimage (no rendering: no-op). */
|
|
51
|
+
setDragImage(_image: unknown, _x: number, _y: number): void;
|
|
52
|
+
/** https://html.spec.whatwg.org/#dom-datatransfer-types */
|
|
53
|
+
get types(): readonly string[];
|
|
54
|
+
/** https://html.spec.whatwg.org/#dom-datatransfer-getdata */
|
|
55
|
+
getData(format: string): string;
|
|
56
|
+
/** https://html.spec.whatwg.org/#dom-datatransfer-setdata */
|
|
57
|
+
setData(format: string, data: string): void;
|
|
58
|
+
/** https://html.spec.whatwg.org/#dom-datatransfer-cleardata */
|
|
59
|
+
clearData(format?: string): void;
|
|
60
|
+
/** https://html.spec.whatwg.org/#dom-datatransfer-files */
|
|
61
|
+
get files(): FileList;
|
|
62
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { EventInit } from "../webidl.js";
|
|
2
|
+
import type { EventTarget } from "./EventTarget.js";
|
|
3
|
+
export declare const NONE = 0;
|
|
4
|
+
export declare const CAPTURING_PHASE = 1;
|
|
5
|
+
export declare const AT_TARGET = 2;
|
|
6
|
+
export declare const BUBBLING_PHASE = 3;
|
|
7
|
+
export declare const EF_STOP_PROPAGATION: number;
|
|
8
|
+
export declare const EF_STOP_IMMEDIATE: number;
|
|
9
|
+
export declare const EF_CANCELED: number;
|
|
10
|
+
export declare const EF_IN_PASSIVE_LISTENER: number;
|
|
11
|
+
export declare const EF_COMPOSED: number;
|
|
12
|
+
export declare const EF_INITIALIZED: number;
|
|
13
|
+
export declare const EF_DISPATCH: number;
|
|
14
|
+
export declare const EF_TRUSTED: number;
|
|
15
|
+
export declare const EF_BUBBLES: number;
|
|
16
|
+
export declare const EF_CANCELABLE: number;
|
|
17
|
+
/** Set on MouseEvent (and subclasses) so dispatch can detect activation events without instanceof. */
|
|
18
|
+
export declare const EF_MOUSE_EVENT: number;
|
|
19
|
+
/** Set on TouchEvent so dispatch computes touch target lists. */
|
|
20
|
+
export declare const EF_TOUCH_EVENT: number;
|
|
21
|
+
/** Internal, monomorphic per-event state. Never exposed. */
|
|
22
|
+
export declare class EventState {
|
|
23
|
+
flags: number;
|
|
24
|
+
type: string;
|
|
25
|
+
target: EventTarget | null;
|
|
26
|
+
relatedTarget: EventTarget | null;
|
|
27
|
+
currentTarget: EventTarget | null;
|
|
28
|
+
eventPhase: number;
|
|
29
|
+
/** Offset of the first path struct in `PATH`, or -1 when the path is empty. */
|
|
30
|
+
pathStart: number;
|
|
31
|
+
/** Number of structs in the path. */
|
|
32
|
+
pathLength: number;
|
|
33
|
+
/** https://dom.spec.whatwg.org/#event-touch-target-list (retargeted touch targets for the current struct). */
|
|
34
|
+
touchTargets: EventTarget[] | null;
|
|
35
|
+
timeStamp: number;
|
|
36
|
+
constructor(type: string, flags: number);
|
|
37
|
+
}
|
|
38
|
+
export declare const STRIDE = 5;
|
|
39
|
+
export declare const PF_IN_SHADOW_TREE = 1;
|
|
40
|
+
export declare const PF_ROOT_OF_CLOSED_TREE = 2;
|
|
41
|
+
export declare const PF_SLOT_IN_CLOSED_TREE = 4;
|
|
42
|
+
export declare const PF_HAS_SHADOW_ADJUSTED_TARGET = 8;
|
|
43
|
+
/**
|
|
44
|
+
* The struct's item is a Window. Listeners live on the Window instance, but `currentTarget`, the
|
|
45
|
+
* listener's `this`, `composedPath()` and (for a window target) `target` expose the global it is
|
|
46
|
+
* installed on, so `event.target === window` holds under the test environments
|
|
47
|
+
* (docs/deviations.md, Window row).
|
|
48
|
+
*/
|
|
49
|
+
export declare const PF_WINDOW = 16;
|
|
50
|
+
/** What a struct's item looks like from script: the installed global for a Window (PF_WINDOW). */
|
|
51
|
+
export declare function exposedPathItem(o: number): EventTarget;
|
|
52
|
+
/** A Window's installed global (WindowProxy), or the Window itself when not installed. */
|
|
53
|
+
export declare function exposedWindow(window: EventTarget): EventTarget;
|
|
54
|
+
export declare const PATH: unknown[];
|
|
55
|
+
export declare const pathStack: {
|
|
56
|
+
top: number;
|
|
57
|
+
};
|
|
58
|
+
/** @internal Allows `createEvent` / internal code to construct interfaces with no public constructor. */
|
|
59
|
+
export declare function withInternalConstruct<T>(fn: () => T): T;
|
|
60
|
+
export declare function isInternalConstruct(): boolean;
|
|
61
|
+
export declare class Event {
|
|
62
|
+
#private;
|
|
63
|
+
static readonly NONE = 0;
|
|
64
|
+
static readonly CAPTURING_PHASE = 1;
|
|
65
|
+
static readonly AT_TARGET = 2;
|
|
66
|
+
static readonly BUBBLING_PHASE = 3;
|
|
67
|
+
readonly NONE: 0;
|
|
68
|
+
readonly CAPTURING_PHASE: 1;
|
|
69
|
+
readonly AT_TARGET: 2;
|
|
70
|
+
readonly BUBBLING_PHASE: 3;
|
|
71
|
+
/** @internal The per-event state record (non-enumerable prototype accessor). */
|
|
72
|
+
get _s(): EventState;
|
|
73
|
+
/** https://dom.spec.whatwg.org/#dom-event-event */
|
|
74
|
+
constructor(type: string, eventInitDict?: EventInit | null);
|
|
75
|
+
get type(): string;
|
|
76
|
+
get target(): EventTarget | null;
|
|
77
|
+
/** https://dom.spec.whatwg.org/#dom-event-srcelement (historical alias) */
|
|
78
|
+
get srcElement(): EventTarget | null;
|
|
79
|
+
get currentTarget(): EventTarget | null;
|
|
80
|
+
get eventPhase(): number;
|
|
81
|
+
get bubbles(): boolean;
|
|
82
|
+
get cancelable(): boolean;
|
|
83
|
+
get composed(): boolean;
|
|
84
|
+
readonly isTrusted: boolean;
|
|
85
|
+
/** https://dom.spec.whatwg.org/#dom-event-timestamp — ms since the time origin (performance.now()). */
|
|
86
|
+
get timeStamp(): number;
|
|
87
|
+
get defaultPrevented(): boolean;
|
|
88
|
+
/** https://dom.spec.whatwg.org/#dom-event-returnvalue */
|
|
89
|
+
get returnValue(): boolean;
|
|
90
|
+
set returnValue(value: boolean);
|
|
91
|
+
/** https://dom.spec.whatwg.org/#dom-event-cancelbubble */
|
|
92
|
+
get cancelBubble(): boolean;
|
|
93
|
+
set cancelBubble(value: boolean);
|
|
94
|
+
/** https://dom.spec.whatwg.org/#dom-event-stoppropagation */
|
|
95
|
+
stopPropagation(): void;
|
|
96
|
+
/** https://dom.spec.whatwg.org/#dom-event-stopimmediatepropagation */
|
|
97
|
+
stopImmediatePropagation(): void;
|
|
98
|
+
/** https://dom.spec.whatwg.org/#dom-event-preventdefault */
|
|
99
|
+
preventDefault(): void;
|
|
100
|
+
/** https://dom.spec.whatwg.org/#dom-event-composedpath */
|
|
101
|
+
composedPath(): EventTarget[];
|
|
102
|
+
/** https://dom.spec.whatwg.org/#dom-event-initevent */
|
|
103
|
+
initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
|
|
104
|
+
}
|
|
105
|
+
/** https://dom.spec.whatwg.org/#set-the-canceled-flag */
|
|
106
|
+
export declare function setCanceledFlag(s: EventState): void;
|
|
107
|
+
/** https://dom.spec.whatwg.org/#concept-event-initialize */
|
|
108
|
+
export declare function initializeEvent(s: EventState, type: string, bubbles: boolean, cancelable: boolean): void;
|
|
109
|
+
/** @internal Mark an event as trusted (dispatched by the user agent). */
|
|
110
|
+
export declare function setTrusted(event: Event, trusted?: boolean): void;
|
|
111
|
+
/** Name used in subclass constructor errors. */
|
|
112
|
+
export declare function setToStringTag(ctor: {
|
|
113
|
+
prototype: object;
|
|
114
|
+
name: string;
|
|
115
|
+
}, requiredArgs?: number): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Event } from "./Event.js";
|
|
2
|
+
import type { AddEventListenerOptions, EventListenerOptions, EventListenerOrEventListenerObject } from "../webidl.js";
|
|
3
|
+
import { type ListenerMap } from "./listeners.js";
|
|
4
|
+
import { $listeners } from "../keys.js";
|
|
5
|
+
export declare class EventTarget {
|
|
6
|
+
/** @internal Event type → listener list, or null when there are no listeners (see listeners.ts). */
|
|
7
|
+
/**
|
|
8
|
+
* Added on first addEventListener (absent otherwise): most nodes never get a listener (React
|
|
9
|
+
* delegates to its root container), and an always-initialized field cost every node a slot.
|
|
10
|
+
*/
|
|
11
|
+
[$listeners]?: ListenerMap | null;
|
|
12
|
+
/** https://dom.spec.whatwg.org/#dom-eventtarget-eventtarget */
|
|
13
|
+
constructor();
|
|
14
|
+
/** https://dom.spec.whatwg.org/#dom-eventtarget-addeventlistener */
|
|
15
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;
|
|
16
|
+
/** https://dom.spec.whatwg.org/#dom-eventtarget-removeeventlistener */
|
|
17
|
+
removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): void;
|
|
18
|
+
/** https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent */
|
|
19
|
+
dispatchEvent(event: Event): boolean;
|
|
20
|
+
/** https://dom.spec.whatwg.org/#get-the-parent */
|
|
21
|
+
_getTheParent(_event: Event): EventTarget | null;
|
|
22
|
+
}
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { Event } from "./Event.js";
|
|
2
|
+
import type { EventTarget } from "./EventTarget.js";
|
|
3
|
+
import type { EventInit } from "../webidl.js";
|
|
4
|
+
import type { Window } from "../window/Window.js";
|
|
5
|
+
import type { DataTransfer } from "./DataTransfer.js";
|
|
6
|
+
export declare function requireArgs(given: number, needed: number, iface: string): void;
|
|
7
|
+
/** Window detection without importing the Window class (avoids an import cycle). */
|
|
8
|
+
export declare function isWindow(v: unknown): v is Window;
|
|
9
|
+
export interface UIEventInit extends EventInit {
|
|
10
|
+
view?: Window | null;
|
|
11
|
+
detail?: number;
|
|
12
|
+
which?: number;
|
|
13
|
+
}
|
|
14
|
+
/** https://w3c.github.io/uievents/#interface-uievent */
|
|
15
|
+
export declare class UIEvent extends Event {
|
|
16
|
+
#private;
|
|
17
|
+
constructor(type: string, eventInitDict?: UIEventInit | null);
|
|
18
|
+
get view(): Window | null;
|
|
19
|
+
get detail(): number;
|
|
20
|
+
/** https://w3c.github.io/uievents/#dom-uievent-which (init value, like jsdom). */
|
|
21
|
+
get which(): number;
|
|
22
|
+
/** https://w3c.github.io/uievents/#dom-uievent-inituievent */
|
|
23
|
+
initUIEvent(type: string, bubbles?: boolean, cancelable?: boolean, view?: Window | null, detail?: number): void;
|
|
24
|
+
}
|
|
25
|
+
export interface FocusEventInit extends UIEventInit {
|
|
26
|
+
relatedTarget?: EventTarget | null;
|
|
27
|
+
}
|
|
28
|
+
/** https://w3c.github.io/uievents/#interface-focusevent */
|
|
29
|
+
export declare class FocusEvent extends UIEvent {
|
|
30
|
+
constructor(type: string, eventInitDict?: FocusEventInit | null);
|
|
31
|
+
get relatedTarget(): EventTarget | null;
|
|
32
|
+
}
|
|
33
|
+
export interface EventModifierInit extends UIEventInit {
|
|
34
|
+
ctrlKey?: boolean;
|
|
35
|
+
shiftKey?: boolean;
|
|
36
|
+
altKey?: boolean;
|
|
37
|
+
metaKey?: boolean;
|
|
38
|
+
modifierAltGraph?: boolean;
|
|
39
|
+
modifierCapsLock?: boolean;
|
|
40
|
+
modifierFn?: boolean;
|
|
41
|
+
modifierFnLock?: boolean;
|
|
42
|
+
modifierHyper?: boolean;
|
|
43
|
+
modifierNumLock?: boolean;
|
|
44
|
+
modifierScrollLock?: boolean;
|
|
45
|
+
modifierSuper?: boolean;
|
|
46
|
+
modifierSymbol?: boolean;
|
|
47
|
+
modifierSymbolLock?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface MouseEventInit extends EventModifierInit {
|
|
50
|
+
screenX?: number;
|
|
51
|
+
screenY?: number;
|
|
52
|
+
clientX?: number;
|
|
53
|
+
clientY?: number;
|
|
54
|
+
button?: number;
|
|
55
|
+
buttons?: number;
|
|
56
|
+
relatedTarget?: EventTarget | null;
|
|
57
|
+
movementX?: number;
|
|
58
|
+
movementY?: number;
|
|
59
|
+
}
|
|
60
|
+
/** https://w3c.github.io/uievents/#interface-mouseevent */
|
|
61
|
+
export declare class MouseEvent extends UIEvent {
|
|
62
|
+
#private;
|
|
63
|
+
constructor(type: string, eventInitDict?: MouseEventInit | null);
|
|
64
|
+
get screenX(): number;
|
|
65
|
+
get screenY(): number;
|
|
66
|
+
get clientX(): number;
|
|
67
|
+
get clientY(): number;
|
|
68
|
+
/** https://drafts.csswg.org/cssom-view/#dom-mouseevent-x */
|
|
69
|
+
get x(): number;
|
|
70
|
+
get y(): number;
|
|
71
|
+
/** https://drafts.csswg.org/cssom-view/#dom-mouseevent-pagex (no scrolling: = clientX). */
|
|
72
|
+
get pageX(): number;
|
|
73
|
+
get pageY(): number;
|
|
74
|
+
/** https://drafts.csswg.org/cssom-view/#dom-mouseevent-offsetx (no layout: = pageX, like jsdom). */
|
|
75
|
+
get offsetX(): number;
|
|
76
|
+
get offsetY(): number;
|
|
77
|
+
get movementX(): number;
|
|
78
|
+
get movementY(): number;
|
|
79
|
+
get ctrlKey(): boolean;
|
|
80
|
+
get shiftKey(): boolean;
|
|
81
|
+
get altKey(): boolean;
|
|
82
|
+
get metaKey(): boolean;
|
|
83
|
+
get button(): number;
|
|
84
|
+
get buttons(): number;
|
|
85
|
+
get relatedTarget(): EventTarget | null;
|
|
86
|
+
getModifierState(keyArg: string): boolean;
|
|
87
|
+
/** https://w3c.github.io/uievents/#dom-mouseevent-initmouseevent */
|
|
88
|
+
initMouseEvent(type: string, bubbles?: boolean, cancelable?: boolean, view?: Window | null, detail?: number, screenX?: number, screenY?: number, clientX?: number, clientY?: number, ctrlKey?: boolean, altKey?: boolean, shiftKey?: boolean, metaKey?: boolean, button?: number, relatedTarget?: EventTarget | null): void;
|
|
89
|
+
}
|
|
90
|
+
export interface PointerEventInit extends MouseEventInit {
|
|
91
|
+
pointerId?: number;
|
|
92
|
+
width?: number;
|
|
93
|
+
height?: number;
|
|
94
|
+
pressure?: number;
|
|
95
|
+
tangentialPressure?: number;
|
|
96
|
+
tiltX?: number;
|
|
97
|
+
tiltY?: number;
|
|
98
|
+
twist?: number;
|
|
99
|
+
altitudeAngle?: number;
|
|
100
|
+
azimuthAngle?: number;
|
|
101
|
+
pointerType?: string;
|
|
102
|
+
isPrimary?: boolean;
|
|
103
|
+
persistentDeviceId?: number;
|
|
104
|
+
coalescedEvents?: PointerEvent[];
|
|
105
|
+
predictedEvents?: PointerEvent[];
|
|
106
|
+
}
|
|
107
|
+
/** https://w3c.github.io/pointerevents/#pointerevent-interface */
|
|
108
|
+
export declare class PointerEvent extends MouseEvent {
|
|
109
|
+
#private;
|
|
110
|
+
constructor(type: string, eventInitDict?: PointerEventInit | null);
|
|
111
|
+
get pointerId(): number;
|
|
112
|
+
get width(): number;
|
|
113
|
+
get height(): number;
|
|
114
|
+
get pressure(): number;
|
|
115
|
+
get tangentialPressure(): number;
|
|
116
|
+
get tiltX(): number;
|
|
117
|
+
get tiltY(): number;
|
|
118
|
+
get twist(): number;
|
|
119
|
+
get altitudeAngle(): number;
|
|
120
|
+
get azimuthAngle(): number;
|
|
121
|
+
get pointerType(): string;
|
|
122
|
+
get isPrimary(): boolean;
|
|
123
|
+
get persistentDeviceId(): number;
|
|
124
|
+
/** https://w3c.github.io/pointerevents/#dom-pointerevent-getcoalescedevents */
|
|
125
|
+
getCoalescedEvents(): PointerEvent[];
|
|
126
|
+
/** https://w3c.github.io/pointerevents/#dom-pointerevent-getpredictedevents */
|
|
127
|
+
getPredictedEvents(): PointerEvent[];
|
|
128
|
+
}
|
|
129
|
+
export interface WheelEventInit extends MouseEventInit {
|
|
130
|
+
deltaX?: number;
|
|
131
|
+
deltaY?: number;
|
|
132
|
+
deltaZ?: number;
|
|
133
|
+
deltaMode?: number;
|
|
134
|
+
}
|
|
135
|
+
/** https://w3c.github.io/uievents/#interface-wheelevent */
|
|
136
|
+
export declare class WheelEvent extends MouseEvent {
|
|
137
|
+
#private;
|
|
138
|
+
static readonly DOM_DELTA_PIXEL = 0;
|
|
139
|
+
static readonly DOM_DELTA_LINE = 1;
|
|
140
|
+
static readonly DOM_DELTA_PAGE = 2;
|
|
141
|
+
constructor(type: string, eventInitDict?: WheelEventInit | null);
|
|
142
|
+
get deltaX(): number;
|
|
143
|
+
get deltaY(): number;
|
|
144
|
+
get deltaZ(): number;
|
|
145
|
+
get deltaMode(): number;
|
|
146
|
+
}
|
|
147
|
+
export interface DragEventInit extends MouseEventInit {
|
|
148
|
+
dataTransfer?: DataTransfer | null;
|
|
149
|
+
}
|
|
150
|
+
/** https://html.spec.whatwg.org/#the-dragevent-interface */
|
|
151
|
+
export declare class DragEvent extends MouseEvent {
|
|
152
|
+
#private;
|
|
153
|
+
constructor(type: string, eventInitDict?: DragEventInit | null);
|
|
154
|
+
get dataTransfer(): DataTransfer | null;
|
|
155
|
+
}
|
|
156
|
+
export interface KeyboardEventInit extends EventModifierInit {
|
|
157
|
+
key?: string;
|
|
158
|
+
code?: string;
|
|
159
|
+
location?: number;
|
|
160
|
+
repeat?: boolean;
|
|
161
|
+
isComposing?: boolean;
|
|
162
|
+
charCode?: number;
|
|
163
|
+
keyCode?: number;
|
|
164
|
+
}
|
|
165
|
+
/** https://w3c.github.io/uievents/#interface-keyboardevent */
|
|
166
|
+
export declare class KeyboardEvent extends UIEvent {
|
|
167
|
+
#private;
|
|
168
|
+
static readonly DOM_KEY_LOCATION_STANDARD = 0;
|
|
169
|
+
static readonly DOM_KEY_LOCATION_LEFT = 1;
|
|
170
|
+
static readonly DOM_KEY_LOCATION_RIGHT = 2;
|
|
171
|
+
static readonly DOM_KEY_LOCATION_NUMPAD = 3;
|
|
172
|
+
constructor(type: string, eventInitDict?: KeyboardEventInit | null);
|
|
173
|
+
get key(): string;
|
|
174
|
+
get code(): string;
|
|
175
|
+
get location(): number;
|
|
176
|
+
get ctrlKey(): boolean;
|
|
177
|
+
get shiftKey(): boolean;
|
|
178
|
+
get altKey(): boolean;
|
|
179
|
+
get metaKey(): boolean;
|
|
180
|
+
get repeat(): boolean;
|
|
181
|
+
get isComposing(): boolean;
|
|
182
|
+
/** https://w3c.github.io/uievents/#dom-keyboardevent-charcode (legacy; init value). */
|
|
183
|
+
get charCode(): number;
|
|
184
|
+
/** https://w3c.github.io/uievents/#dom-keyboardevent-keycode (legacy; init value). */
|
|
185
|
+
get keyCode(): number;
|
|
186
|
+
getModifierState(keyArg: string): boolean;
|
|
187
|
+
/** https://w3c.github.io/uievents/#dom-keyboardevent-initkeyboardevent */
|
|
188
|
+
initKeyboardEvent(type: string, bubbles?: boolean, cancelable?: boolean, view?: Window | null, key?: string, location?: number, ctrlKey?: boolean, altKey?: boolean, shiftKey?: boolean, metaKey?: boolean): void;
|
|
189
|
+
}
|
|
190
|
+
export interface InputEventInit extends UIEventInit {
|
|
191
|
+
data?: string | null;
|
|
192
|
+
isComposing?: boolean;
|
|
193
|
+
inputType?: string;
|
|
194
|
+
dataTransfer?: DataTransfer | null;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* https://w3c.github.io/uievents/#interface-inputevent + https://w3c.github.io/input-events/
|
|
198
|
+
* No `getTargetRanges()`, like jsdom and happy-dom: editors and React Aria feature-detect it to
|
|
199
|
+
* switch to native `beforeinput` handling, which suites written for jsdom do not exercise
|
|
200
|
+
* (docs/deviations.md). There is no editing model to produce target ranges anyway.
|
|
201
|
+
*/
|
|
202
|
+
export declare class InputEvent extends UIEvent {
|
|
203
|
+
#private;
|
|
204
|
+
constructor(type: string, eventInitDict?: InputEventInit | null);
|
|
205
|
+
get data(): string | null;
|
|
206
|
+
get isComposing(): boolean;
|
|
207
|
+
get inputType(): string;
|
|
208
|
+
get dataTransfer(): DataTransfer | null;
|
|
209
|
+
}
|
|
210
|
+
export interface CompositionEventInit extends UIEventInit {
|
|
211
|
+
data?: string;
|
|
212
|
+
}
|
|
213
|
+
/** https://w3c.github.io/uievents/#interface-compositionevent */
|
|
214
|
+
export declare class CompositionEvent extends UIEvent {
|
|
215
|
+
#private;
|
|
216
|
+
constructor(type: string, eventInitDict?: CompositionEventInit | null);
|
|
217
|
+
get data(): string;
|
|
218
|
+
/** https://w3c.github.io/uievents/#dom-compositionevent-initcompositionevent */
|
|
219
|
+
initCompositionEvent(type: string, bubbles?: boolean, cancelable?: boolean, view?: Window | null, data?: string): void;
|
|
220
|
+
}
|
|
221
|
+
/** https://w3c.github.io/uievents/#legacy-textevent-interface */
|
|
222
|
+
export declare class TextEvent extends UIEvent {
|
|
223
|
+
#private;
|
|
224
|
+
constructor(type: string, eventInitDict?: UIEventInit | null);
|
|
225
|
+
get data(): string;
|
|
226
|
+
initTextEvent(type: string, bubbles?: boolean, cancelable?: boolean, view?: Window | null, data?: string): void;
|
|
227
|
+
}
|
|
228
|
+
export interface TouchInit {
|
|
229
|
+
identifier: number;
|
|
230
|
+
target: EventTarget;
|
|
231
|
+
clientX?: number;
|
|
232
|
+
clientY?: number;
|
|
233
|
+
screenX?: number;
|
|
234
|
+
screenY?: number;
|
|
235
|
+
pageX?: number;
|
|
236
|
+
pageY?: number;
|
|
237
|
+
radiusX?: number;
|
|
238
|
+
radiusY?: number;
|
|
239
|
+
rotationAngle?: number;
|
|
240
|
+
force?: number;
|
|
241
|
+
altitudeAngle?: number;
|
|
242
|
+
azimuthAngle?: number;
|
|
243
|
+
touchType?: "direct" | "stylus";
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* https://w3c.github.io/touch-events/#touch-interface
|
|
247
|
+
* Deviation: `target` is the init target as-is; touch target lists are retargeted on the
|
|
248
|
+
* event path but Touch objects are not re-created per path entry.
|
|
249
|
+
*/
|
|
250
|
+
export declare class Touch {
|
|
251
|
+
#private;
|
|
252
|
+
constructor(touchInitDict: TouchInit);
|
|
253
|
+
get identifier(): number;
|
|
254
|
+
get target(): EventTarget;
|
|
255
|
+
get clientX(): number;
|
|
256
|
+
get clientY(): number;
|
|
257
|
+
get screenX(): number;
|
|
258
|
+
get screenY(): number;
|
|
259
|
+
get pageX(): number;
|
|
260
|
+
get pageY(): number;
|
|
261
|
+
get radiusX(): number;
|
|
262
|
+
get radiusY(): number;
|
|
263
|
+
get rotationAngle(): number;
|
|
264
|
+
get force(): number;
|
|
265
|
+
get altitudeAngle(): number;
|
|
266
|
+
get azimuthAngle(): number;
|
|
267
|
+
get touchType(): string;
|
|
268
|
+
}
|
|
269
|
+
/** https://w3c.github.io/touch-events/#touchlist-interface (static list with own index properties). */
|
|
270
|
+
export declare class TouchList {
|
|
271
|
+
#private;
|
|
272
|
+
[index: number]: Touch;
|
|
273
|
+
constructor();
|
|
274
|
+
/** @internal */
|
|
275
|
+
static _create(items: Touch[]): TouchList;
|
|
276
|
+
get length(): number;
|
|
277
|
+
item(index: number): Touch | null;
|
|
278
|
+
[Symbol.iterator](): IterableIterator<Touch>;
|
|
279
|
+
}
|
|
280
|
+
export interface TouchEventInit extends EventModifierInit {
|
|
281
|
+
touches?: Touch[];
|
|
282
|
+
targetTouches?: Touch[];
|
|
283
|
+
changedTouches?: Touch[];
|
|
284
|
+
}
|
|
285
|
+
/** https://w3c.github.io/touch-events/#touchevent-interface */
|
|
286
|
+
export declare class TouchEvent extends UIEvent {
|
|
287
|
+
#private;
|
|
288
|
+
constructor(type: string, eventInitDict?: TouchEventInit | null);
|
|
289
|
+
get touches(): TouchList;
|
|
290
|
+
get targetTouches(): TouchList;
|
|
291
|
+
get changedTouches(): TouchList;
|
|
292
|
+
get altKey(): boolean;
|
|
293
|
+
get metaKey(): boolean;
|
|
294
|
+
get ctrlKey(): boolean;
|
|
295
|
+
get shiftKey(): boolean;
|
|
296
|
+
getModifierState(keyArg: string): boolean;
|
|
297
|
+
/** @internal https://dom.spec.whatwg.org/#event-touch-target-list */
|
|
298
|
+
_touchTargetList(): EventTarget[];
|
|
299
|
+
}
|
|
300
|
+
export interface ClipboardEventInit extends EventInit {
|
|
301
|
+
clipboardData?: DataTransfer | null;
|
|
302
|
+
}
|
|
303
|
+
/** https://w3c.github.io/clipboard-apis/#clipboardevent */
|
|
304
|
+
export declare class ClipboardEvent extends Event {
|
|
305
|
+
#private;
|
|
306
|
+
constructor(type: string, eventInitDict?: ClipboardEventInit | null);
|
|
307
|
+
get clipboardData(): DataTransfer | null;
|
|
308
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** https://webidl.spec.whatwg.org/#es-DOMString */
|
|
2
|
+
export declare function toDOMString(v: unknown): string;
|
|
3
|
+
/** https://webidl.spec.whatwg.org/#es-double — throws on non-finite values. */
|
|
4
|
+
export declare function toDouble(v: unknown, what: string): number;
|
|
5
|
+
/** https://webidl.spec.whatwg.org/#es-float */
|
|
6
|
+
export declare function toFloat(v: unknown, what: string): number;
|
|
7
|
+
/** https://webidl.spec.whatwg.org/#es-long */
|
|
8
|
+
export declare function toLong(v: unknown): number;
|
|
9
|
+
/** https://webidl.spec.whatwg.org/#es-unsigned-long */
|
|
10
|
+
export declare function toUnsignedLong(v: unknown): number;
|
|
11
|
+
/** https://webidl.spec.whatwg.org/#es-short */
|
|
12
|
+
export declare function toShort(v: unknown): number;
|
|
13
|
+
/** https://webidl.spec.whatwg.org/#es-unsigned-short */
|
|
14
|
+
export declare function toUnsignedShort(v: unknown): number;
|
|
15
|
+
/** A dictionary argument: undefined/null → null (use defaults), objects pass, others throw. */
|
|
16
|
+
export declare function toDictionary(v: unknown, iface: string): Record<string, unknown> | null;
|