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