UNPKG

448 kBTypeScriptView Raw
1/*! *****************************************************************************
2Copyright (c) Microsoft Corporation. All rights reserved.
3Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4this file except in compliance with the License. You may obtain a copy of the
5License at http://www.apache.org/licenses/LICENSE-2.0
6
7THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10MERCHANTABLITY OR NON-INFRINGEMENT.
11
12See the Apache Version 2.0 License for specific language governing permissions
13and limitations under the License.
14***************************************************************************** */
15
16declare namespace ts {
17 const versionMajorMinor = "4.2";
18 /** The version of the TypeScript compiler release */
19 const version: string;
20 /**
21 * Type of objects whose values are all of the same type.
22 * The `in` and `for-in` operators can *not* be safely used,
23 * since `Object.prototype` may be modified by outside code.
24 */
25 interface MapLike<T> {
26 [index: string]: T;
27 }
28 interface SortedReadonlyArray<T> extends ReadonlyArray<T> {
29 " __sortedArrayBrand": any;
30 }
31 interface SortedArray<T> extends Array<T> {
32 " __sortedArrayBrand": any;
33 }
34 /** Common read methods for ES6 Map/Set. */
35 interface ReadonlyCollection<K> {
36 readonly size: number;
37 has(key: K): boolean;
38 keys(): Iterator<K>;
39 }
40 /** Common write methods for ES6 Map/Set. */
41 interface Collection<K> extends ReadonlyCollection<K> {
42 delete(key: K): boolean;
43 clear(): void;
44 }
45 /** ES6 Map interface, only read methods included. */
46 interface ReadonlyESMap<K, V> extends ReadonlyCollection<K> {
47 get(key: K): V | undefined;
48 values(): Iterator<V>;
49 entries(): Iterator<[K, V]>;
50 forEach(action: (value: V, key: K) => void): void;
51 }
52 /**
53 * ES6 Map interface, only read methods included.
54 */
55 interface ReadonlyMap<T> extends ReadonlyESMap<string, T> {
56 }
57 /** ES6 Map interface. */
58 interface ESMap<K, V> extends ReadonlyESMap<K, V>, Collection<K> {
59 set(key: K, value: V): this;
60 }
61 /**
62 * ES6 Map interface.
63 */
64 interface Map<T> extends ESMap<string, T> {
65 }
66 /** ES6 Set interface, only read methods included. */
67 interface ReadonlySet<T> extends ReadonlyCollection<T> {
68 has(value: T): boolean;
69 values(): Iterator<T>;
70 entries(): Iterator<[T, T]>;
71 forEach(action: (value: T, key: T) => void): void;
72 }
73 /** ES6 Set interface. */
74 interface Set<T> extends ReadonlySet<T>, Collection<T> {
75 add(value: T): this;
76 delete(value: T): boolean;
77 }
78 /** ES6 Iterator type. */
79 interface Iterator<T> {
80 next(): {
81 value: T;
82 done?: false;
83 } | {
84 value: void;
85 done: true;
86 };
87 }
88 /** Array that is only intended to be pushed to, never read. */
89 interface Push<T> {
90 push(...values: T[]): void;
91 }
92}
93declare namespace ts {
94 export type Path = string & {
95 __pathBrand: any;
96 };
97 export interface TextRange {
98 pos: number;
99 end: number;
100 }
101 export interface ReadonlyTextRange {
102 readonly pos: number;
103 readonly end: number;
104 }
105 export enum SyntaxKind {
106 Unknown = 0,
107 EndOfFileToken = 1,
108 SingleLineCommentTrivia = 2,
109 MultiLineCommentTrivia = 3,
110 NewLineTrivia = 4,
111 WhitespaceTrivia = 5,
112 ShebangTrivia = 6,
113 ConflictMarkerTrivia = 7,
114 NumericLiteral = 8,
115 BigIntLiteral = 9,
116 StringLiteral = 10,
117 JsxText = 11,
118 JsxTextAllWhiteSpaces = 12,
119 RegularExpressionLiteral = 13,
120 NoSubstitutionTemplateLiteral = 14,
121 TemplateHead = 15,
122 TemplateMiddle = 16,
123 TemplateTail = 17,
124 OpenBraceToken = 18,
125 CloseBraceToken = 19,
126 OpenParenToken = 20,
127 CloseParenToken = 21,
128 OpenBracketToken = 22,
129 CloseBracketToken = 23,
130 DotToken = 24,
131 DotDotDotToken = 25,
132 SemicolonToken = 26,
133 CommaToken = 27,
134 QuestionDotToken = 28,
135 LessThanToken = 29,
136 LessThanSlashToken = 30,
137 GreaterThanToken = 31,
138 LessThanEqualsToken = 32,
139 GreaterThanEqualsToken = 33,
140 EqualsEqualsToken = 34,
141 ExclamationEqualsToken = 35,
142 EqualsEqualsEqualsToken = 36,
143 ExclamationEqualsEqualsToken = 37,
144 EqualsGreaterThanToken = 38,
145 PlusToken = 39,
146 MinusToken = 40,
147 AsteriskToken = 41,
148 AsteriskAsteriskToken = 42,
149 SlashToken = 43,
150 PercentToken = 44,
151 PlusPlusToken = 45,
152 MinusMinusToken = 46,
153 LessThanLessThanToken = 47,
154 GreaterThanGreaterThanToken = 48,
155 GreaterThanGreaterThanGreaterThanToken = 49,
156 AmpersandToken = 50,
157 BarToken = 51,
158 CaretToken = 52,
159 ExclamationToken = 53,
160 TildeToken = 54,
161 AmpersandAmpersandToken = 55,
162 BarBarToken = 56,
163 QuestionToken = 57,
164 ColonToken = 58,
165 AtToken = 59,
166 QuestionQuestionToken = 60,
167 /** Only the JSDoc scanner produces BacktickToken. The normal scanner produces NoSubstitutionTemplateLiteral and related kinds. */
168 BacktickToken = 61,
169 EqualsToken = 62,
170 PlusEqualsToken = 63,
171 MinusEqualsToken = 64,
172 AsteriskEqualsToken = 65,
173 AsteriskAsteriskEqualsToken = 66,
174 SlashEqualsToken = 67,
175 PercentEqualsToken = 68,
176 LessThanLessThanEqualsToken = 69,
177 GreaterThanGreaterThanEqualsToken = 70,
178 GreaterThanGreaterThanGreaterThanEqualsToken = 71,
179 AmpersandEqualsToken = 72,
180 BarEqualsToken = 73,
181 BarBarEqualsToken = 74,
182 AmpersandAmpersandEqualsToken = 75,
183 QuestionQuestionEqualsToken = 76,
184 CaretEqualsToken = 77,
185 Identifier = 78,
186 PrivateIdentifier = 79,
187 BreakKeyword = 80,
188 CaseKeyword = 81,
189 CatchKeyword = 82,
190 ClassKeyword = 83,
191 ConstKeyword = 84,
192 ContinueKeyword = 85,
193 DebuggerKeyword = 86,
194 DefaultKeyword = 87,
195 DeleteKeyword = 88,
196 DoKeyword = 89,
197 ElseKeyword = 90,
198 EnumKeyword = 91,
199 ExportKeyword = 92,
200 ExtendsKeyword = 93,
201 FalseKeyword = 94,
202 FinallyKeyword = 95,
203 ForKeyword = 96,
204 FunctionKeyword = 97,
205 IfKeyword = 98,
206 ImportKeyword = 99,
207 InKeyword = 100,
208 InstanceOfKeyword = 101,
209 NewKeyword = 102,
210 NullKeyword = 103,
211 ReturnKeyword = 104,
212 SuperKeyword = 105,
213 SwitchKeyword = 106,
214 ThisKeyword = 107,
215 ThrowKeyword = 108,
216 TrueKeyword = 109,
217 TryKeyword = 110,
218 TypeOfKeyword = 111,
219 VarKeyword = 112,
220 VoidKeyword = 113,
221 WhileKeyword = 114,
222 WithKeyword = 115,
223 ImplementsKeyword = 116,
224 InterfaceKeyword = 117,
225 LetKeyword = 118,
226 PackageKeyword = 119,
227 PrivateKeyword = 120,
228 ProtectedKeyword = 121,
229 PublicKeyword = 122,
230 StaticKeyword = 123,
231 YieldKeyword = 124,
232 AbstractKeyword = 125,
233 AsKeyword = 126,
234 AssertsKeyword = 127,
235 AnyKeyword = 128,
236 AsyncKeyword = 129,
237 AwaitKeyword = 130,
238 BooleanKeyword = 131,
239 ConstructorKeyword = 132,
240 DeclareKeyword = 133,
241 GetKeyword = 134,
242 InferKeyword = 135,
243 IntrinsicKeyword = 136,
244 IsKeyword = 137,
245 KeyOfKeyword = 138,
246 ModuleKeyword = 139,
247 NamespaceKeyword = 140,
248 NeverKeyword = 141,
249 ReadonlyKeyword = 142,
250 RequireKeyword = 143,
251 NumberKeyword = 144,
252 ObjectKeyword = 145,
253 SetKeyword = 146,
254 StringKeyword = 147,
255 SymbolKeyword = 148,
256 TypeKeyword = 149,
257 UndefinedKeyword = 150,
258 UniqueKeyword = 151,
259 UnknownKeyword = 152,
260 FromKeyword = 153,
261 GlobalKeyword = 154,
262 BigIntKeyword = 155,
263 OfKeyword = 156,
264 QualifiedName = 157,
265 ComputedPropertyName = 158,
266 TypeParameter = 159,
267 Parameter = 160,
268 Decorator = 161,
269 PropertySignature = 162,
270 PropertyDeclaration = 163,
271 MethodSignature = 164,
272 MethodDeclaration = 165,
273 Constructor = 166,
274 GetAccessor = 167,
275 SetAccessor = 168,
276 CallSignature = 169,
277 ConstructSignature = 170,
278 IndexSignature = 171,
279 TypePredicate = 172,
280 TypeReference = 173,
281 FunctionType = 174,
282 ConstructorType = 175,
283 TypeQuery = 176,
284 TypeLiteral = 177,
285 ArrayType = 178,
286 TupleType = 179,
287 OptionalType = 180,
288 RestType = 181,
289 UnionType = 182,
290 IntersectionType = 183,
291 ConditionalType = 184,
292 InferType = 185,
293 ParenthesizedType = 186,
294 ThisType = 187,
295 TypeOperator = 188,
296 IndexedAccessType = 189,
297 MappedType = 190,
298 LiteralType = 191,
299 NamedTupleMember = 192,
300 TemplateLiteralType = 193,
301 TemplateLiteralTypeSpan = 194,
302 ImportType = 195,
303 ObjectBindingPattern = 196,
304 ArrayBindingPattern = 197,
305 BindingElement = 198,
306 ArrayLiteralExpression = 199,
307 ObjectLiteralExpression = 200,
308 PropertyAccessExpression = 201,
309 ElementAccessExpression = 202,
310 CallExpression = 203,
311 NewExpression = 204,
312 TaggedTemplateExpression = 205,
313 TypeAssertionExpression = 206,
314 ParenthesizedExpression = 207,
315 FunctionExpression = 208,
316 ArrowFunction = 209,
317 DeleteExpression = 210,
318 TypeOfExpression = 211,
319 VoidExpression = 212,
320 AwaitExpression = 213,
321 PrefixUnaryExpression = 214,
322 PostfixUnaryExpression = 215,
323 BinaryExpression = 216,
324 ConditionalExpression = 217,
325 TemplateExpression = 218,
326 YieldExpression = 219,
327 SpreadElement = 220,
328 ClassExpression = 221,
329 OmittedExpression = 222,
330 ExpressionWithTypeArguments = 223,
331 AsExpression = 224,
332 NonNullExpression = 225,
333 MetaProperty = 226,
334 SyntheticExpression = 227,
335 TemplateSpan = 228,
336 SemicolonClassElement = 229,
337 Block = 230,
338 EmptyStatement = 231,
339 VariableStatement = 232,
340 ExpressionStatement = 233,
341 IfStatement = 234,
342 DoStatement = 235,
343 WhileStatement = 236,
344 ForStatement = 237,
345 ForInStatement = 238,
346 ForOfStatement = 239,
347 ContinueStatement = 240,
348 BreakStatement = 241,
349 ReturnStatement = 242,
350 WithStatement = 243,
351 SwitchStatement = 244,
352 LabeledStatement = 245,
353 ThrowStatement = 246,
354 TryStatement = 247,
355 DebuggerStatement = 248,
356 VariableDeclaration = 249,
357 VariableDeclarationList = 250,
358 FunctionDeclaration = 251,
359 ClassDeclaration = 252,
360 InterfaceDeclaration = 253,
361 TypeAliasDeclaration = 254,
362 EnumDeclaration = 255,
363 ModuleDeclaration = 256,
364 ModuleBlock = 257,
365 CaseBlock = 258,
366 NamespaceExportDeclaration = 259,
367 ImportEqualsDeclaration = 260,
368 ImportDeclaration = 261,
369 ImportClause = 262,
370 NamespaceImport = 263,
371 NamedImports = 264,
372 ImportSpecifier = 265,
373 ExportAssignment = 266,
374 ExportDeclaration = 267,
375 NamedExports = 268,
376 NamespaceExport = 269,
377 ExportSpecifier = 270,
378 MissingDeclaration = 271,
379 ExternalModuleReference = 272,
380 JsxElement = 273,
381 JsxSelfClosingElement = 274,
382 JsxOpeningElement = 275,
383 JsxClosingElement = 276,
384 JsxFragment = 277,
385 JsxOpeningFragment = 278,
386 JsxClosingFragment = 279,
387 JsxAttribute = 280,
388 JsxAttributes = 281,
389 JsxSpreadAttribute = 282,
390 JsxExpression = 283,
391 CaseClause = 284,
392 DefaultClause = 285,
393 HeritageClause = 286,
394 CatchClause = 287,
395 PropertyAssignment = 288,
396 ShorthandPropertyAssignment = 289,
397 SpreadAssignment = 290,
398 EnumMember = 291,
399 UnparsedPrologue = 292,
400 UnparsedPrepend = 293,
401 UnparsedText = 294,
402 UnparsedInternalText = 295,
403 UnparsedSyntheticReference = 296,
404 SourceFile = 297,
405 Bundle = 298,
406 UnparsedSource = 299,
407 InputFiles = 300,
408 JSDocTypeExpression = 301,
409 JSDocNameReference = 302,
410 JSDocAllType = 303,
411 JSDocUnknownType = 304,
412 JSDocNullableType = 305,
413 JSDocNonNullableType = 306,
414 JSDocOptionalType = 307,
415 JSDocFunctionType = 308,
416 JSDocVariadicType = 309,
417 JSDocNamepathType = 310,
418 JSDocComment = 311,
419 JSDocTypeLiteral = 312,
420 JSDocSignature = 313,
421 JSDocTag = 314,
422 JSDocAugmentsTag = 315,
423 JSDocImplementsTag = 316,
424 JSDocAuthorTag = 317,
425 JSDocDeprecatedTag = 318,
426 JSDocClassTag = 319,
427 JSDocPublicTag = 320,
428 JSDocPrivateTag = 321,
429 JSDocProtectedTag = 322,
430 JSDocReadonlyTag = 323,
431 JSDocCallbackTag = 324,
432 JSDocEnumTag = 325,
433 JSDocParameterTag = 326,
434 JSDocReturnTag = 327,
435 JSDocThisTag = 328,
436 JSDocTypeTag = 329,
437 JSDocTemplateTag = 330,
438 JSDocTypedefTag = 331,
439 JSDocSeeTag = 332,
440 JSDocPropertyTag = 333,
441 SyntaxList = 334,
442 NotEmittedStatement = 335,
443 PartiallyEmittedExpression = 336,
444 CommaListExpression = 337,
445 MergeDeclarationMarker = 338,
446 EndOfDeclarationMarker = 339,
447 SyntheticReferenceExpression = 340,
448 Count = 341,
449 FirstAssignment = 62,
450 LastAssignment = 77,
451 FirstCompoundAssignment = 63,
452 LastCompoundAssignment = 77,
453 FirstReservedWord = 80,
454 LastReservedWord = 115,
455 FirstKeyword = 80,
456 LastKeyword = 156,
457 FirstFutureReservedWord = 116,
458 LastFutureReservedWord = 124,
459 FirstTypeNode = 172,
460 LastTypeNode = 195,
461 FirstPunctuation = 18,
462 LastPunctuation = 77,
463 FirstToken = 0,
464 LastToken = 156,
465 FirstTriviaToken = 2,
466 LastTriviaToken = 7,
467 FirstLiteralToken = 8,
468 LastLiteralToken = 14,
469 FirstTemplateToken = 14,
470 LastTemplateToken = 17,
471 FirstBinaryOperator = 29,
472 LastBinaryOperator = 77,
473 FirstStatement = 232,
474 LastStatement = 248,
475 FirstNode = 157,
476 FirstJSDocNode = 301,
477 LastJSDocNode = 333,
478 FirstJSDocTagNode = 314,
479 LastJSDocTagNode = 333,
480 }
481 export type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia;
482 export type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral;
483 export type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail;
484 export type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken;
485 export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword;
486 export type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.StaticKeyword;
487 export type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword;
488 export type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind;
489 export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken;
490 export type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind;
491 export enum NodeFlags {
492 None = 0,
493 Let = 1,
494 Const = 2,
495 NestedNamespace = 4,
496 Synthesized = 8,
497 Namespace = 16,
498 OptionalChain = 32,
499 ExportContext = 64,
500 ContainsThis = 128,
501 HasImplicitReturn = 256,
502 HasExplicitReturn = 512,
503 GlobalAugmentation = 1024,
504 HasAsyncFunctions = 2048,
505 DisallowInContext = 4096,
506 YieldContext = 8192,
507 DecoratorContext = 16384,
508 AwaitContext = 32768,
509 ThisNodeHasError = 65536,
510 JavaScriptFile = 131072,
511 ThisNodeOrAnySubNodesHasError = 262144,
512 HasAggregatedChildData = 524288,
513 JSDoc = 4194304,
514 JsonFile = 33554432,
515 BlockScoped = 3,
516 ReachabilityCheckFlags = 768,
517 ReachabilityAndEmitFlags = 2816,
518 ContextFlags = 25358336,
519 TypeExcludesFlags = 40960,
520 }
521 export enum ModifierFlags {
522 None = 0,
523 Export = 1,
524 Ambient = 2,
525 Public = 4,
526 Private = 8,
527 Protected = 16,
528 Static = 32,
529 Readonly = 64,
530 Abstract = 128,
531 Async = 256,
532 Default = 512,
533 Const = 2048,
534 HasComputedJSDocModifiers = 4096,
535 Deprecated = 8192,
536 HasComputedFlags = 536870912,
537 AccessibilityModifier = 28,
538 ParameterPropertyModifier = 92,
539 NonPublicAccessibilityModifier = 24,
540 TypeScriptModifier = 2270,
541 ExportDefault = 513,
542 All = 11263
543 }
544 export enum JsxFlags {
545 None = 0,
546 /** An element from a named property of the JSX.IntrinsicElements interface */
547 IntrinsicNamedElement = 1,
548 /** An element inferred from the string index signature of the JSX.IntrinsicElements interface */
549 IntrinsicIndexedElement = 2,
550 IntrinsicElement = 3
551 }
552 export interface Node extends ReadonlyTextRange {
553 readonly kind: SyntaxKind;
554 readonly flags: NodeFlags;
555 readonly decorators?: NodeArray<Decorator>;
556 readonly modifiers?: ModifiersArray;
557 readonly parent: Node;
558 }
559 export interface JSDocContainer {
560 }
561 export type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | LabeledStatement | ExpressionStatement | VariableStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | EndOfFileToken;
562 export type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType;
563 export type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
564 export type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
565 export type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertySignature | PropertyDeclaration | PropertyAssignment | EnumMember;
566 export interface NodeArray<T extends Node> extends ReadonlyArray<T>, ReadonlyTextRange {
567 hasTrailingComma?: boolean;
568 }
569 export interface Token<TKind extends SyntaxKind> extends Node {
570 readonly kind: TKind;
571 }
572 export type EndOfFileToken = Token<SyntaxKind.EndOfFileToken> & JSDocContainer;
573 export interface PunctuationToken<TKind extends PunctuationSyntaxKind> extends Token<TKind> {
574 }
575 export type DotToken = PunctuationToken<SyntaxKind.DotToken>;
576 export type DotDotDotToken = PunctuationToken<SyntaxKind.DotDotDotToken>;
577 export type QuestionToken = PunctuationToken<SyntaxKind.QuestionToken>;
578 export type ExclamationToken = PunctuationToken<SyntaxKind.ExclamationToken>;
579 export type ColonToken = PunctuationToken<SyntaxKind.ColonToken>;
580 export type EqualsToken = PunctuationToken<SyntaxKind.EqualsToken>;
581 export type AsteriskToken = PunctuationToken<SyntaxKind.AsteriskToken>;
582 export type EqualsGreaterThanToken = PunctuationToken<SyntaxKind.EqualsGreaterThanToken>;
583 export type PlusToken = PunctuationToken<SyntaxKind.PlusToken>;
584 export type MinusToken = PunctuationToken<SyntaxKind.MinusToken>;
585 export type QuestionDotToken = PunctuationToken<SyntaxKind.QuestionDotToken>;
586 export interface KeywordToken<TKind extends KeywordSyntaxKind> extends Token<TKind> {
587 }
588 export type AssertsKeyword = KeywordToken<SyntaxKind.AssertsKeyword>;
589 export type AwaitKeyword = KeywordToken<SyntaxKind.AwaitKeyword>;
590 /** @deprecated Use `AwaitKeyword` instead. */
591 export type AwaitKeywordToken = AwaitKeyword;
592 /** @deprecated Use `AssertsKeyword` instead. */
593 export type AssertsToken = AssertsKeyword;
594 export interface ModifierToken<TKind extends ModifierSyntaxKind> extends KeywordToken<TKind> {
595 }
596 export type AbstractKeyword = ModifierToken<SyntaxKind.AbstractKeyword>;
597 export type AsyncKeyword = ModifierToken<SyntaxKind.AsyncKeyword>;
598 export type ConstKeyword = ModifierToken<SyntaxKind.ConstKeyword>;
599 export type DeclareKeyword = ModifierToken<SyntaxKind.DeclareKeyword>;
600 export type DefaultKeyword = ModifierToken<SyntaxKind.DefaultKeyword>;
601 export type ExportKeyword = ModifierToken<SyntaxKind.ExportKeyword>;
602 export type PrivateKeyword = ModifierToken<SyntaxKind.PrivateKeyword>;
603 export type ProtectedKeyword = ModifierToken<SyntaxKind.ProtectedKeyword>;
604 export type PublicKeyword = ModifierToken<SyntaxKind.PublicKeyword>;
605 export type ReadonlyKeyword = ModifierToken<SyntaxKind.ReadonlyKeyword>;
606 export type StaticKeyword = ModifierToken<SyntaxKind.StaticKeyword>;
607 /** @deprecated Use `ReadonlyKeyword` instead. */
608 export type ReadonlyToken = ReadonlyKeyword;
609 export type Modifier = AbstractKeyword | AsyncKeyword | ConstKeyword | DeclareKeyword | DefaultKeyword | ExportKeyword | PrivateKeyword | ProtectedKeyword | PublicKeyword | ReadonlyKeyword | StaticKeyword;
610 export type AccessibilityModifier = PublicKeyword | PrivateKeyword | ProtectedKeyword;
611 export type ParameterPropertyModifier = AccessibilityModifier | ReadonlyKeyword;
612 export type ClassMemberModifier = AccessibilityModifier | ReadonlyKeyword | StaticKeyword;
613 export type ModifiersArray = NodeArray<Modifier>;
614 export enum GeneratedIdentifierFlags {
615 None = 0,
616 ReservedInNestedScopes = 8,
617 Optimistic = 16,
618 FileLevel = 32,
619 AllowNameSubstitution = 64
620 }
621 export interface Identifier extends PrimaryExpression, Declaration {
622 readonly kind: SyntaxKind.Identifier;
623 /**
624 * Prefer to use `id.unescapedText`. (Note: This is available only in services, not internally to the TypeScript compiler.)
625 * Text of identifier, but if the identifier begins with two underscores, this will begin with three.
626 */
627 readonly escapedText: __String;
628 readonly originalKeywordKind?: SyntaxKind;
629 isInJSDocNamespace?: boolean;
630 }
631 export interface TransientIdentifier extends Identifier {
632 resolvedSymbol: Symbol;
633 }
634 export interface QualifiedName extends Node {
635 readonly kind: SyntaxKind.QualifiedName;
636 readonly left: EntityName;
637 readonly right: Identifier;
638 }
639 export type EntityName = Identifier | QualifiedName;
640 export type PropertyName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier;
641 export type DeclarationName = Identifier | PrivateIdentifier | StringLiteralLike | NumericLiteral | ComputedPropertyName | ElementAccessExpression | BindingPattern | EntityNameExpression;
642 export interface Declaration extends Node {
643 _declarationBrand: any;
644 }
645 export interface NamedDeclaration extends Declaration {
646 readonly name?: DeclarationName;
647 }
648 export interface DeclarationStatement extends NamedDeclaration, Statement {
649 readonly name?: Identifier | StringLiteral | NumericLiteral;
650 }
651 export interface ComputedPropertyName extends Node {
652 readonly kind: SyntaxKind.ComputedPropertyName;
653 readonly parent: Declaration;
654 readonly expression: Expression;
655 }
656 export interface PrivateIdentifier extends Node {
657 readonly kind: SyntaxKind.PrivateIdentifier;
658 readonly escapedText: __String;
659 }
660 export interface Decorator extends Node {
661 readonly kind: SyntaxKind.Decorator;
662 readonly parent: NamedDeclaration;
663 readonly expression: LeftHandSideExpression;
664 }
665 export interface TypeParameterDeclaration extends NamedDeclaration {
666 readonly kind: SyntaxKind.TypeParameter;
667 readonly parent: DeclarationWithTypeParameterChildren | InferTypeNode;
668 readonly name: Identifier;
669 /** Note: Consider calling `getEffectiveConstraintOfTypeParameter` */
670 readonly constraint?: TypeNode;
671 readonly default?: TypeNode;
672 expression?: Expression;
673 }
674 export interface SignatureDeclarationBase extends NamedDeclaration, JSDocContainer {
675 readonly kind: SignatureDeclaration["kind"];
676 readonly name?: PropertyName;
677 readonly typeParameters?: NodeArray<TypeParameterDeclaration>;
678 readonly parameters: NodeArray<ParameterDeclaration>;
679 readonly type?: TypeNode;
680 }
681 export type SignatureDeclaration = CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | AccessorDeclaration | FunctionExpression | ArrowFunction;
682 export interface CallSignatureDeclaration extends SignatureDeclarationBase, TypeElement {
683 readonly kind: SyntaxKind.CallSignature;
684 }
685 export interface ConstructSignatureDeclaration extends SignatureDeclarationBase, TypeElement {
686 readonly kind: SyntaxKind.ConstructSignature;
687 }
688 export type BindingName = Identifier | BindingPattern;
689 export interface VariableDeclaration extends NamedDeclaration {
690 readonly kind: SyntaxKind.VariableDeclaration;
691 readonly parent: VariableDeclarationList | CatchClause;
692 readonly name: BindingName;
693 readonly exclamationToken?: ExclamationToken;
694 readonly type?: TypeNode;
695 readonly initializer?: Expression;
696 }
697 export interface VariableDeclarationList extends Node {
698 readonly kind: SyntaxKind.VariableDeclarationList;
699 readonly parent: VariableStatement | ForStatement | ForOfStatement | ForInStatement;
700 readonly declarations: NodeArray<VariableDeclaration>;
701 }
702 export interface ParameterDeclaration extends NamedDeclaration, JSDocContainer {
703 readonly kind: SyntaxKind.Parameter;
704 readonly parent: SignatureDeclaration;
705 readonly dotDotDotToken?: DotDotDotToken;
706 readonly name: BindingName;
707 readonly questionToken?: QuestionToken;
708 readonly type?: TypeNode;
709 readonly initializer?: Expression;
710 }
711 export interface BindingElement extends NamedDeclaration {
712 readonly kind: SyntaxKind.BindingElement;
713 readonly parent: BindingPattern;
714 readonly propertyName?: PropertyName;
715 readonly dotDotDotToken?: DotDotDotToken;
716 readonly name: BindingName;
717 readonly initializer?: Expression;
718 }
719 export interface PropertySignature extends TypeElement, JSDocContainer {
720 readonly kind: SyntaxKind.PropertySignature;
721 readonly name: PropertyName;
722 readonly questionToken?: QuestionToken;
723 readonly type?: TypeNode;
724 initializer?: Expression;
725 }
726 export interface PropertyDeclaration extends ClassElement, JSDocContainer {
727 readonly kind: SyntaxKind.PropertyDeclaration;
728 readonly parent: ClassLikeDeclaration;
729 readonly name: PropertyName;
730 readonly questionToken?: QuestionToken;
731 readonly exclamationToken?: ExclamationToken;
732 readonly type?: TypeNode;
733 readonly initializer?: Expression;
734 }
735 export interface ObjectLiteralElement extends NamedDeclaration {
736 _objectLiteralBrand: any;
737 readonly name?: PropertyName;
738 }
739 /** Unlike ObjectLiteralElement, excludes JSXAttribute and JSXSpreadAttribute. */
740 export type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | MethodDeclaration | AccessorDeclaration;
741 export interface PropertyAssignment extends ObjectLiteralElement, JSDocContainer {
742 readonly kind: SyntaxKind.PropertyAssignment;
743 readonly parent: ObjectLiteralExpression;
744 readonly name: PropertyName;
745 readonly questionToken?: QuestionToken;
746 readonly exclamationToken?: ExclamationToken;
747 readonly initializer: Expression;
748 }
749 export interface ShorthandPropertyAssignment extends ObjectLiteralElement, JSDocContainer {
750 readonly kind: SyntaxKind.ShorthandPropertyAssignment;
751 readonly parent: ObjectLiteralExpression;
752 readonly name: Identifier;
753 readonly questionToken?: QuestionToken;
754 readonly exclamationToken?: ExclamationToken;
755 readonly equalsToken?: EqualsToken;
756 readonly objectAssignmentInitializer?: Expression;
757 }
758 export interface SpreadAssignment extends ObjectLiteralElement, JSDocContainer {
759 readonly kind: SyntaxKind.SpreadAssignment;
760 readonly parent: ObjectLiteralExpression;
761 readonly expression: Expression;
762 }
763 export type VariableLikeDeclaration = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | PropertyAssignment | PropertySignature | JsxAttribute | ShorthandPropertyAssignment | EnumMember | JSDocPropertyTag | JSDocParameterTag;
764 export interface PropertyLikeDeclaration extends NamedDeclaration {
765 readonly name: PropertyName;
766 }
767 export interface ObjectBindingPattern extends Node {
768 readonly kind: SyntaxKind.ObjectBindingPattern;
769 readonly parent: VariableDeclaration | ParameterDeclaration | BindingElement;
770 readonly elements: NodeArray<BindingElement>;
771 }
772 export interface ArrayBindingPattern extends Node {
773 readonly kind: SyntaxKind.ArrayBindingPattern;
774 readonly parent: VariableDeclaration | ParameterDeclaration | BindingElement;
775 readonly elements: NodeArray<ArrayBindingElement>;
776 }
777 export type BindingPattern = ObjectBindingPattern | ArrayBindingPattern;
778 export type ArrayBindingElement = BindingElement | OmittedExpression;
779 /**
780 * Several node kinds share function-like features such as a signature,
781 * a name, and a body. These nodes should extend FunctionLikeDeclarationBase.
782 * Examples:
783 * - FunctionDeclaration
784 * - MethodDeclaration
785 * - AccessorDeclaration
786 */
787 export interface FunctionLikeDeclarationBase extends SignatureDeclarationBase {
788 _functionLikeDeclarationBrand: any;
789 readonly asteriskToken?: AsteriskToken;
790 readonly questionToken?: QuestionToken;
791 readonly exclamationToken?: ExclamationToken;
792 readonly body?: Block | Expression;
793 }
794 export type FunctionLikeDeclaration = FunctionDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ConstructorDeclaration | FunctionExpression | ArrowFunction;
795 /** @deprecated Use SignatureDeclaration */
796 export type FunctionLike = SignatureDeclaration;
797 export interface FunctionDeclaration extends FunctionLikeDeclarationBase, DeclarationStatement {
798 readonly kind: SyntaxKind.FunctionDeclaration;
799 readonly name?: Identifier;
800 readonly body?: FunctionBody;
801 }
802 export interface MethodSignature extends SignatureDeclarationBase, TypeElement {
803 readonly kind: SyntaxKind.MethodSignature;
804 readonly parent: ObjectTypeDeclaration;
805 readonly name: PropertyName;
806 }
807 export interface MethodDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer {
808 readonly kind: SyntaxKind.MethodDeclaration;
809 readonly parent: ClassLikeDeclaration | ObjectLiteralExpression;
810 readonly name: PropertyName;
811 readonly body?: FunctionBody;
812 }
813 export interface ConstructorDeclaration extends FunctionLikeDeclarationBase, ClassElement, JSDocContainer {
814 readonly kind: SyntaxKind.Constructor;
815 readonly parent: ClassLikeDeclaration;
816 readonly body?: FunctionBody;
817 }
818 /** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */
819 export interface SemicolonClassElement extends ClassElement {
820 readonly kind: SyntaxKind.SemicolonClassElement;
821 readonly parent: ClassLikeDeclaration;
822 }
823 export interface GetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer {
824 readonly kind: SyntaxKind.GetAccessor;
825 readonly parent: ClassLikeDeclaration | ObjectLiteralExpression;
826 readonly name: PropertyName;
827 readonly body?: FunctionBody;
828 }
829 export interface SetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer {
830 readonly kind: SyntaxKind.SetAccessor;
831 readonly parent: ClassLikeDeclaration | ObjectLiteralExpression;
832 readonly name: PropertyName;
833 readonly body?: FunctionBody;
834 }
835 export type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration;
836 export interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement {
837 readonly kind: SyntaxKind.IndexSignature;
838 readonly parent: ObjectTypeDeclaration;
839 readonly type: TypeNode;
840 }
841 export interface TypeNode extends Node {
842 _typeNodeBrand: any;
843 }
844 export interface KeywordTypeNode<TKind extends KeywordTypeSyntaxKind = KeywordTypeSyntaxKind> extends KeywordToken<TKind>, TypeNode {
845 readonly kind: TKind;
846 }
847 export interface ImportTypeNode extends NodeWithTypeArguments {
848 readonly kind: SyntaxKind.ImportType;
849 readonly isTypeOf: boolean;
850 readonly argument: TypeNode;
851 readonly qualifier?: EntityName;
852 }
853 export interface ThisTypeNode extends TypeNode {
854 readonly kind: SyntaxKind.ThisType;
855 }
856 export type FunctionOrConstructorTypeNode = FunctionTypeNode | ConstructorTypeNode;
857 export interface FunctionOrConstructorTypeNodeBase extends TypeNode, SignatureDeclarationBase {
858 readonly kind: SyntaxKind.FunctionType | SyntaxKind.ConstructorType;
859 readonly type: TypeNode;
860 }
861 export interface FunctionTypeNode extends FunctionOrConstructorTypeNodeBase {
862 readonly kind: SyntaxKind.FunctionType;
863 }
864 export interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase {
865 readonly kind: SyntaxKind.ConstructorType;
866 }
867 export interface NodeWithTypeArguments extends TypeNode {
868 readonly typeArguments?: NodeArray<TypeNode>;
869 }
870 export type TypeReferenceType = TypeReferenceNode | ExpressionWithTypeArguments;
871 export interface TypeReferenceNode extends NodeWithTypeArguments {
872 readonly kind: SyntaxKind.TypeReference;
873 readonly typeName: EntityName;
874 }
875 export interface TypePredicateNode extends TypeNode {
876 readonly kind: SyntaxKind.TypePredicate;
877 readonly parent: SignatureDeclaration | JSDocTypeExpression;
878 readonly assertsModifier?: AssertsToken;
879 readonly parameterName: Identifier | ThisTypeNode;
880 readonly type?: TypeNode;
881 }
882 export interface TypeQueryNode extends TypeNode {
883 readonly kind: SyntaxKind.TypeQuery;
884 readonly exprName: EntityName;
885 }
886 export interface TypeLiteralNode extends TypeNode, Declaration {
887 readonly kind: SyntaxKind.TypeLiteral;
888 readonly members: NodeArray<TypeElement>;
889 }
890 export interface ArrayTypeNode extends TypeNode {
891 readonly kind: SyntaxKind.ArrayType;
892 readonly elementType: TypeNode;
893 }
894 export interface TupleTypeNode extends TypeNode {
895 readonly kind: SyntaxKind.TupleType;
896 readonly elements: NodeArray<TypeNode | NamedTupleMember>;
897 }
898 export interface NamedTupleMember extends TypeNode, JSDocContainer, Declaration {
899 readonly kind: SyntaxKind.NamedTupleMember;
900 readonly dotDotDotToken?: Token<SyntaxKind.DotDotDotToken>;
901 readonly name: Identifier;
902 readonly questionToken?: Token<SyntaxKind.QuestionToken>;
903 readonly type: TypeNode;
904 }
905 export interface OptionalTypeNode extends TypeNode {
906 readonly kind: SyntaxKind.OptionalType;
907 readonly type: TypeNode;
908 }
909 export interface RestTypeNode extends TypeNode {
910 readonly kind: SyntaxKind.RestType;
911 readonly type: TypeNode;
912 }
913 export type UnionOrIntersectionTypeNode = UnionTypeNode | IntersectionTypeNode;
914 export interface UnionTypeNode extends TypeNode {
915 readonly kind: SyntaxKind.UnionType;
916 readonly types: NodeArray<TypeNode>;
917 }
918 export interface IntersectionTypeNode extends TypeNode {
919 readonly kind: SyntaxKind.IntersectionType;
920 readonly types: NodeArray<TypeNode>;
921 }
922 export interface ConditionalTypeNode extends TypeNode {
923 readonly kind: SyntaxKind.ConditionalType;
924 readonly checkType: TypeNode;
925 readonly extendsType: TypeNode;
926 readonly trueType: TypeNode;
927 readonly falseType: TypeNode;
928 }
929 export interface InferTypeNode extends TypeNode {
930 readonly kind: SyntaxKind.InferType;
931 readonly typeParameter: TypeParameterDeclaration;
932 }
933 export interface ParenthesizedTypeNode extends TypeNode {
934 readonly kind: SyntaxKind.ParenthesizedType;
935 readonly type: TypeNode;
936 }
937 export interface TypeOperatorNode extends TypeNode {
938 readonly kind: SyntaxKind.TypeOperator;
939 readonly operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword;
940 readonly type: TypeNode;
941 }
942 export interface IndexedAccessTypeNode extends TypeNode {
943 readonly kind: SyntaxKind.IndexedAccessType;
944 readonly objectType: TypeNode;
945 readonly indexType: TypeNode;
946 }
947 export interface MappedTypeNode extends TypeNode, Declaration {
948 readonly kind: SyntaxKind.MappedType;
949 readonly readonlyToken?: ReadonlyToken | PlusToken | MinusToken;
950 readonly typeParameter: TypeParameterDeclaration;
951 readonly nameType?: TypeNode;
952 readonly questionToken?: QuestionToken | PlusToken | MinusToken;
953 readonly type?: TypeNode;
954 }
955 export interface LiteralTypeNode extends TypeNode {
956 readonly kind: SyntaxKind.LiteralType;
957 readonly literal: NullLiteral | BooleanLiteral | LiteralExpression | PrefixUnaryExpression;
958 }
959 export interface StringLiteral extends LiteralExpression, Declaration {
960 readonly kind: SyntaxKind.StringLiteral;
961 }
962 export type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral;
963 export type PropertyNameLiteral = Identifier | StringLiteralLike | NumericLiteral;
964 export interface TemplateLiteralTypeNode extends TypeNode {
965 kind: SyntaxKind.TemplateLiteralType;
966 readonly head: TemplateHead;
967 readonly templateSpans: NodeArray<TemplateLiteralTypeSpan>;
968 }
969 export interface TemplateLiteralTypeSpan extends TypeNode {
970 readonly kind: SyntaxKind.TemplateLiteralTypeSpan;
971 readonly parent: TemplateLiteralTypeNode;
972 readonly type: TypeNode;
973 readonly literal: TemplateMiddle | TemplateTail;
974 }
975 export interface Expression extends Node {
976 _expressionBrand: any;
977 }
978 export interface OmittedExpression extends Expression {
979 readonly kind: SyntaxKind.OmittedExpression;
980 }
981 export interface PartiallyEmittedExpression extends LeftHandSideExpression {
982 readonly kind: SyntaxKind.PartiallyEmittedExpression;
983 readonly expression: Expression;
984 }
985 export interface UnaryExpression extends Expression {
986 _unaryExpressionBrand: any;
987 }
988 /** Deprecated, please use UpdateExpression */
989 export type IncrementExpression = UpdateExpression;
990 export interface UpdateExpression extends UnaryExpression {
991 _updateExpressionBrand: any;
992 }
993 export type PrefixUnaryOperator = SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.TildeToken | SyntaxKind.ExclamationToken;
994 export interface PrefixUnaryExpression extends UpdateExpression {
995 readonly kind: SyntaxKind.PrefixUnaryExpression;
996 readonly operator: PrefixUnaryOperator;
997 readonly operand: UnaryExpression;
998 }
999 export type PostfixUnaryOperator = SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken;
1000 export interface PostfixUnaryExpression extends UpdateExpression {
1001 readonly kind: SyntaxKind.PostfixUnaryExpression;
1002 readonly operand: LeftHandSideExpression;
1003 readonly operator: PostfixUnaryOperator;
1004 }
1005 export interface LeftHandSideExpression extends UpdateExpression {
1006 _leftHandSideExpressionBrand: any;
1007 }
1008 export interface MemberExpression extends LeftHandSideExpression {
1009 _memberExpressionBrand: any;
1010 }
1011 export interface PrimaryExpression extends MemberExpression {
1012 _primaryExpressionBrand: any;
1013 }
1014 export interface NullLiteral extends PrimaryExpression {
1015 readonly kind: SyntaxKind.NullKeyword;
1016 }
1017 export interface TrueLiteral extends PrimaryExpression {
1018 readonly kind: SyntaxKind.TrueKeyword;
1019 }
1020 export interface FalseLiteral extends PrimaryExpression {
1021 readonly kind: SyntaxKind.FalseKeyword;
1022 }
1023 export type BooleanLiteral = TrueLiteral | FalseLiteral;
1024 export interface ThisExpression extends PrimaryExpression {
1025 readonly kind: SyntaxKind.ThisKeyword;
1026 }
1027 export interface SuperExpression extends PrimaryExpression {
1028 readonly kind: SyntaxKind.SuperKeyword;
1029 }
1030 export interface ImportExpression extends PrimaryExpression {
1031 readonly kind: SyntaxKind.ImportKeyword;
1032 }
1033 export interface DeleteExpression extends UnaryExpression {
1034 readonly kind: SyntaxKind.DeleteExpression;
1035 readonly expression: UnaryExpression;
1036 }
1037 export interface TypeOfExpression extends UnaryExpression {
1038 readonly kind: SyntaxKind.TypeOfExpression;
1039 readonly expression: UnaryExpression;
1040 }
1041 export interface VoidExpression extends UnaryExpression {
1042 readonly kind: SyntaxKind.VoidExpression;
1043 readonly expression: UnaryExpression;
1044 }
1045 export interface AwaitExpression extends UnaryExpression {
1046 readonly kind: SyntaxKind.AwaitExpression;
1047 readonly expression: UnaryExpression;
1048 }
1049 export interface YieldExpression extends Expression {
1050 readonly kind: SyntaxKind.YieldExpression;
1051 readonly asteriskToken?: AsteriskToken;
1052 readonly expression?: Expression;
1053 }
1054 export interface SyntheticExpression extends Expression {
1055 readonly kind: SyntaxKind.SyntheticExpression;
1056 readonly isSpread: boolean;
1057 readonly type: Type;
1058 readonly tupleNameSource?: ParameterDeclaration | NamedTupleMember;
1059 }
1060 export type ExponentiationOperator = SyntaxKind.AsteriskAsteriskToken;
1061 export type MultiplicativeOperator = SyntaxKind.AsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken;
1062 export type MultiplicativeOperatorOrHigher = ExponentiationOperator | MultiplicativeOperator;
1063 export type AdditiveOperator = SyntaxKind.PlusToken | SyntaxKind.MinusToken;
1064 export type AdditiveOperatorOrHigher = MultiplicativeOperatorOrHigher | AdditiveOperator;
1065 export type ShiftOperator = SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken;
1066 export type ShiftOperatorOrHigher = AdditiveOperatorOrHigher | ShiftOperator;
1067 export type RelationalOperator = SyntaxKind.LessThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.InstanceOfKeyword | SyntaxKind.InKeyword;
1068 export type RelationalOperatorOrHigher = ShiftOperatorOrHigher | RelationalOperator;
1069 export type EqualityOperator = SyntaxKind.EqualsEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.ExclamationEqualsToken;
1070 export type EqualityOperatorOrHigher = RelationalOperatorOrHigher | EqualityOperator;
1071 export type BitwiseOperator = SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken;
1072 export type BitwiseOperatorOrHigher = EqualityOperatorOrHigher | BitwiseOperator;
1073 export type LogicalOperator = SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken;
1074 export type LogicalOperatorOrHigher = BitwiseOperatorOrHigher | LogicalOperator;
1075 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 | SyntaxKind.BarBarEqualsToken | SyntaxKind.AmpersandAmpersandEqualsToken | SyntaxKind.QuestionQuestionEqualsToken;
1076 export type AssignmentOperator = SyntaxKind.EqualsToken | CompoundAssignmentOperator;
1077 export type AssignmentOperatorOrHigher = SyntaxKind.QuestionQuestionToken | LogicalOperatorOrHigher | AssignmentOperator;
1078 export type BinaryOperator = AssignmentOperatorOrHigher | SyntaxKind.CommaToken;
1079 export type LogicalOrCoalescingAssignmentOperator = SyntaxKind.AmpersandAmpersandEqualsToken | SyntaxKind.BarBarEqualsToken | SyntaxKind.QuestionQuestionEqualsToken;
1080 export type BinaryOperatorToken = Token<BinaryOperator>;
1081 export interface BinaryExpression extends Expression, Declaration {
1082 readonly kind: SyntaxKind.BinaryExpression;
1083 readonly left: Expression;
1084 readonly operatorToken: BinaryOperatorToken;
1085 readonly right: Expression;
1086 }
1087 export type AssignmentOperatorToken = Token<AssignmentOperator>;
1088 export interface AssignmentExpression<TOperator extends AssignmentOperatorToken> extends BinaryExpression {
1089 readonly left: LeftHandSideExpression;
1090 readonly operatorToken: TOperator;
1091 }
1092 export interface ObjectDestructuringAssignment extends AssignmentExpression<EqualsToken> {
1093 readonly left: ObjectLiteralExpression;
1094 }
1095 export interface ArrayDestructuringAssignment extends AssignmentExpression<EqualsToken> {
1096 readonly left: ArrayLiteralExpression;
1097 }
1098 export type DestructuringAssignment = ObjectDestructuringAssignment | ArrayDestructuringAssignment;
1099 export type BindingOrAssignmentElement = VariableDeclaration | ParameterDeclaration | ObjectBindingOrAssignmentElement | ArrayBindingOrAssignmentElement;
1100 export type ObjectBindingOrAssignmentElement = BindingElement | PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment;
1101 export type ArrayBindingOrAssignmentElement = BindingElement | OmittedExpression | SpreadElement | ArrayLiteralExpression | ObjectLiteralExpression | AssignmentExpression<EqualsToken> | Identifier | PropertyAccessExpression | ElementAccessExpression;
1102 export type BindingOrAssignmentElementRestIndicator = DotDotDotToken | SpreadElement | SpreadAssignment;
1103 export type BindingOrAssignmentElementTarget = BindingOrAssignmentPattern | Identifier | PropertyAccessExpression | ElementAccessExpression | OmittedExpression;
1104 export type ObjectBindingOrAssignmentPattern = ObjectBindingPattern | ObjectLiteralExpression;
1105 export type ArrayBindingOrAssignmentPattern = ArrayBindingPattern | ArrayLiteralExpression;
1106 export type AssignmentPattern = ObjectLiteralExpression | ArrayLiteralExpression;
1107 export type BindingOrAssignmentPattern = ObjectBindingOrAssignmentPattern | ArrayBindingOrAssignmentPattern;
1108 export interface ConditionalExpression extends Expression {
1109 readonly kind: SyntaxKind.ConditionalExpression;
1110 readonly condition: Expression;
1111 readonly questionToken: QuestionToken;
1112 readonly whenTrue: Expression;
1113 readonly colonToken: ColonToken;
1114 readonly whenFalse: Expression;
1115 }
1116 export type FunctionBody = Block;
1117 export type ConciseBody = FunctionBody | Expression;
1118 export interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclarationBase, JSDocContainer {
1119 readonly kind: SyntaxKind.FunctionExpression;
1120 readonly name?: Identifier;
1121 readonly body: FunctionBody;
1122 }
1123 export interface ArrowFunction extends Expression, FunctionLikeDeclarationBase, JSDocContainer {
1124 readonly kind: SyntaxKind.ArrowFunction;
1125 readonly equalsGreaterThanToken: EqualsGreaterThanToken;
1126 readonly body: ConciseBody;
1127 readonly name: never;
1128 }
1129 export interface LiteralLikeNode extends Node {
1130 text: string;
1131 isUnterminated?: boolean;
1132 hasExtendedUnicodeEscape?: boolean;
1133 }
1134 export interface TemplateLiteralLikeNode extends LiteralLikeNode {
1135 rawText?: string;
1136 }
1137 export interface LiteralExpression extends LiteralLikeNode, PrimaryExpression {
1138 _literalExpressionBrand: any;
1139 }
1140 export interface RegularExpressionLiteral extends LiteralExpression {
1141 readonly kind: SyntaxKind.RegularExpressionLiteral;
1142 }
1143 export interface NoSubstitutionTemplateLiteral extends LiteralExpression, TemplateLiteralLikeNode, Declaration {
1144 readonly kind: SyntaxKind.NoSubstitutionTemplateLiteral;
1145 }
1146 export enum TokenFlags {
1147 None = 0,
1148 Scientific = 16,
1149 Octal = 32,
1150 HexSpecifier = 64,
1151 BinarySpecifier = 128,
1152 OctalSpecifier = 256,
1153 }
1154 export interface NumericLiteral extends LiteralExpression, Declaration {
1155 readonly kind: SyntaxKind.NumericLiteral;
1156 }
1157 export interface BigIntLiteral extends LiteralExpression {
1158 readonly kind: SyntaxKind.BigIntLiteral;
1159 }
1160 export type LiteralToken = NumericLiteral | BigIntLiteral | StringLiteral | JsxText | RegularExpressionLiteral | NoSubstitutionTemplateLiteral;
1161 export interface TemplateHead extends TemplateLiteralLikeNode {
1162 readonly kind: SyntaxKind.TemplateHead;
1163 readonly parent: TemplateExpression | TemplateLiteralTypeNode;
1164 }
1165 export interface TemplateMiddle extends TemplateLiteralLikeNode {
1166 readonly kind: SyntaxKind.TemplateMiddle;
1167 readonly parent: TemplateSpan | TemplateLiteralTypeSpan;
1168 }
1169 export interface TemplateTail extends TemplateLiteralLikeNode {
1170 readonly kind: SyntaxKind.TemplateTail;
1171 readonly parent: TemplateSpan | TemplateLiteralTypeSpan;
1172 }
1173 export type PseudoLiteralToken = TemplateHead | TemplateMiddle | TemplateTail;
1174 export type TemplateLiteralToken = NoSubstitutionTemplateLiteral | PseudoLiteralToken;
1175 export interface TemplateExpression extends PrimaryExpression {
1176 readonly kind: SyntaxKind.TemplateExpression;
1177 readonly head: TemplateHead;
1178 readonly templateSpans: NodeArray<TemplateSpan>;
1179 }
1180 export type TemplateLiteral = TemplateExpression | NoSubstitutionTemplateLiteral;
1181 export interface TemplateSpan extends Node {
1182 readonly kind: SyntaxKind.TemplateSpan;
1183 readonly parent: TemplateExpression;
1184 readonly expression: Expression;
1185 readonly literal: TemplateMiddle | TemplateTail;
1186 }
1187 export interface ParenthesizedExpression extends PrimaryExpression, JSDocContainer {
1188 readonly kind: SyntaxKind.ParenthesizedExpression;
1189 readonly expression: Expression;
1190 }
1191 export interface ArrayLiteralExpression extends PrimaryExpression {
1192 readonly kind: SyntaxKind.ArrayLiteralExpression;
1193 readonly elements: NodeArray<Expression>;
1194 }
1195 export interface SpreadElement extends Expression {
1196 readonly kind: SyntaxKind.SpreadElement;
1197 readonly parent: ArrayLiteralExpression | CallExpression | NewExpression;
1198 readonly expression: Expression;
1199 }
1200 /**
1201 * This interface is a base interface for ObjectLiteralExpression and JSXAttributes to extend from. JSXAttributes is similar to
1202 * ObjectLiteralExpression in that it contains array of properties; however, JSXAttributes' properties can only be
1203 * JSXAttribute or JSXSpreadAttribute. ObjectLiteralExpression, on the other hand, can only have properties of type
1204 * ObjectLiteralElement (e.g. PropertyAssignment, ShorthandPropertyAssignment etc.)
1205 */
1206 export interface ObjectLiteralExpressionBase<T extends ObjectLiteralElement> extends PrimaryExpression, Declaration {
1207 readonly properties: NodeArray<T>;
1208 }
1209 export interface ObjectLiteralExpression extends ObjectLiteralExpressionBase<ObjectLiteralElementLike> {
1210 readonly kind: SyntaxKind.ObjectLiteralExpression;
1211 }
1212 export type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression;
1213 export type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression;
1214 export type AccessExpression = PropertyAccessExpression | ElementAccessExpression;
1215 export interface PropertyAccessExpression extends MemberExpression, NamedDeclaration {
1216 readonly kind: SyntaxKind.PropertyAccessExpression;
1217 readonly expression: LeftHandSideExpression;
1218 readonly questionDotToken?: QuestionDotToken;
1219 readonly name: Identifier | PrivateIdentifier;
1220 }
1221 export interface PropertyAccessChain extends PropertyAccessExpression {
1222 _optionalChainBrand: any;
1223 readonly name: Identifier | PrivateIdentifier;
1224 }
1225 export interface SuperPropertyAccessExpression extends PropertyAccessExpression {
1226 readonly expression: SuperExpression;
1227 }
1228 /** Brand for a PropertyAccessExpression which, like a QualifiedName, consists of a sequence of identifiers separated by dots. */
1229 export interface PropertyAccessEntityNameExpression extends PropertyAccessExpression {
1230 _propertyAccessExpressionLikeQualifiedNameBrand?: any;
1231 readonly expression: EntityNameExpression;
1232 readonly name: Identifier;
1233 }
1234 export interface ElementAccessExpression extends MemberExpression {
1235 readonly kind: SyntaxKind.ElementAccessExpression;
1236 readonly expression: LeftHandSideExpression;
1237 readonly questionDotToken?: QuestionDotToken;
1238 readonly argumentExpression: Expression;
1239 }
1240 export interface ElementAccessChain extends ElementAccessExpression {
1241 _optionalChainBrand: any;
1242 }
1243 export interface SuperElementAccessExpression extends ElementAccessExpression {
1244 readonly expression: SuperExpression;
1245 }
1246 export type SuperProperty = SuperPropertyAccessExpression | SuperElementAccessExpression;
1247 export interface CallExpression extends LeftHandSideExpression, Declaration {
1248 readonly kind: SyntaxKind.CallExpression;
1249 readonly expression: LeftHandSideExpression;
1250 readonly questionDotToken?: QuestionDotToken;
1251 readonly typeArguments?: NodeArray<TypeNode>;
1252 readonly arguments: NodeArray<Expression>;
1253 }
1254 export interface CallChain extends CallExpression {
1255 _optionalChainBrand: any;
1256 }
1257 export type OptionalChain = PropertyAccessChain | ElementAccessChain | CallChain | NonNullChain;
1258 export interface SuperCall extends CallExpression {
1259 readonly expression: SuperExpression;
1260 }
1261 export interface ImportCall extends CallExpression {
1262 readonly expression: ImportExpression;
1263 }
1264 export interface ExpressionWithTypeArguments extends NodeWithTypeArguments {
1265 readonly kind: SyntaxKind.ExpressionWithTypeArguments;
1266 readonly parent: HeritageClause | JSDocAugmentsTag | JSDocImplementsTag;
1267 readonly expression: LeftHandSideExpression;
1268 }
1269 export interface NewExpression extends PrimaryExpression, Declaration {
1270 readonly kind: SyntaxKind.NewExpression;
1271 readonly expression: LeftHandSideExpression;
1272 readonly typeArguments?: NodeArray<TypeNode>;
1273 readonly arguments?: NodeArray<Expression>;
1274 }
1275 export interface TaggedTemplateExpression extends MemberExpression {
1276 readonly kind: SyntaxKind.TaggedTemplateExpression;
1277 readonly tag: LeftHandSideExpression;
1278 readonly typeArguments?: NodeArray<TypeNode>;
1279 readonly template: TemplateLiteral;
1280 }
1281 export type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression | Decorator | JsxOpeningLikeElement;
1282 export interface AsExpression extends Expression {
1283 readonly kind: SyntaxKind.AsExpression;
1284 readonly expression: Expression;
1285 readonly type: TypeNode;
1286 }
1287 export interface TypeAssertion extends UnaryExpression {
1288 readonly kind: SyntaxKind.TypeAssertionExpression;
1289 readonly type: TypeNode;
1290 readonly expression: UnaryExpression;
1291 }
1292 export type AssertionExpression = TypeAssertion | AsExpression;
1293 export interface NonNullExpression extends LeftHandSideExpression {
1294 readonly kind: SyntaxKind.NonNullExpression;
1295 readonly expression: Expression;
1296 }
1297 export interface NonNullChain extends NonNullExpression {
1298 _optionalChainBrand: any;
1299 }
1300 export interface MetaProperty extends PrimaryExpression {
1301 readonly kind: SyntaxKind.MetaProperty;
1302 readonly keywordToken: SyntaxKind.NewKeyword | SyntaxKind.ImportKeyword;
1303 readonly name: Identifier;
1304 }
1305 export interface JsxElement extends PrimaryExpression {
1306 readonly kind: SyntaxKind.JsxElement;
1307 readonly openingElement: JsxOpeningElement;
1308 readonly children: NodeArray<JsxChild>;
1309 readonly closingElement: JsxClosingElement;
1310 }
1311 export type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement;
1312 export type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute;
1313 export type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess;
1314 export interface JsxTagNamePropertyAccess extends PropertyAccessExpression {
1315 readonly expression: JsxTagNameExpression;
1316 }
1317 export interface JsxAttributes extends ObjectLiteralExpressionBase<JsxAttributeLike> {
1318 readonly kind: SyntaxKind.JsxAttributes;
1319 readonly parent: JsxOpeningLikeElement;
1320 }
1321 export interface JsxOpeningElement extends Expression {
1322 readonly kind: SyntaxKind.JsxOpeningElement;
1323 readonly parent: JsxElement;
1324 readonly tagName: JsxTagNameExpression;
1325 readonly typeArguments?: NodeArray<TypeNode>;
1326 readonly attributes: JsxAttributes;
1327 }
1328 export interface JsxSelfClosingElement extends PrimaryExpression {
1329 readonly kind: SyntaxKind.JsxSelfClosingElement;
1330 readonly tagName: JsxTagNameExpression;
1331 readonly typeArguments?: NodeArray<TypeNode>;
1332 readonly attributes: JsxAttributes;
1333 }
1334 export interface JsxFragment extends PrimaryExpression {
1335 readonly kind: SyntaxKind.JsxFragment;
1336 readonly openingFragment: JsxOpeningFragment;
1337 readonly children: NodeArray<JsxChild>;
1338 readonly closingFragment: JsxClosingFragment;
1339 }
1340 export interface JsxOpeningFragment extends Expression {
1341 readonly kind: SyntaxKind.JsxOpeningFragment;
1342 readonly parent: JsxFragment;
1343 }
1344 export interface JsxClosingFragment extends Expression {
1345 readonly kind: SyntaxKind.JsxClosingFragment;
1346 readonly parent: JsxFragment;
1347 }
1348 export interface JsxAttribute extends ObjectLiteralElement {
1349 readonly kind: SyntaxKind.JsxAttribute;
1350 readonly parent: JsxAttributes;
1351 readonly name: Identifier;
1352 readonly initializer?: StringLiteral | JsxExpression;
1353 }
1354 export interface JsxSpreadAttribute extends ObjectLiteralElement {
1355 readonly kind: SyntaxKind.JsxSpreadAttribute;
1356 readonly parent: JsxAttributes;
1357 readonly expression: Expression;
1358 }
1359 export interface JsxClosingElement extends Node {
1360 readonly kind: SyntaxKind.JsxClosingElement;
1361 readonly parent: JsxElement;
1362 readonly tagName: JsxTagNameExpression;
1363 }
1364 export interface JsxExpression extends Expression {
1365 readonly kind: SyntaxKind.JsxExpression;
1366 readonly parent: JsxElement | JsxAttributeLike;
1367 readonly dotDotDotToken?: Token<SyntaxKind.DotDotDotToken>;
1368 readonly expression?: Expression;
1369 }
1370 export interface JsxText extends LiteralLikeNode {
1371 readonly kind: SyntaxKind.JsxText;
1372 readonly parent: JsxElement;
1373 readonly containsOnlyTriviaWhiteSpaces: boolean;
1374 }
1375 export type JsxChild = JsxText | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment;
1376 export interface Statement extends Node {
1377 _statementBrand: any;
1378 }
1379 export interface NotEmittedStatement extends Statement {
1380 readonly kind: SyntaxKind.NotEmittedStatement;
1381 }
1382 /**
1383 * A list of comma-separated expressions. This node is only created by transformations.
1384 */
1385 export interface CommaListExpression extends Expression {
1386 readonly kind: SyntaxKind.CommaListExpression;
1387 readonly elements: NodeArray<Expression>;
1388 }
1389 export interface EmptyStatement extends Statement {
1390 readonly kind: SyntaxKind.EmptyStatement;
1391 }
1392 export interface DebuggerStatement extends Statement {
1393 readonly kind: SyntaxKind.DebuggerStatement;
1394 }
1395 export interface MissingDeclaration extends DeclarationStatement {
1396 readonly kind: SyntaxKind.MissingDeclaration;
1397 readonly name?: Identifier;
1398 }
1399 export type BlockLike = SourceFile | Block | ModuleBlock | CaseOrDefaultClause;
1400 export interface Block extends Statement {
1401 readonly kind: SyntaxKind.Block;
1402 readonly statements: NodeArray<Statement>;
1403 }
1404 export interface VariableStatement extends Statement, JSDocContainer {
1405 readonly kind: SyntaxKind.VariableStatement;
1406 readonly declarationList: VariableDeclarationList;
1407 }
1408 export interface ExpressionStatement extends Statement, JSDocContainer {
1409 readonly kind: SyntaxKind.ExpressionStatement;
1410 readonly expression: Expression;
1411 }
1412 export interface IfStatement extends Statement {
1413 readonly kind: SyntaxKind.IfStatement;
1414 readonly expression: Expression;
1415 readonly thenStatement: Statement;
1416 readonly elseStatement?: Statement;
1417 }
1418 export interface IterationStatement extends Statement {
1419 readonly statement: Statement;
1420 }
1421 export interface DoStatement extends IterationStatement {
1422 readonly kind: SyntaxKind.DoStatement;
1423 readonly expression: Expression;
1424 }
1425 export interface WhileStatement extends IterationStatement {
1426 readonly kind: SyntaxKind.WhileStatement;
1427 readonly expression: Expression;
1428 }
1429 export type ForInitializer = VariableDeclarationList | Expression;
1430 export interface ForStatement extends IterationStatement {
1431 readonly kind: SyntaxKind.ForStatement;
1432 readonly initializer?: ForInitializer;
1433 readonly condition?: Expression;
1434 readonly incrementor?: Expression;
1435 }
1436 export type ForInOrOfStatement = ForInStatement | ForOfStatement;
1437 export interface ForInStatement extends IterationStatement {
1438 readonly kind: SyntaxKind.ForInStatement;
1439 readonly initializer: ForInitializer;
1440 readonly expression: Expression;
1441 }
1442 export interface ForOfStatement extends IterationStatement {
1443 readonly kind: SyntaxKind.ForOfStatement;
1444 readonly awaitModifier?: AwaitKeywordToken;
1445 readonly initializer: ForInitializer;
1446 readonly expression: Expression;
1447 }
1448 export interface BreakStatement extends Statement {
1449 readonly kind: SyntaxKind.BreakStatement;
1450 readonly label?: Identifier;
1451 }
1452 export interface ContinueStatement extends Statement {
1453 readonly kind: SyntaxKind.ContinueStatement;
1454 readonly label?: Identifier;
1455 }
1456 export type BreakOrContinueStatement = BreakStatement | ContinueStatement;
1457 export interface ReturnStatement extends Statement {
1458 readonly kind: SyntaxKind.ReturnStatement;
1459 readonly expression?: Expression;
1460 }
1461 export interface WithStatement extends Statement {
1462 readonly kind: SyntaxKind.WithStatement;
1463 readonly expression: Expression;
1464 readonly statement: Statement;
1465 }
1466 export interface SwitchStatement extends Statement {
1467 readonly kind: SyntaxKind.SwitchStatement;
1468 readonly expression: Expression;
1469 readonly caseBlock: CaseBlock;
1470 possiblyExhaustive?: boolean;
1471 }
1472 export interface CaseBlock extends Node {
1473 readonly kind: SyntaxKind.CaseBlock;
1474 readonly parent: SwitchStatement;
1475 readonly clauses: NodeArray<CaseOrDefaultClause>;
1476 }
1477 export interface CaseClause extends Node {
1478 readonly kind: SyntaxKind.CaseClause;
1479 readonly parent: CaseBlock;
1480 readonly expression: Expression;
1481 readonly statements: NodeArray<Statement>;
1482 }
1483 export interface DefaultClause extends Node {
1484 readonly kind: SyntaxKind.DefaultClause;
1485 readonly parent: CaseBlock;
1486 readonly statements: NodeArray<Statement>;
1487 }
1488 export type CaseOrDefaultClause = CaseClause | DefaultClause;
1489 export interface LabeledStatement extends Statement, JSDocContainer {
1490 readonly kind: SyntaxKind.LabeledStatement;
1491 readonly label: Identifier;
1492 readonly statement: Statement;
1493 }
1494 export interface ThrowStatement extends Statement {
1495 readonly kind: SyntaxKind.ThrowStatement;
1496 readonly expression: Expression;
1497 }
1498 export interface TryStatement extends Statement {
1499 readonly kind: SyntaxKind.TryStatement;
1500 readonly tryBlock: Block;
1501 readonly catchClause?: CatchClause;
1502 readonly finallyBlock?: Block;
1503 }
1504 export interface CatchClause extends Node {
1505 readonly kind: SyntaxKind.CatchClause;
1506 readonly parent: TryStatement;
1507 readonly variableDeclaration?: VariableDeclaration;
1508 readonly block: Block;
1509 }
1510 export type ObjectTypeDeclaration = ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode;
1511 export type DeclarationWithTypeParameters = DeclarationWithTypeParameterChildren | JSDocTypedefTag | JSDocCallbackTag | JSDocSignature;
1512 export type DeclarationWithTypeParameterChildren = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag;
1513 export interface ClassLikeDeclarationBase extends NamedDeclaration, JSDocContainer {
1514 readonly kind: SyntaxKind.ClassDeclaration | SyntaxKind.ClassExpression;
1515 readonly name?: Identifier;
1516 readonly typeParameters?: NodeArray<TypeParameterDeclaration>;
1517 readonly heritageClauses?: NodeArray<HeritageClause>;
1518 readonly members: NodeArray<ClassElement>;
1519 }
1520 export interface ClassDeclaration extends ClassLikeDeclarationBase, DeclarationStatement {
1521 readonly kind: SyntaxKind.ClassDeclaration;
1522 /** May be undefined in `export default class { ... }`. */
1523 readonly name?: Identifier;
1524 }
1525 export interface ClassExpression extends ClassLikeDeclarationBase, PrimaryExpression {
1526 readonly kind: SyntaxKind.ClassExpression;
1527 }
1528 export type ClassLikeDeclaration = ClassDeclaration | ClassExpression;
1529 export interface ClassElement extends NamedDeclaration {
1530 _classElementBrand: any;
1531 readonly name?: PropertyName;
1532 }
1533 export interface TypeElement extends NamedDeclaration {
1534 _typeElementBrand: any;
1535 readonly name?: PropertyName;
1536 readonly questionToken?: QuestionToken;
1537 }
1538 export interface InterfaceDeclaration extends DeclarationStatement, JSDocContainer {
1539 readonly kind: SyntaxKind.InterfaceDeclaration;
1540 readonly name: Identifier;
1541 readonly typeParameters?: NodeArray<TypeParameterDeclaration>;
1542 readonly heritageClauses?: NodeArray<HeritageClause>;
1543 readonly members: NodeArray<TypeElement>;
1544 }
1545 export interface HeritageClause extends Node {
1546 readonly kind: SyntaxKind.HeritageClause;
1547 readonly parent: InterfaceDeclaration | ClassLikeDeclaration;
1548 readonly token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword;
1549 readonly types: NodeArray<ExpressionWithTypeArguments>;
1550 }
1551 export interface TypeAliasDeclaration extends DeclarationStatement, JSDocContainer {
1552 readonly kind: SyntaxKind.TypeAliasDeclaration;
1553 readonly name: Identifier;
1554 readonly typeParameters?: NodeArray<TypeParameterDeclaration>;
1555 readonly type: TypeNode;
1556 }
1557 export interface EnumMember extends NamedDeclaration, JSDocContainer {
1558 readonly kind: SyntaxKind.EnumMember;
1559 readonly parent: EnumDeclaration;
1560 readonly name: PropertyName;
1561 readonly initializer?: Expression;
1562 }
1563 export interface EnumDeclaration extends DeclarationStatement, JSDocContainer {
1564 readonly kind: SyntaxKind.EnumDeclaration;
1565 readonly name: Identifier;
1566 readonly members: NodeArray<EnumMember>;
1567 }
1568 export type ModuleName = Identifier | StringLiteral;
1569 export type ModuleBody = NamespaceBody | JSDocNamespaceBody;
1570 export interface ModuleDeclaration extends DeclarationStatement, JSDocContainer {
1571 readonly kind: SyntaxKind.ModuleDeclaration;
1572 readonly parent: ModuleBody | SourceFile;
1573 readonly name: ModuleName;
1574 readonly body?: ModuleBody | JSDocNamespaceDeclaration;
1575 }
1576 export type NamespaceBody = ModuleBlock | NamespaceDeclaration;
1577 export interface NamespaceDeclaration extends ModuleDeclaration {
1578 readonly name: Identifier;
1579 readonly body: NamespaceBody;
1580 }
1581 export type JSDocNamespaceBody = Identifier | JSDocNamespaceDeclaration;
1582 export interface JSDocNamespaceDeclaration extends ModuleDeclaration {
1583 readonly name: Identifier;
1584 readonly body?: JSDocNamespaceBody;
1585 }
1586 export interface ModuleBlock extends Node, Statement {
1587 readonly kind: SyntaxKind.ModuleBlock;
1588 readonly parent: ModuleDeclaration;
1589 readonly statements: NodeArray<Statement>;
1590 }
1591 export type ModuleReference = EntityName | ExternalModuleReference;
1592 /**
1593 * One of:
1594 * - import x = require("mod");
1595 * - import x = M.x;
1596 */
1597 export interface ImportEqualsDeclaration extends DeclarationStatement, JSDocContainer {
1598 readonly kind: SyntaxKind.ImportEqualsDeclaration;
1599 readonly parent: SourceFile | ModuleBlock;
1600 readonly name: Identifier;
1601 readonly isTypeOnly: boolean;
1602 readonly moduleReference: ModuleReference;
1603 }
1604 export interface ExternalModuleReference extends Node {
1605 readonly kind: SyntaxKind.ExternalModuleReference;
1606 readonly parent: ImportEqualsDeclaration;
1607 readonly expression: Expression;
1608 }
1609 export interface ImportDeclaration extends Statement, JSDocContainer {
1610 readonly kind: SyntaxKind.ImportDeclaration;
1611 readonly parent: SourceFile | ModuleBlock;
1612 readonly importClause?: ImportClause;
1613 /** If this is not a StringLiteral it will be a grammar error. */
1614 readonly moduleSpecifier: Expression;
1615 }
1616 export type NamedImportBindings = NamespaceImport | NamedImports;
1617 export type NamedExportBindings = NamespaceExport | NamedExports;
1618 export interface ImportClause extends NamedDeclaration {
1619 readonly kind: SyntaxKind.ImportClause;
1620 readonly parent: ImportDeclaration;
1621 readonly isTypeOnly: boolean;
1622 readonly name?: Identifier;
1623 readonly namedBindings?: NamedImportBindings;
1624 }
1625 export interface NamespaceImport extends NamedDeclaration {
1626 readonly kind: SyntaxKind.NamespaceImport;
1627 readonly parent: ImportClause;
1628 readonly name: Identifier;
1629 }
1630 export interface NamespaceExport extends NamedDeclaration {
1631 readonly kind: SyntaxKind.NamespaceExport;
1632 readonly parent: ExportDeclaration;
1633 readonly name: Identifier;
1634 }
1635 export interface NamespaceExportDeclaration extends DeclarationStatement, JSDocContainer {
1636 readonly kind: SyntaxKind.NamespaceExportDeclaration;
1637 readonly name: Identifier;
1638 }
1639 export interface ExportDeclaration extends DeclarationStatement, JSDocContainer {
1640 readonly kind: SyntaxKind.ExportDeclaration;
1641 readonly parent: SourceFile | ModuleBlock;
1642 readonly isTypeOnly: boolean;
1643 /** Will not be assigned in the case of `export * from "foo";` */
1644 readonly exportClause?: NamedExportBindings;
1645 /** If this is not a StringLiteral it will be a grammar error. */
1646 readonly moduleSpecifier?: Expression;
1647 }
1648 export interface NamedImports extends Node {
1649 readonly kind: SyntaxKind.NamedImports;
1650 readonly parent: ImportClause;
1651 readonly elements: NodeArray<ImportSpecifier>;
1652 }
1653 export interface NamedExports extends Node {
1654 readonly kind: SyntaxKind.NamedExports;
1655 readonly parent: ExportDeclaration;
1656 readonly elements: NodeArray<ExportSpecifier>;
1657 }
1658 export type NamedImportsOrExports = NamedImports | NamedExports;
1659 export interface ImportSpecifier extends NamedDeclaration {
1660 readonly kind: SyntaxKind.ImportSpecifier;
1661 readonly parent: NamedImports;
1662 readonly propertyName?: Identifier;
1663 readonly name: Identifier;
1664 }
1665 export interface ExportSpecifier extends NamedDeclaration {
1666 readonly kind: SyntaxKind.ExportSpecifier;
1667 readonly parent: NamedExports;
1668 readonly propertyName?: Identifier;
1669 readonly name: Identifier;
1670 }
1671 export type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier;
1672 export type TypeOnlyCompatibleAliasDeclaration = ImportClause | ImportEqualsDeclaration | NamespaceImport | ImportOrExportSpecifier;
1673 /**
1674 * This is either an `export =` or an `export default` declaration.
1675 * Unless `isExportEquals` is set, this node was parsed as an `export default`.
1676 */
1677 export interface ExportAssignment extends DeclarationStatement, JSDocContainer {
1678 readonly kind: SyntaxKind.ExportAssignment;
1679 readonly parent: SourceFile;
1680 readonly isExportEquals?: boolean;
1681 readonly expression: Expression;
1682 }
1683 export interface FileReference extends TextRange {
1684 fileName: string;
1685 }
1686 export interface CheckJsDirective extends TextRange {
1687 enabled: boolean;
1688 }
1689 export type CommentKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia;
1690 export interface CommentRange extends TextRange {
1691 hasTrailingNewLine?: boolean;
1692 kind: CommentKind;
1693 }
1694 export interface SynthesizedComment extends CommentRange {
1695 text: string;
1696 pos: -1;
1697 end: -1;
1698 hasLeadingNewline?: boolean;
1699 }
1700 export interface JSDocTypeExpression extends TypeNode {
1701 readonly kind: SyntaxKind.JSDocTypeExpression;
1702 readonly type: TypeNode;
1703 }
1704 export interface JSDocNameReference extends Node {
1705 readonly kind: SyntaxKind.JSDocNameReference;
1706 readonly name: EntityName;
1707 }
1708 export interface JSDocType extends TypeNode {
1709 _jsDocTypeBrand: any;
1710 }
1711 export interface JSDocAllType extends JSDocType {
1712 readonly kind: SyntaxKind.JSDocAllType;
1713 }
1714 export interface JSDocUnknownType extends JSDocType {
1715 readonly kind: SyntaxKind.JSDocUnknownType;
1716 }
1717 export interface JSDocNonNullableType extends JSDocType {
1718 readonly kind: SyntaxKind.JSDocNonNullableType;
1719 readonly type: TypeNode;
1720 }
1721 export interface JSDocNullableType extends JSDocType {
1722 readonly kind: SyntaxKind.JSDocNullableType;
1723 readonly type: TypeNode;
1724 }
1725 export interface JSDocOptionalType extends JSDocType {
1726 readonly kind: SyntaxKind.JSDocOptionalType;
1727 readonly type: TypeNode;
1728 }
1729 export interface JSDocFunctionType extends JSDocType, SignatureDeclarationBase {
1730 readonly kind: SyntaxKind.JSDocFunctionType;
1731 }
1732 export interface JSDocVariadicType extends JSDocType {
1733 readonly kind: SyntaxKind.JSDocVariadicType;
1734 readonly type: TypeNode;
1735 }
1736 export interface JSDocNamepathType extends JSDocType {
1737 readonly kind: SyntaxKind.JSDocNamepathType;
1738 readonly type: TypeNode;
1739 }
1740 export type JSDocTypeReferencingNode = JSDocVariadicType | JSDocOptionalType | JSDocNullableType | JSDocNonNullableType;
1741 export interface JSDoc extends Node {
1742 readonly kind: SyntaxKind.JSDocComment;
1743 readonly parent: HasJSDoc;
1744 readonly tags?: NodeArray<JSDocTag>;
1745 readonly comment?: string;
1746 }
1747 export interface JSDocTag extends Node {
1748 readonly parent: JSDoc | JSDocTypeLiteral;
1749 readonly tagName: Identifier;
1750 readonly comment?: string;
1751 }
1752 export interface JSDocUnknownTag extends JSDocTag {
1753 readonly kind: SyntaxKind.JSDocTag;
1754 }
1755 /**
1756 * Note that `@extends` is a synonym of `@augments`.
1757 * Both tags are represented by this interface.
1758 */
1759 export interface JSDocAugmentsTag extends JSDocTag {
1760 readonly kind: SyntaxKind.JSDocAugmentsTag;
1761 readonly class: ExpressionWithTypeArguments & {
1762 readonly expression: Identifier | PropertyAccessEntityNameExpression;
1763 };
1764 }
1765 export interface JSDocImplementsTag extends JSDocTag {
1766 readonly kind: SyntaxKind.JSDocImplementsTag;
1767 readonly class: ExpressionWithTypeArguments & {
1768 readonly expression: Identifier | PropertyAccessEntityNameExpression;
1769 };
1770 }
1771 export interface JSDocAuthorTag extends JSDocTag {
1772 readonly kind: SyntaxKind.JSDocAuthorTag;
1773 }
1774 export interface JSDocDeprecatedTag extends JSDocTag {
1775 kind: SyntaxKind.JSDocDeprecatedTag;
1776 }
1777 export interface JSDocClassTag extends JSDocTag {
1778 readonly kind: SyntaxKind.JSDocClassTag;
1779 }
1780 export interface JSDocPublicTag extends JSDocTag {
1781 readonly kind: SyntaxKind.JSDocPublicTag;
1782 }
1783 export interface JSDocPrivateTag extends JSDocTag {
1784 readonly kind: SyntaxKind.JSDocPrivateTag;
1785 }
1786 export interface JSDocProtectedTag extends JSDocTag {
1787 readonly kind: SyntaxKind.JSDocProtectedTag;
1788 }
1789 export interface JSDocReadonlyTag extends JSDocTag {
1790 readonly kind: SyntaxKind.JSDocReadonlyTag;
1791 }
1792 export interface JSDocEnumTag extends JSDocTag, Declaration {
1793 readonly kind: SyntaxKind.JSDocEnumTag;
1794 readonly parent: JSDoc;
1795 readonly typeExpression: JSDocTypeExpression;
1796 }
1797 export interface JSDocThisTag extends JSDocTag {
1798 readonly kind: SyntaxKind.JSDocThisTag;
1799 readonly typeExpression: JSDocTypeExpression;
1800 }
1801 export interface JSDocTemplateTag extends JSDocTag {
1802 readonly kind: SyntaxKind.JSDocTemplateTag;
1803 readonly constraint: JSDocTypeExpression | undefined;
1804 readonly typeParameters: NodeArray<TypeParameterDeclaration>;
1805 }
1806 export interface JSDocSeeTag extends JSDocTag {
1807 readonly kind: SyntaxKind.JSDocSeeTag;
1808 readonly name?: JSDocNameReference;
1809 }
1810 export interface JSDocReturnTag extends JSDocTag {
1811 readonly kind: SyntaxKind.JSDocReturnTag;
1812 readonly typeExpression?: JSDocTypeExpression;
1813 }
1814 export interface JSDocTypeTag extends JSDocTag {
1815 readonly kind: SyntaxKind.JSDocTypeTag;
1816 readonly typeExpression: JSDocTypeExpression;
1817 }
1818 export interface JSDocTypedefTag extends JSDocTag, NamedDeclaration {
1819 readonly kind: SyntaxKind.JSDocTypedefTag;
1820 readonly parent: JSDoc;
1821 readonly fullName?: JSDocNamespaceDeclaration | Identifier;
1822 readonly name?: Identifier;
1823 readonly typeExpression?: JSDocTypeExpression | JSDocTypeLiteral;
1824 }
1825 export interface JSDocCallbackTag extends JSDocTag, NamedDeclaration {
1826 readonly kind: SyntaxKind.JSDocCallbackTag;
1827 readonly parent: JSDoc;
1828 readonly fullName?: JSDocNamespaceDeclaration | Identifier;
1829 readonly name?: Identifier;
1830 readonly typeExpression: JSDocSignature;
1831 }
1832 export interface JSDocSignature extends JSDocType, Declaration {
1833 readonly kind: SyntaxKind.JSDocSignature;
1834 readonly typeParameters?: readonly JSDocTemplateTag[];
1835 readonly parameters: readonly JSDocParameterTag[];
1836 readonly type: JSDocReturnTag | undefined;
1837 }
1838 export interface JSDocPropertyLikeTag extends JSDocTag, Declaration {
1839 readonly parent: JSDoc;
1840 readonly name: EntityName;
1841 readonly typeExpression?: JSDocTypeExpression;
1842 /** Whether the property name came before the type -- non-standard for JSDoc, but Typescript-like */
1843 readonly isNameFirst: boolean;
1844 readonly isBracketed: boolean;
1845 }
1846 export interface JSDocPropertyTag extends JSDocPropertyLikeTag {
1847 readonly kind: SyntaxKind.JSDocPropertyTag;
1848 }
1849 export interface JSDocParameterTag extends JSDocPropertyLikeTag {
1850 readonly kind: SyntaxKind.JSDocParameterTag;
1851 }
1852 export interface JSDocTypeLiteral extends JSDocType {
1853 readonly kind: SyntaxKind.JSDocTypeLiteral;
1854 readonly jsDocPropertyTags?: readonly JSDocPropertyLikeTag[];
1855 /** If true, then this type literal represents an *array* of its type. */
1856 readonly isArrayType: boolean;
1857 }
1858 export enum FlowFlags {
1859 Unreachable = 1,
1860 Start = 2,
1861 BranchLabel = 4,
1862 LoopLabel = 8,
1863 Assignment = 16,
1864 TrueCondition = 32,
1865 FalseCondition = 64,
1866 SwitchClause = 128,
1867 ArrayMutation = 256,
1868 Call = 512,
1869 ReduceLabel = 1024,
1870 Referenced = 2048,
1871 Shared = 4096,
1872 Label = 12,
1873 Condition = 96
1874 }
1875 export type FlowNode = FlowStart | FlowLabel | FlowAssignment | FlowCall | FlowCondition | FlowSwitchClause | FlowArrayMutation | FlowCall | FlowReduceLabel;
1876 export interface FlowNodeBase {
1877 flags: FlowFlags;
1878 id?: number;
1879 }
1880 export interface FlowStart extends FlowNodeBase {
1881 node?: FunctionExpression | ArrowFunction | MethodDeclaration;
1882 }
1883 export interface FlowLabel extends FlowNodeBase {
1884 antecedents: FlowNode[] | undefined;
1885 }
1886 export interface FlowAssignment extends FlowNodeBase {
1887 node: Expression | VariableDeclaration | BindingElement;
1888 antecedent: FlowNode;
1889 }
1890 export interface FlowCall extends FlowNodeBase {
1891 node: CallExpression;
1892 antecedent: FlowNode;
1893 }
1894 export interface FlowCondition extends FlowNodeBase {
1895 node: Expression;
1896 antecedent: FlowNode;
1897 }
1898 export interface FlowSwitchClause extends FlowNodeBase {
1899 switchStatement: SwitchStatement;
1900 clauseStart: number;
1901 clauseEnd: number;
1902 antecedent: FlowNode;
1903 }
1904 export interface FlowArrayMutation extends FlowNodeBase {
1905 node: CallExpression | BinaryExpression;
1906 antecedent: FlowNode;
1907 }
1908 export interface FlowReduceLabel extends FlowNodeBase {
1909 target: FlowLabel;
1910 antecedents: FlowNode[];
1911 antecedent: FlowNode;
1912 }
1913 export type FlowType = Type | IncompleteType;
1914 export interface IncompleteType {
1915 flags: TypeFlags;
1916 type: Type;
1917 }
1918 export interface AmdDependency {
1919 path: string;
1920 name?: string;
1921 }
1922 export interface SourceFile extends Declaration {
1923 readonly kind: SyntaxKind.SourceFile;
1924 readonly statements: NodeArray<Statement>;
1925 readonly endOfFileToken: Token<SyntaxKind.EndOfFileToken>;
1926 fileName: string;
1927 text: string;
1928 amdDependencies: readonly AmdDependency[];
1929 moduleName?: string;
1930 referencedFiles: readonly FileReference[];
1931 typeReferenceDirectives: readonly FileReference[];
1932 libReferenceDirectives: readonly FileReference[];
1933 languageVariant: LanguageVariant;
1934 isDeclarationFile: boolean;
1935 /**
1936 * lib.d.ts should have a reference comment like
1937 *
1938 * /// <reference no-default-lib="true"/>
1939 *
1940 * If any other file has this comment, it signals not to include lib.d.ts
1941 * because this containing file is intended to act as a default library.
1942 */
1943 hasNoDefaultLib: boolean;
1944 languageVersion: ScriptTarget;
1945 }
1946 export interface Bundle extends Node {
1947 readonly kind: SyntaxKind.Bundle;
1948 readonly prepends: readonly (InputFiles | UnparsedSource)[];
1949 readonly sourceFiles: readonly SourceFile[];
1950 }
1951 export interface InputFiles extends Node {
1952 readonly kind: SyntaxKind.InputFiles;
1953 javascriptPath?: string;
1954 javascriptText: string;
1955 javascriptMapPath?: string;
1956 javascriptMapText?: string;
1957 declarationPath?: string;
1958 declarationText: string;
1959 declarationMapPath?: string;
1960 declarationMapText?: string;
1961 }
1962 export interface UnparsedSource extends Node {
1963 readonly kind: SyntaxKind.UnparsedSource;
1964 fileName: string;
1965 text: string;
1966 readonly prologues: readonly UnparsedPrologue[];
1967 helpers: readonly UnscopedEmitHelper[] | undefined;
1968 referencedFiles: readonly FileReference[];
1969 typeReferenceDirectives: readonly string[] | undefined;
1970 libReferenceDirectives: readonly FileReference[];
1971 hasNoDefaultLib?: boolean;
1972 sourceMapPath?: string;
1973 sourceMapText?: string;
1974 readonly syntheticReferences?: readonly UnparsedSyntheticReference[];
1975 readonly texts: readonly UnparsedSourceText[];
1976 }
1977 export type UnparsedSourceText = UnparsedPrepend | UnparsedTextLike;
1978 export type UnparsedNode = UnparsedPrologue | UnparsedSourceText | UnparsedSyntheticReference;
1979 export interface UnparsedSection extends Node {
1980 readonly kind: SyntaxKind;
1981 readonly parent: UnparsedSource;
1982 readonly data?: string;
1983 }
1984 export interface UnparsedPrologue extends UnparsedSection {
1985 readonly kind: SyntaxKind.UnparsedPrologue;
1986 readonly parent: UnparsedSource;
1987 readonly data: string;
1988 }
1989 export interface UnparsedPrepend extends UnparsedSection {
1990 readonly kind: SyntaxKind.UnparsedPrepend;
1991 readonly parent: UnparsedSource;
1992 readonly data: string;
1993 readonly texts: readonly UnparsedTextLike[];
1994 }
1995 export interface UnparsedTextLike extends UnparsedSection {
1996 readonly kind: SyntaxKind.UnparsedText | SyntaxKind.UnparsedInternalText;
1997 readonly parent: UnparsedSource;
1998 }
1999 export interface UnparsedSyntheticReference extends UnparsedSection {
2000 readonly kind: SyntaxKind.UnparsedSyntheticReference;
2001 readonly parent: UnparsedSource;
2002 }
2003 export interface JsonSourceFile extends SourceFile {
2004 readonly statements: NodeArray<JsonObjectExpressionStatement>;
2005 }
2006 export interface TsConfigSourceFile extends JsonSourceFile {
2007 extendedSourceFiles?: string[];
2008 }
2009 export interface JsonMinusNumericLiteral extends PrefixUnaryExpression {
2010 readonly kind: SyntaxKind.PrefixUnaryExpression;
2011 readonly operator: SyntaxKind.MinusToken;
2012 readonly operand: NumericLiteral;
2013 }
2014 export type JsonObjectExpression = ObjectLiteralExpression | ArrayLiteralExpression | JsonMinusNumericLiteral | NumericLiteral | StringLiteral | BooleanLiteral | NullLiteral;
2015 export interface JsonObjectExpressionStatement extends ExpressionStatement {
2016 readonly expression: JsonObjectExpression;
2017 }
2018 export interface ScriptReferenceHost {
2019 getCompilerOptions(): CompilerOptions;
2020 getSourceFile(fileName: string): SourceFile | undefined;
2021 getSourceFileByPath(path: Path): SourceFile | undefined;
2022 getCurrentDirectory(): string;
2023 }
2024 export interface ParseConfigHost {
2025 useCaseSensitiveFileNames: boolean;
2026 readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number): readonly string[];
2027 /**
2028 * Gets a value indicating whether the specified path exists and is a file.
2029 * @param path The path to test.
2030 */
2031 fileExists(path: string): boolean;
2032 readFile(path: string): string | undefined;
2033 trace?(s: string): void;
2034 }
2035 /**
2036 * Branded string for keeping track of when we've turned an ambiguous path
2037 * specified like "./blah" to an absolute path to an actual
2038 * tsconfig file, e.g. "/root/blah/tsconfig.json"
2039 */
2040 export type ResolvedConfigFileName = string & {
2041 _isResolvedConfigFileName: never;
2042 };
2043 export type WriteFileCallback = (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[]) => void;
2044 export class OperationCanceledException {
2045 }
2046 export interface CancellationToken {
2047 isCancellationRequested(): boolean;
2048 /** @throws OperationCanceledException if isCancellationRequested is true */
2049 throwIfCancellationRequested(): void;
2050 }
2051 export interface Program extends ScriptReferenceHost {
2052 getCurrentDirectory(): string;
2053 /**
2054 * Get a list of root file names that were passed to a 'createProgram'
2055 */
2056 getRootFileNames(): readonly string[];
2057 /**
2058 * Get a list of files in the program
2059 */
2060 getSourceFiles(): readonly SourceFile[];
2061 /**
2062 * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then
2063 * the JavaScript and declaration files will be produced for all the files in this program.
2064 * If targetSourceFile is specified, then only the JavaScript and declaration for that
2065 * specific file will be generated.
2066 *
2067 * If writeFile is not specified then the writeFile callback from the compiler host will be
2068 * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter
2069 * will be invoked when writing the JavaScript and declaration files.
2070 */
2071 emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult;
2072 getOptionsDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
2073 getGlobalDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
2074 getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[];
2075 /** The first time this is called, it will return global diagnostics (no location). */
2076 getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
2077 getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[];
2078 getConfigFileParsingDiagnostics(): readonly Diagnostic[];
2079 /**
2080 * Gets a type checker that can be used to semantically analyze source files in the program.
2081 */
2082 getTypeChecker(): TypeChecker;
2083 getTypeCatalog(): readonly Type[];
2084 getNodeCount(): number;
2085 getIdentifierCount(): number;
2086 getSymbolCount(): number;
2087 getTypeCount(): number;
2088 getInstantiationCount(): number;
2089 getRelationCacheSizes(): {
2090 assignable: number;
2091 identity: number;
2092 subtype: number;
2093 strictSubtype: number;
2094 };
2095 isSourceFileFromExternalLibrary(file: SourceFile): boolean;
2096 isSourceFileDefaultLibrary(file: SourceFile): boolean;
2097 getProjectReferences(): readonly ProjectReference[] | undefined;
2098 getResolvedProjectReferences(): readonly (ResolvedProjectReference | undefined)[] | undefined;
2099 }
2100 export interface ResolvedProjectReference {
2101 commandLine: ParsedCommandLine;
2102 sourceFile: SourceFile;
2103 references?: readonly (ResolvedProjectReference | undefined)[];
2104 }
2105 export type CustomTransformerFactory = (context: TransformationContext) => CustomTransformer;
2106 export interface CustomTransformer {
2107 transformSourceFile(node: SourceFile): SourceFile;
2108 transformBundle(node: Bundle): Bundle;
2109 }
2110 export interface CustomTransformers {
2111 /** Custom transformers to evaluate before built-in .js transformations. */
2112 before?: (TransformerFactory<SourceFile> | CustomTransformerFactory)[];
2113 /** Custom transformers to evaluate after built-in .js transformations. */
2114 after?: (TransformerFactory<SourceFile> | CustomTransformerFactory)[];
2115 /** Custom transformers to evaluate after built-in .d.ts transformations. */
2116 afterDeclarations?: (TransformerFactory<Bundle | SourceFile> | CustomTransformerFactory)[];
2117 }
2118 export interface SourceMapSpan {
2119 /** Line number in the .js file. */
2120 emittedLine: number;
2121 /** Column number in the .js file. */
2122 emittedColumn: number;
2123 /** Line number in the .ts file. */
2124 sourceLine: number;
2125 /** Column number in the .ts file. */
2126 sourceColumn: number;
2127 /** Optional name (index into names array) associated with this span. */
2128 nameIndex?: number;
2129 /** .ts file (index into sources array) associated with this span */
2130 sourceIndex: number;
2131 }
2132 /** Return code used by getEmitOutput function to indicate status of the function */
2133 export enum ExitStatus {
2134 Success = 0,
2135 DiagnosticsPresent_OutputsSkipped = 1,
2136 DiagnosticsPresent_OutputsGenerated = 2,
2137 InvalidProject_OutputsSkipped = 3,
2138 ProjectReferenceCycle_OutputsSkipped = 4,
2139 /** @deprecated Use ProjectReferenceCycle_OutputsSkipped instead. */
2140 ProjectReferenceCycle_OutputsSkupped = 4
2141 }
2142 export interface EmitResult {
2143 emitSkipped: boolean;
2144 /** Contains declaration emit diagnostics */
2145 diagnostics: readonly Diagnostic[];
2146 emittedFiles?: string[];
2147 }
2148 export interface TypeChecker {
2149 getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type;
2150 getDeclaredTypeOfSymbol(symbol: Symbol): Type;
2151 getPropertiesOfType(type: Type): Symbol[];
2152 getPropertyOfType(type: Type, propertyName: string): Symbol | undefined;
2153 getPrivateIdentifierPropertyOfType(leftType: Type, name: string, location: Node): Symbol | undefined;
2154 getIndexInfoOfType(type: Type, kind: IndexKind): IndexInfo | undefined;
2155 getSignaturesOfType(type: Type, kind: SignatureKind): readonly Signature[];
2156 getIndexTypeOfType(type: Type, kind: IndexKind): Type | undefined;
2157 getBaseTypes(type: InterfaceType): BaseType[];
2158 getBaseTypeOfLiteralType(type: Type): Type;
2159 getWidenedType(type: Type): Type;
2160 getReturnTypeOfSignature(signature: Signature): Type;
2161 getNullableType(type: Type, flags: TypeFlags): Type;
2162 getNonNullableType(type: Type): Type;
2163 getTypeArguments(type: TypeReference): readonly Type[];
2164 /** Note that the resulting nodes cannot be checked. */
2165 typeToTypeNode(type: Type, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): TypeNode | undefined;
2166 /** Note that the resulting nodes cannot be checked. */
2167 signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): SignatureDeclaration & {
2168 typeArguments?: NodeArray<TypeNode>;
2169 } | undefined;
2170 /** Note that the resulting nodes cannot be checked. */
2171 indexInfoToIndexSignatureDeclaration(indexInfo: IndexInfo, kind: IndexKind, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): IndexSignatureDeclaration | undefined;
2172 /** Note that the resulting nodes cannot be checked. */
2173 symbolToEntityName(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): EntityName | undefined;
2174 /** Note that the resulting nodes cannot be checked. */
2175 symbolToExpression(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): Expression | undefined;
2176 /** Note that the resulting nodes cannot be checked. */
2177 symbolToTypeParameterDeclarations(symbol: Symbol, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): NodeArray<TypeParameterDeclaration> | undefined;
2178 /** Note that the resulting nodes cannot be checked. */
2179 symbolToParameterDeclaration(symbol: Symbol, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): ParameterDeclaration | undefined;
2180 /** Note that the resulting nodes cannot be checked. */
2181 typeParameterToDeclaration(parameter: TypeParameter, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): TypeParameterDeclaration | undefined;
2182 getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[];
2183 getSymbolAtLocation(node: Node): Symbol | undefined;
2184 getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[];
2185 /**
2186 * The function returns the value (local variable) symbol of an identifier in the short-hand property assignment.
2187 * This is necessary as an identifier in short-hand property assignment can contains two meaning: property name and property value.
2188 */
2189 getShorthandAssignmentValueSymbol(location: Node): Symbol | undefined;
2190 getExportSpecifierLocalTargetSymbol(location: ExportSpecifier | Identifier): Symbol | undefined;
2191 /**
2192 * If a symbol is a local symbol with an associated exported symbol, returns the exported symbol.
2193 * Otherwise returns its input.
2194 * For example, at `export type T = number;`:
2195 * - `getSymbolAtLocation` at the location `T` will return the exported symbol for `T`.
2196 * - But the result of `getSymbolsInScope` will contain the *local* symbol for `T`, not the exported symbol.
2197 * - Calling `getExportSymbolOfSymbol` on that local symbol will return the exported symbol.
2198 */
2199 getExportSymbolOfSymbol(symbol: Symbol): Symbol;
2200 getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol | undefined;
2201 getTypeOfAssignmentPattern(pattern: AssignmentPattern): Type;
2202 getTypeAtLocation(node: Node): Type;
2203 getTypeFromTypeNode(node: TypeNode): Type;
2204 signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string;
2205 typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string;
2206 symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): string;
2207 typePredicateToString(predicate: TypePredicate, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string;
2208 getFullyQualifiedName(symbol: Symbol): string;
2209 getAugmentedPropertiesOfType(type: Type): Symbol[];
2210 getRootSymbols(symbol: Symbol): readonly Symbol[];
2211 getSymbolOfExpando(node: Node, allowDeclaration: boolean): Symbol | undefined;
2212 getContextualType(node: Expression): Type | undefined;
2213 /**
2214 * returns unknownSignature in the case of an error.
2215 * returns undefined if the node is not valid.
2216 * @param argumentCount Apparent number of arguments, passed in case of a possibly incomplete call. This should come from an ArgumentListInfo. See `signatureHelp.ts`.
2217 */
2218 getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[], argumentCount?: number): Signature | undefined;
2219 getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature | undefined;
2220 isImplementationOfOverload(node: SignatureDeclaration): boolean | undefined;
2221 isUndefinedSymbol(symbol: Symbol): boolean;
2222 isArgumentsSymbol(symbol: Symbol): boolean;
2223 isUnknownSymbol(symbol: Symbol): boolean;
2224 getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): string | number | undefined;
2225 isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName | ImportTypeNode, propertyName: string): boolean;
2226 /** Follow all aliases to get the original symbol. */
2227 getAliasedSymbol(symbol: Symbol): Symbol;
2228 getExportsOfModule(moduleSymbol: Symbol): Symbol[];
2229 getJsxIntrinsicTagNamesAt(location: Node): Symbol[];
2230 isOptionalParameter(node: ParameterDeclaration): boolean;
2231 getAmbientModules(): Symbol[];
2232 tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined;
2233 getApparentType(type: Type): Type;
2234 getBaseConstraintOfType(type: Type): Type | undefined;
2235 getDefaultFromTypeParameter(type: Type): Type | undefined;
2236 /**
2237 * Depending on the operation performed, it may be appropriate to throw away the checker
2238 * if the cancellation token is triggered. Typically, if it is used for error checking
2239 * and the operation is cancelled, then it should be discarded, otherwise it is safe to keep.
2240 */
2241 runWithCancellationToken<T>(token: CancellationToken, cb: (checker: TypeChecker) => T): T;
2242 }
2243 export enum NodeBuilderFlags {
2244 None = 0,
2245 NoTruncation = 1,
2246 WriteArrayAsGenericType = 2,
2247 GenerateNamesForShadowedTypeParams = 4,
2248 UseStructuralFallback = 8,
2249 ForbidIndexedAccessSymbolReferences = 16,
2250 WriteTypeArgumentsOfSignature = 32,
2251 UseFullyQualifiedType = 64,
2252 UseOnlyExternalAliasing = 128,
2253 SuppressAnyReturnType = 256,
2254 WriteTypeParametersInQualifiedName = 512,
2255 MultilineObjectLiterals = 1024,
2256 WriteClassExpressionAsTypeLiteral = 2048,
2257 UseTypeOfFunction = 4096,
2258 OmitParameterModifiers = 8192,
2259 UseAliasDefinedOutsideCurrentScope = 16384,
2260 UseSingleQuotesForStringLiteralType = 268435456,
2261 NoTypeReduction = 536870912,
2262 NoUndefinedOptionalParameterType = 1073741824,
2263 AllowThisInObjectLiteral = 32768,
2264 AllowQualifedNameInPlaceOfIdentifier = 65536,
2265 AllowAnonymousIdentifier = 131072,
2266 AllowEmptyUnionOrIntersection = 262144,
2267 AllowEmptyTuple = 524288,
2268 AllowUniqueESSymbolType = 1048576,
2269 AllowEmptyIndexInfoType = 2097152,
2270 AllowNodeModulesRelativePaths = 67108864,
2271 IgnoreErrors = 70221824,
2272 InObjectTypeLiteral = 4194304,
2273 InTypeAlias = 8388608,
2274 InInitialEntityName = 16777216,
2275 InReverseMappedType = 33554432
2276 }
2277 export enum TypeFormatFlags {
2278 None = 0,
2279 NoTruncation = 1,
2280 WriteArrayAsGenericType = 2,
2281 UseStructuralFallback = 8,
2282 WriteTypeArgumentsOfSignature = 32,
2283 UseFullyQualifiedType = 64,
2284 SuppressAnyReturnType = 256,
2285 MultilineObjectLiterals = 1024,
2286 WriteClassExpressionAsTypeLiteral = 2048,
2287 UseTypeOfFunction = 4096,
2288 OmitParameterModifiers = 8192,
2289 UseAliasDefinedOutsideCurrentScope = 16384,
2290 UseSingleQuotesForStringLiteralType = 268435456,
2291 NoTypeReduction = 536870912,
2292 AllowUniqueESSymbolType = 1048576,
2293 AddUndefined = 131072,
2294 WriteArrowStyleSignature = 262144,
2295 InArrayType = 524288,
2296 InElementType = 2097152,
2297 InFirstTypeArgument = 4194304,
2298 InTypeAlias = 8388608,
2299 /** @deprecated */ WriteOwnNameForAnyLike = 0,
2300 NodeBuilderFlagsMask = 814775659
2301 }
2302 export enum SymbolFormatFlags {
2303 None = 0,
2304 WriteTypeParametersOrArguments = 1,
2305 UseOnlyExternalAliasing = 2,
2306 AllowAnyNodeKind = 4,
2307 UseAliasDefinedOutsideCurrentScope = 8,
2308 }
2309 export enum TypePredicateKind {
2310 This = 0,
2311 Identifier = 1,
2312 AssertsThis = 2,
2313 AssertsIdentifier = 3
2314 }
2315 export interface TypePredicateBase {
2316 kind: TypePredicateKind;
2317 type: Type | undefined;
2318 }
2319 export interface ThisTypePredicate extends TypePredicateBase {
2320 kind: TypePredicateKind.This;
2321 parameterName: undefined;
2322 parameterIndex: undefined;
2323 type: Type;
2324 }
2325 export interface IdentifierTypePredicate extends TypePredicateBase {
2326 kind: TypePredicateKind.Identifier;
2327 parameterName: string;
2328 parameterIndex: number;
2329 type: Type;
2330 }
2331 export interface AssertsThisTypePredicate extends TypePredicateBase {
2332 kind: TypePredicateKind.AssertsThis;
2333 parameterName: undefined;
2334 parameterIndex: undefined;
2335 type: Type | undefined;
2336 }
2337 export interface AssertsIdentifierTypePredicate extends TypePredicateBase {
2338 kind: TypePredicateKind.AssertsIdentifier;
2339 parameterName: string;
2340 parameterIndex: number;
2341 type: Type | undefined;
2342 }
2343 export type TypePredicate = ThisTypePredicate | IdentifierTypePredicate | AssertsThisTypePredicate | AssertsIdentifierTypePredicate;
2344 export enum SymbolFlags {
2345 None = 0,
2346 FunctionScopedVariable = 1,
2347 BlockScopedVariable = 2,
2348 Property = 4,
2349 EnumMember = 8,
2350 Function = 16,
2351 Class = 32,
2352 Interface = 64,
2353 ConstEnum = 128,
2354 RegularEnum = 256,
2355 ValueModule = 512,
2356 NamespaceModule = 1024,
2357 TypeLiteral = 2048,
2358 ObjectLiteral = 4096,
2359 Method = 8192,
2360 Constructor = 16384,
2361 GetAccessor = 32768,
2362 SetAccessor = 65536,
2363 Signature = 131072,
2364 TypeParameter = 262144,
2365 TypeAlias = 524288,
2366 ExportValue = 1048576,
2367 Alias = 2097152,
2368 Prototype = 4194304,
2369 ExportStar = 8388608,
2370 Optional = 16777216,
2371 Transient = 33554432,
2372 Assignment = 67108864,
2373 ModuleExports = 134217728,
2374 Enum = 384,
2375 Variable = 3,
2376 Value = 111551,
2377 Type = 788968,
2378 Namespace = 1920,
2379 Module = 1536,
2380 Accessor = 98304,
2381 FunctionScopedVariableExcludes = 111550,
2382 BlockScopedVariableExcludes = 111551,
2383 ParameterExcludes = 111551,
2384 PropertyExcludes = 0,
2385 EnumMemberExcludes = 900095,
2386 FunctionExcludes = 110991,
2387 ClassExcludes = 899503,
2388 InterfaceExcludes = 788872,
2389 RegularEnumExcludes = 899327,
2390 ConstEnumExcludes = 899967,
2391 ValueModuleExcludes = 110735,
2392 NamespaceModuleExcludes = 0,
2393 MethodExcludes = 103359,
2394 GetAccessorExcludes = 46015,
2395 SetAccessorExcludes = 78783,
2396 TypeParameterExcludes = 526824,
2397 TypeAliasExcludes = 788968,
2398 AliasExcludes = 2097152,
2399 ModuleMember = 2623475,
2400 ExportHasLocal = 944,
2401 BlockScoped = 418,
2402 PropertyOrAccessor = 98308,
2403 ClassMember = 106500,
2404 }
2405 export interface Symbol {
2406 flags: SymbolFlags;
2407 escapedName: __String;
2408 declarations: Declaration[];
2409 valueDeclaration: Declaration;
2410 members?: SymbolTable;
2411 exports?: SymbolTable;
2412 globalExports?: SymbolTable;
2413 }
2414 export enum InternalSymbolName {
2415 Call = "__call",
2416 Constructor = "__constructor",
2417 New = "__new",
2418 Index = "__index",
2419 ExportStar = "__export",
2420 Global = "__global",
2421 Missing = "__missing",
2422 Type = "__type",
2423 Object = "__object",
2424 JSXAttributes = "__jsxAttributes",
2425 Class = "__class",
2426 Function = "__function",
2427 Computed = "__computed",
2428 Resolving = "__resolving__",
2429 ExportEquals = "export=",
2430 Default = "default",
2431 This = "this"
2432 }
2433 /**
2434 * This represents a string whose leading underscore have been escaped by adding extra leading underscores.
2435 * The shape of this brand is rather unique compared to others we've used.
2436 * Instead of just an intersection of a string and an object, it is that union-ed
2437 * with an intersection of void and an object. This makes it wholly incompatible
2438 * with a normal string (which is good, it cannot be misused on assignment or on usage),
2439 * while still being comparable with a normal string via === (also good) and castable from a string.
2440 */
2441 export type __String = (string & {
2442 __escapedIdentifier: void;
2443 }) | (void & {
2444 __escapedIdentifier: void;
2445 }) | InternalSymbolName;
2446 /** ReadonlyMap where keys are `__String`s. */
2447 export interface ReadonlyUnderscoreEscapedMap<T> extends ReadonlyESMap<__String, T> {
2448 }
2449 /** Map where keys are `__String`s. */
2450 export interface UnderscoreEscapedMap<T> extends ESMap<__String, T>, ReadonlyUnderscoreEscapedMap<T> {
2451 }
2452 /** SymbolTable based on ES6 Map interface. */
2453 export type SymbolTable = UnderscoreEscapedMap<Symbol>;
2454 export enum TypeFlags {
2455 Any = 1,
2456 Unknown = 2,
2457 String = 4,
2458 Number = 8,
2459 Boolean = 16,
2460 Enum = 32,
2461 BigInt = 64,
2462 StringLiteral = 128,
2463 NumberLiteral = 256,
2464 BooleanLiteral = 512,
2465 EnumLiteral = 1024,
2466 BigIntLiteral = 2048,
2467 ESSymbol = 4096,
2468 UniqueESSymbol = 8192,
2469 Void = 16384,
2470 Undefined = 32768,
2471 Null = 65536,
2472 Never = 131072,
2473 TypeParameter = 262144,
2474 Object = 524288,
2475 Union = 1048576,
2476 Intersection = 2097152,
2477 Index = 4194304,
2478 IndexedAccess = 8388608,
2479 Conditional = 16777216,
2480 Substitution = 33554432,
2481 NonPrimitive = 67108864,
2482 TemplateLiteral = 134217728,
2483 StringMapping = 268435456,
2484 Literal = 2944,
2485 Unit = 109440,
2486 StringOrNumberLiteral = 384,
2487 PossiblyFalsy = 117724,
2488 StringLike = 402653316,
2489 NumberLike = 296,
2490 BigIntLike = 2112,
2491 BooleanLike = 528,
2492 EnumLike = 1056,
2493 ESSymbolLike = 12288,
2494 VoidLike = 49152,
2495 UnionOrIntersection = 3145728,
2496 StructuredType = 3670016,
2497 TypeVariable = 8650752,
2498 InstantiableNonPrimitive = 58982400,
2499 InstantiablePrimitive = 406847488,
2500 Instantiable = 465829888,
2501 StructuredOrInstantiable = 469499904,
2502 Narrowable = 536624127,
2503 }
2504 export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression;
2505 export interface Type {
2506 flags: TypeFlags;
2507 symbol: Symbol;
2508 pattern?: DestructuringPattern;
2509 aliasSymbol?: Symbol;
2510 aliasTypeArguments?: readonly Type[];
2511 }
2512 export interface LiteralType extends Type {
2513 value: string | number | PseudoBigInt;
2514 freshType: LiteralType;
2515 regularType: LiteralType;
2516 }
2517 export interface UniqueESSymbolType extends Type {
2518 symbol: Symbol;
2519 escapedName: __String;
2520 }
2521 export interface StringLiteralType extends LiteralType {
2522 value: string;
2523 }
2524 export interface NumberLiteralType extends LiteralType {
2525 value: number;
2526 }
2527 export interface BigIntLiteralType extends LiteralType {
2528 value: PseudoBigInt;
2529 }
2530 export interface EnumType extends Type {
2531 }
2532 export enum ObjectFlags {
2533 Class = 1,
2534 Interface = 2,
2535 Reference = 4,
2536 Tuple = 8,
2537 Anonymous = 16,
2538 Mapped = 32,
2539 Instantiated = 64,
2540 ObjectLiteral = 128,
2541 EvolvingArray = 256,
2542 ObjectLiteralPatternWithComputedProperties = 512,
2543 ContainsSpread = 1024,
2544 ReverseMapped = 2048,
2545 JsxAttributes = 4096,
2546 MarkerType = 8192,
2547 JSLiteral = 16384,
2548 FreshLiteral = 32768,
2549 ArrayLiteral = 65536,
2550 ObjectRestType = 131072,
2551 ClassOrInterface = 3,
2552 }
2553 export interface ObjectType extends Type {
2554 objectFlags: ObjectFlags;
2555 }
2556 /** Class and interface types (ObjectFlags.Class and ObjectFlags.Interface). */
2557 export interface InterfaceType extends ObjectType {
2558 typeParameters: TypeParameter[] | undefined;
2559 outerTypeParameters: TypeParameter[] | undefined;
2560 localTypeParameters: TypeParameter[] | undefined;
2561 thisType: TypeParameter | undefined;
2562 }
2563 export type BaseType = ObjectType | IntersectionType | TypeVariable;
2564 export interface InterfaceTypeWithDeclaredMembers extends InterfaceType {
2565 declaredProperties: Symbol[];
2566 declaredCallSignatures: Signature[];
2567 declaredConstructSignatures: Signature[];
2568 declaredStringIndexInfo?: IndexInfo;
2569 declaredNumberIndexInfo?: IndexInfo;
2570 }
2571 /**
2572 * Type references (ObjectFlags.Reference). When a class or interface has type parameters or
2573 * a "this" type, references to the class or interface are made using type references. The
2574 * typeArguments property specifies the types to substitute for the type parameters of the
2575 * class or interface and optionally includes an extra element that specifies the type to
2576 * substitute for "this" in the resulting instantiation. When no extra argument is present,
2577 * the type reference itself is substituted for "this". The typeArguments property is undefined
2578 * if the class or interface has no type parameters and the reference isn't specifying an
2579 * explicit "this" argument.
2580 */
2581 export interface TypeReference extends ObjectType {
2582 target: GenericType;
2583 node?: TypeReferenceNode | ArrayTypeNode | TupleTypeNode;
2584 }
2585 export interface DeferredTypeReference extends TypeReference {
2586 }
2587 export interface GenericType extends InterfaceType, TypeReference {
2588 }
2589 export enum ElementFlags {
2590 Required = 1,
2591 Optional = 2,
2592 Rest = 4,
2593 Variadic = 8,
2594 Fixed = 3,
2595 Variable = 12,
2596 NonRequired = 14,
2597 NonRest = 11
2598 }
2599 export interface TupleType extends GenericType {
2600 elementFlags: readonly ElementFlags[];
2601 minLength: number;
2602 fixedLength: number;
2603 hasRestElement: boolean;
2604 combinedFlags: ElementFlags;
2605 readonly: boolean;
2606 labeledElementDeclarations?: readonly (NamedTupleMember | ParameterDeclaration)[];
2607 }
2608 export interface TupleTypeReference extends TypeReference {
2609 target: TupleType;
2610 }
2611 export interface UnionOrIntersectionType extends Type {
2612 types: Type[];
2613 }
2614 export interface UnionType extends UnionOrIntersectionType {
2615 }
2616 export interface IntersectionType extends UnionOrIntersectionType {
2617 }
2618 export type StructuredType = ObjectType | UnionType | IntersectionType;
2619 export interface EvolvingArrayType extends ObjectType {
2620 elementType: Type;
2621 finalArrayType?: Type;
2622 }
2623 export interface InstantiableType extends Type {
2624 }
2625 export interface TypeParameter extends InstantiableType {
2626 }
2627 export interface IndexedAccessType extends InstantiableType {
2628 objectType: Type;
2629 indexType: Type;
2630 constraint?: Type;
2631 simplifiedForReading?: Type;
2632 simplifiedForWriting?: Type;
2633 }
2634 export type TypeVariable = TypeParameter | IndexedAccessType;
2635 export interface IndexType extends InstantiableType {
2636 type: InstantiableType | UnionOrIntersectionType;
2637 }
2638 export interface ConditionalRoot {
2639 node: ConditionalTypeNode;
2640 checkType: Type;
2641 extendsType: Type;
2642 isDistributive: boolean;
2643 inferTypeParameters?: TypeParameter[];
2644 outerTypeParameters?: TypeParameter[];
2645 instantiations?: Map<Type>;
2646 aliasSymbol?: Symbol;
2647 aliasTypeArguments?: Type[];
2648 }
2649 export interface ConditionalType extends InstantiableType {
2650 root: ConditionalRoot;
2651 checkType: Type;
2652 extendsType: Type;
2653 resolvedTrueType: Type;
2654 resolvedFalseType: Type;
2655 }
2656 export interface TemplateLiteralType extends InstantiableType {
2657 texts: readonly string[];
2658 types: readonly Type[];
2659 }
2660 export interface StringMappingType extends InstantiableType {
2661 symbol: Symbol;
2662 type: Type;
2663 }
2664 export interface SubstitutionType extends InstantiableType {
2665 baseType: Type;
2666 substitute: Type;
2667 }
2668 export enum SignatureKind {
2669 Call = 0,
2670 Construct = 1
2671 }
2672 export interface Signature {
2673 declaration?: SignatureDeclaration | JSDocSignature;
2674 typeParameters?: readonly TypeParameter[];
2675 parameters: readonly Symbol[];
2676 }
2677 export enum IndexKind {
2678 String = 0,
2679 Number = 1
2680 }
2681 export interface IndexInfo {
2682 type: Type;
2683 isReadonly: boolean;
2684 declaration?: IndexSignatureDeclaration;
2685 }
2686 export enum InferencePriority {
2687 NakedTypeVariable = 1,
2688 SpeculativeTuple = 2,
2689 HomomorphicMappedType = 4,
2690 PartialHomomorphicMappedType = 8,
2691 MappedTypeConstraint = 16,
2692 ContravariantConditional = 32,
2693 ReturnType = 64,
2694 LiteralKeyof = 128,
2695 NoConstraints = 256,
2696 AlwaysStrict = 512,
2697 MaxValue = 1024,
2698 PriorityImpliesCombination = 208,
2699 Circularity = -1
2700 }
2701 /** @deprecated Use FileExtensionInfo instead. */
2702 export type JsFileExtensionInfo = FileExtensionInfo;
2703 export interface FileExtensionInfo {
2704 extension: string;
2705 isMixedContent: boolean;
2706 scriptKind?: ScriptKind;
2707 }
2708 export interface DiagnosticMessage {
2709 key: string;
2710 category: DiagnosticCategory;
2711 code: number;
2712 message: string;
2713 reportsUnnecessary?: {};
2714 reportsDeprecated?: {};
2715 }
2716 /**
2717 * A linked list of formatted diagnostic messages to be used as part of a multiline message.
2718 * It is built from the bottom up, leaving the head to be the "main" diagnostic.
2719 * While it seems that DiagnosticMessageChain is structurally similar to DiagnosticMessage,
2720 * the difference is that messages are all preformatted in DMC.
2721 */
2722 export interface DiagnosticMessageChain {
2723 messageText: string;
2724 category: DiagnosticCategory;
2725 code: number;
2726 next?: DiagnosticMessageChain[];
2727 }
2728 export interface Diagnostic extends DiagnosticRelatedInformation {
2729 /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
2730 reportsUnnecessary?: {};
2731 reportsDeprecated?: {};
2732 source?: string;
2733 relatedInformation?: DiagnosticRelatedInformation[];
2734 }
2735 export interface DiagnosticRelatedInformation {
2736 category: DiagnosticCategory;
2737 code: number;
2738 file: SourceFile | undefined;
2739 start: number | undefined;
2740 length: number | undefined;
2741 messageText: string | DiagnosticMessageChain;
2742 }
2743 export interface DiagnosticWithLocation extends Diagnostic {
2744 file: SourceFile;
2745 start: number;
2746 length: number;
2747 }
2748 export enum DiagnosticCategory {
2749 Warning = 0,
2750 Error = 1,
2751 Suggestion = 2,
2752 Message = 3
2753 }
2754 export enum ModuleResolutionKind {
2755 Classic = 1,
2756 NodeJs = 2
2757 }
2758 export interface PluginImport {
2759 name: string;
2760 }
2761 export interface ProjectReference {
2762 /** A normalized path on disk */
2763 path: string;
2764 /** The path as the user originally wrote it */
2765 originalPath?: string;
2766 /** True if the output of this reference should be prepended to the output of this project. Only valid for --outFile compilations */
2767 prepend?: boolean;
2768 /** True if it is intended that this reference form a circularity */
2769 circular?: boolean;
2770 }
2771 export enum WatchFileKind {
2772 FixedPollingInterval = 0,
2773 PriorityPollingInterval = 1,
2774 DynamicPriorityPolling = 2,
2775 UseFsEvents = 3,
2776 UseFsEventsOnParentDirectory = 4
2777 }
2778 export enum WatchDirectoryKind {
2779 UseFsEvents = 0,
2780 FixedPollingInterval = 1,
2781 DynamicPriorityPolling = 2
2782 }
2783 export enum PollingWatchKind {
2784 FixedInterval = 0,
2785 PriorityInterval = 1,
2786 DynamicPriority = 2
2787 }
2788 export type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | PluginImport[] | ProjectReference[] | null | undefined;
2789 export interface CompilerOptions {
2790 allowJs?: boolean;
2791 allowSyntheticDefaultImports?: boolean;
2792 allowUmdGlobalAccess?: boolean;
2793 allowUnreachableCode?: boolean;
2794 allowUnusedLabels?: boolean;
2795 alwaysStrict?: boolean;
2796 baseUrl?: string;
2797 charset?: string;
2798 checkJs?: boolean;
2799 declaration?: boolean;
2800 declarationMap?: boolean;
2801 emitDeclarationOnly?: boolean;
2802 declarationDir?: string;
2803 disableSizeLimit?: boolean;
2804 disableSourceOfProjectReferenceRedirect?: boolean;
2805 disableSolutionSearching?: boolean;
2806 disableReferencedProjectLoad?: boolean;
2807 downlevelIteration?: boolean;
2808 emitBOM?: boolean;
2809 emitDecoratorMetadata?: boolean;
2810 experimentalDecorators?: boolean;
2811 forceConsistentCasingInFileNames?: boolean;
2812 importHelpers?: boolean;
2813 importsNotUsedAsValues?: ImportsNotUsedAsValues;
2814 inlineSourceMap?: boolean;
2815 inlineSources?: boolean;
2816 isolatedModules?: boolean;
2817 jsx?: JsxEmit;
2818 keyofStringsOnly?: boolean;
2819 lib?: string[];
2820 locale?: string;
2821 mapRoot?: string;
2822 maxNodeModuleJsDepth?: number;
2823 module?: ModuleKind;
2824 moduleResolution?: ModuleResolutionKind;
2825 newLine?: NewLineKind;
2826 noEmit?: boolean;
2827 noEmitHelpers?: boolean;
2828 noEmitOnError?: boolean;
2829 noErrorTruncation?: boolean;
2830 noFallthroughCasesInSwitch?: boolean;
2831 noImplicitAny?: boolean;
2832 noImplicitReturns?: boolean;
2833 noImplicitThis?: boolean;
2834 noStrictGenericChecks?: boolean;
2835 noUnusedLocals?: boolean;
2836 noUnusedParameters?: boolean;
2837 noImplicitUseStrict?: boolean;
2838 noPropertyAccessFromIndexSignature?: boolean;
2839 assumeChangesOnlyAffectDirectDependencies?: boolean;
2840 noLib?: boolean;
2841 noResolve?: boolean;
2842 noUncheckedIndexedAccess?: boolean;
2843 out?: string;
2844 outDir?: string;
2845 outFile?: string;
2846 paths?: MapLike<string[]>;
2847 preserveConstEnums?: boolean;
2848 preserveSymlinks?: boolean;
2849 project?: string;
2850 reactNamespace?: string;
2851 jsxFactory?: string;
2852 jsxFragmentFactory?: string;
2853 jsxImportSource?: string;
2854 composite?: boolean;
2855 incremental?: boolean;
2856 tsBuildInfoFile?: string;
2857 removeComments?: boolean;
2858 rootDir?: string;
2859 rootDirs?: string[];
2860 skipLibCheck?: boolean;
2861 skipDefaultLibCheck?: boolean;
2862 sourceMap?: boolean;
2863 sourceRoot?: string;
2864 strict?: boolean;
2865 strictFunctionTypes?: boolean;
2866 strictBindCallApply?: boolean;
2867 strictNullChecks?: boolean;
2868 strictPropertyInitialization?: boolean;
2869 stripInternal?: boolean;
2870 suppressExcessPropertyErrors?: boolean;
2871 suppressImplicitAnyIndexErrors?: boolean;
2872 target?: ScriptTarget;
2873 traceResolution?: boolean;
2874 resolveJsonModule?: boolean;
2875 types?: string[];
2876 /** Paths used to compute primary types search locations */
2877 typeRoots?: string[];
2878 esModuleInterop?: boolean;
2879 useDefineForClassFields?: boolean;
2880 [option: string]: CompilerOptionsValue | TsConfigSourceFile | undefined;
2881 }
2882 export interface WatchOptions {
2883 watchFile?: WatchFileKind;
2884 watchDirectory?: WatchDirectoryKind;
2885 fallbackPolling?: PollingWatchKind;
2886 synchronousWatchDirectory?: boolean;
2887 excludeDirectories?: string[];
2888 excludeFiles?: string[];
2889 [option: string]: CompilerOptionsValue | undefined;
2890 }
2891 export interface TypeAcquisition {
2892 /**
2893 * @deprecated typingOptions.enableAutoDiscovery
2894 * Use typeAcquisition.enable instead.
2895 */
2896 enableAutoDiscovery?: boolean;
2897 enable?: boolean;
2898 include?: string[];
2899 exclude?: string[];
2900 disableFilenameBasedTypeAcquisition?: boolean;
2901 [option: string]: CompilerOptionsValue | undefined;
2902 }
2903 export enum ModuleKind {
2904 None = 0,
2905 CommonJS = 1,
2906 AMD = 2,
2907 UMD = 3,
2908 System = 4,
2909 ES2015 = 5,
2910 ES2020 = 6,
2911 ESNext = 99
2912 }
2913 export enum JsxEmit {
2914 None = 0,
2915 Preserve = 1,
2916 React = 2,
2917 ReactNative = 3,
2918 ReactJSX = 4,
2919 ReactJSXDev = 5
2920 }
2921 export enum ImportsNotUsedAsValues {
2922 Remove = 0,
2923 Preserve = 1,
2924 Error = 2
2925 }
2926 export enum NewLineKind {
2927 CarriageReturnLineFeed = 0,
2928 LineFeed = 1
2929 }
2930 export interface LineAndCharacter {
2931 /** 0-based. */
2932 line: number;
2933 character: number;
2934 }
2935 export enum ScriptKind {
2936 Unknown = 0,
2937 JS = 1,
2938 JSX = 2,
2939 TS = 3,
2940 TSX = 4,
2941 External = 5,
2942 JSON = 6,
2943 /**
2944 * Used on extensions that doesn't define the ScriptKind but the content defines it.
2945 * Deferred extensions are going to be included in all project contexts.
2946 */
2947 Deferred = 7
2948 }
2949 export enum ScriptTarget {
2950 ES3 = 0,
2951 ES5 = 1,
2952 ES2015 = 2,
2953 ES2016 = 3,
2954 ES2017 = 4,
2955 ES2018 = 5,
2956 ES2019 = 6,
2957 ES2020 = 7,
2958 ESNext = 99,
2959 JSON = 100,
2960 Latest = 99
2961 }
2962 export enum LanguageVariant {
2963 Standard = 0,
2964 JSX = 1
2965 }
2966 /** Either a parsed command line or a parsed tsconfig.json */
2967 export interface ParsedCommandLine {
2968 options: CompilerOptions;
2969 typeAcquisition?: TypeAcquisition;
2970 fileNames: string[];
2971 projectReferences?: readonly ProjectReference[];
2972 watchOptions?: WatchOptions;
2973 raw?: any;
2974 errors: Diagnostic[];
2975 wildcardDirectories?: MapLike<WatchDirectoryFlags>;
2976 compileOnSave?: boolean;
2977 }
2978 export enum WatchDirectoryFlags {
2979 None = 0,
2980 Recursive = 1
2981 }
2982 export interface CreateProgramOptions {
2983 rootNames: readonly string[];
2984 options: CompilerOptions;
2985 projectReferences?: readonly ProjectReference[];
2986 host?: CompilerHost;
2987 oldProgram?: Program;
2988 configFileParsingDiagnostics?: readonly Diagnostic[];
2989 }
2990 export interface ModuleResolutionHost {
2991 fileExists(fileName: string): boolean;
2992 readFile(fileName: string): string | undefined;
2993 trace?(s: string): void;
2994 directoryExists?(directoryName: string): boolean;
2995 /**
2996 * Resolve a symbolic link.
2997 * @see https://nodejs.org/api/fs.html#fs_fs_realpathsync_path_options
2998 */
2999 realpath?(path: string): string;
3000 getCurrentDirectory?(): string;
3001 getDirectories?(path: string): string[];
3002 }
3003 /**
3004 * Represents the result of module resolution.
3005 * Module resolution will pick up tsx/jsx/js files even if '--jsx' and '--allowJs' are turned off.
3006 * The Program will then filter results based on these flags.
3007 *
3008 * Prefer to return a `ResolvedModuleFull` so that the file type does not have to be inferred.
3009 */
3010 export interface ResolvedModule {
3011 /** Path of the file the module was resolved to. */
3012 resolvedFileName: string;
3013 /** True if `resolvedFileName` comes from `node_modules`. */
3014 isExternalLibraryImport?: boolean;
3015 }
3016 /**
3017 * ResolvedModule with an explicitly provided `extension` property.
3018 * Prefer this over `ResolvedModule`.
3019 * If changing this, remember to change `moduleResolutionIsEqualTo`.
3020 */
3021 export interface ResolvedModuleFull extends ResolvedModule {
3022 /**
3023 * Extension of resolvedFileName. This must match what's at the end of resolvedFileName.
3024 * This is optional for backwards-compatibility, but will be added if not provided.
3025 */
3026 extension: Extension;
3027 packageId?: PackageId;
3028 }
3029 /**
3030 * Unique identifier with a package name and version.
3031 * If changing this, remember to change `packageIdIsEqual`.
3032 */
3033 export interface PackageId {
3034 /**
3035 * Name of the package.
3036 * Should not include `@types`.
3037 * If accessing a non-index file, this should include its name e.g. "foo/bar".
3038 */
3039 name: string;
3040 /**
3041 * Name of a submodule within this package.
3042 * May be "".
3043 */
3044 subModuleName: string;
3045 /** Version of the package, e.g. "1.2.3" */
3046 version: string;
3047 }
3048 export enum Extension {
3049 Ts = ".ts",
3050 Tsx = ".tsx",
3051 Dts = ".d.ts",
3052 Js = ".js",
3053 Jsx = ".jsx",
3054 Json = ".json",
3055 TsBuildInfo = ".tsbuildinfo"
3056 }
3057 export interface ResolvedModuleWithFailedLookupLocations {
3058 readonly resolvedModule: ResolvedModuleFull | undefined;
3059 }
3060 export interface ResolvedTypeReferenceDirective {
3061 primary: boolean;
3062 resolvedFileName: string | undefined;
3063 packageId?: PackageId;
3064 /** True if `resolvedFileName` comes from `node_modules`. */
3065 isExternalLibraryImport?: boolean;
3066 }
3067 export interface ResolvedTypeReferenceDirectiveWithFailedLookupLocations {
3068 readonly resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective | undefined;
3069 readonly failedLookupLocations: string[];
3070 }
3071 export interface CompilerHost extends ModuleResolutionHost {
3072 getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): SourceFile | undefined;
3073 getSourceFileByPath?(fileName: string, path: Path, languageVersion: ScriptTarget, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): SourceFile | undefined;
3074 getCancellationToken?(): CancellationToken;
3075 getDefaultLibFileName(options: CompilerOptions): string;
3076 getDefaultLibLocation?(): string;
3077 writeFile: WriteFileCallback;
3078 getCurrentDirectory(): string;
3079 getCanonicalFileName(fileName: string): string;
3080 useCaseSensitiveFileNames(): boolean;
3081 getNewLine(): string;
3082 readDirectory?(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number): string[];
3083 resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedModule | undefined)[];
3084 /**
3085 * This method is a companion for 'resolveModuleNames' and is used to resolve 'types' references to actual type declaration files
3086 */
3087 resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
3088 getEnvironmentVariable?(name: string): string | undefined;
3089 createHash?(data: string): string;
3090 getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
3091 }
3092 export interface SourceMapRange extends TextRange {
3093 source?: SourceMapSource;
3094 }
3095 export interface SourceMapSource {
3096 fileName: string;
3097 text: string;
3098 skipTrivia?: (pos: number) => number;
3099 }
3100 export enum EmitFlags {
3101 None = 0,
3102 SingleLine = 1,
3103 AdviseOnEmitNode = 2,
3104 NoSubstitution = 4,
3105 CapturesThis = 8,
3106 NoLeadingSourceMap = 16,
3107 NoTrailingSourceMap = 32,
3108 NoSourceMap = 48,
3109 NoNestedSourceMaps = 64,
3110 NoTokenLeadingSourceMaps = 128,
3111 NoTokenTrailingSourceMaps = 256,
3112 NoTokenSourceMaps = 384,
3113 NoLeadingComments = 512,
3114 NoTrailingComments = 1024,
3115 NoComments = 1536,
3116 NoNestedComments = 2048,
3117 HelperName = 4096,
3118 ExportName = 8192,
3119 LocalName = 16384,
3120 InternalName = 32768,
3121 Indented = 65536,
3122 NoIndentation = 131072,
3123 AsyncFunctionBody = 262144,
3124 ReuseTempVariableScope = 524288,
3125 CustomPrologue = 1048576,
3126 NoHoisting = 2097152,
3127 HasEndOfDeclarationMarker = 4194304,
3128 Iterator = 8388608,
3129 NoAsciiEscaping = 16777216,
3130 }
3131 export interface EmitHelper {
3132 readonly name: string;
3133 readonly scoped: boolean;
3134 readonly text: string | ((node: EmitHelperUniqueNameCallback) => string);
3135 readonly priority?: number;
3136 readonly dependencies?: EmitHelper[];
3137 }
3138 export interface UnscopedEmitHelper extends EmitHelper {
3139 readonly scoped: false;
3140 readonly text: string;
3141 }
3142 export type EmitHelperUniqueNameCallback = (name: string) => string;
3143 export enum EmitHint {
3144 SourceFile = 0,
3145 Expression = 1,
3146 IdentifierName = 2,
3147 MappedTypeParameter = 3,
3148 Unspecified = 4,
3149 EmbeddedStatement = 5,
3150 JsxAttributeValue = 6
3151 }
3152 export enum OuterExpressionKinds {
3153 Parentheses = 1,
3154 TypeAssertions = 2,
3155 NonNullAssertions = 4,
3156 PartiallyEmittedExpressions = 8,
3157 Assertions = 6,
3158 All = 15
3159 }
3160 export type TypeOfTag = "undefined" | "number" | "bigint" | "boolean" | "string" | "symbol" | "object" | "function";
3161 export interface NodeFactory {
3162 createNodeArray<T extends Node>(elements?: readonly T[], hasTrailingComma?: boolean): NodeArray<T>;
3163 createNumericLiteral(value: string | number, numericLiteralFlags?: TokenFlags): NumericLiteral;
3164 createBigIntLiteral(value: string | PseudoBigInt): BigIntLiteral;
3165 createStringLiteral(text: string, isSingleQuote?: boolean): StringLiteral;
3166 createStringLiteralFromNode(sourceNode: PropertyNameLiteral, isSingleQuote?: boolean): StringLiteral;
3167 createRegularExpressionLiteral(text: string): RegularExpressionLiteral;
3168 createIdentifier(text: string): Identifier;
3169 /** Create a unique temporary variable. */
3170 createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined): Identifier;
3171 /** Create a unique temporary variable for use in a loop. */
3172 createLoopVariable(): Identifier;
3173 /** Create a unique name based on the supplied text. */
3174 createUniqueName(text: string, flags?: GeneratedIdentifierFlags): Identifier;
3175 /** Create a unique name generated for a node. */
3176 getGeneratedNameForNode(node: Node | undefined): Identifier;
3177 createPrivateIdentifier(text: string): PrivateIdentifier;
3178 createToken(token: SyntaxKind.SuperKeyword): SuperExpression;
3179 createToken(token: SyntaxKind.ThisKeyword): ThisExpression;
3180 createToken(token: SyntaxKind.NullKeyword): NullLiteral;
3181 createToken(token: SyntaxKind.TrueKeyword): TrueLiteral;
3182 createToken(token: SyntaxKind.FalseKeyword): FalseLiteral;
3183 createToken<TKind extends PunctuationSyntaxKind>(token: TKind): PunctuationToken<TKind>;
3184 createToken<TKind extends KeywordTypeSyntaxKind>(token: TKind): KeywordTypeNode<TKind>;
3185 createToken<TKind extends ModifierSyntaxKind>(token: TKind): ModifierToken<TKind>;
3186 createToken<TKind extends KeywordSyntaxKind>(token: TKind): KeywordToken<TKind>;
3187 createToken<TKind extends SyntaxKind.Unknown | SyntaxKind.EndOfFileToken>(token: TKind): Token<TKind>;
3188 createSuper(): SuperExpression;
3189 createThis(): ThisExpression;
3190 createNull(): NullLiteral;
3191 createTrue(): TrueLiteral;
3192 createFalse(): FalseLiteral;
3193 createModifier<T extends ModifierSyntaxKind>(kind: T): ModifierToken<T>;
3194 createModifiersFromModifierFlags(flags: ModifierFlags): Modifier[];
3195 createQualifiedName(left: EntityName, right: string | Identifier): QualifiedName;
3196 updateQualifiedName(node: QualifiedName, left: EntityName, right: Identifier): QualifiedName;
3197 createComputedPropertyName(expression: Expression): ComputedPropertyName;
3198 updateComputedPropertyName(node: ComputedPropertyName, expression: Expression): ComputedPropertyName;
3199 createTypeParameterDeclaration(name: string | Identifier, constraint?: TypeNode, defaultType?: TypeNode): TypeParameterDeclaration;
3200 updateTypeParameterDeclaration(node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration;
3201 createParameterDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken?: QuestionToken, type?: TypeNode, initializer?: Expression): ParameterDeclaration;
3202 updateParameterDeclaration(node: ParameterDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): ParameterDeclaration;
3203 createDecorator(expression: Expression): Decorator;
3204 updateDecorator(node: Decorator, expression: Expression): Decorator;
3205 createPropertySignature(modifiers: readonly Modifier[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature;
3206 updatePropertySignature(node: PropertySignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature;
3207 createPropertyDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
3208 updatePropertyDeclaration(node: PropertyDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
3209 createMethodSignature(modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): MethodSignature;
3210 updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): MethodSignature;
3211 createMethodDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
3212 updateMethodDeclaration(node: MethodDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
3213 createConstructorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
3214 updateConstructorDeclaration(node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
3215 createGetAccessorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
3216 updateGetAccessorDeclaration(node: GetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
3217 createSetAccessorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration;
3218 updateSetAccessorDeclaration(node: SetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration;
3219 createCallSignature(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): CallSignatureDeclaration;
3220 updateCallSignature(node: CallSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): CallSignatureDeclaration;
3221 createConstructSignature(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): ConstructSignatureDeclaration;
3222 updateConstructSignature(node: ConstructSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): ConstructSignatureDeclaration;
3223 createIndexSignature(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration;
3224 updateIndexSignature(node: IndexSignatureDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration;
3225 createTemplateLiteralTypeSpan(type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan;
3226 updateTemplateLiteralTypeSpan(node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan;
3227 createKeywordTypeNode<TKind extends KeywordTypeSyntaxKind>(kind: TKind): KeywordTypeNode<TKind>;
3228 createTypePredicateNode(assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode | string, type: TypeNode | undefined): TypePredicateNode;
3229 updateTypePredicateNode(node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined): TypePredicateNode;
3230 createTypeReferenceNode(typeName: string | EntityName, typeArguments?: readonly TypeNode[]): TypeReferenceNode;
3231 updateTypeReferenceNode(node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray<TypeNode> | undefined): TypeReferenceNode;
3232 createFunctionTypeNode(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): FunctionTypeNode;
3233 updateFunctionTypeNode(node: FunctionTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode): FunctionTypeNode;
3234 createConstructorTypeNode(modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode;
3235 /** @deprecated */
3236 createConstructorTypeNode(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode;
3237 updateConstructorTypeNode(node: ConstructorTypeNode, modifiers: readonly Modifier[] | undefined, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode): ConstructorTypeNode;
3238 /** @deprecated */
3239 updateConstructorTypeNode(node: ConstructorTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode): ConstructorTypeNode;
3240 createTypeQueryNode(exprName: EntityName): TypeQueryNode;
3241 updateTypeQueryNode(node: TypeQueryNode, exprName: EntityName): TypeQueryNode;
3242 createTypeLiteralNode(members: readonly TypeElement[] | undefined): TypeLiteralNode;
3243 updateTypeLiteralNode(node: TypeLiteralNode, members: NodeArray<TypeElement>): TypeLiteralNode;
3244 createArrayTypeNode(elementType: TypeNode): ArrayTypeNode;
3245 updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode;
3246 createTupleTypeNode(elements: readonly (TypeNode | NamedTupleMember)[]): TupleTypeNode;
3247 updateTupleTypeNode(node: TupleTypeNode, elements: readonly (TypeNode | NamedTupleMember)[]): TupleTypeNode;
3248 createNamedTupleMember(dotDotDotToken: DotDotDotToken | undefined, name: Identifier, questionToken: QuestionToken | undefined, type: TypeNode): NamedTupleMember;
3249 updateNamedTupleMember(node: NamedTupleMember, dotDotDotToken: DotDotDotToken | undefined, name: Identifier, questionToken: QuestionToken | undefined, type: TypeNode): NamedTupleMember;
3250 createOptionalTypeNode(type: TypeNode): OptionalTypeNode;
3251 updateOptionalTypeNode(node: OptionalTypeNode, type: TypeNode): OptionalTypeNode;
3252 createRestTypeNode(type: TypeNode): RestTypeNode;
3253 updateRestTypeNode(node: RestTypeNode, type: TypeNode): RestTypeNode;
3254 createUnionTypeNode(types: readonly TypeNode[]): UnionTypeNode;
3255 updateUnionTypeNode(node: UnionTypeNode, types: NodeArray<TypeNode>): UnionTypeNode;
3256 createIntersectionTypeNode(types: readonly TypeNode[]): IntersectionTypeNode;
3257 updateIntersectionTypeNode(node: IntersectionTypeNode, types: NodeArray<TypeNode>): IntersectionTypeNode;
3258 createConditionalTypeNode(checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode;
3259 updateConditionalTypeNode(node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode;
3260 createInferTypeNode(typeParameter: TypeParameterDeclaration): InferTypeNode;
3261 updateInferTypeNode(node: InferTypeNode, typeParameter: TypeParameterDeclaration): InferTypeNode;
3262 createImportTypeNode(argument: TypeNode, qualifier?: EntityName, typeArguments?: readonly TypeNode[], isTypeOf?: boolean): ImportTypeNode;
3263 updateImportTypeNode(node: ImportTypeNode, argument: TypeNode, qualifier: EntityName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf?: boolean): ImportTypeNode;
3264 createParenthesizedType(type: TypeNode): ParenthesizedTypeNode;
3265 updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode;
3266 createThisTypeNode(): ThisTypeNode;
3267 createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode;
3268 updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode;
3269 createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode;
3270 updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode;
3271 createMappedTypeNode(readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode;
3272 updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode;
3273 createLiteralTypeNode(literal: LiteralTypeNode["literal"]): LiteralTypeNode;
3274 updateLiteralTypeNode(node: LiteralTypeNode, literal: LiteralTypeNode["literal"]): LiteralTypeNode;
3275 createTemplateLiteralType(head: TemplateHead, templateSpans: readonly TemplateLiteralTypeSpan[]): TemplateLiteralTypeNode;
3276 updateTemplateLiteralType(node: TemplateLiteralTypeNode, head: TemplateHead, templateSpans: readonly TemplateLiteralTypeSpan[]): TemplateLiteralTypeNode;
3277 createObjectBindingPattern(elements: readonly BindingElement[]): ObjectBindingPattern;
3278 updateObjectBindingPattern(node: ObjectBindingPattern, elements: readonly BindingElement[]): ObjectBindingPattern;
3279 createArrayBindingPattern(elements: readonly ArrayBindingElement[]): ArrayBindingPattern;
3280 updateArrayBindingPattern(node: ArrayBindingPattern, elements: readonly ArrayBindingElement[]): ArrayBindingPattern;
3281 createBindingElement(dotDotDotToken: DotDotDotToken | undefined, propertyName: string | PropertyName | undefined, name: string | BindingName, initializer?: Expression): BindingElement;
3282 updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken | undefined, propertyName: PropertyName | undefined, name: BindingName, initializer: Expression | undefined): BindingElement;
3283 createArrayLiteralExpression(elements?: readonly Expression[], multiLine?: boolean): ArrayLiteralExpression;
3284 updateArrayLiteralExpression(node: ArrayLiteralExpression, elements: readonly Expression[]): ArrayLiteralExpression;
3285 createObjectLiteralExpression(properties?: readonly ObjectLiteralElementLike[], multiLine?: boolean): ObjectLiteralExpression;
3286 updateObjectLiteralExpression(node: ObjectLiteralExpression, properties: readonly ObjectLiteralElementLike[]): ObjectLiteralExpression;
3287 createPropertyAccessExpression(expression: Expression, name: string | Identifier | PrivateIdentifier): PropertyAccessExpression;
3288 updatePropertyAccessExpression(node: PropertyAccessExpression, expression: Expression, name: Identifier | PrivateIdentifier): PropertyAccessExpression;
3289 createPropertyAccessChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, name: string | Identifier | PrivateIdentifier): PropertyAccessChain;
3290 updatePropertyAccessChain(node: PropertyAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, name: Identifier | PrivateIdentifier): PropertyAccessChain;
3291 createElementAccessExpression(expression: Expression, index: number | Expression): ElementAccessExpression;
3292 updateElementAccessExpression(node: ElementAccessExpression, expression: Expression, argumentExpression: Expression): ElementAccessExpression;
3293 createElementAccessChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, index: number | Expression): ElementAccessChain;
3294 updateElementAccessChain(node: ElementAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, argumentExpression: Expression): ElementAccessChain;
3295 createCallExpression(expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): CallExpression;
3296 updateCallExpression(node: CallExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]): CallExpression;
3297 createCallChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): CallChain;
3298 updateCallChain(node: CallChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]): CallChain;
3299 createNewExpression(expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): NewExpression;
3300 updateNewExpression(node: NewExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): NewExpression;
3301 createTaggedTemplateExpression(tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression;
3302 updateTaggedTemplateExpression(node: TaggedTemplateExpression, tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression;
3303 createTypeAssertion(type: TypeNode, expression: Expression): TypeAssertion;
3304 updateTypeAssertion(node: TypeAssertion, type: TypeNode, expression: Expression): TypeAssertion;
3305 createParenthesizedExpression(expression: Expression): ParenthesizedExpression;
3306 updateParenthesizedExpression(node: ParenthesizedExpression, expression: Expression): ParenthesizedExpression;
3307 createFunctionExpression(modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[] | undefined, type: TypeNode | undefined, body: Block): FunctionExpression;
3308 updateFunctionExpression(node: FunctionExpression, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block): FunctionExpression;
3309 createArrowFunction(modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction;
3310 updateArrowFunction(node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken, body: ConciseBody): ArrowFunction;
3311 createDeleteExpression(expression: Expression): DeleteExpression;
3312 updateDeleteExpression(node: DeleteExpression, expression: Expression): DeleteExpression;
3313 createTypeOfExpression(expression: Expression): TypeOfExpression;
3314 updateTypeOfExpression(node: TypeOfExpression, expression: Expression): TypeOfExpression;
3315 createVoidExpression(expression: Expression): VoidExpression;
3316 updateVoidExpression(node: VoidExpression, expression: Expression): VoidExpression;
3317 createAwaitExpression(expression: Expression): AwaitExpression;
3318 updateAwaitExpression(node: AwaitExpression, expression: Expression): AwaitExpression;
3319 createPrefixUnaryExpression(operator: PrefixUnaryOperator, operand: Expression): PrefixUnaryExpression;
3320 updatePrefixUnaryExpression(node: PrefixUnaryExpression, operand: Expression): PrefixUnaryExpression;
3321 createPostfixUnaryExpression(operand: Expression, operator: PostfixUnaryOperator): PostfixUnaryExpression;
3322 updatePostfixUnaryExpression(node: PostfixUnaryExpression, operand: Expression): PostfixUnaryExpression;
3323 createBinaryExpression(left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression): BinaryExpression;
3324 updateBinaryExpression(node: BinaryExpression, left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression): BinaryExpression;
3325 createConditionalExpression(condition: Expression, questionToken: QuestionToken | undefined, whenTrue: Expression, colonToken: ColonToken | undefined, whenFalse: Expression): ConditionalExpression;
3326 updateConditionalExpression(node: ConditionalExpression, condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression;
3327 createTemplateExpression(head: TemplateHead, templateSpans: readonly TemplateSpan[]): TemplateExpression;
3328 updateTemplateExpression(node: TemplateExpression, head: TemplateHead, templateSpans: readonly TemplateSpan[]): TemplateExpression;
3329 createTemplateHead(text: string, rawText?: string, templateFlags?: TokenFlags): TemplateHead;
3330 createTemplateHead(text: string | undefined, rawText: string, templateFlags?: TokenFlags): TemplateHead;
3331 createTemplateMiddle(text: string, rawText?: string, templateFlags?: TokenFlags): TemplateMiddle;
3332 createTemplateMiddle(text: string | undefined, rawText: string, templateFlags?: TokenFlags): TemplateMiddle;
3333 createTemplateTail(text: string, rawText?: string, templateFlags?: TokenFlags): TemplateTail;
3334 createTemplateTail(text: string | undefined, rawText: string, templateFlags?: TokenFlags): TemplateTail;
3335 createNoSubstitutionTemplateLiteral(text: string, rawText?: string): NoSubstitutionTemplateLiteral;
3336 createNoSubstitutionTemplateLiteral(text: string | undefined, rawText: string): NoSubstitutionTemplateLiteral;
3337 createYieldExpression(asteriskToken: AsteriskToken, expression: Expression): YieldExpression;
3338 createYieldExpression(asteriskToken: undefined, expression: Expression | undefined): YieldExpression;
3339 updateYieldExpression(node: YieldExpression, asteriskToken: AsteriskToken | undefined, expression: Expression | undefined): YieldExpression;
3340 createSpreadElement(expression: Expression): SpreadElement;
3341 updateSpreadElement(node: SpreadElement, expression: Expression): SpreadElement;
3342 createClassExpression(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassExpression;
3343 updateClassExpression(node: ClassExpression, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassExpression;
3344 createOmittedExpression(): OmittedExpression;
3345 createExpressionWithTypeArguments(expression: Expression, typeArguments: readonly TypeNode[] | undefined): ExpressionWithTypeArguments;
3346 updateExpressionWithTypeArguments(node: ExpressionWithTypeArguments, expression: Expression, typeArguments: readonly TypeNode[] | undefined): ExpressionWithTypeArguments;
3347 createAsExpression(expression: Expression, type: TypeNode): AsExpression;
3348 updateAsExpression(node: AsExpression, expression: Expression, type: TypeNode): AsExpression;
3349 createNonNullExpression(expression: Expression): NonNullExpression;
3350 updateNonNullExpression(node: NonNullExpression, expression: Expression): NonNullExpression;
3351 createNonNullChain(expression: Expression): NonNullChain;
3352 updateNonNullChain(node: NonNullChain, expression: Expression): NonNullChain;
3353 createMetaProperty(keywordToken: MetaProperty["keywordToken"], name: Identifier): MetaProperty;
3354 updateMetaProperty(node: MetaProperty, name: Identifier): MetaProperty;
3355 createTemplateSpan(expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan;
3356 updateTemplateSpan(node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan;
3357 createSemicolonClassElement(): SemicolonClassElement;
3358 createBlock(statements: readonly Statement[], multiLine?: boolean): Block;
3359 updateBlock(node: Block, statements: readonly Statement[]): Block;
3360 createVariableStatement(modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList | readonly VariableDeclaration[]): VariableStatement;
3361 updateVariableStatement(node: VariableStatement, modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList): VariableStatement;
3362 createEmptyStatement(): EmptyStatement;
3363 createExpressionStatement(expression: Expression): ExpressionStatement;
3364 updateExpressionStatement(node: ExpressionStatement, expression: Expression): ExpressionStatement;
3365 createIfStatement(expression: Expression, thenStatement: Statement, elseStatement?: Statement): IfStatement;
3366 updateIfStatement(node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement | undefined): IfStatement;
3367 createDoStatement(statement: Statement, expression: Expression): DoStatement;
3368 updateDoStatement(node: DoStatement, statement: Statement, expression: Expression): DoStatement;
3369 createWhileStatement(expression: Expression, statement: Statement): WhileStatement;
3370 updateWhileStatement(node: WhileStatement, expression: Expression, statement: Statement): WhileStatement;
3371 createForStatement(initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement;
3372 updateForStatement(node: ForStatement, initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement;
3373 createForInStatement(initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement;
3374 updateForInStatement(node: ForInStatement, initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement;
3375 createForOfStatement(awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement;
3376 updateForOfStatement(node: ForOfStatement, awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement;
3377 createContinueStatement(label?: string | Identifier): ContinueStatement;
3378 updateContinueStatement(node: ContinueStatement, label: Identifier | undefined): ContinueStatement;
3379 createBreakStatement(label?: string | Identifier): BreakStatement;
3380 updateBreakStatement(node: BreakStatement, label: Identifier | undefined): BreakStatement;
3381 createReturnStatement(expression?: Expression): ReturnStatement;
3382 updateReturnStatement(node: ReturnStatement, expression: Expression | undefined): ReturnStatement;
3383 createWithStatement(expression: Expression, statement: Statement): WithStatement;
3384 updateWithStatement(node: WithStatement, expression: Expression, statement: Statement): WithStatement;
3385 createSwitchStatement(expression: Expression, caseBlock: CaseBlock): SwitchStatement;
3386 updateSwitchStatement(node: SwitchStatement, expression: Expression, caseBlock: CaseBlock): SwitchStatement;
3387 createLabeledStatement(label: string | Identifier, statement: Statement): LabeledStatement;
3388 updateLabeledStatement(node: LabeledStatement, label: Identifier, statement: Statement): LabeledStatement;
3389 createThrowStatement(expression: Expression): ThrowStatement;
3390 updateThrowStatement(node: ThrowStatement, expression: Expression): ThrowStatement;
3391 createTryStatement(tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement;
3392 updateTryStatement(node: TryStatement, tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement;
3393 createDebuggerStatement(): DebuggerStatement;
3394 createVariableDeclaration(name: string | BindingName, exclamationToken?: ExclamationToken, type?: TypeNode, initializer?: Expression): VariableDeclaration;
3395 updateVariableDeclaration(node: VariableDeclaration, name: BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration;
3396 createVariableDeclarationList(declarations: readonly VariableDeclaration[], flags?: NodeFlags): VariableDeclarationList;
3397 updateVariableDeclarationList(node: VariableDeclarationList, declarations: readonly VariableDeclaration[]): VariableDeclarationList;
3398 createFunctionDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration;
3399 updateFunctionDeclaration(node: FunctionDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration;
3400 createClassDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassDeclaration;
3401 updateClassDeclaration(node: ClassDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassDeclaration;
3402 createInterfaceDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
3403 updateInterfaceDeclaration(node: InterfaceDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
3404 createTypeAliasDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
3405 updateTypeAliasDeclaration(node: TypeAliasDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
3406 createEnumDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration;
3407 updateEnumDeclaration(node: EnumDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration;
3408 createModuleDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration;
3409 updateModuleDeclaration(node: ModuleDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration;
3410 createModuleBlock(statements: readonly Statement[]): ModuleBlock;
3411 updateModuleBlock(node: ModuleBlock, statements: readonly Statement[]): ModuleBlock;
3412 createCaseBlock(clauses: readonly CaseOrDefaultClause[]): CaseBlock;
3413 updateCaseBlock(node: CaseBlock, clauses: readonly CaseOrDefaultClause[]): CaseBlock;
3414 createNamespaceExportDeclaration(name: string | Identifier): NamespaceExportDeclaration;
3415 updateNamespaceExportDeclaration(node: NamespaceExportDeclaration, name: Identifier): NamespaceExportDeclaration;
3416 createImportEqualsDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration;
3417 updateImportEqualsDeclaration(node: ImportEqualsDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration;
3418 createImportDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression): ImportDeclaration;
3419 updateImportDeclaration(node: ImportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression): ImportDeclaration;
3420 createImportClause(isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause;
3421 updateImportClause(node: ImportClause, isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause;
3422 createNamespaceImport(name: Identifier): NamespaceImport;
3423 updateNamespaceImport(node: NamespaceImport, name: Identifier): NamespaceImport;
3424 createNamespaceExport(name: Identifier): NamespaceExport;
3425 updateNamespaceExport(node: NamespaceExport, name: Identifier): NamespaceExport;
3426 createNamedImports(elements: readonly ImportSpecifier[]): NamedImports;
3427 updateNamedImports(node: NamedImports, elements: readonly ImportSpecifier[]): NamedImports;
3428 createImportSpecifier(propertyName: Identifier | undefined, name: Identifier): ImportSpecifier;
3429 updateImportSpecifier(node: ImportSpecifier, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier;
3430 createExportAssignment(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment;
3431 updateExportAssignment(node: ExportAssignment, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, expression: Expression): ExportAssignment;
3432 createExportDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression): ExportDeclaration;
3433 updateExportDeclaration(node: ExportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined): ExportDeclaration;
3434 createNamedExports(elements: readonly ExportSpecifier[]): NamedExports;
3435 updateNamedExports(node: NamedExports, elements: readonly ExportSpecifier[]): NamedExports;
3436 createExportSpecifier(propertyName: string | Identifier | undefined, name: string | Identifier): ExportSpecifier;
3437 updateExportSpecifier(node: ExportSpecifier, propertyName: Identifier | undefined, name: Identifier): ExportSpecifier;
3438 createExternalModuleReference(expression: Expression): ExternalModuleReference;
3439 updateExternalModuleReference(node: ExternalModuleReference, expression: Expression): ExternalModuleReference;
3440 createJSDocAllType(): JSDocAllType;
3441 createJSDocUnknownType(): JSDocUnknownType;
3442 createJSDocNonNullableType(type: TypeNode): JSDocNonNullableType;
3443 updateJSDocNonNullableType(node: JSDocNonNullableType, type: TypeNode): JSDocNonNullableType;
3444 createJSDocNullableType(type: TypeNode): JSDocNullableType;
3445 updateJSDocNullableType(node: JSDocNullableType, type: TypeNode): JSDocNullableType;
3446 createJSDocOptionalType(type: TypeNode): JSDocOptionalType;
3447 updateJSDocOptionalType(node: JSDocOptionalType, type: TypeNode): JSDocOptionalType;
3448 createJSDocFunctionType(parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): JSDocFunctionType;
3449 updateJSDocFunctionType(node: JSDocFunctionType, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): JSDocFunctionType;
3450 createJSDocVariadicType(type: TypeNode): JSDocVariadicType;
3451 updateJSDocVariadicType(node: JSDocVariadicType, type: TypeNode): JSDocVariadicType;
3452 createJSDocNamepathType(type: TypeNode): JSDocNamepathType;
3453 updateJSDocNamepathType(node: JSDocNamepathType, type: TypeNode): JSDocNamepathType;
3454 createJSDocTypeExpression(type: TypeNode): JSDocTypeExpression;
3455 updateJSDocTypeExpression(node: JSDocTypeExpression, type: TypeNode): JSDocTypeExpression;
3456 createJSDocNameReference(name: EntityName): JSDocNameReference;
3457 updateJSDocNameReference(node: JSDocNameReference, name: EntityName): JSDocNameReference;
3458 createJSDocTypeLiteral(jsDocPropertyTags?: readonly JSDocPropertyLikeTag[], isArrayType?: boolean): JSDocTypeLiteral;
3459 updateJSDocTypeLiteral(node: JSDocTypeLiteral, jsDocPropertyTags: readonly JSDocPropertyLikeTag[] | undefined, isArrayType: boolean | undefined): JSDocTypeLiteral;
3460 createJSDocSignature(typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type?: JSDocReturnTag): JSDocSignature;
3461 updateJSDocSignature(node: JSDocSignature, typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type: JSDocReturnTag | undefined): JSDocSignature;
3462 createJSDocTemplateTag(tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment?: string): JSDocTemplateTag;
3463 updateJSDocTemplateTag(node: JSDocTemplateTag, tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment: string | undefined): JSDocTemplateTag;
3464 createJSDocTypedefTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression | JSDocTypeLiteral, fullName?: Identifier | JSDocNamespaceDeclaration, comment?: string): JSDocTypedefTag;
3465 updateJSDocTypedefTag(node: JSDocTypedefTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | JSDocTypeLiteral | undefined, fullName: Identifier | JSDocNamespaceDeclaration | undefined, comment: string | undefined): JSDocTypedefTag;
3466 createJSDocParameterTag(tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression, isNameFirst?: boolean, comment?: string): JSDocParameterTag;
3467 updateJSDocParameterTag(node: JSDocParameterTag, tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression: JSDocTypeExpression | undefined, isNameFirst: boolean, comment: string | undefined): JSDocParameterTag;
3468 createJSDocPropertyTag(tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression, isNameFirst?: boolean, comment?: string): JSDocPropertyTag;
3469 updateJSDocPropertyTag(node: JSDocPropertyTag, tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression: JSDocTypeExpression | undefined, isNameFirst: boolean, comment: string | undefined): JSDocPropertyTag;
3470 createJSDocTypeTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocTypeTag;
3471 updateJSDocTypeTag(node: JSDocTypeTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | undefined): JSDocTypeTag;
3472 createJSDocSeeTag(tagName: Identifier | undefined, nameExpression: JSDocNameReference | undefined, comment?: string): JSDocSeeTag;
3473 updateJSDocSeeTag(node: JSDocSeeTag, tagName: Identifier | undefined, nameExpression: JSDocNameReference | undefined, comment?: string): JSDocSeeTag;
3474 createJSDocReturnTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression, comment?: string): JSDocReturnTag;
3475 updateJSDocReturnTag(node: JSDocReturnTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | undefined): JSDocReturnTag;
3476 createJSDocThisTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocThisTag;
3477 updateJSDocThisTag(node: JSDocThisTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | undefined): JSDocThisTag;
3478 createJSDocEnumTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocEnumTag;
3479 updateJSDocEnumTag(node: JSDocEnumTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | undefined): JSDocEnumTag;
3480 createJSDocCallbackTag(tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName?: Identifier | JSDocNamespaceDeclaration, comment?: string): JSDocCallbackTag;
3481 updateJSDocCallbackTag(node: JSDocCallbackTag, tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName: Identifier | JSDocNamespaceDeclaration | undefined, comment: string | undefined): JSDocCallbackTag;
3482 createJSDocAugmentsTag(tagName: Identifier | undefined, className: JSDocAugmentsTag["class"], comment?: string): JSDocAugmentsTag;
3483 updateJSDocAugmentsTag(node: JSDocAugmentsTag, tagName: Identifier | undefined, className: JSDocAugmentsTag["class"], comment: string | undefined): JSDocAugmentsTag;
3484 createJSDocImplementsTag(tagName: Identifier | undefined, className: JSDocImplementsTag["class"], comment?: string): JSDocImplementsTag;
3485 updateJSDocImplementsTag(node: JSDocImplementsTag, tagName: Identifier | undefined, className: JSDocImplementsTag["class"], comment: string | undefined): JSDocImplementsTag;
3486 createJSDocAuthorTag(tagName: Identifier | undefined, comment?: string): JSDocAuthorTag;
3487 updateJSDocAuthorTag(node: JSDocAuthorTag, tagName: Identifier | undefined, comment: string | undefined): JSDocAuthorTag;
3488 createJSDocClassTag(tagName: Identifier | undefined, comment?: string): JSDocClassTag;
3489 updateJSDocClassTag(node: JSDocClassTag, tagName: Identifier | undefined, comment: string | undefined): JSDocClassTag;
3490 createJSDocPublicTag(tagName: Identifier | undefined, comment?: string): JSDocPublicTag;
3491 updateJSDocPublicTag(node: JSDocPublicTag, tagName: Identifier | undefined, comment: string | undefined): JSDocPublicTag;
3492 createJSDocPrivateTag(tagName: Identifier | undefined, comment?: string): JSDocPrivateTag;
3493 updateJSDocPrivateTag(node: JSDocPrivateTag, tagName: Identifier | undefined, comment: string | undefined): JSDocPrivateTag;
3494 createJSDocProtectedTag(tagName: Identifier | undefined, comment?: string): JSDocProtectedTag;
3495 updateJSDocProtectedTag(node: JSDocProtectedTag, tagName: Identifier | undefined, comment: string | undefined): JSDocProtectedTag;
3496 createJSDocReadonlyTag(tagName: Identifier | undefined, comment?: string): JSDocReadonlyTag;
3497 updateJSDocReadonlyTag(node: JSDocReadonlyTag, tagName: Identifier | undefined, comment: string | undefined): JSDocReadonlyTag;
3498 createJSDocUnknownTag(tagName: Identifier, comment?: string): JSDocUnknownTag;
3499 updateJSDocUnknownTag(node: JSDocUnknownTag, tagName: Identifier, comment: string | undefined): JSDocUnknownTag;
3500 createJSDocDeprecatedTag(tagName: Identifier, comment?: string): JSDocDeprecatedTag;
3501 updateJSDocDeprecatedTag(node: JSDocDeprecatedTag, tagName: Identifier, comment?: string): JSDocDeprecatedTag;
3502 createJSDocComment(comment?: string | undefined, tags?: readonly JSDocTag[] | undefined): JSDoc;
3503 updateJSDocComment(node: JSDoc, comment: string | undefined, tags: readonly JSDocTag[] | undefined): JSDoc;
3504 createJsxElement(openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement): JsxElement;
3505 updateJsxElement(node: JsxElement, openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement): JsxElement;
3506 createJsxSelfClosingElement(tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxSelfClosingElement;
3507 updateJsxSelfClosingElement(node: JsxSelfClosingElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxSelfClosingElement;
3508 createJsxOpeningElement(tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxOpeningElement;
3509 updateJsxOpeningElement(node: JsxOpeningElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxOpeningElement;
3510 createJsxClosingElement(tagName: JsxTagNameExpression): JsxClosingElement;
3511 updateJsxClosingElement(node: JsxClosingElement, tagName: JsxTagNameExpression): JsxClosingElement;
3512 createJsxFragment(openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment): JsxFragment;
3513 createJsxText(text: string, containsOnlyTriviaWhiteSpaces?: boolean): JsxText;
3514 updateJsxText(node: JsxText, text: string, containsOnlyTriviaWhiteSpaces?: boolean): JsxText;
3515 createJsxOpeningFragment(): JsxOpeningFragment;
3516 createJsxJsxClosingFragment(): JsxClosingFragment;
3517 updateJsxFragment(node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment): JsxFragment;
3518 createJsxAttribute(name: Identifier, initializer: StringLiteral | JsxExpression | undefined): JsxAttribute;
3519 updateJsxAttribute(node: JsxAttribute, name: Identifier, initializer: StringLiteral | JsxExpression | undefined): JsxAttribute;
3520 createJsxAttributes(properties: readonly JsxAttributeLike[]): JsxAttributes;
3521 updateJsxAttributes(node: JsxAttributes, properties: readonly JsxAttributeLike[]): JsxAttributes;
3522 createJsxSpreadAttribute(expression: Expression): JsxSpreadAttribute;
3523 updateJsxSpreadAttribute(node: JsxSpreadAttribute, expression: Expression): JsxSpreadAttribute;
3524 createJsxExpression(dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined): JsxExpression;
3525 updateJsxExpression(node: JsxExpression, expression: Expression | undefined): JsxExpression;
3526 createCaseClause(expression: Expression, statements: readonly Statement[]): CaseClause;
3527 updateCaseClause(node: CaseClause, expression: Expression, statements: readonly Statement[]): CaseClause;
3528 createDefaultClause(statements: readonly Statement[]): DefaultClause;
3529 updateDefaultClause(node: DefaultClause, statements: readonly Statement[]): DefaultClause;
3530 createHeritageClause(token: HeritageClause["token"], types: readonly ExpressionWithTypeArguments[]): HeritageClause;
3531 updateHeritageClause(node: HeritageClause, types: readonly ExpressionWithTypeArguments[]): HeritageClause;
3532 createCatchClause(variableDeclaration: string | VariableDeclaration | undefined, block: Block): CatchClause;
3533 updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration | undefined, block: Block): CatchClause;
3534 createPropertyAssignment(name: string | PropertyName, initializer: Expression): PropertyAssignment;
3535 updatePropertyAssignment(node: PropertyAssignment, name: PropertyName, initializer: Expression): PropertyAssignment;
3536 createShorthandPropertyAssignment(name: string | Identifier, objectAssignmentInitializer?: Expression): ShorthandPropertyAssignment;
3537 updateShorthandPropertyAssignment(node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression | undefined): ShorthandPropertyAssignment;
3538 createSpreadAssignment(expression: Expression): SpreadAssignment;
3539 updateSpreadAssignment(node: SpreadAssignment, expression: Expression): SpreadAssignment;
3540 createEnumMember(name: string | PropertyName, initializer?: Expression): EnumMember;
3541 updateEnumMember(node: EnumMember, name: PropertyName, initializer: Expression | undefined): EnumMember;
3542 createSourceFile(statements: readonly Statement[], endOfFileToken: EndOfFileToken, flags: NodeFlags): SourceFile;
3543 updateSourceFile(node: SourceFile, statements: readonly Statement[], isDeclarationFile?: boolean, referencedFiles?: readonly FileReference[], typeReferences?: readonly FileReference[], hasNoDefaultLib?: boolean, libReferences?: readonly FileReference[]): SourceFile;
3544 createNotEmittedStatement(original: Node): NotEmittedStatement;
3545 createPartiallyEmittedExpression(expression: Expression, original?: Node): PartiallyEmittedExpression;
3546 updatePartiallyEmittedExpression(node: PartiallyEmittedExpression, expression: Expression): PartiallyEmittedExpression;
3547 createCommaListExpression(elements: readonly Expression[]): CommaListExpression;
3548 updateCommaListExpression(node: CommaListExpression, elements: readonly Expression[]): CommaListExpression;
3549 createBundle(sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle;
3550 updateBundle(node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle;
3551 createComma(left: Expression, right: Expression): BinaryExpression;
3552 createAssignment(left: ObjectLiteralExpression | ArrayLiteralExpression, right: Expression): DestructuringAssignment;
3553 createAssignment(left: Expression, right: Expression): AssignmentExpression<EqualsToken>;
3554 createLogicalOr(left: Expression, right: Expression): BinaryExpression;
3555 createLogicalAnd(left: Expression, right: Expression): BinaryExpression;
3556 createBitwiseOr(left: Expression, right: Expression): BinaryExpression;
3557 createBitwiseXor(left: Expression, right: Expression): BinaryExpression;
3558 createBitwiseAnd(left: Expression, right: Expression): BinaryExpression;
3559 createStrictEquality(left: Expression, right: Expression): BinaryExpression;
3560 createStrictInequality(left: Expression, right: Expression): BinaryExpression;
3561 createEquality(left: Expression, right: Expression): BinaryExpression;
3562 createInequality(left: Expression, right: Expression): BinaryExpression;
3563 createLessThan(left: Expression, right: Expression): BinaryExpression;
3564 createLessThanEquals(left: Expression, right: Expression): BinaryExpression;
3565 createGreaterThan(left: Expression, right: Expression): BinaryExpression;
3566 createGreaterThanEquals(left: Expression, right: Expression): BinaryExpression;
3567 createLeftShift(left: Expression, right: Expression): BinaryExpression;
3568 createRightShift(left: Expression, right: Expression): BinaryExpression;
3569 createUnsignedRightShift(left: Expression, right: Expression): BinaryExpression;
3570 createAdd(left: Expression, right: Expression): BinaryExpression;
3571 createSubtract(left: Expression, right: Expression): BinaryExpression;
3572 createMultiply(left: Expression, right: Expression): BinaryExpression;
3573 createDivide(left: Expression, right: Expression): BinaryExpression;
3574 createModulo(left: Expression, right: Expression): BinaryExpression;
3575 createExponent(left: Expression, right: Expression): BinaryExpression;
3576 createPrefixPlus(operand: Expression): PrefixUnaryExpression;
3577 createPrefixMinus(operand: Expression): PrefixUnaryExpression;
3578 createPrefixIncrement(operand: Expression): PrefixUnaryExpression;
3579 createPrefixDecrement(operand: Expression): PrefixUnaryExpression;
3580 createBitwiseNot(operand: Expression): PrefixUnaryExpression;
3581 createLogicalNot(operand: Expression): PrefixUnaryExpression;
3582 createPostfixIncrement(operand: Expression): PostfixUnaryExpression;
3583 createPostfixDecrement(operand: Expression): PostfixUnaryExpression;
3584 createImmediatelyInvokedFunctionExpression(statements: readonly Statement[]): CallExpression;
3585 createImmediatelyInvokedFunctionExpression(statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression;
3586 createImmediatelyInvokedArrowFunction(statements: readonly Statement[]): CallExpression;
3587 createImmediatelyInvokedArrowFunction(statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression;
3588 createVoidZero(): VoidExpression;
3589 createExportDefault(expression: Expression): ExportAssignment;
3590 createExternalModuleExport(exportName: Identifier): ExportDeclaration;
3591 restoreOuterExpressions(outerExpression: Expression | undefined, innerExpression: Expression, kinds?: OuterExpressionKinds): Expression;
3592 }
3593 export interface CoreTransformationContext {
3594 readonly factory: NodeFactory;
3595 /** Gets the compiler options supplied to the transformer. */
3596 getCompilerOptions(): CompilerOptions;
3597 /** Starts a new lexical environment. */
3598 startLexicalEnvironment(): void;
3599 /** Suspends the current lexical environment, usually after visiting a parameter list. */
3600 suspendLexicalEnvironment(): void;
3601 /** Resumes a suspended lexical environment, usually before visiting a function body. */
3602 resumeLexicalEnvironment(): void;
3603 /** Ends a lexical environment, returning any declarations. */
3604 endLexicalEnvironment(): Statement[] | undefined;
3605 /** Hoists a function declaration to the containing scope. */
3606 hoistFunctionDeclaration(node: FunctionDeclaration): void;
3607 /** Hoists a variable declaration to the containing scope. */
3608 hoistVariableDeclaration(node: Identifier): void;
3609 }
3610 export interface TransformationContext extends CoreTransformationContext {
3611 /** Records a request for a non-scoped emit helper in the current context. */
3612 requestEmitHelper(helper: EmitHelper): void;
3613 /** Gets and resets the requested non-scoped emit helpers. */
3614 readEmitHelpers(): EmitHelper[] | undefined;
3615 /** Enables expression substitutions in the pretty printer for the provided SyntaxKind. */
3616 enableSubstitution(kind: SyntaxKind): void;
3617 /** Determines whether expression substitutions are enabled for the provided node. */
3618 isSubstitutionEnabled(node: Node): boolean;
3619 /**
3620 * Hook used by transformers to substitute expressions just before they
3621 * are emitted by the pretty printer.
3622 *
3623 * NOTE: Transformation hooks should only be modified during `Transformer` initialization,
3624 * before returning the `NodeTransformer` callback.
3625 */
3626 onSubstituteNode: (hint: EmitHint, node: Node) => Node;
3627 /**
3628 * Enables before/after emit notifications in the pretty printer for the provided
3629 * SyntaxKind.
3630 */
3631 enableEmitNotification(kind: SyntaxKind): void;
3632 /**
3633 * Determines whether before/after emit notifications should be raised in the pretty
3634 * printer when it emits a node.
3635 */
3636 isEmitNotificationEnabled(node: Node): boolean;
3637 /**
3638 * Hook used to allow transformers to capture state before or after
3639 * the printer emits a node.
3640 *
3641 * NOTE: Transformation hooks should only be modified during `Transformer` initialization,
3642 * before returning the `NodeTransformer` callback.
3643 */
3644 onEmitNode: (hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void) => void;
3645 }
3646 export interface TransformationResult<T extends Node> {
3647 /** Gets the transformed source files. */
3648 transformed: T[];
3649 /** Gets diagnostics for the transformation. */
3650 diagnostics?: DiagnosticWithLocation[];
3651 /**
3652 * Gets a substitute for a node, if one is available; otherwise, returns the original node.
3653 *
3654 * @param hint A hint as to the intended usage of the node.
3655 * @param node The node to substitute.
3656 */
3657 substituteNode(hint: EmitHint, node: Node): Node;
3658 /**
3659 * Emits a node with possible notification.
3660 *
3661 * @param hint A hint as to the intended usage of the node.
3662 * @param node The node to emit.
3663 * @param emitCallback A callback used to emit the node.
3664 */
3665 emitNodeWithNotification(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void;
3666 /**
3667 * Indicates if a given node needs an emit notification
3668 *
3669 * @param node The node to emit.
3670 */
3671 isEmitNotificationEnabled?(node: Node): boolean;
3672 /**
3673 * Clean up EmitNode entries on any parse-tree nodes.
3674 */
3675 dispose(): void;
3676 }
3677 /**
3678 * A function that is used to initialize and return a `Transformer` callback, which in turn
3679 * will be used to transform one or more nodes.
3680 */
3681 export type TransformerFactory<T extends Node> = (context: TransformationContext) => Transformer<T>;
3682 /**
3683 * A function that transforms a node.
3684 */
3685 export type Transformer<T extends Node> = (node: T) => T;
3686 /**
3687 * A function that accepts and possibly transforms a node.
3688 */
3689 export type Visitor = (node: Node) => VisitResult<Node>;
3690 export interface NodeVisitor {
3691 <T extends Node>(nodes: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T;
3692 <T extends Node>(nodes: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T | undefined;
3693 }
3694 export interface NodesVisitor {
3695 <T extends Node>(nodes: NodeArray<T>, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T>;
3696 <T extends Node>(nodes: NodeArray<T> | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T> | undefined;
3697 }
3698 export type VisitResult<T extends Node> = T | T[] | undefined;
3699 export interface Printer {
3700 /**
3701 * Print a node and its subtree as-is, without any emit transformations.
3702 * @param hint A value indicating the purpose of a node. This is primarily used to
3703 * distinguish between an `Identifier` used in an expression position, versus an
3704 * `Identifier` used as an `IdentifierName` as part of a declaration. For most nodes you
3705 * should just pass `Unspecified`.
3706 * @param node The node to print. The node and its subtree are printed as-is, without any
3707 * emit transformations.
3708 * @param sourceFile A source file that provides context for the node. The source text of
3709 * the file is used to emit the original source content for literals and identifiers, while
3710 * the identifiers of the source file are used when generating unique names to avoid
3711 * collisions.
3712 */
3713 printNode(hint: EmitHint, node: Node, sourceFile: SourceFile): string;
3714 /**
3715 * Prints a list of nodes using the given format flags
3716 */
3717 printList<T extends Node>(format: ListFormat, list: NodeArray<T>, sourceFile: SourceFile): string;
3718 /**
3719 * Prints a source file as-is, without any emit transformations.
3720 */
3721 printFile(sourceFile: SourceFile): string;
3722 /**
3723 * Prints a bundle of source files as-is, without any emit transformations.
3724 */
3725 printBundle(bundle: Bundle): string;
3726 }
3727 export interface PrintHandlers {
3728 /**
3729 * A hook used by the Printer when generating unique names to avoid collisions with
3730 * globally defined names that exist outside of the current source file.
3731 */
3732 hasGlobalName?(name: string): boolean;
3733 /**
3734 * A hook used by the Printer to provide notifications prior to emitting a node. A
3735 * compatible implementation **must** invoke `emitCallback` with the provided `hint` and
3736 * `node` values.
3737 * @param hint A hint indicating the intended purpose of the node.
3738 * @param node The node to emit.
3739 * @param emitCallback A callback that, when invoked, will emit the node.
3740 * @example
3741 * ```ts
3742 * var printer = createPrinter(printerOptions, {
3743 * onEmitNode(hint, node, emitCallback) {
3744 * // set up or track state prior to emitting the node...
3745 * emitCallback(hint, node);
3746 * // restore state after emitting the node...
3747 * }
3748 * });
3749 * ```
3750 */
3751 onEmitNode?(hint: EmitHint, node: Node | undefined, emitCallback: (hint: EmitHint, node: Node | undefined) => void): void;
3752 /**
3753 * A hook used to check if an emit notification is required for a node.
3754 * @param node The node to emit.
3755 */
3756 isEmitNotificationEnabled?(node: Node | undefined): boolean;
3757 /**
3758 * A hook used by the Printer to perform just-in-time substitution of a node. This is
3759 * primarily used by node transformations that need to substitute one node for another,
3760 * such as replacing `myExportedVar` with `exports.myExportedVar`.
3761 * @param hint A hint indicating the intended purpose of the node.
3762 * @param node The node to emit.
3763 * @example
3764 * ```ts
3765 * var printer = createPrinter(printerOptions, {
3766 * substituteNode(hint, node) {
3767 * // perform substitution if necessary...
3768 * return node;
3769 * }
3770 * });
3771 * ```
3772 */
3773 substituteNode?(hint: EmitHint, node: Node): Node;
3774 }
3775 export interface PrinterOptions {
3776 removeComments?: boolean;
3777 newLine?: NewLineKind;
3778 omitTrailingSemicolon?: boolean;
3779 noEmitHelpers?: boolean;
3780 }
3781 export interface GetEffectiveTypeRootsHost {
3782 directoryExists?(directoryName: string): boolean;
3783 getCurrentDirectory?(): string;
3784 }
3785 export interface TextSpan {
3786 start: number;
3787 length: number;
3788 }
3789 export interface TextChangeRange {
3790 span: TextSpan;
3791 newLength: number;
3792 }
3793 export interface SyntaxList extends Node {
3794 kind: SyntaxKind.SyntaxList;
3795 _children: Node[];
3796 }
3797 export enum ListFormat {
3798 None = 0,
3799 SingleLine = 0,
3800 MultiLine = 1,
3801 PreserveLines = 2,
3802 LinesMask = 3,
3803 NotDelimited = 0,
3804 BarDelimited = 4,
3805 AmpersandDelimited = 8,
3806 CommaDelimited = 16,
3807 AsteriskDelimited = 32,
3808 DelimitersMask = 60,
3809 AllowTrailingComma = 64,
3810 Indented = 128,
3811 SpaceBetweenBraces = 256,
3812 SpaceBetweenSiblings = 512,
3813 Braces = 1024,
3814 Parenthesis = 2048,
3815 AngleBrackets = 4096,
3816 SquareBrackets = 8192,
3817 BracketsMask = 15360,
3818 OptionalIfUndefined = 16384,
3819 OptionalIfEmpty = 32768,
3820 Optional = 49152,
3821 PreferNewLine = 65536,
3822 NoTrailingNewLine = 131072,
3823 NoInterveningComments = 262144,
3824 NoSpaceIfEmpty = 524288,
3825 SingleElement = 1048576,
3826 SpaceAfterList = 2097152,
3827 Modifiers = 262656,
3828 HeritageClauses = 512,
3829 SingleLineTypeLiteralMembers = 768,
3830 MultiLineTypeLiteralMembers = 32897,
3831 SingleLineTupleTypeElements = 528,
3832 MultiLineTupleTypeElements = 657,
3833 UnionTypeConstituents = 516,
3834 IntersectionTypeConstituents = 520,
3835 ObjectBindingPatternElements = 525136,
3836 ArrayBindingPatternElements = 524880,
3837 ObjectLiteralExpressionProperties = 526226,
3838 ArrayLiteralExpressionElements = 8914,
3839 CommaListElements = 528,
3840 CallExpressionArguments = 2576,
3841 NewExpressionArguments = 18960,
3842 TemplateExpressionSpans = 262144,
3843 SingleLineBlockStatements = 768,
3844 MultiLineBlockStatements = 129,
3845 VariableDeclarationList = 528,
3846 SingleLineFunctionBodyStatements = 768,
3847 MultiLineFunctionBodyStatements = 1,
3848 ClassHeritageClauses = 0,
3849 ClassMembers = 129,
3850 InterfaceMembers = 129,
3851 EnumMembers = 145,
3852 CaseBlockClauses = 129,
3853 NamedImportsOrExportsElements = 525136,
3854 JsxElementOrFragmentChildren = 262144,
3855 JsxElementAttributes = 262656,
3856 CaseOrDefaultClauseStatements = 163969,
3857 HeritageClauseTypes = 528,
3858 SourceFileStatements = 131073,
3859 Decorators = 2146305,
3860 TypeArguments = 53776,
3861 TypeParameters = 53776,
3862 Parameters = 2576,
3863 IndexSignatureParameters = 8848,
3864 JSDocComment = 33
3865 }
3866 export interface UserPreferences {
3867 readonly disableSuggestions?: boolean;
3868 readonly quotePreference?: "auto" | "double" | "single";
3869 readonly includeCompletionsForModuleExports?: boolean;
3870 readonly includeAutomaticOptionalChainCompletions?: boolean;
3871 readonly includeCompletionsWithInsertText?: boolean;
3872 readonly importModuleSpecifierPreference?: "shortest" | "project-relative" | "relative" | "non-relative";
3873 /** Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js" */
3874 readonly importModuleSpecifierEnding?: "auto" | "minimal" | "index" | "js";
3875 readonly allowTextChangesInNewFiles?: boolean;
3876 readonly providePrefixAndSuffixTextForRename?: boolean;
3877 readonly includePackageJsonAutoImports?: "auto" | "on" | "off";
3878 readonly provideRefactorNotApplicableReason?: boolean;
3879 }
3880 /** Represents a bigint literal value without requiring bigint support */
3881 export interface PseudoBigInt {
3882 negative: boolean;
3883 base10Value: string;
3884 }
3885 export {};
3886}
3887declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any;
3888declare function clearTimeout(handle: any): void;
3889declare namespace ts {
3890 export enum FileWatcherEventKind {
3891 Created = 0,
3892 Changed = 1,
3893 Deleted = 2
3894 }
3895 export type FileWatcherCallback = (fileName: string, eventKind: FileWatcherEventKind) => void;
3896 export type DirectoryWatcherCallback = (fileName: string) => void;
3897 export interface System {
3898 args: string[];
3899 newLine: string;
3900 useCaseSensitiveFileNames: boolean;
3901 write(s: string): void;
3902 writeOutputIsTTY?(): boolean;
3903 readFile(path: string, encoding?: string): string | undefined;
3904 getFileSize?(path: string): number;
3905 writeFile(path: string, data: string, writeByteOrderMark?: boolean): void;
3906 /**
3907 * @pollingInterval - this parameter is used in polling-based watchers and ignored in watchers that
3908 * use native OS file watching
3909 */
3910 watchFile?(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: WatchOptions): FileWatcher;
3911 watchDirectory?(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: WatchOptions): FileWatcher;
3912 resolvePath(path: string): string;
3913 fileExists(path: string): boolean;
3914 directoryExists(path: string): boolean;
3915 createDirectory(path: string): void;
3916 getExecutingFilePath(): string;
3917 getCurrentDirectory(): string;
3918 getDirectories(path: string): string[];
3919 readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
3920 getModifiedTime?(path: string): Date | undefined;
3921 setModifiedTime?(path: string, time: Date): void;
3922 deleteFile?(path: string): void;
3923 /**
3924 * A good implementation is node.js' `crypto.createHash`. (https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm)
3925 */
3926 createHash?(data: string): string;
3927 /** This must be cryptographically secure. Only implement this method using `crypto.createHash("sha256")`. */
3928 createSHA256Hash?(data: string): string;
3929 getMemoryUsage?(): number;
3930 exit(exitCode?: number): void;
3931 realpath?(path: string): string;
3932 setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
3933 clearTimeout?(timeoutId: any): void;
3934 clearScreen?(): void;
3935 base64decode?(input: string): string;
3936 base64encode?(input: string): string;
3937 }
3938 export interface FileWatcher {
3939 close(): void;
3940 }
3941 export function getNodeMajorVersion(): number | undefined;
3942 export let sys: System;
3943 export {};
3944}
3945declare namespace ts {
3946 type ErrorCallback = (message: DiagnosticMessage, length: number) => void;
3947 interface Scanner {
3948 getStartPos(): number;
3949 getToken(): SyntaxKind;
3950 getTextPos(): number;
3951 getTokenPos(): number;
3952 getTokenText(): string;
3953 getTokenValue(): string;
3954 hasUnicodeEscape(): boolean;
3955 hasExtendedUnicodeEscape(): boolean;
3956 hasPrecedingLineBreak(): boolean;
3957 isIdentifier(): boolean;
3958 isReservedWord(): boolean;
3959 isUnterminated(): boolean;
3960 reScanGreaterToken(): SyntaxKind;
3961 reScanSlashToken(): SyntaxKind;
3962 reScanAsteriskEqualsToken(): SyntaxKind;
3963 reScanTemplateToken(isTaggedTemplate: boolean): SyntaxKind;
3964 reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind;
3965 scanJsxIdentifier(): SyntaxKind;
3966 scanJsxAttributeValue(): SyntaxKind;
3967 reScanJsxAttributeValue(): SyntaxKind;
3968 reScanJsxToken(): JsxTokenSyntaxKind;
3969 reScanLessThanToken(): SyntaxKind;
3970 reScanQuestionToken(): SyntaxKind;
3971 reScanInvalidIdentifier(): SyntaxKind;
3972 scanJsxToken(): JsxTokenSyntaxKind;
3973 scanJsDocToken(): JSDocSyntaxKind;
3974 scan(): SyntaxKind;
3975 getText(): string;
3976 setText(text: string | undefined, start?: number, length?: number): void;
3977 setOnError(onError: ErrorCallback | undefined): void;
3978 setScriptTarget(scriptTarget: ScriptTarget): void;
3979 setLanguageVariant(variant: LanguageVariant): void;
3980 setTextPos(textPos: number): void;
3981 lookAhead<T>(callback: () => T): T;
3982 scanRange<T>(start: number, length: number, callback: () => T): T;
3983 tryScan<T>(callback: () => T): T;
3984 }
3985 function tokenToString(t: SyntaxKind): string | undefined;
3986 function getPositionOfLineAndCharacter(sourceFile: SourceFileLike, line: number, character: number): number;
3987 function getLineAndCharacterOfPosition(sourceFile: SourceFileLike, position: number): LineAndCharacter;
3988 function isWhiteSpaceLike(ch: number): boolean;
3989 /** Does not include line breaks. For that, see isWhiteSpaceLike. */
3990 function isWhiteSpaceSingleLine(ch: number): boolean;
3991 function isLineBreak(ch: number): boolean;
3992 function couldStartTrivia(text: string, pos: number): boolean;
3993 function forEachLeadingCommentRange<U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined;
3994 function forEachLeadingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined;
3995 function forEachTrailingCommentRange<U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined;
3996 function forEachTrailingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined;
3997 function reduceEachLeadingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U | undefined;
3998 function reduceEachTrailingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U | undefined;
3999 function getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined;
4000 function getTrailingCommentRanges(text: string, pos: number): CommentRange[] | undefined;
4001 /** Optionally, get the shebang */
4002 function getShebang(text: string): string | undefined;
4003 function isIdentifierStart(ch: number, languageVersion: ScriptTarget | undefined): boolean;
4004 function isIdentifierPart(ch: number, languageVersion: ScriptTarget | undefined, identifierVariant?: LanguageVariant): boolean;
4005 function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, textInitial?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner;
4006}
4007declare namespace ts {
4008 function isExternalModuleNameRelative(moduleName: string): boolean;
4009 function sortAndDeduplicateDiagnostics<T extends Diagnostic>(diagnostics: readonly T[]): SortedReadonlyArray<T>;
4010 function getDefaultLibFileName(options: CompilerOptions): string;
4011 function textSpanEnd(span: TextSpan): number;
4012 function textSpanIsEmpty(span: TextSpan): boolean;
4013 function textSpanContainsPosition(span: TextSpan, position: number): boolean;
4014 function textSpanContainsTextSpan(span: TextSpan, other: TextSpan): boolean;
4015 function textSpanOverlapsWith(span: TextSpan, other: TextSpan): boolean;
4016 function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan | undefined;
4017 function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan): boolean;
4018 function textSpanIntersectsWith(span: TextSpan, start: number, length: number): boolean;
4019 function decodedTextSpanIntersectsWith(start1: number, length1: number, start2: number, length2: number): boolean;
4020 function textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean;
4021 function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan | undefined;
4022 function createTextSpan(start: number, length: number): TextSpan;
4023 function createTextSpanFromBounds(start: number, end: number): TextSpan;
4024 function textChangeRangeNewSpan(range: TextChangeRange): TextSpan;
4025 function textChangeRangeIsUnchanged(range: TextChangeRange): boolean;
4026 function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange;
4027 let unchangedTextChangeRange: TextChangeRange;
4028 /**
4029 * Called to merge all the changes that occurred across several versions of a script snapshot
4030 * into a single change. i.e. if a user keeps making successive edits to a script we will
4031 * have a text change from V1 to V2, V2 to V3, ..., Vn.
4032 *
4033 * This function will then merge those changes into a single change range valid between V1 and
4034 * Vn.
4035 */
4036 function collapseTextChangeRangesAcrossMultipleVersions(changes: readonly TextChangeRange[]): TextChangeRange;
4037 function getTypeParameterOwner(d: Declaration): Declaration | undefined;
4038 type ParameterPropertyDeclaration = ParameterDeclaration & {
4039 parent: ConstructorDeclaration;
4040 name: Identifier;
4041 };
4042 function isParameterPropertyDeclaration(node: Node, parent: Node): node is ParameterPropertyDeclaration;
4043 function isEmptyBindingPattern(node: BindingName): node is BindingPattern;
4044 function isEmptyBindingElement(node: BindingElement): boolean;
4045 function walkUpBindingElementsAndPatterns(binding: BindingElement): VariableDeclaration | ParameterDeclaration;
4046 function getCombinedModifierFlags(node: Declaration): ModifierFlags;
4047 function getCombinedNodeFlags(node: Node): NodeFlags;
4048 /**
4049 * Checks to see if the locale is in the appropriate format,
4050 * and if it is, attempts to set the appropriate language.
4051 */
4052 function validateLocaleAndSetLanguage(locale: string, sys: {
4053 getExecutingFilePath(): string;
4054 resolvePath(path: string): string;
4055 fileExists(fileName: string): boolean;
4056 readFile(fileName: string): string | undefined;
4057 }, errors?: Push<Diagnostic>): void;
4058 function getOriginalNode(node: Node): Node;
4059 function getOriginalNode<T extends Node>(node: Node, nodeTest: (node: Node) => node is T): T;
4060 function getOriginalNode(node: Node | undefined): Node | undefined;
4061 function getOriginalNode<T extends Node>(node: Node | undefined, nodeTest: (node: Node | undefined) => node is T): T | undefined;
4062 /**
4063 * Iterates through the parent chain of a node and performs the callback on each parent until the callback
4064 * returns a truthy value, then returns that value.
4065 * If no such value is found, it applies the callback until the parent pointer is undefined or the callback returns "quit"
4066 * At that point findAncestor returns undefined.
4067 */
4068 function findAncestor<T extends Node>(node: Node | undefined, callback: (element: Node) => element is T): T | undefined;
4069 function findAncestor(node: Node | undefined, callback: (element: Node) => boolean | "quit"): Node | undefined;
4070 /**
4071 * Gets a value indicating whether a node originated in the parse tree.
4072 *
4073 * @param node The node to test.
4074 */
4075 function isParseTreeNode(node: Node): boolean;
4076 /**
4077 * Gets the original parse tree node for a node.
4078 *
4079 * @param node The original node.
4080 * @returns The original parse tree node if found; otherwise, undefined.
4081 */
4082 function getParseTreeNode(node: Node | undefined): Node | undefined;
4083 /**
4084 * Gets the original parse tree node for a node.
4085 *
4086 * @param node The original node.
4087 * @param nodeTest A callback used to ensure the correct type of parse tree node is returned.
4088 * @returns The original parse tree node if found; otherwise, undefined.
4089 */
4090 function getParseTreeNode<T extends Node>(node: T | undefined, nodeTest?: (node: Node) => node is T): T | undefined;
4091 /** Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' */
4092 function escapeLeadingUnderscores(identifier: string): __String;
4093 /**
4094 * Remove extra underscore from escaped identifier text content.
4095 *
4096 * @param identifier The escaped identifier text.
4097 * @returns The unescaped identifier text.
4098 */
4099 function unescapeLeadingUnderscores(identifier: __String): string;
4100 function idText(identifierOrPrivateName: Identifier | PrivateIdentifier): string;
4101 function symbolName(symbol: Symbol): string;
4102 function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | PrivateIdentifier | undefined;
4103 function getNameOfDeclaration(declaration: Declaration | Expression): DeclarationName | undefined;
4104 /**
4105 * Gets the JSDoc parameter tags for the node if present.
4106 *
4107 * @remarks Returns any JSDoc param tag whose name matches the provided
4108 * parameter, whether a param tag on a containing function
4109 * expression, or a param tag on a variable declaration whose
4110 * initializer is the containing function. The tags closest to the
4111 * node are returned first, so in the previous example, the param
4112 * tag on the containing function expression would be first.
4113 *
4114 * For binding patterns, parameter tags are matched by position.
4115 */
4116 function getJSDocParameterTags(param: ParameterDeclaration): readonly JSDocParameterTag[];
4117 /**
4118 * Gets the JSDoc type parameter tags for the node if present.
4119 *
4120 * @remarks Returns any JSDoc template tag whose names match the provided
4121 * parameter, whether a template tag on a containing function
4122 * expression, or a template tag on a variable declaration whose
4123 * initializer is the containing function. The tags closest to the
4124 * node are returned first, so in the previous example, the template
4125 * tag on the containing function expression would be first.
4126 */
4127 function getJSDocTypeParameterTags(param: TypeParameterDeclaration): readonly JSDocTemplateTag[];
4128 /**
4129 * Return true if the node has JSDoc parameter tags.
4130 *
4131 * @remarks Includes parameter tags that are not directly on the node,
4132 * for example on a variable declaration whose initializer is a function expression.
4133 */
4134 function hasJSDocParameterTags(node: FunctionLikeDeclaration | SignatureDeclaration): boolean;
4135 /** Gets the JSDoc augments tag for the node if present */
4136 function getJSDocAugmentsTag(node: Node): JSDocAugmentsTag | undefined;
4137 /** Gets the JSDoc implements tags for the node if present */
4138 function getJSDocImplementsTags(node: Node): readonly JSDocImplementsTag[];
4139 /** Gets the JSDoc class tag for the node if present */
4140 function getJSDocClassTag(node: Node): JSDocClassTag | undefined;
4141 /** Gets the JSDoc public tag for the node if present */
4142 function getJSDocPublicTag(node: Node): JSDocPublicTag | undefined;
4143 /** Gets the JSDoc private tag for the node if present */
4144 function getJSDocPrivateTag(node: Node): JSDocPrivateTag | undefined;
4145 /** Gets the JSDoc protected tag for the node if present */
4146 function getJSDocProtectedTag(node: Node): JSDocProtectedTag | undefined;
4147 /** Gets the JSDoc protected tag for the node if present */
4148 function getJSDocReadonlyTag(node: Node): JSDocReadonlyTag | undefined;
4149 /** Gets the JSDoc deprecated tag for the node if present */
4150 function getJSDocDeprecatedTag(node: Node): JSDocDeprecatedTag | undefined;
4151 /** Gets the JSDoc enum tag for the node if present */
4152 function getJSDocEnumTag(node: Node): JSDocEnumTag | undefined;
4153 /** Gets the JSDoc this tag for the node if present */
4154 function getJSDocThisTag(node: Node): JSDocThisTag | undefined;
4155 /** Gets the JSDoc return tag for the node if present */
4156 function getJSDocReturnTag(node: Node): JSDocReturnTag | undefined;
4157 /** Gets the JSDoc template tag for the node if present */
4158 function getJSDocTemplateTag(node: Node): JSDocTemplateTag | undefined;
4159 /** Gets the JSDoc type tag for the node if present and valid */
4160 function getJSDocTypeTag(node: Node): JSDocTypeTag | undefined;
4161 /**
4162 * Gets the type node for the node if provided via JSDoc.
4163 *
4164 * @remarks The search includes any JSDoc param tag that relates
4165 * to the provided parameter, for example a type tag on the
4166 * parameter itself, or a param tag on a containing function
4167 * expression, or a param tag on a variable declaration whose
4168 * initializer is the containing function. The tags closest to the
4169 * node are examined first, so in the previous example, the type
4170 * tag directly on the node would be returned.
4171 */
4172 function getJSDocType(node: Node): TypeNode | undefined;
4173 /**
4174 * Gets the return type node for the node if provided via JSDoc return tag or type tag.
4175 *
4176 * @remarks `getJSDocReturnTag` just gets the whole JSDoc tag. This function
4177 * gets the type from inside the braces, after the fat arrow, etc.
4178 */
4179 function getJSDocReturnType(node: Node): TypeNode | undefined;
4180 /** Get all JSDoc tags related to a node, including those on parent nodes. */
4181 function getJSDocTags(node: Node): readonly JSDocTag[];
4182 /** Gets all JSDoc tags that match a specified predicate */
4183 function getAllJSDocTags<T extends JSDocTag>(node: Node, predicate: (tag: JSDocTag) => tag is T): readonly T[];
4184 /** Gets all JSDoc tags of a specified kind */
4185 function getAllJSDocTagsOfKind(node: Node, kind: SyntaxKind): readonly JSDocTag[];
4186 /**
4187 * Gets the effective type parameters. If the node was parsed in a
4188 * JavaScript file, gets the type parameters from the `@template` tag from JSDoc.
4189 */
4190 function getEffectiveTypeParameterDeclarations(node: DeclarationWithTypeParameters): readonly TypeParameterDeclaration[];
4191 function getEffectiveConstraintOfTypeParameter(node: TypeParameterDeclaration): TypeNode | undefined;
4192 function isIdentifierOrPrivateIdentifier(node: Node): node is Identifier | PrivateIdentifier;
4193 function isPropertyAccessChain(node: Node): node is PropertyAccessChain;
4194 function isElementAccessChain(node: Node): node is ElementAccessChain;
4195 function isCallChain(node: Node): node is CallChain;
4196 function isOptionalChain(node: Node): node is PropertyAccessChain | ElementAccessChain | CallChain | NonNullChain;
4197 function isNullishCoalesce(node: Node): boolean;
4198 function isConstTypeReference(node: Node): boolean;
4199 function skipPartiallyEmittedExpressions(node: Expression): Expression;
4200 function skipPartiallyEmittedExpressions(node: Node): Node;
4201 function isNonNullChain(node: Node): node is NonNullChain;
4202 function isBreakOrContinueStatement(node: Node): node is BreakOrContinueStatement;
4203 function isNamedExportBindings(node: Node): node is NamedExportBindings;
4204 function isUnparsedTextLike(node: Node): node is UnparsedTextLike;
4205 function isUnparsedNode(node: Node): node is UnparsedNode;
4206 function isJSDocPropertyLikeTag(node: Node): node is JSDocPropertyLikeTag;
4207 /**
4208 * True if node is of some token syntax kind.
4209 * For example, this is true for an IfKeyword but not for an IfStatement.
4210 * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail.
4211 */
4212 function isToken(n: Node): boolean;
4213 function isLiteralExpression(node: Node): node is LiteralExpression;
4214 function isTemplateLiteralToken(node: Node): node is TemplateLiteralToken;
4215 function isTemplateMiddleOrTemplateTail(node: Node): node is TemplateMiddle | TemplateTail;
4216 function isImportOrExportSpecifier(node: Node): node is ImportSpecifier | ExportSpecifier;
4217 function isTypeOnlyImportOrExportDeclaration(node: Node): node is TypeOnlyCompatibleAliasDeclaration;
4218 function isStringTextContainingNode(node: Node): node is StringLiteral | TemplateLiteralToken;
4219 function isModifier(node: Node): node is Modifier;
4220 function isEntityName(node: Node): node is EntityName;
4221 function isPropertyName(node: Node): node is PropertyName;
4222 function isBindingName(node: Node): node is BindingName;
4223 function isFunctionLike(node: Node): node is SignatureDeclaration;
4224 function isClassElement(node: Node): node is ClassElement;
4225 function isClassLike(node: Node): node is ClassLikeDeclaration;
4226 function isAccessor(node: Node): node is AccessorDeclaration;
4227 function isTypeElement(node: Node): node is TypeElement;
4228 function isClassOrTypeElement(node: Node): node is ClassElement | TypeElement;
4229 function isObjectLiteralElementLike(node: Node): node is ObjectLiteralElementLike;
4230 /**
4231 * Node test that determines whether a node is a valid type node.
4232 * This differs from the `isPartOfTypeNode` function which determines whether a node is *part*
4233 * of a TypeNode.
4234 */
4235 function isTypeNode(node: Node): node is TypeNode;
4236 function isFunctionOrConstructorTypeNode(node: Node): node is FunctionTypeNode | ConstructorTypeNode;
4237 function isPropertyAccessOrQualifiedName(node: Node): node is PropertyAccessExpression | QualifiedName;
4238 function isCallLikeExpression(node: Node): node is CallLikeExpression;
4239 function isCallOrNewExpression(node: Node): node is CallExpression | NewExpression;
4240 function isTemplateLiteral(node: Node): node is TemplateLiteral;
4241 function isAssertionExpression(node: Node): node is AssertionExpression;
4242 function isIterationStatement(node: Node, lookInLabeledStatements: false): node is IterationStatement;
4243 function isIterationStatement(node: Node, lookInLabeledStatements: boolean): node is IterationStatement | LabeledStatement;
4244 function isJsxOpeningLikeElement(node: Node): node is JsxOpeningLikeElement;
4245 function isCaseOrDefaultClause(node: Node): node is CaseOrDefaultClause;
4246 /** True if node is of a kind that may contain comment text. */
4247 function isJSDocCommentContainingNode(node: Node): boolean;
4248 function isSetAccessor(node: Node): node is SetAccessorDeclaration;
4249 function isGetAccessor(node: Node): node is GetAccessorDeclaration;
4250 /** True if has initializer node attached to it. */
4251 function hasOnlyExpressionInitializer(node: Node): node is HasExpressionInitializer;
4252 function isObjectLiteralElement(node: Node): node is ObjectLiteralElement;
4253 function isStringLiteralLike(node: Node): node is StringLiteralLike;
4254}
4255declare namespace ts {
4256 const factory: NodeFactory;
4257 function createUnparsedSourceFile(text: string): UnparsedSource;
4258 function createUnparsedSourceFile(inputFile: InputFiles, type: "js" | "dts", stripInternal?: boolean): UnparsedSource;
4259 function createUnparsedSourceFile(text: string, mapPath: string | undefined, map: string | undefined): UnparsedSource;
4260 function createInputFiles(javascriptText: string, declarationText: string): InputFiles;
4261 function createInputFiles(readFileText: (path: string) => string | undefined, javascriptPath: string, javascriptMapPath: string | undefined, declarationPath: string, declarationMapPath: string | undefined, buildInfoPath: string | undefined): InputFiles;
4262 function createInputFiles(javascriptText: string, declarationText: string, javascriptMapPath: string | undefined, javascriptMapText: string | undefined, declarationMapPath: string | undefined, declarationMapText: string | undefined): InputFiles;
4263 /**
4264 * Create an external source map source file reference
4265 */
4266 function createSourceMapSource(fileName: string, text: string, skipTrivia?: (pos: number) => number): SourceMapSource;
4267 function setOriginalNode<T extends Node>(node: T, original: Node | undefined): T;
4268}
4269declare namespace ts {
4270 /**
4271 * Clears any `EmitNode` entries from parse-tree nodes.
4272 * @param sourceFile A source file.
4273 */
4274 function disposeEmitNodes(sourceFile: SourceFile | undefined): void;
4275 /**
4276 * Sets flags that control emit behavior of a node.
4277 */
4278 function setEmitFlags<T extends Node>(node: T, emitFlags: EmitFlags): T;
4279 /**
4280 * Gets a custom text range to use when emitting source maps.
4281 */
4282 function getSourceMapRange(node: Node): SourceMapRange;
4283 /**
4284 * Sets a custom text range to use when emitting source maps.
4285 */
4286 function setSourceMapRange<T extends Node>(node: T, range: SourceMapRange | undefined): T;
4287 /**
4288 * Gets the TextRange to use for source maps for a token of a node.
4289 */
4290 function getTokenSourceMapRange(node: Node, token: SyntaxKind): SourceMapRange | undefined;
4291 /**
4292 * Sets the TextRange to use for source maps for a token of a node.
4293 */
4294 function setTokenSourceMapRange<T extends Node>(node: T, token: SyntaxKind, range: SourceMapRange | undefined): T;
4295 /**
4296 * Gets a custom text range to use when emitting comments.
4297 */
4298 function getCommentRange(node: Node): TextRange;
4299 /**
4300 * Sets a custom text range to use when emitting comments.
4301 */
4302 function setCommentRange<T extends Node>(node: T, range: TextRange): T;
4303 function getSyntheticLeadingComments(node: Node): SynthesizedComment[] | undefined;
4304 function setSyntheticLeadingComments<T extends Node>(node: T, comments: SynthesizedComment[] | undefined): T;
4305 function addSyntheticLeadingComment<T extends Node>(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T;
4306 function getSyntheticTrailingComments(node: Node): SynthesizedComment[] | undefined;
4307 function setSyntheticTrailingComments<T extends Node>(node: T, comments: SynthesizedComment[] | undefined): T;
4308 function addSyntheticTrailingComment<T extends Node>(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T;
4309 function moveSyntheticComments<T extends Node>(node: T, original: Node): T;
4310 /**
4311 * Gets the constant value to emit for an expression representing an enum.
4312 */
4313 function getConstantValue(node: AccessExpression): string | number | undefined;
4314 /**
4315 * Sets the constant value to emit for an expression.
4316 */
4317 function setConstantValue(node: AccessExpression, value: string | number): AccessExpression;
4318 /**
4319 * Adds an EmitHelper to a node.
4320 */
4321 function addEmitHelper<T extends Node>(node: T, helper: EmitHelper): T;
4322 /**
4323 * Add EmitHelpers to a node.
4324 */
4325 function addEmitHelpers<T extends Node>(node: T, helpers: EmitHelper[] | undefined): T;
4326 /**
4327 * Removes an EmitHelper from a node.
4328 */
4329 function removeEmitHelper(node: Node, helper: EmitHelper): boolean;
4330 /**
4331 * Gets the EmitHelpers of a node.
4332 */
4333 function getEmitHelpers(node: Node): EmitHelper[] | undefined;
4334 /**
4335 * Moves matching emit helpers from a source node to a target node.
4336 */
4337 function moveEmitHelpers(source: Node, target: Node, predicate: (helper: EmitHelper) => boolean): void;
4338}
4339declare namespace ts {
4340 function isNumericLiteral(node: Node): node is NumericLiteral;
4341 function isBigIntLiteral(node: Node): node is BigIntLiteral;
4342 function isStringLiteral(node: Node): node is StringLiteral;
4343 function isJsxText(node: Node): node is JsxText;
4344 function isRegularExpressionLiteral(node: Node): node is RegularExpressionLiteral;
4345 function isNoSubstitutionTemplateLiteral(node: Node): node is NoSubstitutionTemplateLiteral;
4346 function isTemplateHead(node: Node): node is TemplateHead;
4347 function isTemplateMiddle(node: Node): node is TemplateMiddle;
4348 function isTemplateTail(node: Node): node is TemplateTail;
4349 function isIdentifier(node: Node): node is Identifier;
4350 function isQualifiedName(node: Node): node is QualifiedName;
4351 function isComputedPropertyName(node: Node): node is ComputedPropertyName;
4352 function isPrivateIdentifier(node: Node): node is PrivateIdentifier;
4353 function isTypeParameterDeclaration(node: Node): node is TypeParameterDeclaration;
4354 function isParameter(node: Node): node is ParameterDeclaration;
4355 function isDecorator(node: Node): node is Decorator;
4356 function isPropertySignature(node: Node): node is PropertySignature;
4357 function isPropertyDeclaration(node: Node): node is PropertyDeclaration;
4358 function isMethodSignature(node: Node): node is MethodSignature;
4359 function isMethodDeclaration(node: Node): node is MethodDeclaration;
4360 function isConstructorDeclaration(node: Node): node is ConstructorDeclaration;
4361 function isGetAccessorDeclaration(node: Node): node is GetAccessorDeclaration;
4362 function isSetAccessorDeclaration(node: Node): node is SetAccessorDeclaration;
4363 function isCallSignatureDeclaration(node: Node): node is CallSignatureDeclaration;
4364 function isConstructSignatureDeclaration(node: Node): node is ConstructSignatureDeclaration;
4365 function isIndexSignatureDeclaration(node: Node): node is IndexSignatureDeclaration;
4366 function isTypePredicateNode(node: Node): node is TypePredicateNode;
4367 function isTypeReferenceNode(node: Node): node is TypeReferenceNode;
4368 function isFunctionTypeNode(node: Node): node is FunctionTypeNode;
4369 function isConstructorTypeNode(node: Node): node is ConstructorTypeNode;
4370 function isTypeQueryNode(node: Node): node is TypeQueryNode;
4371 function isTypeLiteralNode(node: Node): node is TypeLiteralNode;
4372 function isArrayTypeNode(node: Node): node is ArrayTypeNode;
4373 function isTupleTypeNode(node: Node): node is TupleTypeNode;
4374 function isNamedTupleMember(node: Node): node is NamedTupleMember;
4375 function isOptionalTypeNode(node: Node): node is OptionalTypeNode;
4376 function isRestTypeNode(node: Node): node is RestTypeNode;
4377 function isUnionTypeNode(node: Node): node is UnionTypeNode;
4378 function isIntersectionTypeNode(node: Node): node is IntersectionTypeNode;
4379 function isConditionalTypeNode(node: Node): node is ConditionalTypeNode;
4380 function isInferTypeNode(node: Node): node is InferTypeNode;
4381 function isParenthesizedTypeNode(node: Node): node is ParenthesizedTypeNode;
4382 function isThisTypeNode(node: Node): node is ThisTypeNode;
4383 function isTypeOperatorNode(node: Node): node is TypeOperatorNode;
4384 function isIndexedAccessTypeNode(node: Node): node is IndexedAccessTypeNode;
4385 function isMappedTypeNode(node: Node): node is MappedTypeNode;
4386 function isLiteralTypeNode(node: Node): node is LiteralTypeNode;
4387 function isImportTypeNode(node: Node): node is ImportTypeNode;
4388 function isTemplateLiteralTypeSpan(node: Node): node is TemplateLiteralTypeSpan;
4389 function isTemplateLiteralTypeNode(node: Node): node is TemplateLiteralTypeNode;
4390 function isObjectBindingPattern(node: Node): node is ObjectBindingPattern;
4391 function isArrayBindingPattern(node: Node): node is ArrayBindingPattern;
4392 function isBindingElement(node: Node): node is BindingElement;
4393 function isArrayLiteralExpression(node: Node): node is ArrayLiteralExpression;
4394 function isObjectLiteralExpression(node: Node): node is ObjectLiteralExpression;
4395 function isPropertyAccessExpression(node: Node): node is PropertyAccessExpression;
4396 function isElementAccessExpression(node: Node): node is ElementAccessExpression;
4397 function isCallExpression(node: Node): node is CallExpression;
4398 function isNewExpression(node: Node): node is NewExpression;
4399 function isTaggedTemplateExpression(node: Node): node is TaggedTemplateExpression;
4400 function isTypeAssertionExpression(node: Node): node is TypeAssertion;
4401 function isParenthesizedExpression(node: Node): node is ParenthesizedExpression;
4402 function isFunctionExpression(node: Node): node is FunctionExpression;
4403 function isArrowFunction(node: Node): node is ArrowFunction;
4404 function isDeleteExpression(node: Node): node is DeleteExpression;
4405 function isTypeOfExpression(node: Node): node is TypeOfExpression;
4406 function isVoidExpression(node: Node): node is VoidExpression;
4407 function isAwaitExpression(node: Node): node is AwaitExpression;
4408 function isPrefixUnaryExpression(node: Node): node is PrefixUnaryExpression;
4409 function isPostfixUnaryExpression(node: Node): node is PostfixUnaryExpression;
4410 function isBinaryExpression(node: Node): node is BinaryExpression;
4411 function isConditionalExpression(node: Node): node is ConditionalExpression;
4412 function isTemplateExpression(node: Node): node is TemplateExpression;
4413 function isYieldExpression(node: Node): node is YieldExpression;
4414 function isSpreadElement(node: Node): node is SpreadElement;
4415 function isClassExpression(node: Node): node is ClassExpression;
4416 function isOmittedExpression(node: Node): node is OmittedExpression;
4417 function isExpressionWithTypeArguments(node: Node): node is ExpressionWithTypeArguments;
4418 function isAsExpression(node: Node): node is AsExpression;
4419 function isNonNullExpression(node: Node): node is NonNullExpression;
4420 function isMetaProperty(node: Node): node is MetaProperty;
4421 function isSyntheticExpression(node: Node): node is SyntheticExpression;
4422 function isPartiallyEmittedExpression(node: Node): node is PartiallyEmittedExpression;
4423 function isCommaListExpression(node: Node): node is CommaListExpression;
4424 function isTemplateSpan(node: Node): node is TemplateSpan;
4425 function isSemicolonClassElement(node: Node): node is SemicolonClassElement;
4426 function isBlock(node: Node): node is Block;
4427 function isVariableStatement(node: Node): node is VariableStatement;
4428 function isEmptyStatement(node: Node): node is EmptyStatement;
4429 function isExpressionStatement(node: Node): node is ExpressionStatement;
4430 function isIfStatement(node: Node): node is IfStatement;
4431 function isDoStatement(node: Node): node is DoStatement;
4432 function isWhileStatement(node: Node): node is WhileStatement;
4433 function isForStatement(node: Node): node is ForStatement;
4434 function isForInStatement(node: Node): node is ForInStatement;
4435 function isForOfStatement(node: Node): node is ForOfStatement;
4436 function isContinueStatement(node: Node): node is ContinueStatement;
4437 function isBreakStatement(node: Node): node is BreakStatement;
4438 function isReturnStatement(node: Node): node is ReturnStatement;
4439 function isWithStatement(node: Node): node is WithStatement;
4440 function isSwitchStatement(node: Node): node is SwitchStatement;
4441 function isLabeledStatement(node: Node): node is LabeledStatement;
4442 function isThrowStatement(node: Node): node is ThrowStatement;
4443 function isTryStatement(node: Node): node is TryStatement;
4444 function isDebuggerStatement(node: Node): node is DebuggerStatement;
4445 function isVariableDeclaration(node: Node): node is VariableDeclaration;
4446 function isVariableDeclarationList(node: Node): node is VariableDeclarationList;
4447 function isFunctionDeclaration(node: Node): node is FunctionDeclaration;
4448 function isClassDeclaration(node: Node): node is ClassDeclaration;
4449 function isInterfaceDeclaration(node: Node): node is InterfaceDeclaration;
4450 function isTypeAliasDeclaration(node: Node): node is TypeAliasDeclaration;
4451 function isEnumDeclaration(node: Node): node is EnumDeclaration;
4452 function isModuleDeclaration(node: Node): node is ModuleDeclaration;
4453 function isModuleBlock(node: Node): node is ModuleBlock;
4454 function isCaseBlock(node: Node): node is CaseBlock;
4455 function isNamespaceExportDeclaration(node: Node): node is NamespaceExportDeclaration;
4456 function isImportEqualsDeclaration(node: Node): node is ImportEqualsDeclaration;
4457 function isImportDeclaration(node: Node): node is ImportDeclaration;
4458 function isImportClause(node: Node): node is ImportClause;
4459 function isNamespaceImport(node: Node): node is NamespaceImport;
4460 function isNamespaceExport(node: Node): node is NamespaceExport;
4461 function isNamedImports(node: Node): node is NamedImports;
4462 function isImportSpecifier(node: Node): node is ImportSpecifier;
4463 function isExportAssignment(node: Node): node is ExportAssignment;
4464 function isExportDeclaration(node: Node): node is ExportDeclaration;
4465 function isNamedExports(node: Node): node is NamedExports;
4466 function isExportSpecifier(node: Node): node is ExportSpecifier;
4467 function isMissingDeclaration(node: Node): node is MissingDeclaration;
4468 function isNotEmittedStatement(node: Node): node is NotEmittedStatement;
4469 function isExternalModuleReference(node: Node): node is ExternalModuleReference;
4470 function isJsxElement(node: Node): node is JsxElement;
4471 function isJsxSelfClosingElement(node: Node): node is JsxSelfClosingElement;
4472 function isJsxOpeningElement(node: Node): node is JsxOpeningElement;
4473 function isJsxClosingElement(node: Node): node is JsxClosingElement;
4474 function isJsxFragment(node: Node): node is JsxFragment;
4475 function isJsxOpeningFragment(node: Node): node is JsxOpeningFragment;
4476 function isJsxClosingFragment(node: Node): node is JsxClosingFragment;
4477 function isJsxAttribute(node: Node): node is JsxAttribute;
4478 function isJsxAttributes(node: Node): node is JsxAttributes;
4479 function isJsxSpreadAttribute(node: Node): node is JsxSpreadAttribute;
4480 function isJsxExpression(node: Node): node is JsxExpression;
4481 function isCaseClause(node: Node): node is CaseClause;
4482 function isDefaultClause(node: Node): node is DefaultClause;
4483 function isHeritageClause(node: Node): node is HeritageClause;
4484 function isCatchClause(node: Node): node is CatchClause;
4485 function isPropertyAssignment(node: Node): node is PropertyAssignment;
4486 function isShorthandPropertyAssignment(node: Node): node is ShorthandPropertyAssignment;
4487 function isSpreadAssignment(node: Node): node is SpreadAssignment;
4488 function isEnumMember(node: Node): node is EnumMember;
4489 function isUnparsedPrepend(node: Node): node is UnparsedPrepend;
4490 function isSourceFile(node: Node): node is SourceFile;
4491 function isBundle(node: Node): node is Bundle;
4492 function isUnparsedSource(node: Node): node is UnparsedSource;
4493 function isJSDocTypeExpression(node: Node): node is JSDocTypeExpression;
4494 function isJSDocNameReference(node: Node): node is JSDocNameReference;
4495 function isJSDocAllType(node: Node): node is JSDocAllType;
4496 function isJSDocUnknownType(node: Node): node is JSDocUnknownType;
4497 function isJSDocNullableType(node: Node): node is JSDocNullableType;
4498 function isJSDocNonNullableType(node: Node): node is JSDocNonNullableType;
4499 function isJSDocOptionalType(node: Node): node is JSDocOptionalType;
4500 function isJSDocFunctionType(node: Node): node is JSDocFunctionType;
4501 function isJSDocVariadicType(node: Node): node is JSDocVariadicType;
4502 function isJSDocNamepathType(node: Node): node is JSDocNamepathType;
4503 function isJSDoc(node: Node): node is JSDoc;
4504 function isJSDocTypeLiteral(node: Node): node is JSDocTypeLiteral;
4505 function isJSDocSignature(node: Node): node is JSDocSignature;
4506 function isJSDocAugmentsTag(node: Node): node is JSDocAugmentsTag;
4507 function isJSDocAuthorTag(node: Node): node is JSDocAuthorTag;
4508 function isJSDocClassTag(node: Node): node is JSDocClassTag;
4509 function isJSDocCallbackTag(node: Node): node is JSDocCallbackTag;
4510 function isJSDocPublicTag(node: Node): node is JSDocPublicTag;
4511 function isJSDocPrivateTag(node: Node): node is JSDocPrivateTag;
4512 function isJSDocProtectedTag(node: Node): node is JSDocProtectedTag;
4513 function isJSDocReadonlyTag(node: Node): node is JSDocReadonlyTag;
4514 function isJSDocDeprecatedTag(node: Node): node is JSDocDeprecatedTag;
4515 function isJSDocSeeTag(node: Node): node is JSDocSeeTag;
4516 function isJSDocEnumTag(node: Node): node is JSDocEnumTag;
4517 function isJSDocParameterTag(node: Node): node is JSDocParameterTag;
4518 function isJSDocReturnTag(node: Node): node is JSDocReturnTag;
4519 function isJSDocThisTag(node: Node): node is JSDocThisTag;
4520 function isJSDocTypeTag(node: Node): node is JSDocTypeTag;
4521 function isJSDocTemplateTag(node: Node): node is JSDocTemplateTag;
4522 function isJSDocTypedefTag(node: Node): node is JSDocTypedefTag;
4523 function isJSDocUnknownTag(node: Node): node is JSDocUnknownTag;
4524 function isJSDocPropertyTag(node: Node): node is JSDocPropertyTag;
4525 function isJSDocImplementsTag(node: Node): node is JSDocImplementsTag;
4526}
4527declare namespace ts {
4528 function setTextRange<T extends TextRange>(range: T, location: TextRange | undefined): T;
4529}
4530declare namespace ts {
4531 /**
4532 * Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes
4533 * stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise,
4534 * embedded arrays are flattened and the 'cbNode' callback is invoked for each element. If a callback returns
4535 * a truthy value, iteration stops and that value is returned. Otherwise, undefined is returned.
4536 *
4537 * @param node a given node to visit its children
4538 * @param cbNode a callback to be invoked for all child nodes
4539 * @param cbNodes a callback to be invoked for embedded array
4540 *
4541 * @remarks `forEachChild` must visit the children of a node in the order
4542 * that they appear in the source code. The language service depends on this property to locate nodes by position.
4543 */
4544 export function forEachChild<T>(node: Node, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined;
4545 export function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean, scriptKind?: ScriptKind): SourceFile;
4546 export function parseIsolatedEntityName(text: string, languageVersion: ScriptTarget): EntityName | undefined;
4547 /**
4548 * Parse json text into SyntaxTree and return node and parse errors if any
4549 * @param fileName
4550 * @param sourceText
4551 */
4552 export function parseJsonText(fileName: string, sourceText: string): JsonSourceFile;
4553 export function isExternalModule(file: SourceFile): boolean;
4554 export function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
4555 export {};
4556}
4557declare namespace ts {
4558 export function parseCommandLine(commandLine: readonly string[], readFile?: (path: string) => string | undefined): ParsedCommandLine;
4559 export type DiagnosticReporter = (diagnostic: Diagnostic) => void;
4560 /**
4561 * Reports config file diagnostics
4562 */
4563 export interface ConfigFileDiagnosticsReporter {
4564 /**
4565 * Reports unrecoverable error when parsing config file
4566 */
4567 onUnRecoverableConfigFileDiagnostic: DiagnosticReporter;
4568 }
4569 /**
4570 * Interface extending ParseConfigHost to support ParseConfigFile that reads config file and reports errors
4571 */
4572 export interface ParseConfigFileHost extends ParseConfigHost, ConfigFileDiagnosticsReporter {
4573 getCurrentDirectory(): string;
4574 }
4575 /**
4576 * Reads the config file, reports errors if any and exits if the config file cannot be found
4577 */
4578 export function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions, host: ParseConfigFileHost, extendedConfigCache?: Map<ExtendedConfigCacheEntry>, watchOptionsToExtend?: WatchOptions, extraFileExtensions?: readonly FileExtensionInfo[]): ParsedCommandLine | undefined;
4579 /**
4580 * Read tsconfig.json file
4581 * @param fileName The path to the config file
4582 */
4583 export function readConfigFile(fileName: string, readFile: (path: string) => string | undefined): {
4584 config?: any;
4585 error?: Diagnostic;
4586 };
4587 /**
4588 * Parse the text of the tsconfig.json file
4589 * @param fileName The path to the config file
4590 * @param jsonText The text of the config file
4591 */
4592 export function parseConfigFileTextToJson(fileName: string, jsonText: string): {
4593 config?: any;
4594 error?: Diagnostic;
4595 };
4596 /**
4597 * Read tsconfig.json file
4598 * @param fileName The path to the config file
4599 */
4600 export function readJsonConfigFile(fileName: string, readFile: (path: string) => string | undefined): TsConfigSourceFile;
4601 /**
4602 * Convert the json syntax tree into the json value
4603 */
4604 export function convertToObject(sourceFile: JsonSourceFile, errors: Push<Diagnostic>): any;
4605 /**
4606 * Parse the contents of a config file (tsconfig.json).
4607 * @param json The contents of the config file to parse
4608 * @param host Instance of ParseConfigHost used to enumerate files in folder.
4609 * @param basePath A root directory to resolve relative path entries in the config
4610 * file to. e.g. outDir
4611 */
4612 export function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: readonly FileExtensionInfo[], extendedConfigCache?: Map<ExtendedConfigCacheEntry>, existingWatchOptions?: WatchOptions): ParsedCommandLine;
4613 /**
4614 * Parse the contents of a config file (tsconfig.json).
4615 * @param jsonNode The contents of the config file to parse
4616 * @param host Instance of ParseConfigHost used to enumerate files in folder.
4617 * @param basePath A root directory to resolve relative path entries in the config
4618 * file to. e.g. outDir
4619 */
4620 export function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: readonly FileExtensionInfo[], extendedConfigCache?: Map<ExtendedConfigCacheEntry>, existingWatchOptions?: WatchOptions): ParsedCommandLine;
4621 export interface ParsedTsconfig {
4622 raw: any;
4623 options?: CompilerOptions;
4624 watchOptions?: WatchOptions;
4625 typeAcquisition?: TypeAcquisition;
4626 /**
4627 * Note that the case of the config path has not yet been normalized, as no files have been imported into the project yet
4628 */
4629 extendedConfigPath?: string;
4630 }
4631 export interface ExtendedConfigCacheEntry {
4632 extendedResult: TsConfigSourceFile;
4633 extendedConfig: ParsedTsconfig | undefined;
4634 }
4635 export function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
4636 options: CompilerOptions;
4637 errors: Diagnostic[];
4638 };
4639 export function convertTypeAcquisitionFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
4640 options: TypeAcquisition;
4641 errors: Diagnostic[];
4642 };
4643 export {};
4644}
4645declare namespace ts {
4646 function getEffectiveTypeRoots(options: CompilerOptions, host: GetEffectiveTypeRootsHost): string[] | undefined;
4647 /**
4648 * @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown.
4649 * This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups
4650 * is assumed to be the same as root directory of the project.
4651 */
4652 function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference): ResolvedTypeReferenceDirectiveWithFailedLookupLocations;
4653 /**
4654 * Given a set of options, returns the set of type directive names
4655 * that should be included for this program automatically.
4656 * This list could either come from the config file,
4657 * or from enumerating the types root + initial secondary types lookup location.
4658 * More type directives might appear in the program later as a result of loading actual source files;
4659 * this list is only the set of defaults that are implicitly included.
4660 */
4661 function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[];
4662 /**
4663 * Cached module resolutions per containing directory.
4664 * This assumes that any module id will have the same resolution for sibling files located in the same folder.
4665 */
4666 interface ModuleResolutionCache extends NonRelativeModuleNameResolutionCache {
4667 getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference): Map<ResolvedModuleWithFailedLookupLocations>;
4668 }
4669 /**
4670 * Stored map from non-relative module name to a table: directory -> result of module lookup in this directory
4671 * We support only non-relative module names because resolution of relative module names is usually more deterministic and thus less expensive.
4672 */
4673 interface NonRelativeModuleNameResolutionCache {
4674 getOrCreateCacheForModuleName(nonRelativeModuleName: string, redirectedReference?: ResolvedProjectReference): PerModuleNameCache;
4675 }
4676 interface PerModuleNameCache {
4677 get(directory: string): ResolvedModuleWithFailedLookupLocations | undefined;
4678 set(directory: string, result: ResolvedModuleWithFailedLookupLocations): void;
4679 }
4680 function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions): ModuleResolutionCache;
4681 function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations | undefined;
4682 function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
4683 function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
4684 function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
4685}
4686declare namespace ts {
4687 /**
4688 * Visits a Node using the supplied visitor, possibly returning a new Node in its place.
4689 *
4690 * @param node The Node to visit.
4691 * @param visitor The callback used to visit the Node.
4692 * @param test A callback to execute to verify the Node is valid.
4693 * @param lift An optional callback to execute to lift a NodeArray into a valid Node.
4694 */
4695 function visitNode<T extends Node>(node: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T;
4696 /**
4697 * Visits a Node using the supplied visitor, possibly returning a new Node in its place.
4698 *
4699 * @param node The Node to visit.
4700 * @param visitor The callback used to visit the Node.
4701 * @param test A callback to execute to verify the Node is valid.
4702 * @param lift An optional callback to execute to lift a NodeArray into a valid Node.
4703 */
4704 function visitNode<T extends Node>(node: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T | undefined;
4705 /**
4706 * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
4707 *
4708 * @param nodes The NodeArray to visit.
4709 * @param visitor The callback used to visit a Node.
4710 * @param test A node test to execute for each node.
4711 * @param start An optional value indicating the starting offset at which to start visiting.
4712 * @param count An optional value indicating the maximum number of nodes to visit.
4713 */
4714 function visitNodes<T extends Node>(nodes: NodeArray<T>, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T>;
4715 /**
4716 * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
4717 *
4718 * @param nodes The NodeArray to visit.
4719 * @param visitor The callback used to visit a Node.
4720 * @param test A node test to execute for each node.
4721 * @param start An optional value indicating the starting offset at which to start visiting.
4722 * @param count An optional value indicating the maximum number of nodes to visit.
4723 */
4724 function visitNodes<T extends Node>(nodes: NodeArray<T> | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T> | undefined;
4725 /**
4726 * Starts a new lexical environment and visits a statement list, ending the lexical environment
4727 * and merging hoisted declarations upon completion.
4728 */
4729 function visitLexicalEnvironment(statements: NodeArray<Statement>, visitor: Visitor, context: TransformationContext, start?: number, ensureUseStrict?: boolean, nodesVisitor?: NodesVisitor): NodeArray<Statement>;
4730 /**
4731 * Starts a new lexical environment and visits a parameter list, suspending the lexical
4732 * environment upon completion.
4733 */
4734 function visitParameterList(nodes: NodeArray<ParameterDeclaration>, visitor: Visitor, context: TransformationContext, nodesVisitor?: NodesVisitor): NodeArray<ParameterDeclaration>;
4735 function visitParameterList(nodes: NodeArray<ParameterDeclaration> | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: NodesVisitor): NodeArray<ParameterDeclaration> | undefined;
4736 /**
4737 * Resumes a suspended lexical environment and visits a function body, ending the lexical
4738 * environment and merging hoisted declarations upon completion.
4739 */
4740 function visitFunctionBody(node: FunctionBody, visitor: Visitor, context: TransformationContext): FunctionBody;
4741 /**
4742 * Resumes a suspended lexical environment and visits a function body, ending the lexical
4743 * environment and merging hoisted declarations upon completion.
4744 */
4745 function visitFunctionBody(node: FunctionBody | undefined, visitor: Visitor, context: TransformationContext): FunctionBody | undefined;
4746 /**
4747 * Resumes a suspended lexical environment and visits a concise body, ending the lexical
4748 * environment and merging hoisted declarations upon completion.
4749 */
4750 function visitFunctionBody(node: ConciseBody, visitor: Visitor, context: TransformationContext): ConciseBody;
4751 /**
4752 * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.
4753 *
4754 * @param node The Node whose children will be visited.
4755 * @param visitor The callback used to visit each child.
4756 * @param context A lexical environment context for the visitor.
4757 */
4758 function visitEachChild<T extends Node>(node: T, visitor: Visitor, context: TransformationContext): T;
4759 /**
4760 * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.
4761 *
4762 * @param node The Node whose children will be visited.
4763 * @param visitor The callback used to visit each child.
4764 * @param context A lexical environment context for the visitor.
4765 */
4766 function visitEachChild<T extends Node>(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined;
4767}
4768declare namespace ts {
4769 function getTsBuildInfoEmitOutputFilePath(options: CompilerOptions): string | undefined;
4770 function getOutputFileNames(commandLine: ParsedCommandLine, inputFileName: string, ignoreCase: boolean): readonly string[];
4771 function createPrinter(printerOptions?: PrinterOptions, handlers?: PrintHandlers): Printer;
4772}
4773declare namespace ts {
4774 export function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string | undefined;
4775 export function resolveTripleslashReference(moduleName: string, containingFile: string): string;
4776 export function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
4777 export function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
4778 export interface FormatDiagnosticsHost {
4779 getCurrentDirectory(): string;
4780 getCanonicalFileName(fileName: string): string;
4781 getNewLine(): string;
4782 }
4783 export function formatDiagnostics(diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost): string;
4784 export function formatDiagnostic(diagnostic: Diagnostic, host: FormatDiagnosticsHost): string;
4785 export function formatDiagnosticsWithColorAndContext(diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost): string;
4786 export function flattenDiagnosticMessageText(diag: string | DiagnosticMessageChain | undefined, newLine: string, indent?: number): string;
4787 export function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): readonly Diagnostic[];
4788 /**
4789 * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions'
4790 * that represent a compilation unit.
4791 *
4792 * Creating a program proceeds from a set of root files, expanding the set of inputs by following imports and
4793 * triple-slash-reference-path directives transitively. '@types' and triple-slash-reference-types are also pulled in.
4794 *
4795 * @param createProgramOptions - The options for creating a program.
4796 * @returns A 'Program' object.
4797 */
4798 export function createProgram(createProgramOptions: CreateProgramOptions): Program;
4799 /**
4800 * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions'
4801 * that represent a compilation unit.
4802 *
4803 * Creating a program proceeds from a set of root files, expanding the set of inputs by following imports and
4804 * triple-slash-reference-path directives transitively. '@types' and triple-slash-reference-types are also pulled in.
4805 *
4806 * @param rootNames - A set of root files.
4807 * @param options - The compiler options which should be used.
4808 * @param host - The host interacts with the underlying file system.
4809 * @param oldProgram - Reuses an old program structure.
4810 * @param configFileParsingDiagnostics - error during config file parsing
4811 * @returns A 'Program' object.
4812 */
4813 export function createProgram(rootNames: readonly string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program, configFileParsingDiagnostics?: readonly Diagnostic[]): Program;
4814 /** @deprecated */ export interface ResolveProjectReferencePathHost {
4815 fileExists(fileName: string): boolean;
4816 }
4817 /**
4818 * Returns the target config filename of a project reference.
4819 * Note: The file might not exist.
4820 */
4821 export function resolveProjectReferencePath(ref: ProjectReference): ResolvedConfigFileName;
4822 /** @deprecated */ export function resolveProjectReferencePath(host: ResolveProjectReferencePathHost, ref: ProjectReference): ResolvedConfigFileName;
4823 export {};
4824}
4825declare namespace ts {
4826 interface EmitOutput {
4827 outputFiles: OutputFile[];
4828 emitSkipped: boolean;
4829 }
4830 interface OutputFile {
4831 name: string;
4832 writeByteOrderMark: boolean;
4833 text: string;
4834 }
4835}
4836declare namespace ts {
4837 type AffectedFileResult<T> = {
4838 result: T;
4839 affected: SourceFile | Program;
4840 } | undefined;
4841 interface BuilderProgramHost {
4842 /**
4843 * return true if file names are treated with case sensitivity
4844 */
4845 useCaseSensitiveFileNames(): boolean;
4846 /**
4847 * If provided this would be used this hash instead of actual file shape text for detecting changes
4848 */
4849 createHash?: (data: string) => string;
4850 /**
4851 * When emit or emitNextAffectedFile are called without writeFile,
4852 * this callback if present would be used to write files
4853 */
4854 writeFile?: WriteFileCallback;
4855 }
4856 /**
4857 * Builder to manage the program state changes
4858 */
4859 interface BuilderProgram {
4860 /**
4861 * Returns current program
4862 */
4863 getProgram(): Program;
4864 /**
4865 * Get compiler options of the program
4866 */
4867 getCompilerOptions(): CompilerOptions;
4868 /**
4869 * Get the source file in the program with file name
4870 */
4871 getSourceFile(fileName: string): SourceFile | undefined;
4872 /**
4873 * Get a list of files in the program
4874 */
4875 getSourceFiles(): readonly SourceFile[];
4876 /**
4877 * Get the diagnostics for compiler options
4878 */
4879 getOptionsDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
4880 /**
4881 * Get the diagnostics that dont belong to any file
4882 */
4883 getGlobalDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
4884 /**
4885 * Get the diagnostics from config file parsing
4886 */
4887 getConfigFileParsingDiagnostics(): readonly Diagnostic[];
4888 /**
4889 * Get the syntax diagnostics, for all source files if source file is not supplied
4890 */
4891 getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
4892 /**
4893 * Get the declaration diagnostics, for all source files if source file is not supplied
4894 */
4895 getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[];
4896 /**
4897 * Get all the dependencies of the file
4898 */
4899 getAllDependencies(sourceFile: SourceFile): readonly string[];
4900 /**
4901 * Gets the semantic diagnostics from the program corresponding to this state of file (if provided) or whole program
4902 * The semantic diagnostics are cached and managed here
4903 * Note that it is assumed that when asked about semantic diagnostics through this API,
4904 * the file has been taken out of affected files so it is safe to use cache or get from program and cache the diagnostics
4905 * In case of SemanticDiagnosticsBuilderProgram if the source file is not provided,
4906 * it will iterate through all the affected files, to ensure that cache stays valid and yet provide a way to get all semantic diagnostics
4907 */
4908 getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
4909 /**
4910 * Emits the JavaScript and declaration files.
4911 * When targetSource file is specified, emits the files corresponding to that source file,
4912 * otherwise for the whole program.
4913 * In case of EmitAndSemanticDiagnosticsBuilderProgram, when targetSourceFile is specified,
4914 * it is assumed that that file is handled from affected file list. If targetSourceFile is not specified,
4915 * it will only emit all the affected files instead of whole program
4916 *
4917 * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host
4918 * in that order would be used to write the files
4919 */
4920 emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult;
4921 /**
4922 * Get the current directory of the program
4923 */
4924 getCurrentDirectory(): string;
4925 }
4926 /**
4927 * The builder that caches the semantic diagnostics for the program and handles the changed files and affected files
4928 */
4929 interface SemanticDiagnosticsBuilderProgram extends BuilderProgram {
4930 /**
4931 * Gets the semantic diagnostics from the program for the next affected file and caches it
4932 * Returns undefined if the iteration is complete
4933 */
4934 getSemanticDiagnosticsOfNextAffectedFile(cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean): AffectedFileResult<readonly Diagnostic[]>;
4935 }
4936 /**
4937 * The builder that can handle the changes in program and iterate through changed file to emit the files
4938 * The semantic diagnostics are cached per file and managed by clearing for the changed/affected files
4939 */
4940 interface EmitAndSemanticDiagnosticsBuilderProgram extends SemanticDiagnosticsBuilderProgram {
4941 /**
4942 * Emits the next affected file's emit result (EmitResult and sourceFiles emitted) or returns undefined if iteration is complete
4943 * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host
4944 * in that order would be used to write the files
4945 */
4946 emitNextAffectedFile(writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): AffectedFileResult<EmitResult>;
4947 }
4948 /**
4949 * Create the builder to manage semantic diagnostics and cache them
4950 */
4951 function createSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[]): SemanticDiagnosticsBuilderProgram;
4952 function createSemanticDiagnosticsBuilderProgram(rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]): SemanticDiagnosticsBuilderProgram;
4953 /**
4954 * Create the builder that can handle the changes in program and iterate through changed files
4955 * to emit the those files and manage semantic diagnostics cache as well
4956 */
4957 function createEmitAndSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[]): EmitAndSemanticDiagnosticsBuilderProgram;
4958 function createEmitAndSemanticDiagnosticsBuilderProgram(rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]): EmitAndSemanticDiagnosticsBuilderProgram;
4959 /**
4960 * Creates a builder thats just abstraction over program and can be used with watch
4961 */
4962 function createAbstractBuilder(newProgram: Program, host: BuilderProgramHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[]): BuilderProgram;
4963 function createAbstractBuilder(rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]): BuilderProgram;
4964}
4965declare namespace ts {
4966 interface ReadBuildProgramHost {
4967 useCaseSensitiveFileNames(): boolean;
4968 getCurrentDirectory(): string;
4969 readFile(fileName: string): string | undefined;
4970 }
4971 function readBuilderProgram(compilerOptions: CompilerOptions, host: ReadBuildProgramHost): EmitAndSemanticDiagnosticsBuilderProgram | undefined;
4972 function createIncrementalCompilerHost(options: CompilerOptions, system?: System): CompilerHost;
4973 interface IncrementalProgramOptions<T extends BuilderProgram> {
4974 rootNames: readonly string[];
4975 options: CompilerOptions;
4976 configFileParsingDiagnostics?: readonly Diagnostic[];
4977 projectReferences?: readonly ProjectReference[];
4978 host?: CompilerHost;
4979 createProgram?: CreateProgram<T>;
4980 }
4981 function createIncrementalProgram<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>({ rootNames, options, configFileParsingDiagnostics, projectReferences, host, createProgram }: IncrementalProgramOptions<T>): T;
4982 type WatchStatusReporter = (diagnostic: Diagnostic, newLine: string, options: CompilerOptions, errorCount?: number) => void;
4983 /** Create the program with rootNames and options, if they are undefined, oldProgram and new configFile diagnostics create new program */
4984 type CreateProgram<T extends BuilderProgram> = (rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: T, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[] | undefined) => T;
4985 /** Host that has watch functionality used in --watch mode */
4986 interface WatchHost {
4987 /** If provided, called with Diagnostic message that informs about change in watch status */
4988 onWatchStatusChange?(diagnostic: Diagnostic, newLine: string, options: CompilerOptions, errorCount?: number): void;
4989 /** Used to watch changes in source files, missing files needed to update the program or config file */
4990 watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: CompilerOptions): FileWatcher;
4991 /** Used to watch resolved module's failed lookup locations, config file specs, type roots where auto type reference directives are added */
4992 watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: CompilerOptions): FileWatcher;
4993 /** If provided, will be used to set delayed compilation, so that multiple changes in short span are compiled together */
4994 setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
4995 /** If provided, will be used to reset existing delayed compilation */
4996 clearTimeout?(timeoutId: any): void;
4997 }
4998 interface ProgramHost<T extends BuilderProgram> {
4999 /**
5000 * Used to create the program when need for program creation or recreation detected
5001 */
5002 createProgram: CreateProgram<T>;
5003 useCaseSensitiveFileNames(): boolean;
5004 getNewLine(): string;
5005 getCurrentDirectory(): string;
5006 getDefaultLibFileName(options: CompilerOptions): string;
5007 getDefaultLibLocation?(): string;
5008 createHash?(data: string): string;
5009 /**
5010 * Use to check file presence for source files and
5011 * if resolveModuleNames is not provided (complier is in charge of module resolution) then module files as well
5012 */
5013 fileExists(path: string): boolean;
5014 /**
5015 * Use to read file text for source files and
5016 * if resolveModuleNames is not provided (complier is in charge of module resolution) then module files as well
5017 */
5018 readFile(path: string, encoding?: string): string | undefined;
5019 /** If provided, used for module resolution as well as to handle directory structure */
5020 directoryExists?(path: string): boolean;
5021 /** If provided, used in resolutions as well as handling directory structure */
5022 getDirectories?(path: string): string[];
5023 /** If provided, used to cache and handle directory structure modifications */
5024 readDirectory?(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
5025 /** Symbol links resolution */
5026 realpath?(path: string): string;
5027 /** If provided would be used to write log about compilation */
5028 trace?(s: string): void;
5029 /** If provided is used to get the environment variable */
5030 getEnvironmentVariable?(name: string): string | undefined;
5031 /** If provided, used to resolve the module names, otherwise typescript's default module resolution */
5032 resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedModule | undefined)[];
5033 /** If provided, used to resolve type reference directives, otherwise typescript's default resolution */
5034 resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
5035 }
5036 interface WatchCompilerHost<T extends BuilderProgram> extends ProgramHost<T>, WatchHost {
5037 /** Instead of using output d.ts file from project reference, use its source file */
5038 useSourceOfProjectReferenceRedirect?(): boolean;
5039 /** If provided, callback to invoke after every new program creation */
5040 afterProgramCreate?(program: T): void;
5041 }
5042 /**
5043 * Host to create watch with root files and options
5044 */
5045 interface WatchCompilerHostOfFilesAndCompilerOptions<T extends BuilderProgram> extends WatchCompilerHost<T> {
5046 /** root files to use to generate program */
5047 rootFiles: string[];
5048 /** Compiler options */
5049 options: CompilerOptions;
5050 watchOptions?: WatchOptions;
5051 /** Project References */
5052 projectReferences?: readonly ProjectReference[];
5053 }
5054 /**
5055 * Host to create watch with config file
5056 */
5057 interface WatchCompilerHostOfConfigFile<T extends BuilderProgram> extends WatchCompilerHost<T>, ConfigFileDiagnosticsReporter {
5058 /** Name of the config file to compile */
5059 configFileName: string;
5060 /** Options to extend */
5061 optionsToExtend?: CompilerOptions;
5062 watchOptionsToExtend?: WatchOptions;
5063 extraFileExtensions?: readonly FileExtensionInfo[];
5064 /**
5065 * Used to generate source file names from the config file and its include, exclude, files rules
5066 * and also to cache the directory stucture
5067 */
5068 readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
5069 }
5070 interface Watch<T> {
5071 /** Synchronize with host and get updated program */
5072 getProgram(): T;
5073 /** Closes the watch */
5074 close(): void;
5075 }
5076 /**
5077 * Creates the watch what generates program using the config file
5078 */
5079 interface WatchOfConfigFile<T> extends Watch<T> {
5080 }
5081 /**
5082 * Creates the watch that generates program using the root files and compiler options
5083 */
5084 interface WatchOfFilesAndCompilerOptions<T> extends Watch<T> {
5085 /** Updates the root files in the program, only if this is not config file compilation */
5086 updateRootFileNames(fileNames: string[]): void;
5087 }
5088 /**
5089 * Create the watch compiler host for either configFile or fileNames and its options
5090 */
5091 function createWatchCompilerHost<T extends BuilderProgram>(configFileName: string, optionsToExtend: CompilerOptions | undefined, system: System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter, watchOptionsToExtend?: WatchOptions, extraFileExtensions?: readonly FileExtensionInfo[]): WatchCompilerHostOfConfigFile<T>;
5092 function createWatchCompilerHost<T extends BuilderProgram>(rootFiles: string[], options: CompilerOptions, system: System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter, projectReferences?: readonly ProjectReference[], watchOptions?: WatchOptions): WatchCompilerHostOfFilesAndCompilerOptions<T>;
5093 /**
5094 * Creates the watch from the host for root files and compiler options
5095 */
5096 function createWatchProgram<T extends BuilderProgram>(host: WatchCompilerHostOfFilesAndCompilerOptions<T>): WatchOfFilesAndCompilerOptions<T>;
5097 /**
5098 * Creates the watch from the host for config file
5099 */
5100 function createWatchProgram<T extends BuilderProgram>(host: WatchCompilerHostOfConfigFile<T>): WatchOfConfigFile<T>;
5101}
5102declare namespace ts {
5103 interface BuildOptions {
5104 dry?: boolean;
5105 force?: boolean;
5106 verbose?: boolean;
5107 incremental?: boolean;
5108 assumeChangesOnlyAffectDirectDependencies?: boolean;
5109 traceResolution?: boolean;
5110 [option: string]: CompilerOptionsValue | undefined;
5111 }
5112 type ReportEmitErrorSummary = (errorCount: number) => void;
5113 interface SolutionBuilderHostBase<T extends BuilderProgram> extends ProgramHost<T> {
5114 createDirectory?(path: string): void;
5115 /**
5116 * Should provide create directory and writeFile if done of invalidatedProjects is not invoked with
5117 * writeFileCallback
5118 */
5119 writeFile?(path: string, data: string, writeByteOrderMark?: boolean): void;
5120 getModifiedTime(fileName: string): Date | undefined;
5121 setModifiedTime(fileName: string, date: Date): void;
5122 deleteFile(fileName: string): void;
5123 getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
5124 reportDiagnostic: DiagnosticReporter;
5125 reportSolutionBuilderStatus: DiagnosticReporter;
5126 afterProgramEmitAndDiagnostics?(program: T): void;
5127 }
5128 interface SolutionBuilderHost<T extends BuilderProgram> extends SolutionBuilderHostBase<T> {
5129 reportErrorSummary?: ReportEmitErrorSummary;
5130 }
5131 interface SolutionBuilderWithWatchHost<T extends BuilderProgram> extends SolutionBuilderHostBase<T>, WatchHost {
5132 }
5133 interface SolutionBuilder<T extends BuilderProgram> {
5134 build(project?: string, cancellationToken?: CancellationToken): ExitStatus;
5135 clean(project?: string): ExitStatus;
5136 buildReferences(project: string, cancellationToken?: CancellationToken): ExitStatus;
5137 cleanReferences(project?: string): ExitStatus;
5138 getNextInvalidatedProject(cancellationToken?: CancellationToken): InvalidatedProject<T> | undefined;
5139 }
5140 /**
5141 * Create a function that reports watch status by writing to the system and handles the formating of the diagnostic
5142 */
5143 function createBuilderStatusReporter(system: System, pretty?: boolean): DiagnosticReporter;
5144 function createSolutionBuilderHost<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>(system?: System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportSolutionBuilderStatus?: DiagnosticReporter, reportErrorSummary?: ReportEmitErrorSummary): SolutionBuilderHost<T>;
5145 function createSolutionBuilderWithWatchHost<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>(system?: System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportSolutionBuilderStatus?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter): SolutionBuilderWithWatchHost<T>;
5146 function createSolutionBuilder<T extends BuilderProgram>(host: SolutionBuilderHost<T>, rootNames: readonly string[], defaultOptions: BuildOptions): SolutionBuilder<T>;
5147 function createSolutionBuilderWithWatch<T extends BuilderProgram>(host: SolutionBuilderWithWatchHost<T>, rootNames: readonly string[], defaultOptions: BuildOptions, baseWatchOptions?: WatchOptions): SolutionBuilder<T>;
5148 enum InvalidatedProjectKind {
5149 Build = 0,
5150 UpdateBundle = 1,
5151 UpdateOutputFileStamps = 2
5152 }
5153 interface InvalidatedProjectBase {
5154 readonly kind: InvalidatedProjectKind;
5155 readonly project: ResolvedConfigFileName;
5156 /**
5157 * To dispose this project and ensure that all the necessary actions are taken and state is updated accordingly
5158 */
5159 done(cancellationToken?: CancellationToken, writeFile?: WriteFileCallback, customTransformers?: CustomTransformers): ExitStatus;
5160 getCompilerOptions(): CompilerOptions;
5161 getCurrentDirectory(): string;
5162 }
5163 interface UpdateOutputFileStampsProject extends InvalidatedProjectBase {
5164 readonly kind: InvalidatedProjectKind.UpdateOutputFileStamps;
5165 updateOutputFileStatmps(): void;
5166 }
5167 interface BuildInvalidedProject<T extends BuilderProgram> extends InvalidatedProjectBase {
5168 readonly kind: InvalidatedProjectKind.Build;
5169 getBuilderProgram(): T | undefined;
5170 getProgram(): Program | undefined;
5171 getSourceFile(fileName: string): SourceFile | undefined;
5172 getSourceFiles(): readonly SourceFile[];
5173 getOptionsDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
5174 getGlobalDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
5175 getConfigFileParsingDiagnostics(): readonly Diagnostic[];
5176 getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
5177 getAllDependencies(sourceFile: SourceFile): readonly string[];
5178 getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
5179 getSemanticDiagnosticsOfNextAffectedFile(cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean): AffectedFileResult<readonly Diagnostic[]>;
5180 emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult | undefined;
5181 }
5182 interface UpdateBundleProject<T extends BuilderProgram> extends InvalidatedProjectBase {
5183 readonly kind: InvalidatedProjectKind.UpdateBundle;
5184 emit(writeFile?: WriteFileCallback, customTransformers?: CustomTransformers): EmitResult | BuildInvalidedProject<T> | undefined;
5185 }
5186 type InvalidatedProject<T extends BuilderProgram> = UpdateOutputFileStampsProject | BuildInvalidedProject<T> | UpdateBundleProject<T>;
5187}
5188declare namespace ts.server {
5189 type ActionSet = "action::set";
5190 type ActionInvalidate = "action::invalidate";
5191 type ActionPackageInstalled = "action::packageInstalled";
5192 type EventTypesRegistry = "event::typesRegistry";
5193 type EventBeginInstallTypes = "event::beginInstallTypes";
5194 type EventEndInstallTypes = "event::endInstallTypes";
5195 type EventInitializationFailed = "event::initializationFailed";
5196}
5197declare namespace ts.server {
5198 interface TypingInstallerResponse {
5199 readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed;
5200 }
5201 interface TypingInstallerRequestWithProjectName {
5202 readonly projectName: string;
5203 }
5204 interface DiscoverTypings extends TypingInstallerRequestWithProjectName {
5205 readonly fileNames: string[];
5206 readonly projectRootPath: Path;
5207 readonly compilerOptions: CompilerOptions;
5208 readonly watchOptions?: WatchOptions;
5209 readonly typeAcquisition: TypeAcquisition;
5210 readonly unresolvedImports: SortedReadonlyArray<string>;
5211 readonly cachePath?: string;
5212 readonly kind: "discover";
5213 }
5214 interface CloseProject extends TypingInstallerRequestWithProjectName {
5215 readonly kind: "closeProject";
5216 }
5217 interface TypesRegistryRequest {
5218 readonly kind: "typesRegistry";
5219 }
5220 interface InstallPackageRequest extends TypingInstallerRequestWithProjectName {
5221 readonly kind: "installPackage";
5222 readonly fileName: Path;
5223 readonly packageName: string;
5224 readonly projectRootPath: Path;
5225 }
5226 interface PackageInstalledResponse extends ProjectResponse {
5227 readonly kind: ActionPackageInstalled;
5228 readonly success: boolean;
5229 readonly message: string;
5230 }
5231 interface InitializationFailedResponse extends TypingInstallerResponse {
5232 readonly kind: EventInitializationFailed;
5233 readonly message: string;
5234 readonly stack?: string;
5235 }
5236 interface ProjectResponse extends TypingInstallerResponse {
5237 readonly projectName: string;
5238 }
5239 interface InvalidateCachedTypings extends ProjectResponse {
5240 readonly kind: ActionInvalidate;
5241 }
5242 interface InstallTypes extends ProjectResponse {
5243 readonly kind: EventBeginInstallTypes | EventEndInstallTypes;
5244 readonly eventId: number;
5245 readonly typingsInstallerVersion: string;
5246 readonly packagesToInstall: readonly string[];
5247 }
5248 interface BeginInstallTypes extends InstallTypes {
5249 readonly kind: EventBeginInstallTypes;
5250 }
5251 interface EndInstallTypes extends InstallTypes {
5252 readonly kind: EventEndInstallTypes;
5253 readonly installSuccess: boolean;
5254 }
5255 interface SetTypings extends ProjectResponse {
5256 readonly typeAcquisition: TypeAcquisition;
5257 readonly compilerOptions: CompilerOptions;
5258 readonly typings: string[];
5259 readonly unresolvedImports: SortedReadonlyArray<string>;
5260 readonly kind: ActionSet;
5261 }
5262}
5263declare namespace ts {
5264 interface Node {
5265 getSourceFile(): SourceFile;
5266 getChildCount(sourceFile?: SourceFile): number;
5267 getChildAt(index: number, sourceFile?: SourceFile): Node;
5268 getChildren(sourceFile?: SourceFile): Node[];
5269 getStart(sourceFile?: SourceFile, includeJsDocComment?: boolean): number;
5270 getFullStart(): number;
5271 getEnd(): number;
5272 getWidth(sourceFile?: SourceFileLike): number;
5273 getFullWidth(): number;
5274 getLeadingTriviaWidth(sourceFile?: SourceFile): number;
5275 getFullText(sourceFile?: SourceFile): string;
5276 getText(sourceFile?: SourceFile): string;
5277 getFirstToken(sourceFile?: SourceFile): Node | undefined;
5278 getLastToken(sourceFile?: SourceFile): Node | undefined;
5279 forEachChild<T>(cbNode: (node: Node) => T | undefined, cbNodeArray?: (nodes: NodeArray<Node>) => T | undefined): T | undefined;
5280 }
5281 interface Identifier {
5282 readonly text: string;
5283 }
5284 interface PrivateIdentifier {
5285 readonly text: string;
5286 }
5287 interface Symbol {
5288 readonly name: string;
5289 getFlags(): SymbolFlags;
5290 getEscapedName(): __String;
5291 getName(): string;
5292 getDeclarations(): Declaration[] | undefined;
5293 getDocumentationComment(typeChecker: TypeChecker | undefined): SymbolDisplayPart[];
5294 getJsDocTags(): JSDocTagInfo[];
5295 }
5296 interface Type {
5297 getFlags(): TypeFlags;
5298 getSymbol(): Symbol | undefined;
5299 getProperties(): Symbol[];
5300 getProperty(propertyName: string): Symbol | undefined;
5301 getApparentProperties(): Symbol[];
5302 getCallSignatures(): readonly Signature[];
5303 getConstructSignatures(): readonly Signature[];
5304 getStringIndexType(): Type | undefined;
5305 getNumberIndexType(): Type | undefined;
5306 getBaseTypes(): BaseType[] | undefined;
5307 getNonNullableType(): Type;
5308 getConstraint(): Type | undefined;
5309 getDefault(): Type | undefined;
5310 isUnion(): this is UnionType;
5311 isIntersection(): this is IntersectionType;
5312 isUnionOrIntersection(): this is UnionOrIntersectionType;
5313 isLiteral(): this is LiteralType;
5314 isStringLiteral(): this is StringLiteralType;
5315 isNumberLiteral(): this is NumberLiteralType;
5316 isTypeParameter(): this is TypeParameter;
5317 isClassOrInterface(): this is InterfaceType;
5318 isClass(): this is InterfaceType;
5319 }
5320 interface TypeReference {
5321 typeArguments?: readonly Type[];
5322 }
5323 interface Signature {
5324 getDeclaration(): SignatureDeclaration;
5325 getTypeParameters(): TypeParameter[] | undefined;
5326 getParameters(): Symbol[];
5327 getReturnType(): Type;
5328 getDocumentationComment(typeChecker: TypeChecker | undefined): SymbolDisplayPart[];
5329 getJsDocTags(): JSDocTagInfo[];
5330 }
5331 interface SourceFile {
5332 getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
5333 getLineEndOfPosition(pos: number): number;
5334 getLineStarts(): readonly number[];
5335 getPositionOfLineAndCharacter(line: number, character: number): number;
5336 update(newText: string, textChangeRange: TextChangeRange): SourceFile;
5337 }
5338 interface SourceFileLike {
5339 getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
5340 }
5341 interface SourceMapSource {
5342 getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
5343 }
5344 /**
5345 * Represents an immutable snapshot of a script at a specified time.Once acquired, the
5346 * snapshot is observably immutable. i.e. the same calls with the same parameters will return
5347 * the same values.
5348 */
5349 interface IScriptSnapshot {
5350 /** Gets a portion of the script snapshot specified by [start, end). */
5351 getText(start: number, end: number): string;
5352 /** Gets the length of this script snapshot. */
5353 getLength(): number;
5354 /**
5355 * Gets the TextChangeRange that describe how the text changed between this text and
5356 * an older version. This information is used by the incremental parser to determine
5357 * what sections of the script need to be re-parsed. 'undefined' can be returned if the
5358 * change range cannot be determined. However, in that case, incremental parsing will
5359 * not happen and the entire document will be re - parsed.
5360 */
5361 getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange | undefined;
5362 /** Releases all resources held by this script snapshot */
5363 dispose?(): void;
5364 }
5365 namespace ScriptSnapshot {
5366 function fromString(text: string): IScriptSnapshot;
5367 }
5368 interface PreProcessedFileInfo {
5369 referencedFiles: FileReference[];
5370 typeReferenceDirectives: FileReference[];
5371 libReferenceDirectives: FileReference[];
5372 importedFiles: FileReference[];
5373 ambientExternalModules?: string[];
5374 isLibFile: boolean;
5375 }
5376 interface HostCancellationToken {
5377 isCancellationRequested(): boolean;
5378 }
5379 interface InstallPackageOptions {
5380 fileName: Path;
5381 packageName: string;
5382 }
5383 interface PerformanceEvent {
5384 kind: "UpdateGraph" | "CreatePackageJsonAutoImportProvider";
5385 durationMs: number;
5386 }
5387 enum LanguageServiceMode {
5388 Semantic = 0,
5389 PartialSemantic = 1,
5390 Syntactic = 2
5391 }
5392 interface LanguageServiceHost extends GetEffectiveTypeRootsHost {
5393 getCompilationSettings(): CompilerOptions;
5394 getNewLine?(): string;
5395 getProjectVersion?(): string;
5396 getScriptFileNames(): string[];
5397 getScriptKind?(fileName: string): ScriptKind;
5398 getScriptVersion(fileName: string): string;
5399 getScriptSnapshot(fileName: string): IScriptSnapshot | undefined;
5400 getProjectReferences?(): readonly ProjectReference[] | undefined;
5401 getLocalizedDiagnosticMessages?(): any;
5402 getCancellationToken?(): HostCancellationToken;
5403 getCurrentDirectory(): string;
5404 getDefaultLibFileName(options: CompilerOptions): string;
5405 log?(s: string): void;
5406 trace?(s: string): void;
5407 error?(s: string): void;
5408 useCaseSensitiveFileNames?(): boolean;
5409 readDirectory?(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
5410 readFile?(path: string, encoding?: string): string | undefined;
5411 realpath?(path: string): string;
5412 fileExists?(path: string): boolean;
5413 getTypeRootsVersion?(): number;
5414 resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedModule | undefined)[];
5415 getResolvedModuleWithFailedLookupLocationsFromCache?(modulename: string, containingFile: string): ResolvedModuleWithFailedLookupLocations | undefined;
5416 resolveTypeReferenceDirectives?(typeDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
5417 getDirectories?(directoryName: string): string[];
5418 /**
5419 * Gets a set of custom transformers to use during emit.
5420 */
5421 getCustomTransformers?(): CustomTransformers | undefined;
5422 isKnownTypesPackageName?(name: string): boolean;
5423 installPackage?(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
5424 writeFile?(fileName: string, content: string): void;
5425 }
5426 type WithMetadata<T> = T & {
5427 metadata?: unknown;
5428 };
5429 enum SemanticClassificationFormat {
5430 Original = "original",
5431 TwentyTwenty = "2020"
5432 }
5433 interface LanguageService {
5434 /** This is used as a part of restarting the language service. */
5435 cleanupSemanticCache(): void;
5436 /**
5437 * Gets errors indicating invalid syntax in a file.
5438 *
5439 * In English, "this cdeo have, erorrs" is syntactically invalid because it has typos,
5440 * grammatical errors, and misplaced punctuation. Likewise, examples of syntax
5441 * errors in TypeScript are missing parentheses in an `if` statement, mismatched
5442 * curly braces, and using a reserved keyword as a variable name.
5443 *
5444 * These diagnostics are inexpensive to compute and don't require knowledge of
5445 * other files. Note that a non-empty result increases the likelihood of false positives
5446 * from `getSemanticDiagnostics`.
5447 *
5448 * While these represent the majority of syntax-related diagnostics, there are some
5449 * that require the type system, which will be present in `getSemanticDiagnostics`.
5450 *
5451 * @param fileName A path to the file you want syntactic diagnostics for
5452 */
5453 getSyntacticDiagnostics(fileName: string): DiagnosticWithLocation[];
5454 /**
5455 * Gets warnings or errors indicating type system issues in a given file.
5456 * Requesting semantic diagnostics may start up the type system and
5457 * run deferred work, so the first call may take longer than subsequent calls.
5458 *
5459 * Unlike the other get*Diagnostics functions, these diagnostics can potentially not
5460 * include a reference to a source file. Specifically, the first time this is called,
5461 * it will return global diagnostics with no associated location.
5462 *
5463 * To contrast the differences between semantic and syntactic diagnostics, consider the
5464 * sentence: "The sun is green." is syntactically correct; those are real English words with
5465 * correct sentence structure. However, it is semantically invalid, because it is not true.
5466 *
5467 * @param fileName A path to the file you want semantic diagnostics for
5468 */
5469 getSemanticDiagnostics(fileName: string): Diagnostic[];
5470 /**
5471 * Gets suggestion diagnostics for a specific file. These diagnostics tend to
5472 * proactively suggest refactors, as opposed to diagnostics that indicate
5473 * potentially incorrect runtime behavior.
5474 *
5475 * @param fileName A path to the file you want semantic diagnostics for
5476 */
5477 getSuggestionDiagnostics(fileName: string): DiagnosticWithLocation[];
5478 /**
5479 * Gets global diagnostics related to the program configuration and compiler options.
5480 */
5481 getCompilerOptionsDiagnostics(): Diagnostic[];
5482 /** @deprecated Use getEncodedSyntacticClassifications instead. */
5483 getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[];
5484 getSyntacticClassifications(fileName: string, span: TextSpan, format: SemanticClassificationFormat): ClassifiedSpan[] | ClassifiedSpan2020[];
5485 /** @deprecated Use getEncodedSemanticClassifications instead. */
5486 getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[];
5487 getSemanticClassifications(fileName: string, span: TextSpan, format: SemanticClassificationFormat): ClassifiedSpan[] | ClassifiedSpan2020[];
5488 /** Encoded as triples of [start, length, ClassificationType]. */
5489 getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications;
5490 /**
5491 * Gets semantic highlights information for a particular file. Has two formats, an older
5492 * version used by VS and a format used by VS Code.
5493 *
5494 * @param fileName The path to the file
5495 * @param position A text span to return results within
5496 * @param format Which format to use, defaults to "original"
5497 * @returns a number array encoded as triples of [start, length, ClassificationType, ...].
5498 */
5499 getEncodedSemanticClassifications(fileName: string, span: TextSpan, format?: SemanticClassificationFormat): Classifications;
5500 /**
5501 * Gets completion entries at a particular position in a file.
5502 *
5503 * @param fileName The path to the file
5504 * @param position A zero-based index of the character where you want the entries
5505 * @param options An object describing how the request was triggered and what kinds
5506 * of code actions can be returned with the completions.
5507 */
5508 getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined): WithMetadata<CompletionInfo> | undefined;
5509 /**
5510 * Gets the extended details for a completion entry retrieved from `getCompletionsAtPosition`.
5511 *
5512 * @param fileName The path to the file
5513 * @param position A zero based index of the character where you want the entries
5514 * @param entryName The name from an existing completion which came from `getCompletionsAtPosition`
5515 * @param formatOptions How should code samples in the completions be formatted, can be undefined for backwards compatibility
5516 * @param source Source code for the current file, can be undefined for backwards compatibility
5517 * @param preferences User settings, can be undefined for backwards compatibility
5518 */
5519 getCompletionEntryDetails(fileName: string, position: number, entryName: string, formatOptions: FormatCodeOptions | FormatCodeSettings | undefined, source: string | undefined, preferences: UserPreferences | undefined): CompletionEntryDetails | undefined;
5520 getCompletionEntrySymbol(fileName: string, position: number, name: string, source: string | undefined): Symbol | undefined;
5521 /**
5522 * Gets semantic information about the identifier at a particular position in a
5523 * file. Quick info is what you typically see when you hover in an editor.
5524 *
5525 * @param fileName The path to the file
5526 * @param position A zero-based index of the character where you want the quick info
5527 */
5528 getQuickInfoAtPosition(fileName: string, position: number): QuickInfo | undefined;
5529 getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan | undefined;
5530 getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan | undefined;
5531 getSignatureHelpItems(fileName: string, position: number, options: SignatureHelpItemsOptions | undefined): SignatureHelpItems | undefined;
5532 getRenameInfo(fileName: string, position: number, options?: RenameInfoOptions): RenameInfo;
5533 findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename?: boolean): readonly RenameLocation[] | undefined;
5534 getSmartSelectionRange(fileName: string, position: number): SelectionRange;
5535 getDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined;
5536 getDefinitionAndBoundSpan(fileName: string, position: number): DefinitionInfoAndBoundSpan | undefined;
5537 getTypeDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined;
5538 getImplementationAtPosition(fileName: string, position: number): readonly ImplementationLocation[] | undefined;
5539 getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[] | undefined;
5540 findReferences(fileName: string, position: number): ReferencedSymbol[] | undefined;
5541 getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): DocumentHighlights[] | undefined;
5542 getFileReferences(fileName: string): ReferenceEntry[];
5543 /** @deprecated */
5544 getOccurrencesAtPosition(fileName: string, position: number): readonly ReferenceEntry[] | undefined;
5545 getNavigateToItems(searchValue: string, maxResultCount?: number, fileName?: string, excludeDtsFiles?: boolean): NavigateToItem[];
5546 getNavigationBarItems(fileName: string): NavigationBarItem[];
5547 getNavigationTree(fileName: string): NavigationTree;
5548 prepareCallHierarchy(fileName: string, position: number): CallHierarchyItem | CallHierarchyItem[] | undefined;
5549 provideCallHierarchyIncomingCalls(fileName: string, position: number): CallHierarchyIncomingCall[];
5550 provideCallHierarchyOutgoingCalls(fileName: string, position: number): CallHierarchyOutgoingCall[];
5551 getOutliningSpans(fileName: string): OutliningSpan[];
5552 getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[];
5553 getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[];
5554 getIndentationAtPosition(fileName: string, position: number, options: EditorOptions | EditorSettings): number;
5555 getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
5556 getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
5557 getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
5558 getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions): TextInsertion | undefined;
5559 isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean;
5560 /**
5561 * This will return a defined result if the position is after the `>` of the opening tag, or somewhere in the text, of a JSXElement with no closing tag.
5562 * Editors should call this after `>` is typed.
5563 */
5564 getJsxClosingTagAtPosition(fileName: string, position: number): JsxClosingTagInfo | undefined;
5565 getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan | undefined;
5566 toLineColumnOffset?(fileName: string, position: number): LineAndCharacter;
5567 getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: readonly number[], formatOptions: FormatCodeSettings, preferences: UserPreferences): readonly CodeFixAction[];
5568 getCombinedCodeFix(scope: CombinedCodeFixScope, fixId: {}, formatOptions: FormatCodeSettings, preferences: UserPreferences): CombinedCodeActions;
5569 applyCodeActionCommand(action: CodeActionCommand, formatSettings?: FormatCodeSettings): Promise<ApplyCodeActionCommandResult>;
5570 applyCodeActionCommand(action: CodeActionCommand[], formatSettings?: FormatCodeSettings): Promise<ApplyCodeActionCommandResult[]>;
5571 applyCodeActionCommand(action: CodeActionCommand | CodeActionCommand[], formatSettings?: FormatCodeSettings): Promise<ApplyCodeActionCommandResult | ApplyCodeActionCommandResult[]>;
5572 /** @deprecated `fileName` will be ignored */
5573 applyCodeActionCommand(fileName: string, action: CodeActionCommand): Promise<ApplyCodeActionCommandResult>;
5574 /** @deprecated `fileName` will be ignored */
5575 applyCodeActionCommand(fileName: string, action: CodeActionCommand[]): Promise<ApplyCodeActionCommandResult[]>;
5576 /** @deprecated `fileName` will be ignored */
5577 applyCodeActionCommand(fileName: string, action: CodeActionCommand | CodeActionCommand[]): Promise<ApplyCodeActionCommandResult | ApplyCodeActionCommandResult[]>;
5578 getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined, triggerReason?: RefactorTriggerReason, kind?: string): ApplicableRefactorInfo[];
5579 getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | undefined): RefactorEditInfo | undefined;
5580 organizeImports(scope: OrganizeImportsScope, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[];
5581 getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[];
5582 getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean, forceDtsEmit?: boolean): EmitOutput;
5583 getProgram(): Program | undefined;
5584 toggleLineComment(fileName: string, textRange: TextRange): TextChange[];
5585 toggleMultilineComment(fileName: string, textRange: TextRange): TextChange[];
5586 commentSelection(fileName: string, textRange: TextRange): TextChange[];
5587 uncommentSelection(fileName: string, textRange: TextRange): TextChange[];
5588 dispose(): void;
5589 }
5590 interface JsxClosingTagInfo {
5591 readonly newText: string;
5592 }
5593 interface CombinedCodeFixScope {
5594 type: "file";
5595 fileName: string;
5596 }
5597 type OrganizeImportsScope = CombinedCodeFixScope;
5598 type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<" | "#";
5599 interface GetCompletionsAtPositionOptions extends UserPreferences {
5600 /**
5601 * If the editor is asking for completions because a certain character was typed
5602 * (as opposed to when the user explicitly requested them) this should be set.
5603 */
5604 triggerCharacter?: CompletionsTriggerCharacter;
5605 /** @deprecated Use includeCompletionsForModuleExports */
5606 includeExternalModuleExports?: boolean;
5607 /** @deprecated Use includeCompletionsWithInsertText */
5608 includeInsertTextCompletions?: boolean;
5609 }
5610 type SignatureHelpTriggerCharacter = "," | "(" | "<";
5611 type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")";
5612 interface SignatureHelpItemsOptions {
5613 triggerReason?: SignatureHelpTriggerReason;
5614 }
5615 type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason;
5616 /**
5617 * Signals that the user manually requested signature help.
5618 * The language service will unconditionally attempt to provide a result.
5619 */
5620 interface SignatureHelpInvokedReason {
5621 kind: "invoked";
5622 triggerCharacter?: undefined;
5623 }
5624 /**
5625 * Signals that the signature help request came from a user typing a character.
5626 * Depending on the character and the syntactic context, the request may or may not be served a result.
5627 */
5628 interface SignatureHelpCharacterTypedReason {
5629 kind: "characterTyped";
5630 /**
5631 * Character that was responsible for triggering signature help.
5632 */
5633 triggerCharacter: SignatureHelpTriggerCharacter;
5634 }
5635 /**
5636 * Signals that this signature help request came from typing a character or moving the cursor.
5637 * This should only occur if a signature help session was already active and the editor needs to see if it should adjust.
5638 * The language service will unconditionally attempt to provide a result.
5639 * `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move.
5640 */
5641 interface SignatureHelpRetriggeredReason {
5642 kind: "retrigger";
5643 /**
5644 * Character that was responsible for triggering signature help.
5645 */
5646 triggerCharacter?: SignatureHelpRetriggerCharacter;
5647 }
5648 interface ApplyCodeActionCommandResult {
5649 successMessage: string;
5650 }
5651 interface Classifications {
5652 spans: number[];
5653 endOfLineState: EndOfLineState;
5654 }
5655 interface ClassifiedSpan {
5656 textSpan: TextSpan;
5657 classificationType: ClassificationTypeNames;
5658 }
5659 interface ClassifiedSpan2020 {
5660 textSpan: TextSpan;
5661 classificationType: number;
5662 }
5663 /**
5664 * Navigation bar interface designed for visual studio's dual-column layout.
5665 * This does not form a proper tree.
5666 * The navbar is returned as a list of top-level items, each of which has a list of child items.
5667 * Child items always have an empty array for their `childItems`.
5668 */
5669 interface NavigationBarItem {
5670 text: string;
5671 kind: ScriptElementKind;
5672 kindModifiers: string;
5673 spans: TextSpan[];
5674 childItems: NavigationBarItem[];
5675 indent: number;
5676 bolded: boolean;
5677 grayed: boolean;
5678 }
5679 /**
5680 * Node in a tree of nested declarations in a file.
5681 * The top node is always a script or module node.
5682 */
5683 interface NavigationTree {
5684 /** Name of the declaration, or a short description, e.g. "<class>". */
5685 text: string;
5686 kind: ScriptElementKind;
5687 /** ScriptElementKindModifier separated by commas, e.g. "public,abstract" */
5688 kindModifiers: string;
5689 /**
5690 * Spans of the nodes that generated this declaration.
5691 * There will be more than one if this is the result of merging.
5692 */
5693 spans: TextSpan[];
5694 nameSpan: TextSpan | undefined;
5695 /** Present if non-empty */
5696 childItems?: NavigationTree[];
5697 }
5698 interface CallHierarchyItem {
5699 name: string;
5700 kind: ScriptElementKind;
5701 kindModifiers?: string;
5702 file: string;
5703 span: TextSpan;
5704 selectionSpan: TextSpan;
5705 containerName?: string;
5706 }
5707 interface CallHierarchyIncomingCall {
5708 from: CallHierarchyItem;
5709 fromSpans: TextSpan[];
5710 }
5711 interface CallHierarchyOutgoingCall {
5712 to: CallHierarchyItem;
5713 fromSpans: TextSpan[];
5714 }
5715 interface TodoCommentDescriptor {
5716 text: string;
5717 priority: number;
5718 }
5719 interface TodoComment {
5720 descriptor: TodoCommentDescriptor;
5721 message: string;
5722 position: number;
5723 }
5724 interface TextChange {
5725 span: TextSpan;
5726 newText: string;
5727 }
5728 interface FileTextChanges {
5729 fileName: string;
5730 textChanges: readonly TextChange[];
5731 isNewFile?: boolean;
5732 }
5733 interface CodeAction {
5734 /** Description of the code action to display in the UI of the editor */
5735 description: string;
5736 /** Text changes to apply to each file as part of the code action */
5737 changes: FileTextChanges[];
5738 /**
5739 * If the user accepts the code fix, the editor should send the action back in a `applyAction` request.
5740 * This allows the language service to have side effects (e.g. installing dependencies) upon a code fix.
5741 */
5742 commands?: CodeActionCommand[];
5743 }
5744 interface CodeFixAction extends CodeAction {
5745 /** Short name to identify the fix, for use by telemetry. */
5746 fixName: string;
5747 /**
5748 * If present, one may call 'getCombinedCodeFix' with this fixId.
5749 * This may be omitted to indicate that the code fix can't be applied in a group.
5750 */
5751 fixId?: {};
5752 fixAllDescription?: string;
5753 }
5754 interface CombinedCodeActions {
5755 changes: readonly FileTextChanges[];
5756 commands?: readonly CodeActionCommand[];
5757 }
5758 type CodeActionCommand = InstallPackageAction;
5759 interface InstallPackageAction {
5760 }
5761 /**
5762 * A set of one or more available refactoring actions, grouped under a parent refactoring.
5763 */
5764 interface ApplicableRefactorInfo {
5765 /**
5766 * The programmatic name of the refactoring
5767 */
5768 name: string;
5769 /**
5770 * A description of this refactoring category to show to the user.
5771 * If the refactoring gets inlined (see below), this text will not be visible.
5772 */
5773 description: string;
5774 /**
5775 * Inlineable refactorings can have their actions hoisted out to the top level
5776 * of a context menu. Non-inlineanable refactorings should always be shown inside
5777 * their parent grouping.
5778 *
5779 * If not specified, this value is assumed to be 'true'
5780 */
5781 inlineable?: boolean;
5782 actions: RefactorActionInfo[];
5783 }
5784 /**
5785 * Represents a single refactoring action - for example, the "Extract Method..." refactor might
5786 * offer several actions, each corresponding to a surround class or closure to extract into.
5787 */
5788 interface RefactorActionInfo {
5789 /**
5790 * The programmatic name of the refactoring action
5791 */
5792 name: string;
5793 /**
5794 * A description of this refactoring action to show to the user.
5795 * If the parent refactoring is inlined away, this will be the only text shown,
5796 * so this description should make sense by itself if the parent is inlineable=true
5797 */
5798 description: string;
5799 /**
5800 * A message to show to the user if the refactoring cannot be applied in
5801 * the current context.
5802 */
5803 notApplicableReason?: string;
5804 /**
5805 * The hierarchical dotted name of the refactor action.
5806 */
5807 kind?: string;
5808 }
5809 /**
5810 * A set of edits to make in response to a refactor action, plus an optional
5811 * location where renaming should be invoked from
5812 */
5813 interface RefactorEditInfo {
5814 edits: FileTextChanges[];
5815 renameFilename?: string;
5816 renameLocation?: number;
5817 commands?: CodeActionCommand[];
5818 }
5819 type RefactorTriggerReason = "implicit" | "invoked";
5820 interface TextInsertion {
5821 newText: string;
5822 /** The position in newText the caret should point to after the insertion. */
5823 caretOffset: number;
5824 }
5825 interface DocumentSpan {
5826 textSpan: TextSpan;
5827 fileName: string;
5828 /**
5829 * If the span represents a location that was remapped (e.g. via a .d.ts.map file),
5830 * then the original filename and span will be specified here
5831 */
5832 originalTextSpan?: TextSpan;
5833 originalFileName?: string;
5834 /**
5835 * If DocumentSpan.textSpan is the span for name of the declaration,
5836 * then this is the span for relevant declaration
5837 */
5838 contextSpan?: TextSpan;
5839 originalContextSpan?: TextSpan;
5840 }
5841 interface RenameLocation extends DocumentSpan {
5842 readonly prefixText?: string;
5843 readonly suffixText?: string;
5844 }
5845 interface ReferenceEntry extends DocumentSpan {
5846 isWriteAccess: boolean;
5847 isDefinition: boolean;
5848 isInString?: true;
5849 }
5850 interface ImplementationLocation extends DocumentSpan {
5851 kind: ScriptElementKind;
5852 displayParts: SymbolDisplayPart[];
5853 }
5854 enum HighlightSpanKind {
5855 none = "none",
5856 definition = "definition",
5857 reference = "reference",
5858 writtenReference = "writtenReference"
5859 }
5860 interface HighlightSpan {
5861 fileName?: string;
5862 isInString?: true;
5863 textSpan: TextSpan;
5864 contextSpan?: TextSpan;
5865 kind: HighlightSpanKind;
5866 }
5867 interface NavigateToItem {
5868 name: string;
5869 kind: ScriptElementKind;
5870 kindModifiers: string;
5871 matchKind: "exact" | "prefix" | "substring" | "camelCase";
5872 isCaseSensitive: boolean;
5873 fileName: string;
5874 textSpan: TextSpan;
5875 containerName: string;
5876 containerKind: ScriptElementKind;
5877 }
5878 enum IndentStyle {
5879 None = 0,
5880 Block = 1,
5881 Smart = 2
5882 }
5883 enum SemicolonPreference {
5884 Ignore = "ignore",
5885 Insert = "insert",
5886 Remove = "remove"
5887 }
5888 interface EditorOptions {
5889 BaseIndentSize?: number;
5890 IndentSize: number;
5891 TabSize: number;
5892 NewLineCharacter: string;
5893 ConvertTabsToSpaces: boolean;
5894 IndentStyle: IndentStyle;
5895 }
5896 interface EditorSettings {
5897 baseIndentSize?: number;
5898 indentSize?: number;
5899 tabSize?: number;
5900 newLineCharacter?: string;
5901 convertTabsToSpaces?: boolean;
5902 indentStyle?: IndentStyle;
5903 trimTrailingWhitespace?: boolean;
5904 }
5905 interface FormatCodeOptions extends EditorOptions {
5906 InsertSpaceAfterCommaDelimiter: boolean;
5907 InsertSpaceAfterSemicolonInForStatements: boolean;
5908 InsertSpaceBeforeAndAfterBinaryOperators: boolean;
5909 InsertSpaceAfterConstructor?: boolean;
5910 InsertSpaceAfterKeywordsInControlFlowStatements: boolean;
5911 InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean;
5912 InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean;
5913 InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: boolean;
5914 InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
5915 InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean;
5916 InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
5917 InsertSpaceAfterTypeAssertion?: boolean;
5918 InsertSpaceBeforeFunctionParenthesis?: boolean;
5919 PlaceOpenBraceOnNewLineForFunctions: boolean;
5920 PlaceOpenBraceOnNewLineForControlBlocks: boolean;
5921 insertSpaceBeforeTypeAnnotation?: boolean;
5922 }
5923 interface FormatCodeSettings extends EditorSettings {
5924 readonly insertSpaceAfterCommaDelimiter?: boolean;
5925 readonly insertSpaceAfterSemicolonInForStatements?: boolean;
5926 readonly insertSpaceBeforeAndAfterBinaryOperators?: boolean;
5927 readonly insertSpaceAfterConstructor?: boolean;
5928 readonly insertSpaceAfterKeywordsInControlFlowStatements?: boolean;
5929 readonly insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean;
5930 readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean;
5931 readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean;
5932 readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
5933 readonly insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean;
5934 readonly insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean;
5935 readonly insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
5936 readonly insertSpaceAfterTypeAssertion?: boolean;
5937 readonly insertSpaceBeforeFunctionParenthesis?: boolean;
5938 readonly placeOpenBraceOnNewLineForFunctions?: boolean;
5939 readonly placeOpenBraceOnNewLineForControlBlocks?: boolean;
5940 readonly insertSpaceBeforeTypeAnnotation?: boolean;
5941 readonly indentMultiLineObjectLiteralBeginningOnBlankLine?: boolean;
5942 readonly semicolons?: SemicolonPreference;
5943 }
5944 function getDefaultFormatCodeSettings(newLineCharacter?: string): FormatCodeSettings;
5945 interface DefinitionInfo extends DocumentSpan {
5946 kind: ScriptElementKind;
5947 name: string;
5948 containerKind: ScriptElementKind;
5949 containerName: string;
5950 }
5951 interface DefinitionInfoAndBoundSpan {
5952 definitions?: readonly DefinitionInfo[];
5953 textSpan: TextSpan;
5954 }
5955 interface ReferencedSymbolDefinitionInfo extends DefinitionInfo {
5956 displayParts: SymbolDisplayPart[];
5957 }
5958 interface ReferencedSymbol {
5959 definition: ReferencedSymbolDefinitionInfo;
5960 references: ReferenceEntry[];
5961 }
5962 enum SymbolDisplayPartKind {
5963 aliasName = 0,
5964 className = 1,
5965 enumName = 2,
5966 fieldName = 3,
5967 interfaceName = 4,
5968 keyword = 5,
5969 lineBreak = 6,
5970 numericLiteral = 7,
5971 stringLiteral = 8,
5972 localName = 9,
5973 methodName = 10,
5974 moduleName = 11,
5975 operator = 12,
5976 parameterName = 13,
5977 propertyName = 14,
5978 punctuation = 15,
5979 space = 16,
5980 text = 17,
5981 typeParameterName = 18,
5982 enumMemberName = 19,
5983 functionName = 20,
5984 regularExpressionLiteral = 21
5985 }
5986 interface SymbolDisplayPart {
5987 text: string;
5988 kind: string;
5989 }
5990 interface JSDocTagInfo {
5991 name: string;
5992 text?: string;
5993 }
5994 interface QuickInfo {
5995 kind: ScriptElementKind;
5996 kindModifiers: string;
5997 textSpan: TextSpan;
5998 displayParts?: SymbolDisplayPart[];
5999 documentation?: SymbolDisplayPart[];
6000 tags?: JSDocTagInfo[];
6001 }
6002 type RenameInfo = RenameInfoSuccess | RenameInfoFailure;
6003 interface RenameInfoSuccess {
6004 canRename: true;
6005 /**
6006 * File or directory to rename.
6007 * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`.
6008 */
6009 fileToRename?: string;
6010 displayName: string;
6011 fullDisplayName: string;
6012 kind: ScriptElementKind;
6013 kindModifiers: string;
6014 triggerSpan: TextSpan;
6015 }
6016 interface RenameInfoFailure {
6017 canRename: false;
6018 localizedErrorMessage: string;
6019 }
6020 interface RenameInfoOptions {
6021 readonly allowRenameOfImportPath?: boolean;
6022 }
6023 interface DocCommentTemplateOptions {
6024 readonly generateReturnInDocTemplate?: boolean;
6025 }
6026 interface SignatureHelpParameter {
6027 name: string;
6028 documentation: SymbolDisplayPart[];
6029 displayParts: SymbolDisplayPart[];
6030 isOptional: boolean;
6031 isRest?: boolean;
6032 }
6033 interface SelectionRange {
6034 textSpan: TextSpan;
6035 parent?: SelectionRange;
6036 }
6037 /**
6038 * Represents a single signature to show in signature help.
6039 * The id is used for subsequent calls into the language service to ask questions about the
6040 * signature help item in the context of any documents that have been updated. i.e. after
6041 * an edit has happened, while signature help is still active, the host can ask important
6042 * questions like 'what parameter is the user currently contained within?'.
6043 */
6044 interface SignatureHelpItem {
6045 isVariadic: boolean;
6046 prefixDisplayParts: SymbolDisplayPart[];
6047 suffixDisplayParts: SymbolDisplayPart[];
6048 separatorDisplayParts: SymbolDisplayPart[];
6049 parameters: SignatureHelpParameter[];
6050 documentation: SymbolDisplayPart[];
6051 tags: JSDocTagInfo[];
6052 }
6053 /**
6054 * Represents a set of signature help items, and the preferred item that should be selected.
6055 */
6056 interface SignatureHelpItems {
6057 items: SignatureHelpItem[];
6058 applicableSpan: TextSpan;
6059 selectedItemIndex: number;
6060 argumentIndex: number;
6061 argumentCount: number;
6062 }
6063 interface CompletionInfo {
6064 /** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */
6065 isGlobalCompletion: boolean;
6066 isMemberCompletion: boolean;
6067 /**
6068 * In the absence of `CompletionEntry["replacementSpan"], the editor may choose whether to use
6069 * this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span
6070 * must be used to commit that completion entry.
6071 */
6072 optionalReplacementSpan?: TextSpan;
6073 /**
6074 * true when the current location also allows for a new identifier
6075 */
6076 isNewIdentifierLocation: boolean;
6077 entries: CompletionEntry[];
6078 }
6079 interface CompletionEntry {
6080 name: string;
6081 kind: ScriptElementKind;
6082 kindModifiers?: string;
6083 sortText: string;
6084 insertText?: string;
6085 /**
6086 * An optional span that indicates the text to be replaced by this completion item.
6087 * If present, this span should be used instead of the default one.
6088 * It will be set if the required span differs from the one generated by the default replacement behavior.
6089 */
6090 replacementSpan?: TextSpan;
6091 hasAction?: true;
6092 source?: string;
6093 isRecommended?: true;
6094 isFromUncheckedFile?: true;
6095 isPackageJsonImport?: true;
6096 }
6097 interface CompletionEntryDetails {
6098 name: string;
6099 kind: ScriptElementKind;
6100 kindModifiers: string;
6101 displayParts: SymbolDisplayPart[];
6102 documentation?: SymbolDisplayPart[];
6103 tags?: JSDocTagInfo[];
6104 codeActions?: CodeAction[];
6105 source?: SymbolDisplayPart[];
6106 }
6107 interface OutliningSpan {
6108 /** The span of the document to actually collapse. */
6109 textSpan: TextSpan;
6110 /** The span of the document to display when the user hovers over the collapsed span. */
6111 hintSpan: TextSpan;
6112 /** The text to display in the editor for the collapsed region. */
6113 bannerText: string;
6114 /**
6115 * Whether or not this region should be automatically collapsed when
6116 * the 'Collapse to Definitions' command is invoked.
6117 */
6118 autoCollapse: boolean;
6119 /**
6120 * Classification of the contents of the span
6121 */
6122 kind: OutliningSpanKind;
6123 }
6124 enum OutliningSpanKind {
6125 /** Single or multi-line comments */
6126 Comment = "comment",
6127 /** Sections marked by '// #region' and '// #endregion' comments */
6128 Region = "region",
6129 /** Declarations and expressions */
6130 Code = "code",
6131 /** Contiguous blocks of import declarations */
6132 Imports = "imports"
6133 }
6134 enum OutputFileType {
6135 JavaScript = 0,
6136 SourceMap = 1,
6137 Declaration = 2
6138 }
6139 enum EndOfLineState {
6140 None = 0,
6141 InMultiLineCommentTrivia = 1,
6142 InSingleQuoteStringLiteral = 2,
6143 InDoubleQuoteStringLiteral = 3,
6144 InTemplateHeadOrNoSubstitutionTemplate = 4,
6145 InTemplateMiddleOrTail = 5,
6146 InTemplateSubstitutionPosition = 6
6147 }
6148 enum TokenClass {
6149 Punctuation = 0,
6150 Keyword = 1,
6151 Operator = 2,
6152 Comment = 3,
6153 Whitespace = 4,
6154 Identifier = 5,
6155 NumberLiteral = 6,
6156 BigIntLiteral = 7,
6157 StringLiteral = 8,
6158 RegExpLiteral = 9
6159 }
6160 interface ClassificationResult {
6161 finalLexState: EndOfLineState;
6162 entries: ClassificationInfo[];
6163 }
6164 interface ClassificationInfo {
6165 length: number;
6166 classification: TokenClass;
6167 }
6168 interface Classifier {
6169 /**
6170 * Gives lexical classifications of tokens on a line without any syntactic context.
6171 * For instance, a token consisting of the text 'string' can be either an identifier
6172 * named 'string' or the keyword 'string', however, because this classifier is not aware,
6173 * it relies on certain heuristics to give acceptable results. For classifications where
6174 * speed trumps accuracy, this function is preferable; however, for true accuracy, the
6175 * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the
6176 * lexical, syntactic, and semantic classifiers may issue the best user experience.
6177 *
6178 * @param text The text of a line to classify.
6179 * @param lexState The state of the lexical classifier at the end of the previous line.
6180 * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier.
6181 * If there is no syntactic classifier (syntacticClassifierAbsent=true),
6182 * certain heuristics may be used in its place; however, if there is a
6183 * syntactic classifier (syntacticClassifierAbsent=false), certain
6184 * classifications which may be incorrectly categorized will be given
6185 * back as Identifiers in order to allow the syntactic classifier to
6186 * subsume the classification.
6187 * @deprecated Use getLexicalClassifications instead.
6188 */
6189 getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult;
6190 getEncodedLexicalClassifications(text: string, endOfLineState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications;
6191 }
6192 enum ScriptElementKind {
6193 unknown = "",
6194 warning = "warning",
6195 /** predefined type (void) or keyword (class) */
6196 keyword = "keyword",
6197 /** top level script node */
6198 scriptElement = "script",
6199 /** module foo {} */
6200 moduleElement = "module",
6201 /** class X {} */
6202 classElement = "class",
6203 /** var x = class X {} */
6204 localClassElement = "local class",
6205 /** interface Y {} */
6206 interfaceElement = "interface",
6207 /** type T = ... */
6208 typeElement = "type",
6209 /** enum E */
6210 enumElement = "enum",
6211 enumMemberElement = "enum member",
6212 /**
6213 * Inside module and script only
6214 * const v = ..
6215 */
6216 variableElement = "var",
6217 /** Inside function */
6218 localVariableElement = "local var",
6219 /**
6220 * Inside module and script only
6221 * function f() { }
6222 */
6223 functionElement = "function",
6224 /** Inside function */
6225 localFunctionElement = "local function",
6226 /** class X { [public|private]* foo() {} } */
6227 memberFunctionElement = "method",
6228 /** class X { [public|private]* [get|set] foo:number; } */
6229 memberGetAccessorElement = "getter",
6230 memberSetAccessorElement = "setter",
6231 /**
6232 * class X { [public|private]* foo:number; }
6233 * interface Y { foo:number; }
6234 */
6235 memberVariableElement = "property",
6236 /** class X { constructor() { } } */
6237 constructorImplementationElement = "constructor",
6238 /** interface Y { ():number; } */
6239 callSignatureElement = "call",
6240 /** interface Y { []:number; } */
6241 indexSignatureElement = "index",
6242 /** interface Y { new():Y; } */
6243 constructSignatureElement = "construct",
6244 /** function foo(*Y*: string) */
6245 parameterElement = "parameter",
6246 typeParameterElement = "type parameter",
6247 primitiveType = "primitive type",
6248 label = "label",
6249 alias = "alias",
6250 constElement = "const",
6251 letElement = "let",
6252 directory = "directory",
6253 externalModuleName = "external module name",
6254 /**
6255 * <JsxTagName attribute1 attribute2={0} />
6256 */
6257 jsxAttribute = "JSX attribute",
6258 /** String literal */
6259 string = "string"
6260 }
6261 enum ScriptElementKindModifier {
6262 none = "",
6263 publicMemberModifier = "public",
6264 privateMemberModifier = "private",
6265 protectedMemberModifier = "protected",
6266 exportedModifier = "export",
6267 ambientModifier = "declare",
6268 staticModifier = "static",
6269 abstractModifier = "abstract",
6270 optionalModifier = "optional",
6271 deprecatedModifier = "deprecated",
6272 dtsModifier = ".d.ts",
6273 tsModifier = ".ts",
6274 tsxModifier = ".tsx",
6275 jsModifier = ".js",
6276 jsxModifier = ".jsx",
6277 jsonModifier = ".json"
6278 }
6279 enum ClassificationTypeNames {
6280 comment = "comment",
6281 identifier = "identifier",
6282 keyword = "keyword",
6283 numericLiteral = "number",
6284 bigintLiteral = "bigint",
6285 operator = "operator",
6286 stringLiteral = "string",
6287 whiteSpace = "whitespace",
6288 text = "text",
6289 punctuation = "punctuation",
6290 className = "class name",
6291 enumName = "enum name",
6292 interfaceName = "interface name",
6293 moduleName = "module name",
6294 typeParameterName = "type parameter name",
6295 typeAliasName = "type alias name",
6296 parameterName = "parameter name",
6297 docCommentTagName = "doc comment tag name",
6298 jsxOpenTagName = "jsx open tag name",
6299 jsxCloseTagName = "jsx close tag name",
6300 jsxSelfClosingTagName = "jsx self closing tag name",
6301 jsxAttribute = "jsx attribute",
6302 jsxText = "jsx text",
6303 jsxAttributeStringLiteralValue = "jsx attribute string literal value"
6304 }
6305 enum ClassificationType {
6306 comment = 1,
6307 identifier = 2,
6308 keyword = 3,
6309 numericLiteral = 4,
6310 operator = 5,
6311 stringLiteral = 6,
6312 regularExpressionLiteral = 7,
6313 whiteSpace = 8,
6314 text = 9,
6315 punctuation = 10,
6316 className = 11,
6317 enumName = 12,
6318 interfaceName = 13,
6319 moduleName = 14,
6320 typeParameterName = 15,
6321 typeAliasName = 16,
6322 parameterName = 17,
6323 docCommentTagName = 18,
6324 jsxOpenTagName = 19,
6325 jsxCloseTagName = 20,
6326 jsxSelfClosingTagName = 21,
6327 jsxAttribute = 22,
6328 jsxText = 23,
6329 jsxAttributeStringLiteralValue = 24,
6330 bigintLiteral = 25
6331 }
6332}
6333declare namespace ts {
6334 /** The classifier is used for syntactic highlighting in editors via the TSServer */
6335 function createClassifier(): Classifier;
6336}
6337declare namespace ts {
6338 interface DocumentHighlights {
6339 fileName: string;
6340 highlightSpans: HighlightSpan[];
6341 }
6342}
6343declare namespace ts {
6344 /**
6345 * The document registry represents a store of SourceFile objects that can be shared between
6346 * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST)
6347 * of files in the context.
6348 * SourceFile objects account for most of the memory usage by the language service. Sharing
6349 * the same DocumentRegistry instance between different instances of LanguageService allow
6350 * for more efficient memory utilization since all projects will share at least the library
6351 * file (lib.d.ts).
6352 *
6353 * A more advanced use of the document registry is to serialize sourceFile objects to disk
6354 * and re-hydrate them when needed.
6355 *
6356 * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it
6357 * to all subsequent createLanguageService calls.
6358 */
6359 interface DocumentRegistry {
6360 /**
6361 * Request a stored SourceFile with a given fileName and compilationSettings.
6362 * The first call to acquire will call createLanguageServiceSourceFile to generate
6363 * the SourceFile if was not found in the registry.
6364 *
6365 * @param fileName The name of the file requested
6366 * @param compilationSettings Some compilation settings like target affects the
6367 * shape of a the resulting SourceFile. This allows the DocumentRegistry to store
6368 * multiple copies of the same file for different compilation settings.
6369 * @param scriptSnapshot Text of the file. Only used if the file was not found
6370 * in the registry and a new one was created.
6371 * @param version Current version of the file. Only used if the file was not found
6372 * in the registry and a new one was created.
6373 */
6374 acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile;
6375 acquireDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile;
6376 /**
6377 * Request an updated version of an already existing SourceFile with a given fileName
6378 * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile
6379 * to get an updated SourceFile.
6380 *
6381 * @param fileName The name of the file requested
6382 * @param compilationSettings Some compilation settings like target affects the
6383 * shape of a the resulting SourceFile. This allows the DocumentRegistry to store
6384 * multiple copies of the same file for different compilation settings.
6385 * @param scriptSnapshot Text of the file.
6386 * @param version Current version of the file.
6387 */
6388 updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile;
6389 updateDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile;
6390 getKeyForCompilationSettings(settings: CompilerOptions): DocumentRegistryBucketKey;
6391 /**
6392 * Informs the DocumentRegistry that a file is not needed any longer.
6393 *
6394 * Note: It is not allowed to call release on a SourceFile that was not acquired from
6395 * this registry originally.
6396 *
6397 * @param fileName The name of the file to be released
6398 * @param compilationSettings The compilation settings used to acquire the file
6399 */
6400 releaseDocument(fileName: string, compilationSettings: CompilerOptions): void;
6401 releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey): void;
6402 reportStats(): string;
6403 }
6404 type DocumentRegistryBucketKey = string & {
6405 __bucketKey: any;
6406 };
6407 function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory?: string): DocumentRegistry;
6408}
6409declare namespace ts {
6410 function preProcessFile(sourceText: string, readImportFiles?: boolean, detectJavaScriptImports?: boolean): PreProcessedFileInfo;
6411}
6412declare namespace ts {
6413 interface TranspileOptions {
6414 compilerOptions?: CompilerOptions;
6415 fileName?: string;
6416 reportDiagnostics?: boolean;
6417 moduleName?: string;
6418 renamedDependencies?: MapLike<string>;
6419 transformers?: CustomTransformers;
6420 }
6421 interface TranspileOutput {
6422 outputText: string;
6423 diagnostics?: Diagnostic[];
6424 sourceMapText?: string;
6425 }
6426 function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput;
6427 function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string;
6428}
6429declare namespace ts {
6430 /** The version of the language service API */
6431 const servicesVersion = "0.8";
6432 function toEditorSettings(options: EditorOptions | EditorSettings): EditorSettings;
6433 function displayPartsToString(displayParts: SymbolDisplayPart[] | undefined): string;
6434 function getDefaultCompilerOptions(): CompilerOptions;
6435 function getSupportedCodeFixes(): string[];
6436 function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean, scriptKind?: ScriptKind): SourceFile;
6437 function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange | undefined, aggressiveChecks?: boolean): SourceFile;
6438 function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry, syntaxOnlyOrLanguageServiceMode?: boolean | LanguageServiceMode): LanguageService;
6439 /**
6440 * Get the path of the default library files (lib.d.ts) as distributed with the typescript
6441 * node package.
6442 * The functionality is not supported if the ts module is consumed outside of a node module.
6443 */
6444 function getDefaultLibFilePath(options: CompilerOptions): string;
6445}
6446declare namespace ts {
6447 /**
6448 * Transform one or more nodes using the supplied transformers.
6449 * @param source A single `Node` or an array of `Node` objects.
6450 * @param transformers An array of `TransformerFactory` callbacks used to process the transformation.
6451 * @param compilerOptions Optional compiler options.
6452 */
6453 function transform<T extends Node>(source: T | T[], transformers: TransformerFactory<T>[], compilerOptions?: CompilerOptions): TransformationResult<T>;
6454}
6455declare namespace ts {
6456 /** @deprecated Use `factory.createNodeArray` or the factory supplied by your transformation context instead. */
6457 const createNodeArray: <T extends Node>(elements?: readonly T[] | undefined, hasTrailingComma?: boolean | undefined) => NodeArray<T>;
6458 /** @deprecated Use `factory.createNumericLiteral` or the factory supplied by your transformation context instead. */
6459 const createNumericLiteral: (value: string | number, numericLiteralFlags?: TokenFlags | undefined) => NumericLiteral;
6460 /** @deprecated Use `factory.createBigIntLiteral` or the factory supplied by your transformation context instead. */
6461 const createBigIntLiteral: (value: string | PseudoBigInt) => BigIntLiteral;
6462 /** @deprecated Use `factory.createStringLiteral` or the factory supplied by your transformation context instead. */
6463 const createStringLiteral: {
6464 (text: string, isSingleQuote?: boolean | undefined): StringLiteral;
6465 (text: string, isSingleQuote?: boolean | undefined, hasExtendedUnicodeEscape?: boolean | undefined): StringLiteral;
6466 };
6467 /** @deprecated Use `factory.createStringLiteralFromNode` or the factory supplied by your transformation context instead. */
6468 const createStringLiteralFromNode: (sourceNode: PropertyNameLiteral, isSingleQuote?: boolean | undefined) => StringLiteral;
6469 /** @deprecated Use `factory.createRegularExpressionLiteral` or the factory supplied by your transformation context instead. */
6470 const createRegularExpressionLiteral: (text: string) => RegularExpressionLiteral;
6471 /** @deprecated Use `factory.createLoopVariable` or the factory supplied by your transformation context instead. */
6472 const createLoopVariable: () => Identifier;
6473 /** @deprecated Use `factory.createUniqueName` or the factory supplied by your transformation context instead. */
6474 const createUniqueName: (text: string, flags?: GeneratedIdentifierFlags | undefined) => Identifier;
6475 /** @deprecated Use `factory.createPrivateIdentifier` or the factory supplied by your transformation context instead. */
6476 const createPrivateIdentifier: (text: string) => PrivateIdentifier;
6477 /** @deprecated Use `factory.createSuper` or the factory supplied by your transformation context instead. */
6478 const createSuper: () => SuperExpression;
6479 /** @deprecated Use `factory.createThis` or the factory supplied by your transformation context instead. */
6480 const createThis: () => ThisExpression;
6481 /** @deprecated Use `factory.createNull` or the factory supplied by your transformation context instead. */
6482 const createNull: () => NullLiteral;
6483 /** @deprecated Use `factory.createTrue` or the factory supplied by your transformation context instead. */
6484 const createTrue: () => TrueLiteral;
6485 /** @deprecated Use `factory.createFalse` or the factory supplied by your transformation context instead. */
6486 const createFalse: () => FalseLiteral;
6487 /** @deprecated Use `factory.createModifier` or the factory supplied by your transformation context instead. */
6488 const createModifier: <T extends ModifierSyntaxKind>(kind: T) => ModifierToken<T>;
6489 /** @deprecated Use `factory.createModifiersFromModifierFlags` or the factory supplied by your transformation context instead. */
6490 const createModifiersFromModifierFlags: (flags: ModifierFlags) => Modifier[];
6491 /** @deprecated Use `factory.createQualifiedName` or the factory supplied by your transformation context instead. */
6492 const createQualifiedName: (left: EntityName, right: string | Identifier) => QualifiedName;
6493 /** @deprecated Use `factory.updateQualifiedName` or the factory supplied by your transformation context instead. */
6494 const updateQualifiedName: (node: QualifiedName, left: EntityName, right: Identifier) => QualifiedName;
6495 /** @deprecated Use `factory.createComputedPropertyName` or the factory supplied by your transformation context instead. */
6496 const createComputedPropertyName: (expression: Expression) => ComputedPropertyName;
6497 /** @deprecated Use `factory.updateComputedPropertyName` or the factory supplied by your transformation context instead. */
6498 const updateComputedPropertyName: (node: ComputedPropertyName, expression: Expression) => ComputedPropertyName;
6499 /** @deprecated Use `factory.createTypeParameterDeclaration` or the factory supplied by your transformation context instead. */
6500 const createTypeParameterDeclaration: (name: string | Identifier, constraint?: TypeNode | undefined, defaultType?: TypeNode | undefined) => TypeParameterDeclaration;
6501 /** @deprecated Use `factory.updateTypeParameterDeclaration` or the factory supplied by your transformation context instead. */
6502 const updateTypeParameterDeclaration: (node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined) => TypeParameterDeclaration;
6503 /** @deprecated Use `factory.createParameterDeclaration` or the factory supplied by your transformation context instead. */
6504 const createParameter: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken?: QuestionToken | undefined, type?: TypeNode | undefined, initializer?: Expression | undefined) => ParameterDeclaration;
6505 /** @deprecated Use `factory.updateParameterDeclaration` or the factory supplied by your transformation context instead. */
6506 const updateParameter: (node: ParameterDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined) => ParameterDeclaration;
6507 /** @deprecated Use `factory.createDecorator` or the factory supplied by your transformation context instead. */
6508 const createDecorator: (expression: Expression) => Decorator;
6509 /** @deprecated Use `factory.updateDecorator` or the factory supplied by your transformation context instead. */
6510 const updateDecorator: (node: Decorator, expression: Expression) => Decorator;
6511 /** @deprecated Use `factory.createPropertyDeclaration` or the factory supplied by your transformation context instead. */
6512 const createProperty: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined) => PropertyDeclaration;
6513 /** @deprecated Use `factory.updatePropertyDeclaration` or the factory supplied by your transformation context instead. */
6514 const updateProperty: (node: PropertyDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined) => PropertyDeclaration;
6515 /** @deprecated Use `factory.createMethodDeclaration` or the factory supplied by your transformation context instead. */
6516 const createMethod: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => MethodDeclaration;
6517 /** @deprecated Use `factory.updateMethodDeclaration` or the factory supplied by your transformation context instead. */
6518 const updateMethod: (node: MethodDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => MethodDeclaration;
6519 /** @deprecated Use `factory.createConstructorDeclaration` or the factory supplied by your transformation context instead. */
6520 const createConstructor: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined) => ConstructorDeclaration;
6521 /** @deprecated Use `factory.updateConstructorDeclaration` or the factory supplied by your transformation context instead. */
6522 const updateConstructor: (node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined) => ConstructorDeclaration;
6523 /** @deprecated Use `factory.createGetAccessorDeclaration` or the factory supplied by your transformation context instead. */
6524 const createGetAccessor: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => GetAccessorDeclaration;
6525 /** @deprecated Use `factory.updateGetAccessorDeclaration` or the factory supplied by your transformation context instead. */
6526 const updateGetAccessor: (node: GetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => GetAccessorDeclaration;
6527 /** @deprecated Use `factory.createSetAccessorDeclaration` or the factory supplied by your transformation context instead. */
6528 const createSetAccessor: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined) => SetAccessorDeclaration;
6529 /** @deprecated Use `factory.updateSetAccessorDeclaration` or the factory supplied by your transformation context instead. */
6530 const updateSetAccessor: (node: SetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined) => SetAccessorDeclaration;
6531 /** @deprecated Use `factory.createCallSignature` or the factory supplied by your transformation context instead. */
6532 const createCallSignature: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined) => CallSignatureDeclaration;
6533 /** @deprecated Use `factory.updateCallSignature` or the factory supplied by your transformation context instead. */
6534 const updateCallSignature: (node: CallSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined) => CallSignatureDeclaration;
6535 /** @deprecated Use `factory.createConstructSignature` or the factory supplied by your transformation context instead. */
6536 const createConstructSignature: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined) => ConstructSignatureDeclaration;
6537 /** @deprecated Use `factory.updateConstructSignature` or the factory supplied by your transformation context instead. */
6538 const updateConstructSignature: (node: ConstructSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined) => ConstructSignatureDeclaration;
6539 /** @deprecated Use `factory.updateIndexSignature` or the factory supplied by your transformation context instead. */
6540 const updateIndexSignature: (node: IndexSignatureDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => IndexSignatureDeclaration;
6541 /** @deprecated Use `factory.createKeywordTypeNode` or the factory supplied by your transformation context instead. */
6542 const createKeywordTypeNode: <TKind extends KeywordTypeSyntaxKind>(kind: TKind) => KeywordTypeNode<TKind>;
6543 /** @deprecated Use `factory.createTypePredicateNode` or the factory supplied by your transformation context instead. */
6544 const createTypePredicateNodeWithModifier: (assertsModifier: AssertsKeyword | undefined, parameterName: string | Identifier | ThisTypeNode, type: TypeNode | undefined) => TypePredicateNode;
6545 /** @deprecated Use `factory.updateTypePredicateNode` or the factory supplied by your transformation context instead. */
6546 const updateTypePredicateNodeWithModifier: (node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined) => TypePredicateNode;
6547 /** @deprecated Use `factory.createTypeReferenceNode` or the factory supplied by your transformation context instead. */
6548 const createTypeReferenceNode: (typeName: string | EntityName, typeArguments?: readonly TypeNode[] | undefined) => TypeReferenceNode;
6549 /** @deprecated Use `factory.updateTypeReferenceNode` or the factory supplied by your transformation context instead. */
6550 const updateTypeReferenceNode: (node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray<TypeNode> | undefined) => TypeReferenceNode;
6551 /** @deprecated Use `factory.createFunctionTypeNode` or the factory supplied by your transformation context instead. */
6552 const createFunctionTypeNode: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => FunctionTypeNode;
6553 /** @deprecated Use `factory.updateFunctionTypeNode` or the factory supplied by your transformation context instead. */
6554 const updateFunctionTypeNode: (node: FunctionTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode) => FunctionTypeNode;
6555 /** @deprecated Use `factory.createConstructorTypeNode` or the factory supplied by your transformation context instead. */
6556 const createConstructorTypeNode: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => ConstructorTypeNode;
6557 /** @deprecated Use `factory.updateConstructorTypeNode` or the factory supplied by your transformation context instead. */
6558 const updateConstructorTypeNode: (node: ConstructorTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode) => ConstructorTypeNode;
6559 /** @deprecated Use `factory.createTypeQueryNode` or the factory supplied by your transformation context instead. */
6560 const createTypeQueryNode: (exprName: EntityName) => TypeQueryNode;
6561 /** @deprecated Use `factory.updateTypeQueryNode` or the factory supplied by your transformation context instead. */
6562 const updateTypeQueryNode: (node: TypeQueryNode, exprName: EntityName) => TypeQueryNode;
6563 /** @deprecated Use `factory.createTypeLiteralNode` or the factory supplied by your transformation context instead. */
6564 const createTypeLiteralNode: (members: readonly TypeElement[] | undefined) => TypeLiteralNode;
6565 /** @deprecated Use `factory.updateTypeLiteralNode` or the factory supplied by your transformation context instead. */
6566 const updateTypeLiteralNode: (node: TypeLiteralNode, members: NodeArray<TypeElement>) => TypeLiteralNode;
6567 /** @deprecated Use `factory.createArrayTypeNode` or the factory supplied by your transformation context instead. */
6568 const createArrayTypeNode: (elementType: TypeNode) => ArrayTypeNode;
6569 /** @deprecated Use `factory.updateArrayTypeNode` or the factory supplied by your transformation context instead. */
6570 const updateArrayTypeNode: (node: ArrayTypeNode, elementType: TypeNode) => ArrayTypeNode;
6571 /** @deprecated Use `factory.createTupleTypeNode` or the factory supplied by your transformation context instead. */
6572 const createTupleTypeNode: (elements: readonly (TypeNode | NamedTupleMember)[]) => TupleTypeNode;
6573 /** @deprecated Use `factory.updateTupleTypeNode` or the factory supplied by your transformation context instead. */
6574 const updateTupleTypeNode: (node: TupleTypeNode, elements: readonly (TypeNode | NamedTupleMember)[]) => TupleTypeNode;
6575 /** @deprecated Use `factory.createOptionalTypeNode` or the factory supplied by your transformation context instead. */
6576 const createOptionalTypeNode: (type: TypeNode) => OptionalTypeNode;
6577 /** @deprecated Use `factory.updateOptionalTypeNode` or the factory supplied by your transformation context instead. */
6578 const updateOptionalTypeNode: (node: OptionalTypeNode, type: TypeNode) => OptionalTypeNode;
6579 /** @deprecated Use `factory.createRestTypeNode` or the factory supplied by your transformation context instead. */
6580 const createRestTypeNode: (type: TypeNode) => RestTypeNode;
6581 /** @deprecated Use `factory.updateRestTypeNode` or the factory supplied by your transformation context instead. */
6582 const updateRestTypeNode: (node: RestTypeNode, type: TypeNode) => RestTypeNode;
6583 /** @deprecated Use `factory.createUnionTypeNode` or the factory supplied by your transformation context instead. */
6584 const createUnionTypeNode: (types: readonly TypeNode[]) => UnionTypeNode;
6585 /** @deprecated Use `factory.updateUnionTypeNode` or the factory supplied by your transformation context instead. */
6586 const updateUnionTypeNode: (node: UnionTypeNode, types: NodeArray<TypeNode>) => UnionTypeNode;
6587 /** @deprecated Use `factory.createIntersectionTypeNode` or the factory supplied by your transformation context instead. */
6588 const createIntersectionTypeNode: (types: readonly TypeNode[]) => IntersectionTypeNode;
6589 /** @deprecated Use `factory.updateIntersectionTypeNode` or the factory supplied by your transformation context instead. */
6590 const updateIntersectionTypeNode: (node: IntersectionTypeNode, types: NodeArray<TypeNode>) => IntersectionTypeNode;
6591 /** @deprecated Use `factory.createConditionalTypeNode` or the factory supplied by your transformation context instead. */
6592 const createConditionalTypeNode: (checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode) => ConditionalTypeNode;
6593 /** @deprecated Use `factory.updateConditionalTypeNode` or the factory supplied by your transformation context instead. */
6594 const updateConditionalTypeNode: (node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode) => ConditionalTypeNode;
6595 /** @deprecated Use `factory.createInferTypeNode` or the factory supplied by your transformation context instead. */
6596 const createInferTypeNode: (typeParameter: TypeParameterDeclaration) => InferTypeNode;
6597 /** @deprecated Use `factory.updateInferTypeNode` or the factory supplied by your transformation context instead. */
6598 const updateInferTypeNode: (node: InferTypeNode, typeParameter: TypeParameterDeclaration) => InferTypeNode;
6599 /** @deprecated Use `factory.createImportTypeNode` or the factory supplied by your transformation context instead. */
6600 const createImportTypeNode: (argument: TypeNode, qualifier?: EntityName | undefined, typeArguments?: readonly TypeNode[] | undefined, isTypeOf?: boolean | undefined) => ImportTypeNode;
6601 /** @deprecated Use `factory.updateImportTypeNode` or the factory supplied by your transformation context instead. */
6602 const updateImportTypeNode: (node: ImportTypeNode, argument: TypeNode, qualifier: EntityName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf?: boolean | undefined) => ImportTypeNode;
6603 /** @deprecated Use `factory.createParenthesizedType` or the factory supplied by your transformation context instead. */
6604 const createParenthesizedType: (type: TypeNode) => ParenthesizedTypeNode;
6605 /** @deprecated Use `factory.updateParenthesizedType` or the factory supplied by your transformation context instead. */
6606 const updateParenthesizedType: (node: ParenthesizedTypeNode, type: TypeNode) => ParenthesizedTypeNode;
6607 /** @deprecated Use `factory.createThisTypeNode` or the factory supplied by your transformation context instead. */
6608 const createThisTypeNode: () => ThisTypeNode;
6609 /** @deprecated Use `factory.updateTypeOperatorNode` or the factory supplied by your transformation context instead. */
6610 const updateTypeOperatorNode: (node: TypeOperatorNode, type: TypeNode) => TypeOperatorNode;
6611 /** @deprecated Use `factory.createIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */
6612 const createIndexedAccessTypeNode: (objectType: TypeNode, indexType: TypeNode) => IndexedAccessTypeNode;
6613 /** @deprecated Use `factory.updateIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */
6614 const updateIndexedAccessTypeNode: (node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode) => IndexedAccessTypeNode;
6615 /** @deprecated Use `factory.createMappedTypeNode` or the factory supplied by your transformation context instead. */
6616 const createMappedTypeNode: (readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined) => MappedTypeNode;
6617 /** @deprecated Use `factory.updateMappedTypeNode` or the factory supplied by your transformation context instead. */
6618 const updateMappedTypeNode: (node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined) => MappedTypeNode;
6619 /** @deprecated Use `factory.createLiteralTypeNode` or the factory supplied by your transformation context instead. */
6620 const createLiteralTypeNode: (literal: LiteralExpression | BooleanLiteral | PrefixUnaryExpression | NullLiteral) => LiteralTypeNode;
6621 /** @deprecated Use `factory.updateLiteralTypeNode` or the factory supplied by your transformation context instead. */
6622 const updateLiteralTypeNode: (node: LiteralTypeNode, literal: LiteralExpression | BooleanLiteral | PrefixUnaryExpression | NullLiteral) => LiteralTypeNode;
6623 /** @deprecated Use `factory.createObjectBindingPattern` or the factory supplied by your transformation context instead. */
6624 const createObjectBindingPattern: (elements: readonly BindingElement[]) => ObjectBindingPattern;
6625 /** @deprecated Use `factory.updateObjectBindingPattern` or the factory supplied by your transformation context instead. */
6626 const updateObjectBindingPattern: (node: ObjectBindingPattern, elements: readonly BindingElement[]) => ObjectBindingPattern;
6627 /** @deprecated Use `factory.createArrayBindingPattern` or the factory supplied by your transformation context instead. */
6628 const createArrayBindingPattern: (elements: readonly ArrayBindingElement[]) => ArrayBindingPattern;
6629 /** @deprecated Use `factory.updateArrayBindingPattern` or the factory supplied by your transformation context instead. */
6630 const updateArrayBindingPattern: (node: ArrayBindingPattern, elements: readonly ArrayBindingElement[]) => ArrayBindingPattern;
6631 /** @deprecated Use `factory.createBindingElement` or the factory supplied by your transformation context instead. */
6632 const createBindingElement: (dotDotDotToken: DotDotDotToken | undefined, propertyName: string | PropertyName | undefined, name: string | BindingName, initializer?: Expression | undefined) => BindingElement;
6633 /** @deprecated Use `factory.updateBindingElement` or the factory supplied by your transformation context instead. */
6634 const updateBindingElement: (node: BindingElement, dotDotDotToken: DotDotDotToken | undefined, propertyName: PropertyName | undefined, name: BindingName, initializer: Expression | undefined) => BindingElement;
6635 /** @deprecated Use `factory.createArrayLiteralExpression` or the factory supplied by your transformation context instead. */
6636 const createArrayLiteral: (elements?: readonly Expression[] | undefined, multiLine?: boolean | undefined) => ArrayLiteralExpression;
6637 /** @deprecated Use `factory.updateArrayLiteralExpression` or the factory supplied by your transformation context instead. */
6638 const updateArrayLiteral: (node: ArrayLiteralExpression, elements: readonly Expression[]) => ArrayLiteralExpression;
6639 /** @deprecated Use `factory.createObjectLiteralExpression` or the factory supplied by your transformation context instead. */
6640 const createObjectLiteral: (properties?: readonly ObjectLiteralElementLike[] | undefined, multiLine?: boolean | undefined) => ObjectLiteralExpression;
6641 /** @deprecated Use `factory.updateObjectLiteralExpression` or the factory supplied by your transformation context instead. */
6642 const updateObjectLiteral: (node: ObjectLiteralExpression, properties: readonly ObjectLiteralElementLike[]) => ObjectLiteralExpression;
6643 /** @deprecated Use `factory.createPropertyAccessExpression` or the factory supplied by your transformation context instead. */
6644 const createPropertyAccess: (expression: Expression, name: string | Identifier | PrivateIdentifier) => PropertyAccessExpression;
6645 /** @deprecated Use `factory.updatePropertyAccessExpression` or the factory supplied by your transformation context instead. */
6646 const updatePropertyAccess: (node: PropertyAccessExpression, expression: Expression, name: Identifier | PrivateIdentifier) => PropertyAccessExpression;
6647 /** @deprecated Use `factory.createPropertyAccessChain` or the factory supplied by your transformation context instead. */
6648 const createPropertyAccessChain: (expression: Expression, questionDotToken: QuestionDotToken | undefined, name: string | Identifier | PrivateIdentifier) => PropertyAccessChain;
6649 /** @deprecated Use `factory.updatePropertyAccessChain` or the factory supplied by your transformation context instead. */
6650 const updatePropertyAccessChain: (node: PropertyAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, name: Identifier | PrivateIdentifier) => PropertyAccessChain;
6651 /** @deprecated Use `factory.createElementAccessExpression` or the factory supplied by your transformation context instead. */
6652 const createElementAccess: (expression: Expression, index: number | Expression) => ElementAccessExpression;
6653 /** @deprecated Use `factory.updateElementAccessExpression` or the factory supplied by your transformation context instead. */
6654 const updateElementAccess: (node: ElementAccessExpression, expression: Expression, argumentExpression: Expression) => ElementAccessExpression;
6655 /** @deprecated Use `factory.createElementAccessChain` or the factory supplied by your transformation context instead. */
6656 const createElementAccessChain: (expression: Expression, questionDotToken: QuestionDotToken | undefined, index: number | Expression) => ElementAccessChain;
6657 /** @deprecated Use `factory.updateElementAccessChain` or the factory supplied by your transformation context instead. */
6658 const updateElementAccessChain: (node: ElementAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, argumentExpression: Expression) => ElementAccessChain;
6659 /** @deprecated Use `factory.createCallExpression` or the factory supplied by your transformation context instead. */
6660 const createCall: (expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => CallExpression;
6661 /** @deprecated Use `factory.updateCallExpression` or the factory supplied by your transformation context instead. */
6662 const updateCall: (node: CallExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]) => CallExpression;
6663 /** @deprecated Use `factory.createCallChain` or the factory supplied by your transformation context instead. */
6664 const createCallChain: (expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => CallChain;
6665 /** @deprecated Use `factory.updateCallChain` or the factory supplied by your transformation context instead. */
6666 const updateCallChain: (node: CallChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]) => CallChain;
6667 /** @deprecated Use `factory.createNewExpression` or the factory supplied by your transformation context instead. */
6668 const createNew: (expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => NewExpression;
6669 /** @deprecated Use `factory.updateNewExpression` or the factory supplied by your transformation context instead. */
6670 const updateNew: (node: NewExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => NewExpression;
6671 /** @deprecated Use `factory.createTypeAssertion` or the factory supplied by your transformation context instead. */
6672 const createTypeAssertion: (type: TypeNode, expression: Expression) => TypeAssertion;
6673 /** @deprecated Use `factory.updateTypeAssertion` or the factory supplied by your transformation context instead. */
6674 const updateTypeAssertion: (node: TypeAssertion, type: TypeNode, expression: Expression) => TypeAssertion;
6675 /** @deprecated Use `factory.createParenthesizedExpression` or the factory supplied by your transformation context instead. */
6676 const createParen: (expression: Expression) => ParenthesizedExpression;
6677 /** @deprecated Use `factory.updateParenthesizedExpression` or the factory supplied by your transformation context instead. */
6678 const updateParen: (node: ParenthesizedExpression, expression: Expression) => ParenthesizedExpression;
6679 /** @deprecated Use `factory.createFunctionExpression` or the factory supplied by your transformation context instead. */
6680 const createFunctionExpression: (modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[] | undefined, type: TypeNode | undefined, body: Block) => FunctionExpression;
6681 /** @deprecated Use `factory.updateFunctionExpression` or the factory supplied by your transformation context instead. */
6682 const updateFunctionExpression: (node: FunctionExpression, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block) => FunctionExpression;
6683 /** @deprecated Use `factory.createDeleteExpression` or the factory supplied by your transformation context instead. */
6684 const createDelete: (expression: Expression) => DeleteExpression;
6685 /** @deprecated Use `factory.updateDeleteExpression` or the factory supplied by your transformation context instead. */
6686 const updateDelete: (node: DeleteExpression, expression: Expression) => DeleteExpression;
6687 /** @deprecated Use `factory.createTypeOfExpression` or the factory supplied by your transformation context instead. */
6688 const createTypeOf: (expression: Expression) => TypeOfExpression;
6689 /** @deprecated Use `factory.updateTypeOfExpression` or the factory supplied by your transformation context instead. */
6690 const updateTypeOf: (node: TypeOfExpression, expression: Expression) => TypeOfExpression;
6691 /** @deprecated Use `factory.createVoidExpression` or the factory supplied by your transformation context instead. */
6692 const createVoid: (expression: Expression) => VoidExpression;
6693 /** @deprecated Use `factory.updateVoidExpression` or the factory supplied by your transformation context instead. */
6694 const updateVoid: (node: VoidExpression, expression: Expression) => VoidExpression;
6695 /** @deprecated Use `factory.createAwaitExpression` or the factory supplied by your transformation context instead. */
6696 const createAwait: (expression: Expression) => AwaitExpression;
6697 /** @deprecated Use `factory.updateAwaitExpression` or the factory supplied by your transformation context instead. */
6698 const updateAwait: (node: AwaitExpression, expression: Expression) => AwaitExpression;
6699 /** @deprecated Use `factory.createPrefixExpression` or the factory supplied by your transformation context instead. */
6700 const createPrefix: (operator: PrefixUnaryOperator, operand: Expression) => PrefixUnaryExpression;
6701 /** @deprecated Use `factory.updatePrefixExpression` or the factory supplied by your transformation context instead. */
6702 const updatePrefix: (node: PrefixUnaryExpression, operand: Expression) => PrefixUnaryExpression;
6703 /** @deprecated Use `factory.createPostfixUnaryExpression` or the factory supplied by your transformation context instead. */
6704 const createPostfix: (operand: Expression, operator: PostfixUnaryOperator) => PostfixUnaryExpression;
6705 /** @deprecated Use `factory.updatePostfixUnaryExpression` or the factory supplied by your transformation context instead. */
6706 const updatePostfix: (node: PostfixUnaryExpression, operand: Expression) => PostfixUnaryExpression;
6707 /** @deprecated Use `factory.createBinaryExpression` or the factory supplied by your transformation context instead. */
6708 const createBinary: (left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression) => BinaryExpression;
6709 /** @deprecated Use `factory.updateConditionalExpression` or the factory supplied by your transformation context instead. */
6710 const updateConditional: (node: ConditionalExpression, condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression) => ConditionalExpression;
6711 /** @deprecated Use `factory.createTemplateExpression` or the factory supplied by your transformation context instead. */
6712 const createTemplateExpression: (head: TemplateHead, templateSpans: readonly TemplateSpan[]) => TemplateExpression;
6713 /** @deprecated Use `factory.updateTemplateExpression` or the factory supplied by your transformation context instead. */
6714 const updateTemplateExpression: (node: TemplateExpression, head: TemplateHead, templateSpans: readonly TemplateSpan[]) => TemplateExpression;
6715 /** @deprecated Use `factory.createTemplateHead` or the factory supplied by your transformation context instead. */
6716 const createTemplateHead: {
6717 (text: string, rawText?: string | undefined, templateFlags?: TokenFlags | undefined): TemplateHead;
6718 (text: string | undefined, rawText: string, templateFlags?: TokenFlags | undefined): TemplateHead;
6719 };
6720 /** @deprecated Use `factory.createTemplateMiddle` or the factory supplied by your transformation context instead. */
6721 const createTemplateMiddle: {
6722 (text: string, rawText?: string | undefined, templateFlags?: TokenFlags | undefined): TemplateMiddle;
6723 (text: string | undefined, rawText: string, templateFlags?: TokenFlags | undefined): TemplateMiddle;
6724 };
6725 /** @deprecated Use `factory.createTemplateTail` or the factory supplied by your transformation context instead. */
6726 const createTemplateTail: {
6727 (text: string, rawText?: string | undefined, templateFlags?: TokenFlags | undefined): TemplateTail;
6728 (text: string | undefined, rawText: string, templateFlags?: TokenFlags | undefined): TemplateTail;
6729 };
6730 /** @deprecated Use `factory.createNoSubstitutionTemplateLiteral` or the factory supplied by your transformation context instead. */
6731 const createNoSubstitutionTemplateLiteral: {
6732 (text: string, rawText?: string | undefined): NoSubstitutionTemplateLiteral;
6733 (text: string | undefined, rawText: string): NoSubstitutionTemplateLiteral;
6734 };
6735 /** @deprecated Use `factory.updateYieldExpression` or the factory supplied by your transformation context instead. */
6736 const updateYield: (node: YieldExpression, asteriskToken: AsteriskToken | undefined, expression: Expression | undefined) => YieldExpression;
6737 /** @deprecated Use `factory.createSpreadExpression` or the factory supplied by your transformation context instead. */
6738 const createSpread: (expression: Expression) => SpreadElement;
6739 /** @deprecated Use `factory.updateSpreadExpression` or the factory supplied by your transformation context instead. */
6740 const updateSpread: (node: SpreadElement, expression: Expression) => SpreadElement;
6741 /** @deprecated Use `factory.createOmittedExpression` or the factory supplied by your transformation context instead. */
6742 const createOmittedExpression: () => OmittedExpression;
6743 /** @deprecated Use `factory.createAsExpression` or the factory supplied by your transformation context instead. */
6744 const createAsExpression: (expression: Expression, type: TypeNode) => AsExpression;
6745 /** @deprecated Use `factory.updateAsExpression` or the factory supplied by your transformation context instead. */
6746 const updateAsExpression: (node: AsExpression, expression: Expression, type: TypeNode) => AsExpression;
6747 /** @deprecated Use `factory.createNonNullExpression` or the factory supplied by your transformation context instead. */
6748 const createNonNullExpression: (expression: Expression) => NonNullExpression;
6749 /** @deprecated Use `factory.updateNonNullExpression` or the factory supplied by your transformation context instead. */
6750 const updateNonNullExpression: (node: NonNullExpression, expression: Expression) => NonNullExpression;
6751 /** @deprecated Use `factory.createNonNullChain` or the factory supplied by your transformation context instead. */
6752 const createNonNullChain: (expression: Expression) => NonNullChain;
6753 /** @deprecated Use `factory.updateNonNullChain` or the factory supplied by your transformation context instead. */
6754 const updateNonNullChain: (node: NonNullChain, expression: Expression) => NonNullChain;
6755 /** @deprecated Use `factory.createMetaProperty` or the factory supplied by your transformation context instead. */
6756 const createMetaProperty: (keywordToken: SyntaxKind.ImportKeyword | SyntaxKind.NewKeyword, name: Identifier) => MetaProperty;
6757 /** @deprecated Use `factory.updateMetaProperty` or the factory supplied by your transformation context instead. */
6758 const updateMetaProperty: (node: MetaProperty, name: Identifier) => MetaProperty;
6759 /** @deprecated Use `factory.createTemplateSpan` or the factory supplied by your transformation context instead. */
6760 const createTemplateSpan: (expression: Expression, literal: TemplateMiddle | TemplateTail) => TemplateSpan;
6761 /** @deprecated Use `factory.updateTemplateSpan` or the factory supplied by your transformation context instead. */
6762 const updateTemplateSpan: (node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail) => TemplateSpan;
6763 /** @deprecated Use `factory.createSemicolonClassElement` or the factory supplied by your transformation context instead. */
6764 const createSemicolonClassElement: () => SemicolonClassElement;
6765 /** @deprecated Use `factory.createBlock` or the factory supplied by your transformation context instead. */
6766 const createBlock: (statements: readonly Statement[], multiLine?: boolean | undefined) => Block;
6767 /** @deprecated Use `factory.updateBlock` or the factory supplied by your transformation context instead. */
6768 const updateBlock: (node: Block, statements: readonly Statement[]) => Block;
6769 /** @deprecated Use `factory.createVariableStatement` or the factory supplied by your transformation context instead. */
6770 const createVariableStatement: (modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList | readonly VariableDeclaration[]) => VariableStatement;
6771 /** @deprecated Use `factory.updateVariableStatement` or the factory supplied by your transformation context instead. */
6772 const updateVariableStatement: (node: VariableStatement, modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList) => VariableStatement;
6773 /** @deprecated Use `factory.createEmptyStatement` or the factory supplied by your transformation context instead. */
6774 const createEmptyStatement: () => EmptyStatement;
6775 /** @deprecated Use `factory.createExpressionStatement` or the factory supplied by your transformation context instead. */
6776 const createExpressionStatement: (expression: Expression) => ExpressionStatement;
6777 /** @deprecated Use `factory.updateExpressionStatement` or the factory supplied by your transformation context instead. */
6778 const updateExpressionStatement: (node: ExpressionStatement, expression: Expression) => ExpressionStatement;
6779 /** @deprecated Use `factory.createExpressionStatement` or the factory supplied by your transformation context instead. */
6780 const createStatement: (expression: Expression) => ExpressionStatement;
6781 /** @deprecated Use `factory.updateExpressionStatement` or the factory supplied by your transformation context instead. */
6782 const updateStatement: (node: ExpressionStatement, expression: Expression) => ExpressionStatement;
6783 /** @deprecated Use `factory.createIfStatement` or the factory supplied by your transformation context instead. */
6784 const createIf: (expression: Expression, thenStatement: Statement, elseStatement?: Statement | undefined) => IfStatement;
6785 /** @deprecated Use `factory.updateIfStatement` or the factory supplied by your transformation context instead. */
6786 const updateIf: (node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement | undefined) => IfStatement;
6787 /** @deprecated Use `factory.createDoStatement` or the factory supplied by your transformation context instead. */
6788 const createDo: (statement: Statement, expression: Expression) => DoStatement;
6789 /** @deprecated Use `factory.updateDoStatement` or the factory supplied by your transformation context instead. */
6790 const updateDo: (node: DoStatement, statement: Statement, expression: Expression) => DoStatement;
6791 /** @deprecated Use `factory.createWhileStatement` or the factory supplied by your transformation context instead. */
6792 const createWhile: (expression: Expression, statement: Statement) => WhileStatement;
6793 /** @deprecated Use `factory.updateWhileStatement` or the factory supplied by your transformation context instead. */
6794 const updateWhile: (node: WhileStatement, expression: Expression, statement: Statement) => WhileStatement;
6795 /** @deprecated Use `factory.createForStatement` or the factory supplied by your transformation context instead. */
6796 const createFor: (initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement) => ForStatement;
6797 /** @deprecated Use `factory.updateForStatement` or the factory supplied by your transformation context instead. */
6798 const updateFor: (node: ForStatement, initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement) => ForStatement;
6799 /** @deprecated Use `factory.createForInStatement` or the factory supplied by your transformation context instead. */
6800 const createForIn: (initializer: ForInitializer, expression: Expression, statement: Statement) => ForInStatement;
6801 /** @deprecated Use `factory.updateForInStatement` or the factory supplied by your transformation context instead. */
6802 const updateForIn: (node: ForInStatement, initializer: ForInitializer, expression: Expression, statement: Statement) => ForInStatement;
6803 /** @deprecated Use `factory.createForOfStatement` or the factory supplied by your transformation context instead. */
6804 const createForOf: (awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement) => ForOfStatement;
6805 /** @deprecated Use `factory.updateForOfStatement` or the factory supplied by your transformation context instead. */
6806 const updateForOf: (node: ForOfStatement, awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement) => ForOfStatement;
6807 /** @deprecated Use `factory.createContinueStatement` or the factory supplied by your transformation context instead. */
6808 const createContinue: (label?: string | Identifier | undefined) => ContinueStatement;
6809 /** @deprecated Use `factory.updateContinueStatement` or the factory supplied by your transformation context instead. */
6810 const updateContinue: (node: ContinueStatement, label: Identifier | undefined) => ContinueStatement;
6811 /** @deprecated Use `factory.createBreakStatement` or the factory supplied by your transformation context instead. */
6812 const createBreak: (label?: string | Identifier | undefined) => BreakStatement;
6813 /** @deprecated Use `factory.updateBreakStatement` or the factory supplied by your transformation context instead. */
6814 const updateBreak: (node: BreakStatement, label: Identifier | undefined) => BreakStatement;
6815 /** @deprecated Use `factory.createReturnStatement` or the factory supplied by your transformation context instead. */
6816 const createReturn: (expression?: Expression | undefined) => ReturnStatement;
6817 /** @deprecated Use `factory.updateReturnStatement` or the factory supplied by your transformation context instead. */
6818 const updateReturn: (node: ReturnStatement, expression: Expression | undefined) => ReturnStatement;
6819 /** @deprecated Use `factory.createWithStatement` or the factory supplied by your transformation context instead. */
6820 const createWith: (expression: Expression, statement: Statement) => WithStatement;
6821 /** @deprecated Use `factory.updateWithStatement` or the factory supplied by your transformation context instead. */
6822 const updateWith: (node: WithStatement, expression: Expression, statement: Statement) => WithStatement;
6823 /** @deprecated Use `factory.createSwitchStatement` or the factory supplied by your transformation context instead. */
6824 const createSwitch: (expression: Expression, caseBlock: CaseBlock) => SwitchStatement;
6825 /** @deprecated Use `factory.updateSwitchStatement` or the factory supplied by your transformation context instead. */
6826 const updateSwitch: (node: SwitchStatement, expression: Expression, caseBlock: CaseBlock) => SwitchStatement;
6827 /** @deprecated Use `factory.createLabelStatement` or the factory supplied by your transformation context instead. */
6828 const createLabel: (label: string | Identifier, statement: Statement) => LabeledStatement;
6829 /** @deprecated Use `factory.updateLabelStatement` or the factory supplied by your transformation context instead. */
6830 const updateLabel: (node: LabeledStatement, label: Identifier, statement: Statement) => LabeledStatement;
6831 /** @deprecated Use `factory.createThrowStatement` or the factory supplied by your transformation context instead. */
6832 const createThrow: (expression: Expression) => ThrowStatement;
6833 /** @deprecated Use `factory.updateThrowStatement` or the factory supplied by your transformation context instead. */
6834 const updateThrow: (node: ThrowStatement, expression: Expression) => ThrowStatement;
6835 /** @deprecated Use `factory.createTryStatement` or the factory supplied by your transformation context instead. */
6836 const createTry: (tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined) => TryStatement;
6837 /** @deprecated Use `factory.updateTryStatement` or the factory supplied by your transformation context instead. */
6838 const updateTry: (node: TryStatement, tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined) => TryStatement;
6839 /** @deprecated Use `factory.createDebuggerStatement` or the factory supplied by your transformation context instead. */
6840 const createDebuggerStatement: () => DebuggerStatement;
6841 /** @deprecated Use `factory.createVariableDeclarationList` or the factory supplied by your transformation context instead. */
6842 const createVariableDeclarationList: (declarations: readonly VariableDeclaration[], flags?: NodeFlags | undefined) => VariableDeclarationList;
6843 /** @deprecated Use `factory.updateVariableDeclarationList` or the factory supplied by your transformation context instead. */
6844 const updateVariableDeclarationList: (node: VariableDeclarationList, declarations: readonly VariableDeclaration[]) => VariableDeclarationList;
6845 /** @deprecated Use `factory.createFunctionDeclaration` or the factory supplied by your transformation context instead. */
6846 const createFunctionDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => FunctionDeclaration;
6847 /** @deprecated Use `factory.updateFunctionDeclaration` or the factory supplied by your transformation context instead. */
6848 const updateFunctionDeclaration: (node: FunctionDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => FunctionDeclaration;
6849 /** @deprecated Use `factory.createClassDeclaration` or the factory supplied by your transformation context instead. */
6850 const createClassDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassDeclaration;
6851 /** @deprecated Use `factory.updateClassDeclaration` or the factory supplied by your transformation context instead. */
6852 const updateClassDeclaration: (node: ClassDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassDeclaration;
6853 /** @deprecated Use `factory.createInterfaceDeclaration` or the factory supplied by your transformation context instead. */
6854 const createInterfaceDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]) => InterfaceDeclaration;
6855 /** @deprecated Use `factory.updateInterfaceDeclaration` or the factory supplied by your transformation context instead. */
6856 const updateInterfaceDeclaration: (node: InterfaceDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]) => InterfaceDeclaration;
6857 /** @deprecated Use `factory.createTypeAliasDeclaration` or the factory supplied by your transformation context instead. */
6858 const createTypeAliasDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode) => TypeAliasDeclaration;
6859 /** @deprecated Use `factory.updateTypeAliasDeclaration` or the factory supplied by your transformation context instead. */
6860 const updateTypeAliasDeclaration: (node: TypeAliasDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode) => TypeAliasDeclaration;
6861 /** @deprecated Use `factory.createEnumDeclaration` or the factory supplied by your transformation context instead. */
6862 const createEnumDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]) => EnumDeclaration;
6863 /** @deprecated Use `factory.updateEnumDeclaration` or the factory supplied by your transformation context instead. */
6864 const updateEnumDeclaration: (node: EnumDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]) => EnumDeclaration;
6865 /** @deprecated Use `factory.createModuleDeclaration` or the factory supplied by your transformation context instead. */
6866 const createModuleDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags | undefined) => ModuleDeclaration;
6867 /** @deprecated Use `factory.updateModuleDeclaration` or the factory supplied by your transformation context instead. */
6868 const updateModuleDeclaration: (node: ModuleDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined) => ModuleDeclaration;
6869 /** @deprecated Use `factory.createModuleBlock` or the factory supplied by your transformation context instead. */
6870 const createModuleBlock: (statements: readonly Statement[]) => ModuleBlock;
6871 /** @deprecated Use `factory.updateModuleBlock` or the factory supplied by your transformation context instead. */
6872 const updateModuleBlock: (node: ModuleBlock, statements: readonly Statement[]) => ModuleBlock;
6873 /** @deprecated Use `factory.createCaseBlock` or the factory supplied by your transformation context instead. */
6874 const createCaseBlock: (clauses: readonly CaseOrDefaultClause[]) => CaseBlock;
6875 /** @deprecated Use `factory.updateCaseBlock` or the factory supplied by your transformation context instead. */
6876 const updateCaseBlock: (node: CaseBlock, clauses: readonly CaseOrDefaultClause[]) => CaseBlock;
6877 /** @deprecated Use `factory.createNamespaceExportDeclaration` or the factory supplied by your transformation context instead. */
6878 const createNamespaceExportDeclaration: (name: string | Identifier) => NamespaceExportDeclaration;
6879 /** @deprecated Use `factory.updateNamespaceExportDeclaration` or the factory supplied by your transformation context instead. */
6880 const updateNamespaceExportDeclaration: (node: NamespaceExportDeclaration, name: Identifier) => NamespaceExportDeclaration;
6881 /** @deprecated Use `factory.createImportEqualsDeclaration` or the factory supplied by your transformation context instead. */
6882 const createImportEqualsDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference) => ImportEqualsDeclaration;
6883 /** @deprecated Use `factory.updateImportEqualsDeclaration` or the factory supplied by your transformation context instead. */
6884 const updateImportEqualsDeclaration: (node: ImportEqualsDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference) => ImportEqualsDeclaration;
6885 /** @deprecated Use `factory.createImportDeclaration` or the factory supplied by your transformation context instead. */
6886 const createImportDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression) => ImportDeclaration;
6887 /** @deprecated Use `factory.updateImportDeclaration` or the factory supplied by your transformation context instead. */
6888 const updateImportDeclaration: (node: ImportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression) => ImportDeclaration;
6889 /** @deprecated Use `factory.createNamespaceImport` or the factory supplied by your transformation context instead. */
6890 const createNamespaceImport: (name: Identifier) => NamespaceImport;
6891 /** @deprecated Use `factory.updateNamespaceImport` or the factory supplied by your transformation context instead. */
6892 const updateNamespaceImport: (node: NamespaceImport, name: Identifier) => NamespaceImport;
6893 /** @deprecated Use `factory.createNamedImports` or the factory supplied by your transformation context instead. */
6894 const createNamedImports: (elements: readonly ImportSpecifier[]) => NamedImports;
6895 /** @deprecated Use `factory.updateNamedImports` or the factory supplied by your transformation context instead. */
6896 const updateNamedImports: (node: NamedImports, elements: readonly ImportSpecifier[]) => NamedImports;
6897 /** @deprecated Use `factory.createImportSpecifier` or the factory supplied by your transformation context instead. */
6898 const createImportSpecifier: (propertyName: Identifier | undefined, name: Identifier) => ImportSpecifier;
6899 /** @deprecated Use `factory.updateImportSpecifier` or the factory supplied by your transformation context instead. */
6900 const updateImportSpecifier: (node: ImportSpecifier, propertyName: Identifier | undefined, name: Identifier) => ImportSpecifier;
6901 /** @deprecated Use `factory.createExportAssignment` or the factory supplied by your transformation context instead. */
6902 const createExportAssignment: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isExportEquals: boolean | undefined, expression: Expression) => ExportAssignment;
6903 /** @deprecated Use `factory.updateExportAssignment` or the factory supplied by your transformation context instead. */
6904 const updateExportAssignment: (node: ExportAssignment, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, expression: Expression) => ExportAssignment;
6905 /** @deprecated Use `factory.createNamedExports` or the factory supplied by your transformation context instead. */
6906 const createNamedExports: (elements: readonly ExportSpecifier[]) => NamedExports;
6907 /** @deprecated Use `factory.updateNamedExports` or the factory supplied by your transformation context instead. */
6908 const updateNamedExports: (node: NamedExports, elements: readonly ExportSpecifier[]) => NamedExports;
6909 /** @deprecated Use `factory.createExportSpecifier` or the factory supplied by your transformation context instead. */
6910 const createExportSpecifier: (propertyName: string | Identifier | undefined, name: string | Identifier) => ExportSpecifier;
6911 /** @deprecated Use `factory.updateExportSpecifier` or the factory supplied by your transformation context instead. */
6912 const updateExportSpecifier: (node: ExportSpecifier, propertyName: Identifier | undefined, name: Identifier) => ExportSpecifier;
6913 /** @deprecated Use `factory.createExternalModuleReference` or the factory supplied by your transformation context instead. */
6914 const createExternalModuleReference: (expression: Expression) => ExternalModuleReference;
6915 /** @deprecated Use `factory.updateExternalModuleReference` or the factory supplied by your transformation context instead. */
6916 const updateExternalModuleReference: (node: ExternalModuleReference, expression: Expression) => ExternalModuleReference;
6917 /** @deprecated Use `factory.createJSDocTypeExpression` or the factory supplied by your transformation context instead. */
6918 const createJSDocTypeExpression: (type: TypeNode) => JSDocTypeExpression;
6919 /** @deprecated Use `factory.createJSDocTypeTag` or the factory supplied by your transformation context instead. */
6920 const createJSDocTypeTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | undefined) => JSDocTypeTag;
6921 /** @deprecated Use `factory.createJSDocReturnTag` or the factory supplied by your transformation context instead. */
6922 const createJSDocReturnTag: (tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression | undefined, comment?: string | undefined) => JSDocReturnTag;
6923 /** @deprecated Use `factory.createJSDocThisTag` or the factory supplied by your transformation context instead. */
6924 const createJSDocThisTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | undefined) => JSDocThisTag;
6925 /** @deprecated Use `factory.createJSDocComment` or the factory supplied by your transformation context instead. */
6926 const createJSDocComment: (comment?: string | undefined, tags?: readonly JSDocTag[] | undefined) => JSDoc;
6927 /** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */
6928 const createJSDocParameterTag: (tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, isNameFirst?: boolean | undefined, comment?: string | undefined) => JSDocParameterTag;
6929 /** @deprecated Use `factory.createJSDocClassTag` or the factory supplied by your transformation context instead. */
6930 const createJSDocClassTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocClassTag;
6931 /** @deprecated Use `factory.createJSDocAugmentsTag` or the factory supplied by your transformation context instead. */
6932 const createJSDocAugmentsTag: (tagName: Identifier | undefined, className: ExpressionWithTypeArguments & {
6933 readonly expression: Identifier | PropertyAccessEntityNameExpression;
6934 }, comment?: string | undefined) => JSDocAugmentsTag;
6935 /** @deprecated Use `factory.createJSDocEnumTag` or the factory supplied by your transformation context instead. */
6936 const createJSDocEnumTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | undefined) => JSDocEnumTag;
6937 /** @deprecated Use `factory.createJSDocTemplateTag` or the factory supplied by your transformation context instead. */
6938 const createJSDocTemplateTag: (tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment?: string | undefined) => JSDocTemplateTag;
6939 /** @deprecated Use `factory.createJSDocTypedefTag` or the factory supplied by your transformation context instead. */
6940 const createJSDocTypedefTag: (tagName: Identifier | undefined, typeExpression?: JSDocTypeLiteral | JSDocTypeExpression | undefined, fullName?: Identifier | JSDocNamespaceDeclaration | undefined, comment?: string | undefined) => JSDocTypedefTag;
6941 /** @deprecated Use `factory.createJSDocCallbackTag` or the factory supplied by your transformation context instead. */
6942 const createJSDocCallbackTag: (tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName?: Identifier | JSDocNamespaceDeclaration | undefined, comment?: string | undefined) => JSDocCallbackTag;
6943 /** @deprecated Use `factory.createJSDocSignature` or the factory supplied by your transformation context instead. */
6944 const createJSDocSignature: (typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type?: JSDocReturnTag | undefined) => JSDocSignature;
6945 /** @deprecated Use `factory.createJSDocPropertyTag` or the factory supplied by your transformation context instead. */
6946 const createJSDocPropertyTag: (tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, isNameFirst?: boolean | undefined, comment?: string | undefined) => JSDocPropertyTag;
6947 /** @deprecated Use `factory.createJSDocTypeLiteral` or the factory supplied by your transformation context instead. */
6948 const createJSDocTypeLiteral: (jsDocPropertyTags?: readonly JSDocPropertyLikeTag[] | undefined, isArrayType?: boolean | undefined) => JSDocTypeLiteral;
6949 /** @deprecated Use `factory.createJSDocImplementsTag` or the factory supplied by your transformation context instead. */
6950 const createJSDocImplementsTag: (tagName: Identifier | undefined, className: ExpressionWithTypeArguments & {
6951 readonly expression: Identifier | PropertyAccessEntityNameExpression;
6952 }, comment?: string | undefined) => JSDocImplementsTag;
6953 /** @deprecated Use `factory.createJSDocAuthorTag` or the factory supplied by your transformation context instead. */
6954 const createJSDocAuthorTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocAuthorTag;
6955 /** @deprecated Use `factory.createJSDocPublicTag` or the factory supplied by your transformation context instead. */
6956 const createJSDocPublicTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocPublicTag;
6957 /** @deprecated Use `factory.createJSDocPrivateTag` or the factory supplied by your transformation context instead. */
6958 const createJSDocPrivateTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocPrivateTag;
6959 /** @deprecated Use `factory.createJSDocProtectedTag` or the factory supplied by your transformation context instead. */
6960 const createJSDocProtectedTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocProtectedTag;
6961 /** @deprecated Use `factory.createJSDocReadonlyTag` or the factory supplied by your transformation context instead. */
6962 const createJSDocReadonlyTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocReadonlyTag;
6963 /** @deprecated Use `factory.createJSDocUnknownTag` or the factory supplied by your transformation context instead. */
6964 const createJSDocTag: (tagName: Identifier, comment?: string | undefined) => JSDocUnknownTag;
6965 /** @deprecated Use `factory.createJsxElement` or the factory supplied by your transformation context instead. */
6966 const createJsxElement: (openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement) => JsxElement;
6967 /** @deprecated Use `factory.updateJsxElement` or the factory supplied by your transformation context instead. */
6968 const updateJsxElement: (node: JsxElement, openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement) => JsxElement;
6969 /** @deprecated Use `factory.createJsxSelfClosingElement` or the factory supplied by your transformation context instead. */
6970 const createJsxSelfClosingElement: (tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxSelfClosingElement;
6971 /** @deprecated Use `factory.updateJsxSelfClosingElement` or the factory supplied by your transformation context instead. */
6972 const updateJsxSelfClosingElement: (node: JsxSelfClosingElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxSelfClosingElement;
6973 /** @deprecated Use `factory.createJsxOpeningElement` or the factory supplied by your transformation context instead. */
6974 const createJsxOpeningElement: (tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxOpeningElement;
6975 /** @deprecated Use `factory.updateJsxOpeningElement` or the factory supplied by your transformation context instead. */
6976 const updateJsxOpeningElement: (node: JsxOpeningElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxOpeningElement;
6977 /** @deprecated Use `factory.createJsxClosingElement` or the factory supplied by your transformation context instead. */
6978 const createJsxClosingElement: (tagName: JsxTagNameExpression) => JsxClosingElement;
6979 /** @deprecated Use `factory.updateJsxClosingElement` or the factory supplied by your transformation context instead. */
6980 const updateJsxClosingElement: (node: JsxClosingElement, tagName: JsxTagNameExpression) => JsxClosingElement;
6981 /** @deprecated Use `factory.createJsxFragment` or the factory supplied by your transformation context instead. */
6982 const createJsxFragment: (openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment) => JsxFragment;
6983 /** @deprecated Use `factory.createJsxText` or the factory supplied by your transformation context instead. */
6984 const createJsxText: (text: string, containsOnlyTriviaWhiteSpaces?: boolean | undefined) => JsxText;
6985 /** @deprecated Use `factory.updateJsxText` or the factory supplied by your transformation context instead. */
6986 const updateJsxText: (node: JsxText, text: string, containsOnlyTriviaWhiteSpaces?: boolean | undefined) => JsxText;
6987 /** @deprecated Use `factory.createJsxOpeningFragment` or the factory supplied by your transformation context instead. */
6988 const createJsxOpeningFragment: () => JsxOpeningFragment;
6989 /** @deprecated Use `factory.createJsxJsxClosingFragment` or the factory supplied by your transformation context instead. */
6990 const createJsxJsxClosingFragment: () => JsxClosingFragment;
6991 /** @deprecated Use `factory.updateJsxFragment` or the factory supplied by your transformation context instead. */
6992 const updateJsxFragment: (node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment) => JsxFragment;
6993 /** @deprecated Use `factory.createJsxAttribute` or the factory supplied by your transformation context instead. */
6994 const createJsxAttribute: (name: Identifier, initializer: StringLiteral | JsxExpression | undefined) => JsxAttribute;
6995 /** @deprecated Use `factory.updateJsxAttribute` or the factory supplied by your transformation context instead. */
6996 const updateJsxAttribute: (node: JsxAttribute, name: Identifier, initializer: StringLiteral | JsxExpression | undefined) => JsxAttribute;
6997 /** @deprecated Use `factory.createJsxAttributes` or the factory supplied by your transformation context instead. */
6998 const createJsxAttributes: (properties: readonly JsxAttributeLike[]) => JsxAttributes;
6999 /** @deprecated Use `factory.updateJsxAttributes` or the factory supplied by your transformation context instead. */
7000 const updateJsxAttributes: (node: JsxAttributes, properties: readonly JsxAttributeLike[]) => JsxAttributes;
7001 /** @deprecated Use `factory.createJsxSpreadAttribute` or the factory supplied by your transformation context instead. */
7002 const createJsxSpreadAttribute: (expression: Expression) => JsxSpreadAttribute;
7003 /** @deprecated Use `factory.updateJsxSpreadAttribute` or the factory supplied by your transformation context instead. */
7004 const updateJsxSpreadAttribute: (node: JsxSpreadAttribute, expression: Expression) => JsxSpreadAttribute;
7005 /** @deprecated Use `factory.createJsxExpression` or the factory supplied by your transformation context instead. */
7006 const createJsxExpression: (dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined) => JsxExpression;
7007 /** @deprecated Use `factory.updateJsxExpression` or the factory supplied by your transformation context instead. */
7008 const updateJsxExpression: (node: JsxExpression, expression: Expression | undefined) => JsxExpression;
7009 /** @deprecated Use `factory.createCaseClause` or the factory supplied by your transformation context instead. */
7010 const createCaseClause: (expression: Expression, statements: readonly Statement[]) => CaseClause;
7011 /** @deprecated Use `factory.updateCaseClause` or the factory supplied by your transformation context instead. */
7012 const updateCaseClause: (node: CaseClause, expression: Expression, statements: readonly Statement[]) => CaseClause;
7013 /** @deprecated Use `factory.createDefaultClause` or the factory supplied by your transformation context instead. */
7014 const createDefaultClause: (statements: readonly Statement[]) => DefaultClause;
7015 /** @deprecated Use `factory.updateDefaultClause` or the factory supplied by your transformation context instead. */
7016 const updateDefaultClause: (node: DefaultClause, statements: readonly Statement[]) => DefaultClause;
7017 /** @deprecated Use `factory.createHeritageClause` or the factory supplied by your transformation context instead. */
7018 const createHeritageClause: (token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword, types: readonly ExpressionWithTypeArguments[]) => HeritageClause;
7019 /** @deprecated Use `factory.updateHeritageClause` or the factory supplied by your transformation context instead. */
7020 const updateHeritageClause: (node: HeritageClause, types: readonly ExpressionWithTypeArguments[]) => HeritageClause;
7021 /** @deprecated Use `factory.createCatchClause` or the factory supplied by your transformation context instead. */
7022 const createCatchClause: (variableDeclaration: string | VariableDeclaration | undefined, block: Block) => CatchClause;
7023 /** @deprecated Use `factory.updateCatchClause` or the factory supplied by your transformation context instead. */
7024 const updateCatchClause: (node: CatchClause, variableDeclaration: VariableDeclaration | undefined, block: Block) => CatchClause;
7025 /** @deprecated Use `factory.createPropertyAssignment` or the factory supplied by your transformation context instead. */
7026 const createPropertyAssignment: (name: string | PropertyName, initializer: Expression) => PropertyAssignment;
7027 /** @deprecated Use `factory.updatePropertyAssignment` or the factory supplied by your transformation context instead. */
7028 const updatePropertyAssignment: (node: PropertyAssignment, name: PropertyName, initializer: Expression) => PropertyAssignment;
7029 /** @deprecated Use `factory.createShorthandPropertyAssignment` or the factory supplied by your transformation context instead. */
7030 const createShorthandPropertyAssignment: (name: string | Identifier, objectAssignmentInitializer?: Expression | undefined) => ShorthandPropertyAssignment;
7031 /** @deprecated Use `factory.updateShorthandPropertyAssignment` or the factory supplied by your transformation context instead. */
7032 const updateShorthandPropertyAssignment: (node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression | undefined) => ShorthandPropertyAssignment;
7033 /** @deprecated Use `factory.createSpreadAssignment` or the factory supplied by your transformation context instead. */
7034 const createSpreadAssignment: (expression: Expression) => SpreadAssignment;
7035 /** @deprecated Use `factory.updateSpreadAssignment` or the factory supplied by your transformation context instead. */
7036 const updateSpreadAssignment: (node: SpreadAssignment, expression: Expression) => SpreadAssignment;
7037 /** @deprecated Use `factory.createEnumMember` or the factory supplied by your transformation context instead. */
7038 const createEnumMember: (name: string | PropertyName, initializer?: Expression | undefined) => EnumMember;
7039 /** @deprecated Use `factory.updateEnumMember` or the factory supplied by your transformation context instead. */
7040 const updateEnumMember: (node: EnumMember, name: PropertyName, initializer: Expression | undefined) => EnumMember;
7041 /** @deprecated Use `factory.updateSourceFile` or the factory supplied by your transformation context instead. */
7042 const updateSourceFileNode: (node: SourceFile, statements: readonly Statement[], isDeclarationFile?: boolean | undefined, referencedFiles?: readonly FileReference[] | undefined, typeReferences?: readonly FileReference[] | undefined, hasNoDefaultLib?: boolean | undefined, libReferences?: readonly FileReference[] | undefined) => SourceFile;
7043 /** @deprecated Use `factory.createNotEmittedStatement` or the factory supplied by your transformation context instead. */
7044 const createNotEmittedStatement: (original: Node) => NotEmittedStatement;
7045 /** @deprecated Use `factory.createPartiallyEmittedExpression` or the factory supplied by your transformation context instead. */
7046 const createPartiallyEmittedExpression: (expression: Expression, original?: Node | undefined) => PartiallyEmittedExpression;
7047 /** @deprecated Use `factory.updatePartiallyEmittedExpression` or the factory supplied by your transformation context instead. */
7048 const updatePartiallyEmittedExpression: (node: PartiallyEmittedExpression, expression: Expression) => PartiallyEmittedExpression;
7049 /** @deprecated Use `factory.createCommaListExpression` or the factory supplied by your transformation context instead. */
7050 const createCommaList: (elements: readonly Expression[]) => CommaListExpression;
7051 /** @deprecated Use `factory.updateCommaListExpression` or the factory supplied by your transformation context instead. */
7052 const updateCommaList: (node: CommaListExpression, elements: readonly Expression[]) => CommaListExpression;
7053 /** @deprecated Use `factory.createBundle` or the factory supplied by your transformation context instead. */
7054 const createBundle: (sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[] | undefined) => Bundle;
7055 /** @deprecated Use `factory.updateBundle` or the factory supplied by your transformation context instead. */
7056 const updateBundle: (node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[] | undefined) => Bundle;
7057 /** @deprecated Use `factory.createImmediatelyInvokedFunctionExpression` or the factory supplied by your transformation context instead. */
7058 const createImmediatelyInvokedFunctionExpression: {
7059 (statements: readonly Statement[]): CallExpression;
7060 (statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression;
7061 };
7062 /** @deprecated Use `factory.createImmediatelyInvokedArrowFunction` or the factory supplied by your transformation context instead. */
7063 const createImmediatelyInvokedArrowFunction: {
7064 (statements: readonly Statement[]): CallExpression;
7065 (statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression;
7066 };
7067 /** @deprecated Use `factory.createVoidZero` or the factory supplied by your transformation context instead. */
7068 const createVoidZero: () => VoidExpression;
7069 /** @deprecated Use `factory.createExportDefault` or the factory supplied by your transformation context instead. */
7070 const createExportDefault: (expression: Expression) => ExportAssignment;
7071 /** @deprecated Use `factory.createExternalModuleExport` or the factory supplied by your transformation context instead. */
7072 const createExternalModuleExport: (exportName: Identifier) => ExportDeclaration;
7073 /** @deprecated Use `factory.createNamespaceExport` or the factory supplied by your transformation context instead. */
7074 const createNamespaceExport: (name: Identifier) => NamespaceExport;
7075 /** @deprecated Use `factory.updateNamespaceExport` or the factory supplied by your transformation context instead. */
7076 const updateNamespaceExport: (node: NamespaceExport, name: Identifier) => NamespaceExport;
7077 /** @deprecated Use `factory.createToken` or the factory supplied by your transformation context instead. */
7078 const createToken: <TKind extends SyntaxKind>(kind: TKind) => Token<TKind>;
7079 /** @deprecated Use `factory.createIdentifier` or the factory supplied by your transformation context instead. */
7080 const createIdentifier: (text: string) => Identifier;
7081 /** @deprecated Use `factory.createTempVariable` or the factory supplied by your transformation context instead. */
7082 const createTempVariable: (recordTempVariable: ((node: Identifier) => void) | undefined) => Identifier;
7083 /** @deprecated Use `factory.getGeneratedNameForNode` or the factory supplied by your transformation context instead. */
7084 const getGeneratedNameForNode: (node: Node | undefined) => Identifier;
7085 /** @deprecated Use `factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic)` or the factory supplied by your transformation context instead. */
7086 const createOptimisticUniqueName: (text: string) => Identifier;
7087 /** @deprecated Use `factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic | GeneratedIdentifierFlags.FileLevel)` or the factory supplied by your transformation context instead. */
7088 const createFileLevelUniqueName: (text: string) => Identifier;
7089 /** @deprecated Use `factory.createIndexSignature` or the factory supplied by your transformation context instead. */
7090 const createIndexSignature: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => IndexSignatureDeclaration;
7091 /** @deprecated Use `factory.createTypePredicateNode` or the factory supplied by your transformation context instead. */
7092 const createTypePredicateNode: (parameterName: Identifier | ThisTypeNode | string, type: TypeNode) => TypePredicateNode;
7093 /** @deprecated Use `factory.updateTypePredicateNode` or the factory supplied by your transformation context instead. */
7094 const updateTypePredicateNode: (node: TypePredicateNode, parameterName: Identifier | ThisTypeNode, type: TypeNode) => TypePredicateNode;
7095 /** @deprecated Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead. */
7096 const createLiteral: {
7097 (value: string | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier): StringLiteral;
7098 (value: number | PseudoBigInt): NumericLiteral;
7099 (value: boolean): BooleanLiteral;
7100 (value: string | number | PseudoBigInt | boolean): PrimaryExpression;
7101 };
7102 /** @deprecated Use `factory.createMethodSignature` or the factory supplied by your transformation context instead. */
7103 const createMethodSignature: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined) => MethodSignature;
7104 /** @deprecated Use `factory.updateMethodSignature` or the factory supplied by your transformation context instead. */
7105 const updateMethodSignature: (node: MethodSignature, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined, name: PropertyName, questionToken: QuestionToken | undefined) => MethodSignature;
7106 /** @deprecated Use `factory.createTypeOperatorNode` or the factory supplied by your transformation context instead. */
7107 const createTypeOperatorNode: {
7108 (type: TypeNode): TypeOperatorNode;
7109 (operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode;
7110 };
7111 /** @deprecated Use `factory.createTaggedTemplate` or the factory supplied by your transformation context instead. */
7112 const createTaggedTemplate: {
7113 (tag: Expression, template: TemplateLiteral): TaggedTemplateExpression;
7114 (tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression;
7115 };
7116 /** @deprecated Use `factory.updateTaggedTemplate` or the factory supplied by your transformation context instead. */
7117 const updateTaggedTemplate: {
7118 (node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression;
7119 (node: TaggedTemplateExpression, tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression;
7120 };
7121 /** @deprecated Use `factory.updateBinary` or the factory supplied by your transformation context instead. */
7122 const updateBinary: (node: BinaryExpression, left: Expression, right: Expression, operator?: BinaryOperator | BinaryOperatorToken) => BinaryExpression;
7123 /** @deprecated Use `factory.createConditional` or the factory supplied by your transformation context instead. */
7124 const createConditional: {
7125 (condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression;
7126 (condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression;
7127 };
7128 /** @deprecated Use `factory.createYield` or the factory supplied by your transformation context instead. */
7129 const createYield: {
7130 (expression?: Expression | undefined): YieldExpression;
7131 (asteriskToken: AsteriskToken | undefined, expression: Expression): YieldExpression;
7132 };
7133 /** @deprecated Use `factory.createClassExpression` or the factory supplied by your transformation context instead. */
7134 const createClassExpression: (modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassExpression;
7135 /** @deprecated Use `factory.updateClassExpression` or the factory supplied by your transformation context instead. */
7136 const updateClassExpression: (node: ClassExpression, modifiers: readonly Modifier[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassExpression;
7137 /** @deprecated Use `factory.createPropertySignature` or the factory supplied by your transformation context instead. */
7138 const createPropertySignature: (modifiers: readonly Modifier[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer?: Expression | undefined) => PropertySignature;
7139 /** @deprecated Use `factory.updatePropertySignature` or the factory supplied by your transformation context instead. */
7140 const updatePropertySignature: (node: PropertySignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined) => PropertySignature;
7141 /** @deprecated Use `factory.createExpressionWithTypeArguments` or the factory supplied by your transformation context instead. */
7142 const createExpressionWithTypeArguments: (typeArguments: readonly TypeNode[] | undefined, expression: Expression) => ExpressionWithTypeArguments;
7143 /** @deprecated Use `factory.updateExpressionWithTypeArguments` or the factory supplied by your transformation context instead. */
7144 const updateExpressionWithTypeArguments: (node: ExpressionWithTypeArguments, typeArguments: readonly TypeNode[] | undefined, expression: Expression) => ExpressionWithTypeArguments;
7145 /** @deprecated Use `factory.createArrowFunction` or the factory supplied by your transformation context instead. */
7146 const createArrowFunction: {
7147 (modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction;
7148 (modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction;
7149 };
7150 /** @deprecated Use `factory.updateArrowFunction` or the factory supplied by your transformation context instead. */
7151 const updateArrowFunction: {
7152 (node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken, body: ConciseBody): ArrowFunction;
7153 (node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction;
7154 };
7155 /** @deprecated Use `factory.createVariableDeclaration` or the factory supplied by your transformation context instead. */
7156 const createVariableDeclaration: {
7157 (name: string | BindingName, type?: TypeNode | undefined, initializer?: Expression | undefined): VariableDeclaration;
7158 (name: string | BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration;
7159 };
7160 /** @deprecated Use `factory.updateVariableDeclaration` or the factory supplied by your transformation context instead. */
7161 const updateVariableDeclaration: {
7162 (node: VariableDeclaration, name: BindingName, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration;
7163 (node: VariableDeclaration, name: BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration;
7164 };
7165 /** @deprecated Use `factory.createImportClause` or the factory supplied by your transformation context instead. */
7166 const createImportClause: (name: Identifier | undefined, namedBindings: NamedImportBindings | undefined, isTypeOnly?: any) => ImportClause;
7167 /** @deprecated Use `factory.updateImportClause` or the factory supplied by your transformation context instead. */
7168 const updateImportClause: (node: ImportClause, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined, isTypeOnly: boolean) => ImportClause;
7169 /** @deprecated Use `factory.createExportDeclaration` or the factory supplied by your transformation context instead. */
7170 const createExportDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression | undefined, isTypeOnly?: any) => ExportDeclaration;
7171 /** @deprecated Use `factory.updateExportDeclaration` or the factory supplied by your transformation context instead. */
7172 const updateExportDeclaration: (node: ExportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, isTypeOnly: boolean) => ExportDeclaration;
7173 /** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */
7174 const createJSDocParamTag: (name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, comment?: string | undefined) => JSDocParameterTag;
7175 /** @deprecated Use `factory.createComma` or the factory supplied by your transformation context instead. */
7176 const createComma: (left: Expression, right: Expression) => Expression;
7177 /** @deprecated Use `factory.createLessThan` or the factory supplied by your transformation context instead. */
7178 const createLessThan: (left: Expression, right: Expression) => Expression;
7179 /** @deprecated Use `factory.createAssignment` or the factory supplied by your transformation context instead. */
7180 const createAssignment: (left: Expression, right: Expression) => BinaryExpression;
7181 /** @deprecated Use `factory.createStrictEquality` or the factory supplied by your transformation context instead. */
7182 const createStrictEquality: (left: Expression, right: Expression) => BinaryExpression;
7183 /** @deprecated Use `factory.createStrictInequality` or the factory supplied by your transformation context instead. */
7184 const createStrictInequality: (left: Expression, right: Expression) => BinaryExpression;
7185 /** @deprecated Use `factory.createAdd` or the factory supplied by your transformation context instead. */
7186 const createAdd: (left: Expression, right: Expression) => BinaryExpression;
7187 /** @deprecated Use `factory.createSubtract` or the factory supplied by your transformation context instead. */
7188 const createSubtract: (left: Expression, right: Expression) => BinaryExpression;
7189 /** @deprecated Use `factory.createLogicalAnd` or the factory supplied by your transformation context instead. */
7190 const createLogicalAnd: (left: Expression, right: Expression) => BinaryExpression;
7191 /** @deprecated Use `factory.createLogicalOr` or the factory supplied by your transformation context instead. */
7192 const createLogicalOr: (left: Expression, right: Expression) => BinaryExpression;
7193 /** @deprecated Use `factory.createPostfixIncrement` or the factory supplied by your transformation context instead. */
7194 const createPostfixIncrement: (operand: Expression) => PostfixUnaryExpression;
7195 /** @deprecated Use `factory.createLogicalNot` or the factory supplied by your transformation context instead. */
7196 const createLogicalNot: (operand: Expression) => PrefixUnaryExpression;
7197 /** @deprecated Use an appropriate `factory` method instead. */
7198 const createNode: (kind: SyntaxKind, pos?: any, end?: any) => Node;
7199 /**
7200 * Creates a shallow, memberwise clone of a node ~for mutation~ with its `pos`, `end`, and `parent` set.
7201 *
7202 * NOTE: It is unsafe to change any properties of a `Node` that relate to its AST children, as those changes won't be
7203 * captured with respect to transformations.
7204 *
7205 * @deprecated Use an appropriate `factory.update...` method instead, use `setCommentRange` or `setSourceMapRange`, and avoid setting `parent`.
7206 */
7207 const getMutableClone: <T extends Node>(node: T) => T;
7208 /** @deprecated Use `isTypeAssertionExpression` instead. */
7209 const isTypeAssertion: (node: Node) => node is TypeAssertion;
7210 /**
7211 * @deprecated Use `ts.ReadonlyESMap<K, V>` instead.
7212 */
7213 interface ReadonlyMap<T> extends ReadonlyESMap<string, T> {
7214 }
7215 /**
7216 * @deprecated Use `ts.ESMap<K, V>` instead.
7217 */
7218 interface Map<T> extends ESMap<string, T> {
7219 }
7220}
7221
7222export = ts;
\No newline at end of file