@markuplint/ml-core 3.2.0 → 3.3.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 (40) hide show
  1. package/lib/index.d.ts +11 -1
  2. package/lib/ml-core.d.ts +22 -11
  3. package/lib/ml-dom/helper/create-node.d.ts +4 -1
  4. package/lib/ml-dom/helper/getIndent.d.ts +7 -7
  5. package/lib/ml-dom/helper/walkers.d.ts +11 -3
  6. package/lib/ml-dom/helper/walkers.js +19 -15
  7. package/lib/ml-dom/manipulations/child-node-methods.d.ts +18 -5
  8. package/lib/ml-dom/manipulations/get-children.d.ts +3 -1
  9. package/lib/ml-dom/node/attr.d.ts +89 -89
  10. package/lib/ml-dom/node/block.d.ts +30 -30
  11. package/lib/ml-dom/node/character-data.d.ts +59 -52
  12. package/lib/ml-dom/node/child-node.d.ts +6 -1
  13. package/lib/ml-dom/node/comment.d.ts +15 -12
  14. package/lib/ml-dom/node/document-fragment.d.ts +22 -19
  15. package/lib/ml-dom/node/document-type.d.ts +34 -31
  16. package/lib/ml-dom/node/document.d.ts +1596 -1582
  17. package/lib/ml-dom/node/dom-token-list.d.ts +26 -26
  18. package/lib/ml-dom/node/element.d.ts +1894 -1888
  19. package/lib/ml-dom/node/named-node-map.d.ts +44 -39
  20. package/lib/ml-dom/node/node-list.d.ts +9 -3
  21. package/lib/ml-dom/node/node-store.d.ts +3 -3
  22. package/lib/ml-dom/node/node.d.ts +491 -471
  23. package/lib/ml-dom/node/parent-node.d.ts +66 -57
  24. package/lib/ml-dom/node/rule-mapper.d.ts +7 -7
  25. package/lib/ml-dom/node/text.d.ts +49 -46
  26. package/lib/ml-dom/node/types.d.ts +66 -10
  27. package/lib/ml-dom/node/unexpected-call-error.d.ts +1 -2
  28. package/lib/ml-dom/token/token.d.ts +44 -44
  29. package/lib/ml-rule/create-test-rule.d.ts +5 -3
  30. package/lib/ml-rule/ml-rule-context.d.ts +55 -47
  31. package/lib/ml-rule/ml-rule.d.ts +24 -22
  32. package/lib/ml-rule/types.d.ts +18 -12
  33. package/lib/plugin/types.d.ts +5 -5
  34. package/lib/ruleset/index.d.ts +4 -4
  35. package/lib/test/index.d.ts +19 -7
  36. package/lib/types.d.ts +7 -7
  37. package/lib/utils/get-location-from-chars.d.ts +9 -4
  38. package/package.json +15 -10
  39. package/lib/ml-dom/node/pretender.d.ts +0 -5
  40. package/lib/ml-dom/node/pretender.js +0 -11
@@ -8,475 +8,495 @@ import type { MarkuplintPreprocessorBlockType, NodeType, NodeTypeOf } from './ty
8
8
  import type { MLASTAbstractNode } from '@markuplint/ml-ast';
9
9
  import type { AnyRule, RuleConfigValue } from '@markuplint/ml-config';
10
10
  import { MLToken } from '../token/token';
