1 | export interface Stylesheet {
|
2 | rules: Rule[];
|
3 | }
|
4 | export type Rule = QualifiedRule | AtRule;
|
5 | export interface AtRule {
|
6 | type: 'at-rule';
|
7 | name: string;
|
8 | prelude: InputToken[];
|
9 | block: SimpleBlock;
|
10 | }
|
11 | export interface QualifiedRule {
|
12 | type: 'qualified-rule';
|
13 | prelude: InputToken[];
|
14 | block: SimpleBlock;
|
15 | }
|
16 | export type InputToken = '(' | ')' | '{' | '}' | '[' | ']' | ':' | ';' | ',' | ' ' | '^=' | '|=' | '$=' | '*=' | '~=' | '<!--' | '-->' | undefined | InputTokenObject | FunctionInputToken | FunctionToken | SimpleBlock | AtKeywordToken;
|
17 | export declare const enum TokenObjectType {
|
18 | |
19 |
|
20 |
|
21 | string = 1,
|
22 | |
23 |
|
24 |
|
25 | delim = 2,
|
26 | |
27 |
|
28 |
|
29 | number = 3,
|
30 | |
31 |
|
32 |
|
33 | percentage = 4,
|
34 | |
35 |
|
36 |
|
37 | dimension = 5,
|
38 | |
39 |
|
40 |
|
41 | ident = 6,
|
42 | |
43 |
|
44 |
|
45 | url = 7,
|
46 | |
47 |
|
48 |
|
49 |
|
50 | functionToken = 8,
|
51 | /**
|
52 | * <simple-block>
|
53 | */
|
54 | simpleBlock = 9,
|
55 | /**
|
56 | * <comment-token>
|
57 | */
|
58 | comment = 10,
|
59 | /**
|
60 | * <at-keyword-token>
|
61 | */
|
62 | atKeyword = 11,
|
63 | /**
|
64 | * <hash-token>
|
65 | */
|
66 | hash = 12,
|
67 | /**
|
68 | * <function>
|
69 | * This is a complete consumed function: <function-token>([<component-value> [, <component-value>]*])")"
|
70 | */
|
71 | function = 14
|
72 | }
|
73 | export interface InputTokenObject {
|
74 | type: TokenObjectType;
|
75 | text: string;
|
76 | }
|
77 | /**
|
78 | * This is a "<ident>(" token.
|
79 | */
|
80 | export interface FunctionInputToken extends InputTokenObject {
|
81 | name: string;
|
82 | }
|
83 |
|
84 |
|
85 |
|
86 | export interface FunctionToken extends FunctionInputToken {
|
87 | components: any[];
|
88 | }
|
89 | export interface SimpleBlock extends InputTokenObject {
|
90 | associatedToken: InputToken;
|
91 | values: InputToken[];
|
92 | }
|
93 | export type AtKeywordToken = InputTokenObject;
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 | export declare class CSS3Parser {
|
100 | private text;
|
101 | private nextInputCodePointIndex;
|
102 | private reconsumedInputToken;
|
103 | private topLevelFlag;
|
104 | constructor(text: string);
|
105 | |
106 |
|
107 |
|
108 |
|
109 | tokenize(): InputToken[];
|
110 | |
111 |
|
112 |
|
113 |
|
114 | private consumeAToken;
|
115 | private consumeADelimToken;
|
116 | private consumeAWhitespace;
|
117 | private consumeAHashToken;
|
118 | private consumeCDO;
|
119 | private consumeCDC;
|
120 | private consumeAMatchToken;
|
121 | |
122 |
|
123 |
|
124 |
|
125 | private consumeANumericToken;
|
126 | |
127 |
|
128 |
|
129 |
|
130 | private consumeAnIdentLikeToken;
|
131 | |
132 |
|
133 |
|
134 |
|
135 | private consumeAStringToken;
|
136 | |
137 |
|
138 |
|
139 |
|
140 | private consumeAURLToken;
|
141 | |
142 |
|
143 |
|
144 |
|
145 | private consumeAName;
|
146 | private consumeAtKeyword;
|
147 | private consumeAComment;
|
148 | private reconsumeTheCurrentInputToken;
|
149 | |
150 |
|
151 |
|
152 |
|
153 | parseAStylesheet(): Stylesheet;
|
154 | |
155 |
|
156 |
|
157 |
|
158 | consumeAListOfRules(): Rule[];
|
159 | |
160 |
|
161 |
|
162 |
|
163 | consumeAnAtRule(): AtRule;
|
164 | |
165 |
|
166 |
|
167 |
|
168 | consumeAQualifiedRule(): QualifiedRule;
|
169 | |
170 |
|
171 |
|
172 |
|
173 | private consumeAComponentValue;
|
174 | |
175 |
|
176 |
|
177 |
|
178 | private consumeASimpleBlock;
|
179 | |
180 |
|
181 |
|
182 |
|
183 | private consumeAFunction;
|
184 | }
|
185 |
|
\ | No newline at end of file |