open-agreements 0.7.6 → 0.7.7

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 (250) hide show
  1. package/README.md +1 -1
  2. package/content/templates/openagreements-due-diligence-request-list/template.docx +0 -0
  3. package/content/templates/openagreements-due-diligence-request-list/template.md +1 -1
  4. package/dist/core/fill-pipeline.d.ts.map +1 -1
  5. package/dist/core/fill-pipeline.js +0 -8
  6. package/dist/core/fill-pipeline.js.map +1 -1
  7. package/dist/core/unified-pipeline.d.ts.map +1 -1
  8. package/dist/core/unified-pipeline.js +4 -6
  9. package/dist/core/unified-pipeline.js.map +1 -1
  10. package/gemini-extension.json +1 -1
  11. package/node_modules/@xmldom/xmldom/CHANGELOG.md +939 -0
  12. package/node_modules/@xmldom/xmldom/LICENSE +8 -0
  13. package/node_modules/@xmldom/xmldom/SECURITY.md +50 -0
  14. package/node_modules/@xmldom/xmldom/index.d.ts +1664 -0
  15. package/node_modules/@xmldom/xmldom/lib/.eslintrc.yml +3 -0
  16. package/node_modules/@xmldom/xmldom/lib/conventions.js +429 -0
  17. package/node_modules/@xmldom/xmldom/lib/dom-parser.js +586 -0
  18. package/node_modules/@xmldom/xmldom/lib/dom.js +3192 -0
  19. package/node_modules/@xmldom/xmldom/lib/entities.js +2171 -0
  20. package/node_modules/@xmldom/xmldom/lib/errors.js +202 -0
  21. package/node_modules/@xmldom/xmldom/lib/grammar.js +533 -0
  22. package/node_modules/@xmldom/xmldom/lib/index.js +41 -0
  23. package/node_modules/@xmldom/xmldom/lib/sax.js +929 -0
  24. package/node_modules/@xmldom/xmldom/package.json +74 -0
  25. package/node_modules/@xmldom/xmldom/readme.md +364 -0
  26. package/node_modules/core-util-is/LICENSE +19 -0
  27. package/node_modules/core-util-is/README.md +3 -0
  28. package/node_modules/core-util-is/lib/util.js +107 -0
  29. package/node_modules/core-util-is/package.json +38 -0
  30. package/node_modules/immediate/LICENSE.txt +20 -0
  31. package/node_modules/immediate/README.md +93 -0
  32. package/node_modules/immediate/dist/immediate.js +75 -0
  33. package/node_modules/immediate/dist/immediate.min.js +1 -0
  34. package/node_modules/immediate/lib/browser.js +69 -0
  35. package/node_modules/immediate/lib/index.js +73 -0
  36. package/node_modules/immediate/package.json +42 -0
  37. package/node_modules/inherits/LICENSE +16 -0
  38. package/node_modules/inherits/README.md +42 -0
  39. package/node_modules/inherits/inherits.js +9 -0
  40. package/node_modules/inherits/inherits_browser.js +27 -0
  41. package/node_modules/inherits/package.json +29 -0
  42. package/node_modules/isarray/.npmignore +1 -0
  43. package/node_modules/isarray/.travis.yml +4 -0
  44. package/node_modules/isarray/Makefile +6 -0
  45. package/node_modules/isarray/README.md +60 -0
  46. package/node_modules/isarray/component.json +19 -0
  47. package/node_modules/isarray/index.js +5 -0
  48. package/node_modules/isarray/package.json +45 -0
  49. package/node_modules/isarray/test.js +20 -0
  50. package/node_modules/jszip/.codeclimate.yml +16 -0
  51. package/node_modules/jszip/.editorconfig +8 -0
  52. package/node_modules/jszip/.eslintrc.js +43 -0
  53. package/node_modules/jszip/.github/workflows/pr.yaml +58 -0
  54. package/node_modules/jszip/.jekyll-metadata +0 -0
  55. package/node_modules/jszip/.travis.yml +17 -0
  56. package/node_modules/jszip/CHANGES.md +204 -0
  57. package/node_modules/jszip/LICENSE.markdown +651 -0
  58. package/node_modules/jszip/README.markdown +33 -0
  59. package/node_modules/jszip/deps.js +37 -0
  60. package/node_modules/jszip/dist/jszip.js +11577 -0
  61. package/node_modules/jszip/dist/jszip.min.js +13 -0
  62. package/node_modules/jszip/graph.svg +601 -0
  63. package/node_modules/jszip/index.d.ts +330 -0
  64. package/node_modules/jszip/lib/base64.js +106 -0
  65. package/node_modules/jszip/lib/compressedObject.js +74 -0
  66. package/node_modules/jszip/lib/compressions.js +14 -0
  67. package/node_modules/jszip/lib/crc32.js +77 -0
  68. package/node_modules/jszip/lib/defaults.js +11 -0
  69. package/node_modules/jszip/lib/external.js +18 -0
  70. package/node_modules/jszip/lib/flate.js +85 -0
  71. package/node_modules/jszip/lib/generate/ZipFileWorker.js +539 -0
  72. package/node_modules/jszip/lib/generate/index.js +57 -0
  73. package/node_modules/jszip/lib/index.js +55 -0
  74. package/node_modules/jszip/lib/license_header.js +11 -0
  75. package/node_modules/jszip/lib/load.js +88 -0
  76. package/node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js +74 -0
  77. package/node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js +42 -0
  78. package/node_modules/jszip/lib/nodejsUtils.js +57 -0
  79. package/node_modules/jszip/lib/object.js +384 -0
  80. package/node_modules/jszip/lib/readable-stream-browser.js +10 -0
  81. package/node_modules/jszip/lib/reader/ArrayReader.js +57 -0
  82. package/node_modules/jszip/lib/reader/DataReader.js +116 -0
  83. package/node_modules/jszip/lib/reader/NodeBufferReader.js +19 -0
  84. package/node_modules/jszip/lib/reader/StringReader.js +38 -0
  85. package/node_modules/jszip/lib/reader/Uint8ArrayReader.js +22 -0
  86. package/node_modules/jszip/lib/reader/readerFor.js +28 -0
  87. package/node_modules/jszip/lib/signature.js +7 -0
  88. package/node_modules/jszip/lib/stream/ConvertWorker.js +26 -0
  89. package/node_modules/jszip/lib/stream/Crc32Probe.js +24 -0
  90. package/node_modules/jszip/lib/stream/DataLengthProbe.js +29 -0
  91. package/node_modules/jszip/lib/stream/DataWorker.js +116 -0
  92. package/node_modules/jszip/lib/stream/GenericWorker.js +263 -0
  93. package/node_modules/jszip/lib/stream/StreamHelper.js +214 -0
  94. package/node_modules/jszip/lib/support.js +38 -0
  95. package/node_modules/jszip/lib/utf8.js +275 -0
  96. package/node_modules/jszip/lib/utils.js +501 -0
  97. package/node_modules/jszip/lib/zipEntries.js +261 -0
  98. package/node_modules/jszip/lib/zipEntry.js +293 -0
  99. package/node_modules/jszip/lib/zipObject.js +133 -0
  100. package/node_modules/jszip/package.json +67 -0
  101. package/node_modules/jszip/sponsors.md +21 -0
  102. package/node_modules/jszip/tsconfig.json +101 -0
  103. package/node_modules/jszip/vendor/FileSaver.js +247 -0
  104. package/node_modules/lie/README.md +62 -0
  105. package/node_modules/lie/dist/lie.js +350 -0
  106. package/node_modules/lie/dist/lie.min.js +1 -0
  107. package/node_modules/lie/dist/lie.polyfill.js +358 -0
  108. package/node_modules/lie/dist/lie.polyfill.min.js +1 -0
  109. package/node_modules/lie/lib/browser.js +273 -0
  110. package/node_modules/lie/lib/index.js +298 -0
  111. package/node_modules/lie/license.md +7 -0
  112. package/node_modules/lie/lie.d.ts +244 -0
  113. package/node_modules/lie/package.json +69 -0
  114. package/node_modules/lie/polyfill.js +4 -0
  115. package/node_modules/pako/LICENSE +21 -0
  116. package/node_modules/pako/README.md +191 -0
  117. package/node_modules/pako/dist/pako.js +6818 -0
  118. package/node_modules/pako/dist/pako.min.js +1 -0
  119. package/node_modules/pako/dist/pako_deflate.js +3997 -0
  120. package/node_modules/pako/dist/pako_deflate.min.js +1 -0
  121. package/node_modules/pako/dist/pako_inflate.js +3300 -0
  122. package/node_modules/pako/dist/pako_inflate.min.js +1 -0
  123. package/node_modules/pako/index.js +14 -0
  124. package/node_modules/pako/lib/deflate.js +400 -0
  125. package/node_modules/pako/lib/inflate.js +423 -0
  126. package/node_modules/pako/lib/utils/common.js +105 -0
  127. package/node_modules/pako/lib/utils/strings.js +187 -0
  128. package/node_modules/pako/lib/zlib/README +59 -0
  129. package/node_modules/pako/lib/zlib/adler32.js +51 -0
  130. package/node_modules/pako/lib/zlib/constants.js +68 -0
  131. package/node_modules/pako/lib/zlib/crc32.js +59 -0
  132. package/node_modules/pako/lib/zlib/deflate.js +1874 -0
  133. package/node_modules/pako/lib/zlib/gzheader.js +58 -0
  134. package/node_modules/pako/lib/zlib/inffast.js +345 -0
  135. package/node_modules/pako/lib/zlib/inflate.js +1556 -0
  136. package/node_modules/pako/lib/zlib/inftrees.js +343 -0
  137. package/node_modules/pako/lib/zlib/messages.js +32 -0
  138. package/node_modules/pako/lib/zlib/trees.js +1222 -0
  139. package/node_modules/pako/lib/zlib/zstream.js +47 -0
  140. package/node_modules/pako/package.json +44 -0
  141. package/node_modules/process-nextick-args/index.js +45 -0
  142. package/node_modules/process-nextick-args/license.md +19 -0
  143. package/node_modules/process-nextick-args/package.json +25 -0
  144. package/node_modules/process-nextick-args/readme.md +18 -0
  145. package/node_modules/readable-stream/.travis.yml +34 -0
  146. package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
  147. package/node_modules/readable-stream/GOVERNANCE.md +136 -0
  148. package/node_modules/readable-stream/LICENSE +47 -0
  149. package/node_modules/readable-stream/README.md +58 -0
  150. package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
  151. package/node_modules/readable-stream/duplex-browser.js +1 -0
  152. package/node_modules/readable-stream/duplex.js +1 -0
  153. package/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
  154. package/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
  155. package/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
  156. package/node_modules/readable-stream/lib/_stream_transform.js +214 -0
  157. package/node_modules/readable-stream/lib/_stream_writable.js +685 -0
  158. package/node_modules/readable-stream/lib/internal/streams/BufferList.js +78 -0
  159. package/node_modules/readable-stream/lib/internal/streams/destroy.js +84 -0
  160. package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
  161. package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
  162. package/node_modules/readable-stream/package.json +52 -0
  163. package/node_modules/readable-stream/passthrough.js +1 -0
  164. package/node_modules/readable-stream/readable-browser.js +7 -0
  165. package/node_modules/readable-stream/readable.js +19 -0
  166. package/node_modules/readable-stream/transform.js +1 -0
  167. package/node_modules/readable-stream/writable-browser.js +1 -0
  168. package/node_modules/readable-stream/writable.js +8 -0
  169. package/node_modules/safe-buffer/LICENSE +21 -0
  170. package/node_modules/safe-buffer/README.md +584 -0
  171. package/node_modules/safe-buffer/index.d.ts +187 -0
  172. package/node_modules/safe-buffer/index.js +62 -0
  173. package/node_modules/safe-buffer/package.json +37 -0
  174. package/node_modules/setimmediate/LICENSE.txt +20 -0
  175. package/node_modules/setimmediate/package.json +30 -0
  176. package/node_modules/setimmediate/setImmediate.js +186 -0
  177. package/node_modules/string_decoder/.travis.yml +50 -0
  178. package/node_modules/string_decoder/LICENSE +48 -0
  179. package/node_modules/string_decoder/README.md +47 -0
  180. package/node_modules/string_decoder/lib/string_decoder.js +296 -0
  181. package/node_modules/string_decoder/package.json +31 -0
  182. package/node_modules/util-deprecate/History.md +16 -0
  183. package/node_modules/util-deprecate/LICENSE +24 -0
  184. package/node_modules/util-deprecate/README.md +53 -0
  185. package/node_modules/util-deprecate/browser.js +67 -0
  186. package/node_modules/util-deprecate/node.js +6 -0
  187. package/node_modules/util-deprecate/package.json +27 -0
  188. package/package.json +1 -1
  189. package/skills/client-email/SKILL.md +8 -6
  190. package/skills/employment-contract/SKILL.md +23 -6
  191. package/skills/non-compete-contract-explainer/content/alabama.md +251 -0
  192. package/skills/non-compete-contract-explainer/content/alaska.md +160 -0
  193. package/skills/non-compete-contract-explainer/content/american-samoa.md +187 -0
  194. package/skills/non-compete-contract-explainer/content/arizona.md +293 -0
  195. package/skills/non-compete-contract-explainer/content/arkansas.md +235 -0
  196. package/skills/non-compete-contract-explainer/content/california.md +270 -0
  197. package/skills/non-compete-contract-explainer/content/cnmi.md +168 -0
  198. package/skills/non-compete-contract-explainer/content/colorado.md +277 -0
  199. package/skills/non-compete-contract-explainer/content/connecticut.md +220 -0
  200. package/skills/non-compete-contract-explainer/content/delaware.md +222 -0
  201. package/skills/non-compete-contract-explainer/content/district-of-columbia.md +263 -0
  202. package/skills/non-compete-contract-explainer/content/florida.md +267 -0
  203. package/skills/non-compete-contract-explainer/content/georgia.md +323 -0
  204. package/skills/non-compete-contract-explainer/content/guam.md +180 -0
  205. package/skills/non-compete-contract-explainer/content/hawaii.md +236 -0
  206. package/skills/non-compete-contract-explainer/content/idaho.md +258 -0
  207. package/skills/non-compete-contract-explainer/content/illinois.md +266 -0
  208. package/skills/non-compete-contract-explainer/content/india.md +269 -0
  209. package/skills/non-compete-contract-explainer/content/indiana.md +253 -0
  210. package/skills/non-compete-contract-explainer/content/iowa.md +232 -0
  211. package/skills/non-compete-contract-explainer/content/kansas.md +227 -0
  212. package/skills/non-compete-contract-explainer/content/kentucky.md +201 -0
  213. package/skills/non-compete-contract-explainer/content/louisiana.md +272 -0
  214. package/skills/non-compete-contract-explainer/content/maine.md +178 -0
  215. package/skills/non-compete-contract-explainer/content/maryland.md +244 -0
  216. package/skills/non-compete-contract-explainer/content/massachusetts.md +272 -0
  217. package/skills/non-compete-contract-explainer/content/michigan.md +222 -0
  218. package/skills/non-compete-contract-explainer/content/minnesota.md +171 -0
  219. package/skills/non-compete-contract-explainer/content/mississippi.md +237 -0
  220. package/skills/non-compete-contract-explainer/content/missouri.md +219 -0
  221. package/skills/non-compete-contract-explainer/content/montana.md +202 -0
  222. package/skills/non-compete-contract-explainer/content/nebraska.md +206 -0
  223. package/skills/non-compete-contract-explainer/content/nevada.md +278 -0
  224. package/skills/non-compete-contract-explainer/content/new-hampshire.md +233 -0
  225. package/skills/non-compete-contract-explainer/content/new-jersey.md +277 -0
  226. package/skills/non-compete-contract-explainer/content/new-mexico.md +244 -0
  227. package/skills/non-compete-contract-explainer/content/new-york.md +226 -0
  228. package/skills/non-compete-contract-explainer/content/north-carolina.md +346 -0
  229. package/skills/non-compete-contract-explainer/content/north-dakota.md +187 -0
  230. package/skills/non-compete-contract-explainer/content/ohio.md +207 -0
  231. package/skills/non-compete-contract-explainer/content/oklahoma.md +196 -0
  232. package/skills/non-compete-contract-explainer/content/oregon.md +359 -0
  233. package/skills/non-compete-contract-explainer/content/pennsylvania.md +254 -0
  234. package/skills/non-compete-contract-explainer/content/philippines.md +211 -0
  235. package/skills/non-compete-contract-explainer/content/puerto-rico.md +163 -0
  236. package/skills/non-compete-contract-explainer/content/rhode-island.md +171 -0
  237. package/skills/non-compete-contract-explainer/content/singapore.md +229 -0
  238. package/skills/non-compete-contract-explainer/content/south-carolina.md +226 -0
  239. package/skills/non-compete-contract-explainer/content/south-dakota.md +222 -0
  240. package/skills/non-compete-contract-explainer/content/tennessee.md +251 -0
  241. package/skills/non-compete-contract-explainer/content/texas.md +297 -0
  242. package/skills/non-compete-contract-explainer/content/us-virgin-islands.md +193 -0
  243. package/skills/non-compete-contract-explainer/content/utah.md +250 -0
  244. package/skills/non-compete-contract-explainer/content/vermont.md +193 -0
  245. package/skills/non-compete-contract-explainer/content/virginia.md +213 -0
  246. package/skills/non-compete-contract-explainer/content/washington.md +296 -0
  247. package/skills/non-compete-contract-explainer/content/west-virginia.md +187 -0
  248. package/skills/non-compete-contract-explainer/content/wisconsin.md +293 -0
  249. package/skills/non-compete-contract-explainer/content/wyoming.md +55 -45
  250. package/skills/non-compete-contract-explainer/manifest.json +523 -1
