@markuplint/ml-core 2.3.4 → 2.3.5

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 (47) hide show
  1. package/lib/ml-core.d.ts +1 -1
  2. package/lib/ml-dom/manipulations/child-node-methods.d.ts +33 -0
  3. package/lib/ml-dom/manipulations/child-node-methods.js +73 -0
  4. package/lib/ml-dom/manipulations/get-children.d.ts +4 -0
  5. package/lib/ml-dom/manipulations/get-children.js +10 -0
  6. package/lib/ml-dom/node/attr.d.ts +98 -0
  7. package/lib/ml-dom/node/attr.js +157 -0
  8. package/lib/ml-dom/node/block.d.ts +38 -0
  9. package/lib/ml-dom/node/block.js +53 -0
  10. package/lib/ml-dom/node/character-data.d.ts +57 -0
  11. package/lib/ml-dom/node/character-data.js +87 -0
  12. package/lib/ml-dom/node/child-node.d.ts +9 -0
  13. package/lib/ml-dom/node/child-node.js +10 -0
  14. package/lib/ml-dom/node/comment.d.ts +17 -0
  15. package/lib/ml-dom/node/comment.js +24 -0
  16. package/lib/ml-dom/node/document-fragment.d.ts +24 -0
  17. package/lib/ml-dom/node/document-fragment.js +33 -0
  18. package/lib/ml-dom/node/document-type.d.ts +38 -0
  19. package/lib/ml-dom/node/document-type.js +52 -0
  20. package/lib/ml-dom/node/document.d.ts +1599 -0
  21. package/lib/ml-dom/node/document.js +2172 -0
  22. package/lib/ml-dom/node/dom-token-list.d.ts +33 -0
  23. package/lib/ml-dom/node/dom-token-list.js +137 -0
  24. package/lib/ml-dom/node/element.d.ts +1900 -0
  25. package/lib/ml-dom/node/element.js +2683 -0
  26. package/lib/ml-dom/node/named-node-map.d.ts +42 -0
  27. package/lib/ml-dom/node/named-node-map.js +64 -0
  28. package/lib/ml-dom/node/node-list.d.ts +6 -0
  29. package/lib/ml-dom/node/node-list.js +39 -0
  30. package/lib/ml-dom/node/node-store.d.ts +14 -0
  31. package/lib/ml-dom/node/node-store.js +32 -0
  32. package/lib/ml-dom/node/node.d.ts +482 -0
  33. package/lib/ml-dom/node/node.js +675 -0
  34. package/lib/ml-dom/node/parent-node.d.ts +66 -0
  35. package/lib/ml-dom/node/parent-node.js +131 -0
  36. package/lib/ml-dom/node/rule-mapper.d.ts +17 -0
  37. package/lib/ml-dom/node/rule-mapper.js +49 -0
  38. package/lib/ml-dom/node/text.d.ts +51 -0
  39. package/lib/ml-dom/node/text.js +76 -0
  40. package/lib/ml-dom/node/types.d.ts +35 -0
  41. package/lib/ml-dom/node/types.js +2 -0
  42. package/lib/ml-dom/node/unexpected-call-error.d.ts +2 -0
  43. package/lib/ml-dom/node/unexpected-call-error.js +5 -0
  44. package/lib/ml-dom/token/token.d.ts +47 -0
  45. package/lib/ml-dom/token/token.js +89 -0
  46. package/package.json +4 -4
  47. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,42 @@
