@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.
Files changed (380) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +338 -0
  3. package/README.md +362 -2
  4. package/dist/aria/_chunks/roles-list-CYZF-l9K.js +1503 -0
  5. package/dist/aria/_chunks/roles-list-D4WCyRO_.cjs +1754 -0
  6. package/dist/aria/index.cjs +232 -0
  7. package/dist/aria/index.js +198 -0
  8. package/dist/aria/internal.cjs +69 -0
  9. package/dist/aria/internal.js +30 -0
  10. package/dist/aria/types/accname.d.ts +40 -0
  11. package/dist/aria/types/data/aria-query.d.ts +61 -0
  12. package/dist/aria/types/data/aria-query.generated.d.ts +2 -0
  13. package/dist/aria/types/forms.d.ts +25 -0
  14. package/dist/aria/types/hidden.d.ts +38 -0
  15. package/dist/aria/types/index.d.ts +46 -0
  16. package/dist/aria/types/internal.d.ts +15 -0
  17. package/dist/aria/types/role.d.ts +27 -0
  18. package/dist/aria/types/roles-list.d.ts +18 -0
  19. package/dist/aria/types/states.d.ts +29 -0
  20. package/dist/aria/types/style.d.ts +18 -0
  21. package/dist/aria/types/tree.d.ts +20 -0
  22. package/dist/bridge/index.cjs +3 -0
  23. package/dist/bridge/index.js +4 -0
  24. package/dist/bridge/internal.cjs +3 -0
  25. package/dist/bridge/internal.js +4 -0
  26. package/dist/cli/_chunks/report-DdncYfuJ.js +93 -0
  27. package/dist/cli/ctrl-dom.js +199 -0
  28. package/dist/cli/jest-reporter.js +55 -0
  29. package/dist/cli/vitest-reporter.js +81 -0
  30. package/dist/dom/_chunks/src-Hv_BAHIV.js +47537 -0
  31. package/dist/dom/index.js +3 -0
  32. package/dist/dom/internal.js +434 -0
  33. package/dist/dom/types/collections/DOMStringMap.d.ts +8 -0
  34. package/dist/dom/types/collections/DOMTokenList.d.ts +33 -0
  35. package/dist/dom/types/collections/HTMLCollection.d.ts +62 -0
  36. package/dist/dom/types/collections/NamedNodeMap.d.ts +22 -0
  37. package/dist/dom/types/collections/NodeList.d.ts +43 -0
  38. package/dist/dom/types/collections/indexed.d.ts +8 -0
  39. package/dist/dom/types/collections/iterator.d.ts +8 -0
  40. package/dist/dom/types/css/CSS.d.ts +21 -0
  41. package/dist/dom/types/css/CSSStyleDeclaration.d.ts +57 -0
  42. package/dist/dom/types/css/cascade.d.ts +159 -0
  43. package/dist/dom/types/css/colors.d.ts +28 -0
  44. package/dist/dom/types/css/computed.d.ts +22 -0
  45. package/dist/dom/types/css/cssom.d.ts +363 -0
  46. package/dist/dom/types/css/data/properties.d.ts +1 -0
  47. package/dist/dom/types/css/declarations.d.ts +40 -0
  48. package/dist/dom/types/css/index.d.ts +5 -0
  49. package/dist/dom/types/css/inline-count.d.ts +2 -0
  50. package/dist/dom/types/css/internal.d.ts +11 -0
  51. package/dist/dom/types/css/layout-mode.d.ts +4 -0
  52. package/dist/dom/types/css/layout.d.ts +63 -0
  53. package/dist/dom/types/css/media.d.ts +55 -0
  54. package/dist/dom/types/css/parser.d.ts +93 -0
  55. package/dist/dom/types/css/properties.d.ts +28 -0
  56. package/dist/dom/types/css/resize-observer.d.ts +19 -0
  57. package/dist/dom/types/css/selector-info.d.ts +13 -0
  58. package/dist/dom/types/css/shorthands.d.ts +33 -0
  59. package/dist/dom/types/css/stylesheets.d.ts +93 -0
  60. package/dist/dom/types/css/supports.d.ts +4 -0
  61. package/dist/dom/types/css/tokenizer.d.ts +91 -0
  62. package/dist/dom/types/css/values.d.ts +91 -0
  63. package/dist/dom/types/css/view.d.ts +44 -0
  64. package/dist/dom/types/events/DataTransfer.d.ts +62 -0
  65. package/dist/dom/types/events/Event.d.ts +115 -0
  66. package/dist/dom/types/events/EventTarget.d.ts +22 -0
  67. package/dist/dom/types/events/UIEvents.d.ts +308 -0
  68. package/dist/dom/types/events/activation.d.ts +7 -0
  69. package/dist/dom/types/events/convert.d.ts +16 -0
  70. package/dist/dom/types/events/createEvent.d.ts +3 -0
  71. package/dist/dom/types/events/dispatch.d.ts +39 -0
  72. package/dist/dom/types/events/events.d.ts +200 -0
  73. package/dist/dom/types/events/fire.d.ts +21 -0
  74. package/dist/dom/types/events/handlers.d.ts +14 -0
  75. package/dist/dom/types/events/listeners.d.ts +32 -0
  76. package/dist/dom/types/events/report.d.ts +10 -0
  77. package/dist/dom/types/html/HTMLElement.d.ts +126 -0
  78. package/dist/dom/types/html/MathMLElement.d.ts +6 -0
  79. package/dist/dom/types/html/SVGElement.d.ts +145 -0
  80. package/dist/dom/types/html/anchor.d.ts +16 -0
  81. package/dist/dom/types/html/aria-reflection.d.ts +14 -0
  82. package/dist/dom/types/html/collection.d.ts +5 -0
  83. package/dist/dom/types/html/custom-elements.d.ts +129 -0
  84. package/dist/dom/types/html/elements.d.ts +202 -0
  85. package/dist/dom/types/html/events.d.ts +22 -0
  86. package/dist/dom/types/html/focus.d.ts +63 -0
  87. package/dist/dom/types/html/forms/FileList.d.ts +1 -0
  88. package/dist/dom/types/html/forms/FormData.d.ts +7 -0
  89. package/dist/dom/types/html/forms/HTMLButtonElement.d.ts +36 -0
  90. package/dist/dom/types/html/forms/HTMLFieldSetElement.d.ts +29 -0
  91. package/dist/dom/types/html/forms/HTMLFormElement.d.ts +61 -0
  92. package/dist/dom/types/html/forms/HTMLInputElement.d.ts +204 -0
  93. package/dist/dom/types/html/forms/HTMLLabelElement.d.ts +15 -0
  94. package/dist/dom/types/html/forms/HTMLOptionElement.d.ts +61 -0
  95. package/dist/dom/types/html/forms/HTMLOutputElement.d.ts +74 -0
  96. package/dist/dom/types/html/forms/HTMLSelectElement.d.ts +96 -0
  97. package/dist/dom/types/html/forms/HTMLTextAreaElement.d.ts +82 -0
  98. package/dist/dom/types/html/forms/autofill.d.ts +10 -0
  99. package/dist/dom/types/html/forms/collections.d.ts +112 -0
  100. package/dist/dom/types/html/forms/common.d.ts +36 -0
  101. package/dist/dom/types/html/forms/face.d.ts +59 -0
  102. package/dist/dom/types/html/forms/form-associated.d.ts +46 -0
  103. package/dist/dom/types/html/forms/form-submission.d.ts +55 -0
  104. package/dist/dom/types/html/forms/index.d.ts +17 -0
  105. package/dist/dom/types/html/forms/input-type.d.ts +50 -0
  106. package/dist/dom/types/html/forms/microsyntaxes.d.ts +52 -0
  107. package/dist/dom/types/html/forms/state.d.ts +54 -0
  108. package/dist/dom/types/html/forms/ui.d.ts +35 -0
  109. package/dist/dom/types/html/forms/user-validity.d.ts +19 -0
  110. package/dist/dom/types/html/forms/validation.d.ts +76 -0
  111. package/dist/dom/types/html/index.d.ts +13 -0
  112. package/dist/dom/types/html/innerText.d.ts +9 -0
  113. package/dist/dom/types/html/interactive.d.ts +43 -0
  114. package/dist/dom/types/html/invokers.d.ts +39 -0
  115. package/dist/dom/types/html/media.d.ts +86 -0
  116. package/dist/dom/types/html/reflect.d.ts +67 -0
  117. package/dist/dom/types/html/registry.d.ts +9 -0
  118. package/dist/dom/types/html/resources.d.ts +55 -0
  119. package/dist/dom/types/html/shared.d.ts +22 -0
  120. package/dist/dom/types/html/slot.d.ts +15 -0
  121. package/dist/dom/types/html/template.d.ts +18 -0
  122. package/dist/dom/types/html/top-layer.d.ts +73 -0
  123. package/dist/dom/types/index.d.ts +50 -0
  124. package/dist/dom/types/internal.d.ts +61 -0
  125. package/dist/dom/types/keys.d.ts +209 -0
  126. package/dist/dom/types/nodes/Attr.d.ts +25 -0
  127. package/dist/dom/types/nodes/CharacterData.d.ts +35 -0
  128. package/dist/dom/types/nodes/Document.d.ts +169 -0
  129. package/dist/dom/types/nodes/DocumentFragment.d.ts +12 -0
  130. package/dist/dom/types/nodes/DocumentType.d.ts +17 -0
  131. package/dist/dom/types/nodes/Element.d.ts +142 -0
  132. package/dist/dom/types/nodes/Node.d.ts +112 -0
  133. package/dist/dom/types/nodes/NodeImpl.d.ts +90 -0
  134. package/dist/dom/types/nodes/ShadowRoot.d.ts +43 -0
  135. package/dist/dom/types/nodes/attr-nodes.d.ts +8 -0
  136. package/dist/dom/types/nodes/attributes.d.ts +46 -0
  137. package/dist/dom/types/nodes/cache.d.ts +38 -0
  138. package/dist/dom/types/nodes/character-data.d.ts +5 -0
  139. package/dist/dom/types/nodes/clone.d.ts +5 -0
  140. package/dist/dom/types/nodes/constants.d.ts +52 -0
  141. package/dist/dom/types/nodes/create.d.ts +42 -0
  142. package/dist/dom/types/nodes/derived.d.ts +26 -0
  143. package/dist/dom/types/nodes/inspect.d.ts +2 -0
  144. package/dist/dom/types/nodes/mixins.d.ts +41 -0
  145. package/dist/dom/types/nodes/names.d.ts +15 -0
  146. package/dist/dom/types/nodes/slots.d.ts +38 -0
  147. package/dist/dom/types/nodes/tags.d.ts +8 -0
  148. package/dist/dom/types/nodes/traverse.d.ts +21 -0
  149. package/dist/dom/types/nodes/tree.d.ts +47 -0
  150. package/dist/dom/types/observers/MutationObserver.d.ts +33 -0
  151. package/dist/dom/types/observers/MutationRecord.d.ts +17 -0
  152. package/dist/dom/types/observers/queue.d.ts +45 -0
  153. package/dist/dom/types/parser/entities-data.d.ts +3 -0
  154. package/dist/dom/types/parser/entities.d.ts +11 -0
  155. package/dist/dom/types/parser/index.d.ts +34 -0
  156. package/dist/dom/types/parser/tags.d.ts +182 -0
  157. package/dist/dom/types/parser/tokenizer.d.ts +109 -0
  158. package/dist/dom/types/parser/treebuilder.d.ts +271 -0
  159. package/dist/dom/types/parser/xml.d.ts +14 -0
  160. package/dist/dom/types/selectors/compile.d.ts +154 -0
  161. package/dist/dom/types/selectors/filter.d.ts +21 -0
  162. package/dist/dom/types/selectors/html-predicates.d.ts +1 -0
  163. package/dist/dom/types/selectors/index.d.ts +16 -0
  164. package/dist/dom/types/selectors/internal.d.ts +87 -0
  165. package/dist/dom/types/selectors/parser.d.ts +310 -0
  166. package/dist/dom/types/selectors/serialize.d.ts +20 -0
  167. package/dist/dom/types/selectors/state.d.ts +43 -0
  168. package/dist/dom/types/serializer/index.d.ts +29 -0
  169. package/dist/dom/types/trace.d.ts +51 -0
  170. package/dist/dom/types/traversal/Range.d.ts +113 -0
  171. package/dist/dom/types/traversal/Selection.d.ts +45 -0
  172. package/dist/dom/types/traversal/TreeWalker.d.ts +77 -0
  173. package/dist/dom/types/traversal/live.d.ts +46 -0
  174. package/dist/dom/types/webidl-runtime.d.ts +18 -0
  175. package/dist/dom/types/webidl.d.ts +34 -0
  176. package/dist/dom/types/window/DOMStringList.d.ts +14 -0
  177. package/dist/dom/types/window/FileList.d.ts +11 -0
  178. package/dist/dom/types/window/FileReader.d.ts +27 -0
  179. package/dist/dom/types/window/History.d.ts +43 -0
  180. package/dist/dom/types/window/Location.d.ts +46 -0
  181. package/dist/dom/types/window/Navigator.d.ts +79 -0
  182. package/dist/dom/types/window/Screen.d.ts +27 -0
  183. package/dist/dom/types/window/Storage.d.ts +28 -0
  184. package/dist/dom/types/window/Window.d.ts +329 -0
  185. package/dist/dom/types/window/abort.d.ts +4 -0
  186. package/dist/dom/types/window/browsing-context.d.ts +12 -0
  187. package/dist/dom/types/window/clock.d.ts +163 -0
  188. package/dist/dom/types/window/compat.d.ts +34 -0
  189. package/dist/dom/types/window/cookies.d.ts +21 -0
  190. package/dist/dom/types/window/current.d.ts +7 -0
  191. package/dist/dom/types/window/document.d.ts +19 -0
  192. package/dist/dom/types/window/events.d.ts +11 -0
  193. package/dist/dom/types/window/fallbacks.d.ts +20 -0
  194. package/dist/dom/types/window/geometry.d.ts +133 -0
  195. package/dist/dom/types/window/globals.d.ts +7 -0
  196. package/dist/dom/types/window/hooks.d.ts +22 -0
  197. package/dist/dom/types/window/host-originals.d.ts +9 -0
  198. package/dist/dom/types/window/interfaces.d.ts +13 -0
  199. package/dist/dom/types/window/isolation.d.ts +20 -0
  200. package/dist/dom/types/window/media.d.ts +33 -0
  201. package/dist/dom/types/window/not-implemented.d.ts +23 -0
  202. package/dist/dom/types/window/observers.d.ts +42 -0
  203. package/dist/dom/types/window/origin.d.ts +3 -0
  204. package/dist/dom/types/window/timers.d.ts +28 -0
  205. package/dist/dom/types/window/xhr.d.ts +108 -0
  206. package/dist/jest-dom/_chunks/matchers-CDnnXUfG.js +2211 -0
  207. package/dist/jest-dom/_chunks/matchers-D988Ducb.cjs +2516 -0
  208. package/dist/jest-dom/index.cjs +5 -0
  209. package/dist/jest-dom/index.js +6 -0
  210. package/dist/jest-dom/jest-globals.cjs +6 -0
  211. package/dist/jest-dom/jest-globals.js +7 -0
  212. package/dist/jest-dom/matchers.cjs +53 -0
  213. package/dist/jest-dom/matchers.js +3 -0
  214. package/dist/jest-dom/types/bun.d.ts +13 -0
  215. package/dist/jest-dom/types/index.d.ts +3 -0
  216. package/dist/jest-dom/types/jest-globals.d.ts +13 -0
  217. package/dist/jest-dom/types/jest.d.ts +15 -0
  218. package/dist/jest-dom/types/matchers-standalone.d.ts +32 -0
  219. package/dist/jest-dom/types/matchers.d.ts +1079 -0
  220. package/dist/jest-dom/types/package.json +1 -0
  221. package/dist/jest-dom/types/vitest.d.ts +16 -0
  222. package/dist/jest-dom/vitest.cjs +6 -0
  223. package/dist/jest-dom/vitest.js +7 -0
  224. package/dist/react/_chunks/pure-DZ97z2oT.cjs +498 -0
  225. package/dist/react/_chunks/pure-PtE2hivW.js +420 -0
  226. package/dist/react/dont-cleanup-after-each.cjs +3 -0
  227. package/dist/react/dont-cleanup-after-each.js +4 -0
  228. package/dist/react/index.cjs +47 -0
  229. package/dist/react/index.js +35 -0
  230. package/dist/react/pure.cjs +17 -0
  231. package/dist/react/pure.js +5 -0
  232. package/dist/react/types/act-compat.d.ts +6 -0
  233. package/dist/react/types/config.d.ts +9 -0
  234. package/dist/react/types/dont-cleanup-after-each.d.ts +1 -0
  235. package/dist/react/types/dtl.d.ts +1 -0
  236. package/dist/react/types/fire-event.d.ts +3 -0
  237. package/dist/react/types/index.d.ts +1 -0
  238. package/dist/react/types/pure.d.ts +136 -0
  239. package/dist/register/index.js +11 -0
  240. package/dist/register/pure.js +147 -0
  241. package/dist/register/types/index.d.ts +1 -0
  242. package/dist/register/types/pure.d.ts +36 -0
  243. package/dist/testing-library/_chunks/aria-snapshot-diff-D7PzpXew.cjs +1170 -0
  244. package/dist/testing-library/_chunks/aria-snapshot-diff-Q8Wj33K0.js +985 -0
  245. package/dist/testing-library/agent.cjs +721 -0
  246. package/dist/testing-library/agent.js +713 -0
  247. package/dist/testing-library/index.cjs +2469 -0
  248. package/dist/testing-library/index.js +2390 -0
  249. package/dist/testing-library/types/agent.d.ts +56 -0
  250. package/dist/testing-library/types/aria-role.d.ts +99 -0
  251. package/dist/testing-library/types/aria-snapshot.d.ts +43 -0
  252. package/dist/testing-library/types/config.d.ts +27 -0
  253. package/dist/testing-library/types/events.d.ts +118 -0
  254. package/dist/testing-library/types/get-node-text.d.ts +1 -0
  255. package/dist/testing-library/types/get-queries-for-element.d.ts +182 -0
  256. package/dist/testing-library/types/index.d.ts +24 -0
  257. package/dist/testing-library/types/matches.d.ts +46 -0
  258. package/dist/testing-library/types/pretty-dom.d.ts +37 -0
  259. package/dist/testing-library/types/queries.d.ts +315 -0
  260. package/dist/testing-library/types/query-helpers.d.ts +112 -0
  261. package/dist/testing-library/types/role-helpers.d.ts +19 -0
  262. package/dist/testing-library/types/screen.d.ts +30 -0
  263. package/dist/testing-library/types/suggestions.d.ts +46 -0
  264. package/dist/testing-library/types/wait-for-element-to-be-removed.d.ts +6 -0
  265. package/dist/testing-library/types/wait-for.d.ts +12 -0
  266. package/dist/user-event/index.cjs +3923 -0
  267. package/dist/user-event/index.js +3898 -0
  268. package/dist/user-event/types/clipboard/copy.d.ts +2 -0
  269. package/dist/user-event/types/clipboard/cut.d.ts +2 -0
  270. package/dist/user-event/types/clipboard/index.d.ts +3 -0
  271. package/dist/user-event/types/clipboard/paste.d.ts +3 -0
  272. package/dist/user-event/types/convenience/click.d.ts +5 -0
  273. package/dist/user-event/types/convenience/hover.d.ts +4 -0
  274. package/dist/user-event/types/convenience/index.d.ts +3 -0
  275. package/dist/user-event/types/convenience/tab.d.ts +4 -0
  276. package/dist/user-event/types/ctrl-dom.d.ts +55 -0
  277. package/dist/user-event/types/document/UI.d.ts +35 -0
  278. package/dist/user-event/types/document/copySelection.d.ts +2 -0
  279. package/dist/user-event/types/document/getValueOrTextContent.d.ts +2 -0
  280. package/dist/user-event/types/document/index.d.ts +5 -0
  281. package/dist/user-event/types/document/interceptor.d.ts +20 -0
  282. package/dist/user-event/types/document/patchFocus.d.ts +7 -0
  283. package/dist/user-event/types/document/prepareDocument.d.ts +2 -0
  284. package/dist/user-event/types/document/trackValue.d.ts +13 -0
  285. package/dist/user-event/types/dom-types.d.ts +56 -0
  286. package/dist/user-event/types/event/behavior/click.d.ts +1 -0
  287. package/dist/user-event/types/event/behavior/cut.d.ts +1 -0
  288. package/dist/user-event/types/event/behavior/index.d.ts +8 -0
  289. package/dist/user-event/types/event/behavior/keydown.d.ts +1 -0
  290. package/dist/user-event/types/event/behavior/keypress.d.ts +1 -0
  291. package/dist/user-event/types/event/behavior/keyup.d.ts +1 -0
  292. package/dist/user-event/types/event/behavior/paste.d.ts +1 -0
  293. package/dist/user-event/types/event/behavior/registry.d.ts +9 -0
  294. package/dist/user-event/types/event/createEvent.d.ts +8 -0
  295. package/dist/user-event/types/event/dispatchEvent.d.ts +6 -0
  296. package/dist/user-event/types/event/eventMap.d.ts +265 -0
  297. package/dist/user-event/types/event/focus.d.ts +6 -0
  298. package/dist/user-event/types/event/index.d.ts +7 -0
  299. package/dist/user-event/types/event/input.d.ts +3 -0
  300. package/dist/user-event/types/event/radio.d.ts +5 -0
  301. package/dist/user-event/types/event/selection/getInputRange.d.ts +6 -0
  302. package/dist/user-event/types/event/selection/getTargetTypeAndSelection.d.ts +11 -0
  303. package/dist/user-event/types/event/selection/index.d.ts +15 -0
  304. package/dist/user-event/types/event/selection/modifySelection.d.ts +9 -0
  305. package/dist/user-event/types/event/selection/modifySelectionPerMouse.d.ts +8 -0
  306. package/dist/user-event/types/event/selection/moveSelection.d.ts +5 -0
  307. package/dist/user-event/types/event/selection/resolveCaretPosition.d.ts +9 -0
  308. package/dist/user-event/types/event/selection/selectAll.d.ts +6 -0
  309. package/dist/user-event/types/event/selection/setSelection.d.ts +11 -0
  310. package/dist/user-event/types/event/selection/setSelectionPerMouse.d.ts +9 -0
  311. package/dist/user-event/types/event/selection/setSelectionRange.d.ts +7 -0
  312. package/dist/user-event/types/event/selection/updateSelectionOnFocus.d.ts +6 -0
  313. package/dist/user-event/types/event/types.d.ts +21 -0
  314. package/dist/user-event/types/event/wrapEvent.d.ts +2 -0
  315. package/dist/user-event/types/index.d.ts +6 -0
  316. package/dist/user-event/types/keyboard/index.d.ts +3 -0
  317. package/dist/user-event/types/keyboard/keyMap.d.ts +5 -0
  318. package/dist/user-event/types/keyboard/parseKeyDef.d.ts +17 -0
  319. package/dist/user-event/types/options.d.ts +121 -0
  320. package/dist/user-event/types/pointer/index.d.ts +29 -0
  321. package/dist/user-event/types/pointer/keyMap.d.ts +2 -0
  322. package/dist/user-event/types/pointer/parseKeyDef.d.ts +6 -0
  323. package/dist/user-event/types/setup/api.d.ts +23 -0
  324. package/dist/user-event/types/setup/directApi.d.ts +25 -0
  325. package/dist/user-event/types/setup/dtl.d.ts +20 -0
  326. package/dist/user-event/types/setup/index.d.ts +22 -0
  327. package/dist/user-event/types/setup/setup.d.ts +45 -0
  328. package/dist/user-event/types/setup/wrapAsync.d.ts +4 -0
  329. package/dist/user-event/types/system/index.d.ts +13 -0
  330. package/dist/user-event/types/system/keyLocation.d.ts +11 -0
  331. package/dist/user-event/types/system/keyboard.d.ts +46 -0
  332. package/dist/user-event/types/system/pointer/buttons.d.ts +25 -0
  333. package/dist/user-event/types/system/pointer/device.d.ts +8 -0
  334. package/dist/user-event/types/system/pointer/index.d.ts +21 -0
  335. package/dist/user-event/types/system/pointer/mouse.d.ts +31 -0
  336. package/dist/user-event/types/system/pointer/pointer.d.ts +32 -0
  337. package/dist/user-event/types/system/pointer/shared.d.ts +21 -0
  338. package/dist/user-event/types/utility/clear.d.ts +3 -0
  339. package/dist/user-event/types/utility/index.d.ts +4 -0
  340. package/dist/user-event/types/utility/selectOptions.d.ts +4 -0
  341. package/dist/user-event/types/utility/type.d.ts +10 -0
  342. package/dist/user-event/types/utility/upload.d.ts +6 -0
  343. package/dist/user-event/types/utils/click/isClickableInput.d.ts +17 -0
  344. package/dist/user-event/types/utils/dataTransfer/Blob.d.ts +4 -0
  345. package/dist/user-event/types/utils/dataTransfer/Clipboard.d.ts +12 -0
  346. package/dist/user-event/types/utils/dataTransfer/DataTransfer.d.ts +3 -0
  347. package/dist/user-event/types/utils/dataTransfer/FileList.d.ts +2 -0
  348. package/dist/user-event/types/utils/edit/isContentEditable.d.ts +8 -0
  349. package/dist/user-event/types/utils/edit/isEditable.d.ts +26 -0
  350. package/dist/user-event/types/utils/edit/maxLength.d.ts +16 -0
  351. package/dist/user-event/types/utils/edit/setFiles.d.ts +11 -0
  352. package/dist/user-event/types/utils/edit/timeValue.d.ts +5 -0
  353. package/dist/user-event/types/utils/focus/cursor.d.ts +5 -0
  354. package/dist/user-event/types/utils/focus/getActiveElement.d.ts +3 -0
  355. package/dist/user-event/types/utils/focus/getTabDestination.d.ts +2 -0
  356. package/dist/user-event/types/utils/focus/isFocusable.d.ts +2 -0
  357. package/dist/user-event/types/utils/focus/selection.d.ts +9 -0
  358. package/dist/user-event/types/utils/focus/selector.d.ts +1 -0
  359. package/dist/user-event/types/utils/index.d.ts +29 -0
  360. package/dist/user-event/types/utils/keyDef/readNextDescriptor.d.ts +21 -0
  361. package/dist/user-event/types/utils/misc/cloneEvent.d.ts +2 -0
  362. package/dist/user-event/types/utils/misc/findClosest.d.ts +2 -0
  363. package/dist/user-event/types/utils/misc/getDocumentFromNode.d.ts +2 -0
  364. package/dist/user-event/types/utils/misc/getTreeDiff.d.ts +2 -0
  365. package/dist/user-event/types/utils/misc/getWindow.d.ts +2 -0
  366. package/dist/user-event/types/utils/misc/isDescendantOrSelf.d.ts +2 -0
  367. package/dist/user-event/types/utils/misc/isDisabled.d.ts +2 -0
  368. package/dist/user-event/types/utils/misc/isElementType.d.ts +6 -0
  369. package/dist/user-event/types/utils/misc/isVisible.d.ts +2 -0
  370. package/dist/user-event/types/utils/misc/level.d.ts +9 -0
  371. package/dist/user-event/types/utils/misc/wait.d.ts +6 -0
  372. package/dist/user-event/types/utils/pointer/cssPointerEvents.d.ts +4 -0
  373. package/dist/vitest-environment/failure-snapshot.js +42 -0
  374. package/dist/vitest-environment/index.js +185 -0
  375. package/dist/vitest-environment/plugin.js +90 -0
  376. package/dist/vitest-environment/types/failure-snapshot.d.ts +1 -0
  377. package/dist/vitest-environment/types/index.d.ts +29 -0
  378. package/dist/vitest-environment/types/plugin.d.ts +33 -0
  379. package/jest-preset.cjs +17 -0
  380. package/package.json +178 -4
