@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,8 @@
1
+ export interface IndexGetterTable {
2
+ proto: object;
3
+ count: number;
4
+ item: (self: object, index: number) => unknown;
5
+ }
6
+ export declare function indexGetterTable(proto: object, item: (self: object, index: number) => unknown, initial?: number): IndexGetterTable;
7
+ /** Make sure accessor properties exist for indices [0, n). Amortized: doubles the bound. */
8
+ export declare function ensureIndexGetters(table: IndexGetterTable, n: number): void;
@@ -0,0 +1,8 @@
1
+ /** https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next, kind "value", over a collection. */
2
+ export declare class CollectionIterator extends Iterator<unknown, undefined> {
3
+ #private;
4
+ constructor(list: ArrayLike<unknown>, snapshot: boolean);
5
+ next(): IteratorResult<unknown, undefined>;
6
+ }
7
+ /** Array.prototype.values's ToObject step: collections only ever pass themselves, but `.call(x)` works on any array-like. */
8
+ export declare function iterableTarget(self: unknown): ArrayLike<unknown>;
@@ -0,0 +1,21 @@
1
+ /** https://drafts.csswg.org/cssom/#serialize-an-identifier */
2
+ export declare function escape(ident: string): string;
3
+ /** https://drafts.csswg.org/css-conditional-3/#dom-css-supports */
4
+ export declare function supports(conditionOrProperty: string, value?: string): boolean;
5
+ /** https://drafts.css-houdini.org/css-properties-values-api/#dom-css-registerproperty — records the name only. */
6
+ export declare function registerProperty(definition: {
7
+ name: string;
8
+ syntax?: string;
9
+ inherits?: boolean;
10
+ initialValue?: string;
11
+ }): void;
12
+ /**
13
+ * The `CSS` namespace object (https://webidl.spec.whatwg.org/#es-namespaces): an ordinary,
14
+ * extensible object whose operations are writable/enumerable/configurable data properties, so
15
+ * tests can stub them (`CSS.supports = vi.fn()`).
16
+ */
17
+ export declare const CSS: {
18
+ escape: typeof escape;
19
+ supports: typeof supports;
20
+ registerProperty: typeof registerProperty;
21
+ };
@@ -0,0 +1,57 @@
1
+ import type { Element } from "../nodes/Element.js";
2
+ import { DeclBlock } from "./declarations.js";
3
+ import { $block, $indexed, $owner, $parentRule, $readonly, $updating } from "../keys.js";
4
+ /** Parent rule interface needed here (avoids importing cssom.ts). */
5
+ export interface DeclarationOwnerRule {
6
+ /** Called after the declarations changed (bumps the style version). */
7
+ _declarationsChanged(): void;
8
+ }
9
+ export declare class CSSStyleDeclaration {
10
+ /** Inline style owner element, or null. */
11
+ [$owner]: Element | null;
12
+ /** Rule owning these declarations (CSSStyleRule, CSSFontFaceRule, ...), or null. */
13
+ [$parentRule]: DeclarationOwnerRule | null;
14
+ [$block]: DeclBlock;
15
+ /** Computed declarations are read-only. */
16
+ [$readonly]: boolean;
17
+ /** Set while this declaration writes its owner's style attribute. */
18
+ [$updating]: boolean;
19
+ /** Number of own indexed properties currently defined. */
20
+ [$indexed]: number;
21
+ constructor(owner?: Element | null, block?: DeclBlock | null, parentRule?: DeclarationOwnerRule | null);
22
+ /** @internal Core hook: the owner's style attribute changed (https://drafts.csswg.org/cssom/#ref-for-concept-element-attributes-change-ext). */
23
+ _attributeChanged(value: string | null): void;
24
+ /** https://drafts.csswg.org/cssom/#update-style-attribute-for */
25
+ _changed(): void;
26
+ _syncIndices(): void;
27
+ _checkWritable(): void;
28
+ /** https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-csstext */
29
+ get cssText(): string;
30
+ set cssText(text: string);
31
+ /** https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-length */
32
+ get length(): number;
33
+ /** https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-item */
34
+ item(index: number): string;
35
+ /** https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-getpropertyvalue */
36
+ getPropertyValue(property: string): string;
37
+ /** https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-getpropertypriority */
38
+ getPropertyPriority(property: string): string;
39
+ /** https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty */
40
+ setProperty(property: string, value: string | null, priority?: string): void;
41
+ /** https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-removeproperty */
42
+ removeProperty(property: string): string;
43
+ /** https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-parentrule */
44
+ get parentRule(): DeclarationOwnerRule | null;
45
+ /** https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-cssfloat */
46
+ get cssFloat(): string;
47
+ set cssFloat(value: string);
48
+ /** Setter steps of the camel-cased / dashed attributes (https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-camel-cased-attribute). */
49
+ _setNamed(property: string, value: unknown): void;
50
+ [Symbol.iterator](): IterableIterator<string>;
51
+ get [Symbol.toStringTag](): string;
52
+ }
53
+ /** Named property accessors (installed at runtime from the property list) and indexed access. */
54
+ export interface CSSStyleDeclaration {
55
+ [property: string]: any;
56
+ [index: number]: string;
57
+ }
@@ -0,0 +1,159 @@
1
+ import type { Document } from "../nodes/Document.js";
2
+ import type { NodeImpl } from "../nodes/NodeImpl.js";
3
+ import { type CompiledSelector, type StateDeps } from "../selectors/internal.js";
4
+ import { DeclBlock } from "./declarations.js";
5
+ import { type RootStyles } from "./stylesheets.js";
6
+ export declare class IndexedRule {
7
+ sel: CompiledSelector;
8
+ specificity: number;
9
+ /** Position in cascade order (tree order of rules across sheets). */
10
+ order: number;
11
+ /** Layer rank: higher wins for normal declarations; unlayered rules have the highest rank. */
12
+ layer: number;
13
+ block: DeclBlock;
14
+ layerNode: LayerNode;
15
+ /** Copied from `sel` so the cascade's loop reads them without a pointer hop (as Blink's RuleData). */
16
+ h0: number;
17
+ h1: number;
18
+ h2: number;
19
+ h3: number;
20
+ constructor(sel: CompiledSelector, order: number, block: DeclBlock, layerNode: LayerNode);
21
+ }
22
+ /** Rules bucketed by subject key. */
23
+ export declare class RuleBuckets {
24
+ ids: Map<string, IndexedRule[]>;
25
+ classes: Map<string, IndexedRule[]>;
26
+ tags: Map<string, IndexedRule[]>;
27
+ universal: IndexedRule[];
28
+ size: number;
29
+ /**
30
+ * Quirks-mode document: id and class keys are ASCII-lowercased on both sides
31
+ * (https://html.spec.whatwg.org/#case-sensitivity-of-selectors).
32
+ */
33
+ quirks: boolean;
34
+ constructor(quirks: boolean);
35
+ add(r: IndexedRule): void;
36
+ }
37
+ declare class LayerNode {
38
+ name: string;
39
+ children: Map<string, LayerNode>;
40
+ rank: number;
41
+ constructor(name: string);
42
+ }
43
+ export declare class RuleIndex {
44
+ main: RuleBuckets;
45
+ before: RuleBuckets;
46
+ after: RuleBuckets;
47
+ /** Any rule depends on state outside Document._version (:hover, :focus, :checked, ...). */
48
+ volatile: boolean;
49
+ styleVersion: number;
50
+ constructor(styleVersion: number, quirks?: boolean);
51
+ }
52
+ /**
53
+ * Validates the document's style state (adopted-sheet mutations, viewport changes for media
54
+ * rules) and returns the current `_styleVersion`.
55
+ */
56
+ export declare function currentStyleVersion(doc: Document): number;
57
+ /** Rule index for a tree (null if it has no applicable sheets). */
58
+ export declare function ruleIndexFor(rs: RootStyles, doc: Document, styleVersion: number): RuleIndex | null;
59
+ /**
60
+ * UA `display` (https://html.spec.whatwg.org/#rendering), including the hidden-elements rules
61
+ * (https://html.spec.whatwg.org/#hidden-elements). `[hidden]` and `dialog:not([open])` are
62
+ * normal-importance UA rules (author styles override them); `input[type=hidden]` is
63
+ * `!important` (see uaDisplayImportant).
64
+ */
65
+ export declare function uaDisplay(el: NodeImpl): string;
66
+ export declare const PSEUDO_NONE = 0;
67
+ export declare const PSEUDO_BEFORE = 1;
68
+ export declare const PSEUDO_AFTER = 2;
69
+ /** Cascade result + memoized computed values for one element (or pseudo-element). */
70
+ export declare class StyleRecord {
71
+ el: NodeImpl;
72
+ pseudo: number;
73
+ /** Winning cascaded value per property (author + inline + UA), null if none. */
74
+ decls: Map<string, string> | null;
75
+ /** UA cascaded values (for `revert`). */
76
+ ua: Map<string, string> | null;
77
+ /** Whether a UA !important display:none applies. */
78
+ displayLocked: boolean;
79
+ /** Memoized computed values. */
80
+ computed: Map<string, string> | null;
81
+ /** Computed custom properties (inherited), resolved lazily. */
82
+ custom: Map<string, string> | null;
83
+ customDone: boolean;
84
+ /** Computed display/visibility/pointer-events (hot for aria), "" = not computed yet. */
85
+ display: string;
86
+ visibility: string;
87
+ pointerEvents: string;
88
+ /** Depends on state that neither the version stamps nor `deps` cover: never reuse from cache. */
89
+ volatile: boolean;
90
+ /**
91
+ * Volatile selector tests (:hover, :focus, :checked, ...) evaluated while matching this
92
+ * element's rules, with their results (selectors/compile.ts StateDeps), or null. While they
93
+ * still hold, the matched declarations are reused; computed values are recomputed.
94
+ */
95
+ deps: StateDeps | null;
96
+ /**
97
+ * A computed value was derived from another record (parent, originating element, root) that is
98
+ * volatile, has `deps`, or itself has this flag: such values may change without a version
99
+ * bump, so they are not kept across reuses. Set by `dependOn` when that record is read.
100
+ */
101
+ inheritsVolatile: boolean;
102
+ before: StyleRecord | null;
103
+ after: StyleRecord | null;
104
+ /** Tree root styles this element belongs to (null when disconnected). */
105
+ root: RootStyles | null;
106
+ constructor(el: NodeImpl, pseudo: number);
107
+ }
108
+ /** Parent element for inheritance: the parent element, or the host for shadow-root children. */
109
+ export declare function inheritanceParent(el: NodeImpl): NodeImpl | null;
110
+ /** The (cached) style record of an element. */
111
+ export declare function styleRecord(el: NodeImpl): StyleRecord;
112
+ export declare function recordFor(el: NodeImpl, pseudo: number): StyleRecord;
113
+ /**
114
+ * https://drafts.csswg.org/css-variables-2/#substitute-a-var — replaces var()/env() references.
115
+ * Returns null when a reference is invalid (value becomes invalid at computed-value time).
116
+ */
117
+ export declare function substitute(value: string, lookup: (name: string) => string | null): string | null;
118
+ /**
119
+ * "specified" (default): computed colors keep the author's specified serialization.
120
+ * "rgb": spec behavior, colors resolve to rgb()/rgba(). Bumps nothing: call before reading styles.
121
+ */
122
+ export declare function setComputedColorMode(mode: "specified" | "rgb"): void;
123
+ /** The computed value of `prop` for a record (memoized). */
124
+ export declare function computedValueOf(rec: StyleRecord, prop: string): string;
125
+ /**
126
+ * True when any style sheet with rules applies anywhere in the document, or any element has an
127
+ * inline style. O(1) for documents without inline styles (per-document counter maintained by
128
+ * nodes/attributes.ts); otherwise answered by a walk cached per (`_version`, `_styleVersion`).
129
+ * Not exact after adoptNode() of styled elements into another document (counted in the old one).
130
+ */
131
+ export declare function hasAuthorStyles(doc: Document): boolean;
132
+ /** Computed `position` (no record allocation for elements without author styles: the UA sheet sets none). */
133
+ export declare function computedPosition(el: NodeImpl): string;
134
+ /** Computed `display` of the element (own value, not ancestors). */
135
+ export declare function computedDisplay(el: NodeImpl): string;
136
+ /** https://drafts.csswg.org/css-display-3/#valdef-display-none — own computed display is none. */
137
+ export declare function isDisplayNone(el: NodeImpl): boolean;
138
+ /** The element or an ancestor (flat-tree-ish: through shadow hosts) is display:none. */
139
+ export declare function isDisplayNoneInclusive(el: NodeImpl): boolean;
140
+ /** Computed `visibility` (inherited): "visible" | "hidden" | "collapse". */
141
+ export declare function computedVisibility(el: NodeImpl): string;
142
+ export declare function isVisibilityHidden(el: NodeImpl): boolean;
143
+ /** Computed `pointer-events` (inherited). */
144
+ export declare function pointerEvents(el: NodeImpl): string;
145
+ export declare function pointerEventsNone(el: NodeImpl): boolean;
146
+ /** Computed value of `property` for an element (or its ::before/::after). "" for unknown pseudo-elements. */
147
+ export declare function computedValue(el: NodeImpl, property: string, pseudo?: string | null): string;
148
+ /** Names of the computed custom properties of an element (for computed-style enumeration). */
149
+ export declare function customPropertyNames(el: NodeImpl, pseudo: string | null): string[];
150
+ /**
151
+ * Text generated by `content` on ::before / ::after (strings and attr() concatenated), or ""
152
+ * when the pseudo-element has no content. https://drafts.csswg.org/css-content-3/#content-property
153
+ */
154
+ export declare function pseudoContent(el: NodeImpl, pseudo: "::before" | "::after"): string;
155
+ /** Extracts the text of a computed `content` value. */
156
+ export declare function contentText(el: NodeImpl, v: string): string;
157
+ /** Number of elements with a cached style record is not tracked; exposed for tests of the fast path. */
158
+ export declare function _hasStyleRecord(el: NodeImpl): boolean;
159
+ export {};
@@ -0,0 +1,28 @@
1
+ export declare function isNamedColor(lowerName: string): boolean;
2
+ /** Resolved sRGB color: channels 0-255 (unrounded), alpha 0-1. */
3
+ export declare class RGBA {
4
+ r: number;
5
+ g: number;
6
+ b: number;
7
+ a: number;
8
+ constructor(r: number, g: number, b: number, a: number);
9
+ }
10
+ export declare function serializeRGBA(c: RGBA): string;
11
+ /** https://drafts.csswg.org/css-color-4/#hex-notation — `hex` without "#". */
12
+ export declare function parseHex(hex: string): RGBA | null;
13
+ /**
14
+ * Parses a legacy-sRGB color function given its lowercase name and inner text. Returns null
15
+ * if invalid.
16
+ */
17
+ export declare function parseColorFunction(name: string, inner: string): RGBA | null;
18
+ /**
19
+ * Normalizes a specified color value (single component text). Returns the serialization
20
+ * (browsers' specified-value form), or null if `text` is not a color.
21
+ */
22
+ export declare function normalizeColor(text: string): string | null;
23
+ /**
24
+ * Computed color value (https://drafts.csswg.org/css-color-4/#resolving-color-values):
25
+ * named/system/transparent colors resolve to rgb()/rgba(); `currentcolor` resolves to
26
+ * `currentColor` (the element's computed `color`).
27
+ */
28
+ export declare function computeColor(specified: string, currentColor: string): string;
@@ -0,0 +1,22 @@
1
+ import type { Element } from "../nodes/Element.js";
2
+ import type { NodeImpl } from "../nodes/NodeImpl.js";
3
+ import { CSSStyleDeclaration } from "./CSSStyleDeclaration.js";
4
+ import { $el, $pseudo } from "../keys.js";
5
+ /**
6
+ * Computed declarations enumerate every longhand (sorted, like browsers) and resolve values
7
+ * lazily through the cascade's per-element cache, so reads stay live across mutations.
8
+ */
9
+ export declare class CSSComputedStyleDeclaration extends CSSStyleDeclaration {
10
+ [$el]: NodeImpl;
11
+ [$pseudo]: string | null;
12
+ constructor(el: NodeImpl, pseudo: string | null);
13
+ get length(): number;
14
+ item(index: number): string;
15
+ getPropertyValue(property: string): string;
16
+ getPropertyPriority(_property: string): string;
17
+ get cssText(): string;
18
+ set cssText(_text: string);
19
+ _syncIndices(): void;
20
+ }
21
+ /** https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle — the declaration object is reused per element (it is live). */
22
+ export declare function getComputedStyle(element: Element, pseudoElement?: string | null): CSSStyleDeclaration;
@@ -0,0 +1,363 @@
1
+ import type { Document } from "../nodes/Document.js";
2
+ import type { Element } from "../nodes/Element.js";
3
+ import { type RawRule } from "./parser.js";
4
+ import { DeclBlock } from "./declarations.js";
5
+ import { CSSStyleDeclaration, type DeclarationOwnerRule } from "./CSSStyleDeclaration.js";
6
+ import { type MediaQuery } from "./media.js";
7
+ import { type CompiledSelectorList } from "../selectors/internal.js";
8
+ import { $block, $compiled, $compiledFor, $condition, $constructed, $defaultNamespace, $disabled, $disallowModification, $doc, $href, $indexed, $keyText, $layerName, $list, $matches, $media, $name, $names, $namespaces, $owner, $ownerNode, $ownerRule, $parent, $prefix, $prelude, $queries, $rules, $selector, $sheet, $sheets, $style, $supportsText, $title, $uri, $version } from "../keys.js";
9
+ /** https://drafts.csswg.org/cssom/#the-cssrulelist-interface — live view over a rule array. */
10
+ export declare class CSSRuleList {
11
+ [$rules]: CSSRule[];
12
+ [$indexed]: number;
13
+ constructor(rules: CSSRule[]);
14
+ /** @internal Swap the backing array (replaceSync). */
15
+ _setRules(rules: CSSRule[]): void;
16
+ /** @internal Re-sync own indexed properties after the backing array changed. */
17
+ _sync(): void;
18
+ get length(): number;
19
+ item(index: number): CSSRule | null;
20
+ [Symbol.iterator](): IterableIterator<CSSRule>;
21
+ get [Symbol.toStringTag](): string;
22
+ }
23
+ /** https://drafts.csswg.org/cssom/#the-medialist-interface */
24
+ export declare class MediaList {
25
+ [$queries]: MediaQuery[];
26
+ [$owner]: {
27
+ _changed(): void;
28
+ } | null;
29
+ [$indexed]: number;
30
+ constructor(text: string, owner: {
31
+ _changed(): void;
32
+ } | null);
33
+ _sync(): void;
34
+ get mediaText(): string;
35
+ set mediaText(text: string);
36
+ get length(): number;
37
+ item(index: number): string | null;
38
+ /** https://drafts.csswg.org/cssom/#dom-medialist-appendmedium */
39
+ appendMedium(medium: string): void;
40
+ /** https://drafts.csswg.org/cssom/#dom-medialist-deletemedium */
41
+ deleteMedium(medium: string): void;
42
+ toString(): string;
43
+ [Symbol.iterator](): IterableIterator<string>;
44
+ get [Symbol.toStringTag](): string;
45
+ }
46
+ /** https://drafts.csswg.org/cssom/#the-stylesheetlist-interface — kept in sync by stylesheets.ts. */
47
+ export declare class StyleSheetList {
48
+ [$sheets]: CSSStyleSheet[];
49
+ [$indexed]: number;
50
+ constructor();
51
+ /** @internal */
52
+ _set(sheets: CSSStyleSheet[]): void;
53
+ get length(): number;
54
+ item(index: number): CSSStyleSheet | null;
55
+ [Symbol.iterator](): IterableIterator<CSSStyleSheet>;
56
+ get [Symbol.toStringTag](): string;
57
+ }
58
+ /** https://drafts.csswg.org/cssom/#the-stylesheet-interface */
59
+ export declare class StyleSheet {
60
+ [$ownerNode]: Element | null;
61
+ [$media]: MediaList;
62
+ [$disabled]: boolean;
63
+ [$title]: string | null;
64
+ [$href]: string | null;
65
+ constructor(ownerNode: Element | null, media: string, title: string | null, href: string | null);
66
+ _changed(): void;
67
+ get type(): string;
68
+ get href(): string | null;
69
+ get ownerNode(): Element | null;
70
+ get parentStyleSheet(): CSSStyleSheet | null;
71
+ /**
72
+ * https://drafts.csswg.org/cssom/#dom-stylesheet-title — the owner's non-empty title
73
+ * attribute (an empty title is null). Read live: changing `title` on a <style>/<link>
74
+ * re-creates the sheet with the new title in browsers.
75
+ */
76
+ get title(): string | null;
77
+ get media(): MediaList;
78
+ set media(text: string);
79
+ get disabled(): boolean;
80
+ set disabled(value: boolean);
81
+ }
82
+ export interface CSSStyleSheetInit {
83
+ baseURL?: string;
84
+ media?: string | MediaList;
85
+ disabled?: boolean;
86
+ }
87
+ /** https://drafts.csswg.org/cssom/#the-cssstylesheet-interface */
88
+ export declare class CSSStyleSheet extends StyleSheet {
89
+ [$rules]: CSSRule[];
90
+ [$list]: CSSRuleList | null;
91
+ /** Document whose style version this sheet bumps (owner node's document, or the constructor document). */
92
+ [$doc]: Document | null;
93
+ /** https://drafts.csswg.org/cssom/#concept-css-style-sheet-constructed-flag */
94
+ [$constructed]: boolean;
95
+ /** https://drafts.csswg.org/cssom/#concept-css-style-sheet-disallow-modification-flag */
96
+ [$disallowModification]: boolean;
97
+ [$ownerRule]: CSSImportRule | null;
98
+ /** @namespace declarations (prefix → URI), for selector compilation. */
99
+ [$namespaces]: Map<string, string | null> | null;
100
+ [$defaultNamespace]: string | null | undefined;
101
+ /** Bumped on every change (rule index cache key). */
102
+ [$version]: number;
103
+ constructor(options?: CSSStyleSheetInit);
104
+ /** @internal Create a non-constructed sheet for a <style>/<link> owner. */
105
+ static _forOwner(owner: Element, text: string, media: string, href: string | null): CSSStyleSheet;
106
+ _changed(): void;
107
+ /** Replaces all rules from stylesheet text (no @import fetching). */
108
+ _setText(text: string): void;
109
+ _registerNamespace(rule: CSSNamespaceRule): void;
110
+ get parentStyleSheet(): CSSStyleSheet | null;
111
+ get ownerRule(): CSSImportRule | null;
112
+ /** https://drafts.csswg.org/cssom/#dom-cssstylesheet-cssrules */
113
+ get cssRules(): CSSRuleList;
114
+ get rules(): CSSRuleList;
115
+ /** https://drafts.csswg.org/cssom/#dom-cssstylesheet-insertrule */
116
+ insertRule(rule: string, index?: number): number;
117
+ /** https://drafts.csswg.org/cssom/#dom-cssstylesheet-deleterule */
118
+ deleteRule(index: number): void;
119
+ /** https://drafts.csswg.org/cssom/#dom-cssstylesheet-addrule (legacy) */
120
+ addRule(selector?: string, style?: string, index?: number): number;
121
+ /** https://drafts.csswg.org/cssom/#dom-cssstylesheet-removerule (legacy) */
122
+ removeRule(index?: number): void;
123
+ /** https://drafts.csswg.org/cssom/#dom-cssstylesheet-replace */
124
+ replace(text: string): Promise<CSSStyleSheet>;
125
+ /** https://drafts.csswg.org/cssom/#dom-cssstylesheet-replacesync */
126
+ replaceSync(text: string): void;
127
+ get [Symbol.toStringTag](): string;
128
+ }
129
+ /** https://drafts.csswg.org/cssom/#the-cssrule-interface */
130
+ export declare class CSSRule {
131
+ /** Owning sheet for top-level rules (nested rules find it through their parent). */
132
+ [$sheet]: CSSStyleSheet | null;
133
+ [$parent]: CSSRule | null;
134
+ static readonly STYLE_RULE = 1;
135
+ static readonly CHARSET_RULE = 2;
136
+ static readonly IMPORT_RULE = 3;
137
+ static readonly MEDIA_RULE = 4;
138
+ static readonly FONT_FACE_RULE = 5;
139
+ static readonly PAGE_RULE = 6;
140
+ static readonly KEYFRAMES_RULE = 7;
141
+ static readonly KEYFRAME_RULE = 8;
142
+ static readonly MARGIN_RULE = 9;
143
+ static readonly NAMESPACE_RULE = 10;
144
+ static readonly COUNTER_STYLE_RULE = 11;
145
+ static readonly SUPPORTS_RULE = 12;
146
+ static readonly DOCUMENT_RULE = 13;
147
+ static readonly FONT_FEATURE_VALUES_RULE = 14;
148
+ static readonly VIEWPORT_RULE = 15;
149
+ static readonly REGION_STYLE_RULE = 16;
150
+ constructor();
151
+ get type(): number;
152
+ get cssText(): string;
153
+ /** https://drafts.csswg.org/cssom/#dom-cssrule-csstext — setting does nothing. */
154
+ set cssText(_value: string);
155
+ get parentRule(): CSSRule | null;
156
+ get parentStyleSheet(): CSSStyleSheet | null;
157
+ /** Bumps the owning sheet (and document) style version. */
158
+ _changed(): void;
159
+ _declarationsChanged(): void;
160
+ }
161
+ /** https://drafts.csswg.org/cssom/#the-cssgroupingrule-interface */
162
+ export declare class CSSGroupingRule extends CSSRule {
163
+ [$rules]: CSSRule[];
164
+ [$list]: CSSRuleList | null;
165
+ constructor();
166
+ get cssRules(): CSSRuleList;
167
+ /** Whether rules inside are nested in a style rule (relative selectors, nested declarations). */
168
+ _nestedContext(): boolean;
169
+ /** https://drafts.csswg.org/cssom/#dom-cssgroupingrule-insertrule */
170
+ insertRule(rule: string, index?: number): number;
171
+ /** https://drafts.csswg.org/cssom/#dom-cssgroupingrule-deleterule */
172
+ deleteRule(index: number): void;
173
+ }
174
+ /** https://drafts.csswg.org/cssom/#the-cssstylerule-interface (+ CSS Nesting: nested cssRules) */
175
+ export declare class CSSStyleRule extends CSSGroupingRule implements DeclarationOwnerRule {
176
+ [$selector]: string;
177
+ [$block]: DeclBlock;
178
+ [$style]: CSSStyleDeclaration | null;
179
+ /** Compiled (nesting-resolved) selector list, cached until selectorText or an ancestor selector changes. */
180
+ [$compiled]: CompiledSelectorList | null;
181
+ [$compiledFor]: string;
182
+ constructor(selector: string, block: DeclBlock);
183
+ get type(): number;
184
+ /** https://drafts.csswg.org/cssom/#dom-cssstylerule-selectortext */
185
+ get selectorText(): string;
186
+ set selectorText(value: string);
187
+ _nestedContextForSelf(): boolean;
188
+ get style(): CSSStyleDeclaration;
189
+ set style(text: string);
190
+ get cssText(): string;
191
+ /**
192
+ * Nesting-resolved selector texts (https://drafts.csswg.org/css-nesting-1/#nest-selector).
193
+ * Top-level rules resolve to their own selector list.
194
+ */
195
+ _resolvedSelectors(): string[];
196
+ /** Compiled selector list for matching (null if the engine rejects it). */
197
+ _compile(): CompiledSelectorList | null;
198
+ get [Symbol.toStringTag](): string;
199
+ }
200
+ /** https://drafts.csswg.org/css-nesting-1/#cssnesteddeclarations — declarations after/inside nested group rules. */
201
+ export declare class CSSNestedDeclarations extends CSSRule implements DeclarationOwnerRule {
202
+ [$block]: DeclBlock;
203
+ [$style]: CSSStyleDeclaration | null;
204
+ constructor(block: DeclBlock);
205
+ get type(): number;
206
+ get style(): CSSStyleDeclaration;
207
+ get cssText(): string;
208
+ }
209
+ /** https://drafts.csswg.org/css-conditional-3/#the-cssconditionrule-interface */
210
+ export declare class CSSConditionRule extends CSSGroupingRule {
211
+ get conditionText(): string;
212
+ }
213
+ /** https://drafts.csswg.org/css-conditional-3/#the-cssmediarule-interface */
214
+ export declare class CSSMediaRule extends CSSConditionRule {
215
+ [$media]: MediaList;
216
+ constructor(media: string);
217
+ get type(): number;
218
+ get media(): MediaList;
219
+ set media(text: string);
220
+ get conditionText(): string;
221
+ get cssText(): string;
222
+ }
223
+ /** https://drafts.csswg.org/css-conditional-3/#the-csssupportsrule-interface */
224
+ export declare class CSSSupportsRule extends CSSConditionRule {
225
+ [$condition]: string;
226
+ [$matches]: boolean;
227
+ constructor(condition: string);
228
+ get type(): number;
229
+ get conditionText(): string;
230
+ get cssText(): string;
231
+ }
232
+ /** https://drafts.csswg.org/css-contain-3/#the-csscontainerrule-interface — stored, never matches (no layout). */
233
+ export declare class CSSContainerRule extends CSSConditionRule {
234
+ [$condition]: string;
235
+ constructor(condition: string);
236
+ get conditionText(): string;
237
+ get containerName(): string;
238
+ get containerQuery(): string;
239
+ get cssText(): string;
240
+ }
241
+ /** https://drafts.csswg.org/css-cascade-5/#the-csslayerblockrule-interface */
242
+ export declare class CSSLayerBlockRule extends CSSGroupingRule {
243
+ [$name]: string;
244
+ constructor(name: string);
245
+ get name(): string;
246
+ get cssText(): string;
247
+ }
248
+ /** https://drafts.csswg.org/css-cascade-5/#the-csslayerstatementrule-interface */
249
+ export declare class CSSLayerStatementRule extends CSSRule {
250
+ [$names]: string[];
251
+ constructor(names: string[]);
252
+ get nameList(): readonly string[];
253
+ get cssText(): string;
254
+ }
255
+ /** https://drafts.csswg.org/css-cascade-6/#the-cssscoperule-interface — stored, applied unscoped is wrong, so not applied. */
256
+ export declare class CSSScopeRule extends CSSGroupingRule {
257
+ [$prelude]: string;
258
+ constructor(prelude: string);
259
+ /** https://drafts.csswg.org/css-cascade-6/#dom-cssscoperule-start — prelude `[(<scope-start>)]? [to (<scope-end>)]?` */
260
+ get start(): string | null;
261
+ /** https://drafts.csswg.org/css-cascade-6/#dom-cssscoperule-end */
262
+ get end(): string | null;
263
+ get cssText(): string;
264
+ }
265
+ /** https://drafts.csswg.org/css-transitions-2/#the-cssstartingstylerule-interface — stored, not applied. */
266
+ export declare class CSSStartingStyleRule extends CSSGroupingRule {
267
+ get cssText(): string;
268
+ }
269
+ /** https://drafts.csswg.org/cssom/#the-cssimportrule-interface — never fetched (styleSheet is null). */
270
+ export declare class CSSImportRule extends CSSRule {
271
+ [$href]: string;
272
+ [$media]: MediaList;
273
+ [$layerName]: string | null;
274
+ [$supportsText]: string | null;
275
+ constructor(href: string, media: string, layerName: string | null, supportsText: string | null);
276
+ get type(): number;
277
+ get href(): string;
278
+ get media(): MediaList;
279
+ get styleSheet(): CSSStyleSheet | null;
280
+ get layerName(): string | null;
281
+ get supportsText(): string | null;
282
+ get cssText(): string;
283
+ }
284
+ /** https://drafts.csswg.org/cssom/#the-cssnamespacerule-interface */
285
+ export declare class CSSNamespaceRule extends CSSRule {
286
+ [$prefix]: string;
287
+ [$uri]: string;
288
+ constructor(prefix: string, uri: string);
289
+ get type(): number;
290
+ get namespaceURI(): string;
291
+ get prefix(): string;
292
+ get cssText(): string;
293
+ }
294
+ /** Rules holding a declaration block of descriptors. */
295
+ declare class DescriptorRule extends CSSRule implements DeclarationOwnerRule {
296
+ [$block]: DeclBlock;
297
+ [$style]: CSSStyleDeclaration | null;
298
+ constructor(block: DeclBlock);
299
+ get style(): CSSStyleDeclaration;
300
+ }
301
+ /** https://drafts.csswg.org/css-fonts-4/#cssfontfacerule */
302
+ export declare class CSSFontFaceRule extends DescriptorRule {
303
+ get type(): number;
304
+ get cssText(): string;
305
+ }
306
+ /** https://drafts.csswg.org/cssom/#the-csspagerule-interface */
307
+ export declare class CSSPageRule extends DescriptorRule {
308
+ [$selector]: string;
309
+ constructor(selector: string, block: DeclBlock);
310
+ get type(): number;
311
+ get selectorText(): string;
312
+ set selectorText(v: string);
313
+ get cssText(): string;
314
+ }
315
+ /** https://drafts.css-houdini.org/css-properties-values-api/#the-css-property-rule-interface */
316
+ export declare class CSSPropertyRule extends CSSRule {
317
+ [$name]: string;
318
+ [$block]: DeclBlock;
319
+ constructor(name: string, block: DeclBlock);
320
+ get name(): string;
321
+ get syntax(): string;
322
+ get inherits(): boolean;
323
+ get initialValue(): string | null;
324
+ get cssText(): string;
325
+ }
326
+ /** https://drafts.csswg.org/css-animations-1/#interface-csskeyframerule */
327
+ export declare class CSSKeyframeRule extends DescriptorRule {
328
+ [$keyText]: string;
329
+ constructor(keyText: string, block: DeclBlock);
330
+ get type(): number;
331
+ get keyText(): string;
332
+ set keyText(value: string);
333
+ get cssText(): string;
334
+ }
335
+ /** https://drafts.csswg.org/css-animations-1/#interface-csskeyframesrule */
336
+ export declare class CSSKeyframesRule extends CSSRule {
337
+ [$name]: string;
338
+ [$rules]: CSSKeyframeRule[];
339
+ [$list]: CSSRuleList | null;
340
+ constructor(name: string);
341
+ get type(): number;
342
+ get name(): string;
343
+ set name(v: string);
344
+ get cssRules(): CSSRuleList;
345
+ get length(): number;
346
+ appendRule(rule: string): void;
347
+ deleteRule(select: string): void;
348
+ findRule(select: string): CSSKeyframeRule | null;
349
+ _findIndex(select: string): number;
350
+ get cssText(): string;
351
+ }
352
+ /** https://drafts.csswg.org/cssom/#parse-a-css-rule + CSSOM rule construction. */
353
+ export declare function createRule(raw: RawRule, parent: CSSRule | null, sheet: CSSStyleSheet | null, nested: boolean, inKeyframes: boolean): CSSRule | null;
354
+ export interface CSSRuleList {
355
+ readonly [index: number]: CSSRule;
356
+ }
357
+ export interface MediaList {
358
+ readonly [index: number]: string;
359
+ }
360
+ export interface StyleSheetList {
361
+ readonly [index: number]: CSSStyleSheet;
362
+ }
363
+ export {};