@tslite/parser 1.10.0 → 1.13.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.
Files changed (47) hide show
  1. package/LICENSE +55 -0
  2. package/NOTICE +14 -0
  3. package/dist/_namespaces/ts.d.ts +18 -0
  4. package/dist/_namespaces/ts.js +21 -0
  5. package/dist/_namespaces/ts.performance.d.ts +1 -0
  6. package/dist/_namespaces/ts.performance.js +2 -0
  7. package/dist/core.d.ts +450 -0
  8. package/dist/core.js +1394 -0
  9. package/dist/corePublic.d.ts +62 -0
  10. package/dist/corePublic.js +31 -0
  11. package/dist/debug.d.ts +74 -0
  12. package/dist/debug.js +326 -0
  13. package/dist/diagnosticInformationMap.generated.d.ts +1435 -0
  14. package/dist/diagnosticInformationMap.generated.js +1441 -0
  15. package/dist/factory.d.ts +78 -0
  16. package/dist/factory.js +622 -0
  17. package/dist/factoryPublic.d.ts +314 -0
  18. package/dist/factoryPublic.js +1796 -0
  19. package/dist/index.d.ts +1 -249
  20. package/dist/index.js +4 -6
  21. package/dist/parser.d.ts +59 -0
  22. package/dist/parser.js +5075 -0
  23. package/dist/path.d.ts +312 -0
  24. package/dist/path.js +475 -0
  25. package/dist/perfLogger.d.ts +4 -0
  26. package/dist/perfLogger.js +38 -0
  27. package/dist/performance.d.ts +20 -0
  28. package/dist/performance.js +49 -0
  29. package/dist/performanceTimestamp.d.ts +2 -0
  30. package/dist/performanceTimestamp.js +2 -0
  31. package/dist/scanner.d.ts +80 -0
  32. package/dist/scanner.js +1984 -0
  33. package/dist/shims/mapShim.d.ts +23 -0
  34. package/dist/shims/mapShim.js +156 -0
  35. package/dist/types.d.ts +2626 -0
  36. package/dist/types.js +1074 -0
  37. package/dist/utilities.d.ts +473 -0
  38. package/dist/utilities.js +2632 -0
  39. package/dist/utilitiesPublic.d.ts +274 -0
  40. package/dist/utilitiesPublic.js +1049 -0
  41. package/dist/visitor.d.ts +15 -0
  42. package/dist/visitor.js +64 -0
  43. package/dist/visitorPublic.d.ts +82 -0
  44. package/dist/visitorPublic.js +352 -0
  45. package/package.json +14 -42
  46. package/dist/index.cjs +0 -6
  47. package/dist/index.d.cts +0 -249