11
- export declare abstract class MLNode<T extends RuleConfigValue, O = null, A extends MLASTAbstractNode = MLASTAbstractNode> extends MLToken<A> implements Node {
12
- #private;
13
- /**
14
- * @implements DOM API: `Node`
15
- * @see https://dom.spec.whatwg.org/#interface-node
16
- */
17
- readonly ATTRIBUTE_NODE = 2;
18
- /**
19
- * @implements DOM API: `Node`
20
- * @see https://dom.spec.whatwg.org/#interface-node
21
- */
22
- readonly CDATA_SECTION_NODE = 4;
23
- /**
24
- * @implements DOM API: `Node`
25
- * @see https://dom.spec.whatwg.org/#interface-node
26
- */
27
- readonly COMMENT_NODE = 8;
28
- /**
29
- * @implements DOM API: `Node`
30
- * @see https://dom.spec.whatwg.org/#interface-node
31
- */
32
- readonly DOCUMENT_FRAGMENT_NODE = 11;
33
- /**
34
- * @implements DOM API: `Node`
35
- * @see https://dom.spec.whatwg.org/#interface-node
36
- */
37
- readonly DOCUMENT_NODE = 9;
38
- /**
39
- * @implements DOM API: `Node`
40
- * @see https://dom.spec.whatwg.org/#dom-node-document_position_contained_by
41
- */
42
- readonly DOCUMENT_POSITION_CONTAINED_BY = 16;
43
- /**
44
- * @implements DOM API: `Node`
45
- * @see https://dom.spec.whatwg.org/#dom-node-document_position_contains
46
- */
47
- readonly DOCUMENT_POSITION_CONTAINS = 8;
48
- /**
49
- * @implements DOM API: `Node`
50
- * @see https://dom.spec.whatwg.org/#dom-node-document_position_disconnected
51
- */
52
- readonly DOCUMENT_POSITION_DISCONNECTED = 1;
53
- /**
54
- * @implements DOM API: `Node`
55
- * @see https://dom.spec.whatwg.org/#dom-node-document_position_following
56
- */
57
- readonly DOCUMENT_POSITION_FOLLOWING = 4;
58
- /**
59
- * @implements DOM API: `Node`
60
- * @see https://dom.spec.whatwg.org/#dom-node-document_position_implementation_specific
61
- */
62
- readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32;
63
- /**
64
- * @implements DOM API: `Node`
65
- * @see https://dom.spec.whatwg.org/#dom-node-document_position_preceding
66
- */
67
- readonly DOCUMENT_POSITION_PRECEDING = 2;
68
- /**
69
- * @implements DOM API: `Node`
70
- * @see https://dom.spec.whatwg.org/#interface-node
71
- */
72
- readonly DOCUMENT_TYPE_NODE = 10;
73
- /**
74
- * @implements DOM API: `Node`
75
- * @see https://dom.spec.whatwg.org/#interface-node
76
- */
77
- readonly ELEMENT_NODE = 1;
78
- /**
79
- * @deprecated
80
- * @implements DOM API: `Node`
81
- * @see https://dom.spec.whatwg.org/#interface-node
82
- */
83
- readonly ENTITY_NODE = 6;
84
- /**
85
- * @deprecated
86
- * @implements DOM API: `Node`
87
- * @see https://dom.spec.whatwg.org/#interface-node
88
- */
89
- readonly ENTITY_REFERENCE_NODE = 5;
90
- /**
91
- * @implements `@markuplint/ml-core` API: `MLNode`
92
- */
93
- readonly MARKUPLINT_PREPROCESSOR_BLOCK: MarkuplintPreprocessorBlockType;
94
- /**
95
- * @deprecated
96
- * @implements DOM API: `Node`
97
- * @see https://dom.spec.whatwg.org/#interface-node
98
- */
99
- readonly NOTATION_NODE = 12;
100
- /**
101
- * @implements DOM API: `Node`
102
- * @see https://dom.spec.whatwg.org/#interface-node
103
- */
104
- readonly PROCESSING_INSTRUCTION_NODE = 7;
105
- /**
106
- * @implements DOM API: `Node`
107
- * @see https://dom.spec.whatwg.org/#interface-node
108
- */
109
- readonly TEXT_NODE = 3;
110
- /**
111
- *
112
- */
113
- readonly rules: Record<string, AnyRule>;
114
- protected _astToken: A;
115
- constructor(astNode: A, document: MLDocument<T, O>);
116
- /**
117
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
118
- *
119
- * @unsupported
120
- * @implements DOM API: `Node`
121
- * @see https://dom.spec.whatwg.org/#ref-for-dom-node-baseuri%E2%91%A0
122
- */
123
- get baseURI(): string;
124
- /**
125
- * The list of child nodes that contains `Element`, `Text`, and `Comment`.
126
- *
127
- * @readonly
128
- * @implements DOM API: `Node`
129
- * @see https://dom.spec.whatwg.org/#ref-for-dom-node-childnodes%E2%91%A0
130
- */
131
- get childNodes(): NodeListOf<MLChildNode<T, O>>;
132
- /**
133
- * The first node that may be `Element`, `Text`, and `CommentNode`.
134
- *
135
- * @readonly
136
- * @implements DOM API: `Node`
137
- * @see https://dom.spec.whatwg.org/#ref-for-dom-node-firstchild%E2%91%A0
138
- */
139
- get firstChild(): MLChildNode<T, O>;
140
- /**
141
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
142
- *
143
- * @unsupported
144
- * @implements DOM API: `Node`
145
- * @see https://dom.spec.whatwg.org/#ref-for-dom-node-isconnected%E2%91%A0
146
- */
147
- get isConnected(): boolean;
148
- /**
149
- * The last node that may be `Element`, `Text`, and `CommentNode`.
150
- *
151
- * @readonly
152
- * @implements DOM API: `Node`
153
- * @see https://dom.spec.whatwg.org/#ref-for-dom-node-lastchild%E2%91%A0
154
- */
155
- get lastChild(): MLChildNode<T, O>;
156
- /**
157
- * @implements `@markuplint/ml-core` API: `MLNode`
158
- */
159
- get nextNode(): MLNode<T, O> | null;
160
- /**
161
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
162
- *
163
- * @unsupported
164
- * @implements DOM API: `Node`
165
- * @see https://dom.spec.whatwg.org/#ref-for-dom-node-nextsibling%E2%91%A0
166
- */
167
- get nextSibling(): ChildNode | null;
168
- /**
169
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
170
- *
171
- * It must not call from the instance of the `MLNode` class.
172
- *
173
- * @implements DOM API: `Node`
174
- * @see https://dom.spec.whatwg.org/#ref-for-dom-node-nodename%E2%91%A0
175
- */
176
- get nodeName(): string;
177
- /**
178
- * @implements DOM API: `Node`
179
- * @see https://dom.spec.whatwg.org/#ref-for-dom-node-nodetype%E2%91%A0
180
- */
181
- get nodeType(): NodeType | -1;
182
- /**
183
- * The nodeValue getter steps are to return the following, switching on the interface this implements:
184
- *
185
- * - `Attr`: this’s value.
186
- * - `CharacterData`: this’s data.
187
- * - _Otherwise_: Null.
188
- *
189
- * @implements DOM API: `Node`
190
- * @see https://dom.spec.whatwg.org/#dom-node-nodevalue
191
- */
192
- get nodeValue(): string | null;
193
- /**
194
- * The `Document` that this node belongs to.
195
- *
196
- * @deprecated
197
- * @implements DOM API: `Node`
198
- * @see https://dom.spec.whatwg.org/#ref-for-dom-node-ownerdocument%E2%91%A0
199
- */
200
- get ownerDocument(): any;
201
- get ownerMLDocument(): MLDocument<T, O>;
202
- /**
203
- * The parent element.
204
- *
205
- * @implements DOM API: `Node`
206
- * @see https://dom.spec.whatwg.org/#ref-for-dom-node-parentelement%E2%91%A0
207
- */
208
- get parentElement(): MLElement<T, O> | null;
209
- /**
210
- * The parent node that may be `Element`, `Document`, `DocumentFragment`, and `null`.
211
- *
212
- * ## HTML:
213
- *
214
- * ```html
215
- * <html> // => #document
216
- * <body></body> // => <html>
217
- * </html>
218
- * ```
219
- *
220
- * ---
221
- *
222
- * ```html
223
- * <div> // => null
224
- * <span></span> // => <div>
225
- * </div>
226
- * ```
227
- *
228
- * ## JSX:
229
- *
230
- * ```jsx
231
- * <> // => null
232
- * <div> // => #document-fragment
233
- * {items.map(item => {
234
- * return (
235
- * <span /> // => null
236
- * )
237
- * })}
238
- * </div>
239
- * </>
240
- * ```
241
- *
242
- * ## Pug
243
- *
244
- * ```jade
245
- * //- null
246
- * div
247
- * //- <div>
248
- * if foo
249
- * //- null
250
- * span
251
- * ```
252
- *
253
- * @implements DOM API: `Node`
254
- * @see https://dom.spec.whatwg.org/#ref-for-dom-node-parentnode%E2%91%A0
255
- */
256
- get parentNode(): MLDocument<any, any> | MLDocumentFragment<any, any> | MLElement<T, O> | null;
257
- /**
258
- * @implements `@markuplint/ml-core` API: `MLNode`
259
- */
260
- get prevNode(): MLNode<T, O> | null;
261
- /**
262
- * @implements `@markuplint/ml-core` API: `MLNode`
263
- */
264
- get prevToken(): MLNode<T, O> | null;
265
- /**
266
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
267
- *
268
- * @unsupported
269
- * @implements DOM API: `Node`
270
- * @see https://dom.spec.whatwg.org/#ref-for-dom-node-previoussibling%E2%91%A0
271
- */
272
- get previousSibling(): ChildNode | null;
273
- /**
274
- * @implements `@markuplint/ml-core` API: `MLNode`
275
- */
276
- get rule(): RuleInfo<T, O>;
277
- /**
278
- * Returns a syntactical parent node
279
- *
280
- * ## HTML:
281
- *
282
- * ```html
283
- * <html> // => #document
284
- * <body></body> // => <html>
285
- * </html>
286
- * ```
287
- *
288
- * ## JSX:
289
- *
290
- * ```jsx
291
- * <> // => #document
292
- * <div> // => #document-fragment
293
- * {items.map(item => {
294
- * return (
295
- * <span /> // => #ml-block
296
- * )
297
- * })}
298
- * </div>
299
- * </>
300
- * ```
301
- *
302
- * ## Pug
303
- *
304
- * ```jade
305
- * //- #document
306
- * div
307
- * //- <div>
308
- * if foo
309
- * //- #ml-block
310
- * span
311
- * ```
312
- *
313
- * @implements `@markuplint/ml-core` API: `MLNode`
314
- */
315
- get syntacticalParentNode(): MLDocument<any, any> | MLDocumentFragment<any, any> | MLElement<T, O> | MLBlock<T, O> | null;
316
- /**
317
- * Return the text content.
318
- *
319
- * - If the node is a `Comment`, or `Text`, textContent returns, or sets, the text inside the node, i.e., the Node.nodeValue.
320
- * - For other node types, textContent returns the concatenation of the textContent of every child node, excluding comments and processing instructions. (This is an empty string if the node has no children.)
321
- *
322
- * @implements DOM API: `Node`
323
- * @see https://dom.spec.whatwg.org/#dom-node-textcontent
324
- */
325
- get textContent(): string | null;
326
- /**
327
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
328
- *
329
- * @unsupported
330
- * @implements DOM API: `EventTarget`
331
- * @see https://dom.spec.whatwg.org/#ref-for-dom-eventtarget-addeventlistener%E2%91%A2
332
- */
333
- addEventListener(type: string, callback?: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void;
334
- /**
335
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
336
- *
337
- * @unsupported
338
- * @implements DOM API: `Node`
339
- * @see https://dom.spec.whatwg.org/#dom-node-appendchild
340
- */
341
- appendChild<T extends Node>(node: T): T;
342
- /**
343
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
344
- *
345
- * @unsupported
346
- * @implements DOM API: `Node`
347
- * @see https://dom.spec.whatwg.org/#ref-for-dom-node-clonenode%E2%91%A0
348
- */
349
- cloneNode(deep?: boolean): Node;
350
- /**
351
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
352
- *
353
- * @unsupported
354
- * @implements DOM API: `Node`
355
- * @see https://dom.spec.whatwg.org/#ref-for-dom-node-comparedocumentposition%E2%91%A0
356
- */
357
- compareDocumentPosition(other: Node): number;
358
- /**
359
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
360
- *
361
- * @unsupported
362
- * @implements DOM API: `Node`
363
- * @see https://dom.spec.whatwg.org/#ref-for-dom-node-contains%E2%91%A0
364
- */
365
- contains(other: Node | null): boolean;
366
- /**
367
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
368
- *
369
- * @unsupported
370
- * @implements DOM API: `EventTarget`
371
- * @see https://dom.spec.whatwg.org/#ref-for-dom-eventtarget-dispatchevent%E2%91%A2
372
- */
373
- dispatchEvent(event: Event): boolean;
374
- /**
375
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
376
- *
377
- * @unsupported
378
- * @implements DOM API: `Node`
379
- * @see https://dom.spec.whatwg.org/#ref-for-dom-node-getrootnode%E2%91%A0
380
- */
381
- getRootNode(options?: GetRootNodeOptions): MLNode<T, O>;
382
- /**
383
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
384
- *
385
- * @unsupported
386
- * @implements DOM API: `Node`
387
- * @see https://dom.spec.whatwg.org/#ref-for-dom-node-haschildnodes%E2%91%A0
388
- */
389
- hasChildNodes(): boolean;
390
- /**
391
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
392
- *
393
- * @unsupported
394
- * @implements DOM API: `Node`
395
- * @see https://dom.spec.whatwg.org/#dom-node-insertbefore
396
- */
397
- insertBefore<T extends Node>(node: T, child: Node | null): T;
398
- /**
399
- * @implements `@markuplint/ml-core` API: `MLNode`
400
- */
401
- is<NType extends NodeType>(nodeType: NType): this is NodeTypeOf<NType, T, O>;
402
- /**
403
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
404
- *
405
- * @unsupported
406
- * @implements DOM API: `Node`
407
- * @see https://dom.spec.whatwg.org/#dom-node-isdefaultnamespace
408
- */
409
- isDefaultNamespace(namespace: string | null): boolean;
410
- /**
411
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
412
- *
413
- * @unsupported
414
- * @implements DOM API: `Node`
415
- * @see https://dom.spec.whatwg.org/#ref-for-dom-node-isequalnode%E2%91%A0
416
- */
417
- isEqualNode(otherNode: Node | null): boolean;
418
- /**
419
- * @implements `@markuplint/ml-core` API: `MLNode`
420
- */
421
- isInFragmentDocument(): boolean;
422
- /**
423
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
424
- *
425
- * @unsupported
426
- * @implements DOM API: `Node`
427
- * @see https://dom.spec.whatwg.org/#dom-node-issamenode
428
- */
429
- isSameNode(otherNode: Node | null): boolean;
430
- /**
431
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
432
- *
433
- * @unsupported
434
- * @implements DOM API: `Node`
435
- * @see https://dom.spec.whatwg.org/#dom-node-lookupnamespaceuri
436
- */
437
- lookupNamespaceURI(prefix: string | null): string | null;
438
- /**
439
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
440
- *
441
- * @unsupported
442
- * @implements DOM API: `Node`
443
- * @see https://dom.spec.whatwg.org/#dom-node-lookupprefix
444
- */
445
- lookupPrefix(namespace: string | null): string | null;
446
- /**
447
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
448
- *
449
- * @unsupported
450
- * @implements DOM API: `Node`
451
- * @see https://dom.spec.whatwg.org/#ref-for-dom-node-normalize%E2%91%A0
452
- */
453
- normalize(): void;
454
- /**
455
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
456
- *
457
- * @unsupported
458
- * @implements DOM API: `Node`
459
- * @see https://dom.spec.whatwg.org/#dom-node-removechild
460
- */
461
- removeChild<T extends Node>(child: T): T;
462
- /**
463
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
464
- *
465
- * @unsupported
466
- * @implements DOM API: `EventTarget`
467
- * @see https://dom.spec.whatwg.org/#ref-for-dom-eventtarget-removeeventlistener%E2%91%A1
468
- */
469
- removeEventListener(type: string, callback?: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void;
470
- /**
471
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
472
- *
473
- * @unsupported
474
- * @implements DOM API: `Node`
475
- * @see https://dom.spec.whatwg.org/#dom-node-replacechild
476
- */
477
- replaceChild<T extends Node>(node: Node, child: T): T;
478
- /**
479
- * @implements `@markuplint/ml-core` API: `MLNode`
480
- */
481
- resetChildren(childNodes?: NodeListOf<MLChildNode<T, O>>): void;
11
+ export declare abstract class MLNode<
12
+ T extends RuleConfigValue,
13
+ O = null,
14
+ A extends MLASTAbstractNode = MLASTAbstractNode,
15
+ >
16
+ extends MLToken<A>
17
+ implements Node
18
+ {
19
+ #private;
20
+ /**
21
+ * @implements DOM API: `Node`
22
+ * @see https://dom.spec.whatwg.org/#interface-node
23
+ */
24
+ readonly ATTRIBUTE_NODE = 2;
25
+ /**
26
+ * @implements DOM API: `Node`
27
+ * @see https://dom.spec.whatwg.org/#interface-node
28
+ */
29
+ readonly CDATA_SECTION_NODE = 4;
30
+ /**
31
+ * @implements DOM API: `Node`
32
+ * @see https://dom.spec.whatwg.org/#interface-node
33
+ */
34
+ readonly COMMENT_NODE = 8;
35
+ /**
36
+ * @implements DOM API: `Node`
37
+ * @see https://dom.spec.whatwg.org/#interface-node
38
+ */
39
+ readonly DOCUMENT_FRAGMENT_NODE = 11;
40
+ /**
41
+ * @implements DOM API: `Node`
42
+ * @see https://dom.spec.whatwg.org/#interface-node
43
+ */
44
+ readonly DOCUMENT_NODE = 9;
45
+ /**
46
+ * @implements DOM API: `Node`
47
+ * @see https://dom.spec.whatwg.org/#dom-node-document_position_contained_by
48
+ */
49
+ readonly DOCUMENT_POSITION_CONTAINED_BY = 16;
50
+ /**
51
+ * @implements DOM API: `Node`
52
+ * @see https://dom.spec.whatwg.org/#dom-node-document_position_contains
53
+ */
54
+ readonly DOCUMENT_POSITION_CONTAINS = 8;
55
+ /**
56
+ * @implements DOM API: `Node`
57
+ * @see https://dom.spec.whatwg.org/#dom-node-document_position_disconnected
58
+ */
59
+ readonly DOCUMENT_POSITION_DISCONNECTED = 1;
60
+ /**
61
+ * @implements DOM API: `Node`
62
+ * @see https://dom.spec.whatwg.org/#dom-node-document_position_following
63
+ */
64
+ readonly DOCUMENT_POSITION_FOLLOWING = 4;
65
+ /**
66
+ * @implements DOM API: `Node`
67
+ * @see https://dom.spec.whatwg.org/#dom-node-document_position_implementation_specific
68
+ */
69
+ readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32;
70
+ /**
71
+ * @implements DOM API: `Node`
72
+ * @see https://dom.spec.whatwg.org/#dom-node-document_position_preceding
73
+ */
74
+ readonly DOCUMENT_POSITION_PRECEDING = 2;
75
+ /**
76
+ * @implements DOM API: `Node`
77
+ * @see https://dom.spec.whatwg.org/#interface-node
78
+ */
79
+ readonly DOCUMENT_TYPE_NODE = 10;
80
+ /**
81
+ * @implements DOM API: `Node`
82
+ * @see https://dom.spec.whatwg.org/#interface-node
83
+ */
84
+ readonly ELEMENT_NODE = 1;
85
+ /**
86
+ * @deprecated
87
+ * @implements DOM API: `Node`
88
+ * @see https://dom.spec.whatwg.org/#interface-node
89
+ */
90
+ readonly ENTITY_NODE = 6;
91
+ /**
92
+ * @deprecated
93
+ * @implements DOM API: `Node`
94
+ * @see https://dom.spec.whatwg.org/#interface-node
95
+ */
96
+ readonly ENTITY_REFERENCE_NODE = 5;
97
+ /**
98
+ * @implements `@markuplint/ml-core` API: `MLNode`
99
+ */
100
+ readonly MARKUPLINT_PREPROCESSOR_BLOCK: MarkuplintPreprocessorBlockType;
101
+ /**
102
+ * @deprecated
103
+ * @implements DOM API: `Node`
104
+ * @see https://dom.spec.whatwg.org/#interface-node
105
+ */
106
+ readonly NOTATION_NODE = 12;
107
+ /**
108
+ * @implements DOM API: `Node`
109
+ * @see https://dom.spec.whatwg.org/#interface-node
110
+ */
111
+ readonly PROCESSING_INSTRUCTION_NODE = 7;
112
+ /**
113
+ * @implements DOM API: `Node`
114
+ * @see https://dom.spec.whatwg.org/#interface-node
115
+ */
116
+ readonly TEXT_NODE = 3;
117
+ /**
118
+ *
119
+ */
120
+ readonly rules: Record<string, AnyRule>;
121
+ protected _astToken: A;
122
+ constructor(astNode: A, document: MLDocument<T, O>);
123
+ /**
124
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
125
+ *
126
+ * @unsupported
127
+ * @implements DOM API: `Node`
128
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-node-baseuri%E2%91%A0
129
+ */
130
+ get baseURI(): string;
131
+ /**
132
+ * The list of child nodes that contains `Element`, `Text`, and `Comment`.
133
+ *
134
+ * @readonly
135
+ * @implements DOM API: `Node`
136
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-node-childnodes%E2%91%A0
137
+ */
138
+ get childNodes(): NodeListOf<MLChildNode<T, O>>;
139
+ /**
140
+ * The first node that may be `Element`, `Text`, and `CommentNode`.
141
+ *
142
+ * @readonly
143
+ * @implements DOM API: `Node`
144
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-node-firstchild%E2%91%A0
145
+ */
146
+ get firstChild(): MLChildNode<T, O>;
147
+ /**
148
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
149
+ *
150
+ * @unsupported
151
+ * @implements DOM API: `Node`
152
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-node-isconnected%E2%91%A0
153
+ */
154
+ get isConnected(): boolean;
155
+ /**
156
+ * The last node that may be `Element`, `Text`, and `CommentNode`.
157
+ *
158
+ * @readonly
159
+ * @implements DOM API: `Node`
160
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-node-lastchild%E2%91%A0
161
+ */
162
+ get lastChild(): MLChildNode<T, O>;
163
+ /**
164
+ * @implements `@markuplint/ml-core` API: `MLNode`
165
+ */
166
+ get nextNode(): MLNode<T, O> | null;
167
+ /**
168
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
169
+ *
170
+ * @unsupported
171
+ * @implements DOM API: `Node`
172
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-node-nextsibling%E2%91%A0
173
+ */
174
+ get nextSibling(): ChildNode | null;
175
+ /**
176
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
177
+ *
178
+ * It must not call from the instance of the `MLNode` class.
179
+ *
180
+ * @implements DOM API: `Node`
181
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-node-nodename%E2%91%A0
182
+ */
183
+ get nodeName(): string;
184
+ /**
185
+ * @implements DOM API: `Node`
186
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-node-nodetype%E2%91%A0
187
+ */
188
+ get nodeType(): NodeType | -1;
189
+ /**
190
+ * The nodeValue getter steps are to return the following, switching on the interface this implements:
191
+ *
192
+ * - `Attr`: this’s value.
193
+ * - `CharacterData`: this’s data.
194
+ * - _Otherwise_: Null.
195
+ *
196
+ * @implements DOM API: `Node`
197
+ * @see https://dom.spec.whatwg.org/#dom-node-nodevalue
198
+ */
199
+ get nodeValue(): string | null;
200
+ /**
201
+ * The `Document` that this node belongs to.
202
+ *
203
+ * @deprecated
204
+ * @implements DOM API: `Node`
205
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-node-ownerdocument%E2%91%A0
206
+ */
207
+ get ownerDocument(): any;
208
+ get ownerMLDocument(): MLDocument<T, O>;
209
+ /**
210
+ * The parent element.
211
+ *
212
+ * @implements DOM API: `Node`
213
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-node-parentelement%E2%91%A0
214
+ */
215
+ get parentElement(): MLElement<T, O> | null;
216
+ /**
217
+ * The parent node that may be `Element`, `Document`, `DocumentFragment`, and `null`.
218
+ *
219
+ * ## HTML:
220
+ *
221
+ * ```html
222
+ * <html> // => #document
223
+ * <body></body> // => <html>
224
+ * </html>
225
+ * ```
226
+ *
227
+ * ---
228
+ *
229
+ * ```html
230
+ * <div> // => null
231
+ * <span></span> // => <div>
232
+ * </div>
233
+ * ```
234
+ *
235
+ * ## JSX:
236
+ *
237
+ * ```jsx
238
+ * <> // => null
239
+ * <div> // => #document-fragment
240
+ * {items.map(item => {
241
+ * return (
242
+ * <span /> // => null
243
+ * )
244
+ * })}
245
+ * </div>
246
+ * </>
247
+ * ```
248
+ *
249
+ * ## Pug
250
+ *
251
+ * ```jade
252
+ * //- null
253
+ * div
254
+ * //- <div>
255
+ * if foo
256
+ * //- null
257
+ * span
258
+ * ```
259
+ *
260
+ * @implements DOM API: `Node`
261
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-node-parentnode%E2%91%A0
262
+ */
263
+ get parentNode(): MLDocument<any, any> | MLDocumentFragment<any, any> | MLElement<T, O> | null;
264
+ /**
265
+ * @implements `@markuplint/ml-core` API: `MLNode`
266
+ */
267
+ get prevNode(): MLNode<T, O> | null;
268
+ /**
269
+ * @implements `@markuplint/ml-core` API: `MLNode`
270
+ */
271
+ get prevToken(): MLNode<T, O> | null;
272
+ /**
273
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
274
+ *
275
+ * @unsupported
276
+ * @implements DOM API: `Node`
277
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-node-previoussibling%E2%91%A0
278
+ */
279
+ get previousSibling(): ChildNode | null;
280
+ /**
281
+ * @implements `@markuplint/ml-core` API: `MLNode`
282
+ */
283
+ get rule(): RuleInfo<T, O>;
284
+ /**
285
+ * Returns a syntactical parent node
286
+ *
287
+ * ## HTML:
288
+ *
289
+ * ```html
290
+ * <html> // => #document
291
+ * <body></body> // => <html>
292
+ * </html>
293
+ * ```
294
+ *
295
+ * ## JSX:
296
+ *
297
+ * ```jsx
298
+ * <> // => #document
299
+ * <div> // => #document-fragment
300
+ * {items.map(item => {
301
+ * return (
302
+ * <span /> // => #ml-block
303
+ * )
304
+ * })}
305
+ * </div>
306
+ * </>
307
+ * ```
308
+ *
309
+ * ## Pug
310
+ *
311
+ * ```jade
312
+ * //- #document
313
+ * div
314
+ * //- <div>
315
+ * if foo
316
+ * //- #ml-block
317
+ * span
318
+ * ```
319
+ *
320
+ * @implements `@markuplint/ml-core` API: `MLNode`
321
+ */
322
+ get syntacticalParentNode():
323
+ | MLDocument<any, any>
324
+ | MLDocumentFragment<any, any>
325
+ | MLElement<T, O>
326
+ | MLBlock<T, O>
327
+ | null;
328
+ /**
329
+ * Return the text content.
330
+ *
331
+ * - If the node is a `Comment`, or `Text`, textContent returns, or sets, the text inside the node, i.e., the Node.nodeValue.
332
+ * - For other node types, textContent returns the concatenation of the textContent of every child node, excluding comments and processing instructions. (This is an empty string if the node has no children.)
333
+ *
334
+ * @implements DOM API: `Node`
335
+ * @see https://dom.spec.whatwg.org/#dom-node-textcontent
336
+ */
337
+ get textContent(): string | null;
338
+ /**
339
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
340
+ *
341
+ * @unsupported
342
+ * @implements DOM API: `EventTarget`
343
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-eventtarget-addeventlistener%E2%91%A2
344
+ */
345
+ addEventListener(
346
+ type: string,
347
+ callback?: EventListenerOrEventListenerObject | null,
348
+ options?: AddEventListenerOptions | boolean,
349
+ ): void;
350
+ /**
351
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
352
+ *
353
+ * @unsupported
354
+ * @implements DOM API: `Node`
355
+ * @see https://dom.spec.whatwg.org/#dom-node-appendchild
356
+ */
357
+ appendChild<T extends Node>(node: T): T;
358
+ /**
359
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
360
+ *
361
+ * @unsupported
362
+ * @implements DOM API: `Node`
363
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-node-clonenode%E2%91%A0
364
+ */
365
+ cloneNode(deep?: boolean): Node;
366
+ /**
367
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
368
+ *
369
+ * @unsupported
370
+ * @implements DOM API: `Node`
371
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-node-comparedocumentposition%E2%91%A0
372
+ */
373
+ compareDocumentPosition(other: Node): number;
374
+ /**
375
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
376
+ *
377
+ * @unsupported
378
+ * @implements DOM API: `Node`
379
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-node-contains%E2%91%A0
380
+ */
381
+ contains(other: Node | null): boolean;
382
+ /**
383
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
384
+ *
385
+ * @unsupported
386
+ * @implements DOM API: `EventTarget`
387
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-eventtarget-dispatchevent%E2%91%A2
388
+ */
389
+ dispatchEvent(event: Event): boolean;
390
+ /**
391
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
392
+ *
393
+ * @unsupported
394
+ * @implements DOM API: `Node`
395
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-node-getrootnode%E2%91%A0
396
+ */
397
+ getRootNode(options?: GetRootNodeOptions): MLNode<T, O>;
398
+ /**
399
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
400
+ *
401
+ * @unsupported
402
+ * @implements DOM API: `Node`
403
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-node-haschildnodes%E2%91%A0
404
+ */
405
+ hasChildNodes(): boolean;
406
+ /**
407
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
408
+ *
409
+ * @unsupported
410
+ * @implements DOM API: `Node`
411
+ * @see https://dom.spec.whatwg.org/#dom-node-insertbefore
412
+ */
413
+ insertBefore<T extends Node>(node: T, child: Node | null): T;
414
+ /**
415
+ * @implements `@markuplint/ml-core` API: `MLNode`
416
+ */
417
+ is<NType extends NodeType>(nodeType: NType): this is NodeTypeOf<NType, T, O>;
418
+ /**
419
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
420
+ *
421
+ * @unsupported
422
+ * @implements DOM API: `Node`
423
+ * @see https://dom.spec.whatwg.org/#dom-node-isdefaultnamespace
424
+ */
425
+ isDefaultNamespace(namespace: string | null): boolean;
426
+ /**
427
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
428
+ *
429
+ * @unsupported
430
+ * @implements DOM API: `Node`
431
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-node-isequalnode%E2%91%A0
432
+ */
433
+ isEqualNode(otherNode: Node | null): boolean;
434
+ /**
435
+ * @implements `@markuplint/ml-core` API: `MLNode`
436
+ */
437
+ isInFragmentDocument(): boolean;
438
+ /**
439
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
440
+ *
441
+ * @unsupported
442
+ * @implements DOM API: `Node`
443
+ * @see https://dom.spec.whatwg.org/#dom-node-issamenode
444
+ */
445
+ isSameNode(otherNode: Node | null): boolean;
446
+ /**
447
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
448
+ *
449
+ * @unsupported
450
+ * @implements DOM API: `Node`
451
+ * @see https://dom.spec.whatwg.org/#dom-node-lookupnamespaceuri
452
+ */
453
+ lookupNamespaceURI(prefix: string | null): string | null;
454
+ /**
455
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
456
+ *
457
+ * @unsupported
458
+ * @implements DOM API: `Node`
459
+ * @see https://dom.spec.whatwg.org/#dom-node-lookupprefix
460
+ */
461
+ lookupPrefix(namespace: string | null): string | null;
462
+ /**
463
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
464
+ *
465
+ * @unsupported
466
+ * @implements DOM API: `Node`
467
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-node-normalize%E2%91%A0
468
+ */
469
+ normalize(): void;
470
+ /**
471
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
472
+ *
473
+ * @unsupported
474
+ * @implements DOM API: `Node`
475
+ * @see https://dom.spec.whatwg.org/#dom-node-removechild
476
+ */
477
+ removeChild<T extends Node>(child: T): T;
478
+ /**
479
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
480
+ *
481
+ * @unsupported
482
+ * @implements DOM API: `EventTarget`
483
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-eventtarget-removeeventlistener%E2%91%A1
484
+ */
485
+ removeEventListener(
486
+ type: string,
487
+ callback?: EventListenerOrEventListenerObject | null,
488
+ options?: EventListenerOptions | boolean,
489
+ ): void;
490
+ /**
491
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
492
+ *
493
+ * @unsupported
494
+ * @implements DOM API: `Node`
495
+ * @see https://dom.spec.whatwg.org/#dom-node-replacechild
496
+ */
497
+ replaceChild<T extends Node>(node: Node, child: T): T;
498
+ /**
499
+ * @implements `@markuplint/ml-core` API: `MLNode`
500
+ */
501
+ resetChildren(childNodes?: NodeListOf<MLChildNode<T, O>>): void;
482
502
  }