1 | FS Noderelations
|
2 | ================
|
3 |
|
4 | LabeledStatement:
|
5 | SequenceExpression:
|
6 | LogicalExpression:
|
7 | UnaryExpression:
|
8 | ArrayPattern:
|
9 | ObjectPattern:
|
10 | AssignmentPattern:
|
11 | RestElement:
|
12 | TryStatement:
|
13 | CatchClause:
|
14 | ThrowStatement:
|
15 | SpreadElement:
|
16 | TaggedTemplateExpression:
|
17 | TemplateElement:
|
18 | TemplateLiteral:
|
19 | MetaProperty:
|
20 | SwitchStatement:
|
21 | SwitchCase:
|
22 | DoWhileStatement:
|
23 | ImportNamespaceSpecifier:
|
24 | ImportDeclaration:
|
25 | ImportSpecifier:
|
26 | ImportDefaultSpecifier:
|
27 | ForStatement:
|
28 | ForInStatement:
|
29 | ForOfStatement:
|
30 | UpdateExpression:
|
31 | ExportNamedDeclaration:
|
32 | ExportAllDeclaration:
|
33 | ExportSpecifier:
|
34 | ExportDefaultDeclaration:
|
35 | ConditionalExpression:
|
36 | ClassDeclaration:
|
37 | ClassExpression:
|
38 | ClassBody:
|
39 | MethodDefinition:
|
40 | IfStatement:
|
41 | WhileStatement:
|
42 | NewExpression:
|
43 | MemberExpression:
|
44 | AssignmentExpression:
|
45 | BinaryExpression:
|
46 | ExpressionStatement:
|
47 | AwaitExpression:
|
48 | YieldExpression:
|
49 | ArrowFunctionExpression:
|
50 | FunctionDeclaration:
|
51 | BreakStatement:
|
52 | ContinueStatement:
|
53 | DebuggerStatement:
|
54 | ThisExpression:
|
55 | ReturnStatement:
|
56 | FunctionExpression:
|
57 | ObjectExpression:
|
58 | Property:
|
59 | ArrayExpression:
|
60 | BlockStatement:
|
61 | CallExpression:
|
62 | VariableDeclaration:
|
63 | VariableDeclarator:
|
64 | Program:
|
65 | Literal:
|
66 | Identifier:
|
67 |
|
68 |
|
69 |
|
70 | type BindingPattern = ArrayPattern | ObjectPattern;
|
71 |
|
72 | type Expression = ThisExpression | Identifier | Literal |
|
73 | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | ClassExpression |
|
74 | TaggedTemplateExpression | MemberExpression | Super | MetaProperty |
|
75 | NewExpression | CallExpression | UpdateExpression | AwaitExpression | UnaryExpression |
|
76 | BinaryExpression | LogicalExpression | ConditionalExpression |
|
77 | YieldExpression | AssignmentExpression | SequenceExpression;
|
78 |
|
79 | type ArrayPatternElement = AssignmentPattern | Identifier | BindingPattern | RestElement | null;
|
80 |
|
81 | type ArrayExpressionElement = Expression | SpreadElement;
|
82 |
|
83 | type FunctionParameter = AssignmentPattern | Identifier | BindingPattern;
|
84 |
|
85 | type ArgumentListElement = Expression | SpreadElement;
|
86 |
|
87 | type Statement = BlockStatement | BreakStatement | ContinueStatement |
|
88 | DebuggerStatement | DoWhileStatement | EmptyStatement |
|
89 | ExpressionStatement | ForStatement | ForInStatement |
|
90 | ForOfStatement | FunctionDeclaration | IfStatement |
|
91 | LabeledStatement | ReturnStatement | SwitchStatement |
|
92 | ThrowStatement | TryStatement | VariableDeclaration |
|
93 | WhileStatement | WithStatement;
|
94 |
|
95 | type Declaration = ClassDeclaration | FunctionDeclaration | VariableDeclaration;
|
96 |
|
97 | type StatementListItem = Declaration | Statement;
|
98 |
|
99 | type FunctionParameter = AssignmentPattern | Identifier | BindingPattern;
|
100 |
|
101 | type ModuleItem = ImportDeclaration | ExportDeclaration | StatementListItem;
|
102 |
|
103 | type ImportDeclaration {
|
104 | type: 'ImportDeclaration';
|
105 | specifiers: ImportSpecifier[];
|
106 | source: Literal;
|
107 | }
|
108 |
|
109 | type ExportDeclaration = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration;
|
110 |
|
111 | interface ExportSpecifier {
|
112 | type: 'ExportSpecifier';
|
113 | exported: Identifier;
|
114 | local: Identifier;
|
115 | };
|
116 |
|
117 | interface ExportAllDeclaration {
|
118 | type: 'ExportAllDeclaration';
|
119 | source: Literal;
|
120 | }
|
121 |
|
122 | interface ExportDefaultDeclaration {
|
123 | type: 'ExportDefaultDeclaration';
|
124 | declaration: Identifier | BindingPattern | ClassDeclaration | Expression | FunctionDeclaration;
|
125 | }
|
126 |
|
127 | interface ExportNamedDeclaration {
|
128 | type: 'ExportNamedDeclaration';
|
129 | declaration: ClassDeclaration | FunctionDeclaration | VariableDeclaration;
|
130 | specifiers: ExportSpecifier[];
|
131 | source: Literal;
|
132 | }
|
133 |
|
134 | interface ImportSpecifier {
|
135 | type: 'ImportSpecifier' | 'ImportDefaultSpecifier' | 'ImportNamespaceSpecifier';
|
136 | local: Identifier;
|
137 | imported?: Identifier;
|
138 | }
|
139 |
|
140 | interface Program {
|
141 | type: 'Program';
|
142 | sourceType: 'module';
|
143 | body: ModuleItem[];
|
144 | }
|
145 |
|
146 | interface Program {
|
147 | type: 'Program';
|
148 | sourceType: 'script';
|
149 | body: StatementListItem[];
|
150 | }
|
151 |
|
152 | interface WhileStatement {
|
153 | type: 'WhileStatement';
|
154 | test: Expression;
|
155 | body: Statement;
|
156 | }
|
157 |
|
158 | interface VariableDeclarator {
|
159 | type: 'VariableDeclarator';
|
160 | id: Identifier | BindingPattern;
|
161 | init: Expression | null;
|
162 | }
|
163 |
|
164 | interface VariableDeclaration {
|
165 | type: 'VariableDeclaration';
|
166 | declarations: VariableDeclarator[];
|
167 | kind: 'var' | 'const' | 'let';
|
168 | }
|
169 |
|
170 | interface CatchClause {
|
171 | type: 'CatchClause';
|
172 | param: Identifier | BindingPattern;
|
173 | body: BlockStatement;
|
174 | }
|
175 |
|
176 | interface TryStatement {
|
177 | type: 'TryStatement';
|
178 | block: BlockStatement;
|
179 | handler: CatchClause | null;
|
180 | finalizer: BlockStatement | null;
|
181 | }
|
182 |
|
183 | interface ThrowStatement {
|
184 | type: 'ThrowStatement';
|
185 | argument: Expression;
|
186 | }
|
187 |
|
188 | interface SwitchCase {
|
189 | type: 'SwitchCase';
|
190 | test: Expression;
|
191 | consequent: Statement[];
|
192 | }
|
193 |
|
194 | interface SwitchStatement {
|
195 | type: 'SwitchStatement';
|
196 | discriminant: Expression;
|
197 | cases: SwitchCase[];
|
198 | }
|
199 |
|
200 | interface ReturnStatement {
|
201 | type: 'ReturnStatement';
|
202 | argument: Expression | null;
|
203 | }
|
204 |
|
205 | interface LabeledStatement {
|
206 | type: 'LabeledStatement';
|
207 | label: Identifier;
|
208 | body: Statement;
|
209 | }
|
210 |
|
211 | interface IfStatement {
|
212 | type: 'IfStatement';
|
213 | test: Expression;
|
214 | consequent: Statement;
|
215 | alternate?: Statement;
|
216 | }
|
217 |
|
218 | interface FunctionDeclaration {
|
219 | type: 'FunctionDeclaration';
|
220 | id: Identifier | null;
|
221 | params: FunctionParameter[];
|
222 | body: BlockStatement;
|
223 | generator: boolean;
|
224 | async: boolean;
|
225 | expression: false;
|
226 | }
|
227 |
|
228 | interface ForOfStatement {
|
229 | type: 'ForOfStatement';
|
230 | left: Expression;
|
231 | right: Expression;
|
232 | body: Statement;
|
233 | }
|
234 |
|
235 | interface ForInStatement {
|
236 | type: 'ForInStatement';
|
237 | left: Expression;
|
238 | right: Expression;
|
239 | body: Statement;
|
240 | each: false;
|
241 | }
|
242 |
|
243 | interface ForStatement {
|
244 | type: 'ForStatement';
|
245 | init: Expression | VariableDeclaration | null;
|
246 | test: Expression | null;
|
247 | update: Expression | null;
|
248 | body: Statement;
|
249 | }
|
250 |
|
251 | interface ExpressionStatement {
|
252 | type: 'ExpressionStatement';
|
253 | expression: Expression;
|
254 | directive?: string;
|
255 | }
|
256 |
|
257 | interface EmptyStatement {
|
258 | type: 'EmptyStatement';
|
259 | }
|
260 |
|
261 | interface DoWhileStatement {
|
262 | type: 'DoWhileStatement';
|
263 | body: Statement;
|
264 | test: Expression;
|
265 | }
|
266 |
|
267 | interface DebuggerStatement {
|
268 | type: 'DebuggerStatement';
|
269 | }
|
270 |
|
271 | interface ContinueStatement {
|
272 | type: 'ContinueStatement';
|
273 | label: Identifier | null;
|
274 | }
|
275 |
|
276 | interface ClassDeclaration {
|
277 | type: 'ClassDeclaration';
|
278 | id: Identifier | null;
|
279 | superClass: Identifier | null;
|
280 | body: ClassBody;
|
281 | }
|
282 |
|
283 | interface BreakStatement {
|
284 | type: 'BreakStatement';
|
285 | label: Identifier | null;
|
286 | }
|
287 |
|
288 | interface BlockStatement {
|
289 | type: 'BlockStatement';
|
290 | body: StatementListItem[];
|
291 | }
|
292 |
|
293 | interface SequenceExpression {
|
294 | type: 'SequenceExpression';
|
295 | expressions: Expression[];
|
296 | }
|
297 |
|
298 | interface AssignmentExpression {
|
299 | type: 'AssignmentExpression';
|
300 | operator: '=' | '*=' | '**=' | '/=' | '%=' | '+=' | '-=' |
|
301 | '<<=' | '>>=' | '>>>=' | '&=' | '^=' | '|=';
|
302 | left: Expression;
|
303 | right: Expression;
|
304 | }
|
305 |
|
306 | interface YieldExpression {
|
307 | type: 'YieldExpression';
|
308 | argument: Expression | null;
|
309 | delegate: boolean;
|
310 | }
|
311 |
|
312 | interface ConditionalExpression {
|
313 | type: 'ConditionalExpression';
|
314 | test: Expression;
|
315 | consequent: Statement;
|
316 | alternate?: Statement;
|
317 | }
|
318 |
|
319 | interface LogicalExpression {
|
320 | type: 'LogicalExpression';
|
321 | operator: '||' | '&&';
|
322 | left: Expression;
|
323 | right: Expression;
|
324 | }
|
325 |
|
326 | interface BinaryExpression {
|
327 | type: 'BinaryExpression';
|
328 | operator: 'instanceof' | 'in' | '+' | '-' | '*' | '/' | '%' | '**' |
|
329 | '|' | '^' | '&' | '==' | '!=' | '===' | '!==' |
|
330 | '<' | '>' | '<=' | '<<' | '>>' | '>>>';
|
331 | left: Expression;
|
332 | right: Expression;
|
333 | }
|
334 |
|
335 | interface UnaryExpression {
|
336 | type: 'UnaryExpression';
|
337 | operator: '+' | '-' | '~' | '!' | 'delete' | 'void' | 'typeof';
|
338 | argument: Expression;
|
339 | prefix: true;
|
340 | }
|
341 |
|
342 | interface AwaitExpression {
|
343 | type: 'AwaitExpression';
|
344 | argument: Expression;
|
345 | }
|
346 |
|
347 | interface UpdateExpression {
|
348 | type: 'UpdateExpression';
|
349 | operator: '++' | '--';
|
350 | argument: Expression;
|
351 | prefix: boolean;
|
352 | }
|
353 |
|
354 | interface SpreadElement {
|
355 | type: 'SpreadElement';
|
356 | argument: Expression;
|
357 | }
|
358 |
|
359 | interface CallExpression {
|
360 | type: 'CallExpression';
|
361 | callee: Expression;
|
362 | arguments: ArgumentListElement[];
|
363 | }
|
364 |
|
365 | interface NewExpression {
|
366 | type: 'NewExpression';
|
367 | callee: Expression;
|
368 | arguments: ArgumentListElement[];
|
369 | }
|
370 |
|
371 | interface MetaProperty {
|
372 | type: 'MetaProperty';
|
373 | meta: Identifier;
|
374 | property: Identifier;
|
375 | }
|
376 |
|
377 | interface Super {
|
378 | type: 'Super';
|
379 | }
|
380 |
|
381 | interface MemberExpression {
|
382 | type: 'MemberExpression';
|
383 | computed: boolean;
|
384 | object: Expression;
|
385 | property: Expression;
|
386 | }
|
387 |
|
388 | interface TemplateElement {
|
389 | type: 'TemplateElement';
|
390 | value: { cooked: string; raw: string };
|
391 | tail: boolean;
|
392 | }
|
393 |
|
394 | interface TemplateLiteral {
|
395 | type: 'TemplateLiteral';
|
396 | quasis: TemplateElement[];
|
397 | expressions: Expression[];
|
398 | }
|
399 |
|
400 | interface TaggedTemplateExpression {
|
401 | type: 'TaggedTemplateExpression';
|
402 | readonly tag: Expression;
|
403 | readonly quasi: TemplateLiteral;
|
404 | }
|
405 |
|
406 | interface MethodDefinition {
|
407 | type: 'MethodDefinition';
|
408 | key: Expression | null;
|
409 | computed: boolean;
|
410 | value: FunctionExpression | null;
|
411 | kind: 'method' | 'constructor';
|
412 | static: boolean;
|
413 | }
|
414 |
|
415 | interface ClassBody {
|
416 | type: 'ClassBody';
|
417 | body: MethodDefinition[];
|
418 | }
|
419 |
|
420 | interface ClassExpression {
|
421 | type: 'ClassExpression';
|
422 | id: Identifier | null;
|
423 | superClass: Identifier | null;
|
424 | body: ClassBody;
|
425 | }
|
426 |
|
427 | interface FunctionExpression {
|
428 | type: 'ArrowFunctionExpression';
|
429 | id: Identifier | null;
|
430 | params: FunctionParameter[];
|
431 | body: BlockStatement | Expression;
|
432 | generator: boolean;
|
433 | async: boolean;
|
434 | expression: false;
|
435 | }
|
436 |
|
437 | interface FunctionExpression {
|
438 | type: 'FunctionExpression';
|
439 | id: Identifier | null;
|
440 | params: FunctionParameter[];
|
441 | body: BlockStatement;
|
442 | generator: boolean;
|
443 | async: boolean;
|
444 | expression: boolean;
|
445 | }
|
446 |
|
447 | interface Property {
|
448 | type: 'Property';
|
449 | key: Identifier | Literal;
|
450 | computed: boolean;
|
451 | value: AssignmentPattern | Identifier | BindingPattern | FunctionExpression | null;
|
452 | kind: 'get' | 'set' | 'init';
|
453 | method: false;
|
454 | shorthand: boolean;
|
455 | }
|
456 |
|
457 | interface ObjectExpression {
|
458 | type: 'ObjectExpression';
|
459 | properties: Property[];
|
460 | }
|
461 |
|
462 | interface ArrayPattern {
|
463 | type: 'ArrayPattern';
|
464 | elements: ArrayPatternElement[];
|
465 | }
|
466 |
|
467 | interface RestElement {
|
468 | type: 'RestElement';
|
469 | argument: Identifier | BindingPattern;
|
470 | }
|
471 |
|
472 | interface AssignmentPattern {
|
473 | type: 'AssignmentPattern';
|
474 | left: Identifier | BindingPattern;
|
475 | right: Expression;
|
476 | }
|
477 |
|
478 | interface ObjectPattern {
|
479 | type: 'ObjectPattern';
|
480 | properties: Property[];
|
481 | }
|
482 |
|
483 | interface ThisExpression {
|
484 | type: 'ThisExpression';
|
485 | }
|
486 |
|
487 | interface Identifier {
|
488 | type: 'Identifier';
|
489 | name: string;
|
490 | }
|
491 |
|
492 | interface Literal {
|
493 | type: 'Literal';
|
494 | value: boolean | number | string | RegExp | null;
|
495 | raw: string;
|
496 | regex?: { pattern: string, flags: string };
|
497 | }
|
498 |
|
499 | interface ArrayExpression {
|
500 | type: 'ArrayExpression';
|
501 | elements: ArrayExpressionElement[];
|
502 | }
|