@tslite/core 0.1.0

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.
@@ -0,0 +1,1215 @@
1
+ type Node = NodeMap[keyof NodeMap];
2
+ interface ExpressionMap {
3
+ ArrayExpression: ArrayExpression;
4
+ ArrowFunctionExpression: ArrowFunctionExpression;
5
+ AssignmentExpression: AssignmentExpression;
6
+ AwaitExpression: AwaitExpression;
7
+ BinaryExpression: BinaryExpression;
8
+ CallExpression: CallExpression;
9
+ ChainExpression: ChainExpression;
10
+ ConditionalExpression: ConditionalExpression;
11
+ FunctionExpression: FunctionExpression;
12
+ Identifier: Identifier;
13
+ JsonExpression: JsonExpression;
14
+ ImportExpression: ImportExpression;
15
+ Literal: Literal;
16
+ LogicalExpression: LogicalExpression;
17
+ MemberExpression: MemberExpression;
18
+ MetaProperty: MetaProperty;
19
+ NewExpression: NewExpression;
20
+ ObjectExpression: ObjectExpression;
21
+ SequenceExpression: SequenceExpression;
22
+ TaggedTemplateExpression: TaggedTemplateExpression;
23
+ TemplateLiteral: TemplateLiteral;
24
+ ThisExpression: ThisExpression;
25
+ UnaryExpression: UnaryExpression;
26
+ UpdateExpression: UpdateExpression;
27
+ }
28
+ interface NodeMap {
29
+ AssignmentProperty: AssignmentProperty;
30
+ CatchClause: CatchClause;
31
+ Expression: Expression;
32
+ Function: Function;
33
+ Identifier: Identifier;
34
+ Literal: Literal;
35
+ MethodDefinition: MethodDefinition;
36
+ Pattern: Pattern;
37
+ Program: Program;
38
+ Property: Property;
39
+ PropertyDefinition: PropertyDefinition;
40
+ SpreadElement: SpreadElement;
41
+ Statement: Statement;
42
+ SwitchCase: SwitchCase;
43
+ TemplateElement: TemplateElement;
44
+ VariableDeclarator: VariableDeclarator;
45
+ ImportDeclaration: ImportDeclaration;
46
+ ImportSpecifier: ImportSpecifier;
47
+ ImportDefaultSpecifier: ImportDefaultSpecifier;
48
+ ImportNamespaceSpecifier: ImportNamespaceSpecifier;
49
+ }
50
+ type Expression = ExpressionMap[keyof ExpressionMap];
51
+ type Statement = ExpressionStatement | BlockStatement | EmptyStatement | DebuggerStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | Declaration;
52
+ type CallExpression = SimpleCallExpression | NewExpression;
53
+ type ChainElement = SimpleCallExpression | MemberExpression;
54
+ type Declaration = FunctionDeclaration | VariableDeclaration;
55
+ type Function = ArrowFunctionExpression | FunctionDeclaration | FunctionExpression;
56
+ /**
57
+ * TSLite — a forma serializada da linguagem TSLite.
58
+ *
59
+ * JSON puro (dados estáticos) entremeado de ilhas executáveis marcadas com
60
+ * `#ast`, cujo valor é o tipo do nó ESTree. É portável, serializável e
61
+ * diffável: `encode()` produz, `decode()` consome, `printJson()` emite.
62
+ */
63
+ type TSLite = string | number | boolean | null | TSLite[] | TSLiteMarker | {
64
+ [key: string]: TSLite;
65
+ };
66
+ /** Ilha executável dentro do TSLite (o valor de `#ast` é o tipo do nó). */
67
+ interface TSLiteMarker {
68
+ "#ast": string;
69
+ [prop: string]: unknown;
70
+ }
71
+ /**
72
+ * SimpleNode — a forma de árvore simplificada produzida por `encode()`: um nó
73
+ * ESTree com os campos falsy omitidos e cada `ObjectExpression` colapsado em
74
+ * `JsonExpression` (cujo `body` é {@link TSLite}). Os tipos `Simple*` descrevem
75
+ * cada variante; este é o agregador.
76
+ */
77
+ type SimpleNode = {
78
+ type: string;
79
+ [key: string]: any;
80
+ };
81
+ type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral;
82
+ type Pattern = ArrayPattern | AssignmentPattern | Identifier | JsonExpression | MemberExpression | ObjectPattern | RestElement;
83
+ type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "||=" | "&&=" | "??=";
84
+ type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" | "instanceof";
85
+ type LogicalOperator = "||" | "&&" | "??";
86
+ type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
87
+ type UpdateOperator = "++" | "--";
88
+ interface ArrayExpression extends BaseExpression {
89
+ type: "ArrayExpression";
90
+ elements: Array<Expression | SpreadElement | null>;
91
+ }
92
+ interface ArrayPattern extends BasePattern {
93
+ type: "ArrayPattern";
94
+ elements: Array<Pattern | null>;
95
+ }
96
+ interface ArrowFunctionExpression extends BaseExpression, BaseFunction {
97
+ type: "ArrowFunctionExpression";
98
+ expression: boolean;
99
+ body: BlockStatement | Expression;
100
+ }
101
+ interface AssignmentExpression extends BaseExpression {
102
+ type: "AssignmentExpression";
103
+ operator: AssignmentOperator;
104
+ left: Pattern | MemberExpression;
105
+ right: Expression;
106
+ }
107
+ interface AssignmentPattern extends BasePattern {
108
+ type: "AssignmentPattern";
109
+ left: Pattern;
110
+ right: Expression;
111
+ }
112
+ interface AssignmentProperty extends Property {
113
+ value: Pattern;
114
+ kind: "init";
115
+ method: boolean;
116
+ }
117
+ interface AwaitExpression extends BaseExpression {
118
+ type: "AwaitExpression";
119
+ argument: Expression;
120
+ }
121
+ interface BaseCallExpression extends BaseExpression {
122
+ callee: Expression;
123
+ arguments: Array<Expression | SpreadElement>;
124
+ }
125
+ interface BaseDeclaration extends BaseStatement {
126
+ }
127
+ interface BaseExpression extends BaseNode {
128
+ }
129
+ interface BaseForXStatement extends BaseStatement {
130
+ left: VariableDeclaration | Pattern;
131
+ right: Expression;
132
+ body: Statement;
133
+ }
134
+ interface BaseFunction extends BaseNode {
135
+ params: Pattern[];
136
+ generator?: boolean | undefined;
137
+ async?: boolean | undefined;
138
+ body: BlockStatement | Expression;
139
+ }
140
+ interface BaseNode extends BaseNodeWithoutComments {
141
+ leadingComments?: Comment[] | undefined;
142
+ trailingComments?: Comment[] | undefined;
143
+ }
144
+ interface BaseNodeWithoutComments {
145
+ type: string;
146
+ loc?: SourceLocation | null | undefined;
147
+ range?: [number, number] | undefined;
148
+ }
149
+ interface BasePattern extends BaseNode {
150
+ }
151
+ interface BaseStatement extends BaseNode {
152
+ }
153
+ interface BigIntLiteral extends BaseNode, BaseExpression {
154
+ type: "Literal";
155
+ value?: bigint | null | undefined;
156
+ bigint: string;
157
+ raw?: string | undefined;
158
+ }
159
+ interface BinaryExpression extends BaseExpression {
160
+ type: "BinaryExpression";
161
+ operator: BinaryOperator;
162
+ left: Expression;
163
+ right: Expression;
164
+ }
165
+ interface BlockStatement extends BaseStatement {
166
+ type: "BlockStatement";
167
+ body: Statement[];
168
+ innerComments?: Comment[] | undefined;
169
+ }
170
+ interface BreakStatement extends BaseStatement {
171
+ type: "BreakStatement";
172
+ label?: Identifier | null | undefined;
173
+ }
174
+ interface CatchClause extends BaseNode {
175
+ type: "CatchClause";
176
+ param: Pattern | null;
177
+ body: BlockStatement;
178
+ }
179
+ interface ChainExpression extends BaseExpression {
180
+ type: "ChainExpression";
181
+ expression: ChainElement;
182
+ }
183
+ interface Comment extends BaseNodeWithoutComments {
184
+ type: "Line" | "Block";
185
+ value: string;
186
+ }
187
+ interface ConditionalExpression extends BaseExpression {
188
+ type: "ConditionalExpression";
189
+ test: Expression;
190
+ alternate: Expression;
191
+ consequent: Expression;
192
+ }
193
+ interface ContinueStatement extends BaseStatement {
194
+ type: "ContinueStatement";
195
+ label?: Identifier | null | undefined;
196
+ }
197
+ interface DebuggerStatement extends BaseStatement {
198
+ type: "DebuggerStatement";
199
+ }
200
+ interface Directive extends BaseNode {
201
+ type: "ExpressionStatement";
202
+ expression: Literal;
203
+ directive: string;
204
+ }
205
+ interface DoWhileStatement extends BaseStatement {
206
+ type: "DoWhileStatement";
207
+ body: Statement;
208
+ test: Expression;
209
+ }
210
+ interface EmptyStatement extends BaseStatement {
211
+ type: "EmptyStatement";
212
+ }
213
+ interface ExpressionStatement extends BaseStatement {
214
+ type: "ExpressionStatement";
215
+ expression: Expression;
216
+ }
217
+ interface ForInStatement extends BaseForXStatement {
218
+ type: "ForInStatement";
219
+ }
220
+ interface ForOfStatement extends BaseForXStatement {
221
+ type: "ForOfStatement";
222
+ await: boolean;
223
+ }
224
+ interface ForStatement extends BaseStatement {
225
+ type: "ForStatement";
226
+ init?: VariableDeclaration | Expression | null | undefined;
227
+ test?: Expression | null | undefined;
228
+ update?: Expression | null | undefined;
229
+ body: Statement;
230
+ }
231
+ interface FunctionDeclaration extends MaybeNamedFunctionDeclaration {
232
+ id: Identifier;
233
+ }
234
+ interface FunctionExpression extends BaseFunction, BaseExpression {
235
+ id?: Identifier | null | undefined;
236
+ type: "FunctionExpression";
237
+ body: BlockStatement;
238
+ }
239
+ interface Identifier extends BaseNode, BaseExpression, BasePattern {
240
+ type: "Identifier";
241
+ name: string;
242
+ }
243
+ interface IfStatement extends BaseStatement {
244
+ type: "IfStatement";
245
+ test: Expression;
246
+ consequent: Statement;
247
+ alternate?: Statement | null | undefined;
248
+ }
249
+ interface JsonExpression extends BaseNode, BaseExpression, BasePattern {
250
+ type: "JsonExpression";
251
+ body: TSLite;
252
+ }
253
+ interface LabeledStatement extends BaseStatement {
254
+ type: "LabeledStatement";
255
+ label: Identifier;
256
+ body: Statement;
257
+ }
258
+ interface LogicalExpression extends BaseExpression {
259
+ type: "LogicalExpression";
260
+ operator: LogicalOperator;
261
+ left: Expression;
262
+ right: Expression;
263
+ }
264
+ interface MaybeNamedFunctionDeclaration extends BaseFunction, BaseDeclaration {
265
+ type: "FunctionDeclaration";
266
+ id: Identifier | null;
267
+ body: BlockStatement;
268
+ }
269
+ interface MemberExpression extends BaseExpression, BasePattern {
270
+ type: "MemberExpression";
271
+ object: Expression;
272
+ property: Expression;
273
+ computed?: boolean;
274
+ optional?: boolean;
275
+ }
276
+ interface MetaProperty extends BaseExpression {
277
+ type: "MetaProperty";
278
+ meta: Identifier;
279
+ property: Identifier;
280
+ }
281
+ type ModuleDeclaration = ImportDeclaration;
282
+ interface BaseModuleDeclaration extends BaseNode {
283
+ }
284
+ type ModuleSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier;
285
+ interface BaseModuleSpecifier extends BaseNode {
286
+ local: Identifier;
287
+ }
288
+ interface MethodDefinition extends BaseNode {
289
+ type: "MethodDefinition";
290
+ key: Expression;
291
+ value: FunctionExpression;
292
+ kind: "constructor" | "method" | "get" | "set";
293
+ computed?: boolean;
294
+ static: boolean;
295
+ }
296
+ interface NewExpression extends BaseCallExpression {
297
+ type: "NewExpression";
298
+ }
299
+ interface ObjectExpression extends BaseExpression {
300
+ type: "ObjectExpression";
301
+ properties: Array<Property | SpreadElement>;
302
+ }
303
+ interface ObjectPattern extends BasePattern {
304
+ type: "ObjectPattern";
305
+ properties: Array<AssignmentProperty | RestElement>;
306
+ }
307
+ interface Position {
308
+ line: number;
309
+ column: number;
310
+ }
311
+ interface Program extends BaseNode {
312
+ type: "Program";
313
+ sourceType: "script" | "module";
314
+ body: Array<Directive | Statement | ModuleDeclaration>;
315
+ comments?: Comment[] | undefined;
316
+ }
317
+ interface Property extends BaseNode {
318
+ type: "Property";
319
+ key: Expression;
320
+ value: Expression | Pattern | AssignmentProperty;
321
+ kind: "init" | "get" | "set";
322
+ method?: boolean;
323
+ shorthand?: boolean;
324
+ computed?: boolean;
325
+ }
326
+ interface PropertyDefinition extends BaseNode {
327
+ type: "PropertyDefinition";
328
+ key: Expression;
329
+ value?: Expression | null | undefined;
330
+ computed?: boolean;
331
+ static: boolean;
332
+ }
333
+ interface RegExpLiteral extends BaseNode, BaseExpression {
334
+ type: "Literal";
335
+ value?: RegExp | null | undefined;
336
+ regex: {
337
+ pattern: string;
338
+ flags: string;
339
+ };
340
+ raw?: string | undefined;
341
+ }
342
+ interface RestElement extends BasePattern {
343
+ type: "RestElement";
344
+ argument: Pattern;
345
+ }
346
+ interface ReturnStatement extends BaseStatement {
347
+ type: "ReturnStatement";
348
+ argument?: Expression | null | undefined;
349
+ }
350
+ interface SequenceExpression extends BaseExpression {
351
+ type: "SequenceExpression";
352
+ expressions: Expression[];
353
+ }
354
+ interface SimpleCallExpression extends BaseCallExpression {
355
+ type: "CallExpression";
356
+ optional?: boolean;
357
+ }
358
+ interface SimpleLiteral extends BaseNode, BaseExpression {
359
+ type: "Literal";
360
+ value: string | boolean | number | null;
361
+ raw?: string | undefined;
362
+ }
363
+ interface SourceLocation {
364
+ source?: string | null | undefined;
365
+ start: Position;
366
+ end: Position;
367
+ }
368
+ interface SpreadElement extends BaseNode {
369
+ type: "SpreadElement";
370
+ argument: Expression;
371
+ }
372
+ interface SwitchCase extends BaseNode {
373
+ type: "SwitchCase";
374
+ test?: Expression | null | undefined;
375
+ consequent: Statement[];
376
+ }
377
+ interface SwitchStatement extends BaseStatement {
378
+ type: "SwitchStatement";
379
+ discriminant: Expression;
380
+ cases: SwitchCase[];
381
+ }
382
+ interface TaggedTemplateExpression extends BaseExpression {
383
+ type: "TaggedTemplateExpression";
384
+ tag: Expression;
385
+ quasi: TemplateLiteral;
386
+ }
387
+ interface TemplateElement extends BaseNode {
388
+ type: "TemplateElement";
389
+ tail: boolean;
390
+ value: {
391
+ cooked?: string | null | undefined;
392
+ raw: string;
393
+ };
394
+ }
395
+ interface TemplateLiteral extends BaseExpression {
396
+ type: "TemplateLiteral";
397
+ quasis: TemplateElement[];
398
+ expressions: Expression[];
399
+ }
400
+ interface ThisExpression extends BaseExpression {
401
+ type: "ThisExpression";
402
+ }
403
+ interface ThrowStatement extends BaseStatement {
404
+ type: "ThrowStatement";
405
+ argument: Expression;
406
+ }
407
+ interface TryStatement extends BaseStatement {
408
+ type: "TryStatement";
409
+ block: BlockStatement;
410
+ handler?: CatchClause | null | undefined;
411
+ finalizer?: BlockStatement | null | undefined;
412
+ }
413
+ interface UnaryExpression extends BaseExpression {
414
+ type: "UnaryExpression";
415
+ operator: UnaryOperator;
416
+ prefix: true;
417
+ argument: Expression;
418
+ }
419
+ interface UpdateExpression extends BaseExpression {
420
+ type: "UpdateExpression";
421
+ operator: UpdateOperator;
422
+ argument: Expression;
423
+ prefix: boolean;
424
+ }
425
+ interface VariableDeclaration extends BaseDeclaration {
426
+ type: "VariableDeclaration";
427
+ declarations: VariableDeclarator[];
428
+ kind: "var" | "let" | "const";
429
+ }
430
+ interface VariableDeclarator extends BaseNode {
431
+ type: "VariableDeclarator";
432
+ id: Pattern;
433
+ init?: Expression | null | undefined;
434
+ }
435
+ interface WhileStatement extends BaseStatement {
436
+ type: "WhileStatement";
437
+ test: Expression;
438
+ body: Statement;
439
+ }
440
+ interface ImportDeclaration extends BaseModuleDeclaration {
441
+ type: "ImportDeclaration";
442
+ specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>;
443
+ source: Literal;
444
+ }
445
+ interface ImportSpecifier extends BaseModuleSpecifier {
446
+ type: "ImportSpecifier";
447
+ imported: Identifier;
448
+ }
449
+ interface ImportExpression extends BaseExpression {
450
+ type: "ImportExpression";
451
+ source: Expression;
452
+ }
453
+ interface ImportDefaultSpecifier extends BaseModuleSpecifier {
454
+ type: "ImportDefaultSpecifier";
455
+ }
456
+ interface ImportNamespaceSpecifier extends BaseModuleSpecifier {
457
+ type: "ImportNamespaceSpecifier";
458
+ }
459
+ type SimpleArrayExpression = Partial<ArrayExpression>;
460
+ type SimpleArrayPattern = Partial<ArrayPattern>;
461
+ type SimpleArrowFunctionExpression = Partial<ArrowFunctionExpression>;
462
+ type SimpleAssignmentExpression = Partial<AssignmentExpression>;
463
+ type SimpleAssignmentPattern = Partial<AssignmentPattern>;
464
+ type SimpleAssignmentProperty = Partial<AssignmentProperty>;
465
+ type SimpleAwaitExpression = Partial<AwaitExpression>;
466
+ type SimpleBaseCallExpression = Partial<BaseCallExpression>;
467
+ type SimpleBaseDeclaration = Partial<BaseDeclaration>;
468
+ type SimpleBaseExpression = Partial<BaseExpression>;
469
+ type SimpleBaseForXStatement = Partial<BaseForXStatement>;
470
+ type SimpleBaseFunction = Partial<BaseFunction>;
471
+ type SimpleBaseNode = Partial<BaseNode>;
472
+ type SimpleBaseNodeWithoutComments = Partial<BaseNodeWithoutComments>;
473
+ type SimpleBasePattern = Partial<BasePattern>;
474
+ type SimpleBaseStatement = Partial<BaseStatement>;
475
+ type SimpleBigIntLiteral = Partial<BigIntLiteral>;
476
+ type SimpleBinaryExpression = Partial<BinaryExpression>;
477
+ type SimpleBlockStatement = Partial<BlockStatement>;
478
+ type SimpleBreakStatement = Partial<BreakStatement>;
479
+ type SimpleCatchClause = Partial<CatchClause>;
480
+ type SimpleChainExpression = Partial<ChainExpression>;
481
+ type SimpleComment = Partial<Comment>;
482
+ type SimpleConditionalExpression = Partial<ConditionalExpression>;
483
+ type SimpleContinueStatement = Partial<ContinueStatement>;
484
+ type SimpleDoWhileStatement = Partial<DoWhileStatement>;
485
+ type SimpleEmptyStatement = Partial<EmptyStatement>;
486
+ type SimpleExpressionStatement = Partial<ExpressionStatement>;
487
+ type SimpleForInStatement = Partial<ForInStatement>;
488
+ type SimpleForOfStatement = Partial<ForOfStatement>;
489
+ type SimpleForStatement = Partial<ForStatement>;
490
+ type SimpleFunctionDeclaration = Partial<FunctionDeclaration>;
491
+ type SimpleFunctionExpression = Partial<FunctionExpression>;
492
+ type SimpleIdentifier = Partial<Identifier>;
493
+ type SimpleIfStatement = Partial<IfStatement>;
494
+ type SimpleJsonExpression = Partial<JsonExpression>;
495
+ type SimpleLabeledStatement = Partial<LabeledStatement>;
496
+ type SimpleLogicalExpression = Partial<LogicalExpression>;
497
+ type SimpleMemberExpression = Partial<MemberExpression>;
498
+ type SimpleMethodDefinition = Partial<MethodDefinition>;
499
+ type SimpleNewExpression = Partial<NewExpression>;
500
+ type SimpleObjectExpression = Partial<ObjectExpression>;
501
+ type SimpleObjectPattern = Partial<ObjectPattern>;
502
+ type SimplePosition = Partial<Position>;
503
+ type SimpleProgram = Partial<Program>;
504
+ type SimpleProperty = Partial<Property>;
505
+ type SimplePropertyDefinition = Partial<PropertyDefinition>;
506
+ type SimpleRegExpLiteral = Partial<RegExpLiteral>;
507
+ type SimpleRestElement = Partial<RestElement>;
508
+ type SimpleReturnStatement = Partial<ReturnStatement>;
509
+ type SimpleSequenceExpression = Partial<SequenceExpression>;
510
+ type SimpleSimpleCallExpression = Partial<SimpleCallExpression>;
511
+ type SimpleSimpleLiteral = Partial<SimpleLiteral>;
512
+ type SimpleSourceLocation = Partial<SourceLocation>;
513
+ type SimpleSpreadElement = Partial<SpreadElement>;
514
+ type SimpleSwitchCase = Partial<SwitchCase>;
515
+ type SimpleSwitchStatement = Partial<SwitchStatement>;
516
+ type SimpleTemplateElement = Partial<TemplateElement>;
517
+ type SimpleTemplateLiteral = Partial<TemplateLiteral>;
518
+ type SimpleThisExpression = Partial<ThisExpression>;
519
+ type SimpleThrowStatement = Partial<ThrowStatement>;
520
+ type SimpleTryStatement = Partial<TryStatement>;
521
+ type SimpleUnaryExpression = Partial<UnaryExpression>;
522
+ type SimpleUpdateExpression = Partial<UpdateExpression>;
523
+ type SimpleVariableDeclaration = Partial<VariableDeclaration>;
524
+ type SimpleVariableDeclarator = Partial<VariableDeclarator>;
525
+ type SimpleWhileStatement = Partial<WhileStatement>;
526
+
527
+ type types_ArrayExpression = ArrayExpression;
528
+ type types_ArrayPattern = ArrayPattern;
529
+ type types_ArrowFunctionExpression = ArrowFunctionExpression;
530
+ type types_AssignmentExpression = AssignmentExpression;
531
+ type types_AssignmentOperator = AssignmentOperator;
532
+ type types_AssignmentPattern = AssignmentPattern;
533
+ type types_AssignmentProperty = AssignmentProperty;
534
+ type types_AwaitExpression = AwaitExpression;
535
+ type types_BaseCallExpression = BaseCallExpression;
536
+ type types_BaseDeclaration = BaseDeclaration;
537
+ type types_BaseExpression = BaseExpression;
538
+ type types_BaseForXStatement = BaseForXStatement;
539
+ type types_BaseFunction = BaseFunction;
540
+ type types_BaseModuleDeclaration = BaseModuleDeclaration;
541
+ type types_BaseModuleSpecifier = BaseModuleSpecifier;
542
+ type types_BaseNode = BaseNode;
543
+ type types_BaseNodeWithoutComments = BaseNodeWithoutComments;
544
+ type types_BasePattern = BasePattern;
545
+ type types_BaseStatement = BaseStatement;
546
+ type types_BigIntLiteral = BigIntLiteral;
547
+ type types_BinaryExpression = BinaryExpression;
548
+ type types_BinaryOperator = BinaryOperator;
549
+ type types_BlockStatement = BlockStatement;
550
+ type types_BreakStatement = BreakStatement;
551
+ type types_CallExpression = CallExpression;
552
+ type types_CatchClause = CatchClause;
553
+ type types_ChainElement = ChainElement;
554
+ type types_ChainExpression = ChainExpression;
555
+ type types_Comment = Comment;
556
+ type types_ConditionalExpression = ConditionalExpression;
557
+ type types_ContinueStatement = ContinueStatement;
558
+ type types_DebuggerStatement = DebuggerStatement;
559
+ type types_Declaration = Declaration;
560
+ type types_Directive = Directive;
561
+ type types_DoWhileStatement = DoWhileStatement;
562
+ type types_EmptyStatement = EmptyStatement;
563
+ type types_Expression = Expression;
564
+ type types_ExpressionStatement = ExpressionStatement;
565
+ type types_ForInStatement = ForInStatement;
566
+ type types_ForOfStatement = ForOfStatement;
567
+ type types_ForStatement = ForStatement;
568
+ type types_Function = Function;
569
+ type types_FunctionDeclaration = FunctionDeclaration;
570
+ type types_FunctionExpression = FunctionExpression;
571
+ type types_Identifier = Identifier;
572
+ type types_IfStatement = IfStatement;
573
+ type types_ImportDeclaration = ImportDeclaration;
574
+ type types_ImportDefaultSpecifier = ImportDefaultSpecifier;
575
+ type types_ImportExpression = ImportExpression;
576
+ type types_ImportNamespaceSpecifier = ImportNamespaceSpecifier;
577
+ type types_ImportSpecifier = ImportSpecifier;
578
+ type types_JsonExpression = JsonExpression;
579
+ type types_LabeledStatement = LabeledStatement;
580
+ type types_Literal = Literal;
581
+ type types_LogicalExpression = LogicalExpression;
582
+ type types_LogicalOperator = LogicalOperator;
583
+ type types_MaybeNamedFunctionDeclaration = MaybeNamedFunctionDeclaration;
584
+ type types_MemberExpression = MemberExpression;
585
+ type types_MetaProperty = MetaProperty;
586
+ type types_MethodDefinition = MethodDefinition;
587
+ type types_ModuleDeclaration = ModuleDeclaration;
588
+ type types_ModuleSpecifier = ModuleSpecifier;
589
+ type types_NewExpression = NewExpression;
590
+ type types_Node = Node;
591
+ type types_NodeMap = NodeMap;
592
+ type types_ObjectExpression = ObjectExpression;
593
+ type types_ObjectPattern = ObjectPattern;
594
+ type types_Pattern = Pattern;
595
+ type types_Position = Position;
596
+ type types_Program = Program;
597
+ type types_Property = Property;
598
+ type types_PropertyDefinition = PropertyDefinition;
599
+ type types_RegExpLiteral = RegExpLiteral;
600
+ type types_RestElement = RestElement;
601
+ type types_ReturnStatement = ReturnStatement;
602
+ type types_SequenceExpression = SequenceExpression;
603
+ type types_SimpleArrayExpression = SimpleArrayExpression;
604
+ type types_SimpleArrayPattern = SimpleArrayPattern;
605
+ type types_SimpleArrowFunctionExpression = SimpleArrowFunctionExpression;
606
+ type types_SimpleAssignmentExpression = SimpleAssignmentExpression;
607
+ type types_SimpleAssignmentPattern = SimpleAssignmentPattern;
608
+ type types_SimpleAssignmentProperty = SimpleAssignmentProperty;
609
+ type types_SimpleAwaitExpression = SimpleAwaitExpression;
610
+ type types_SimpleBaseCallExpression = SimpleBaseCallExpression;
611
+ type types_SimpleBaseDeclaration = SimpleBaseDeclaration;
612
+ type types_SimpleBaseExpression = SimpleBaseExpression;
613
+ type types_SimpleBaseForXStatement = SimpleBaseForXStatement;
614
+ type types_SimpleBaseFunction = SimpleBaseFunction;
615
+ type types_SimpleBaseNode = SimpleBaseNode;
616
+ type types_SimpleBaseNodeWithoutComments = SimpleBaseNodeWithoutComments;
617
+ type types_SimpleBasePattern = SimpleBasePattern;
618
+ type types_SimpleBaseStatement = SimpleBaseStatement;
619
+ type types_SimpleBigIntLiteral = SimpleBigIntLiteral;
620
+ type types_SimpleBinaryExpression = SimpleBinaryExpression;
621
+ type types_SimpleBlockStatement = SimpleBlockStatement;
622
+ type types_SimpleBreakStatement = SimpleBreakStatement;
623
+ type types_SimpleCallExpression = SimpleCallExpression;
624
+ type types_SimpleCatchClause = SimpleCatchClause;
625
+ type types_SimpleChainExpression = SimpleChainExpression;
626
+ type types_SimpleComment = SimpleComment;
627
+ type types_SimpleConditionalExpression = SimpleConditionalExpression;
628
+ type types_SimpleContinueStatement = SimpleContinueStatement;
629
+ type types_SimpleDoWhileStatement = SimpleDoWhileStatement;
630
+ type types_SimpleEmptyStatement = SimpleEmptyStatement;
631
+ type types_SimpleExpressionStatement = SimpleExpressionStatement;
632
+ type types_SimpleForInStatement = SimpleForInStatement;
633
+ type types_SimpleForOfStatement = SimpleForOfStatement;
634
+ type types_SimpleForStatement = SimpleForStatement;
635
+ type types_SimpleFunctionDeclaration = SimpleFunctionDeclaration;
636
+ type types_SimpleFunctionExpression = SimpleFunctionExpression;
637
+ type types_SimpleIdentifier = SimpleIdentifier;
638
+ type types_SimpleIfStatement = SimpleIfStatement;
639
+ type types_SimpleJsonExpression = SimpleJsonExpression;
640
+ type types_SimpleLabeledStatement = SimpleLabeledStatement;
641
+ type types_SimpleLiteral = SimpleLiteral;
642
+ type types_SimpleLogicalExpression = SimpleLogicalExpression;
643
+ type types_SimpleMemberExpression = SimpleMemberExpression;
644
+ type types_SimpleMethodDefinition = SimpleMethodDefinition;
645
+ type types_SimpleNewExpression = SimpleNewExpression;
646
+ type types_SimpleNode = SimpleNode;
647
+ type types_SimpleObjectExpression = SimpleObjectExpression;
648
+ type types_SimpleObjectPattern = SimpleObjectPattern;
649
+ type types_SimplePosition = SimplePosition;
650
+ type types_SimpleProgram = SimpleProgram;
651
+ type types_SimpleProperty = SimpleProperty;
652
+ type types_SimplePropertyDefinition = SimplePropertyDefinition;
653
+ type types_SimpleRegExpLiteral = SimpleRegExpLiteral;
654
+ type types_SimpleRestElement = SimpleRestElement;
655
+ type types_SimpleReturnStatement = SimpleReturnStatement;
656
+ type types_SimpleSequenceExpression = SimpleSequenceExpression;
657
+ type types_SimpleSimpleCallExpression = SimpleSimpleCallExpression;
658
+ type types_SimpleSimpleLiteral = SimpleSimpleLiteral;
659
+ type types_SimpleSourceLocation = SimpleSourceLocation;
660
+ type types_SimpleSpreadElement = SimpleSpreadElement;
661
+ type types_SimpleSwitchCase = SimpleSwitchCase;
662
+ type types_SimpleSwitchStatement = SimpleSwitchStatement;
663
+ type types_SimpleTemplateElement = SimpleTemplateElement;
664
+ type types_SimpleTemplateLiteral = SimpleTemplateLiteral;
665
+ type types_SimpleThisExpression = SimpleThisExpression;
666
+ type types_SimpleThrowStatement = SimpleThrowStatement;
667
+ type types_SimpleTryStatement = SimpleTryStatement;
668
+ type types_SimpleUnaryExpression = SimpleUnaryExpression;
669
+ type types_SimpleUpdateExpression = SimpleUpdateExpression;
670
+ type types_SimpleVariableDeclaration = SimpleVariableDeclaration;
671
+ type types_SimpleVariableDeclarator = SimpleVariableDeclarator;
672
+ type types_SimpleWhileStatement = SimpleWhileStatement;
673
+ type types_SourceLocation = SourceLocation;
674
+ type types_SpreadElement = SpreadElement;
675
+ type types_Statement = Statement;
676
+ type types_SwitchCase = SwitchCase;
677
+ type types_SwitchStatement = SwitchStatement;
678
+ type types_TSLite = TSLite;
679
+ type types_TSLiteMarker = TSLiteMarker;
680
+ type types_TaggedTemplateExpression = TaggedTemplateExpression;
681
+ type types_TemplateElement = TemplateElement;
682
+ type types_TemplateLiteral = TemplateLiteral;
683
+ type types_ThisExpression = ThisExpression;
684
+ type types_ThrowStatement = ThrowStatement;
685
+ type types_TryStatement = TryStatement;
686
+ type types_UnaryExpression = UnaryExpression;
687
+ type types_UnaryOperator = UnaryOperator;
688
+ type types_UpdateExpression = UpdateExpression;
689
+ type types_UpdateOperator = UpdateOperator;
690
+ type types_VariableDeclaration = VariableDeclaration;
691
+ type types_VariableDeclarator = VariableDeclarator;
692
+ type types_WhileStatement = WhileStatement;
693
+ declare namespace types {
694
+ export type { types_ArrayExpression as ArrayExpression, types_ArrayPattern as ArrayPattern, types_ArrowFunctionExpression as ArrowFunctionExpression, types_AssignmentExpression as AssignmentExpression, types_AssignmentOperator as AssignmentOperator, types_AssignmentPattern as AssignmentPattern, types_AssignmentProperty as AssignmentProperty, types_AwaitExpression as AwaitExpression, types_BaseCallExpression as BaseCallExpression, types_BaseDeclaration as BaseDeclaration, types_BaseExpression as BaseExpression, types_BaseForXStatement as BaseForXStatement, types_BaseFunction as BaseFunction, types_BaseModuleDeclaration as BaseModuleDeclaration, types_BaseModuleSpecifier as BaseModuleSpecifier, types_BaseNode as BaseNode, types_BaseNodeWithoutComments as BaseNodeWithoutComments, types_BasePattern as BasePattern, types_BaseStatement as BaseStatement, types_BigIntLiteral as BigIntLiteral, types_BinaryExpression as BinaryExpression, types_BinaryOperator as BinaryOperator, types_BlockStatement as BlockStatement, types_BreakStatement as BreakStatement, types_CallExpression as CallExpression, types_CatchClause as CatchClause, types_ChainElement as ChainElement, types_ChainExpression as ChainExpression, types_Comment as Comment, types_ConditionalExpression as ConditionalExpression, types_ContinueStatement as ContinueStatement, types_DebuggerStatement as DebuggerStatement, types_Declaration as Declaration, types_Directive as Directive, types_DoWhileStatement as DoWhileStatement, types_EmptyStatement as EmptyStatement, types_Expression as Expression, types_ExpressionStatement as ExpressionStatement, types_ForInStatement as ForInStatement, types_ForOfStatement as ForOfStatement, types_ForStatement as ForStatement, types_Function as Function, types_FunctionDeclaration as FunctionDeclaration, types_FunctionExpression as FunctionExpression, types_Identifier as Identifier, types_IfStatement as IfStatement, types_ImportDeclaration as ImportDeclaration, types_ImportDefaultSpecifier as ImportDefaultSpecifier, types_ImportExpression as ImportExpression, types_ImportNamespaceSpecifier as ImportNamespaceSpecifier, types_ImportSpecifier as ImportSpecifier, types_JsonExpression as JsonExpression, types_LabeledStatement as LabeledStatement, types_Literal as Literal, types_LogicalExpression as LogicalExpression, types_LogicalOperator as LogicalOperator, types_MaybeNamedFunctionDeclaration as MaybeNamedFunctionDeclaration, types_MemberExpression as MemberExpression, types_MetaProperty as MetaProperty, types_MethodDefinition as MethodDefinition, types_ModuleDeclaration as ModuleDeclaration, types_ModuleSpecifier as ModuleSpecifier, types_NewExpression as NewExpression, types_Node as Node, types_NodeMap as NodeMap, types_ObjectExpression as ObjectExpression, types_ObjectPattern as ObjectPattern, types_Pattern as Pattern, types_Position as Position, types_Program as Program, types_Property as Property, types_PropertyDefinition as PropertyDefinition, types_RegExpLiteral as RegExpLiteral, types_RestElement as RestElement, types_ReturnStatement as ReturnStatement, types_SequenceExpression as SequenceExpression, types_SimpleArrayExpression as SimpleArrayExpression, types_SimpleArrayPattern as SimpleArrayPattern, types_SimpleArrowFunctionExpression as SimpleArrowFunctionExpression, types_SimpleAssignmentExpression as SimpleAssignmentExpression, types_SimpleAssignmentPattern as SimpleAssignmentPattern, types_SimpleAssignmentProperty as SimpleAssignmentProperty, types_SimpleAwaitExpression as SimpleAwaitExpression, types_SimpleBaseCallExpression as SimpleBaseCallExpression, types_SimpleBaseDeclaration as SimpleBaseDeclaration, types_SimpleBaseExpression as SimpleBaseExpression, types_SimpleBaseForXStatement as SimpleBaseForXStatement, types_SimpleBaseFunction as SimpleBaseFunction, types_SimpleBaseNode as SimpleBaseNode, types_SimpleBaseNodeWithoutComments as SimpleBaseNodeWithoutComments, types_SimpleBasePattern as SimpleBasePattern, types_SimpleBaseStatement as SimpleBaseStatement, types_SimpleBigIntLiteral as SimpleBigIntLiteral, types_SimpleBinaryExpression as SimpleBinaryExpression, types_SimpleBlockStatement as SimpleBlockStatement, types_SimpleBreakStatement as SimpleBreakStatement, types_SimpleCallExpression as SimpleCallExpression, types_SimpleCatchClause as SimpleCatchClause, types_SimpleChainExpression as SimpleChainExpression, types_SimpleComment as SimpleComment, types_SimpleConditionalExpression as SimpleConditionalExpression, types_SimpleContinueStatement as SimpleContinueStatement, types_SimpleDoWhileStatement as SimpleDoWhileStatement, types_SimpleEmptyStatement as SimpleEmptyStatement, types_SimpleExpressionStatement as SimpleExpressionStatement, types_SimpleForInStatement as SimpleForInStatement, types_SimpleForOfStatement as SimpleForOfStatement, types_SimpleForStatement as SimpleForStatement, types_SimpleFunctionDeclaration as SimpleFunctionDeclaration, types_SimpleFunctionExpression as SimpleFunctionExpression, types_SimpleIdentifier as SimpleIdentifier, types_SimpleIfStatement as SimpleIfStatement, types_SimpleJsonExpression as SimpleJsonExpression, types_SimpleLabeledStatement as SimpleLabeledStatement, types_SimpleLiteral as SimpleLiteral, types_SimpleLogicalExpression as SimpleLogicalExpression, types_SimpleMemberExpression as SimpleMemberExpression, types_SimpleMethodDefinition as SimpleMethodDefinition, types_SimpleNewExpression as SimpleNewExpression, types_SimpleNode as SimpleNode, types_SimpleObjectExpression as SimpleObjectExpression, types_SimpleObjectPattern as SimpleObjectPattern, types_SimplePosition as SimplePosition, types_SimpleProgram as SimpleProgram, types_SimpleProperty as SimpleProperty, types_SimplePropertyDefinition as SimplePropertyDefinition, types_SimpleRegExpLiteral as SimpleRegExpLiteral, types_SimpleRestElement as SimpleRestElement, types_SimpleReturnStatement as SimpleReturnStatement, types_SimpleSequenceExpression as SimpleSequenceExpression, types_SimpleSimpleCallExpression as SimpleSimpleCallExpression, types_SimpleSimpleLiteral as SimpleSimpleLiteral, types_SimpleSourceLocation as SimpleSourceLocation, types_SimpleSpreadElement as SimpleSpreadElement, types_SimpleSwitchCase as SimpleSwitchCase, types_SimpleSwitchStatement as SimpleSwitchStatement, types_SimpleTemplateElement as SimpleTemplateElement, types_SimpleTemplateLiteral as SimpleTemplateLiteral, types_SimpleThisExpression as SimpleThisExpression, types_SimpleThrowStatement as SimpleThrowStatement, types_SimpleTryStatement as SimpleTryStatement, types_SimpleUnaryExpression as SimpleUnaryExpression, types_SimpleUpdateExpression as SimpleUpdateExpression, types_SimpleVariableDeclaration as SimpleVariableDeclaration, types_SimpleVariableDeclarator as SimpleVariableDeclarator, types_SimpleWhileStatement as SimpleWhileStatement, types_SourceLocation as SourceLocation, types_SpreadElement as SpreadElement, types_Statement as Statement, types_SwitchCase as SwitchCase, types_SwitchStatement as SwitchStatement, types_TSLite as TSLite, types_TSLiteMarker as TSLiteMarker, types_TaggedTemplateExpression as TaggedTemplateExpression, types_TemplateElement as TemplateElement, types_TemplateLiteral as TemplateLiteral, types_ThisExpression as ThisExpression, types_ThrowStatement as ThrowStatement, types_TryStatement as TryStatement, types_UnaryExpression as UnaryExpression, types_UnaryOperator as UnaryOperator, types_UpdateExpression as UpdateExpression, types_UpdateOperator as UpdateOperator, types_VariableDeclaration as VariableDeclaration, types_VariableDeclarator as VariableDeclarator, types_WhileStatement as WhileStatement };
695
+ }
696
+
697
+ /** Erro lançado pelo `@tslite/core`. */
698
+ type CoreErrorCode = "invalid-ast-entry" | "missing-node-type" | "unknown-node-type";
699
+ /**
700
+ * Erro base da plataforma TSLite. Carrega um `code` legível por máquina e um
701
+ * `details` opcional com o contexto estruturado (ex.: o `type` ofensor).
702
+ *
703
+ * @typeParam C - união de codes do package que lança; default `string`.
704
+ */
705
+ declare class TSLiteError<C extends string = string> extends Error {
706
+ readonly code: C;
707
+ readonly details?: Record<string, unknown>;
708
+ constructor(code: C, message: string, details?: Record<string, unknown>);
709
+ }
710
+
711
+ /** Marker para lógica executável em JSON híbrido */
712
+ declare const AST_MARKER = "#ast";
713
+ /** Pattern para keys de objeto válidas sem aspas */
714
+ declare const VALID_OBJECT_KEY: RegExp;
715
+ /**
716
+ * Tipos válidos como ponto de entrada #ast.
717
+ *
718
+ * São tipos que podem aparecer como VALOR em JSON - tudo que pode estar
719
+ * do lado direito de uma atribuição ou como valor de propriedade.
720
+ *
721
+ * Basicamente: Expressions + Program (para AST completo)
722
+ */
723
+ declare const VALID_AST_ENTRY_TYPES: readonly ["Identifier", "MemberExpression", "CallExpression", "ArrowFunctionExpression", "FunctionExpression", "BinaryExpression", "LogicalExpression", "UnaryExpression", "UpdateExpression", "ConditionalExpression", "AssignmentExpression", "NewExpression", "ArrayExpression", "ObjectExpression", "AwaitExpression", "TemplateLiteral", "TaggedTemplateExpression", "SequenceExpression", "ChainExpression", "Program"];
724
+ type ValidAstEntryType = (typeof VALID_AST_ENTRY_TYPES)[number];
725
+ /**
726
+ * Verifica se um tipo é válido como ponto de entrada #ast
727
+ */
728
+ declare function isValidAstEntryType(type: string): type is ValidAstEntryType;
729
+ /**
730
+ * Erro para tipo inválido como entrada #ast.
731
+ *
732
+ * `code: "invalid-ast-entry"`; `details` carrega o `type` ofensor e a lista de
733
+ * tipos válidos, para o consumidor reagir sem fazer parse da mensagem.
734
+ */
735
+ declare function invalidAstEntryError(type: string): TSLiteError<"invalid-ast-entry">;
736
+ declare const VisitorKeys: {
737
+ AssignmentExpression: string[];
738
+ AssignmentPattern: string[];
739
+ ArrayExpression: string[];
740
+ ArrayPattern: string[];
741
+ ArrowFunctionExpression: string[];
742
+ AwaitExpression: string[];
743
+ BlockStatement: string[];
744
+ BinaryExpression: string[];
745
+ BreakStatement: string[];
746
+ CallExpression: string[];
747
+ CatchClause: string[];
748
+ ChainExpression: string[];
749
+ ClassBody: string[];
750
+ ClassDeclaration: string[];
751
+ ClassExpression: string[];
752
+ ConditionalExpression: string[];
753
+ ContinueStatement: string[];
754
+ DebuggerStatement: never[];
755
+ DirectiveStatement: never[];
756
+ DoWhileStatement: string[];
757
+ EmptyStatement: never[];
758
+ ExpressionStatement: string[];
759
+ ForStatement: string[];
760
+ ForInStatement: string[];
761
+ ForOfStatement: string[];
762
+ FunctionDeclaration: string[];
763
+ FunctionExpression: string[];
764
+ Identifier: never[];
765
+ IfStatement: string[];
766
+ ImportDeclaration: string[];
767
+ ImportDefaultSpecifier: string[];
768
+ ImportExpression: string[];
769
+ ImportNamespaceSpecifier: string[];
770
+ ImportSpecifier: string[];
771
+ JsonExpression: never[];
772
+ Literal: never[];
773
+ LabeledStatement: string[];
774
+ LogicalExpression: string[];
775
+ MemberExpression: string[];
776
+ MetaProperty: string[];
777
+ MethodDefinition: string[];
778
+ ModuleSpecifier: never[];
779
+ NewExpression: string[];
780
+ ObjectExpression: string[];
781
+ ObjectPattern: string[];
782
+ PrivateIdentifier: never[];
783
+ Program: string[];
784
+ Property: string[];
785
+ PropertyDefinition: string[];
786
+ RestElement: string[];
787
+ ReturnStatement: string[];
788
+ SequenceExpression: string[];
789
+ SpreadElement: string[];
790
+ SwitchStatement: string[];
791
+ SwitchCase: string[];
792
+ TaggedTemplateExpression: string[];
793
+ TemplateElement: never[];
794
+ TemplateLiteral: string[];
795
+ ThisExpression: never[];
796
+ ThrowStatement: string[];
797
+ TryStatement: string[];
798
+ UnaryExpression: string[];
799
+ UpdateExpression: string[];
800
+ VariableDeclaration: string[];
801
+ VariableDeclarator: string[];
802
+ WhileStatement: string[];
803
+ WithStatement: string[];
804
+ };
805
+ declare const Precedence: {
806
+ Sequence: number;
807
+ Yield: number;
808
+ Assignment: number;
809
+ Conditional: number;
810
+ ArrowFunction: number;
811
+ Coalesce: number;
812
+ LogicalOR: number;
813
+ LogicalAND: number;
814
+ BitwiseOR: number;
815
+ BitwiseXOR: number;
816
+ BitwiseAND: number;
817
+ Equality: number;
818
+ Relational: number;
819
+ BitwiseSHIFT: number;
820
+ Additive: number;
821
+ Multiplicative: number;
822
+ Exponentiation: number;
823
+ Await: number;
824
+ Unary: number;
825
+ Postfix: number;
826
+ OptionalChaining: number;
827
+ Call: number;
828
+ New: number;
829
+ TaggedTemplate: number;
830
+ Member: number;
831
+ Primary: number;
832
+ };
833
+ declare const BinaryPrecedence: {
834
+ "??": number;
835
+ "||": number;
836
+ "&&": number;
837
+ "|": number;
838
+ "^": number;
839
+ "&": number;
840
+ "==": number;
841
+ "!=": number;
842
+ "===": number;
843
+ "!==": number;
844
+ is: number;
845
+ isnt: number;
846
+ "<": number;
847
+ ">": number;
848
+ "<=": number;
849
+ ">=": number;
850
+ in: number;
851
+ instanceof: number;
852
+ "<<": number;
853
+ ">>": number;
854
+ ">>>": number;
855
+ "+": number;
856
+ "-": number;
857
+ "*": number;
858
+ "%": number;
859
+ "/": number;
860
+ "**": number;
861
+ };
862
+
863
+ /**
864
+ * Cria um marcador #ast para embedar AST em JSON.
865
+ *
866
+ * O formato usa #ast como o tipo do nó, sem wrapper body:
867
+ * ```
868
+ * { "#ast": "CallExpression", "callee": {...}, "arguments": [] }
869
+ * ```
870
+ *
871
+ * @param node - Nó AST (deve ter propriedade `type`)
872
+ * @returns Objeto com #ast marker pronto para JSON
873
+ * @throws Se o tipo não for válido como entry point
874
+ */
875
+ declare const ast: (node: Node) => TSLiteMarker;
876
+ /**
877
+ * Converte um objeto com #ast marker de volta para nó AST com type.
878
+ *
879
+ * Útil quando você tem um objeto no formato TSLite e precisa usar como nó AST
880
+ * normal (ex: passar como argumento).
881
+ *
882
+ * @param obj - Objeto com #ast marker
883
+ * @returns Nó AST com type (ou o objeto original se não tiver #ast)
884
+ *
885
+ * @example
886
+ * ```ts
887
+ * const astMarked = { "#ast": "Identifier", name: "foo" };
888
+ * const node = fromAstMarker(astMarked);
889
+ * // { type: "Identifier", name: "foo" }
890
+ * ```
891
+ */
892
+ declare const fromAstMarker: (obj: unknown) => unknown;
893
+ declare const identifier: (name: string) => Identifier;
894
+ declare const literal: (value: string | boolean | number | null | RegExp | bigint | undefined) => Literal;
895
+ declare const arrayExpression: (elements: Array<Expression | SpreadElement | null>) => ArrayExpression;
896
+ declare const objectExpression: (properties: Array<Property | SpreadElement>) => ObjectExpression;
897
+ declare const property: (key: Expression, value: Expression | Pattern | AssignmentProperty, shorthand?: boolean, computed?: boolean) => Property;
898
+ declare const spreadElement: (argument: Expression) => SpreadElement;
899
+ declare const callExpression: (callee: Expression, args: Array<Expression | SpreadElement>, optional?: boolean) => SimpleCallExpression;
900
+ declare const newExpression: (callee: Expression, args: Array<Expression | SpreadElement>) => NewExpression;
901
+ declare const memberExpression: (object: Expression, property: Expression, computed?: boolean, optional?: boolean) => MemberExpression;
902
+ declare const chainExpression: (expression: ChainElement) => ChainExpression;
903
+ declare const binaryExpression: (operator: BinaryOperator, left: Expression, right: Expression) => BinaryExpression;
904
+ declare const logicalExpression: (operator: LogicalOperator, left: Expression, right: Expression) => LogicalExpression;
905
+ declare const unaryExpression: (operator: UnaryOperator, argument: Expression) => UnaryExpression;
906
+ declare const updateExpression: (operator: UpdateOperator, argument: Expression, prefix?: boolean) => UpdateExpression;
907
+ declare const assignmentExpression: (operator: AssignmentOperator, left: Pattern, right: Expression) => AssignmentExpression;
908
+ declare const conditionalExpression: (test: Expression, consequent: Expression, alternate: Expression) => ConditionalExpression;
909
+ declare const awaitExpression: (argument: Expression | null) => AwaitExpression;
910
+ declare const templateElement: (value: {
911
+ cooked?: string | null | undefined;
912
+ raw: string;
913
+ }, tail?: boolean) => TemplateElement;
914
+ declare const templateLiteral: (quasis: TemplateElement[], expressions: Expression[]) => TemplateLiteral;
915
+ declare const arrowFunctionExpression: (params: Pattern[], body: Expression | BlockStatement, async?: boolean, generator?: boolean) => ArrowFunctionExpression;
916
+ declare const functionExpression: (id: Identifier | null | undefined, params: Pattern[], body: BlockStatement, async?: boolean, generator?: boolean) => FunctionExpression;
917
+ declare const functionDeclaration: (id: Identifier, params: Pattern[], body: BlockStatement, generator?: boolean, async?: boolean) => FunctionDeclaration;
918
+ declare const blockStatement: (body: Statement[]) => BlockStatement;
919
+ declare const expressionStatement: (expression: Expression) => ExpressionStatement;
920
+ declare const returnStatement: (argument: Expression | null | undefined) => ReturnStatement;
921
+ declare const ifStatement: (test: Expression, consequent: Statement, alternate?: Statement | null | undefined) => IfStatement;
922
+ declare const switchStatement: (discriminant: Expression, cases: SwitchCase[]) => SwitchStatement;
923
+ declare const switchCase: (test: Expression | null | undefined, consequent: Statement[]) => SwitchCase;
924
+ declare const throwStatement: (argument: Expression) => ThrowStatement;
925
+ declare const tryStatement: (block: BlockStatement, handler: CatchClause | null | undefined, finalizer?: BlockStatement | null | undefined) => TryStatement;
926
+ declare const catchClause: (param: Pattern | null, body: BlockStatement) => CatchClause;
927
+ declare const breakStatement: (label?: Identifier | null) => BreakStatement;
928
+ declare const continueStatement: (label?: Identifier | null) => ContinueStatement;
929
+ declare const emptyStatement: () => EmptyStatement;
930
+ declare const forStatement: (init: VariableDeclaration | Expression | null | undefined, test: Expression | null | undefined, update: Expression | null | undefined, body: Statement) => ForStatement;
931
+ declare const forInStatement: (left: Pattern | VariableDeclaration, right: Expression, body: Statement) => ForInStatement;
932
+ declare const forOfStatement: (left: Pattern | VariableDeclaration, right: Expression, body: Statement, _await?: boolean) => ForOfStatement;
933
+ declare const whileStatement: (test: Expression, body: Statement) => WhileStatement;
934
+ declare const doWhileStatement: (body: Statement, test: Expression) => DoWhileStatement;
935
+ declare const variableDeclaration: (kind: "var" | "let" | "const", declarations: VariableDeclarator[]) => VariableDeclaration;
936
+ declare const variableDeclarator: (id: Pattern, init?: Expression | null) => VariableDeclarator;
937
+ declare const objectPattern: (properties: Array<AssignmentProperty | RestElement>) => ObjectPattern;
938
+ declare const arrayPattern: (elements: Array<Pattern | null>) => ArrayPattern;
939
+ declare const assignmentProperty: (key: Expression, value?: Pattern, shorthand?: boolean, computed?: boolean) => AssignmentProperty;
940
+ declare const restElement: (argument: Pattern) => RestElement;
941
+ declare const program: (body: Array<Directive | Statement | ModuleDeclaration>, sourceType?: "script" | "module") => Program;
942
+ declare const jsonExpression: (body: TSLite) => JsonExpression;
943
+ declare const importDeclaration: (specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>, source: Literal) => ImportDeclaration;
944
+ declare const importSpecifier: (imported: Identifier, local: Identifier) => ImportSpecifier;
945
+ declare const importDefaultSpecifier: (local: Identifier) => ImportDefaultSpecifier;
946
+ declare const importNamespaceSpecifier: (local: Identifier) => ImportNamespaceSpecifier;
947
+ declare const json: (body: TSLite) => JsonExpression;
948
+
949
+ declare const index$1_arrayExpression: typeof arrayExpression;
950
+ declare const index$1_arrayPattern: typeof arrayPattern;
951
+ declare const index$1_arrowFunctionExpression: typeof arrowFunctionExpression;
952
+ declare const index$1_assignmentExpression: typeof assignmentExpression;
953
+ declare const index$1_assignmentProperty: typeof assignmentProperty;
954
+ declare const index$1_ast: typeof ast;
955
+ declare const index$1_awaitExpression: typeof awaitExpression;
956
+ declare const index$1_binaryExpression: typeof binaryExpression;
957
+ declare const index$1_blockStatement: typeof blockStatement;
958
+ declare const index$1_breakStatement: typeof breakStatement;
959
+ declare const index$1_callExpression: typeof callExpression;
960
+ declare const index$1_catchClause: typeof catchClause;
961
+ declare const index$1_chainExpression: typeof chainExpression;
962
+ declare const index$1_conditionalExpression: typeof conditionalExpression;
963
+ declare const index$1_continueStatement: typeof continueStatement;
964
+ declare const index$1_doWhileStatement: typeof doWhileStatement;
965
+ declare const index$1_emptyStatement: typeof emptyStatement;
966
+ declare const index$1_expressionStatement: typeof expressionStatement;
967
+ declare const index$1_forInStatement: typeof forInStatement;
968
+ declare const index$1_forOfStatement: typeof forOfStatement;
969
+ declare const index$1_forStatement: typeof forStatement;
970
+ declare const index$1_fromAstMarker: typeof fromAstMarker;
971
+ declare const index$1_functionDeclaration: typeof functionDeclaration;
972
+ declare const index$1_functionExpression: typeof functionExpression;
973
+ declare const index$1_identifier: typeof identifier;
974
+ declare const index$1_ifStatement: typeof ifStatement;
975
+ declare const index$1_importDeclaration: typeof importDeclaration;
976
+ declare const index$1_importDefaultSpecifier: typeof importDefaultSpecifier;
977
+ declare const index$1_importNamespaceSpecifier: typeof importNamespaceSpecifier;
978
+ declare const index$1_importSpecifier: typeof importSpecifier;
979
+ declare const index$1_json: typeof json;
980
+ declare const index$1_jsonExpression: typeof jsonExpression;
981
+ declare const index$1_literal: typeof literal;
982
+ declare const index$1_logicalExpression: typeof logicalExpression;
983
+ declare const index$1_memberExpression: typeof memberExpression;
984
+ declare const index$1_newExpression: typeof newExpression;
985
+ declare const index$1_objectExpression: typeof objectExpression;
986
+ declare const index$1_objectPattern: typeof objectPattern;
987
+ declare const index$1_program: typeof program;
988
+ declare const index$1_property: typeof property;
989
+ declare const index$1_restElement: typeof restElement;
990
+ declare const index$1_returnStatement: typeof returnStatement;
991
+ declare const index$1_spreadElement: typeof spreadElement;
992
+ declare const index$1_switchCase: typeof switchCase;
993
+ declare const index$1_switchStatement: typeof switchStatement;
994
+ declare const index$1_templateElement: typeof templateElement;
995
+ declare const index$1_templateLiteral: typeof templateLiteral;
996
+ declare const index$1_throwStatement: typeof throwStatement;
997
+ declare const index$1_tryStatement: typeof tryStatement;
998
+ declare const index$1_unaryExpression: typeof unaryExpression;
999
+ declare const index$1_updateExpression: typeof updateExpression;
1000
+ declare const index$1_variableDeclaration: typeof variableDeclaration;
1001
+ declare const index$1_variableDeclarator: typeof variableDeclarator;
1002
+ declare const index$1_whileStatement: typeof whileStatement;
1003
+ declare namespace index$1 {
1004
+ export { index$1_arrayExpression as arrayExpression, index$1_arrayPattern as arrayPattern, index$1_arrowFunctionExpression as arrowFunctionExpression, index$1_assignmentExpression as assignmentExpression, index$1_assignmentProperty as assignmentProperty, index$1_ast as ast, index$1_awaitExpression as awaitExpression, index$1_binaryExpression as binaryExpression, index$1_blockStatement as blockStatement, index$1_breakStatement as breakStatement, index$1_callExpression as callExpression, index$1_catchClause as catchClause, index$1_chainExpression as chainExpression, index$1_conditionalExpression as conditionalExpression, index$1_continueStatement as continueStatement, index$1_doWhileStatement as doWhileStatement, index$1_emptyStatement as emptyStatement, index$1_expressionStatement as expressionStatement, index$1_forInStatement as forInStatement, index$1_forOfStatement as forOfStatement, index$1_forStatement as forStatement, index$1_fromAstMarker as fromAstMarker, index$1_functionDeclaration as functionDeclaration, index$1_functionExpression as functionExpression, index$1_identifier as identifier, index$1_ifStatement as ifStatement, index$1_importDeclaration as importDeclaration, index$1_importDefaultSpecifier as importDefaultSpecifier, index$1_importNamespaceSpecifier as importNamespaceSpecifier, index$1_importSpecifier as importSpecifier, index$1_json as json, index$1_jsonExpression as jsonExpression, index$1_literal as literal, index$1_logicalExpression as logicalExpression, index$1_memberExpression as memberExpression, index$1_newExpression as newExpression, index$1_objectExpression as objectExpression, index$1_objectPattern as objectPattern, index$1_program as program, index$1_property as property, index$1_restElement as restElement, index$1_returnStatement as returnStatement, index$1_spreadElement as spreadElement, index$1_switchCase as switchCase, index$1_switchStatement as switchStatement, index$1_templateElement as templateElement, index$1_templateLiteral as templateLiteral, index$1_throwStatement as throwStatement, index$1_tryStatement as tryStatement, index$1_unaryExpression as unaryExpression, index$1_updateExpression as updateExpression, index$1_variableDeclaration as variableDeclaration, index$1_variableDeclarator as variableDeclarator, index$1_whileStatement as whileStatement };
1005
+ }
1006
+
1007
+ declare const generateBuilders: (prefix?: string) => {
1008
+ build: (node: BaseNode, parent?: BaseNode) => any;
1009
+ buildFunction: (node: BaseNode) => string;
1010
+ safeEval: (codeJs: string) => any;
1011
+ builders: {
1012
+ ArrayExpression: (n: ArrayExpression, _parent: Node) => string;
1013
+ ArrayPattern: (n: ArrayPattern, _parent: Node) => string;
1014
+ ArrowFunctionExpression: (n: ArrowFunctionExpression, _parent: Node) => string;
1015
+ AssignmentExpression: (n: AssignmentExpression, _parent: Node) => string;
1016
+ AssignmentProperty: (n: AssignmentProperty, _parent: Node) => string;
1017
+ AwaitExpression: (n: AwaitExpression, _parent: Node) => string;
1018
+ BinaryExpression: (n: BinaryExpression, _parent: Node) => string;
1019
+ BlockStatement: (n: BlockStatement, _parent: Node) => string;
1020
+ BreakStatement: (n: BreakStatement, _parent: Node) => string;
1021
+ CallExpression: (n: SimpleCallExpression, _parent: Node) => string;
1022
+ CatchClause: (n: CatchClause, _parent: Node) => string;
1023
+ ChainExpression: (n: ChainExpression, _parent: Node) => string;
1024
+ ConditionalExpression: (n: ConditionalExpression, _parent: Node) => string;
1025
+ ContinueStatement: (n: ContinueStatement, _parent: Node) => string;
1026
+ DoWhileStatement: (n: DoWhileStatement, _parent: Node) => string;
1027
+ EmptyStatement: (n: EmptyStatement, _parent: Node) => string;
1028
+ ExpressionStatement: (n: ExpressionStatement, _parent: Node) => string;
1029
+ ForInStatement: (n: ForInStatement, _parent: Node) => string;
1030
+ ForOfStatement: (n: ForOfStatement, _parent: Node) => string;
1031
+ ForStatement: (n: ForStatement, _parent: Node) => string;
1032
+ FunctionDeclaration: (n: FunctionDeclaration, _parent: Node) => string;
1033
+ FunctionExpression: (n: FunctionExpression, _parent: Node) => string;
1034
+ Identifier: (n: Identifier, _parent: Node) => string;
1035
+ IfStatement: (n: IfStatement, _parent: Node) => string;
1036
+ ImportDeclaration: (n: ImportDeclaration, _parent: Node) => string;
1037
+ ImportDefaultSpecifier: (n: ImportDefaultSpecifier, _parent: Node) => string;
1038
+ ImportNamespaceSpecifier: (n: ImportNamespaceSpecifier, _parent: Node) => string;
1039
+ ImportSpecifier: (n: ImportSpecifier, _parent: Node) => string;
1040
+ JsonExpression: (n: JsonExpression, _parent: Node) => string;
1041
+ Literal: (n: Literal, _parent: Node) => string;
1042
+ LogicalExpression: (n: LogicalExpression, _parent: Node) => string;
1043
+ MemberExpression: (n: MemberExpression, _parent: Node) => string;
1044
+ NewExpression: (n: NewExpression, _parent: Node) => string;
1045
+ ObjectExpression: (n: ObjectExpression, _parent: Node) => string;
1046
+ ObjectPattern: (n: ObjectPattern, _parent: Node) => string;
1047
+ Program: (n: Program, _parent: Node) => string;
1048
+ Property: (n: Property, parent: ObjectExpression | ObjectPattern) => string | undefined;
1049
+ ReturnStatement: (n: ReturnStatement, _parent: Node) => string;
1050
+ SwitchCase: (n: SwitchCase, _parent: Node) => string;
1051
+ SwitchStatement: (n: SwitchStatement, _parent: Node) => string;
1052
+ TemplateElement: (n: TemplateElement, _parent: Node) => string;
1053
+ TemplateLiteral: (n: TemplateLiteral, _parent: Node) => string;
1054
+ ThrowStatement: (n: ThrowStatement, _parent: Node) => string;
1055
+ TryStatement: (n: TryStatement, _parent: Node) => string;
1056
+ UnaryExpression: (n: UnaryExpression, _parent: Node) => string;
1057
+ UpdateExpression: (n: UpdateExpression, _parent: Node) => string;
1058
+ VariableDeclaration: (n: VariableDeclaration, _parent: Node) => string;
1059
+ VariableDeclarator: (n: VariableDeclarator, _parent: Node) => string;
1060
+ WhileStatement: (n: WhileStatement, _parent: Node) => string;
1061
+ SpreadElement: (n: SpreadElement, _parent: Node) => string;
1062
+ RestElement: (n: RestElement, _parent: Node) => string;
1063
+ };
1064
+ };
1065
+
1066
+ declare const isLiteral: (n: any) => n is Literal;
1067
+ declare const isIdentifier: (n: any) => n is Identifier;
1068
+ declare const isBinaryExpression: (n: any) => n is BinaryExpression;
1069
+ declare const isArrowFunctionExpression: (n: any) => n is ArrowFunctionExpression;
1070
+ declare const isFunctionExpression: (n: any) => n is FunctionExpression;
1071
+ declare const isCallExpression: (n: any) => n is SimpleCallExpression;
1072
+ declare const isObjectExpression: (n: any) => n is ObjectExpression;
1073
+ declare const isArrayExpression: (n: any) => n is ArrayExpression;
1074
+ declare const isConditionalExpression: (n: any) => n is ConditionalExpression;
1075
+ declare const isLogicalExpression: (n: any) => n is LogicalExpression;
1076
+ declare const isUnaryExpression: (n: any) => n is UnaryExpression;
1077
+ declare const isUpdateExpression: (n: any) => n is UpdateExpression;
1078
+ declare const isMemberExpression: (n: any) => n is MemberExpression;
1079
+ declare const isAssignmentExpression: (n: any) => n is AssignmentExpression;
1080
+ declare const isAwaitExpression: (n: any) => n is AwaitExpression;
1081
+ declare const isNewExpression: (n: any) => n is NewExpression;
1082
+ declare const isJsonExpression: (n: any) => n is JsonExpression;
1083
+ declare const isExpressionStatement: (n: any) => n is ExpressionStatement;
1084
+ declare const isBlockStatement: (n: any) => n is BlockStatement;
1085
+ declare const isReturnStatement: (n: any) => n is ReturnStatement;
1086
+ declare const isIfStatement: (n: any) => n is IfStatement;
1087
+ declare const isBreakStatement: (n: any) => n is BreakStatement;
1088
+ declare const isContinueStatement: (n: any) => n is ContinueStatement;
1089
+ declare const isEmptyStatement: (n: any) => n is EmptyStatement;
1090
+ declare const isVariableDeclarator: (n: any) => n is VariableDeclarator;
1091
+ declare const isVariableDeclaration: (n: any) => n is VariableDeclaration;
1092
+ declare const isObjectPattern: (n: any) => n is ObjectPattern;
1093
+ declare const isArrayPattern: (n: any) => n is ArrayPattern;
1094
+ declare const isFunctionDeclaration: (n: any) => n is FunctionDeclaration;
1095
+ declare const isProgram: (n: any) => n is Program;
1096
+ declare const isSwitchStatement: (n: any) => n is SwitchStatement;
1097
+ declare const isSwitchCase: (n: any) => n is SwitchCase;
1098
+ declare const isWhileStatement: (n: any) => n is WhileStatement;
1099
+ declare const isForStatement: (n: any) => n is ForStatement;
1100
+ declare const isForInStatement: (n: any) => n is ForInStatement;
1101
+ declare const isForOfStatement: (n: any) => n is ForOfStatement;
1102
+ declare const isDoWhileStatement: (n: any) => n is DoWhileStatement;
1103
+ declare const isTryStatement: (n: any) => n is TryStatement;
1104
+ declare const isCatchClause: (n: any) => n is CatchClause;
1105
+ declare const isThrowStatement: (n: any) => n is ThrowStatement;
1106
+ declare const isTemplateElement: (n: any) => n is TemplateElement;
1107
+ declare const isTemplateLiteral: (n: any) => n is TemplateLiteral;
1108
+ declare const isImportDeclaration: (n: any) => n is ImportDeclaration;
1109
+ declare const isImportSpecifier: (n: any) => n is ImportSpecifier;
1110
+ declare const isImportDefaultSpecifier: (n: any) => n is ImportDefaultSpecifier;
1111
+ declare const isImportNamespaceSpecifier: (n: any) => n is ImportNamespaceSpecifier;
1112
+ declare const isModuleDeclaration: (n: any) => n is ModuleDeclaration;
1113
+ declare const isDirective: (n: any) => n is Directive;
1114
+ declare const isProperty: (n: any) => n is Property;
1115
+ declare const isAssignmentProperty: (n: any) => n is AssignmentProperty;
1116
+ declare const isNode: (n: any) => n is Node;
1117
+
1118
+ declare const index_isArrayExpression: typeof isArrayExpression;
1119
+ declare const index_isArrayPattern: typeof isArrayPattern;
1120
+ declare const index_isArrowFunctionExpression: typeof isArrowFunctionExpression;
1121
+ declare const index_isAssignmentExpression: typeof isAssignmentExpression;
1122
+ declare const index_isAssignmentProperty: typeof isAssignmentProperty;
1123
+ declare const index_isAwaitExpression: typeof isAwaitExpression;
1124
+ declare const index_isBinaryExpression: typeof isBinaryExpression;
1125
+ declare const index_isBlockStatement: typeof isBlockStatement;
1126
+ declare const index_isBreakStatement: typeof isBreakStatement;
1127
+ declare const index_isCallExpression: typeof isCallExpression;
1128
+ declare const index_isCatchClause: typeof isCatchClause;
1129
+ declare const index_isConditionalExpression: typeof isConditionalExpression;
1130
+ declare const index_isContinueStatement: typeof isContinueStatement;
1131
+ declare const index_isDirective: typeof isDirective;
1132
+ declare const index_isDoWhileStatement: typeof isDoWhileStatement;
1133
+ declare const index_isEmptyStatement: typeof isEmptyStatement;
1134
+ declare const index_isExpressionStatement: typeof isExpressionStatement;
1135
+ declare const index_isForInStatement: typeof isForInStatement;
1136
+ declare const index_isForOfStatement: typeof isForOfStatement;
1137
+ declare const index_isForStatement: typeof isForStatement;
1138
+ declare const index_isFunctionDeclaration: typeof isFunctionDeclaration;
1139
+ declare const index_isFunctionExpression: typeof isFunctionExpression;
1140
+ declare const index_isIdentifier: typeof isIdentifier;
1141
+ declare const index_isIfStatement: typeof isIfStatement;
1142
+ declare const index_isImportDeclaration: typeof isImportDeclaration;
1143
+ declare const index_isImportDefaultSpecifier: typeof isImportDefaultSpecifier;
1144
+ declare const index_isImportNamespaceSpecifier: typeof isImportNamespaceSpecifier;
1145
+ declare const index_isImportSpecifier: typeof isImportSpecifier;
1146
+ declare const index_isJsonExpression: typeof isJsonExpression;
1147
+ declare const index_isLiteral: typeof isLiteral;
1148
+ declare const index_isLogicalExpression: typeof isLogicalExpression;
1149
+ declare const index_isMemberExpression: typeof isMemberExpression;
1150
+ declare const index_isModuleDeclaration: typeof isModuleDeclaration;
1151
+ declare const index_isNewExpression: typeof isNewExpression;
1152
+ declare const index_isNode: typeof isNode;
1153
+ declare const index_isObjectExpression: typeof isObjectExpression;
1154
+ declare const index_isObjectPattern: typeof isObjectPattern;
1155
+ declare const index_isProgram: typeof isProgram;
1156
+ declare const index_isProperty: typeof isProperty;
1157
+ declare const index_isReturnStatement: typeof isReturnStatement;
1158
+ declare const index_isSwitchCase: typeof isSwitchCase;
1159
+ declare const index_isSwitchStatement: typeof isSwitchStatement;
1160
+ declare const index_isTemplateElement: typeof isTemplateElement;
1161
+ declare const index_isTemplateLiteral: typeof isTemplateLiteral;
1162
+ declare const index_isThrowStatement: typeof isThrowStatement;
1163
+ declare const index_isTryStatement: typeof isTryStatement;
1164
+ declare const index_isUnaryExpression: typeof isUnaryExpression;
1165
+ declare const index_isUpdateExpression: typeof isUpdateExpression;
1166
+ declare const index_isVariableDeclaration: typeof isVariableDeclaration;
1167
+ declare const index_isVariableDeclarator: typeof isVariableDeclarator;
1168
+ declare const index_isWhileStatement: typeof isWhileStatement;
1169
+ declare namespace index {
1170
+ export { index_isArrayExpression as isArrayExpression, index_isArrayPattern as isArrayPattern, index_isArrowFunctionExpression as isArrowFunctionExpression, index_isAssignmentExpression as isAssignmentExpression, index_isAssignmentProperty as isAssignmentProperty, index_isAwaitExpression as isAwaitExpression, index_isBinaryExpression as isBinaryExpression, index_isBlockStatement as isBlockStatement, index_isBreakStatement as isBreakStatement, index_isCallExpression as isCallExpression, index_isCatchClause as isCatchClause, index_isConditionalExpression as isConditionalExpression, index_isContinueStatement as isContinueStatement, index_isDirective as isDirective, index_isDoWhileStatement as isDoWhileStatement, index_isEmptyStatement as isEmptyStatement, index_isExpressionStatement as isExpressionStatement, index_isForInStatement as isForInStatement, index_isForOfStatement as isForOfStatement, index_isForStatement as isForStatement, index_isFunctionDeclaration as isFunctionDeclaration, index_isFunctionExpression as isFunctionExpression, index_isIdentifier as isIdentifier, index_isIfStatement as isIfStatement, index_isImportDeclaration as isImportDeclaration, index_isImportDefaultSpecifier as isImportDefaultSpecifier, index_isImportNamespaceSpecifier as isImportNamespaceSpecifier, index_isImportSpecifier as isImportSpecifier, index_isJsonExpression as isJsonExpression, index_isLiteral as isLiteral, index_isLogicalExpression as isLogicalExpression, index_isMemberExpression as isMemberExpression, index_isModuleDeclaration as isModuleDeclaration, index_isNewExpression as isNewExpression, index_isNode as isNode, index_isObjectExpression as isObjectExpression, index_isObjectPattern as isObjectPattern, index_isProgram as isProgram, index_isProperty as isProperty, index_isReturnStatement as isReturnStatement, index_isSwitchCase as isSwitchCase, index_isSwitchStatement as isSwitchStatement, index_isTemplateElement as isTemplateElement, index_isTemplateLiteral as isTemplateLiteral, index_isThrowStatement as isThrowStatement, index_isTryStatement as isTryStatement, index_isUnaryExpression as isUnaryExpression, index_isUpdateExpression as isUpdateExpression, index_isVariableDeclaration as isVariableDeclaration, index_isVariableDeclarator as isVariableDeclarator, index_isWhileStatement as isWhileStatement };
1171
+ }
1172
+
1173
+ type VisitorFunction = (node: BaseNode & {
1174
+ [key: string]: any;
1175
+ }, // <- FLEXÍVEL AQUI!
1176
+ parent: BaseNode | null) => void | false | "break";
1177
+ type WalkVisitors = {
1178
+ [key: string]: VisitorFunction;
1179
+ "*": VisitorFunction;
1180
+ };
1181
+ declare function walk(root: BaseNode, visitors: Partial<WalkVisitors>): void;
1182
+
1183
+ /**
1184
+ * Visita cada filho direto de `node`, na ordem da gramática. O callback recebe o
1185
+ * filho, a `key` do campo onde ele mora e o `index` (quando o campo é um array,
1186
+ * senão `null`). Não desce recursivamente — é um passo só (use `walk` p/ DFS).
1187
+ */
1188
+ declare function forEachChild(node: BaseNode, visit: (child: BaseNode, key: string, index: number | null) => void): void;
1189
+ /** Os filhos diretos de `node`, na ordem da gramática. */
1190
+ declare function childrenOf(node: BaseNode): BaseNode[];
1191
+
1192
+ /** Um nível de escopo léxico encadeado ao pai. */
1193
+ interface Scope<T> {
1194
+ readonly vars: Readonly<Record<string, T>>;
1195
+ readonly parent: Scope<T> | null;
1196
+ }
1197
+ /** Cria um escopo raiz (sem pai). */
1198
+ declare const rootScope: <T>(vars?: Record<string, T>) => Scope<T>;
1199
+ /** Estende `parent` com novos bindings, criando um escopo filho (sem mutar o pai). */
1200
+ declare const childScope: <T>(parent: Scope<T>, vars: Record<string, T>) => Scope<T>;
1201
+ /** Resolve `name` subindo a cadeia léxica. `undefined` se não existir. */
1202
+ declare function lookup<T>(scope: Scope<T>, name: string): T | undefined;
1203
+ /**
1204
+ * Todos os nomes visíveis a partir de `scope`, com shadowing — o binding mais
1205
+ * interno vence (alimenta autocomplete e checagens de visibilidade).
1206
+ */
1207
+ declare function visibleNames<T>(scope: Scope<T>): Map<string, T>;
1208
+
1209
+ declare const Mock: any;
1210
+ declare const isObject: (x: unknown) => x is Record<string, unknown>;
1211
+ declare function find<T = BaseNode>(node: any, match: (n: any) => boolean): T | undefined;
1212
+ declare function mutate<T = any>(node: T, match: (value: any) => boolean, modifier: (value: any) => any): T;
1213
+ declare function pick<T extends object, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
1214
+
1215
+ export { AST_MARKER, type ArrayExpression, type ArrayPattern, type ArrowFunctionExpression, type AssignmentExpression, type AssignmentOperator, type AssignmentPattern, type AssignmentProperty, type AwaitExpression, type BaseCallExpression, type BaseDeclaration, type BaseExpression, type BaseForXStatement, type BaseFunction, type BaseModuleDeclaration, type BaseModuleSpecifier, type BaseNode, type BaseNodeWithoutComments, type BasePattern, type BaseStatement, type BigIntLiteral, type BinaryExpression, type BinaryOperator, BinaryPrecedence, type BlockStatement, type BreakStatement, type CallExpression, type CatchClause, type ChainElement, type ChainExpression, type Comment, type ConditionalExpression, type ContinueStatement, type CoreErrorCode, type DebuggerStatement, type Declaration, type Directive, type DoWhileStatement, type EmptyStatement, type Expression, type ExpressionStatement, type ForInStatement, type ForOfStatement, type ForStatement, type Function, type FunctionDeclaration, type FunctionExpression, type Identifier, type IfStatement, type ImportDeclaration, type ImportDefaultSpecifier, type ImportExpression, type ImportNamespaceSpecifier, type ImportSpecifier, type JsonExpression, type LabeledStatement, type Literal, type LogicalExpression, type LogicalOperator, type MaybeNamedFunctionDeclaration, type MemberExpression, type MetaProperty, type MethodDefinition, Mock, type ModuleDeclaration, type ModuleSpecifier, type NewExpression, type Node, type NodeMap, type ObjectExpression, type ObjectPattern, type Pattern, type Position, Precedence, type Program, type Property, type PropertyDefinition, type RegExpLiteral, type RestElement, type ReturnStatement, type Scope, type SequenceExpression, type SimpleArrayExpression, type SimpleArrayPattern, type SimpleArrowFunctionExpression, type SimpleAssignmentExpression, type SimpleAssignmentPattern, type SimpleAssignmentProperty, type SimpleAwaitExpression, type SimpleBaseCallExpression, type SimpleBaseDeclaration, type SimpleBaseExpression, type SimpleBaseForXStatement, type SimpleBaseFunction, type SimpleBaseNode, type SimpleBaseNodeWithoutComments, type SimpleBasePattern, type SimpleBaseStatement, type SimpleBigIntLiteral, type SimpleBinaryExpression, type SimpleBlockStatement, type SimpleBreakStatement, type SimpleCallExpression, type SimpleCatchClause, type SimpleChainExpression, type SimpleComment, type SimpleConditionalExpression, type SimpleContinueStatement, type SimpleDoWhileStatement, type SimpleEmptyStatement, type SimpleExpressionStatement, type SimpleForInStatement, type SimpleForOfStatement, type SimpleForStatement, type SimpleFunctionDeclaration, type SimpleFunctionExpression, type SimpleIdentifier, type SimpleIfStatement, type SimpleJsonExpression, type SimpleLabeledStatement, type SimpleLiteral, type SimpleLogicalExpression, type SimpleMemberExpression, type SimpleMethodDefinition, type SimpleNewExpression, type SimpleNode, type SimpleObjectExpression, type SimpleObjectPattern, type SimplePosition, type SimpleProgram, type SimpleProperty, type SimplePropertyDefinition, type SimpleRegExpLiteral, type SimpleRestElement, type SimpleReturnStatement, type SimpleSequenceExpression, type SimpleSimpleCallExpression, type SimpleSimpleLiteral, type SimpleSourceLocation, type SimpleSpreadElement, type SimpleSwitchCase, type SimpleSwitchStatement, type SimpleTemplateElement, type SimpleTemplateLiteral, type SimpleThisExpression, type SimpleThrowStatement, type SimpleTryStatement, type SimpleUnaryExpression, type SimpleUpdateExpression, type SimpleVariableDeclaration, type SimpleVariableDeclarator, type SimpleWhileStatement, type SourceLocation, type SpreadElement, type Statement, type SwitchCase, type SwitchStatement, type TSLite, TSLiteError, type TSLiteMarker, type TaggedTemplateExpression, type TemplateElement, type TemplateLiteral, type ThisExpression, type ThrowStatement, type TryStatement, type UnaryExpression, type UnaryOperator, type UpdateExpression, type UpdateOperator, VALID_AST_ENTRY_TYPES, VALID_OBJECT_KEY, type ValidAstEntryType, type VariableDeclaration, type VariableDeclarator, VisitorKeys, type WhileStatement, ast, index$1 as builders, childScope, childrenOf, find, forEachChild, fromAstMarker, generateBuilders, index as guards, invalidAstEntryError, isObject, isValidAstEntryType, json, jsonExpression, lookup, mutate, pick, rootScope, types, visibleNames, walk };