@markuplint/ml-core 2.3.2 → 2.3.3
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/ml-core.d.ts +1 -1
- package/lib/ml-dom/helper/selector.d.ts +1 -1
- package/package.json +5 -5
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/ml-dom/manipulations/child-node-methods.d.ts +0 -33
- package/lib/ml-dom/manipulations/child-node-methods.js +0 -73
- package/lib/ml-dom/manipulations/get-children.d.ts +0 -4
- package/lib/ml-dom/manipulations/get-children.js +0 -10
- package/lib/ml-dom/node/attr.d.ts +0 -93
- package/lib/ml-dom/node/attr.js +0 -144
- package/lib/ml-dom/node/block.d.ts +0 -38
- package/lib/ml-dom/node/block.js +0 -53
- package/lib/ml-dom/node/character-data.d.ts +0 -57
- package/lib/ml-dom/node/character-data.js +0 -87
- package/lib/ml-dom/node/child-node.d.ts +0 -9
- package/lib/ml-dom/node/child-node.js +0 -10
- package/lib/ml-dom/node/comment.d.ts +0 -17
- package/lib/ml-dom/node/comment.js +0 -24
- package/lib/ml-dom/node/document-fragment.d.ts +0 -24
- package/lib/ml-dom/node/document-fragment.js +0 -33
- package/lib/ml-dom/node/document-type.d.ts +0 -38
- package/lib/ml-dom/node/document-type.js +0 -52
- package/lib/ml-dom/node/document.d.ts +0 -1554
- package/lib/ml-dom/node/document.js +0 -2117
- package/lib/ml-dom/node/dom-token-list.d.ts +0 -15
- package/lib/ml-dom/node/dom-token-list.js +0 -61
- package/lib/ml-dom/node/element.d.ts +0 -1832
- package/lib/ml-dom/node/element.js +0 -2483
- package/lib/ml-dom/node/named-node-map.d.ts +0 -42
- package/lib/ml-dom/node/named-node-map.js +0 -64
- package/lib/ml-dom/node/node-list.d.ts +0 -6
- package/lib/ml-dom/node/node-list.js +0 -39
- package/lib/ml-dom/node/node-store.d.ts +0 -14
- package/lib/ml-dom/node/node-store.js +0 -32
- package/lib/ml-dom/node/node.d.ts +0 -475
- package/lib/ml-dom/node/node.js +0 -672
- package/lib/ml-dom/node/parent-node.d.ts +0 -66
- package/lib/ml-dom/node/parent-node.js +0 -131
- package/lib/ml-dom/node/rule-mapper.d.ts +0 -17
- package/lib/ml-dom/node/rule-mapper.js +0 -49
- package/lib/ml-dom/node/text.d.ts +0 -51
- package/lib/ml-dom/node/text.js +0 -76
- package/lib/ml-dom/node/types.d.ts +0 -25
- package/lib/ml-dom/node/types.js +0 -2
- package/lib/ml-dom/node/unexpected-call-error.d.ts +0 -2
- package/lib/ml-dom/node/unexpected-call-error.js +0 -5
- package/lib/ml-dom/token/token.d.ts +0 -47
- package/lib/ml-dom/token/token.js +0 -89
- package/lib/selector/is-pure-html-element.d.ts +0 -1
- package/lib/selector/is-pure-html-element.js +0 -7
- package/lib/selector/match-selector.d.ts +0 -14
- package/lib/selector/match-selector.js +0 -230
- package/lib/selector/selector.d.ts +0 -9
- package/lib/selector/selector.js +0 -561
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import type { MLElement } from './element';
|
|
2
|
-
import type { AttributeNodeType } from './types';
|
|
3
|
-
import type { MLASTAttr } from '@markuplint/ml-ast';
|
|
4
|
-
import type { RuleConfigValue } from '@markuplint/ml-config';
|
|
5
|
-
import { MLToken } from '../token/token';
|
|
6
|
-
import { MLNode } from './node';
|
|
7
|
-
export declare class MLAttr<T extends RuleConfigValue, O = null> extends MLNode<T, O, MLASTAttr> implements Attr {
|
|
8
|
-
#private;
|
|
9
|
-
readonly candidate?: string;
|
|
10
|
-
readonly endQuote: MLToken | null;
|
|
11
|
-
readonly equal: MLToken | null;
|
|
12
|
-
readonly isDirective?: true;
|
|
13
|
-
readonly isDuplicatable: boolean;
|
|
14
|
-
readonly isDynamicValue?: true;
|
|
15
|
-
readonly nameNode: MLToken | null;
|
|
16
|
-
/**
|
|
17
|
-
* @implements DOM API: `Attr`
|
|
18
|
-
* @see https://dom.spec.whatwg.org/#ref-for-dom-node-previoussibling%E2%91%A0
|
|
19
|
-
*/
|
|
20
|
-
readonly ownerElement: MLElement<T, O>;
|
|
21
|
-
readonly spacesAfterEqual: MLToken | null;
|
|
22
|
-
readonly spacesBeforeEqual: MLToken | null;
|
|
23
|
-
readonly spacesBeforeName: MLToken | null;
|
|
24
|
-
readonly startQuote: MLToken | null;
|
|
25
|
-
readonly valueNode: MLToken | null;
|
|
26
|
-
/**
|
|
27
|
-
* Returns the "string" if HTML syntax. Otherwise, returns a type in its syntax.
|
|
28
|
-
*
|
|
29
|
-
* @default "string"
|
|
30
|
-
* @implements `@markuplint/ml-core` API: `MLAttr`
|
|
31
|
-
*/
|
|
32
|
-
readonly valueType: 'string' | 'number' | 'boolean' | 'code';
|
|
33
|
-
/**
|
|
34
|
-
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
35
|
-
*
|
|
36
|
-
* @unsupported
|
|
37
|
-
* @implements DOM API: `Attr`
|
|
38
|
-
* @see https://dom.spec.whatwg.org/#ref-for-dom-attr-localname
|
|
39
|
-
*/
|
|
40
|
-
get localName(): string;
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
* @implements DOM API: `Attr`
|
|
44
|
-
* @see https://dom.spec.whatwg.org/#dom-attr-name
|
|
45
|
-
*/
|
|
46
|
-
get name(): string;
|
|
47
|
-
/**
|
|
48
|
-
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
49
|
-
*
|
|
50
|
-
* @unsupported
|
|
51
|
-
* @implements DOM API: `Attr`
|
|
52
|
-
* @see https://dom.spec.whatwg.org/#ref-for-dom-attr-namespaceuri
|
|
53
|
-
*/
|
|
54
|
-
get namespaceURI(): string | null;
|
|
55
|
-
/**
|
|
56
|
-
* Returns a string appropriate for the type of node as `Attr`
|
|
57
|
-
*
|
|
58
|
-
* @see https://dom.spec.whatwg.org/#ref-for-attr%E2%91%A4
|
|
59
|
-
*/
|
|
60
|
-
get nodeName(): string;
|
|
61
|
-
/**
|
|
62
|
-
* Returns a number appropriate for the type of `Attr`
|
|
63
|
-
*/
|
|
64
|
-
get nodeType(): AttributeNodeType;
|
|
65
|
-
get nodeValue(): string;
|
|
66
|
-
/**
|
|
67
|
-
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
68
|
-
*
|
|
69
|
-
* @unsupported
|
|
70
|
-
* @implements DOM API: `Attr`
|
|
71
|
-
* @see https://dom.spec.whatwg.org/#ref-for-dom-attr-prefix
|
|
72
|
-
*/
|
|
73
|
-
get prefix(): string | null;
|
|
74
|
-
/**
|
|
75
|
-
* @implements `@markuplint/ml-core` API: `MLAttr`
|
|
76
|
-
*/
|
|
77
|
-
get rule(): import("@markuplint/ml-config").RuleInfo<T, O>;
|
|
78
|
-
/**
|
|
79
|
-
* @implements DOM API: `Attr`
|
|
80
|
-
* @see https://dom.spec.whatwg.org/#dom-attr-specified
|
|
81
|
-
*/
|
|
82
|
-
get specified(): true;
|
|
83
|
-
/**
|
|
84
|
-
* @implements DOM API: `Attr`
|
|
85
|
-
* @see https://dom.spec.whatwg.org/#dom-attr-value
|
|
86
|
-
*/
|
|
87
|
-
get value(): string;
|
|
88
|
-
constructor(astToken: MLASTAttr, ownElement: MLElement<T, O>);
|
|
89
|
-
/**
|
|
90
|
-
* @implements `@markuplint/ml-core` API: `MLAttr`
|
|
91
|
-
*/
|
|
92
|
-
toNormalizeString(): string;
|
|
93
|
-
}
|
package/lib/ml-dom/node/attr.js
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _MLAttr_potentialName, _MLAttr_potentialValue;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.MLAttr = void 0;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const token_1 = require("../token/token");
|
|
7
|
-
const node_1 = require("./node");
|
|
8
|
-
const unexpected_call_error_1 = tslib_1.__importDefault(require("./unexpected-call-error"));
|
|
9
|
-
class MLAttr extends node_1.MLNode {
|
|
10
|
-
constructor(astToken, ownElement) {
|
|
11
|
-
var _a;
|
|
12
|
-
super(astToken, ownElement.ownerMLDocument);
|
|
13
|
-
_MLAttr_potentialName.set(this, void 0);
|
|
14
|
-
_MLAttr_potentialValue.set(this, void 0);
|
|
15
|
-
this.endQuote = null;
|
|
16
|
-
this.equal = null;
|
|
17
|
-
this.nameNode = null;
|
|
18
|
-
this.spacesAfterEqual = null;
|
|
19
|
-
this.spacesBeforeEqual = null;
|
|
20
|
-
this.spacesBeforeName = null;
|
|
21
|
-
this.startQuote = null;
|
|
22
|
-
this.valueNode = null;
|
|
23
|
-
/**
|
|
24
|
-
* Returns the "string" if HTML syntax. Otherwise, returns a type in its syntax.
|
|
25
|
-
*
|
|
26
|
-
* @default "string"
|
|
27
|
-
* @implements `@markuplint/ml-core` API: `MLAttr`
|
|
28
|
-
*/
|
|
29
|
-
this.valueType = 'string';
|
|
30
|
-
if (this._astToken.type === 'html-attr') {
|
|
31
|
-
this.spacesBeforeName = new token_1.MLToken(this._astToken.spacesBeforeName);
|
|
32
|
-
this.nameNode = new token_1.MLToken(this._astToken.name);
|
|
33
|
-
this.spacesBeforeEqual = new token_1.MLToken(this._astToken.spacesBeforeEqual);
|
|
34
|
-
this.equal = new token_1.MLToken(this._astToken.equal);
|
|
35
|
-
this.spacesAfterEqual = new token_1.MLToken(this._astToken.spacesAfterEqual);
|
|
36
|
-
this.startQuote = new token_1.MLToken(this._astToken.startQuote);
|
|
37
|
-
this.valueNode = new token_1.MLToken(this._astToken.value);
|
|
38
|
-
this.endQuote = new token_1.MLToken(this._astToken.endQuote);
|
|
39
|
-
this.isDynamicValue = this._astToken.isDynamicValue;
|
|
40
|
-
this.isDirective = this._astToken.isDirective;
|
|
41
|
-
this.candidate = this._astToken.candidate;
|
|
42
|
-
tslib_1.__classPrivateFieldSet(this, _MLAttr_potentialName, this._astToken.potentialName || ((_a = this.nameNode) === null || _a === void 0 ? void 0 : _a.raw) || '', "f");
|
|
43
|
-
tslib_1.__classPrivateFieldSet(this, _MLAttr_potentialValue, this._astToken.value.raw || '', "f");
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
this.valueType = this._astToken.valueType;
|
|
47
|
-
this.isDuplicatable = this._astToken.isDuplicatable;
|
|
48
|
-
tslib_1.__classPrivateFieldSet(this, _MLAttr_potentialName, this._astToken.potentialName, "f");
|
|
49
|
-
tslib_1.__classPrivateFieldSet(this, _MLAttr_potentialValue, this._astToken.potentialValue, "f");
|
|
50
|
-
}
|
|
51
|
-
this.ownerElement = ownElement;
|
|
52
|
-
this.isDuplicatable = this._astToken.isDuplicatable;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
56
|
-
*
|
|
57
|
-
* @unsupported
|
|
58
|
-
* @implements DOM API: `Attr`
|
|
59
|
-
* @see https://dom.spec.whatwg.org/#ref-for-dom-attr-localname
|
|
60
|
-
*/
|
|
61
|
-
get localName() {
|
|
62
|
-
throw new unexpected_call_error_1.default('Not supported "localname" property');
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
*
|
|
66
|
-
* @implements DOM API: `Attr`
|
|
67
|
-
* @see https://dom.spec.whatwg.org/#dom-attr-name
|
|
68
|
-
*/
|
|
69
|
-
get name() {
|
|
70
|
-
return tslib_1.__classPrivateFieldGet(this, _MLAttr_potentialName, "f");
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
74
|
-
*
|
|
75
|
-
* @unsupported
|
|
76
|
-
* @implements DOM API: `Attr`
|
|
77
|
-
* @see https://dom.spec.whatwg.org/#ref-for-dom-attr-namespaceuri
|
|
78
|
-
*/
|
|
79
|
-
get namespaceURI() {
|
|
80
|
-
throw new unexpected_call_error_1.default('Not supported "namespaceURI" property');
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Returns a string appropriate for the type of node as `Attr`
|
|
84
|
-
*
|
|
85
|
-
* @see https://dom.spec.whatwg.org/#ref-for-attr%E2%91%A4
|
|
86
|
-
*/
|
|
87
|
-
get nodeName() {
|
|
88
|
-
return this.name;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Returns a number appropriate for the type of `Attr`
|
|
92
|
-
*/
|
|
93
|
-
get nodeType() {
|
|
94
|
-
return this.ATTRIBUTE_NODE;
|
|
95
|
-
}
|
|
96
|
-
get nodeValue() {
|
|
97
|
-
return this.value;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
101
|
-
*
|
|
102
|
-
* @unsupported
|
|
103
|
-
* @implements DOM API: `Attr`
|
|
104
|
-
* @see https://dom.spec.whatwg.org/#ref-for-dom-attr-prefix
|
|
105
|
-
*/
|
|
106
|
-
get prefix() {
|
|
107
|
-
throw new unexpected_call_error_1.default('Not supported "prefix" property');
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* @implements `@markuplint/ml-core` API: `MLAttr`
|
|
111
|
-
*/
|
|
112
|
-
get rule() {
|
|
113
|
-
return this.ownerElement.rule;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* @implements DOM API: `Attr`
|
|
117
|
-
* @see https://dom.spec.whatwg.org/#dom-attr-specified
|
|
118
|
-
*/
|
|
119
|
-
get specified() {
|
|
120
|
-
return true;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* @implements DOM API: `Attr`
|
|
124
|
-
* @see https://dom.spec.whatwg.org/#dom-attr-value
|
|
125
|
-
*/
|
|
126
|
-
get value() {
|
|
127
|
-
return tslib_1.__classPrivateFieldGet(this, _MLAttr_potentialValue, "f");
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* @implements `@markuplint/ml-core` API: `MLAttr`
|
|
131
|
-
*/
|
|
132
|
-
toNormalizeString() {
|
|
133
|
-
if (this.nameNode && this.equal && this.startQuote && this.valueNode && this.endQuote) {
|
|
134
|
-
return (this.nameNode.originRaw +
|
|
135
|
-
this.equal.originRaw +
|
|
136
|
-
this.startQuote.originRaw +
|
|
137
|
-
this.valueNode.originRaw +
|
|
138
|
-
this.endQuote.originRaw);
|
|
139
|
-
}
|
|
140
|
-
return this.raw;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
exports.MLAttr = MLAttr;
|
|
144
|
-
_MLAttr_potentialName = new WeakMap(), _MLAttr_potentialValue = new WeakMap();
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { MLDocument } from './document';
|
|
2
|
-
import type { MLElement } from './element';
|
|
3
|
-
import type { MarkuplintPreprocessorBlockType } from './types';
|
|
4
|
-
import type { MLASTPreprocessorSpecificBlock } from '@markuplint/ml-ast';
|
|
5
|
-
import type { RuleConfigValue } from '@markuplint/ml-config';
|
|
6
|
-
import { MLNode } from './node';
|
|
7
|
-
export declare class MLBlock<T extends RuleConfigValue, O = null> extends MLNode<T, O, MLASTPreprocessorSpecificBlock> {
|
|
8
|
-
readonly isTransparent: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Returns a string appropriate for the type of node as `MLBlock`
|
|
11
|
-
*
|
|
12
|
-
* @implements `@markuplint/ml-core` API: `MLBlock`
|
|
13
|
-
*/
|
|
14
|
-
get nodeName(): "#ml-block";
|
|
15
|
-
/**
|
|
16
|
-
* Returns a number appropriate for the type of `MLBlock`
|
|
17
|
-
*
|
|
18
|
-
* @implements `@markuplint/ml-core` API: `MLBlock`
|
|
19
|
-
*/
|
|
20
|
-
get nodeType(): MarkuplintPreprocessorBlockType;
|
|
21
|
-
constructor(astNode: MLASTPreprocessorSpecificBlock, document: MLDocument<T, O>);
|
|
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
|
-
}
|
package/lib/ml-dom/node/block.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MLBlock = void 0;
|
|
4
|
-
const child_node_methods_1 = require("../manipulations/child-node-methods");
|
|
5
|
-
const node_1 = require("./node");
|
|
6
|
-
class MLBlock extends node_1.MLNode {
|
|
7
|
-
constructor(astNode, document) {
|
|
8
|
-
super(astNode, document);
|
|
9
|
-
// TODO:
|
|
10
|
-
this.isTransparent = true;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Returns a string appropriate for the type of node as `MLBlock`
|
|
14
|
-
*
|
|
15
|
-
* @implements `@markuplint/ml-core` API: `MLBlock`
|
|
16
|
-
*/
|
|
17
|
-
get nodeName() {
|
|
18
|
-
return '#ml-block';
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Returns a number appropriate for the type of `MLBlock`
|
|
22
|
-
*
|
|
23
|
-
* @implements `@markuplint/ml-core` API: `MLBlock`
|
|
24
|
-
*/
|
|
25
|
-
get nodeType() {
|
|
26
|
-
return this.MARKUPLINT_PREPROCESSOR_BLOCK;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* @implements DOM API: `ChildNode`
|
|
30
|
-
*/
|
|
31
|
-
after(...nodes) {
|
|
32
|
-
(0, child_node_methods_1.after)(this, ...nodes);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @implements DOM API: `ChildNode`
|
|
36
|
-
*/
|
|
37
|
-
before(...nodes) {
|
|
38
|
-
(0, child_node_methods_1.before)(this, ...nodes);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* @implements DOM API: `ChildNode`
|
|
42
|
-
*/
|
|
43
|
-
remove() {
|
|
44
|
-
(0, child_node_methods_1.remove)(this);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* @implements DOM API: `ChildNode`
|
|
48
|
-
*/
|
|
49
|
-
replaceWith(...nodes) {
|
|
50
|
-
(0, child_node_methods_1.replaceWith)(this, ...nodes);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
exports.MLBlock = MLBlock;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { MLElement } from './element';
|
|
2
|
-
import type { MLASTAbstructNode } from '@markuplint/ml-ast';
|
|
3
|
-
import type { RuleConfigValue } from '@markuplint/ml-config';
|
|
4
|
-
import { MLNode } from './node';
|
|
5
|
-
export declare abstract class MLCharacterData<T extends RuleConfigValue, O = null, A extends MLASTAbstructNode = MLASTAbstructNode> 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;
|
|
57
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MLCharacterData = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const child_node_methods_1 = require("../manipulations/child-node-methods");
|
|
6
|
-
const node_1 = require("./node");
|
|
7
|
-
const unexpected_call_error_1 = tslib_1.__importDefault(require("./unexpected-call-error"));
|
|
8
|
-
class MLCharacterData extends node_1.MLNode {
|
|
9
|
-
/**
|
|
10
|
-
* @implements DOM API: `CharacterData`
|
|
11
|
-
* @see https://dom.spec.whatwg.org/#dom-characterdata-data
|
|
12
|
-
*/
|
|
13
|
-
get data() {
|
|
14
|
-
// TODO:
|
|
15
|
-
return this.raw;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
19
|
-
*
|
|
20
|
-
* @unsupported
|
|
21
|
-
* @implements DOM API: `CharacterData`
|
|
22
|
-
* @see https://dom.spec.whatwg.org/#dom-characterdata-length
|
|
23
|
-
*/
|
|
24
|
-
get length() {
|
|
25
|
-
throw new unexpected_call_error_1.default('Not supported "length" property');
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* The element immediately following the specified one in its parent's children list.
|
|
29
|
-
*
|
|
30
|
-
* @readonly
|
|
31
|
-
* @implements DOM API: `CharacterData`
|
|
32
|
-
* @see https://dom.spec.whatwg.org/#ref-for-dom-nondocumenttypechildnode-nextelementsibling%E2%91%A1
|
|
33
|
-
*/
|
|
34
|
-
get nextElementSibling() {
|
|
35
|
-
return (0, child_node_methods_1.nextElementSibling)(this);
|
|
36
|
-
}
|
|
37
|
-
get nodeValue() {
|
|
38
|
-
return this.data;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* The element immediately prior the specified one in its parent's children list.
|
|
42
|
-
*
|
|
43
|
-
* @readonly
|
|
44
|
-
* @implements DOM API: `CharacterData`
|
|
45
|
-
* @see https://dom.spec.whatwg.org/#ref-for-dom-nondocumenttypechildnode-previouselementsibling%E2%91%A1
|
|
46
|
-
*/
|
|
47
|
-
get previousElementSibling() {
|
|
48
|
-
return (0, child_node_methods_1.previousElementSibling)(this);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* @implements DOM API: `CharacterData`
|
|
52
|
-
*/
|
|
53
|
-
after(...nodes) {
|
|
54
|
-
(0, child_node_methods_1.after)(this, ...nodes);
|
|
55
|
-
}
|
|
56
|
-
// TODO
|
|
57
|
-
appendData(data) { }
|
|
58
|
-
/**
|
|
59
|
-
* @implements DOM API: `CharacterData`
|
|
60
|
-
*/
|
|
61
|
-
before(...nodes) {
|
|
62
|
-
(0, child_node_methods_1.before)(this, ...nodes);
|
|
63
|
-
}
|
|
64
|
-
// TODO
|
|
65
|
-
deleteData(offset, count) { }
|
|
66
|
-
// TODO
|
|
67
|
-
insertData(offset, data) { }
|
|
68
|
-
/**
|
|
69
|
-
* @implements DOM API: `CharacterData`
|
|
70
|
-
*/
|
|
71
|
-
remove() {
|
|
72
|
-
(0, child_node_methods_1.remove)(this);
|
|
73
|
-
}
|
|
74
|
-
// TODO
|
|
75
|
-
replaceData(offset, count, data) { }
|
|
76
|
-
/**
|
|
77
|
-
* @implements DOM API: `CharacterData`
|
|
78
|
-
*/
|
|
79
|
-
replaceWith(...nodes) {
|
|
80
|
-
(0, child_node_methods_1.replaceWith)(this, ...nodes);
|
|
81
|
-
}
|
|
82
|
-
// TODO
|
|
83
|
-
substringData(offset, count) {
|
|
84
|
-
return '';
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
exports.MLCharacterData = MLCharacterData;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { MLBlock } from './block';
|
|
2
|
-
import type { MLCharacterData } from './character-data';
|
|
3
|
-
import type { MLDocumentType } from './document-type';
|
|
4
|
-
import type { MLElement } from './element';
|
|
5
|
-
import type { MLNode } from './node';
|
|
6
|
-
import type { MLText } from './text';
|
|
7
|
-
import type { RuleConfigValue } from '@markuplint/ml-config';
|
|
8
|
-
export declare type MLChildNode<T extends RuleConfigValue, O = null> = MLDocumentType<T, O> | MLCharacterData<T, O> | MLText<T, O> | MLElement<T, O> | MLBlock<T, O>;
|
|
9
|
-
export declare function isChildNode<T extends RuleConfigValue, O = null>(node: MLNode<T, O>): node is MLChildNode<T, O>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isChildNode = void 0;
|
|
4
|
-
function isChildNode(node) {
|
|
5
|
-
return (node.is(node.DOCUMENT_TYPE_NODE) ||
|
|
6
|
-
node.is(node.TEXT_NODE) ||
|
|
7
|
-
node.is(node.ELEMENT_NODE) ||
|
|
8
|
-
node.is(node.MARKUPLINT_PREPROCESSOR_BLOCK));
|
|
9
|
-
}
|
|
10
|
-
exports.isChildNode = isChildNode;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { CommentNodeType } from './types';
|
|
2
|
-
import type { MLASTComment } from '@markuplint/ml-ast';
|
|
3
|
-
import type { RuleConfigValue } from '@markuplint/ml-config';
|
|
4
|
-
import { MLCharacterData } from './character-data';
|
|
5
|
-
export declare class MLComment<T extends RuleConfigValue, O = null> 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;
|
|
17
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MLComment = void 0;
|
|
4
|
-
const character_data_1 = require("./character-data");
|
|
5
|
-
class MLComment extends character_data_1.MLCharacterData {
|
|
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() {
|
|
12
|
-
return '#comment';
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Returns a number appropriate for the type of `Comment`
|
|
16
|
-
*/
|
|
17
|
-
get nodeType() {
|
|
18
|
-
return this.COMMENT_NODE;
|
|
19
|
-
}
|
|
20
|
-
get textContent() {
|
|
21
|
-
return this.nodeValue;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.MLComment = MLComment;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { DocumentFragmentNodeType } from './types';
|
|
2
|
-
import type { MLASTAbstructNode } from '@markuplint/ml-ast';
|
|
3
|
-
import type { RuleConfigValue } from '@markuplint/ml-config';
|
|
4
|
-
import { MLParentNode } from './parent-node';
|
|
5
|
-
export declare class MLDocumentFragment<T extends RuleConfigValue, O = null> extends MLParentNode<T, O, MLASTAbstructNode> 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;
|
|
24
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MLDocumentFragment = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const parent_node_1 = require("./parent-node");
|
|
6
|
-
const unexpected_call_error_1 = tslib_1.__importDefault(require("./unexpected-call-error"));
|
|
7
|
-
class MLDocumentFragment extends parent_node_1.MLParentNode {
|
|
8
|
-
/**
|
|
9
|
-
* Returns a string appropriate for the type of node as `DocumentFragment`
|
|
10
|
-
*
|
|
11
|
-
* @see https://dom.spec.whatwg.org/#ref-for-documentfragment%E2%91%A0%E2%91%A6
|
|
12
|
-
*/
|
|
13
|
-
get nodeName() {
|
|
14
|
-
return '#document-fragment';
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Returns a number appropriate for the type of `DocumentFragment`
|
|
18
|
-
*/
|
|
19
|
-
get nodeType() {
|
|
20
|
-
return this.DOCUMENT_FRAGMENT_NODE;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
24
|
-
*
|
|
25
|
-
* @deprecated
|
|
26
|
-
* @unsupported
|
|
27
|
-
* @implements DOM API: `DocumentFragment`
|
|
28
|
-
*/
|
|
29
|
-
getElementById(elementId) {
|
|
30
|
-
throw new unexpected_call_error_1.default('Not supported "getElementById" method');
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.MLDocumentFragment = MLDocumentFragment;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { MLDocument } from './document';
|
|
2
|
-
import type { MLElement } from './element';
|
|
3
|
-
import type { DocumentTypeNodeType } from './types';
|
|
4
|
-
import type { MLASTDoctype } from '@markuplint/ml-ast';
|
|
5
|
-
import type { RuleConfigValue } from '@markuplint/ml-config';
|
|
6
|
-
import { MLNode } from './node';
|
|
7
|
-
export declare class MLDocumentType<T extends RuleConfigValue, O = null> extends MLNode<T, O, MLASTDoctype> implements DocumentType {
|
|
8
|
-
readonly name: string;
|
|
9
|
-
readonly publicId: string;
|
|
10
|
-
readonly systemId: string;
|
|
11
|
-
/**
|
|
12
|
-
* Returns a string appropriate for the type of node as `DocumentType`
|
|
13
|
-
*
|
|
14
|
-
* @see https://dom.spec.whatwg.org/#ref-for-documenttype%E2%91%A0%E2%93%AA
|
|
15
|
-
*/
|
|
16
|
-
get nodeName(): string;
|
|
17
|
-
/**
|
|
18
|
-
* Returns a number appropriate for the type of `DocumentType`
|
|
19
|
-
*/
|
|
20
|
-
get nodeType(): DocumentTypeNodeType;
|
|
21
|
-
constructor(astNode: MLASTDoctype, document: MLDocument<T, O>);
|
|
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;
|
|
38
|
-
}
|