@gi-tcg/gts-transpiler 0.6.3 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,502 +1,9 @@
1
- import { Options, Parser } from "acorn";
1
+ import * as acorn from "acorn";
2
+ import { Options as Options$1, Parser as Parser$1 } from "acorn";
3
+ import * as AST from "estree";
4
+ import { Program, SourceLocation } from "estree";
2
5
  import { SourceMap } from "magic-string";
3
6
 
4
- //#region node_modules/@types/estree/index.d.ts
5
- // This definition file follows a somewhat unusual format. ESTree allows
6
- // runtime type checks based on the `type` parameter. In order to explain this
7
- // to typescript we want to use discriminated union types:
8
- // https://github.com/Microsoft/TypeScript/pull/9163
9
- //
10
- // For ESTree this is a bit tricky because the high level interfaces like
11
- // Node or Function are pulling double duty. We want to pass common fields down
12
- // to the interfaces that extend them (like Identifier or
13
- // ArrowFunctionExpression), but you can't extend a type union or enforce
14
- // common fields on them. So we've split the high level interfaces into two
15
- // types, a base type which passes down inherited fields, and a type union of
16
- // all types which extend the base type. Only the type union is exported, and
17
- // the union is how other types refer to the collection of inheriting types.
18
- //
19
- // This makes the definitions file here somewhat more difficult to maintain,
20
- // but it has the notable advantage of making ESTree much easier to use as
21
- // an end user.
22
- interface BaseNodeWithoutComments {
23
- // Every leaf interface that extends BaseNode must specify a type property.
24
- // The type property should be a string literal. For example, Identifier
25
- // has: `type: "Identifier"`
26
- type: string;
27
- loc?: SourceLocation | null | undefined;
28
- range?: [number, number] | undefined;
29
- }
30
- interface BaseNode extends BaseNodeWithoutComments {
31
- leadingComments?: Comment[] | undefined;
32
- trailingComments?: Comment[] | undefined;
33
- }
34
- interface Comment extends BaseNodeWithoutComments {
35
- type: "Line" | "Block";
36
- value: string;
37
- }
38
- interface SourceLocation {
39
- source?: string | null | undefined;
40
- start: Position;
41
- end: Position;
42
- }
43
- interface Position {
44
- /** >= 1 */
45
- line: number;
46
- /** >= 0 */
47
- column: number;
48
- }
49
- interface Program extends BaseNode {
50
- type: "Program";
51
- sourceType: "script" | "module";
52
- body: Array<Directive | Statement | ModuleDeclaration>;
53
- comments?: Comment[] | undefined;
54
- }
55
- interface Directive extends BaseNode {
56
- type: "ExpressionStatement";
57
- expression: Literal;
58
- directive: string;
59
- }
60
- interface BaseFunction extends BaseNode {
61
- params: Pattern[];
62
- generator?: boolean | undefined;
63
- async?: boolean | undefined; // The body is either BlockStatement or Expression because arrow functions
64
- // can have a body that's either. FunctionDeclarations and
65
- // FunctionExpressions have only BlockStatement bodies.
66
- body: BlockStatement | Expression;
67
- }
68
- type Statement = ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | Declaration;
69
- interface BaseStatement extends BaseNode {}
70
- interface EmptyStatement extends BaseStatement {
71
- type: "EmptyStatement";
72
- }
73
- interface BlockStatement extends BaseStatement {
74
- type: "BlockStatement";
75
- body: Statement[];
76
- innerComments?: Comment[] | undefined;
77
- }
78
- interface StaticBlock extends Omit<BlockStatement, "type"> {
79
- type: "StaticBlock";
80
- }
81
- interface ExpressionStatement extends BaseStatement {
82
- type: "ExpressionStatement";
83
- expression: Expression;
84
- }
85
- interface IfStatement extends BaseStatement {
86
- type: "IfStatement";
87
- test: Expression;
88
- consequent: Statement;
89
- alternate?: Statement | null | undefined;
90
- }
91
- interface LabeledStatement extends BaseStatement {
92
- type: "LabeledStatement";
93
- label: Identifier;
94
- body: Statement;
95
- }
96
- interface BreakStatement extends BaseStatement {
97
- type: "BreakStatement";
98
- label?: Identifier | null | undefined;
99
- }
100
- interface ContinueStatement extends BaseStatement {
101
- type: "ContinueStatement";
102
- label?: Identifier | null | undefined;
103
- }
104
- interface WithStatement extends BaseStatement {
105
- type: "WithStatement";
106
- object: Expression;
107
- body: Statement;
108
- }
109
- interface SwitchStatement extends BaseStatement {
110
- type: "SwitchStatement";
111
- discriminant: Expression;
112
- cases: SwitchCase[];
113
- }
114
- interface ReturnStatement extends BaseStatement {
115
- type: "ReturnStatement";
116
- argument?: Expression | null | undefined;
117
- }
118
- interface ThrowStatement extends BaseStatement {
119
- type: "ThrowStatement";
120
- argument: Expression;
121
- }
122
- interface TryStatement extends BaseStatement {
123
- type: "TryStatement";
124
- block: BlockStatement;
125
- handler?: CatchClause | null | undefined;
126
- finalizer?: BlockStatement | null | undefined;
127
- }
128
- interface WhileStatement extends BaseStatement {
129
- type: "WhileStatement";
130
- test: Expression;
131
- body: Statement;
132
- }
133
- interface DoWhileStatement extends BaseStatement {
134
- type: "DoWhileStatement";
135
- body: Statement;
136
- test: Expression;
137
- }
138
- interface ForStatement extends BaseStatement {
139
- type: "ForStatement";
140
- init?: VariableDeclaration | Expression | null | undefined;
141
- test?: Expression | null | undefined;
142
- update?: Expression | null | undefined;
143
- body: Statement;
144
- }
145
- interface BaseForXStatement extends BaseStatement {
146
- left: VariableDeclaration | Pattern;
147
- right: Expression;
148
- body: Statement;
149
- }
150
- interface ForInStatement extends BaseForXStatement {
151
- type: "ForInStatement";
152
- }
153
- interface DebuggerStatement extends BaseStatement {
154
- type: "DebuggerStatement";
155
- }
156
- type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
157
- interface BaseDeclaration extends BaseStatement {}
158
- interface MaybeNamedFunctionDeclaration extends BaseFunction, BaseDeclaration {
159
- type: "FunctionDeclaration";
160
- /** It is null when a function declaration is a part of the `export default function` statement */
161
- id: Identifier | null;
162
- body: BlockStatement;
163
- }
164
- interface FunctionDeclaration extends MaybeNamedFunctionDeclaration {
165
- id: Identifier;
166
- }
167
- interface VariableDeclaration extends BaseDeclaration {
168
- type: "VariableDeclaration";
169
- declarations: VariableDeclarator[];
170
- kind: "var" | "let" | "const" | "using" | "await using";
171
- }
172
- interface VariableDeclarator extends BaseNode {
173
- type: "VariableDeclarator";
174
- id: Pattern;
175
- init?: Expression | null | undefined;
176
- }
177
- interface ExpressionMap {
178
- ArrayExpression: ArrayExpression;
179
- ArrowFunctionExpression: ArrowFunctionExpression;
180
- AssignmentExpression: AssignmentExpression;
181
- AwaitExpression: AwaitExpression;
182
- BinaryExpression: BinaryExpression;
183
- CallExpression: CallExpression;
184
- ChainExpression: ChainExpression;
185
- ClassExpression: ClassExpression;
186
- ConditionalExpression: ConditionalExpression;
187
- FunctionExpression: FunctionExpression;
188
- Identifier: Identifier;
189
- ImportExpression: ImportExpression;
190
- Literal: Literal;
191
- LogicalExpression: LogicalExpression;
192
- MemberExpression: MemberExpression;
193
- MetaProperty: MetaProperty;
194
- NewExpression: NewExpression;
195
- ObjectExpression: ObjectExpression;
196
- SequenceExpression: SequenceExpression;
197
- TaggedTemplateExpression: TaggedTemplateExpression;
198
- TemplateLiteral: TemplateLiteral;
199
- ThisExpression: ThisExpression;
200
- UnaryExpression: UnaryExpression;
201
- UpdateExpression: UpdateExpression;
202
- YieldExpression: YieldExpression;
203
- }
204
- type Expression = ExpressionMap[keyof ExpressionMap];
205
- interface BaseExpression extends BaseNode {}
206
- type ChainElement = SimpleCallExpression | MemberExpression;
207
- interface ChainExpression extends BaseExpression {
208
- type: "ChainExpression";
209
- expression: ChainElement;
210
- }
211
- interface ThisExpression extends BaseExpression {
212
- type: "ThisExpression";
213
- }
214
- interface ArrayExpression extends BaseExpression {
215
- type: "ArrayExpression";
216
- elements: Array<Expression | SpreadElement | null>;
217
- }
218
- interface ObjectExpression extends BaseExpression {
219
- type: "ObjectExpression";
220
- properties: Array<Property | SpreadElement>;
221
- }
222
- interface PrivateIdentifier extends BaseNode {
223
- type: "PrivateIdentifier";
224
- name: string;
225
- }
226
- interface Property extends BaseNode {
227
- type: "Property";
228
- key: Expression;
229
- value: Expression | Pattern; // Could be an AssignmentProperty
230
- kind: "init" | "get" | "set";
231
- method: boolean;
232
- shorthand: boolean;
233
- computed: boolean;
234
- }
235
- interface PropertyDefinition extends BaseNode {
236
- type: "PropertyDefinition";
237
- key: Expression | PrivateIdentifier;
238
- value?: Expression | null | undefined;
239
- computed: boolean;
240
- static: boolean;
241
- }
242
- interface FunctionExpression extends BaseFunction, BaseExpression {
243
- id?: Identifier | null | undefined;
244
- type: "FunctionExpression";
245
- body: BlockStatement;
246
- }
247
- interface SequenceExpression extends BaseExpression {
248
- type: "SequenceExpression";
249
- expressions: Expression[];
250
- }
251
- interface UnaryExpression extends BaseExpression {
252
- type: "UnaryExpression";
253
- operator: UnaryOperator;
254
- prefix: true;
255
- argument: Expression;
256
- }
257
- interface BinaryExpression extends BaseExpression {
258
- type: "BinaryExpression";
259
- operator: BinaryOperator;
260
- left: Expression | PrivateIdentifier;
261
- right: Expression;
262
- }
263
- interface AssignmentExpression extends BaseExpression {
264
- type: "AssignmentExpression";
265
- operator: AssignmentOperator;
266
- left: Pattern | MemberExpression;
267
- right: Expression;
268
- }
269
- interface UpdateExpression extends BaseExpression {
270
- type: "UpdateExpression";
271
- operator: UpdateOperator;
272
- argument: Expression;
273
- prefix: boolean;
274
- }
275
- interface LogicalExpression extends BaseExpression {
276
- type: "LogicalExpression";
277
- operator: LogicalOperator;
278
- left: Expression;
279
- right: Expression;
280
- }
281
- interface ConditionalExpression extends BaseExpression {
282
- type: "ConditionalExpression";
283
- test: Expression;
284
- alternate: Expression;
285
- consequent: Expression;
286
- }
287
- interface BaseCallExpression extends BaseExpression {
288
- callee: Expression | Super;
289
- arguments: Array<Expression | SpreadElement>;
290
- }
291
- type CallExpression = SimpleCallExpression | NewExpression;
292
- interface SimpleCallExpression extends BaseCallExpression {
293
- type: "CallExpression";
294
- optional: boolean;
295
- }
296
- interface NewExpression extends BaseCallExpression {
297
- type: "NewExpression";
298
- }
299
- interface MemberExpression extends BaseExpression, BasePattern {
300
- type: "MemberExpression";
301
- object: Expression | Super;
302
- property: Expression | PrivateIdentifier;
303
- computed: boolean;
304
- optional: boolean;
305
- }
306
- type Pattern = Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression;
307
- interface BasePattern extends BaseNode {}
308
- interface SwitchCase extends BaseNode {
309
- type: "SwitchCase";
310
- test?: Expression | null | undefined;
311
- consequent: Statement[];
312
- }
313
- interface CatchClause extends BaseNode {
314
- type: "CatchClause";
315
- param: Pattern | null;
316
- body: BlockStatement;
317
- }
318
- interface Identifier extends BaseNode, BaseExpression, BasePattern {
319
- type: "Identifier";
320
- name: string;
321
- }
322
- type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral;
323
- interface SimpleLiteral extends BaseNode, BaseExpression {
324
- type: "Literal";
325
- value: string | boolean | number | null;
326
- raw?: string | undefined;
327
- }
328
- interface RegExpLiteral extends BaseNode, BaseExpression {
329
- type: "Literal";
330
- value?: RegExp | null | undefined;
331
- regex: {
332
- pattern: string;
333
- flags: string;
334
- };
335
- raw?: string | undefined;
336
- }
337
- interface BigIntLiteral extends BaseNode, BaseExpression {
338
- type: "Literal";
339
- value?: bigint | null | undefined;
340
- bigint: string;
341
- raw?: string | undefined;
342
- }
343
- type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
344
- type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" | "instanceof";
345
- type LogicalOperator = "||" | "&&" | "??";
346
- type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "||=" | "&&=" | "??=";
347
- type UpdateOperator = "++" | "--";
348
- interface ForOfStatement extends BaseForXStatement {
349
- type: "ForOfStatement";
350
- await: boolean;
351
- }
352
- interface Super extends BaseNode {
353
- type: "Super";
354
- }
355
- interface SpreadElement extends BaseNode {
356
- type: "SpreadElement";
357
- argument: Expression;
358
- }
359
- interface ArrowFunctionExpression extends BaseExpression, BaseFunction {
360
- type: "ArrowFunctionExpression";
361
- expression: boolean;
362
- body: BlockStatement | Expression;
363
- }
364
- interface YieldExpression extends BaseExpression {
365
- type: "YieldExpression";
366
- argument?: Expression | null | undefined;
367
- delegate: boolean;
368
- }
369
- interface TemplateLiteral extends BaseExpression {
370
- type: "TemplateLiteral";
371
- quasis: TemplateElement[];
372
- expressions: Expression[];
373
- }
374
- interface TaggedTemplateExpression extends BaseExpression {
375
- type: "TaggedTemplateExpression";
376
- tag: Expression;
377
- quasi: TemplateLiteral;
378
- }
379
- interface TemplateElement extends BaseNode {
380
- type: "TemplateElement";
381
- tail: boolean;
382
- value: {
383
- /** It is null when the template literal is tagged and the text has an invalid escape (e.g. - tag`\unicode and \u{55}`) */cooked?: string | null | undefined;
384
- raw: string;
385
- };
386
- }
387
- interface AssignmentProperty extends Property {
388
- value: Pattern;
389
- kind: "init";
390
- method: boolean; // false
391
- }
392
- interface ObjectPattern extends BasePattern {
393
- type: "ObjectPattern";
394
- properties: Array<AssignmentProperty | RestElement>;
395
- }
396
- interface ArrayPattern extends BasePattern {
397
- type: "ArrayPattern";
398
- elements: Array<Pattern | null>;
399
- }
400
- interface RestElement extends BasePattern {
401
- type: "RestElement";
402
- argument: Pattern;
403
- }
404
- interface AssignmentPattern extends BasePattern {
405
- type: "AssignmentPattern";
406
- left: Pattern;
407
- right: Expression;
408
- }
409
- interface BaseClass extends BaseNode {
410
- superClass?: Expression | null | undefined;
411
- body: ClassBody;
412
- }
413
- interface ClassBody extends BaseNode {
414
- type: "ClassBody";
415
- body: Array<MethodDefinition | PropertyDefinition | StaticBlock>;
416
- }
417
- interface MethodDefinition extends BaseNode {
418
- type: "MethodDefinition";
419
- key: Expression | PrivateIdentifier;
420
- value: FunctionExpression;
421
- kind: "constructor" | "method" | "get" | "set";
422
- computed: boolean;
423
- static: boolean;
424
- }
425
- interface MaybeNamedClassDeclaration extends BaseClass, BaseDeclaration {
426
- type: "ClassDeclaration";
427
- /** It is null when a class declaration is a part of the `export default class` statement */
428
- id: Identifier | null;
429
- }
430
- interface ClassDeclaration extends MaybeNamedClassDeclaration {
431
- id: Identifier;
432
- }
433
- interface ClassExpression extends BaseClass, BaseExpression {
434
- type: "ClassExpression";
435
- id?: Identifier | null | undefined;
436
- }
437
- interface MetaProperty extends BaseExpression {
438
- type: "MetaProperty";
439
- meta: Identifier;
440
- property: Identifier;
441
- }
442
- type ModuleDeclaration = ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration;
443
- interface BaseModuleDeclaration extends BaseNode {}
444
- interface BaseModuleSpecifier extends BaseNode {
445
- local: Identifier;
446
- }
447
- interface ImportDeclaration extends BaseModuleDeclaration {
448
- type: "ImportDeclaration";
449
- specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>;
450
- attributes: ImportAttribute[];
451
- source: Literal;
452
- }
453
- interface ImportSpecifier extends BaseModuleSpecifier {
454
- type: "ImportSpecifier";
455
- imported: Identifier | Literal;
456
- }
457
- interface ImportAttribute extends BaseNode {
458
- type: "ImportAttribute";
459
- key: Identifier | Literal;
460
- value: Literal;
461
- }
462
- interface ImportExpression extends BaseExpression {
463
- type: "ImportExpression";
464
- source: Expression;
465
- options?: Expression | null | undefined;
466
- }
467
- interface ImportDefaultSpecifier extends BaseModuleSpecifier {
468
- type: "ImportDefaultSpecifier";
469
- }
470
- interface ImportNamespaceSpecifier extends BaseModuleSpecifier {
471
- type: "ImportNamespaceSpecifier";
472
- }
473
- interface ExportNamedDeclaration extends BaseModuleDeclaration {
474
- type: "ExportNamedDeclaration";
475
- declaration?: Declaration | null | undefined;
476
- specifiers: ExportSpecifier[];
477
- attributes: ImportAttribute[];
478
- source?: Literal | null | undefined;
479
- }
480
- interface ExportSpecifier extends Omit<BaseModuleSpecifier, "local"> {
481
- type: "ExportSpecifier";
482
- local: Identifier | Literal;
483
- exported: Identifier | Literal;
484
- }
485
- interface ExportDefaultDeclaration extends BaseModuleDeclaration {
486
- type: "ExportDefaultDeclaration";
487
- declaration: MaybeNamedFunctionDeclaration | MaybeNamedClassDeclaration | Expression;
488
- }
489
- interface ExportAllDeclaration extends BaseModuleDeclaration {
490
- type: "ExportAllDeclaration";
491
- exported: Identifier | Literal | null;
492
- attributes: ImportAttribute[];
493
- source: Literal;
494
- }
495
- interface AwaitExpression extends BaseExpression {
496
- type: "AwaitExpression";
497
- argument: Expression;
498
- }
499
- //#endregion
500
7
  //#region src/parse/gts_plugin.d.ts
