@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.
- package/lib/index.d.ts +11 -1
- package/lib/ml-core.d.ts +22 -11
- package/lib/ml-dom/helper/create-node.d.ts +4 -1
- package/lib/ml-dom/helper/getIndent.d.ts +7 -7
- package/lib/ml-dom/helper/walkers.d.ts +11 -3
- package/lib/ml-dom/helper/walkers.js +19 -15
- package/lib/ml-dom/manipulations/child-node-methods.d.ts +18 -5
- package/lib/ml-dom/manipulations/get-children.d.ts +3 -1
- package/lib/ml-dom/node/attr.d.ts +89 -89
- package/lib/ml-dom/node/block.d.ts +30 -30
- package/lib/ml-dom/node/character-data.d.ts +59 -52
- package/lib/ml-dom/node/child-node.d.ts +6 -1
- package/lib/ml-dom/node/comment.d.ts +15 -12
- package/lib/ml-dom/node/document-fragment.d.ts +22 -19
- package/lib/ml-dom/node/document-type.d.ts +34 -31
- package/lib/ml-dom/node/document.d.ts +1596 -1582
- package/lib/ml-dom/node/dom-token-list.d.ts +26 -26
- package/lib/ml-dom/node/element.d.ts +1894 -1888
- package/lib/ml-dom/node/named-node-map.d.ts +44 -39
- package/lib/ml-dom/node/node-list.d.ts +9 -3
- package/lib/ml-dom/node/node-store.d.ts +3 -3
- package/lib/ml-dom/node/node.d.ts +491 -471
- package/lib/ml-dom/node/parent-node.d.ts +66 -57
- package/lib/ml-dom/node/rule-mapper.d.ts +7 -7
- package/lib/ml-dom/node/text.d.ts +49 -46
- package/lib/ml-dom/node/types.d.ts +66 -10
- package/lib/ml-dom/node/unexpected-call-error.d.ts +1 -2
- package/lib/ml-dom/token/token.d.ts +44 -44
- package/lib/ml-rule/create-test-rule.d.ts +5 -3
- package/lib/ml-rule/ml-rule-context.d.ts +55 -47
- package/lib/ml-rule/ml-rule.d.ts +24 -22
- package/lib/ml-rule/types.d.ts +18 -12
- package/lib/plugin/types.d.ts +5 -5
- package/lib/ruleset/index.d.ts +4 -4
- package/lib/test/index.d.ts +19 -7
- package/lib/types.d.ts +7 -7
- package/lib/utils/get-location-from-chars.d.ts +9 -4
- package/package.json +15 -10
- package/lib/ml-dom/node/pretender.d.ts +0 -5
- 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<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
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
|
}
|