@markuplint/ml-core 3.5.0 → 3.6.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/index.d.ts +11 -1
- package/lib/ml-core.d.ts +22 -11
- package/lib/ml-dom/helper/accname.js +3 -2
- package/lib/ml-dom/helper/create-node.d.ts +5 -1
- package/lib/ml-dom/helper/debug.js +3 -2
- package/lib/ml-dom/helper/getIndent.d.ts +7 -7
- package/lib/ml-dom/helper/getIndent.js +7 -9
- package/lib/ml-dom/helper/walkers.d.ts +14 -4
- package/lib/ml-dom/helper/walkers.js +1 -1
- 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 +93 -90
- package/lib/ml-dom/node/attr.js +3 -3
- package/lib/ml-dom/node/block.d.ts +35 -31
- package/lib/ml-dom/node/character-data.d.ts +59 -52
- package/lib/ml-dom/node/child-node.d.ts +9 -2
- 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 +1600 -1583
- package/lib/ml-dom/node/document.js +15 -12
- package/lib/ml-dom/node/dom-token-list.d.ts +26 -26
- package/lib/ml-dom/node/dom-token-list.js +1 -1
- package/lib/ml-dom/node/element.d.ts +1902 -1896
- package/lib/ml-dom/node/element.js +18 -13
- package/lib/ml-dom/node/named-node-map.d.ts +44 -39
- package/lib/ml-dom/node/named-node-map.js +2 -1
- package/lib/ml-dom/node/node-list.d.ts +9 -3
- package/lib/ml-dom/node/node-list.js +2 -1
- package/lib/ml-dom/node/node-store.d.ts +8 -3
- package/lib/ml-dom/node/node.d.ts +491 -471
- package/lib/ml-dom/node/node.js +6 -3
- package/lib/ml-dom/node/parent-node.d.ts +66 -57
- package/lib/ml-dom/node/parent-node.js +6 -3
- package/lib/ml-dom/node/rule-mapper.d.ts +7 -7
- package/lib/ml-dom/node/rule-mapper.js +2 -1
- package/lib/ml-dom/node/text.d.ts +49 -46
- package/lib/ml-dom/node/types.d.ts +80 -12
- 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-rule.d.ts +3 -1
- 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 +33 -23
- package/lib/ml-rule/ml-rule.js +4 -5
- package/lib/ml-rule/types.d.ts +31 -13
- package/lib/plugin/plugin.d.ts +3 -1
- 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 +8 -8
- package/lib/utils/get-location-from-chars.d.ts +9 -4
- package/package.json +10 -11
|
@@ -2,56 +2,63 @@ import type { MLElement } from './element';
|
|
|
2
2
|
import type { MLASTAbstractNode } from '@markuplint/ml-ast';
|
|
3
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
|
-
|
|
5
|
+
export declare abstract class MLCharacterData<
|
|
6
|
+
T extends RuleConfigValue,
|
|
7
|
+
O extends PlainData = undefined,
|
|
8
|
+
A extends MLASTAbstractNode = MLASTAbstractNode,
|
|
9
|
+
>
|
|
10
|
+
extends MLNode<T, O, A>
|
|
11
|
+
implements CharacterData
|
|
12
|
+
{
|
|
13
|
+
/**
|
|
14
|
+
* @implements DOM API: `CharacterData`
|
|
15
|
+
* @see https://dom.spec.whatwg.org/#dom-characterdata-data
|
|
16
|
+
*/
|
|
17
|
+
get data(): string;
|
|
18
|
+
/**
|
|
19
|
+
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
20
|
+
*
|
|
21
|
+
* @unsupported
|
|
22
|
+
* @implements DOM API: `CharacterData`
|
|
23
|
+
* @see https://dom.spec.whatwg.org/#dom-characterdata-length
|
|
24
|
+
*/
|
|
25
|
+
get length(): number;
|
|
26
|
+
/**
|
|
27
|
+
* The element immediately following the specified one in its parent's children list.
|
|
28
|
+
*
|
|
29
|
+
* @readonly
|
|
30
|
+
* @implements DOM API: `CharacterData`
|
|
31
|
+
* @see https://dom.spec.whatwg.org/#ref-for-dom-nondocumenttypechildnode-nextelementsibling%E2%91%A1
|
|
32
|
+
*/
|
|
33
|
+
get nextElementSibling(): MLElement<T, O> | null;
|
|
34
|
+
get nodeValue(): string | null;
|
|
35
|
+
/**
|
|
36
|
+
* The element immediately prior the specified one in its parent's children list.
|
|
37
|
+
*
|
|
38
|
+
* @readonly
|
|
39
|
+
* @implements DOM API: `CharacterData`
|
|
40
|
+
* @see https://dom.spec.whatwg.org/#ref-for-dom-nondocumenttypechildnode-previouselementsibling%E2%91%A1
|
|
41
|
+
*/
|
|
42
|
+
get previousElementSibling(): MLElement<T, O> | null;
|
|
43
|
+
/**
|
|
44
|
+
* @implements DOM API: `CharacterData`
|
|
45
|
+
*/
|
|
46
|
+
after(...nodes: (string | MLElement<any, any>)[]): void;
|
|
47
|
+
appendData(data: string): void;
|
|
48
|
+
/**
|
|
49
|
+
* @implements DOM API: `CharacterData`
|
|
50
|
+
*/
|
|
51
|
+
before(...nodes: (string | MLElement<any, any>)[]): void;
|
|
52
|
+
deleteData(offset: number, count: number): void;
|
|
53
|
+
insertData(offset: number, data: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* @implements DOM API: `CharacterData`
|
|
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;
|
|
57
64
|
}
|
|
@@ -5,5 +5,12 @@ import type { MLElement } from './element';
|
|
|
5
5
|
import type { MLNode } from './node';
|
|
6
6
|
import type { MLText } from './text';
|
|
7
7
|
import type { PlainData, RuleConfigValue } from '@markuplint/ml-config';
|
|
8
|
-
export type MLChildNode<T extends RuleConfigValue, O extends PlainData = undefined> =
|
|
9
|
-
|
|
8
|
+
export type MLChildNode<T extends RuleConfigValue, O extends PlainData = undefined> =
|
|
9
|
+
| MLDocumentType<T, O>
|
|
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 extends PlainData = undefined>(
|
|
15
|
+
node: MLNode<T, O>,
|
|
16
|
+
): node is MLChildNode<T, O>;
|
|
@@ -2,16 +2,19 @@ import type { CommentNodeType } from './types';
|
|
|
2
2
|
import type { MLASTComment } from '@markuplint/ml-ast';
|
|
3
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 extends PlainData = undefined>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
export declare class MLComment<T extends RuleConfigValue, O extends PlainData = undefined>
|
|
6
|
+
extends MLCharacterData<T, O, MLASTComment>
|
|
7
|
+
implements Comment
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Returns a string appropriate for the type of node as `Attr`
|
|
11
|
+
*
|
|
12
|
+
* @see https://dom.spec.whatwg.org/#ref-for-exclusive-text-node%E2%91%A0
|
|
13
|
+
*/
|
|
14
|
+
get nodeName(): '#comment';
|
|
15
|
+
/**
|
|
16
|
+
* Returns a number appropriate for the type of `Comment`
|
|
17
|
+
*/
|
|
18
|
+
get nodeType(): CommentNodeType;
|
|
19
|
+
get textContent(): string | null;
|
|
17
20
|
}
|
|
@@ -2,23 +2,26 @@ import type { DocumentFragmentNodeType } from './types';
|
|
|
2
2
|
import type { MLASTAbstractNode } from '@markuplint/ml-ast';
|
|
3
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 extends PlainData = undefined>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
export declare class MLDocumentFragment<T extends RuleConfigValue, O extends PlainData = undefined>
|
|
6
|
+
extends MLParentNode<T, O, MLASTAbstractNode>
|
|
7
|
+
implements DocumentFragment
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Returns a string appropriate for the type of node as `DocumentFragment`
|
|
11
|
+
*
|
|
12
|
+
* @see https://dom.spec.whatwg.org/#ref-for-documentfragment%E2%91%A0%E2%91%A6
|
|
13
|
+
*/
|
|
14
|
+
get nodeName(): '#document-fragment';
|
|
15
|
+
/**
|
|
16
|
+
* Returns a number appropriate for the type of `DocumentFragment`
|
|
17
|
+
*/
|
|
18
|
+
get nodeType(): DocumentFragmentNodeType;
|
|
19
|
+
/**
|
|
20
|
+
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
21
|
+
*
|
|
22
|
+
* @deprecated
|
|
23
|
+
* @unsupported
|
|
24
|
+
* @implements DOM API: `DocumentFragment`
|
|
25
|
+
*/
|
|
26
|
+
getElementById(elementId: string): HTMLElement | null;
|
|
24
27
|
}
|
|
@@ -4,35 +4,38 @@ import type { DocumentTypeNodeType } from './types';
|
|
|
4
4
|
import type { MLASTDoctype } from '@markuplint/ml-ast';
|
|
5
5
|
import type { PlainData, RuleConfigValue } from '@markuplint/ml-config';
|
|
6
6
|
import { MLNode } from './node';
|
|
7
|
-
export declare class MLDocumentType<T extends RuleConfigValue, O extends PlainData = undefined>
|
|
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 MLDocumentType<T extends RuleConfigValue, O extends PlainData = undefined>
|
|
8
|
+
extends MLNode<T, O, MLASTDoctype>
|
|
9
|
+
implements DocumentType
|
|
10
|
+
{
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly publicId: string;
|
|
13
|
+
readonly systemId: string;
|
|
14
|
+
constructor(astNode: MLASTDoctype, document: MLDocument<T, O>);
|
|
15
|
+
/**
|
|
16
|
+
* Returns a string appropriate for the type of node as `DocumentType`
|
|
17
|
+
*
|
|
18
|
+
* @see https://dom.spec.whatwg.org/#ref-for-documenttype%E2%91%A0%E2%93%AA
|
|
19
|
+
*/
|
|
20
|
+
get nodeName(): string;
|
|
21
|
+
/**
|
|
22
|
+
* Returns a number appropriate for the type of `DocumentType`
|
|
23
|
+
*/
|
|
24
|
+
get nodeType(): DocumentTypeNodeType;
|
|
25
|
+
/**
|
|
26
|
+
* @implements DOM API: `CharacterData`
|
|
27
|
+
*/
|
|
28
|
+
after(...nodes: (string | MLElement<any, any>)[]): void;
|
|
29
|
+
/**
|
|
30
|
+
* @implements DOM API: `CharacterData`
|
|
31
|
+
*/
|
|
32
|
+
before(...nodes: (string | MLElement<any, any>)[]): void;
|
|
33
|
+
/**
|
|
34
|
+
* @implements DOM API: `CharacterData`
|
|
35
|
+
*/
|
|
36
|
+
remove(): void;
|
|
37
|
+
/**
|
|
38
|
+
* @implements DOM API: `CharacterData`
|
|
39
|
+
*/
|
|
40
|
+
replaceWith(...nodes: (string | MLElement<any, any>)[]): void;
|
|
38
41
|
}
|