501
8
  interface GtsPluginOption {
502
9
  allowEmptyShortcutMember?: boolean;
@@ -505,7 +12,7 @@ interface GtsPluginOption {
505
12
  //#endregion
506
13
  //#region src/parse/index.d.ts
507
14
  interface ParseOptions extends GtsPluginOption {
508
- onComment: Options["onComment"];
15
+ onComment: Options$1["onComment"];
509
16
  }
510
17
  declare function parse(input: string, options?: ParseOptions): Program;
511
18
  interface ParseLooseOptions extends GtsPluginOption {
@@ -609,6 +116,1395 @@ declare class GtsTranspilerError extends Error {
609
116
  constructor(message: string, position: SourceLocation | null);
610
117
  }
611
118
  //#endregion
119
+ //#region src/types.d.ts
120
+ type ForInit = boolean | "await";
121
+ declare module "estree" {
122
+ interface Identifier {
123
+ isDummy?: boolean;
124
+ }
125
+ interface NodeMap {
126
+ GTSDefineStatement: GTSDefineStatement;
127
+ GTSNamedAttributeDefinition: GTSNamedAttributeDefinition;
128
+ GTSAttributeBody: GTSAttributeBody;
129
+ GTSPositionalAttributeList: GTSPositionalAttributeList;
130
+ GTSNamedAttributeBlock: GTSNamedAttributeBlock;
131
+ GTSDirectFunction: GTSDirectFunction;
132
+ }
133
+ interface ExpressionMap {
134
+ GTSShortcutArgumentExpression: GTSShortcutArgumentExpression;
135
+ GTSShortcutFunctionExpression: GTSShortcutFunctionExpression;
136
+ }
137
+ interface SimpleCallExpression {
138
+ lParenRange?: [number, number];
139
+ }
140
+ interface NewExpression {
141
+ lParenRange?: [number, number];
142
+ }
143
+ interface ArrowFunctionExpression {
144
+ returnType?: TSTypeAnnotation;
145
+ }
146
+ interface TSTypeAnnotation extends BaseNode {
147
+ type: "TSTypeAnnotation";
148
+ typeAnnotation: any;
149
+ }
150
+ interface GTSDefineStatement extends BaseStatement {
151
+ type: "GTSDefineStatement";
152
+ body: GTSNamedAttributeDefinition;
153
+ }
154
+ interface GTSNamedAttributeDefinition extends BaseNode {
155
+ type: "GTSNamedAttributeDefinition";
156
+ name: Identifier | Literal;
157
+ body: GTSAttributeBody;
158
+ bindingAccessModifier?: "public" | "protected" | "private";
159
+ bindingName?: Identifier;
160
+ }
161
+ interface GTSAttributeBody extends BaseNode {
162
+ type: "GTSAttributeBody";
163
+ positionalAttributes: GTSPositionalAttributeList;
164
+ namedAttributes?: GTSNamedAttributeBlock;
165
+ }
166
+ interface GTSPositionalAttributeList extends BaseNode {
167
+ type: "GTSPositionalAttributeList";
168
+ attributes: Expression[];
169
+ }
170
+ interface GTSNamedAttributeBlock extends BaseNode {
171
+ type: "GTSNamedAttributeBlock";
172
+ attributes: GTSNamedAttributeDefinition[];
173
+ directAction?: GTSDirectFunction;
174
+ }
175
+ interface GTSDirectFunction extends BaseNode {
176
+ type: "GTSDirectFunction";
177
+ body: Statement[];
178
+ }
179
+ interface GTSShortcutArgumentExpression extends BaseExpression {
180
+ type: "GTSShortcutArgumentExpression";
181
+ property: Identifier;
182
+ }
183
+ interface GTSShortcutFunctionExpression extends BaseExpression {
184
+ type: "GTSShortcutFunctionExpression";
185
+ body: BlockStatement | Expression;
186
+ expression: boolean;
187
+ returnType?: TSTypeAnnotation;
188
+ }
189
+ }
190
+ declare module "acorn" {
191
+ type ReadToken = Parse.Parser["readToken"];
192
+ const tokContexts: Parse.TokContexts;
193
+ class Position implements AST.Position {
194
+ line: number;
195
+ column: number;
196
+ constructor(line: number, column: number);
197
+ }
198
+ function isNewLine(code: number): boolean;
199
+ interface Parser {
200
+ readToken(...args: Parameters<ReadToken>): ReturnType<ReadToken>;
201
+ }
202
+ }
203
+ declare namespace Parse {
204
+ /**
205
+ * Destructuring errors object used during expression parsing
206
+ * See: https://github.com/acornjs/acorn/blob/main/acorn/src/parseutil.js
207
+ */
208
+ export interface DestructuringErrors {
209
+ shorthandAssign: number;
210
+ trailingComma: number;
211
+ parenthesizedAssign: number;
212
+ parenthesizedBind: number;
213
+ doubleProto: number;
214
+ }
215
+ /**
216
+ * Binding type constants used in checkLVal* and declareName
217
+ * to determine the type of a binding
218
+ */
219
+ export interface BindingType {
220
+ /** Not a binding */
221
+ BIND_NONE: 0;
222
+ /** Var-style binding */
223
+ BIND_VAR: 1;
224
+ /** Let- or const-style binding */
225
+ BIND_LEXICAL: 2;
226
+ /** Function declaration */
227
+ BIND_FUNCTION: 3;
228
+ /** Simple (identifier pattern) catch binding */
229
+ BIND_SIMPLE_CATCH: 4;
230
+ /** Special case for function names as bound inside the function */
231
+ BIND_OUTSIDE: 5;
232
+ }
233
+ export interface Options extends acorn.Options {}
234
+ export interface CommentMetaData {
235
+ containerId: number;
236
+ childIndex: number;
237
+ beforeMeaningfulChild: boolean;
238
+ }
239
+ /**
240
+ * Token context - controls how tokens are interpreted in different syntactic contexts
241
+ */
242
+ export interface TokContext {
243
+ token: string;
244
+ isExpr: boolean;
245
+ preserveSpace?: boolean;
246
+ override?: ((parser: Parser) => acorn.Token) | null;
247
+ }
248
+ /**
249
+ * Token type definition
250
+ */
251
+ export interface TokenType {
252
+ label: string;
253
+ keyword: string | undefined;
254
+ beforeExpr?: boolean;
255
+ startsExpr?: boolean;
256
+ isLoop?: boolean;
257
+ isAssign?: boolean;
258
+ prefix?: boolean;
259
+ postfix?: boolean;
260
+ binop?: number | null;
261
+ updateContext?: ((prevType: TokenType) => void) | null;
262
+ }
263
+ /**
264
+ * Acorn's built-in token contexts
265
+ */
266
+ export interface TokContexts {
267
+ /** Block statement context - `{` in statement position */
268
+ b_stat: TokContext & {
269
+ token: "{";
270
+ };
271
+ /** Block expression context - `{` in expression position (object literals) */
272
+ b_expr: TokContext & {
273
+ token: "{";
274
+ };
275
+ /** Template literal context - `${` inside template */
276
+ b_tmpl: TokContext & {
277
+ token: "${";
278
+ };
279
+ /** Parenthesized statement context - `(` in statement position */
280
+ p_stat: TokContext & {
281
+ token: "(";
282
+ };
283
+ /** Parenthesized expression context - `(` in expression position */
284
+ p_expr: TokContext & {
285
+ token: "(";
286
+ };
287
+ /** Quasi/template context - `` ` `` backtick */
288
+ q_tmpl: TokContext & {
289
+ token: "`";
290
+ };
291
+ /** Function statement context - `function` keyword in statement */
292
+ f_stat: TokContext & {
293
+ token: "function";
294
+ };
295
+ /** Function expression context - `function` keyword in expression */
296
+ f_expr: TokContext & {
297
+ token: "function";
298
+ };
299
+ /** Generator function expression context - `function*` in expression */
300
+ f_expr_gen: TokContext & {
301
+ token: "function";
302
+ };
303
+ /** Generator function context - `function*` in statement */
304
+ f_gen: TokContext & {
305
+ token: "function";
306
+ };
307
+ }
308
+ /**
309
+ * Acorn's built-in token types
310
+ */
311
+ export interface TokTypes {
312
+ num: TokenType & {
313
+ label: "num";
314
+ };
315
+ regexp: TokenType & {
316
+ label: "regexp";
317
+ };
318
+ string: TokenType & {
319
+ label: "string";
320
+ };
321
+ name: TokenType & {
322
+ label: "name";
323
+ };
324
+ privateId: TokenType & {
325
+ label: "privateId";
326
+ };
327
+ eof: TokenType & {
328
+ label: "eof";
329
+ };
330
+ bracketL: TokenType & {
331
+ label: "[";
332
+ };
333
+ bracketR: TokenType & {
334
+ label: "]";
335
+ };
336
+ braceL: TokenType & {
337
+ label: "{";
338
+ };
339
+ braceR: TokenType & {
340
+ label: "}";
341
+ };
342
+ parenL: TokenType & {
343
+ label: "(";
344
+ };
345
+ parenR: TokenType & {
346
+ label: ")";
347
+ };
348
+ comma: TokenType & {
349
+ label: ",";
350
+ };
351
+ semi: TokenType & {
352
+ label: ";";
353
+ };
354
+ colon: TokenType & {
355
+ label: ":";
356
+ };
357
+ dot: TokenType & {
358
+ label: ".";
359
+ };
360
+ question: TokenType & {
361
+ label: "?";
362
+ };
363
+ questionDot: TokenType & {
364
+ label: "?.";
365
+ };
366
+ arrow: TokenType & {
367
+ label: "=>";
368
+ };
369
+ template: TokenType & {
370
+ label: "template";
371
+ };
372
+ invalidTemplate: TokenType & {
373
+ label: "invalidTemplate";
374
+ };
375
+ ellipsis: TokenType & {
376
+ label: "...";
377
+ };
378
+ backQuote: TokenType & {
379
+ label: "`";
380
+ };
381
+ dollarBraceL: TokenType & {
382
+ label: "${";
383
+ };
384
+ eq: TokenType & {
385
+ label: "=";
386
+ isAssign: true;
387
+ };
388
+ assign: TokenType & {
389
+ label: "_=";
390
+ isAssign: true;
391
+ };
392
+ incDec: TokenType & {
393
+ label: "++/--";
394
+ prefix: true;
395
+ postfix: true;
396
+ };
397
+ prefix: TokenType & {
398
+ label: "!/~";
399
+ prefix: true;
400
+ };
401
+ logicalOR: TokenType & {
402
+ label: "||";
403
+ binop: 1;
404
+ };
405
+ logicalAND: TokenType & {
406
+ label: "&&";
407
+ binop: 2;
408
+ };
409
+ bitwiseOR: TokenType & {
410
+ label: "|";
411
+ binop: 3;
412
+ };
413
+ bitwiseXOR: TokenType & {
414
+ label: "^";
415
+ binop: 4;
416
+ };
417
+ bitwiseAND: TokenType & {
418
+ label: "&";
419
+ binop: 5;
420
+ };
421
+ equality: TokenType & {
422
+ label: "==/!=/===/!==";
423
+ binop: 6;
424
+ };
425
+ relational: TokenType & {
426
+ label: "</>/<=/>=";
427
+ binop: 7;
428
+ };
429
+ bitShift: TokenType & {
430
+ label: "<</>>/>>>";
431
+ binop: 8;
432
+ };
433
+ plusMin: TokenType & {
434
+ label: "+/-";
435
+ binop: 9;
436
+ prefix: true;
437
+ };
438
+ modulo: TokenType & {
439
+ label: "%";
440
+ binop: 10;
441
+ };
442
+ star: TokenType & {
443
+ label: "*";
444
+ binop: 10;
445
+ };
446
+ slash: TokenType & {
447
+ label: "/";
448
+ binop: 10;
449
+ };
450
+ starstar: TokenType & {
451
+ label: "**";
452
+ };
453
+ coalesce: TokenType & {
454
+ label: "??";
455
+ binop: 1;
456
+ };
457
+ _break: TokenType & {
458
+ label: "break";
459
+ keyword: "break";
460
+ };
461
+ _case: TokenType & {
462
+ label: "case";
463
+ keyword: "case";
464
+ };
465
+ _catch: TokenType & {
466
+ label: "catch";
467
+ keyword: "catch";
468
+ };
469
+ _continue: TokenType & {
470
+ label: "continue";
471
+ keyword: "continue";
472
+ };
473
+ _debugger: TokenType & {
474
+ label: "debugger";
475
+ keyword: "debugger";
476
+ };
477
+ _default: TokenType & {
478
+ label: "default";
479
+ keyword: "default";
480
+ };
481
+ _do: TokenType & {
482
+ label: "do";
483
+ keyword: "do";
484
+ isLoop: true;
485
+ };
486
+ _else: TokenType & {
487
+ label: "else";
488
+ keyword: "else";
489
+ };
490
+ _finally: TokenType & {
491
+ label: "finally";
492
+ keyword: "finally";
493
+ };
494
+ _for: TokenType & {
495
+ label: "for";
496
+ keyword: "for";
497
+ isLoop: true;
498
+ };
499
+ _function: TokenType & {
500
+ label: "function";
501
+ keyword: "function";
502
+ };
503
+ _if: TokenType & {
504
+ label: "if";
505
+ keyword: "if";
506
+ };
507
+ _return: TokenType & {
508
+ label: "return";
509
+ keyword: "return";
510
+ };
511
+ _switch: TokenType & {
512
+ label: "switch";
513
+ keyword: "switch";
514
+ };
515
+ _throw: TokenType & {
516
+ label: "throw";
517
+ keyword: "throw";
518
+ };
519
+ _try: TokenType & {
520
+ label: "try";
521
+ keyword: "try";
522
+ };
523
+ _var: TokenType & {
524
+ label: "var";
525
+ keyword: "var";
526
+ };
527
+ _const: TokenType & {
528
+ label: "const";
529
+ keyword: "const";
530
+ };
531
+ _while: TokenType & {
532
+ label: "while";
533
+ keyword: "while";
534
+ isLoop: true;
535
+ };
536
+ _with: TokenType & {
537
+ label: "with";
538
+ keyword: "with";
539
+ };
540
+ _new: TokenType & {
541
+ label: "new";
542
+ keyword: "new";
543
+ };
544
+ _this: TokenType & {
545
+ label: "this";
546
+ keyword: "this";
547
+ };
548
+ _super: TokenType & {
549
+ label: "super";
550
+ keyword: "super";
551
+ };
552
+ _class: TokenType & {
553
+ label: "class";
554
+ keyword: "class";
555
+ };
556
+ _extends: TokenType & {
557
+ label: "extends";
558
+ keyword: "extends";
559
+ };
560
+ _export: TokenType & {
561
+ label: "export";
562
+ keyword: "export";
563
+ };
564
+ _import: TokenType & {
565
+ label: "import";
566
+ keyword: "import";
567
+ };
568
+ _null: TokenType & {
569
+ label: "null";
570
+ keyword: "null";
571
+ };
572
+ _true: TokenType & {
573
+ label: "true";
574
+ keyword: "true";
575
+ };
576
+ _false: TokenType & {
577
+ label: "false";
578
+ keyword: "false";
579
+ };
580
+ _in: TokenType & {
581
+ label: "in";
582
+ keyword: "in";
583
+ binop: 7;
584
+ };
585
+ _instanceof: TokenType & {
586
+ label: "instanceof";
587
+ keyword: "instanceof";
588
+ binop: 7;
589
+ };
590
+ _typeof: TokenType & {
591
+ label: "typeof";
592
+ keyword: "typeof";
593
+ prefix: true;
594
+ };
595
+ _void: TokenType & {
596
+ label: "void";
597
+ keyword: "void";
598
+ prefix: true;
599
+ };
600
+ _delete: TokenType & {
601
+ label: "delete";
602
+ keyword: "delete";
603
+ prefix: true;
604
+ };
605
+ }
606
+ /**
607
+ * TypeScript-specific token types added by @sveltejs/acorn-typescript
608
+ */
609
+ export interface AcornTypeScriptTokTypes {
610
+ jsxTagStart: TokenType & {
611
+ label: "jsxTagStart";
612
+ };
613
+ jsxTagEnd: TokenType & {
614
+ label: "jsxTagEnd";
615
+ };
616
+ jsxText: TokenType & {
617
+ label: "jsxText";
618
+ };
619
+ jsxName: TokenType & {
620
+ label: "jsxName";
621
+ };
622
+ at: TokenType & {
623
+ label: "@";
624
+ };
625
+ abstract: TokenType & {
626
+ label: "abstract";
627
+ };
628
+ as: TokenType & {
629
+ label: "as";
630
+ };
631
+ asserts: TokenType & {
632
+ label: "asserts";
633
+ };
634
+ assert: TokenType & {
635
+ label: "assert";
636
+ };
637
+ bigint: TokenType & {
638
+ label: "bigint";
639
+ };
640
+ declare: TokenType & {
641
+ label: "declare";
642
+ };
643
+ enum: TokenType & {
644
+ label: "enum";
645
+ };
646
+ global: TokenType & {
647
+ label: "global";
648
+ };
649
+ implements: TokenType & {
650
+ label: "implements";
651
+ };
652
+ infer: TokenType & {
653
+ label: "infer";
654
+ };
655
+ interface: TokenType & {
656
+ label: "interface";
657
+ };
658
+ intrinsic: TokenType & {
659
+ label: "intrinsic";
660
+ };
661
+ is: TokenType & {
662
+ label: "is";
663
+ };
664
+ keyof: TokenType & {
665
+ label: "keyof";
666
+ };
667
+ module: TokenType & {
668
+ label: "module";
669
+ };
670
+ namespace: TokenType & {
671
+ label: "namespace";
672
+ };
673
+ never: TokenType & {
674
+ label: "never";
675
+ };
676
+ out: TokenType & {
677
+ label: "out";
678
+ };
679
+ override: TokenType & {
680
+ label: "override";
681
+ };
682
+ private: TokenType & {
683
+ label: "private";
684
+ };
685
+ protected: TokenType & {
686
+ label: "protected";
687
+ };
688
+ public: TokenType & {
689
+ label: "public";
690
+ };
691
+ readonly: TokenType & {
692
+ label: "readonly";
693
+ };
694
+ require: TokenType & {
695
+ label: "require";
696
+ };
697
+ satisfies: TokenType & {
698
+ label: "satisfies";
699
+ };
700
+ symbol: TokenType & {
701
+ label: "symbol";
702
+ };
703
+ type: TokenType & {
704
+ label: "type";
705
+ };
706
+ unique: TokenType & {
707
+ label: "unique";
708
+ };
709
+ unknown: TokenType & {
710
+ label: "unknown";
711
+ };
712
+ }
713
+ /**
714
+ * TypeScript-specific token contexts added by @sveltejs/acorn-typescript
715
+ */
716
+ export interface AcornTypeScriptTokContexts {
717
+ /** JSX opening tag context - `<` starting a JSX tag */
718
+ tc_oTag: TokContext & {
719
+ token: "<";
720
+ };
721
+ /** JSX closing tag context - `</` closing a JSX tag */
722
+ tc_cTag: TokContext & {
723
+ token: "</";
724
+ };
725
+ /** JSX expression context - `{` inside JSX for expressions */
726
+ tc_expr: TokContext & {
727
+ token: "{";
728
+ };
729
+ }
730
+ /**
731
+ * Combined TypeScript extensions object
732
+ */
733
+ export interface AcornTypeScriptExtensions {
734
+ tokTypes: AcornTypeScriptTokTypes;
735
+ tokContexts: AcornTypeScriptTokContexts;
736
+ }
737
+ /**
738
+ * Extended Parser instance with internal properties
739
+ *
740
+ * These properties are used internally by Acorn but not exposed in official types.
741
+ * They are accessed by Ripple's custom parser plugin for whitespace handling,
742
+ * JSX parsing, and other advanced features.
743
+ */
744
+ export class Parser extends acorn.Parser {
745
+ /** Start position of the current token (0-indexed) */
746
+ start: number;
747
+ /** End position of the current token (0-indexed) */
748
+ end: number;
749
+ /** Current parsing position in input string (0-indexed) */
750
+ pos: number;
751
+ /** Current line number (1-indexed) */
752
+ curLine: number;
753
+ /** Position where the current line starts (0-indexed) */
754
+ lineStart: number;
755
+ /** Start location of current token */
756
+ startLoc: AST.Position;
757
+ /** End location of current token */
758
+ endLoc: AST.Position;
759
+ /** End position of the last token */
760
+ lastTokEnd: number;
761
+ /** Start position of the last token */
762
+ lastTokStart: number;
763
+ /** End location of the last token */
764
+ lastTokEndLoc: AST.Position;
765
+ /** Start location of the last token */
766
+ lastTokStartLoc: AST.Position;
767
+ /** Current token type */
768
+ type: TokenType;
769
+ /** Current token value (string for names, number for nums, etc.) */
770
+ value: string | number | RegExp | bigint | null;
771
+ /** The source code being parsed */
772
+ input: string;
773
+ /** Whether the current position expects an expression */
774
+ exprAllowed: boolean;
775
+ /** Whether the parser is in strict mode */
776
+ strict: boolean;
777
+ /** Whether we're inside a generator function */
778
+ inGenerator: boolean;
779
+ /** Whether we're inside an async function */
780
+ inAsync: boolean;
781
+ /** Whether we're inside a function */
782
+ inFunction: boolean;
783
+ /** Stack of label names for break/continue statements */
784
+ labels: Array<{
785
+ kind: string | null;
786
+ name?: string;
787
+ statementStart?: number;
788
+ }>;
789
+ /** Current scope flags stack */
790
+ scopeStack: Array<{
791
+ flags: number;
792
+ var: string[];
793
+ lexical: string[];
794
+ functions: string[];
795
+ }>;
796
+ /** Regular expression validation state */
797
+ regexpState?: any;
798
+ /** Whether we can use await keyword */
799
+ canAwait: boolean;
800
+ /** Position of await keyword (0 if not in async context) */
801
+ awaitPos: number;
802
+ /** Position of yield keyword (0 if not in generator context) */
803
+ yieldPos: number;
804
+ /** Position of await used as identifier (for error reporting) */
805
+ awaitIdentPos: number;
806
+ /** Whether current identifier contains escape sequences */
807
+ containsEsc: boolean;
808
+ /** Potential arrow function position */
809
+ potentialArrowAt: number;
810
+ /** Potential arrow in for-await position */
811
+ potentialArrowInForAwait: boolean;
812
+ /** Private name stack for class private fields validation */
813
+ privateNameStack: Array<{
814
+ declared: Record<string, any>;
815
+ used: Array<AST.Node>;
816
+ }>;
817
+ /** Undefined exports for module validation */
818
+ undefinedExports: Record<string, AST.Node>;
819
+ /** Token context stack for tokenizer state */
820
+ context: TokContext[];
821
+ /** Whether to preserve spaces in current context */
822
+ preserveSpace?: boolean;
823
+ /** Parser options (from constructor) */
824
+ options: Options;
825
+ /** ECMAScript version being parsed */
826
+ ecmaVersion: number;
827
+ /** Keywords regex for current ecmaVersion */
828
+ keywords: RegExp;
829
+ /** Reserved words regex */
830
+ reservedWords: RegExp;
831
+ /** Whether we're parsing a module */
832
+ inModule: boolean;
833
+ /**
834
+ * Finish current token with given type and optional value
835
+ * @see https://github.com/acornjs/acorn/blob/main/acorn/src/tokenize.js
836
+ */
837
+ finishToken(type: TokenType, val?: string | number | RegExp | bigint): void;
838
+ readAtIdentifier(): void;
839
+ /**
840
+ * Read a token based on character code
841
+ * Called by nextToken() for each character
842
+ */
843
+ readToken(code: number): void;
844
+ /**
845
+ * Read a word (identifier or keyword)
846
+ * @returns Token type (name or keyword)
847
+ */
848
+ readWord(): TokenType;
849
+ /**
850
+ * Read word starting from current position
851
+ * @returns The word string
852
+ */
853
+ readWord1(): string;
854
+ /** Read a number literal */
855
+ readNumber(startsWithDot: boolean): void;
856
+ /** Read a string literal */
857
+ readString(quote: number): void;
858
+ /** Read a template token */
859
+ readTmplToken(): void;
860
+ /** Read a regular expression literal */
861
+ readRegexp(): void;
862
+ /** Skip block comment, tracking line positions */
863
+ skipBlockComment(): void;
864
+ /** Skip line comment */
865
+ skipLineComment(startSkip: number): void;
866
+ /** Skip whitespace and comments */
867
+ skipSpace(): void;
868
+ /** Read and return the next token */
869
+ nextToken(): void;
870
+ /** Advance to next token (wrapper around nextToken) */
871
+ next(): void;
872
+ /**
873
+ * Get token from character code
874
+ * Main tokenizer dispatch based on first character
875
+ */
876
+ getTokenFromCode(code: number): void;
877
+ /**
878
+ * Get current position as Position object
879
+ * @returns { line: number, column: number, index: number }
880
+ */
881
+ curPosition(): AST.Position;
882
+ /**
883
+ * Finish building an operator token
884
+ * @param type Token type
885
+ * @param size Number of characters consumed
886
+ */
887
+ finishOp(type: TokenType, size: number): TokenType;
888
+ /**
889
+ * Finish a node, setting its end position and type
890
+ * @template T Node type extending AST.Node
891
+ * @param node The node to finish
892
+ * @param type The node type string (e.g., "Identifier", "BinaryExpression")
893
+ * @returns The finished node
894
+ */
895
+ finishNode<T extends AST.Node>(node: T, type: string): T;
896
+ /**
897
+ * Finish a node at a specific position
898
+ */
899
+ finishNodeAt<T extends AST.Node>(node: T, type: string, pos: number, loc: AST.Position): T;
900
+ /**
901
+ * Start a new node at current position
902
+ */
903
+ startNode(): AST.Node;
904
+ /**
905
+ * Start a new node at a specific position
906
+ * @param pos Start position
907
+ * @param loc Start location
908
+ * @returns A new node with specified start position
909
+ */
910
+ startNodeAt(pos: number, loc: AST.Position): AST.Node;
911
+ /**
912
+ * Start a node at the same position as another node
913
+ * @param node The node to copy position from
914
+ * @returns A new node with copied start position
915
+ */
916
+ startNodeAtNode(node: AST.Node): AST.Node;
917
+ /**
918
+ * Copy a node's position info
919
+ * @template T Node type
920
+ * @param node The node to copy
921
+ * @returns A shallow copy of the node
922
+ */
923
+ copyNode<T extends AST.Node>(node: T): T;
924
+ /**
925
+ * Reset end location from another node
926
+ * @param node Node to update
927
+ */
928
+ resetEndLocation(node: AST.Node): void;
929
+ /**
930
+ * Reset start location from another node
931
+ * @param node Node to update
932
+ * @param locationNode Node to copy from
933
+ */
934
+ resetStartLocationFromNode(node: AST.Node, locationNode: AST.Node): void;
935
+ /**
936
+ * Raise a fatal error at given position
937
+ * @throws SyntaxError
938
+ */
939
+ raise(pos: number, message: string): never;
940
+ /**
941
+ * Raise a recoverable error (warning that doesn't stop parsing)
942
+ */
943
+ raiseRecoverable(pos: number, message: string): void;
944
+ /**
945
+ * Throw unexpected token error
946
+ * @param pos Optional position (defaults to current)
947
+ */
948
+ unexpected(pos?: number): never;
949
+ /**
950
+ * Expect a specific token type, raise error if not found
951
+ * @param type Expected token type
952
+ */
953
+ expect(type: TokenType): void;
954
+ /**
955
+ * Consume token if it matches, return true if consumed
956
+ * @param type Token type to eat
957
+ * @returns true if token was consumed
958
+ */
959
+ eat(type: TokenType): boolean;
960
+ /**
961
+ * Check if current token matches type (alias for this.type === type)
962
+ * @param type Token type to match
963
+ */
964
+ match(type: TokenType): boolean;
965
+ /**
966
+ * Peek at character at position
967
+ * @deprecated Use charCodeAt instead
968
+ */
969
+ charAt(pos: number): string;
970
+ /**
971
+ * Get character code at position in input
972
+ */
973
+ charCodeAt(pos: number): number;
974
+ /**
975
+ * Check if current token is a contextual keyword
976
+ * @param name Keyword to check (e.g., "async", "of")
977
+ */
978
+ isContextual(name: string): boolean;
979
+ /**
980
+ * Consume if current token is a contextual keyword
981
+ * @param name Keyword to consume
982
+ * @returns true if consumed
983
+ */
984
+ eatContextual(name: string): boolean;
985
+ /**
986
+ * Expect a contextual keyword, raise error if not found
987
+ * @param name Expected keyword
988
+ */
989
+ expectContextual(name: string): void;
990
+ /**
991
+ * Check if semicolon can be inserted at current position (ASI)
992
+ */
993
+ canInsertSemicolon(): boolean;
994
+ /**
995
+ * Insert a semicolon if allowed by ASI rules
996
+ * returns true if semicolon was inserted
997
+ */
998
+ insertSemicolon(): boolean;
999
+ /**
1000
+ * Consume semicolon or insert via ASI
1001
+ */
1002
+ semicolon(): void;
1003
+ /**
1004
+ * Handle trailing comma in lists
1005
+ */
1006
+ afterTrailingComma(type: TokenType, notNext?: boolean): boolean;
1007
+ /**
1008
+ * Enter a new scope
1009
+ * @param flags Scope flags (SCOPE_* constants)
1010
+ */
1011
+ enterScope(flags: number): void;
1012
+ /** Exit current scope */
1013
+ exitScope(): void;
1014
+ /**
1015
+ * Declare a name in current scope
1016
+ */
1017
+ declareName(name: string, bindingType: BindingType[keyof BindingType], pos: number): void;
1018
+ /** Get current scope */
1019
+ currentScope(): {
1020
+ flags: number;
1021
+ var: string[];
1022
+ lexical: string[];
1023
+ functions: string[];
1024
+ };
1025
+ /** Get current variable scope (for var declarations) */
1026
+ currentVarScope(): {
1027
+ flags: number;
1028
+ var: string[];
1029
+ lexical: string[];
1030
+ functions: string[];
1031
+ };
1032
+ /** Get current "this" scope */
1033
+ currentThisScope(): {
1034
+ flags: number;
1035
+ var: string[];
1036
+ lexical: string[];
1037
+ functions: string[];
1038
+ };
1039
+ /** Check if treating functions as var in current scope */
1040
+ treatFunctionsAsVarInScope(scope: any): boolean;
1041
+ /**
1042
+ * Get current token context
1043
+ * @returns Current context from stack
1044
+ */
1045
+ curContext(): TokContext;
1046
+ /**
1047
+ * Update token context based on previous token
1048
+ * @param prevType Previous token type
1049
+ */
1050
+ updateContext(prevType: TokenType): void;
1051
+ /**
1052
+ * Override the current context
1053
+ * @param context New context to push
1054
+ */
1055
+ overrideContext(context: TokContext): void;
1056
+ /**
1057
+ * Look ahead one token without consuming
1058
+ * @returns Object with type and value of next token
1059
+ */
1060
+ lookahead(): {
1061
+ type: TokenType;
1062
+ value: any;
1063
+ };
1064
+ /**
1065
+ * Get next token start position
1066
+ */
1067
+ nextTokenStart(): number;
1068
+ /**
1069
+ * Get next token start since given position
1070
+ */
1071
+ nextTokenStartSince(pos: number): number;
1072
+ /**
1073
+ * Look ahead at character code
1074
+ */
1075
+ lookaheadCharCode(): number;
1076
+ /**
1077
+ * Parse an expression
1078
+ */
1079
+ parseExpression(forInit?: ForInit, refDestructuringErrors?: DestructuringErrors): AST.Expression;
1080
+ /**
1081
+ * Parse maybe-assignment expression (handles = and op=)
1082
+ */
1083
+ parseMaybeAssign(forInit?: ForInit, refDestructuringErrors?: DestructuringErrors, afterLeftParse?: (node: AST.Node, startPos: number, startLoc: AST.Position) => AST.Node): AST.Expression;
1084
+ /**
1085
+ * Parse maybe-conditional expression (?:)
1086
+ */
1087
+ parseMaybeConditional(forInit?: ForInit, refDestructuringErrors?: DestructuringErrors): AST.Expression;
1088
+ /**
1089
+ * Parse expression with operators (handles precedence)
1090
+ */
1091
+ parseExprOps(forInit?: ForInit, refDestructuringErrors?: DestructuringErrors): AST.Expression;
1092
+ /**
1093
+ * Parse expression with operator at given precedence
1094
+ */
1095
+ parseExprOp(left: AST.Expression, leftStartPos: number, leftStartLoc: AST.Position, minPrec: number, forInit?: ForInit): AST.Expression;
1096
+ /**
1097
+ * Parse maybe-unary expression (prefix operators)
1098
+ */
1099
+ parseMaybeUnary(refDestructuringErrors?: DestructuringErrors | null, sawUnary?: boolean, incDec?: boolean, forInit?: ForInit): AST.Expression;
1100
+ /**
1101
+ * Parse expression subscripts (member access, calls)
1102
+ */
1103
+ parseExprSubscripts(refDestructuringErrors?: DestructuringErrors, forInit?: ForInit): AST.Expression;
1104
+ /**
1105
+ * Parse subscripts (., [], (), ?.)
1106
+ */
1107
+ parseSubscripts(base: AST.Expression, startPos: number, startLoc: AST.Position, noCalls?: boolean, forInit?: ForInit): AST.Expression;
1108
+ parseSubscript(base: AST.Expression, startPos: number, startLoc: AST.Position, noCalls?: boolean, maybeAsyncArrow?: boolean, optionalChained?: boolean, forInit?: ForInit): AST.Expression;
1109
+ /**
1110
+ * Parse expression atom (literals, identifiers, etc.)
1111
+ */
1112
+ parseExprAtom(refDestructuringErrors?: DestructuringErrors, forInit?: ForInit, forNew?: boolean): AST.Expression;
1113
+ /**
1114
+ * Parse a literal value (string, number, boolean, null, regex)
1115
+ * @param value The literal value
1116
+ * @returns Literal node
1117
+ */
1118
+ parseLiteral(value: string | number | boolean | null | RegExp | bigint): AST.Literal;
1119
+ /**
1120
+ * Parse parenthesized expression, distinguishing arrow functions
1121
+ */
1122
+ parseParenAndDistinguishExpression(canBeArrow?: boolean, forInit?: ForInit): AST.Expression;
1123
+ /** Parse parenthesized expression (just the expression) */
1124
+ parseParenExpression(): AST.Expression;
1125
+ /**
1126
+ * Parse item in parentheses (can be overridden for flow/ts)
1127
+ */
1128
+ parseParenItem(item: AST.Node): AST.Node;
1129
+ /**
1130
+ * Parse arrow expression
1131
+
1132
+ */
1133
+ parseArrowExpression(node: AST.Node, params: AST.Node[], isAsync?: boolean, forInit?: ForInit): AST.ArrowFunctionExpression;
1134
+ /**
1135
+ * Check if arrow should be parsed
1136
+ */
1137
+ shouldParseArrow(exprList: AST.Node[]): boolean;
1138
+ /**
1139
+ * Parse spread element (...expr)
1140
+ */
1141
+ parseSpread(refDestructuringErrors?: DestructuringErrors): AST.SpreadElement;
1142
+ /**
1143
+ * Parse rest binding pattern (...pattern)
1144
+ * @returns RestElement node
1145
+ */
1146
+ parseRestBinding(): AST.RestElement;
1147
+ /**
1148
+ * Parse 'new' expression
1149
+ * @returns NewExpression or MetaProperty (new.target)
1150
+ */
1151
+ parseNew(): AST.NewExpression | AST.MetaProperty;
1152
+ /**
1153
+ * Parse dynamic import expression
1154
+ * @param forNew Whether in new expression context
1155
+ */
1156
+ parseExprImport(forNew?: boolean): AST.ImportExpression | AST.MetaProperty;
1157
+ /**
1158
+ * Parse dynamic import call
1159
+ * @param node Import expression node
1160
+ */
1161
+ parseDynamicImport(node: AST.Node): AST.ImportExpression;
1162
+ /**
1163
+ * Parse import.meta
1164
+ * @param node MetaProperty node
1165
+ */
1166
+ parseImportMeta(node: AST.Node): AST.MetaProperty;
1167
+ /** Parse yield expression */
1168
+ parseYield(forInit?: ForInit): AST.YieldExpression;
1169
+ /** Parse await expression */
1170
+ parseAwait(forInit?: ForInit): AST.AwaitExpression;
1171
+ /**
1172
+ * Parse template literal
1173
+ * @param isTagged Whether this is a tagged template
1174
+ */
1175
+ parseTemplate(isTagged?: {
1176
+ start: number;
1177
+ }): AST.TemplateLiteral;
1178
+ /**
1179
+ * Parse template element
1180
+ * @param options { isTagged: boolean }
1181
+ */
1182
+ parseTemplateElement(options: {
1183
+ isTagged: boolean;
1184
+ }): AST.TemplateElement;
1185
+ /**
1186
+ * Parse an identifier
1187
+ */
1188
+ parseIdent(liberal?: boolean): AST.Identifier;
1189
+ /**
1190
+ * Parse identifier node (internal, doesn't consume token)
1191
+ * @returns Partial identifier node
1192
+ */
1193
+ parseIdentNode(): AST.Node;
1194
+ /**
1195
+ * Parse private identifier (#name)
1196
+ * @returns PrivateIdentifier node
1197
+ */
1198
+ parsePrivateIdent(): AST.PrivateIdentifier;
1199
+ /**
1200
+ * Check if identifier is unreserved
1201
+ * @param ref Node with name, start, end
1202
+ */
1203
+ checkUnreserved(ref: {
1204
+ name: string;
1205
+ start: number;
1206
+ end: number;
1207
+ }): void;
1208
+ /**
1209
+ * Parse object expression or pattern
1210
+ * @param isPattern Whether parsing a pattern
1211
+ * @param refDestructuringErrors Error collector
1212
+ * @returns ObjectExpression or ObjectPattern
1213
+ */
1214
+ parseObj(isPattern?: boolean, refDestructuringErrors?: DestructuringErrors): AST.ObjectExpression | AST.ObjectPattern;
1215
+ /**
1216
+ * Parse property in object literal
1217
+ * @param isPattern Whether parsing a pattern
1218
+ * @param refDestructuringErrors Error collector
1219
+ * @returns Property node
1220
+ */
1221
+ parseProperty(isPattern: boolean, refDestructuringErrors?: DestructuringErrors): AST.Property | AST.SpreadElement;
1222
+ /**
1223
+ * Parse property name (identifier, string, number, computed)
1224
+ * @param prop Property node to update
1225
+ * @returns The key expression
1226
+ */
1227
+ parsePropertyName(prop: AST.Node): AST.Expression | AST.PrivateIdentifier;
1228
+ /**
1229
+ * Parse property value
1230
+ * @param prop Property node
1231
+ * @param isPattern Whether parsing pattern
1232
+ * @param isGenerator Whether generator method
1233
+ * @param isAsync Whether async method
1234
+ * @param startPos Start position
1235
+ * @param startLoc Start location
1236
+ * @param refDestructuringErrors Error collector
1237
+ * @param containsEsc Whether key contains escapes
1238
+ */
1239
+ parsePropertyValue(prop: AST.Node, isPattern: boolean, isGenerator: boolean, isAsync: boolean, startPos: number, startLoc: AST.Position, refDestructuringErrors?: DestructuringErrors, containsEsc?: boolean): void;
1240
+ /**
1241
+ * Get property kind from name
1242
+ * @param prop Property node
1243
+ * @returns "init", "get", or "set"
1244
+ */
1245
+ getPropertyKind(prop: AST.Node): "init" | "get" | "set";
1246
+ /**
1247
+ * Parse expression list (array elements, call arguments)
1248
+ * @param close Closing token type
1249
+ * @param allowTrailingComma Whether trailing comma allowed
1250
+ * @param allowEmpty Whether empty slots allowed
1251
+ * @param refDestructuringErrors Error collector
1252
+ * @returns Array of expressions
1253
+ */
1254
+ parseExprList(close: TokenType, allowTrailingComma?: boolean, allowEmpty?: boolean, refDestructuringErrors?: DestructuringErrors): (AST.Expression | null)[];
1255
+ /**
1256
+ * Parse binding list (pattern elements)
1257
+ * @param close Closing token type
1258
+ * @param allowEmpty Whether empty slots allowed
1259
+ * @param allowTrailingComma Whether trailing comma allowed
1260
+ * @param allowModifiers Whether modifiers allowed (TS)
1261
+ */
1262
+ parseBindingList(close: TokenType, allowEmpty?: boolean, allowTrailingComma?: boolean, allowModifiers?: boolean): AST.Pattern[];
1263
+ /**
1264
+ * Parse binding atom (identifier or pattern)
1265
+ * @returns Pattern node
1266
+ */
1267
+ parseBindingAtom(): AST.Pattern;
1268
+ /**
1269
+ * Parse top level program
1270
+ * @param node Program node to populate
1271
+ * @returns Completed Program node
1272
+ */
1273
+ parseTopLevel(node: AST.Program): AST.Program;
1274
+ parseTemplateBody(body: (AST.Statement | AST.Node)[]): void;
1275
+ /**
1276
+ * Parse a statement
1277
+ * @param context Statement context ("for", "if", "label", etc.)
1278
+ * @param topLevel Whether at top level
1279
+ * @param exports Export set for module
1280
+ * @returns Statement node
1281
+ */
1282
+ parseStatement(context?: string | null, topLevel?: boolean, exports?: AST.ExportSpecifier): AST.ExpressionStatement | AST.Statement | AST.GTSDefineStatement;
1283
+ parseBlock(createNewLexicalScope?: boolean, node?: AST.BlockStatement, exitStrict?: boolean): AST.BlockStatement;
1284
+ /** Parse empty statement (;) */
1285
+ parseEmptyStatement(node: AST.Node): AST.EmptyStatement;
1286
+ /** Parse expression statement */
1287
+ parseExpressionStatement(node: AST.Node, expr: AST.Expression): AST.ExpressionStatement;
1288
+ /** Parse labeled statement */
1289
+ parseLabeledStatement(node: AST.Node, maybeName: string, expr: AST.Expression, context?: string): AST.LabeledStatement;
1290
+ /** Parse if statement */
1291
+ parseIfStatement(node: AST.Node): AST.IfStatement;
1292
+ /** Parse switch statement */
1293
+ parseSwitchStatement(node: AST.Node): AST.SwitchStatement;
1294
+ /** Parse while statement */
1295
+ parseWhileStatement(node: AST.Node): AST.WhileStatement;
1296
+ /** Parse do-while statement */
1297
+ parseDoStatement(node: AST.Node): AST.DoWhileStatement;
1298
+ /** Parse for statement (all variants) */
1299
+ parseForStatement(node: AST.ForStatement | AST.ForInStatement | AST.ForOfStatement): AST.ForStatement | AST.ForInStatement | AST.ForOfStatement;
1300
+ parseForAfterInitWithIndex(node: AST.ForStatement | AST.ForInStatement | AST.ForOfStatement, init: AST.VariableDeclaration, awaitAt: number): AST.ForStatement | AST.ForInStatement | AST.ForOfStatement;
1301
+ parseForInWithIndex(node: AST.ForInStatement | AST.ForOfStatement, init: AST.VariableDeclaration | AST.Pattern): AST.ForInStatement | AST.ForOfStatement;
1302
+ /**
1303
+ * Parse regular for loop
1304
+ * @param node For statement node
1305
+ * @param init Initializer expression
1306
+ */
1307
+ parseFor(node: AST.Node, init: AST.Node | null): AST.ForStatement;
1308
+ /**
1309
+ * Parse for-in loop
1310
+ * @param node For statement node
1311
+ * @param init Left-hand binding
1312
+ */
1313
+ parseForIn(node: AST.Node, init: AST.Node): AST.ForInStatement;
1314
+ /** Parse break statement */
1315
+ parseBreakContinueStatement(node: AST.Node, keyword: string): AST.BreakStatement | AST.ContinueStatement;
1316
+ /** Parse return statement */
1317
+ parseReturnStatement(node: AST.Node): AST.ReturnStatement;
1318
+ /** Parse throw statement */
1319
+ parseThrowStatement(node: AST.Node): AST.ThrowStatement;
1320
+ /** Parse try statement */
1321
+ parseTryStatement(node: AST.TryStatement): AST.TryStatement;
1322
+ /**
1323
+ * Parse catch clause parameter
1324
+ * @returns Pattern node for catch param
1325
+ */
1326
+ parseCatchClauseParam(): AST.Pattern;
1327
+ /** Parse with statement */
1328
+ parseWithStatement(node: AST.Node): AST.WithStatement;
1329
+ /** Parse debugger statement */
1330
+ parseDebuggerStatement(node: AST.Node): AST.DebuggerStatement;
1331
+ /** Parse variable statement (var, let, const) */
1332
+ parseVarStatement(node: AST.Node, kind: string): AST.VariableDeclaration;
1333
+ /**
1334
+ * Parse variable declarations
1335
+ * @param node Declaration node
1336
+ * @param isFor Whether in for-loop initializer
1337
+ * @param kind "var", "let", "const", "using", or "await using"
1338
+ * @returns VariableDeclaration node
1339
+ */
1340
+ parseVar(node: AST.Node, isFor: boolean, kind: string): AST.VariableDeclaration;
1341
+ /**
1342
+ * Parse variable ID (identifier or pattern)
1343
+ * @param decl Declarator node
1344
+ * @param kind Variable kind
1345
+ */
1346
+ parseVarId(decl: AST.Node, kind: string): void;
1347
+ /** Check if current token starts 'let' declaration */
1348
+ isLet(context?: string): boolean;
1349
+ /** Check if current token starts 'using' declaration */
1350
+ isUsing?(isFor?: boolean): boolean;
1351
+ /** Check if current token starts 'await using' declaration */
1352
+ isAwaitUsing?(isFor?: boolean): boolean;
1353
+ /**
1354
+ * Parse function declaration or expression
1355
+ */
1356
+ parseFunction(node: AST.Node, statement: number, allowExpressionBody?: boolean, isAsync?: boolean, forInit?: ForInit): AST.FunctionDeclaration | AST.FunctionExpression;
1357
+ /** Parse function statement */
1358
+ parseFunctionStatement(node: AST.Node, isAsync?: boolean, declarationPosition?: boolean): AST.FunctionDeclaration;
1359
+ /**
1360
+ * Parse function parameters into node.params
1361
+ * @param node Function node to populate
1362
+ */
1363
+ parseFunctionParams(node: AST.Node): void;
1364
+ /**
1365
+ * Parse function body
1366
+ */
1367
+ parseFunctionBody(node: AST.Node, isArrowFunction: boolean, isMethod: boolean, forInit?: ForInit): void;
1368
+ /** Initialize function node properties */
1369
+ initFunction(node: AST.Node): void;
1370
+ /** Check for yield/await in default parameters */
1371
+ checkYieldAwaitInDefaultParams(): void;
1372
+ /** Check if async function */
1373
+ isAsyncFunction(): boolean;
1374
+ /**
1375
+ * Parse class declaration or expression
1376
+ * @param node Class node
1377
+ * @param isStatement true, "nullableID", or false
1378
+ */
1379
+ parseClass(node: AST.Node, isStatement: boolean | "nullableID"): AST.ClassDeclaration | AST.ClassExpression;
1380
+ /** Parse class ID (name) */
1381
+ parseClassId(node: AST.Node, isStatement: boolean | "nullableID"): void;
1382
+ /** Parse class superclass */
1383
+ parseClassSuper(node: AST.Node): void;
1384
+ /** Enter class body scope */
1385
+ enterClassBody(): Record<string, any>;
1386
+ /** Exit class body scope */
1387
+ exitClassBody(): void;
1388
+ /**
1389
+ * Parse class element (method, field, static block)
1390
+ * @param constructorAllowsSuper Whether constructor can call super
1391
+ */
1392
+ parseClassElement(constructorAllowsSuper: boolean): AST.MethodDefinition | AST.PropertyDefinition | AST.StaticBlock | null;
1393
+ /** Parse class element name */
1394
+ parseClassElementName(element: AST.Node): void;
1395
+ /** Parse class static block */
1396
+ parseClassStaticBlock(node: AST.Node): AST.StaticBlock;
1397
+ /** Parse class method */
1398
+ parseClassMethod(method: AST.Node, isGenerator: boolean, isAsync: boolean, allowDirectSuper: boolean): AST.MethodDefinition;
1399
+ /** Parse class field */
1400
+ parseClassField(field: AST.Node): AST.PropertyDefinition;
1401
+ /** Check if class element name start */
1402
+ isClassElementNameStart(): boolean;
1403
+ /**
1404
+ * Parse method definition
1405
+ * @param isGenerator Whether generator method
1406
+ * @param isAsync Whether async method
1407
+ * @param allowDirectSuper Whether super() allowed
1408
+ */
1409
+ parseMethod(isGenerator: boolean, isAsync?: boolean, allowDirectSuper?: boolean): AST.FunctionExpression;
1410
+ /** Parse import declaration */
1411
+ parseImport(node: AST.Node): AST.ImportDeclaration;
1412
+ /** Parse import specifiers */
1413
+ parseImportSpecifiers(): AST.ImportSpecifier[];
1414
+ /** Parse single import specifier */
1415
+ parseImportSpecifier(): AST.ImportSpecifier;
1416
+ /** Parse module export name (identifier or string) */
1417
+ parseModuleExportName(): AST.Identifier | AST.Literal;
1418
+ /** Parse export declaration */
1419
+ parseExport(node: AST.Node, exports?: any): AST.ExportNamedDeclaration | AST.ExportDefaultDeclaration | AST.ExportAllDeclaration;
1420
+ /** Parse export specifiers */
1421
+ parseExportSpecifiers(exports?: any): AST.ExportSpecifier[];
1422
+ /** Parse export default declaration */
1423
+ parseExportDefaultDeclaration(): AST.Declaration | AST.Expression;
1424
+ /** Check if export statement should be parsed */
1425
+ shouldParseExportStatement(): boolean;
1426
+ /** Parse export declaration body */
1427
+ parseExportDeclaration(node: AST.Node): AST.Declaration;
1428
+ /**
1429
+ * Convert expression to assignable pattern
1430
+ * @param node Expression to convert
1431
+ * @param isBinding Whether binding pattern
1432
+ * @param refDestructuringErrors Error collector
1433
+ */
1434
+ toAssignable(node: AST.Node, isBinding?: boolean, refDestructuringErrors?: DestructuringErrors): AST.Pattern;
1435
+ /**
1436
+ * Convert expression list to assignable list
1437
+ * @param exprList Expression list
1438
+ * @param isBinding Whether binding patterns
1439
+ */
1440
+ toAssignableList(exprList: AST.Node[], isBinding: boolean): AST.Pattern[];
1441
+ /**
1442
+ * Parse maybe-default pattern (pattern = defaultValue)
1443
+ * @param startPos Start position
1444
+ * @param startLoc Start location
1445
+ * @param left Left-hand pattern
1446
+ */
1447
+ parseMaybeDefault(startPos: number, startLoc: AST.Position, left?: AST.Node): AST.Pattern;
1448
+ /**
1449
+ * Check left-value pattern (for destructuring)
1450
+ */
1451
+ checkLValPattern(node: AST.Node, bindingType?: BindingType[keyof BindingType], checkClashes?: Record<string, boolean>): void;
1452
+ /**
1453
+ * Check left-value simple (identifier or member expression)
1454
+ */
1455
+ checkLValSimple(expr: AST.Node, bindingType?: BindingType[keyof BindingType], checkClashes?: Record<string, boolean>): void;
1456
+ /**
1457
+ * Check left-value inner pattern
1458
+ * @param node Pattern node
1459
+ * @param bindingType Binding type constant
1460
+ * @param checkClashes Clash detection object
1461
+ */
1462
+ checkLValInnerPattern(node: AST.Node, bindingType?: BindingType[keyof BindingType], checkClashes?: Record<string, boolean>): void;
1463
+ /**
1464
+ * Check expression errors
1465
+ * @param refDestructuringErrors Error collector
1466
+ * @param andThrow Whether to throw on error
1467
+ * @returns Whether there were errors
1468
+ */
1469
+ checkExpressionErrors(refDestructuringErrors: DestructuringErrors | null, andThrow?: boolean): boolean;
1470
+ /**
1471
+ * Check if expression is simple assign target
1472
+ * @param expr Expression to check
1473
+ */
1474
+ isSimpleAssignTarget(expr: AST.Node): boolean;
1475
+ /**
1476
+ * Try to parse, returning result with error info if failed
1477
+ * @param fn Parsing function to try
1478
+ * @returns Result with node, error, thrown, aborted, failState
1479
+ */
1480
+ tryParse<T>(fn: () => T): {
1481
+ node: T | null;
1482
+ error: Error | null;
1483
+ thrown: boolean;
1484
+ aborted: boolean;
1485
+ failState: any;
1486
+ };
1487
+ /**
1488
+ * Runs `cb` in a type context.
1489
+ * This should be called one token *before* the first type token,
1490
+ * so that the call to `next()` is run in type context.
1491
+ */
1492
+ tsInType<T>(cb: () => T): T;
1493
+ tsParseType(): any;
1494
+ getElementName(node?: AST.Node): string | null;
1495
+ /**
1496
+ * The constructor/class type for the extended Ripple parser.
1497
+ * This represents the static side of the parser class after extending with plugins.
1498
+ */
1499
+ /** Built-in token types */
1500
+ static tokTypes: TokTypes;
1501
+ /** Built-in token contexts */
1502
+ static tokContexts: TokContexts;
1503
+ /** TypeScript extensions when using acorn-typescript */
1504
+ static acornTypeScript: AcornTypeScriptExtensions;
1505
+ }
1506
+ }
1507
+ //#endregion
612
1508
  //#region src/config.d.ts
613
1509
  interface GtsConfig extends TranspileOption {}
614
1510
  type ReadFileFn = (path: string, encoding: "utf8") => string;
@@ -636,4 +1532,4 @@ declare function resolveGtsConfigSync(filePath: string, inlineConfig: GtsConfig,
636
1532
  declare function transpile(source: string, filename: string, option: TranspileOption): TranspileResult;
637
1533
  declare function transpileForVolar(source: string, filename: string, option: TranspileOption): VolarMappingResult;
638
1534
  //#endregion
639
- export { type GtsConfig, type ParseLooseOptions as GtsParseLooseOptions, type ParseOptions as GtsParseOptions, GtsTranspilerError, type PathModule, type ResolveGtsConfigAsyncOptions, type ResolveGtsConfigSyncOptions, type TranspileOption, type TranspileResult, type VolarMappingResult, parse, parseLoose, resolveGtsConfig, resolveGtsConfigSync, transpile, transpileForVolar };
1535
+ export { type AST, type GtsConfig, type ParseLooseOptions as GtsParseLooseOptions, type ParseOptions as GtsParseOptions, GtsTranspilerError, type PathModule, type ResolveGtsConfigAsyncOptions, type ResolveGtsConfigSyncOptions, type TranspileOption, type TranspileResult, type VolarMappingResult, parse, parseLoose, resolveGtsConfig, resolveGtsConfigSync, transpile, transpileForVolar };