svg-eslint-parser 0.0.0 → 0.0.2
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/README.md +7 -1
- package/dist/index.cjs +265 -46
- package/dist/index.d.cts +78 -9
- package/dist/index.d.ts +78 -9
- package/dist/index.js +250 -46
- package/package.json +5 -2
package/dist/index.d.cts
CHANGED
|
@@ -16,15 +16,44 @@ declare class ParseError extends SyntaxError {
|
|
|
16
16
|
constructor(message: string, offset: number, line: number, column: number);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* svg comment start
|
|
21
|
+
*/
|
|
22
|
+
declare const COMMENT_START = "<!--";
|
|
23
|
+
/**
|
|
24
|
+
* svg comment end
|
|
25
|
+
*/
|
|
26
|
+
declare const COMMENT_END = "-->";
|
|
27
|
+
/**
|
|
28
|
+
* regexp for open tag start
|
|
29
|
+
* @regex101 https://regex101.com/?regex=%5E%3C%5Cw&flavor=javascript
|
|
30
|
+
*/
|
|
31
|
+
declare const RE_OPEN_TAG_START: RegExp;
|
|
32
|
+
/**
|
|
33
|
+
* regexp for open tag name
|
|
34
|
+
* @regex101 https://regex101.com/?regex=%5E%3C%28%5CS%2B%29&flavor=javascript
|
|
35
|
+
*/
|
|
36
|
+
declare const RE_OPEN_TAG_NAME: RegExp;
|
|
37
|
+
/**
|
|
38
|
+
* regexp for close tag name
|
|
39
|
+
* @regex101 https://regex101.com/?regex=%5E%3C%5C%2F%28%28%3F%3A.%7C%5Cn%29*%29%3E%24&flavor=javascript
|
|
40
|
+
*/
|
|
41
|
+
declare const RE_CLOSE_TAG_NAME: RegExp;
|
|
42
|
+
/**
|
|
43
|
+
* regexp for incomplete closing tag
|
|
44
|
+
* @regex101 https://regex101.com/?regex=%3C%5C%2F%5B%5E%3E%5D%2B%24&flavor=javascript
|
|
45
|
+
*/
|
|
46
|
+
declare const RE_INCOMPLETE_CLOSING_TAG: RegExp;
|
|
47
|
+
|
|
19
48
|
declare enum NodeTypes {
|
|
20
49
|
Program = "Program",
|
|
21
50
|
Document = "Document",
|
|
22
51
|
Text = "Text",
|
|
52
|
+
XMLDeclaration = "XMLDeclaration",
|
|
23
53
|
Doctype = "Doctype",
|
|
24
54
|
DoctypeOpen = "DoctypeOpen",
|
|
25
55
|
DoctypeClose = "DoctypeClose",
|
|
26
56
|
DoctypeAttribute = "DoctypeAttribute",
|
|
27
|
-
DoctypeAttributeKey = "DoctypeAttributeKey",
|
|
28
57
|
DoctypeAttributeValue = "DoctypeAttributeValue",
|
|
29
58
|
DoctypeAttributeWrapperEnd = "DoctypeAttributeWrapperEnd",
|
|
30
59
|
DoctypeAttributeWrapperStart = "DoctypeAttributeWrapperStart",
|
|
@@ -69,6 +98,40 @@ declare enum TokenTypes {
|
|
|
69
98
|
AttributeValueWrapperEnd = "AttributeValueWrapperEnd"
|
|
70
99
|
}
|
|
71
100
|
|
|
101
|
+
declare const SPECIAL_CHAR: {
|
|
102
|
+
closingCorner: string;
|
|
103
|
+
colon: string;
|
|
104
|
+
comma: string;
|
|
105
|
+
doubleQuote: string;
|
|
106
|
+
equal: string;
|
|
107
|
+
exclamation: string;
|
|
108
|
+
hyphen: string;
|
|
109
|
+
newline: string;
|
|
110
|
+
openingCorner: string;
|
|
111
|
+
question: string;
|
|
112
|
+
return: string;
|
|
113
|
+
singleQuote: string;
|
|
114
|
+
slash: string;
|
|
115
|
+
space: string;
|
|
116
|
+
tab: string;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @copyright {@link https://github.com/davidohlin/svg-elements}
|
|
121
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Element}
|
|
122
|
+
*/
|
|
123
|
+
declare const SVG_ELEMENTS: Set<string>;
|
|
124
|
+
/**
|
|
125
|
+
* obsolete and deprecated elements
|
|
126
|
+
*
|
|
127
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Element#obsolete_and_deprecated_elements}
|
|
128
|
+
*/
|
|
129
|
+
declare const DEPRECATED_SVG_ELEMENTS: Set<string>;
|
|
130
|
+
/**
|
|
131
|
+
* self closing svg elements
|
|
132
|
+
*/
|
|
133
|
+
declare const SELF_CLOSING_ELEMENTS: Set<string>;
|
|
134
|
+
|
|
72
135
|
declare enum TokenizerContextTypes {
|
|
73
136
|
Data = "Data",
|
|
74
137
|
OpenTagStart = "OpenTagStart",
|
|
@@ -182,9 +245,7 @@ type CommentOpenNode = SimpleNode<NodeTypes.CommentOpen>;
|
|
|
182
245
|
/**
|
|
183
246
|
* doctype
|
|
184
247
|
*/
|
|
185
|
-
type DoctypeAttributeKeyNode = SimpleNode<NodeTypes.DoctypeAttributeKey>;
|
|
186
248
|
interface DoctypeAttributeNode extends BaseNode {
|
|
187
|
-
key: DoctypeAttributeKeyNode;
|
|
188
249
|
type: NodeTypes.DoctypeAttribute;
|
|
189
250
|
endWrapper?: DoctypeAttributeWrapperEndNode;
|
|
190
251
|
startWrapper?: DoctypeAttributeWrapperStartNode;
|
|
@@ -206,6 +267,13 @@ interface DocumentNode extends BaseNode {
|
|
|
206
267
|
type: NodeTypes.Document;
|
|
207
268
|
}
|
|
208
269
|
type TextNode = SimpleNode<NodeTypes.Text>;
|
|
270
|
+
interface XMLDeclarationNode extends BaseNode {
|
|
271
|
+
/**
|
|
272
|
+
* TODO: create XMLDeclarationAttributeNode
|
|
273
|
+
*/
|
|
274
|
+
attributes: AttributeNode[];
|
|
275
|
+
type: NodeTypes.XMLDeclaration;
|
|
276
|
+
}
|
|
209
277
|
/**
|
|
210
278
|
* tag
|
|
211
279
|
*/
|
|
@@ -234,11 +302,11 @@ interface Program extends BaseNode {
|
|
|
234
302
|
/**
|
|
235
303
|
* nestable node
|
|
236
304
|
*/
|
|
237
|
-
type NestableNode = CommentNode | TagNode | TextNode;
|
|
305
|
+
type NestableNode = CommentNode | TagNode | TextNode | XMLDeclarationNode;
|
|
238
306
|
/**
|
|
239
307
|
* any node
|
|
240
308
|
*/
|
|
241
|
-
type AnyNode = AttributeKeyNode | AttributeNode | AttributeValueNode | AttributeValueWrapperEndNode | AttributeValueWrapperStartNode | CloseTagNode | CommentCloseNode | CommentContentNode | CommentNode | CommentOpenNode |
|
|
309
|
+
type AnyNode = AttributeKeyNode | AttributeNode | AttributeValueNode | AttributeValueWrapperEndNode | AttributeValueWrapperStartNode | CloseTagNode | CommentCloseNode | CommentContentNode | CommentNode | CommentOpenNode | DoctypeAttributeNode | DoctypeAttributeValueNode | DoctypeAttributeWrapperEndNode | DoctypeAttributeWrapperStartNode | DoctypeCloseNode | DoctypeNode | DoctypeOpenNode | DocumentNode | OpenTagEndNode | OpenTagStartNode | Program | TagNode | TextNode | XMLDeclarationNode;
|
|
242
310
|
|
|
243
311
|
interface Options {
|
|
244
312
|
}
|
|
@@ -257,7 +325,7 @@ interface ParseResult {
|
|
|
257
325
|
type AnyContextualNode = ContextualAttributeNode | ContextualCommentNode | ContextualDoctypeAttributeNode | ContextualDoctypeNode | ContextualDocumentNode | ContextualTagNode;
|
|
258
326
|
type ContextualAttributeNode = ContextualNode<AttributeNode, 'key' | 'value'>;
|
|
259
327
|
type ContextualCommentNode = ContextualNode<CommentNode, 'close' | 'open' | 'value'>;
|
|
260
|
-
type ContextualDoctypeAttributeNode = ContextualNode<DoctypeAttributeNode, '
|
|
328
|
+
type ContextualDoctypeAttributeNode = ContextualNode<DoctypeAttributeNode, 'value'>;
|
|
261
329
|
type ContextualDoctypeNode = ContextualNode<DoctypeNode, 'close' | 'open'> & {
|
|
262
330
|
attributes: ContextualDoctypeAttributeNode[];
|
|
263
331
|
};
|
|
@@ -378,7 +446,6 @@ type index_ContextualDoctypeNode = ContextualDoctypeNode;
|
|
|
378
446
|
type index_ContextualDocumentNode = ContextualDocumentNode;
|
|
379
447
|
type index_ContextualNode<T extends AnyNode, K extends keyof T> = ContextualNode<T, K>;
|
|
380
448
|
type index_ContextualTagNode = ContextualTagNode;
|
|
381
|
-
type index_DoctypeAttributeKeyNode = DoctypeAttributeKeyNode;
|
|
382
449
|
type index_DoctypeAttributeNode = DoctypeAttributeNode;
|
|
383
450
|
type index_DoctypeAttributeValueNode = DoctypeAttributeValueNode;
|
|
384
451
|
type index_DoctypeAttributeWrapperEndNode = DoctypeAttributeWrapperEndNode;
|
|
@@ -405,8 +472,9 @@ type index_TextNode = TextNode;
|
|
|
405
472
|
type index_Token<T extends TokenTypes> = Token<T>;
|
|
406
473
|
type index_TokenizeHandler = TokenizeHandler;
|
|
407
474
|
type index_TokenizerState = TokenizerState;
|
|
475
|
+
type index_XMLDeclarationNode = XMLDeclarationNode;
|
|
408
476
|
declare namespace index {
|
|
409
|
-
export type { index_AnyContextualNode as AnyContextualNode, index_AnyNode as AnyNode, index_AnyToken as AnyToken, index_AttributeKeyNode as AttributeKeyNode, index_AttributeNode as AttributeNode, index_AttributeValueNode as AttributeValueNode, index_AttributeValueWrapperEndNode as AttributeValueWrapperEndNode, index_AttributeValueWrapperStartNode as AttributeValueWrapperStartNode, index_BaseNode as BaseNode, index_CloseTagNode as CloseTagNode, index_CommentCloseNode as CommentCloseNode, index_CommentContentNode as CommentContentNode, index_CommentNode as CommentNode, index_CommentOpenNode as CommentOpenNode, index_ConstructTreeHandler as ConstructTreeHandler, index_ConstructTreeState as ConstructTreeState, index_ContextualAttributeNode as ContextualAttributeNode, index_ContextualCommentNode as ContextualCommentNode, index_ContextualDoctypeAttributeNode as ContextualDoctypeAttributeNode, index_ContextualDoctypeNode as ContextualDoctypeNode, index_ContextualDocumentNode as ContextualDocumentNode, index_ContextualNode as ContextualNode, index_ContextualTagNode as ContextualTagNode,
|
|
477
|
+
export type { index_AnyContextualNode as AnyContextualNode, index_AnyNode as AnyNode, index_AnyToken as AnyToken, index_AttributeKeyNode as AttributeKeyNode, index_AttributeNode as AttributeNode, index_AttributeValueNode as AttributeValueNode, index_AttributeValueWrapperEndNode as AttributeValueWrapperEndNode, index_AttributeValueWrapperStartNode as AttributeValueWrapperStartNode, index_BaseNode as BaseNode, index_CloseTagNode as CloseTagNode, index_CommentCloseNode as CommentCloseNode, index_CommentContentNode as CommentContentNode, index_CommentNode as CommentNode, index_CommentOpenNode as CommentOpenNode, index_ConstructTreeHandler as ConstructTreeHandler, index_ConstructTreeState as ConstructTreeState, index_ContextualAttributeNode as ContextualAttributeNode, index_ContextualCommentNode as ContextualCommentNode, index_ContextualDoctypeAttributeNode as ContextualDoctypeAttributeNode, index_ContextualDoctypeNode as ContextualDoctypeNode, index_ContextualDocumentNode as ContextualDocumentNode, index_ContextualNode as ContextualNode, index_ContextualTagNode as ContextualTagNode, index_DoctypeAttributeNode as DoctypeAttributeNode, index_DoctypeAttributeValueNode as DoctypeAttributeValueNode, index_DoctypeAttributeWrapperEndNode as DoctypeAttributeWrapperEndNode, index_DoctypeAttributeWrapperStartNode as DoctypeAttributeWrapperStartNode, index_DoctypeCloseNode as DoctypeCloseNode, index_DoctypeNode as DoctypeNode, index_DoctypeOpenNode as DoctypeOpenNode, index_DocumentNode as DocumentNode, index_Locations as Locations, index_NestableNode as NestableNode, index_OpenTagEndNode as OpenTagEndNode, index_OpenTagStartNode as OpenTagStartNode, index_Options as Options, index_ParseForESLintResult as ParseForESLintResult, index_ParseResult as ParseResult, index_PartialBy as PartialBy, index_Position as Position, index_Program as Program, index_Range as Range, index_SimpleNode as SimpleNode, index_SourceLocation as SourceLocation, index_TagNode as TagNode, index_TextNode as TextNode, index_Token as Token, index_TokenizeHandler as TokenizeHandler, index_TokenizerState as TokenizerState, index_XMLDeclarationNode as XMLDeclarationNode };
|
|
410
478
|
}
|
|
411
479
|
|
|
412
480
|
declare function parseForESLint(source: string, options?: Options): ParseForESLintResult;
|
|
@@ -414,5 +482,6 @@ declare function parseForESLint(source: string, options?: Options): ParseForESLi
|
|
|
414
482
|
declare function parseSVG(code: string, options?: Options): Program;
|
|
415
483
|
declare const name: string;
|
|
416
484
|
declare const VisitorKeys: eslint.SourceCode.VisitorKeys;
|
|
485
|
+
declare const parse: typeof parseSVG;
|
|
417
486
|
|
|
418
|
-
export { index as AST, ParseError, VisitorKeys, meta, name, parseForESLint, parseSVG };
|
|
487
|
+
export { index as AST, type AnyContextualNode, type AnyNode, type AnyToken, type AttributeKeyNode, type AttributeNode, type AttributeValueNode, type AttributeValueWrapperEndNode, type AttributeValueWrapperStartNode, type BaseNode, COMMENT_END, COMMENT_START, type CloseTagNode, type CommentCloseNode, type CommentContentNode, type CommentNode, type CommentOpenNode, ConstructTreeContextTypes, type ConstructTreeHandler, type ConstructTreeState, type ContextualAttributeNode, type ContextualCommentNode, type ContextualDoctypeAttributeNode, type ContextualDoctypeNode, type ContextualDocumentNode, type ContextualNode, type ContextualTagNode, DEPRECATED_SVG_ELEMENTS, type DoctypeAttributeNode, type DoctypeAttributeValueNode, type DoctypeAttributeWrapperEndNode, type DoctypeAttributeWrapperStartNode, type DoctypeCloseNode, type DoctypeNode, type DoctypeOpenNode, type DocumentNode, type Locations, type NestableNode, NodeTypes, type OpenTagEndNode, type OpenTagStartNode, type Options, ParseError, type ParseForESLintResult, type ParseResult, type PartialBy, type Position, type Program, RE_CLOSE_TAG_NAME, RE_INCOMPLETE_CLOSING_TAG, RE_OPEN_TAG_NAME, RE_OPEN_TAG_START, type Range, SELF_CLOSING_ELEMENTS, SPECIAL_CHAR, SVG_ELEMENTS, type SimpleNode, type SourceLocation, type TagNode, type TextNode, type Token, TokenTypes, type TokenizeHandler, TokenizerContextTypes, type TokenizerState, VisitorKeys, type XMLDeclarationNode, meta, name, parse, parseForESLint, parseSVG };
|
package/dist/index.d.ts
CHANGED
|
@@ -16,15 +16,44 @@ declare class ParseError extends SyntaxError {
|
|
|
16
16
|
constructor(message: string, offset: number, line: number, column: number);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* svg comment start
|
|
21
|
+
*/
|
|
22
|
+
declare const COMMENT_START = "<!--";
|
|
23
|
+
/**
|
|
24
|
+
* svg comment end
|
|
25
|
+
*/
|
|
26
|
+
declare const COMMENT_END = "-->";
|
|
27
|
+
/**
|
|
28
|
+
* regexp for open tag start
|
|
29
|
+
* @regex101 https://regex101.com/?regex=%5E%3C%5Cw&flavor=javascript
|
|
30
|
+
*/
|
|
31
|
+
declare const RE_OPEN_TAG_START: RegExp;
|
|
32
|
+
/**
|
|
33
|
+
* regexp for open tag name
|
|
34
|
+
* @regex101 https://regex101.com/?regex=%5E%3C%28%5CS%2B%29&flavor=javascript
|
|
35
|
+
*/
|
|
36
|
+
declare const RE_OPEN_TAG_NAME: RegExp;
|
|
37
|
+
/**
|
|
38
|
+
* regexp for close tag name
|
|
39
|
+
* @regex101 https://regex101.com/?regex=%5E%3C%5C%2F%28%28%3F%3A.%7C%5Cn%29*%29%3E%24&flavor=javascript
|
|
40
|
+
*/
|
|
41
|
+
declare const RE_CLOSE_TAG_NAME: RegExp;
|
|
42
|
+
/**
|
|
43
|
+
* regexp for incomplete closing tag
|
|
44
|
+
* @regex101 https://regex101.com/?regex=%3C%5C%2F%5B%5E%3E%5D%2B%24&flavor=javascript
|
|
45
|
+
*/
|
|
46
|
+
declare const RE_INCOMPLETE_CLOSING_TAG: RegExp;
|
|
47
|
+
|
|
19
48
|
declare enum NodeTypes {
|
|
20
49
|
Program = "Program",
|
|
21
50
|
Document = "Document",
|
|
22
51
|
Text = "Text",
|
|
52
|
+
XMLDeclaration = "XMLDeclaration",
|
|
23
53
|
Doctype = "Doctype",
|
|
24
54
|
DoctypeOpen = "DoctypeOpen",
|
|
25
55
|
DoctypeClose = "DoctypeClose",
|
|
26
56
|
DoctypeAttribute = "DoctypeAttribute",
|
|
27
|
-
DoctypeAttributeKey = "DoctypeAttributeKey",
|
|
28
57
|
DoctypeAttributeValue = "DoctypeAttributeValue",
|
|
29
58
|
DoctypeAttributeWrapperEnd = "DoctypeAttributeWrapperEnd",
|
|
30
59
|
DoctypeAttributeWrapperStart = "DoctypeAttributeWrapperStart",
|
|
@@ -69,6 +98,40 @@ declare enum TokenTypes {
|
|
|
69
98
|
AttributeValueWrapperEnd = "AttributeValueWrapperEnd"
|
|
70
99
|
}
|
|
71
100
|
|
|
101
|
+
declare const SPECIAL_CHAR: {
|
|
102
|
+
closingCorner: string;
|
|
103
|
+
colon: string;
|
|
104
|
+
comma: string;
|
|
105
|
+
doubleQuote: string;
|
|
106
|
+
equal: string;
|
|
107
|
+
exclamation: string;
|
|
108
|
+
hyphen: string;
|
|
109
|
+
newline: string;
|
|
110
|
+
openingCorner: string;
|
|
111
|
+
question: string;
|
|
112
|
+
return: string;
|
|
113
|
+
singleQuote: string;
|
|
114
|
+
slash: string;
|
|
115
|
+
space: string;
|
|
116
|
+
tab: string;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @copyright {@link https://github.com/davidohlin/svg-elements}
|
|
121
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Element}
|
|
122
|
+
*/
|
|
123
|
+
declare const SVG_ELEMENTS: Set<string>;
|
|
124
|
+
/**
|
|
125
|
+
* obsolete and deprecated elements
|
|
126
|
+
*
|
|
127
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Element#obsolete_and_deprecated_elements}
|
|
128
|
+
*/
|
|
129
|
+
declare const DEPRECATED_SVG_ELEMENTS: Set<string>;
|
|
130
|
+
/**
|
|
131
|
+
* self closing svg elements
|
|
132
|
+
*/
|
|
133
|
+
declare const SELF_CLOSING_ELEMENTS: Set<string>;
|
|
134
|
+
|
|
72
135
|
declare enum TokenizerContextTypes {
|
|
73
136
|
Data = "Data",
|
|
74
137
|
OpenTagStart = "OpenTagStart",
|
|
@@ -182,9 +245,7 @@ type CommentOpenNode = SimpleNode<NodeTypes.CommentOpen>;
|
|
|
182
245
|
/**
|
|
183
246
|
* doctype
|
|
184
247
|
*/
|
|
185
|
-
type DoctypeAttributeKeyNode = SimpleNode<NodeTypes.DoctypeAttributeKey>;
|
|
186
248
|
interface DoctypeAttributeNode extends BaseNode {
|
|
187
|
-
key: DoctypeAttributeKeyNode;
|
|
188
249
|
type: NodeTypes.DoctypeAttribute;
|
|
189
250
|
endWrapper?: DoctypeAttributeWrapperEndNode;
|
|
190
251
|
startWrapper?: DoctypeAttributeWrapperStartNode;
|
|
@@ -206,6 +267,13 @@ interface DocumentNode extends BaseNode {
|
|
|
206
267
|
type: NodeTypes.Document;
|
|
207
268
|
}
|
|
208
269
|
type TextNode = SimpleNode<NodeTypes.Text>;
|
|
270
|
+
interface XMLDeclarationNode extends BaseNode {
|
|
271
|
+
/**
|
|
272
|
+
* TODO: create XMLDeclarationAttributeNode
|
|
273
|
+
*/
|
|
274
|
+
attributes: AttributeNode[];
|
|
275
|
+
type: NodeTypes.XMLDeclaration;
|
|
276
|
+
}
|
|
209
277
|
/**
|
|
210
278
|
* tag
|
|
211
279
|
*/
|
|
@@ -234,11 +302,11 @@ interface Program extends BaseNode {
|
|
|
234
302
|
/**
|
|
235
303
|
* nestable node
|
|
236
304
|
*/
|
|
237
|
-
type NestableNode = CommentNode | TagNode | TextNode;
|
|
305
|
+
type NestableNode = CommentNode | TagNode | TextNode | XMLDeclarationNode;
|
|
238
306
|
/**
|
|
239
307
|
* any node
|
|
240
308
|
*/
|
|
241
|
-
type AnyNode = AttributeKeyNode | AttributeNode | AttributeValueNode | AttributeValueWrapperEndNode | AttributeValueWrapperStartNode | CloseTagNode | CommentCloseNode | CommentContentNode | CommentNode | CommentOpenNode |
|
|
309
|
+
type AnyNode = AttributeKeyNode | AttributeNode | AttributeValueNode | AttributeValueWrapperEndNode | AttributeValueWrapperStartNode | CloseTagNode | CommentCloseNode | CommentContentNode | CommentNode | CommentOpenNode | DoctypeAttributeNode | DoctypeAttributeValueNode | DoctypeAttributeWrapperEndNode | DoctypeAttributeWrapperStartNode | DoctypeCloseNode | DoctypeNode | DoctypeOpenNode | DocumentNode | OpenTagEndNode | OpenTagStartNode | Program | TagNode | TextNode | XMLDeclarationNode;
|
|
242
310
|
|
|
243
311
|
interface Options {
|
|
244
312
|
}
|
|
@@ -257,7 +325,7 @@ interface ParseResult {
|
|
|
257
325
|
type AnyContextualNode = ContextualAttributeNode | ContextualCommentNode | ContextualDoctypeAttributeNode | ContextualDoctypeNode | ContextualDocumentNode | ContextualTagNode;
|
|
258
326
|
type ContextualAttributeNode = ContextualNode<AttributeNode, 'key' | 'value'>;
|
|
259
327
|
type ContextualCommentNode = ContextualNode<CommentNode, 'close' | 'open' | 'value'>;
|
|
260
|
-
type ContextualDoctypeAttributeNode = ContextualNode<DoctypeAttributeNode, '
|
|
328
|
+
type ContextualDoctypeAttributeNode = ContextualNode<DoctypeAttributeNode, 'value'>;
|
|
261
329
|
type ContextualDoctypeNode = ContextualNode<DoctypeNode, 'close' | 'open'> & {
|
|
262
330
|
attributes: ContextualDoctypeAttributeNode[];
|
|
263
331
|
};
|
|
@@ -378,7 +446,6 @@ type index_ContextualDoctypeNode = ContextualDoctypeNode;
|
|
|
378
446
|
type index_ContextualDocumentNode = ContextualDocumentNode;
|
|
379
447
|
type index_ContextualNode<T extends AnyNode, K extends keyof T> = ContextualNode<T, K>;
|
|
380
448
|
type index_ContextualTagNode = ContextualTagNode;
|
|
381
|
-
type index_DoctypeAttributeKeyNode = DoctypeAttributeKeyNode;
|
|
382
449
|
type index_DoctypeAttributeNode = DoctypeAttributeNode;
|
|
383
450
|
type index_DoctypeAttributeValueNode = DoctypeAttributeValueNode;
|
|
384
451
|
type index_DoctypeAttributeWrapperEndNode = DoctypeAttributeWrapperEndNode;
|
|
@@ -405,8 +472,9 @@ type index_TextNode = TextNode;
|
|
|
405
472
|
type index_Token<T extends TokenTypes> = Token<T>;
|
|
406
473
|
type index_TokenizeHandler = TokenizeHandler;
|
|
407
474
|
type index_TokenizerState = TokenizerState;
|
|
475
|
+
type index_XMLDeclarationNode = XMLDeclarationNode;
|
|
408
476
|
declare namespace index {
|
|
409
|
-
export type { index_AnyContextualNode as AnyContextualNode, index_AnyNode as AnyNode, index_AnyToken as AnyToken, index_AttributeKeyNode as AttributeKeyNode, index_AttributeNode as AttributeNode, index_AttributeValueNode as AttributeValueNode, index_AttributeValueWrapperEndNode as AttributeValueWrapperEndNode, index_AttributeValueWrapperStartNode as AttributeValueWrapperStartNode, index_BaseNode as BaseNode, index_CloseTagNode as CloseTagNode, index_CommentCloseNode as CommentCloseNode, index_CommentContentNode as CommentContentNode, index_CommentNode as CommentNode, index_CommentOpenNode as CommentOpenNode, index_ConstructTreeHandler as ConstructTreeHandler, index_ConstructTreeState as ConstructTreeState, index_ContextualAttributeNode as ContextualAttributeNode, index_ContextualCommentNode as ContextualCommentNode, index_ContextualDoctypeAttributeNode as ContextualDoctypeAttributeNode, index_ContextualDoctypeNode as ContextualDoctypeNode, index_ContextualDocumentNode as ContextualDocumentNode, index_ContextualNode as ContextualNode, index_ContextualTagNode as ContextualTagNode,
|
|
477
|
+
export type { index_AnyContextualNode as AnyContextualNode, index_AnyNode as AnyNode, index_AnyToken as AnyToken, index_AttributeKeyNode as AttributeKeyNode, index_AttributeNode as AttributeNode, index_AttributeValueNode as AttributeValueNode, index_AttributeValueWrapperEndNode as AttributeValueWrapperEndNode, index_AttributeValueWrapperStartNode as AttributeValueWrapperStartNode, index_BaseNode as BaseNode, index_CloseTagNode as CloseTagNode, index_CommentCloseNode as CommentCloseNode, index_CommentContentNode as CommentContentNode, index_CommentNode as CommentNode, index_CommentOpenNode as CommentOpenNode, index_ConstructTreeHandler as ConstructTreeHandler, index_ConstructTreeState as ConstructTreeState, index_ContextualAttributeNode as ContextualAttributeNode, index_ContextualCommentNode as ContextualCommentNode, index_ContextualDoctypeAttributeNode as ContextualDoctypeAttributeNode, index_ContextualDoctypeNode as ContextualDoctypeNode, index_ContextualDocumentNode as ContextualDocumentNode, index_ContextualNode as ContextualNode, index_ContextualTagNode as ContextualTagNode, index_DoctypeAttributeNode as DoctypeAttributeNode, index_DoctypeAttributeValueNode as DoctypeAttributeValueNode, index_DoctypeAttributeWrapperEndNode as DoctypeAttributeWrapperEndNode, index_DoctypeAttributeWrapperStartNode as DoctypeAttributeWrapperStartNode, index_DoctypeCloseNode as DoctypeCloseNode, index_DoctypeNode as DoctypeNode, index_DoctypeOpenNode as DoctypeOpenNode, index_DocumentNode as DocumentNode, index_Locations as Locations, index_NestableNode as NestableNode, index_OpenTagEndNode as OpenTagEndNode, index_OpenTagStartNode as OpenTagStartNode, index_Options as Options, index_ParseForESLintResult as ParseForESLintResult, index_ParseResult as ParseResult, index_PartialBy as PartialBy, index_Position as Position, index_Program as Program, index_Range as Range, index_SimpleNode as SimpleNode, index_SourceLocation as SourceLocation, index_TagNode as TagNode, index_TextNode as TextNode, index_Token as Token, index_TokenizeHandler as TokenizeHandler, index_TokenizerState as TokenizerState, index_XMLDeclarationNode as XMLDeclarationNode };
|
|
410
478
|
}
|
|
411
479
|
|
|
412
480
|
declare function parseForESLint(source: string, options?: Options): ParseForESLintResult;
|
|
@@ -414,5 +482,6 @@ declare function parseForESLint(source: string, options?: Options): ParseForESLi
|
|
|
414
482
|
declare function parseSVG(code: string, options?: Options): Program;
|
|
415
483
|
declare const name: string;
|
|
416
484
|
declare const VisitorKeys: eslint.SourceCode.VisitorKeys;
|
|
485
|
+
declare const parse: typeof parseSVG;
|
|
417
486
|
|
|
418
|
-
export { index as AST, ParseError, VisitorKeys, meta, name, parseForESLint, parseSVG };
|
|
487
|
+
export { index as AST, type AnyContextualNode, type AnyNode, type AnyToken, type AttributeKeyNode, type AttributeNode, type AttributeValueNode, type AttributeValueWrapperEndNode, type AttributeValueWrapperStartNode, type BaseNode, COMMENT_END, COMMENT_START, type CloseTagNode, type CommentCloseNode, type CommentContentNode, type CommentNode, type CommentOpenNode, ConstructTreeContextTypes, type ConstructTreeHandler, type ConstructTreeState, type ContextualAttributeNode, type ContextualCommentNode, type ContextualDoctypeAttributeNode, type ContextualDoctypeNode, type ContextualDocumentNode, type ContextualNode, type ContextualTagNode, DEPRECATED_SVG_ELEMENTS, type DoctypeAttributeNode, type DoctypeAttributeValueNode, type DoctypeAttributeWrapperEndNode, type DoctypeAttributeWrapperStartNode, type DoctypeCloseNode, type DoctypeNode, type DoctypeOpenNode, type DocumentNode, type Locations, type NestableNode, NodeTypes, type OpenTagEndNode, type OpenTagStartNode, type Options, ParseError, type ParseForESLintResult, type ParseResult, type PartialBy, type Position, type Program, RE_CLOSE_TAG_NAME, RE_INCOMPLETE_CLOSING_TAG, RE_OPEN_TAG_NAME, RE_OPEN_TAG_START, type Range, SELF_CLOSING_ELEMENTS, SPECIAL_CHAR, SVG_ELEMENTS, type SimpleNode, type SourceLocation, type TagNode, type TextNode, type Token, TokenTypes, type TokenizeHandler, TokenizerContextTypes, type TokenizerState, VisitorKeys, type XMLDeclarationNode, meta, name, parse, parseForESLint, parseSVG };
|