UNPKG

114 kBTypeScriptView Raw
1export interface Comment {
2 value: string;
3 start: number;
4 end: number;
5 loc: SourceLocation;
6}
7
8export interface CommentBlock extends Comment {
9 type: "CommentBlock";
10}
11
12export interface CommentLine extends Comment {
13 type: "CommentLine";
14}
15
16export interface SourceLocation {
17 start: {
18 line: number;
19 column: number;
20 };
21
22 end: {
23 line: number;
24 column: number;
25 };
26}
27
28export interface Node {
29 type: string;
30 leadingComments?: Comment[] | undefined;
31 innerComments?: Comment[] | undefined;
32 trailingComments?: Comment[] | undefined;
33 start: number;
34 end: number;
35 loc: SourceLocation;
36}
37
38export interface ArrayExpression extends Node {
39 type: "ArrayExpression";
40 elements: Array<null | Expression | SpreadElement>;
41}
42
43export interface AssignmentExpression extends Node {
44 type: "AssignmentExpression";
45 operator: "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=";
46 left: LVal;
47 right: Expression;
48}
49
50export interface BinaryExpression extends Node {
51 type: "BinaryExpression";
52 operator:
53 | "+"
54 | "-"
55 | "/"
56 | "%"
57 | "*"
58 | "**"
59 | "&"
60 | "|"
61 | ">>"
62 | ">>>"
63 | "<<"
64 | "^"
65 | "=="
66 | "==="
67 | "!="
68 | "!=="
69 | "in"
70 | "instanceof"
71 | ">"
72 | "<"
73 | ">="
74 | "<=";
75 left: Expression;
76 right: Expression;
77}
78
79export interface Directive extends Node {
80 type: "Directive";
81 value: DirectiveLiteral;
82}
83
84export interface DirectiveLiteral extends Node {
85 type: "DirectiveLiteral";
86 value: string;
87}
88
89export interface BlockStatement extends Node {
90 type: "BlockStatement";
91 directives?: Directive[] | undefined;
92 body: Statement[];
93}
94
95export interface BreakStatement extends Node {
96 type: "BreakStatement";
97 label: Identifier;
98}
99
100export interface CallExpression extends Node {
101 type: "CallExpression";
102 callee: Expression | Super;
103 arguments: Array<Expression | SpreadElement>;
104}
105
106export interface CatchClause extends Node {
107 type: "CatchClause";
108 param: Identifier;
109 body: BlockStatement;
110}
111
112export interface ConditionalExpression extends Node {
113 type: "ConditionalExpression";
114 test: Expression;
115 consequent: Expression;
116 alternate: Expression;
117}
118
119export interface ContinueStatement extends Node {
120 type: "ContinueStatement";
121 label: Identifier;
122}
123
124export interface DebuggerStatement extends Node {
125 type: "DebuggerStatement";
126}
127
128export interface DoWhileStatement extends Node {
129 type: "DoWhileStatement";
130 test: Expression;
131 body: Statement;
132}
133
134export interface EmptyStatement extends Node {
135 type: "EmptyStatement";
136}
137
138export interface ExpressionStatement extends Node {
139 type: "ExpressionStatement";
140 expression: Expression;
141}
142
143export interface File extends Node {
144 type: "File";
145 program: Program;
146 comments: Comment[];
147 tokens: any[];
148}
149
150export interface ForInStatement extends Node {
151 type: "ForInStatement";
152 left: VariableDeclaration | LVal;
153 right: Expression;
154 body: Statement;
155}
156
157export interface ForStatement extends Node {
158 type: "ForStatement";
159 init: VariableDeclaration | Expression;
160 test: Expression;
161 update: Expression;
162 body: Statement;
163}
164
165export interface FunctionDeclaration extends Node {
166 type: "FunctionDeclaration";
167 id: Identifier;
168 params: LVal[];
169 body: BlockStatement;
170 generator: boolean;
171 async: boolean;
172 returnType?: TypeAnnotation | undefined;
173 typeParameters?: TypeParameterDeclaration | undefined;
174}
175
176export interface FunctionExpression extends Node {
177 type: "FunctionExpression";
178 id: Identifier;
179 params: LVal[];
180 body: BlockStatement;
181 generator: boolean;
182 async: boolean;
183 returnType?: TypeAnnotation | undefined;
184 typeParameters?: TypeParameterDeclaration | undefined;
185}
186
187export interface Identifier extends Node {
188 type: "Identifier";
189 name: string;
190 typeAnnotation?: TypeAnnotation | undefined;
191}
192
193export interface IfStatement extends Node {
194 type: "IfStatement";
195 test: Expression;
196 consequent: Statement;
197 alternate: Statement;
198}
199
200export interface LabeledStatement extends Node {
201 type: "LabeledStatement";
202 label: Identifier;
203 body: Statement;
204}
205
206export interface StringLiteral extends Node {
207 type: "StringLiteral";
208 value: string;
209}
210
211export interface NumericLiteral extends Node {
212 type: "NumericLiteral";
213 value: number;
214}
215
216export interface NullLiteral extends Node {
217 type: "NullLiteral";
218}
219
220export interface BooleanLiteral extends Node {
221 type: "BooleanLiteral";
222 value: boolean;
223}
224
225export interface RegExpLiteral extends Node {
226 type: "RegExpLiteral";
227 pattern: string;
228 flags?: string | undefined;
229}
230
231export interface LogicalExpression extends Node {
232 type: "LogicalExpression";
233 operator: "||" | "&&";
234 left: Expression;
235 right: Expression;
236}
237
238export interface MemberExpression extends Node {
239 type: "MemberExpression";
240 object: Expression | Super;
241 property: Expression;
242 computed: boolean;
243}
244
245export interface NewExpression extends Node {
246 type: "NewExpression";
247 callee: Expression | Super;
248 arguments: Array<Expression | SpreadElement>;
249}
250
251export interface Program extends Node {
252 type: "Program";
253 sourceType: "script" | "module";
254 directives?: Directive[] | undefined;
255 body: Array<Statement | ModuleDeclaration>;
256}
257
258export interface ObjectExpression extends Node {
259 type: "ObjectExpression";
260 properties: Array<ObjectProperty | ObjectMethod | SpreadProperty>;
261}
262
263export interface ObjectMethod extends Node {
264 type: "ObjectMethod";
265 key: Expression;
266 kind: "get" | "set" | "method";
267 shorthand: boolean;
268 computed: boolean;
269 value: Expression;
270 decorators?: Decorator[] | undefined;
271 id: Identifier;
272 params: LVal[];
273 body: BlockStatement;
274 generator: boolean;
275 async: boolean;
276 returnType?: TypeAnnotation | undefined;
277 typeParameters?: TypeParameterDeclaration | undefined;
278}
279
280export interface ObjectProperty extends Node {
281 type: "ObjectProperty";
282 key: Expression;
283 computed: boolean;
284 value: Expression;
285 decorators?: Decorator[] | undefined;
286 shorthand: boolean;
287}
288
289export interface RestElement extends Node {
290 type: "RestElement";
291 argument: LVal;
292 typeAnnotation?: TypeAnnotation | undefined;
293}
294
295export interface ReturnStatement extends Node {
296 type: "ReturnStatement";
297 argument: Expression;
298}
299
300export interface SequenceExpression extends Node {
301 type: "SequenceExpression";
302 expressions: Expression[];
303}
304
305export interface SwitchCase extends Node {
306 type: "SwitchCase";
307 test: Expression;
308 consequent: Statement[];
309}
310
311export interface SwitchStatement extends Node {
312 type: "SwitchStatement";
313 discriminant: Expression;
314 cases: SwitchCase[];
315}
316
317export interface ThisExpression extends Node {
318 type: "ThisExpression";
319}
320
321export interface ThrowStatement extends Node {
322 type: "ThrowStatement";
323 argument: Expression;
324}
325
326export interface TryStatement extends Node {
327 type: "TryStatement";
328 block: BlockStatement;
329 handler: CatchClause;
330 finalizer: BlockStatement;
331}
332
333export interface UnaryExpression extends Node {
334 type: "UnaryExpression";
335 operator: "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
336 prefix: boolean;
337 argument: Expression;
338}
339
340export interface UpdateExpression extends Node {
341 type: "UpdateExpression";
342 operator: "++" | "--";
343 prefix: boolean;
344 argument: Expression;
345}
346
347export interface VariableDeclaration extends Node {
348 type: "VariableDeclaration";
349 declarations: VariableDeclarator[];
350 kind: "var" | "let" | "const";
351}
352
353export interface VariableDeclarator extends Node {
354 type: "VariableDeclarator";
355 id: LVal;
356 init: Expression;
357}
358
359export interface WhileStatement extends Node {
360 type: "WhileStatement";
361 test: Expression;
362 body: Statement;
363}
364
365export interface WithStatement extends Node {
366 type: "WithStatement";
367 object: Expression;
368 body: BlockStatement | Statement;
369}
370
371export interface AssignmentPattern extends Node {
372 type: "AssignmentPattern";
373 left: Identifier;
374 right: Expression;
375}
376
377export interface ArrayPattern extends Node {
378 type: "ArrayPattern";
379 elements: Expression[];
380 typeAnnotation?: TypeAnnotation | undefined;
381}
382
383export interface ArrowFunctionExpression extends Node {
384 type: "ArrowFunctionExpression";
385 id: Identifier;
386 params: LVal[];
387 body: BlockStatement | Expression;
388 generator: boolean;
389 async: boolean;
390 expression: boolean;
391 returnType?: TypeAnnotation | undefined;
392 typeParameters?: TypeParameterDeclaration | undefined;
393}
394
395export interface ClassBody extends Node {
396 type: "ClassBody";
397 body: Array<ClassMethod | ClassProperty>;
398}
399
400export interface ClassDeclaration extends Node {
401 type: "ClassDeclaration";
402 id: Identifier;
403 superClass: Expression;
404 body: ClassBody;
405 decorators?: Decorator[] | undefined;
406 implements?: ClassImplements[] | undefined;
407 mixins?: any[] | undefined;
408 typeParameters?: TypeParameterDeclaration | undefined;
409 superTypeParameters?: TypeParameterInstantiation | undefined;
410}
411
412export interface ClassExpression extends Node {
413 type: "ClassExpression";
414 id: Identifier;
415 superClass: Expression;
416 body: ClassBody;
417 decorators?: Decorator[] | undefined;
418 implements?: ClassImplements[] | undefined;
419 mixins?: any[] | undefined;
420 typeParameters?: TypeParameterDeclaration | undefined;
421 superTypeParameters?: TypeParameterInstantiation | undefined;
422}
423
424export interface ExportAllDeclaration extends Node {
425 type: "ExportAllDeclaration";
426 source: StringLiteral;
427}
428
429export interface ExportDefaultDeclaration extends Node {
430 type: "ExportDefaultDeclaration";
431 declaration: Declaration | Expression;
432}
433
434export interface ExportNamedDeclaration extends Node {
435 type: "ExportNamedDeclaration";
436 declaration: Declaration;
437 specifiers: ExportSpecifier[];
438 source: StringLiteral | null;
439}
440
441export interface ExportSpecifier extends Node {
442 type: "ExportSpecifier";
443 local: Identifier;
444 imported: Identifier;
445 exported: Identifier;
446}
447
448export interface ForOfStatement extends Node {
449 type: "ForOfStatement";
450 left: VariableDeclaration | LVal;
451 right: Expression;
452 body: Statement;
453}
454
455export interface ImportDeclaration extends Node {
456 type: "ImportDeclaration";
457 specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>;
458 source: StringLiteral;
459}
460
461export interface ImportDefaultSpecifier extends Node {
462 type: "ImportDefaultSpecifier";
463 local: Identifier;
464}
465
466export interface ImportNamespaceSpecifier extends Node {
467 type: "ImportNamespaceSpecifier";
468 local: Identifier;
469}
470
471export interface ImportSpecifier extends Node {
472 type: "ImportSpecifier";
473 local: Identifier;
474 imported: Identifier;
475}
476
477export interface MetaProperty extends Node {
478 type: "MetaProperty";
479 meta: Identifier;
480 property: Identifier;
481}
482
483export interface ClassMethod extends Node {
484 type: "ClassMethod";
485 key: Expression;
486 value?: FunctionExpression | undefined;
487 kind: "constructor" | "method" | "get" | "set";
488 computed: boolean;
489 static: boolean;
490 decorators?: Decorator[] | undefined;
491 id: Identifier;
492 params: LVal[];
493 body: BlockStatement;
494 generator: boolean;
495 async: boolean;
496 expression: boolean;
497 returnType?: TypeAnnotation | undefined;
498 typeParameters?: TypeParameterDeclaration | undefined;
499}
500
501// See: https://github.com/babel/babel/blob/master/doc/ast/spec.md#objectpattern
502export interface AssignmentProperty extends Node {
503 type: "ObjectProperty";
504 key: Expression;
505 computed: boolean;
506 value: Pattern;
507 decorators?: Decorator[] | undefined;
508 shorthand: boolean;
509}
510
511export interface ObjectPattern extends Node {
512 type: "ObjectPattern";
513 properties: Array<AssignmentProperty | RestProperty>;
514 typeAnnotation?: TypeAnnotation | undefined;
515}
516
517export interface SpreadElement extends Node {
518 type: "SpreadElement";
519 argument: Expression;
520}
521
522export interface Super extends Node {
523 type: "Super";
524}
525
526export interface TaggedTemplateExpression extends Node {
527 type: "TaggedTemplateExpression";
528 tag: Expression;
529 quasi: TemplateLiteral;
530}
531
532export interface TemplateElement extends Node {
533 type: "TemplateElement";
534 tail: boolean;
535 value: {
536 cooked: string;
537 raw: string;
538 };
539}
540
541export interface TemplateLiteral extends Node {
542 type: "TemplateLiteral";
543 quasis: TemplateElement[];
544 expressions: Expression[];
545}
546
547export interface YieldExpression extends Node {
548 type: "YieldExpression";
549 argument: Expression;
550 delegate: boolean;
551}
552
553export interface AnyTypeAnnotation extends Node {
554 type: "AnyTypeAnnotation";
555}
556
557export interface ArrayTypeAnnotation extends Node {
558 type: "ArrayTypeAnnotation";
559 elementType: FlowTypeAnnotation;
560}
561
562export interface BooleanTypeAnnotation extends Node {
563 type: "BooleanTypeAnnotation";
564}
565
566export interface BooleanLiteralTypeAnnotation extends Node {
567 type: "BooleanLiteralTypeAnnotation";
568}
569
570export interface NullLiteralTypeAnnotation extends Node {
571 type: "NullLiteralTypeAnnotation";
572}
573
574export interface ClassImplements extends Node {
575 type: "ClassImplements";
576 id: Identifier;
577 typeParameters: TypeParameterInstantiation;
578}
579
580export interface ClassProperty extends Node {
581 type: "ClassProperty";
582 key: Identifier;
583 value: Expression;
584 decorators?: Decorator[] | undefined;
585 typeAnnotation?: TypeAnnotation | undefined;
586}
587
588export interface DeclareClass extends Node {
589 type: "DeclareClass";
590 id: Identifier;
591 typeParameters: TypeParameterDeclaration;
592 extends: InterfaceExtends[];
593 body: ObjectTypeAnnotation;
594}
595
596export interface DeclareFunction extends Node {
597 type: "DeclareFunction";
598 id: Identifier;
599}
600
601export interface DeclareInterface extends Node {
602 type: "DeclareInterface";
603 id: Identifier;
604 typeParameters: TypeParameterDeclaration;
605 extends: InterfaceExtends[];
606 body: ObjectTypeAnnotation;
607}
608
609export interface DeclareModule extends Node {
610 type: "DeclareModule";
611 id: StringLiteral | Identifier;
612 body: BlockStatement;
613}
614
615export interface DeclareTypeAlias extends Node {
616 type: "DeclareTypeAlias";
617 id: Identifier;
618 typeParameters: TypeParameterDeclaration;
619 right: FlowTypeAnnotation;
620}
621
622export interface DeclareVariable extends Node {
623 type: "DeclareVariable";
624 id: Identifier;
625}
626
627export interface ExistentialTypeParam extends Node {
628 type: "ExistentialTypeParam";
629}
630
631export interface FunctionTypeAnnotation extends Node {
632 type: "FunctionTypeAnnotation";
633 typeParameters: TypeParameterDeclaration;
634 params: FunctionTypeParam[];
635 rest: FunctionTypeParam;
636 returnType: FlowTypeAnnotation;
637}
638
639export interface FunctionTypeParam extends Node {
640 type: "FunctionTypeParam";
641 name: Identifier;
642 typeAnnotation: FlowTypeAnnotation;
643}
644
645export interface GenericTypeAnnotation extends Node {
646 type: "GenericTypeAnnotation";
647 id: Identifier;
648 typeParameters: TypeParameterInstantiation;
649}
650
651export interface InterfaceExtends extends Node {
652 type: "InterfaceExtends";
653 id: Identifier;
654 typeParameters: TypeParameterInstantiation;
655}
656
657export interface InterfaceDeclaration extends Node {
658 type: "InterfaceDeclaration";
659 id: Identifier;
660 typeParameters: TypeParameterDeclaration;
661 extends: InterfaceExtends[];
662 mixins?: any[] | undefined;
663 body: ObjectTypeAnnotation;
664}
665
666export interface IntersectionTypeAnnotation extends Node {
667 type: "IntersectionTypeAnnotation";
668 types: FlowTypeAnnotation[];
669}
670
671export interface MixedTypeAnnotation extends Node {
672 type: "MixedTypeAnnotation";
673}
674
675export interface NullableTypeAnnotation extends Node {
676 type: "NullableTypeAnnotation";
677 typeAnnotation: FlowTypeAnnotation;
678}
679
680export interface NumericLiteralTypeAnnotation extends Node {
681 type: "NumericLiteralTypeAnnotation";
682}
683
684export interface NumberTypeAnnotation extends Node {
685 type: "NumberTypeAnnotation";
686}
687
688export interface StringLiteralTypeAnnotation extends Node {
689 type: "StringLiteralTypeAnnotation";
690}
691
692export interface StringTypeAnnotation extends Node {
693 type: "StringTypeAnnotation";
694}
695
696export interface ThisTypeAnnotation extends Node {
697 type: "ThisTypeAnnotation";
698}
699
700export interface TupleTypeAnnotation extends Node {
701 type: "TupleTypeAnnotation";
702 types: FlowTypeAnnotation[];
703}
704
705export interface TypeofTypeAnnotation extends Node {
706 type: "TypeofTypeAnnotation";
707 argument: FlowTypeAnnotation;
708}
709
710export interface TypeAlias extends Node {
711 type: "TypeAlias";
712 id: Identifier;
713 typeParameters: TypeParameterDeclaration;
714 right: FlowTypeAnnotation;
715}
716
717export interface TypeAnnotation extends Node {
718 type: "TypeAnnotation";
719 typeAnnotation: FlowTypeAnnotation;
720}
721
722export interface TypeCastExpression extends Node {
723 type: "TypeCastExpression";
724 expression: Expression;
725 typeAnnotation: FlowTypeAnnotation;
726}
727
728export interface TypeParameter extends Node {
729 type: "TypeParameterDeclaration";
730 bound: TypeAnnotation | null;
731 default: Flow | null;
732 name: string | null;
733}
734
735export interface TypeParameterDeclaration extends Node {
736 type: "TypeParameterDeclaration";
737 params: Identifier[];
738}
739
740export interface TypeParameterInstantiation extends Node {
741 type: "TypeParameterInstantiation";
742 params: FlowTypeAnnotation[];
743}
744
745export interface ObjectTypeAnnotation extends Node {
746 type: "ObjectTypeAnnotation";
747 properties: ObjectTypeProperty[];
748 indexers: ObjectTypeIndexer[];
749 callProperties: ObjectTypeCallProperty[];
750}
751
752export interface ObjectTypeCallProperty extends Node {
753 type: "ObjectTypeCallProperty";
754 value: FlowTypeAnnotation;
755}
756
757export interface ObjectTypeIndexer extends Node {
758 type: "ObjectTypeIndexer";
759 id: Expression;
760 key: FlowTypeAnnotation;
761 value: FlowTypeAnnotation;
762}
763
764export interface ObjectTypeProperty extends Node {
765 type: "ObjectTypeProperty";
766 key: Expression;
767 value: FlowTypeAnnotation;
768}
769
770export interface QualifiedTypeIdentifier extends Node {
771 type: "QualifiedTypeIdentifier";
772 id: Identifier;
773 qualification: Identifier | QualifiedTypeIdentifier;
774}
775
776export interface UnionTypeAnnotation extends Node {
777 type: "UnionTypeAnnotation";
778 types: FlowTypeAnnotation[];
779}
780
781export interface VoidTypeAnnotation extends Node {
782 type: "VoidTypeAnnotation";
783}
784
785export interface JSXAttribute extends Node {
786 type: "JSXAttribute";
787 name: JSXIdentifier | JSXNamespacedName;
788 value: JSXElement | StringLiteral | JSXExpressionContainer | null;
789}
790
791export interface JSXClosingElement extends Node {
792 type: "JSXClosingElement";
793 name: JSXIdentifier | JSXMemberExpression;
794}
795
796export interface JSXElement extends Node {
797 type: "JSXElement";
798 openingElement: JSXOpeningElement;
799 closingElement: JSXClosingElement;
800 children: Array<JSXElement | JSXExpressionContainer | JSXText>;
801 selfClosing?: boolean | undefined;
802}
803
804export interface JSXEmptyExpression extends Node {
805 type: "JSXEmptyExpression";
806}
807
808export interface JSXExpressionContainer extends Node {
809 type: "JSXExpressionContainer";
810 expression: Expression;
811}
812
813export interface JSXIdentifier extends Node {
814 type: "JSXIdentifier";
815 name: string;
816}
817
818export interface JSXMemberExpression extends Node {
819 type: "JSXMemberExpression";
820 object: JSXMemberExpression | JSXIdentifier;
821 property: JSXIdentifier;
822}
823
824export interface JSXNamespacedName extends Node {
825 type: "JSXNamespacedName";
826 namespace: JSXIdentifier;
827 name: JSXIdentifier;
828}
829
830export interface JSXOpeningElement extends Node {
831 type: "JSXOpeningElement";
832 name: JSXIdentifier | JSXMemberExpression;
833 selfClosing: boolean;
834 attributes: JSXAttribute[];
835}
836
837export interface JSXSpreadAttribute extends Node {
838 type: "JSXSpreadAttribute";
839 argument: Expression;
840}
841
842export interface JSXText extends Node {
843 type: "JSXText";
844 value: string;
845}
846
847export interface Noop extends Node {
848 type: "Noop";
849}
850
851export interface ParenthesizedExpression extends Node {
852 type: "ParenthesizedExpression";
853 expression: Expression;
854}
855
856export interface AwaitExpression extends Node {
857 type: "AwaitExpression";
858 argument: Expression;
859}
860
861export interface BindExpression extends Node {
862 type: "BindExpression";
863 object: Expression;
864 callee: Expression;
865}
866
867export interface Decorator extends Node {
868 type: "Decorator";
869 expression: Expression;
870}
871
872export interface DoExpression extends Node {
873 type: "DoExpression";
874 body: BlockStatement;
875}
876
877export interface ExportDefaultSpecifier extends Node {
878 type: "ExportDefaultSpecifier";
879 exported: Identifier;
880}
881
882export interface ExportNamespaceSpecifier extends Node {
883 type: "ExportNamespaceSpecifier";
884 exported: Identifier;
885}
886
887export interface RestProperty extends Node {
888 type: "RestProperty";
889 argument: LVal;
890}
891
892export interface SpreadProperty extends Node {
893 type: "SpreadProperty";
894 argument: Expression;
895}
896
897export interface TSAnyKeyword extends Node {
898 type: "TSAnyKeyword";
899}
900
901export interface TSArrayType extends Node {
902 type: "TSArrayType";
903 elementType: TSType;
904}
905
906export interface TSAsExpression extends Node {
907 type: "TSAsExpression";
908 expression: Expression;
909 typeAnnotation: TSType;
910}
911
912export interface TSBooleanKeyword extends Node {
913 type: "TSBooleanKeyword";
914}
915
916export interface TSCallSignatureDeclaration extends Node {
917 type: "TSCallSignatureDeclaration";
918 typeParameters: TypeParameterDeclaration | null;
919 parameters: Array<Identifier | RestElement> | null;
920 typeAnnotation: TSTypeAnnotation | null;
921}
922
923export interface TSConstructSignatureDeclaration extends Node {
924 type: "TSConstructSignatureDeclaration";
925 typeParameters: TypeParameterDeclaration | null;
926 parameters: Array<Identifier | RestElement> | null;
927 typeAnnotation: TSTypeAnnotation | null;
928}
929
930export interface TSConstructorType extends Node {
931 type: "TSConstructorType";
932 typeParameters: TypeParameterDeclaration | null;
933 typeAnnotation: TSTypeAnnotation | null;
934 parameters: Array<Identifier | RestElement> | null;
935}
936
937export interface TSDeclareFunction extends Node {
938 type: "TSDeclareFunction";
939 id: Identifier | null;
940 typeParameters: TypeParameterDeclaration | Noop | null;
941 params: LVal[];
942 returnType: TypeAnnotation | TSTypeAnnotation | Noop | null;
943 async: boolean;
944 declare: boolean | null;
945 generator: boolean;
946}
947
948export interface TSDeclareMethod extends Node {
949 type: "TSDeclareMethod";
950 decorators: Decorator[] | null;
951 key: Expression;
952 typeParameters: TypeParameterDeclaration | Noop | null;
953 params: LVal[];
954 returnType: TypeAnnotation | TSTypeAnnotation | Noop | null;
955 abstract: boolean | null;
956 access: "public" | "private" | "protected" | null;
957 accessibility: "public" | "private" | "protected" | null;
958 async: boolean;
959 computed: boolean;
960 generator: boolean;
961 kind: "get" | "set" | "method" | "constructor";
962 optional: boolean | null;
963 static: boolean | null;
964}
965
966export interface TSEnumDeclaration extends Node {
967 type: "TSEnumDeclaration";
968 id: Identifier;
969 members: TSEnumMember[];
970 const: boolean | null;
971 declare: boolean | null;
972 initializer: Expression | null;
973}
974
975export interface TSEnumMember extends Node {
976 type: "TSEnumMember";
977 id: Identifier | StringLiteral;
978 initializer: Expression | null;
979}
980
981export interface TSExportAssignment extends Node {
982 type: "TSExportAssignment";
983 expression: Expression;
984}
985
986export interface TSExpressionWithTypeArguments extends Node {
987 type: "TSExpressionWithTypeArguments";
988 expression: TSEntityName;
989 typeParameters: TypeParameterInstantiation | null;
990}
991
992export interface TSExternalModuleReference extends Node {
993 type: "TSExternalModuleReference";
994 expression: StringLiteral;
995}
996
997export interface TSFunctionType extends Node {
998 type: "TSFunctionType";
999 typeParameters: TypeParameterDeclaration | null;
1000 typeAnnotation: TSTypeAnnotation | null;
1001 parameters: Array<Identifier | RestElement> | null;
1002}
1003
1004export interface TSImportEqualsDeclaration extends Node {
1005 type: "TSImportEqualsDeclaration";
1006 id: Identifier;
1007 moduleReference: TSEntityName | TSExternalModuleReference;
1008 isExport: boolean | null;
1009}
1010
1011export interface TSIndexSignature extends Node {
1012 type: "TSIndexSignature";
1013 parameters: Identifier[];
1014 typeAnnotation: TSTypeAnnotation | null;
1015 readonly: boolean | null;
1016}
1017
1018export interface TSIndexedAccessType extends Node {
1019 type: "TSIndexedAccessType";
1020 objectType: TSType;
1021 indexType: TSType;
1022}
1023
1024export interface TSInterfaceBody extends Node {
1025 type: "TSInterfaceBody";
1026 body: TSTypeElement[];
1027}
1028
1029export interface TSInterfaceDeclaration extends Node {
1030 type: "TSInterfaceDeclaration";
1031 id: Identifier;
1032 typeParameters: TypeParameterDeclaration | null;
1033 extends: TSExpressionWithTypeArguments[] | null;
1034 body: TSInterfaceBody;
1035 declare: boolean | null;
1036}
1037
1038export interface TSIntersectionType extends Node {
1039 type: "TSIntersectionType";
1040 types: TSType[];
1041}
1042
1043export interface TSLiteralType extends Node {
1044 type: "TSLiteralType";
1045 literal: NumericLiteral | StringLiteral | BooleanLiteral;
1046}
1047
1048export interface TSMappedType extends Node {
1049 type: "TSMappedType";
1050 typeParameter: TypeParameter;
1051 typeAnnotation: TSType | null;
1052 optional: boolean | null;
1053 readonly: boolean | null;
1054}
1055
1056export interface TSMethodSignature extends Node {
1057 type: "TSMethodSignature";
1058 key: Expression;
1059 typeParameters: TypeParameterDeclaration | null;
1060 parameters: Array<Identifier | RestElement> | null;
1061 typeAnnotation: TSTypeAnnotation | null;
1062 computed: boolean | null;
1063 optional: boolean | null;
1064}
1065
1066export interface TSModuleBlock extends Node {
1067 type: "TSModuleBlock";
1068 body: Statement[];
1069}
1070
1071export interface TSModuleDeclaration extends Node {
1072 type: "TSModuleDeclaration";
1073 id: Identifier | StringLiteral;
1074 body: TSModuleBlock | TSModuleDeclaration;
1075 declare: boolean | null;
1076 global: boolean | null;
1077}
1078
1079export interface TSNamespaceExportDeclaration extends Node {
1080 type: "TSNamespaceExportDeclaration";
1081 id: Identifier;
1082}
1083
1084export interface TSNeverKeyword extends Node {
1085 type: "TSNeverKeyword";
1086}
1087
1088export interface TSNonNullExpression extends Node {
1089 type: "TSNonNullExpression";
1090 expression: Expression;
1091}
1092
1093export interface TSNullKeyword extends Node {
1094 type: "TSNullKeyword";
1095}
1096
1097export interface TSNumberKeyword extends Node {
1098 type: "TSNumberKeyword";
1099}
1100
1101export interface TSObjectKeyword extends Node {
1102 type: "TSObjectKeyword";
1103}
1104
1105export interface TSParameterProperty extends Node {
1106 type: "TSParameterProperty";
1107 parameter: Identifier | AssignmentPattern;
1108 accessibility: "public" | "private" | "protected" | null;
1109 readonly: boolean | null;
1110}
1111
1112export interface TSParenthesizedType extends Node {
1113 type: "TSParenthesizedType";
1114 typeAnnotation: TSType;
1115}
1116
1117export interface TSPropertySignature extends Node {
1118 type: "TSPropertySignature";
1119 key: Expression;
1120 typeAnnotation: TSTypeAnnotation | null;
1121 initializer: Expression | null;
1122 computed: boolean | null;
1123 optional: boolean | null;
1124 readonly: boolean | null;
1125}
1126
1127export interface TSQualifiedName extends Node {
1128 type: "TSQualifiedName";
1129 left: TSEntityName;
1130 right: Identifier;
1131}
1132
1133export interface TSStringKeyword extends Node {
1134 type: "TSStringKeyword";
1135}
1136
1137export interface TSSymbolKeyword extends Node {
1138 type: "TSSymbolKeyword";
1139}
1140
1141export interface TSThisType extends Node {
1142 type: "TSThisType";
1143}
1144
1145export interface TSTupleType extends Node {
1146 type: "TSTupleType";
1147 elementTypes: TSType[];
1148}
1149
1150export interface TSTypeAliasDeclaration extends Node {
1151 type: "TSTypeAliasDeclaration";
1152 id: Identifier;
1153 typeParameters: TypeParameterDeclaration | null;
1154 typeAnnotation: TSType;
1155 declare: boolean | null;
1156}
1157
1158export interface TSTypeAnnotation extends Node {
1159 type: "TSTypeAnnotation";
1160 typeAnnotation: TSType;
1161}
1162
1163export interface TSTypeAssertion extends Node {
1164 type: "TSTypeAssertion";
1165 typeAnnotation: TSType;
1166 expression: Expression;
1167}
1168
1169export interface TSTypeLiteral extends Node {
1170 type: "TSTypeLiteral";
1171 members: TSTypeElement[];
1172}
1173
1174export interface TSTypeOperator extends Node {
1175 type: "TSTypeOperator";
1176 typeAnnotation: TSType;
1177 operator: string | null;
1178}
1179
1180export interface TSTypeParameter extends Node {
1181 type: "TSTypeParameter";
1182 constraint: TSType | null;
1183 default: TSType | null;
1184 name: string | null;
1185}
1186
1187export interface TSTypeParameterDeclaration extends Node {
1188 type: "TSTypeParameterDeclaration";
1189 params: TSTypeParameter[];
1190}
1191
1192export interface TSTypeParameterInstantiation extends Node {
1193 type: "TSTypeParameterInstantiation";
1194 params: TSType[];
1195}
1196
1197export interface TSTypePredicate extends Node {
1198 type: "TSTypePredicate";
1199 parameterName: Identifier | TSThisType;
1200 typeAnnotation: TSTypeAnnotation;
1201}
1202
1203export interface TSTypeQuery extends Node {
1204 type: "TSTypeQuery";
1205 exprName: TSEntityName;
1206}
1207
1208export interface TSTypeReference extends Node {
1209 type: "TSTypeReference";
1210 typeName: TSEntityName;
1211 typeParameters: TypeParameterInstantiation | null;
1212}
1213
1214export interface TSUndefinedKeyword extends Node {
1215 type: "TSUndefinedKeyword";
1216}
1217
1218export interface TSUnionType extends Node {
1219 type: "TSUnionType";
1220 types: TSType[];
1221}
1222
1223export interface TSVoidKeyword extends Node {
1224 type: "TSVoidKeyword";
1225}
1226
1227export type Expression =
1228 | ArrayExpression
1229 | AssignmentExpression
1230 | BinaryExpression
1231 | CallExpression
1232 | ConditionalExpression
1233 | FunctionExpression
1234 | Identifier
1235 | StringLiteral
1236 | NumericLiteral
1237 | BooleanLiteral
1238 | NullLiteral
1239 | RegExpLiteral
1240 | LogicalExpression
1241 | MemberExpression
1242 | NewExpression
1243 | ObjectExpression
1244 | SequenceExpression
1245 | ThisExpression
1246 | UnaryExpression
1247 | UpdateExpression
1248 | ArrowFunctionExpression
1249 | ClassExpression
1250 | MetaProperty
1251 | Super
1252 | TaggedTemplateExpression
1253 | TemplateLiteral
1254 | YieldExpression
1255 | TypeCastExpression
1256 | JSXElement
1257 | JSXEmptyExpression
1258 | JSXIdentifier
1259 | JSXMemberExpression
1260 | ParenthesizedExpression
1261 | AwaitExpression
1262 | BindExpression
1263 | DoExpression
1264 | TSAsExpression
1265 | TSNonNullExpression
1266 | TSTypeAssertion;
1267
1268export type Binary = BinaryExpression | LogicalExpression;
1269
1270export type Scopable =
1271 | BlockStatement
1272 | CatchClause
1273 | DoWhileStatement
1274 | ForInStatement
1275 | ForStatement
1276 | FunctionDeclaration
1277 | FunctionExpression
1278 | Program
1279 | ObjectMethod
1280 | SwitchStatement
1281 | WhileStatement
1282 | ArrowFunctionExpression
1283 | ClassDeclaration
1284 | ClassExpression
1285 | ForOfStatement
1286 | ClassMethod;
1287
1288export type BlockParent =
1289 | BlockStatement
1290 | DoWhileStatement
1291 | ForInStatement
1292 | ForStatement
1293 | FunctionDeclaration
1294 | FunctionExpression
1295 | Program
1296 | ObjectMethod
1297 | SwitchStatement
1298 | WhileStatement
1299 | ArrowFunctionExpression
1300 | ForOfStatement
1301 | ClassMethod;
1302
1303export type Block = BlockStatement | Program;
1304
1305export type Statement =
1306 | BlockStatement
1307 | BreakStatement
1308 | ContinueStatement
1309 | DebuggerStatement
1310 | DoWhileStatement
1311 | EmptyStatement
1312 | ExpressionStatement
1313 | ForInStatement
1314 | ForStatement
1315 | FunctionDeclaration
1316 | IfStatement
1317 | LabeledStatement
1318 | ReturnStatement
1319 | SwitchStatement
1320 | ThrowStatement
1321 | TryStatement
1322 | VariableDeclaration
1323 | WhileStatement
1324 | WithStatement
1325 | ClassDeclaration
1326 | ExportAllDeclaration
1327 | ExportDefaultDeclaration
1328 | ExportNamedDeclaration
1329 | ForOfStatement
1330 | ImportDeclaration
1331 | DeclareClass
1332 | DeclareFunction
1333 | DeclareInterface
1334 | DeclareModule
1335 | DeclareTypeAlias
1336 | DeclareVariable
1337 | InterfaceDeclaration
1338 | TypeAlias
1339 | TSDeclareFunction
1340 | TSEnumDeclaration
1341 | TSExportAssignment
1342 | TSImportEqualsDeclaration
1343 | TSInterfaceDeclaration
1344 | TSModuleDeclaration
1345 | TSNamespaceExportDeclaration
1346 | TSTypeAliasDeclaration;
1347
1348export type Terminatorless =
1349 | BreakStatement
1350 | ContinueStatement
1351 | ReturnStatement
1352 | ThrowStatement
1353 | YieldExpression
1354 | AwaitExpression;
1355export type CompletionStatement = BreakStatement | ContinueStatement | ReturnStatement | ThrowStatement;
1356export type Conditional = ConditionalExpression | IfStatement;
1357export type Loop = DoWhileStatement | ForInStatement | ForStatement | WhileStatement | ForOfStatement;
1358export type While = DoWhileStatement | WhileStatement;
1359export type ExpressionWrapper = ExpressionStatement | TypeCastExpression | ParenthesizedExpression;
1360export type For = ForInStatement | ForStatement | ForOfStatement;
1361export type ForXStatement = ForInStatement | ForOfStatement;
1362export type Function = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod;
1363export type FunctionParent =
1364 | FunctionDeclaration
1365 | FunctionExpression
1366 | Program
1367 | ObjectMethod
1368 | ArrowFunctionExpression
1369 | ClassMethod;
1370export type Pureish =
1371 | FunctionDeclaration
1372 | FunctionExpression
1373 | StringLiteral
1374 | NumericLiteral
1375 | BooleanLiteral
1376 | NullLiteral
1377 | ArrowFunctionExpression
1378 | ClassDeclaration
1379 | ClassExpression;
1380
1381export type Declaration =
1382 | FunctionDeclaration
1383 | VariableDeclaration
1384 | ClassDeclaration
1385 | ExportAllDeclaration
1386 | ExportDefaultDeclaration
1387 | ExportNamedDeclaration
1388 | ImportDeclaration
1389 | DeclareClass
1390 | DeclareFunction
1391 | DeclareInterface
1392 | DeclareModule
1393 | DeclareTypeAlias
1394 | DeclareVariable
1395 | InterfaceDeclaration
1396 | TypeAlias
1397 | TSDeclareFunction
1398 | TSEnumDeclaration
1399 | TSInterfaceDeclaration
1400 | TSModuleDeclaration
1401 | TSTypeAliasDeclaration;
1402
1403export type LVal =
1404 | Identifier
1405 | MemberExpression
1406 | RestElement
1407 | AssignmentPattern
1408 | ArrayPattern
1409 | ObjectPattern
1410 | TSParameterProperty;
1411export type Literal = StringLiteral | NumericLiteral | BooleanLiteral | NullLiteral | RegExpLiteral | TemplateLiteral;
1412export type Immutable =
1413 | StringLiteral
1414 | NumericLiteral
1415 | BooleanLiteral
1416 | NullLiteral
1417 | JSXAttribute
1418 | JSXClosingElement
1419 | JSXElement
1420 | JSXExpressionContainer
1421 | JSXOpeningElement;
1422export type UserWhitespacable =
1423 | ObjectMethod
1424 | ObjectProperty
1425 | ObjectTypeCallProperty
1426 | ObjectTypeIndexer
1427 | ObjectTypeProperty;
1428export type Method = ObjectMethod | ClassMethod;
1429export type ObjectMember = ObjectMethod | ObjectProperty;
1430export type Property = ObjectProperty | ClassProperty;
1431export type UnaryLike = UnaryExpression | SpreadElement | RestProperty | SpreadProperty;
1432export type Pattern = AssignmentPattern | ArrayPattern | ObjectPattern;
1433export type Class = ClassDeclaration | ClassExpression;
1434export type ModuleDeclaration =
1435 | ExportAllDeclaration
1436 | ExportDefaultDeclaration
1437 | ExportNamedDeclaration
1438 | ImportDeclaration;
1439export type ExportDeclaration = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration;
1440export type ModuleSpecifier =
1441 | ExportSpecifier
1442 | ImportDefaultSpecifier
1443 | ImportNamespaceSpecifier
1444 | ImportSpecifier
1445 | ExportDefaultSpecifier
1446 | ExportNamespaceSpecifier;
1447
1448export type Flow =
1449 | AnyTypeAnnotation
1450 | ArrayTypeAnnotation
1451 | BooleanTypeAnnotation
1452 | BooleanLiteralTypeAnnotation
1453 | ClassImplements
1454 | ClassProperty
1455 | DeclareClass
1456 | DeclareFunction
1457 | DeclareInterface
1458 | DeclareModule
1459 | DeclareTypeAlias
1460 | DeclareVariable
1461 | ExistentialTypeParam
1462 | FunctionTypeAnnotation
1463 | FunctionTypeParam
1464 | GenericTypeAnnotation
1465 | InterfaceExtends
1466 | InterfaceDeclaration
1467 | IntersectionTypeAnnotation
1468 | MixedTypeAnnotation
1469 | NullableTypeAnnotation
1470 | NumericLiteralTypeAnnotation
1471 | NumberTypeAnnotation
1472 | StringLiteralTypeAnnotation
1473 | StringTypeAnnotation
1474 | ThisTypeAnnotation
1475 | TupleTypeAnnotation
1476 | TypeofTypeAnnotation
1477 | TypeAlias
1478 | TypeAnnotation
1479 | TypeCastExpression
1480 | TypeParameterDeclaration
1481 | TypeParameterInstantiation
1482 | ObjectTypeAnnotation
1483 | ObjectTypeCallProperty
1484 | ObjectTypeIndexer
1485 | ObjectTypeProperty
1486 | QualifiedTypeIdentifier
1487 | UnionTypeAnnotation
1488 | VoidTypeAnnotation;
1489
1490export type FlowTypeAnnotation =
1491 | AnyTypeAnnotation
1492 | ArrayTypeAnnotation
1493 | BooleanTypeAnnotation
1494 | BooleanLiteralTypeAnnotation
1495 | FunctionTypeAnnotation
1496 | GenericTypeAnnotation
1497 | IntersectionTypeAnnotation
1498 | MixedTypeAnnotation
1499 | NullableTypeAnnotation
1500 | NumericLiteralTypeAnnotation
1501 | NumberTypeAnnotation
1502 | StringLiteralTypeAnnotation
1503 | StringTypeAnnotation
1504 | ThisTypeAnnotation
1505 | TupleTypeAnnotation
1506 | TypeofTypeAnnotation
1507 | TypeAnnotation
1508 | ObjectTypeAnnotation
1509 | UnionTypeAnnotation
1510 | VoidTypeAnnotation;
1511
1512export type FlowBaseAnnotation =
1513 | AnyTypeAnnotation
1514 | BooleanTypeAnnotation
1515 | MixedTypeAnnotation
1516 | NumberTypeAnnotation
1517 | StringTypeAnnotation
1518 | ThisTypeAnnotation
1519 | VoidTypeAnnotation;
1520export type FlowDeclaration =
1521 | DeclareClass
1522 | DeclareFunction
1523 | DeclareInterface
1524 | DeclareModule
1525 | DeclareTypeAlias
1526 | DeclareVariable
1527 | InterfaceDeclaration
1528 | TypeAlias;
1529
1530export type JSX =
1531 | JSXAttribute
1532 | JSXClosingElement
1533 | JSXElement
1534 | JSXEmptyExpression
1535 | JSXExpressionContainer
1536 | JSXIdentifier
1537 | JSXMemberExpression
1538 | JSXNamespacedName
1539 | JSXOpeningElement
1540 | JSXSpreadAttribute
1541 | JSXText;
1542
1543export type TSType =
1544 | TSAnyKeyword
1545 | TSArrayType
1546 | TSBooleanKeyword
1547 | TSConstructorType
1548 | TSExpressionWithTypeArguments
1549 | TSFunctionType
1550 | TSIndexedAccessType
1551 | TSIntersectionType
1552 | TSLiteralType
1553 | TSMappedType
1554 | TSNeverKeyword
1555 | TSNullKeyword
1556 | TSNumberKeyword
1557 | TSObjectKeyword
1558 | TSParenthesizedType
1559 | TSStringKeyword
1560 | TSSymbolKeyword
1561 | TSThisType
1562 | TSTupleType
1563 | TSTypeLiteral
1564 | TSTypeOperator
1565 | TSTypePredicate
1566 | TSTypeQuery
1567 | TSTypeReference
1568 | TSUndefinedKeyword
1569 | TSUnionType
1570 | TSVoidKeyword;
1571
1572export type TSEntityName = Identifier | TSQualifiedName;
1573
1574export type TSTypeElement =
1575 | TSCallSignatureDeclaration
1576 | TSConstructSignatureDeclaration
1577 | TSIndexSignature
1578 | TSMethodSignature
1579 | TSPropertySignature;
1580
1581export function arrayExpression(elements?: Array<null | Expression | SpreadElement>): ArrayExpression;
1582export function assignmentExpression(operator?: string, left?: LVal, right?: Expression): AssignmentExpression;
1583export function binaryExpression(
1584 operator?:
1585 | "+"
1586 | "-"
1587 | "/"
1588 | "%"
1589 | "*"
1590 | "**"
1591 | "&"
1592 | "|"
1593 | ">>"
1594 | ">>>"
1595 | "<<"
1596 | "^"
1597 | "=="
1598 | "==="
1599 | "!="
1600 | "!=="
1601 | "in"
1602 | "instanceof"
1603 | ">"
1604 | "<"
1605 | ">="
1606 | "<=",
1607 left?: Expression,
1608 right?: Expression,
1609): BinaryExpression;
1610export function directive(value?: DirectiveLiteral): Directive;
1611export function directiveLiteral(value?: string): DirectiveLiteral;
1612export function blockStatement(body?: Statement[], directives?: Directive[]): BlockStatement;
1613export function breakStatement(label?: Identifier): BreakStatement;
1614export function callExpression(callee?: Expression, _arguments?: Array<Expression | SpreadElement>): CallExpression;
1615export function catchClause(param?: Identifier, body?: BlockStatement): CatchClause;
1616export function conditionalExpression(
1617 test?: Expression,
1618 consequent?: Expression,
1619 alternate?: Expression,
1620): ConditionalExpression;
1621export function continueStatement(label?: Identifier): ContinueStatement;
1622export function debuggerStatement(): DebuggerStatement;
1623export function doWhileStatement(test?: Expression, body?: Statement): DoWhileStatement;
1624export function emptyStatement(): EmptyStatement;
1625export function expressionStatement(expression?: Expression): ExpressionStatement;
1626export function file(program?: Program, comments?: Comment[], tokens?: any[]): File;
1627export function forInStatement(left?: VariableDeclaration | LVal, right?: Expression, body?: Statement): ForInStatement;
1628export function forStatement(
1629 init?: VariableDeclaration | Expression,
1630 test?: Expression,
1631 update?: Expression,
1632 body?: Statement,
1633): ForStatement;
1634export function functionDeclaration(
1635 id?: Identifier,
1636 params?: LVal[],
1637 body?: BlockStatement,
1638 generator?: boolean,
1639 async?: boolean,
1640): FunctionDeclaration;
1641export function functionExpression(
1642 id?: Identifier,
1643 params?: LVal[],
1644 body?: BlockStatement,
1645 generator?: boolean,
1646 async?: boolean,
1647): FunctionExpression;
1648export function identifier(name?: string): Identifier;
1649export function ifStatement(test?: Expression, consequent?: Statement, alternate?: Statement): IfStatement;
1650export function labeledStatement(label?: Identifier, body?: Statement): LabeledStatement;
1651export function stringLiteral(value?: string): StringLiteral;
1652export function numericLiteral(value?: number): NumericLiteral;
1653export function nullLiteral(): NullLiteral;
1654export function booleanLiteral(value?: boolean): BooleanLiteral;
1655export function regExpLiteral(pattern?: string, flags?: string): RegExpLiteral;
1656export function logicalExpression(operator?: "||" | "&&", left?: Expression, right?: Expression): LogicalExpression;
1657export function memberExpression(
1658 object?: Expression | Super,
1659 property?: Expression,
1660 computed?: boolean,
1661): MemberExpression;
1662export function newExpression(
1663 callee?: Expression | Super,
1664 _arguments?: Array<Expression | SpreadElement>,
1665): NewExpression;
1666export function program(body?: Array<Statement | ModuleDeclaration>, directives?: Directive[]): Program;
1667export function objectExpression(properties?: Array<ObjectProperty | ObjectMethod | SpreadProperty>): ObjectExpression;
1668export function objectMethod(
1669 kind?: "get" | "set" | "method",
1670 key?: Expression,
1671 params?: LVal[],
1672 body?: BlockStatement,
1673 computed?: boolean,
1674): ObjectMethod;
1675export function objectProperty(
1676 key?: Expression,
1677 value?: Expression,
1678 computed?: boolean,
1679 shorthand?: boolean,
1680 decorators?: Decorator[],
1681): ObjectProperty;
1682export function restElement(argument?: LVal, typeAnnotation?: TypeAnnotation): RestElement;
1683export function returnStatement(argument?: Expression): ReturnStatement;
1684export function sequenceExpression(expressions?: Expression[]): SequenceExpression;
1685export function switchCase(test?: Expression, consequent?: Statement[]): SwitchCase;
1686export function switchStatement(discriminant?: Expression, cases?: SwitchCase[]): SwitchStatement;
1687export function thisExpression(): ThisExpression;
1688export function throwStatement(argument?: Expression): ThrowStatement;
1689export function tryStatement(block?: BlockStatement, handler?: CatchClause, finalizer?: BlockStatement): TryStatement;
1690export function unaryExpression(
1691 operator?: "void" | "delete" | "!" | "+" | "-" | "++" | "--" | "~" | "typeof",
1692 argument?: Expression,
1693 prefix?: boolean,
1694): UnaryExpression;
1695export function updateExpression(operator?: "++" | "--", argument?: Expression, prefix?: boolean): UpdateExpression;
1696export function variableDeclaration(
1697 kind?: "var" | "let" | "const",
1698 declarations?: VariableDeclarator[],
1699): VariableDeclaration;
1700export function variableDeclarator(id?: LVal, init?: Expression): VariableDeclarator;
1701export function whileStatement(test?: Expression, body?: BlockStatement | Statement): WhileStatement;
1702export function withStatement(object?: Expression, body?: BlockStatement | Statement): WithStatement;
1703export function assignmentPattern(left?: Identifier, right?: Expression): AssignmentPattern;
1704export function arrayPattern(elements?: Expression[], typeAnnotation?: TypeAnnotation): ArrayPattern;
1705export function arrowFunctionExpression(
1706 params?: LVal[],
1707 body?: BlockStatement | Expression,
1708 async?: boolean,
1709): ArrowFunctionExpression;
1710export function classBody(body?: Array<ClassMethod | ClassProperty>): ClassBody;
1711export function classDeclaration(
1712 id?: Identifier,
1713 superClass?: Expression,
1714 body?: ClassBody,
1715 decorators?: Decorator[],
1716): ClassDeclaration;
1717export function classExpression(
1718 id?: Identifier,
1719 superClass?: Expression,
1720 body?: ClassBody,
1721 decorators?: Decorator[],
1722): ClassExpression;
1723export function exportAllDeclaration(source?: StringLiteral): ExportAllDeclaration;
1724export function exportDefaultDeclaration(
1725 declaration?: FunctionDeclaration | ClassDeclaration | Expression,
1726): ExportDefaultDeclaration;
1727export function exportNamedDeclaration(
1728 declaration?: Declaration,
1729 specifiers?: ExportSpecifier[],
1730 source?: StringLiteral,
1731): ExportNamedDeclaration;
1732export function exportSpecifier(local?: Identifier, exported?: Identifier): ExportSpecifier;
1733export function forOfStatement(left?: VariableDeclaration | LVal, right?: Expression, body?: Statement): ForOfStatement;
1734export function importDeclaration(
1735 specifiers?: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>,
1736 source?: StringLiteral,
1737): ImportDeclaration;
1738export function importDefaultSpecifier(local?: Identifier): ImportDefaultSpecifier;
1739export function importNamespaceSpecifier(local?: Identifier): ImportNamespaceSpecifier;
1740export function importSpecifier(local?: Identifier, imported?: Identifier): ImportSpecifier;
1741export function metaProperty(meta?: string, property?: string): MetaProperty;
1742export function classMethod(
1743 kind?: "constructor" | "method" | "get" | "set",
1744 key?: Expression,
1745 params?: LVal[],
1746 body?: BlockStatement,
1747 computed?: boolean,
1748 _static?: boolean,
1749): ClassMethod;
1750export function objectPattern(
1751 properties?: Array<AssignmentProperty | RestProperty>,
1752 typeAnnotation?: TypeAnnotation,
1753): ObjectPattern;
1754export function spreadElement(argument?: Expression): SpreadElement;
1755export function taggedTemplateExpression(tag?: Expression, quasi?: TemplateLiteral): TaggedTemplateExpression;
1756export function templateElement(
1757 value?: { cooked?: string | undefined; raw?: string | undefined },
1758 tail?: boolean,
1759): TemplateElement;
1760export function templateLiteral(quasis?: TemplateElement[], expressions?: Expression[]): TemplateLiteral;
1761export function yieldExpression(argument?: Expression, delegate?: boolean): YieldExpression;
1762export function anyTypeAnnotation(): AnyTypeAnnotation;
1763export function arrayTypeAnnotation(elementType?: FlowTypeAnnotation): ArrayTypeAnnotation;
1764export function booleanTypeAnnotation(): BooleanTypeAnnotation;
1765export function booleanLiteralTypeAnnotation(): BooleanLiteralTypeAnnotation;
1766export function nullLiteralTypeAnnotation(): NullLiteralTypeAnnotation;
1767export function classImplements(id?: Identifier, typeParameters?: TypeParameterInstantiation): ClassImplements;
1768export function classProperty(
1769 key?: Identifier,
1770 value?: Expression,
1771 typeAnnotation?: TypeAnnotation,
1772 decorators?: Decorator[],
1773): ClassProperty;
1774export function declareClass(
1775 id?: Identifier,
1776 typeParameters?: TypeParameterDeclaration,
1777 _extends?: InterfaceExtends[],
1778 body?: ObjectTypeAnnotation,
1779): DeclareClass;
1780export function declareFunction(id?: Identifier): DeclareFunction;
1781export function declareInterface(
1782 id?: Identifier,
1783 typeParameters?: TypeParameterDeclaration,
1784 _extends?: InterfaceExtends[],
1785 body?: ObjectTypeAnnotation,
1786): DeclareInterface;
1787export function declareModule(id?: StringLiteral | Identifier, body?: BlockStatement): DeclareModule;
1788export function declareTypeAlias(
1789 id?: Identifier,
1790 typeParameters?: TypeParameterDeclaration,
1791 right?: FlowTypeAnnotation,
1792): DeclareTypeAlias;
1793export function declareVariable(id?: Identifier): DeclareVariable;
1794export function existentialTypeParam(): ExistentialTypeParam;
1795export function functionTypeAnnotation(
1796 typeParameters?: TypeParameterDeclaration,
1797 params?: FunctionTypeParam[],
1798 rest?: FunctionTypeParam,
1799 returnType?: FlowTypeAnnotation,
1800): FunctionTypeAnnotation;
1801export function functionTypeParam(name?: Identifier, typeAnnotation?: FlowTypeAnnotation): FunctionTypeParam;
1802export function genericTypeAnnotation(
1803 id?: Identifier,
1804 typeParameters?: TypeParameterInstantiation,
1805): GenericTypeAnnotation;
1806export function interfaceExtends(id?: Identifier, typeParameters?: TypeParameterInstantiation): InterfaceExtends;
1807export function interfaceDeclaration(
1808 id?: Identifier,
1809 typeParameters?: TypeParameterDeclaration,
1810 _extends?: InterfaceExtends[],
1811 body?: ObjectTypeAnnotation,
1812): InterfaceDeclaration;
1813export function intersectionTypeAnnotation(types?: FlowTypeAnnotation[]): IntersectionTypeAnnotation;
1814export function mixedTypeAnnotation(): MixedTypeAnnotation;
1815export function nullableTypeAnnotation(typeAnnotation?: FlowTypeAnnotation): NullableTypeAnnotation;
1816export function numericLiteralTypeAnnotation(): NumericLiteralTypeAnnotation;
1817export function numberTypeAnnotation(): NumberTypeAnnotation;
1818export function stringLiteralTypeAnnotation(): StringLiteralTypeAnnotation;
1819export function stringTypeAnnotation(): StringTypeAnnotation;
1820export function thisTypeAnnotation(): ThisTypeAnnotation;
1821export function tupleTypeAnnotation(types?: FlowTypeAnnotation[]): TupleTypeAnnotation;
1822export function typeofTypeAnnotation(argument?: FlowTypeAnnotation): TypeofTypeAnnotation;
1823export function typeAlias(
1824 id?: Identifier,
1825 typeParameters?: TypeParameterDeclaration,
1826 right?: FlowTypeAnnotation,
1827): TypeAlias;
1828export function typeAnnotation(typeAnnotation?: FlowTypeAnnotation): TypeAnnotation;
1829export function typeCastExpression(expression?: Expression, typeAnnotation?: FlowTypeAnnotation): TypeCastExpression;
1830export function typeParameter(bound?: TypeAnnotation, default_?: Flow): TypeParameter;
1831export function typeParameterDeclaration(params?: Identifier[]): TypeParameterDeclaration;
1832export function typeParameterInstantiation(params?: FlowTypeAnnotation[]): TypeParameterInstantiation;
1833export function objectTypeAnnotation(
1834 properties?: ObjectTypeProperty[],
1835 indexers?: ObjectTypeIndexer[],
1836 callProperties?: ObjectTypeCallProperty[],
1837): ObjectTypeAnnotation;
1838export function objectTypeCallProperty(value?: FlowTypeAnnotation): ObjectTypeCallProperty;
1839export function objectTypeIndexer(
1840 id?: Expression,
1841 key?: FlowTypeAnnotation,
1842 value?: FlowTypeAnnotation,
1843): ObjectTypeIndexer;
1844export function objectTypeProperty(key?: Expression, value?: FlowTypeAnnotation): ObjectTypeProperty;
1845export function qualifiedTypeIdentifier(
1846 id?: Identifier,
1847 qualification?: Identifier | QualifiedTypeIdentifier,
1848): QualifiedTypeIdentifier;
1849export function unionTypeAnnotation(types?: FlowTypeAnnotation[]): UnionTypeAnnotation;
1850export function voidTypeAnnotation(): VoidTypeAnnotation;
1851export function jSXAttribute(
1852 name?: JSXIdentifier | JSXNamespacedName,
1853 value?: JSXElement | StringLiteral | JSXExpressionContainer | null,
1854): JSXAttribute;
1855export function jSXClosingElement(name?: JSXIdentifier | JSXMemberExpression): JSXClosingElement;
1856export function jSXElement(
1857 openingElement?: JSXOpeningElement,
1858 closingElement?: JSXClosingElement,
1859 children?: Array<JSXElement | JSXExpressionContainer | JSXText>,
1860 selfClosing?: boolean,
1861): JSXElement;
1862export function jSXEmptyExpression(): JSXEmptyExpression;
1863export function jSXExpressionContainer(expression?: Expression): JSXExpressionContainer;
1864export function jSXIdentifier(name?: string): JSXIdentifier;
1865export function jSXMemberExpression(
1866 object?: JSXMemberExpression | JSXIdentifier,
1867 property?: JSXIdentifier,
1868): JSXMemberExpression;
1869export function jSXNamespacedName(namespace?: JSXIdentifier, name?: JSXIdentifier): JSXNamespacedName;
1870export function jSXOpeningElement(
1871 name?: JSXIdentifier | JSXMemberExpression,
1872 attributes?: JSXAttribute[],
1873 selfClosing?: boolean,
1874): JSXOpeningElement;
1875export function jSXSpreadAttribute(argument?: Expression): JSXSpreadAttribute;
1876export function jSXText(value?: string): JSXText;
1877export function noop(): Noop;
1878export function parenthesizedExpression(expression?: Expression): ParenthesizedExpression;
1879export function awaitExpression(argument?: Expression): AwaitExpression;
1880export function bindExpression(object?: Expression, callee?: Expression): BindExpression;
1881export function decorator(expression?: Expression): Decorator;
1882export function doExpression(body?: BlockStatement): DoExpression;
1883export function exportDefaultSpecifier(exported?: Identifier): ExportDefaultSpecifier;
1884export function exportNamespaceSpecifier(exported?: Identifier): ExportNamespaceSpecifier;
1885export function restProperty(argument?: LVal): RestProperty;
1886export function spreadProperty(argument?: Expression): SpreadProperty;
1887
1888export function TSAnyKeyword(): TSAnyKeyword;
1889export function TSArrayType(elementType: TSType): TSArrayType;
1890export function TSAsExpression(expression: Expression, typeAnnotation: TSType): TSAsExpression;
1891export function TSBooleanKeyword(): TSBooleanKeyword;
1892export function TSCallSignatureDeclaration(
1893 typeParameters?: TypeParameterDeclaration,
1894 parameters?: Array<Identifier | RestElement>,
1895 typeAnnotation?: TSTypeAnnotation,
1896): TSCallSignatureDeclaration;
1897export function TSConstructSignatureDeclaration(
1898 typeParameters?: TypeParameterDeclaration,
1899 parameters?: Array<Identifier | RestElement>,
1900 typeAnnotation?: TSTypeAnnotation,
1901): TSTypeElement;
1902export function TSConstructorType(
1903 typeParameters?: TypeParameterDeclaration,
1904 typeAnnotation?: TSTypeAnnotation,
1905): TSConstructorType;
1906export function TSDeclareFunction(
1907 id: Identifier | undefined | null,
1908 typeParameters: TypeParameterDeclaration | Noop | undefined | null,
1909 params: LVal[],
1910 returnType: TypeAnnotation | TSTypeAnnotation | Noop | undefined | null,
1911): TSDeclareFunction;
1912export function TSDeclareMethod(
1913 decorators: Decorator[] | undefined | null,
1914 key: Expression,
1915 typeParameters: TypeParameterDeclaration | Noop | undefined | null,
1916 params: LVal[],
1917 returnType?: TypeAnnotation | TSTypeAnnotation | Noop,
1918): TSDeclareMethod;
1919export function TSEnumDeclaration(id: Identifier, members: TSEnumMember[]): TSEnumDeclaration;
1920export function TSEnumMember(id: Identifier | StringLiteral, initializer?: Expression): TSEnumMember;
1921export function TSExportAssignment(expression: Expression): TSExportAssignment;
1922export function TSExpressionWithTypeArguments(
1923 expression: TSEntityName,
1924 typeParameters?: TypeParameterInstantiation,
1925): TSExpressionWithTypeArguments;
1926export function TSExternalModuleReference(expression: StringLiteral): TSExternalModuleReference;
1927export function TSFunctionType(
1928 typeParameters?: TypeParameterDeclaration,
1929 typeAnnotation?: TSTypeAnnotation,
1930): TSFunctionType;
1931export function TSImportEqualsDeclaration(
1932 id: Identifier,
1933 moduleReference: TSEntityName | TSExternalModuleReference,
1934): TSImportEqualsDeclaration;
1935export function TSIndexSignature(parameters: Identifier[], typeAnnotation?: TSTypeAnnotation): TSIndexSignature;
1936export function TSIndexedAccessType(objectType: TSType, indexType: TSType): TSIndexedAccessType;
1937export function TSInterfaceBody(body: TSTypeElement[]): TSInterfaceBody;
1938export function TSInterfaceDeclaration(
1939 id: Identifier,
1940 typeParameters: TypeParameterDeclaration | undefined | null,
1941 extends_: TSExpressionWithTypeArguments[] | undefined | null,
1942 body: TSInterfaceBody,
1943): TSInterfaceDeclaration;
1944export function TSIntersectionType(types: TSType[]): TSIntersectionType;
1945export function TSLiteralType(literal: NumericLiteral | StringLiteral | BooleanLiteral): TSLiteralType;
1946export function TSMappedType(typeParameter: TypeParameter, typeAnnotation?: TSType): TSMappedType;
1947export function TSMethodSignature(
1948 key: Expression,
1949 typeParameters?: TypeParameterDeclaration,
1950 parameters?: Array<Identifier | RestElement>,
1951 typeAnnotation?: TSTypeAnnotation,
1952): TSMethodSignature;
1953export function TSModuleBlock(body: Statement[]): TSModuleBlock;
1954export function TSModuleDeclaration(
1955 id: Identifier | StringLiteral,
1956 body: TSModuleBlock | TSModuleDeclaration,
1957): TSModuleDeclaration;
1958export function TSNamespaceExportDeclaration(id: Identifier): TSNamespaceExportDeclaration;
1959export function TSNeverKeyword(): TSNeverKeyword;
1960export function TSNonNullExpression(expression: Expression): TSNonNullExpression;
1961export function TSNullKeyword(): TSNullKeyword;
1962export function TSNumberKeyword(): TSNumberKeyword;
1963export function TSObjectKeyword(): TSObjectKeyword;
1964export function TSParameterProperty(parameter: Identifier | AssignmentPattern): TSParameterProperty;
1965export function TSParenthesizedType(typeAnnotation: TSType): TSParenthesizedType;
1966export function TSPropertySignature(
1967 key: Expression,
1968 typeAnnotation?: TSTypeAnnotation,
1969 initializer?: Expression,
1970): TSPropertySignature;
1971export function TSQualifiedName(left: TSEntityName, right: Identifier): TSQualifiedName;
1972export function TSStringKeyword(): TSStringKeyword;
1973export function TSSymbolKeyword(): TSSymbolKeyword;
1974export function TSThisType(): TSThisType;
1975export function TSTupleType(elementTypes: TSType[]): TSTupleType;
1976export function TSTypeAliasDeclaration(
1977 id: Identifier,
1978 typeParameters: TypeParameterDeclaration | undefined | null,
1979 typeAnnotation: TSType,
1980): TSTypeAliasDeclaration;
1981export function TSTypeAnnotation(typeAnnotation: TSType): TSTypeAnnotation;
1982export function TSTypeAssertion(typeAnnotation: TSType, expression: Expression): TSTypeAssertion;
1983export function TSTypeLiteral(members: TSTypeElement[]): TSTypeLiteral;
1984export function TSTypeOperator(typeAnnotation: TSType): TSTypeOperator;
1985export function TSTypeParameter(constraint?: TSType, default_?: TSType): TSTypeParameter;
1986export function TSTypeParameterDeclaration(params: TSTypeParameter[]): TSTypeParameterDeclaration;
1987export function TSTypeParameterInstantiation(params: TSType[]): TSTypeParameterInstantiation;
1988export function TSTypePredicate(
1989 parameterName: Identifier | TSThisType,
1990 typeAnnotation: TSTypeAnnotation,
1991): TSTypePredicate;
1992export function TSTypeQuery(exprName: TSEntityName): TSTypeQuery;
1993export function TSTypeReference(typeName: TSEntityName, typeParameters?: TSTypeParameterInstantiation): TSTypeReference;
1994export function TSUndefinedKeyword(): TSUndefinedKeyword;
1995export function TSUnionType(types: TSType[]): TSUnionType;
1996export function TSVoidKeyword(): TSVoidKeyword;
1997
1998export function isArrayExpression(node: object | null | undefined, opts?: object): node is ArrayExpression;
1999export function isAssignmentExpression(node: object | null | undefined, opts?: object): node is AssignmentExpression;
2000export function isBinaryExpression(node: object | null | undefined, opts?: object): node is BinaryExpression;
2001export function isDirective(node: object | null | undefined, opts?: object): node is Directive;
2002export function isDirectiveLiteral(node: object | null | undefined, opts?: object): node is DirectiveLiteral;
2003export function isBlockStatement(node: object | null | undefined, opts?: object): node is BlockStatement;
2004export function isBreakStatement(node: object | null | undefined, opts?: object): node is BreakStatement;
2005export function isCallExpression(node: object | null | undefined, opts?: object): node is CallExpression;
2006export function isCatchClause(node: object | null | undefined, opts?: object): node is CatchClause;
2007export function isConditionalExpression(node: object | null | undefined, opts?: object): node is ConditionalExpression;
2008export function isContinueStatement(node: object | null | undefined, opts?: object): node is ContinueStatement;
2009export function isDebuggerStatement(node: object | null | undefined, opts?: object): node is DebuggerStatement;
2010export function isDoWhileStatement(node: object | null | undefined, opts?: object): node is DoWhileStatement;
2011export function isEmptyStatement(node: object | null | undefined, opts?: object): node is EmptyStatement;
2012export function isExpressionStatement(node: object | null | undefined, opts?: object): node is ExpressionStatement;
2013export function isFile(node: object | null | undefined, opts?: object): node is File;
2014export function isForInStatement(node: object | null | undefined, opts?: object): node is ForInStatement;
2015export function isForStatement(node: object | null | undefined, opts?: object): node is ForStatement;
2016export function isFunctionDeclaration(node: object | null | undefined, opts?: object): node is FunctionDeclaration;
2017export function isFunctionExpression(node: object | null | undefined, opts?: object): node is FunctionExpression;
2018export function isIdentifier(node: object | null | undefined, opts?: object): node is Identifier;
2019export function isIfStatement(node: object | null | undefined, opts?: object): node is IfStatement;
2020export function isLabeledStatement(node: object | null | undefined, opts?: object): node is LabeledStatement;
2021export function isStringLiteral(node: object | null | undefined, opts?: object): node is StringLiteral;
2022export function isNumericLiteral(node: object | null | undefined, opts?: object): node is NumericLiteral;
2023
2024/** @deprecated Use `isNumericLiteral` */
2025export function isNumberLiteral(node: object | null | undefined, opts?: object): node is NumericLiteral;
2026export function isNullLiteral(node: object | null | undefined, opts?: object): node is NullLiteral;
2027export function isBooleanLiteral(node: object | null | undefined, opts?: object): node is BooleanLiteral;
2028export function isRegExpLiteral(node: object | null | undefined, opts?: object): node is RegExpLiteral;
2029
2030/** @deprecated Use `isRegExpLiteral` */
2031export function isRegexLiteral(node: object | null | undefined, opts?: object): node is RegExpLiteral;
2032export function isLogicalExpression(node: object | null | undefined, opts?: object): node is LogicalExpression;
2033export function isMemberExpression(node: object | null | undefined, opts?: object): node is MemberExpression;
2034export function isNewExpression(node: object | null | undefined, opts?: object): node is NewExpression;
2035export function isProgram(node: object | null | undefined, opts?: object): node is Program;
2036export function isObjectExpression(node: object | null | undefined, opts?: object): node is ObjectExpression;
2037export function isObjectMethod(node: object | null | undefined, opts?: object): node is ObjectMethod;
2038export function isObjectProperty(node: object | null | undefined, opts?: object): node is ObjectProperty;
2039export function isRestElement(node: object | null | undefined, opts?: object): node is RestElement;
2040export function isReturnStatement(node: object | null | undefined, opts?: object): node is ReturnStatement;
2041export function isSequenceExpression(node: object | null | undefined, opts?: object): node is SequenceExpression;
2042export function isSwitchCase(node: object | null | undefined, opts?: object): node is SwitchCase;
2043export function isSwitchStatement(node: object | null | undefined, opts?: object): node is SwitchStatement;
2044export function isThisExpression(node: object | null | undefined, opts?: object): node is ThisExpression;
2045export function isThrowStatement(node: object | null | undefined, opts?: object): node is ThrowStatement;
2046export function isTryStatement(node: object | null | undefined, opts?: object): node is TryStatement;
2047export function isUnaryExpression(node: object | null | undefined, opts?: object): node is UnaryExpression;
2048export function isUpdateExpression(node: object | null | undefined, opts?: object): node is UpdateExpression;
2049export function isVariableDeclaration(node: object | null | undefined, opts?: object): node is VariableDeclaration;
2050export function isVariableDeclarator(node: object | null | undefined, opts?: object): node is VariableDeclarator;
2051export function isWhileStatement(node: object | null | undefined, opts?: object): node is WhileStatement;
2052export function isWithStatement(node: object | null | undefined, opts?: object): node is WithStatement;
2053export function isAssignmentPattern(node: object | null | undefined, opts?: object): node is AssignmentPattern;
2054export function isArrayPattern(node: object | null | undefined, opts?: object): node is ArrayPattern;
2055export function isArrowFunctionExpression(
2056 node: object | null | undefined,
2057 opts?: object,
2058): node is ArrowFunctionExpression;
2059export function isClassBody(node: object | null | undefined, opts?: object): node is ClassBody;
2060export function isClassDeclaration(node: object | null | undefined, opts?: object): node is ClassDeclaration;
2061export function isClassExpression(node: object | null | undefined, opts?: object): node is ClassExpression;
2062export function isExportAllDeclaration(node: object | null | undefined, opts?: object): node is ExportAllDeclaration;
2063export function isExportDefaultDeclaration(
2064 node: object | null | undefined,
2065 opts?: object,
2066): node is ExportDefaultDeclaration;
2067export function isExportNamedDeclaration(
2068 node: object | null | undefined,
2069 opts?: object,
2070): node is ExportNamedDeclaration;
2071export function isExportSpecifier(node: object | null | undefined, opts?: object): node is ExportSpecifier;
2072export function isForOfStatement(node: object | null | undefined, opts?: object): node is ForOfStatement;
2073export function isImportDeclaration(node: object | null | undefined, opts?: object): node is ImportDeclaration;
2074export function isImportDefaultSpecifier(
2075 node: object | null | undefined,
2076 opts?: object,
2077): node is ImportDefaultSpecifier;
2078export function isImportNamespaceSpecifier(
2079 node: object | null | undefined,
2080 opts?: object,
2081): node is ImportNamespaceSpecifier;
2082export function isImportSpecifier(node: object | null | undefined, opts?: object): node is ImportSpecifier;
2083export function isMetaProperty(node: object | null | undefined, opts?: object): node is MetaProperty;
2084export function isClassMethod(node: object | null | undefined, opts?: object): node is ClassMethod;
2085export function isObjectPattern(node: object | null | undefined, opts?: object): node is ObjectPattern;
2086export function isSpreadElement(node: object | null | undefined, opts?: object): node is SpreadElement;
2087export function isSuper(node: object | null | undefined, opts?: object): node is Super;
2088export function isTaggedTemplateExpression(
2089 node: object | null | undefined,
2090 opts?: object,
2091): node is TaggedTemplateExpression;
2092export function isTemplateElement(node: object | null | undefined, opts?: object): node is TemplateElement;
2093export function isTemplateLiteral(node: object | null | undefined, opts?: object): node is TemplateLiteral;
2094export function isYieldExpression(node: object | null | undefined, opts?: object): node is YieldExpression;
2095export function isAnyTypeAnnotation(node: object | null | undefined, opts?: object): node is AnyTypeAnnotation;
2096export function isArrayTypeAnnotation(node: object | null | undefined, opts?: object): node is ArrayTypeAnnotation;
2097export function isBooleanTypeAnnotation(node: object | null | undefined, opts?: object): node is BooleanTypeAnnotation;
2098export function isBooleanLiteralTypeAnnotation(
2099 node: object | null | undefined,
2100 opts?: object,
2101): node is BooleanLiteralTypeAnnotation;
2102export function isNullLiteralTypeAnnotation(
2103 node: object | null | undefined,
2104 opts?: object,
2105): node is NullLiteralTypeAnnotation;
2106export function isClassImplements(node: object | null | undefined, opts?: object): node is ClassImplements;
2107export function isClassProperty(node: object | null | undefined, opts?: object): node is ClassProperty;
2108export function isDeclareClass(node: object | null | undefined, opts?: object): node is DeclareClass;
2109export function isDeclareFunction(node: object | null | undefined, opts?: object): node is DeclareFunction;
2110export function isDeclareInterface(node: object | null | undefined, opts?: object): node is DeclareInterface;
2111export function isDeclareModule(node: object | null | undefined, opts?: object): node is DeclareModule;
2112export function isDeclareTypeAlias(node: object | null | undefined, opts?: object): node is DeclareTypeAlias;
2113export function isDeclareVariable(node: object | null | undefined, opts?: object): node is DeclareVariable;
2114export function isExistentialTypeParam(node: object | null | undefined, opts?: object): node is ExistentialTypeParam;
2115export function isFunctionTypeAnnotation(
2116 node: object | null | undefined,
2117 opts?: object,
2118): node is FunctionTypeAnnotation;
2119export function isFunctionTypeParam(node: object | null | undefined, opts?: object): node is FunctionTypeParam;
2120export function isGenericTypeAnnotation(node: object | null | undefined, opts?: object): node is GenericTypeAnnotation;
2121export function isInterfaceExtends(node: object | null | undefined, opts?: object): node is InterfaceExtends;
2122export function isInterfaceDeclaration(node: object | null | undefined, opts?: object): node is InterfaceDeclaration;
2123export function isIntersectionTypeAnnotation(
2124 node: object | null | undefined,
2125 opts?: object,
2126): node is IntersectionTypeAnnotation;
2127export function isMixedTypeAnnotation(node: object | null | undefined, opts?: object): node is MixedTypeAnnotation;
2128export function isNullableTypeAnnotation(
2129 node: object | null | undefined,
2130 opts?: object,
2131): node is NullableTypeAnnotation;
2132export function isNumericLiteralTypeAnnotation(
2133 node: object | null | undefined,
2134 opts?: object,
2135): node is NumericLiteralTypeAnnotation;
2136export function isNumberTypeAnnotation(node: object | null | undefined, opts?: object): node is NumberTypeAnnotation;
2137export function isStringLiteralTypeAnnotation(
2138 node: object | null | undefined,
2139 opts?: object,
2140): node is StringLiteralTypeAnnotation;
2141export function isStringTypeAnnotation(node: object | null | undefined, opts?: object): node is StringTypeAnnotation;
2142export function isThisTypeAnnotation(node: object | null | undefined, opts?: object): node is ThisTypeAnnotation;
2143export function isTupleTypeAnnotation(node: object | null | undefined, opts?: object): node is TupleTypeAnnotation;
2144export function isTypeofTypeAnnotation(node: object | null | undefined, opts?: object): node is TypeofTypeAnnotation;
2145export function isTypeAlias(node: object | null | undefined, opts?: object): node is TypeAlias;
2146export function isTypeAnnotation(node: object | null | undefined, opts?: object): node is TypeAnnotation;
2147export function isTypeCastExpression(node: object | null | undefined, opts?: object): node is TypeCastExpression;
2148export function isTypeParameter(node: object | null | undefined, opts?: object): node is TypeParameter;
2149export function isTypeParameterDeclaration(
2150 node: object | null | undefined,
2151 opts?: object,
2152): node is TypeParameterDeclaration;
2153export function isTypeParameterInstantiation(
2154 node: object | null | undefined,
2155 opts?: object,
2156): node is TypeParameterInstantiation;
2157export function isObjectTypeAnnotation(node: object | null | undefined, opts?: object): node is ObjectTypeAnnotation;
2158export function isObjectTypeCallProperty(
2159 node: object | null | undefined,
2160 opts?: object,
2161): node is ObjectTypeCallProperty;
2162export function isObjectTypeIndexer(node: object | null | undefined, opts?: object): node is ObjectTypeIndexer;
2163export function isObjectTypeProperty(node: object | null | undefined, opts?: object): node is ObjectTypeProperty;
2164export function isQualifiedTypeIdentifier(
2165 node: object | null | undefined,
2166 opts?: object,
2167): node is QualifiedTypeIdentifier;
2168export function isUnionTypeAnnotation(node: object | null | undefined, opts?: object): node is UnionTypeAnnotation;
2169export function isVoidTypeAnnotation(node: object | null | undefined, opts?: object): node is VoidTypeAnnotation;
2170export function isJSXAttribute(node: object | null | undefined, opts?: object): node is JSXAttribute;
2171export function isJSXClosingElement(node: object | null | undefined, opts?: object): node is JSXClosingElement;
2172export function isJSXElement(node: object | null | undefined, opts?: object): node is JSXElement;
2173export function isJSXEmptyExpression(node: object | null | undefined, opts?: object): node is JSXEmptyExpression;
2174export function isJSXExpressionContainer(
2175 node: object | null | undefined,
2176 opts?: object,
2177): node is JSXExpressionContainer;
2178export function isJSXIdentifier(node: object | null | undefined, opts?: object): node is JSXIdentifier;
2179export function isJSXMemberExpression(node: object | null | undefined, opts?: object): node is JSXMemberExpression;
2180export function isJSXNamespacedName(node: object | null | undefined, opts?: object): node is JSXNamespacedName;
2181export function isJSXOpeningElement(node: object | null | undefined, opts?: object): node is JSXOpeningElement;
2182export function isJSXSpreadAttribute(node: object | null | undefined, opts?: object): node is JSXSpreadAttribute;
2183export function isJSXText(node: object | null | undefined, opts?: object): node is JSXText;
2184export function isNoop(node: object | null | undefined, opts?: object): node is Noop;
2185export function isParenthesizedExpression(
2186 node: object | null | undefined,
2187 opts?: object,
2188): node is ParenthesizedExpression;
2189export function isAwaitExpression(node: object | null | undefined, opts?: object): node is AwaitExpression;
2190export function isBindExpression(node: object | null | undefined, opts?: object): node is BindExpression;
2191export function isDecorator(node: object | null | undefined, opts?: object): node is Decorator;
2192export function isDoExpression(node: object | null | undefined, opts?: object): node is DoExpression;
2193export function isExportDefaultSpecifier(
2194 node: object | null | undefined,
2195 opts?: object,
2196): node is ExportDefaultSpecifier;
2197export function isExportNamespaceSpecifier(
2198 node: object | null | undefined,
2199 opts?: object,
2200): node is ExportNamespaceSpecifier;
2201export function isRestProperty(node: object | null | undefined, opts?: object): node is RestProperty;
2202export function isSpreadProperty(node: object | null | undefined, opts?: object): node is SpreadProperty;
2203export function isExpression(node: object | null | undefined, opts?: object): node is Expression;
2204export function isBinary(node: object | null | undefined, opts?: object): node is Binary;
2205export function isScopable(node: object | null | undefined, opts?: object): node is Scopable;
2206export function isBlockParent(node: object | null | undefined, opts?: object): node is BlockParent;
2207export function isBlock(node: object | null | undefined, opts?: object): node is Block;
2208export function isStatement(node: object | null | undefined, opts?: object): node is Statement;
2209export function isTerminatorless(node: object | null | undefined, opts?: object): node is Terminatorless;
2210export function isCompletionStatement(node: object | null | undefined, opts?: object): node is CompletionStatement;
2211export function isConditional(node: object | null | undefined, opts?: object): node is Conditional;
2212export function isLoop(node: object | null | undefined, opts?: object): node is Loop;
2213export function isWhile(node: object | null | undefined, opts?: object): node is While;
2214export function isExpressionWrapper(node: object | null | undefined, opts?: object): node is ExpressionWrapper;
2215export function isFor(node: object | null | undefined, opts?: object): node is For;
2216export function isForXStatement(node: object | null | undefined, opts?: object): node is ForXStatement;
2217export function isFunction(node: object | null | undefined, opts?: object): node is Function;
2218export function isFunctionParent(node: object | null | undefined, opts?: object): node is FunctionParent;
2219export function isPureish(node: object | null | undefined, opts?: object): node is Pureish;
2220export function isDeclaration(node: object | null | undefined, opts?: object): node is Declaration;
2221export function isLVal(node: object | null | undefined, opts?: object): node is LVal;
2222export function isLiteral(node: object | null | undefined, opts?: object): node is Literal;
2223export function isImmutable(node: object | null | undefined, opts?: object): node is Immutable;
2224export function isUserWhitespacable(node: object | null | undefined, opts?: object): node is UserWhitespacable;
2225export function isMethod(node: object | null | undefined, opts?: object): node is Method;
2226export function isObjectMember(node: object | null | undefined, opts?: object): node is ObjectMember;
2227export function isProperty(node: object | null | undefined, opts?: object): node is Property;
2228export function isUnaryLike(node: object | null | undefined, opts?: object): node is UnaryLike;
2229export function isPattern(node: object | null | undefined, opts?: object): node is Pattern;
2230export function isClass(node: object | null | undefined, opts?: object): node is Class;
2231export function isModuleDeclaration(node: object | null | undefined, opts?: object): node is ModuleDeclaration;
2232export function isExportDeclaration(node: object | null | undefined, opts?: object): node is ExportDeclaration;
2233export function isModuleSpecifier(node: object | null | undefined, opts?: object): node is ModuleSpecifier;
2234export function isFlow(node: object | null | undefined, opts?: object): node is Flow;
2235export function isFlowBaseAnnotation(node: object | null | undefined, opts?: object): node is FlowBaseAnnotation;
2236export function isFlowDeclaration(node: object | null | undefined, opts?: object): node is FlowDeclaration;
2237export function isJSX(node: object | null | undefined, opts?: object): node is JSX;
2238
2239export function isReferencedIdentifier(
2240 node: object | null | undefined,
2241 opts?: object,
2242): node is Identifier | JSXIdentifier;
2243export function isReferencedMemberExpression(node: object | null | undefined, opts?: object): node is MemberExpression;
2244export function isBindingIdentifier(node: object | null | undefined, opts?: object): node is Identifier;
2245export function isScope(node: object | null | undefined, opts?: object): node is Scopable;
2246export function isReferenced(node: object | null | undefined, opts?: object): boolean;
2247export function isBlockScoped(
2248 node: object | null | undefined,
2249 opts?: object,
2250): node is FunctionDeclaration | ClassDeclaration | VariableDeclaration;
2251export function isVar(node: object | null | undefined, opts?: object): node is VariableDeclaration;
2252export function isUser(node: object | null | undefined, opts?: object): boolean;
2253export function isGenerated(node: object | null | undefined, opts?: object): boolean;
2254export function isPure(node: object | null | undefined, opts?: object): boolean;
2255
2256export function isTSAnyKeyword(node: object | null | undefined, opts?: object): node is TSAnyKeyword;
2257export function isTSArrayType(node: object | null | undefined, opts?: object): node is TSArrayType;
2258export function isTSAsExpression(node: object | null | undefined, opts?: object): node is TSAsExpression;
2259export function isTSBooleanKeyword(node: object | null | undefined, opts?: object): node is TSBooleanKeyword;
2260export function isTSCallSignatureDeclaration(
2261 node: object | null | undefined,
2262 opts?: object,
2263): node is TSCallSignatureDeclaration;
2264export function isTSConstructSignatureDeclaration(
2265 node: object | null | undefined,
2266 opts?: object,
2267): node is TSTypeElement;
2268export function isTSConstructorType(node: object | null | undefined, opts?: object): node is TSConstructorType;
2269export function isTSDeclareFunction(node: object | null | undefined, opts?: object): node is TSDeclareFunction;
2270export function isTSDeclareMethod(node: object | null | undefined, opts?: object): node is TSDeclareMethod;
2271export function isTSEnumDeclaration(node: object | null | undefined, opts?: object): node is TSEnumDeclaration;
2272export function isTSEnumMember(node: object | null | undefined, opts?: object): node is TSEnumMember;
2273export function isTSExportAssignment(node: object | null | undefined, opts?: object): node is TSExportAssignment;
2274export function isTSExpressionWithTypeArguments(
2275 node: object | null | undefined,
2276 opts?: object,
2277): node is TSExpressionWithTypeArguments;
2278export function isTSExternalModuleReference(
2279 node: object | null | undefined,
2280 opts?: object,
2281): node is TSExternalModuleReference;
2282export function isTSFunctionType(node: object | null | undefined, opts?: object): node is TSFunctionType;
2283export function isTSImportEqualsDeclaration(
2284 node: object | null | undefined,
2285 opts?: object,
2286): node is TSImportEqualsDeclaration;
2287export function isTSIndexSignature(node: object | null | undefined, opts?: object): node is TSIndexSignature;
2288export function isTSIndexedAccessType(node: object | null | undefined, opts?: object): node is TSIndexedAccessType;
2289export function isTSInterfaceBody(node: object | null | undefined, opts?: object): node is TSInterfaceBody;
2290export function isTSInterfaceDeclaration(
2291 node: object | null | undefined,
2292 opts?: object,
2293): node is TSInterfaceDeclaration;
2294export function isTSIntersectionType(node: object | null | undefined, opts?: object): node is TSIntersectionType;
2295export function isTSLiteralType(node: object | null | undefined, opts?: object): node is TSLiteralType;
2296export function isTSMappedType(node: object | null | undefined, opts?: object): node is TSMappedType;
2297export function isTSMethodSignature(node: object | null | undefined, opts?: object): node is TSMethodSignature;
2298export function isTSModuleBlock(node: object | null | undefined, opts?: object): node is TSModuleBlock;
2299export function isTSModuleDeclaration(node: object | null | undefined, opts?: object): node is TSModuleDeclaration;
2300export function isTSNamespaceExportDeclaration(
2301 node: object | null | undefined,
2302 opts?: object,
2303): node is TSNamespaceExportDeclaration;
2304export function isTSNeverKeyword(node: object | null | undefined, opts?: object): node is TSNeverKeyword;
2305export function isTSNonNullExpression(node: object | null | undefined, opts?: object): node is TSNonNullExpression;
2306export function isTSNullKeyword(node: object | null | undefined, opts?: object): node is TSNullKeyword;
2307export function isTSNumberKeyword(node: object | null | undefined, opts?: object): node is TSNumberKeyword;
2308export function isTSObjectKeyword(node: object | null | undefined, opts?: object): node is TSObjectKeyword;
2309export function isTSParameterProperty(node: object | null | undefined, opts?: object): node is TSParameterProperty;
2310export function isTSParenthesizedType(node: object | null | undefined, opts?: object): node is TSParenthesizedType;
2311export function isTSPropertySignature(node: object | null | undefined, opts?: object): node is TSPropertySignature;
2312export function isTSQualifiedName(node: object | null | undefined, opts?: object): node is TSQualifiedName;
2313export function isTSStringKeyword(node: object | null | undefined, opts?: object): node is TSStringKeyword;
2314export function isTSSymbolKeyword(node: object | null | undefined, opts?: object): node is TSSymbolKeyword;
2315export function isTSThisType(node: object | null | undefined, opts?: object): node is TSThisType;
2316export function isTSTupleType(node: object | null | undefined, opts?: object): node is TSTupleType;
2317export function isTSTypeAliasDeclaration(
2318 node: object | null | undefined,
2319 opts?: object,
2320): node is TSTypeAliasDeclaration;
2321export function isTSTypeAnnotation(node: object | null | undefined, opts?: object): node is TSTypeAnnotation;
2322export function isTSTypeAssertion(node: object | null | undefined, opts?: object): node is TSTypeAssertion;
2323export function isTSTypeLiteral(node: object | null | undefined, opts?: object): node is TSTypeLiteral;
2324export function isTSTypeOperator(node: object | null | undefined, opts?: object): node is TSTypeOperator;
2325export function isTSTypeParameter(node: object | null | undefined, opts?: object): node is TSTypeParameter;
2326export function isTSTypeParameterDeclaration(
2327 node: object | null | undefined,
2328 opts?: object,
2329): node is TSTypeParameterDeclaration;
2330export function isTSTypeParameterInstantiation(
2331 node: object | null | undefined,
2332 opts?: object,
2333): node is TSTypeParameterInstantiation;
2334export function isTSTypePredicate(node: object | null | undefined, opts?: object): node is TSTypePredicate;
2335export function isTSTypeQuery(node: object | null | undefined, opts?: object): node is TSTypeQuery;
2336export function isTSTypeReference(node: object | null | undefined, opts?: object): node is TSTypeReference;
2337export function isTSUndefinedKeyword(node: object | null | undefined, opts?: object): node is TSUndefinedKeyword;
2338export function isTSUnionType(node: object | null | undefined, opts?: object): node is TSUnionType;
2339export function isTSVoidKeyword(node: object | null | undefined, opts?: object): node is TSVoidKeyword;
2340
2341// React specific
2342export interface ReactHelpers {
2343 isCompatTag(tagName?: string): boolean;
2344 buildChildren(node: object): Node[];
2345}
2346export const react: ReactHelpers;
2347
2348export function assertArrayExpression(node: object | null | undefined, opts?: object): asserts node is ArrayExpression;
2349export function assertAssignmentExpression(
2350 node: object | null | undefined,
2351 opts?: object,
2352): asserts node is AssignmentExpression;
2353export function assertBinaryExpression(
2354 node: object | null | undefined,
2355 opts?: object,
2356): asserts node is BinaryExpression;
2357export function assertDirective(node: object | null | undefined, opts?: object): asserts node is Directive;
2358export function assertDirectiveLiteral(
2359 node: object | null | undefined,
2360 opts?: object,
2361): asserts node is DirectiveLiteral;
2362export function assertBlockStatement(node: object | null | undefined, opts?: object): asserts node is BlockStatement;
2363export function assertBreakStatement(node: object | null | undefined, opts?: object): asserts node is BreakStatement;
2364export function assertCallExpression(node: object | null | undefined, opts?: object): asserts node is CallExpression;
2365export function assertCatchClause(node: object | null | undefined, opts?: object): asserts node is CatchClause;
2366export function assertConditionalExpression(
2367 node: object | null | undefined,
2368 opts?: object,
2369): asserts node is ConditionalExpression;
2370export function assertContinueStatement(
2371 node: object | null | undefined,
2372 opts?: object,
2373): asserts node is ContinueStatement;
2374export function assertDebuggerStatement(
2375 node: object | null | undefined,
2376 opts?: object,
2377): asserts node is DebuggerStatement;
2378export function assertDoWhileStatement(
2379 node: object | null | undefined,
2380 opts?: object,
2381): asserts node is DoWhileStatement;
2382export function assertEmptyStatement(node: object | null | undefined, opts?: object): asserts node is EmptyStatement;
2383export function assertExpressionStatement(
2384 node: object | null | undefined,
2385 opts?: object,
2386): asserts node is ExpressionStatement;
2387export function assertFile(node: object | null | undefined, opts?: object): asserts node is File;
2388export function assertForInStatement(node: object | null | undefined, opts?: object): asserts node is ForInStatement;
2389export function assertForStatement(node: object | null | undefined, opts?: object): asserts node is ForStatement;
2390export function assertFunctionDeclaration(
2391 node: object | null | undefined,
2392 opts?: object,
2393): asserts node is FunctionDeclaration;
2394export function assertFunctionExpression(
2395 node: object | null | undefined,
2396 opts?: object,
2397): asserts node is FunctionExpression;
2398export function assertIdentifier(node: object | null | undefined, opts?: object): asserts node is Identifier;
2399export function assertIfStatement(node: object | null | undefined, opts?: object): asserts node is IfStatement;
2400export function assertLabeledStatement(
2401 node: object | null | undefined,
2402 opts?: object,
2403): asserts node is LabeledStatement;
2404export function assertStringLiteral(node: object | null | undefined, opts?: object): asserts node is StringLiteral;
2405export function assertNumericLiteral(node: object | null | undefined, opts?: object): asserts node is NumericLiteral;
2406
2407/** @deprecated Use `assertNumericLiteral` */
2408export function assertNumberLiteral(node: object | null | undefined, opts?: object): asserts node is NumericLiteral;
2409export function assertNullLiteral(node: object | null | undefined, opts?: object): asserts node is NullLiteral;
2410export function assertBooleanLiteral(node: object | null | undefined, opts?: object): asserts node is BooleanLiteral;
2411export function assertRegExpLiteral(node: object | null | undefined, opts?: object): asserts node is RegExpLiteral;
2412
2413/** @deprecated Use `assertRegExpLiteral` */
2414export function assertRegexLiteral(node: object | null | undefined, opts?: object): asserts node is RegExpLiteral;
2415export function assertLogicalExpression(
2416 node: object | null | undefined,
2417 opts?: object,
2418): asserts node is LogicalExpression;
2419export function assertMemberExpression(
2420 node: object | null | undefined,
2421 opts?: object,
2422): asserts node is MemberExpression;
2423export function assertNewExpression(node: object | null | undefined, opts?: object): asserts node is NewExpression;
2424export function assertProgram(node: object | null | undefined, opts?: object): asserts node is Program;
2425export function assertObjectExpression(
2426 node: object | null | undefined,
2427 opts?: object,
2428): asserts node is ObjectExpression;
2429export function assertObjectMethod(node: object | null | undefined, opts?: object): asserts node is ObjectMethod;
2430export function assertObjectProperty(node: object | null | undefined, opts?: object): asserts node is ObjectProperty;
2431export function assertRestElement(node: object | null | undefined, opts?: object): asserts node is RestElement;
2432export function assertReturnStatement(node: object | null | undefined, opts?: object): asserts node is ReturnStatement;
2433export function assertSequenceExpression(
2434 node: object | null | undefined,
2435 opts?: object,
2436): asserts node is SequenceExpression;
2437export function assertSwitchCase(node: object | null | undefined, opts?: object): asserts node is SwitchCase;
2438export function assertSwitchStatement(node: object | null | undefined, opts?: object): asserts node is SwitchStatement;
2439export function assertThisExpression(node: object | null | undefined, opts?: object): asserts node is ThisExpression;
2440export function assertThrowStatement(node: object | null | undefined, opts?: object): asserts node is ThrowStatement;
2441export function assertTryStatement(node: object | null | undefined, opts?: object): asserts node is TryStatement;
2442export function assertUnaryExpression(node: object | null | undefined, opts?: object): asserts node is UnaryExpression;
2443export function assertUpdateExpression(
2444 node: object | null | undefined,
2445 opts?: object,
2446): asserts node is UpdateExpression;
2447export function assertVariableDeclaration(
2448 node: object | null | undefined,
2449 opts?: object,
2450): asserts node is VariableDeclaration;
2451export function assertVariableDeclarator(
2452 node: object | null | undefined,
2453 opts?: object,
2454): asserts node is VariableDeclarator;
2455export function assertWhileStatement(node: object | null | undefined, opts?: object): asserts node is WhileStatement;
2456export function assertWithStatement(node: object | null | undefined, opts?: object): asserts node is WithStatement;
2457export function assertAssignmentPattern(
2458 node: object | null | undefined,
2459 opts?: object,
2460): asserts node is AssignmentPattern;
2461export function assertArrayPattern(node: object | null | undefined, opts?: object): asserts node is ArrayPattern;
2462export function assertArrowFunctionExpression(
2463 node: object | null | undefined,
2464 opts?: object,
2465): asserts node is ArrowFunctionExpression;
2466export function assertClassBody(node: object | null | undefined, opts?: object): asserts node is ClassBody;
2467export function assertClassDeclaration(
2468 node: object | null | undefined,
2469 opts?: object,
2470): asserts node is ClassDeclaration;
2471export function assertClassExpression(node: object | null | undefined, opts?: object): asserts node is ClassExpression;
2472export function assertExportAllDeclaration(
2473 node: object | null | undefined,
2474 opts?: object,
2475): asserts node is ExportAllDeclaration;
2476export function assertExportDefaultDeclaration(
2477 node: object | null | undefined,
2478 opts?: object,
2479): asserts node is ExportDefaultDeclaration;
2480export function assertExportNamedDeclaration(
2481 node: object | null | undefined,
2482 opts?: object,
2483): asserts node is ExportNamedDeclaration;
2484export function assertExportSpecifier(node: object | null | undefined, opts?: object): asserts node is ExportSpecifier;
2485export function assertForOfStatement(node: object | null | undefined, opts?: object): asserts node is ForOfStatement;
2486export function assertImportDeclaration(
2487 node: object | null | undefined,
2488 opts?: object,
2489): asserts node is ImportDeclaration;
2490export function assertImportDefaultSpecifier(
2491 node: object | null | undefined,
2492 opts?: object,
2493): asserts node is ImportDefaultSpecifier;
2494export function assertImportNamespaceSpecifier(
2495 node: object | null | undefined,
2496 opts?: object,
2497): asserts node is ImportNamespaceSpecifier;
2498export function assertImportSpecifier(node: object | null | undefined, opts?: object): asserts node is ImportSpecifier;
2499export function assertMetaProperty(node: object | null | undefined, opts?: object): asserts node is MetaProperty;
2500export function assertClassMethod(node: object | null | undefined, opts?: object): asserts node is ClassMethod;
2501export function assertObjectPattern(node: object | null | undefined, opts?: object): asserts node is ObjectPattern;
2502export function assertSpreadElement(node: object | null | undefined, opts?: object): asserts node is SpreadElement;
2503export function assertSuper(node: object | null | undefined, opts?: object): asserts node is Super;
2504export function assertTaggedTemplateExpression(
2505 node: object | null | undefined,
2506 opts?: object,
2507): asserts node is TaggedTemplateExpression;
2508export function assertTemplateElement(node: object | null | undefined, opts?: object): asserts node is TemplateElement;
2509export function assertTemplateLiteral(node: object | null | undefined, opts?: object): asserts node is TemplateLiteral;
2510export function assertYieldExpression(node: object | null | undefined, opts?: object): asserts node is YieldExpression;
2511export function assertAnyTypeAnnotation(
2512 node: object | null | undefined,
2513 opts?: object,
2514): asserts node is AnyTypeAnnotation;
2515export function assertArrayTypeAnnotation(
2516 node: object | null | undefined,
2517 opts?: object,
2518): asserts node is ArrayTypeAnnotation;
2519export function assertBooleanTypeAnnotation(
2520 node: object | null | undefined,
2521 opts?: object,
2522): asserts node is BooleanTypeAnnotation;
2523export function assertBooleanLiteralTypeAnnotation(
2524 node: object | null | undefined,
2525 opts?: object,
2526): asserts node is BooleanLiteralTypeAnnotation;
2527export function assertNullLiteralTypeAnnotation(
2528 node: object | null | undefined,
2529 opts?: object,
2530): asserts node is NullLiteralTypeAnnotation;
2531export function assertClassImplements(node: object | null | undefined, opts?: object): asserts node is ClassImplements;
2532export function assertClassProperty(node: object | null | undefined, opts?: object): asserts node is ClassProperty;
2533export function assertDeclareClass(node: object | null | undefined, opts?: object): asserts node is DeclareClass;
2534export function assertDeclareFunction(node: object | null | undefined, opts?: object): asserts node is DeclareFunction;
2535export function assertDeclareInterface(
2536 node: object | null | undefined,
2537 opts?: object,
2538): asserts node is DeclareInterface;
2539export function assertDeclareModule(node: object | null | undefined, opts?: object): asserts node is DeclareModule;
2540export function assertDeclareTypeAlias(
2541 node: object | null | undefined,
2542 opts?: object,
2543): asserts node is DeclareTypeAlias;
2544export function assertDeclareVariable(node: object | null | undefined, opts?: object): asserts node is DeclareVariable;
2545export function assertExistentialTypeParam(
2546 node: object | null | undefined,
2547 opts?: object,
2548): asserts node is ExistentialTypeParam;
2549export function assertFunctionTypeAnnotation(
2550 node: object | null | undefined,
2551 opts?: object,
2552): asserts node is FunctionTypeAnnotation;
2553export function assertFunctionTypeParam(
2554 node: object | null | undefined,
2555 opts?: object,
2556): asserts node is FunctionTypeParam;
2557export function assertGenericTypeAnnotation(
2558 node: object | null | undefined,
2559 opts?: object,
2560): asserts node is GenericTypeAnnotation;
2561export function assertInterfaceExtends(
2562 node: object | null | undefined,
2563 opts?: object,
2564): asserts node is InterfaceExtends;
2565export function assertInterfaceDeclaration(
2566 node: object | null | undefined,
2567 opts?: object,
2568): asserts node is InterfaceDeclaration;
2569export function assertIntersectionTypeAnnotation(
2570 node: object | null | undefined,
2571 opts?: object,
2572): asserts node is IntersectionTypeAnnotation;
2573export function assertMixedTypeAnnotation(
2574 node: object | null | undefined,
2575 opts?: object,
2576): asserts node is MixedTypeAnnotation;
2577export function assertNullableTypeAnnotation(
2578 node: object | null | undefined,
2579 opts?: object,
2580): asserts node is NullableTypeAnnotation;
2581export function assertNumericLiteralTypeAnnotation(
2582 node: object | null | undefined,
2583 opts?: object,
2584): asserts node is NumericLiteralTypeAnnotation;
2585export function assertNumberTypeAnnotation(
2586 node: object | null | undefined,
2587 opts?: object,
2588): asserts node is NumberTypeAnnotation;
2589export function assertStringLiteralTypeAnnotation(
2590 node: object | null | undefined,
2591 opts?: object,
2592): asserts node is StringLiteralTypeAnnotation;
2593export function assertStringTypeAnnotation(
2594 node: object | null | undefined,
2595 opts?: object,
2596): asserts node is StringTypeAnnotation;
2597export function assertThisTypeAnnotation(
2598 node: object | null | undefined,
2599 opts?: object,
2600): asserts node is ThisTypeAnnotation;
2601export function assertTupleTypeAnnotation(
2602 node: object | null | undefined,
2603 opts?: object,
2604): asserts node is TupleTypeAnnotation;
2605export function assertTypeofTypeAnnotation(
2606 node: object | null | undefined,
2607 opts?: object,
2608): asserts node is TypeofTypeAnnotation;
2609export function assertTypeAlias(node: object | null | undefined, opts?: object): asserts node is TypeAlias;
2610export function assertTypeAnnotation(node: object | null | undefined, opts?: object): asserts node is TypeAnnotation;
2611export function assertTypeCastExpression(
2612 node: object | null | undefined,
2613 opts?: object,
2614): asserts node is TypeCastExpression;
2615export function assertTypeParameter(node: object | null | undefined, opts?: object): asserts node is TypeParameter;
2616export function assertTypeParameterDeclaration(
2617 node: object | null | undefined,
2618 opts?: object,
2619): asserts node is TypeParameterDeclaration;
2620export function assertTypeParameterInstantiation(
2621 node: object | null | undefined,
2622 opts?: object,
2623): asserts node is TypeParameterInstantiation;
2624export function assertObjectTypeAnnotation(
2625 node: object | null | undefined,
2626 opts?: object,
2627): asserts node is ObjectTypeAnnotation;
2628export function assertObjectTypeCallProperty(
2629 node: object | null | undefined,
2630 opts?: object,
2631): asserts node is ObjectTypeCallProperty;
2632export function assertObjectTypeIndexer(
2633 node: object | null | undefined,
2634 opts?: object,
2635): asserts node is ObjectTypeIndexer;
2636export function assertObjectTypeProperty(
2637 node: object | null | undefined,
2638 opts?: object,
2639): asserts node is ObjectTypeProperty;
2640export function assertQualifiedTypeIdentifier(
2641 node: object | null | undefined,
2642 opts?: object,
2643): asserts node is QualifiedTypeIdentifier;
2644export function assertUnionTypeAnnotation(
2645 node: object | null | undefined,
2646 opts?: object,
2647): asserts node is UnionTypeAnnotation;
2648export function assertVoidTypeAnnotation(
2649 node: object | null | undefined,
2650 opts?: object,
2651): asserts node is VoidTypeAnnotation;
2652export function assertJSXAttribute(node: object | null | undefined, opts?: object): asserts node is JSXAttribute;
2653export function assertJSXClosingElement(
2654 node: object | null | undefined,
2655 opts?: object,
2656): asserts node is JSXClosingElement;
2657export function assertJSXElement(node: object | null | undefined, opts?: object): asserts node is JSXElement;
2658export function assertJSXEmptyExpression(
2659 node: object | null | undefined,
2660 opts?: object,
2661): asserts node is JSXEmptyExpression;
2662export function assertJSXExpressionContainer(
2663 node: object | null | undefined,
2664 opts?: object,
2665): asserts node is JSXExpressionContainer;
2666export function assertJSXIdentifier(node: object | null | undefined, opts?: object): asserts node is JSXIdentifier;
2667export function assertJSXMemberExpression(
2668 node: object | null | undefined,
2669 opts?: object,
2670): asserts node is JSXMemberExpression;
2671export function assertJSXNamespacedName(
2672 node: object | null | undefined,
2673 opts?: object,
2674): asserts node is JSXNamespacedName;
2675export function assertJSXOpeningElement(
2676 node: object | null | undefined,
2677 opts?: object,
2678): asserts node is JSXOpeningElement;
2679export function assertJSXSpreadAttribute(
2680 node: object | null | undefined,
2681 opts?: object,
2682): asserts node is JSXSpreadAttribute;
2683export function assertJSXText(node: object | null | undefined, opts?: object): asserts node is JSXText;
2684export function assertNoop(node: object | null | undefined, opts?: object): asserts node is Noop;
2685export function assertParenthesizedExpression(
2686 node: object | null | undefined,
2687 opts?: object,
2688): asserts node is ParenthesizedExpression;
2689export function assertAwaitExpression(node: object | null | undefined, opts?: object): asserts node is AwaitExpression;
2690export function assertBindExpression(node: object | null | undefined, opts?: object): asserts node is BindExpression;
2691export function assertDecorator(node: object | null | undefined, opts?: object): asserts node is Decorator;
2692export function assertDoExpression(node: object | null | undefined, opts?: object): asserts node is DoExpression;
2693export function assertExportDefaultSpecifier(
2694 node: object | null | undefined,
2695 opts?: object,
2696): asserts node is ExportDefaultSpecifier;
2697export function assertExportNamespaceSpecifier(
2698 node: object | null | undefined,
2699 opts?: object,
2700): asserts node is ExportNamespaceSpecifier;
2701export function assertRestProperty(node: object | null | undefined, opts?: object): asserts node is RestProperty;
2702export function assertSpreadProperty(node: object | null | undefined, opts?: object): asserts node is SpreadProperty;
2703export function assertExpression(node: object | null | undefined, opts?: object): asserts node is Expression;
2704export function assertBinary(node: object | null | undefined, opts?: object): asserts node is Binary;
2705export function assertScopable(node: object | null | undefined, opts?: object): asserts node is Scopable;
2706export function assertBlockParent(node: object | null | undefined, opts?: object): asserts node is BlockParent;
2707export function assertBlock(node: object | null | undefined, opts?: object): asserts node is Block;
2708export function assertStatement(node: object | null | undefined, opts?: object): asserts node is Statement;
2709export function assertTerminatorless(node: object | null | undefined, opts?: object): asserts node is Terminatorless;
2710export function assertCompletionStatement(
2711 node: object | null | undefined,
2712 opts?: object,
2713): asserts node is CompletionStatement;
2714export function assertConditional(node: object | null | undefined, opts?: object): asserts node is Conditional;
2715export function assertLoop(node: object | null | undefined, opts?: object): asserts node is Loop;
2716export function assertWhile(node: object | null | undefined, opts?: object): asserts node is While;
2717export function assertExpressionWrapper(
2718 node: object | null | undefined,
2719 opts?: object,
2720): asserts node is ExpressionWrapper;
2721export function assertFor(node: object | null | undefined, opts?: object): asserts node is For;
2722export function assertForXStatement(node: object | null | undefined, opts?: object): asserts node is ForXStatement;
2723export function assertFunction(node: object | null | undefined, opts?: object): asserts node is Function;
2724export function assertFunctionParent(node: object | null | undefined, opts?: object): asserts node is FunctionParent;
2725export function assertPureish(node: object | null | undefined, opts?: object): asserts node is Pureish;
2726export function assertDeclaration(node: object | null | undefined, opts?: object): asserts node is Declaration;
2727export function assertLVal(node: object | null | undefined, opts?: object): asserts node is LVal;
2728export function assertLiteral(node: object | null | undefined, opts?: object): asserts node is Literal;
2729export function assertImmutable(node: object | null | undefined, opts?: object): asserts node is Immutable;
2730export function assertUserWhitespacable(
2731 node: object | null | undefined,
2732 opts?: object,
2733): asserts node is UserWhitespacable;
2734export function assertMethod(node: object | null | undefined, opts?: object): asserts node is Method;
2735export function assertObjectMember(node: object | null | undefined, opts?: object): asserts node is ObjectMember;
2736export function assertProperty(node: object | null | undefined, opts?: object): asserts node is Property;
2737export function assertUnaryLike(node: object | null | undefined, opts?: object): asserts node is UnaryLike;
2738export function assertPattern(node: object | null | undefined, opts?: object): asserts node is Pattern;
2739export function assertClass(node: object | null | undefined, opts?: object): asserts node is Class;
2740export function assertModuleDeclaration(
2741 node: object | null | undefined,
2742 opts?: object,
2743): asserts node is ModuleDeclaration;
2744export function assertExportDeclaration(
2745 node: object | null | undefined,
2746 opts?: object,
2747): asserts node is ExportDeclaration;
2748export function assertModuleSpecifier(node: object | null | undefined, opts?: object): asserts node is ModuleSpecifier;
2749export function assertFlow(node: object | null | undefined, opts?: object): asserts node is Flow;
2750export function assertFlowBaseAnnotation(
2751 node: object | null | undefined,
2752 opts?: object,
2753): asserts node is FlowBaseAnnotation;
2754export function assertFlowDeclaration(node: object | null | undefined, opts?: object): asserts node is FlowDeclaration;
2755export function assertJSX(node: object | null | undefined, opts?: object): asserts node is JSX;
2756
2757export function assertTSAnyKeyword(node: object | null | undefined, opts?: object): asserts node is TSAnyKeyword;
2758export function assertTSArrayType(node: object | null | undefined, opts?: object): asserts node is TSArrayType;
2759export function assertTSAsExpression(node: object | null | undefined, opts?: object): asserts node is TSAsExpression;
2760export function assertTSBooleanKeyword(
2761 node: object | null | undefined,
2762 opts?: object,
2763): asserts node is TSBooleanKeyword;
2764export function assertTSCallSignatureDeclaration(
2765 node: object | null | undefined,
2766 opts?: object,
2767): asserts node is TSCallSignatureDeclaration;
2768export function assertTSConstructSignatureDeclaration(
2769 node: object | null | undefined,
2770 opts?: object,
2771): asserts node is TSConstructSignatureDeclaration;
2772export function assertTSConstructorType(
2773 node: object | null | undefined,
2774 opts?: object,
2775): asserts node is TSConstructorType;
2776export function assertTSDeclareFunction(
2777 node: object | null | undefined,
2778 opts?: object,
2779): asserts node is TSDeclareFunction;
2780export function assertTSDeclareMethod(node: object | null | undefined, opts?: object): asserts node is TSDeclareMethod;
2781export function assertTSEnumDeclaration(
2782 node: object | null | undefined,
2783 opts?: object,
2784): asserts node is TSEnumDeclaration;
2785export function assertTSEnumMember(node: object | null | undefined, opts?: object): asserts node is TSEnumMember;
2786export function assertTSExportAssignment(
2787 node: object | null | undefined,
2788 opts?: object,
2789): asserts node is TSExportAssignment;
2790export function assertTSExpressionWithTypeArguments(
2791 node: object | null | undefined,
2792 opts?: object,
2793): asserts node is TSExpressionWithTypeArguments;
2794export function assertTSExternalModuleReference(
2795 node: object | null | undefined,
2796 opts?: object,
2797): asserts node is TSExternalModuleReference;
2798export function assertTSFunctionType(node: object | null | undefined, opts?: object): asserts node is TSFunctionType;
2799export function assertTSImportEqualsDeclaration(
2800 node: object | null | undefined,
2801 opts?: object,
2802): asserts node is TSImportEqualsDeclaration;
2803export function assertTSIndexSignature(
2804 node: object | null | undefined,
2805 opts?: object,
2806): asserts node is TSIndexSignature;
2807export function assertTSIndexedAccessType(
2808 node: object | null | undefined,
2809 opts?: object,
2810): asserts node is TSIndexedAccessType;
2811export function assertTSInterfaceBody(node: object | null | undefined, opts?: object): asserts node is TSInterfaceBody;
2812export function assertTSInterfaceDeclaration(
2813 node: object | null | undefined,
2814 opts?: object,
2815): asserts node is TSInterfaceDeclaration;
2816export function assertTSIntersectionType(
2817 node: object | null | undefined,
2818 opts?: object,
2819): asserts node is TSIntersectionType;
2820export function assertTSLiteralType(node: object | null | undefined, opts?: object): asserts node is TSLiteralType;
2821export function assertTSMappedType(node: object | null | undefined, opts?: object): asserts node is TSMappedType;
2822export function assertTSMethodSignature(
2823 node: object | null | undefined,
2824 opts?: object,
2825): asserts node is TSMethodSignature;
2826export function assertTSModuleBlock(node: object | null | undefined, opts?: object): asserts node is TSModuleBlock;
2827export function assertTSModuleDeclaration(
2828 node: object | null | undefined,
2829 opts?: object,
2830): asserts node is TSModuleDeclaration;
2831export function assertTSNamespaceExportDeclaration(
2832 node: object | null | undefined,
2833 opts?: object,
2834): asserts node is TSNamespaceExportDeclaration;
2835export function assertTSNeverKeyword(node: object | null | undefined, opts?: object): asserts node is TSNeverKeyword;
2836export function assertTSNonNullExpression(
2837 node: object | null | undefined,
2838 opts?: object,
2839): asserts node is TSNonNullExpression;
2840export function assertTSNullKeyword(node: object | null | undefined, opts?: object): asserts node is TSNullKeyword;
2841export function assertTSNumberKeyword(node: object | null | undefined, opts?: object): asserts node is TSNumberKeyword;
2842export function assertTSObjectKeyword(node: object | null | undefined, opts?: object): asserts node is TSObjectKeyword;
2843export function assertTSParameterProperty(
2844 node: object | null | undefined,
2845 opts?: object,
2846): asserts node is TSParameterProperty;
2847export function assertTSParenthesizedType(
2848 node: object | null | undefined,
2849 opts?: object,
2850): asserts node is TSParenthesizedType;
2851export function assertTSPropertySignature(
2852 node: object | null | undefined,
2853 opts?: object,
2854): asserts node is TSPropertySignature;
2855export function assertTSQualifiedName(node: object | null | undefined, opts?: object): asserts node is TSQualifiedName;
2856export function assertTSStringKeyword(node: object | null | undefined, opts?: object): asserts node is TSStringKeyword;
2857export function assertTSSymbolKeyword(node: object | null | undefined, opts?: object): asserts node is TSSymbolKeyword;
2858export function assertTSThisType(node: object | null | undefined, opts?: object): asserts node is TSThisType;
2859export function assertTSTupleType(node: object | null | undefined, opts?: object): asserts node is TSTupleType;
2860export function assertTSTypeAliasDeclaration(
2861 node: object | null | undefined,
2862 opts?: object,
2863): asserts node is TSTypeAliasDeclaration;
2864export function assertTSTypeAnnotation(
2865 node: object | null | undefined,
2866 opts?: object,
2867): asserts node is TSTypeAnnotation;
2868export function assertTSTypeAssertion(node: object | null | undefined, opts?: object): asserts node is TSTypeAssertion;
2869export function assertTSTypeLiteral(node: object | null | undefined, opts?: object): asserts node is TSTypeLiteral;
2870export function assertTSTypeOperator(node: object | null | undefined, opts?: object): asserts node is TSTypeOperator;
2871export function assertTSTypeParameter(node: object | null | undefined, opts?: object): asserts node is TSTypeParameter;
2872export function assertTSTypeParameterDeclaration(
2873 node: object | null | undefined,
2874 opts?: object,
2875): asserts node is TSTypeParameterDeclaration;
2876export function assertTSTypeParameterInstantiation(
2877 node: object | null | undefined,
2878 opts?: object,
2879): asserts node is TSTypeParameterInstantiation;
2880export function assertTSTypePredicate(node: object | null | undefined, opts?: object): asserts node is TSTypePredicate;
2881export function assertTSTypeQuery(node: object | null | undefined, opts?: object): asserts node is TSTypeQuery;
2882export function assertTSTypeReference(node: object | null | undefined, opts?: object): asserts node is TSTypeReference;
2883export function assertTSUndefinedKeyword(
2884 node: object | null | undefined,
2885 opts?: object,
2886): asserts node is TSUndefinedKeyword;
2887export function assertTSUnionType(node: object | null | undefined, opts?: object): asserts node is TSUnionType;
2888export function assertTSVoidKeyword(node: object | null | undefined, opts?: object): asserts node is TSVoidKeyword;