@@ -0,0 +1,1664 @@
1
+ declare module '@xmldom/xmldom' {
2
+ // START ./lib/conventions.js
3
+ /**
4
+ * Since xmldom can not rely on `Object.assign`,
5
+ * it uses/provides a simplified version that is sufficient for its needs.
6
+ *
7
+ * @throws {TypeError}
8
+ * If target is not an object.
9
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
10
+ * @see https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign
11
+ */
12
+ function assign<T, S>(target: T, source: S): T & S;
13
+
14
+ /**
15
+ * For both the `text/html` and the `application/xhtml+xml` namespace the spec defines that
16
+ * the HTML namespace is provided as the default.
17
+ *
18
+ * @param {string} mimeType
19
+ * @returns {boolean}
20
+ * @see https://dom.spec.whatwg.org/#dom-document-createelement
21
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument
22
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument
23
+ */
24
+ function hasDefaultHTMLNamespace(
25
+ mimeType: string
26
+ ): mimeType is typeof MIME_TYPE.HTML | typeof MIME_TYPE.XML_XHTML_APPLICATION;
27
+
28
+ /**
29
+ * Only returns true if `value` matches MIME_TYPE.HTML, which indicates an HTML document.
30
+ *
31
+ * @see https://www.iana.org/assignments/media-types/text/html
32
+ * @see https://en.wikipedia.org/wiki/HTML
33
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString
34
+ * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring
35
+ */
36
+ function isHTMLMimeType(mimeType: string): mimeType is typeof MIME_TYPE.HTML;
37
+
38
+ /**
39
+ * Only returns true if `mimeType` is one of the allowed values for `DOMParser.parseFromString`.
40
+ */
41
+ function isValidMimeType(mimeType: string): mimeType is MIME_TYPE;
42
+
43
+ /**
44
+ * All mime types that are allowed as input to `DOMParser.parseFromString`
45
+ *
46
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#Argument02
47
+ * MDN
48
+ * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#domparsersupportedtype
49
+ * WHATWG HTML Spec
50
+ * @see {@link DOMParser.prototype.parseFromString}
51
+ */
52
+ type MIME_TYPE = (typeof MIME_TYPE)[keyof typeof MIME_TYPE];
53
+ /**
54
+ * All mime types that are allowed as input to `DOMParser.parseFromString`
55
+ *
56
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#Argument02
57
+ * MDN
58
+ * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#domparsersupportedtype
59
+ * WHATWG HTML Spec
60
+ * @see {@link DOMParser.prototype.parseFromString}
61
+ */
62
+ var MIME_TYPE: {
63
+ /**
64
+ * `text/html`, the only mime type that triggers treating an XML document as HTML.
65
+ *
66
+ * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration
67
+ * @see https://en.wikipedia.org/wiki/HTML Wikipedia
68
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN
69
+ * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring
70
+ * WHATWG HTML Spec
71
+ */
72
+ readonly HTML: 'text/html';
73
+ /**
74
+ * `application/xml`, the standard mime type for XML documents.
75
+ *
76
+ * @see https://www.iana.org/assignments/media-types/application/xml IANA MimeType
77
+ * registration
78
+ * @see https://tools.ietf.org/html/rfc7303#section-9.1 RFC 7303
79
+ * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia
80
+ */
81
+ readonly XML_APPLICATION: 'application/xml';
82
+ /**
83
+ * `text/html`, an alias for `application/xml`.
84
+ *
85
+ * @see https://tools.ietf.org/html/rfc7303#section-9.2 RFC 7303
86
+ * @see https://www.iana.org/assignments/media-types/text/xml IANA MimeType registration
87
+ * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia
88
+ */
89
+ readonly XML_TEXT: 'text/xml';
90
+ /**
91
+ * `application/xhtml+xml`, indicates an XML document that has the default HTML namespace,
92
+ * but is parsed as an XML document.
93
+ *
94
+ * @see https://www.iana.org/assignments/media-types/application/xhtml+xml IANA MimeType
95
+ * registration
96
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument WHATWG DOM Spec
97
+ * @see https://en.wikipedia.org/wiki/XHTML Wikipedia
98
+ */
99
+ readonly XML_XHTML_APPLICATION: 'application/xhtml+xml';
100
+ /**
101
+ * `image/svg+xml`,
102
+ *
103
+ * @see https://www.iana.org/assignments/media-types/image/svg+xml IANA MimeType registration
104
+ * @see https://www.w3.org/TR/SVG11/ W3C SVG 1.1
105
+ * @see https://en.wikipedia.org/wiki/Scalable_Vector_Graphics Wikipedia
106
+ */
107
+ readonly XML_SVG_IMAGE: 'image/svg+xml';
108
+ };
109
+ /**
110
+ * Namespaces that are used in xmldom.
111
+ *
112
+ * @see http://www.w3.org/TR/REC-xml-names
113
+ */
114
+ type NAMESPACE = (typeof NAMESPACE)[keyof typeof NAMESPACE];
115
+ /**
116
+ * Namespaces that are used in xmldom.
117
+ *
118
+ * @see http://www.w3.org/TR/REC-xml-names
119
+ */
120
+ var NAMESPACE: {
121
+ /**
122
+ * The XHTML namespace.
123
+ *
124
+ * @see http://www.w3.org/1999/xhtml
125
+ */
126
+ readonly HTML: 'http://www.w3.org/1999/xhtml';
127
+ /**
128
+ * The SVG namespace.
129
+ *
130
+ * @see http://www.w3.org/2000/svg
131
+ */
132
+ readonly SVG: 'http://www.w3.org/2000/svg';
133
+ /**
134
+ * The `xml:` namespace.
135
+ *
136
+ * @see http://www.w3.org/XML/1998/namespace
137
+ */
138
+ readonly XML: 'http://www.w3.org/XML/1998/namespace';
139
+
140
+ /**
141
+ * The `xmlns:` namespace.
142
+ *
143
+ * @see https://www.w3.org/2000/xmlns/
144
+ */
145
+ readonly XMLNS: 'http://www.w3.org/2000/xmlns/';
146
+ };
147
+
148
+ // END ./lib/conventions.js
149
+
150
+ // START ./lib/errors.js
151
+ type DOMExceptionName =
152
+ (typeof DOMExceptionName)[keyof typeof DOMExceptionName];
153
+ var DOMExceptionName: {
154
+ /**
155
+ * the default value as defined by the spec
156
+ */
157
+ readonly Error: 'Error';
158
+ /**
159
+ * @deprecated
160
+ * Use RangeError instead.
161
+ */
162
+ readonly IndexSizeError: 'IndexSizeError';
163
+ /**
164
+ * @deprecated
165
+ * Just to match the related static code, not part of the spec.
166
+ */
167
+ readonly DomstringSizeError: 'DomstringSizeError';
168
+ readonly HierarchyRequestError: 'HierarchyRequestError';
169
+ readonly WrongDocumentError: 'WrongDocumentError';
170
+ readonly InvalidCharacterError: 'InvalidCharacterError';
171
+ /**
172
+ * @deprecated
173
+ * Just to match the related static code, not part of the spec.
174
+ */
175
+ readonly NoDataAllowedError: 'NoDataAllowedError';
176
+ readonly NoModificationAllowedError: 'NoModificationAllowedError';
177
+ readonly NotFoundError: 'NotFoundError';
178
+ readonly NotSupportedError: 'NotSupportedError';
179
+ readonly InUseAttributeError: 'InUseAttributeError';
180
+ readonly InvalidStateError: 'InvalidStateError';
181
+ readonly SyntaxError: 'SyntaxError';
182
+ readonly InvalidModificationError: 'InvalidModificationError';
183
+ readonly NamespaceError: 'NamespaceError';
184
+ /**
185
+ * @deprecated
186
+ * Use TypeError for invalid arguments,
187
+ * "NotSupportedError" DOMException for unsupported operations,
188
+ * and "NotAllowedError" DOMException for denied requests instead.
189
+ */
190
+ readonly InvalidAccessError: 'InvalidAccessError';
191
+ /**
192
+ * @deprecated
193
+ * Just to match the related static code, not part of the spec.
194
+ */
195
+ readonly ValidationError: 'ValidationError';
196
+ /**
197
+ * @deprecated
198
+ * Use TypeError instead.
199
+ */
200
+ readonly TypeMismatchError: 'TypeMismatchError';
201
+ readonly SecurityError: 'SecurityError';
202
+ readonly NetworkError: 'NetworkError';
203
+ readonly AbortError: 'AbortError';
204
+ /**
205
+ * @deprecated
206
+ * Just to match the related static code, not part of the spec.
207
+ */
208
+ readonly URLMismatchError: 'URLMismatchError';
209
+ readonly QuotaExceededError: 'QuotaExceededError';
210
+ readonly TimeoutError: 'TimeoutError';
211
+ readonly InvalidNodeTypeError: 'InvalidNodeTypeError';
212
+ readonly DataCloneError: 'DataCloneError';
213
+ readonly EncodingError: 'EncodingError';
214
+ readonly NotReadableError: 'NotReadableError';
215
+ readonly UnknownError: 'UnknownError';
216
+ readonly ConstraintError: 'ConstraintError';
217
+ readonly DataError: 'DataError';
218
+ readonly TransactionInactiveError: 'TransactionInactiveError';
219
+ readonly ReadOnlyError: 'ReadOnlyError';
220
+ readonly VersionError: 'VersionError';
221
+ readonly OperationError: 'OperationError';
222
+ readonly NotAllowedError: 'NotAllowedError';
223
+ readonly OptOutError: 'OptOutError';
224
+ };
225
+ type ExceptionCode = (typeof ExceptionCode)[keyof typeof ExceptionCode];
226
+
227
+ var ExceptionCode: {
228
+ readonly INDEX_SIZE_ERR: 1;
229
+ readonly DOMSTRING_SIZE_ERR: 2;
230
+ readonly HIERARCHY_REQUEST_ERR: 3;
231
+ readonly WRONG_DOCUMENT_ERR: 4;
232
+ readonly INVALID_CHARACTER_ERR: 5;
233
+ readonly NO_DATA_ALLOWED_ERR: 6;
234
+ readonly NO_MODIFICATION_ALLOWED_ERR: 7;
235
+ readonly NOT_FOUND_ERR: 8;
236
+ readonly NOT_SUPPORTED_ERR: 9;
237
+ readonly INUSE_ATTRIBUTE_ERR: 10;
238
+ readonly INVALID_STATE_ERR: 11;
239
+ readonly SYNTAX_ERR: 12;
240
+ readonly INVALID_MODIFICATION_ERR: 13;
241
+ readonly NAMESPACE_ERR: 14;
242
+ readonly INVALID_ACCESS_ERR: 15;
243
+ readonly VALIDATION_ERR: 16;
244
+ readonly TYPE_MISMATCH_ERR: 17;
245
+ readonly SECURITY_ERR: 18;
246
+ readonly NETWORK_ERR: 19;
247
+ readonly ABORT_ERR: 20;
248
+ readonly URL_MISMATCH_ERR: 21;
249
+ readonly QUOTA_EXCEEDED_ERR: 22;
250
+ readonly TIMEOUT_ERR: 23;
251
+ readonly INVALID_NODE_TYPE_ERR: 24;
252
+ readonly DATA_CLONE_ERR: 25;
253
+ };
254
+
255
+ /**
256
+ * DOM operations only raise exceptions in "exceptional" circumstances, i.e., when an
257
+ * operation is impossible to perform (either for logical reasons, because data is lost, or
258
+ * because the implementation has become unstable). In general, DOM methods return specific
259
+ * error values in ordinary processing situations, such as out-of-bound errors when using
260
+ * NodeList.
261
+ *
262
+ * Implementations should raise other exceptions under other circumstances. For example,
263
+ * implementations should raise an implementation-dependent exception if a null argument is
264
+ * passed when null was not expected.
265
+ *
266
+ * This implementation supports the following usages:
267
+ * 1. according to the living standard (both arguments are optional):
268
+ * ```
269
+ * new DOMException("message (can be empty)", DOMExceptionNames.HierarchyRequestError)
270
+ * ```
271
+ * 2. according to previous xmldom implementation (only the first argument is required):
272
+ * ```
273
+ * new DOMException(DOMException.HIERARCHY_REQUEST_ERR, "optional message")
274
+ * ```
275
+ * both result in the proper name being set.
276
+ *
277
+ * @see https://webidl.spec.whatwg.org/#idl-DOMException
278
+ * @see https://webidl.spec.whatwg.org/#dfn-error-names-table
279
+ * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-17189187
280
+ * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html
281
+ * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html
282
+ */
283
+ class DOMException extends Error {
284
+ constructor(message?: string, name?: DOMExceptionName | string);
285
+ constructor(code?: ExceptionCode, message?: string);
286
+
287
+ readonly name: DOMExceptionName;
288
+ readonly code: ExceptionCode | 0;
289
+ static readonly INDEX_SIZE_ERR: 1;
290
+ static readonly DOMSTRING_SIZE_ERR: 2;
291
+ static readonly HIERARCHY_REQUEST_ERR: 3;
292
+ static readonly WRONG_DOCUMENT_ERR: 4;
293
+ static readonly INVALID_CHARACTER_ERR: 5;
294
+ static readonly NO_DATA_ALLOWED_ERR: 6;
295
+ static readonly NO_MODIFICATION_ALLOWED_ERR: 7;
296
+ static readonly NOT_FOUND_ERR: 8;
297
+ static readonly NOT_SUPPORTED_ERR: 9;
298
+ static readonly INUSE_ATTRIBUTE_ERR: 10;
299
+ static readonly INVALID_STATE_ERR: 11;
300
+ static readonly SYNTAX_ERR: 12;
301
+ static readonly INVALID_MODIFICATION_ERR: 13;
302
+ static readonly NAMESPACE_ERR: 14;
303
+ static readonly INVALID_ACCESS_ERR: 15;
304
+ static readonly VALIDATION_ERR: 16;
305
+ static readonly TYPE_MISMATCH_ERR: 17;
306
+ static readonly SECURITY_ERR: 18;
307
+ static readonly NETWORK_ERR: 19;
308
+ static readonly ABORT_ERR: 20;
309
+ static readonly URL_MISMATCH_ERR: 21;
310
+ static readonly QUOTA_EXCEEDED_ERR: 22;
311
+ static readonly TIMEOUT_ERR: 23;
312
+ static readonly INVALID_NODE_TYPE_ERR: 24;
313
+ static readonly DATA_CLONE_ERR: 25;
314
+ }
315
+
316
+ /**
317
+ * Creates an error that will not be caught by XMLReader aka the SAX parser.
318
+ */
319
+ class ParseError extends Error {
320
+ constructor(message: string, locator?: any, cause?: Error);
321
+
322
+ readonly message: string;
323
+ readonly locator?: any;
324
+ }
325
+
326
+ // END ./lib/errors.js
327
+
328
+ // START ./lib/dom.js
329
+
330
+ type InstanceOf<T> = {
331
+ // instanceof pre ts 5.3
332
+ (val: unknown): val is T;
333
+ // instanceof post ts 5.3
334
+ [Symbol.hasInstance](val: unknown): val is T;
335
+ };
336
+
337
+ type GetRootNodeOptions = {
338
+ composed?: boolean;
339
+ };
340
+
341
+ /**
342
+ * The DOM Node interface is an abstract base class upon which many other DOM API objects are
343
+ * based, thus letting those object types to be used similarly and often interchangeably. As an
344
+ * abstract class, there is no such thing as a plain Node object. All objects that implement
345
+ * Node functionality are based on one of its subclasses. Most notable are Document, Element,
346
+ * and DocumentFragment.
347
+ *
348
+ * In addition, every kind of DOM node is represented by an interface based on Node. These
349
+ * include Attr, CharacterData (which Text, Comment, CDATASection and ProcessingInstruction are
350
+ * all based on), and DocumentType.
351
+ *
352
+ * In some cases, a particular feature of the base Node interface may not apply to one of its
353
+ * child interfaces; in that case, the inheriting node may return null or throw an exception,
354
+ * depending on circumstances. For example, attempting to add children to a node type that
355
+ * cannot have children will throw an exception.
356
+ *
357
+ * **This behavior is slightly different from the in the specs**:
358
+ * - unimplemented interfaces: EventTarget
359
+ *
360
+ * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247
361
+ * @see https://dom.spec.whatwg.org/#node
362
+ * @prettierignore
363
+ */
364
+ interface Node {
365
+ /**
366
+ * Returns the children.
367
+ *
368
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
369
+ */
370
+ readonly childNodes: NodeList;
371
+ /**
372
+ * Returns the first child.
373
+ *
374
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
375
+ */
376
+ readonly firstChild: Node | null;
377
+ /**
378
+ * Returns the last child.
379
+ *
380
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/lastChild)
381
+ */
382
+ readonly lastChild: Node | null;
383
+ /**
384
+ * The local part of the qualified name of this node.
385
+ */
386
+ localName: string | null;
387
+ /**
388
+ * Always returns `about:blank` currently.
389
+ *
390
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Node/baseURI)
391
+ */
392
+ readonly baseURI: 'about:blank';
393
+ /**
394
+ * Returns true if this node is inside of a document or is the document node itself.
395
+ *
396
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Node/isConnected)
397
+ */
398
+ readonly isConnected: boolean;
399
+ /**
400
+ * The namespace URI of this node.
401
+ */
402
+ readonly namespaceURI: string | null;
403
+ /**
404
+ * Returns the next sibling.
405
+ *
406
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/nextSibling)
407
+ */
408
+ readonly nextSibling: Node | null;
409
+ /**
410
+ * Returns a string appropriate for the type of node.
411
+ *
412
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/nodeName)
413
+ */
414
+ readonly nodeName: string;
415
+ /**
416
+ * Returns the type of node.
417
+ *
418
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/nodeType)
419
+ */
420
+ readonly nodeType: number;
421
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/nodeValue) */
422
+ nodeValue: string | null;
423
+ /**
424
+ * Returns the node document. Returns null for documents.
425
+ *
426
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/ownerDocument)
427
+ */
428
+ readonly ownerDocument: Document | null;
429
+ /**
430
+ * Returns the parent.
431
+ *
432
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/parentNode)
433
+ */
434
+ readonly parentNode: Node | null;
435
+ /**
436
+ * Returns the parent `Node` if it is of type `Element`, otherwise `null`.
437
+ *
438
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/parentElement)
439
+ */
440
+ readonly parentElement: Element | null;
441
+ /**
442
+ * The prefix of the namespace for this node.
443
+ */
444
+ prefix: string | null;
445
+ /**
446
+ * Returns the previous sibling.
447
+ *
448
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/previousSibling)
449
+ */
450
+ readonly previousSibling: Node | null;
451
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/textContent) */
452
+ textContent: string | null;
453
+
454
+ /**
455
+ * Zero based line position inside the parsed source,
456
+ * if the `locator` was not disabled.
457
+ */
458
+ lineNumber?: number;
459
+ /**
460
+ * One based column position inside the parsed source,
461
+ * if the `locator` was not disabled.
462
+ */
463
+ columnNumber?: number;
464
+
465
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/appendChild) */
466
+ appendChild(node: Node): Node;
467
+
468
+ /**
469
+ * Checks whether `other` is an inclusive descendant of this node.
470
+ *
471
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Node/contains)
472
+ */
473
+ contains(other: Node | null | undefined): boolean;
474
+ /**
475
+ * Searches for the root node of this node.
476
+ *
477
+ * **This behavior is slightly different from the one in the specs**:
478
+ * - ignores `options.composed`, since `ShadowRoot`s are unsupported, therefore always
479
+ * returning root.
480
+ *
481
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Node/getRootNode)
482
+ *
483
+ * @see https://dom.spec.whatwg.org/#dom-node-getrootnode
484
+ * @see https://dom.spec.whatwg.org/#concept-shadow-including-root
485
+ */
486
+ getRootNode(options: GetRootNodeOptions): Node;
487
+
488
+ /**
489
+ * Checks whether the given node is equal to this node.
490
+ *
491
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Node/isEqualNode)
492
+ */
493
+ isEqualNode(other: Node): boolean;
494
+
495
+ /**
496
+ * Checks whether the given node is this node.
497
+ *
498
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Node/isSameNode)
499
+ */
500
+ isSameNode(other: Node): boolean;
501
+
502
+ /**
503
+ * Returns a copy of node. If deep is true, the copy also includes the node's descendants.
504
+ *
505
+ * @throws {DOMException}
506
+ * May throw a DOMException if operations within {@link Element#setAttributeNode} or
507
+ * {@link Node#appendChild} (which are potentially invoked in this method) do not meet their
508
+ * specific constraints.
509
+ *
510
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/cloneNode)
511
+ */
512
+ cloneNode(deep?: boolean): Node;
513
+
514
+ /**
515
+ * Returns a bitmask indicating the position of other relative to node.
516
+ *
517
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition)
518
+ */
519
+ compareDocumentPosition(other: Node): number;
520
+
521
+ /**
522
+ * Returns whether node has children.
523
+ *
524
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes)
525
+ */
526
+ hasChildNodes(): boolean;
527
+
528
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) */
529
+ insertBefore(node: Node, child: Node | null): Node;
530
+
531
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) */
532
+ isDefaultNamespace(namespace: string | null): boolean;
533
+
534
+ /**
535
+ * Checks whether the DOM implementation implements a specific feature and its version.
536
+ *
537
+ * @deprecated
538
+ * Since `DOMImplementation.hasFeature` is deprecated and always returns true.
539
+ * @param feature
540
+ * The package name of the feature to test. This is the same name that can be passed to the
541
+ * method `hasFeature` on `DOMImplementation`.
542
+ * @param version
543
+ * This is the version number of the package name to test.
544
+ * @since Introduced in DOM Level 2
545
+ * @see {@link DOMImplementation.hasFeature}
546
+ */
547
+ isSupported(feature: string, version: string): true;
548
+
549
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) */
550
+ lookupNamespaceURI(prefix: string | null): string | null;
551
+
552
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) */
553
+ lookupPrefix(namespace: string | null): string | null;
554
+
555
+ /**
556
+ * Removes empty exclusive Text nodes and concatenates the data of remaining contiguous
557
+ * exclusive Text nodes into the first of their nodes.
558
+ *
559
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/normalize)
560
+ */
561
+ normalize(): void;
562
+
563
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/removeChild) */
564
+ removeChild(child: Node): Node;
565
+
566
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) */
567
+ replaceChild(node: Node, child: Node): Node;
568
+
569
+ /** node is an element. */
570
+ readonly ELEMENT_NODE: 1;
571
+ readonly ATTRIBUTE_NODE: 2;
572
+ /** node is a Text node. */
573
+ readonly TEXT_NODE: 3;
574
+ /** node is a CDATASection node. */
575
+ readonly CDATA_SECTION_NODE: 4;
576
+ readonly ENTITY_REFERENCE_NODE: 5;
577
+ readonly ENTITY_NODE: 6;
578
+ /** node is a ProcessingInstruction node. */
579
+ readonly PROCESSING_INSTRUCTION_NODE: 7;
580
+ /** node is a Comment node. */
581
+ readonly COMMENT_NODE: 8;
582
+ /** node is a document. */
583
+ readonly DOCUMENT_NODE: 9;
584
+ /** node is a doctype. */
585
+ readonly DOCUMENT_TYPE_NODE: 10;
586
+ /** node is a DocumentFragment node. */
587
+ readonly DOCUMENT_FRAGMENT_NODE: 11;
588
+ readonly NOTATION_NODE: 12;
589
+ /** Set when node and other are not in the same tree. */
590
+ readonly DOCUMENT_POSITION_DISCONNECTED: 0x01;
591
+ /** Set when other is preceding node. */
592
+ readonly DOCUMENT_POSITION_PRECEDING: 0x02;
593
+ /** Set when other is following node. */
594
+ readonly DOCUMENT_POSITION_FOLLOWING: 0x04;
595
+ /** Set when other is an ancestor of node. */
596
+ readonly DOCUMENT_POSITION_CONTAINS: 0x08;
597
+ /** Set when other is a descendant of node. */
598
+ readonly DOCUMENT_POSITION_CONTAINED_BY: 0x10;
599
+ readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 0x20;
600
+ }
601
+
602
+ var Node: InstanceOf<Node> & {
603
+ /** node is an element. */
604
+ readonly ELEMENT_NODE: 1;
605
+ readonly ATTRIBUTE_NODE: 2;
606
+ /** node is a Text node. */
607
+ readonly TEXT_NODE: 3;
608
+ /** node is a CDATASection node. */
609
+ readonly CDATA_SECTION_NODE: 4;
610
+ readonly ENTITY_REFERENCE_NODE: 5;
611
+ readonly ENTITY_NODE: 6;
612
+ /** node is a ProcessingInstruction node. */
613
+ readonly PROCESSING_INSTRUCTION_NODE: 7;
614
+ /** node is a Comment node. */
615
+ readonly COMMENT_NODE: 8;
616
+ /** node is a document. */
617
+ readonly DOCUMENT_NODE: 9;
618
+ /** node is a doctype. */
619
+ readonly DOCUMENT_TYPE_NODE: 10;
620
+ /** node is a DocumentFragment node. */
621
+ readonly DOCUMENT_FRAGMENT_NODE: 11;
622
+ readonly NOTATION_NODE: 12;
623
+ /** Set when node and other are not in the same tree. */
624
+ readonly DOCUMENT_POSITION_DISCONNECTED: 0x01;
625
+ /** Set when other is preceding node. */
626
+ readonly DOCUMENT_POSITION_PRECEDING: 0x02;
627
+ /** Set when other is following node. */
628
+ readonly DOCUMENT_POSITION_FOLLOWING: 0x04;
629
+ /** Set when other is an ancestor of node. */
630
+ readonly DOCUMENT_POSITION_CONTAINS: 0x08;
631
+ /** Set when other is a descendant of node. */
632
+ readonly DOCUMENT_POSITION_CONTAINED_BY: 0x10;
633
+ readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 0x20;
634
+ };
635
+
636
+ /**
637
+ * A DOM element's attribute as an object. In most DOM methods, you will probably directly
638
+ * retrieve the attribute as a string (e.g., Element.getAttribute(), but certain functions (e.g.,
639
+ * Element.getAttributeNode()) or means of iterating give Attr types.
640
+ *
641
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr)
642
+ */
643
+ interface Attr extends Node {
644
+ readonly nodeType: typeof Node.ATTRIBUTE_NODE;
645
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/name) */
646
+ readonly name: string;
647
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/namespaceURI) */
648
+ readonly namespaceURI: string | null;
649
+ readonly ownerDocument: Document;
650
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/ownerElement) */
651
+ readonly ownerElement: Element | null;
652
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/prefix) */
653
+ readonly prefix: string | null;
654
+ /**
655
+ * @deprecated
656
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/specified)
657
+ */
658
+ readonly specified: true;
659
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/value) */
660
+ value: string;
661
+ }
662
+ /**
663
+ * A DOM element's attribute as an object. In most DOM methods, you will probably directly
664
+ * retrieve the attribute as a string (e.g., Element.getAttribute(), but certain functions (e.g.,
665
+ * Element.getAttributeNode()) or means of iterating give Attr types.
666
+ *
667
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr)
668
+ */
669
+ var Attr: InstanceOf<Attr>;
670
+
671
+ /**
672
+ * Objects implementing the NamedNodeMap interface are used to represent collections of nodes
673
+ * that can be accessed by name.
674
+ * Note that NamedNodeMap does not inherit from NodeList;
675
+ * NamedNodeMaps are not maintained in any particular order.
676
+ * Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal
677
+ * index,
678
+ * but this is simply to allow convenient enumeration of the contents of a NamedNodeMap,
679
+ * and does not imply that the DOM specifies an order to these Nodes.
680
+ * NamedNodeMap objects in the DOM are live.
681
+ * used for attributes or DocumentType entities
682
+ *
683
+ * This implementation only supports property indices, but does not support named properties,
684
+ * as specified in the living standard.
685
+ *
686
+ * @see https://dom.spec.whatwg.org/#interface-namednodemap
687
+ * @see https://webidl.spec.whatwg.org/#dfn-supported-property-names
688
+ */
689
+ class NamedNodeMap implements Iterable<Attr> {
690
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/NamedNodeMap/length) */
691
+ readonly length: number;
692
+ /**
693
+ * Get an attribute by name. Note: Name is in lower case in case of HTML namespace and
694
+ * document.
695
+ *
696
+ * @see https://dom.spec.whatwg.org/#concept-element-attributes-get-by-name
697
+ */
698
+ getNamedItem(qualifiedName: string): Attr | null;
699
+ /**
700
+ * Get an attribute by namespace and local name.
701
+ *
702
+ * @see https://dom.spec.whatwg.org/#concept-element-attributes-get-by-namespace
703
+ */
704
+ getNamedItemNS(namespace: string | null, localName: string): Attr | null;
705
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/NamedNodeMap/item) */
706
+ item(index: number): Attr | null;
707
+
708
+ /**
709
+ * Removes an attribute specified by the local name.
710
+ *
711
+ * @throws {DOMException}
712
+ * With code:
713
+ * - {@link DOMException.NOT_FOUND_ERR} if no attribute with the given name is found.
714
+ * @see https://dom.spec.whatwg.org/#dom-namednodemap-removenameditem
715
+ * @see https://dom.spec.whatwg.org/#concept-element-attributes-remove-by-name
716
+ */
717
+ removeNamedItem(qualifiedName: string): Attr;
718
+ /**
719
+ * Removes an attribute specified by the namespace and local name.
720
+ *
721
+ * @throws {DOMException}
722
+ * With code:
723
+ * - {@link DOMException.NOT_FOUND_ERR} if no attribute with the given namespace URI and
724
+ * local name is found.
725
+ * @see https://dom.spec.whatwg.org/#dom-namednodemap-removenameditemns
726
+ * @see https://dom.spec.whatwg.org/#concept-element-attributes-remove-by-namespace
727
+ */
728
+ removeNamedItemNS(namespace: string | null, localName: string): Attr;
729
+ /**
730
+ * Set an attribute.
731
+ *
732
+ * @throws {DOMException}
733
+ * With code:
734
+ * - {@link INUSE_ATTRIBUTE_ERR} - If the attribute is already an attribute of another
735
+ * element.
736
+ * @see https://dom.spec.whatwg.org/#concept-element-attributes-set
737
+ */
738
+ setNamedItem(attr: Attr): Attr | null;
739
+ /**
740
+ * Set an attribute, replacing an existing attribute with the same local name and namespace
741
+ * URI if one exists.
742
+ *
743
+ * @throws {DOMException}
744
+ * Throws a DOMException with the name "InUseAttributeError" if the attribute is already an
745
+ * attribute of another element.
746
+ * @see https://dom.spec.whatwg.org/#concept-element-attributes-set
747
+ */
748
+ setNamedItemNS(attr: Attr): Attr | null;
749
+ [index: number]: Attr;
750
+ [Symbol.iterator](): Iterator<Attr>;
751
+ }
752
+
753
+ /**
754
+ * NodeList objects are collections of nodes, usually returned by properties such as
755
+ * Node.childNodes and methods such as document.querySelectorAll().
756
+ *
757
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NodeList)
758
+ */
759
+ class NodeList<T extends Node = Node> implements Iterable<T> {
760
+ /**
761
+ * Returns the number of nodes in the collection.
762
+ *
763
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NodeList/length)
764
+ */
765
+ readonly length: number;
766
+ /**
767
+ * Returns the node with index index from the collection. The nodes are sorted in tree order.
768
+ *
769
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NodeList/item)
770
+ */
771
+ item(index: number): T | null;
772
+ /**
773
+ * Returns a string representation of the NodeList.
774
+ */
775
+ toString(nodeFilter: (node: T) => T | undefined): string;
776
+ /**
777
+ * Filters the NodeList based on a predicate.
778
+ *
779
+ * @private
780
+ */
781
+ filter(predicate: (node: T) => boolean): T[];
782
+ /**
783
+ * Returns the first index at which a given node can be found in the NodeList, or -1 if it is
784
+ * not present.
785
+ *
786
+ * @private
787
+ */
788
+ indexOf(node: T): number;
789
+
790
+ /**
791
+ * Index based access returns `undefined`, when accessing indexes >= `length`.
792
+ * But it would break a lot of code (like `Array.from` usages),
793
+ * if it would be typed as `T | undefined`.
794
+ */
795
+ [index: number]: T;
796
+
797
+ [Symbol.iterator](): Iterator<T>;
798
+ }
799
+
800
+ /**
801
+ * Represents a live collection of nodes that is automatically updated when its associated
802
+ * document changes.
803
+ */
804
+ interface LiveNodeList<T extends Node = Node> extends NodeList<T> {}
805
+ /**
806
+ * Represents a live collection of nodes that is automatically updated when its associated
807
+ * document changes.
808
+ */
809
+ var LiveNodeList: InstanceOf<LiveNodeList>;
810
+
811
+ /**
812
+ * Element is the most general base class from which all objects in a Document inherit. It only
813
+ * has methods and properties common to all kinds of elements. More specific classes inherit from
814
+ * Element.
815
+ *
816
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element)
817
+ */
818
+ interface Element extends Node {
819
+ readonly nodeType: typeof Node.ELEMENT_NODE;
820
+
821
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/attributes) */
822
+ readonly attributes: NamedNodeMap;
823
+ /**
824
+ * Returns the HTML-uppercased qualified name.
825
+ *
826
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/tagName)
827
+ */
828
+ readonly tagName: string;
829
+
830
+ /**
831
+ * Returns a live collection of the direct child elements of this element.
832
+ *
833
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/children)
834
+ *
835
+ * @see https://dom.spec.whatwg.org/#dom-parentnode-children
836
+ */
837
+ readonly children: LiveNodeList<Element>;
838
+
839
+ /**
840
+ * Returns element's first attribute whose qualified name is qualifiedName, and null if there
841
+ * is no such attribute otherwise.
842
+ *
843
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getAttribute)
844
+ */
845
+ getAttribute(qualifiedName: string): string | null;
846
+ /**
847
+ * Returns element's attribute whose namespace is namespace and local name is localName, and
848
+ * null if there is no such attribute otherwise.
849
+ *
850
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS)
851
+ */
852
+ getAttributeNS(namespace: string | null, localName: string): string | null;
853
+ /**
854
+ * Returns the qualified names of all element's attributes. Can contain duplicates.
855
+ *
856
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames)
857
+ */
858
+ getAttributeNames(): string[];
859
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) */
860
+ getAttributeNode(qualifiedName: string): Attr | null;
861
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) */
862
+ getAttributeNodeNS(
863
+ namespace: string | null,
864
+ localName: string
865
+ ): Attr | null;
866
+ /**
867
+ * Returns a LiveNodeList of all child elements which have **all** of the given class
868
+ * name(s).
869
+ *
870
+ * Returns an empty list if `classNames` is an empty string or only contains HTML white space
871
+ * characters.
872
+ *
873
+ * Warning: This returns a live LiveNodeList.
874
+ * Changes in the DOM will reflect in the array as the changes occur.
875
+ * If an element selected by this array no longer qualifies for the selector,
876
+ * it will automatically be removed. Be aware of this for iteration purposes.
877
+ *
878
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByClassName
879
+ * @see https://dom.spec.whatwg.org/#concept-getelementsbyclassname
880
+ */
881
+ getElementsByClassName(classNames: string): LiveNodeList<Element>;
882
+
883
+ /**
884
+ * Returns a LiveNodeList of elements with the given qualifiedName.
885
+ * Searching for all descendants can be done by passing `*` as `qualifiedName`.
886
+ *
887
+ * All descendants of the specified element are searched, but not the element itself.
888
+ * The returned list is live, which means it updates itself with the DOM tree automatically.
889
+ * Therefore, there is no need to call `Element.getElementsByTagName()`
890
+ * with the same element and arguments repeatedly if the DOM changes in between calls.
891
+ *
892
+ * When called on an HTML element in an HTML document,
893
+ * `getElementsByTagName` lower-cases the argument before searching for it.
894
+ * This is undesirable when trying to match camel-cased SVG elements (such as
895
+ * `<linearGradient>`) in an HTML document.
896
+ * Instead, use `Element.getElementsByTagNameNS()`,
897
+ * which preserves the capitalization of the tag name.
898
+ *
899
+ * `Element.getElementsByTagName` is similar to `Document.getElementsByTagName()`,
900
+ * except that it only searches for elements that are descendants of the specified element.
901
+ *
902
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByTagName
903
+ * @see https://dom.spec.whatwg.org/#concept-getelementsbytagname
904
+ */
905
+ getElementsByTagName(qualifiedName: string): LiveNodeList<Element>;
906
+
907
+ /**
908
+ * Returns a `LiveNodeList` of elements with the given tag name belonging to the given
909
+ * namespace. It is similar to `Document.getElementsByTagNameNS`, except that its search is
910
+ * restricted to descendants of the specified element.
911
+ *
912
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS)
913
+ * */
914
+ getElementsByTagNameNS(
915
+ namespaceURI: string | null,
916
+ localName: string
917
+ ): LiveNodeList<Element>;
918
+
919
+ getQualifiedName(): string;
920
+ /**
921
+ * Returns true if element has an attribute whose qualified name is qualifiedName, and false
922
+ * otherwise.
923
+ *
924
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute)
925
+ */
926
+ hasAttribute(qualifiedName: string): boolean;
927
+ /**
928
+ * Returns true if element has an attribute whose namespace is namespace and local name is
929
+ * localName.
930
+ *
931
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS)
932
+ */
933
+ hasAttributeNS(namespace: string | null, localName: string): boolean;
934
+ /**
935
+ * Returns true if element has attributes, and false otherwise.
936
+ *
937
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes)
938
+ */
939
+ hasAttributes(): boolean;
940
+ /**
941
+ * Removes element's first attribute whose qualified name is qualifiedName.
942
+ *
943
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute)
944
+ */
945
+ removeAttribute(qualifiedName: string): void;
946
+ /**
947
+ * Removes element's attribute whose namespace is namespace and local name is localName.
948
+ *
949
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS)
950
+ */
951
+ removeAttributeNS(namespace: string | null, localName: string): void;
952
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) */
953
+ removeAttributeNode(attr: Attr): Attr;
954
+ /**
955
+ * Sets the value of element's first attribute whose qualified name is qualifiedName to value.
956
+ *
957
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setAttribute)
958
+ */
959
+ setAttribute(qualifiedName: string, value: string): void;
960
+ /**
961
+ * Sets the value of element's attribute whose namespace is namespace and local name is
962
+ * localName to value.
963
+ *
964
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS)
965
+ */
966
+ setAttributeNS(
967
+ namespace: string | null,
968
+ qualifiedName: string,
969
+ value: string
970
+ ): void;
971
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) */
972
+ setAttributeNode(attr: Attr): Attr | null;
973
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) */
974
+ setAttributeNodeNS(attr: Attr): Attr | null;
975
+ }
976
+ /**
977
+ * Element is the most general base class from which all objects in a Document inherit. It only
978
+ * has methods and properties common to all kinds of elements. More specific classes inherit from
979
+ * Element.
980
+ *
981
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element)
982
+ */
983
+ var Element: InstanceOf<Element>;
984
+
985
+ /**
986
+ * The CharacterData abstract interface represents a Node object that contains characters. This
987
+ * is an abstract interface, meaning there aren't any object of type CharacterData: it is
988
+ * implemented by other interfaces, like Text, Comment, or ProcessingInstruction which aren't
989
+ * abstract.
990
+ *
991
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData)
992
+ */
993
+ interface CharacterData extends Node {
994
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/data) */
995
+ data: string;
996
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/length) */
997
+ readonly length: number;
998
+ readonly ownerDocument: Document;
999
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/appendData) */
1000
+ appendData(data: string): void;
1001
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/deleteData) */
1002
+ deleteData(offset: number, count: number): void;
1003
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/insertData) */
1004
+ insertData(offset: number, data: string): void;
1005
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceData) */
1006
+ replaceData(offset: number, count: number, data: string): void;
1007
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/substringData) */
1008
+ substringData(offset: number, count: number): string;
1009
+ }
1010
+ /**
1011
+ * The CharacterData abstract interface represents a Node object that contains characters. This
1012
+ * is an abstract interface, meaning there aren't any object of type CharacterData: it is
1013
+ * implemented by other interfaces, like Text, Comment, or ProcessingInstruction which aren't
1014
+ * abstract.
1015
+ *
1016
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData)
1017
+ */
1018
+ var CharacterData: InstanceOf<CharacterData>;
1019
+
1020
+ /**
1021
+ * The textual content of Element or Attr. If an element has no markup within its content, it has
1022
+ * a single child implementing Text that contains the element's text. However, if the element
1023
+ * contains markup, it is parsed into information items and Text nodes that form its children.
1024
+ *
1025
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Text)
1026
+ */
1027
+ interface Text extends CharacterData {
1028
+ nodeName: '#text' | '#cdata-section';
1029
+ nodeType: typeof Node.TEXT_NODE | typeof Node.CDATA_SECTION_NODE;
1030
+ /**
1031
+ * Splits data at the given offset and returns the remainder as Text node.
1032
+ *
1033
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Text/splitText)
1034
+ */
1035
+ splitText(offset: number): Text;
1036
+ }
1037
+
1038
+ /**
1039
+ * The textual content of Element or Attr. If an element has no markup within its content, it has
1040
+ * a single child implementing Text that contains the element's text. However, if the element
1041
+ * contains markup, it is parsed into information items and Text nodes that form its children.
1042
+ *
1043
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Text)
1044
+ */
1045
+ var Text: InstanceOf<Text>;
1046
+
1047
+ /**
1048
+ * The Comment interface represents textual notations within markup; although it is generally not
1049
+ * visually shown, such comments are available to be read in the source view. Comments are
1050
+ * represented in HTML and XML as content between '<!--' and '-->'. In XML, like inside SVG or
1051
+ * MathML markup, the character sequence '--' cannot be used within a comment.
1052
+ *
1053
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Comment)
1054
+ */
1055
+ interface Comment extends CharacterData {
1056
+ nodeName: '#comment';
1057
+ nodeType: typeof Node.COMMENT_NODE;
1058
+ }
1059
+ /**
1060
+ * The Comment interface represents textual notations within markup; although it is generally not
1061
+ * visually shown, such comments are available to be read in the source view. Comments are
1062
+ * represented in HTML and XML as content between '<!--' and '-->'. In XML, like inside SVG or
1063
+ * MathML markup, the character sequence '--' cannot be used within a comment.
1064
+ *
1065
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Comment)
1066
+ */
1067
+ var Comment: InstanceOf<Comment>;
1068
+
1069
+ /**
1070
+ * A CDATA section that can be used within XML to include extended portions of unescaped text.
1071
+ * The symbols < and & don’t need escaping as they normally do when inside a CDATA section.
1072
+ *
1073
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CDATASection)
1074
+ */
1075
+ interface CDATASection extends Text {
1076
+ nodeName: '#cdata-section';
1077
+ nodeType: typeof Node.CDATA_SECTION_NODE;
1078
+ }
1079
+ /**
1080
+ * A CDATA section that can be used within XML to include extended portions of unescaped text.
1081
+ * The symbols < and & don’t need escaping as they normally do when inside a CDATA section.
1082
+ *
1083
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CDATASection)
1084
+ */
1085
+ var CDATASection: InstanceOf<CDATASection>;
1086
+
1087
+ /**
1088
+ * The DocumentFragment interface represents a minimal document object that has no parent.
1089
+ * It is used as a lightweight version of Document that stores a segment of a document structure
1090
+ * comprised of nodes just like a standard document.
1091
+ * The key difference is due to the fact that the document fragment isn't part
1092
+ * of the active document tree structure.
1093
+ * Changes made to the fragment don't affect the document.
1094
+ */
1095
+ interface DocumentFragment extends Node {
1096
+ readonly ownerDocument: Document;
1097
+
1098
+ /**
1099
+ * Returns a live collection of the direct child elements of this document fragment.
1100
+ *
1101
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DocumentFragment/children)
1102
+ *
1103
+ * @see https://dom.spec.whatwg.org/#dom-parentnode-children
1104
+ */
1105
+ readonly children: LiveNodeList<Element>;
1106
+
1107
+ getElementById(elementId: string): Element | null;
1108
+ }
1109
+ var DocumentFragment: InstanceOf<DocumentFragment>;
1110
+
1111
+ interface Entity extends Node {
1112
+ nodeType: typeof Node.ENTITY_NODE;
1113
+ }
1114
+ var Entity: InstanceOf<Entity>;
1115
+
1116
+ interface EntityReference extends Node {
1117
+ nodeType: typeof Node.ENTITY_REFERENCE_NODE;
1118
+ }
1119
+ var EntityReference: InstanceOf<EntityReference>;
1120
+
1121
+ interface Notation extends Node {
1122
+ nodeType: typeof Node.NOTATION_NODE;
1123
+ }
1124
+ var Notation: InstanceOf<Notation>;
1125
+
1126
+ interface ProcessingInstruction extends CharacterData {
1127
+ nodeType: typeof Node.PROCESSING_INSTRUCTION_NODE;
1128
+ /**
1129
+ * A string representing the textual data contained in this object.
1130
+ * For `ProcessingInstruction`, that means everything that goes after the `target`, excluding
1131
+ * `?>`.
1132
+ *
1133
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/data)
1134
+ */
1135
+ data: string;
1136
+ /**
1137
+ * A string containing the name of the application.
1138
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ProcessingInstruction/target) */
1139
+ readonly target: string;
1140
+ }
1141
+ var ProcessingInstruction: InstanceOf<ProcessingInstruction>;
1142
+
1143
+ interface Document extends Node {
1144
+ /**
1145
+ * The mime type of the document is determined at creation time and can not be modified.
1146
+ *
1147
+ * @see https://dom.spec.whatwg.org/#concept-document-content-type
1148
+ * @see {@link DOMImplementation}
1149
+ * @see {@link MIME_TYPE}
1150
+ */
1151
+ readonly contentType: MIME_TYPE;
1152
+ /**
1153
+ * @see https://dom.spec.whatwg.org/#concept-document-type
1154
+ * @see {@link DOMImplementation}
1155
+ */
1156
+ readonly type: 'html' | 'xml';
1157
+ /**
1158
+ * The implementation that created this document.
1159
+ *
1160
+ * @readonly
1161
+ */
1162
+ readonly implementation: DOMImplementation;
1163
+ readonly ownerDocument: Document;
1164
+ readonly nodeName: '#document';
1165
+ readonly nodeType: typeof Node.DOCUMENT_NODE;
1166
+ readonly doctype: DocumentType | null;
1167
+ /**
1168
+ * Gets a reference to the root node of the document.
1169
+ *
1170
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/documentElement)
1171
+ */
1172
+ readonly documentElement: Element | null;
1173
+
1174
+ /**
1175
+ * Returns a live collection of the direct child elements of this document.
1176
+ *
1177
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/children)
1178
+ *
1179
+ * @see https://dom.spec.whatwg.org/#dom-parentnode-children
1180
+ */
1181
+ readonly children: LiveNodeList<Element>;
1182
+
1183
+ /**
1184
+ * Creates an attribute object with a specified name.
1185
+ *
1186
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createAttribute)
1187
+ */
1188
+ createAttribute(localName: string): Attr;
1189
+
1190
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createAttributeNS) */
1191
+ createAttributeNS(namespace: string | null, qualifiedName: string): Attr;
1192
+
1193
+ /**
1194
+ * Returns a new CDATASection node whose data is `data`.
1195
+ *
1196
+ * __This implementation differs from the specification:__ - calling this method on an HTML
1197
+ * document does not throw `NotSupportedError`.
1198
+ *
1199
+ * @throws {DOMException}
1200
+ * With code `INVALID_CHARACTER_ERR` if `data` contains `"]]>"`.
1201
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createCDATASection
1202
+ * @see https://dom.spec.whatwg.org/#dom-document-createcdatasection
1203
+ */
1204
+ createCDATASection(data: string): CDATASection;
1205
+
1206
+ /**
1207
+ * Creates a comment object with the specified data.
1208
+ *
1209
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createComment)
1210
+ */
1211
+ createComment(data: string): Comment;
1212
+
1213
+ /**
1214
+ * Creates a new document.
1215
+ *
1216
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createDocumentFragment)
1217
+ */
1218
+ createDocumentFragment(): DocumentFragment;
1219
+
1220
+ createElement(tagName: string): Element;
1221
+
1222
+ /**
1223
+ * Returns an element with namespace namespace. Its namespace prefix will be everything before
1224
+ * ":" (U+003E) in qualifiedName or null. Its local name will be everything after ":" (U+003E)
1225
+ * in qualifiedName or qualifiedName.
1226
+ *
1227
+ * If localName does not match the Name production an "InvalidCharacterError" DOMException will
1228
+ * be thrown.
1229
+ *
1230
+ * If one of the following conditions is true a "NamespaceError" DOMException will be thrown:
1231
+ *
1232
+ * localName does not match the QName production.
1233
+ * Namespace prefix is not null and namespace is the empty string.
1234
+ * Namespace prefix is "xml" and namespace is not the XML namespace.
1235
+ * qualifiedName or namespace prefix is "xmlns" and namespace is not the XMLNS namespace.
1236
+ * namespace is the XMLNS namespace and neither qualifiedName nor namespace prefix is "xmlns".
1237
+ *
1238
+ * When supplied, options's is can be used to create a customized built-in element.
1239
+ *
1240
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createElementNS)
1241
+ */
1242
+ createElementNS(namespace: string | null, qualifiedName: string): Element;
1243
+ /**
1244
+ * Creates an EntityReference object.
1245
+ * The current implementation does not fill the `childNodes` with those of the corresponding
1246
+ * `Entity`
1247
+ *
1248
+ * The name of the entity to reference. No namespace well-formedness checks are performed.
1249
+ *
1250
+ * @deprecated
1251
+ * In DOM Level 4.
1252
+ * @returns {EntityReference}
1253
+ * @throws {DOMException}
1254
+ * With code `INVALID_CHARACTER_ERR` when `name` is not valid.
1255
+ * @throws {DOMException}
1256
+ * with code `NOT_SUPPORTED_ERR` when the document is of type `html`
1257
+ * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-392B75AE
1258
+ */
1259
+ createEntityReference(name: string): EntityReference;
1260
+
1261
+ /**
1262
+ * Returns a ProcessingInstruction node whose target is target and data is data. If target does
1263
+ * not match the Name production an "InvalidCharacterError" DOMException will be thrown. If
1264
+ * data contains "?>" an "InvalidCharacterError" DOMException will be thrown.
1265
+ *
1266
+ * [MDN
1267
+ * Reference](https://developer.mozilla.org/docs/Web/API/Document/createProcessingInstruction)
1268
+ */
1269
+ createProcessingInstruction(
1270
+ target: string,
1271
+ data: string
1272
+ ): ProcessingInstruction;
1273
+
1274
+ /**
1275
+ * Creates a text string from the specified value.
1276
+ *
1277
+ * @param data
1278
+ * String that specifies the nodeValue property of the text node.
1279
+ *
1280
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createTextNode)
1281
+ */
1282
+ createTextNode(data: string): Text;
1283
+
1284
+ /**
1285
+ * Returns a reference to the first object with the specified value of the ID attribute.
1286
+ */
1287
+ getElementById(elementId: string): Element | null;
1288
+
1289
+ /**
1290
+ * Returns a LiveNodeList of all child elements which have **all** of the given class
1291
+ * name(s).
1292
+ *
1293
+ * Returns an empty list if `classNames` is an empty string or only contains HTML white space
1294
+ * characters.
1295
+ *
1296
+ * Warning: This returns a live LiveNodeList.
1297
+ * Changes in the DOM will reflect in the array as the changes occur.
1298
+ * If an element selected by this array no longer qualifies for the selector,
1299
+ * it will automatically be removed. Be aware of this for iteration purposes.
1300
+ *
1301
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName
1302
+ * @see https://dom.spec.whatwg.org/#concept-getelementsbyclassname
1303
+ */
1304
+ getElementsByClassName(classNames: string): LiveNodeList<Element>;
1305
+
1306
+ /**
1307
+ * Returns a LiveNodeList of elements with the given qualifiedName.
1308
+ * Searching for all descendants can be done by passing `*` as `qualifiedName`.
1309
+ *
1310
+ * The complete document is searched, including the root node.
1311
+ * The returned list is live, which means it updates itself with the DOM tree automatically.
1312
+ * Therefore, there is no need to call `Element.getElementsByTagName()`
1313
+ * with the same element and arguments repeatedly if the DOM changes in between calls.
1314
+ *
1315
+ * When called on an HTML element in an HTML document,
1316
+ * `getElementsByTagName` lower-cases the argument before searching for it.
1317
+ * This is undesirable when trying to match camel-cased SVG elements (such as
1318
+ * `<linearGradient>`) in an HTML document.
1319
+ * Instead, use `Element.getElementsByTagNameNS()`,
1320
+ * which preserves the capitalization of the tag name.
1321
+ *
1322
+ * `Element.getElementsByTagName` is similar to `Document.getElementsByTagName()`,
1323
+ * except that it only searches for elements that are descendants of the specified element.
1324
+ *
1325
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByTagName
1326
+ * @see https://dom.spec.whatwg.org/#concept-getelementsbytagname
1327
+ */
1328
+ getElementsByTagName(qualifiedName: string): LiveNodeList<Element>;
1329
+
1330
+ /**
1331
+ * Returns a `LiveNodeList` of elements with the given tag name belonging to the given
1332
+ * namespace. The complete document is searched, including the root node.
1333
+ *
1334
+ * The returned list is live, which means it updates itself with the DOM tree automatically.
1335
+ * Therefore, there is no need to call `Element.getElementsByTagName()`
1336
+ * with the same element and arguments repeatedly if the DOM changes in between calls.
1337
+ *
1338
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS)
1339
+ * */
1340
+ getElementsByTagNameNS(
1341
+ namespaceURI: string | null,
1342
+ localName: string
1343
+ ): LiveNodeList<Element>;
1344
+ /**
1345
+ * Returns a copy of node. If deep is true, the copy also includes the node's descendants.
1346
+ *
1347
+ * If node is a document or a shadow root, throws a "NotSupportedError" DOMException.
1348
+ *
1349
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/importNode)
1350
+ */
1351
+ importNode<T extends Node>(node: T, deep?: boolean): T;
1352
+ }
1353
+
1354
+ var Document: InstanceOf<Document>;
1355
+
1356
+ /**
1357
+ * A Node containing a doctype.
1358
+ *
1359
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DocumentType)
1360
+ */
1361
+ interface DocumentType extends Node {
1362
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DocumentType/name) */
1363
+ readonly name: string;
1364
+ readonly internalSubset: string;
1365
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DocumentType/publicId) */
1366
+ readonly publicId: string;
1367
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DocumentType/systemId) */
1368
+ readonly systemId: string;
1369
+ }
1370
+
1371
+ var DocumentType: InstanceOf<DocumentFragment>;
1372
+
1373
+ class DOMImplementation {
1374
+ /**
1375
+ * The DOMImplementation interface represents an object providing methods which are not
1376
+ * dependent on any particular document.
1377
+ * Such an object is returned by the `Document.implementation` property.
1378
+ *
1379
+ * __The individual methods describe the differences compared to the specs.__.
1380
+ *
1381
+ * @class
1382
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation MDN
1383
+ * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490 DOM Level 1
1384
+ * Core (Initial)
1385
+ * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490 DOM Level 2 Core
1386
+ * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-102161490 DOM Level 3 Core
1387
+ * @see https://dom.spec.whatwg.org/#domimplementation DOM Living Standard
1388
+ */
1389
+ constructor();
1390
+
1391
+ /**
1392
+ * Creates an XML Document object of the specified type with its document element.
1393
+ *
1394
+ * __It behaves slightly different from the description in the living standard__:
1395
+ * - There is no interface/class `XMLDocument`, it returns a `Document` instance (with it's
1396
+ * `type` set to `'xml'`).
1397
+ * - `encoding`, `mode`, `origin`, `url` fields are currently not declared.
1398
+ *
1399
+ * @returns {Document}
1400
+ * The XML document.
1401
+ * @see {@link DOMImplementation.createHTMLDocument}
1402
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocument MDN
1403
+ * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocument DOM
1404
+ * Level 2 Core (initial)
1405
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument DOM Level 2 Core
1406
+ */
1407
+ createDocument(
1408
+ namespaceURI: NAMESPACE | string | null,
1409
+ qualifiedName: string,
1410
+ doctype?: DocumentType | null
1411
+ ): Document;
1412
+
1413
+ /**
1414
+ * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.
1415
+ *
1416
+ * __This behavior is slightly different from the in the specs__:
1417
+ * - `encoding`, `mode`, `origin`, `url` fields are currently not declared.
1418
+ *
1419
+ * @returns {DocumentType}
1420
+ * which can either be used with `DOMImplementation.createDocument`
1421
+ * upon document creation or can be put into the document via methods like
1422
+ * `Node.insertBefore()` or `Node.replaceChild()`
1423
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocumentType
1424
+ * MDN
1425
+ * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocType DOM
1426
+ * Level 2 Core
1427
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype DOM Living
1428
+ * Standard
1429
+ */
1430
+ createDocumentType(
1431
+ qualifiedName: string,
1432
+ publicId?: string,
1433
+ systemId?: string
1434
+ ): DocumentType;
1435
+
1436
+ /**
1437
+ * Returns an HTML document, that might already have a basic DOM structure.
1438
+ *
1439
+ * __It behaves slightly different from the description in the living standard__:
1440
+ * - If the first argument is `false` no initial nodes are added (steps 3-7 in the specs are
1441
+ * omitted)
1442
+ * - several properties and methods are missing - Nothing related to events is implemented.
1443
+ *
1444
+ * @see {@link DOMImplementation.createDocument}
1445
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument
1446
+ * @see https://dom.spec.whatwg.org/#html-document
1447
+ */
1448
+ createHTMLDocument(title?: string | false): Document;
1449
+
1450
+ /**
1451
+ * The DOMImplementation.hasFeature() method returns a Boolean flag indicating if a given
1452
+ * feature is supported. The different implementations fairly diverged in what kind of
1453
+ * features were reported. The latest version of the spec settled to force this method to
1454
+ * always return true, where the functionality was accurate and in use.
1455
+ *
1456
+ * @deprecated
1457
+ * It is deprecated and modern browsers return true in all cases.
1458
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/hasFeature MDN
1459
+ * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-5CED94D7 DOM Level 1
1460
+ * Core
1461
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature DOM Living Standard
1462
+ */
1463
+ hasFeature(feature: string, version?: string): true;
1464
+ }
1465
+
1466
+ class XMLSerializer {
1467
+ /**
1468
+ * Returns the result of serializing `node` to XML.
1469
+ *
1470
+ * __This implementation differs from the specification:__ - CDATASection nodes whose data
1471
+ * contains `]]>` are serialized by splitting the section at each `]]>` occurrence (following
1472
+ * W3C DOM Level 3 Core `split-cdata-sections`
1473
+ * default behaviour). A configurable option is not yet implemented.
1474
+ *
1475
+ * @see https://html.spec.whatwg.org/#dom-xmlserializer-serializetostring
1476
+ */
1477
+ serializeToString(node: Node, nodeFilter?: (node: Node) => boolean): string;
1478
+ }
1479
+ // END ./lib/dom.js
1480
+
1481
+ // START ./lib/dom-parser.js
1482
+ /**
1483
+ * The DOMParser interface provides the ability to parse XML or HTML source code from a string
1484
+ * into a DOM `Document`.
1485
+ *
1486
+ * _xmldom is different from the spec in that it allows an `options` parameter,
1487
+ * to control the behavior._.
1488
+ *
1489
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser
1490
+ * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsing-and-serialization
1491
+ */
1492
+ class DOMParser {
1493
+ /**
1494
+ * The DOMParser interface provides the ability to parse XML or HTML source code from a
1495
+ * string into a DOM `Document`.
1496
+ *
1497
+ * _xmldom is different from the spec in that it allows an `options` parameter,
1498
+ * to control the behavior._.
1499
+ *
1500
+ * @class
1501
+ * @param {DOMParserOptions} [options]
1502
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser
1503
+ * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsing-and-serialization
1504
+ */
1505
+ constructor(options?: DOMParserOptions);
1506
+
1507
+ /**
1508
+ * Parses `source` using the options in the way configured by the `DOMParserOptions` of
1509
+ * `this`
1510
+ * `DOMParser`. If `mimeType` is `text/html` an HTML `Document` is created, otherwise an XML
1511
+ * `Document` is created.
1512
+ *
1513
+ * __It behaves different from the description in the living standard__:
1514
+ * - Uses the `options` passed to the `DOMParser` constructor to modify the behavior.
1515
+ * - Any unexpected input is reported to `onError` with either a `warning`, `error` or
1516
+ * `fatalError` level.
1517
+ * - Any `fatalError` throws a `ParseError` which prevents further processing.
1518
+ * - Any error thrown by `onError` is converted to a `ParseError` which prevents further
1519
+ * processing - If no `Document` was created during parsing it is reported as a `fatalError`.
1520
+ *
1521
+ * @returns
1522
+ * The `Document` node.
1523
+ * @throws {ParseError}
1524
+ * for any `fatalError` or anything that is thrown by `onError`
1525
+ * @throws {TypeError}
1526
+ * for any invalid `mimeType`
1527
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString
1528
+ * @see https://html.spec.whatwg.org/#dom-domparser-parsefromstring-dev
1529
+ */
1530
+ parseFromString(source: string, mimeType: MIME_TYPE | string): Document;
1531
+ }
1532
+
1533
+ interface DOMParserOptions {
1534
+ /**
1535
+ * The method to use instead of `Object.assign` (defaults to `conventions.assign`),
1536
+ * which is used to copy values from the options before they are used for parsing.
1537
+ *
1538
+ * @private
1539
+ * @see {@link assign}
1540
+ */
1541
+ readonly assign?: typeof Object.assign;
1542
+ /**
1543
+ * For internal testing: The class for creating an instance for handling events from the SAX
1544
+ * parser.
1545
+ * *****Warning: By configuring a faulty implementation,
1546
+ * the specified behavior can completely be broken*****.
1547
+ *
1548
+ * @private
1549
+ */
1550
+ readonly domHandler?: unknown;
1551
+
1552
+ /**
1553
+ * DEPRECATED: Use `onError` instead!
1554
+ *
1555
+ * For backwards compatibility:
1556
+ * If it is a function, it will be used as a value for `onError`,
1557
+ * but it receives different argument types than before 0.9.0.
1558
+ *
1559
+ * @deprecated
1560
+ * @throws {TypeError}
1561
+ * If it is an object.
1562
+ */
1563
+ readonly errorHandler?: ErrorHandlerFunction;
1564
+
1565
+ /**
1566
+ * Configures if the nodes created during parsing
1567
+ * will have a `lineNumber` and a `columnNumber` attribute
1568
+ * describing their location in the XML string.
1569
+ * Default is true.
1570
+ */
1571
+ readonly locator?: boolean;
1572
+
1573
+ /**
1574
+ * used to replace line endings before parsing, defaults to exported `normalizeLineEndings`,
1575
+ * which normalizes line endings according to <https://www.w3.org/TR/xml11/#sec-line-ends>,
1576
+ * including some Unicode "newline" characters.
1577
+ *
1578
+ * @see {@link normalizeLineEndings}
1579
+ */
1580
+ readonly normalizeLineEndings?: (source: string) => string;
1581
+ /**
1582
+ * A function invoked for every error that occurs during parsing.
1583
+ *
1584
+ * If it is not provided, all errors are reported to `console.error`
1585
+ * and only `fatalError`s are thrown as a `ParseError`,
1586
+ * which prevents any further processing.
1587
+ * If the provided method throws, a `ParserError` is thrown,
1588
+ * which prevents any further processing.
1589
+ *
1590
+ * Be aware that many `warning`s are considered an error that prevents further processing in
1591
+ * most implementations.
1592
+ *
1593
+ * @param level
1594
+ * The error level as reported by the SAXParser.
1595
+ * @param message
1596
+ * The error message.
1597
+ * @param context
1598
+ * The DOMHandler instance used for parsing.
1599
+ * @see {@link onErrorStopParsing}
1600
+ * @see {@link onWarningStopParsing}
1601
+ */
1602
+ readonly onError?: ErrorHandlerFunction;
1603
+
1604
+ /**
1605
+ * The XML namespaces that should be assumed when parsing.
1606
+ * The default namespace can be provided by the key that is the empty string.
1607
+ * When the `mimeType` for HTML, XHTML or SVG are passed to `parseFromString`,
1608
+ * the default namespace that will be used,
1609
+ * will be overridden according to the specification.
1610
+ */
1611
+ readonly xmlns?: Readonly<Record<string, string | null | undefined>>;
1612
+ }
1613
+
1614
+ interface ErrorHandlerFunction {
1615
+ (
1616
+ level: 'warning' | 'error' | 'fatalError',
1617
+ msg: string,
1618
+ context: any
1619
+ ): void;
1620
+ }
1621
+
1622
+ /**
1623
+ * Normalizes line ending according to <https://www.w3.org/TR/xml11/#sec-line-ends>,
1624
+ * including some Unicode "newline" characters:
1625
+ *
1626
+ * > XML parsed entities are often stored in computer files which,
1627
+ * > for editing convenience, are organized into lines.
1628
+ * > These lines are typically separated by some combination
1629
+ * > of the characters CARRIAGE RETURN (#xD) and LINE FEED (#xA).
1630
+ * >
1631
+ * > To simplify the tasks of applications, the XML processor must behave
1632
+ * > as if it normalized all line breaks in external parsed entities (including the document entity)
1633
+ * > on input, before parsing, by translating the following to a single #xA character:
1634
+ * >
1635
+ * > 1. the two-character sequence #xD #xA,
1636
+ * > 2. the two-character sequence #xD #x85,
1637
+ * > 3. the single character #x85,
1638
+ * > 4. the single character #x2028,
1639
+ * > 5. the single character #x2029,
1640
+ * > 6. any #xD character that is not immediately followed by #xA or #x85.
1641
+ *
1642
+ * @prettierignore
1643
+ */
1644
+ function normalizeLineEndings(input: string): string;
1645
+ /**
1646
+ * A method that prevents any further parsing when an `error`
1647
+ * with level `error` is reported during parsing.
1648
+ *
1649
+ * @see {@link DOMParserOptions.onError}
1650
+ * @see {@link onWarningStopParsing}
1651
+ */
1652
+ function onErrorStopParsing(): void | never;
1653
+
1654
+ /**
1655
+ * A method that prevents any further parsing when an `error`
1656
+ * with any level is reported during parsing.
1657
+ *
1658
+ * @see {@link DOMParserOptions.onError}
1659
+ * @see {@link onErrorStopParsing}
1660
+ */
1661
+ function onWarningStopParsing(): never;
1662
+
1663
+ // END ./lib/dom-parser.js
1664
+ }