@ctrl/dom 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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-DWP2w3IQ.js +47516 -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 +153 -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 +3910 -0
  267. package/dist/user-event/index.js +3885 -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 +50 -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 +177 -3
@@ -0,0 +1,204 @@
1
+ import { HTMLElement } from "../HTMLElement.js";
2
+ import type { Document } from "../../nodes/Document.js";
3
+ import type { NodeImpl } from "../../nodes/NodeImpl.js";
4
+ import type { Element } from "../../nodes/Element.js";
5
+ import type { Event } from "../../events/Event.js";
6
+ import { LabelsNodeList } from "./collections.js";
7
+ import { FileList } from "../../window/FileList.js";
8
+ import type { EventTarget } from "../../events/EventTarget.js";
9
+ import { $badInput, $checked, $checkedSet, $customValidity, $dirtyChecked, $dirtyValue, $files, $indeterminate, $labels, $preApplied, $preChecked, $preCheckedRadio, $preIndeterminate, $selDir, $selEnd, $selStart, $uiValue, $userEdited, $userValidity, $validity, $value } from "../../keys.js";
10
+ import { type ConstraintValidation, type ValidityState } from "./validation.js";
11
+ /** https://html.spec.whatwg.org/#value-sanitization-algorithm for each type. */
12
+ export declare function sanitizeValue(type: number, value: string, impl: NodeImpl): string;
13
+ /** https://html.spec.whatwg.org/#concept-input-value-string-number — NaN on error. */
14
+ export declare function stringToNumber(type: number, s: string): number;
15
+ /** https://html.spec.whatwg.org/#concept-input-value-number-string */
16
+ export declare function numberToString(type: number, n: number): string;
17
+ declare const DIRECTIONS: readonly ["forward", "backward", "none"];
18
+ type SelectionDirection = (typeof DIRECTIONS)[number];
19
+ export declare class HTMLInputElement extends HTMLElement {
20
+ /** The value while the dirty value flag is set (value mode "value"). */
21
+ [$value]: string;
22
+ /** https://html.spec.whatwg.org/#concept-input-value-dirty-flag */
23
+ [$dirtyValue]: boolean;
24
+ /** Checkedness, authoritative only when `_checkedSet` (otherwise derived from the checked attribute). */
25
+ [$checked]: boolean;
26
+ [$checkedSet]: boolean;
27
+ /** https://html.spec.whatwg.org/#concept-input-checked-dirty-flag */
28
+ [$dirtyChecked]: boolean;
29
+ [$indeterminate]: boolean;
30
+ [$files]: FileList | null;
31
+ [$selStart]: number;
32
+ [$selEnd]: number;
33
+ [$selDir]: SelectionDirection;
34
+ [$customValidity]: string;
35
+ [$validity]: ValidityState | null;
36
+ [$labels]: LabelsNodeList | null;
37
+ /** The value was last changed by a user edit (tooLong/tooShort only apply then). */
38
+ [$userEdited]: boolean;
39
+ /** The user typed something the type cannot represent (e.g. "1e" in a number field). */
40
+ [$badInput]: boolean;
41
+ /** User-event's UI value (raw typed text) — null when it equals the value. See ui.ts. */
42
+ [$uiValue]: string | null;
43
+ [$preChecked]: boolean;
44
+ [$preIndeterminate]: boolean;
45
+ [$preCheckedRadio]: NodeImpl | null;
46
+ /** Legacy-pre-activation ran (and changed state) for the current dispatch. */
47
+ [$preApplied]: boolean;
48
+ /** https://html.spec.whatwg.org/#user-validity (forms/user-validity.ts). */
49
+ [$userValidity]: boolean;
50
+ /** @internal Use Document.createElement. */
51
+ constructor(doc: Document, localName: string, ns: string | null, prefix: string | null);
52
+ /** Sets user validity when a `change` event is dispatched at this control (forms/user-validity.ts). */
53
+ _getTheParent(event: Event): EventTarget | null;
54
+ /** https://html.spec.whatwg.org/#dom-input-type */
55
+ get type(): string;
56
+ set type(value: string);
57
+ /** The element's value (https://html.spec.whatwg.org/#concept-fe-value) for value mode "value". */
58
+ _currentValue(type: number): string;
59
+ /** https://html.spec.whatwg.org/#dom-input-value */
60
+ get value(): string;
61
+ set value(v: string);
62
+ /** Value-mode setter steps (script assignment): https://html.spec.whatwg.org/#dom-input-value-value */
63
+ _setValueFromAPI(type: number, value: string): void;
64
+ /** https://html.spec.whatwg.org/#concept-fe-checked */
65
+ _checkedness(): boolean;
66
+ /** Set checkedness; when it becomes true on a radio, uncheck the rest of its group. */
67
+ _setCheckedness(value: boolean, dirty: boolean): void;
68
+ /** https://html.spec.whatwg.org/#dom-input-checked */
69
+ get checked(): boolean;
70
+ set checked(value: boolean);
71
+ /** https://html.spec.whatwg.org/#dom-input-indeterminate */
72
+ get indeterminate(): boolean;
73
+ set indeterminate(value: boolean);
74
+ /** https://html.spec.whatwg.org/#dom-input-files */
75
+ get files(): FileList | null;
76
+ set files(value: FileList | null);
77
+ /** https://html.spec.whatwg.org/#dom-input-valueasnumber */
78
+ get valueAsNumber(): number;
79
+ set valueAsNumber(v: number);
80
+ /** https://html.spec.whatwg.org/#dom-input-valueasdate */
81
+ get valueAsDate(): Date | null;
82
+ set valueAsDate(v: Date | null);
83
+ /** https://html.spec.whatwg.org/#dom-input-stepup */
84
+ stepUp(n?: number): void;
85
+ /** https://html.spec.whatwg.org/#dom-input-stepdown */
86
+ stepDown(n?: number): void;
87
+ _stepUpOrDown(n: number, up: boolean): void;
88
+ _selectionLength(): number;
89
+ _assertSelectable(member: string): void;
90
+ /** https://html.spec.whatwg.org/#dom-textarea/input-selectionstart */
91
+ get selectionStart(): number | null;
92
+ set selectionStart(value: number | null);
93
+ get selectionEnd(): number | null;
94
+ set selectionEnd(value: number | null);
95
+ get selectionDirection(): string | null;
96
+ set selectionDirection(value: string | null);
97
+ /** https://html.spec.whatwg.org/#dom-textarea/input-setselectionrange */
98
+ setSelectionRange(start: number, end: number, direction?: string): void;
99
+ /** https://html.spec.whatwg.org/#dom-textarea/input-select */
100
+ select(): void;
101
+ /** https://html.spec.whatwg.org/#dom-textarea/input-setrangetext */
102
+ setRangeText(replacement: string, start?: number, end?: number, selectionMode?: string): void;
103
+ accept: string;
104
+ alt: string;
105
+ autocomplete: string;
106
+ dirName: string;
107
+ disabled: boolean;
108
+ formEnctype: string;
109
+ formMethod: string;
110
+ formNoValidate: boolean;
111
+ formTarget: string;
112
+ /**
113
+ * https://html.spec.whatwg.org/#dom-input-height — the rendered height when rendered (never,
114
+ * without layout), else the natural height of an available image (never fetched), else the
115
+ * attribute's value as a non-negative integer, else 0.
116
+ */
117
+ get height(): number;
118
+ set height(v: number);
119
+ /** https://html.spec.whatwg.org/#dom-input-width — see `height`. */
120
+ get width(): number;
121
+ set width(v: number);
122
+ max: string;
123
+ maxLength: number;
124
+ min: string;
125
+ minLength: number;
126
+ multiple: boolean;
127
+ name: string;
128
+ pattern: string;
129
+ placeholder: string;
130
+ readOnly: boolean;
131
+ required: boolean;
132
+ size: number;
133
+ src: string;
134
+ step: string;
135
+ useMap: string;
136
+ align: string;
137
+ defaultChecked: boolean;
138
+ defaultValue: string;
139
+ /** https://html.spec.whatwg.org/#dom-fs-formaction */
140
+ get formAction(): string;
141
+ set formAction(v: string);
142
+ /** https://html.spec.whatwg.org/#dom-input-list */
143
+ get list(): Element | null;
144
+ /** https://html.spec.whatwg.org/#dom-fae-form */
145
+ get form(): Element | null;
146
+ /** https://html.spec.whatwg.org/#dom-lfe-labels */
147
+ get labels(): LabelsNodeList | null;
148
+ /** https://html.spec.whatwg.org/#dom-input-showpicker — no picker UI here. */
149
+ showPicker(): void;
150
+ /** https://html.spec.whatwg.org/#concept-fe-mutable */
151
+ _isMutable(): boolean;
152
+ _barredFromValidation(): boolean;
153
+ _validityFlags(): number;
154
+ _validationMessage(flags: number): string;
155
+ /** https://html.spec.whatwg.org/#the-input-element:concept-form-reset-control */
156
+ _reset(): void;
157
+ /** Hook: attribute change steps (type change, value/checked content attribute, radio group). */
158
+ _attributeChangedSteps(localName: string, oldValue: string | null, value: string | null, namespace: string | null): void;
159
+ /** https://html.spec.whatwg.org/#input-type-change */
160
+ _typeChange(oldType: number, newType: number): void;
161
+ /** Insertion steps (connected case): radio group rule on insertion. */
162
+ _connectedSteps(): void;
163
+ /** https://html.spec.whatwg.org/#the-input-element:concept-node-clone-ext */
164
+ _cloningSteps(copy: Element): void;
165
+ /**
166
+ * "An input element has activation behavior if its type attribute's state defines input
167
+ * activation behavior" (https://html.spec.whatwg.org/#the-input-element:activation-behaviour):
168
+ * checkbox, radio, the buttons, file and color. Others (hidden, text, ...) leave the click to an
169
+ * ancestor such as a <label> (WPT clicking-noninteractive-unlabelable-content.html).
170
+ */
171
+ get _hasActivationBehavior(): boolean;
172
+ /** https://html.spec.whatwg.org/#the-input-element:legacy-pre-activation-behavior */
173
+ _legacyPreActivationBehavior(): void;
174
+ /** https://html.spec.whatwg.org/#the-input-element:legacy-canceled-activation-behavior */
175
+ _legacyCanceledActivationBehavior(): void;
176
+ /** https://html.spec.whatwg.org/#the-input-element:activation-behaviour */
177
+ _activationBehavior(_event: Event | null): void;
178
+ }
179
+ export interface HTMLInputElement extends ConstraintValidation {
180
+ }
181
+ interface SelectionHost {
182
+ [$selStart]: number;
183
+ [$selEnd]: number;
184
+ [$selDir]: SelectionDirection;
185
+ _selectionLength(): number;
186
+ }
187
+ /**
188
+ * https://html.spec.whatwg.org/#set-the-selection-range — when the selection changed, queue a
189
+ * task to fire a bubbling `select` event at the element.
190
+ */
191
+ export declare function setSelection(el: SelectionHost, start: number, end: number, direction: string): void;
192
+ /** The setRangeText() algorithm: https://html.spec.whatwg.org/#dom-textarea/input-setrangetext */
193
+ export declare function rangeText(value: string, selStart: number, selEnd: number, replacement: string, startArg: number | undefined, endArg: number | undefined, modeArg: string | undefined, argc: number): {
194
+ value: string;
195
+ start: number;
196
+ end: number;
197
+ };
198
+ /** https://html.spec.whatwg.org/#radio-button-group */
199
+ export declare function inSameRadioGroup(a: NodeImpl, b: NodeImpl): boolean;
200
+ /** Set checkedness false on every other member of el's radio button group. */
201
+ export declare function uncheckOtherRadios(el: NodeImpl): void;
202
+ /** Whether `el` (a radio) has no checked member in its group — `:indeterminate` for radios. */
203
+ export declare function radioGroupHasNoChecked(el: NodeImpl): boolean;
204
+ export {};
@@ -0,0 +1,15 @@
1
+ import { HTMLElement } from "../HTMLElement.js";
2
+ import type { Element } from "../../nodes/Element.js";
3
+ import type { NodeImpl } from "../../nodes/NodeImpl.js";
4
+ import type { Event } from "../../events/Event.js";
5
+ /** https://html.spec.whatwg.org/#interactive-content */
6
+ export declare function isInteractiveContent(el: NodeImpl): boolean;
7
+ export declare class HTMLLabelElement extends HTMLElement {
8
+ htmlFor: string;
9
+ /** https://html.spec.whatwg.org/#dom-label-control */
10
+ get control(): Element | null;
11
+ /** https://html.spec.whatwg.org/#dom-label-form */
12
+ get form(): Element | null;
13
+ get _hasActivationBehavior(): boolean;
14
+ _activationBehavior(event: Event | null): void;
15
+ }
@@ -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 { $dirtiness, $selSet, $selectedness } from "../../keys.js";
6
+ /**
7
+ * The select element an option belongs to, its "nearest ancestor select":
8
+ * https://html.spec.whatwg.org/#option-element-nearest-ancestor-select
9
+ */
10
+ export declare function optionSelect(option: NodeImpl): NodeImpl | null;
11
+ export declare class HTMLOptionElement extends HTMLElement {
12
+ /** https://html.spec.whatwg.org/#concept-option-selectedness (authoritative when `_selSet`). */
13
+ [$selectedness]: boolean;
14
+ [$selSet]: boolean;
15
+ /** https://html.spec.whatwg.org/#concept-option-dirtiness */
16
+ [$dirtiness]: boolean;
17
+ /** @internal Use Document.createElement or `new Option()`. */
18
+ constructor(doc: Document, localName: string, ns: string | null, prefix: string | null);
19
+ _selectednessNow(): boolean;
20
+ /** Set selectedness without dirtiness or a reset (used by the select's algorithms). */
21
+ _setSelectedness(value: boolean): void;
22
+ /** https://html.spec.whatwg.org/#dom-option-selected */
23
+ get selected(): boolean;
24
+ set selected(value: boolean);
25
+ defaultSelected: boolean;
26
+ disabled: boolean;
27
+ /** https://html.spec.whatwg.org/#dom-option-text — descendant text, stripped and collapsed, excluding script descendants. */
28
+ get text(): string;
29
+ set text(value: string);
30
+ /** https://html.spec.whatwg.org/#dom-option-value */
31
+ get value(): string;
32
+ set value(value: string);
33
+ /** https://html.spec.whatwg.org/#dom-option-label */
34
+ get label(): string;
35
+ set label(value: string);
36
+ /** https://html.spec.whatwg.org/#dom-option-index */
37
+ get index(): number;
38
+ /** https://html.spec.whatwg.org/#dom-option-form */
39
+ get form(): Element | null;
40
+ /** https://html.spec.whatwg.org/#the-option-element:concept-element-attributes-change-ext */
41
+ _attributeChangedSteps(localName: string, oldValue: string | null, value: string | null, namespace: string | null): void;
42
+ /** https://html.spec.whatwg.org/#the-option-element:concept-node-clone-ext */
43
+ _cloningSteps(copy: Element): void;
44
+ }
45
+ /**
46
+ * The legacy factory function `Option(text, value, defaultSelected, selected)`:
47
+ * https://html.spec.whatwg.org/#dom-option
48
+ * Exposed as the `Option` global by the window.
49
+ */
50
+ export declare const Option: new (text?: string, value?: string, defaultSelected?: boolean, selected?: boolean) => HTMLOptionElement;
51
+ /** https://html.spec.whatwg.org/#the-optgroup-element */
52
+ export declare class HTMLOptGroupElement extends HTMLElement {
53
+ /** @internal Use Document.createElement. */
54
+ constructor(doc: Document, localName: string, ns: string | null, prefix: string | null);
55
+ /** An optgroup's disabled state is its options' disabled state: re-run the select's algorithm. */
56
+ _attributeChangedSteps(localName: string, oldValue: string | null, value: string | null, namespace: string | null): void;
57
+ disabled: boolean;
58
+ label: string;
59
+ /** Options added to / removed from an optgroup change the select's list of options. */
60
+ _childrenChangedSteps(): void;
61
+ }
@@ -0,0 +1,74 @@
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 { LabelsNodeList } from "./collections.js";
6
+ import { type ConstraintValidation, type ValidityState } from "./validation.js";
7
+ import { $customValidity, $defaultValueOverride, $labels, $options, $validity } from "../../keys.js";
8
+ export declare class HTMLOutputElement extends HTMLElement {
9
+ /** https://html.spec.whatwg.org/#concept-output-default-value-override (null = none). */
10
+ [$defaultValueOverride]: string | null;
11
+ [$customValidity]: string;
12
+ [$validity]: ValidityState | null;
13
+ [$labels]: LabelsNodeList | null;
14
+ /** @internal Use Document.createElement. */
15
+ constructor(doc: Document, localName: string, ns: string | null, prefix: string | null);
16
+ get type(): string;
17
+ htmlFor: object;
18
+ name: string;
19
+ get form(): Element | null;
20
+ get labels(): LabelsNodeList;
21
+ /** https://html.spec.whatwg.org/#dom-output-defaultvalue */
22
+ get defaultValue(): string;
23
+ set defaultValue(value: string);
24
+ /** https://html.spec.whatwg.org/#dom-output-value */
25
+ get value(): string;
26
+ set value(value: string);
27
+ /** https://html.spec.whatwg.org/#the-output-element:concept-form-reset-control */
28
+ _reset(): void;
29
+ _barredFromValidation(): boolean;
30
+ _validityFlags(): number;
31
+ _validationMessage(_flags: number): string;
32
+ }
33
+ export interface HTMLOutputElement extends ConstraintValidation {
34
+ }
35
+ export declare class HTMLProgressElement extends HTMLElement {
36
+ [$labels]: LabelsNodeList | null;
37
+ /** @internal Use Document.createElement. */
38
+ constructor(doc: Document, localName: string, ns: string | null, prefix: string | null);
39
+ /** https://html.spec.whatwg.org/#dom-progress-max */
40
+ get max(): number;
41
+ set max(value: number);
42
+ /** https://html.spec.whatwg.org/#dom-progress-value */
43
+ get value(): number;
44
+ set value(value: number);
45
+ /** https://html.spec.whatwg.org/#dom-progress-position — -1 when indeterminate. */
46
+ get position(): number;
47
+ get labels(): LabelsNodeList;
48
+ }
49
+ /** https://html.spec.whatwg.org/#the-meter-element — the clamped values of the meter algorithm. */
50
+ export declare class HTMLMeterElement extends HTMLElement {
51
+ [$labels]: LabelsNodeList | null;
52
+ /** @internal Use Document.createElement. */
53
+ constructor(doc: Document, localName: string, ns: string | null, prefix: string | null);
54
+ get min(): number;
55
+ set min(v: number);
56
+ get max(): number;
57
+ set max(v: number);
58
+ get value(): number;
59
+ set value(v: number);
60
+ get low(): number;
61
+ set low(v: number);
62
+ get high(): number;
63
+ set high(v: number);
64
+ get optimum(): number;
65
+ set optimum(v: number);
66
+ get labels(): LabelsNodeList;
67
+ }
68
+ export declare class HTMLDataListElement extends HTMLElement {
69
+ [$options]: HTMLCollection | null;
70
+ /** @internal Use Document.createElement. */
71
+ constructor(doc: Document, localName: string, ns: string | null, prefix: string | null);
72
+ /** https://html.spec.whatwg.org/#dom-datalist-options */
73
+ get options(): HTMLCollection;
74
+ }
@@ -0,0 +1,96 @@
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 { HTMLCollection } from "../../collections/HTMLCollection.js";
6
+ import { HTMLOptionsCollection, LabelsNodeList } from "./collections.js";
7
+ import { type ConstraintValidation, type ValidityState } from "./validation.js";
8
+ import { $customValidity, $labels, $options, $selectedOptions, $settled, $updatingSelectedContent, $userValidity, $validity } from "../../keys.js";
9
+ import type { Event } from "../../events/Event.js";
10
+ import type { EventTarget } from "../../events/EventTarget.js";
11
+ export declare class HTMLSelectElement extends HTMLElement {
12
+ [$customValidity]: string;
13
+ [$validity]: ValidityState | null;
14
+ [$labels]: LabelsNodeList | null;
15
+ [$options]: HTMLOptionsCollection | null;
16
+ [$selectedOptions]: HTMLCollection | null;
17
+ /**
18
+ * The selectedness setting algorithm has run at least once. Trees built by the parser or by
19
+ * cloning attach options without hooks; the first read (or insertion) settles them.
20
+ */
21
+ [$settled]: boolean;
22
+ /** Re-entrancy guard for `_updateSelectedContent` (it mutates the select's subtree). */
23
+ [$updatingSelectedContent]: boolean;
24
+ /** https://html.spec.whatwg.org/#user-validity (forms/user-validity.ts). */
25
+ [$userValidity]: boolean;
26
+ /** @internal Use Document.createElement. */
27
+ constructor(doc: Document, localName: string, ns: string | null, prefix: string | null);
28
+ /** Sets user validity when a `change` event is dispatched at this control (forms/user-validity.ts). */
29
+ _getTheParent(event: Event): EventTarget | null;
30
+ _ensureSettled(): void;
31
+ _cloningSteps(copy: Element): void;
32
+ _connectedSteps(): void;
33
+ /** https://html.spec.whatwg.org/#dom-select-type */
34
+ get type(): string;
35
+ /** https://html.spec.whatwg.org/#concept-select-size */
36
+ _displaySize(): number;
37
+ _isSingle(): boolean;
38
+ /** https://html.spec.whatwg.org/#dom-select-options */
39
+ get options(): HTMLOptionsCollection;
40
+ get length(): number;
41
+ set length(value: number);
42
+ /** https://html.spec.whatwg.org/#dom-select-item */
43
+ item(index: number): Element | null;
44
+ /** https://html.spec.whatwg.org/#dom-select-nameditem */
45
+ namedItem(name: string): Element | null;
46
+ /** https://html.spec.whatwg.org/#dom-select-add */
47
+ add(element: Element, before?: Element | number | null): void;
48
+ /** https://html.spec.whatwg.org/#dom-select-remove — remove() removes the select; remove(index) an option. */
49
+ remove(index?: number): void;
50
+ /** https://html.spec.whatwg.org/#dom-select-selectedoptions */
51
+ get selectedOptions(): HTMLCollection;
52
+ /** https://html.spec.whatwg.org/#dom-select-selectedindex */
53
+ get selectedIndex(): number;
54
+ set selectedIndex(value: number);
55
+ /** https://html.spec.whatwg.org/#dom-select-value */
56
+ get value(): string;
57
+ set value(v: string);
58
+ get form(): Element | null;
59
+ get labels(): LabelsNodeList;
60
+ autocomplete: string;
61
+ disabled: boolean;
62
+ multiple: boolean;
63
+ name: string;
64
+ required: boolean;
65
+ size: number;
66
+ /** https://html.spec.whatwg.org/#dom-select-showpicker — no picker UI. */
67
+ showPicker(): void;
68
+ /**
69
+ * "If the multiple attribute is absent, whenever an option element in the select element's
70
+ * list of options has its selectedness set to true, the user agent must set the selectedness
71
+ * of all the other option elements in its list of options to false."
72
+ */
73
+ _deselectOthers(selected: NodeImpl): void;
74
+ /** https://html.spec.whatwg.org/#selectedness-setting-algorithm */
75
+ _selectednessSettingAlgorithm(): void;
76
+ _runSelectedness(): void;
77
+ /** https://html.spec.whatwg.org/#get-a-select's-enabled-selectedcontent */
78
+ _enabledSelectedContent(): NodeImpl | null;
79
+ /**
80
+ * https://html.spec.whatwg.org/#update-a-select's-selectedcontent — mirror the first selected
81
+ * option's children into the select's selectedcontent element.
82
+ */
83
+ _updateSelectedContent(): void;
84
+ /** https://html.spec.whatwg.org/#the-select-element:concept-form-reset-control */
85
+ _reset(): void;
86
+ /** The list of options changed: https://html.spec.whatwg.org/#the-select-element:selectedness-setting-algorithm */
87
+ _childrenChangedSteps(): void;
88
+ _attributeChangedSteps(localName: string, oldValue: string | null, value: string | null, namespace: string | null): void;
89
+ _barredFromValidation(): boolean;
90
+ /** https://html.spec.whatwg.org/#placeholder-label-option */
91
+ _placeholderLabelOption(): NodeImpl | null;
92
+ _validityFlags(): number;
93
+ _validationMessage(flags: number): string;
94
+ }
95
+ export interface HTMLSelectElement extends ConstraintValidation {
96
+ }
@@ -0,0 +1,82 @@
1
+ import { HTMLElement } from "../HTMLElement.js";
2
+ import type { Document } from "../../nodes/Document.js";
3
+ import type { Element } from "../../nodes/Element.js";
4
+ import { LabelsNodeList } from "./collections.js";
5
+ import { type ConstraintValidation, type ValidityState } from "./validation.js";
6
+ import { $customValidity, $dirtyValue, $labels, $rawValue, $selDir, $selEnd, $selStart, $userEdited, $userValidity, $validity } from "../../keys.js";
7
+ import type { Event } from "../../events/Event.js";
8
+ import type { EventTarget } from "../../events/EventTarget.js";
9
+ export declare class HTMLTextAreaElement extends HTMLElement {
10
+ /** Raw value while the dirty value flag is set. */
11
+ [$rawValue]: string;
12
+ /** https://html.spec.whatwg.org/#concept-textarea-dirty */
13
+ [$dirtyValue]: boolean;
14
+ [$selStart]: number;
15
+ [$selEnd]: number;
16
+ [$selDir]: "forward" | "backward" | "none";
17
+ [$customValidity]: string;
18
+ [$validity]: ValidityState | null;
19
+ [$labels]: LabelsNodeList | null;
20
+ /** The value was last changed by a user edit (tooLong/tooShort only apply then). */
21
+ [$userEdited]: boolean;
22
+ /** https://html.spec.whatwg.org/#user-validity (forms/user-validity.ts). */
23
+ [$userValidity]: boolean;
24
+ /** @internal Use Document.createElement. */
25
+ constructor(doc: Document, localName: string, ns: string | null, prefix: string | null);
26
+ /** Sets user validity when a `change` event is dispatched at this control (forms/user-validity.ts). */
27
+ _getTheParent(event: Event): EventTarget | null;
28
+ get type(): string;
29
+ /** https://html.spec.whatwg.org/#dom-textarea-defaultvalue — the child text content. */
30
+ get defaultValue(): string;
31
+ set defaultValue(value: string);
32
+ /** https://html.spec.whatwg.org/#concept-textarea-raw-value */
33
+ _rawValueNow(): string;
34
+ /** https://html.spec.whatwg.org/#concept-fe-api-value */
35
+ _apiValue(): string;
36
+ /** https://html.spec.whatwg.org/#dom-textarea-value */
37
+ get value(): string;
38
+ set value(v: string);
39
+ /** https://html.spec.whatwg.org/#dom-textarea-textlength */
40
+ get textLength(): number;
41
+ get form(): Element | null;
42
+ get labels(): LabelsNodeList;
43
+ autocomplete: string;
44
+ cols: number;
45
+ dirName: string;
46
+ disabled: boolean;
47
+ maxLength: number;
48
+ minLength: number;
49
+ name: string;
50
+ placeholder: string;
51
+ readOnly: boolean;
52
+ required: boolean;
53
+ rows: number;
54
+ wrap: string;
55
+ _selectionLength(): number;
56
+ get selectionStart(): number;
57
+ set selectionStart(value: number);
58
+ get selectionEnd(): number;
59
+ set selectionEnd(value: number);
60
+ get selectionDirection(): string;
61
+ set selectionDirection(value: string);
62
+ setSelectionRange(start: number, end: number, direction?: string): void;
63
+ select(): void;
64
+ setRangeText(replacement: string, start?: number, end?: number, selectionMode?: string): void;
65
+ _isMutable(): boolean;
66
+ _barredFromValidation(): boolean;
67
+ _validityFlags(): number;
68
+ _validationMessage(flags: number): string;
69
+ /** https://html.spec.whatwg.org/#the-textarea-element:concept-form-reset-control */
70
+ _reset(): void;
71
+ /**
72
+ * Children changed: while the dirty value flag is unset the raw value is the child text
73
+ * content, so a shorter value clamps the selection for good (a later longer value does not
74
+ * bring the old offsets back). https://html.spec.whatwg.org/#concept-textarea-raw-value,
75
+ * https://html.spec.whatwg.org/#textFieldSelection ("the selection ... must be adjusted").
76
+ */
77
+ _childrenChangedSteps(): void;
78
+ /** https://html.spec.whatwg.org/#the-textarea-element:concept-node-clone-ext */
79
+ _cloningSteps(copy: Element): void;
80
+ }
81
+ export interface HTMLTextAreaElement extends ConstraintValidation {
82
+ }
@@ -0,0 +1,10 @@
1
+ import type { NodeImpl } from "../../nodes/NodeImpl.js";
2
+ /**
3
+ * https://html.spec.whatwg.org/#autofill-processing-model — the IDL-exposed autofill value
4
+ * ("" whenever the algorithm jumps to the step labeled "default").
5
+ */
6
+ export declare function idlExposedAutofillValue(el: NodeImpl): string;
7
+ /** Install the `autocomplete` accessor (getter: IDL-exposed autofill value; setter: reflects). */
8
+ export declare function installAutocomplete(C: {
9
+ prototype: object;
10
+ }): void;
@@ -0,0 +1,112 @@
1
+ import type { NodeImpl } from "../../nodes/NodeImpl.js";
2
+ import type { Element } from "../../nodes/Element.js";
3
+ import type { Node } from "../../nodes/Node.js";
4
+ import { HTMLCollection } from "../../collections/HTMLCollection.js";
5
+ import { NodeList } from "../../collections/NodeList.js";
6
+ import { $cache, $el, $form, $name, $version } from "../../keys.js";
7
+ /** Version-stamped members of a computed NodeList (dropped on node removal, nodes/derived.ts). */
8
+ declare class SnapshotCache {
9
+ items: Node[];
10
+ version: number;
11
+ doc: object | null;
12
+ _dropSnapshot(): void;
13
+ }
14
+ /**
15
+ * Base for the live NodeLists computed from the tree (labels, RadioNodeList): a version-stamped
16
+ * snapshot plus Proxy-free prototype index getters (collections/indexed.ts).
17
+ */
18
+ declare abstract class ComputedNodeList extends NodeList {
19
+ [$cache]: SnapshotCache;
20
+ constructor();
21
+ abstract _compute(): Node[];
22
+ abstract _ownerDocument(): {
23
+ [$version]: number;
24
+ };
25
+ /** The node whose tree the members come from (derived.ts holdSnapshot). */
26
+ abstract _root(): NodeImpl;
27
+ _snapshot(): Node[];
28
+ get length(): number;
29
+ item(index: number): Node | null;
30
+ }
31
+ /** Live NodeList of the label elements associated with a labelable element. */
32
+ export declare class LabelsNodeList extends ComputedNodeList {
33
+ [$el]: NodeImpl;
34
+ /** @internal */
35
+ constructor(el: NodeImpl);
36
+ _ownerDocument(): {
37
+ [$version]: number;
38
+ };
39
+ _root(): NodeImpl;
40
+ _compute(): Node[];
41
+ }
42
+ /**
43
+ * The live NodeList returned by `document.getElementsByName(name)`
44
+ * (https://html.spec.whatwg.org/#dom-document-getelementsbyname): every HTML element in the
45
+ * document, in tree order, whose `name` attribute value is `name`.
46
+ */
47
+ export declare class NameNodeList extends ComputedNodeList {
48
+ [$el]: NodeImpl;
49
+ [$name]: string;
50
+ /** @internal */
51
+ constructor(doc: NodeImpl, name: string);
52
+ _ownerDocument(): {
53
+ [$version]: number;
54
+ };
55
+ _root(): NodeImpl;
56
+ _compute(): Node[];
57
+ }
58
+ /** https://html.spec.whatwg.org/#radionodelist — live list of a form's controls with a given name/id. */
59
+ export declare class RadioNodeList extends ComputedNodeList {
60
+ [$form]: NodeImpl;
61
+ [$name]: string;
62
+ /** @internal */
63
+ constructor(form: NodeImpl, name: string);
64
+ _ownerDocument(): {
65
+ [$version]: number;
66
+ };
67
+ _root(): NodeImpl;
68
+ _compute(): Node[];
69
+ /** https://html.spec.whatwg.org/#dom-radionodelist-value */
70
+ get value(): string;
71
+ set value(value: string);
72
+ }
73
+ /** https://html.spec.whatwg.org/#htmlformcontrolscollection */
74
+ export declare class HTMLFormControlsCollection extends HTMLCollection {
75
+ /** @internal Use `createFormControlsCollection(form)` (adds named property access). */
76
+ constructor(form: NodeImpl);
77
+ _collect(out: Element[]): void;
78
+ /** https://html.spec.whatwg.org/#dom-htmlformcontrolscollection-nameditem */
79
+ namedItem(name: string): Element | null;
80
+ }
81
+ /** form.elements: the collection with WebIDL named properties (`form.elements.username`). */
82
+ export declare function createFormControlsCollection(form: NodeImpl): HTMLFormControlsCollection;
83
+ /**
84
+ * The list of options of a select ("get the list of options"):
85
+ * https://html.spec.whatwg.org/#concept-select-option-list — option descendants in tree order,
86
+ * not looking inside select, hr, option and datalist elements or an optgroup nested in another
87
+ * optgroup (within the select). The common shapes (options and optgroups as children) stay a
88
+ * walk over children.
89
+ */
90
+ export declare function listOfOptions(select: NodeImpl, out: NodeImpl[]): NodeImpl[];
91
+ /** https://html.spec.whatwg.org/#htmloptionscollection */
92
+ export declare class HTMLOptionsCollection extends HTMLCollection {
93
+ /** @internal */
94
+ constructor(select: NodeImpl);
95
+ _collect(out: Element[]): void;
96
+ /** https://html.spec.whatwg.org/#dom-htmloptionscollection-setter */
97
+ _setIndex(index: number, value: Element | null): void;
98
+ get length(): number;
99
+ /** https://html.spec.whatwg.org/#dom-htmloptionscollection-length */
100
+ set length(value: number);
101
+ /** https://html.spec.whatwg.org/#dom-htmloptionscollection-add */
102
+ add(element: Element, before?: Element | number | null): void;
103
+ /** https://html.spec.whatwg.org/#dom-htmloptionscollection-remove */
104
+ remove(index: number): void;
105
+ /** https://html.spec.whatwg.org/#dom-htmloptionscollection-selectedindex */
106
+ get selectedIndex(): number;
107
+ set selectedIndex(value: number);
108
+ }
109
+ /** @internal Register a prototype whose instances forward indices to an options collection. */
110
+ export declare function addOptionIndexHost(proto: object, coll: (self: object) => HTMLOptionsCollection): void;
111
+ export declare function ensureOptionIndexAccessors(n: number): void;
112
+ export {};