/
index.ts
executable file
路1496 lines (1494 loc) 路 48 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* This file is auto-generated! Do not modify it directly.
* To re-generate run 'make build'
*/
import builder from "../builder";
import type * as t from "../..";
/* eslint-disable @typescript-eslint/no-unused-vars */
export function arrayExpression(
elements?: Array<null | t.Expression | t.SpreadElement>,
): t.ArrayExpression {
return builder("ArrayExpression", ...arguments);
}
export function assignmentExpression(
operator: string,
left: t.LVal,
right: t.Expression,
): t.AssignmentExpression {
return builder("AssignmentExpression", ...arguments);
}
export function binaryExpression(
operator:
| "+"
| "-"
| "/"
| "%"
| "*"
| "**"
| "&"
| "|"
| ">>"
| ">>>"
| "<<"
| "^"
| "=="
| "==="
| "!="
| "!=="
| "in"
| "instanceof"
| ">"
| "<"
| ">="
| "<=",
left: t.Expression | t.PrivateName,
right: t.Expression,
): t.BinaryExpression {
return builder("BinaryExpression", ...arguments);
}
export function interpreterDirective(value: string): t.InterpreterDirective {
return builder("InterpreterDirective", ...arguments);
}
export function directive(value: t.DirectiveLiteral): t.Directive {
return builder("Directive", ...arguments);
}
export function directiveLiteral(value: string): t.DirectiveLiteral {
return builder("DirectiveLiteral", ...arguments);
}
export function blockStatement(
body: Array<t.Statement>,
directives?: Array<t.Directive>,
): t.BlockStatement {
return builder("BlockStatement", ...arguments);
}
export function breakStatement(label?: t.Identifier | null): t.BreakStatement {
return builder("BreakStatement", ...arguments);
}
export function callExpression(
callee: t.Expression | t.V8IntrinsicIdentifier,
_arguments: Array<
t.Expression | t.SpreadElement | t.JSXNamespacedName | t.ArgumentPlaceholder
>,
): t.CallExpression {
return builder("CallExpression", ...arguments);
}
export function catchClause(
param: t.Identifier | t.ArrayPattern | t.ObjectPattern | null | undefined,
body: t.BlockStatement,
): t.CatchClause {
return builder("CatchClause", ...arguments);
}
export function conditionalExpression(
test: t.Expression,
consequent: t.Expression,
alternate: t.Expression,
): t.ConditionalExpression {
return builder("ConditionalExpression", ...arguments);
}
export function continueStatement(
label?: t.Identifier | null,
): t.ContinueStatement {
return builder("ContinueStatement", ...arguments);
}
export function debuggerStatement(): t.DebuggerStatement {
return builder("DebuggerStatement", ...arguments);
}
export function doWhileStatement(
test: t.Expression,
body: t.Statement,
): t.DoWhileStatement {
return builder("DoWhileStatement", ...arguments);
}
export function emptyStatement(): t.EmptyStatement {
return builder("EmptyStatement", ...arguments);
}
export function expressionStatement(
expression: t.Expression,
): t.ExpressionStatement {
return builder("ExpressionStatement", ...arguments);
}
export function file(
program: t.Program,
comments?: Array<t.CommentBlock | t.CommentLine> | null,
tokens?: Array<any> | null,
): t.File {
return builder("File", ...arguments);
}
export function forInStatement(
left: t.VariableDeclaration | t.LVal,
right: t.Expression,
body: t.Statement,
): t.ForInStatement {
return builder("ForInStatement", ...arguments);
}
export function forStatement(
init: t.VariableDeclaration | t.Expression | null | undefined,
test: t.Expression | null | undefined,
update: t.Expression | null | undefined,
body: t.Statement,
): t.ForStatement {
return builder("ForStatement", ...arguments);
}
export function functionDeclaration(
id: t.Identifier | null | undefined,
params: Array<
t.Identifier | t.Pattern | t.RestElement | t.TSParameterProperty
>,
body: t.BlockStatement,
generator?: boolean,
async?: boolean,
): t.FunctionDeclaration {
return builder("FunctionDeclaration", ...arguments);
}
export function functionExpression(
id: t.Identifier | null | undefined,
params: Array<
t.Identifier | t.Pattern | t.RestElement | t.TSParameterProperty
>,
body: t.BlockStatement,
generator?: boolean,
async?: boolean,
): t.FunctionExpression {
return builder("FunctionExpression", ...arguments);
}
export function identifier(name: string): t.Identifier {
return builder("Identifier", ...arguments);
}
export function ifStatement(
test: t.Expression,
consequent: t.Statement,
alternate?: t.Statement | null,
): t.IfStatement {
return builder("IfStatement", ...arguments);
}
export function labeledStatement(
label: t.Identifier,
body: t.Statement,
): t.LabeledStatement {
return builder("LabeledStatement", ...arguments);
}
export function stringLiteral(value: string): t.StringLiteral {
return builder("StringLiteral", ...arguments);
}
export function numericLiteral(value: number): t.NumericLiteral {
return builder("NumericLiteral", ...arguments);
}
export function nullLiteral(): t.NullLiteral {
return builder("NullLiteral", ...arguments);
}
export function booleanLiteral(value: boolean): t.BooleanLiteral {
return builder("BooleanLiteral", ...arguments);
}
export function regExpLiteral(
pattern: string,
flags?: string,
): t.RegExpLiteral {
return builder("RegExpLiteral", ...arguments);
}
export function logicalExpression(
operator: "||" | "&&" | "??",
left: t.Expression,
right: t.Expression,
): t.LogicalExpression {
return builder("LogicalExpression", ...arguments);
}
export function memberExpression(
object: t.Expression,
property: t.Expression | t.Identifier | t.PrivateName,
computed?: boolean,
optional?: true | false | null,
): t.MemberExpression {
return builder("MemberExpression", ...arguments);
}
export function newExpression(
callee: t.Expression | t.V8IntrinsicIdentifier,
_arguments: Array<
t.Expression | t.SpreadElement | t.JSXNamespacedName | t.ArgumentPlaceholder
>,
): t.NewExpression {
return builder("NewExpression", ...arguments);
}
export function program(
body: Array<t.Statement>,
directives?: Array<t.Directive>,
sourceType?: "script" | "module",
interpreter?: t.InterpreterDirective | null,
): t.Program {
return builder("Program", ...arguments);
}
export function objectExpression(
properties: Array<t.ObjectMethod | t.ObjectProperty | t.SpreadElement>,
): t.ObjectExpression {
return builder("ObjectExpression", ...arguments);
}
export function objectMethod(
kind: "method" | "get" | "set" | undefined,
key: t.Expression | t.Identifier | t.StringLiteral | t.NumericLiteral,
params: Array<
t.Identifier | t.Pattern | t.RestElement | t.TSParameterProperty
>,
body: t.BlockStatement,
computed?: boolean,
generator?: boolean,
async?: boolean,
): t.ObjectMethod {
return builder("ObjectMethod", ...arguments);
}
export function objectProperty(
key: t.Expression | t.Identifier | t.StringLiteral | t.NumericLiteral,
value: t.Expression | t.PatternLike,
computed?: boolean,
shorthand?: boolean,
decorators?: Array<t.Decorator> | null,
): t.ObjectProperty {
return builder("ObjectProperty", ...arguments);
}
export function restElement(argument: t.LVal): t.RestElement {
return builder("RestElement", ...arguments);
}
export function returnStatement(
argument?: t.Expression | null,
): t.ReturnStatement {
return builder("ReturnStatement", ...arguments);
}
export function sequenceExpression(
expressions: Array<t.Expression>,
): t.SequenceExpression {
return builder("SequenceExpression", ...arguments);
}
export function parenthesizedExpression(
expression: t.Expression,
): t.ParenthesizedExpression {
return builder("ParenthesizedExpression", ...arguments);
}
export function switchCase(
test: t.Expression | null | undefined,
consequent: Array<t.Statement>,
): t.SwitchCase {
return builder("SwitchCase", ...arguments);
}
export function switchStatement(
discriminant: t.Expression,
cases: Array<t.SwitchCase>,
): t.SwitchStatement {
return builder("SwitchStatement", ...arguments);
}
export function thisExpression(): t.ThisExpression {
return builder("ThisExpression", ...arguments);
}
export function throwStatement(argument: t.Expression): t.ThrowStatement {
return builder("ThrowStatement", ...arguments);
}
export function tryStatement(
block: t.BlockStatement,
handler?: t.CatchClause | null,
finalizer?: t.BlockStatement | null,
): t.TryStatement {
return builder("TryStatement", ...arguments);
}
export function unaryExpression(
operator: "void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof",
argument: t.Expression,
prefix?: boolean,
): t.UnaryExpression {
return builder("UnaryExpression", ...arguments);
}
export function updateExpression(
operator: "++" | "--",
argument: t.Expression,
prefix?: boolean,
): t.UpdateExpression {
return builder("UpdateExpression", ...arguments);
}
export function variableDeclaration(
kind: "var" | "let" | "const",
declarations: Array<t.VariableDeclarator>,
): t.VariableDeclaration {
return builder("VariableDeclaration", ...arguments);
}
export function variableDeclarator(
id: t.LVal,
init?: t.Expression | null,
): t.VariableDeclarator {
return builder("VariableDeclarator", ...arguments);
}
export function whileStatement(
test: t.Expression,
body: t.Statement,
): t.WhileStatement {
return builder("WhileStatement", ...arguments);
}
export function withStatement(
object: t.Expression,
body: t.Statement,
): t.WithStatement {
return builder("WithStatement", ...arguments);
}
export function assignmentPattern(
left: t.Identifier | t.ObjectPattern | t.ArrayPattern | t.MemberExpression,
right: t.Expression,
): t.AssignmentPattern {
return builder("AssignmentPattern", ...arguments);
}
export function arrayPattern(
elements: Array<null | t.PatternLike>,
): t.ArrayPattern {
return builder("ArrayPattern", ...arguments);
}
export function arrowFunctionExpression(
params: Array<
t.Identifier | t.Pattern | t.RestElement | t.TSParameterProperty
>,
body: t.BlockStatement | t.Expression,
async?: boolean,
): t.ArrowFunctionExpression {
return builder("ArrowFunctionExpression", ...arguments);
}
export function classBody(
body: Array<
| t.ClassMethod
| t.ClassPrivateMethod
| t.ClassProperty
| t.ClassPrivateProperty
| t.TSDeclareMethod
| t.TSIndexSignature
>,
): t.ClassBody {
return builder("ClassBody", ...arguments);
}
export function classExpression(
id: t.Identifier | null | undefined,
superClass: t.Expression | null | undefined,
body: t.ClassBody,
decorators?: Array<t.Decorator> | null,
): t.ClassExpression {
return builder("ClassExpression", ...arguments);
}
export function classDeclaration(
id: t.Identifier,
superClass: t.Expression | null | undefined,
body: t.ClassBody,
decorators?: Array<t.Decorator> | null,
): t.ClassDeclaration {
return builder("ClassDeclaration", ...arguments);
}
export function exportAllDeclaration(
source: t.StringLiteral,
): t.ExportAllDeclaration {
return builder("ExportAllDeclaration", ...arguments);
}
export function exportDefaultDeclaration(
declaration:
| t.FunctionDeclaration
| t.TSDeclareFunction
| t.ClassDeclaration
| t.Expression,
): t.ExportDefaultDeclaration {
return builder("ExportDefaultDeclaration", ...arguments);
}
export function exportNamedDeclaration(
declaration?: t.Declaration | null,
specifiers?: Array<
t.ExportSpecifier | t.ExportDefaultSpecifier | t.ExportNamespaceSpecifier
>,
source?: t.StringLiteral | null,
): t.ExportNamedDeclaration {
return builder("ExportNamedDeclaration", ...arguments);
}
export function exportSpecifier(
local: t.Identifier,
exported: t.Identifier | t.StringLiteral,
): t.ExportSpecifier {
return builder("ExportSpecifier", ...arguments);
}
export function forOfStatement(
left: t.VariableDeclaration | t.LVal,
right: t.Expression,
body: t.Statement,
_await?: boolean,
): t.ForOfStatement {
return builder("ForOfStatement", ...arguments);
}
export function importDeclaration(
specifiers: Array<
t.ImportSpecifier | t.ImportDefaultSpecifier | t.ImportNamespaceSpecifier
>,
source: t.StringLiteral,
): t.ImportDeclaration {
return builder("ImportDeclaration", ...arguments);
}
export function importDefaultSpecifier(
local: t.Identifier,
): t.ImportDefaultSpecifier {
return builder("ImportDefaultSpecifier", ...arguments);
}
export function importNamespaceSpecifier(
local: t.Identifier,
): t.ImportNamespaceSpecifier {
return builder("ImportNamespaceSpecifier", ...arguments);
}
export function importSpecifier(
local: t.Identifier,
imported: t.Identifier | t.StringLiteral,
): t.ImportSpecifier {
return builder("ImportSpecifier", ...arguments);
}
export function metaProperty(
meta: t.Identifier,
property: t.Identifier,
): t.MetaProperty {
return builder("MetaProperty", ...arguments);
}
export function classMethod(
kind: "get" | "set" | "method" | "constructor" | undefined,
key: t.Identifier | t.StringLiteral | t.NumericLiteral | t.Expression,
params: Array<
t.Identifier | t.Pattern | t.RestElement | t.TSParameterProperty
>,
body: t.BlockStatement,
computed?: boolean,
_static?: boolean,
generator?: boolean,
async?: boolean,
): t.ClassMethod {
return builder("ClassMethod", ...arguments);
}
export function objectPattern(
properties: Array<t.RestElement | t.ObjectProperty>,
): t.ObjectPattern {
return builder("ObjectPattern", ...arguments);
}
export function spreadElement(argument: t.Expression): t.SpreadElement {
return builder("SpreadElement", ...arguments);
}
function _super(): t.Super {
return builder("Super", ...arguments);
}
export { _super as super };
export function taggedTemplateExpression(
tag: t.Expression,
quasi: t.TemplateLiteral,
): t.TaggedTemplateExpression {
return builder("TaggedTemplateExpression", ...arguments);
}
export function templateElement(
value: { raw: string; cooked?: string },
tail?: boolean,
): t.TemplateElement {
return builder("TemplateElement", ...arguments);
}
export function templateLiteral(
quasis: Array<t.TemplateElement>,
expressions: Array<t.Expression | t.TSType>,
): t.TemplateLiteral {
return builder("TemplateLiteral", ...arguments);
}
export function yieldExpression(
argument?: t.Expression | null,
delegate?: boolean,
): t.YieldExpression {
return builder("YieldExpression", ...arguments);
}
export function awaitExpression(argument: t.Expression): t.AwaitExpression {
return builder("AwaitExpression", ...arguments);
}
function _import(): t.Import {
return builder("Import", ...arguments);
}
export { _import as import };
export function bigIntLiteral(value: string): t.BigIntLiteral {
return builder("BigIntLiteral", ...arguments);
}
export function exportNamespaceSpecifier(
exported: t.Identifier,
): t.ExportNamespaceSpecifier {
return builder("ExportNamespaceSpecifier", ...arguments);
}
export function optionalMemberExpression(
object: t.Expression,
property: t.Expression | t.Identifier,
computed: boolean | undefined,
optional: boolean,
): t.OptionalMemberExpression {
return builder("OptionalMemberExpression", ...arguments);
}
export function optionalCallExpression(
callee: t.Expression,
_arguments: Array<
t.Expression | t.SpreadElement | t.JSXNamespacedName | t.ArgumentPlaceholder
>,
optional: boolean,
): t.OptionalCallExpression {
return builder("OptionalCallExpression", ...arguments);
}
export function anyTypeAnnotation(): t.AnyTypeAnnotation {
return builder("AnyTypeAnnotation", ...arguments);
}
export function arrayTypeAnnotation(
elementType: t.FlowType,
): t.ArrayTypeAnnotation {
return builder("ArrayTypeAnnotation", ...arguments);
}
export function booleanTypeAnnotation(): t.BooleanTypeAnnotation {
return builder("BooleanTypeAnnotation", ...arguments);
}
export function booleanLiteralTypeAnnotation(
value: boolean,
): t.BooleanLiteralTypeAnnotation {
return builder("BooleanLiteralTypeAnnotation", ...arguments);
}
export function nullLiteralTypeAnnotation(): t.NullLiteralTypeAnnotation {
return builder("NullLiteralTypeAnnotation", ...arguments);
}
export function classImplements(
id: t.Identifier,
typeParameters?: t.TypeParameterInstantiation | null,
): t.ClassImplements {
return builder("ClassImplements", ...arguments);
}
export function declareClass(
id: t.Identifier,
typeParameters: t.TypeParameterDeclaration | null | undefined,
_extends: Array<t.InterfaceExtends> | null | undefined,
body: t.ObjectTypeAnnotation,
): t.DeclareClass {
return builder("DeclareClass", ...arguments);
}
export function declareFunction(id: t.Identifier): t.DeclareFunction {
return builder("DeclareFunction", ...arguments);
}
export function declareInterface(
id: t.Identifier,
typeParameters: t.TypeParameterDeclaration | null | undefined,
_extends: Array<t.InterfaceExtends> | null | undefined,
body: t.ObjectTypeAnnotation,
): t.DeclareInterface {
return builder("DeclareInterface", ...arguments);
}
export function declareModule(
id: t.Identifier | t.StringLiteral,
body: t.BlockStatement,
kind?: "CommonJS" | "ES" | null,
): t.DeclareModule {
return builder("DeclareModule", ...arguments);
}
export function declareModuleExports(
typeAnnotation: t.TypeAnnotation,
): t.DeclareModuleExports {
return builder("DeclareModuleExports", ...arguments);
}
export function declareTypeAlias(
id: t.Identifier,
typeParameters: t.TypeParameterDeclaration | null | undefined,
right: t.FlowType,
): t.DeclareTypeAlias {
return builder("DeclareTypeAlias", ...arguments);
}
export function declareOpaqueType(
id: t.Identifier,
typeParameters?: t.TypeParameterDeclaration | null,
supertype?: t.FlowType | null,
): t.DeclareOpaqueType {
return builder("DeclareOpaqueType", ...arguments);
}
export function declareVariable(id: t.Identifier): t.DeclareVariable {
return builder("DeclareVariable", ...arguments);
}
export function declareExportDeclaration(
declaration?: t.Flow | null,
specifiers?: Array<t.ExportSpecifier | t.ExportNamespaceSpecifier> | null,
source?: t.StringLiteral | null,
): t.DeclareExportDeclaration {
return builder("DeclareExportDeclaration", ...arguments);
}
export function declareExportAllDeclaration(
source: t.StringLiteral,
): t.DeclareExportAllDeclaration {
return builder("DeclareExportAllDeclaration", ...arguments);
}
export function declaredPredicate(value: t.Flow): t.DeclaredPredicate {
return builder("DeclaredPredicate", ...arguments);
}
export function existsTypeAnnotation(): t.ExistsTypeAnnotation {
return builder("ExistsTypeAnnotation", ...arguments);
}
export function functionTypeAnnotation(
typeParameters: t.TypeParameterDeclaration | null | undefined,
params: Array<t.FunctionTypeParam>,
rest: t.FunctionTypeParam | null | undefined,
returnType: t.FlowType,
): t.FunctionTypeAnnotation {
return builder("FunctionTypeAnnotation", ...arguments);
}
export function functionTypeParam(
name: t.Identifier | null | undefined,
typeAnnotation: t.FlowType,
): t.FunctionTypeParam {
return builder("FunctionTypeParam", ...arguments);
}
export function genericTypeAnnotation(
id: t.Identifier | t.QualifiedTypeIdentifier,
typeParameters?: t.TypeParameterInstantiation | null,
): t.GenericTypeAnnotation {
return builder("GenericTypeAnnotation", ...arguments);
}
export function inferredPredicate(): t.InferredPredicate {
return builder("InferredPredicate", ...arguments);
}
export function interfaceExtends(
id: t.Identifier | t.QualifiedTypeIdentifier,
typeParameters?: t.TypeParameterInstantiation | null,
): t.InterfaceExtends {
return builder("InterfaceExtends", ...arguments);
}
export function interfaceDeclaration(
id: t.Identifier,
typeParameters: t.TypeParameterDeclaration | null | undefined,
_extends: Array<t.InterfaceExtends> | null | undefined,
body: t.ObjectTypeAnnotation,
): t.InterfaceDeclaration {
return builder("InterfaceDeclaration", ...arguments);
}
export function interfaceTypeAnnotation(
_extends: Array<t.InterfaceExtends> | null | undefined,
body: t.ObjectTypeAnnotation,
): t.InterfaceTypeAnnotation {
return builder("InterfaceTypeAnnotation", ...arguments);
}
export function intersectionTypeAnnotation(
types: Array<t.FlowType>,
): t.IntersectionTypeAnnotation {
return builder("IntersectionTypeAnnotation", ...arguments);
}
export function mixedTypeAnnotation(): t.MixedTypeAnnotation {
return builder("MixedTypeAnnotation", ...arguments);
}
export function emptyTypeAnnotation(): t.EmptyTypeAnnotation {
return builder("EmptyTypeAnnotation", ...arguments);
}
export function nullableTypeAnnotation(
typeAnnotation: t.FlowType,
): t.NullableTypeAnnotation {
return builder("NullableTypeAnnotation", ...arguments);
}
export function numberLiteralTypeAnnotation(
value: number,
): t.NumberLiteralTypeAnnotation {
return builder("NumberLiteralTypeAnnotation", ...arguments);
}
export function numberTypeAnnotation(): t.NumberTypeAnnotation {
return builder("NumberTypeAnnotation", ...arguments);
}
export function objectTypeAnnotation(
properties: Array<t.ObjectTypeProperty | t.ObjectTypeSpreadProperty>,
indexers?: Array<t.ObjectTypeIndexer> | null,
callProperties?: Array<t.ObjectTypeCallProperty> | null,
internalSlots?: Array<t.ObjectTypeInternalSlot> | null,
exact?: boolean,
): t.ObjectTypeAnnotation {
return builder("ObjectTypeAnnotation", ...arguments);
}
export function objectTypeInternalSlot(
id: t.Identifier,
value: t.FlowType,
optional: boolean,
_static: boolean,
method: boolean,
): t.ObjectTypeInternalSlot {
return builder("ObjectTypeInternalSlot", ...arguments);
}
export function objectTypeCallProperty(
value: t.FlowType,
): t.ObjectTypeCallProperty {
return builder("ObjectTypeCallProperty", ...arguments);
}
export function objectTypeIndexer(
id: t.Identifier | null | undefined,
key: t.FlowType,
value: t.FlowType,
variance?: t.Variance | null,
): t.ObjectTypeIndexer {
return builder("ObjectTypeIndexer", ...arguments);
}
export function objectTypeProperty(
key: t.Identifier | t.StringLiteral,
value: t.FlowType,
variance?: t.Variance | null,
): t.ObjectTypeProperty {
return builder("ObjectTypeProperty", ...arguments);
}
export function objectTypeSpreadProperty(
argument: t.FlowType,
): t.ObjectTypeSpreadProperty {
return builder("ObjectTypeSpreadProperty", ...arguments);
}
export function opaqueType(
id: t.Identifier,
typeParameters: t.TypeParameterDeclaration | null | undefined,
supertype: t.FlowType | null | undefined,
impltype: t.FlowType,
): t.OpaqueType {
return builder("OpaqueType", ...arguments);
}
export function qualifiedTypeIdentifier(
id: t.Identifier,
qualification: t.Identifier | t.QualifiedTypeIdentifier,
): t.QualifiedTypeIdentifier {
return builder("QualifiedTypeIdentifier", ...arguments);
}
export function stringLiteralTypeAnnotation(
value: string,
): t.StringLiteralTypeAnnotation {
return builder("StringLiteralTypeAnnotation", ...arguments);
}
export function stringTypeAnnotation(): t.StringTypeAnnotation {
return builder("StringTypeAnnotation", ...arguments);
}
export function symbolTypeAnnotation(): t.SymbolTypeAnnotation {
return builder("SymbolTypeAnnotation", ...arguments);
}
export function thisTypeAnnotation(): t.ThisTypeAnnotation {
return builder("ThisTypeAnnotation", ...arguments);
}
export function tupleTypeAnnotation(
types: Array<t.FlowType>,
): t.TupleTypeAnnotation {
return builder("TupleTypeAnnotation", ...arguments);
}
export function typeofTypeAnnotation(
argument: t.FlowType,
): t.TypeofTypeAnnotation {
return builder("TypeofTypeAnnotation", ...arguments);
}
export function typeAlias(
id: t.Identifier,
typeParameters: t.TypeParameterDeclaration | null | undefined,
right: t.FlowType,
): t.TypeAlias {
return builder("TypeAlias", ...arguments);
}
export function typeAnnotation(typeAnnotation: t.FlowType): t.TypeAnnotation {
return builder("TypeAnnotation", ...arguments);
}
export function typeCastExpression(
expression: t.Expression,
typeAnnotation: t.TypeAnnotation,
): t.TypeCastExpression {
return builder("TypeCastExpression", ...arguments);
}
export function typeParameter(
bound?: t.TypeAnnotation | null,
_default?: t.FlowType | null,
variance?: t.Variance | null,
): t.TypeParameter {
return builder("TypeParameter", ...arguments);
}
export function typeParameterDeclaration(
params: Array<t.TypeParameter>,
): t.TypeParameterDeclaration {
return builder("TypeParameterDeclaration", ...arguments);
}
export function typeParameterInstantiation(
params: Array<t.FlowType>,
): t.TypeParameterInstantiation {
return builder("TypeParameterInstantiation", ...arguments);
}
export function unionTypeAnnotation(
types: Array<t.FlowType>,
): t.UnionTypeAnnotation {
return builder("UnionTypeAnnotation", ...arguments);
}
export function variance(kind: "minus" | "plus"): t.Variance {
return builder("Variance", ...arguments);
}
export function voidTypeAnnotation(): t.VoidTypeAnnotation {
return builder("VoidTypeAnnotation", ...arguments);
}
export function enumDeclaration(
id: t.Identifier,
body:
| t.EnumBooleanBody
| t.EnumNumberBody
| t.EnumStringBody
| t.EnumSymbolBody,
): t.EnumDeclaration {
return builder("EnumDeclaration", ...arguments);
}
export function enumBooleanBody(
members: Array<t.EnumBooleanMember>,
): t.EnumBooleanBody {
return builder("EnumBooleanBody", ...arguments);
}
export function enumNumberBody(
members: Array<t.EnumNumberMember>,
): t.EnumNumberBody {
return builder("EnumNumberBody", ...arguments);
}
export function enumStringBody(
members: Array<t.EnumStringMember | t.EnumDefaultedMember>,
): t.EnumStringBody {
return builder("EnumStringBody", ...arguments);
}
export function enumSymbolBody(
members: Array<t.EnumDefaultedMember>,
): t.EnumSymbolBody {
return builder("EnumSymbolBody", ...arguments);
}
export function enumBooleanMember(id: t.Identifier): t.EnumBooleanMember {
return builder("EnumBooleanMember", ...arguments);
}
export function enumNumberMember(
id: t.Identifier,
init: t.NumericLiteral,
): t.EnumNumberMember {
return builder("EnumNumberMember", ...arguments);
}
export function enumStringMember(
id: t.Identifier,
init: t.StringLiteral,
): t.EnumStringMember {
return builder("EnumStringMember", ...arguments);
}
export function enumDefaultedMember(id: t.Identifier): t.EnumDefaultedMember {
return builder("EnumDefaultedMember", ...arguments);
}
export function indexedAccessType(
objectType: t.FlowType,
indexType: t.FlowType,
): t.IndexedAccessType {
return builder("IndexedAccessType", ...arguments);
}
export function jsxAttribute(
name: t.JSXIdentifier | t.JSXNamespacedName,
value?:
| t.JSXElement
| t.JSXFragment
| t.StringLiteral
| t.JSXExpressionContainer
| null,
): t.JSXAttribute {
return builder("JSXAttribute", ...arguments);
}
export { jsxAttribute as jSXAttribute };
export function jsxClosingElement(
name: t.JSXIdentifier | t.JSXMemberExpression | t.JSXNamespacedName,
): t.JSXClosingElement {
return builder("JSXClosingElement", ...arguments);
}
export { jsxClosingElement as jSXClosingElement };
export function jsxElement(
openingElement: t.JSXOpeningElement,
closingElement: t.JSXClosingElement | null | undefined,
children: Array<
| t.JSXText
| t.JSXExpressionContainer
| t.JSXSpreadChild
| t.JSXElement
| t.JSXFragment
>,
selfClosing?: boolean | null,
): t.JSXElement {
return builder("JSXElement", ...arguments);
}
export { jsxElement as jSXElement };
export function jsxEmptyExpression(): t.JSXEmptyExpression {
return builder("JSXEmptyExpression", ...arguments);
}
export { jsxEmptyExpression as jSXEmptyExpression };
export function jsxExpressionContainer(
expression: t.Expression | t.JSXEmptyExpression,
): t.JSXExpressionContainer {
return builder("JSXExpressionContainer", ...arguments);
}
export { jsxExpressionContainer as jSXExpressionContainer };
export function jsxSpreadChild(expression: t.Expression): t.JSXSpreadChild {
return builder("JSXSpreadChild", ...arguments);
}
export { jsxSpreadChild as jSXSpreadChild };
export function jsxIdentifier(name: string): t.JSXIdentifier {
return builder("JSXIdentifier", ...arguments);
}
export { jsxIdentifier as jSXIdentifier };
export function jsxMemberExpression(
object: t.JSXMemberExpression | t.JSXIdentifier,
property: t.JSXIdentifier,
): t.JSXMemberExpression {
return builder("JSXMemberExpression", ...arguments);
}
export { jsxMemberExpression as jSXMemberExpression };
export function jsxNamespacedName(
namespace: t.JSXIdentifier,
name: t.JSXIdentifier,
): t.JSXNamespacedName {
return builder("JSXNamespacedName", ...arguments);
}
export { jsxNamespacedName as jSXNamespacedName };
export function jsxOpeningElement(
name: t.JSXIdentifier | t.JSXMemberExpression | t.JSXNamespacedName,
attributes: Array<t.JSXAttribute | t.JSXSpreadAttribute>,
selfClosing?: boolean,
): t.JSXOpeningElement {
return builder("JSXOpeningElement", ...arguments);
}
export { jsxOpeningElement as jSXOpeningElement };
export function jsxSpreadAttribute(
argument: t.Expression,
): t.JSXSpreadAttribute {
return builder("JSXSpreadAttribute", ...arguments);
}
export { jsxSpreadAttribute as jSXSpreadAttribute };
export function jsxText(value: string): t.JSXText {
return builder("JSXText", ...arguments);
}
export { jsxText as jSXText };
export function jsxFragment(
openingFragment: t.JSXOpeningFragment,
closingFragment: t.JSXClosingFragment,
children: Array<
| t.JSXText
| t.JSXExpressionContainer
| t.JSXSpreadChild
| t.JSXElement
| t.JSXFragment
>,
): t.JSXFragment {
return builder("JSXFragment", ...arguments);
}
export { jsxFragment as jSXFragment };
export function jsxOpeningFragment(): t.JSXOpeningFragment {
return builder("JSXOpeningFragment", ...arguments);
}
export { jsxOpeningFragment as jSXOpeningFragment };
export function jsxClosingFragment(): t.JSXClosingFragment {
return builder("JSXClosingFragment", ...arguments);
}
export { jsxClosingFragment as jSXClosingFragment };
export function noop(): t.Noop {
return builder("Noop", ...arguments);
}
export function placeholder(
expectedNode:
| "Identifier"
| "StringLiteral"
| "Expression"
| "Statement"
| "Declaration"
| "BlockStatement"
| "ClassBody"
| "Pattern",
name: t.Identifier,
): t.Placeholder {
return builder("Placeholder", ...arguments);
}
export function v8IntrinsicIdentifier(name: string): t.V8IntrinsicIdentifier {
return builder("V8IntrinsicIdentifier", ...arguments);
}
export function argumentPlaceholder(): t.ArgumentPlaceholder {
return builder("ArgumentPlaceholder", ...arguments);
}
export function bindExpression(
object: t.Expression,
callee: t.Expression,
): t.BindExpression {
return builder("BindExpression", ...arguments);
}
export function classProperty(
key: t.Identifier | t.StringLiteral | t.NumericLiteral | t.Expression,
value?: t.Expression | null,
typeAnnotation?: t.TypeAnnotation | t.TSTypeAnnotation | t.Noop | null,