xbintsc 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +191 -0
- package/bin/xbintsc.js +26 -0
- package/dist/src/ast/factory.d.ts +11 -0
- package/dist/src/ast/factory.js +36 -0
- package/dist/src/ast/factory.js.map +1 -0
- package/dist/src/ast/nodes.d.ts +848 -0
- package/dist/src/ast/nodes.js +247 -0
- package/dist/src/ast/nodes.js.map +1 -0
- package/dist/src/ast/visitor.d.ts +18 -0
- package/dist/src/ast/visitor.js +52 -0
- package/dist/src/ast/visitor.js.map +1 -0
- package/dist/src/binder/binder.d.ts +82 -0
- package/dist/src/binder/binder.js +443 -0
- package/dist/src/binder/binder.js.map +1 -0
- package/dist/src/cli/main.d.ts +16 -0
- package/dist/src/cli/main.js +191 -0
- package/dist/src/cli/main.js.map +1 -0
- package/dist/src/codegen/llvm.d.ts +31 -0
- package/dist/src/codegen/llvm.js +1178 -0
- package/dist/src/codegen/llvm.js.map +1 -0
- package/dist/src/codegen/values.d.ts +23 -0
- package/dist/src/codegen/values.js +32 -0
- package/dist/src/codegen/values.js.map +1 -0
- package/dist/src/diagnostics/diagnostic.d.ts +69 -0
- package/dist/src/diagnostics/diagnostic.js +104 -0
- package/dist/src/diagnostics/diagnostic.js.map +1 -0
- package/dist/src/diagnostics/source.d.ts +43 -0
- package/dist/src/diagnostics/source.js +73 -0
- package/dist/src/diagnostics/source.js.map +1 -0
- package/dist/src/driver/cache.d.ts +37 -0
- package/dist/src/driver/cache.js +82 -0
- package/dist/src/driver/cache.js.map +1 -0
- package/dist/src/driver/compiler.d.ts +41 -0
- package/dist/src/driver/compiler.js +128 -0
- package/dist/src/driver/compiler.js.map +1 -0
- package/dist/src/driver/index.d.ts +4 -0
- package/dist/src/driver/index.js +5 -0
- package/dist/src/driver/index.js.map +1 -0
- package/dist/src/driver/paths.d.ts +4 -0
- package/dist/src/driver/paths.js +22 -0
- package/dist/src/driver/paths.js.map +1 -0
- package/dist/src/driver/toolchain.d.ts +43 -0
- package/dist/src/driver/toolchain.js +76 -0
- package/dist/src/driver/toolchain.js.map +1 -0
- package/dist/src/extensions/node.d.ts +9 -0
- package/dist/src/extensions/node.js +20 -0
- package/dist/src/extensions/node.js.map +1 -0
- package/dist/src/extensions/registry.d.ts +45 -0
- package/dist/src/extensions/registry.js +76 -0
- package/dist/src/extensions/registry.js.map +1 -0
- package/dist/src/index.d.ts +18 -0
- package/dist/src/index.js +19 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lexer/scanner.d.ts +48 -0
- package/dist/src/lexer/scanner.js +650 -0
- package/dist/src/lexer/scanner.js.map +1 -0
- package/dist/src/lexer/token.d.ts +170 -0
- package/dist/src/lexer/token.js +250 -0
- package/dist/src/lexer/token.js.map +1 -0
- package/dist/src/parser/parser.d.ts +127 -0
- package/dist/src/parser/parser.js +2334 -0
- package/dist/src/parser/parser.js.map +1 -0
- package/dist/tests/binder/binder.test.d.ts +1 -0
- package/dist/tests/binder/binder.test.js +89 -0
- package/dist/tests/binder/binder.test.js.map +1 -0
- package/dist/tests/cli/main.test.d.ts +1 -0
- package/dist/tests/cli/main.test.js +68 -0
- package/dist/tests/cli/main.test.js.map +1 -0
- package/dist/tests/cli/process.test.d.ts +9 -0
- package/dist/tests/cli/process.test.js +57 -0
- package/dist/tests/cli/process.test.js.map +1 -0
- package/dist/tests/codegen/llvm.test.d.ts +1 -0
- package/dist/tests/codegen/llvm.test.js +93 -0
- package/dist/tests/codegen/llvm.test.js.map +1 -0
- package/dist/tests/driver/cache.test.d.ts +1 -0
- package/dist/tests/driver/cache.test.js +66 -0
- package/dist/tests/driver/cache.test.js.map +1 -0
- package/dist/tests/driver/compiler.test.d.ts +1 -0
- package/dist/tests/driver/compiler.test.js +80 -0
- package/dist/tests/driver/compiler.test.js.map +1 -0
- package/dist/tests/driver/toolchain.test.d.ts +1 -0
- package/dist/tests/driver/toolchain.test.js +60 -0
- package/dist/tests/driver/toolchain.test.js.map +1 -0
- package/dist/tests/e2e/compile.test.d.ts +5 -0
- package/dist/tests/e2e/compile.test.js +93 -0
- package/dist/tests/e2e/compile.test.js.map +1 -0
- package/dist/tests/extensions/registry.test.d.ts +1 -0
- package/dist/tests/extensions/registry.test.js +47 -0
- package/dist/tests/extensions/registry.test.js.map +1 -0
- package/dist/tests/helpers.d.ts +23 -0
- package/dist/tests/helpers.js +41 -0
- package/dist/tests/helpers.js.map +1 -0
- package/dist/tests/lexer/scanner.test.d.ts +1 -0
- package/dist/tests/lexer/scanner.test.js +95 -0
- package/dist/tests/lexer/scanner.test.js.map +1 -0
- package/dist/tests/parser/parser.test.d.ts +1 -0
- package/dist/tests/parser/parser.test.js +137 -0
- package/dist/tests/parser/parser.test.js.map +1 -0
- package/package.json +49 -0
- package/runtime/ext_node.c +42 -0
- package/runtime/rt.h +177 -0
- package/runtime/xt_runtime.c +682 -0
- package/scripts/build-runtime.mjs +34 -0
- package/src/ast/factory.ts +37 -0
- package/src/ast/nodes.ts +1111 -0
- package/src/ast/visitor.ts +60 -0
- package/src/binder/binder.ts +549 -0
- package/src/cli/main.ts +210 -0
- package/src/codegen/llvm.ts +1324 -0
- package/src/codegen/values.ts +36 -0
- package/src/diagnostics/diagnostic.ts +132 -0
- package/src/diagnostics/source.ts +97 -0
- package/src/driver/cache.ts +96 -0
- package/src/driver/compiler.ts +197 -0
- package/src/driver/index.ts +4 -0
- package/src/driver/paths.ts +24 -0
- package/src/driver/toolchain.ts +103 -0
- package/src/extensions/node.ts +23 -0
- package/src/extensions/registry.ts +101 -0
- package/src/index.ts +33 -0
- package/src/lexer/scanner.ts +650 -0
- package/src/lexer/token.ts +266 -0
- package/src/parser/parser.ts +2396 -0
|
@@ -0,0 +1,848 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The xbintsc abstract syntax tree.
|
|
3
|
+
*
|
|
4
|
+
* The AST is a faithful, lossless-enough representation of the TypeScript
|
|
5
|
+
* source. Nodes are discriminated unions keyed by `kind` so the binder, checker
|
|
6
|
+
* and code generator can switch exhaustively over them. Every node carries a
|
|
7
|
+
* source range (`start`/`end` offsets) which the diagnostics layer maps back to
|
|
8
|
+
* line/column, and which the incremental cache uses to detect changes.
|
|
9
|
+
*/
|
|
10
|
+
import type { Token } from "../lexer/token.js";
|
|
11
|
+
export interface Range {
|
|
12
|
+
/** Inclusive start offset (UTF-16 code units). */
|
|
13
|
+
readonly start: number;
|
|
14
|
+
/** Exclusive end offset. */
|
|
15
|
+
readonly end: number;
|
|
16
|
+
}
|
|
17
|
+
export interface Node extends Range {
|
|
18
|
+
readonly kind: SyntaxKind;
|
|
19
|
+
}
|
|
20
|
+
export declare const enum SyntaxKind {
|
|
21
|
+
Unknown = 0,
|
|
22
|
+
EndOfFileToken = 1,
|
|
23
|
+
SourceFile = 300,
|
|
24
|
+
QualifiedName = 301,
|
|
25
|
+
ExpressionWithTypeArguments = 302,
|
|
26
|
+
ImportType = 303,
|
|
27
|
+
Identifier = 2,
|
|
28
|
+
PrivateIdentifier = 3,
|
|
29
|
+
NumericLiteral = 4,
|
|
30
|
+
BigIntLiteral = 5,
|
|
31
|
+
StringLiteral = 6,
|
|
32
|
+
NoSubstitutionTemplateLiteral = 7,
|
|
33
|
+
TemplateLiteral = 8,
|
|
34
|
+
TemplateSpan = 9,
|
|
35
|
+
RegularExpressionLiteral = 10,
|
|
36
|
+
TrueKeyword = 11,
|
|
37
|
+
FalseKeyword = 12,
|
|
38
|
+
NullKeyword = 13,
|
|
39
|
+
UndefinedKeyword = 14,
|
|
40
|
+
ThisKeyword = 15,
|
|
41
|
+
ArrayLiteralExpression = 20,
|
|
42
|
+
ObjectLiteralExpression = 21,
|
|
43
|
+
PropertyAssignment = 22,
|
|
44
|
+
ShorthandPropertyAssignment = 23,
|
|
45
|
+
SpreadElement = 24,
|
|
46
|
+
FunctionExpression = 25,
|
|
47
|
+
ArrowFunction = 26,
|
|
48
|
+
ClassExpression = 27,
|
|
49
|
+
CallExpression = 28,
|
|
50
|
+
NewExpression = 29,
|
|
51
|
+
PropertyAccessExpression = 30,
|
|
52
|
+
ElementAccessExpression = 31,
|
|
53
|
+
ParenthesizedExpression = 32,
|
|
54
|
+
PrefixUnaryExpression = 33,
|
|
55
|
+
PostfixUnaryExpression = 34,
|
|
56
|
+
BinaryExpression = 35,
|
|
57
|
+
ConditionalExpression = 36,
|
|
58
|
+
AsExpression = 37,
|
|
59
|
+
SatisfiesExpression = 38,
|
|
60
|
+
NonNullExpression = 39,
|
|
61
|
+
TypeOfExpression = 40,
|
|
62
|
+
VoidExpression = 41,
|
|
63
|
+
DeleteExpression = 42,
|
|
64
|
+
AwaitExpression = 43,
|
|
65
|
+
YieldExpression = 44,
|
|
66
|
+
TaggedTemplateExpression = 45,
|
|
67
|
+
ExpressionStatement = 60,
|
|
68
|
+
Block = 61,
|
|
69
|
+
EmptyStatement = 62,
|
|
70
|
+
DebuggerStatement = 63,
|
|
71
|
+
VariableStatement = 64,
|
|
72
|
+
VariableDeclarationList = 65,
|
|
73
|
+
VariableDeclaration = 66,
|
|
74
|
+
IfStatement = 67,
|
|
75
|
+
WhileStatement = 68,
|
|
76
|
+
DoStatement = 69,
|
|
77
|
+
ForStatement = 70,
|
|
78
|
+
ForOfStatement = 71,
|
|
79
|
+
ForInStatement = 72,
|
|
80
|
+
ReturnStatement = 73,
|
|
81
|
+
BreakStatement = 74,
|
|
82
|
+
ContinueStatement = 75,
|
|
83
|
+
ThrowStatement = 76,
|
|
84
|
+
TryStatement = 77,
|
|
85
|
+
CatchClause = 78,
|
|
86
|
+
SwitchStatement = 79,
|
|
87
|
+
CaseClause = 80,
|
|
88
|
+
DefaultClause = 81,
|
|
89
|
+
LabeledStatement = 82,
|
|
90
|
+
FunctionDeclaration = 100,
|
|
91
|
+
ClassDeclaration = 101,
|
|
92
|
+
InterfaceDeclaration = 102,
|
|
93
|
+
TypeAliasDeclaration = 103,
|
|
94
|
+
EnumDeclaration = 104,
|
|
95
|
+
EnumMember = 105,
|
|
96
|
+
ModuleDeclaration = 106,
|
|
97
|
+
Parameter = 107,
|
|
98
|
+
TypeParameterDeclaration = 108,
|
|
99
|
+
PropertyDeclaration = 109,
|
|
100
|
+
MethodDeclaration = 110,
|
|
101
|
+
ConstructorDeclaration = 111,
|
|
102
|
+
HeritageClause = 112,
|
|
103
|
+
ImportDeclaration = 113,
|
|
104
|
+
ImportClause = 114,
|
|
105
|
+
NamedImports = 115,
|
|
106
|
+
ImportSpecifier = 116,
|
|
107
|
+
NamespaceImport = 117,
|
|
108
|
+
ExportDeclaration = 118,
|
|
109
|
+
ExportAssignment = 119,
|
|
110
|
+
NamedExports = 120,
|
|
111
|
+
ExportSpecifier = 121,
|
|
112
|
+
TypeReference = 200,
|
|
113
|
+
TypePredicate = 201,
|
|
114
|
+
AnyKeywordType = 202,
|
|
115
|
+
UnknownKeywordType = 203,
|
|
116
|
+
NumberKeywordType = 204,
|
|
117
|
+
BigIntKeywordType = 205,
|
|
118
|
+
StringKeywordType = 206,
|
|
119
|
+
BooleanKeywordType = 207,
|
|
120
|
+
SymbolKeywordType = 208,
|
|
121
|
+
VoidKeywordType = 209,
|
|
122
|
+
UndefinedKeywordType = 210,
|
|
123
|
+
NullKeywordType = 211,
|
|
124
|
+
NeverKeywordType = 212,
|
|
125
|
+
ObjectKeywordType = 213,
|
|
126
|
+
ThisKeywordType = 214,
|
|
127
|
+
LiteralType = 215,
|
|
128
|
+
ArrayType = 216,
|
|
129
|
+
TupleType = 217,
|
|
130
|
+
UnionType = 218,
|
|
131
|
+
IntersectionType = 219,
|
|
132
|
+
FunctionType = 220,
|
|
133
|
+
TypeLiteral = 221,
|
|
134
|
+
PropertySignature = 222,
|
|
135
|
+
MethodSignature = 223,
|
|
136
|
+
IndexSignature = 224,
|
|
137
|
+
ParenthesizedType = 225,
|
|
138
|
+
TypeQuery = 226,
|
|
139
|
+
IndexedAccessType = 227,
|
|
140
|
+
TypeOperator = 228,
|
|
141
|
+
MappedType = 229,
|
|
142
|
+
ConditionalType = 230,
|
|
143
|
+
InferType = 231,
|
|
144
|
+
OptionalType = 232,
|
|
145
|
+
RestType = 233
|
|
146
|
+
}
|
|
147
|
+
export declare const enum NodeFlags {
|
|
148
|
+
None = 0,
|
|
149
|
+
Let = 1,
|
|
150
|
+
Const = 2,
|
|
151
|
+
Var = 4,
|
|
152
|
+
Exported = 8,
|
|
153
|
+
Default = 16,
|
|
154
|
+
Declare = 32,
|
|
155
|
+
Async = 64,
|
|
156
|
+
Generator = 128,
|
|
157
|
+
Ambient = 256,
|
|
158
|
+
Readonly = 512,
|
|
159
|
+
Abstract = 1024,
|
|
160
|
+
Optional = 2048
|
|
161
|
+
}
|
|
162
|
+
export declare const enum ModifierKind {
|
|
163
|
+
Export = "export",
|
|
164
|
+
Default = "default",
|
|
165
|
+
Declare = "declare",
|
|
166
|
+
Abstract = "abstract",
|
|
167
|
+
Public = "public",
|
|
168
|
+
Private = "private",
|
|
169
|
+
Protected = "protected",
|
|
170
|
+
Static = "static",
|
|
171
|
+
Readonly = "readonly",
|
|
172
|
+
Async = "async"
|
|
173
|
+
}
|
|
174
|
+
export interface Modifier extends Node {
|
|
175
|
+
readonly kind: SyntaxKind.Unknown;
|
|
176
|
+
readonly modifierKind: ModifierKind;
|
|
177
|
+
}
|
|
178
|
+
export type Expression = Identifier | PrivateIdentifier | NumericLiteral | BigIntLiteral | StringLiteral | NoSubstitutionTemplateLiteral | TemplateLiteral | RegularExpressionLiteral | BooleanLiteral | NullLiteral | UndefinedLiteral | ThisExpression | ArrayLiteralExpression | ObjectLiteralExpression | FunctionExpression | ArrowFunction | ClassExpression | CallExpression | NewExpression | PropertyAccessExpression | ElementAccessExpression | ParenthesizedExpression | PrefixUnaryExpression | PostfixUnaryExpression | BinaryExpression | ConditionalExpression | AsExpression | SatisfiesExpression | NonNullExpression | TypeOfExpression | VoidExpression | DeleteExpression | AwaitExpression | YieldExpression | TaggedTemplateExpression | SpreadElement;
|
|
179
|
+
export type Statement = ExpressionStatement | Block | EmptyStatement | DebuggerStatement | VariableStatement | IfStatement | WhileStatement | DoStatement | ForStatement | ForOfStatement | ForInStatement | ReturnStatement | BreakStatement | ContinueStatement | ThrowStatement | TryStatement | SwitchStatement | LabeledStatement | FunctionDeclaration | ClassDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportDeclaration | ExportDeclaration | ExportAssignment;
|
|
180
|
+
export type TypeNode = TypeReference | TypePredicate | KeywordTypeNode | LiteralTypeNode | ArrayTypeNode | TupleTypeNode | UnionTypeNode | IntersectionTypeNode | FunctionTypeNode | TypeLiteralNode | ParenthesizedTypeNode | TypeQueryNode | IndexedAccessTypeNode | TypeOperatorNode | MappedTypeNode | ConditionalTypeNode | InferTypeNode | OptionalTypeNode | RestTypeNode;
|
|
181
|
+
export interface SourceFileNode extends Node {
|
|
182
|
+
readonly kind: SyntaxKind.SourceFile;
|
|
183
|
+
readonly statements: Statement[];
|
|
184
|
+
readonly fileName: string;
|
|
185
|
+
readonly text: string;
|
|
186
|
+
}
|
|
187
|
+
export interface Identifier extends Node {
|
|
188
|
+
readonly kind: SyntaxKind.Identifier;
|
|
189
|
+
readonly text: string;
|
|
190
|
+
/** True when the identifier was written with a `#` prefix. */
|
|
191
|
+
readonly escaped?: boolean;
|
|
192
|
+
}
|
|
193
|
+
export interface PrivateIdentifier extends Node {
|
|
194
|
+
readonly kind: SyntaxKind.PrivateIdentifier;
|
|
195
|
+
readonly text: string;
|
|
196
|
+
}
|
|
197
|
+
export interface NumericLiteral extends Node {
|
|
198
|
+
readonly kind: SyntaxKind.NumericLiteral;
|
|
199
|
+
readonly text: string;
|
|
200
|
+
readonly value: number;
|
|
201
|
+
}
|
|
202
|
+
export interface BigIntLiteral extends Node {
|
|
203
|
+
readonly kind: SyntaxKind.BigIntLiteral;
|
|
204
|
+
readonly text: string;
|
|
205
|
+
readonly value: bigint;
|
|
206
|
+
}
|
|
207
|
+
export interface StringLiteral extends Node {
|
|
208
|
+
readonly kind: SyntaxKind.StringLiteral;
|
|
209
|
+
readonly text: string;
|
|
210
|
+
readonly value: string;
|
|
211
|
+
/** Raw source text, including quotes. */
|
|
212
|
+
readonly raw: string;
|
|
213
|
+
}
|
|
214
|
+
export interface NoSubstitutionTemplateLiteral extends Node {
|
|
215
|
+
readonly kind: SyntaxKind.NoSubstitutionTemplateLiteral;
|
|
216
|
+
readonly text: string;
|
|
217
|
+
readonly value: string;
|
|
218
|
+
}
|
|
219
|
+
export interface TemplateLiteral extends Node {
|
|
220
|
+
readonly kind: SyntaxKind.TemplateLiteral;
|
|
221
|
+
readonly head: string;
|
|
222
|
+
readonly spans: TemplateSpan[];
|
|
223
|
+
}
|
|
224
|
+
export interface TemplateSpan extends Node {
|
|
225
|
+
readonly kind: SyntaxKind.TemplateSpan;
|
|
226
|
+
readonly expression: Expression;
|
|
227
|
+
readonly literal: string;
|
|
228
|
+
/** True when this span terminates the template (tail) rather than continues it. */
|
|
229
|
+
readonly isTail: boolean;
|
|
230
|
+
}
|
|
231
|
+
export interface RegularExpressionLiteral extends Node {
|
|
232
|
+
readonly kind: SyntaxKind.RegularExpressionLiteral;
|
|
233
|
+
readonly text: string;
|
|
234
|
+
readonly pattern: string;
|
|
235
|
+
readonly flags: string;
|
|
236
|
+
}
|
|
237
|
+
export interface BooleanLiteral extends Node {
|
|
238
|
+
readonly kind: SyntaxKind.TrueKeyword | SyntaxKind.FalseKeyword;
|
|
239
|
+
readonly value: boolean;
|
|
240
|
+
}
|
|
241
|
+
export interface NullLiteral extends Node {
|
|
242
|
+
readonly kind: SyntaxKind.NullKeyword;
|
|
243
|
+
}
|
|
244
|
+
export interface UndefinedLiteral extends Node {
|
|
245
|
+
readonly kind: SyntaxKind.UndefinedKeyword;
|
|
246
|
+
}
|
|
247
|
+
export interface ThisExpression extends Node {
|
|
248
|
+
readonly kind: SyntaxKind.ThisKeyword;
|
|
249
|
+
}
|
|
250
|
+
export interface ArrayLiteralExpression extends Node {
|
|
251
|
+
readonly kind: SyntaxKind.ArrayLiteralExpression;
|
|
252
|
+
readonly elements: Expression[];
|
|
253
|
+
}
|
|
254
|
+
export interface PropertyAssignment extends Node {
|
|
255
|
+
readonly kind: SyntaxKind.PropertyAssignment;
|
|
256
|
+
readonly name: PropertyName;
|
|
257
|
+
readonly initializer: Expression;
|
|
258
|
+
}
|
|
259
|
+
export interface ShorthandPropertyAssignment extends Node {
|
|
260
|
+
readonly kind: SyntaxKind.ShorthandPropertyAssignment;
|
|
261
|
+
readonly name: Identifier;
|
|
262
|
+
}
|
|
263
|
+
export interface SpreadElement extends Node {
|
|
264
|
+
readonly kind: SyntaxKind.SpreadElement;
|
|
265
|
+
readonly expression: Expression;
|
|
266
|
+
}
|
|
267
|
+
export type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | SpreadElement;
|
|
268
|
+
export interface ObjectLiteralExpression extends Node {
|
|
269
|
+
readonly kind: SyntaxKind.ObjectLiteralExpression;
|
|
270
|
+
readonly properties: ObjectLiteralElementLike[];
|
|
271
|
+
}
|
|
272
|
+
export type PropertyName = Identifier | StringLiteral | NumericLiteral | PrivateIdentifier;
|
|
273
|
+
export interface FunctionExpression extends Node {
|
|
274
|
+
readonly kind: SyntaxKind.FunctionExpression;
|
|
275
|
+
readonly name?: Identifier;
|
|
276
|
+
readonly typeParameters: TypeParameterDeclaration[];
|
|
277
|
+
readonly parameters: Parameter[];
|
|
278
|
+
readonly returnType?: TypeNode;
|
|
279
|
+
readonly body: Block;
|
|
280
|
+
readonly flags: NodeFlags;
|
|
281
|
+
}
|
|
282
|
+
export interface ArrowFunction extends Node {
|
|
283
|
+
readonly kind: SyntaxKind.ArrowFunction;
|
|
284
|
+
readonly typeParameters: TypeParameterDeclaration[];
|
|
285
|
+
readonly parameters: Parameter[];
|
|
286
|
+
readonly returnType?: TypeNode;
|
|
287
|
+
readonly body: Block | Expression;
|
|
288
|
+
readonly flags: NodeFlags;
|
|
289
|
+
}
|
|
290
|
+
export interface ClassExpression extends Node {
|
|
291
|
+
readonly kind: SyntaxKind.ClassExpression;
|
|
292
|
+
readonly name?: Identifier;
|
|
293
|
+
readonly typeParameters: TypeParameterDeclaration[];
|
|
294
|
+
readonly heritage: HeritageClause[];
|
|
295
|
+
readonly members: ClassElement[];
|
|
296
|
+
}
|
|
297
|
+
export interface CallExpression extends Node {
|
|
298
|
+
readonly kind: SyntaxKind.CallExpression;
|
|
299
|
+
readonly expression: Expression;
|
|
300
|
+
readonly typeArguments: TypeNode[];
|
|
301
|
+
readonly arguments: Expression[];
|
|
302
|
+
readonly optional: boolean;
|
|
303
|
+
}
|
|
304
|
+
export interface NewExpression extends Node {
|
|
305
|
+
readonly kind: SyntaxKind.NewExpression;
|
|
306
|
+
readonly expression: Expression;
|
|
307
|
+
readonly typeArguments: TypeNode[];
|
|
308
|
+
readonly arguments: Expression[];
|
|
309
|
+
}
|
|
310
|
+
export interface PropertyAccessExpression extends Node {
|
|
311
|
+
readonly kind: SyntaxKind.PropertyAccessExpression;
|
|
312
|
+
readonly expression: Expression;
|
|
313
|
+
readonly name: Identifier;
|
|
314
|
+
readonly optional: boolean;
|
|
315
|
+
}
|
|
316
|
+
export interface ElementAccessExpression extends Node {
|
|
317
|
+
readonly kind: SyntaxKind.ElementAccessExpression;
|
|
318
|
+
readonly expression: Expression;
|
|
319
|
+
readonly argumentExpression: Expression;
|
|
320
|
+
readonly optional: boolean;
|
|
321
|
+
}
|
|
322
|
+
export interface ParenthesizedExpression extends Node {
|
|
323
|
+
readonly kind: SyntaxKind.ParenthesizedExpression;
|
|
324
|
+
readonly expression: Expression;
|
|
325
|
+
}
|
|
326
|
+
export declare const enum PrefixUnaryOperator {
|
|
327
|
+
Plus = "+",
|
|
328
|
+
Minus = "-",
|
|
329
|
+
Tilde = "~",
|
|
330
|
+
Exclamation = "!",
|
|
331
|
+
TypeOf = "typeof",
|
|
332
|
+
Void = "void",
|
|
333
|
+
Delete = "delete",
|
|
334
|
+
PlusPlus = "++",
|
|
335
|
+
MinusMinus = "--",
|
|
336
|
+
Await = "await"
|
|
337
|
+
}
|
|
338
|
+
export interface PrefixUnaryExpression extends Node {
|
|
339
|
+
readonly kind: SyntaxKind.PrefixUnaryExpression;
|
|
340
|
+
readonly operator: PrefixUnaryOperator;
|
|
341
|
+
readonly operand: Expression;
|
|
342
|
+
}
|
|
343
|
+
export declare const enum PostfixUnaryOperator {
|
|
344
|
+
PlusPlus = "++",
|
|
345
|
+
MinusMinus = "--"
|
|
346
|
+
}
|
|
347
|
+
export interface PostfixUnaryExpression extends Node {
|
|
348
|
+
readonly kind: SyntaxKind.PostfixUnaryExpression;
|
|
349
|
+
readonly operator: PostfixUnaryOperator;
|
|
350
|
+
readonly operand: Expression;
|
|
351
|
+
}
|
|
352
|
+
export declare const enum BinaryOperator {
|
|
353
|
+
Add = "+",
|
|
354
|
+
Subtract = "-",
|
|
355
|
+
Multiply = "*",
|
|
356
|
+
Divide = "/",
|
|
357
|
+
Remainder = "%",
|
|
358
|
+
Exponent = "**",
|
|
359
|
+
LessThan = "<",
|
|
360
|
+
LessThanEquals = "<=",
|
|
361
|
+
GreaterThan = ">",
|
|
362
|
+
GreaterThanEquals = ">=",
|
|
363
|
+
EqualsEquals = "==",
|
|
364
|
+
ExclamationEquals = "!=",
|
|
365
|
+
EqualsEqualsEquals = "===",
|
|
366
|
+
ExclamationEqualsEquals = "!==",
|
|
367
|
+
AmpersandAmpersand = "&&",
|
|
368
|
+
BarBar = "||",
|
|
369
|
+
QuestionQuestion = "??",
|
|
370
|
+
Ampersand = "&",
|
|
371
|
+
Bar = "|",
|
|
372
|
+
Caret = "^",
|
|
373
|
+
LessThanLessThan = "<<",
|
|
374
|
+
GreaterThanGreaterThan = ">>",
|
|
375
|
+
GreaterThanGreaterThanGreaterThan = ">>>",
|
|
376
|
+
Comma = ",",
|
|
377
|
+
In = "in",
|
|
378
|
+
InstanceOf = "instanceof"
|
|
379
|
+
}
|
|
380
|
+
/** Assignment operators, including the compound forms. */
|
|
381
|
+
export declare const enum AssignmentOperator {
|
|
382
|
+
Assign = "=",
|
|
383
|
+
AddAssign = "+=",
|
|
384
|
+
SubtractAssign = "-=",
|
|
385
|
+
MultiplyAssign = "*=",
|
|
386
|
+
DivideAssign = "/=",
|
|
387
|
+
RemainderAssign = "%=",
|
|
388
|
+
ExponentAssign = "**=",
|
|
389
|
+
LessThanLessThanAssign = "<<=",
|
|
390
|
+
GreaterThanGreaterThanAssign = ">>=",
|
|
391
|
+
GreaterThanGreaterThanGreaterThanAssign = ">>>=",
|
|
392
|
+
AmpersandAssign = "&=",
|
|
393
|
+
BarAssign = "|=",
|
|
394
|
+
CaretAssign = "^=",
|
|
395
|
+
AmpersandAmpersandAssign = "&&=",
|
|
396
|
+
BarBarAssign = "||=",
|
|
397
|
+
QuestionQuestionAssign = "??="
|
|
398
|
+
}
|
|
399
|
+
export interface BinaryExpression extends Node {
|
|
400
|
+
readonly kind: SyntaxKind.BinaryExpression;
|
|
401
|
+
readonly left: Expression;
|
|
402
|
+
readonly operator: BinaryOperator;
|
|
403
|
+
readonly right: Expression;
|
|
404
|
+
readonly operatorToken: Token;
|
|
405
|
+
}
|
|
406
|
+
export interface AssignmentExpression extends Node {
|
|
407
|
+
readonly kind: SyntaxKind.BinaryExpression;
|
|
408
|
+
readonly left: Expression;
|
|
409
|
+
readonly operator: AssignmentOperator;
|
|
410
|
+
readonly right: Expression;
|
|
411
|
+
readonly operatorToken: Token;
|
|
412
|
+
}
|
|
413
|
+
export interface ConditionalExpression extends Node {
|
|
414
|
+
readonly kind: SyntaxKind.ConditionalExpression;
|
|
415
|
+
readonly condition: Expression;
|
|
416
|
+
readonly whenTrue: Expression;
|
|
417
|
+
readonly whenFalse: Expression;
|
|
418
|
+
}
|
|
419
|
+
export interface AsExpression extends Node {
|
|
420
|
+
readonly kind: SyntaxKind.AsExpression;
|
|
421
|
+
readonly expression: Expression;
|
|
422
|
+
readonly type: TypeNode;
|
|
423
|
+
}
|
|
424
|
+
export interface SatisfiesExpression extends Node {
|
|
425
|
+
readonly kind: SyntaxKind.SatisfiesExpression;
|
|
426
|
+
readonly expression: Expression;
|
|
427
|
+
readonly type: TypeNode;
|
|
428
|
+
}
|
|
429
|
+
export interface NonNullExpression extends Node {
|
|
430
|
+
readonly kind: SyntaxKind.NonNullExpression;
|
|
431
|
+
readonly expression: Expression;
|
|
432
|
+
}
|
|
433
|
+
export interface TypeOfExpression extends Node {
|
|
434
|
+
readonly kind: SyntaxKind.TypeOfExpression;
|
|
435
|
+
readonly expression: Expression;
|
|
436
|
+
}
|
|
437
|
+
export interface VoidExpression extends Node {
|
|
438
|
+
readonly kind: SyntaxKind.VoidExpression;
|
|
439
|
+
readonly expression?: Expression;
|
|
440
|
+
}
|
|
441
|
+
export interface DeleteExpression extends Node {
|
|
442
|
+
readonly kind: SyntaxKind.DeleteExpression;
|
|
443
|
+
readonly expression: Expression;
|
|
444
|
+
}
|
|
445
|
+
export interface AwaitExpression extends Node {
|
|
446
|
+
readonly kind: SyntaxKind.AwaitExpression;
|
|
447
|
+
readonly expression: Expression;
|
|
448
|
+
}
|
|
449
|
+
export interface YieldExpression extends Node {
|
|
450
|
+
readonly kind: SyntaxKind.YieldExpression;
|
|
451
|
+
readonly expression?: Expression;
|
|
452
|
+
readonly delegate: boolean;
|
|
453
|
+
}
|
|
454
|
+
export interface TaggedTemplateExpression extends Node {
|
|
455
|
+
readonly kind: SyntaxKind.TaggedTemplateExpression;
|
|
456
|
+
readonly tag: Expression;
|
|
457
|
+
readonly template: TemplateLiteral | NoSubstitutionTemplateLiteral;
|
|
458
|
+
}
|
|
459
|
+
export interface ExpressionStatement extends Node {
|
|
460
|
+
readonly kind: SyntaxKind.ExpressionStatement;
|
|
461
|
+
readonly expression: Expression;
|
|
462
|
+
}
|
|
463
|
+
export interface Block extends Node {
|
|
464
|
+
readonly kind: SyntaxKind.Block;
|
|
465
|
+
readonly statements: Statement[];
|
|
466
|
+
}
|
|
467
|
+
export interface EmptyStatement extends Node {
|
|
468
|
+
readonly kind: SyntaxKind.EmptyStatement;
|
|
469
|
+
}
|
|
470
|
+
export interface DebuggerStatement extends Node {
|
|
471
|
+
readonly kind: SyntaxKind.DebuggerStatement;
|
|
472
|
+
}
|
|
473
|
+
export interface VariableDeclaration extends Node {
|
|
474
|
+
readonly kind: SyntaxKind.VariableDeclaration;
|
|
475
|
+
readonly name: Identifier;
|
|
476
|
+
readonly exclamation: boolean;
|
|
477
|
+
readonly type?: TypeNode;
|
|
478
|
+
readonly initializer?: Expression;
|
|
479
|
+
}
|
|
480
|
+
export interface VariableDeclarationList extends Node {
|
|
481
|
+
readonly kind: SyntaxKind.VariableDeclarationList;
|
|
482
|
+
readonly declarations: VariableDeclaration[];
|
|
483
|
+
readonly declarationKind: "var" | "let" | "const" | "using";
|
|
484
|
+
}
|
|
485
|
+
export interface VariableStatement extends Node {
|
|
486
|
+
readonly kind: SyntaxKind.VariableStatement;
|
|
487
|
+
readonly declarationList: VariableDeclarationList;
|
|
488
|
+
readonly modifiers: Modifier[];
|
|
489
|
+
}
|
|
490
|
+
export interface IfStatement extends Node {
|
|
491
|
+
readonly kind: SyntaxKind.IfStatement;
|
|
492
|
+
readonly condition: Expression;
|
|
493
|
+
readonly thenStatement: Statement;
|
|
494
|
+
readonly elseStatement?: Statement;
|
|
495
|
+
}
|
|
496
|
+
export interface WhileStatement extends Node {
|
|
497
|
+
readonly kind: SyntaxKind.WhileStatement;
|
|
498
|
+
readonly condition: Expression;
|
|
499
|
+
readonly statement: Statement;
|
|
500
|
+
}
|
|
501
|
+
export interface DoStatement extends Node {
|
|
502
|
+
readonly kind: SyntaxKind.DoStatement;
|
|
503
|
+
readonly condition: Expression;
|
|
504
|
+
readonly statement: Statement;
|
|
505
|
+
}
|
|
506
|
+
export interface ForStatement extends Node {
|
|
507
|
+
readonly kind: SyntaxKind.ForStatement;
|
|
508
|
+
readonly initializer?: VariableDeclarationList | Expression;
|
|
509
|
+
readonly condition?: Expression;
|
|
510
|
+
readonly incrementor?: Expression;
|
|
511
|
+
readonly statement: Statement;
|
|
512
|
+
}
|
|
513
|
+
export interface ForOfStatement extends Node {
|
|
514
|
+
readonly kind: SyntaxKind.ForOfStatement;
|
|
515
|
+
readonly initializer: VariableDeclarationList | Expression;
|
|
516
|
+
readonly expression: Expression;
|
|
517
|
+
readonly statement: Statement;
|
|
518
|
+
readonly awaitModifier: boolean;
|
|
519
|
+
}
|
|
520
|
+
export interface ForInStatement extends Node {
|
|
521
|
+
readonly kind: SyntaxKind.ForInStatement;
|
|
522
|
+
readonly initializer: VariableDeclarationList | Expression;
|
|
523
|
+
readonly expression: Expression;
|
|
524
|
+
readonly statement: Statement;
|
|
525
|
+
}
|
|
526
|
+
export interface ReturnStatement extends Node {
|
|
527
|
+
readonly kind: SyntaxKind.ReturnStatement;
|
|
528
|
+
readonly expression?: Expression;
|
|
529
|
+
}
|
|
530
|
+
export interface BreakStatement extends Node {
|
|
531
|
+
readonly kind: SyntaxKind.BreakStatement;
|
|
532
|
+
readonly label?: Identifier;
|
|
533
|
+
}
|
|
534
|
+
export interface ContinueStatement extends Node {
|
|
535
|
+
readonly kind: SyntaxKind.ContinueStatement;
|
|
536
|
+
readonly label?: Identifier;
|
|
537
|
+
}
|
|
538
|
+
export interface ThrowStatement extends Node {
|
|
539
|
+
readonly kind: SyntaxKind.ThrowStatement;
|
|
540
|
+
readonly expression: Expression;
|
|
541
|
+
}
|
|
542
|
+
export interface CatchClause extends Node {
|
|
543
|
+
readonly kind: SyntaxKind.CatchClause;
|
|
544
|
+
readonly variable?: Identifier;
|
|
545
|
+
readonly type?: TypeNode;
|
|
546
|
+
readonly block: Block;
|
|
547
|
+
}
|
|
548
|
+
export interface TryStatement extends Node {
|
|
549
|
+
readonly kind: SyntaxKind.TryStatement;
|
|
550
|
+
readonly tryBlock: Block;
|
|
551
|
+
readonly catchClause?: CatchClause;
|
|
552
|
+
readonly finallyBlock?: Block;
|
|
553
|
+
}
|
|
554
|
+
export interface CaseClause extends Node {
|
|
555
|
+
readonly kind: SyntaxKind.CaseClause;
|
|
556
|
+
readonly expression: Expression;
|
|
557
|
+
readonly statements: Statement[];
|
|
558
|
+
}
|
|
559
|
+
export interface DefaultClause extends Node {
|
|
560
|
+
readonly kind: SyntaxKind.DefaultClause;
|
|
561
|
+
readonly statements: Statement[];
|
|
562
|
+
}
|
|
563
|
+
export interface SwitchStatement extends Node {
|
|
564
|
+
readonly kind: SyntaxKind.SwitchStatement;
|
|
565
|
+
readonly expression: Expression;
|
|
566
|
+
readonly clauses: (CaseClause | DefaultClause)[];
|
|
567
|
+
}
|
|
568
|
+
export interface LabeledStatement extends Node {
|
|
569
|
+
readonly kind: SyntaxKind.LabeledStatement;
|
|
570
|
+
readonly label: Identifier;
|
|
571
|
+
readonly statement: Statement;
|
|
572
|
+
}
|
|
573
|
+
export interface Parameter extends Node {
|
|
574
|
+
readonly kind: SyntaxKind.Parameter;
|
|
575
|
+
readonly name: Identifier;
|
|
576
|
+
readonly modifiers: Modifier[];
|
|
577
|
+
readonly dotDotDotToken: boolean;
|
|
578
|
+
readonly questionToken: boolean;
|
|
579
|
+
readonly type?: TypeNode;
|
|
580
|
+
readonly initializer?: Expression;
|
|
581
|
+
}
|
|
582
|
+
export interface TypeParameterDeclaration extends Node {
|
|
583
|
+
readonly kind: SyntaxKind.TypeParameterDeclaration;
|
|
584
|
+
readonly name: Identifier;
|
|
585
|
+
readonly constraint?: TypeNode;
|
|
586
|
+
readonly default?: TypeNode;
|
|
587
|
+
}
|
|
588
|
+
export interface FunctionDeclaration extends Node {
|
|
589
|
+
readonly kind: SyntaxKind.FunctionDeclaration;
|
|
590
|
+
readonly name?: Identifier;
|
|
591
|
+
readonly modifiers: Modifier[];
|
|
592
|
+
readonly typeParameters: TypeParameterDeclaration[];
|
|
593
|
+
readonly parameters: Parameter[];
|
|
594
|
+
readonly returnType?: TypeNode;
|
|
595
|
+
readonly body?: Block;
|
|
596
|
+
readonly flags: NodeFlags;
|
|
597
|
+
}
|
|
598
|
+
export interface HeritageClause extends Node {
|
|
599
|
+
readonly kind: SyntaxKind.HeritageClause;
|
|
600
|
+
readonly token: "extends" | "implements";
|
|
601
|
+
readonly types: ExpressionWithTypeArguments[];
|
|
602
|
+
}
|
|
603
|
+
export interface ExpressionWithTypeArguments extends Node {
|
|
604
|
+
readonly kind: SyntaxKind.ExpressionWithTypeArguments;
|
|
605
|
+
readonly expression: Expression;
|
|
606
|
+
readonly typeArguments: TypeNode[];
|
|
607
|
+
}
|
|
608
|
+
export type ClassElement = PropertyDeclaration | MethodDeclaration | ConstructorDeclaration;
|
|
609
|
+
export interface PropertyDeclaration extends Node {
|
|
610
|
+
readonly kind: SyntaxKind.PropertyDeclaration;
|
|
611
|
+
readonly name: PropertyName;
|
|
612
|
+
readonly modifiers: Modifier[];
|
|
613
|
+
readonly questionToken: boolean;
|
|
614
|
+
readonly exclamationToken: boolean;
|
|
615
|
+
readonly type?: TypeNode;
|
|
616
|
+
readonly initializer?: Expression;
|
|
617
|
+
}
|
|
618
|
+
export interface MethodDeclaration extends Node {
|
|
619
|
+
readonly kind: SyntaxKind.MethodDeclaration;
|
|
620
|
+
readonly name: PropertyName;
|
|
621
|
+
readonly modifiers: Modifier[];
|
|
622
|
+
readonly typeParameters: TypeParameterDeclaration[];
|
|
623
|
+
readonly parameters: Parameter[];
|
|
624
|
+
readonly returnType?: TypeNode;
|
|
625
|
+
readonly body?: Block;
|
|
626
|
+
readonly flags: NodeFlags;
|
|
627
|
+
readonly optional: boolean;
|
|
628
|
+
}
|
|
629
|
+
export interface ConstructorDeclaration extends Node {
|
|
630
|
+
readonly kind: SyntaxKind.ConstructorDeclaration;
|
|
631
|
+
readonly modifiers: Modifier[];
|
|
632
|
+
readonly parameters: Parameter[];
|
|
633
|
+
readonly body?: Block;
|
|
634
|
+
}
|
|
635
|
+
export interface ClassDeclaration extends Node {
|
|
636
|
+
readonly kind: SyntaxKind.ClassDeclaration;
|
|
637
|
+
readonly name?: Identifier;
|
|
638
|
+
readonly modifiers: Modifier[];
|
|
639
|
+
readonly typeParameters: TypeParameterDeclaration[];
|
|
640
|
+
readonly heritage: HeritageClause[];
|
|
641
|
+
readonly members: ClassElement[];
|
|
642
|
+
}
|
|
643
|
+
export interface InterfaceDeclaration extends Node {
|
|
644
|
+
readonly kind: SyntaxKind.InterfaceDeclaration;
|
|
645
|
+
readonly name: Identifier;
|
|
646
|
+
readonly modifiers: Modifier[];
|
|
647
|
+
readonly typeParameters: TypeParameterDeclaration[];
|
|
648
|
+
readonly heritage: HeritageClause[];
|
|
649
|
+
readonly members: TypeElement[];
|
|
650
|
+
}
|
|
651
|
+
export interface TypeAliasDeclaration extends Node {
|
|
652
|
+
readonly kind: SyntaxKind.TypeAliasDeclaration;
|
|
653
|
+
readonly name: Identifier;
|
|
654
|
+
readonly modifiers: Modifier[];
|
|
655
|
+
readonly typeParameters: TypeParameterDeclaration[];
|
|
656
|
+
readonly type: TypeNode;
|
|
657
|
+
}
|
|
658
|
+
export interface EnumMember extends Node {
|
|
659
|
+
readonly kind: SyntaxKind.EnumMember;
|
|
660
|
+
readonly name: PropertyName;
|
|
661
|
+
readonly initializer?: Expression;
|
|
662
|
+
}
|
|
663
|
+
export interface EnumDeclaration extends Node {
|
|
664
|
+
readonly kind: SyntaxKind.EnumDeclaration;
|
|
665
|
+
readonly name: Identifier;
|
|
666
|
+
readonly modifiers: Modifier[];
|
|
667
|
+
readonly members: EnumMember[];
|
|
668
|
+
}
|
|
669
|
+
export interface ModuleDeclaration extends Node {
|
|
670
|
+
readonly kind: SyntaxKind.ModuleDeclaration;
|
|
671
|
+
readonly name: Identifier | StringLiteral;
|
|
672
|
+
readonly modifiers: Modifier[];
|
|
673
|
+
readonly body?: Block;
|
|
674
|
+
}
|
|
675
|
+
export interface ImportSpecifier extends Node {
|
|
676
|
+
readonly kind: SyntaxKind.ImportSpecifier;
|
|
677
|
+
readonly propertyName?: Identifier;
|
|
678
|
+
readonly name: Identifier;
|
|
679
|
+
readonly isTypeOnly: boolean;
|
|
680
|
+
}
|
|
681
|
+
export interface NamedImports extends Node {
|
|
682
|
+
readonly kind: SyntaxKind.NamedImports;
|
|
683
|
+
readonly elements: ImportSpecifier[];
|
|
684
|
+
}
|
|
685
|
+
export interface NamespaceImport extends Node {
|
|
686
|
+
readonly kind: SyntaxKind.NamespaceImport;
|
|
687
|
+
readonly name: Identifier;
|
|
688
|
+
}
|
|
689
|
+
export interface ImportClause extends Node {
|
|
690
|
+
readonly kind: SyntaxKind.ImportClause;
|
|
691
|
+
readonly name?: Identifier;
|
|
692
|
+
readonly namedBindings?: NamedImports | NamespaceImport;
|
|
693
|
+
readonly isTypeOnly: boolean;
|
|
694
|
+
}
|
|
695
|
+
export interface ImportDeclaration extends Node {
|
|
696
|
+
readonly kind: SyntaxKind.ImportDeclaration;
|
|
697
|
+
readonly importClause?: ImportClause;
|
|
698
|
+
readonly moduleSpecifier: StringLiteral;
|
|
699
|
+
readonly attributes: {
|
|
700
|
+
name: string;
|
|
701
|
+
value: string;
|
|
702
|
+
}[];
|
|
703
|
+
}
|
|
704
|
+
export interface ExportSpecifier extends Node {
|
|
705
|
+
readonly kind: SyntaxKind.ExportSpecifier;
|
|
706
|
+
readonly propertyName?: Identifier;
|
|
707
|
+
readonly name: Identifier;
|
|
708
|
+
readonly isTypeOnly: boolean;
|
|
709
|
+
}
|
|
710
|
+
export interface NamedExports extends Node {
|
|
711
|
+
readonly kind: SyntaxKind.NamedExports;
|
|
712
|
+
readonly elements: ExportSpecifier[];
|
|
713
|
+
}
|
|
714
|
+
export interface ExportDeclaration extends Node {
|
|
715
|
+
readonly kind: SyntaxKind.ExportDeclaration;
|
|
716
|
+
readonly modifiers: Modifier[];
|
|
717
|
+
readonly exportClause?: NamedExports | NamespaceExport;
|
|
718
|
+
readonly moduleSpecifier?: StringLiteral;
|
|
719
|
+
readonly isTypeOnly: boolean;
|
|
720
|
+
}
|
|
721
|
+
export interface NamespaceExport extends Node {
|
|
722
|
+
readonly kind: SyntaxKind.NamespaceImport;
|
|
723
|
+
readonly name: Identifier;
|
|
724
|
+
}
|
|
725
|
+
export interface ExportAssignment extends Node {
|
|
726
|
+
readonly kind: SyntaxKind.ExportAssignment;
|
|
727
|
+
readonly isExportEquals: boolean;
|
|
728
|
+
readonly expression: Expression;
|
|
729
|
+
}
|
|
730
|
+
export interface TypeReference extends Node {
|
|
731
|
+
readonly kind: SyntaxKind.TypeReference;
|
|
732
|
+
readonly typeName: Identifier | QualifiedName;
|
|
733
|
+
readonly typeArguments: TypeNode[];
|
|
734
|
+
}
|
|
735
|
+
export interface QualifiedName extends Node {
|
|
736
|
+
readonly kind: SyntaxKind.QualifiedName;
|
|
737
|
+
readonly left: Identifier | QualifiedName;
|
|
738
|
+
readonly right: Identifier;
|
|
739
|
+
}
|
|
740
|
+
export interface TypePredicate extends Node {
|
|
741
|
+
readonly kind: SyntaxKind.TypePredicate;
|
|
742
|
+
readonly parameterName: Identifier | ThisExpression;
|
|
743
|
+
readonly type?: TypeNode;
|
|
744
|
+
}
|
|
745
|
+
export interface KeywordTypeNode extends Node {
|
|
746
|
+
readonly kind: SyntaxKind.AnyKeywordType | SyntaxKind.UnknownKeywordType | SyntaxKind.NumberKeywordType | SyntaxKind.BigIntKeywordType | SyntaxKind.StringKeywordType | SyntaxKind.BooleanKeywordType | SyntaxKind.SymbolKeywordType | SyntaxKind.VoidKeywordType | SyntaxKind.UndefinedKeywordType | SyntaxKind.NullKeywordType | SyntaxKind.NeverKeywordType | SyntaxKind.ObjectKeywordType | SyntaxKind.ThisKeywordType;
|
|
747
|
+
}
|
|
748
|
+
export interface LiteralTypeNode extends Node {
|
|
749
|
+
readonly kind: SyntaxKind.LiteralType;
|
|
750
|
+
readonly literal: StringLiteral | NumericLiteral | BooleanLiteral | NullLiteral;
|
|
751
|
+
}
|
|
752
|
+
export interface ArrayTypeNode extends Node {
|
|
753
|
+
readonly kind: SyntaxKind.ArrayType;
|
|
754
|
+
readonly elementType: TypeNode;
|
|
755
|
+
}
|
|
756
|
+
export interface TupleTypeNode extends Node {
|
|
757
|
+
readonly kind: SyntaxKind.TupleType;
|
|
758
|
+
readonly elements: TypeNode[];
|
|
759
|
+
}
|
|
760
|
+
export interface UnionTypeNode extends Node {
|
|
761
|
+
readonly kind: SyntaxKind.UnionType;
|
|
762
|
+
readonly types: TypeNode[];
|
|
763
|
+
}
|
|
764
|
+
export interface IntersectionTypeNode extends Node {
|
|
765
|
+
readonly kind: SyntaxKind.IntersectionType;
|
|
766
|
+
readonly types: TypeNode[];
|
|
767
|
+
}
|
|
768
|
+
export interface FunctionTypeNode extends Node {
|
|
769
|
+
readonly kind: SyntaxKind.FunctionType;
|
|
770
|
+
readonly typeParameters: TypeParameterDeclaration[];
|
|
771
|
+
readonly parameters: Parameter[];
|
|
772
|
+
readonly returnType: TypeNode;
|
|
773
|
+
}
|
|
774
|
+
export type TypeElement = PropertySignature | MethodSignature | IndexSignature;
|
|
775
|
+
export interface PropertySignature extends Node {
|
|
776
|
+
readonly kind: SyntaxKind.PropertySignature;
|
|
777
|
+
readonly name: PropertyName;
|
|
778
|
+
readonly questionToken: boolean;
|
|
779
|
+
readonly readonlyToken: boolean;
|
|
780
|
+
readonly type?: TypeNode;
|
|
781
|
+
}
|
|
782
|
+
export interface MethodSignature extends Node {
|
|
783
|
+
readonly kind: SyntaxKind.MethodSignature;
|
|
784
|
+
readonly name: PropertyName;
|
|
785
|
+
readonly questionToken: boolean;
|
|
786
|
+
readonly typeParameters: TypeParameterDeclaration[];
|
|
787
|
+
readonly parameters: Parameter[];
|
|
788
|
+
readonly returnType?: TypeNode;
|
|
789
|
+
}
|
|
790
|
+
export interface IndexSignature extends Node {
|
|
791
|
+
readonly kind: SyntaxKind.IndexSignature;
|
|
792
|
+
readonly parameters: Parameter[];
|
|
793
|
+
readonly type?: TypeNode;
|
|
794
|
+
}
|
|
795
|
+
export interface TypeLiteralNode extends Node {
|
|
796
|
+
readonly kind: SyntaxKind.TypeLiteral;
|
|
797
|
+
readonly members: TypeElement[];
|
|
798
|
+
}
|
|
799
|
+
export interface ParenthesizedTypeNode extends Node {
|
|
800
|
+
readonly kind: SyntaxKind.ParenthesizedType;
|
|
801
|
+
readonly type: TypeNode;
|
|
802
|
+
}
|
|
803
|
+
export interface TypeQueryNode extends Node {
|
|
804
|
+
readonly kind: SyntaxKind.TypeQuery;
|
|
805
|
+
readonly exprName: Identifier | QualifiedName;
|
|
806
|
+
readonly typeArguments: TypeNode[];
|
|
807
|
+
}
|
|
808
|
+
export interface IndexedAccessTypeNode extends Node {
|
|
809
|
+
readonly kind: SyntaxKind.IndexedAccessType;
|
|
810
|
+
readonly objectType: TypeNode;
|
|
811
|
+
readonly indexType: TypeNode;
|
|
812
|
+
}
|
|
813
|
+
export declare const enum TypeOperator {
|
|
814
|
+
KeyOf = "keyof",
|
|
815
|
+
Unique = "unique",
|
|
816
|
+
Readonly = "readonly"
|
|
817
|
+
}
|
|
818
|
+
export interface TypeOperatorNode extends Node {
|
|
819
|
+
readonly kind: SyntaxKind.TypeOperator;
|
|
820
|
+
readonly operator: TypeOperator;
|
|
821
|
+
readonly type: TypeNode;
|
|
822
|
+
}
|
|
823
|
+
export interface MappedTypeNode extends Node {
|
|
824
|
+
readonly kind: SyntaxKind.MappedType;
|
|
825
|
+
readonly readonlyToken: boolean | "+" | "-";
|
|
826
|
+
readonly typeParameter: TypeParameterDeclaration;
|
|
827
|
+
readonly questionToken: boolean | "+" | "-";
|
|
828
|
+
readonly type?: TypeNode;
|
|
829
|
+
}
|
|
830
|
+
export interface ConditionalTypeNode extends Node {
|
|
831
|
+
readonly kind: SyntaxKind.ConditionalType;
|
|
832
|
+
readonly checkType: TypeNode;
|
|
833
|
+
readonly extendsType: TypeNode;
|
|
834
|
+
readonly trueType: TypeNode;
|
|
835
|
+
readonly falseType: TypeNode;
|
|
836
|
+
}
|
|
837
|
+
export interface InferTypeNode extends Node {
|
|
838
|
+
readonly kind: SyntaxKind.InferType;
|
|
839
|
+
readonly typeParameter: TypeParameterDeclaration;
|
|
840
|
+
}
|
|
841
|
+
export interface OptionalTypeNode extends Node {
|
|
842
|
+
readonly kind: SyntaxKind.OptionalType;
|
|
843
|
+
readonly type: TypeNode;
|
|
844
|
+
}
|
|
845
|
+
export interface RestTypeNode extends Node {
|
|
846
|
+
readonly kind: SyntaxKind.RestType;
|
|
847
|
+
readonly type: TypeNode;
|
|
848
|
+
}
|