@ctrl/dom 0.0.0-stage → 0.1.1
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-Hv_BAHIV.js +47537 -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 +163 -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 +3923 -0
- package/dist/user-event/index.js +3898 -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 +55 -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 +178 -4
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { NodeImpl } from "../../nodes/NodeImpl.js";
|
|
2
|
+
import { Event } from "../../events/Event.js";
|
|
3
|
+
import type { EventTarget } from "../../events/EventTarget.js";
|
|
4
|
+
/** Read a `long` limited to only non-negative numbers (maxlength/minlength); `def` when absent/invalid. */
|
|
5
|
+
export declare function readNonNegativeLong(impl: NodeImpl, name: string, def: number): number;
|
|
6
|
+
/** Read an `unsigned long` limited to only positive numbers (with fallback). */
|
|
7
|
+
export declare function readPositiveUnsigned(impl: NodeImpl, name: string, def: number): number;
|
|
8
|
+
/**
|
|
9
|
+
* Reflect `unsigned long` attributes "limited to only positive numbers with fallback"
|
|
10
|
+
* (input.size, textarea.rows/cols): 0 or out-of-range values read and write the default.
|
|
11
|
+
* https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes
|
|
12
|
+
*/
|
|
13
|
+
export declare function positiveWithFallback(C: {
|
|
14
|
+
prototype: object;
|
|
15
|
+
}, idl: string, content: string, def: number): void;
|
|
16
|
+
/** WebIDL `unsigned long` conversion. */
|
|
17
|
+
export declare function toUnsignedLong(value: unknown): number;
|
|
18
|
+
/**
|
|
19
|
+
* URL reflection for `action`/`formAction`: the attribute resolved against the base URL, or the
|
|
20
|
+
* document URL when the attribute is missing or empty
|
|
21
|
+
* (https://html.spec.whatwg.org/#dom-fs-action).
|
|
22
|
+
*/
|
|
23
|
+
export declare function reflectActionURL(impl: NodeImpl, name: string): string;
|
|
24
|
+
export declare function isWS(c: number): boolean;
|
|
25
|
+
/** https://infra.spec.whatwg.org/#strip-newlines — returns the input when there is nothing to strip. */
|
|
26
|
+
export declare function stripNewlines(s: string): string;
|
|
27
|
+
/** https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace */
|
|
28
|
+
export declare function trimASCII(s: string): string;
|
|
29
|
+
/** https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace */
|
|
30
|
+
export declare function stripAndCollapseWS(s: string): string;
|
|
31
|
+
/** https://infra.spec.whatwg.org/#normalize-newlines */
|
|
32
|
+
export declare function normalizeNewlines(s: string): string;
|
|
33
|
+
/** https://dom.spec.whatwg.org/#concept-event-fire — a trusted plain Event. Returns false when canceled. */
|
|
34
|
+
export declare function fireEvent(target: EventTarget, type: string, bubbles: boolean, cancelable: boolean, composed?: boolean): boolean;
|
|
35
|
+
/** Dispatch a UA-constructed event (marked trusted). */
|
|
36
|
+
export declare function dispatchTrusted(target: EventTarget, event: Event): boolean;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Element } from "../../nodes/Element.js";
|
|
2
|
+
import type { NodeImpl } from "../../nodes/NodeImpl.js";
|
|
3
|
+
import { LabelsNodeList } from "./collections.js";
|
|
4
|
+
import { ValidityState, type Validatable } from "./validation.js";
|
|
5
|
+
import { $customValidity, $validity } from "../../keys.js";
|
|
6
|
+
/**
|
|
7
|
+
* Per-FACE state. Doubles as the `Validatable` adapter that ValidityState and the form's static
|
|
8
|
+
* validation read (the custom element itself has no validity members).
|
|
9
|
+
*/
|
|
10
|
+
export declare class FaceState {
|
|
11
|
+
impl: NodeImpl;
|
|
12
|
+
/** https://html.spec.whatwg.org/#face-submission-value */
|
|
13
|
+
value: unknown;
|
|
14
|
+
/** https://html.spec.whatwg.org/#face-state */
|
|
15
|
+
state: unknown;
|
|
16
|
+
flags: number;
|
|
17
|
+
message: string;
|
|
18
|
+
anchor: Element | null;
|
|
19
|
+
validity: ValidityState | null;
|
|
20
|
+
labels: LabelsNodeList | null;
|
|
21
|
+
/** Last form owner / disabledness reported through the callbacks. */
|
|
22
|
+
lastOwner: NodeImpl | null;
|
|
23
|
+
lastDisabled: boolean;
|
|
24
|
+
[$customValidity]: string;
|
|
25
|
+
[$validity]: ValidityState | null;
|
|
26
|
+
constructor(impl: NodeImpl);
|
|
27
|
+
_validityFlags(): number;
|
|
28
|
+
/** https://html.spec.whatwg.org/#barred-from-constraint-validation (FACE: disabled, readonly, datalist). */
|
|
29
|
+
_barredFromValidation(): boolean;
|
|
30
|
+
_validationMessage(_flags: number): string;
|
|
31
|
+
}
|
|
32
|
+
export declare function isFACE(impl: NodeImpl): boolean;
|
|
33
|
+
export declare function faceState(impl: NodeImpl): FaceState;
|
|
34
|
+
/** The Validatable for a form control or FACE (used by static validation and :valid/:invalid). */
|
|
35
|
+
export declare function validatableOf(impl: NodeImpl): Validatable;
|
|
36
|
+
/** https://html.spec.whatwg.org/#dom-elementinternals-setformvalue */
|
|
37
|
+
export declare function internalsSetFormValue(impl: NodeImpl, value: unknown, state?: unknown): void;
|
|
38
|
+
/** https://html.spec.whatwg.org/#dom-elementinternals-form */
|
|
39
|
+
export declare function internalsForm(impl: NodeImpl): Element | null;
|
|
40
|
+
/** https://html.spec.whatwg.org/#dom-elementinternals-labels */
|
|
41
|
+
export declare function internalsLabels(impl: NodeImpl): LabelsNodeList;
|
|
42
|
+
/** https://html.spec.whatwg.org/#dom-elementinternals-setvalidity */
|
|
43
|
+
export declare function internalsSetValidity(impl: NodeImpl, flags: Record<string, unknown> | undefined, message?: string, anchor?: Element): void;
|
|
44
|
+
export declare function internalsWillValidate(impl: NodeImpl): boolean;
|
|
45
|
+
export declare function internalsValidity(impl: NodeImpl): ValidityState;
|
|
46
|
+
export declare function internalsValidationMessage(impl: NodeImpl): string;
|
|
47
|
+
/** https://html.spec.whatwg.org/#dom-elementinternals-checkvalidity (reportValidity has no UI). */
|
|
48
|
+
export declare function internalsCheckValidity(impl: NodeImpl, member?: string): boolean;
|
|
49
|
+
/** https://html.spec.whatwg.org/#face-entry-construction */
|
|
50
|
+
export declare function faceEntries(impl: NodeImpl, out: [string, string | File][]): void;
|
|
51
|
+
/** Reset algorithm for a FACE: enqueue formResetCallback. */
|
|
52
|
+
export declare function faceReset(impl: NodeImpl): void;
|
|
53
|
+
/** End of a [CEReactions] API that enqueued FACE callbacks (form.reset()). */
|
|
54
|
+
export declare function flushFaceReactions(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Called from HTMLElement's connected/disconnected/attribute hooks for FACEs: report form owner
|
|
57
|
+
* changes (formAssociatedCallback) and disabledness changes (formDisabledCallback).
|
|
58
|
+
*/
|
|
59
|
+
export declare function faceStateMaybeChanged(impl: NodeImpl): void;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { NodeImpl } from "../../nodes/NodeImpl.js";
|
|
2
|
+
/** https://html.spec.whatwg.org/#category-listed — button, fieldset, input, object, output, select, textarea. */
|
|
3
|
+
export declare function isListed(el: NodeImpl): boolean;
|
|
4
|
+
/** https://html.spec.whatwg.org/#category-submit — button, input, select, textarea (object is never submitted here). */
|
|
5
|
+
export declare function isSubmittable(el: NodeImpl): boolean;
|
|
6
|
+
/** https://html.spec.whatwg.org/#category-reset — input, output, select, textarea. */
|
|
7
|
+
export declare function isResettable(el: NodeImpl): boolean;
|
|
8
|
+
/** https://html.spec.whatwg.org/#category-label — button, input (not hidden), meter, output, progress, select, textarea. */
|
|
9
|
+
export declare function isLabelable(el: NodeImpl): boolean;
|
|
10
|
+
/** https://html.spec.whatwg.org/#form-associated-element (listed elements + img). */
|
|
11
|
+
export declare function isFormAssociated(el: NodeImpl): boolean;
|
|
12
|
+
/** First element in `el`'s tree (shadow-root aware) whose id is `id`, or null. */
|
|
13
|
+
export declare function elementByIdInTree(el: NodeImpl, id: string): NodeImpl | null;
|
|
14
|
+
/**
|
|
15
|
+
* The form owner of a form-associated element: https://html.spec.whatwg.org/#form-owner
|
|
16
|
+
* (computed per https://html.spec.whatwg.org/#reset-the-form-owner, steps 3–4).
|
|
17
|
+
*/
|
|
18
|
+
export declare function formOwner(el: NodeImpl): NodeImpl | null;
|
|
19
|
+
/**
|
|
20
|
+
* Called by the parser (`_parserAssociateForm`) for a form-associated element created while
|
|
21
|
+
* the form element pointer was set. Listed elements with a `form` attribute are never passed.
|
|
22
|
+
*/
|
|
23
|
+
export declare function parserAssociateForm(el: NodeImpl, form: NodeImpl): void;
|
|
24
|
+
/** The element's ancestor chain changed (https://html.spec.whatwg.org/#reset-the-form-owner): drop the association. */
|
|
25
|
+
export declare function clearParserAssociation(el: NodeImpl): void;
|
|
26
|
+
/** All listed elements (excluding image buttons) whose form owner is `form`, in tree order: form.elements. */
|
|
27
|
+
export declare function formControls(form: NodeImpl, out: NodeImpl[], includeImages: boolean): NodeImpl[];
|
|
28
|
+
/** First legend element child of a fieldset. */
|
|
29
|
+
export declare function firstLegend(fieldset: NodeImpl): NodeImpl | null;
|
|
30
|
+
/**
|
|
31
|
+
* Whether `el` is a descendant of a disabled fieldset and not inside that fieldset's first legend.
|
|
32
|
+
* https://html.spec.whatwg.org/#concept-fe-disabled
|
|
33
|
+
*/
|
|
34
|
+
export declare function inDisabledFieldset(el: NodeImpl): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* https://html.spec.whatwg.org/#concept-fe-disabled (button, input, select, textarea, fieldset),
|
|
37
|
+
* https://html.spec.whatwg.org/#concept-option-disabled, optgroup's disabled attribute.
|
|
38
|
+
* This is what `:disabled` matches.
|
|
39
|
+
*/
|
|
40
|
+
export declare function isActuallyDisabled(el: NodeImpl): boolean;
|
|
41
|
+
/** Ancestor <datalist> bars an element from constraint validation and submission. */
|
|
42
|
+
export declare function hasDatalistAncestor(el: NodeImpl): boolean;
|
|
43
|
+
/** https://html.spec.whatwg.org/#labeled-control */
|
|
44
|
+
export declare function labeledControl(label: NodeImpl): NodeImpl | null;
|
|
45
|
+
/** Label elements whose labeled control is `el`, in tree order. https://html.spec.whatwg.org/#dom-lfe-labels */
|
|
46
|
+
export declare function labelsFor(el: NodeImpl, out: NodeImpl[]): NodeImpl[];
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { NodeImpl } from "../../nodes/NodeImpl.js";
|
|
2
|
+
import type { Element } from "../../nodes/Element.js";
|
|
3
|
+
import type { EnumSpec } from "../reflect.js";
|
|
4
|
+
/** https://html.spec.whatwg.org/#attr-fs-enctype (formEnctype: missing → ""). */
|
|
5
|
+
export declare const FORM_ENCTYPE: EnumSpec;
|
|
6
|
+
/** https://html.spec.whatwg.org/#attr-fs-method (formMethod: missing → ""). */
|
|
7
|
+
export declare const FORM_METHOD: EnumSpec;
|
|
8
|
+
/** https://html.spec.whatwg.org/#concept-submit-button */
|
|
9
|
+
export declare function isSubmitButton(el: NodeImpl): boolean;
|
|
10
|
+
/** The button element's type state: https://html.spec.whatwg.org/#attr-button-type */
|
|
11
|
+
export declare function buttonType(el: NodeImpl): "submit" | "reset" | "button";
|
|
12
|
+
/** https://html.spec.whatwg.org/#default-button — first submit button in tree order whose form owner is form. */
|
|
13
|
+
export declare function defaultButton(form: NodeImpl): NodeImpl | null;
|
|
14
|
+
/**
|
|
15
|
+
* https://html.spec.whatwg.org/#statically-validate-the-constraints — null for a positive result;
|
|
16
|
+
* otherwise (negative) the unhandled invalid controls, those whose `invalid` event was not
|
|
17
|
+
* canceled. Canceling every `invalid` event still makes the result negative.
|
|
18
|
+
*/
|
|
19
|
+
export declare function staticallyValidate(form: NodeImpl): NodeImpl[] | null;
|
|
20
|
+
/** https://html.spec.whatwg.org/#dom-form-checkvalidity */
|
|
21
|
+
export declare function formCheckValidity(form: NodeImpl): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* https://html.spec.whatwg.org/#concept-form-submit
|
|
24
|
+
* `submitter` is the submit button or the form itself; `fromSubmit` is "submitted from submit() method".
|
|
25
|
+
*/
|
|
26
|
+
export declare function submitForm(form: NodeImpl, submitter: NodeImpl, fromSubmit: boolean): void;
|
|
27
|
+
export declare function setDialogSubmission(fn: (form: NodeImpl, submitter: NodeImpl) => boolean): void;
|
|
28
|
+
/** https://html.spec.whatwg.org/#concept-form-reset */
|
|
29
|
+
export declare function resetForm(form: NodeImpl): void;
|
|
30
|
+
/**
|
|
31
|
+
* https://html.spec.whatwg.org/#implicit-submission — what pressing Enter in a field does.
|
|
32
|
+
* Exported for user-event's keyboard implementation.
|
|
33
|
+
*/
|
|
34
|
+
export declare function implicitSubmission(form: NodeImpl): void;
|
|
35
|
+
/**
|
|
36
|
+
* Run synthetic click activation steps on `el`. Uses HTMLElement.click() when the
|
|
37
|
+
* html-elements/events agents provide it; otherwise dispatches a click and runs the element's
|
|
38
|
+
* activation behavior directly.
|
|
39
|
+
*/
|
|
40
|
+
export declare function syntheticClick(el: Element): void;
|
|
41
|
+
export type Entry = [name: string, value: string | File];
|
|
42
|
+
/**
|
|
43
|
+
* An image button's selected coordinate (https://html.spec.whatwg.org/#image-button-state-(type=image)),
|
|
44
|
+
* set by its activation behavior. A side table: image buttons are rare, so other inputs carry no field.
|
|
45
|
+
* Absent means (0,0), "if the user activates the control without explicitly selecting a coordinate".
|
|
46
|
+
*/
|
|
47
|
+
export declare const selectedCoordinates: WeakMap<NodeImpl, {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* https://html.spec.whatwg.org/#constructing-the-form-data-set — returns null when the form is
|
|
53
|
+
* already constructing its entry list.
|
|
54
|
+
*/
|
|
55
|
+
export declare function constructEntryList(form: NodeImpl, submitter: NodeImpl | null, beforeUnlock?: ((entries: Entry[]) => void) | null): Entry[] | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ElementConstructor } from "../../nodes/create.js";
|
|
2
|
+
import { HTMLInputElement } from "./HTMLInputElement.js";
|
|
3
|
+
import { HTMLTextAreaElement } from "./HTMLTextAreaElement.js";
|
|
4
|
+
import { HTMLSelectElement } from "./HTMLSelectElement.js";
|
|
5
|
+
import { HTMLOptGroupElement, HTMLOptionElement, Option } from "./HTMLOptionElement.js";
|
|
6
|
+
import { HTMLButtonElement } from "./HTMLButtonElement.js";
|
|
7
|
+
import { HTMLLabelElement } from "./HTMLLabelElement.js";
|
|
8
|
+
import { HTMLFieldSetElement, HTMLLegendElement } from "./HTMLFieldSetElement.js";
|
|
9
|
+
import { HTMLDataListElement, HTMLMeterElement, HTMLOutputElement, HTMLProgressElement } from "./HTMLOutputElement.js";
|
|
10
|
+
import { HTMLFormElement } from "./HTMLFormElement.js";
|
|
11
|
+
export declare const formElementClasses: Map<string, ElementConstructor>;
|
|
12
|
+
export { HTMLInputElement, HTMLTextAreaElement, HTMLSelectElement, HTMLOptionElement, HTMLOptGroupElement, Option, HTMLButtonElement, HTMLLabelElement, HTMLFieldSetElement, HTMLLegendElement, HTMLOutputElement, HTMLProgressElement, HTMLMeterElement, HTMLDataListElement, HTMLFormElement, };
|
|
13
|
+
export { ValidityState } from "./validation.js";
|
|
14
|
+
export { FormData } from "./FormData.js";
|
|
15
|
+
export { HTMLFormControlsCollection, HTMLOptionsCollection, RadioNodeList } from "./collections.js";
|
|
16
|
+
export { implicitSubmission, constructEntryList, defaultButton } from "./form-submission.js";
|
|
17
|
+
export { formOwner, labeledControl, isLabelable, isListed, isSubmittable, isResettable } from "./form-associated.js";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { NodeImpl } from "../../nodes/NodeImpl.js";
|
|
2
|
+
export declare const I_HIDDEN = 0;
|
|
3
|
+
export declare const I_TEXT = 1;
|
|
4
|
+
export declare const I_SEARCH = 2;
|
|
5
|
+
export declare const I_TEL = 3;
|
|
6
|
+
export declare const I_URL = 4;
|
|
7
|
+
export declare const I_EMAIL = 5;
|
|
8
|
+
export declare const I_PASSWORD = 6;
|
|
9
|
+
export declare const I_DATE = 7;
|
|
10
|
+
export declare const I_MONTH = 8;
|
|
11
|
+
export declare const I_WEEK = 9;
|
|
12
|
+
export declare const I_TIME = 10;
|
|
13
|
+
export declare const I_DATETIME_LOCAL = 11;
|
|
14
|
+
export declare const I_NUMBER = 12;
|
|
15
|
+
export declare const I_RANGE = 13;
|
|
16
|
+
export declare const I_COLOR = 14;
|
|
17
|
+
export declare const I_CHECKBOX = 15;
|
|
18
|
+
export declare const I_RADIO = 16;
|
|
19
|
+
export declare const I_FILE = 17;
|
|
20
|
+
export declare const I_SUBMIT = 18;
|
|
21
|
+
export declare const I_IMAGE = 19;
|
|
22
|
+
export declare const I_RESET = 20;
|
|
23
|
+
export declare const I_BUTTON = 21;
|
|
24
|
+
/** Canonical keyword per type id (what the `type` IDL attribute returns). */
|
|
25
|
+
export declare const INPUT_TYPE_NAMES: readonly ["hidden", "text", "search", "tel", "url", "email", "password", "date", "month", "week", "time", "datetime-local", "number", "range", "color", "checkbox", "radio", "file", "submit", "image", "reset", "button"];
|
|
26
|
+
/** Type id for a `type` attribute value (missing/invalid → text). */
|
|
27
|
+
export declare function inputTypeFromAttr(value: string | null): number;
|
|
28
|
+
/** The input element's current type state. */
|
|
29
|
+
export declare function inputType(impl: NodeImpl): number;
|
|
30
|
+
export declare const MODE_VALUE = 0;
|
|
31
|
+
export declare const MODE_DEFAULT = 1;
|
|
32
|
+
export declare const MODE_DEFAULT_ON = 2;
|
|
33
|
+
export declare const MODE_FILENAME = 3;
|
|
34
|
+
export declare function valueMode(type: number): number;
|
|
35
|
+
/** Text, Search, Telephone, URL, Password: selection APIs apply (https://html.spec.whatwg.org/#do-not-apply). */
|
|
36
|
+
export declare function supportsSelectionType(type: number): boolean;
|
|
37
|
+
/** Types whose value is edited as text in a browser (also email/number which reject the selection APIs). */
|
|
38
|
+
export declare function isTextualType(type: number): boolean;
|
|
39
|
+
/** date, month, week, time, datetime-local, number, range. */
|
|
40
|
+
export declare function isNumericType(type: number): boolean;
|
|
41
|
+
/** Text, Search, URL, Telephone, E-mail, Password: maxlength/minlength/pattern/size/placeholder apply. */
|
|
42
|
+
export declare function lengthApplies(type: number): boolean;
|
|
43
|
+
/** readonly applies: text-ish, date-ish and number. https://html.spec.whatwg.org/#the-readonly-attribute */
|
|
44
|
+
export declare function readonlyApplies(type: number): boolean;
|
|
45
|
+
/** required applies. */
|
|
46
|
+
export declare function requiredApplies(type: number): boolean;
|
|
47
|
+
/** placeholder applies: text, search, url, tel, email, password, number. */
|
|
48
|
+
export declare function placeholderApplies(type: number): boolean;
|
|
49
|
+
/** list applies. */
|
|
50
|
+
export declare function listApplies(type: number): boolean;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export declare function isValidFloatString(s: string): boolean;
|
|
2
|
+
/**
|
|
3
|
+
* https://html.spec.whatwg.org/#rules-for-parsing-floating-point-number-values, restricted to
|
|
4
|
+
* valid floating-point numbers (what value sanitization requires). NaN on error.
|
|
5
|
+
*/
|
|
6
|
+
export declare function parseFloatStrict(s: string): number;
|
|
7
|
+
/**
|
|
8
|
+
* https://html.spec.whatwg.org/#rules-for-parsing-floating-point-number-values (lenient: used for
|
|
9
|
+
* min/max/step attributes, which accept leading whitespace-free prefixes like "1.5abc"). NaN on error.
|
|
10
|
+
*/
|
|
11
|
+
export declare function parseFloatLenient(s: string): number;
|
|
12
|
+
/** https://html.spec.whatwg.org/#best-representation-of-the-number-as-a-floating-point-number */
|
|
13
|
+
export declare function serializeFloat(n: number): string;
|
|
14
|
+
/** https://html.spec.whatwg.org/#number-of-days-in-month-month-of-year-year */
|
|
15
|
+
export declare function daysInMonth(month: number, year: number): number;
|
|
16
|
+
/** Date.UTC that does not map years 0–99 onto 1900–1999. */
|
|
17
|
+
export declare function utcMs(year: number, month?: number, day?: number, hour?: number, minute?: number, second?: number, ms?: number): number;
|
|
18
|
+
/** https://html.spec.whatwg.org/#valid-date-string (no ECMAScript Date range limit). */
|
|
19
|
+
export declare function isValidDateString(s: string): boolean;
|
|
20
|
+
/** https://html.spec.whatwg.org/#valid-month-string */
|
|
21
|
+
export declare function isValidMonthString(s: string): boolean;
|
|
22
|
+
/** https://html.spec.whatwg.org/#valid-week-string */
|
|
23
|
+
export declare function isValidWeekString(s: string): boolean;
|
|
24
|
+
/** https://html.spec.whatwg.org/#valid-time-string */
|
|
25
|
+
export declare function isValidTimeString(s: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Value sanitization for datetime-local: a valid local date and time string becomes the
|
|
28
|
+
* valid normalized one (T separator, shortest time); anything else becomes "".
|
|
29
|
+
* https://html.spec.whatwg.org/#local-date-and-time-state-(type=datetime-local)
|
|
30
|
+
*/
|
|
31
|
+
export declare function normalizeLocalDateTime(s: string): string;
|
|
32
|
+
/** https://html.spec.whatwg.org/#parse-a-month-string → months since 1970-01, or NaN. */
|
|
33
|
+
export declare function parseMonth(s: string): number;
|
|
34
|
+
/** https://html.spec.whatwg.org/#parse-a-date-string → UTC ms at midnight, or NaN. */
|
|
35
|
+
export declare function parseDate(s: string): number;
|
|
36
|
+
/** https://html.spec.whatwg.org/#parse-a-time-string → ms since midnight, or NaN. */
|
|
37
|
+
export declare function parseTime(s: string): number;
|
|
38
|
+
/** https://html.spec.whatwg.org/#parse-a-local-date-and-time-string → ms, or NaN. */
|
|
39
|
+
export declare function parseLocalDateTime(s: string): number;
|
|
40
|
+
/** https://html.spec.whatwg.org/#parse-a-week-string → UTC ms of the Monday that starts the week, or NaN. */
|
|
41
|
+
export declare function parseWeek(s: string): number;
|
|
42
|
+
export declare function serializeDate(ms: number): string;
|
|
43
|
+
export declare function serializeMonth(months: number): string;
|
|
44
|
+
/** Shortest valid time string (https://html.spec.whatwg.org/#valid-normalised-local-date-and-time-string). */
|
|
45
|
+
export declare function serializeTime(ms: number): string;
|
|
46
|
+
export declare function serializeLocalDateTime(ms: number): string;
|
|
47
|
+
export declare function serializeWeek(ms: number): string;
|
|
48
|
+
/** https://html.spec.whatwg.org/#valid-simple-colour (lowercased). */
|
|
49
|
+
export declare function isValidSimpleColor(s: string): boolean;
|
|
50
|
+
export declare function isValidEmail(s: string): boolean;
|
|
51
|
+
/** https://html.spec.whatwg.org/#valid-absolute-url (approximated by the URL parser). */
|
|
52
|
+
export declare function isValidAbsoluteURL(s: string): boolean;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { NodeImpl } from "../../nodes/NodeImpl.js";
|
|
2
|
+
export { isActuallyDisabled } from "./form-associated.js";
|
|
3
|
+
/** `:disabled` — https://html.spec.whatwg.org/#selector-disabled */
|
|
4
|
+
export declare function isDisabled(el: NodeImpl): boolean;
|
|
5
|
+
/** `:enabled` — button, input, select, textarea, optgroup, option, fieldset that are not disabled. */
|
|
6
|
+
export declare function isEnabled(el: NodeImpl): boolean;
|
|
7
|
+
/** https://html.spec.whatwg.org/#concept-fe-mutable for input/textarea/select. */
|
|
8
|
+
export declare function isMutable(el: NodeImpl): boolean;
|
|
9
|
+
/** `:read-write` — https://html.spec.whatwg.org/#selector-read-write */
|
|
10
|
+
export declare function isReadWrite(el: NodeImpl): boolean;
|
|
11
|
+
/** `:read-only` — every element that is not `:read-write`. */
|
|
12
|
+
export declare function isReadOnly(el: NodeImpl): boolean;
|
|
13
|
+
/** The control has a `readonly` attribute that applies (aria-readonly semantics / jest-dom). */
|
|
14
|
+
export declare function hasReadonlyAttribute(el: NodeImpl): boolean;
|
|
15
|
+
/** `:required` — https://html.spec.whatwg.org/#selector-required */
|
|
16
|
+
export declare function isRequired(el: NodeImpl): boolean;
|
|
17
|
+
/** `:optional` — input/select/textarea that are not required. */
|
|
18
|
+
export declare function isOptional(el: NodeImpl): boolean;
|
|
19
|
+
/** `:valid` — https://html.spec.whatwg.org/#selector-valid */
|
|
20
|
+
export declare function isValid(el: NodeImpl): boolean;
|
|
21
|
+
/** `:invalid` — https://html.spec.whatwg.org/#selector-invalid */
|
|
22
|
+
export declare function isInvalid(el: NodeImpl): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* `:user-valid` — https://html.spec.whatwg.org/#selector-user-valid: input, textarea and select
|
|
25
|
+
* whose user validity is true (forms/user-validity.ts), candidates for constraint validation
|
|
26
|
+
* that satisfy their constraints.
|
|
27
|
+
*/
|
|
28
|
+
export declare function isUserValid(el: NodeImpl): boolean;
|
|
29
|
+
/** `:user-invalid` — https://html.spec.whatwg.org/#selector-user-invalid: as `:user-valid`, but suffering from a constraint violation. */
|
|
30
|
+
export declare function isUserInvalid(el: NodeImpl): boolean;
|
|
31
|
+
/** `:in-range` — https://html.spec.whatwg.org/#selector-in-range */
|
|
32
|
+
export declare function isInRange(el: NodeImpl): boolean;
|
|
33
|
+
/** `:out-of-range` — https://html.spec.whatwg.org/#selector-out-of-range */
|
|
34
|
+
export declare function isOutOfRange(el: NodeImpl): boolean;
|
|
35
|
+
/** `:checked` — checkbox/radio checkedness, option selectedness. https://html.spec.whatwg.org/#selector-checked */
|
|
36
|
+
export declare function isChecked(el: NodeImpl): boolean;
|
|
37
|
+
/** `:indeterminate` — https://html.spec.whatwg.org/#selector-indeterminate */
|
|
38
|
+
export declare function isIndeterminate(el: NodeImpl): boolean;
|
|
39
|
+
/** `:default` — https://html.spec.whatwg.org/#selector-default */
|
|
40
|
+
export declare function isDefault(el: NodeImpl): boolean;
|
|
41
|
+
/** `:placeholder-shown` — https://html.spec.whatwg.org/#selector-placeholder-shown */
|
|
42
|
+
export declare function isPlaceholderShown(el: NodeImpl): boolean;
|
|
43
|
+
/** `:autofill` never matches (no autofill). */
|
|
44
|
+
export declare function isAutofilled(_el: NodeImpl): boolean;
|
|
45
|
+
/** Whether the element is a form control whose value the user can type into. */
|
|
46
|
+
export declare function isTextControl(el: NodeImpl): boolean;
|
|
47
|
+
/** The current value of an input, textarea or select (what `.value` returns); "" otherwise. */
|
|
48
|
+
export declare function controlValue(el: NodeImpl): string;
|
|
49
|
+
/** Checkedness of an input (any type), false for other elements. */
|
|
50
|
+
export declare function inputChecked(el: NodeImpl): boolean;
|
|
51
|
+
/** The indeterminate IDL flag of an input. */
|
|
52
|
+
export declare function inputIndeterminate(el: NodeImpl): boolean;
|
|
53
|
+
/** Selectedness of an option. */
|
|
54
|
+
export declare function optionSelected(el: NodeImpl): boolean;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Element } from "../../nodes/Element.js";
|
|
2
|
+
import type { NodeImpl } from "../../nodes/NodeImpl.js";
|
|
3
|
+
type El = Element | NodeImpl;
|
|
4
|
+
/** Whether the user can edit the element's value by typing (mutable text control or editing host). */
|
|
5
|
+
export declare function isEditable(el: El): boolean;
|
|
6
|
+
/** Whether the selection APIs (selectionStart, setSelectionRange, ...) work on the element. */
|
|
7
|
+
export declare function supportsSelection(el: El): boolean;
|
|
8
|
+
/** Whether the element has a UI value/selection (input in value mode or textarea). */
|
|
9
|
+
export declare function hasUIValue(el: El): boolean;
|
|
10
|
+
/** The value as the user sees it (raw typed text), falling back to `.value`. */
|
|
11
|
+
export declare function getUIValue(el: El): string;
|
|
12
|
+
/**
|
|
13
|
+
* Set the value as a user edit: sanitizes like the browser, marks the value dirty and
|
|
14
|
+
* "last changed by a user edit" (tooLong/tooShort apply), records badInput when the typed text
|
|
15
|
+
* cannot be represented (e.g. "1e" in a number field). Does not fire events.
|
|
16
|
+
*/
|
|
17
|
+
export declare function setUIValue(el: El, value: string): void;
|
|
18
|
+
/** Forget the UI value (the next getUIValue returns `.value`). */
|
|
19
|
+
export declare function clearUIValue(el: El): void;
|
|
20
|
+
export interface UISelection {
|
|
21
|
+
start: number;
|
|
22
|
+
end: number;
|
|
23
|
+
direction: "forward" | "backward" | "none";
|
|
24
|
+
}
|
|
25
|
+
/** The caret/selection inside an input or textarea (works for every value-mode input type). */
|
|
26
|
+
export declare function getUISelection(el: El): UISelection;
|
|
27
|
+
/** Set the caret/selection as the user would (no exceptions for email/number inputs). */
|
|
28
|
+
export declare function setUISelection(el: El, start: number, end?: number, direction?: UISelection["direction"]): void;
|
|
29
|
+
/** Replace a file input's selected files as the file picker would (no events). */
|
|
30
|
+
export declare function setFilesFromUI(el: El, files: readonly File[]): void;
|
|
31
|
+
/** Set an option's selectedness as the user would (dirty; single selects deselect the rest). */
|
|
32
|
+
export declare function setOptionSelectedFromUI(option: El, selected: boolean): void;
|
|
33
|
+
/** Set a checkbox/radio's checkedness as the user would (dirty; radio groups stay exclusive). */
|
|
34
|
+
export declare function setCheckedFromUI(el: El, checked: boolean): void;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { NodeImpl } from "../../nodes/NodeImpl.js";
|
|
2
|
+
import type { Event } from "../../events/Event.js";
|
|
3
|
+
import { $userValidity } from "../../keys.js";
|
|
4
|
+
/** A control with a user validity flag (input, textarea, select). */
|
|
5
|
+
export interface UserValidityHolder {
|
|
6
|
+
[$userValidity]: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Called from the controls' `_getTheParent` (the event dispatch algorithm calls it on the
|
|
10
|
+
* target first, https://dom.spec.whatwg.org/#concept-event-dispatch step 6.8, before any
|
|
11
|
+
* listener runs, so `change` listeners already see the new state). `pathLength` is 1 only for
|
|
12
|
+
* that first call: a `change` dispatched at an `<option>` reaches its `<select>` as a parent and
|
|
13
|
+
* must not set the select's flag.
|
|
14
|
+
*/
|
|
15
|
+
export declare function noteChangeDispatch(el: UserValidityHolder, event: Event): void;
|
|
16
|
+
/** Whether `el` is an input, textarea or select whose user validity is true. */
|
|
17
|
+
export declare function hasUserValidity(el: NodeImpl): boolean;
|
|
18
|
+
/** https://html.spec.whatwg.org/#concept-form-submit step 6.3: set user validity of the form's submittable controls. */
|
|
19
|
+
export declare function setUserValidity(el: NodeImpl, value: boolean): void;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { Element } from "../../nodes/Element.js";
|
|
2
|
+
import { $customValidity, $el, $validity } from "../../keys.js";
|
|
3
|
+
export declare const V_VALUE_MISSING: number;
|
|
4
|
+
export declare const V_TYPE_MISMATCH: number;
|
|
5
|
+
export declare const V_PATTERN_MISMATCH: number;
|
|
6
|
+
export declare const V_TOO_LONG: number;
|
|
7
|
+
export declare const V_TOO_SHORT: number;
|
|
8
|
+
export declare const V_RANGE_UNDERFLOW: number;
|
|
9
|
+
export declare const V_RANGE_OVERFLOW: number;
|
|
10
|
+
export declare const V_STEP_MISMATCH: number;
|
|
11
|
+
export declare const V_BAD_INPUT: number;
|
|
12
|
+
export declare const V_CUSTOM_ERROR: number;
|
|
13
|
+
/** Internal contract every element with the constraint validation API implements. */
|
|
14
|
+
export interface Validatable extends Element {
|
|
15
|
+
[$customValidity]: string;
|
|
16
|
+
[$validity]: ValidityState | null;
|
|
17
|
+
/** Bit set of V_* flags describing the current validity state. */
|
|
18
|
+
_validityFlags(): number;
|
|
19
|
+
/** https://html.spec.whatwg.org/#barred-from-constraint-validation */
|
|
20
|
+
_barredFromValidation(): boolean;
|
|
21
|
+
/** Browser-like message for the first failing constraint in `flags` (customError excluded). */
|
|
22
|
+
_validationMessage(flags: number): string;
|
|
23
|
+
}
|
|
24
|
+
/** https://html.spec.whatwg.org/#validitystate */
|
|
25
|
+
export declare class ValidityState {
|
|
26
|
+
[$el]: Validatable;
|
|
27
|
+
/** @internal */
|
|
28
|
+
constructor(el: Validatable);
|
|
29
|
+
get valueMissing(): boolean;
|
|
30
|
+
get typeMismatch(): boolean;
|
|
31
|
+
get patternMismatch(): boolean;
|
|
32
|
+
get tooLong(): boolean;
|
|
33
|
+
get tooShort(): boolean;
|
|
34
|
+
get rangeUnderflow(): boolean;
|
|
35
|
+
get rangeOverflow(): boolean;
|
|
36
|
+
get stepMismatch(): boolean;
|
|
37
|
+
get badInput(): boolean;
|
|
38
|
+
get customError(): boolean;
|
|
39
|
+
get valid(): boolean;
|
|
40
|
+
get [Symbol.toStringTag](): string;
|
|
41
|
+
}
|
|
42
|
+
/** The element is a candidate for constraint validation and does not satisfy its constraints. */
|
|
43
|
+
export declare function isInvalidCandidate(el: Validatable): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* https://html.spec.whatwg.org/#check-validity-steps — fires `invalid` (cancelable) when the
|
|
46
|
+
* element is an invalid candidate. Returns validity.
|
|
47
|
+
*/
|
|
48
|
+
export declare function checkValidityOf(el: Validatable): boolean;
|
|
49
|
+
export interface ConstraintValidation {
|
|
50
|
+
readonly willValidate: boolean;
|
|
51
|
+
readonly validity: ValidityState;
|
|
52
|
+
readonly validationMessage: string;
|
|
53
|
+
checkValidity(): boolean;
|
|
54
|
+
reportValidity(): boolean;
|
|
55
|
+
setCustomValidity(error: string): void;
|
|
56
|
+
}
|
|
57
|
+
export declare function installConstraintValidation(target: {
|
|
58
|
+
prototype: object;
|
|
59
|
+
}): void;
|
|
60
|
+
/** jsdom's text for every built-in constraint failure (the default; drop-in compatibility). */
|
|
61
|
+
export declare const MSG_JSDOM = "Constraints not satisfied";
|
|
62
|
+
export declare const MSG_FILL_OUT = "Please fill out this field.";
|
|
63
|
+
export declare const MSG_CHECKBOX = "Please check this box if you want to proceed.";
|
|
64
|
+
export declare const MSG_RADIO = "Please select one of these options.";
|
|
65
|
+
export declare const MSG_SELECT = "Please select an item in the list.";
|
|
66
|
+
export declare const MSG_FILE = "Please select a file.";
|
|
67
|
+
export declare const MSG_PATTERN = "Please match the requested format.";
|
|
68
|
+
export declare const MSG_URL = "Please enter a URL.";
|
|
69
|
+
export declare const MSG_NUMBER = "Please enter a number.";
|
|
70
|
+
export declare const MSG_BAD_INPUT = "Please enter a valid value.";
|
|
71
|
+
export declare function msgEmail(value: string): string;
|
|
72
|
+
export declare function msgTooLong(max: number, len: number): string;
|
|
73
|
+
export declare function msgTooShort(min: number, len: number): string;
|
|
74
|
+
export declare function msgUnderflow(min: string, isDate: boolean): string;
|
|
75
|
+
export declare function msgOverflow(max: string, isDate: boolean): string;
|
|
76
|
+
export declare function msgStep(low: string | null, high: string | null): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { HTMLUnknownElement } from "./elements.js";
|
|
2
|
+
export { HTMLHtmlElement, HTMLHeadElement, HTMLBaseElement, HTMLMetaElement, HTMLBodyElement, HTMLHeadingElement, HTMLParagraphElement, HTMLHRElement, HTMLPreElement, HTMLQuoteElement, HTMLOListElement, HTMLUListElement, HTMLMenuElement, HTMLLIElement, HTMLDListElement, HTMLDivElement, HTMLDataElement, HTMLTimeElement, HTMLSpanElement, HTMLBRElement, HTMLModElement, HTMLPictureElement, HTMLSourceElement, HTMLImageElement, Image, HTMLIFrameElement, HTMLEmbedElement, HTMLObjectElement, HTMLParamElement, HTMLTrackElement, HTMLMapElement, HTMLCanvasElement, HTMLTableElement, HTMLTableCaptionElement, HTMLTableColElement, HTMLTableSectionElement, HTMLTableRowElement, HTMLTableCellElement, HTMLDirectoryElement, HTMLFontElement, HTMLFrameSetElement, HTMLFrameElement, HTMLMarqueeElement, } from "./elements.js";
|
|
3
|
+
export { HTMLAnchorElement, HTMLAreaElement } from "./anchor.js";
|
|
4
|
+
export { HTMLMediaElement, HTMLAudioElement, HTMLVideoElement, Audio, TimeRanges, MediaError } from "./media.js";
|
|
5
|
+
export { HTMLDetailsElement, HTMLDialogElement } from "./interactive.js";
|
|
6
|
+
export { CommandEvent } from "./invokers.js";
|
|
7
|
+
export { HTMLTemplateElement } from "./template.js";
|
|
8
|
+
export { HTMLSlotElement } from "./slot.js";
|
|
9
|
+
export { HTMLStyleElement, HTMLLinkElement, HTMLScriptElement, HTMLTitleElement } from "./resources.js";
|
|
10
|
+
export { ElementInternals, CustomStateSet } from "./HTMLElement.js";
|
|
11
|
+
export { CustomElementRegistry } from "./custom-elements.js";
|
|
12
|
+
export { MathMLElement } from "./MathMLElement.js";
|
|
13
|
+
export { SVGAnimatedString, SVGGraphicsElement, SVGGeometryElement, SVGSVGElement, SVGGElement, SVGDefsElement, SVGDescElement, SVGMetadataElement, SVGTitleElement, SVGSymbolElement, SVGUseElement, SVGSwitchElement, SVGImageElement, SVGForeignObjectElement, SVGAElement, SVGPathElement, SVGRectElement, SVGCircleElement, SVGEllipseElement, SVGLineElement, SVGPolylineElement, SVGPolygonElement, SVGTextContentElement, SVGTextPositioningElement, SVGTextElement, SVGTSpanElement, SVGTextPathElement, SVGMarkerElement, SVGClipPathElement, SVGMaskElement, SVGPatternElement, SVGGradientElement, SVGLinearGradientElement, SVGRadialGradientElement, SVGStopElement, SVGStyleElement, SVGScriptElement, SVGViewElement, SVGFilterElement, } from "./SVGElement.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NodeImpl } from "../nodes/NodeImpl.js";
|
|
2
|
+
import type { Node } from "../nodes/Node.js";
|
|
3
|
+
/** https://html.spec.whatwg.org/#get-the-text-steps */
|
|
4
|
+
export declare function getInnerText(el: NodeImpl): string;
|
|
5
|
+
/**
|
|
6
|
+
* https://html.spec.whatwg.org/#rendered-text-fragment — Text nodes separated by <br> for
|
|
7
|
+
* every LF (CR LF and lone CR count as one break).
|
|
8
|
+
*/
|
|
9
|
+
export declare function renderedTextFragment(input: string, el: NodeImpl): Node;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { HTMLElement } from "./HTMLElement.js";
|
|
2
|
+
import type { Document } from "../nodes/Document.js";
|
|
3
|
+
import type { NodeImpl } from "../nodes/NodeImpl.js";
|
|
4
|
+
/** https://html.spec.whatwg.org/#the-details-element */
|
|
5
|
+
export declare class HTMLDetailsElement extends HTMLElement {
|
|
6
|
+
constructor(doc?: Document, localName?: string, ns?: string | null, prefix?: string | null);
|
|
7
|
+
_attributeChangedSteps(localName: string, oldValue: string | null, value: string | null, namespace: string | null): void;
|
|
8
|
+
_connectedSteps(): void;
|
|
9
|
+
}
|
|
10
|
+
declare const SummaryBase: typeof HTMLElement;
|
|
11
|
+
/**
|
|
12
|
+
* <summary> uses the HTMLElement interface; this subclass (named "HTMLElement", not exposed on
|
|
13
|
+
* the window) only adds activation behavior (https://html.spec.whatwg.org/#the-summary-element:activation-behaviour).
|
|
14
|
+
*/
|
|
15
|
+
export declare const HTMLSummaryElement: typeof SummaryBase;
|
|
16
|
+
/** https://html.spec.whatwg.org/#the-dialog-element */
|
|
17
|
+
export declare class HTMLDialogElement extends HTMLElement {
|
|
18
|
+
constructor(doc?: Document, localName?: string, ns?: string | null, prefix?: string | null);
|
|
19
|
+
/** https://html.spec.whatwg.org/#dom-dialog-returnvalue */
|
|
20
|
+
get returnValue(): string;
|
|
21
|
+
set returnValue(v: string);
|
|
22
|
+
/** https://html.spec.whatwg.org/#dom-dialog-closedby */
|
|
23
|
+
get closedBy(): string;
|
|
24
|
+
set closedBy(v: string);
|
|
25
|
+
/** https://html.spec.whatwg.org/#dom-dialog-show */
|
|
26
|
+
show(): void;
|
|
27
|
+
/** https://html.spec.whatwg.org/#dom-dialog-showmodal */
|
|
28
|
+
showModal(): void;
|
|
29
|
+
/** https://html.spec.whatwg.org/#dom-dialog-close */
|
|
30
|
+
close(returnValue?: string): void;
|
|
31
|
+
/** https://html.spec.whatwg.org/#dom-dialog-requestclose */
|
|
32
|
+
requestClose(returnValue?: string): void;
|
|
33
|
+
_attributeChangedSteps(localName: string, oldValue: string | null, value: string | null, namespace: string | null): void;
|
|
34
|
+
_connectedSteps(): void;
|
|
35
|
+
_disconnectedSteps(): void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Steps 8-9 of https://html.spec.whatwg.org/#concept-form-submit for the forms area: when the
|
|
39
|
+
* submitter's method is "dialog", close the form's nearest ancestor dialog with the
|
|
40
|
+
* submitter's optional value and return true (the submission ends there).
|
|
41
|
+
*/
|
|
42
|
+
export declare function submitFormToDialog(form: NodeImpl, submitter: NodeImpl): boolean;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { NodeImpl } from "../nodes/NodeImpl.js";
|
|
2
|
+
import type { Element } from "../nodes/Element.js";
|
|
3
|
+
import { Event } from "../events/Event.js";
|
|
4
|
+
type Ctor = {
|
|
5
|
+
prototype: object;
|
|
6
|
+
};
|
|
7
|
+
/** PopoverTargetAttributes: popoverTargetElement, popoverTargetAction. */
|
|
8
|
+
export declare function installPopoverInvoker(C: Ctor): void;
|
|
9
|
+
/** commandForElement and command on <button>. */
|
|
10
|
+
export declare function installCommandInvoker(C: Ctor): void;
|
|
11
|
+
/** https://html.spec.whatwg.org/#popover-target-element */
|
|
12
|
+
export declare function popoverTargetElement(node: NodeImpl): NodeImpl | null;
|
|
13
|
+
/** https://html.spec.whatwg.org/#popover-target-attribute-activation-behavior */
|
|
14
|
+
export declare function popoverTargetAttributeActivation(node: NodeImpl, eventTarget: NodeImpl | null): void;
|
|
15
|
+
/** https://html.spec.whatwg.org/#popover-target-element and #the-button-element's "target popover" (light dismiss). */
|
|
16
|
+
export declare function targetPopover(node: NodeImpl): NodeImpl | null;
|
|
17
|
+
export interface CommandEventInit {
|
|
18
|
+
bubbles?: boolean;
|
|
19
|
+
cancelable?: boolean;
|
|
20
|
+
composed?: boolean;
|
|
21
|
+
source?: Element | null;
|
|
22
|
+
command?: string;
|
|
23
|
+
}
|
|
24
|
+
/** https://html.spec.whatwg.org/#the-commandevent-interface */
|
|
25
|
+
export declare class CommandEvent extends Event {
|
|
26
|
+
#private;
|
|
27
|
+
constructor(type: string, eventInitDict?: CommandEventInit | null);
|
|
28
|
+
/** https://html.spec.whatwg.org/#dom-commandevent-source — retargeted against currentTarget. */
|
|
29
|
+
get source(): Element | null;
|
|
30
|
+
get command(): string;
|
|
31
|
+
}
|
|
32
|
+
export declare function setDialogCommandSteps(fn: (dialog: NodeImpl, source: NodeImpl, command: string) => void): void;
|
|
33
|
+
/**
|
|
34
|
+
* The commandfor / popovertarget steps of the button activation behavior
|
|
35
|
+
* (https://html.spec.whatwg.org/#the-button-element:activation-behaviour, after the form
|
|
36
|
+
* owner steps the forms area runs). `eventTarget` is the activation event's target.
|
|
37
|
+
*/
|
|
38
|
+
export declare function buttonInvokerActivation(button: NodeImpl, eventTarget?: NodeImpl | null): void;
|
|
39
|
+
export {};
|