1 | export interface NamedEntityMap {
|
2 | [name: string]: string;
|
3 | }
|
4 | export interface EntityParser {
|
5 | parse(entity: string): string | undefined;
|
6 | }
|
7 | export interface TokenizerOptions {
|
8 | loc?: boolean;
|
9 | mode?: 'precompile' | 'codemod';
|
10 | }
|
11 | export declare type Attribute = [string, string, boolean];
|
12 | export interface Location {
|
13 | start: {
|
14 | line: number;
|
15 | column: number;
|
16 | };
|
17 | end: {
|
18 | line: number;
|
19 | column: number;
|
20 | };
|
21 | }
|
22 | export interface TokenBase<T extends TokenType> {
|
23 | type: T;
|
24 | syntaxError?: string;
|
25 | loc?: Location;
|
26 | }
|
27 | export interface Doctype extends TokenBase<TokenType.Doctype> {
|
28 | name: string;
|
29 | publicIdentifier?: string;
|
30 | systemIdentifier?: string;
|
31 | }
|
32 | export interface StartTag extends TokenBase<TokenType.StartTag> {
|
33 | tagName: string;
|
34 | attributes: Attribute[];
|
35 | selfClosing: boolean;
|
36 | }
|
37 | export interface EndTag extends TokenBase<TokenType.EndTag> {
|
38 | tagName: string;
|
39 | }
|
40 | export interface Chars extends TokenBase<TokenType.Chars> {
|
41 | chars: string;
|
42 | }
|
43 | export interface Comment extends TokenBase<TokenType.Comment> {
|
44 | chars: string;
|
45 | }
|
46 | export declare type Token = StartTag | EndTag | Chars | Comment | Doctype;
|
47 | export declare const enum TokenType {
|
48 | Doctype = "Doctype",
|
49 | StartTag = "StartTag",
|
50 | EndTag = "EndTag",
|
51 | Chars = "Chars",
|
52 | Comment = "Comment",
|
53 | }
|
54 | export interface TokenMap {
|
55 | StartTag: StartTag;
|
56 | EndTag: EndTag;
|
57 | Chars: Chars;
|
58 | Comment: Comment;
|
59 | Doctype: Doctype;
|
60 | }
|
61 | export interface TokenizerDelegate {
|
62 | reset(): void;
|
63 | finishData(): void;
|
64 | tagOpen(): void;
|
65 | beginDoctype?(): void;
|
66 | appendToDoctypeName?(char: string): void;
|
67 | appendToDoctypePublicIdentifier?(char: string): void;
|
68 | appendToDoctypeSystemIdentifier?(char: string): void;
|
69 | endDoctype?(): void;
|
70 | beginData(): void;
|
71 | appendToData(char: string): void;
|
72 | beginStartTag(): void;
|
73 | appendToTagName(char: string): void;
|
74 | beginAttribute(): void;
|
75 | appendToAttributeName(char: string): void;
|
76 | beginAttributeValue(quoted: boolean): void;
|
77 | appendToAttributeValue(char: string): void;
|
78 | finishAttributeValue(): void;
|
79 | markTagAsSelfClosing(): void;
|
80 | beginEndTag(): void;
|
81 | finishTag(): void;
|
82 | beginComment(): void;
|
83 | appendToCommentData(char: string): void;
|
84 | finishComment(): void;
|
85 | reportSyntaxError(error: string): void;
|
86 | }
|
87 | export { TokenizerState } from './generated/tokenizer-states';
|