@@ -0,0 +1,2626 @@
1
+ import { Map } from "./_namespaces/ts.js";
2
+ import type { Iterator, MapLike, ReadonlyMap } from "./_namespaces/ts.js";
3
+ export type Path = string & {
4
+ __pathBrand: any;
5
+ };
6
+ export type MatchingKeys<TRecord, TMatch, K extends keyof TRecord = keyof TRecord> = K extends (TRecord[K] extends TMatch ? K : never) ? K : never;
7
+ export interface TextRange {
8
+ pos: number;
9
+ end: number;
10
+ }
11
+ export type KeywordSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.StringKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.OfKeyword;
12
+ export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken;
13
+ export declare enum SyntaxKind {
14
+ Unknown = 0,
15
+ EndOfFileToken = 1,
16
+ SingleLineCommentTrivia = 2,
17
+ MultiLineCommentTrivia = 3,
18
+ NewLineTrivia = 4,
19
+ WhitespaceTrivia = 5,
20
+ ShebangTrivia = 6,
21
+ ConflictMarkerTrivia = 7,
22
+ NumericLiteral = 8,
23
+ BigIntLiteral = 9,
24
+ StringLiteral = 10,
25
+ JsxText = 11,
26
+ JsxTextAllWhiteSpaces = 12,
27
+ RegularExpressionLiteral = 13,
28
+ NoSubstitutionTemplateLiteral = 14,
29
+ TemplateHead = 15,
30
+ TemplateMiddle = 16,
31
+ TemplateTail = 17,
32
+ OpenBraceToken = 18,
33
+ CloseBraceToken = 19,
34
+ OpenParenToken = 20,
35
+ CloseParenToken = 21,
36
+ OpenBracketToken = 22,
37
+ CloseBracketToken = 23,
38
+ DotToken = 24,
39
+ DotDotDotToken = 25,
40
+ SemicolonToken = 26,
41
+ CommaToken = 27,
42
+ QuestionDotToken = 28,
43
+ LessThanToken = 29,
44
+ LessThanSlashToken = 30,
45
+ GreaterThanToken = 31,
46
+ LessThanEqualsToken = 32,
47
+ GreaterThanEqualsToken = 33,
48
+ EqualsEqualsToken = 34,
49
+ ExclamationEqualsToken = 35,
50
+ EqualsEqualsEqualsToken = 36,
51
+ ExclamationEqualsEqualsToken = 37,
52
+ EqualsGreaterThanToken = 38,
53
+ PlusToken = 39,
54
+ MinusToken = 40,
55
+ AsteriskToken = 41,
56
+ AsteriskAsteriskToken = 42,
57
+ SlashToken = 43,
58
+ PercentToken = 44,
59
+ PlusPlusToken = 45,
60
+ MinusMinusToken = 46,
61
+ LessThanLessThanToken = 47,
62
+ GreaterThanGreaterThanToken = 48,
63
+ GreaterThanGreaterThanGreaterThanToken = 49,
64
+ AmpersandToken = 50,
65
+ BarToken = 51,
66
+ CaretToken = 52,
67
+ ExclamationToken = 53,
68
+ TildeToken = 54,
69
+ AmpersandAmpersandToken = 55,
70
+ BarBarToken = 56,
71
+ QuestionToken = 57,
72
+ ColonToken = 58,
73
+ AtToken = 59,
74
+ QuestionQuestionToken = 60,
75
+ /** Nenhum scanner o produz (só o do JSDoc o produzia): a crase começa um template. Fica para não renumerar. */
76
+ BacktickToken = 61,
77
+ EqualsToken = 62,
78
+ PlusEqualsToken = 63,
79
+ MinusEqualsToken = 64,
80
+ AsteriskEqualsToken = 65,
81
+ AsteriskAsteriskEqualsToken = 66,
82
+ SlashEqualsToken = 67,
83
+ PercentEqualsToken = 68,
84
+ LessThanLessThanEqualsToken = 69,
85
+ GreaterThanGreaterThanEqualsToken = 70,
86
+ GreaterThanGreaterThanGreaterThanEqualsToken = 71,
87
+ AmpersandEqualsToken = 72,
88
+ BarEqualsToken = 73,
89
+ CaretEqualsToken = 74,
90
+ Identifier = 75,
91
+ PrivateIdentifier = 76,
92
+ BreakKeyword = 77,
93
+ CaseKeyword = 78,
94
+ CatchKeyword = 79,
95
+ ClassKeyword = 80,
96
+ ConstKeyword = 81,
97
+ ContinueKeyword = 82,
98
+ DebuggerKeyword = 83,
99
+ DefaultKeyword = 84,
100
+ DeleteKeyword = 85,
101
+ DoKeyword = 86,
102
+ ElseKeyword = 87,
103
+ EnumKeyword = 88,
104
+ ExportKeyword = 89,
105
+ ExtendsKeyword = 90,
106
+ FalseKeyword = 91,
107
+ FinallyKeyword = 92,
108
+ ForKeyword = 93,
109
+ FunctionKeyword = 94,
110
+ IfKeyword = 95,
111
+ ImportKeyword = 96,
112
+ InKeyword = 97,
113
+ InstanceOfKeyword = 98,
114
+ NewKeyword = 99,
115
+ NullKeyword = 100,
116
+ ReturnKeyword = 101,
117
+ SuperKeyword = 102,
118
+ SwitchKeyword = 103,
119
+ ThisKeyword = 104,
120
+ ThrowKeyword = 105,
121
+ TrueKeyword = 106,
122
+ TryKeyword = 107,
123
+ TypeOfKeyword = 108,
124
+ VarKeyword = 109,
125
+ VoidKeyword = 110,
126
+ WhileKeyword = 111,
127
+ WithKeyword = 112,
128
+ ImplementsKeyword = 113,
129
+ InterfaceKeyword = 114,
130
+ LetKeyword = 115,
131
+ PackageKeyword = 116,
132
+ PrivateKeyword = 117,
133
+ ProtectedKeyword = 118,
134
+ PublicKeyword = 119,
135
+ StaticKeyword = 120,
136
+ YieldKeyword = 121,
137
+ AbstractKeyword = 122,
138
+ AsKeyword = 123,
139
+ AssertsKeyword = 124,
140
+ AnyKeyword = 125,
141
+ AsyncKeyword = 126,
142
+ AwaitKeyword = 127,
143
+ BooleanKeyword = 128,
144
+ ConstructorKeyword = 129,
145
+ DeclareKeyword = 130,
146
+ GetKeyword = 131,
147
+ InferKeyword = 132,
148
+ IsKeyword = 133,
149
+ KeyOfKeyword = 134,
150
+ ModuleKeyword = 135,
151
+ NamespaceKeyword = 136,
152
+ NeverKeyword = 137,
153
+ ReadonlyKeyword = 138,
154
+ RequireKeyword = 139,
155
+ NumberKeyword = 140,
156
+ ObjectKeyword = 141,
157
+ SetKeyword = 142,
158
+ StringKeyword = 143,
159
+ SymbolKeyword = 144,
160
+ TypeKeyword = 145,
161
+ UndefinedKeyword = 146,
162
+ UniqueKeyword = 147,
163
+ UnknownKeyword = 148,
164
+ FromKeyword = 149,
165
+ GlobalKeyword = 150,
166
+ BigIntKeyword = 151,
167
+ OfKeyword = 152,// LastKeyword and LastToken and LastContextualKeyword
168
+ QualifiedName = 153,
169
+ ComputedPropertyName = 154,
170
+ TypeParameter = 155,
171
+ Parameter = 156,
172
+ Decorator = 157,
173
+ PropertySignature = 158,
174
+ PropertyDeclaration = 159,
175
+ MethodSignature = 160,
176
+ MethodDeclaration = 161,
177
+ Constructor = 162,
178
+ GetAccessor = 163,
179
+ SetAccessor = 164,
180
+ CallSignature = 165,
181
+ ConstructSignature = 166,
182
+ IndexSignature = 167,
183
+ TypePredicate = 168,
184
+ TypeReference = 169,
185
+ FunctionType = 170,
186
+ ConstructorType = 171,
187
+ TypeQuery = 172,
188
+ TypeLiteral = 173,
189
+ ArrayType = 174,
190
+ TupleType = 175,
191
+ OptionalType = 176,
192
+ RestType = 177,
193
+ UnionType = 178,
194
+ IntersectionType = 179,
195
+ ConditionalType = 180,
196
+ InferType = 181,
197
+ ParenthesizedType = 182,
198
+ ThisType = 183,
199
+ TypeOperator = 184,
200
+ IndexedAccessType = 185,
201
+ MappedType = 186,
202
+ LiteralType = 187,
203
+ ImportType = 188,
204
+ ObjectBindingPattern = 189,
205
+ ArrayBindingPattern = 190,
206
+ BindingElement = 191,
207
+ ArrayLiteralExpression = 192,
208
+ ObjectLiteralExpression = 193,
209
+ PropertyAccessExpression = 194,
210
+ ElementAccessExpression = 195,
211
+ CallExpression = 196,
212
+ NewExpression = 197,
213
+ TaggedTemplateExpression = 198,
214
+ TypeAssertionExpression = 199,
215
+ ParenthesizedExpression = 200,
216
+ FunctionExpression = 201,
217
+ ArrowFunction = 202,
218
+ DeleteExpression = 203,
219
+ TypeOfExpression = 204,
220
+ VoidExpression = 205,
221
+ AwaitExpression = 206,
222
+ PrefixUnaryExpression = 207,
223
+ PostfixUnaryExpression = 208,
224
+ BinaryExpression = 209,
225
+ ConditionalExpression = 210,
226
+ TemplateExpression = 211,
227
+ YieldExpression = 212,
228
+ SpreadElement = 213,
229
+ ClassExpression = 214,
230
+ OmittedExpression = 215,
231
+ ExpressionWithTypeArguments = 216,
232
+ AsExpression = 217,
233
+ NonNullExpression = 218,
234
+ MetaProperty = 219,
235
+ SyntheticExpression = 220,
236
+ TemplateSpan = 221,
237
+ SemicolonClassElement = 222,
238
+ Block = 223,
239
+ EmptyStatement = 224,
240
+ VariableStatement = 225,
241
+ ExpressionStatement = 226,
242
+ IfStatement = 227,
243
+ DoStatement = 228,
244
+ WhileStatement = 229,
245
+ ForStatement = 230,
246
+ ForInStatement = 231,
247
+ ForOfStatement = 232,
248
+ ContinueStatement = 233,
249
+ BreakStatement = 234,
250
+ ReturnStatement = 235,
251
+ WithStatement = 236,
252
+ SwitchStatement = 237,
253
+ LabeledStatement = 238,
254
+ ThrowStatement = 239,
255
+ TryStatement = 240,
256
+ DebuggerStatement = 241,
257
+ VariableDeclaration = 242,
258
+ VariableDeclarationList = 243,
259
+ FunctionDeclaration = 244,
260
+ ClassDeclaration = 245,
261
+ InterfaceDeclaration = 246,
262
+ TypeAliasDeclaration = 247,
263
+ EnumDeclaration = 248,
264
+ ModuleDeclaration = 249,
265
+ ModuleBlock = 250,
266
+ CaseBlock = 251,
267
+ NamespaceExportDeclaration = 252,
268
+ ImportEqualsDeclaration = 253,
269
+ ImportDeclaration = 254,
270
+ ImportClause = 255,
271
+ NamespaceImport = 256,
272
+ NamedImports = 257,
273
+ ImportSpecifier = 258,
274
+ ExportAssignment = 259,
275
+ ExportDeclaration = 260,
276
+ NamedExports = 261,
277
+ NamespaceExport = 262,
278
+ ExportSpecifier = 263,
279
+ MissingDeclaration = 264,
280
+ ExternalModuleReference = 265,
281
+ JsxElement = 266,
282
+ JsxSelfClosingElement = 267,
283
+ JsxOpeningElement = 268,
284
+ JsxClosingElement = 269,
285
+ JsxFragment = 270,
286
+ JsxOpeningFragment = 271,
287
+ JsxClosingFragment = 272,
288
+ JsxAttribute = 273,
289
+ JsxAttributes = 274,
290
+ JsxSpreadAttribute = 275,
291
+ JsxExpression = 276,
292
+ CaseClause = 277,
293
+ DefaultClause = 278,
294
+ HeritageClause = 279,
295
+ CatchClause = 280,
296
+ PropertyAssignment = 281,
297
+ ShorthandPropertyAssignment = 282,
298
+ SpreadAssignment = 283,
299
+ EnumMember = 284,
300
+ UnparsedPrologue = 285,
301
+ UnparsedPrepend = 286,
302
+ UnparsedText = 287,
303
+ UnparsedInternalText = 288,
304
+ UnparsedSyntheticReference = 289,
305
+ SourceFile = 290,
306
+ Bundle = 291,
307
+ UnparsedSource = 292,
308
+ InputFiles = 293,
309
+ JSDocTypeExpression = 294,
310
+ JSDocAllType = 295,
311
+ JSDocUnknownType = 296,
312
+ JSDocNullableType = 297,
313
+ JSDocNonNullableType = 298,
314
+ JSDocOptionalType = 299,
315
+ JSDocFunctionType = 300,
316
+ JSDocVariadicType = 301,
317
+ JSDocNamepathType = 302,
318
+ JSDocComment = 303,
319
+ JSDocTypeLiteral = 304,
320
+ JSDocSignature = 305,
321
+ JSDocTag = 306,
322
+ JSDocAugmentsTag = 307,
323
+ JSDocImplementsTag = 308,
324
+ JSDocAuthorTag = 309,
325
+ JSDocClassTag = 310,
326
+ JSDocPublicTag = 311,
327
+ JSDocPrivateTag = 312,
328
+ JSDocProtectedTag = 313,
329
+ JSDocReadonlyTag = 314,
330
+ JSDocCallbackTag = 315,
331
+ JSDocEnumTag = 316,
332
+ JSDocParameterTag = 317,
333
+ JSDocReturnTag = 318,
334
+ JSDocThisTag = 319,
335
+ JSDocTypeTag = 320,
336
+ JSDocTemplateTag = 321,
337
+ JSDocTypedefTag = 322,
338
+ JSDocPropertyTag = 323,
339
+ SyntaxList = 324,
340
+ NotEmittedStatement = 325,
341
+ PartiallyEmittedExpression = 326,
342
+ CommaListExpression = 327,
343
+ MergeDeclarationMarker = 328,
344
+ EndOfDeclarationMarker = 329,
345
+ SyntheticReferenceExpression = 330,
346
+ Count = 331,
347
+ FirstAssignment = 62,
348
+ LastAssignment = 74,
349
+ FirstCompoundAssignment = 63,
350
+ LastCompoundAssignment = 74,
351
+ FirstReservedWord = 77,
352
+ LastReservedWord = 112,
353
+ FirstKeyword = 77,
354
+ LastKeyword = 152,
355
+ FirstFutureReservedWord = 113,
356
+ LastFutureReservedWord = 121,
357
+ FirstTypeNode = 168,
358
+ LastTypeNode = 188,
359
+ FirstPunctuation = 18,
360
+ LastPunctuation = 74,
361
+ FirstToken = 0,
362
+ LastToken = 152,
363
+ FirstTriviaToken = 2,
364
+ LastTriviaToken = 7,
365
+ FirstLiteralToken = 8,
366
+ LastLiteralToken = 14,
367
+ FirstTemplateToken = 14,
368
+ LastTemplateToken = 17,
369
+ FirstBinaryOperator = 29,
370
+ LastBinaryOperator = 74,
371
+ FirstStatement = 225,
372
+ LastStatement = 241,
373
+ FirstNode = 153,
374
+ FirstJSDocNode = 294,
375
+ LastJSDocNode = 323,
376
+ FirstJSDocTagNode = 306,
377
+ LastJSDocTagNode = 323,
378
+ FirstContextualKeyword = 122,
379
+ LastContextualKeyword = 152
380
+ }
381
+ export declare enum NodeFlags {
382
+ None = 0,
383
+ Let = 1,// Variable declaration
384
+ Const = 2,// Variable declaration
385
+ NestedNamespace = 4,// Namespace declaration
386
+ Synthesized = 8,// Node was synthesized during transformation
387
+ Namespace = 16,// Namespace declaration
388
+ OptionalChain = 32,// Chained MemberExpression rooted to a pseudo-OptionalExpression
389
+ ExportContext = 64,// Export context (initialized by binding)
390
+ HasImplicitReturn = 256,// If function implicitly returns on one of codepaths (initialized by binding)
391
+ HasExplicitReturn = 512,// If function has explicit reachable return on one of codepaths (initialized by binding)
392
+ GlobalAugmentation = 1024,// Set if module declaration is an augmentation for the global scope
393
+ HasAsyncFunctions = 2048,// If the file has async functions (initialized by binding)
394
+ DisallowInContext = 4096,// If node was parsed in a context where 'in-expressions' are not allowed
395
+ AwaitContext = 32768,// If node was parsed in the 'await' context created when parsing an async function
396
+ ThisNodeHasError = 65536,// If the parser encountered an error when parsing the code that created this node
397
+ JavaScriptFile = 131072,// If node was parsed in a JavaScript
398
+ ThisNodeOrAnySubNodesHasError = 262144,// If this node or any of its children had an error
399
+ HasAggregatedChildData = 524288,// If we've computed data from children and cached it in this node
400
+ PossiblyContainsDynamicImport = 1048576,
401
+ PossiblyContainsImportMeta = 2097152,
402
+ Ambient = 8388608,// If node was inside an ambient context -- a declaration file, or inside something with the `declare` modifier.
403
+ JsonFile = 33554432,// If node was parsed in a Json
404
+ TypeCached = 67108864,// If a type was cached for node at any point
405
+ BlockScoped = 3,
406
+ ReachabilityCheckFlags = 768,
407
+ ReachabilityAndEmitFlags = 2816,
408
+ ContextFlags = 8556544,
409
+ TypeExcludesFlags = 32768,
410
+ PermanentlySetIncrementalFlags = 3145728
411
+ }
412
+ export declare enum ModifierFlags {
413
+ None = 0,
414
+ Export = 1,// Declarations
415
+ Ambient = 2,// Declarations
416
+ Readonly = 64,// Property/Method
417
+ Async = 256,// Property/Method/Function
418
+ HasComputedFlags = 536870912,// Modifier flags have been computed
419
+ TypeScriptModifier = 66,
420
+ All = 323
421
+ }
422
+ export interface Node extends TextRange {
423
+ kind: SyntaxKind;
424
+ flags: NodeFlags;
425
+ modifierFlagsCache: ModifierFlags;
426
+ transformFlags: TransformFlags;
427
+ modifiers?: ModifiersArray;
428
+ id?: number;
429
+ parent: Node;
430
+ original?: Node;
431
+ symbol: Symbol;
432
+ locals?: SymbolTable;
433
+ nextContainer?: Node;
434
+ localSymbol?: Symbol;
435
+ flowNode?: FlowNode;
436
+ emitNode?: EmitNode;
437
+ }
438
+ export type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration;
439
+ export type HasTypeArguments = CallExpression | JsxOpeningElement | JsxSelfClosingElement;
440
+ export type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
441
+ export type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertySignature | PropertyAssignment;
442
+ export type MutableNodeArray<T extends Node> = NodeArray<T> & T[];
443
+ export interface NodeArray<T extends Node> extends ReadonlyArray<T>, TextRange {
444
+ hasTrailingComma?: boolean;
445
+ transformFlags: TransformFlags;
446
+ }
447
+ export interface Token<TKind extends SyntaxKind> extends Node {
448
+ kind: TKind;
449
+ }
450
+ export type DotToken = Token<SyntaxKind.DotToken>;
451
+ export type DotDotDotToken = Token<SyntaxKind.DotDotDotToken>;
452
+ export type QuestionToken = Token<SyntaxKind.QuestionToken>;
453
+ export type QuestionDotToken = Token<SyntaxKind.QuestionDotToken>;
454
+ export type ExclamationToken = Token<SyntaxKind.ExclamationToken>;
455
+ export type ColonToken = Token<SyntaxKind.ColonToken>;
456
+ export type EqualsToken = Token<SyntaxKind.EqualsToken>;
457
+ export type EqualsGreaterThanToken = Token<SyntaxKind.EqualsGreaterThanToken>;
458
+ export type EndOfFileToken = Token<SyntaxKind.EndOfFileToken>;
459
+ export type ReadonlyToken = Token<SyntaxKind.ReadonlyKeyword>;
460
+ export type AwaitKeywordToken = Token<SyntaxKind.AwaitKeyword>;
461
+ export type PlusToken = Token<SyntaxKind.PlusToken>;
462
+ export type MinusToken = Token<SyntaxKind.MinusToken>;
463
+ export type AssertsToken = Token<SyntaxKind.AssertsKeyword>;
464
+ export type Modifier = Token<SyntaxKind.AsyncKeyword> | Token<SyntaxKind.DeclareKeyword> | Token<SyntaxKind.ExportKeyword> | Token<SyntaxKind.ReadonlyKeyword>;
465
+ export type ModifiersArray = NodeArray<Modifier>;
466
+ export declare enum GeneratedIdentifierFlags {
467
+ None = 0,// Not automatically generated.
468
+ Auto = 1,// Automatically generated identifier.
469
+ Loop = 2,// Automatically generated identifier with a preference for '_i'.
470
+ Unique = 3,// Unique name based on the 'text' property.
471
+ Node = 4,// Unique name based on the node in the 'original' property.
472
+ KindMask = 7,// Mask to extract the kind of identifier from its flags.
473
+ ReservedInNestedScopes = 8,// Reserve the generated name in nested scopes
474
+ Optimistic = 16,// First instance won't use '_#' if there's no conflict
475
+ FileLevel = 32
476
+ }
477
+ export interface Identifier extends PrimaryExpression, Declaration {
478
+ kind: SyntaxKind.Identifier;
479
+ /**
480
+ * Prefer to use `id.unescapedText`. (Note: This is available only in services, not internally to the TypeScript compiler.)
481
+ * Text of identifier, but if the identifier begins with two underscores, this will begin with three.
482
+ */
483
+ escapedText: __String;
484
+ originalKeywordKind?: SyntaxKind;
485
+ autoGenerateFlags?: GeneratedIdentifierFlags;
486
+ autoGenerateId?: number;
487
+ typeArguments?: NodeArray<TypeNode | TypeParameterDeclaration>;
488
+ }
489
+ export interface TransientIdentifier extends Identifier {
490
+ resolvedSymbol: Symbol;
491
+ }
492
+ export interface GeneratedIdentifier extends Identifier {
493
+ autoGenerateFlags: GeneratedIdentifierFlags;
494
+ }
495
+ export interface QualifiedName extends Node {
496
+ kind: SyntaxKind.QualifiedName;
497
+ left: EntityName;
498
+ right: Identifier;
499
+ }
500
+ export type EntityName = Identifier | QualifiedName;
501
+ export type PropertyName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName;
502
+ export type DeclarationName = Identifier | StringLiteralLike | NumericLiteral | ComputedPropertyName | ElementAccessExpression | BindingPattern | EntityNameExpression;
503
+ export interface Declaration extends Node {
504
+ _declarationBrand: any;
505
+ }
506
+ export interface NamedDeclaration extends Declaration {
507
+ name?: DeclarationName;
508
+ }
509
+ export interface DynamicNamedDeclaration extends NamedDeclaration {
510
+ name: ComputedPropertyName;
511
+ }
512
+ export interface DynamicNamedBinaryExpression extends BinaryExpression {
513
+ left: ElementAccessExpression;
514
+ }
515
+ export interface LateBoundDeclaration extends DynamicNamedDeclaration {
516
+ name: LateBoundName;
517
+ }
518
+ export interface DeclarationStatement extends NamedDeclaration, Statement {
519
+ name?: Identifier | StringLiteral | NumericLiteral;
520
+ }
521
+ export interface ComputedPropertyName extends Node {
522
+ parent: Declaration;
523
+ kind: SyntaxKind.ComputedPropertyName;
524
+ expression: Expression;
525
+ }
526
+ export interface LateBoundName extends ComputedPropertyName {
527
+ expression: EntityNameExpression;
528
+ }
529
+ export interface TypeParameterDeclaration extends NamedDeclaration {
530
+ kind: SyntaxKind.TypeParameter;
531
+ parent: DeclarationWithTypeParameterChildren | InferTypeNode;
532
+ name: Identifier;
533
+ /** Note: Consider calling `getEffectiveConstraintOfTypeParameter` */
534
+ constraint?: TypeNode;
535
+ default?: TypeNode;
536
+ expression?: Expression;
537
+ }
538
+ export interface SignatureDeclarationBase extends NamedDeclaration {
539
+ kind: SignatureDeclaration["kind"];
540
+ name?: PropertyName;
541
+ typeParameters?: NodeArray<TypeParameterDeclaration>;
542
+ parameters: NodeArray<ParameterDeclaration>;
543
+ type?: TypeNode;
544
+ typeArguments?: NodeArray<TypeNode>;
545
+ }
546
+ export type SignatureDeclaration = CallSignatureDeclaration | MethodSignature | IndexSignatureDeclaration | FunctionTypeNode | ArrowFunction;
547
+ export interface CallSignatureDeclaration extends SignatureDeclarationBase, TypeElement {
548
+ kind: SyntaxKind.CallSignature;
549
+ }
550
+ export type BindingName = Identifier | BindingPattern;
551
+ export interface VariableDeclaration extends NamedDeclaration {
552
+ kind: SyntaxKind.VariableDeclaration;
553
+ parent: VariableDeclarationList | CatchClause;
554
+ name: BindingName;
555
+ exclamationToken?: ExclamationToken;
556
+ type?: TypeNode;
557
+ initializer?: Expression;
558
+ }
559
+ export interface VariableDeclarationList extends Node {
560
+ kind: SyntaxKind.VariableDeclarationList;
561
+ parent: VariableStatement | ForStatement | ForOfStatement | ForInStatement;
562
+ declarations: NodeArray<VariableDeclaration>;
563
+ }
564
+ export interface ParameterDeclaration extends NamedDeclaration {
565
+ kind: SyntaxKind.Parameter;
566
+ parent: SignatureDeclaration;
567
+ dotDotDotToken?: DotDotDotToken;
568
+ name: BindingName;
569
+ questionToken?: QuestionToken;
570
+ type?: TypeNode;
571
+ initializer?: Expression;
572
+ }
573
+ export interface BindingElement extends NamedDeclaration {
574
+ kind: SyntaxKind.BindingElement;
575
+ parent: BindingPattern;
576
+ propertyName?: PropertyName;
577
+ dotDotDotToken?: DotDotDotToken;
578
+ name: BindingName;
579
+ initializer?: Expression;
580
+ }
581
+ export type BindingElementGrandparent = BindingElement["parent"]["parent"];
582
+ export interface PropertySignature extends TypeElement {
583
+ kind: SyntaxKind.PropertySignature;
584
+ name: PropertyName;
585
+ questionToken?: QuestionToken;
586
+ type?: TypeNode;
587
+ initializer?: Expression;
588
+ }
589
+ export interface ObjectLiteralElement extends NamedDeclaration {
590
+ _objectLiteralBrand: any;
591
+ name?: PropertyName;
592
+ }
593
+ /** Unlike ObjectLiteralElement, excludes JSXAttribute and JSXSpreadAttribute. */
594
+ export type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment;
595
+ export interface PropertyAssignment extends ObjectLiteralElement {
596
+ parent: ObjectLiteralExpression;
597
+ kind: SyntaxKind.PropertyAssignment;
598
+ name: PropertyName;
599
+ questionToken?: QuestionToken;
600
+ initializer: Expression;
601
+ }
602
+ export interface ShorthandPropertyAssignment extends ObjectLiteralElement {
603
+ parent: ObjectLiteralExpression;
604
+ kind: SyntaxKind.ShorthandPropertyAssignment;
605
+ name: Identifier;
606
+ questionToken?: QuestionToken;
607
+ exclamationToken?: ExclamationToken;
608
+ equalsToken?: Token<SyntaxKind.EqualsToken>;
609
+ objectAssignmentInitializer?: Expression;
610
+ }
611
+ export interface SpreadAssignment extends ObjectLiteralElement {
612
+ parent: ObjectLiteralExpression;
613
+ kind: SyntaxKind.SpreadAssignment;
614
+ expression: Expression;
615
+ }
616
+ export type VariableLikeDeclaration = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyAssignment | PropertySignature | JsxAttribute | ShorthandPropertyAssignment;
617
+ export interface PropertyLikeDeclaration extends NamedDeclaration {
618
+ name: PropertyName;
619
+ }
620
+ export interface ObjectBindingPattern extends Node {
621
+ kind: SyntaxKind.ObjectBindingPattern;
622
+ parent: VariableDeclaration | ParameterDeclaration | BindingElement;
623
+ elements: NodeArray<BindingElement>;
624
+ }
625
+ export interface ArrayBindingPattern extends Node {
626
+ kind: SyntaxKind.ArrayBindingPattern;
627
+ parent: VariableDeclaration | ParameterDeclaration | BindingElement;
628
+ elements: NodeArray<ArrayBindingElement>;
629
+ }
630
+ export type BindingPattern = ObjectBindingPattern | ArrayBindingPattern;
631
+ export type ArrayBindingElement = BindingElement | OmittedExpression;
632
+ /** A base dos nós que têm assinatura e corpo: na Linguagem, só a arrow. */
633
+ export interface FunctionLikeDeclarationBase extends SignatureDeclarationBase {
634
+ _functionLikeDeclarationBrand: any;
635
+ questionToken?: QuestionToken;
636
+ exclamationToken?: ExclamationToken;
637
+ body?: Block | Expression;
638
+ endFlowNode?: FlowNode;
639
+ }
640
+ export type FunctionLikeDeclaration = ArrowFunction;
641
+ /** @deprecated Use SignatureDeclaration */
642
+ export type FunctionLike = SignatureDeclaration;
643
+ export interface MethodSignature extends SignatureDeclarationBase, TypeElement {
644
+ kind: SyntaxKind.MethodSignature;
645
+ parent: ObjectTypeDeclaration;
646
+ name: PropertyName;
647
+ }
648
+ export interface IndexSignatureDeclaration extends SignatureDeclarationBase, TypeElement {
649
+ kind: SyntaxKind.IndexSignature;
650
+ parent: ObjectTypeDeclaration;
651
+ }
652
+ export interface TypeNode extends Node {
653
+ _typeNodeBrand: any;
654
+ }
655
+ export interface KeywordTypeNode extends TypeNode {
656
+ kind: SyntaxKind.AnyKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.NumberKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.VoidKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.NullKeyword | SyntaxKind.NeverKeyword;
657
+ }
658
+ export interface ImportTypeNode extends NodeWithTypeArguments {
659
+ kind: SyntaxKind.ImportType;
660
+ isTypeOf?: boolean;
661
+ argument: TypeNode;
662
+ qualifier?: EntityName;
663
+ }
664
+ export type LiteralImportTypeNode = ImportTypeNode & {
665
+ argument: LiteralTypeNode & {
666
+ literal: StringLiteral;
667
+ };
668
+ };
669
+ export interface FunctionTypeNode extends TypeNode, SignatureDeclarationBase {
670
+ kind: SyntaxKind.FunctionType;
671
+ type: TypeNode;
672
+ }
673
+ export interface NodeWithTypeArguments extends TypeNode {
674
+ typeArguments?: NodeArray<TypeNode>;
675
+ }
676
+ export type TypeReferenceType = TypeReferenceNode;
677
+ export interface TypeReferenceNode extends NodeWithTypeArguments {
678
+ kind: SyntaxKind.TypeReference;
679
+ typeName: EntityName;
680
+ }
681
+ export interface TypePredicateNode extends TypeNode {
682
+ kind: SyntaxKind.TypePredicate;
683
+ parent: SignatureDeclaration;
684
+ assertsModifier?: AssertsToken;
685
+ parameterName: Identifier;
686
+ type?: TypeNode;
687
+ }
688
+ export interface TypeQueryNode extends TypeNode {
689
+ kind: SyntaxKind.TypeQuery;
690
+ exprName: EntityName;
691
+ }
692
+ export interface TypeLiteralNode extends TypeNode, Declaration {
693
+ kind: SyntaxKind.TypeLiteral;
694
+ members: NodeArray<TypeElement>;
695
+ }
696
+ export interface ArrayTypeNode extends TypeNode {
697
+ kind: SyntaxKind.ArrayType;
698
+ elementType: TypeNode;
699
+ }
700
+ export interface TupleTypeNode extends TypeNode {
701
+ kind: SyntaxKind.TupleType;
702
+ elementTypes: NodeArray<TypeNode>;
703
+ }
704
+ export interface OptionalTypeNode extends TypeNode {
705
+ kind: SyntaxKind.OptionalType;
706
+ type: TypeNode;
707
+ }
708
+ export interface RestTypeNode extends TypeNode {
709
+ kind: SyntaxKind.RestType;
710
+ type: TypeNode;
711
+ }
712
+ export type UnionOrIntersectionTypeNode = UnionTypeNode | IntersectionTypeNode;
713
+ export interface UnionTypeNode extends TypeNode {
714
+ kind: SyntaxKind.UnionType;
715
+ types: NodeArray<TypeNode>;
716
+ }
717
+ export interface IntersectionTypeNode extends TypeNode {
718
+ kind: SyntaxKind.IntersectionType;
719
+ types: NodeArray<TypeNode>;
720
+ }
721
+ export interface ConditionalTypeNode extends TypeNode {
722
+ kind: SyntaxKind.ConditionalType;
723
+ checkType: TypeNode;
724
+ extendsType: TypeNode;
725
+ trueType: TypeNode;
726
+ falseType: TypeNode;
727
+ }
728
+ export interface InferTypeNode extends TypeNode {
729
+ kind: SyntaxKind.InferType;
730
+ typeParameter: TypeParameterDeclaration;
731
+ }
732
+ export interface ParenthesizedTypeNode extends TypeNode {
733
+ kind: SyntaxKind.ParenthesizedType;
734
+ type: TypeNode;
735
+ }
736
+ export interface TypeOperatorNode extends TypeNode {
737
+ kind: SyntaxKind.TypeOperator;
738
+ operator: SyntaxKind.KeyOfKeyword | SyntaxKind.ReadonlyKeyword;
739
+ type: TypeNode;
740
+ }
741
+ export interface IndexedAccessTypeNode extends TypeNode {
742
+ kind: SyntaxKind.IndexedAccessType;
743
+ objectType: TypeNode;
744
+ indexType: TypeNode;
745
+ }
746
+ export interface MappedTypeNode extends TypeNode, Declaration {
747
+ kind: SyntaxKind.MappedType;
748
+ readonlyToken?: ReadonlyToken | PlusToken | MinusToken;
749
+ typeParameter: TypeParameterDeclaration;
750
+ questionToken?: QuestionToken | PlusToken | MinusToken;
751
+ type?: TypeNode;
752
+ }
753
+ export interface LiteralTypeNode extends TypeNode {
754
+ kind: SyntaxKind.LiteralType;
755
+ literal: BooleanLiteral | LiteralExpression | PrefixUnaryExpression;
756
+ }
757
+ export interface StringLiteral extends LiteralExpression, Declaration {
758
+ kind: SyntaxKind.StringLiteral;
759
+ textSourceNode?: Identifier | StringLiteralLike | NumericLiteral;
760
+ /** Note: this is only set when synthesizing a node, not during parsing. */
761
+ singleQuote?: boolean;
762
+ }
763
+ export type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral;
764
+ export interface Expression extends Node {
765
+ _expressionBrand: any;
766
+ }
767
+ export interface OmittedExpression extends Expression {
768
+ kind: SyntaxKind.OmittedExpression;
769
+ }
770
+ export interface PartiallyEmittedExpression extends LeftHandSideExpression {
771
+ kind: SyntaxKind.PartiallyEmittedExpression;
772
+ expression: Expression;
773
+ }
774
+ export interface UnaryExpression extends Expression {
775
+ _unaryExpressionBrand: any;
776
+ }
777
+ /** Deprecated, please use UpdateExpression */
778
+ export type IncrementExpression = UpdateExpression;
779
+ export interface UpdateExpression extends UnaryExpression {
780
+ _updateExpressionBrand: any;
781
+ }
782
+ export type PrefixUnaryOperator = SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.TildeToken | SyntaxKind.ExclamationToken;
783
+ export interface PrefixUnaryExpression extends UpdateExpression {
784
+ kind: SyntaxKind.PrefixUnaryExpression;
785
+ operator: PrefixUnaryOperator;
786
+ operand: UnaryExpression;
787
+ }
788
+ export type PostfixUnaryOperator = SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken;
789
+ export interface PostfixUnaryExpression extends UpdateExpression {
790
+ kind: SyntaxKind.PostfixUnaryExpression;
791
+ operand: LeftHandSideExpression;
792
+ operator: PostfixUnaryOperator;
793
+ }
794
+ export interface LeftHandSideExpression extends UpdateExpression {
795
+ _leftHandSideExpressionBrand: any;
796
+ }
797
+ export interface MemberExpression extends LeftHandSideExpression {
798
+ _memberExpressionBrand: any;
799
+ }
800
+ export interface PrimaryExpression extends MemberExpression {
801
+ _primaryExpressionBrand: any;
802
+ }
803
+ export interface NullLiteral extends PrimaryExpression, TypeNode {
804
+ kind: SyntaxKind.NullKeyword;
805
+ }
806
+ export interface BooleanLiteral extends PrimaryExpression, TypeNode {
807
+ kind: SyntaxKind.TrueKeyword | SyntaxKind.FalseKeyword;
808
+ }
809
+ export interface ImportExpression extends PrimaryExpression {
810
+ kind: SyntaxKind.ImportKeyword;
811
+ }
812
+ export interface DeleteExpression extends UnaryExpression {
813
+ kind: SyntaxKind.DeleteExpression;
814
+ expression: UnaryExpression;
815
+ }
816
+ export interface TypeOfExpression extends UnaryExpression {
817
+ kind: SyntaxKind.TypeOfExpression;
818
+ expression: UnaryExpression;
819
+ }
820
+ export interface AwaitExpression extends UnaryExpression {
821
+ kind: SyntaxKind.AwaitExpression;
822
+ expression: UnaryExpression;
823
+ }
824
+ export type ExponentiationOperator = SyntaxKind.AsteriskAsteriskToken;
825
+ export type MultiplicativeOperator = SyntaxKind.AsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken;
826
+ export type MultiplicativeOperatorOrHigher = ExponentiationOperator | MultiplicativeOperator;
827
+ export type AdditiveOperator = SyntaxKind.PlusToken | SyntaxKind.MinusToken;
828
+ export type AdditiveOperatorOrHigher = MultiplicativeOperatorOrHigher | AdditiveOperator;
829
+ export type ShiftOperator = SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken;
830
+ export type ShiftOperatorOrHigher = AdditiveOperatorOrHigher | ShiftOperator;
831
+ export type RelationalOperator = SyntaxKind.LessThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.InKeyword;
832
+ export type RelationalOperatorOrHigher = ShiftOperatorOrHigher | RelationalOperator;
833
+ export type EqualityOperator = SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken;
834
+ export type EqualityOperatorOrHigher = RelationalOperatorOrHigher | EqualityOperator;
835
+ export type BitwiseOperator = SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken;
836
+ export type BitwiseOperatorOrHigher = EqualityOperatorOrHigher | BitwiseOperator;
837
+ export type LogicalOperator = SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken;
838
+ export type LogicalOperatorOrHigher = BitwiseOperatorOrHigher | LogicalOperator;
839
+ export type CompoundAssignmentOperator = SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken;
840
+ export type AssignmentOperator = SyntaxKind.EqualsToken | CompoundAssignmentOperator;
841
+ export type AssignmentOperatorOrHigher = SyntaxKind.QuestionQuestionToken | LogicalOperatorOrHigher | AssignmentOperator;
842
+ export type BinaryOperator = AssignmentOperatorOrHigher | SyntaxKind.CommaToken;
843
+ export type BinaryOperatorToken = Token<BinaryOperator>;
844
+ export interface BinaryExpression extends Expression, Declaration {
845
+ kind: SyntaxKind.BinaryExpression;
846
+ left: Expression;
847
+ operatorToken: BinaryOperatorToken;
848
+ right: Expression;
849
+ }
850
+ export type AssignmentOperatorToken = Token<AssignmentOperator>;
851
+ export interface AssignmentExpression<TOperator extends AssignmentOperatorToken> extends BinaryExpression {
852
+ left: LeftHandSideExpression;
853
+ operatorToken: TOperator;
854
+ }
855
+ export interface ObjectDestructuringAssignment extends AssignmentExpression<EqualsToken> {
856
+ left: ObjectLiteralExpression;
857
+ }
858
+ export interface ArrayDestructuringAssignment extends AssignmentExpression<EqualsToken> {
859
+ left: ArrayLiteralExpression;
860
+ }
861
+ export type DestructuringAssignment = ObjectDestructuringAssignment | ArrayDestructuringAssignment;
862
+ export type BindingOrAssignmentElement = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | OmittedExpression | SpreadElement | ArrayLiteralExpression | ObjectLiteralExpression | AssignmentExpression<EqualsToken> | Identifier | PropertyAccessExpression | ElementAccessExpression;
863
+ export type BindingOrAssignmentElementRestIndicator = DotDotDotToken | SpreadElement | SpreadAssignment;
864
+ export type BindingOrAssignmentElementTarget = BindingOrAssignmentPattern | Identifier | PropertyAccessExpression | ElementAccessExpression | OmittedExpression;
865
+ export type ObjectBindingOrAssignmentPattern = ObjectBindingPattern | ObjectLiteralExpression;
866
+ export type ArrayBindingOrAssignmentPattern = ArrayBindingPattern | ArrayLiteralExpression;
867
+ export type AssignmentPattern = ObjectLiteralExpression | ArrayLiteralExpression;
868
+ export type BindingOrAssignmentPattern = ObjectBindingOrAssignmentPattern | ArrayBindingOrAssignmentPattern;
869
+ export interface ConditionalExpression extends Expression {
870
+ kind: SyntaxKind.ConditionalExpression;
871
+ condition: Expression;
872
+ questionToken: QuestionToken;
873
+ whenTrue: Expression;
874
+ colonToken: ColonToken;
875
+ whenFalse: Expression;
876
+ }
877
+ export type FunctionBody = Block;
878
+ export type ConciseBody = FunctionBody | Expression;
879
+ export interface ArrowFunction extends Expression, FunctionLikeDeclarationBase {
880
+ kind: SyntaxKind.ArrowFunction;
881
+ equalsGreaterThanToken: EqualsGreaterThanToken;
882
+ body: ConciseBody;
883
+ name: never;
884
+ }
885
+ export interface LiteralLikeNode extends Node {
886
+ text: string;
887
+ isUnterminated?: boolean;
888
+ hasExtendedUnicodeEscape?: boolean;
889
+ }
890
+ export interface TemplateLiteralLikeNode extends LiteralLikeNode {
891
+ rawText?: string;
892
+ }
893
+ export interface LiteralExpression extends LiteralLikeNode, PrimaryExpression {
894
+ _literalExpressionBrand: any;
895
+ }
896
+ export interface NoSubstitutionTemplateLiteral extends LiteralExpression, TemplateLiteralLikeNode, Declaration {
897
+ kind: SyntaxKind.NoSubstitutionTemplateLiteral;
898
+ }
899
+ export declare enum TokenFlags {
900
+ None = 0,
901
+ PrecedingLineBreak = 1,
902
+ Unterminated = 4,
903
+ ExtendedUnicodeEscape = 8,
904
+ Scientific = 16,// e.g. `10e2`
905
+ Octal = 32,// e.g. `0777`
906
+ HexSpecifier = 64,// e.g. `0x00000000`
907
+ BinarySpecifier = 128,// e.g. `0b0110010000000000`
908
+ OctalSpecifier = 256,// e.g. `0o777`
909
+ ContainsSeparator = 512,// e.g. `0b1100_0101`
910
+ UnicodeEscape = 1024,
911
+ BinaryOrOctalSpecifier = 384,
912
+ NumericLiteralFlags = 1008
913
+ }
914
+ export interface NumericLiteral extends LiteralExpression, Declaration {
915
+ kind: SyntaxKind.NumericLiteral;
916
+ numericLiteralFlags: TokenFlags;
917
+ }
918
+ export interface BigIntLiteral extends LiteralExpression {
919
+ kind: SyntaxKind.BigIntLiteral;
920
+ }
921
+ export interface TemplateHead extends TemplateLiteralLikeNode {
922
+ kind: SyntaxKind.TemplateHead;
923
+ parent: TemplateExpression;
924
+ }
925
+ export interface TemplateMiddle extends TemplateLiteralLikeNode {
926
+ kind: SyntaxKind.TemplateMiddle;
927
+ parent: TemplateSpan;
928
+ }
929
+ export interface TemplateTail extends TemplateLiteralLikeNode {
930
+ kind: SyntaxKind.TemplateTail;
931
+ parent: TemplateSpan;
932
+ }
933
+ export type TemplateLiteral = TemplateExpression | NoSubstitutionTemplateLiteral;
934
+ export interface TemplateExpression extends PrimaryExpression {
935
+ kind: SyntaxKind.TemplateExpression;
936
+ head: TemplateHead;
937
+ templateSpans: NodeArray<TemplateSpan>;
938
+ }
939
+ export interface TemplateSpan extends Node {
940
+ kind: SyntaxKind.TemplateSpan;
941
+ parent: TemplateExpression;
942
+ expression: Expression;
943
+ literal: TemplateMiddle | TemplateTail;
944
+ }
945
+ export interface ParenthesizedExpression extends PrimaryExpression {
946
+ kind: SyntaxKind.ParenthesizedExpression;
947
+ expression: Expression;
948
+ }
949
+ export interface ArrayLiteralExpression extends PrimaryExpression {
950
+ kind: SyntaxKind.ArrayLiteralExpression;
951
+ elements: NodeArray<Expression>;
952
+ multiLine?: boolean;
953
+ }
954
+ export interface SpreadElement extends Expression {
955
+ kind: SyntaxKind.SpreadElement;
956
+ parent: ArrayLiteralExpression | CallExpression;
957
+ expression: Expression;
958
+ }
959
+ /**
960
+ * This interface is a base interface for ObjectLiteralExpression and JSXAttributes to extend from. JSXAttributes is similar to
961
+ * ObjectLiteralExpression in that it contains array of properties; however, JSXAttributes' properties can only be
962
+ * JSXAttribute or JSXSpreadAttribute. ObjectLiteralExpression, on the other hand, can only have properties of type
963
+ * ObjectLiteralElement (e.g. PropertyAssignment, ShorthandPropertyAssignment etc.)
964
+ */
965
+ export interface ObjectLiteralExpressionBase<T extends ObjectLiteralElement> extends PrimaryExpression, Declaration {
966
+ properties: NodeArray<T>;
967
+ }
968
+ export interface ObjectLiteralExpression extends ObjectLiteralExpressionBase<ObjectLiteralElementLike> {
969
+ kind: SyntaxKind.ObjectLiteralExpression;
970
+ multiLine?: boolean;
971
+ }
972
+ export type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression;
973
+ export type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression;
974
+ export type AccessExpression = PropertyAccessExpression | ElementAccessExpression;
975
+ export interface PropertyAccessExpression extends MemberExpression, NamedDeclaration {
976
+ kind: SyntaxKind.PropertyAccessExpression;
977
+ expression: LeftHandSideExpression;
978
+ questionDotToken?: QuestionDotToken;
979
+ name: Identifier;
980
+ }
981
+ export interface PropertyAccessChain extends PropertyAccessExpression {
982
+ _optionalChainBrand: any;
983
+ name: Identifier;
984
+ }
985
+ export interface PropertyAccessChainRoot extends PropertyAccessChain {
986
+ questionDotToken: QuestionDotToken;
987
+ }
988
+ /** Brand for a PropertyAccessExpression which, like a QualifiedName, consists of a sequence of identifiers separated by dots. */
989
+ export interface PropertyAccessEntityNameExpression extends PropertyAccessExpression {
990
+ _propertyAccessExpressionLikeQualifiedNameBrand?: any;
991
+ expression: EntityNameExpression;
992
+ name: Identifier;
993
+ }
994
+ export interface ElementAccessExpression extends MemberExpression {
995
+ kind: SyntaxKind.ElementAccessExpression;
996
+ expression: LeftHandSideExpression;
997
+ questionDotToken?: QuestionDotToken;
998
+ argumentExpression: Expression;
999
+ }
1000
+ export interface ElementAccessChain extends ElementAccessExpression {
1001
+ _optionalChainBrand: any;
1002
+ }
1003
+ export interface ElementAccessChainRoot extends ElementAccessChain {
1004
+ questionDotToken: QuestionDotToken;
1005
+ }
1006
+ export interface CallExpression extends LeftHandSideExpression, Declaration {
1007
+ kind: SyntaxKind.CallExpression;
1008
+ expression: LeftHandSideExpression;
1009
+ questionDotToken?: QuestionDotToken;
1010
+ typeArguments?: NodeArray<TypeNode>;
1011
+ arguments: NodeArray<Expression>;
1012
+ }
1013
+ export interface CallChain extends CallExpression {
1014
+ _optionalChainBrand: any;
1015
+ }
1016
+ export interface CallChainRoot extends CallChain {
1017
+ questionDotToken: QuestionDotToken;
1018
+ }
1019
+ export type OptionalChain = PropertyAccessChain | ElementAccessChain | CallChain;
1020
+ export type OptionalChainRoot = PropertyAccessChainRoot | ElementAccessChainRoot | CallChainRoot;
1021
+ export interface WellKnownSymbolExpression extends PropertyAccessExpression {
1022
+ expression: Identifier & {
1023
+ escapedText: "Symbol";
1024
+ };
1025
+ name: Identifier;
1026
+ }
1027
+ export type BindableObjectDefinePropertyCall = CallExpression & {
1028
+ arguments: {
1029
+ 0: BindableStaticNameExpression;
1030
+ 1: StringLiteralLike | NumericLiteral;
1031
+ 2: ObjectLiteralExpression;
1032
+ };
1033
+ };
1034
+ export type BindableStaticNameExpression = EntityNameExpression | BindableStaticElementAccessExpression;
1035
+ export type LiteralLikeElementAccessExpression = ElementAccessExpression & Declaration & {
1036
+ argumentExpression: StringLiteralLike | NumericLiteral | WellKnownSymbolExpression;
1037
+ };
1038
+ export type BindableStaticElementAccessExpression = LiteralLikeElementAccessExpression & {
1039
+ expression: BindableStaticNameExpression;
1040
+ };
1041
+ export type BindableStaticAccessExpression = PropertyAccessEntityNameExpression | BindableStaticElementAccessExpression;
1042
+ export interface ImportCall extends CallExpression {
1043
+ expression: ImportExpression;
1044
+ }
1045
+ export type CallLikeExpression = CallExpression | JsxOpeningLikeElement;
1046
+ export interface AsExpression extends Expression {
1047
+ kind: SyntaxKind.AsExpression;
1048
+ expression: Expression;
1049
+ type: TypeNode;
1050
+ }
1051
+ export type AssertionExpression = AsExpression;
1052
+ export interface MetaProperty extends PrimaryExpression {
1053
+ kind: SyntaxKind.MetaProperty;
1054
+ keywordToken: SyntaxKind.ImportKeyword;
1055
+ name: Identifier;
1056
+ }
1057
+ export interface ImportMetaProperty extends MetaProperty {
1058
+ keywordToken: SyntaxKind.ImportKeyword;
1059
+ name: Identifier & {
1060
+ escapedText: __String & "meta";
1061
+ };
1062
+ }
1063
+ export interface JsxElement extends PrimaryExpression {
1064
+ kind: SyntaxKind.JsxElement;
1065
+ openingElement: JsxOpeningElement;
1066
+ children: NodeArray<JsxChild>;
1067
+ closingElement: JsxClosingElement;
1068
+ }
1069
+ export type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement;
1070
+ export type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute;
1071
+ export type JsxTagNameExpression = Identifier | JsxTagNamePropertyAccess;
1072
+ export interface JsxTagNamePropertyAccess extends PropertyAccessExpression {
1073
+ expression: JsxTagNameExpression;
1074
+ }
1075
+ export interface JsxAttributes extends ObjectLiteralExpressionBase<JsxAttributeLike> {
1076
+ kind: SyntaxKind.JsxAttributes;
1077
+ parent: JsxOpeningLikeElement;
1078
+ }
1079
+ export interface JsxOpeningElement extends Expression {
1080
+ kind: SyntaxKind.JsxOpeningElement;
1081
+ parent: JsxElement;
1082
+ tagName: JsxTagNameExpression;
1083
+ typeArguments?: NodeArray<TypeNode>;
1084
+ attributes: JsxAttributes;
1085
+ }
1086
+ export interface JsxSelfClosingElement extends PrimaryExpression {
1087
+ kind: SyntaxKind.JsxSelfClosingElement;
1088
+ tagName: JsxTagNameExpression;
1089
+ typeArguments?: NodeArray<TypeNode>;
1090
+ attributes: JsxAttributes;
1091
+ }
1092
+ export interface JsxFragment extends PrimaryExpression {
1093
+ kind: SyntaxKind.JsxFragment;
1094
+ openingFragment: JsxOpeningFragment;
1095
+ children: NodeArray<JsxChild>;
1096
+ closingFragment: JsxClosingFragment;
1097
+ }
1098
+ export interface JsxOpeningFragment extends Expression {
1099
+ kind: SyntaxKind.JsxOpeningFragment;
1100
+ parent: JsxFragment;
1101
+ }
1102
+ export interface JsxClosingFragment extends Expression {
1103
+ kind: SyntaxKind.JsxClosingFragment;
1104
+ parent: JsxFragment;
1105
+ }
1106
+ export interface JsxAttribute extends ObjectLiteralElement {
1107
+ kind: SyntaxKind.JsxAttribute;
1108
+ parent: JsxAttributes;
1109
+ name: Identifier;
1110
+ initializer?: StringLiteral | JsxExpression;
1111
+ }
1112
+ export interface JsxSpreadAttribute extends ObjectLiteralElement {
1113
+ kind: SyntaxKind.JsxSpreadAttribute;
1114
+ parent: JsxAttributes;
1115
+ expression: Expression;
1116
+ }
1117
+ export interface JsxClosingElement extends Node {
1118
+ kind: SyntaxKind.JsxClosingElement;
1119
+ parent: JsxElement;
1120
+ tagName: JsxTagNameExpression;
1121
+ }
1122
+ export interface JsxExpression extends Expression {
1123
+ kind: SyntaxKind.JsxExpression;
1124
+ parent: JsxElement | JsxAttributeLike;
1125
+ dotDotDotToken?: Token<SyntaxKind.DotDotDotToken>;
1126
+ expression?: Expression;
1127
+ }
1128
+ export interface JsxText extends LiteralLikeNode {
1129
+ kind: SyntaxKind.JsxText;
1130
+ containsOnlyTriviaWhiteSpaces: boolean;
1131
+ parent: JsxElement;
1132
+ }
1133
+ export type JsxChild = JsxText | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment;
1134
+ export interface Statement extends Node {
1135
+ _statementBrand: any;
1136
+ }
1137
+ export interface NotEmittedStatement extends Statement {
1138
+ kind: SyntaxKind.NotEmittedStatement;
1139
+ }
1140
+ /**
1141
+ * Marks the end of transformed declaration to properly emit exports.
1142
+ */
1143
+ export interface EndOfDeclarationMarker extends Statement {
1144
+ kind: SyntaxKind.EndOfDeclarationMarker;
1145
+ }
1146
+ /**
1147
+ * A list of comma-separated expressions. This node is only created by transformations.
1148
+ */
1149
+ export interface CommaListExpression extends Expression {
1150
+ kind: SyntaxKind.CommaListExpression;
1151
+ elements: NodeArray<Expression>;
1152
+ }
1153
+ /**
1154
+ * Marks the beginning of a merged transformed declaration.
1155
+ */
1156
+ export interface MergeDeclarationMarker extends Statement {
1157
+ kind: SyntaxKind.MergeDeclarationMarker;
1158
+ }
1159
+ export interface SyntheticReferenceExpression extends LeftHandSideExpression {
1160
+ kind: SyntaxKind.SyntheticReferenceExpression;
1161
+ expression: Expression;
1162
+ thisArg: Expression;
1163
+ }
1164
+ export interface EmptyStatement extends Statement {
1165
+ kind: SyntaxKind.EmptyStatement;
1166
+ }
1167
+ export interface MissingDeclaration extends DeclarationStatement {
1168
+ kind: SyntaxKind.MissingDeclaration;
1169
+ name?: Identifier;
1170
+ }
1171
+ export type BlockLike = SourceFile | Block | ModuleBlock | CaseOrDefaultClause;
1172
+ export interface Block extends Statement {
1173
+ kind: SyntaxKind.Block;
1174
+ statements: NodeArray<Statement>;
1175
+ multiLine?: boolean;
1176
+ }
1177
+ export interface VariableStatement extends Statement {
1178
+ kind: SyntaxKind.VariableStatement;
1179
+ declarationList: VariableDeclarationList;
1180
+ }
1181
+ export interface ExpressionStatement extends Statement {
1182
+ kind: SyntaxKind.ExpressionStatement;
1183
+ expression: Expression;
1184
+ }
1185
+ export interface PrologueDirective extends ExpressionStatement {
1186
+ expression: StringLiteral;
1187
+ }
1188
+ export interface IfStatement extends Statement {
1189
+ kind: SyntaxKind.IfStatement;
1190
+ expression: Expression;
1191
+ thenStatement: Statement;
1192
+ elseStatement?: Statement;
1193
+ }
1194
+ export interface IterationStatement extends Statement {
1195
+ statement: Statement;
1196
+ }
1197
+ export interface DoStatement extends IterationStatement {
1198
+ kind: SyntaxKind.DoStatement;
1199
+ expression: Expression;
1200
+ }
1201
+ export interface WhileStatement extends IterationStatement {
1202
+ kind: SyntaxKind.WhileStatement;
1203
+ expression: Expression;
1204
+ }
1205
+ export type ForInitializer = VariableDeclarationList | Expression;
1206
+ export interface ForStatement extends IterationStatement {
1207
+ kind: SyntaxKind.ForStatement;
1208
+ initializer?: ForInitializer;
1209
+ condition?: Expression;
1210
+ incrementor?: Expression;
1211
+ }
1212
+ export type ForInOrOfStatement = ForInStatement | ForOfStatement;
1213
+ export interface ForInStatement extends IterationStatement {
1214
+ kind: SyntaxKind.ForInStatement;
1215
+ initializer: ForInitializer;
1216
+ expression: Expression;
1217
+ }
1218
+ export interface ForOfStatement extends IterationStatement {
1219
+ kind: SyntaxKind.ForOfStatement;
1220
+ awaitModifier?: AwaitKeywordToken;
1221
+ initializer: ForInitializer;
1222
+ expression: Expression;
1223
+ }
1224
+ export interface BreakStatement extends Statement {
1225
+ kind: SyntaxKind.BreakStatement;
1226
+ }
1227
+ export interface ContinueStatement extends Statement {
1228
+ kind: SyntaxKind.ContinueStatement;
1229
+ }
1230
+ export type BreakOrContinueStatement = BreakStatement | ContinueStatement;
1231
+ export interface ReturnStatement extends Statement {
1232
+ kind: SyntaxKind.ReturnStatement;
1233
+ expression?: Expression;
1234
+ }
1235
+ export interface SwitchStatement extends Statement {
1236
+ kind: SyntaxKind.SwitchStatement;
1237
+ expression: Expression;
1238
+ caseBlock: CaseBlock;
1239
+ possiblyExhaustive?: boolean;
1240
+ }
1241
+ export interface CaseBlock extends Node {
1242
+ kind: SyntaxKind.CaseBlock;
1243
+ parent: SwitchStatement;
1244
+ clauses: NodeArray<CaseOrDefaultClause>;
1245
+ }
1246
+ export interface CaseClause extends Node {
1247
+ kind: SyntaxKind.CaseClause;
1248
+ parent: CaseBlock;
1249
+ expression: Expression;
1250
+ statements: NodeArray<Statement>;
1251
+ fallthroughFlowNode?: FlowNode;
1252
+ }
1253
+ export interface DefaultClause extends Node {
1254
+ kind: SyntaxKind.DefaultClause;
1255
+ parent: CaseBlock;
1256
+ statements: NodeArray<Statement>;
1257
+ fallthroughFlowNode?: FlowNode;
1258
+ }
1259
+ export type CaseOrDefaultClause = CaseClause | DefaultClause;
1260
+ export interface ThrowStatement extends Statement {
1261
+ kind: SyntaxKind.ThrowStatement;
1262
+ expression?: Expression;
1263
+ }
1264
+ export interface TryStatement extends Statement {
1265
+ kind: SyntaxKind.TryStatement;
1266
+ tryBlock: Block;
1267
+ catchClause?: CatchClause;
1268
+ finallyBlock?: Block;
1269
+ }
1270
+ export interface CatchClause extends Node {
1271
+ kind: SyntaxKind.CatchClause;
1272
+ parent: TryStatement;
1273
+ variableDeclaration?: VariableDeclaration;
1274
+ block: Block;
1275
+ }
1276
+ export type ObjectTypeDeclaration = TypeLiteralNode;
1277
+ export type DeclarationWithTypeParameters = DeclarationWithTypeParameterChildren;
1278
+ export type DeclarationWithTypeParameterChildren = SignatureDeclaration | TypeAliasDeclaration;
1279
+ export interface TypeElement extends NamedDeclaration {
1280
+ _typeElementBrand: any;
1281
+ name?: PropertyName;
1282
+ questionToken?: QuestionToken;
1283
+ }
1284
+ export interface TypeAliasDeclaration extends DeclarationStatement {
1285
+ kind: SyntaxKind.TypeAliasDeclaration;
1286
+ name: Identifier;
1287
+ typeParameters?: NodeArray<TypeParameterDeclaration>;
1288
+ type: TypeNode;
1289
+ }
1290
+ export type ModuleName = Identifier;
1291
+ export type ModuleBody = NamespaceBody;
1292
+ export interface AmbientModuleDeclaration extends ModuleDeclaration {
1293
+ body?: ModuleBlock;
1294
+ }
1295
+ export interface ModuleDeclaration extends DeclarationStatement {
1296
+ kind: SyntaxKind.ModuleDeclaration;
1297
+ parent: ModuleBody | SourceFile;
1298
+ name: ModuleName;
1299
+ body?: ModuleBody;
1300
+ }
1301
+ export type NamespaceBody = ModuleBlock | NamespaceDeclaration;
1302
+ export interface NamespaceDeclaration extends ModuleDeclaration {
1303
+ name: Identifier;
1304
+ body: NamespaceBody;
1305
+ }
1306
+ export interface ModuleBlock extends Node, Statement {
1307
+ kind: SyntaxKind.ModuleBlock;
1308
+ parent: ModuleDeclaration;
1309
+ statements: NodeArray<Statement>;
1310
+ }
1311
+ export interface ImportDeclaration extends Statement {
1312
+ kind: SyntaxKind.ImportDeclaration;
1313
+ parent: SourceFile | ModuleBlock;
1314
+ importClause?: ImportClause;
1315
+ /** If this is not a StringLiteral it will be a grammar error. */
1316
+ moduleSpecifier: Expression;
1317
+ }
1318
+ export type NamedImportBindings = NamespaceImport | NamedImports;
1319
+ export type NamedExportBindings = NamespaceExport | NamedExports;
1320
+ export interface ImportClause extends NamedDeclaration {
1321
+ kind: SyntaxKind.ImportClause;
1322
+ parent: ImportDeclaration;
1323
+ isTypeOnly: boolean;
1324
+ name?: Identifier;
1325
+ namedBindings?: NamedImportBindings;
1326
+ }
1327
+ export interface NamespaceImport extends NamedDeclaration {
1328
+ kind: SyntaxKind.NamespaceImport;
1329
+ parent: ImportClause;
1330
+ name: Identifier;
1331
+ }
1332
+ export interface NamespaceExport extends NamedDeclaration {
1333
+ kind: SyntaxKind.NamespaceExport;
1334
+ parent: ExportDeclaration;
1335
+ name: Identifier;
1336
+ }
1337
+ export interface ExportDeclaration extends DeclarationStatement {
1338
+ kind: SyntaxKind.ExportDeclaration;
1339
+ parent: SourceFile | ModuleBlock;
1340
+ isTypeOnly: boolean;
1341
+ /** Will not be assigned in the case of `export * from "foo";` */
1342
+ exportClause?: NamedExportBindings;
1343
+ /** If this is not a StringLiteral it will be a grammar error. */
1344
+ moduleSpecifier?: Expression;
1345
+ }
1346
+ export interface NamedImports extends Node {
1347
+ kind: SyntaxKind.NamedImports;
1348
+ parent: ImportClause;
1349
+ elements: NodeArray<ImportSpecifier>;
1350
+ }
1351
+ export interface NamedExports extends Node {
1352
+ kind: SyntaxKind.NamedExports;
1353
+ parent: ExportDeclaration;
1354
+ elements: NodeArray<ExportSpecifier>;
1355
+ }
1356
+ export type NamedImportsOrExports = NamedImports | NamedExports;
1357
+ export interface ImportSpecifier extends NamedDeclaration {
1358
+ kind: SyntaxKind.ImportSpecifier;
1359
+ parent: NamedImports;
1360
+ propertyName?: Identifier;
1361
+ name: Identifier;
1362
+ }
1363
+ export interface ExportSpecifier extends NamedDeclaration {
1364
+ kind: SyntaxKind.ExportSpecifier;
1365
+ parent: NamedExports;
1366
+ propertyName?: Identifier;
1367
+ name: Identifier;
1368
+ }
1369
+ export type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier;
1370
+ export type TypeOnlyCompatibleAliasDeclaration = ImportClause | NamespaceImport | ImportOrExportSpecifier;
1371
+ /** O `export default` de uma expressão. */
1372
+ export interface ExportAssignment extends DeclarationStatement {
1373
+ kind: SyntaxKind.ExportAssignment;
1374
+ parent: SourceFile;
1375
+ expression: Expression;
1376
+ }
1377
+ export interface FileReference extends TextRange {
1378
+ fileName: string;
1379
+ }
1380
+ export interface CheckJsDirective extends TextRange {
1381
+ enabled: boolean;
1382
+ }
1383
+ export type CommentKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia;
1384
+ export interface CommentRange extends TextRange {
1385
+ hasTrailingNewLine?: boolean;
1386
+ kind: CommentKind;
1387
+ }
1388
+ export interface SynthesizedComment extends CommentRange {
1389
+ text: string;
1390
+ pos: -1;
1391
+ end: -1;
1392
+ }
1393
+ export declare enum FlowFlags {
1394
+ Unreachable = 1,// Unreachable code
1395
+ Start = 2,// Start of flow graph
1396
+ BranchLabel = 4,// Non-looping junction
1397
+ LoopLabel = 8,// Looping junction
1398
+ Assignment = 16,// Assignment
1399
+ TrueCondition = 32,// Condition known to be true
1400
+ FalseCondition = 64,// Condition known to be false
1401
+ SwitchClause = 128,// Switch statement clause
1402
+ ArrayMutation = 256,// Potential array mutation
1403
+ Call = 512,// Potential assertion call
1404
+ ReduceLabel = 1024,// Temporarily reduce antecedents of label
1405
+ Referenced = 2048,// Referenced as antecedent once
1406
+ Shared = 4096,// Referenced as antecedent more than once
1407
+ Label = 12,
1408
+ Condition = 96
1409
+ }
1410
+ export type FlowNode = AfterFinallyFlow | PreFinallyFlow | FlowStart | FlowLabel | FlowAssignment | FlowCall | FlowCondition | FlowSwitchClause | FlowArrayMutation;
1411
+ export interface FlowNodeBase {
1412
+ flags: FlowFlags;
1413
+ id?: number;
1414
+ }
1415
+ export interface FlowLock {
1416
+ locked?: boolean;
1417
+ }
1418
+ export interface AfterFinallyFlow extends FlowNodeBase, FlowLock {
1419
+ antecedent: FlowNode;
1420
+ }
1421
+ export interface PreFinallyFlow extends FlowNodeBase {
1422
+ antecedent: FlowNode;
1423
+ lock: FlowLock;
1424
+ }
1425
+ export interface FlowStart extends FlowNodeBase {
1426
+ node?: ArrowFunction;
1427
+ }
1428
+ export interface FlowLabel extends FlowNodeBase {
1429
+ antecedents: FlowNode[] | undefined;
1430
+ }
1431
+ export interface FlowAssignment extends FlowNodeBase {
1432
+ node: Expression | VariableDeclaration | BindingElement;
1433
+ antecedent: FlowNode;
1434
+ }
1435
+ export interface FlowCall extends FlowNodeBase {
1436
+ node: CallExpression;
1437
+ antecedent: FlowNode;
1438
+ }
1439
+ export interface FlowCondition extends FlowNodeBase {
1440
+ node: Expression;
1441
+ antecedent: FlowNode;
1442
+ }
1443
+ export interface FlowSwitchClause extends FlowNodeBase {
1444
+ switchStatement: SwitchStatement;
1445
+ clauseStart: number;
1446
+ clauseEnd: number;
1447
+ antecedent: FlowNode;
1448
+ }
1449
+ export interface FlowArrayMutation extends FlowNodeBase {
1450
+ node: CallExpression | BinaryExpression;
1451
+ antecedent: FlowNode;
1452
+ }
1453
+ export interface FlowReduceLabel extends FlowNodeBase {
1454
+ target: FlowLabel;
1455
+ antecedents: FlowNode[];
1456
+ antecedent: FlowNode;
1457
+ }
1458
+ export interface AmdDependency {
1459
+ path: string;
1460
+ name?: string;
1461
+ }
1462
+ /**
1463
+ * Subset of properties from SourceFile that are used in multiple utility functions
1464
+ */
1465
+ export interface SourceFileLike {
1466
+ readonly text: string;
1467
+ lineMap?: readonly number[];
1468
+ getPositionOfLineAndCharacter?(line: number, character: number, allowEdits?: true): number;
1469
+ }
1470
+ export interface SourceFile extends Declaration {
1471
+ kind: SyntaxKind.SourceFile;
1472
+ statements: NodeArray<Statement>;
1473
+ endOfFileToken: Token<SyntaxKind.EndOfFileToken>;
1474
+ fileName: string;
1475
+ path: Path;
1476
+ text: string;
1477
+ /** Resolved path can be different from path property,
1478
+ * when file is included through project reference is mapped to its output instead of source
1479
+ * in that case resolvedPath = path to output file
1480
+ * path = input file's path
1481
+ */
1482
+ resolvedPath: Path;
1483
+ /** Original file name that can be different from fileName,
1484
+ * when file is included through project reference is mapped to its output instead of source
1485
+ * in that case originalFileName = name of input file
1486
+ * fileName = output file's name
1487
+ */
1488
+ originalFileName: string;
1489
+ amdDependencies: readonly AmdDependency[];
1490
+ moduleName?: string;
1491
+ referencedFiles: readonly FileReference[];
1492
+ typeReferenceDirectives: readonly FileReference[];
1493
+ libReferenceDirectives: readonly FileReference[];
1494
+ languageVariant: LanguageVariant;
1495
+ isDeclarationFile: boolean;
1496
+ renamedDependencies?: ReadonlyMap<string>;
1497
+ /**
1498
+ * lib.d.ts should have a reference comment like
1499
+ *
1500
+ * /// <reference no-default-lib="true"/>
1501
+ *
1502
+ * If any other file has this comment, it signals not to include lib.d.ts
1503
+ * because this containing file is intended to act as a default library.
1504
+ */
1505
+ hasNoDefaultLib: boolean;
1506
+ languageVersion: ScriptTarget;
1507
+ scriptKind: ScriptKind;
1508
+ /**
1509
+ * The first "most obvious" node that makes a file an external module.
1510
+ * This is intended to be the first top-level import/export,
1511
+ * but could be arbitrarily nested (e.g. `import.meta`).
1512
+ */
1513
+ externalModuleIndicator?: Node;
1514
+ commonJsModuleIndicator?: Node;
1515
+ identifiers: Map<string>;
1516
+ parseDiagnostics: DiagnosticWithLocation[];
1517
+ bindDiagnostics: DiagnosticWithLocation[];
1518
+ bindSuggestionDiagnostics?: DiagnosticWithLocation[];
1519
+ additionalSyntacticDiagnostics?: readonly DiagnosticWithLocation[];
1520
+ lineMap: readonly number[];
1521
+ classifiableNames?: ReadonlyUnderscoreEscapedMap<true>;
1522
+ commentDirectives?: CommentDirective[];
1523
+ resolvedModules?: Map<ResolvedModuleFull | undefined>;
1524
+ imports: readonly StringLiteralLike[];
1525
+ moduleAugmentations: readonly Identifier[];
1526
+ ambientModuleNames: readonly string[];
1527
+ checkJsDirective?: CheckJsDirective;
1528
+ version: string;
1529
+ pragmas: ReadonlyPragmaMap;
1530
+ exportedModulesFromDeclarationEmit?: ExportedModulesFromDeclarationEmit;
1531
+ }
1532
+ export interface CommentDirective {
1533
+ range: TextRange;
1534
+ type: CommentDirectiveType;
1535
+ }
1536
+ export declare enum CommentDirectiveType {
1537
+ ExpectError = 0,
1538
+ Ignore = 1
1539
+ }
1540
+ export type ExportedModulesFromDeclarationEmit = readonly Symbol[];
1541
+ export interface Bundle extends Node {
1542
+ kind: SyntaxKind.Bundle;
1543
+ prepends: readonly (InputFiles | UnparsedSource)[];
1544
+ sourceFiles: readonly SourceFile[];
1545
+ syntheticFileReferences?: readonly FileReference[];
1546
+ syntheticTypeReferences?: readonly FileReference[];
1547
+ syntheticLibReferences?: readonly FileReference[];
1548
+ hasNoDefaultLib?: boolean;
1549
+ }
1550
+ export interface InputFiles extends Node {
1551
+ kind: SyntaxKind.InputFiles;
1552
+ javascriptPath?: string;
1553
+ javascriptText: string;
1554
+ javascriptMapPath?: string;
1555
+ javascriptMapText?: string;
1556
+ declarationPath?: string;
1557
+ declarationText: string;
1558
+ declarationMapPath?: string;
1559
+ declarationMapText?: string;
1560
+ buildInfoPath?: string;
1561
+ buildInfo?: BuildInfo;
1562
+ oldFileOfCurrentEmit?: boolean;
1563
+ }
1564
+ export interface UnparsedSource extends Node {
1565
+ kind: SyntaxKind.UnparsedSource;
1566
+ fileName: string;
1567
+ text: string;
1568
+ prologues: readonly UnparsedPrologue[];
1569
+ helpers: readonly UnscopedEmitHelper[] | undefined;
1570
+ referencedFiles: readonly FileReference[];
1571
+ typeReferenceDirectives: readonly string[] | undefined;
1572
+ libReferenceDirectives: readonly FileReference[];
1573
+ hasNoDefaultLib?: boolean;
1574
+ sourceMapPath?: string;
1575
+ sourceMapText?: string;
1576
+ syntheticReferences?: readonly UnparsedSyntheticReference[];
1577
+ texts: readonly UnparsedSourceText[];
1578
+ oldFileOfCurrentEmit?: boolean;
1579
+ parsedSourceMap?: RawSourceMap | false | undefined;
1580
+ getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
1581
+ }
1582
+ export type UnparsedSourceText = UnparsedPrepend | UnparsedTextLike;
1583
+ export type UnparsedNode = UnparsedPrologue | UnparsedSourceText | UnparsedSyntheticReference;
1584
+ export interface UnparsedSection extends Node {
1585
+ kind: SyntaxKind;
1586
+ data?: string;
1587
+ parent: UnparsedSource;
1588
+ }
1589
+ export interface UnparsedPrologue extends UnparsedSection {
1590
+ kind: SyntaxKind.UnparsedPrologue;
1591
+ data: string;
1592
+ parent: UnparsedSource;
1593
+ }
1594
+ export interface UnparsedPrepend extends UnparsedSection {
1595
+ kind: SyntaxKind.UnparsedPrepend;
1596
+ data: string;
1597
+ parent: UnparsedSource;
1598
+ texts: readonly UnparsedTextLike[];
1599
+ }
1600
+ export interface UnparsedTextLike extends UnparsedSection {
1601
+ kind: SyntaxKind.UnparsedText | SyntaxKind.UnparsedInternalText;
1602
+ parent: UnparsedSource;
1603
+ }
1604
+ export interface UnparsedSyntheticReference extends UnparsedSection {
1605
+ kind: SyntaxKind.UnparsedSyntheticReference;
1606
+ parent: UnparsedSource;
1607
+ section: BundleFileHasNoDefaultLib | BundleFileReference;
1608
+ }
1609
+ export interface JsonSourceFile extends SourceFile {
1610
+ statements: NodeArray<JsonObjectExpressionStatement>;
1611
+ }
1612
+ export interface TsConfigSourceFile extends JsonSourceFile {
1613
+ extendedSourceFiles?: string[];
1614
+ }
1615
+ export interface JsonMinusNumericLiteral extends PrefixUnaryExpression {
1616
+ kind: SyntaxKind.PrefixUnaryExpression;
1617
+ operator: SyntaxKind.MinusToken;
1618
+ operand: NumericLiteral;
1619
+ }
1620
+ export interface JsonObjectExpressionStatement extends ExpressionStatement {
1621
+ expression: ObjectLiteralExpression | ArrayLiteralExpression | JsonMinusNumericLiteral | NumericLiteral | StringLiteral | BooleanLiteral | NullLiteral;
1622
+ }
1623
+ export interface CustomTransformer {
1624
+ transformSourceFile(node: SourceFile): SourceFile;
1625
+ transformBundle(node: Bundle): Bundle;
1626
+ }
1627
+ /** Return code used by getEmitOutput function to indicate status of the function */
1628
+ export declare enum ExitStatus {
1629
+ Success = 0,
1630
+ DiagnosticsPresent_OutputsSkipped = 1,
1631
+ DiagnosticsPresent_OutputsGenerated = 2,
1632
+ InvalidProject_OutputsSkipped = 3,
1633
+ ProjectReferenceCycle_OutputsSkipped = 4,
1634
+ /** @deprecated Use ProjectReferenceCycle_OutputsSkipped instead. */
1635
+ ProjectReferenceCycle_OutputsSkupped = 4
1636
+ }
1637
+ export declare enum SyntheticSymbolKind {
1638
+ UnionOrIntersection = 0,
1639
+ Spread = 1
1640
+ }
1641
+ export type AnyImportSyntax = ImportDeclaration;
1642
+ export type AnyImportOrReExport = AnyImportSyntax | ExportDeclaration;
1643
+ export interface ValidImportTypeNode extends ImportTypeNode {
1644
+ argument: LiteralTypeNode & {
1645
+ literal: StringLiteral;
1646
+ };
1647
+ }
1648
+ /** Na tag, também o `import =` de `require` (CK-03). */
1649
+ export type AnyValidImportOrReExport = (ImportDeclaration | ExportDeclaration) & {
1650
+ moduleSpecifier: StringLiteral;
1651
+ } | RequireOrImportCall | ValidImportTypeNode;
1652
+ export type RequireOrImportCall = CallExpression & {
1653
+ expression: Identifier;
1654
+ arguments: [StringLiteralLike];
1655
+ };
1656
+ export type LateVisibilityPaintedStatement = AnyImportSyntax | VariableStatement | ModuleDeclaration | TypeAliasDeclaration;
1657
+ export declare enum SymbolFlags {
1658
+ None = 0,
1659
+ FunctionScopedVariable = 1,// Variable (var) or parameter
1660
+ BlockScopedVariable = 2,// A block-scoped variable (let or const)
1661
+ Property = 4,// Property
1662
+ Function = 16,// Function
1663
+ Interface = 64,// Interface
1664
+ ValueModule = 512,// Instantiated module
1665
+ NamespaceModule = 1024,// Uninstantiated module
1666
+ TypeLiteral = 2048,// Type Literal or mapped type
1667
+ ObjectLiteral = 4096,// Object Literal
1668
+ Method = 8192,// Method
1669
+ Signature = 131072,// Call or index signature
1670
+ TypeParameter = 262144,// Type parameter
1671
+ TypeAlias = 524288,// Type alias
1672
+ ExportValue = 1048576,// Exported value marker (see comment in declareModuleMember in binder)
1673
+ Alias = 2097152,// An alias for another symbol (see comment in isAliasSymbolDeclaration in checker)
1674
+ ExportStar = 8388608,// Export * declaration
1675
+ Optional = 16777216,// Optional property
1676
+ Transient = 33554432,// Transient symbol (created during type check)
1677
+ Assignment = 67108864,// Assignment treated as declaration (eg `this.prop = 1`)
1678
+ ModuleExports = 134217728,// Symbol for CommonJS `module` of `module.exports`
1679
+ All = 62799447,
1680
+ Variable = 3,
1681
+ Value = 12823,
1682
+ Type = 788544,
1683
+ Namespace = 1536,
1684
+ Module = 1536,
1685
+ BlockScopedVariableExcludes = 12823,
1686
+ ParameterExcludes = 12823,
1687
+ PropertyExcludes = 0,
1688
+ FunctionExcludes = 12295,
1689
+ ValueModuleExcludes = 12295,
1690
+ NamespaceModuleExcludes = 0,
1691
+ TypeParameterExcludes = 526400,
1692
+ TypeAliasExcludes = 788544,
1693
+ AliasExcludes = 2097152,
1694
+ ModuleMember = 2623059,
1695
+ ExportHasLocal = 528,
1696
+ BlockScoped = 2,
1697
+ ClassMember = 8196,
1698
+ Classifiable = 2885184,
1699
+ LateBindingContainer = 6224
1700
+ }
1701
+ export interface Symbol {
1702
+ flags: SymbolFlags;
1703
+ escapedName: __String;
1704
+ declarations: Declaration[];
1705
+ valueDeclaration: Declaration;
1706
+ members?: SymbolTable;
1707
+ exports?: SymbolTable;
1708
+ id?: number;
1709
+ mergeId?: number;
1710
+ parent?: Symbol;
1711
+ exportSymbol?: Symbol;
1712
+ isReferenced?: SymbolFlags;
1713
+ isAssigned?: boolean;
1714
+ }
1715
+ export declare enum InternalSymbolName {
1716
+ Call = "__call",// Call signatures
1717
+ Index = "__index",// Index signatures
1718
+ ExportStar = "__export",// Module export * declarations
1719
+ Global = "__global",// Global self-reference
1720
+ Missing = "__missing",// Indicates missing symbol
1721
+ Type = "__type",// Anonymous type literal symbol
1722
+ Object = "__object",// Anonymous object literal declaration
1723
+ JSXAttributes = "__jsxAttributes",// Anonymous JSX attributes object literal declaration
1724
+ Function = "__function",// Unnamed function expression
1725
+ Computed = "__computed",// Computed property name declaration with dynamic name
1726
+ Resolving = "__resolving__",// Indicator symbol used to mark partially resolved type aliases
1727
+ Default = "default"
1728
+ }
1729
+ /**
1730
+ * This represents a string whose leading underscore have been escaped by adding extra leading underscores.
1731
+ * The shape of this brand is rather unique compared to others we've used.
1732
+ * Instead of just an intersection of a string and an object, it is that union-ed
1733
+ * with an intersection of void and an object. This makes it wholly incompatible
1734
+ * with a normal string (which is good, it cannot be misused on assignment or on usage),
1735
+ * while still being comparable with a normal string via === (also good) and castable from a string.
1736
+ */
1737
+ export type __String = (string & {
1738
+ __escapedIdentifier: void;
1739
+ }) | (void & {
1740
+ __escapedIdentifier: void;
1741
+ }) | InternalSymbolName;
1742
+ /** ReadonlyMap where keys are `__String`s. */
1743
+ export interface ReadonlyUnderscoreEscapedMap<T> {
1744
+ get(key: __String): T | undefined;
1745
+ has(key: __String): boolean;
1746
+ forEach(action: (value: T, key: __String) => void): void;
1747
+ readonly size: number;
1748
+ keys(): Iterator<__String>;
1749
+ values(): Iterator<T>;
1750
+ entries(): Iterator<[__String, T]>;
1751
+ }
1752
+ /** Map where keys are `__String`s. */
1753
+ export interface UnderscoreEscapedMap<T> extends ReadonlyUnderscoreEscapedMap<T> {
1754
+ set(key: __String, value: T): this;
1755
+ delete(key: __String): boolean;
1756
+ clear(): void;
1757
+ }
1758
+ /** SymbolTable based on ES6 Map interface. */
1759
+ export type SymbolTable = UnderscoreEscapedMap<Symbol>;
1760
+ export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression;
1761
+ export declare enum AssignmentDeclarationKind {
1762
+ None = 0,
1763
+ ExportsProperty = 1,
1764
+ ModuleExports = 2,
1765
+ PrototypeProperty = 3,
1766
+ Property = 4,
1767
+ Prototype = 5,
1768
+ ObjectDefinePropertyValue = 6,
1769
+ ObjectDefinePropertyExports = 7,
1770
+ ObjectDefinePrototypeProperty = 8
1771
+ }
1772
+ /** @deprecated Use FileExtensionInfo instead. */
1773
+ export interface DiagnosticMessage {
1774
+ key: string;
1775
+ category: DiagnosticCategory;
1776
+ code: number;
1777
+ message: string;
1778
+ reportsUnnecessary?: {};
1779
+ elidedInCompatabilityPyramid?: boolean;
1780
+ }
1781
+ /**
1782
+ * A linked list of formatted diagnostic messages to be used as part of a multiline message.
1783
+ * It is built from the bottom up, leaving the head to be the "main" diagnostic.
1784
+ * While it seems that DiagnosticMessageChain is structurally similar to DiagnosticMessage,
1785
+ * the difference is that messages are all preformatted in DMC.
1786
+ */
1787
+ export interface DiagnosticMessageChain {
1788
+ messageText: string;
1789
+ category: DiagnosticCategory;
1790
+ code: number;
1791
+ next?: DiagnosticMessageChain[];
1792
+ }
1793
+ export interface Diagnostic extends DiagnosticRelatedInformation {
1794
+ /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
1795
+ reportsUnnecessary?: {};
1796
+ source?: string;
1797
+ relatedInformation?: DiagnosticRelatedInformation[];
1798
+ }
1799
+ export interface DiagnosticRelatedInformation {
1800
+ category: DiagnosticCategory;
1801
+ code: number;
1802
+ file: SourceFile | undefined;
1803
+ start: number | undefined;
1804
+ length: number | undefined;
1805
+ messageText: string | DiagnosticMessageChain;
1806
+ }
1807
+ export interface DiagnosticWithLocation extends Diagnostic {
1808
+ file: SourceFile;
1809
+ start: number;
1810
+ length: number;
1811
+ }
1812
+ export declare enum DiagnosticCategory {
1813
+ Warning = 0,
1814
+ Error = 1,
1815
+ Suggestion = 2,
1816
+ Message = 3
1817
+ }
1818
+ export declare enum ModuleResolutionKind {
1819
+ Classic = 1,
1820
+ NodeJs = 2
1821
+ }
1822
+ export interface PluginImport {
1823
+ name: string;
1824
+ }
1825
+ export interface ProjectReference {
1826
+ /** A normalized path on disk */
1827
+ path: string;
1828
+ /** The path as the user originally wrote it */
1829
+ originalPath?: string;
1830
+ /** True if the output of this reference should be prepended to the output of this project. Only valid for --outFile compilations */
1831
+ prepend?: boolean;
1832
+ /** True if it is intended that this reference form a circularity */
1833
+ circular?: boolean;
1834
+ }
1835
+ export type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | PluginImport[] | ProjectReference[] | null | undefined;
1836
+ export interface CompilerOptions {
1837
+ all?: boolean;
1838
+ allowJs?: boolean;
1839
+ allowNonTsExtensions?: boolean;
1840
+ allowSyntheticDefaultImports?: boolean;
1841
+ allowUmdGlobalAccess?: boolean;
1842
+ allowUnreachableCode?: boolean;
1843
+ allowUnusedLabels?: boolean;
1844
+ alwaysStrict?: boolean;
1845
+ baseUrl?: string;
1846
+ /** An error if set - this should only go through the -b pipeline and not actually be observed */
1847
+ build?: boolean;
1848
+ charset?: string;
1849
+ checkJs?: boolean;
1850
+ configFilePath?: string;
1851
+ /** configFile is set as non enumerable property so as to avoid checking of json source files */
1852
+ readonly configFile?: TsConfigSourceFile;
1853
+ declaration?: boolean;
1854
+ declarationMap?: boolean;
1855
+ emitDeclarationOnly?: boolean;
1856
+ declarationDir?: string;
1857
+ diagnostics?: boolean;
1858
+ extendedDiagnostics?: boolean;
1859
+ disableSizeLimit?: boolean;
1860
+ disableSourceOfProjectReferenceRedirect?: boolean;
1861
+ disableSolutionSearching?: boolean;
1862
+ downlevelIteration?: boolean;
1863
+ emitBOM?: boolean;
1864
+ emitDecoratorMetadata?: boolean;
1865
+ experimentalDecorators?: boolean;
1866
+ forceConsistentCasingInFileNames?: boolean;
1867
+ generateCpuProfile?: string;
1868
+ help?: boolean;
1869
+ importHelpers?: boolean;
1870
+ importsNotUsedAsValues?: ImportsNotUsedAsValues;
1871
+ init?: boolean;
1872
+ inlineSourceMap?: boolean;
1873
+ inlineSources?: boolean;
1874
+ isolatedModules?: boolean;
1875
+ jsx?: JsxEmit;
1876
+ keyofStringsOnly?: boolean;
1877
+ lib?: string[];
1878
+ listEmittedFiles?: boolean;
1879
+ listFiles?: boolean;
1880
+ listFilesOnly?: boolean;
1881
+ locale?: string;
1882
+ mapRoot?: string;
1883
+ maxNodeModuleJsDepth?: number;
1884
+ module?: ModuleKind;
1885
+ moduleResolution?: ModuleResolutionKind;
1886
+ newLine?: NewLineKind;
1887
+ noEmit?: boolean;
1888
+ noEmitForJsFiles?: boolean;
1889
+ noEmitHelpers?: boolean;
1890
+ noEmitOnError?: boolean;
1891
+ noErrorTruncation?: boolean;
1892
+ noFallthroughCasesInSwitch?: boolean;
1893
+ noImplicitAny?: boolean;
1894
+ noImplicitReturns?: boolean;
1895
+ noImplicitThis?: boolean;
1896
+ noStrictGenericChecks?: boolean;
1897
+ noUnusedLocals?: boolean;
1898
+ noUnusedParameters?: boolean;
1899
+ noImplicitUseStrict?: boolean;
1900
+ assumeChangesOnlyAffectDirectDependencies?: boolean;
1901
+ noLib?: boolean;
1902
+ noResolve?: boolean;
1903
+ out?: string;
1904
+ outDir?: string;
1905
+ outFile?: string;
1906
+ paths?: MapLike<string[]>;
1907
+ plugins?: PluginImport[];
1908
+ preserveConstEnums?: boolean;
1909
+ preserveSymlinks?: boolean;
1910
+ preserveWatchOutput?: boolean;
1911
+ project?: string;
1912
+ pretty?: boolean;
1913
+ reactNamespace?: string;
1914
+ jsxFactory?: string;
1915
+ composite?: boolean;
1916
+ incremental?: boolean;
1917
+ tsBuildInfoFile?: string;
1918
+ removeComments?: boolean;
1919
+ rootDir?: string;
1920
+ rootDirs?: string[];
1921
+ skipLibCheck?: boolean;
1922
+ skipDefaultLibCheck?: boolean;
1923
+ sourceMap?: boolean;
1924
+ sourceRoot?: string;
1925
+ strict?: boolean;
1926
+ strictFunctionTypes?: boolean;
1927
+ strictBindCallApply?: boolean;
1928
+ strictNullChecks?: boolean;
1929
+ strictPropertyInitialization?: boolean;
1930
+ stripInternal?: boolean;
1931
+ suppressExcessPropertyErrors?: boolean;
1932
+ suppressImplicitAnyIndexErrors?: boolean;
1933
+ suppressOutputPathCheck?: boolean;
1934
+ target?: ScriptTarget;
1935
+ traceResolution?: boolean;
1936
+ resolveJsonModule?: boolean;
1937
+ types?: string[];
1938
+ /** Paths used to compute primary types search locations */
1939
+ typeRoots?: string[];
1940
+ version?: boolean;
1941
+ watch?: boolean;
1942
+ esModuleInterop?: boolean;
1943
+ showConfig?: boolean;
1944
+ useDefineForClassFields?: boolean;
1945
+ [option: string]: CompilerOptionsValue | TsConfigSourceFile | undefined;
1946
+ }
1947
+ export declare enum ModuleKind {
1948
+ None = 0,
1949
+ CommonJS = 1,
1950
+ AMD = 2,
1951
+ UMD = 3,
1952
+ System = 4,
1953
+ ES2015 = 5,
1954
+ ES2020 = 6,
1955
+ ESNext = 99
1956
+ }
1957
+ export declare enum JsxEmit {
1958
+ None = 0,
1959
+ Preserve = 1,
1960
+ React = 2,
1961
+ ReactNative = 3
1962
+ }
1963
+ export declare enum ImportsNotUsedAsValues {
1964
+ Remove = 0,
1965
+ Preserve = 1,
1966
+ Error = 2
1967
+ }
1968
+ export declare enum NewLineKind {
1969
+ CarriageReturnLineFeed = 0,
1970
+ LineFeed = 1
1971
+ }
1972
+ export interface LineAndCharacter {
1973
+ /** 0-based. */
1974
+ line: number;
1975
+ character: number;
1976
+ }
1977
+ export declare enum ScriptKind {
1978
+ Unknown = 0,
1979
+ JS = 1,
1980
+ JSX = 2,
1981
+ TS = 3,
1982
+ TSX = 4,
1983
+ External = 5,
1984
+ JSON = 6,
1985
+ /**
1986
+ * Used on extensions that doesn't define the ScriptKind but the content defines it.
1987
+ * Deferred extensions are going to be included in all project contexts.
1988
+ */
1989
+ Deferred = 7
1990
+ }
1991
+ export declare enum ScriptTarget {
1992
+ ES3 = 0,
1993
+ ES5 = 1,
1994
+ ES2015 = 2,
1995
+ ES2016 = 3,
1996
+ ES2017 = 4,
1997
+ ES2018 = 5,
1998
+ ES2019 = 6,
1999
+ ES2020 = 7,
2000
+ ESNext = 99,
2001
+ JSON = 100,
2002
+ Latest = 99
2003
+ }
2004
+ export declare enum LanguageVariant {
2005
+ Standard = 0,
2006
+ JSX = 1
2007
+ }
2008
+ export declare enum CharacterCodes {
2009
+ nullCharacter = 0,
2010
+ maxAsciiCharacter = 127,
2011
+ lineFeed = 10,// \n
2012
+ carriageReturn = 13,// \r
2013
+ lineSeparator = 8232,
2014
+ paragraphSeparator = 8233,
2015
+ nextLine = 133,
2016
+ space = 32,// " "
2017
+ nonBreakingSpace = 160,//
2018
+ enQuad = 8192,
2019
+ emQuad = 8193,
2020
+ enSpace = 8194,
2021
+ emSpace = 8195,
2022
+ threePerEmSpace = 8196,
2023
+ fourPerEmSpace = 8197,
2024
+ sixPerEmSpace = 8198,
2025
+ figureSpace = 8199,
2026
+ punctuationSpace = 8200,
2027
+ thinSpace = 8201,
2028
+ hairSpace = 8202,
2029
+ zeroWidthSpace = 8203,
2030
+ narrowNoBreakSpace = 8239,
2031
+ ideographicSpace = 12288,
2032
+ mathematicalSpace = 8287,
2033
+ ogham = 5760,
2034
+ _ = 95,
2035
+ $ = 36,
2036
+ _0 = 48,
2037
+ _1 = 49,
2038
+ _2 = 50,
2039
+ _3 = 51,
2040
+ _4 = 52,
2041
+ _5 = 53,
2042
+ _6 = 54,
2043
+ _7 = 55,
2044
+ _8 = 56,
2045
+ _9 = 57,
2046
+ a = 97,
2047
+ b = 98,
2048
+ c = 99,
2049
+ d = 100,
2050
+ e = 101,
2051
+ f = 102,
2052
+ g = 103,
2053
+ h = 104,
2054
+ i = 105,
2055
+ j = 106,
2056
+ k = 107,
2057
+ l = 108,
2058
+ m = 109,
2059
+ n = 110,
2060
+ o = 111,
2061
+ p = 112,
2062
+ q = 113,
2063
+ r = 114,
2064
+ s = 115,
2065
+ t = 116,
2066
+ u = 117,
2067
+ v = 118,
2068
+ w = 119,
2069
+ x = 120,
2070
+ y = 121,
2071
+ z = 122,
2072
+ A = 65,
2073
+ B = 66,
2074
+ C = 67,
2075
+ D = 68,
2076
+ E = 69,
2077
+ F = 70,
2078
+ G = 71,
2079
+ H = 72,
2080
+ I = 73,
2081
+ J = 74,
2082
+ K = 75,
2083
+ L = 76,
2084
+ M = 77,
2085
+ N = 78,
2086
+ O = 79,
2087
+ P = 80,
2088
+ Q = 81,
2089
+ R = 82,
2090
+ S = 83,
2091
+ T = 84,
2092
+ U = 85,
2093
+ V = 86,
2094
+ W = 87,
2095
+ X = 88,
2096
+ Y = 89,
2097
+ Z = 90,
2098
+ ampersand = 38,// &
2099
+ asterisk = 42,// *
2100
+ at = 64,// @
2101
+ backslash = 92,// \
2102
+ backtick = 96,// `
2103
+ bar = 124,// |
2104
+ caret = 94,// ^
2105
+ closeBrace = 125,// }
2106
+ closeBracket = 93,// ]
2107
+ closeParen = 41,// )
2108
+ colon = 58,// :
2109
+ comma = 44,// ,
2110
+ dot = 46,// .
2111
+ doubleQuote = 34,// "
2112
+ equals = 61,// =
2113
+ exclamation = 33,// !
2114
+ greaterThan = 62,// >
2115
+ hash = 35,// #
2116
+ lessThan = 60,// <
2117
+ minus = 45,// -
2118
+ openBrace = 123,// {
2119
+ openBracket = 91,// [
2120
+ openParen = 40,// (
2121
+ percent = 37,// %
2122
+ plus = 43,// +
2123
+ question = 63,// ?
2124
+ semicolon = 59,// ;
2125
+ singleQuote = 39,// '
2126
+ slash = 47,// /
2127
+ tilde = 126,// ~
2128
+ backspace = 8,// \b
2129
+ formFeed = 12,// \f
2130
+ byteOrderMark = 65279,
2131
+ tab = 9,// \t
2132
+ verticalTab = 11
2133
+ }
2134
+ /** O resultado de resolver um import: o arquivo a que ele resolveu. */
2135
+ export interface ResolvedModule {
2136
+ /** O caminho do arquivo. */
2137
+ resolvedFileName: string;
2138
+ }
2139
+ /** A resolução com a extensão do arquivo, que o `check` tira do nome que o host devolve (CK-46). */
2140
+ export interface ResolvedModuleFull extends ResolvedModule {
2141
+ /** A extensão do `resolvedFileName`, igual ao fim dele. */
2142
+ extension: Extension;
2143
+ }
2144
+ export declare enum Extension {
2145
+ Ts = ".ts",
2146
+ Tsx = ".tsx",
2147
+ Dts = ".d.ts",
2148
+ Js = ".js",
2149
+ Jsx = ".jsx",
2150
+ Json = ".json",
2151
+ TsBuildInfo = ".tsbuildinfo"
2152
+ }
2153
+ export declare enum TransformFlags {
2154
+ None = 0,
2155
+ ContainsTypeScript = 1,
2156
+ ContainsJsx = 2,
2157
+ ContainsESNext = 4,
2158
+ ContainsES2020 = 8,
2159
+ ContainsES2019 = 16,
2160
+ ContainsES2018 = 32,
2161
+ ContainsES2017 = 64,
2162
+ ContainsES2016 = 128,
2163
+ ContainsES2015 = 256,
2164
+ ContainsGenerator = 512,
2165
+ ContainsDestructuringAssignment = 1024,
2166
+ ContainsTypeScriptClassSyntax = 2048,// Decorators, Property Initializers, Parameter Property Initializers
2167
+ ContainsLexicalThis = 4096,
2168
+ ContainsRestOrSpread = 8192,
2169
+ ContainsObjectRestOrSpread = 16384,
2170
+ ContainsComputedPropertyName = 32768,
2171
+ ContainsBlockScopedBinding = 65536,
2172
+ ContainsBindingPattern = 131072,
2173
+ ContainsYield = 262144,
2174
+ ContainsAwait = 524288,
2175
+ ContainsHoistedDeclarationOrCompletion = 1048576,
2176
+ ContainsDynamicImport = 2097152,
2177
+ ContainsClassFields = 4194304,
2178
+ HasComputedFlags = 536870912,// Transform flags have been computed.
2179
+ AssertTypeScript = 1,
2180
+ AssertJsx = 2,
2181
+ AssertESNext = 4,
2182
+ AssertES2020 = 8,
2183
+ AssertES2019 = 16,
2184
+ AssertES2018 = 32,
2185
+ AssertES2017 = 64,
2186
+ AssertES2016 = 128,
2187
+ AssertES2015 = 256,
2188
+ AssertGenerator = 512,
2189
+ AssertDestructuringAssignment = 1024,
2190
+ OuterExpressionExcludes = 536870912,
2191
+ PropertyAccessExcludes = 536870912,
2192
+ NodeExcludes = 536870912,
2193
+ ArrowFunctionExcludes = 538920960,
2194
+ FunctionExcludes = 538925056,
2195
+ ConstructorExcludes = 538923008,
2196
+ MethodOrAccessorExcludes = 538923008,
2197
+ PropertyExcludes = 536875008,
2198
+ ClassExcludes = 536905728,
2199
+ ModuleExcludes = 537991168,
2200
+ TypeExcludes = -2,
2201
+ ObjectLiteralExcludes = 536922112,
2202
+ ArrayLiteralOrCallOrNewExcludes = 536879104,
2203
+ VariableDeclarationListExcludes = 537018368,
2204
+ ParameterExcludes = 536870912,
2205
+ CatchClauseExcludes = 536887296,
2206
+ BindingPatternExcludes = 536879104,
2207
+ PropertyNamePropagatingFlags = 4096
2208
+ }
2209
+ export interface SourceMapRange extends TextRange {
2210
+ source?: SourceMapSource;
2211
+ }
2212
+ export interface SourceMapSource {
2213
+ fileName: string;
2214
+ text: string;
2215
+ lineMap: readonly number[];
2216
+ skipTrivia?: (pos: number) => number;
2217
+ }
2218
+ export interface EmitNode {
2219
+ annotatedNodes?: Node[];
2220
+ flags: EmitFlags;
2221
+ leadingComments?: SynthesizedComment[];
2222
+ trailingComments?: SynthesizedComment[];
2223
+ commentRange?: TextRange;
2224
+ sourceMapRange?: SourceMapRange;
2225
+ tokenSourceMapRanges?: (SourceMapRange | undefined)[];
2226
+ externalHelpersModuleName?: Identifier;
2227
+ externalHelpers?: boolean;
2228
+ helpers?: EmitHelper[];
2229
+ startsOnNewLine?: boolean;
2230
+ }
2231
+ export declare enum EmitFlags {
2232
+ None = 0,
2233
+ SingleLine = 1,// The contents of this node should be emitted on a single line.
2234
+ AdviseOnEmitNode = 2,// The printer should invoke the onEmitNode callback when printing this node.
2235
+ NoSubstitution = 4,// Disables further substitution of an expression.
2236
+ NoLeadingSourceMap = 16,// Do not emit a leading source map location for this node.
2237
+ NoTrailingSourceMap = 32,// Do not emit a trailing source map location for this node.
2238
+ NoSourceMap = 48,// Do not emit a source map location for this node.
2239
+ NoNestedSourceMaps = 64,// Do not emit source map locations for children of this node.
2240
+ NoTokenLeadingSourceMaps = 128,// Do not emit leading source map location for token nodes.
2241
+ NoTokenTrailingSourceMaps = 256,// Do not emit trailing source map location for token nodes.
2242
+ NoTokenSourceMaps = 384,// Do not emit source map locations for tokens of this node.
2243
+ NoLeadingComments = 512,// Do not emit leading comments for this node.
2244
+ NoTrailingComments = 1024,// Do not emit trailing comments for this node.
2245
+ NoComments = 1536,// Do not emit comments for this node.
2246
+ NoNestedComments = 2048,
2247
+ HelperName = 4096,// The Identifier refers to an *unscoped* emit helper (one that is emitted at the top of the file)
2248
+ ExportName = 8192,// Ensure an export prefix is added for an identifier that points to an exported declaration with a local name (see SymbolFlags.ExportHasLocal).
2249
+ LocalName = 16384,// Ensure an export prefix is not added for an identifier that points to an exported declaration.
2250
+ InternalName = 32768,// The name is internal to an ES5 class body function.
2251
+ Indented = 65536,// Adds an explicit extra indentation level for class and function bodies when printing (used to match old emitter).
2252
+ NoIndentation = 131072,// Do not indent the node.
2253
+ AsyncFunctionBody = 262144,
2254
+ ReuseTempVariableScope = 524288,// Reuse the existing temp variable scope during emit.
2255
+ CustomPrologue = 1048576,// Treat the statement as if it were a prologue directive (NOTE: Prologue directives are *not* transformed).
2256
+ NoHoisting = 2097152,// Do not hoist this declaration in --module system
2257
+ HasEndOfDeclarationMarker = 4194304,// Declaration has an associated NotEmittedStatement to mark the end of the declaration
2258
+ Iterator = 8388608,// The expression to a `yield*` should be treated as an Iterator when down-leveling, not an Iterable.
2259
+ NoAsciiEscaping = 16777216,// When synthesizing nodes that lack an original node or textSourceNode, we want to write the text on the node with ASCII escaping substitutions.
2260
+ TypeScriptClassWrapper = 33554432,// The node is an IIFE class wrapper created by the ts transform.
2261
+ NeverApplyImportHelper = 67108864,// Indicates the node should never be wrapped with an import star helper (because, for example, it imports tslib itself)
2262
+ IgnoreSourceNewlines = 134217728
2263
+ }
2264
+ export interface EmitHelper {
2265
+ readonly name: string;
2266
+ readonly scoped: boolean;
2267
+ readonly text: string | ((node: EmitHelperUniqueNameCallback) => string);
2268
+ readonly priority?: number;
2269
+ readonly dependencies?: EmitHelper[];
2270
+ }
2271
+ export interface UnscopedEmitHelper extends EmitHelper {
2272
+ readonly scoped: false;
2273
+ readonly importName?: string;
2274
+ readonly text: string;
2275
+ }
2276
+ export type EmitHelperUniqueNameCallback = (name: string) => string;
2277
+ /**
2278
+ * Used by the checker, this enum keeps track of external emit helpers that should be type
2279
+ * checked.
2280
+ */
2281
+ export declare enum ExternalEmitHelpers {
2282
+ None = 0,
2283
+ Extends = 1,// __extends (used by the ES2015 class transformation)
2284
+ Assign = 2,// __assign (used by Jsx and ESNext object spread transformations)
2285
+ Rest = 4,// __rest (used by ESNext object rest transformation)
2286
+ Decorate = 8,// __decorate (used by TypeScript decorators transformation)
2287
+ Metadata = 16,// __metadata (used by TypeScript decorators transformation)
2288
+ Param = 32,// __param (used by TypeScript decorators transformation)
2289
+ Awaiter = 64,// __awaiter (used by ES2017 async functions transformation)
2290
+ Generator = 128,// __generator (used by ES2015 generator transformation)
2291
+ Values = 256,// __values (used by ES2015 for..of and yield* transformations)
2292
+ Read = 512,// __read (used by ES2015 iterator destructuring transformation)
2293
+ Spread = 1024,// __spread (used by ES2015 array spread and argument list spread transformations)
2294
+ SpreadArrays = 2048,// __spreadArrays (used by ES2015 array spread and argument list spread transformations)
2295
+ Await = 4096,// __await (used by ES2017 async generator transformation)
2296
+ AsyncGenerator = 8192,// __asyncGenerator (used by ES2017 async generator transformation)
2297
+ AsyncDelegator = 16384,// __asyncDelegator (used by ES2017 async generator yield* transformation)
2298
+ AsyncValues = 32768,// __asyncValues (used by ES2017 for..await..of transformation)
2299
+ ExportStar = 65536,// __exportStar (used by CommonJS/AMD/UMD module transformation)
2300
+ MakeTemplateObject = 131072,// __makeTemplateObject (used for constructing template string array objects)
2301
+ ClassPrivateFieldGet = 262144,// __classPrivateFieldGet (used by the class private field transformation)
2302
+ ClassPrivateFieldSet = 524288,// __classPrivateFieldSet (used by the class private field transformation)
2303
+ CreateBinding = 1048576,// __createBinding (use by the module transform for (re)exports and namespace imports)
2304
+ FirstEmitHelper = 1,
2305
+ LastEmitHelper = 1048576,
2306
+ ForOfIncludes = 256,
2307
+ ForAwaitOfIncludes = 32768,
2308
+ AsyncGeneratorIncludes = 12288,
2309
+ AsyncDelegatorIncludes = 53248,
2310
+ SpreadIncludes = 1536
2311
+ }
2312
+ export declare enum EmitHint {
2313
+ SourceFile = 0,// Emitting a SourceFile
2314
+ Expression = 1,// Emitting an Expression
2315
+ IdentifierName = 2,// Emitting an IdentifierName
2316
+ MappedTypeParameter = 3,// Emitting a TypeParameterDeclaration inside of a MappedTypeNode
2317
+ Unspecified = 4,// Emitting an otherwise unspecified node
2318
+ EmbeddedStatement = 5,// Emitting an embedded statement
2319
+ JsxAttributeValue = 6
2320
+ }
2321
+ export declare enum LexicalEnvironmentFlags {
2322
+ None = 0,
2323
+ InParameters = 1,// currently visiting a parameter list
2324
+ VariablesHoistedInParameters = 2
2325
+ }
2326
+ export interface TransformationContext {
2327
+ /** Gets the compiler options supplied to the transformer. */
2328
+ getCompilerOptions(): CompilerOptions;
2329
+ /** Starts a new lexical environment. */
2330
+ startLexicalEnvironment(): void;
2331
+ setLexicalEnvironmentFlags(flags: LexicalEnvironmentFlags, value: boolean): void;
2332
+ getLexicalEnvironmentFlags(): LexicalEnvironmentFlags;
2333
+ /** Suspends the current lexical environment, usually after visiting a parameter list. */
2334
+ suspendLexicalEnvironment(): void;
2335
+ /** Resumes a suspended lexical environment, usually before visiting a function body. */
2336
+ resumeLexicalEnvironment(): void;
2337
+ /** Ends a lexical environment, returning any declarations. */
2338
+ endLexicalEnvironment(): Statement[] | undefined;
2339
+ /** Hoists a variable declaration to the containing scope. */
2340
+ hoistVariableDeclaration(node: Identifier): void;
2341
+ /** Adds an initialization statement to the top of the lexical environment. */
2342
+ addInitializationStatement(node: Statement): void;
2343
+ /** Records a request for a non-scoped emit helper in the current context. */
2344
+ requestEmitHelper(helper: EmitHelper): void;
2345
+ /** Gets and resets the requested non-scoped emit helpers. */
2346
+ readEmitHelpers(): EmitHelper[] | undefined;
2347
+ /** Enables expression substitutions in the pretty printer for the provided SyntaxKind. */
2348
+ enableSubstitution(kind: SyntaxKind): void;
2349
+ /** Determines whether expression substitutions are enabled for the provided node. */
2350
+ isSubstitutionEnabled(node: Node): boolean;
2351
+ /**
2352
+ * Hook used by transformers to substitute expressions just before they
2353
+ * are emitted by the pretty printer.
2354
+ *
2355
+ * NOTE: Transformation hooks should only be modified during `Transformer` initialization,
2356
+ * before returning the `NodeTransformer` callback.
2357
+ */
2358
+ onSubstituteNode: (hint: EmitHint, node: Node) => Node;
2359
+ /**
2360
+ * Enables before/after emit notifications in the pretty printer for the provided
2361
+ * SyntaxKind.
2362
+ */
2363
+ enableEmitNotification(kind: SyntaxKind): void;
2364
+ /**
2365
+ * Determines whether before/after emit notifications should be raised in the pretty
2366
+ * printer when it emits a node.
2367
+ */
2368
+ isEmitNotificationEnabled(node: Node): boolean;
2369
+ /**
2370
+ * Hook used to allow transformers to capture state before or after
2371
+ * the printer emits a node.
2372
+ *
2373
+ * NOTE: Transformation hooks should only be modified during `Transformer` initialization,
2374
+ * before returning the `NodeTransformer` callback.
2375
+ */
2376
+ onEmitNode: (hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void) => void;
2377
+ addDiagnostic(diag: DiagnosticWithLocation): void;
2378
+ }
2379
+ /**
2380
+ * A function that transforms a node.
2381
+ */
2382
+ export type Transformer<T extends Node> = (node: T) => T;
2383
+ /**
2384
+ * A function that accepts and possibly transforms a node.
2385
+ */
2386
+ export type Visitor = (node: Node) => VisitResult<Node>;
2387
+ export type VisitResult<T extends Node> = T | T[] | undefined;
2388
+ export declare enum BundleFileSectionKind {
2389
+ Prologue = "prologue",
2390
+ EmitHelpers = "emitHelpers",
2391
+ NoDefaultLib = "no-default-lib",
2392
+ Reference = "reference",
2393
+ Type = "type",
2394
+ Lib = "lib",
2395
+ Prepend = "prepend",
2396
+ Text = "text",
2397
+ Internal = "internal"
2398
+ }
2399
+ export interface BundleFileSectionBase extends TextRange {
2400
+ kind: BundleFileSectionKind;
2401
+ data?: string;
2402
+ }
2403
+ export interface BundleFilePrologue extends BundleFileSectionBase {
2404
+ kind: BundleFileSectionKind.Prologue;
2405
+ data: string;
2406
+ }
2407
+ export interface BundleFileEmitHelpers extends BundleFileSectionBase {
2408
+ kind: BundleFileSectionKind.EmitHelpers;
2409
+ data: string;
2410
+ }
2411
+ export interface BundleFileHasNoDefaultLib extends BundleFileSectionBase {
2412
+ kind: BundleFileSectionKind.NoDefaultLib;
2413
+ }
2414
+ export interface BundleFileReference extends BundleFileSectionBase {
2415
+ kind: BundleFileSectionKind.Reference | BundleFileSectionKind.Type | BundleFileSectionKind.Lib;
2416
+ data: string;
2417
+ }
2418
+ export interface BundleFilePrepend extends BundleFileSectionBase {
2419
+ kind: BundleFileSectionKind.Prepend;
2420
+ data: string;
2421
+ texts: BundleFileTextLike[];
2422
+ }
2423
+ export type BundleFileTextLikeKind = BundleFileSectionKind.Text | BundleFileSectionKind.Internal;
2424
+ export interface BundleFileTextLike extends BundleFileSectionBase {
2425
+ kind: BundleFileTextLikeKind;
2426
+ }
2427
+ export type BundleFileSection = BundleFilePrologue | BundleFileEmitHelpers | BundleFileHasNoDefaultLib | BundleFileReference | BundleFilePrepend | BundleFileTextLike;
2428
+ export interface SourceFilePrologueDirectiveExpression extends TextRange {
2429
+ text: string;
2430
+ }
2431
+ export interface SourceFilePrologueDirective extends TextRange {
2432
+ expression: SourceFilePrologueDirectiveExpression;
2433
+ }
2434
+ export interface SourceFilePrologueInfo {
2435
+ file: number;
2436
+ text: string;
2437
+ directives: SourceFilePrologueDirective[];
2438
+ }
2439
+ export interface SourceFileInfo {
2440
+ helpers?: string[];
2441
+ prologues?: SourceFilePrologueInfo[];
2442
+ }
2443
+ export interface BundleFileInfo {
2444
+ sections: BundleFileSection[];
2445
+ sources?: SourceFileInfo;
2446
+ }
2447
+ export interface BundleBuildInfo {
2448
+ js?: BundleFileInfo;
2449
+ dts?: BundleFileInfo;
2450
+ commonSourceDirectory: string;
2451
+ sourceFiles: readonly string[];
2452
+ }
2453
+ export interface BuildInfo {
2454
+ bundle?: BundleBuildInfo;
2455
+ version: string;
2456
+ }
2457
+ export interface RawSourceMap {
2458
+ version: 3;
2459
+ file: string;
2460
+ sourceRoot?: string | null;
2461
+ sources: string[];
2462
+ sourcesContent?: (string | null)[] | null;
2463
+ mappings: string;
2464
+ names?: string[] | null;
2465
+ }
2466
+ export interface TextSpan {
2467
+ start: number;
2468
+ length: number;
2469
+ }
2470
+ export interface TextChangeRange {
2471
+ span: TextSpan;
2472
+ newLength: number;
2473
+ }
2474
+ export interface SyntaxList extends Node {
2475
+ _children: Node[];
2476
+ }
2477
+ export declare enum PragmaKindFlags {
2478
+ None = 0,
2479
+ /**
2480
+ * Triple slash comment of the form
2481
+ * /// <pragma-name argname="value" />
2482
+ */
2483
+ TripleSlashXML = 1,
2484
+ /**
2485
+ * Single line comment of the form
2486
+ * // @pragma-name argval1 argval2
2487
+ * or
2488
+ * /// @pragma-name argval1 argval2
2489
+ */
2490
+ SingleLine = 2,
2491
+ /**
2492
+ * Multiline non-jsdoc pragma of the form
2493
+ * /* @pragma-name argval1 argval2 * /
2494
+ */
2495
+ MultiLine = 4,
2496
+ All = 7,
2497
+ Default = 7
2498
+ }
2499
+ interface PragmaArgumentSpecification<TName extends string> {
2500
+ name: TName;
2501
+ optional?: boolean;
2502
+ captureSpan?: boolean;
2503
+ }
2504
+ export interface PragmaDefinition<T1 extends string = string, T2 extends string = string, T3 extends string = string, T4 extends string = string> {
2505
+ args?: readonly [PragmaArgumentSpecification<T1>] | readonly [PragmaArgumentSpecification<T1>, PragmaArgumentSpecification<T2>] | readonly [PragmaArgumentSpecification<T1>, PragmaArgumentSpecification<T2>, PragmaArgumentSpecification<T3>] | readonly [PragmaArgumentSpecification<T1>, PragmaArgumentSpecification<T2>, PragmaArgumentSpecification<T3>, PragmaArgumentSpecification<T4>];
2506
+ kind?: PragmaKindFlags;
2507
+ }
2508
+ export declare const commentPragmas: {
2509
+ readonly reference: {
2510
+ readonly args: readonly [{
2511
+ readonly name: "types";
2512
+ readonly optional: true;
2513
+ readonly captureSpan: true;
2514
+ }, {
2515
+ readonly name: "lib";
2516
+ readonly optional: true;
2517
+ readonly captureSpan: true;
2518
+ }, {
2519
+ readonly name: "path";
2520
+ readonly optional: true;
2521
+ readonly captureSpan: true;
2522
+ }, {
2523
+ readonly name: "no-default-lib";
2524
+ readonly optional: true;
2525
+ }];
2526
+ readonly kind: PragmaKindFlags.TripleSlashXML;
2527
+ };
2528
+ readonly "amd-dependency": {
2529
+ readonly args: readonly [{
2530
+ readonly name: "path";
2531
+ }, {
2532
+ readonly name: "name";
2533
+ readonly optional: true;
2534
+ }];
2535
+ readonly kind: PragmaKindFlags.TripleSlashXML;
2536
+ };
2537
+ readonly "amd-module": {
2538
+ readonly args: readonly [{
2539
+ readonly name: "name";
2540
+ }];
2541
+ readonly kind: PragmaKindFlags.TripleSlashXML;
2542
+ };
2543
+ readonly "ts-check": {
2544
+ readonly kind: PragmaKindFlags.SingleLine;
2545
+ };
2546
+ readonly "ts-nocheck": {
2547
+ readonly kind: PragmaKindFlags.SingleLine;
2548
+ };
2549
+ readonly jsx: {
2550
+ readonly args: readonly [{
2551
+ readonly name: "factory";
2552
+ }];
2553
+ readonly kind: PragmaKindFlags.MultiLine;
2554
+ };
2555
+ };
2556
+ type PragmaArgTypeMaybeCapture<TDesc> = TDesc extends {
2557
+ captureSpan: true;
2558
+ } ? {
2559
+ value: string;
2560
+ pos: number;
2561
+ end: number;
2562
+ } : string;
2563
+ type PragmaArgTypeOptional<TDesc, TName extends string> = TDesc extends {
2564
+ optional: true;
2565
+ } ? {
2566
+ [K in TName]?: PragmaArgTypeMaybeCapture<TDesc>;
2567
+ } : {
2568
+ [K in TName]: PragmaArgTypeMaybeCapture<TDesc>;
2569
+ };
2570
+ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
2571
+ type ArgumentDefinitionToFieldUnion<T extends readonly PragmaArgumentSpecification<any>[]> = {
2572
+ [K in keyof T]: PragmaArgTypeOptional<T[K], T[K] extends {
2573
+ name: infer TName;
2574
+ } ? TName extends string ? TName : never : never>;
2575
+ }[Extract<keyof T, number>];
2576
+ /**
2577
+ * Maps a pragma definition into the desired shape for its arguments object
2578
+ */
2579
+ type PragmaArgumentType<KPrag extends keyof ConcretePragmaSpecs> = ConcretePragmaSpecs[KPrag] extends {
2580
+ args: readonly PragmaArgumentSpecification<any>[];
2581
+ } ? UnionToIntersection<ArgumentDefinitionToFieldUnion<ConcretePragmaSpecs[KPrag]["args"]>> : never;
2582
+ type ConcretePragmaSpecs = typeof commentPragmas;
2583
+ export type PragmaPseudoMap = {
2584
+ [K in keyof ConcretePragmaSpecs]: {
2585
+ arguments: PragmaArgumentType<K>;
2586
+ range: CommentRange;
2587
+ };
2588
+ };
2589
+ export type PragmaPseudoMapEntry = {
2590
+ [K in keyof PragmaPseudoMap]: {
2591
+ name: K;
2592
+ args: PragmaPseudoMap[K];
2593
+ };
2594
+ }[keyof PragmaPseudoMap];
2595
+ export interface ReadonlyPragmaMap extends ReadonlyMap<PragmaPseudoMap[keyof PragmaPseudoMap] | PragmaPseudoMap[keyof PragmaPseudoMap][]> {
2596
+ get<TKey extends keyof PragmaPseudoMap>(key: TKey): PragmaPseudoMap[TKey] | PragmaPseudoMap[TKey][];
2597
+ forEach(action: <TKey extends keyof PragmaPseudoMap>(value: PragmaPseudoMap[TKey] | PragmaPseudoMap[TKey][], key: TKey) => void): void;
2598
+ }
2599
+ /**
2600
+ * A strongly-typed es6 map of pragma entries, the values of which are either a single argument
2601
+ * value (if only one was found), or an array of multiple argument values if the pragma is present
2602
+ * in multiple places
2603
+ */
2604
+ export interface PragmaMap extends Map<PragmaPseudoMap[keyof PragmaPseudoMap] | PragmaPseudoMap[keyof PragmaPseudoMap][]>, ReadonlyPragmaMap {
2605
+ set<TKey extends keyof PragmaPseudoMap>(key: TKey, value: PragmaPseudoMap[TKey] | PragmaPseudoMap[TKey][]): this;
2606
+ get<TKey extends keyof PragmaPseudoMap>(key: TKey): PragmaPseudoMap[TKey] | PragmaPseudoMap[TKey][];
2607
+ forEach(action: <TKey extends keyof PragmaPseudoMap>(value: PragmaPseudoMap[TKey] | PragmaPseudoMap[TKey][], key: TKey) => void): void;
2608
+ }
2609
+ export interface UserPreferences {
2610
+ readonly disableSuggestions?: boolean;
2611
+ readonly quotePreference?: "auto" | "double" | "single";
2612
+ readonly includeCompletionsForModuleExports?: boolean;
2613
+ readonly includeAutomaticOptionalChainCompletions?: boolean;
2614
+ readonly includeCompletionsWithInsertText?: boolean;
2615
+ readonly importModuleSpecifierPreference?: "auto" | "relative" | "non-relative";
2616
+ /** Como o import escreve o `foo/index.ts`: `"foo"`, `"foo/index"` ou `"foo/index.js"`. */
2617
+ readonly importModuleSpecifierEnding?: "auto" | "minimal" | "index" | "js";
2618
+ readonly allowTextChangesInNewFiles?: boolean;
2619
+ readonly providePrefixAndSuffixTextForRename?: boolean;
2620
+ }
2621
+ /** Represents a bigint literal value without requiring bigint support */
2622
+ export interface PseudoBigInt {
2623
+ negative: boolean;
2624
+ base10Value: string;
2625
+ }
2626
+ export {};