UNPKG

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