1
+ import type { MLAttr } from './attr';
2
+ import type { RuleConfigValue } from '@markuplint/ml-config';
3
+ export declare class MLNamedNodeMap<T extends RuleConfigValue, O = null> extends Array<MLAttr<T, O>> implements NamedNodeMap {
4
+ getNamedItem(qualifiedName: string): MLAttr<T, O> | null;
5
+ /**
6
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
7
+ *
8
+ * @unsupported
9
+ * @implements DOM API: `NamedNodeMap`
10
+ */
11
+ getNamedItemNS(namespace: string | null, localName: string): Attr | null;
12
+ item(index: number): MLAttr<T, O> | null;
13
+ /**
14
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
15
+ *
16
+ * @unsupported
17
+ * @implements DOM API: `NamedNodeMap`
18
+ */
19
+ removeNamedItem(qualifiedName: string): MLAttr<T, O>;
20
+ /**
21
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
22
+ *
23
+ * @unsupported
24
+ * @implements DOM API: `NamedNodeMap`
25
+ */
26
+ removeNamedItemNS(namespace: string | null, localName: string): MLAttr<T, O>;
27
+ /**
28
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
29
+ *
30
+ * @unsupported
31
+ * @implements DOM API: `NamedNodeMap`
32
+ */
33
+ setNamedItem(attr: MLAttr<T, O>): MLAttr<T, O> | null;
34
+ /**
35
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
36
+ *
37
+ * @unsupported
38
+ * @implements DOM API: `NamedNodeMap`
39
+ */
40
+ setNamedItemNS(attr: MLAttr<T, O>): MLAttr<T, O> | null;
41
+ }
42
+ export declare function toNamedNodeMap<T extends RuleConfigValue, O = null>(nodes: ReadonlyArray<MLAttr<T, O>>): MLNamedNodeMap<T, O>;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toNamedNodeMap = exports.MLNamedNodeMap = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const unexpected_call_error_1 = tslib_1.__importDefault(require("./unexpected-call-error"));
6
+ class MLNamedNodeMap extends Array {
7
+ getNamedItem(qualifiedName) {
8
+ return this.find(attr => attr.name === qualifiedName) || null;
9
+ }
10
+ /**
11
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
12
+ *
13
+ * @unsupported
14
+ * @implements DOM API: `NamedNodeMap`
15
+ */
16
+ getNamedItemNS(namespace, localName) {
17
+ throw new unexpected_call_error_1.default('Not supported "getNamedItemNS" method');
18
+ }
19
+ item(index) {
20
+ return this[index];
21
+ }
22
+ /**
23
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
24
+ *
25
+ * @unsupported
26
+ * @implements DOM API: `NamedNodeMap`
27
+ */
28
+ removeNamedItem(qualifiedName) {
29
+ throw new unexpected_call_error_1.default('Not supported "removeNamedItem" method');
30
+ }
31
+ /**
32
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
33
+ *
34
+ * @unsupported
35
+ * @implements DOM API: `NamedNodeMap`
36
+ */
37
+ removeNamedItemNS(namespace, localName) {
38
+ throw new unexpected_call_error_1.default('Not supported "removeNamedItemNS" method');
39
+ }
40
+ /**
41
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
42
+ *
43
+ * @unsupported
44
+ * @implements DOM API: `NamedNodeMap`
45
+ */
46
+ setNamedItem(attr) {
47
+ throw new unexpected_call_error_1.default('Not supported "setNamedItem" method');
48
+ }
49
+ /**
50
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
51
+ *
52
+ * @unsupported
53
+ * @implements DOM API: `NamedNodeMap`
54
+ */
55
+ setNamedItemNS(attr) {
56
+ throw new unexpected_call_error_1.default('Not supported "setNamedItemNS" method');
57
+ }
58
+ }
59
+ exports.MLNamedNodeMap = MLNamedNodeMap;
60
+ function toNamedNodeMap(nodes) {
61
+ const namedNodeMap = new MLNamedNodeMap(...nodes);
62
+ return namedNodeMap;
63
+ }
64
+ exports.toNamedNodeMap = toNamedNodeMap;
@@ -0,0 +1,6 @@
1
+ import type { MLChildNode } from './child-node';
2
+ import type { MLElement } from './element';
3
+ import type { RuleConfigValue } from '@markuplint/ml-config';
4
+ export declare function toNodeList<T extends RuleConfigValue, O, N extends MLChildNode<T, O>>(nodes: ReadonlyArray<N>): NodeListOf<N>;
5
+ export declare function toHTMLCollection<T extends RuleConfigValue, O = null>(nodes: ReadonlyArray<MLElement<T, O>>): HTMLCollectionOf<MLElement<T, O>>;
6
+ export declare function nodeListToHTMLCollection<T extends RuleConfigValue, O = null>(nodeList: NodeListOf<MLChildNode<T, O>>): HTMLCollectionOf<MLElement<T, O>>;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.nodeListToHTMLCollection = exports.toHTMLCollection = exports.toNodeList = void 0;
4
+ class MLNodeList extends Array {
5
+ forEach(callbackfn, thisArg) {
6
+ return super.forEach.bind(this)((v, k) => callbackfn(v, k, thisArg !== null && thisArg !== void 0 ? thisArg : this));
7
+ }
8
+ item(index) {
9
+ return this[index];
10
+ }
11
+ }
12
+ function toNodeList(nodes) {
13
+ const nodeList = new MLNodeList(...nodes);
14
+ return nodeList;
15
+ }
16
+ exports.toNodeList = toNodeList;
17
+ class MLHTMLCollection extends Array {
18
+ item(index) {
19
+ return this[index];
20
+ }
21
+ namedItem(name) {
22
+ return this.find(el => el.getAttribute('name') === name) || null;
23
+ }
24
+ }
25
+ function toHTMLCollection(nodes) {
26
+ const collection = new MLHTMLCollection(...nodes);
27
+ return collection;
28
+ }
29
+ exports.toHTMLCollection = toHTMLCollection;
30
+ function nodeListToHTMLCollection(nodeList) {
31
+ const collection = new MLHTMLCollection();
32
+ nodeList.forEach(node => {
33
+ if (node.is(node.ELEMENT_NODE)) {
34
+ collection.push(node);
35
+ }
36
+ });
37
+ return collection;
38
+ }
39
+ exports.nodeListToHTMLCollection = nodeListToHTMLCollection;
@@ -0,0 +1,14 @@
1
+ import type { MLNode } from './node';
2
+ import type { MappedNode } from './types';
3
+ import type { MLASTAbstractNode } from '@markuplint/ml-ast';
4
+ import type { RuleConfigValue } from '@markuplint/ml-config';
5
+ declare class NodeStore {
6
+ #private;
7
+ getNode<N extends MLASTAbstractNode, T extends RuleConfigValue, O = null>(astNode: N): MappedNode<N, T, O>;
8
+ setNode<A extends MLASTAbstractNode, T extends RuleConfigValue, O = null>(astNode: A, node: MLNode<T, O, A>): void;
9
+ }
10
+ /**
11
+ * `NodeStore` Singleton
12
+ */
13
+ export declare const nodeStore: NodeStore;
14
+ export {};
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var _NodeStore_store;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.nodeStore = void 0;
5
+ const tslib_1 = require("tslib");
6
+ const parser_utils_1 = require("@markuplint/parser-utils");
7
+ class NodeStore {
8
+ constructor() {
9
+ _NodeStore_store.set(this, new Map());
10
+ }
11
+ getNode(astNode) {
12
+ // console.log(`Get: ${astNode.uuid} -> ${astNode.raw.trim()}(${astNode.type})`);
13
+ const node = tslib_1.__classPrivateFieldGet(this, _NodeStore_store, "f").get(astNode.uuid);
14
+ if (!node) {
15
+ throw new parser_utils_1.ParserError('Broke mapping nodes.', {
16
+ line: astNode.startLine,
17
+ col: astNode.startCol,
18
+ raw: astNode.raw,
19
+ nodeName: astNode.nodeName,
20
+ });
21
+ }
22
+ return node;
23
+ }
24
+ setNode(astNode, node) {
25
+ tslib_1.__classPrivateFieldGet(this, _NodeStore_store, "f").set(astNode.uuid, node);
26
+ }
27
+ }
28
+ _NodeStore_store = new WeakMap();
29
+ /**
30
+ * `NodeStore` Singleton
31
+ */
32
+ exports.nodeStore = new NodeStore();
@@ -0,0 +1,482 @@
1
+ import type { RuleInfo } from '../..';
2
+ import type { MLBlock } from './block';
3
+ import type { MLChildNode } from './child-node';
4
+ import type { MLDocument } from './document';
5
+ import type { MLDocumentFragment } from './document-fragment';
6
+ import type { MLElement } from './element';
7
+ import type { MarkuplintPreprocessorBlockType, NodeType, NodeTypeOf } from './types';
8
+ import type { MLASTAbstractNode } from '@markuplint/ml-ast';
9
+ import type { AnyRule, RuleConfigValue } from '@markuplint/ml-config';
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;
482
+ }