@@ -0,0 +1,129 @@
1
+ import type { NodeImpl } from "../nodes/NodeImpl.js";
2
+ import type { Document } from "../nodes/Document.js";
3
+ import type { Element } from "../nodes/Element.js";
4
+ import { $byCtor, $byName, $impl, $running, $whenDefined, $window } from "../keys.js";
5
+ type Callback = (...args: unknown[]) => unknown;
6
+ export interface CustomElementDefinition {
7
+ name: string;
8
+ localName: string;
9
+ constructor: Function;
10
+ observedAttributes: Set<string>;
11
+ connectedCallback: Callback | null;
12
+ disconnectedCallback: Callback | null;
13
+ adoptedCallback: Callback | null;
14
+ attributeChangedCallback: Callback | null;
15
+ connectedMoveCallback: Callback | null;
16
+ formAssociatedCallback: Callback | null;
17
+ formResetCallback: Callback | null;
18
+ formDisabledCallback: Callback | null;
19
+ formStateRestoreCallback: Callback | null;
20
+ formAssociated: boolean;
21
+ disableInternals: boolean;
22
+ disableShadow: boolean;
23
+ /** https://html.spec.whatwg.org/#concept-custom-element-definition-construction-stack */
24
+ constructionStack: (Element | typeof ALREADY_CONSTRUCTED)[];
25
+ /** The registry the definition belongs to. */
26
+ registry: CustomElementRegistry;
27
+ }
28
+ declare const ALREADY_CONSTRUCTED: unique symbol;
29
+ /** https://html.spec.whatwg.org/#valid-custom-element-name */
30
+ export declare function isValidCustomElementName(name: string): boolean;
31
+ interface Deferred {
32
+ promise: Promise<Function>;
33
+ resolve: (c: Function) => void;
34
+ }
35
+ export interface ElementDefinitionOptions {
36
+ extends?: string;
37
+ }
38
+ /** https://html.spec.whatwg.org/#customelementregistry */
39
+ export declare class CustomElementRegistry {
40
+ [$byName]: Map<string, CustomElementDefinition>;
41
+ [$byCtor]: Map<Function, CustomElementDefinition>;
42
+ [$whenDefined]: Map<string, Deferred>;
43
+ [$running]: boolean;
44
+ [$window]: object | null;
45
+ /** @internal */
46
+ constructor(window?: object | null);
47
+ /** https://html.spec.whatwg.org/#dom-customelementregistry-define */
48
+ define(name: string, constructor: Function, options?: ElementDefinitionOptions): void;
49
+ /** https://html.spec.whatwg.org/#dom-customelementregistry-get */
50
+ get(name: string): Function | undefined;
51
+ /** https://html.spec.whatwg.org/#dom-customelementregistry-getname */
52
+ getName(constructor: Function): string | null;
53
+ /** https://html.spec.whatwg.org/#dom-customelementregistry-whendefined */
54
+ whenDefined(name: string): Promise<Function>;
55
+ /** https://html.spec.whatwg.org/#dom-customelementregistry-upgrade */
56
+ upgrade(root: {
57
+ [$impl]: NodeImpl;
58
+ }): void;
59
+ /** @internal https://html.spec.whatwg.org/#look-up-a-custom-element-definition (registry part). */
60
+ _lookup(ns: string | null, localName: string, is: string | null): CustomElementDefinition | null;
61
+ }
62
+ /** The CustomElementRegistry of a Window (created on first use). The window agent exposes it as `window.customElements`. */
63
+ export declare function customElementRegistryFor(window: object): CustomElementRegistry;
64
+ /** https://html.spec.whatwg.org/#look-up-a-custom-element-definition */
65
+ export declare function lookupDefinition(doc: Document, ns: string | null, localName: string, is: string | null): CustomElementDefinition | null;
66
+ /** https://html.spec.whatwg.org/#selector-defined — custom element state is "custom" or "uncustomized". */
67
+ export declare function isDefined(impl: NodeImpl): boolean;
68
+ export declare function definitionOf(el: Element): CustomElementDefinition | undefined;
69
+ export declare function isValueOf(el: Element): string | null;
70
+ /** https://dom.spec.whatwg.org/#concept-element-custom-element-state is "precustomized" or "custom" (attachShadow's "available to element internals"). */
71
+ export declare function isPrecustomizedOrCustom(el: Element): boolean;
72
+ export type ConstructResult = {
73
+ upgrade: Element;
74
+ doc: null;
75
+ localName: "";
76
+ def: null;
77
+ active: null;
78
+ } | {
79
+ upgrade: null;
80
+ doc: Document;
81
+ localName: string;
82
+ def: CustomElementDefinition;
83
+ active: Function | null;
84
+ };
85
+ /**
86
+ * https://html.spec.whatwg.org/#html-element-constructors — run when an HTML element interface
87
+ * constructor is invoked without the internal creation arguments (i.e. from user code).
88
+ */
89
+ export declare function htmlElementConstructorSteps(newTarget: Function): ConstructResult;
90
+ /** Step 8 after the HTMLElement constructor created a brand-new custom element. */
91
+ export declare function initNewCustomElement(el: Element, def: CustomElementDefinition, active: Function | null): void;
92
+ export declare function setFaceUpgradeHook(fn: (impl: NodeImpl) => void): void;
93
+ /**
94
+ * Runs a user agent action that is not part of a [CEReactions] API call — activation behaviors
95
+ * reached through `click()` / `dispatchEvent()` (neither is [CEReactions]) and the close request /
96
+ * light dismiss steps after a dispatch. The DOM mutations it makes would flush the current element
97
+ * queue right away (create.ts approximates [CEReactions] per mutation); here the reactions they
98
+ * enqueue go to the backup element queue instead and run in a microtask, as the spec's
99
+ * https://html.spec.whatwg.org/#enqueue-an-element-on-the-appropriate-element-queue step 1 says
100
+ * when the custom element reactions stack is empty.
101
+ */
102
+ export declare function outsideCEReactions<T>(fn: () => T): T;
103
+ /** Enqueue a form-associated custom element callback (formAssociatedCallback & co.; html/forms/face.ts). */
104
+ export declare function enqueueFormCallback(el: Element, name: "formAssociatedCallback" | "formResetCallback" | "formDisabledCallback" | "formStateRestoreCallback", args: unknown[]): void;
105
+ /**
106
+ * https://html.spec.whatwg.org/#invoke-custom-element-reactions for the current element queue.
107
+ * Re-entrant: a DOM call made by a callback flushes (only) the reactions it enqueued before the
108
+ * callback continues, like the nested [CEReactions] scope of that call.
109
+ */
110
+ export declare function flushReactions(): void;
111
+ /** https://html.spec.whatwg.org/#report-an-exception (fires `error` on the window; src/events). */
112
+ export declare function reportException(e: unknown, target?: Element | null): void;
113
+ export declare function ceConnected(el: Element): void;
114
+ export declare function ceDisconnected(el: Element): void;
115
+ export declare function ceAttributeChanged(el: Element, localName: string, oldValue: string | null, value: string | null, ns: string | null): void;
116
+ /**
117
+ * https://dom.spec.whatwg.org/#move step 24.2 (moveBefore within a connected tree): enqueue
118
+ * connectedMoveCallback, or, without one, disconnectedCallback then connectedCallback
119
+ * (https://html.spec.whatwg.org/#enqueue-a-custom-element-callback-reaction step 3).
120
+ */
121
+ export declare function ceMoved(el: Element): void;
122
+ /** https://dom.spec.whatwg.org/#concept-node-adopt step 3.2.1 */
123
+ export declare function ceAdopted(el: Element, oldDoc: Document, newDoc: Document): void;
124
+ /**
125
+ * https://dom.spec.whatwg.org/#concept-attach-a-shadow-root step 3: the definition (looked up by
126
+ * name, like the spec) disables shadow roots.
127
+ */
128
+ export declare function shadowDisabled(el: Element): boolean;
129
+ export {};
@@ -0,0 +1,202 @@
1
+ import { HTMLElement } from "./HTMLElement.js";
2
+ import type { Element } from "../nodes/Element.js";
3
+ import type { Document } from "../nodes/Document.js";
4
+ import type { Window } from "../window/Window.js";
5
+ import { type ConstraintValidation, type ValidityState } from "./forms/validation.js";
6
+ import type { HTMLCollection } from "../collections/HTMLCollection.js";
7
+ import { $customValidity, $validity } from "../keys.js";
8
+ /** Lazily created, per-element [SameObject] value stored under a non-enumerable symbol. */
9
+ export declare function sameObject<V>(el: object, key: symbol, create: () => V): V;
10
+ export declare class HTMLHtmlElement extends HTMLElement {
11
+ }
12
+ export declare class HTMLHeadElement extends HTMLElement {
13
+ }
14
+ export declare class HTMLBaseElement extends HTMLElement {
15
+ /** https://html.spec.whatwg.org/#dom-base-href — resolved against the document's fallback base URL. */
16
+ get href(): string;
17
+ set href(v: string);
18
+ }
19
+ export declare class HTMLMetaElement extends HTMLElement {
20
+ }
21
+ export declare class HTMLBodyElement extends HTMLElement {
22
+ }
23
+ export declare class HTMLHeadingElement extends HTMLElement {
24
+ }
25
+ export declare class HTMLParagraphElement extends HTMLElement {
26
+ }
27
+ export declare class HTMLHRElement extends HTMLElement {
28
+ }
29
+ export declare class HTMLPreElement extends HTMLElement {
30
+ }
31
+ export declare class HTMLQuoteElement extends HTMLElement {
32
+ }
33
+ export declare class HTMLOListElement extends HTMLElement {
34
+ }
35
+ export declare class HTMLUListElement extends HTMLElement {
36
+ }
37
+ export declare class HTMLMenuElement extends HTMLElement {
38
+ }
39
+ export declare class HTMLLIElement extends HTMLElement {
40
+ }
41
+ export declare class HTMLDListElement extends HTMLElement {
42
+ }
43
+ export declare class HTMLDivElement extends HTMLElement {
44
+ }
45
+ export declare class HTMLDataElement extends HTMLElement {
46
+ }
47
+ export declare class HTMLTimeElement extends HTMLElement {
48
+ }
49
+ export declare class HTMLSpanElement extends HTMLElement {
50
+ }
51
+ export declare class HTMLBRElement extends HTMLElement {
52
+ }
53
+ export declare class HTMLModElement extends HTMLElement {
54
+ }
55
+ export declare class HTMLPictureElement extends HTMLElement {
56
+ }
57
+ export declare class HTMLSourceElement extends HTMLElement {
58
+ }
59
+ /**
60
+ * https://html.spec.whatwg.org/#htmlimageelement — nothing is fetched, so an image with a source
61
+ * stays "pending" forever: `complete` is false, natural dimensions are 0, no load/error events
62
+ * fire (as jsdom without resource loading). `decode()` resolves.
63
+ */
64
+ export declare class HTMLImageElement extends HTMLElement {
65
+ /**
66
+ * https://html.spec.whatwg.org/#dom-img-complete — true only when there is no source
67
+ * (no srcset and an empty/absent src); a request that never progresses is neither
68
+ * completely available nor broken.
69
+ */
70
+ get complete(): boolean;
71
+ get naturalWidth(): number;
72
+ get naturalHeight(): number;
73
+ get currentSrc(): string;
74
+ get x(): number;
75
+ get y(): number;
76
+ /** https://html.spec.whatwg.org/#dom-img-width — rendered width unavailable: the attribute, or the natural width (0). */
77
+ get width(): number;
78
+ set width(v: number);
79
+ get height(): number;
80
+ set height(v: number);
81
+ decode(): Promise<void>;
82
+ }
83
+ /**
84
+ * https://html.spec.whatwg.org/#dom-image — `new Image(width?, height?)` creates an <img> in the
85
+ * current window's document.
86
+ */
87
+ export declare const Image: {
88
+ new (width?: number, height?: number): HTMLImageElement;
89
+ prototype: HTMLImageElement;
90
+ };
91
+ /** https://html.spec.whatwg.org/#htmliframeelement — no nested browsing context (contentWindow/contentDocument are null). */
92
+ export declare class HTMLIFrameElement extends HTMLElement {
93
+ constructor(doc?: Document, localName?: string, ns?: string | null, prefix?: string | null);
94
+ _connectedSteps(): void;
95
+ _disconnectedSteps(): void;
96
+ /** https://html.spec.whatwg.org/#dom-iframe-contentdocument (always same-origin here) */
97
+ get contentDocument(): Document | null;
98
+ /** https://html.spec.whatwg.org/#dom-iframe-contentwindow */
99
+ get contentWindow(): Window | null;
100
+ getSVGDocument(): null;
101
+ }
102
+ export declare class HTMLEmbedElement extends HTMLElement {
103
+ getSVGDocument(): null;
104
+ }
105
+ /**
106
+ * https://html.spec.whatwg.org/#htmlobjectelement — never loads; no nested browsing context.
107
+ * Constraint validation via the forms area's mixin: objects are always barred from constraint
108
+ * validation (willValidate false), but setCustomValidity still sets validity.customError.
109
+ */
110
+ export declare class HTMLObjectElement extends HTMLElement {
111
+ [$customValidity]: string;
112
+ [$validity]: ValidityState | null;
113
+ get contentDocument(): null;
114
+ get contentWindow(): null;
115
+ getSVGDocument(): null;
116
+ get form(): Element | null;
117
+ _barredFromValidation(): boolean;
118
+ _validityFlags(): number;
119
+ _validationMessage(_flags: number): string;
120
+ }
121
+ export interface HTMLObjectElement extends ConstraintValidation {
122
+ }
123
+ export declare class HTMLParamElement extends HTMLElement {
124
+ }
125
+ export declare class HTMLTrackElement extends HTMLElement {
126
+ static readonly NONE = 0;
127
+ static readonly LOADING = 1;
128
+ static readonly LOADED = 2;
129
+ static readonly ERROR = 3;
130
+ get readyState(): number;
131
+ get track(): null;
132
+ }
133
+ export declare class HTMLMapElement extends HTMLElement {
134
+ /** https://html.spec.whatwg.org/#dom-map-areas */
135
+ get areas(): HTMLCollection;
136
+ }
137
+ /** https://html.spec.whatwg.org/#htmlcanvaselement — no rendering backend. */
138
+ export declare class HTMLCanvasElement extends HTMLElement {
139
+ getContext(_contextId: string, _options?: unknown): null;
140
+ toDataURL(_type?: string, _quality?: unknown): string;
141
+ toBlob(callback: (blob: null) => void): void;
142
+ transferControlToOffscreen(): never;
143
+ captureStream(): never;
144
+ }
145
+ export declare class HTMLTableElement extends HTMLElement {
146
+ get caption(): Element | null;
147
+ set caption(value: Element | null);
148
+ createCaption(): Element;
149
+ deleteCaption(): void;
150
+ get tHead(): Element | null;
151
+ set tHead(value: Element | null);
152
+ createTHead(): Element;
153
+ deleteTHead(): void;
154
+ get tFoot(): Element | null;
155
+ set tFoot(value: Element | null);
156
+ createTFoot(): Element;
157
+ deleteTFoot(): void;
158
+ get tBodies(): HTMLCollection;
159
+ createTBody(): Element;
160
+ get rows(): HTMLCollection;
161
+ /** https://html.spec.whatwg.org/#dom-table-insertrow */
162
+ insertRow(index?: number): Element;
163
+ deleteRow(index: number): void;
164
+ _afterCaptionAndColgroups(): Element | null;
165
+ }
166
+ export declare class HTMLTableCaptionElement extends HTMLElement {
167
+ }
168
+ export declare class HTMLTableColElement extends HTMLElement {
169
+ }
170
+ export declare class HTMLTableSectionElement extends HTMLElement {
171
+ get rows(): HTMLCollection;
172
+ insertRow(index?: number): Element;
173
+ deleteRow(index: number): void;
174
+ }
175
+ export declare class HTMLTableRowElement extends HTMLElement {
176
+ /** https://html.spec.whatwg.org/#dom-tr-rowindex */
177
+ get rowIndex(): number;
178
+ get sectionRowIndex(): number;
179
+ get cells(): HTMLCollection;
180
+ insertCell(index?: number): Element;
181
+ deleteCell(index: number): void;
182
+ }
183
+ export declare class HTMLTableCellElement extends HTMLElement {
184
+ get cellIndex(): number;
185
+ }
186
+ export declare class HTMLDirectoryElement extends HTMLElement {
187
+ }
188
+ export declare class HTMLFontElement extends HTMLElement {
189
+ }
190
+ export declare class HTMLFrameSetElement extends HTMLElement {
191
+ }
192
+ export declare class HTMLFrameElement extends HTMLElement {
193
+ get contentDocument(): null;
194
+ get contentWindow(): null;
195
+ }
196
+ export declare class HTMLMarqueeElement extends HTMLElement {
197
+ start(): void;
198
+ stop(): void;
199
+ }
200
+ /** https://html.spec.whatwg.org/#htmlunknownelement */
201
+ export declare class HTMLUnknownElement extends HTMLElement {
202
+ }
@@ -0,0 +1,22 @@
1
+ import type { EventTarget } from "../events/EventTarget.js";
2
+ import type { NodeImpl } from "../nodes/NodeImpl.js";
3
+ /** https://dom.spec.whatwg.org/#concept-event-fire — returns false if canceled. */
4
+ export declare function fireEvent(target: EventTarget, type: string, bubbles?: boolean, cancelable?: boolean): boolean;
5
+ /** https://html.spec.whatwg.org/#fire-a-focus-event (composed, `view` = the window). */
6
+ export declare function fireFocusEvent(target: EventTarget, type: string, relatedTarget: EventTarget | null, bubbles: boolean, view: unknown): void;
7
+ /** https://html.spec.whatwg.org/#the-toggleevent-interface — returns false if canceled. */
8
+ export declare function fireToggleEvent(target: EventTarget, type: string, oldState: string, newState: string, cancelable: boolean, source?: EventTarget | null): boolean;
9
+ /**
10
+ * https://html.spec.whatwg.org/#fire-a-synthetic-pointer-event named "click" with the not
11
+ * trusted flag set (HTMLElement.click()). Activation behavior runs inside dispatch (src/events).
12
+ */
13
+ export declare function fireSyntheticClick(target: EventTarget): boolean;
14
+ /**
15
+ * https://html.spec.whatwg.org/#queue-an-element-task — a macrotask on the element's window. Its
16
+ * `_task` uses the window's timers (the test file's virtual clock or fake timers, so the task is
17
+ * ordered with the test's own timers) and close() cancels it. A bare `setTimeout` here is the
18
+ * outer Node realm's real timer under @ctrl/dom-jest-environment (this module is loaded outside the test
19
+ * file's vm global): user-event's post-click wait on the virtual clock then resolved before a
20
+ * <details> `toggle` fired. Documents without a browsing context use the current window.
21
+ */
22
+ export declare function queueElementTask(element: NodeImpl | EventTarget, fn: () => void): void;
@@ -0,0 +1,63 @@
1
+ import type { NodeImpl } from "../nodes/NodeImpl.js";
2
+ import type { Document } from "../nodes/Document.js";
3
+ import type { Element } from "../nodes/Element.js";
4
+ import { $impl } from "../keys.js";
5
+ /** Parsed `tabindex` (https://html.spec.whatwg.org/#attr-tabindex), or NaN when absent/invalid. */
6
+ export declare function tabIndexValue(impl: NodeImpl): number;
7
+ /** https://html.spec.whatwg.org/#summary-for-its-parent-details */
8
+ export declare function isSummaryForParentDetails(impl: NodeImpl): boolean;
9
+ /** Default value of the `tabIndex` IDL attribute (https://html.spec.whatwg.org/#dom-tabindex). */
10
+ export declare function defaultTabIndex(impl: NodeImpl): number;
11
+ /** https://html.spec.whatwg.org/#inert — the element or a flat-tree ancestor has `inert`, or a modal dialog blocks it. */
12
+ export declare function isInert(impl: NodeImpl): boolean;
13
+ /**
14
+ * https://html.spec.whatwg.org/#focusable-area — connected, tabindex focus flag set, not
15
+ * actually disabled, not inert, and rendered (display:none is checked through the css area
16
+ * when it is loaded; without a style engine every connected element counts as rendered, as in jsdom).
17
+ */
18
+ export declare function isFocusable(impl: NodeImpl): boolean;
19
+ /** Focusable and reachable with Tab (https://html.spec.whatwg.org/#sequentially-focusable). */
20
+ export declare function isSequentiallyFocusable(impl: NodeImpl): boolean;
21
+ /**
22
+ * https://html.spec.whatwg.org/#get-the-focusable-area for an element that is not a focusable
23
+ * area. Only shadow hosts that delegate focus have one here (no image maps, scrollable regions
24
+ * or navigables as focus targets).
25
+ */
26
+ export declare function getFocusableArea(target: NodeImpl): NodeImpl | null;
27
+ /** https://html.spec.whatwg.org/#focus-delegate */
28
+ export declare function focusDelegate(focusTarget: NodeImpl): NodeImpl | null;
29
+ export interface FocusElementOptions {
30
+ preventScroll?: boolean;
31
+ /** Override the :focus-visible heuristic (user-event passes false for pointer focus). */
32
+ focusVisible?: boolean;
33
+ }
34
+ /**
35
+ * https://html.spec.whatwg.org/#focusing-steps for an element. Returns true when `impl`
36
+ * (or its focus delegate) is the focused area afterwards.
37
+ */
38
+ export declare function focusElement(impl: NodeImpl, options?: FocusElementOptions): boolean;
39
+ /** https://html.spec.whatwg.org/#unfocusing-steps */
40
+ export declare function blurElement(impl: NodeImpl): void;
41
+ /** Called by user-event before a pointer-caused focus. */
42
+ export declare function notePointerFocus(): void;
43
+ /** https://html.spec.whatwg.org/#dom-documentorshadowroot-activeelement */
44
+ export declare function activeElement(root: NodeImpl): Element | null;
45
+ /** https://html.spec.whatwg.org/#dom-document-hasfocus (no system focus model: true while an element is focused, as jsdom). */
46
+ export declare function documentHasFocus(doc: Document): boolean;
47
+ /** :focus — https://html.spec.whatwg.org/#selector-focus (shadow hosts match when focus is inside their shadow tree). */
48
+ export declare function matchesFocus(impl: NodeImpl): boolean;
49
+ /** :focus-within — https://drafts.csswg.org/selectors-4/#the-focus-within-pseudo */
50
+ export declare function matchesFocusWithin(impl: NodeImpl): boolean;
51
+ /** :focus-visible — https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo (heuristic). */
52
+ export declare function matchesFocusVisible(impl: NodeImpl): boolean;
53
+ /**
54
+ * https://html.spec.whatwg.org/#sequential-focus-navigation-order — the sequentially focusable
55
+ * elements under `root` in Tab order: positive tabindex values ascending (tree order for
56
+ * ties), then tabindex 0 / default-focusable elements in tree order. Each shadow tree forms its
57
+ * own scope at its host's position (https://html.spec.whatwg.org/#focus-navigation-scope-owner).
58
+ */
59
+ export declare function sequentialFocusOrder(root: {
60
+ [$impl]: NodeImpl;
61
+ } | NodeImpl): Element[];
62
+ /** https://html.spec.whatwg.org/#autofocus-delegate (focus trigger "other"). */
63
+ export declare function autofocusDelegate(root: NodeImpl): NodeImpl | null;
@@ -0,0 +1 @@
1
+ export { FileList, createFileList } from "../../window/FileList.js";
@@ -0,0 +1,7 @@
1
+ import type { Element } from "../../nodes/Element.js";
2
+ export interface FormData extends globalThis.FormData {
3
+ }
4
+ export declare class FormData {
5
+ /** https://xhr.spec.whatwg.org/#dom-formdata */
6
+ constructor(form?: Element, submitter?: Element | null);
7
+ }
@@ -0,0 +1,36 @@
1
+ import { HTMLElement } from "../HTMLElement.js";
2
+ import type { Document } from "../../nodes/Document.js";
3
+ import type { Element } from "../../nodes/Element.js";
4
+ import type { Event } from "../../events/Event.js";
5
+ import { LabelsNodeList } from "./collections.js";
6
+ import { type ConstraintValidation, type ValidityState } from "./validation.js";
7
+ import { $customValidity, $labels, $validity } from "../../keys.js";
8
+ export declare class HTMLButtonElement extends HTMLElement {
9
+ [$customValidity]: string;
10
+ [$validity]: ValidityState | null;
11
+ [$labels]: LabelsNodeList | null;
12
+ /** @internal Use Document.createElement. */
13
+ constructor(doc: Document, localName: string, ns: string | null, prefix: string | null);
14
+ /** https://html.spec.whatwg.org/#dom-button-type */
15
+ get type(): string;
16
+ set type(value: string);
17
+ get form(): Element | null;
18
+ get labels(): LabelsNodeList;
19
+ /** https://html.spec.whatwg.org/#dom-fs-formaction */
20
+ get formAction(): string;
21
+ set formAction(v: string);
22
+ disabled: boolean;
23
+ formEnctype: string;
24
+ formMethod: string;
25
+ formNoValidate: boolean;
26
+ formTarget: string;
27
+ name: string;
28
+ value: string;
29
+ _barredFromValidation(): boolean;
30
+ _validityFlags(): number;
31
+ _validationMessage(_flags: number): string;
32
+ get _hasActivationBehavior(): boolean;
33
+ _activationBehavior(_event: Event | null): void;
34
+ }
35
+ export interface HTMLButtonElement extends ConstraintValidation {
36
+ }
@@ -0,0 +1,29 @@
1
+ import { HTMLElement } from "../HTMLElement.js";
2
+ import type { Document } from "../../nodes/Document.js";
3
+ import type { Element } from "../../nodes/Element.js";
4
+ import { HTMLCollection } from "../../collections/HTMLCollection.js";
5
+ import { type ConstraintValidation, type ValidityState } from "./validation.js";
6
+ import { $customValidity, $elements, $validity } from "../../keys.js";
7
+ export declare class HTMLFieldSetElement extends HTMLElement {
8
+ [$customValidity]: string;
9
+ [$validity]: ValidityState | null;
10
+ [$elements]: HTMLCollection | null;
11
+ /** @internal Use Document.createElement. */
12
+ constructor(doc: Document, localName: string, ns: string | null, prefix: string | null);
13
+ get type(): string;
14
+ get form(): Element | null;
15
+ /** https://html.spec.whatwg.org/#dom-fieldset-elements — listed descendants. */
16
+ get elements(): HTMLCollection;
17
+ disabled: boolean;
18
+ name: string;
19
+ _barredFromValidation(): boolean;
20
+ _validityFlags(): number;
21
+ _validationMessage(_flags: number): string;
22
+ }
23
+ export interface HTMLFieldSetElement extends ConstraintValidation {
24
+ }
25
+ export declare class HTMLLegendElement extends HTMLElement {
26
+ /** https://html.spec.whatwg.org/#dom-legend-form */
27
+ get form(): Element | null;
28
+ align: string;
29
+ }
@@ -0,0 +1,61 @@
1
+ import { HTMLElement } from "../HTMLElement.js";
2
+ import type { Document } from "../../nodes/Document.js";
3
+ import type { Element } from "../../nodes/Element.js";
4
+ import type { NodeImpl } from "../../nodes/NodeImpl.js";
5
+ import { type HTMLFormControlsCollection } from "./collections.js";
6
+ import { $assocGen, $constructingEntryList, $controlsCache, $controlsDoc, $controlsVersion, $elements, $firingSubmissionEvents, $lockedForReset, $pastNames } from "../../keys.js";
7
+ export declare class HTMLFormElement extends HTMLElement {
8
+ [$elements]: HTMLFormControlsCollection | null;
9
+ /** Version-stamped cache of the listed controls (excluding image buttons) in tree order. */
10
+ [$controlsCache]: NodeImpl[];
11
+ [$controlsVersion]: number;
12
+ [$controlsDoc]: Document | null;
13
+ /** https://html.spec.whatwg.org/#firing-submission-events */
14
+ [$firingSubmissionEvents]: boolean;
15
+ /** https://html.spec.whatwg.org/#locked-for-reset */
16
+ [$lockedForReset]: boolean;
17
+ /** https://html.spec.whatwg.org/#constructing-entry-list */
18
+ [$constructingEntryList]: boolean;
19
+ /** Bumped when the form is disconnected: parser associations made before end (form-associated.ts). */
20
+ [$assocGen]: number;
21
+ /** https://html.spec.whatwg.org/#past-names-map */
22
+ [$pastNames]: Map<string, NodeImpl> | null;
23
+ /** @internal Use Document.createElement. */
24
+ constructor(doc: Document, localName: string, ns: string | null, prefix: string | null);
25
+ /** "When a form element is removed, reset the form owner" of elements it no longer shares a tree with. */
26
+ _disconnectedSteps(): void;
27
+ /** https://html.spec.whatwg.org/#dom-form-nameditem — element, RadioNodeList, or undefined. */
28
+ _namedProperty(name: string): unknown;
29
+ /** @internal Listed controls whose form owner is this form (image buttons excluded), tree order. */
30
+ _controls(): NodeImpl[];
31
+ /** nodes/derived.ts: release the (stale) control list once a node was removed. */
32
+ _dropSnapshot(): void;
33
+ /** https://html.spec.whatwg.org/#dom-form-elements */
34
+ get elements(): HTMLFormControlsCollection;
35
+ /** https://html.spec.whatwg.org/#dom-form-length */
36
+ get length(): number;
37
+ /** https://html.spec.whatwg.org/#dom-fs-action */
38
+ get action(): string;
39
+ set action(v: string);
40
+ get encoding(): string;
41
+ set encoding(v: string);
42
+ acceptCharset: string;
43
+ autocomplete: string;
44
+ enctype: string;
45
+ method: string;
46
+ name: string;
47
+ noValidate: boolean;
48
+ rel: string;
49
+ relList: object;
50
+ target: string;
51
+ /** https://html.spec.whatwg.org/#dom-form-submit — no events, no validation, no navigation. */
52
+ submit(): void;
53
+ /** https://html.spec.whatwg.org/#dom-form-requestsubmit */
54
+ requestSubmit(submitter?: Element | null): void;
55
+ /** https://html.spec.whatwg.org/#dom-form-reset */
56
+ reset(): void;
57
+ /** https://html.spec.whatwg.org/#dom-form-checkvalidity */
58
+ checkValidity(): boolean;
59
+ /** https://html.spec.whatwg.org/#dom-form-reportvalidity */
60
+ reportValidity(): boolean;
61
+ }