/
ts-nodes.ts
190 lines (187 loc) · 4.66 KB
/
ts-nodes.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
import * as ts from 'typescript';
export type TSToken = ts.Token<ts.SyntaxKind>;
export type TSNode =
| ts.Modifier
| ts.Identifier
| ts.QualifiedName
| ts.ComputedPropertyName
| ts.Decorator
| ts.TypeParameterDeclaration
// | ts.SignatureDeclarationBase -> CallSignatureDeclaration, ConstructSignatureDeclaration
| ts.CallSignatureDeclaration
| ts.ConstructSignatureDeclaration
| ts.VariableDeclaration
| ts.VariableDeclarationList
| ts.ParameterDeclaration
| ts.BindingElement
| ts.PropertySignature
| ts.PropertyDeclaration
| ts.PropertyAssignment
| ts.ShorthandPropertyAssignment
| ts.SpreadAssignment
| ts.ObjectBindingPattern
| ts.ArrayBindingPattern
| ts.FunctionDeclaration
| ts.MethodSignature
| ts.MethodDeclaration
| ts.ConstructorDeclaration
| ts.SemicolonClassElement
| ts.GetAccessorDeclaration
| ts.SetAccessorDeclaration
| ts.IndexSignatureDeclaration
| ts.KeywordTypeNode // TODO: This node is bad, maybe we should report this
| ts.ImportTypeNode
| ts.ThisTypeNode
// | ts.FunctionOrConstructorTypeNodeBase -> FunctionTypeNode, ConstructorTypeNode
| ts.ConstructorTypeNode
| ts.FunctionTypeNode
| ts.TypeReferenceNode
| ts.TypePredicateNode
| ts.TypeQueryNode
| ts.TypeLiteralNode
| ts.ArrayTypeNode
| ts.NamedTupleMember
| ts.TupleTypeNode
| ts.OptionalTypeNode
| ts.RestTypeNode
| ts.UnionTypeNode
| ts.IntersectionTypeNode
| ts.ConditionalTypeNode
| ts.InferTypeNode
| ts.ParenthesizedTypeNode
| ts.TypeOperatorNode
| ts.IndexedAccessTypeNode
| ts.MappedTypeNode
| ts.LiteralTypeNode
| ts.StringLiteral
| ts.OmittedExpression
| ts.PartiallyEmittedExpression
| ts.PrefixUnaryExpression
| ts.PostfixUnaryExpression
| ts.NullLiteral
| ts.BooleanLiteral
| ts.ThisExpression
| ts.SuperExpression
| ts.ImportExpression
| ts.DeleteExpression
| ts.TypeOfExpression
| ts.VoidExpression
| ts.AwaitExpression
| ts.YieldExpression
| ts.SyntheticExpression
| ts.BinaryExpression
| ts.ConditionalExpression
| ts.FunctionExpression
| ts.ArrowFunction
| ts.RegularExpressionLiteral
| ts.NoSubstitutionTemplateLiteral
| ts.NumericLiteral
| ts.BigIntLiteral
| ts.TemplateHead
| ts.TemplateMiddle
| ts.TemplateTail
| ts.TemplateExpression
| ts.TemplateSpan
| ts.ParenthesizedExpression
| ts.ArrayLiteralExpression
| ts.SpreadElement
| ts.ObjectLiteralExpression
| ts.PropertyAccessExpression
| ts.ElementAccessExpression
| ts.CallExpression
| ts.ExpressionWithTypeArguments
| ts.NewExpression
| ts.TaggedTemplateExpression
| ts.AsExpression
| ts.TypeAssertion
| ts.NonNullExpression
| ts.MetaProperty
| ts.JsxElement
| ts.JsxOpeningElement
| ts.JsxSelfClosingElement
| ts.JsxFragment
| ts.JsxOpeningFragment
| ts.JsxClosingFragment
| ts.JsxAttribute
| ts.JsxSpreadAttribute
| ts.JsxClosingElement
| ts.JsxExpression
| ts.JsxText
| ts.NotEmittedStatement
| ts.CommaListExpression
| ts.EmptyStatement
| ts.DebuggerStatement
| ts.MissingDeclaration
| ts.Block
| ts.VariableStatement
| ts.ExpressionStatement
| ts.IfStatement
| ts.DoStatement
| ts.WhileStatement
| ts.ForStatement
| ts.ForInStatement
| ts.ForOfStatement
| ts.BreakStatement
| ts.ContinueStatement
| ts.ReturnStatement
| ts.WithStatement
| ts.SwitchStatement
| ts.CaseBlock
| ts.CaseClause
| ts.DefaultClause
| ts.LabeledStatement
| ts.ThrowStatement
| ts.TryStatement
| ts.CatchClause
// | ts.ClassLikeDeclarationBase -> ClassDeclaration | ClassExpression
| ts.ClassDeclaration
| ts.ClassExpression
| ts.InterfaceDeclaration
| ts.HeritageClause
| ts.TypeAliasDeclaration
| ts.EnumMember
| ts.EnumDeclaration
| ts.ModuleDeclaration
| ts.ModuleBlock
| ts.ImportEqualsDeclaration
| ts.ExternalModuleReference
| ts.ImportDeclaration
| ts.ImportClause
| ts.NamespaceImport
| ts.NamespaceExportDeclaration
| ts.ExportDeclaration
| ts.NamedImports
| ts.NamedExports
| ts.ImportSpecifier
| ts.ExportSpecifier
| ts.ExportAssignment
| ts.SourceFile
| ts.Bundle
| ts.InputFiles
| ts.UnparsedSource
| ts.JsonMinusNumericLiteral
// JSDoc: Unsupported
| ts.JSDoc
| ts.JSDocTypeExpression
| ts.JSDocUnknownTag
| ts.JSDocAugmentsTag
| ts.JSDocClassTag
| ts.JSDocEnumTag
| ts.JSDocThisTag
| ts.JSDocTemplateTag
| ts.JSDocReturnTag
| ts.JSDocTypeTag
| ts.JSDocTypedefTag
| ts.JSDocCallbackTag
| ts.JSDocSignature
| ts.JSDocPropertyTag
| ts.JSDocParameterTag
| ts.JSDocTypeLiteral
| ts.JSDocFunctionType
| ts.JSDocAllType
| ts.JSDocUnknownType
| ts.JSDocNullableType
| ts.JSDocNonNullableType
| ts.JSDocOptionalType
| ts.JSDocVariadicType
| ts.JSDocAuthorTag;