@markuplint/ml-core 3.4.0 → 3.5.0
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/configs.js +1 -2
- package/lib/index.d.ts +1 -11
- package/lib/ml-core.d.ts +12 -23
- package/lib/ml-core.js +4 -4
- package/lib/ml-dom/helper/accname.js +15 -5
- package/lib/ml-dom/helper/create-node.d.ts +2 -5
- package/lib/ml-dom/helper/create-node.js +3 -1
- package/lib/ml-dom/helper/debug.js +6 -2
- package/lib/ml-dom/helper/getIndent.d.ts +7 -7
- package/lib/ml-dom/helper/getIndent.js +11 -3
- package/lib/ml-dom/helper/walkers.d.ts +5 -13
- package/lib/ml-dom/helper/walkers.js +3 -1
- package/lib/ml-dom/manipulations/child-node-methods.d.ts +7 -20
- package/lib/ml-dom/manipulations/child-node-methods.js +24 -6
- package/lib/ml-dom/manipulations/get-children.d.ts +2 -4
- package/lib/ml-dom/manipulations/get-children.js +3 -1
- package/lib/ml-dom/node/attr.d.ts +91 -91
- package/lib/ml-dom/node/attr.js +5 -1
- package/lib/ml-dom/node/block.d.ts +32 -32
- package/lib/ml-dom/node/block.js +14 -4
- package/lib/ml-dom/node/character-data.d.ts +53 -60
- package/lib/ml-dom/node/character-data.js +9 -3
- package/lib/ml-dom/node/child-node.d.ts +3 -8
- package/lib/ml-dom/node/child-node.js +3 -1
- package/lib/ml-dom/node/comment.d.ts +13 -16
- package/lib/ml-dom/node/document-fragment.d.ts +20 -23
- package/lib/ml-dom/node/document-type.d.ts +32 -35
- package/lib/ml-dom/node/document-type.js +14 -4
- package/lib/ml-dom/node/document.d.ts +1586 -1599
- package/lib/ml-dom/node/document.js +29 -7
- package/lib/ml-dom/node/dom-token-list.d.ts +26 -26
- package/lib/ml-dom/node/dom-token-list.js +3 -1
- package/lib/ml-dom/node/element.d.ts +1897 -1895
- package/lib/ml-dom/node/element.js +58 -14
- package/lib/ml-dom/node/named-node-map.d.ts +40 -45
- package/lib/ml-dom/node/named-node-map.js +9 -3
- package/lib/ml-dom/node/node-list.d.ts +4 -10
- package/lib/ml-dom/node/node-list.js +6 -2
- package/lib/ml-dom/node/node-store.d.ts +4 -4
- package/lib/ml-dom/node/node-store.js +8 -3
- package/lib/ml-dom/node/node.d.ts +472 -492
- package/lib/ml-dom/node/node.js +42 -14
- package/lib/ml-dom/node/parent-node.d.ts +58 -67
- package/lib/ml-dom/node/parent-node.js +9 -3
- package/lib/ml-dom/node/rule-mapper.d.ts +7 -7
- package/lib/ml-dom/node/rule-mapper.js +6 -2
- package/lib/ml-dom/node/text.d.ts +47 -50
- package/lib/ml-dom/node/types.d.ts +13 -69
- package/lib/ml-dom/node/unexpected-call-error.d.ts +2 -1
- package/lib/ml-dom/token/token.d.ts +44 -44
- package/lib/ml-rule/create-rule.d.ts +2 -2
- package/lib/ml-rule/create-test-rule.d.ts +4 -6
- package/lib/ml-rule/ml-rule-context.d.ts +49 -57
- package/lib/ml-rule/ml-rule-context.js +3 -1
- package/lib/ml-rule/ml-rule.d.ts +25 -27
- package/lib/ml-rule/ml-rule.js +30 -24
- package/lib/ml-rule/types.d.ts +16 -22
- package/lib/plugin/plugin.d.ts +1 -1
- package/lib/plugin/types.d.ts +7 -7
- package/lib/ruleset/index.d.ts +4 -4
- package/lib/ruleset/index.js +4 -4
- package/lib/test/index.d.ts +8 -20
- package/lib/types.d.ts +9 -8
- package/lib/utils/get-location-from-chars.d.ts +4 -9
- package/package.json +14 -12
|
@@ -2,37 +2,37 @@ import type { MLDocument } from './document';
|
|
|
2
2
|
import type { MLElement } from './element';
|
|
3
3
|
import type { MarkuplintPreprocessorBlockType } from './types';
|
|
4
4
|
import type { MLASTPreprocessorSpecificBlock } from '@markuplint/ml-ast';
|
|
5
|
-
import type { RuleConfigValue } from '@markuplint/ml-config';
|
|
5
|
+
import type { PlainData, RuleConfigValue } from '@markuplint/ml-config';
|
|
6
6
|
import { MLNode } from './node';
|
|
7
|
-
export declare class MLBlock<T extends RuleConfigValue, O =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
7
|
+
export declare class MLBlock<T extends RuleConfigValue, O extends PlainData = undefined> extends MLNode<T, O, MLASTPreprocessorSpecificBlock> {
|
|
8
|
+
readonly isTransparent: boolean;
|
|
9
|
+
constructor(astNode: MLASTPreprocessorSpecificBlock, document: MLDocument<T, O>);
|
|
10
|
+
/**
|
|
11
|
+
* Returns a string appropriate for the type of node as `MLBlock`
|
|
12
|
+
*
|
|
13
|
+
* @implements `@markuplint/ml-core` API: `MLBlock`
|
|
14
|
+
*/
|
|
15
|
+
get nodeName(): "#ml-block";
|
|
16
|
+
/**
|
|
17
|
+
* Returns a number appropriate for the type of `MLBlock`
|
|
18
|
+
*
|
|
19
|
+
* @implements `@markuplint/ml-core` API: `MLBlock`
|
|
20
|
+
*/
|
|
21
|
+
get nodeType(): MarkuplintPreprocessorBlockType;
|
|
22
|
+
/**
|
|
23
|
+
* @implements DOM API: `ChildNode`
|
|
24
|
+
*/
|
|
25
|
+
after(...nodes: (string | MLElement<any, any>)[]): void;
|
|
26
|
+
/**
|
|
27
|
+
* @implements DOM API: `ChildNode`
|
|
28
|
+
*/
|
|
29
|
+
before(...nodes: (string | MLElement<any, any>)[]): void;
|
|
30
|
+
/**
|
|
31
|
+
* @implements DOM API: `ChildNode`
|
|
32
|
+
*/
|
|
33
|
+
remove(): void;
|
|
34
|
+
/**
|
|
35
|
+
* @implements DOM API: `ChildNode`
|
|
36
|
+
*/
|
|
37
|
+
replaceWith(...nodes: (string | MLElement<any, any>)[]): void;
|
|
38
38
|
}
|
package/lib/ml-dom/node/block.js
CHANGED
|
@@ -4,7 +4,11 @@ exports.MLBlock = void 0;
|
|
|
4
4
|
const child_node_methods_1 = require("../manipulations/child-node-methods");
|
|
5
5
|
const node_1 = require("./node");
|
|
6
6
|
class MLBlock extends node_1.MLNode {
|
|
7
|
-
constructor(
|
|
7
|
+
constructor(
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
9
|
+
astNode,
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
11
|
+
document) {
|
|
8
12
|
super(astNode, document);
|
|
9
13
|
// TODO:
|
|
10
14
|
this.isTransparent = true;
|
|
@@ -28,13 +32,17 @@ class MLBlock extends node_1.MLNode {
|
|
|
28
32
|
/**
|
|
29
33
|
* @implements DOM API: `ChildNode`
|
|
30
34
|
*/
|
|
31
|
-
after(
|
|
35
|
+
after(
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
37
|
+
...nodes) {
|
|
32
38
|
(0, child_node_methods_1.after)(this, ...nodes);
|
|
33
39
|
}
|
|
34
40
|
/**
|
|
35
41
|
* @implements DOM API: `ChildNode`
|
|
36
42
|
*/
|
|
37
|
-
before(
|
|
43
|
+
before(
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
45
|
+
...nodes) {
|
|
38
46
|
(0, child_node_methods_1.before)(this, ...nodes);
|
|
39
47
|
}
|
|
40
48
|
/**
|
|
@@ -46,7 +54,9 @@ class MLBlock extends node_1.MLNode {
|
|
|
46
54
|
/**
|
|
47
55
|
* @implements DOM API: `ChildNode`
|
|
48
56
|
*/
|
|
49
|
-
replaceWith(
|
|
57
|
+
replaceWith(
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
59
|
+
...nodes) {
|
|
50
60
|
(0, child_node_methods_1.replaceWith)(this, ...nodes);
|
|
51
61
|
}
|
|
52
62
|
}
|
|
@@ -1,64 +1,57 @@
|
|
|
1
1
|
import type { MLElement } from './element';
|
|
2
2
|
import type { MLASTAbstractNode } from '@markuplint/ml-ast';
|
|
3
|
-
import type { RuleConfigValue } from '@markuplint/ml-config';
|
|
3
|
+
import type { PlainData, RuleConfigValue } from '@markuplint/ml-config';
|
|
4
4
|
import { MLNode } from './node';
|
|
5
|
-
export declare abstract class MLCharacterData<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
remove(): void;
|
|
58
|
-
replaceData(offset: number, count: number, data: string): void;
|
|
59
|
-
/**
|
|
60
|
-
* @implements DOM API: `CharacterData`
|
|
61
|
-
*/
|
|
62
|
-
replaceWith(...nodes: (string | MLElement<any, any>)[]): void;
|
|
63
|
-
substringData(offset: number, count: number): string;
|
|
5
|
+
export declare abstract class MLCharacterData<T extends RuleConfigValue, O extends PlainData = undefined, A extends MLASTAbstractNode = MLASTAbstractNode> extends MLNode<T, O, A> implements CharacterData {
|
|
6
|
+
/**
|
|
7
|
+
* @implements DOM API: `CharacterData`
|
|
8
|
+
* @see https://dom.spec.whatwg.org/#dom-characterdata-data
|
|
9
|
+
*/
|
|
10
|
+
get data(): string;
|
|
11
|
+
/**
|
|
12
|
+
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
13
|
+
*
|
|
14
|
+
* @unsupported
|
|
15
|
+
* @implements DOM API: `CharacterData`
|
|
16
|
+
* @see https://dom.spec.whatwg.org/#dom-characterdata-length
|
|
17
|
+
*/
|
|
18
|
+
get length(): number;
|
|
19
|
+
/**
|
|
20
|
+
* The element immediately following the specified one in its parent's children list.
|
|
21
|
+
*
|
|
22
|
+
* @readonly
|
|
23
|
+
* @implements DOM API: `CharacterData`
|
|
24
|
+
* @see https://dom.spec.whatwg.org/#ref-for-dom-nondocumenttypechildnode-nextelementsibling%E2%91%A1
|
|
25
|
+
*/
|
|
26
|
+
get nextElementSibling(): MLElement<T, O> | null;
|
|
27
|
+
get nodeValue(): string | null;
|
|
28
|
+
/**
|
|
29
|
+
* The element immediately prior the specified one in its parent's children list.
|
|
30
|
+
*
|
|
31
|
+
* @readonly
|
|
32
|
+
* @implements DOM API: `CharacterData`
|
|
33
|
+
* @see https://dom.spec.whatwg.org/#ref-for-dom-nondocumenttypechildnode-previouselementsibling%E2%91%A1
|
|
34
|
+
*/
|
|
35
|
+
get previousElementSibling(): MLElement<T, O> | null;
|
|
36
|
+
/**
|
|
37
|
+
* @implements DOM API: `CharacterData`
|
|
38
|
+
*/
|
|
39
|
+
after(...nodes: (string | MLElement<any, any>)[]): void;
|
|
40
|
+
appendData(data: string): void;
|
|
41
|
+
/**
|
|
42
|
+
* @implements DOM API: `CharacterData`
|
|
43
|
+
*/
|
|
44
|
+
before(...nodes: (string | MLElement<any, any>)[]): void;
|
|
45
|
+
deleteData(offset: number, count: number): void;
|
|
46
|
+
insertData(offset: number, data: string): void;
|
|
47
|
+
/**
|
|
48
|
+
* @implements DOM API: `CharacterData`
|
|
49
|
+
*/
|
|
50
|
+
remove(): void;
|
|
51
|
+
replaceData(offset: number, count: number, data: string): void;
|
|
52
|
+
/**
|
|
53
|
+
* @implements DOM API: `CharacterData`
|
|
54
|
+
*/
|
|
55
|
+
replaceWith(...nodes: (string | MLElement<any, any>)[]): void;
|
|
56
|
+
substringData(offset: number, count: number): string;
|
|
64
57
|
}
|
|
@@ -50,7 +50,9 @@ class MLCharacterData extends node_1.MLNode {
|
|
|
50
50
|
/**
|
|
51
51
|
* @implements DOM API: `CharacterData`
|
|
52
52
|
*/
|
|
53
|
-
after(
|
|
53
|
+
after(
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
55
|
+
...nodes) {
|
|
54
56
|
(0, child_node_methods_1.after)(this, ...nodes);
|
|
55
57
|
}
|
|
56
58
|
// TODO
|
|
@@ -58,7 +60,9 @@ class MLCharacterData extends node_1.MLNode {
|
|
|
58
60
|
/**
|
|
59
61
|
* @implements DOM API: `CharacterData`
|
|
60
62
|
*/
|
|
61
|
-
before(
|
|
63
|
+
before(
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
65
|
+
...nodes) {
|
|
62
66
|
(0, child_node_methods_1.before)(this, ...nodes);
|
|
63
67
|
}
|
|
64
68
|
// TODO
|
|
@@ -76,7 +80,9 @@ class MLCharacterData extends node_1.MLNode {
|
|
|
76
80
|
/**
|
|
77
81
|
* @implements DOM API: `CharacterData`
|
|
78
82
|
*/
|
|
79
|
-
replaceWith(
|
|
83
|
+
replaceWith(
|
|
84
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
85
|
+
...nodes) {
|
|
80
86
|
(0, child_node_methods_1.replaceWith)(this, ...nodes);
|
|
81
87
|
}
|
|
82
88
|
// TODO
|
|
@@ -4,11 +4,6 @@ import type { MLDocumentType } from './document-type';
|
|
|
4
4
|
import type { MLElement } from './element';
|
|
5
5
|
import type { MLNode } from './node';
|
|
6
6
|
import type { MLText } from './text';
|
|
7
|
-
import type { RuleConfigValue } from '@markuplint/ml-config';
|
|
8
|
-
export type MLChildNode<T extends RuleConfigValue, O =
|
|
9
|
-
|
|
10
|
-
| MLCharacterData<T, O>
|
|
11
|
-
| MLText<T, O>
|
|
12
|
-
| MLElement<T, O>
|
|
13
|
-
| MLBlock<T, O>;
|
|
14
|
-
export declare function isChildNode<T extends RuleConfigValue, O = null>(node: MLNode<T, O>): node is MLChildNode<T, O>;
|
|
7
|
+
import type { PlainData, RuleConfigValue } from '@markuplint/ml-config';
|
|
8
|
+
export type MLChildNode<T extends RuleConfigValue, O extends PlainData = undefined> = MLDocumentType<T, O> | MLCharacterData<T, O> | MLText<T, O> | MLElement<T, O> | MLBlock<T, O>;
|
|
9
|
+
export declare function isChildNode<T extends RuleConfigValue, O extends PlainData = undefined>(node: MLNode<T, O>): node is MLChildNode<T, O>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isChildNode = void 0;
|
|
4
|
-
function isChildNode(
|
|
4
|
+
function isChildNode(
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
6
|
+
node) {
|
|
5
7
|
return (node.is(node.DOCUMENT_TYPE_NODE) ||
|
|
6
8
|
node.is(node.TEXT_NODE) ||
|
|
7
9
|
node.is(node.ELEMENT_NODE) ||
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import type { CommentNodeType } from './types';
|
|
2
2
|
import type { MLASTComment } from '@markuplint/ml-ast';
|
|
3
|
-
import type { RuleConfigValue } from '@markuplint/ml-config';
|
|
3
|
+
import type { PlainData, RuleConfigValue } from '@markuplint/ml-config';
|
|
4
4
|
import { MLCharacterData } from './character-data';
|
|
5
|
-
export declare class MLComment<T extends RuleConfigValue, O =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*/
|
|
18
|
-
get nodeType(): CommentNodeType;
|
|
19
|
-
get textContent(): string | null;
|
|
5
|
+
export declare class MLComment<T extends RuleConfigValue, O extends PlainData = undefined> extends MLCharacterData<T, O, MLASTComment> implements Comment {
|
|
6
|
+
/**
|
|
7
|
+
* Returns a string appropriate for the type of node as `Attr`
|
|
8
|
+
*
|
|
9
|
+
* @see https://dom.spec.whatwg.org/#ref-for-exclusive-text-node%E2%91%A0
|
|
10
|
+
*/
|
|
11
|
+
get nodeName(): "#comment";
|
|
12
|
+
/**
|
|
13
|
+
* Returns a number appropriate for the type of `Comment`
|
|
14
|
+
*/
|
|
15
|
+
get nodeType(): CommentNodeType;
|
|
16
|
+
get textContent(): string | null;
|
|
20
17
|
}
|
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
import type { DocumentFragmentNodeType } from './types';
|
|
2
2
|
import type { MLASTAbstractNode } from '@markuplint/ml-ast';
|
|
3
|
-
import type { RuleConfigValue } from '@markuplint/ml-config';
|
|
3
|
+
import type { PlainData, RuleConfigValue } from '@markuplint/ml-config';
|
|
4
4
|
import { MLParentNode } from './parent-node';
|
|
5
|
-
export declare class MLDocumentFragment<T extends RuleConfigValue, O =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* @implements DOM API: `DocumentFragment`
|
|
25
|
-
*/
|
|
26
|
-
getElementById(elementId: string): HTMLElement | null;
|
|
5
|
+
export declare class MLDocumentFragment<T extends RuleConfigValue, O extends PlainData = undefined> extends MLParentNode<T, O, MLASTAbstractNode> implements DocumentFragment {
|
|
6
|
+
/**
|
|
7
|
+
* Returns a string appropriate for the type of node as `DocumentFragment`
|
|
8
|
+
*
|
|
9
|
+
* @see https://dom.spec.whatwg.org/#ref-for-documentfragment%E2%91%A0%E2%91%A6
|
|
10
|
+
*/
|
|
11
|
+
get nodeName(): "#document-fragment";
|
|
12
|
+
/**
|
|
13
|
+
* Returns a number appropriate for the type of `DocumentFragment`
|
|
14
|
+
*/
|
|
15
|
+
get nodeType(): DocumentFragmentNodeType;
|
|
16
|
+
/**
|
|
17
|
+
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
18
|
+
*
|
|
19
|
+
* @deprecated
|
|
20
|
+
* @unsupported
|
|
21
|
+
* @implements DOM API: `DocumentFragment`
|
|
22
|
+
*/
|
|
23
|
+
getElementById(elementId: string): HTMLElement | null;
|
|
27
24
|
}
|
|
@@ -2,40 +2,37 @@ import type { MLDocument } from './document';
|
|
|
2
2
|
import type { MLElement } from './element';
|
|
3
3
|
import type { DocumentTypeNodeType } from './types';
|
|
4
4
|
import type { MLASTDoctype } from '@markuplint/ml-ast';
|
|
5
|
-
import type { RuleConfigValue } from '@markuplint/ml-config';
|
|
5
|
+
import type { PlainData, RuleConfigValue } from '@markuplint/ml-config';
|
|
6
6
|
import { MLNode } from './node';
|
|
7
|
-
export declare class MLDocumentType<T extends RuleConfigValue, O =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
* @implements DOM API: `CharacterData`
|
|
39
|
-
*/
|
|
40
|
-
replaceWith(...nodes: (string | MLElement<any, any>)[]): void;
|
|
7
|
+
export declare class MLDocumentType<T extends RuleConfigValue, O extends PlainData = undefined> extends MLNode<T, O, MLASTDoctype> implements DocumentType {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly publicId: string;
|
|
10
|
+
readonly systemId: string;
|
|
11
|
+
constructor(astNode: MLASTDoctype, document: MLDocument<T, O>);
|
|
12
|
+
/**
|
|
13
|
+
* Returns a string appropriate for the type of node as `DocumentType`
|
|
14
|
+
*
|
|
15
|
+
* @see https://dom.spec.whatwg.org/#ref-for-documenttype%E2%91%A0%E2%93%AA
|
|
16
|
+
*/
|
|
17
|
+
get nodeName(): string;
|
|
18
|
+
/**
|
|
19
|
+
* Returns a number appropriate for the type of `DocumentType`
|
|
20
|
+
*/
|
|
21
|
+
get nodeType(): DocumentTypeNodeType;
|
|
22
|
+
/**
|
|
23
|
+
* @implements DOM API: `CharacterData`
|
|
24
|
+
*/
|
|
25
|
+
after(...nodes: (string | MLElement<any, any>)[]): void;
|
|
26
|
+
/**
|
|
27
|
+
* @implements DOM API: `CharacterData`
|
|
28
|
+
*/
|
|
29
|
+
before(...nodes: (string | MLElement<any, any>)[]): void;
|
|
30
|
+
/**
|
|
31
|
+
* @implements DOM API: `CharacterData`
|
|
32
|
+
*/
|
|
33
|
+
remove(): void;
|
|
34
|
+
/**
|
|
35
|
+
* @implements DOM API: `CharacterData`
|
|
36
|
+
*/
|
|
37
|
+
replaceWith(...nodes: (string | MLElement<any, any>)[]): void;
|
|
41
38
|
}
|
|
@@ -4,7 +4,11 @@ exports.MLDocumentType = void 0;
|
|
|
4
4
|
const child_node_methods_1 = require("../manipulations/child-node-methods");
|
|
5
5
|
const node_1 = require("./node");
|
|
6
6
|
class MLDocumentType extends node_1.MLNode {
|
|
7
|
-
constructor(
|
|
7
|
+
constructor(
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
9
|
+
astNode,
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
11
|
+
document) {
|
|
8
12
|
super(astNode, document);
|
|
9
13
|
this.name = astNode.name;
|
|
10
14
|
this.publicId = astNode.publicId;
|
|
@@ -27,13 +31,17 @@ class MLDocumentType extends node_1.MLNode {
|
|
|
27
31
|
/**
|
|
28
32
|
* @implements DOM API: `CharacterData`
|
|
29
33
|
*/
|
|
30
|
-
after(
|
|
34
|
+
after(
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
36
|
+
...nodes) {
|
|
31
37
|
(0, child_node_methods_1.after)(this, ...nodes);
|
|
32
38
|
}
|
|
33
39
|
/**
|
|
34
40
|
* @implements DOM API: `CharacterData`
|
|
35
41
|
*/
|
|
36
|
-
before(
|
|
42
|
+
before(
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
44
|
+
...nodes) {
|
|
37
45
|
(0, child_node_methods_1.before)(this, ...nodes);
|
|
38
46
|
}
|
|
39
47
|
/**
|
|
@@ -45,7 +53,9 @@ class MLDocumentType extends node_1.MLNode {
|
|
|
45
53
|
/**
|
|
46
54
|
* @implements DOM API: `CharacterData`
|
|
47
55
|
*/
|
|
48
|
-
replaceWith(
|
|
56
|
+
replaceWith(
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
58
|
+
...nodes) {
|
|
49
59
|
(0, child_node_methods_1.replaceWith)(this, ...nodes);
|
|
50
60
|
}
|
|
51
61
|
}
|