/
kindToNodeMappings.ts
259 lines (256 loc) · 15.1 KB
/
kindToNodeMappings.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
// DO NOT EDIT - Automatically maintained by createKindToNodeMappings.ts
// Edit factories/kindToWrapperMappings.ts then run yarn code-generate instead.
import { SyntaxKind, ts } from "@ts-morph/common";
import * as compiler from "./index";
export interface ImplementedKindToNodeMappings {
[SyntaxKind.SourceFile]: compiler.SourceFile;
[SyntaxKind.ArrayBindingPattern]: compiler.ArrayBindingPattern;
[SyntaxKind.ArrayLiteralExpression]: compiler.ArrayLiteralExpression;
[SyntaxKind.ArrayType]: compiler.ArrayTypeNode;
[SyntaxKind.ArrowFunction]: compiler.ArrowFunction;
[SyntaxKind.AsExpression]: compiler.AsExpression;
[SyntaxKind.AwaitExpression]: compiler.AwaitExpression;
[SyntaxKind.BigIntLiteral]: compiler.BigIntLiteral;
[SyntaxKind.BindingElement]: compiler.BindingElement;
[SyntaxKind.BinaryExpression]: compiler.BinaryExpression;
[SyntaxKind.Block]: compiler.Block;
[SyntaxKind.BreakStatement]: compiler.BreakStatement;
[SyntaxKind.CallExpression]: compiler.CallExpression;
[SyntaxKind.CallSignature]: compiler.CallSignatureDeclaration;
[SyntaxKind.CaseBlock]: compiler.CaseBlock;
[SyntaxKind.CaseClause]: compiler.CaseClause;
[SyntaxKind.CatchClause]: compiler.CatchClause;
[SyntaxKind.ClassDeclaration]: compiler.ClassDeclaration;
[SyntaxKind.ClassExpression]: compiler.ClassExpression;
[SyntaxKind.ClassStaticBlockDeclaration]: compiler.ClassStaticBlockDeclaration;
[SyntaxKind.ConditionalType]: compiler.ConditionalTypeNode;
[SyntaxKind.Constructor]: compiler.ConstructorDeclaration;
[SyntaxKind.ConstructorType]: compiler.ConstructorTypeNode;
[SyntaxKind.ConstructSignature]: compiler.ConstructSignatureDeclaration;
[SyntaxKind.ContinueStatement]: compiler.ContinueStatement;
[SyntaxKind.CommaListExpression]: compiler.CommaListExpression;
[SyntaxKind.ComputedPropertyName]: compiler.ComputedPropertyName;
[SyntaxKind.ConditionalExpression]: compiler.ConditionalExpression;
[SyntaxKind.DebuggerStatement]: compiler.DebuggerStatement;
[SyntaxKind.Decorator]: compiler.Decorator;
[SyntaxKind.DefaultClause]: compiler.DefaultClause;
[SyntaxKind.DeleteExpression]: compiler.DeleteExpression;
[SyntaxKind.DoStatement]: compiler.DoStatement;
[SyntaxKind.ElementAccessExpression]: compiler.ElementAccessExpression;
[SyntaxKind.EmptyStatement]: compiler.EmptyStatement;
[SyntaxKind.EnumDeclaration]: compiler.EnumDeclaration;
[SyntaxKind.EnumMember]: compiler.EnumMember;
[SyntaxKind.ExportAssignment]: compiler.ExportAssignment;
[SyntaxKind.ExportDeclaration]: compiler.ExportDeclaration;
[SyntaxKind.ExportSpecifier]: compiler.ExportSpecifier;
[SyntaxKind.ExpressionWithTypeArguments]: compiler.ExpressionWithTypeArguments;
[SyntaxKind.ExpressionStatement]: compiler.ExpressionStatement;
[SyntaxKind.ExternalModuleReference]: compiler.ExternalModuleReference;
[SyntaxKind.QualifiedName]: compiler.QualifiedName;
[SyntaxKind.ForInStatement]: compiler.ForInStatement;
[SyntaxKind.ForOfStatement]: compiler.ForOfStatement;
[SyntaxKind.ForStatement]: compiler.ForStatement;
[SyntaxKind.FunctionDeclaration]: compiler.FunctionDeclaration;
[SyntaxKind.FunctionExpression]: compiler.FunctionExpression;
[SyntaxKind.FunctionType]: compiler.FunctionTypeNode;
[SyntaxKind.GetAccessor]: compiler.GetAccessorDeclaration;
[SyntaxKind.HeritageClause]: compiler.HeritageClause;
[SyntaxKind.Identifier]: compiler.Identifier;
[SyntaxKind.IfStatement]: compiler.IfStatement;
[SyntaxKind.ImportClause]: compiler.ImportClause;
[SyntaxKind.ImportDeclaration]: compiler.ImportDeclaration;
[SyntaxKind.ImportEqualsDeclaration]: compiler.ImportEqualsDeclaration;
[SyntaxKind.ImportSpecifier]: compiler.ImportSpecifier;
[SyntaxKind.ImportType]: compiler.ImportTypeNode;
[SyntaxKind.IndexedAccessType]: compiler.IndexedAccessTypeNode;
[SyntaxKind.IndexSignature]: compiler.IndexSignatureDeclaration;
[SyntaxKind.InferType]: compiler.InferTypeNode;
[SyntaxKind.InterfaceDeclaration]: compiler.InterfaceDeclaration;
[SyntaxKind.IntersectionType]: compiler.IntersectionTypeNode;
[SyntaxKind.JSDocAugmentsTag]: compiler.JSDocAugmentsTag;
[SyntaxKind.JSDocAuthorTag]: compiler.JSDocAuthorTag;
[SyntaxKind.JSDocCallbackTag]: compiler.JSDocCallbackTag;
[SyntaxKind.JSDocClassTag]: compiler.JSDocClassTag;
[SyntaxKind.JSDocDeprecatedTag]: compiler.JSDocDeprecatedTag;
[SyntaxKind.JSDocEnumTag]: compiler.JSDocEnumTag;
[SyntaxKind.JSDocFunctionType]: compiler.JSDocFunctionType;
[SyntaxKind.JSDocImplementsTag]: compiler.JSDocImplementsTag;
[SyntaxKind.JSDocLink]: compiler.JSDocLink;
[SyntaxKind.JSDocLinkCode]: compiler.JSDocLinkCode;
[SyntaxKind.JSDocLinkPlain]: compiler.JSDocLinkPlain;
[SyntaxKind.JSDocMemberName]: compiler.JSDocMemberName;
[SyntaxKind.JSDocOverrideTag]: compiler.JSDocOverrideTag;
[SyntaxKind.JSDocParameterTag]: compiler.JSDocParameterTag;
[SyntaxKind.JSDocPrivateTag]: compiler.JSDocPrivateTag;
[SyntaxKind.JSDocPropertyTag]: compiler.JSDocPropertyTag;
[SyntaxKind.JSDocProtectedTag]: compiler.JSDocProtectedTag;
[SyntaxKind.JSDocPublicTag]: compiler.JSDocPublicTag;
[SyntaxKind.JSDocReturnTag]: compiler.JSDocReturnTag;
[SyntaxKind.JSDocReadonlyTag]: compiler.JSDocReadonlyTag;
[SyntaxKind.JSDocSeeTag]: compiler.JSDocSeeTag;
[SyntaxKind.JSDocSignature]: compiler.JSDocSignature;
[SyntaxKind.JSDocTag]: compiler.JSDocUnknownTag;
[SyntaxKind.JSDocTemplateTag]: compiler.JSDocTemplateTag;
[SyntaxKind.JSDocText]: compiler.JSDocText;
[SyntaxKind.JSDocThisTag]: compiler.JSDocThisTag;
[SyntaxKind.JSDocTypeExpression]: compiler.JSDocTypeExpression;
[SyntaxKind.JSDocTypeTag]: compiler.JSDocTypeTag;
[SyntaxKind.JSDocTypedefTag]: compiler.JSDocTypedefTag;
[SyntaxKind.JsxAttribute]: compiler.JsxAttribute;
[SyntaxKind.JsxClosingElement]: compiler.JsxClosingElement;
[SyntaxKind.JsxClosingFragment]: compiler.JsxClosingFragment;
[SyntaxKind.JsxElement]: compiler.JsxElement;
[SyntaxKind.JsxExpression]: compiler.JsxExpression;
[SyntaxKind.JsxFragment]: compiler.JsxFragment;
[SyntaxKind.JsxOpeningElement]: compiler.JsxOpeningElement;
[SyntaxKind.JsxOpeningFragment]: compiler.JsxOpeningFragment;
[SyntaxKind.JsxSelfClosingElement]: compiler.JsxSelfClosingElement;
[SyntaxKind.JsxSpreadAttribute]: compiler.JsxSpreadAttribute;
[SyntaxKind.JsxText]: compiler.JsxText;
[SyntaxKind.LabeledStatement]: compiler.LabeledStatement;
[SyntaxKind.LiteralType]: compiler.LiteralTypeNode;
[SyntaxKind.MappedType]: compiler.MappedTypeNode;
[SyntaxKind.MetaProperty]: compiler.MetaProperty;
[SyntaxKind.MethodDeclaration]: compiler.MethodDeclaration;
[SyntaxKind.MethodSignature]: compiler.MethodSignature;
[SyntaxKind.ModuleBlock]: compiler.ModuleBlock;
[SyntaxKind.ModuleDeclaration]: compiler.ModuleDeclaration;
[SyntaxKind.NamedExports]: compiler.NamedExports;
[SyntaxKind.NamedImports]: compiler.NamedImports;
[SyntaxKind.NamedTupleMember]: compiler.NamedTupleMember;
[SyntaxKind.NamespaceExport]: compiler.NamespaceExport;
[SyntaxKind.NamespaceImport]: compiler.NamespaceImport;
[SyntaxKind.NewExpression]: compiler.NewExpression;
[SyntaxKind.NonNullExpression]: compiler.NonNullExpression;
[SyntaxKind.NotEmittedStatement]: compiler.NotEmittedStatement;
[SyntaxKind.NoSubstitutionTemplateLiteral]: compiler.NoSubstitutionTemplateLiteral;
[SyntaxKind.NumericLiteral]: compiler.NumericLiteral;
[SyntaxKind.ObjectBindingPattern]: compiler.ObjectBindingPattern;
[SyntaxKind.ObjectLiteralExpression]: compiler.ObjectLiteralExpression;
[SyntaxKind.OmittedExpression]: compiler.OmittedExpression;
[SyntaxKind.Parameter]: compiler.ParameterDeclaration;
[SyntaxKind.ParenthesizedExpression]: compiler.ParenthesizedExpression;
[SyntaxKind.ParenthesizedType]: compiler.ParenthesizedTypeNode;
[SyntaxKind.PartiallyEmittedExpression]: compiler.PartiallyEmittedExpression;
[SyntaxKind.PostfixUnaryExpression]: compiler.PostfixUnaryExpression;
[SyntaxKind.PrefixUnaryExpression]: compiler.PrefixUnaryExpression;
[SyntaxKind.PrivateIdentifier]: compiler.PrivateIdentifier;
[SyntaxKind.PropertyAccessExpression]: compiler.PropertyAccessExpression;
[SyntaxKind.PropertyAssignment]: compiler.PropertyAssignment;
[SyntaxKind.PropertyDeclaration]: compiler.PropertyDeclaration;
[SyntaxKind.PropertySignature]: compiler.PropertySignature;
[SyntaxKind.RegularExpressionLiteral]: compiler.RegularExpressionLiteral;
[SyntaxKind.ReturnStatement]: compiler.ReturnStatement;
[SyntaxKind.SetAccessor]: compiler.SetAccessorDeclaration;
[SyntaxKind.ShorthandPropertyAssignment]: compiler.ShorthandPropertyAssignment;
[SyntaxKind.SpreadAssignment]: compiler.SpreadAssignment;
[SyntaxKind.SpreadElement]: compiler.SpreadElement;
[SyntaxKind.StringLiteral]: compiler.StringLiteral;
[SyntaxKind.SwitchStatement]: compiler.SwitchStatement;
[SyntaxKind.SyntaxList]: compiler.SyntaxList;
[SyntaxKind.TaggedTemplateExpression]: compiler.TaggedTemplateExpression;
[SyntaxKind.TemplateExpression]: compiler.TemplateExpression;
[SyntaxKind.TemplateHead]: compiler.TemplateHead;
[SyntaxKind.TemplateLiteralType]: compiler.TemplateLiteralTypeNode;
[SyntaxKind.TemplateMiddle]: compiler.TemplateMiddle;
[SyntaxKind.TemplateSpan]: compiler.TemplateSpan;
[SyntaxKind.TemplateTail]: compiler.TemplateTail;
[SyntaxKind.ThisType]: compiler.ThisTypeNode;
[SyntaxKind.ThrowStatement]: compiler.ThrowStatement;
[SyntaxKind.TryStatement]: compiler.TryStatement;
[SyntaxKind.TupleType]: compiler.TupleTypeNode;
[SyntaxKind.TypeAliasDeclaration]: compiler.TypeAliasDeclaration;
[SyntaxKind.TypeAssertionExpression]: compiler.TypeAssertion;
[SyntaxKind.TypeLiteral]: compiler.TypeLiteralNode;
[SyntaxKind.TypeOperator]: compiler.TypeOperatorTypeNode;
[SyntaxKind.TypeParameter]: compiler.TypeParameterDeclaration;
[SyntaxKind.TypePredicate]: compiler.TypePredicateNode;
[SyntaxKind.TypeReference]: compiler.TypeReferenceNode;
[SyntaxKind.UnionType]: compiler.UnionTypeNode;
[SyntaxKind.VariableDeclaration]: compiler.VariableDeclaration;
[SyntaxKind.VariableDeclarationList]: compiler.VariableDeclarationList;
[SyntaxKind.VariableStatement]: compiler.VariableStatement;
[SyntaxKind.JSDocComment]: compiler.JSDoc;
[SyntaxKind.TypeOfExpression]: compiler.TypeOfExpression;
[SyntaxKind.WhileStatement]: compiler.WhileStatement;
[SyntaxKind.WithStatement]: compiler.WithStatement;
[SyntaxKind.YieldExpression]: compiler.YieldExpression;
[SyntaxKind.SemicolonToken]: compiler.Node<ts.Token<SyntaxKind.SemicolonToken>>;
[SyntaxKind.InferKeyword]: compiler.Node<ts.Token<SyntaxKind.InferKeyword>>;
[SyntaxKind.NeverKeyword]: compiler.Node<ts.Token<SyntaxKind.NeverKeyword>>;
[SyntaxKind.AnyKeyword]: compiler.Expression;
[SyntaxKind.BooleanKeyword]: compiler.Expression;
[SyntaxKind.NumberKeyword]: compiler.Expression;
[SyntaxKind.ObjectKeyword]: compiler.Expression;
[SyntaxKind.StringKeyword]: compiler.Expression;
[SyntaxKind.SymbolKeyword]: compiler.Expression;
[SyntaxKind.UndefinedKeyword]: compiler.Expression;
[SyntaxKind.FalseKeyword]: compiler.FalseLiteral;
[SyntaxKind.ImportKeyword]: compiler.ImportExpression;
[SyntaxKind.NullKeyword]: compiler.NullLiteral;
[SyntaxKind.SuperKeyword]: compiler.SuperExpression;
[SyntaxKind.ThisKeyword]: compiler.ThisExpression;
[SyntaxKind.TrueKeyword]: compiler.TrueLiteral;
[SyntaxKind.VoidExpression]: compiler.VoidExpression;
}
export interface KindToNodeMappings extends ImplementedKindToNodeMappings {
[kind: number]: compiler.Node;
}
export interface KindToExpressionMappings {
[kind: number]: compiler.Node;
[SyntaxKind.ArrayLiteralExpression]: compiler.ArrayLiteralExpression;
[SyntaxKind.ArrowFunction]: compiler.ArrowFunction;
[SyntaxKind.AsExpression]: compiler.AsExpression;
[SyntaxKind.AwaitExpression]: compiler.AwaitExpression;
[SyntaxKind.BigIntLiteral]: compiler.BigIntLiteral;
[SyntaxKind.BinaryExpression]: compiler.BinaryExpression;
[SyntaxKind.CallExpression]: compiler.CallExpression;
[SyntaxKind.ClassExpression]: compiler.ClassExpression;
[SyntaxKind.CommaListExpression]: compiler.CommaListExpression;
[SyntaxKind.ConditionalExpression]: compiler.ConditionalExpression;
[SyntaxKind.DeleteExpression]: compiler.DeleteExpression;
[SyntaxKind.ElementAccessExpression]: compiler.ElementAccessExpression;
[SyntaxKind.FunctionExpression]: compiler.FunctionExpression;
[SyntaxKind.Identifier]: compiler.Identifier;
[SyntaxKind.JsxClosingFragment]: compiler.JsxClosingFragment;
[SyntaxKind.JsxElement]: compiler.JsxElement;
[SyntaxKind.JsxExpression]: compiler.JsxExpression;
[SyntaxKind.JsxFragment]: compiler.JsxFragment;
[SyntaxKind.JsxOpeningElement]: compiler.JsxOpeningElement;
[SyntaxKind.JsxOpeningFragment]: compiler.JsxOpeningFragment;
[SyntaxKind.JsxSelfClosingElement]: compiler.JsxSelfClosingElement;
[SyntaxKind.MetaProperty]: compiler.MetaProperty;
[SyntaxKind.NewExpression]: compiler.NewExpression;
[SyntaxKind.NonNullExpression]: compiler.NonNullExpression;
[SyntaxKind.NoSubstitutionTemplateLiteral]: compiler.NoSubstitutionTemplateLiteral;
[SyntaxKind.NumericLiteral]: compiler.NumericLiteral;
[SyntaxKind.ObjectLiteralExpression]: compiler.ObjectLiteralExpression;
[SyntaxKind.OmittedExpression]: compiler.OmittedExpression;
[SyntaxKind.ParenthesizedExpression]: compiler.ParenthesizedExpression;
[SyntaxKind.PartiallyEmittedExpression]: compiler.PartiallyEmittedExpression;
[SyntaxKind.PostfixUnaryExpression]: compiler.PostfixUnaryExpression;
[SyntaxKind.PrefixUnaryExpression]: compiler.PrefixUnaryExpression;
[SyntaxKind.PropertyAccessExpression]: compiler.PropertyAccessExpression;
[SyntaxKind.RegularExpressionLiteral]: compiler.RegularExpressionLiteral;
[SyntaxKind.SpreadElement]: compiler.SpreadElement;
[SyntaxKind.StringLiteral]: compiler.StringLiteral;
[SyntaxKind.TaggedTemplateExpression]: compiler.TaggedTemplateExpression;
[SyntaxKind.TemplateExpression]: compiler.TemplateExpression;
[SyntaxKind.TypeAssertionExpression]: compiler.TypeAssertion;
[SyntaxKind.TypeOfExpression]: compiler.TypeOfExpression;
[SyntaxKind.YieldExpression]: compiler.YieldExpression;
[SyntaxKind.AnyKeyword]: compiler.Expression;
[SyntaxKind.BooleanKeyword]: compiler.Expression;
[SyntaxKind.NumberKeyword]: compiler.Expression;
[SyntaxKind.ObjectKeyword]: compiler.Expression;
[SyntaxKind.StringKeyword]: compiler.Expression;
[SyntaxKind.SymbolKeyword]: compiler.Expression;
[SyntaxKind.UndefinedKeyword]: compiler.Expression;
[SyntaxKind.FalseKeyword]: compiler.FalseLiteral;
[SyntaxKind.ImportKeyword]: compiler.ImportExpression;
[SyntaxKind.NullKeyword]: compiler.NullLiteral;
[SyntaxKind.SuperKeyword]: compiler.SuperExpression;
[SyntaxKind.ThisKeyword]: compiler.ThisExpression;
[SyntaxKind.TrueKeyword]: compiler.TrueLiteral;
[SyntaxKind.VoidExpression]: compiler.VoidExpression;
}