UNPKG

660 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.9";
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 /** Only the JSDoc scanner produces HashToken. The normal scanner produces PrivateIdentifier. */
170 HashToken = 62,
171 EqualsToken = 63,
172 PlusEqualsToken = 64,
173 MinusEqualsToken = 65,
174 AsteriskEqualsToken = 66,
175 AsteriskAsteriskEqualsToken = 67,
176 SlashEqualsToken = 68,
177 PercentEqualsToken = 69,
178 LessThanLessThanEqualsToken = 70,
179 GreaterThanGreaterThanEqualsToken = 71,
180 GreaterThanGreaterThanGreaterThanEqualsToken = 72,
181 AmpersandEqualsToken = 73,
182 BarEqualsToken = 74,
183 BarBarEqualsToken = 75,
184 AmpersandAmpersandEqualsToken = 76,
185 QuestionQuestionEqualsToken = 77,
186 CaretEqualsToken = 78,
187 Identifier = 79,
188 PrivateIdentifier = 80,
189 BreakKeyword = 81,
190 CaseKeyword = 82,
191 CatchKeyword = 83,
192 ClassKeyword = 84,
193 ConstKeyword = 85,
194 ContinueKeyword = 86,
195 DebuggerKeyword = 87,
196 DefaultKeyword = 88,
197 DeleteKeyword = 89,
198 DoKeyword = 90,
199 ElseKeyword = 91,
200 EnumKeyword = 92,
201 ExportKeyword = 93,
202 ExtendsKeyword = 94,
203 FalseKeyword = 95,
204 FinallyKeyword = 96,
205 ForKeyword = 97,
206 FunctionKeyword = 98,
207 IfKeyword = 99,
208 ImportKeyword = 100,
209 InKeyword = 101,
210 InstanceOfKeyword = 102,
211 NewKeyword = 103,
212 NullKeyword = 104,
213 ReturnKeyword = 105,
214 SuperKeyword = 106,
215 SwitchKeyword = 107,
216 ThisKeyword = 108,
217 ThrowKeyword = 109,
218 TrueKeyword = 110,
219 TryKeyword = 111,
220 TypeOfKeyword = 112,
221 VarKeyword = 113,
222 VoidKeyword = 114,
223 WhileKeyword = 115,
224 WithKeyword = 116,
225 ImplementsKeyword = 117,
226 InterfaceKeyword = 118,
227 LetKeyword = 119,
228 PackageKeyword = 120,
229 PrivateKeyword = 121,
230 ProtectedKeyword = 122,
231 PublicKeyword = 123,
232 StaticKeyword = 124,
233 YieldKeyword = 125,
234 AbstractKeyword = 126,
235 AccessorKeyword = 127,
236 AsKeyword = 128,
237 AssertsKeyword = 129,
238 AssertKeyword = 130,
239 AnyKeyword = 131,
240 AsyncKeyword = 132,
241 AwaitKeyword = 133,
242 BooleanKeyword = 134,
243 ConstructorKeyword = 135,
244 DeclareKeyword = 136,
245 GetKeyword = 137,
246 InferKeyword = 138,
247 IntrinsicKeyword = 139,
248 IsKeyword = 140,
249 KeyOfKeyword = 141,
250 ModuleKeyword = 142,
251 NamespaceKeyword = 143,
252 NeverKeyword = 144,
253 OutKeyword = 145,
254 ReadonlyKeyword = 146,
255 RequireKeyword = 147,
256 NumberKeyword = 148,
257 ObjectKeyword = 149,
258 SatisfiesKeyword = 150,
259 SetKeyword = 151,
260 StringKeyword = 152,
261 SymbolKeyword = 153,
262 TypeKeyword = 154,
263 UndefinedKeyword = 155,
264 UniqueKeyword = 156,
265 UnknownKeyword = 157,
266 FromKeyword = 158,
267 GlobalKeyword = 159,
268 BigIntKeyword = 160,
269 OverrideKeyword = 161,
270 OfKeyword = 162,
271 QualifiedName = 163,
272 ComputedPropertyName = 164,
273 TypeParameter = 165,
274 Parameter = 166,
275 Decorator = 167,
276 PropertySignature = 168,
277 PropertyDeclaration = 169,
278 MethodSignature = 170,
279 MethodDeclaration = 171,
280 ClassStaticBlockDeclaration = 172,
281 Constructor = 173,
282 GetAccessor = 174,
283 SetAccessor = 175,
284 CallSignature = 176,
285 ConstructSignature = 177,
286 IndexSignature = 178,
287 TypePredicate = 179,
288 TypeReference = 180,
289 FunctionType = 181,
290 ConstructorType = 182,
291 TypeQuery = 183,
292 TypeLiteral = 184,
293 ArrayType = 185,
294 TupleType = 186,
295 OptionalType = 187,
296 RestType = 188,
297 UnionType = 189,
298 IntersectionType = 190,
299 ConditionalType = 191,
300 InferType = 192,
301 ParenthesizedType = 193,
302 ThisType = 194,
303 TypeOperator = 195,
304 IndexedAccessType = 196,
305 MappedType = 197,
306 LiteralType = 198,
307 NamedTupleMember = 199,
308 TemplateLiteralType = 200,
309 TemplateLiteralTypeSpan = 201,
310 ImportType = 202,
311 ObjectBindingPattern = 203,
312 ArrayBindingPattern = 204,
313 BindingElement = 205,
314 ArrayLiteralExpression = 206,
315 ObjectLiteralExpression = 207,
316 PropertyAccessExpression = 208,
317 ElementAccessExpression = 209,
318 CallExpression = 210,
319 NewExpression = 211,
320 TaggedTemplateExpression = 212,
321 TypeAssertionExpression = 213,
322 ParenthesizedExpression = 214,
323 FunctionExpression = 215,
324 ArrowFunction = 216,
325 DeleteExpression = 217,
326 TypeOfExpression = 218,
327 VoidExpression = 219,
328 AwaitExpression = 220,
329 PrefixUnaryExpression = 221,
330 PostfixUnaryExpression = 222,
331 BinaryExpression = 223,
332 ConditionalExpression = 224,
333 TemplateExpression = 225,
334 YieldExpression = 226,
335 SpreadElement = 227,
336 ClassExpression = 228,
337 OmittedExpression = 229,
338 ExpressionWithTypeArguments = 230,
339 AsExpression = 231,
340 NonNullExpression = 232,
341 MetaProperty = 233,
342 SyntheticExpression = 234,
343 SatisfiesExpression = 235,
344 TemplateSpan = 236,
345 SemicolonClassElement = 237,
346 Block = 238,
347 EmptyStatement = 239,
348 VariableStatement = 240,
349 ExpressionStatement = 241,
350 IfStatement = 242,
351 DoStatement = 243,
352 WhileStatement = 244,
353 ForStatement = 245,
354 ForInStatement = 246,
355 ForOfStatement = 247,
356 ContinueStatement = 248,
357 BreakStatement = 249,
358 ReturnStatement = 250,
359 WithStatement = 251,
360 SwitchStatement = 252,
361 LabeledStatement = 253,
362 ThrowStatement = 254,
363 TryStatement = 255,
364 DebuggerStatement = 256,
365 VariableDeclaration = 257,
366 VariableDeclarationList = 258,
367 FunctionDeclaration = 259,
368 ClassDeclaration = 260,
369 InterfaceDeclaration = 261,
370 TypeAliasDeclaration = 262,
371 EnumDeclaration = 263,
372 ModuleDeclaration = 264,
373 ModuleBlock = 265,
374 CaseBlock = 266,
375 NamespaceExportDeclaration = 267,
376 ImportEqualsDeclaration = 268,
377 ImportDeclaration = 269,
378 ImportClause = 270,
379 NamespaceImport = 271,
380 NamedImports = 272,
381 ImportSpecifier = 273,
382 ExportAssignment = 274,
383 ExportDeclaration = 275,
384 NamedExports = 276,
385 NamespaceExport = 277,
386 ExportSpecifier = 278,
387 MissingDeclaration = 279,
388 ExternalModuleReference = 280,
389 JsxElement = 281,
390 JsxSelfClosingElement = 282,
391 JsxOpeningElement = 283,
392 JsxClosingElement = 284,
393 JsxFragment = 285,
394 JsxOpeningFragment = 286,
395 JsxClosingFragment = 287,
396 JsxAttribute = 288,
397 JsxAttributes = 289,
398 JsxSpreadAttribute = 290,
399 JsxExpression = 291,
400 CaseClause = 292,
401 DefaultClause = 293,
402 HeritageClause = 294,
403 CatchClause = 295,
404 AssertClause = 296,
405 AssertEntry = 297,
406 ImportTypeAssertionContainer = 298,
407 PropertyAssignment = 299,
408 ShorthandPropertyAssignment = 300,
409 SpreadAssignment = 301,
410 EnumMember = 302,
411 UnparsedPrologue = 303,
412 UnparsedPrepend = 304,
413 UnparsedText = 305,
414 UnparsedInternalText = 306,
415 UnparsedSyntheticReference = 307,
416 SourceFile = 308,
417 Bundle = 309,
418 UnparsedSource = 310,
419 InputFiles = 311,
420 JSDocTypeExpression = 312,
421 JSDocNameReference = 313,
422 JSDocMemberName = 314,
423 JSDocAllType = 315,
424 JSDocUnknownType = 316,
425 JSDocNullableType = 317,
426 JSDocNonNullableType = 318,
427 JSDocOptionalType = 319,
428 JSDocFunctionType = 320,
429 JSDocVariadicType = 321,
430 JSDocNamepathType = 322,
431 JSDoc = 323,
432 /** @deprecated Use SyntaxKind.JSDoc */
433 JSDocComment = 323,
434 JSDocText = 324,
435 JSDocTypeLiteral = 325,
436 JSDocSignature = 326,
437 JSDocLink = 327,
438 JSDocLinkCode = 328,
439 JSDocLinkPlain = 329,
440 JSDocTag = 330,
441 JSDocAugmentsTag = 331,
442 JSDocImplementsTag = 332,
443 JSDocAuthorTag = 333,
444 JSDocDeprecatedTag = 334,
445 JSDocClassTag = 335,
446 JSDocPublicTag = 336,
447 JSDocPrivateTag = 337,
448 JSDocProtectedTag = 338,
449 JSDocReadonlyTag = 339,
450 JSDocOverrideTag = 340,
451 JSDocCallbackTag = 341,
452 JSDocEnumTag = 342,
453 JSDocParameterTag = 343,
454 JSDocReturnTag = 344,
455 JSDocThisTag = 345,
456 JSDocTypeTag = 346,
457 JSDocTemplateTag = 347,
458 JSDocTypedefTag = 348,
459 JSDocSeeTag = 349,
460 JSDocPropertyTag = 350,
461 SyntaxList = 351,
462 NotEmittedStatement = 352,
463 PartiallyEmittedExpression = 353,
464 CommaListExpression = 354,
465 MergeDeclarationMarker = 355,
466 EndOfDeclarationMarker = 356,
467 SyntheticReferenceExpression = 357,
468 Count = 358,
469 FirstAssignment = 63,
470 LastAssignment = 78,
471 FirstCompoundAssignment = 64,
472 LastCompoundAssignment = 78,
473 FirstReservedWord = 81,
474 LastReservedWord = 116,
475 FirstKeyword = 81,
476 LastKeyword = 162,
477 FirstFutureReservedWord = 117,
478 LastFutureReservedWord = 125,
479 FirstTypeNode = 179,
480 LastTypeNode = 202,
481 FirstPunctuation = 18,
482 LastPunctuation = 78,
483 FirstToken = 0,
484 LastToken = 162,
485 FirstTriviaToken = 2,
486 LastTriviaToken = 7,
487 FirstLiteralToken = 8,
488 LastLiteralToken = 14,
489 FirstTemplateToken = 14,
490 LastTemplateToken = 17,
491 FirstBinaryOperator = 29,
492 LastBinaryOperator = 78,
493 FirstStatement = 240,
494 LastStatement = 256,
495 FirstNode = 163,
496 FirstJSDocNode = 312,
497 LastJSDocNode = 350,
498 FirstJSDocTagNode = 330,
499 LastJSDocTagNode = 350,
500 }
501 export type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia;
502 export type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral;
503 export type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail;
504 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.HashToken | 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;
505 export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AssertKeyword | 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.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SatisfiesKeyword | 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;
506 export type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.InKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.StaticKeyword;
507 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;
508 export type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind;
509 export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken;
510 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.HashToken | SyntaxKind.Unknown | KeywordSyntaxKind;
511 export enum NodeFlags {
512 None = 0,
513 Let = 1,
514 Const = 2,
515 NestedNamespace = 4,
516 Synthesized = 8,
517 Namespace = 16,
518 OptionalChain = 32,
519 ExportContext = 64,
520 ContainsThis = 128,
521 HasImplicitReturn = 256,
522 HasExplicitReturn = 512,
523 GlobalAugmentation = 1024,
524 HasAsyncFunctions = 2048,
525 DisallowInContext = 4096,
526 YieldContext = 8192,
527 DecoratorContext = 16384,
528 AwaitContext = 32768,
529 DisallowConditionalTypesContext = 65536,
530 ThisNodeHasError = 131072,
531 JavaScriptFile = 262144,
532 ThisNodeOrAnySubNodesHasError = 524288,
533 HasAggregatedChildData = 1048576,
534 JSDoc = 8388608,
535 JsonFile = 67108864,
536 BlockScoped = 3,
537 ReachabilityCheckFlags = 768,
538 ReachabilityAndEmitFlags = 2816,
539 ContextFlags = 50720768,
540 TypeExcludesFlags = 40960,
541 }
542 export enum ModifierFlags {
543 None = 0,
544 Export = 1,
545 Ambient = 2,
546 Public = 4,
547 Private = 8,
548 Protected = 16,
549 Static = 32,
550 Readonly = 64,
551 Accessor = 128,
552 Abstract = 256,
553 Async = 512,
554 Default = 1024,
555 Const = 2048,
556 HasComputedJSDocModifiers = 4096,
557 Deprecated = 8192,
558 Override = 16384,
559 In = 32768,
560 Out = 65536,
561 Decorator = 131072,
562 HasComputedFlags = 536870912,
563 AccessibilityModifier = 28,
564 ParameterPropertyModifier = 16476,
565 NonPublicAccessibilityModifier = 24,
566 TypeScriptModifier = 117086,
567 ExportDefault = 1025,
568 All = 258047,
569 Modifier = 126975
570 }
571 export enum JsxFlags {
572 None = 0,
573 /** An element from a named property of the JSX.IntrinsicElements interface */
574 IntrinsicNamedElement = 1,
575 /** An element inferred from the string index signature of the JSX.IntrinsicElements interface */
576 IntrinsicIndexedElement = 2,
577 IntrinsicElement = 3
578 }
579 export interface Node extends ReadonlyTextRange {
580 readonly kind: SyntaxKind;
581 readonly flags: NodeFlags;
582 readonly parent: Node;
583 }
584 export interface JSDocContainer {
585 }
586 export type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | ExportSpecifier | CaseClause | EndOfFileToken;
587 export type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType;
588 export type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
589 export type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
590 export type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | PropertyAssignment | EnumMember;
591 export type HasDecorators = ParameterDeclaration | PropertyDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassExpression | ClassDeclaration;
592 export type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration;
593 export interface NodeArray<T extends Node> extends ReadonlyArray<T>, ReadonlyTextRange {
594 readonly hasTrailingComma: boolean;
595 }
596 export interface Token<TKind extends SyntaxKind> extends Node {
597 readonly kind: TKind;
598 }
599 export type EndOfFileToken = Token<SyntaxKind.EndOfFileToken> & JSDocContainer;
600 export interface PunctuationToken<TKind extends PunctuationSyntaxKind> extends Token<TKind> {
601 }
602 export type DotToken = PunctuationToken<SyntaxKind.DotToken>;
603 export type DotDotDotToken = PunctuationToken<SyntaxKind.DotDotDotToken>;
604 export type QuestionToken = PunctuationToken<SyntaxKind.QuestionToken>;
605 export type ExclamationToken = PunctuationToken<SyntaxKind.ExclamationToken>;
606 export type ColonToken = PunctuationToken<SyntaxKind.ColonToken>;
607 export type EqualsToken = PunctuationToken<SyntaxKind.EqualsToken>;
608 export type AsteriskToken = PunctuationToken<SyntaxKind.AsteriskToken>;
609 export type EqualsGreaterThanToken = PunctuationToken<SyntaxKind.EqualsGreaterThanToken>;
610 export type PlusToken = PunctuationToken<SyntaxKind.PlusToken>;
611 export type MinusToken = PunctuationToken<SyntaxKind.MinusToken>;
612 export type QuestionDotToken = PunctuationToken<SyntaxKind.QuestionDotToken>;
613 export interface KeywordToken<TKind extends KeywordSyntaxKind> extends Token<TKind> {
614 }
615 export type AssertsKeyword = KeywordToken<SyntaxKind.AssertsKeyword>;
616 export type AssertKeyword = KeywordToken<SyntaxKind.AssertKeyword>;
617 export type AwaitKeyword = KeywordToken<SyntaxKind.AwaitKeyword>;
618 /** @deprecated Use `AwaitKeyword` instead. */
619 export type AwaitKeywordToken = AwaitKeyword;
620 /** @deprecated Use `AssertsKeyword` instead. */
621 export type AssertsToken = AssertsKeyword;
622 export interface ModifierToken<TKind extends ModifierSyntaxKind> extends KeywordToken<TKind> {
623 }
624 export type AbstractKeyword = ModifierToken<SyntaxKind.AbstractKeyword>;
625 export type AccessorKeyword = ModifierToken<SyntaxKind.AccessorKeyword>;
626 export type AsyncKeyword = ModifierToken<SyntaxKind.AsyncKeyword>;
627 export type ConstKeyword = ModifierToken<SyntaxKind.ConstKeyword>;
628 export type DeclareKeyword = ModifierToken<SyntaxKind.DeclareKeyword>;
629 export type DefaultKeyword = ModifierToken<SyntaxKind.DefaultKeyword>;
630 export type ExportKeyword = ModifierToken<SyntaxKind.ExportKeyword>;
631 export type InKeyword = ModifierToken<SyntaxKind.InKeyword>;
632 export type PrivateKeyword = ModifierToken<SyntaxKind.PrivateKeyword>;
633 export type ProtectedKeyword = ModifierToken<SyntaxKind.ProtectedKeyword>;
634 export type PublicKeyword = ModifierToken<SyntaxKind.PublicKeyword>;
635 export type ReadonlyKeyword = ModifierToken<SyntaxKind.ReadonlyKeyword>;
636 export type OutKeyword = ModifierToken<SyntaxKind.OutKeyword>;
637 export type OverrideKeyword = ModifierToken<SyntaxKind.OverrideKeyword>;
638 export type StaticKeyword = ModifierToken<SyntaxKind.StaticKeyword>;
639 /** @deprecated Use `ReadonlyKeyword` instead. */
640 export type ReadonlyToken = ReadonlyKeyword;
641 export type Modifier = AbstractKeyword | AccessorKeyword | AsyncKeyword | ConstKeyword | DeclareKeyword | DefaultKeyword | ExportKeyword | InKeyword | PrivateKeyword | ProtectedKeyword | PublicKeyword | OutKeyword | OverrideKeyword | ReadonlyKeyword | StaticKeyword;
642 export type ModifierLike = Modifier | Decorator;
643 export type AccessibilityModifier = PublicKeyword | PrivateKeyword | ProtectedKeyword;
644 export type ParameterPropertyModifier = AccessibilityModifier | ReadonlyKeyword;
645 export type ClassMemberModifier = AccessibilityModifier | ReadonlyKeyword | StaticKeyword | AccessorKeyword;
646 export type ModifiersArray = NodeArray<Modifier>;
647 export enum GeneratedIdentifierFlags {
648 None = 0,
649 ReservedInNestedScopes = 8,
650 Optimistic = 16,
651 FileLevel = 32,
652 AllowNameSubstitution = 64
653 }
654 export interface Identifier extends PrimaryExpression, Declaration {
655 readonly kind: SyntaxKind.Identifier;
656 /**
657 * Prefer to use `id.unescapedText`. (Note: This is available only in services, not internally to the TypeScript compiler.)
658 * Text of identifier, but if the identifier begins with two underscores, this will begin with three.
659 */
660 readonly escapedText: __String;
661 readonly originalKeywordKind?: SyntaxKind;
662 isInJSDocNamespace?: boolean;
663 }
664 export interface TransientIdentifier extends Identifier {
665 resolvedSymbol: Symbol;
666 }
667 export interface QualifiedName extends Node {
668 readonly kind: SyntaxKind.QualifiedName;
669 readonly left: EntityName;
670 readonly right: Identifier;
671 }
672 export type EntityName = Identifier | QualifiedName;
673 export type PropertyName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier;
674 export type MemberName = Identifier | PrivateIdentifier;
675 export type DeclarationName = Identifier | PrivateIdentifier | StringLiteralLike | NumericLiteral | ComputedPropertyName | ElementAccessExpression | BindingPattern | EntityNameExpression;
676 export interface Declaration extends Node {
677 _declarationBrand: any;
678 }
679 export interface NamedDeclaration extends Declaration {
680 readonly name?: DeclarationName;
681 }
682 export interface DeclarationStatement extends NamedDeclaration, Statement {
683 readonly name?: Identifier | StringLiteral | NumericLiteral;
684 }
685 export interface ComputedPropertyName extends Node {
686 readonly kind: SyntaxKind.ComputedPropertyName;
687 readonly parent: Declaration;
688 readonly expression: Expression;
689 }
690 export interface PrivateIdentifier extends PrimaryExpression {
691 readonly kind: SyntaxKind.PrivateIdentifier;
692 readonly escapedText: __String;
693 }
694 export interface Decorator extends Node {
695 readonly kind: SyntaxKind.Decorator;
696 readonly parent: NamedDeclaration;
697 readonly expression: LeftHandSideExpression;
698 }
699 export interface TypeParameterDeclaration extends NamedDeclaration {
700 readonly kind: SyntaxKind.TypeParameter;
701 readonly parent: DeclarationWithTypeParameterChildren | InferTypeNode;
702 readonly modifiers?: NodeArray<Modifier>;
703 readonly name: Identifier;
704 /** Note: Consider calling `getEffectiveConstraintOfTypeParameter` */
705 readonly constraint?: TypeNode;
706 readonly default?: TypeNode;
707 expression?: Expression;
708 }
709 export interface SignatureDeclarationBase extends NamedDeclaration, JSDocContainer {
710 readonly kind: SignatureDeclaration["kind"];
711 readonly name?: PropertyName;
712 readonly typeParameters?: NodeArray<TypeParameterDeclaration> | undefined;
713 readonly parameters: NodeArray<ParameterDeclaration>;
714 readonly type?: TypeNode | undefined;
715 }
716 export type SignatureDeclaration = CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | AccessorDeclaration | FunctionExpression | ArrowFunction;
717 export interface CallSignatureDeclaration extends SignatureDeclarationBase, TypeElement {
718 readonly kind: SyntaxKind.CallSignature;
719 }
720 export interface ConstructSignatureDeclaration extends SignatureDeclarationBase, TypeElement {
721 readonly kind: SyntaxKind.ConstructSignature;
722 }
723 export type BindingName = Identifier | BindingPattern;
724 export interface VariableDeclaration extends NamedDeclaration, JSDocContainer {
725 readonly kind: SyntaxKind.VariableDeclaration;
726 readonly parent: VariableDeclarationList | CatchClause;
727 readonly name: BindingName;
728 readonly exclamationToken?: ExclamationToken;
729 readonly type?: TypeNode;
730 readonly initializer?: Expression;
731 }
732 export interface VariableDeclarationList extends Node {
733 readonly kind: SyntaxKind.VariableDeclarationList;
734 readonly parent: VariableStatement | ForStatement | ForOfStatement | ForInStatement;
735 readonly declarations: NodeArray<VariableDeclaration>;
736 }
737 export interface ParameterDeclaration extends NamedDeclaration, JSDocContainer {
738 readonly kind: SyntaxKind.Parameter;
739 readonly parent: SignatureDeclaration;
740 readonly modifiers?: NodeArray<ModifierLike>;
741 readonly dotDotDotToken?: DotDotDotToken;
742 readonly name: BindingName;
743 readonly questionToken?: QuestionToken;
744 readonly type?: TypeNode;
745 readonly initializer?: Expression;
746 }
747 export interface BindingElement extends NamedDeclaration {
748 readonly kind: SyntaxKind.BindingElement;
749 readonly parent: BindingPattern;
750 readonly propertyName?: PropertyName;
751 readonly dotDotDotToken?: DotDotDotToken;
752 readonly name: BindingName;
753 readonly initializer?: Expression;
754 }
755 export interface PropertySignature extends TypeElement, JSDocContainer {
756 readonly kind: SyntaxKind.PropertySignature;
757 readonly modifiers?: NodeArray<Modifier>;
758 readonly name: PropertyName;
759 readonly questionToken?: QuestionToken;
760 readonly type?: TypeNode;
761 }
762 export interface PropertyDeclaration extends ClassElement, JSDocContainer {
763 readonly kind: SyntaxKind.PropertyDeclaration;
764 readonly parent: ClassLikeDeclaration;
765 readonly modifiers?: NodeArray<ModifierLike>;
766 readonly name: PropertyName;
767 readonly questionToken?: QuestionToken;
768 readonly exclamationToken?: ExclamationToken;
769 readonly type?: TypeNode;
770 readonly initializer?: Expression;
771 }
772 export interface AutoAccessorPropertyDeclaration extends PropertyDeclaration {
773 _autoAccessorBrand: any;
774 }
775 export interface ObjectLiteralElement extends NamedDeclaration {
776 _objectLiteralBrand: any;
777 readonly name?: PropertyName;
778 }
779 /** Unlike ObjectLiteralElement, excludes JSXAttribute and JSXSpreadAttribute. */
780 export type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | MethodDeclaration | AccessorDeclaration;
781 export interface PropertyAssignment extends ObjectLiteralElement, JSDocContainer {
782 readonly kind: SyntaxKind.PropertyAssignment;
783 readonly parent: ObjectLiteralExpression;
784 readonly name: PropertyName;
785 readonly initializer: Expression;
786 }
787 export interface ShorthandPropertyAssignment extends ObjectLiteralElement, JSDocContainer {
788 readonly kind: SyntaxKind.ShorthandPropertyAssignment;
789 readonly parent: ObjectLiteralExpression;
790 readonly name: Identifier;
791 readonly equalsToken?: EqualsToken;
792 readonly objectAssignmentInitializer?: Expression;
793 }
794 export interface SpreadAssignment extends ObjectLiteralElement, JSDocContainer {
795 readonly kind: SyntaxKind.SpreadAssignment;
796 readonly parent: ObjectLiteralExpression;
797 readonly expression: Expression;
798 }
799 export type VariableLikeDeclaration = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | PropertyAssignment | PropertySignature | JsxAttribute | ShorthandPropertyAssignment | EnumMember | JSDocPropertyTag | JSDocParameterTag;
800 export interface PropertyLikeDeclaration extends NamedDeclaration {
801 readonly name: PropertyName;
802 }
803 export interface ObjectBindingPattern extends Node {
804 readonly kind: SyntaxKind.ObjectBindingPattern;
805 readonly parent: VariableDeclaration | ParameterDeclaration | BindingElement;
806 readonly elements: NodeArray<BindingElement>;
807 }
808 export interface ArrayBindingPattern extends Node {
809 readonly kind: SyntaxKind.ArrayBindingPattern;
810 readonly parent: VariableDeclaration | ParameterDeclaration | BindingElement;
811 readonly elements: NodeArray<ArrayBindingElement>;
812 }
813 export type BindingPattern = ObjectBindingPattern | ArrayBindingPattern;
814 export type ArrayBindingElement = BindingElement | OmittedExpression;
815 /**
816 * Several node kinds share function-like features such as a signature,
817 * a name, and a body. These nodes should extend FunctionLikeDeclarationBase.
818 * Examples:
819 * - FunctionDeclaration
820 * - MethodDeclaration
821 * - AccessorDeclaration
822 */
823 export interface FunctionLikeDeclarationBase extends SignatureDeclarationBase {
824 _functionLikeDeclarationBrand: any;
825 readonly asteriskToken?: AsteriskToken | undefined;
826 readonly questionToken?: QuestionToken | undefined;
827 readonly exclamationToken?: ExclamationToken | undefined;
828 readonly body?: Block | Expression | undefined;
829 }
830 export type FunctionLikeDeclaration = FunctionDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ConstructorDeclaration | FunctionExpression | ArrowFunction;
831 /** @deprecated Use SignatureDeclaration */
832 export type FunctionLike = SignatureDeclaration;
833 export interface FunctionDeclaration extends FunctionLikeDeclarationBase, DeclarationStatement {
834 readonly kind: SyntaxKind.FunctionDeclaration;
835 readonly modifiers?: NodeArray<Modifier>;
836 readonly name?: Identifier;
837 readonly body?: FunctionBody;
838 }
839 export interface MethodSignature extends SignatureDeclarationBase, TypeElement {
840 readonly kind: SyntaxKind.MethodSignature;
841 readonly parent: ObjectTypeDeclaration;
842 readonly modifiers?: NodeArray<Modifier>;
843 readonly name: PropertyName;
844 }
845 export interface MethodDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer {
846 readonly kind: SyntaxKind.MethodDeclaration;
847 readonly parent: ClassLikeDeclaration | ObjectLiteralExpression;
848 readonly modifiers?: NodeArray<ModifierLike> | undefined;
849 readonly name: PropertyName;
850 readonly body?: FunctionBody | undefined;
851 }
852 export interface ConstructorDeclaration extends FunctionLikeDeclarationBase, ClassElement, JSDocContainer {
853 readonly kind: SyntaxKind.Constructor;
854 readonly parent: ClassLikeDeclaration;
855 readonly modifiers?: NodeArray<Modifier> | undefined;
856 readonly body?: FunctionBody | undefined;
857 }
858 /** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */
859 export interface SemicolonClassElement extends ClassElement {
860 readonly kind: SyntaxKind.SemicolonClassElement;
861 readonly parent: ClassLikeDeclaration;
862 }
863 export interface GetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, TypeElement, ObjectLiteralElement, JSDocContainer {
864 readonly kind: SyntaxKind.GetAccessor;
865 readonly parent: ClassLikeDeclaration | ObjectLiteralExpression | TypeLiteralNode | InterfaceDeclaration;
866 readonly modifiers?: NodeArray<ModifierLike>;
867 readonly name: PropertyName;
868 readonly body?: FunctionBody;
869 }
870 export interface SetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, TypeElement, ObjectLiteralElement, JSDocContainer {
871 readonly kind: SyntaxKind.SetAccessor;
872 readonly parent: ClassLikeDeclaration | ObjectLiteralExpression | TypeLiteralNode | InterfaceDeclaration;
873 readonly modifiers?: NodeArray<ModifierLike>;
874 readonly name: PropertyName;
875 readonly body?: FunctionBody;
876 }
877 export type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration;
878 export interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement {
879 readonly kind: SyntaxKind.IndexSignature;
880 readonly parent: ObjectTypeDeclaration;
881 readonly modifiers?: NodeArray<Modifier>;
882 readonly type: TypeNode;
883 }
884 export interface ClassStaticBlockDeclaration extends ClassElement, JSDocContainer {
885 readonly kind: SyntaxKind.ClassStaticBlockDeclaration;
886 readonly parent: ClassDeclaration | ClassExpression;
887 readonly body: Block;
888 }
889 export interface TypeNode extends Node {
890 _typeNodeBrand: any;
891 }
892 export interface KeywordTypeNode<TKind extends KeywordTypeSyntaxKind = KeywordTypeSyntaxKind> extends KeywordToken<TKind>, TypeNode {
893 readonly kind: TKind;
894 }
895 export interface ImportTypeAssertionContainer extends Node {
896 readonly kind: SyntaxKind.ImportTypeAssertionContainer;
897 readonly parent: ImportTypeNode;
898 readonly assertClause: AssertClause;
899 readonly multiLine?: boolean;
900 }
901 export interface ImportTypeNode extends NodeWithTypeArguments {
902 readonly kind: SyntaxKind.ImportType;
903 readonly isTypeOf: boolean;
904 readonly argument: TypeNode;
905 readonly assertions?: ImportTypeAssertionContainer;
906 readonly qualifier?: EntityName;
907 }
908 export interface ThisTypeNode extends TypeNode {
909 readonly kind: SyntaxKind.ThisType;
910 }
911 export type FunctionOrConstructorTypeNode = FunctionTypeNode | ConstructorTypeNode;
912 export interface FunctionOrConstructorTypeNodeBase extends TypeNode, SignatureDeclarationBase {
913 readonly kind: SyntaxKind.FunctionType | SyntaxKind.ConstructorType;
914 readonly type: TypeNode;
915 }
916 export interface FunctionTypeNode extends FunctionOrConstructorTypeNodeBase {
917 readonly kind: SyntaxKind.FunctionType;
918 }
919 export interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase {
920 readonly kind: SyntaxKind.ConstructorType;
921 readonly modifiers?: NodeArray<Modifier>;
922 }
923 export interface NodeWithTypeArguments extends TypeNode {
924 readonly typeArguments?: NodeArray<TypeNode>;
925 }
926 export type TypeReferenceType = TypeReferenceNode | ExpressionWithTypeArguments;
927 export interface TypeReferenceNode extends NodeWithTypeArguments {
928 readonly kind: SyntaxKind.TypeReference;
929 readonly typeName: EntityName;
930 }
931 export interface TypePredicateNode extends TypeNode {
932 readonly kind: SyntaxKind.TypePredicate;
933 readonly parent: SignatureDeclaration | JSDocTypeExpression;
934 readonly assertsModifier?: AssertsKeyword;
935 readonly parameterName: Identifier | ThisTypeNode;
936 readonly type?: TypeNode;
937 }
938 export interface TypeQueryNode extends NodeWithTypeArguments {
939 readonly kind: SyntaxKind.TypeQuery;
940 readonly exprName: EntityName;
941 }
942 export interface TypeLiteralNode extends TypeNode, Declaration {
943 readonly kind: SyntaxKind.TypeLiteral;
944 readonly members: NodeArray<TypeElement>;
945 }
946 export interface ArrayTypeNode extends TypeNode {
947 readonly kind: SyntaxKind.ArrayType;
948 readonly elementType: TypeNode;
949 }
950 export interface TupleTypeNode extends TypeNode {
951 readonly kind: SyntaxKind.TupleType;
952 readonly elements: NodeArray<TypeNode | NamedTupleMember>;
953 }
954 export interface NamedTupleMember extends TypeNode, JSDocContainer, Declaration {
955 readonly kind: SyntaxKind.NamedTupleMember;
956 readonly dotDotDotToken?: Token<SyntaxKind.DotDotDotToken>;
957 readonly name: Identifier;
958 readonly questionToken?: Token<SyntaxKind.QuestionToken>;
959 readonly type: TypeNode;
960 }
961 export interface OptionalTypeNode extends TypeNode {
962 readonly kind: SyntaxKind.OptionalType;
963 readonly type: TypeNode;
964 }
965 export interface RestTypeNode extends TypeNode {
966 readonly kind: SyntaxKind.RestType;
967 readonly type: TypeNode;
968 }
969 export type UnionOrIntersectionTypeNode = UnionTypeNode | IntersectionTypeNode;
970 export interface UnionTypeNode extends TypeNode {
971 readonly kind: SyntaxKind.UnionType;
972 readonly types: NodeArray<TypeNode>;
973 }
974 export interface IntersectionTypeNode extends TypeNode {
975 readonly kind: SyntaxKind.IntersectionType;
976 readonly types: NodeArray<TypeNode>;
977 }
978 export interface ConditionalTypeNode extends TypeNode {
979 readonly kind: SyntaxKind.ConditionalType;
980 readonly checkType: TypeNode;
981 readonly extendsType: TypeNode;
982 readonly trueType: TypeNode;
983 readonly falseType: TypeNode;
984 }
985 export interface InferTypeNode extends TypeNode {
986 readonly kind: SyntaxKind.InferType;
987 readonly typeParameter: TypeParameterDeclaration;
988 }
989 export interface ParenthesizedTypeNode extends TypeNode {
990 readonly kind: SyntaxKind.ParenthesizedType;
991 readonly type: TypeNode;
992 }
993 export interface TypeOperatorNode extends TypeNode {
994 readonly kind: SyntaxKind.TypeOperator;
995 readonly operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword;
996 readonly type: TypeNode;
997 }
998 export interface IndexedAccessTypeNode extends TypeNode {
999 readonly kind: SyntaxKind.IndexedAccessType;
1000 readonly objectType: TypeNode;
1001 readonly indexType: TypeNode;
1002 }
1003 export interface MappedTypeNode extends TypeNode, Declaration {
1004 readonly kind: SyntaxKind.MappedType;
1005 readonly readonlyToken?: ReadonlyKeyword | PlusToken | MinusToken;
1006 readonly typeParameter: TypeParameterDeclaration;
1007 readonly nameType?: TypeNode;
1008 readonly questionToken?: QuestionToken | PlusToken | MinusToken;
1009 readonly type?: TypeNode;
1010 /** Used only to produce grammar errors */
1011 readonly members?: NodeArray<TypeElement>;
1012 }
1013 export interface LiteralTypeNode extends TypeNode {
1014 readonly kind: SyntaxKind.LiteralType;
1015 readonly literal: NullLiteral | BooleanLiteral | LiteralExpression | PrefixUnaryExpression;
1016 }
1017 export interface StringLiteral extends LiteralExpression, Declaration {
1018 readonly kind: SyntaxKind.StringLiteral;
1019 }
1020 export type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral;
1021 export type PropertyNameLiteral = Identifier | StringLiteralLike | NumericLiteral;
1022 export interface TemplateLiteralTypeNode extends TypeNode {
1023 kind: SyntaxKind.TemplateLiteralType;
1024 readonly head: TemplateHead;
1025 readonly templateSpans: NodeArray<TemplateLiteralTypeSpan>;
1026 }
1027 export interface TemplateLiteralTypeSpan extends TypeNode {
1028 readonly kind: SyntaxKind.TemplateLiteralTypeSpan;
1029 readonly parent: TemplateLiteralTypeNode;
1030 readonly type: TypeNode;
1031 readonly literal: TemplateMiddle | TemplateTail;
1032 }
1033 export interface Expression extends Node {
1034 _expressionBrand: any;
1035 }
1036 export interface OmittedExpression extends Expression {
1037 readonly kind: SyntaxKind.OmittedExpression;
1038 }
1039 export interface PartiallyEmittedExpression extends LeftHandSideExpression {
1040 readonly kind: SyntaxKind.PartiallyEmittedExpression;
1041 readonly expression: Expression;
1042 }
1043 export interface UnaryExpression extends Expression {
1044 _unaryExpressionBrand: any;
1045 }
1046 /** Deprecated, please use UpdateExpression */
1047 export type IncrementExpression = UpdateExpression;
1048 export interface UpdateExpression extends UnaryExpression {
1049 _updateExpressionBrand: any;
1050 }
1051 export type PrefixUnaryOperator = SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.TildeToken | SyntaxKind.ExclamationToken;
1052 export interface PrefixUnaryExpression extends UpdateExpression {
1053 readonly kind: SyntaxKind.PrefixUnaryExpression;
1054 readonly operator: PrefixUnaryOperator;
1055 readonly operand: UnaryExpression;
1056 }
1057 export type PostfixUnaryOperator = SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken;
1058 export interface PostfixUnaryExpression extends UpdateExpression {
1059 readonly kind: SyntaxKind.PostfixUnaryExpression;
1060 readonly operand: LeftHandSideExpression;
1061 readonly operator: PostfixUnaryOperator;
1062 }
1063 export interface LeftHandSideExpression extends UpdateExpression {
1064 _leftHandSideExpressionBrand: any;
1065 }
1066 export interface MemberExpression extends LeftHandSideExpression {
1067 _memberExpressionBrand: any;
1068 }
1069 export interface PrimaryExpression extends MemberExpression {
1070 _primaryExpressionBrand: any;
1071 }
1072 export interface NullLiteral extends PrimaryExpression {
1073 readonly kind: SyntaxKind.NullKeyword;
1074 }
1075 export interface TrueLiteral extends PrimaryExpression {
1076 readonly kind: SyntaxKind.TrueKeyword;
1077 }
1078 export interface FalseLiteral extends PrimaryExpression {
1079 readonly kind: SyntaxKind.FalseKeyword;
1080 }
1081 export type BooleanLiteral = TrueLiteral | FalseLiteral;
1082 export interface ThisExpression extends PrimaryExpression {
1083 readonly kind: SyntaxKind.ThisKeyword;
1084 }
1085 export interface SuperExpression extends PrimaryExpression {
1086 readonly kind: SyntaxKind.SuperKeyword;
1087 }
1088 export interface ImportExpression extends PrimaryExpression {
1089 readonly kind: SyntaxKind.ImportKeyword;
1090 }
1091 export interface DeleteExpression extends UnaryExpression {
1092 readonly kind: SyntaxKind.DeleteExpression;
1093 readonly expression: UnaryExpression;
1094 }
1095 export interface TypeOfExpression extends UnaryExpression {
1096 readonly kind: SyntaxKind.TypeOfExpression;
1097 readonly expression: UnaryExpression;
1098 }
1099 export interface VoidExpression extends UnaryExpression {
1100 readonly kind: SyntaxKind.VoidExpression;
1101 readonly expression: UnaryExpression;
1102 }
1103 export interface AwaitExpression extends UnaryExpression {
1104 readonly kind: SyntaxKind.AwaitExpression;
1105 readonly expression: UnaryExpression;
1106 }
1107 export interface YieldExpression extends Expression {
1108 readonly kind: SyntaxKind.YieldExpression;
1109 readonly asteriskToken?: AsteriskToken;
1110 readonly expression?: Expression;
1111 }
1112 export interface SyntheticExpression extends Expression {
1113 readonly kind: SyntaxKind.SyntheticExpression;
1114 readonly isSpread: boolean;
1115 readonly type: Type;
1116 readonly tupleNameSource?: ParameterDeclaration | NamedTupleMember;
1117 }
1118 export type ExponentiationOperator = SyntaxKind.AsteriskAsteriskToken;
1119 export type MultiplicativeOperator = SyntaxKind.AsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken;
1120 export type MultiplicativeOperatorOrHigher = ExponentiationOperator | MultiplicativeOperator;
1121 export type AdditiveOperator = SyntaxKind.PlusToken | SyntaxKind.MinusToken;
1122 export type AdditiveOperatorOrHigher = MultiplicativeOperatorOrHigher | AdditiveOperator;
1123 export type ShiftOperator = SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken;
1124 export type ShiftOperatorOrHigher = AdditiveOperatorOrHigher | ShiftOperator;
1125 export type RelationalOperator = SyntaxKind.LessThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.InstanceOfKeyword | SyntaxKind.InKeyword;
1126 export type RelationalOperatorOrHigher = ShiftOperatorOrHigher | RelationalOperator;
1127 export type EqualityOperator = SyntaxKind.EqualsEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.ExclamationEqualsToken;
1128 export type EqualityOperatorOrHigher = RelationalOperatorOrHigher | EqualityOperator;
1129 export type BitwiseOperator = SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken;
1130 export type BitwiseOperatorOrHigher = EqualityOperatorOrHigher | BitwiseOperator;
1131 export type LogicalOperator = SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken;
1132 export type LogicalOperatorOrHigher = BitwiseOperatorOrHigher | LogicalOperator;
1133 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;
1134 export type AssignmentOperator = SyntaxKind.EqualsToken | CompoundAssignmentOperator;
1135 export type AssignmentOperatorOrHigher = SyntaxKind.QuestionQuestionToken | LogicalOperatorOrHigher | AssignmentOperator;
1136 export type BinaryOperator = AssignmentOperatorOrHigher | SyntaxKind.CommaToken;
1137 export type LogicalOrCoalescingAssignmentOperator = SyntaxKind.AmpersandAmpersandEqualsToken | SyntaxKind.BarBarEqualsToken | SyntaxKind.QuestionQuestionEqualsToken;
1138 export type BinaryOperatorToken = Token<BinaryOperator>;
1139 export interface BinaryExpression extends Expression, Declaration {
1140 readonly kind: SyntaxKind.BinaryExpression;
1141 readonly left: Expression;
1142 readonly operatorToken: BinaryOperatorToken;
1143 readonly right: Expression;
1144 }
1145 export type AssignmentOperatorToken = Token<AssignmentOperator>;
1146 export interface AssignmentExpression<TOperator extends AssignmentOperatorToken> extends BinaryExpression {
1147 readonly left: LeftHandSideExpression;
1148 readonly operatorToken: TOperator;
1149 }
1150 export interface ObjectDestructuringAssignment extends AssignmentExpression<EqualsToken> {
1151 readonly left: ObjectLiteralExpression;
1152 }
1153 export interface ArrayDestructuringAssignment extends AssignmentExpression<EqualsToken> {
1154 readonly left: ArrayLiteralExpression;
1155 }
1156 export type DestructuringAssignment = ObjectDestructuringAssignment | ArrayDestructuringAssignment;
1157 export type BindingOrAssignmentElement = VariableDeclaration | ParameterDeclaration | ObjectBindingOrAssignmentElement | ArrayBindingOrAssignmentElement;
1158 export type ObjectBindingOrAssignmentElement = BindingElement | PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment;
1159 export type ArrayBindingOrAssignmentElement = BindingElement | OmittedExpression | SpreadElement | ArrayLiteralExpression | ObjectLiteralExpression | AssignmentExpression<EqualsToken> | Identifier | PropertyAccessExpression | ElementAccessExpression;
1160 export type BindingOrAssignmentElementRestIndicator = DotDotDotToken | SpreadElement | SpreadAssignment;
1161 export type BindingOrAssignmentElementTarget = BindingOrAssignmentPattern | Identifier | PropertyAccessExpression | ElementAccessExpression | OmittedExpression;
1162 export type ObjectBindingOrAssignmentPattern = ObjectBindingPattern | ObjectLiteralExpression;
1163 export type ArrayBindingOrAssignmentPattern = ArrayBindingPattern | ArrayLiteralExpression;
1164 export type AssignmentPattern = ObjectLiteralExpression | ArrayLiteralExpression;
1165 export type BindingOrAssignmentPattern = ObjectBindingOrAssignmentPattern | ArrayBindingOrAssignmentPattern;
1166 export interface ConditionalExpression extends Expression {
1167 readonly kind: SyntaxKind.ConditionalExpression;
1168 readonly condition: Expression;
1169 readonly questionToken: QuestionToken;
1170 readonly whenTrue: Expression;
1171 readonly colonToken: ColonToken;
1172 readonly whenFalse: Expression;
1173 }
1174 export type FunctionBody = Block;
1175 export type ConciseBody = FunctionBody | Expression;
1176 export interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclarationBase, JSDocContainer {
1177 readonly kind: SyntaxKind.FunctionExpression;
1178 readonly modifiers?: NodeArray<Modifier>;
1179 readonly name?: Identifier;
1180 readonly body: FunctionBody;
1181 }
1182 export interface ArrowFunction extends Expression, FunctionLikeDeclarationBase, JSDocContainer {
1183 readonly kind: SyntaxKind.ArrowFunction;
1184 readonly modifiers?: NodeArray<Modifier>;
1185 readonly equalsGreaterThanToken: EqualsGreaterThanToken;
1186 readonly body: ConciseBody;
1187 readonly name: never;
1188 }
1189 export interface LiteralLikeNode extends Node {
1190 text: string;
1191 isUnterminated?: boolean;
1192 hasExtendedUnicodeEscape?: boolean;
1193 }
1194 export interface TemplateLiteralLikeNode extends LiteralLikeNode {
1195 rawText?: string;
1196 }
1197 export interface LiteralExpression extends LiteralLikeNode, PrimaryExpression {
1198 _literalExpressionBrand: any;
1199 }
1200 export interface RegularExpressionLiteral extends LiteralExpression {
1201 readonly kind: SyntaxKind.RegularExpressionLiteral;
1202 }
1203 export interface NoSubstitutionTemplateLiteral extends LiteralExpression, TemplateLiteralLikeNode, Declaration {
1204 readonly kind: SyntaxKind.NoSubstitutionTemplateLiteral;
1205 }
1206 export enum TokenFlags {
1207 None = 0,
1208 Scientific = 16,
1209 Octal = 32,
1210 HexSpecifier = 64,
1211 BinarySpecifier = 128,
1212 OctalSpecifier = 256,
1213 }
1214 export interface NumericLiteral extends LiteralExpression, Declaration {
1215 readonly kind: SyntaxKind.NumericLiteral;
1216 }
1217 export interface BigIntLiteral extends LiteralExpression {
1218 readonly kind: SyntaxKind.BigIntLiteral;
1219 }
1220 export type LiteralToken = NumericLiteral | BigIntLiteral | StringLiteral | JsxText | RegularExpressionLiteral | NoSubstitutionTemplateLiteral;
1221 export interface TemplateHead extends TemplateLiteralLikeNode {
1222 readonly kind: SyntaxKind.TemplateHead;
1223 readonly parent: TemplateExpression | TemplateLiteralTypeNode;
1224 }
1225 export interface TemplateMiddle extends TemplateLiteralLikeNode {
1226 readonly kind: SyntaxKind.TemplateMiddle;
1227 readonly parent: TemplateSpan | TemplateLiteralTypeSpan;
1228 }
1229 export interface TemplateTail extends TemplateLiteralLikeNode {
1230 readonly kind: SyntaxKind.TemplateTail;
1231 readonly parent: TemplateSpan | TemplateLiteralTypeSpan;
1232 }
1233 export type PseudoLiteralToken = TemplateHead | TemplateMiddle | TemplateTail;
1234 export type TemplateLiteralToken = NoSubstitutionTemplateLiteral | PseudoLiteralToken;
1235 export interface TemplateExpression extends PrimaryExpression {
1236 readonly kind: SyntaxKind.TemplateExpression;
1237 readonly head: TemplateHead;
1238 readonly templateSpans: NodeArray<TemplateSpan>;
1239 }
1240 export type TemplateLiteral = TemplateExpression | NoSubstitutionTemplateLiteral;
1241 export interface TemplateSpan extends Node {
1242 readonly kind: SyntaxKind.TemplateSpan;
1243 readonly parent: TemplateExpression;
1244 readonly expression: Expression;
1245 readonly literal: TemplateMiddle | TemplateTail;
1246 }
1247 export interface ParenthesizedExpression extends PrimaryExpression, JSDocContainer {
1248 readonly kind: SyntaxKind.ParenthesizedExpression;
1249 readonly expression: Expression;
1250 }
1251 export interface ArrayLiteralExpression extends PrimaryExpression {
1252 readonly kind: SyntaxKind.ArrayLiteralExpression;
1253 readonly elements: NodeArray<Expression>;
1254 }
1255 export interface SpreadElement extends Expression {
1256 readonly kind: SyntaxKind.SpreadElement;
1257 readonly parent: ArrayLiteralExpression | CallExpression | NewExpression;
1258 readonly expression: Expression;
1259 }
1260 /**
1261 * This interface is a base interface for ObjectLiteralExpression and JSXAttributes to extend from. JSXAttributes is similar to
1262 * ObjectLiteralExpression in that it contains array of properties; however, JSXAttributes' properties can only be
1263 * JSXAttribute or JSXSpreadAttribute. ObjectLiteralExpression, on the other hand, can only have properties of type
1264 * ObjectLiteralElement (e.g. PropertyAssignment, ShorthandPropertyAssignment etc.)
1265 */
1266 export interface ObjectLiteralExpressionBase<T extends ObjectLiteralElement> extends PrimaryExpression, Declaration {
1267 readonly properties: NodeArray<T>;
1268 }
1269 export interface ObjectLiteralExpression extends ObjectLiteralExpressionBase<ObjectLiteralElementLike> {
1270 readonly kind: SyntaxKind.ObjectLiteralExpression;
1271 }
1272 export type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression;
1273 export type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression;
1274 export type AccessExpression = PropertyAccessExpression | ElementAccessExpression;
1275 export interface PropertyAccessExpression extends MemberExpression, NamedDeclaration {
1276 readonly kind: SyntaxKind.PropertyAccessExpression;
1277 readonly expression: LeftHandSideExpression;
1278 readonly questionDotToken?: QuestionDotToken;
1279 readonly name: MemberName;
1280 }
1281 export interface PropertyAccessChain extends PropertyAccessExpression {
1282 _optionalChainBrand: any;
1283 readonly name: MemberName;
1284 }
1285 export interface SuperPropertyAccessExpression extends PropertyAccessExpression {
1286 readonly expression: SuperExpression;
1287 }
1288 /** Brand for a PropertyAccessExpression which, like a QualifiedName, consists of a sequence of identifiers separated by dots. */
1289 export interface PropertyAccessEntityNameExpression extends PropertyAccessExpression {
1290 _propertyAccessExpressionLikeQualifiedNameBrand?: any;
1291 readonly expression: EntityNameExpression;
1292 readonly name: Identifier;
1293 }
1294 export interface ElementAccessExpression extends MemberExpression {
1295 readonly kind: SyntaxKind.ElementAccessExpression;
1296 readonly expression: LeftHandSideExpression;
1297 readonly questionDotToken?: QuestionDotToken;
1298 readonly argumentExpression: Expression;
1299 }
1300 export interface ElementAccessChain extends ElementAccessExpression {
1301 _optionalChainBrand: any;
1302 }
1303 export interface SuperElementAccessExpression extends ElementAccessExpression {
1304 readonly expression: SuperExpression;
1305 }
1306 export type SuperProperty = SuperPropertyAccessExpression | SuperElementAccessExpression;
1307 export interface CallExpression extends LeftHandSideExpression, Declaration {
1308 readonly kind: SyntaxKind.CallExpression;
1309 readonly expression: LeftHandSideExpression;
1310 readonly questionDotToken?: QuestionDotToken;
1311 readonly typeArguments?: NodeArray<TypeNode>;
1312 readonly arguments: NodeArray<Expression>;
1313 }
1314 export interface CallChain extends CallExpression {
1315 _optionalChainBrand: any;
1316 }
1317 export type OptionalChain = PropertyAccessChain | ElementAccessChain | CallChain | NonNullChain;
1318 export interface SuperCall extends CallExpression {
1319 readonly expression: SuperExpression;
1320 }
1321 export interface ImportCall extends CallExpression {
1322 readonly expression: ImportExpression;
1323 }
1324 export interface ExpressionWithTypeArguments extends MemberExpression, NodeWithTypeArguments {
1325 readonly kind: SyntaxKind.ExpressionWithTypeArguments;
1326 readonly expression: LeftHandSideExpression;
1327 }
1328 export interface NewExpression extends PrimaryExpression, Declaration {
1329 readonly kind: SyntaxKind.NewExpression;
1330 readonly expression: LeftHandSideExpression;
1331 readonly typeArguments?: NodeArray<TypeNode>;
1332 readonly arguments?: NodeArray<Expression>;
1333 }
1334 export interface TaggedTemplateExpression extends MemberExpression {
1335 readonly kind: SyntaxKind.TaggedTemplateExpression;
1336 readonly tag: LeftHandSideExpression;
1337 readonly typeArguments?: NodeArray<TypeNode>;
1338 readonly template: TemplateLiteral;
1339 }
1340 export type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression | Decorator | JsxOpeningLikeElement;
1341 export interface AsExpression extends Expression {
1342 readonly kind: SyntaxKind.AsExpression;
1343 readonly expression: Expression;
1344 readonly type: TypeNode;
1345 }
1346 export interface TypeAssertion extends UnaryExpression {
1347 readonly kind: SyntaxKind.TypeAssertionExpression;
1348 readonly type: TypeNode;
1349 readonly expression: UnaryExpression;
1350 }
1351 export interface SatisfiesExpression extends Expression {
1352 readonly kind: SyntaxKind.SatisfiesExpression;
1353 readonly expression: Expression;
1354 readonly type: TypeNode;
1355 }
1356 export type AssertionExpression = TypeAssertion | AsExpression;
1357 export interface NonNullExpression extends LeftHandSideExpression {
1358 readonly kind: SyntaxKind.NonNullExpression;
1359 readonly expression: Expression;
1360 }
1361 export interface NonNullChain extends NonNullExpression {
1362 _optionalChainBrand: any;
1363 }
1364 export interface MetaProperty extends PrimaryExpression {
1365 readonly kind: SyntaxKind.MetaProperty;
1366 readonly keywordToken: SyntaxKind.NewKeyword | SyntaxKind.ImportKeyword;
1367 readonly name: Identifier;
1368 }
1369 export interface JsxElement extends PrimaryExpression {
1370 readonly kind: SyntaxKind.JsxElement;
1371 readonly openingElement: JsxOpeningElement;
1372 readonly children: NodeArray<JsxChild>;
1373 readonly closingElement: JsxClosingElement;
1374 }
1375 export type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement;
1376 export type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute;
1377 export type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess;
1378 export interface JsxTagNamePropertyAccess extends PropertyAccessExpression {
1379 readonly expression: JsxTagNameExpression;
1380 }
1381 export interface JsxAttributes extends ObjectLiteralExpressionBase<JsxAttributeLike> {
1382 readonly kind: SyntaxKind.JsxAttributes;
1383 readonly parent: JsxOpeningLikeElement;
1384 }
1385 export interface JsxOpeningElement extends Expression {
1386 readonly kind: SyntaxKind.JsxOpeningElement;
1387 readonly parent: JsxElement;
1388 readonly tagName: JsxTagNameExpression;
1389 readonly typeArguments?: NodeArray<TypeNode>;
1390 readonly attributes: JsxAttributes;
1391 }
1392 export interface JsxSelfClosingElement extends PrimaryExpression {
1393 readonly kind: SyntaxKind.JsxSelfClosingElement;
1394 readonly tagName: JsxTagNameExpression;
1395 readonly typeArguments?: NodeArray<TypeNode>;
1396 readonly attributes: JsxAttributes;
1397 }
1398 export interface JsxFragment extends PrimaryExpression {
1399 readonly kind: SyntaxKind.JsxFragment;
1400 readonly openingFragment: JsxOpeningFragment;
1401 readonly children: NodeArray<JsxChild>;
1402 readonly closingFragment: JsxClosingFragment;
1403 }
1404 export interface JsxOpeningFragment extends Expression {
1405 readonly kind: SyntaxKind.JsxOpeningFragment;
1406 readonly parent: JsxFragment;
1407 }
1408 export interface JsxClosingFragment extends Expression {
1409 readonly kind: SyntaxKind.JsxClosingFragment;
1410 readonly parent: JsxFragment;
1411 }
1412 export interface JsxAttribute extends ObjectLiteralElement {
1413 readonly kind: SyntaxKind.JsxAttribute;
1414 readonly parent: JsxAttributes;
1415 readonly name: Identifier;
1416 readonly initializer?: JsxAttributeValue;
1417 }
1418 export type JsxAttributeValue = StringLiteral | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment;
1419 export interface JsxSpreadAttribute extends ObjectLiteralElement {
1420 readonly kind: SyntaxKind.JsxSpreadAttribute;
1421 readonly parent: JsxAttributes;
1422 readonly expression: Expression;
1423 }
1424 export interface JsxClosingElement extends Node {
1425 readonly kind: SyntaxKind.JsxClosingElement;
1426 readonly parent: JsxElement;
1427 readonly tagName: JsxTagNameExpression;
1428 }
1429 export interface JsxExpression extends Expression {
1430 readonly kind: SyntaxKind.JsxExpression;
1431 readonly parent: JsxElement | JsxFragment | JsxAttributeLike;
1432 readonly dotDotDotToken?: Token<SyntaxKind.DotDotDotToken>;
1433 readonly expression?: Expression;
1434 }
1435 export interface JsxText extends LiteralLikeNode {
1436 readonly kind: SyntaxKind.JsxText;
1437 readonly parent: JsxElement | JsxFragment;
1438 readonly containsOnlyTriviaWhiteSpaces: boolean;
1439 }
1440 export type JsxChild = JsxText | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment;
1441 export interface Statement extends Node, JSDocContainer {
1442 _statementBrand: any;
1443 }
1444 export interface NotEmittedStatement extends Statement {
1445 readonly kind: SyntaxKind.NotEmittedStatement;
1446 }
1447 /**
1448 * A list of comma-separated expressions. This node is only created by transformations.
1449 */
1450 export interface CommaListExpression extends Expression {
1451 readonly kind: SyntaxKind.CommaListExpression;
1452 readonly elements: NodeArray<Expression>;
1453 }
1454 export interface EmptyStatement extends Statement {
1455 readonly kind: SyntaxKind.EmptyStatement;
1456 }
1457 export interface DebuggerStatement extends Statement {
1458 readonly kind: SyntaxKind.DebuggerStatement;
1459 }
1460 export interface MissingDeclaration extends DeclarationStatement {
1461 readonly kind: SyntaxKind.MissingDeclaration;
1462 readonly name?: Identifier;
1463 }
1464 export type BlockLike = SourceFile | Block | ModuleBlock | CaseOrDefaultClause;
1465 export interface Block extends Statement {
1466 readonly kind: SyntaxKind.Block;
1467 readonly statements: NodeArray<Statement>;
1468 }
1469 export interface VariableStatement extends Statement {
1470 readonly kind: SyntaxKind.VariableStatement;
1471 readonly modifiers?: NodeArray<Modifier>;
1472 readonly declarationList: VariableDeclarationList;
1473 }
1474 export interface ExpressionStatement extends Statement {
1475 readonly kind: SyntaxKind.ExpressionStatement;
1476 readonly expression: Expression;
1477 }
1478 export interface IfStatement extends Statement {
1479 readonly kind: SyntaxKind.IfStatement;
1480 readonly expression: Expression;
1481 readonly thenStatement: Statement;
1482 readonly elseStatement?: Statement;
1483 }
1484 export interface IterationStatement extends Statement {
1485 readonly statement: Statement;
1486 }
1487 export interface DoStatement extends IterationStatement {
1488 readonly kind: SyntaxKind.DoStatement;
1489 readonly expression: Expression;
1490 }
1491 export interface WhileStatement extends IterationStatement {
1492 readonly kind: SyntaxKind.WhileStatement;
1493 readonly expression: Expression;
1494 }
1495 export type ForInitializer = VariableDeclarationList | Expression;
1496 export interface ForStatement extends IterationStatement {
1497 readonly kind: SyntaxKind.ForStatement;
1498 readonly initializer?: ForInitializer;
1499 readonly condition?: Expression;
1500 readonly incrementor?: Expression;
1501 }
1502 export type ForInOrOfStatement = ForInStatement | ForOfStatement;
1503 export interface ForInStatement extends IterationStatement {
1504 readonly kind: SyntaxKind.ForInStatement;
1505 readonly initializer: ForInitializer;
1506 readonly expression: Expression;
1507 }
1508 export interface ForOfStatement extends IterationStatement {
1509 readonly kind: SyntaxKind.ForOfStatement;
1510 readonly awaitModifier?: AwaitKeyword;
1511 readonly initializer: ForInitializer;
1512 readonly expression: Expression;
1513 }
1514 export interface BreakStatement extends Statement {
1515 readonly kind: SyntaxKind.BreakStatement;
1516 readonly label?: Identifier;
1517 }
1518 export interface ContinueStatement extends Statement {
1519 readonly kind: SyntaxKind.ContinueStatement;
1520 readonly label?: Identifier;
1521 }
1522 export type BreakOrContinueStatement = BreakStatement | ContinueStatement;
1523 export interface ReturnStatement extends Statement {
1524 readonly kind: SyntaxKind.ReturnStatement;
1525 readonly expression?: Expression;
1526 }
1527 export interface WithStatement extends Statement {
1528 readonly kind: SyntaxKind.WithStatement;
1529 readonly expression: Expression;
1530 readonly statement: Statement;
1531 }
1532 export interface SwitchStatement extends Statement {
1533 readonly kind: SyntaxKind.SwitchStatement;
1534 readonly expression: Expression;
1535 readonly caseBlock: CaseBlock;
1536 possiblyExhaustive?: boolean;
1537 }
1538 export interface CaseBlock extends Node {
1539 readonly kind: SyntaxKind.CaseBlock;
1540 readonly parent: SwitchStatement;
1541 readonly clauses: NodeArray<CaseOrDefaultClause>;
1542 }
1543 export interface CaseClause extends Node, JSDocContainer {
1544 readonly kind: SyntaxKind.CaseClause;
1545 readonly parent: CaseBlock;
1546 readonly expression: Expression;
1547 readonly statements: NodeArray<Statement>;
1548 }
1549 export interface DefaultClause extends Node {
1550 readonly kind: SyntaxKind.DefaultClause;
1551 readonly parent: CaseBlock;
1552 readonly statements: NodeArray<Statement>;
1553 }
1554 export type CaseOrDefaultClause = CaseClause | DefaultClause;
1555 export interface LabeledStatement extends Statement {
1556 readonly kind: SyntaxKind.LabeledStatement;
1557 readonly label: Identifier;
1558 readonly statement: Statement;
1559 }
1560 export interface ThrowStatement extends Statement {
1561 readonly kind: SyntaxKind.ThrowStatement;
1562 readonly expression: Expression;
1563 }
1564 export interface TryStatement extends Statement {
1565 readonly kind: SyntaxKind.TryStatement;
1566 readonly tryBlock: Block;
1567 readonly catchClause?: CatchClause;
1568 readonly finallyBlock?: Block;
1569 }
1570 export interface CatchClause extends Node {
1571 readonly kind: SyntaxKind.CatchClause;
1572 readonly parent: TryStatement;
1573 readonly variableDeclaration?: VariableDeclaration;
1574 readonly block: Block;
1575 }
1576 export type ObjectTypeDeclaration = ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode;
1577 export type DeclarationWithTypeParameters = DeclarationWithTypeParameterChildren | JSDocTypedefTag | JSDocCallbackTag | JSDocSignature;
1578 export type DeclarationWithTypeParameterChildren = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag;
1579 export interface ClassLikeDeclarationBase extends NamedDeclaration, JSDocContainer {
1580 readonly kind: SyntaxKind.ClassDeclaration | SyntaxKind.ClassExpression;
1581 readonly name?: Identifier;
1582 readonly typeParameters?: NodeArray<TypeParameterDeclaration>;
1583 readonly heritageClauses?: NodeArray<HeritageClause>;
1584 readonly members: NodeArray<ClassElement>;
1585 }
1586 export interface ClassDeclaration extends ClassLikeDeclarationBase, DeclarationStatement {
1587 readonly kind: SyntaxKind.ClassDeclaration;
1588 readonly modifiers?: NodeArray<ModifierLike>;
1589 /** May be undefined in `export default class { ... }`. */
1590 readonly name?: Identifier;
1591 }
1592 export interface ClassExpression extends ClassLikeDeclarationBase, PrimaryExpression {
1593 readonly kind: SyntaxKind.ClassExpression;
1594 readonly modifiers?: NodeArray<ModifierLike>;
1595 }
1596 export type ClassLikeDeclaration = ClassDeclaration | ClassExpression;
1597 export interface ClassElement extends NamedDeclaration {
1598 _classElementBrand: any;
1599 readonly name?: PropertyName;
1600 }
1601 export interface TypeElement extends NamedDeclaration {
1602 _typeElementBrand: any;
1603 readonly name?: PropertyName;
1604 readonly questionToken?: QuestionToken | undefined;
1605 }
1606 export interface InterfaceDeclaration extends DeclarationStatement, JSDocContainer {
1607 readonly kind: SyntaxKind.InterfaceDeclaration;
1608 readonly modifiers?: NodeArray<Modifier>;
1609 readonly name: Identifier;
1610 readonly typeParameters?: NodeArray<TypeParameterDeclaration>;
1611 readonly heritageClauses?: NodeArray<HeritageClause>;
1612 readonly members: NodeArray<TypeElement>;
1613 }
1614 export interface HeritageClause extends Node {
1615 readonly kind: SyntaxKind.HeritageClause;
1616 readonly parent: InterfaceDeclaration | ClassLikeDeclaration;
1617 readonly token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword;
1618 readonly types: NodeArray<ExpressionWithTypeArguments>;
1619 }
1620 export interface TypeAliasDeclaration extends DeclarationStatement, JSDocContainer {
1621 readonly kind: SyntaxKind.TypeAliasDeclaration;
1622 readonly modifiers?: NodeArray<Modifier>;
1623 readonly name: Identifier;
1624 readonly typeParameters?: NodeArray<TypeParameterDeclaration>;
1625 readonly type: TypeNode;
1626 }
1627 export interface EnumMember extends NamedDeclaration, JSDocContainer {
1628 readonly kind: SyntaxKind.EnumMember;
1629 readonly parent: EnumDeclaration;
1630 readonly name: PropertyName;
1631 readonly initializer?: Expression;
1632 }
1633 export interface EnumDeclaration extends DeclarationStatement, JSDocContainer {
1634 readonly kind: SyntaxKind.EnumDeclaration;
1635 readonly modifiers?: NodeArray<Modifier>;
1636 readonly name: Identifier;
1637 readonly members: NodeArray<EnumMember>;
1638 }
1639 export type ModuleName = Identifier | StringLiteral;
1640 export type ModuleBody = NamespaceBody | JSDocNamespaceBody;
1641 export interface ModuleDeclaration extends DeclarationStatement, JSDocContainer {
1642 readonly kind: SyntaxKind.ModuleDeclaration;
1643 readonly parent: ModuleBody | SourceFile;
1644 readonly modifiers?: NodeArray<Modifier>;
1645 readonly name: ModuleName;
1646 readonly body?: ModuleBody | JSDocNamespaceDeclaration;
1647 }
1648 export type NamespaceBody = ModuleBlock | NamespaceDeclaration;
1649 export interface NamespaceDeclaration extends ModuleDeclaration {
1650 readonly name: Identifier;
1651 readonly body: NamespaceBody;
1652 }
1653 export type JSDocNamespaceBody = Identifier | JSDocNamespaceDeclaration;
1654 export interface JSDocNamespaceDeclaration extends ModuleDeclaration {
1655 readonly name: Identifier;
1656 readonly body?: JSDocNamespaceBody;
1657 }
1658 export interface ModuleBlock extends Node, Statement {
1659 readonly kind: SyntaxKind.ModuleBlock;
1660 readonly parent: ModuleDeclaration;
1661 readonly statements: NodeArray<Statement>;
1662 }
1663 export type ModuleReference = EntityName | ExternalModuleReference;
1664 /**
1665 * One of:
1666 * - import x = require("mod");
1667 * - import x = M.x;
1668 */
1669 export interface ImportEqualsDeclaration extends DeclarationStatement, JSDocContainer {
1670 readonly kind: SyntaxKind.ImportEqualsDeclaration;
1671 readonly parent: SourceFile | ModuleBlock;
1672 readonly modifiers?: NodeArray<Modifier>;
1673 readonly name: Identifier;
1674 readonly isTypeOnly: boolean;
1675 readonly moduleReference: ModuleReference;
1676 }
1677 export interface ExternalModuleReference extends Node {
1678 readonly kind: SyntaxKind.ExternalModuleReference;
1679 readonly parent: ImportEqualsDeclaration;
1680 readonly expression: Expression;
1681 }
1682 export interface ImportDeclaration extends Statement {
1683 readonly kind: SyntaxKind.ImportDeclaration;
1684 readonly parent: SourceFile | ModuleBlock;
1685 readonly modifiers?: NodeArray<Modifier>;
1686 readonly importClause?: ImportClause;
1687 /** If this is not a StringLiteral it will be a grammar error. */
1688 readonly moduleSpecifier: Expression;
1689 readonly assertClause?: AssertClause;
1690 }
1691 export type NamedImportBindings = NamespaceImport | NamedImports;
1692 export type NamedExportBindings = NamespaceExport | NamedExports;
1693 export interface ImportClause extends NamedDeclaration {
1694 readonly kind: SyntaxKind.ImportClause;
1695 readonly parent: ImportDeclaration;
1696 readonly isTypeOnly: boolean;
1697 readonly name?: Identifier;
1698 readonly namedBindings?: NamedImportBindings;
1699 }
1700 export type AssertionKey = Identifier | StringLiteral;
1701 export interface AssertEntry extends Node {
1702 readonly kind: SyntaxKind.AssertEntry;
1703 readonly parent: AssertClause;
1704 readonly name: AssertionKey;
1705 readonly value: Expression;
1706 }
1707 export interface AssertClause extends Node {
1708 readonly kind: SyntaxKind.AssertClause;
1709 readonly parent: ImportDeclaration | ExportDeclaration;
1710 readonly elements: NodeArray<AssertEntry>;
1711 readonly multiLine?: boolean;
1712 }
1713 export interface NamespaceImport extends NamedDeclaration {
1714 readonly kind: SyntaxKind.NamespaceImport;
1715 readonly parent: ImportClause;
1716 readonly name: Identifier;
1717 }
1718 export interface NamespaceExport extends NamedDeclaration {
1719 readonly kind: SyntaxKind.NamespaceExport;
1720 readonly parent: ExportDeclaration;
1721 readonly name: Identifier;
1722 }
1723 export interface NamespaceExportDeclaration extends DeclarationStatement, JSDocContainer {
1724 readonly kind: SyntaxKind.NamespaceExportDeclaration;
1725 readonly name: Identifier;
1726 }
1727 export interface ExportDeclaration extends DeclarationStatement, JSDocContainer {
1728 readonly kind: SyntaxKind.ExportDeclaration;
1729 readonly parent: SourceFile | ModuleBlock;
1730 readonly modifiers?: NodeArray<Modifier>;
1731 readonly isTypeOnly: boolean;
1732 /** Will not be assigned in the case of `export * from "foo";` */
1733 readonly exportClause?: NamedExportBindings;
1734 /** If this is not a StringLiteral it will be a grammar error. */
1735 readonly moduleSpecifier?: Expression;
1736 readonly assertClause?: AssertClause;
1737 }
1738 export interface NamedImports extends Node {
1739 readonly kind: SyntaxKind.NamedImports;
1740 readonly parent: ImportClause;
1741 readonly elements: NodeArray<ImportSpecifier>;
1742 }
1743 export interface NamedExports extends Node {
1744 readonly kind: SyntaxKind.NamedExports;
1745 readonly parent: ExportDeclaration;
1746 readonly elements: NodeArray<ExportSpecifier>;
1747 }
1748 export type NamedImportsOrExports = NamedImports | NamedExports;
1749 export interface ImportSpecifier extends NamedDeclaration {
1750 readonly kind: SyntaxKind.ImportSpecifier;
1751 readonly parent: NamedImports;
1752 readonly propertyName?: Identifier;
1753 readonly name: Identifier;
1754 readonly isTypeOnly: boolean;
1755 }
1756 export interface ExportSpecifier extends NamedDeclaration, JSDocContainer {
1757 readonly kind: SyntaxKind.ExportSpecifier;
1758 readonly parent: NamedExports;
1759 readonly isTypeOnly: boolean;
1760 readonly propertyName?: Identifier;
1761 readonly name: Identifier;
1762 }
1763 export type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier;
1764 export type TypeOnlyCompatibleAliasDeclaration = ImportClause | ImportEqualsDeclaration | NamespaceImport | ImportOrExportSpecifier;
1765 export type TypeOnlyAliasDeclaration = ImportClause & {
1766 readonly isTypeOnly: true;
1767 readonly name: Identifier;
1768 } | ImportEqualsDeclaration & {
1769 readonly isTypeOnly: true;
1770 } | NamespaceImport & {
1771 readonly parent: ImportClause & {
1772 readonly isTypeOnly: true;
1773 };
1774 } | ImportSpecifier & ({
1775 readonly isTypeOnly: true;
1776 } | {
1777 readonly parent: NamedImports & {
1778 readonly parent: ImportClause & {
1779 readonly isTypeOnly: true;
1780 };
1781 };
1782 }) | ExportSpecifier & ({
1783 readonly isTypeOnly: true;
1784 } | {
1785 readonly parent: NamedExports & {
1786 readonly parent: ExportDeclaration & {
1787 readonly isTypeOnly: true;
1788 };
1789 };
1790 });
1791 /**
1792 * This is either an `export =` or an `export default` declaration.
1793 * Unless `isExportEquals` is set, this node was parsed as an `export default`.
1794 */
1795 export interface ExportAssignment extends DeclarationStatement, JSDocContainer {
1796 readonly kind: SyntaxKind.ExportAssignment;
1797 readonly parent: SourceFile;
1798 readonly modifiers?: NodeArray<Modifier>;
1799 readonly isExportEquals?: boolean;
1800 readonly expression: Expression;
1801 }
1802 export interface FileReference extends TextRange {
1803 fileName: string;
1804 resolutionMode?: SourceFile["impliedNodeFormat"];
1805 }
1806 export interface CheckJsDirective extends TextRange {
1807 enabled: boolean;
1808 }
1809 export type CommentKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia;
1810 export interface CommentRange extends TextRange {
1811 hasTrailingNewLine?: boolean;
1812 kind: CommentKind;
1813 }
1814 export interface SynthesizedComment extends CommentRange {
1815 text: string;
1816 pos: -1;
1817 end: -1;
1818 hasLeadingNewline?: boolean;
1819 }
1820 export interface JSDocTypeExpression extends TypeNode {
1821 readonly kind: SyntaxKind.JSDocTypeExpression;
1822 readonly type: TypeNode;
1823 }
1824 export interface JSDocNameReference extends Node {
1825 readonly kind: SyntaxKind.JSDocNameReference;
1826 readonly name: EntityName | JSDocMemberName;
1827 }
1828 /** Class#method reference in JSDoc */
1829 export interface JSDocMemberName extends Node {
1830 readonly kind: SyntaxKind.JSDocMemberName;
1831 readonly left: EntityName | JSDocMemberName;
1832 readonly right: Identifier;
1833 }
1834 export interface JSDocType extends TypeNode {
1835 _jsDocTypeBrand: any;
1836 }
1837 export interface JSDocAllType extends JSDocType {
1838 readonly kind: SyntaxKind.JSDocAllType;
1839 }
1840 export interface JSDocUnknownType extends JSDocType {
1841 readonly kind: SyntaxKind.JSDocUnknownType;
1842 }
1843 export interface JSDocNonNullableType extends JSDocType {
1844 readonly kind: SyntaxKind.JSDocNonNullableType;
1845 readonly type: TypeNode;
1846 readonly postfix: boolean;
1847 }
1848 export interface JSDocNullableType extends JSDocType {
1849 readonly kind: SyntaxKind.JSDocNullableType;
1850 readonly type: TypeNode;
1851 readonly postfix: boolean;
1852 }
1853 export interface JSDocOptionalType extends JSDocType {
1854 readonly kind: SyntaxKind.JSDocOptionalType;
1855 readonly type: TypeNode;
1856 }
1857 export interface JSDocFunctionType extends JSDocType, SignatureDeclarationBase {
1858 readonly kind: SyntaxKind.JSDocFunctionType;
1859 }
1860 export interface JSDocVariadicType extends JSDocType {
1861 readonly kind: SyntaxKind.JSDocVariadicType;
1862 readonly type: TypeNode;
1863 }
1864 export interface JSDocNamepathType extends JSDocType {
1865 readonly kind: SyntaxKind.JSDocNamepathType;
1866 readonly type: TypeNode;
1867 }
1868 export type JSDocTypeReferencingNode = JSDocVariadicType | JSDocOptionalType | JSDocNullableType | JSDocNonNullableType;
1869 export interface JSDoc extends Node {
1870 readonly kind: SyntaxKind.JSDoc;
1871 readonly parent: HasJSDoc;
1872 readonly tags?: NodeArray<JSDocTag>;
1873 readonly comment?: string | NodeArray<JSDocComment>;
1874 }
1875 export interface JSDocTag extends Node {
1876 readonly parent: JSDoc | JSDocTypeLiteral;
1877 readonly tagName: Identifier;
1878 readonly comment?: string | NodeArray<JSDocComment>;
1879 }
1880 export interface JSDocLink extends Node {
1881 readonly kind: SyntaxKind.JSDocLink;
1882 readonly name?: EntityName | JSDocMemberName;
1883 text: string;
1884 }
1885 export interface JSDocLinkCode extends Node {
1886 readonly kind: SyntaxKind.JSDocLinkCode;
1887 readonly name?: EntityName | JSDocMemberName;
1888 text: string;
1889 }
1890 export interface JSDocLinkPlain extends Node {
1891 readonly kind: SyntaxKind.JSDocLinkPlain;
1892 readonly name?: EntityName | JSDocMemberName;
1893 text: string;
1894 }
1895 export type JSDocComment = JSDocText | JSDocLink | JSDocLinkCode | JSDocLinkPlain;
1896 export interface JSDocText extends Node {
1897 readonly kind: SyntaxKind.JSDocText;
1898 text: string;
1899 }
1900 export interface JSDocUnknownTag extends JSDocTag {
1901 readonly kind: SyntaxKind.JSDocTag;
1902 }
1903 /**
1904 * Note that `@extends` is a synonym of `@augments`.
1905 * Both tags are represented by this interface.
1906 */
1907 export interface JSDocAugmentsTag extends JSDocTag {
1908 readonly kind: SyntaxKind.JSDocAugmentsTag;
1909 readonly class: ExpressionWithTypeArguments & {
1910 readonly expression: Identifier | PropertyAccessEntityNameExpression;
1911 };
1912 }
1913 export interface JSDocImplementsTag extends JSDocTag {
1914 readonly kind: SyntaxKind.JSDocImplementsTag;
1915 readonly class: ExpressionWithTypeArguments & {
1916 readonly expression: Identifier | PropertyAccessEntityNameExpression;
1917 };
1918 }
1919 export interface JSDocAuthorTag extends JSDocTag {
1920 readonly kind: SyntaxKind.JSDocAuthorTag;
1921 }
1922 export interface JSDocDeprecatedTag extends JSDocTag {
1923 kind: SyntaxKind.JSDocDeprecatedTag;
1924 }
1925 export interface JSDocClassTag extends JSDocTag {
1926 readonly kind: SyntaxKind.JSDocClassTag;
1927 }
1928 export interface JSDocPublicTag extends JSDocTag {
1929 readonly kind: SyntaxKind.JSDocPublicTag;
1930 }
1931 export interface JSDocPrivateTag extends JSDocTag {
1932 readonly kind: SyntaxKind.JSDocPrivateTag;
1933 }
1934 export interface JSDocProtectedTag extends JSDocTag {
1935 readonly kind: SyntaxKind.JSDocProtectedTag;
1936 }
1937 export interface JSDocReadonlyTag extends JSDocTag {
1938 readonly kind: SyntaxKind.JSDocReadonlyTag;
1939 }
1940 export interface JSDocOverrideTag extends JSDocTag {
1941 readonly kind: SyntaxKind.JSDocOverrideTag;
1942 }
1943 export interface JSDocEnumTag extends JSDocTag, Declaration {
1944 readonly kind: SyntaxKind.JSDocEnumTag;
1945 readonly parent: JSDoc;
1946 readonly typeExpression: JSDocTypeExpression;
1947 }
1948 export interface JSDocThisTag extends JSDocTag {
1949 readonly kind: SyntaxKind.JSDocThisTag;
1950 readonly typeExpression: JSDocTypeExpression;
1951 }
1952 export interface JSDocTemplateTag extends JSDocTag {
1953 readonly kind: SyntaxKind.JSDocTemplateTag;
1954 readonly constraint: JSDocTypeExpression | undefined;
1955 readonly typeParameters: NodeArray<TypeParameterDeclaration>;
1956 }
1957 export interface JSDocSeeTag extends JSDocTag {
1958 readonly kind: SyntaxKind.JSDocSeeTag;
1959 readonly name?: JSDocNameReference;
1960 }
1961 export interface JSDocReturnTag extends JSDocTag {
1962 readonly kind: SyntaxKind.JSDocReturnTag;
1963 readonly typeExpression?: JSDocTypeExpression;
1964 }
1965 export interface JSDocTypeTag extends JSDocTag {
1966 readonly kind: SyntaxKind.JSDocTypeTag;
1967 readonly typeExpression: JSDocTypeExpression;
1968 }
1969 export interface JSDocTypedefTag extends JSDocTag, NamedDeclaration {
1970 readonly kind: SyntaxKind.JSDocTypedefTag;
1971 readonly parent: JSDoc;
1972 readonly fullName?: JSDocNamespaceDeclaration | Identifier;
1973 readonly name?: Identifier;
1974 readonly typeExpression?: JSDocTypeExpression | JSDocTypeLiteral;
1975 }
1976 export interface JSDocCallbackTag extends JSDocTag, NamedDeclaration {
1977 readonly kind: SyntaxKind.JSDocCallbackTag;
1978 readonly parent: JSDoc;
1979 readonly fullName?: JSDocNamespaceDeclaration | Identifier;
1980 readonly name?: Identifier;
1981 readonly typeExpression: JSDocSignature;
1982 }
1983 export interface JSDocSignature extends JSDocType, Declaration {
1984 readonly kind: SyntaxKind.JSDocSignature;
1985 readonly typeParameters?: readonly JSDocTemplateTag[];
1986 readonly parameters: readonly JSDocParameterTag[];
1987 readonly type: JSDocReturnTag | undefined;
1988 }
1989 export interface JSDocPropertyLikeTag extends JSDocTag, Declaration {
1990 readonly parent: JSDoc;
1991 readonly name: EntityName;
1992 readonly typeExpression?: JSDocTypeExpression;
1993 /** Whether the property name came before the type -- non-standard for JSDoc, but Typescript-like */
1994 readonly isNameFirst: boolean;
1995 readonly isBracketed: boolean;
1996 }
1997 export interface JSDocPropertyTag extends JSDocPropertyLikeTag {
1998 readonly kind: SyntaxKind.JSDocPropertyTag;
1999 }
2000 export interface JSDocParameterTag extends JSDocPropertyLikeTag {
2001 readonly kind: SyntaxKind.JSDocParameterTag;
2002 }
2003 export interface JSDocTypeLiteral extends JSDocType {
2004 readonly kind: SyntaxKind.JSDocTypeLiteral;
2005 readonly jsDocPropertyTags?: readonly JSDocPropertyLikeTag[];
2006 /** If true, then this type literal represents an *array* of its type. */
2007 readonly isArrayType: boolean;
2008 }
2009 export enum FlowFlags {
2010 Unreachable = 1,
2011 Start = 2,
2012 BranchLabel = 4,
2013 LoopLabel = 8,
2014 Assignment = 16,
2015 TrueCondition = 32,
2016 FalseCondition = 64,
2017 SwitchClause = 128,
2018 ArrayMutation = 256,
2019 Call = 512,
2020 ReduceLabel = 1024,
2021 Referenced = 2048,
2022 Shared = 4096,
2023 Label = 12,
2024 Condition = 96
2025 }
2026 export type FlowNode = FlowStart | FlowLabel | FlowAssignment | FlowCondition | FlowSwitchClause | FlowArrayMutation | FlowCall | FlowReduceLabel;
2027 export interface FlowNodeBase {
2028 flags: FlowFlags;
2029 id?: number;
2030 }
2031 export interface FlowStart extends FlowNodeBase {
2032 node?: FunctionExpression | ArrowFunction | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration;
2033 }
2034 export interface FlowLabel extends FlowNodeBase {
2035 antecedents: FlowNode[] | undefined;
2036 }
2037 export interface FlowAssignment extends FlowNodeBase {
2038 node: Expression | VariableDeclaration | BindingElement;
2039 antecedent: FlowNode;
2040 }
2041 export interface FlowCall extends FlowNodeBase {
2042 node: CallExpression;
2043 antecedent: FlowNode;
2044 }
2045 export interface FlowCondition extends FlowNodeBase {
2046 node: Expression;
2047 antecedent: FlowNode;
2048 }
2049 export interface FlowSwitchClause extends FlowNodeBase {
2050 switchStatement: SwitchStatement;
2051 clauseStart: number;
2052 clauseEnd: number;
2053 antecedent: FlowNode;
2054 }
2055 export interface FlowArrayMutation extends FlowNodeBase {
2056 node: CallExpression | BinaryExpression;
2057 antecedent: FlowNode;
2058 }
2059 export interface FlowReduceLabel extends FlowNodeBase {
2060 target: FlowLabel;
2061 antecedents: FlowNode[];
2062 antecedent: FlowNode;
2063 }
2064 export type FlowType = Type | IncompleteType;
2065 export interface IncompleteType {
2066 flags: TypeFlags;
2067 type: Type;
2068 }
2069 export interface AmdDependency {
2070 path: string;
2071 name?: string;
2072 }
2073 /**
2074 * Subset of properties from SourceFile that are used in multiple utility functions
2075 */
2076 export interface SourceFileLike {
2077 readonly text: string;
2078 }
2079 export interface SourceFile extends Declaration {
2080 readonly kind: SyntaxKind.SourceFile;
2081 readonly statements: NodeArray<Statement>;
2082 readonly endOfFileToken: Token<SyntaxKind.EndOfFileToken>;
2083 fileName: string;
2084 text: string;
2085 amdDependencies: readonly AmdDependency[];
2086 moduleName?: string;
2087 referencedFiles: readonly FileReference[];
2088 typeReferenceDirectives: readonly FileReference[];
2089 libReferenceDirectives: readonly FileReference[];
2090 languageVariant: LanguageVariant;
2091 isDeclarationFile: boolean;
2092 /**
2093 * lib.d.ts should have a reference comment like
2094 *
2095 * /// <reference no-default-lib="true"/>
2096 *
2097 * If any other file has this comment, it signals not to include lib.d.ts
2098 * because this containing file is intended to act as a default library.
2099 */
2100 hasNoDefaultLib: boolean;
2101 languageVersion: ScriptTarget;
2102 /**
2103 * When `module` is `Node16` or `NodeNext`, this field controls whether the
2104 * source file in question is an ESNext-output-format file, or a CommonJS-output-format
2105 * module. This is derived by the module resolver as it looks up the file, since
2106 * it is derived from either the file extension of the module, or the containing
2107 * `package.json` context, and affects both checking and emit.
2108 *
2109 * It is _public_ so that (pre)transformers can set this field,
2110 * since it switches the builtin `node` module transform. Generally speaking, if unset,
2111 * the field is treated as though it is `ModuleKind.CommonJS`.
2112 *
2113 * Note that this field is only set by the module resolution process when
2114 * `moduleResolution` is `Node16` or `NodeNext`, which is implied by the `module` setting
2115 * of `Node16` or `NodeNext`, respectively, but may be overriden (eg, by a `moduleResolution`
2116 * of `node`). If so, this field will be unset and source files will be considered to be
2117 * CommonJS-output-format by the node module transformer and type checker, regardless of extension or context.
2118 */
2119 impliedNodeFormat?: ModuleKind.ESNext | ModuleKind.CommonJS;
2120 }
2121 export interface Bundle extends Node {
2122 readonly kind: SyntaxKind.Bundle;
2123 readonly prepends: readonly (InputFiles | UnparsedSource)[];
2124 readonly sourceFiles: readonly SourceFile[];
2125 }
2126 export interface InputFiles extends Node {
2127 readonly kind: SyntaxKind.InputFiles;
2128 javascriptPath?: string;
2129 javascriptText: string;
2130 javascriptMapPath?: string;
2131 javascriptMapText?: string;
2132 declarationPath?: string;
2133 declarationText: string;
2134 declarationMapPath?: string;
2135 declarationMapText?: string;
2136 }
2137 export interface UnparsedSource extends Node {
2138 readonly kind: SyntaxKind.UnparsedSource;
2139 fileName: string;
2140 text: string;
2141 readonly prologues: readonly UnparsedPrologue[];
2142 helpers: readonly UnscopedEmitHelper[] | undefined;
2143 referencedFiles: readonly FileReference[];
2144 typeReferenceDirectives: readonly FileReference[] | undefined;
2145 libReferenceDirectives: readonly FileReference[];
2146 hasNoDefaultLib?: boolean;
2147 sourceMapPath?: string;
2148 sourceMapText?: string;
2149 readonly syntheticReferences?: readonly UnparsedSyntheticReference[];
2150 readonly texts: readonly UnparsedSourceText[];
2151 }
2152 export type UnparsedSourceText = UnparsedPrepend | UnparsedTextLike;
2153 export type UnparsedNode = UnparsedPrologue | UnparsedSourceText | UnparsedSyntheticReference;
2154 export interface UnparsedSection extends Node {
2155 readonly kind: SyntaxKind;
2156 readonly parent: UnparsedSource;
2157 readonly data?: string;
2158 }
2159 export interface UnparsedPrologue extends UnparsedSection {
2160 readonly kind: SyntaxKind.UnparsedPrologue;
2161 readonly parent: UnparsedSource;
2162 readonly data: string;
2163 }
2164 export interface UnparsedPrepend extends UnparsedSection {
2165 readonly kind: SyntaxKind.UnparsedPrepend;
2166 readonly parent: UnparsedSource;
2167 readonly data: string;
2168 readonly texts: readonly UnparsedTextLike[];
2169 }
2170 export interface UnparsedTextLike extends UnparsedSection {
2171 readonly kind: SyntaxKind.UnparsedText | SyntaxKind.UnparsedInternalText;
2172 readonly parent: UnparsedSource;
2173 }
2174 export interface UnparsedSyntheticReference extends UnparsedSection {
2175 readonly kind: SyntaxKind.UnparsedSyntheticReference;
2176 readonly parent: UnparsedSource;
2177 }
2178 export interface JsonSourceFile extends SourceFile {
2179 readonly statements: NodeArray<JsonObjectExpressionStatement>;
2180 }
2181 export interface TsConfigSourceFile extends JsonSourceFile {
2182 extendedSourceFiles?: string[];
2183 }
2184 export interface JsonMinusNumericLiteral extends PrefixUnaryExpression {
2185 readonly kind: SyntaxKind.PrefixUnaryExpression;
2186 readonly operator: SyntaxKind.MinusToken;
2187 readonly operand: NumericLiteral;
2188 }
2189 export type JsonObjectExpression = ObjectLiteralExpression | ArrayLiteralExpression | JsonMinusNumericLiteral | NumericLiteral | StringLiteral | BooleanLiteral | NullLiteral;
2190 export interface JsonObjectExpressionStatement extends ExpressionStatement {
2191 readonly expression: JsonObjectExpression;
2192 }
2193 export interface ScriptReferenceHost {
2194 getCompilerOptions(): CompilerOptions;
2195 getSourceFile(fileName: string): SourceFile | undefined;
2196 getSourceFileByPath(path: Path): SourceFile | undefined;
2197 getCurrentDirectory(): string;
2198 }
2199 export interface ParseConfigHost {
2200 useCaseSensitiveFileNames: boolean;
2201 readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number): readonly string[];
2202 /**
2203 * Gets a value indicating whether the specified path exists and is a file.
2204 * @param path The path to test.
2205 */
2206 fileExists(path: string): boolean;
2207 readFile(path: string): string | undefined;
2208 trace?(s: string): void;
2209 }
2210 /**
2211 * Branded string for keeping track of when we've turned an ambiguous path
2212 * specified like "./blah" to an absolute path to an actual
2213 * tsconfig file, e.g. "/root/blah/tsconfig.json"
2214 */
2215 export type ResolvedConfigFileName = string & {
2216 _isResolvedConfigFileName: never;
2217 };
2218 export interface WriteFileCallbackData {
2219 }
2220 export type WriteFileCallback = (fileName: string, text: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[], data?: WriteFileCallbackData) => void;
2221 export class OperationCanceledException {
2222 }
2223 export interface CancellationToken {
2224 isCancellationRequested(): boolean;
2225 /** @throws OperationCanceledException if isCancellationRequested is true */
2226 throwIfCancellationRequested(): void;
2227 }
2228 export interface Program extends ScriptReferenceHost {
2229 getCurrentDirectory(): string;
2230 /**
2231 * Get a list of root file names that were passed to a 'createProgram'
2232 */
2233 getRootFileNames(): readonly string[];
2234 /**
2235 * Get a list of files in the program
2236 */
2237 getSourceFiles(): readonly SourceFile[];
2238 /**
2239 * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then
2240 * the JavaScript and declaration files will be produced for all the files in this program.
2241 * If targetSourceFile is specified, then only the JavaScript and declaration for that
2242 * specific file will be generated.
2243 *
2244 * If writeFile is not specified then the writeFile callback from the compiler host will be
2245 * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter
2246 * will be invoked when writing the JavaScript and declaration files.
2247 */
2248 emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult;
2249 getOptionsDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
2250 getGlobalDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
2251 getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[];
2252 /** The first time this is called, it will return global diagnostics (no location). */
2253 getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
2254 getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[];
2255 getConfigFileParsingDiagnostics(): readonly Diagnostic[];
2256 /**
2257 * Gets a type checker that can be used to semantically analyze source files in the program.
2258 */
2259 getTypeChecker(): TypeChecker;
2260 getNodeCount(): number;
2261 getIdentifierCount(): number;
2262 getSymbolCount(): number;
2263 getTypeCount(): number;
2264 getInstantiationCount(): number;
2265 getRelationCacheSizes(): {
2266 assignable: number;
2267 identity: number;
2268 subtype: number;
2269 strictSubtype: number;
2270 };
2271 isSourceFileFromExternalLibrary(file: SourceFile): boolean;
2272 isSourceFileDefaultLibrary(file: SourceFile): boolean;
2273 getProjectReferences(): readonly ProjectReference[] | undefined;
2274 getResolvedProjectReferences(): readonly (ResolvedProjectReference | undefined)[] | undefined;
2275 }
2276 export interface ResolvedProjectReference {
2277 commandLine: ParsedCommandLine;
2278 sourceFile: SourceFile;
2279 references?: readonly (ResolvedProjectReference | undefined)[];
2280 }
2281 export type CustomTransformerFactory = (context: TransformationContext) => CustomTransformer;
2282 export interface CustomTransformer {
2283 transformSourceFile(node: SourceFile): SourceFile;
2284 transformBundle(node: Bundle): Bundle;
2285 }
2286 export interface CustomTransformers {
2287 /** Custom transformers to evaluate before built-in .js transformations. */
2288 before?: (TransformerFactory<SourceFile> | CustomTransformerFactory)[];
2289 /** Custom transformers to evaluate after built-in .js transformations. */
2290 after?: (TransformerFactory<SourceFile> | CustomTransformerFactory)[];
2291 /** Custom transformers to evaluate after built-in .d.ts transformations. */
2292 afterDeclarations?: (TransformerFactory<Bundle | SourceFile> | CustomTransformerFactory)[];
2293 }
2294 export interface SourceMapSpan {
2295 /** Line number in the .js file. */
2296 emittedLine: number;
2297 /** Column number in the .js file. */
2298 emittedColumn: number;
2299 /** Line number in the .ts file. */
2300 sourceLine: number;
2301 /** Column number in the .ts file. */
2302 sourceColumn: number;
2303 /** Optional name (index into names array) associated with this span. */
2304 nameIndex?: number;
2305 /** .ts file (index into sources array) associated with this span */
2306 sourceIndex: number;
2307 }
2308 /** Return code used by getEmitOutput function to indicate status of the function */
2309 export enum ExitStatus {
2310 Success = 0,
2311 DiagnosticsPresent_OutputsSkipped = 1,
2312 DiagnosticsPresent_OutputsGenerated = 2,
2313 InvalidProject_OutputsSkipped = 3,
2314 ProjectReferenceCycle_OutputsSkipped = 4,
2315 /** @deprecated Use ProjectReferenceCycle_OutputsSkipped instead. */
2316 ProjectReferenceCycle_OutputsSkupped = 4
2317 }
2318 export interface EmitResult {
2319 emitSkipped: boolean;
2320 /** Contains declaration emit diagnostics */
2321 diagnostics: readonly Diagnostic[];
2322 emittedFiles?: string[];
2323 }
2324 export interface TypeChecker {
2325 getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type;
2326 getDeclaredTypeOfSymbol(symbol: Symbol): Type;
2327 getPropertiesOfType(type: Type): Symbol[];
2328 getPropertyOfType(type: Type, propertyName: string): Symbol | undefined;
2329 getPrivateIdentifierPropertyOfType(leftType: Type, name: string, location: Node): Symbol | undefined;
2330 getIndexInfoOfType(type: Type, kind: IndexKind): IndexInfo | undefined;
2331 getIndexInfosOfType(type: Type): readonly IndexInfo[];
2332 getIndexInfosOfIndexSymbol: (indexSymbol: Symbol) => IndexInfo[];
2333 getSignaturesOfType(type: Type, kind: SignatureKind): readonly Signature[];
2334 getIndexTypeOfType(type: Type, kind: IndexKind): Type | undefined;
2335 getBaseTypes(type: InterfaceType): BaseType[];
2336 getBaseTypeOfLiteralType(type: Type): Type;
2337 getWidenedType(type: Type): Type;
2338 getReturnTypeOfSignature(signature: Signature): Type;
2339 getNullableType(type: Type, flags: TypeFlags): Type;
2340 getNonNullableType(type: Type): Type;
2341 getTypeArguments(type: TypeReference): readonly Type[];
2342 /** Note that the resulting nodes cannot be checked. */
2343 typeToTypeNode(type: Type, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): TypeNode | undefined;
2344 /** Note that the resulting nodes cannot be checked. */
2345 signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): SignatureDeclaration & {
2346 typeArguments?: NodeArray<TypeNode>;
2347 } | undefined;
2348 /** Note that the resulting nodes cannot be checked. */
2349 indexInfoToIndexSignatureDeclaration(indexInfo: IndexInfo, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): IndexSignatureDeclaration | undefined;
2350 /** Note that the resulting nodes cannot be checked. */
2351 symbolToEntityName(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): EntityName | undefined;
2352 /** Note that the resulting nodes cannot be checked. */
2353 symbolToExpression(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): Expression | undefined;
2354 /** Note that the resulting nodes cannot be checked. */
2355 symbolToTypeParameterDeclarations(symbol: Symbol, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): NodeArray<TypeParameterDeclaration> | undefined;
2356 /** Note that the resulting nodes cannot be checked. */
2357 symbolToParameterDeclaration(symbol: Symbol, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): ParameterDeclaration | undefined;
2358 /** Note that the resulting nodes cannot be checked. */
2359 typeParameterToDeclaration(parameter: TypeParameter, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): TypeParameterDeclaration | undefined;
2360 getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[];
2361 getSymbolAtLocation(node: Node): Symbol | undefined;
2362 getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[];
2363 /**
2364 * The function returns the value (local variable) symbol of an identifier in the short-hand property assignment.
2365 * This is necessary as an identifier in short-hand property assignment can contains two meaning: property name and property value.
2366 */
2367 getShorthandAssignmentValueSymbol(location: Node | undefined): Symbol | undefined;
2368 getExportSpecifierLocalTargetSymbol(location: ExportSpecifier | Identifier): Symbol | undefined;
2369 /**
2370 * If a symbol is a local symbol with an associated exported symbol, returns the exported symbol.
2371 * Otherwise returns its input.
2372 * For example, at `export type T = number;`:
2373 * - `getSymbolAtLocation` at the location `T` will return the exported symbol for `T`.
2374 * - But the result of `getSymbolsInScope` will contain the *local* symbol for `T`, not the exported symbol.
2375 * - Calling `getExportSymbolOfSymbol` on that local symbol will return the exported symbol.
2376 */
2377 getExportSymbolOfSymbol(symbol: Symbol): Symbol;
2378 getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol | undefined;
2379 getTypeOfAssignmentPattern(pattern: AssignmentPattern): Type;
2380 getTypeAtLocation(node: Node): Type;
2381 getTypeFromTypeNode(node: TypeNode): Type;
2382 signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string;
2383 typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string;
2384 symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): string;
2385 typePredicateToString(predicate: TypePredicate, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string;
2386 getFullyQualifiedName(symbol: Symbol): string;
2387 getAugmentedPropertiesOfType(type: Type): Symbol[];
2388 getRootSymbols(symbol: Symbol): readonly Symbol[];
2389 getSymbolOfExpando(node: Node, allowDeclaration: boolean): Symbol | undefined;
2390 getContextualType(node: Expression): Type | undefined;
2391 /**
2392 * returns unknownSignature in the case of an error.
2393 * returns undefined if the node is not valid.
2394 * @param argumentCount Apparent number of arguments, passed in case of a possibly incomplete call. This should come from an ArgumentListInfo. See `signatureHelp.ts`.
2395 */
2396 getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[], argumentCount?: number): Signature | undefined;
2397 getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature | undefined;
2398 isImplementationOfOverload(node: SignatureDeclaration): boolean | undefined;
2399 isUndefinedSymbol(symbol: Symbol): boolean;
2400 isArgumentsSymbol(symbol: Symbol): boolean;
2401 isUnknownSymbol(symbol: Symbol): boolean;
2402 getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): string | number | undefined;
2403 isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName | ImportTypeNode, propertyName: string): boolean;
2404 /** Follow all aliases to get the original symbol. */
2405 getAliasedSymbol(symbol: Symbol): Symbol;
2406 /** Follow a *single* alias to get the immediately aliased symbol. */
2407 getImmediateAliasedSymbol(symbol: Symbol): Symbol | undefined;
2408 getExportsOfModule(moduleSymbol: Symbol): Symbol[];
2409 getJsxIntrinsicTagNamesAt(location: Node): Symbol[];
2410 isOptionalParameter(node: ParameterDeclaration): boolean;
2411 getAmbientModules(): Symbol[];
2412 tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined;
2413 getApparentType(type: Type): Type;
2414 getBaseConstraintOfType(type: Type): Type | undefined;
2415 getDefaultFromTypeParameter(type: Type): Type | undefined;
2416 getTypePredicateOfSignature(signature: Signature): TypePredicate | undefined;
2417 /**
2418 * Depending on the operation performed, it may be appropriate to throw away the checker
2419 * if the cancellation token is triggered. Typically, if it is used for error checking
2420 * and the operation is cancelled, then it should be discarded, otherwise it is safe to keep.
2421 */
2422 runWithCancellationToken<T>(token: CancellationToken, cb: (checker: TypeChecker) => T): T;
2423 }
2424 export enum NodeBuilderFlags {
2425 None = 0,
2426 NoTruncation = 1,
2427 WriteArrayAsGenericType = 2,
2428 GenerateNamesForShadowedTypeParams = 4,
2429 UseStructuralFallback = 8,
2430 ForbidIndexedAccessSymbolReferences = 16,
2431 WriteTypeArgumentsOfSignature = 32,
2432 UseFullyQualifiedType = 64,
2433 UseOnlyExternalAliasing = 128,
2434 SuppressAnyReturnType = 256,
2435 WriteTypeParametersInQualifiedName = 512,
2436 MultilineObjectLiterals = 1024,
2437 WriteClassExpressionAsTypeLiteral = 2048,
2438 UseTypeOfFunction = 4096,
2439 OmitParameterModifiers = 8192,
2440 UseAliasDefinedOutsideCurrentScope = 16384,
2441 UseSingleQuotesForStringLiteralType = 268435456,
2442 NoTypeReduction = 536870912,
2443 OmitThisParameter = 33554432,
2444 AllowThisInObjectLiteral = 32768,
2445 AllowQualifiedNameInPlaceOfIdentifier = 65536,
2446 /** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */
2447 AllowQualifedNameInPlaceOfIdentifier = 65536,
2448 AllowAnonymousIdentifier = 131072,
2449 AllowEmptyUnionOrIntersection = 262144,
2450 AllowEmptyTuple = 524288,
2451 AllowUniqueESSymbolType = 1048576,
2452 AllowEmptyIndexInfoType = 2097152,
2453 AllowNodeModulesRelativePaths = 67108864,
2454 IgnoreErrors = 70221824,
2455 InObjectTypeLiteral = 4194304,
2456 InTypeAlias = 8388608,
2457 InInitialEntityName = 16777216
2458 }
2459 export enum TypeFormatFlags {
2460 None = 0,
2461 NoTruncation = 1,
2462 WriteArrayAsGenericType = 2,
2463 UseStructuralFallback = 8,
2464 WriteTypeArgumentsOfSignature = 32,
2465 UseFullyQualifiedType = 64,
2466 SuppressAnyReturnType = 256,
2467 MultilineObjectLiterals = 1024,
2468 WriteClassExpressionAsTypeLiteral = 2048,
2469 UseTypeOfFunction = 4096,
2470 OmitParameterModifiers = 8192,
2471 UseAliasDefinedOutsideCurrentScope = 16384,
2472 UseSingleQuotesForStringLiteralType = 268435456,
2473 NoTypeReduction = 536870912,
2474 OmitThisParameter = 33554432,
2475 AllowUniqueESSymbolType = 1048576,
2476 AddUndefined = 131072,
2477 WriteArrowStyleSignature = 262144,
2478 InArrayType = 524288,
2479 InElementType = 2097152,
2480 InFirstTypeArgument = 4194304,
2481 InTypeAlias = 8388608,
2482 /** @deprecated */ WriteOwnNameForAnyLike = 0,
2483 NodeBuilderFlagsMask = 848330091
2484 }
2485 export enum SymbolFormatFlags {
2486 None = 0,
2487 WriteTypeParametersOrArguments = 1,
2488 UseOnlyExternalAliasing = 2,
2489 AllowAnyNodeKind = 4,
2490 UseAliasDefinedOutsideCurrentScope = 8,
2491 }
2492 export enum TypePredicateKind {
2493 This = 0,
2494 Identifier = 1,
2495 AssertsThis = 2,
2496 AssertsIdentifier = 3
2497 }
2498 export interface TypePredicateBase {
2499 kind: TypePredicateKind;
2500 type: Type | undefined;
2501 }
2502 export interface ThisTypePredicate extends TypePredicateBase {
2503 kind: TypePredicateKind.This;
2504 parameterName: undefined;
2505 parameterIndex: undefined;
2506 type: Type;
2507 }
2508 export interface IdentifierTypePredicate extends TypePredicateBase {
2509 kind: TypePredicateKind.Identifier;
2510 parameterName: string;
2511 parameterIndex: number;
2512 type: Type;
2513 }
2514 export interface AssertsThisTypePredicate extends TypePredicateBase {
2515 kind: TypePredicateKind.AssertsThis;
2516 parameterName: undefined;
2517 parameterIndex: undefined;
2518 type: Type | undefined;
2519 }
2520 export interface AssertsIdentifierTypePredicate extends TypePredicateBase {
2521 kind: TypePredicateKind.AssertsIdentifier;
2522 parameterName: string;
2523 parameterIndex: number;
2524 type: Type | undefined;
2525 }
2526 export type TypePredicate = ThisTypePredicate | IdentifierTypePredicate | AssertsThisTypePredicate | AssertsIdentifierTypePredicate;
2527 export enum SymbolFlags {
2528 None = 0,
2529 FunctionScopedVariable = 1,
2530 BlockScopedVariable = 2,
2531 Property = 4,
2532 EnumMember = 8,
2533 Function = 16,
2534 Class = 32,
2535 Interface = 64,
2536 ConstEnum = 128,
2537 RegularEnum = 256,
2538 ValueModule = 512,
2539 NamespaceModule = 1024,
2540 TypeLiteral = 2048,
2541 ObjectLiteral = 4096,
2542 Method = 8192,
2543 Constructor = 16384,
2544 GetAccessor = 32768,
2545 SetAccessor = 65536,
2546 Signature = 131072,
2547 TypeParameter = 262144,
2548 TypeAlias = 524288,
2549 ExportValue = 1048576,
2550 Alias = 2097152,
2551 Prototype = 4194304,
2552 ExportStar = 8388608,
2553 Optional = 16777216,
2554 Transient = 33554432,
2555 Assignment = 67108864,
2556 ModuleExports = 134217728,
2557 Enum = 384,
2558 Variable = 3,
2559 Value = 111551,
2560 Type = 788968,
2561 Namespace = 1920,
2562 Module = 1536,
2563 Accessor = 98304,
2564 FunctionScopedVariableExcludes = 111550,
2565 BlockScopedVariableExcludes = 111551,
2566 ParameterExcludes = 111551,
2567 PropertyExcludes = 0,
2568 EnumMemberExcludes = 900095,
2569 FunctionExcludes = 110991,
2570 ClassExcludes = 899503,
2571 InterfaceExcludes = 788872,
2572 RegularEnumExcludes = 899327,
2573 ConstEnumExcludes = 899967,
2574 ValueModuleExcludes = 110735,
2575 NamespaceModuleExcludes = 0,
2576 MethodExcludes = 103359,
2577 GetAccessorExcludes = 46015,
2578 SetAccessorExcludes = 78783,
2579 AccessorExcludes = 13247,
2580 TypeParameterExcludes = 526824,
2581 TypeAliasExcludes = 788968,
2582 AliasExcludes = 2097152,
2583 ModuleMember = 2623475,
2584 ExportHasLocal = 944,
2585 BlockScoped = 418,
2586 PropertyOrAccessor = 98308,
2587 ClassMember = 106500,
2588 }
2589 export interface Symbol {
2590 flags: SymbolFlags;
2591 escapedName: __String;
2592 declarations?: Declaration[];
2593 valueDeclaration?: Declaration;
2594 members?: SymbolTable;
2595 exports?: SymbolTable;
2596 globalExports?: SymbolTable;
2597 }
2598 export enum InternalSymbolName {
2599 Call = "__call",
2600 Constructor = "__constructor",
2601 New = "__new",
2602 Index = "__index",
2603 ExportStar = "__export",
2604 Global = "__global",
2605 Missing = "__missing",
2606 Type = "__type",
2607 Object = "__object",
2608 JSXAttributes = "__jsxAttributes",
2609 Class = "__class",
2610 Function = "__function",
2611 Computed = "__computed",
2612 Resolving = "__resolving__",
2613 ExportEquals = "export=",
2614 Default = "default",
2615 This = "this"
2616 }
2617 /**
2618 * This represents a string whose leading underscore have been escaped by adding extra leading underscores.
2619 * The shape of this brand is rather unique compared to others we've used.
2620 * Instead of just an intersection of a string and an object, it is that union-ed
2621 * with an intersection of void and an object. This makes it wholly incompatible
2622 * with a normal string (which is good, it cannot be misused on assignment or on usage),
2623 * while still being comparable with a normal string via === (also good) and castable from a string.
2624 */
2625 export type __String = (string & {
2626 __escapedIdentifier: void;
2627 }) | (void & {
2628 __escapedIdentifier: void;
2629 }) | InternalSymbolName;
2630 /** ReadonlyMap where keys are `__String`s. */
2631 export interface ReadonlyUnderscoreEscapedMap<T> extends ReadonlyESMap<__String, T> {
2632 }
2633 /** Map where keys are `__String`s. */
2634 export interface UnderscoreEscapedMap<T> extends ESMap<__String, T>, ReadonlyUnderscoreEscapedMap<T> {
2635 }
2636 /** SymbolTable based on ES6 Map interface. */
2637 export type SymbolTable = UnderscoreEscapedMap<Symbol>;
2638 export enum TypeFlags {
2639 Any = 1,
2640 Unknown = 2,
2641 String = 4,
2642 Number = 8,
2643 Boolean = 16,
2644 Enum = 32,
2645 BigInt = 64,
2646 StringLiteral = 128,
2647 NumberLiteral = 256,
2648 BooleanLiteral = 512,
2649 EnumLiteral = 1024,
2650 BigIntLiteral = 2048,
2651 ESSymbol = 4096,
2652 UniqueESSymbol = 8192,
2653 Void = 16384,
2654 Undefined = 32768,
2655 Null = 65536,
2656 Never = 131072,
2657 TypeParameter = 262144,
2658 Object = 524288,
2659 Union = 1048576,
2660 Intersection = 2097152,
2661 Index = 4194304,
2662 IndexedAccess = 8388608,
2663 Conditional = 16777216,
2664 Substitution = 33554432,
2665 NonPrimitive = 67108864,
2666 TemplateLiteral = 134217728,
2667 StringMapping = 268435456,
2668 Literal = 2944,
2669 Unit = 109440,
2670 StringOrNumberLiteral = 384,
2671 PossiblyFalsy = 117724,
2672 StringLike = 402653316,
2673 NumberLike = 296,
2674 BigIntLike = 2112,
2675 BooleanLike = 528,
2676 EnumLike = 1056,
2677 ESSymbolLike = 12288,
2678 VoidLike = 49152,
2679 UnionOrIntersection = 3145728,
2680 StructuredType = 3670016,
2681 TypeVariable = 8650752,
2682 InstantiableNonPrimitive = 58982400,
2683 InstantiablePrimitive = 406847488,
2684 Instantiable = 465829888,
2685 StructuredOrInstantiable = 469499904,
2686 Narrowable = 536624127,
2687 }
2688 export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression;
2689 export interface Type {
2690 flags: TypeFlags;
2691 symbol: Symbol;
2692 pattern?: DestructuringPattern;
2693 aliasSymbol?: Symbol;
2694 aliasTypeArguments?: readonly Type[];
2695 }
2696 export interface LiteralType extends Type {
2697 value: string | number | PseudoBigInt;
2698 freshType: LiteralType;
2699 regularType: LiteralType;
2700 }
2701 export interface UniqueESSymbolType extends Type {
2702 symbol: Symbol;
2703 escapedName: __String;
2704 }
2705 export interface StringLiteralType extends LiteralType {
2706 value: string;
2707 }
2708 export interface NumberLiteralType extends LiteralType {
2709 value: number;
2710 }
2711 export interface BigIntLiteralType extends LiteralType {
2712 value: PseudoBigInt;
2713 }
2714 export interface EnumType extends Type {
2715 }
2716 export enum ObjectFlags {
2717 Class = 1,
2718 Interface = 2,
2719 Reference = 4,
2720 Tuple = 8,
2721 Anonymous = 16,
2722 Mapped = 32,
2723 Instantiated = 64,
2724 ObjectLiteral = 128,
2725 EvolvingArray = 256,
2726 ObjectLiteralPatternWithComputedProperties = 512,
2727 ReverseMapped = 1024,
2728 JsxAttributes = 2048,
2729 JSLiteral = 4096,
2730 FreshLiteral = 8192,
2731 ArrayLiteral = 16384,
2732 ClassOrInterface = 3,
2733 ContainsSpread = 2097152,
2734 ObjectRestType = 4194304,
2735 InstantiationExpressionType = 8388608,
2736 }
2737 export interface ObjectType extends Type {
2738 objectFlags: ObjectFlags;
2739 }
2740 /** Class and interface types (ObjectFlags.Class and ObjectFlags.Interface). */
2741 export interface InterfaceType extends ObjectType {
2742 typeParameters: TypeParameter[] | undefined;
2743 outerTypeParameters: TypeParameter[] | undefined;
2744 localTypeParameters: TypeParameter[] | undefined;
2745 thisType: TypeParameter | undefined;
2746 }
2747 export type BaseType = ObjectType | IntersectionType | TypeVariable;
2748 export interface InterfaceTypeWithDeclaredMembers extends InterfaceType {
2749 declaredProperties: Symbol[];
2750 declaredCallSignatures: Signature[];
2751 declaredConstructSignatures: Signature[];
2752 declaredIndexInfos: IndexInfo[];
2753 }
2754 /**
2755 * Type references (ObjectFlags.Reference). When a class or interface has type parameters or
2756 * a "this" type, references to the class or interface are made using type references. The
2757 * typeArguments property specifies the types to substitute for the type parameters of the
2758 * class or interface and optionally includes an extra element that specifies the type to
2759 * substitute for "this" in the resulting instantiation. When no extra argument is present,
2760 * the type reference itself is substituted for "this". The typeArguments property is undefined
2761 * if the class or interface has no type parameters and the reference isn't specifying an
2762 * explicit "this" argument.
2763 */
2764 export interface TypeReference extends ObjectType {
2765 target: GenericType;
2766 node?: TypeReferenceNode | ArrayTypeNode | TupleTypeNode;
2767 }
2768 export interface DeferredTypeReference extends TypeReference {
2769 }
2770 export interface GenericType extends InterfaceType, TypeReference {
2771 }
2772 export enum ElementFlags {
2773 Required = 1,
2774 Optional = 2,
2775 Rest = 4,
2776 Variadic = 8,
2777 Fixed = 3,
2778 Variable = 12,
2779 NonRequired = 14,
2780 NonRest = 11
2781 }
2782 export interface TupleType extends GenericType {
2783 elementFlags: readonly ElementFlags[];
2784 minLength: number;
2785 fixedLength: number;
2786 hasRestElement: boolean;
2787 combinedFlags: ElementFlags;
2788 readonly: boolean;
2789 labeledElementDeclarations?: readonly (NamedTupleMember | ParameterDeclaration)[];
2790 }
2791 export interface TupleTypeReference extends TypeReference {
2792 target: TupleType;
2793 }
2794 export interface UnionOrIntersectionType extends Type {
2795 types: Type[];
2796 }
2797 export interface UnionType extends UnionOrIntersectionType {
2798 }
2799 export interface IntersectionType extends UnionOrIntersectionType {
2800 }
2801 export type StructuredType = ObjectType | UnionType | IntersectionType;
2802 export interface EvolvingArrayType extends ObjectType {
2803 elementType: Type;
2804 finalArrayType?: Type;
2805 }
2806 export interface InstantiableType extends Type {
2807 }
2808 export interface TypeParameter extends InstantiableType {
2809 }
2810 export interface IndexedAccessType extends InstantiableType {
2811 objectType: Type;
2812 indexType: Type;
2813 constraint?: Type;
2814 simplifiedForReading?: Type;
2815 simplifiedForWriting?: Type;
2816 }
2817 export type TypeVariable = TypeParameter | IndexedAccessType;
2818 export interface IndexType extends InstantiableType {
2819 type: InstantiableType | UnionOrIntersectionType;
2820 }
2821 export interface ConditionalRoot {
2822 node: ConditionalTypeNode;
2823 checkType: Type;
2824 extendsType: Type;
2825 isDistributive: boolean;
2826 inferTypeParameters?: TypeParameter[];
2827 outerTypeParameters?: TypeParameter[];
2828 instantiations?: Map<Type>;
2829 aliasSymbol?: Symbol;
2830 aliasTypeArguments?: Type[];
2831 }
2832 export interface ConditionalType extends InstantiableType {
2833 root: ConditionalRoot;
2834 checkType: Type;
2835 extendsType: Type;
2836 resolvedTrueType?: Type;
2837 resolvedFalseType?: Type;
2838 }
2839 export interface TemplateLiteralType extends InstantiableType {
2840 texts: readonly string[];
2841 types: readonly Type[];
2842 }
2843 export interface StringMappingType extends InstantiableType {
2844 symbol: Symbol;
2845 type: Type;
2846 }
2847 export interface SubstitutionType extends InstantiableType {
2848 objectFlags: ObjectFlags;
2849 baseType: Type;
2850 constraint: Type;
2851 }
2852 export enum SignatureKind {
2853 Call = 0,
2854 Construct = 1
2855 }
2856 export interface Signature {
2857 declaration?: SignatureDeclaration | JSDocSignature;
2858 typeParameters?: readonly TypeParameter[];
2859 parameters: readonly Symbol[];
2860 }
2861 export enum IndexKind {
2862 String = 0,
2863 Number = 1
2864 }
2865 export interface IndexInfo {
2866 keyType: Type;
2867 type: Type;
2868 isReadonly: boolean;
2869 declaration?: IndexSignatureDeclaration;
2870 }
2871 export enum InferencePriority {
2872 NakedTypeVariable = 1,
2873 SpeculativeTuple = 2,
2874 SubstituteSource = 4,
2875 HomomorphicMappedType = 8,
2876 PartialHomomorphicMappedType = 16,
2877 MappedTypeConstraint = 32,
2878 ContravariantConditional = 64,
2879 ReturnType = 128,
2880 LiteralKeyof = 256,
2881 NoConstraints = 512,
2882 AlwaysStrict = 1024,
2883 MaxValue = 2048,
2884 PriorityImpliesCombination = 416,
2885 Circularity = -1
2886 }
2887 /** @deprecated Use FileExtensionInfo instead. */
2888 export type JsFileExtensionInfo = FileExtensionInfo;
2889 export interface FileExtensionInfo {
2890 extension: string;
2891 isMixedContent: boolean;
2892 scriptKind?: ScriptKind;
2893 }
2894 export interface DiagnosticMessage {
2895 key: string;
2896 category: DiagnosticCategory;
2897 code: number;
2898 message: string;
2899 reportsUnnecessary?: {};
2900 reportsDeprecated?: {};
2901 }
2902 /**
2903 * A linked list of formatted diagnostic messages to be used as part of a multiline message.
2904 * It is built from the bottom up, leaving the head to be the "main" diagnostic.
2905 * While it seems that DiagnosticMessageChain is structurally similar to DiagnosticMessage,
2906 * the difference is that messages are all preformatted in DMC.
2907 */
2908 export interface DiagnosticMessageChain {
2909 messageText: string;
2910 category: DiagnosticCategory;
2911 code: number;
2912 next?: DiagnosticMessageChain[];
2913 }
2914 export interface Diagnostic extends DiagnosticRelatedInformation {
2915 /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
2916 reportsUnnecessary?: {};
2917 reportsDeprecated?: {};
2918 source?: string;
2919 relatedInformation?: DiagnosticRelatedInformation[];
2920 }
2921 export interface DiagnosticRelatedInformation {
2922 category: DiagnosticCategory;
2923 code: number;
2924 file: SourceFile | undefined;
2925 start: number | undefined;
2926 length: number | undefined;
2927 messageText: string | DiagnosticMessageChain;
2928 }
2929 export interface DiagnosticWithLocation extends Diagnostic {
2930 file: SourceFile;
2931 start: number;
2932 length: number;
2933 }
2934 export enum DiagnosticCategory {
2935 Warning = 0,
2936 Error = 1,
2937 Suggestion = 2,
2938 Message = 3
2939 }
2940 export enum ModuleResolutionKind {
2941 Classic = 1,
2942 NodeJs = 2,
2943 Node16 = 3,
2944 NodeNext = 99
2945 }
2946 export enum ModuleDetectionKind {
2947 /**
2948 * Files with imports, exports and/or import.meta are considered modules
2949 */
2950 Legacy = 1,
2951 /**
2952 * Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node16+
2953 */
2954 Auto = 2,
2955 /**
2956 * Consider all non-declaration files modules, regardless of present syntax
2957 */
2958 Force = 3
2959 }
2960 export interface PluginImport {
2961 name: string;
2962 }
2963 export interface ProjectReference {
2964 /** A normalized path on disk */
2965 path: string;
2966 /** The path as the user originally wrote it */
2967 originalPath?: string;
2968 /** True if the output of this reference should be prepended to the output of this project. Only valid for --outFile compilations */
2969 prepend?: boolean;
2970 /** True if it is intended that this reference form a circularity */
2971 circular?: boolean;
2972 }
2973 export enum WatchFileKind {
2974 FixedPollingInterval = 0,
2975 PriorityPollingInterval = 1,
2976 DynamicPriorityPolling = 2,
2977 FixedChunkSizePolling = 3,
2978 UseFsEvents = 4,
2979 UseFsEventsOnParentDirectory = 5
2980 }
2981 export enum WatchDirectoryKind {
2982 UseFsEvents = 0,
2983 FixedPollingInterval = 1,
2984 DynamicPriorityPolling = 2,
2985 FixedChunkSizePolling = 3
2986 }
2987 export enum PollingWatchKind {
2988 FixedInterval = 0,
2989 PriorityInterval = 1,
2990 DynamicPriority = 2,
2991 FixedChunkSize = 3
2992 }
2993 export type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | PluginImport[] | ProjectReference[] | null | undefined;
2994 export interface CompilerOptions {
2995 allowJs?: boolean;
2996 allowSyntheticDefaultImports?: boolean;
2997 allowUmdGlobalAccess?: boolean;
2998 allowUnreachableCode?: boolean;
2999 allowUnusedLabels?: boolean;
3000 alwaysStrict?: boolean;
3001 baseUrl?: string;
3002 charset?: string;
3003 checkJs?: boolean;
3004 declaration?: boolean;
3005 declarationMap?: boolean;
3006 emitDeclarationOnly?: boolean;
3007 declarationDir?: string;
3008 disableSizeLimit?: boolean;
3009 disableSourceOfProjectReferenceRedirect?: boolean;
3010 disableSolutionSearching?: boolean;
3011 disableReferencedProjectLoad?: boolean;
3012 downlevelIteration?: boolean;
3013 emitBOM?: boolean;
3014 emitDecoratorMetadata?: boolean;
3015 exactOptionalPropertyTypes?: boolean;
3016 experimentalDecorators?: boolean;
3017 forceConsistentCasingInFileNames?: boolean;
3018 importHelpers?: boolean;
3019 importsNotUsedAsValues?: ImportsNotUsedAsValues;
3020 inlineSourceMap?: boolean;
3021 inlineSources?: boolean;
3022 isolatedModules?: boolean;
3023 jsx?: JsxEmit;
3024 keyofStringsOnly?: boolean;
3025 lib?: string[];
3026 locale?: string;
3027 mapRoot?: string;
3028 maxNodeModuleJsDepth?: number;
3029 module?: ModuleKind;
3030 moduleResolution?: ModuleResolutionKind;
3031 moduleSuffixes?: string[];
3032 moduleDetection?: ModuleDetectionKind;
3033 newLine?: NewLineKind;
3034 noEmit?: boolean;
3035 noEmitHelpers?: boolean;
3036 noEmitOnError?: boolean;
3037 noErrorTruncation?: boolean;
3038 noFallthroughCasesInSwitch?: boolean;
3039 noImplicitAny?: boolean;
3040 noImplicitReturns?: boolean;
3041 noImplicitThis?: boolean;
3042 noStrictGenericChecks?: boolean;
3043 noUnusedLocals?: boolean;
3044 noUnusedParameters?: boolean;
3045 noImplicitUseStrict?: boolean;
3046 noPropertyAccessFromIndexSignature?: boolean;
3047 assumeChangesOnlyAffectDirectDependencies?: boolean;
3048 noLib?: boolean;
3049 noResolve?: boolean;
3050 noUncheckedIndexedAccess?: boolean;
3051 out?: string;
3052 outDir?: string;
3053 outFile?: string;
3054 paths?: MapLike<string[]>;
3055 preserveConstEnums?: boolean;
3056 noImplicitOverride?: boolean;
3057 preserveSymlinks?: boolean;
3058 preserveValueImports?: boolean;
3059 project?: string;
3060 reactNamespace?: string;
3061 jsxFactory?: string;
3062 jsxFragmentFactory?: string;
3063 jsxImportSource?: string;
3064 composite?: boolean;
3065 incremental?: boolean;
3066 tsBuildInfoFile?: string;
3067 removeComments?: boolean;
3068 rootDir?: string;
3069 rootDirs?: string[];
3070 skipLibCheck?: boolean;
3071 skipDefaultLibCheck?: boolean;
3072 sourceMap?: boolean;
3073 sourceRoot?: string;
3074 strict?: boolean;
3075 strictFunctionTypes?: boolean;
3076 strictBindCallApply?: boolean;
3077 strictNullChecks?: boolean;
3078 strictPropertyInitialization?: boolean;
3079 stripInternal?: boolean;
3080 suppressExcessPropertyErrors?: boolean;
3081 suppressImplicitAnyIndexErrors?: boolean;
3082 target?: ScriptTarget;
3083 traceResolution?: boolean;
3084 useUnknownInCatchVariables?: boolean;
3085 resolveJsonModule?: boolean;
3086 types?: string[];
3087 /** Paths used to compute primary types search locations */
3088 typeRoots?: string[];
3089 esModuleInterop?: boolean;
3090 useDefineForClassFields?: boolean;
3091 [option: string]: CompilerOptionsValue | TsConfigSourceFile | undefined;
3092 }
3093 export interface WatchOptions {
3094 watchFile?: WatchFileKind;
3095 watchDirectory?: WatchDirectoryKind;
3096 fallbackPolling?: PollingWatchKind;
3097 synchronousWatchDirectory?: boolean;
3098 excludeDirectories?: string[];
3099 excludeFiles?: string[];
3100 [option: string]: CompilerOptionsValue | undefined;
3101 }
3102 export interface TypeAcquisition {
3103 /**
3104 * @deprecated typingOptions.enableAutoDiscovery
3105 * Use typeAcquisition.enable instead.
3106 */
3107 enableAutoDiscovery?: boolean;
3108 enable?: boolean;
3109 include?: string[];
3110 exclude?: string[];
3111 disableFilenameBasedTypeAcquisition?: boolean;
3112 [option: string]: CompilerOptionsValue | undefined;
3113 }
3114 export enum ModuleKind {
3115 None = 0,
3116 CommonJS = 1,
3117 AMD = 2,
3118 UMD = 3,
3119 System = 4,
3120 ES2015 = 5,
3121 ES2020 = 6,
3122 ES2022 = 7,
3123 ESNext = 99,
3124 Node16 = 100,
3125 NodeNext = 199
3126 }
3127 export enum JsxEmit {
3128 None = 0,
3129 Preserve = 1,
3130 React = 2,
3131 ReactNative = 3,
3132 ReactJSX = 4,
3133 ReactJSXDev = 5
3134 }
3135 export enum ImportsNotUsedAsValues {
3136 Remove = 0,
3137 Preserve = 1,
3138 Error = 2
3139 }
3140 export enum NewLineKind {
3141 CarriageReturnLineFeed = 0,
3142 LineFeed = 1
3143 }
3144 export interface LineAndCharacter {
3145 /** 0-based. */
3146 line: number;
3147 character: number;
3148 }
3149 export enum ScriptKind {
3150 Unknown = 0,
3151 JS = 1,
3152 JSX = 2,
3153 TS = 3,
3154 TSX = 4,
3155 External = 5,
3156 JSON = 6,
3157 /**
3158 * Used on extensions that doesn't define the ScriptKind but the content defines it.
3159 * Deferred extensions are going to be included in all project contexts.
3160 */
3161 Deferred = 7
3162 }
3163 export enum ScriptTarget {
3164 ES3 = 0,
3165 ES5 = 1,
3166 ES2015 = 2,
3167 ES2016 = 3,
3168 ES2017 = 4,
3169 ES2018 = 5,
3170 ES2019 = 6,
3171 ES2020 = 7,
3172 ES2021 = 8,
3173 ES2022 = 9,
3174 ESNext = 99,
3175 JSON = 100,
3176 Latest = 99
3177 }
3178 export enum LanguageVariant {
3179 Standard = 0,
3180 JSX = 1
3181 }
3182 /** Either a parsed command line or a parsed tsconfig.json */
3183 export interface ParsedCommandLine {
3184 options: CompilerOptions;
3185 typeAcquisition?: TypeAcquisition;
3186 fileNames: string[];
3187 projectReferences?: readonly ProjectReference[];
3188 watchOptions?: WatchOptions;
3189 raw?: any;
3190 errors: Diagnostic[];
3191 wildcardDirectories?: MapLike<WatchDirectoryFlags>;
3192 compileOnSave?: boolean;
3193 }
3194 export enum WatchDirectoryFlags {
3195 None = 0,
3196 Recursive = 1
3197 }
3198 export interface CreateProgramOptions {
3199 rootNames: readonly string[];
3200 options: CompilerOptions;
3201 projectReferences?: readonly ProjectReference[];
3202 host?: CompilerHost;
3203 oldProgram?: Program;
3204 configFileParsingDiagnostics?: readonly Diagnostic[];
3205 }
3206 export interface ModuleResolutionHost {
3207 fileExists(fileName: string): boolean;
3208 readFile(fileName: string): string | undefined;
3209 trace?(s: string): void;
3210 directoryExists?(directoryName: string): boolean;
3211 /**
3212 * Resolve a symbolic link.
3213 * @see https://nodejs.org/api/fs.html#fs_fs_realpathsync_path_options
3214 */
3215 realpath?(path: string): string;
3216 getCurrentDirectory?(): string;
3217 getDirectories?(path: string): string[];
3218 useCaseSensitiveFileNames?: boolean | (() => boolean) | undefined;
3219 }
3220 /**
3221 * Used by services to specify the minimum host area required to set up source files under any compilation settings
3222 */
3223 export interface MinimalResolutionCacheHost extends ModuleResolutionHost {
3224 getCompilationSettings(): CompilerOptions;
3225 getCompilerHost?(): CompilerHost | undefined;
3226 }
3227 /**
3228 * Represents the result of module resolution.
3229 * Module resolution will pick up tsx/jsx/js files even if '--jsx' and '--allowJs' are turned off.
3230 * The Program will then filter results based on these flags.
3231 *
3232 * Prefer to return a `ResolvedModuleFull` so that the file type does not have to be inferred.
3233 */
3234 export interface ResolvedModule {
3235 /** Path of the file the module was resolved to. */
3236 resolvedFileName: string;
3237 /** True if `resolvedFileName` comes from `node_modules`. */
3238 isExternalLibraryImport?: boolean;
3239 }
3240 /**
3241 * ResolvedModule with an explicitly provided `extension` property.
3242 * Prefer this over `ResolvedModule`.
3243 * If changing this, remember to change `moduleResolutionIsEqualTo`.
3244 */
3245 export interface ResolvedModuleFull extends ResolvedModule {
3246 /**
3247 * Extension of resolvedFileName. This must match what's at the end of resolvedFileName.
3248 * This is optional for backwards-compatibility, but will be added if not provided.
3249 */
3250 extension: Extension;
3251 packageId?: PackageId;
3252 }
3253 /**
3254 * Unique identifier with a package name and version.
3255 * If changing this, remember to change `packageIdIsEqual`.
3256 */
3257 export interface PackageId {
3258 /**
3259 * Name of the package.
3260 * Should not include `@types`.
3261 * If accessing a non-index file, this should include its name e.g. "foo/bar".
3262 */
3263 name: string;
3264 /**
3265 * Name of a submodule within this package.
3266 * May be "".
3267 */
3268 subModuleName: string;
3269 /** Version of the package, e.g. "1.2.3" */
3270 version: string;
3271 }
3272 export enum Extension {
3273 Ts = ".ts",
3274 Tsx = ".tsx",
3275 Dts = ".d.ts",
3276 Js = ".js",
3277 Jsx = ".jsx",
3278 Json = ".json",
3279 TsBuildInfo = ".tsbuildinfo",
3280 Mjs = ".mjs",
3281 Mts = ".mts",
3282 Dmts = ".d.mts",
3283 Cjs = ".cjs",
3284 Cts = ".cts",
3285 Dcts = ".d.cts"
3286 }
3287 export interface ResolvedModuleWithFailedLookupLocations {
3288 readonly resolvedModule: ResolvedModuleFull | undefined;
3289 }
3290 export interface ResolvedTypeReferenceDirective {
3291 primary: boolean;
3292 resolvedFileName: string | undefined;
3293 packageId?: PackageId;
3294 /** True if `resolvedFileName` comes from `node_modules`. */
3295 isExternalLibraryImport?: boolean;
3296 }
3297 export interface ResolvedTypeReferenceDirectiveWithFailedLookupLocations {
3298 readonly resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective | undefined;
3299 readonly failedLookupLocations: string[];
3300 }
3301 export interface CompilerHost extends ModuleResolutionHost {
3302 getSourceFile(fileName: string, languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): SourceFile | undefined;
3303 getSourceFileByPath?(fileName: string, path: Path, languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): SourceFile | undefined;
3304 getCancellationToken?(): CancellationToken;
3305 getDefaultLibFileName(options: CompilerOptions): string;
3306 getDefaultLibLocation?(): string;
3307 writeFile: WriteFileCallback;
3308 getCurrentDirectory(): string;
3309 getCanonicalFileName(fileName: string): string;
3310 useCaseSensitiveFileNames(): boolean;
3311 getNewLine(): string;
3312 readDirectory?(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number): string[];
3313 resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[];
3314 /**
3315 * Returns the module resolution cache used by a provided `resolveModuleNames` implementation so that any non-name module resolution operations (eg, package.json lookup) can reuse it
3316 */
3317 getModuleResolutionCache?(): ModuleResolutionCache | undefined;
3318 /**
3319 * This method is a companion for 'resolveModuleNames' and is used to resolve 'types' references to actual type declaration files
3320 */
3321 resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
3322 getEnvironmentVariable?(name: string): string | undefined;
3323 /** If provided along with custom resolveModuleNames or resolveTypeReferenceDirectives, used to determine if unchanged file path needs to re-resolve modules/type reference directives */
3324 hasInvalidatedResolutions?(filePath: Path): boolean;
3325 createHash?(data: string): string;
3326 getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
3327 }
3328 export interface SourceMapRange extends TextRange {
3329 source?: SourceMapSource;
3330 }
3331 export interface SourceMapSource {
3332 fileName: string;
3333 text: string;
3334 skipTrivia?: (pos: number) => number;
3335 }
3336 export enum EmitFlags {
3337 None = 0,
3338 SingleLine = 1,
3339 AdviseOnEmitNode = 2,
3340 NoSubstitution = 4,
3341 CapturesThis = 8,
3342 NoLeadingSourceMap = 16,
3343 NoTrailingSourceMap = 32,
3344 NoSourceMap = 48,
3345 NoNestedSourceMaps = 64,
3346 NoTokenLeadingSourceMaps = 128,
3347 NoTokenTrailingSourceMaps = 256,
3348 NoTokenSourceMaps = 384,
3349 NoLeadingComments = 512,
3350 NoTrailingComments = 1024,
3351 NoComments = 1536,
3352 NoNestedComments = 2048,
3353 HelperName = 4096,
3354 ExportName = 8192,
3355 LocalName = 16384,
3356 InternalName = 32768,
3357 Indented = 65536,
3358 NoIndentation = 131072,
3359 AsyncFunctionBody = 262144,
3360 ReuseTempVariableScope = 524288,
3361 CustomPrologue = 1048576,
3362 NoHoisting = 2097152,
3363 HasEndOfDeclarationMarker = 4194304,
3364 Iterator = 8388608,
3365 NoAsciiEscaping = 16777216,
3366 }
3367 export interface EmitHelperBase {
3368 readonly name: string;
3369 readonly scoped: boolean;
3370 readonly text: string | ((node: EmitHelperUniqueNameCallback) => string);
3371 readonly priority?: number;
3372 readonly dependencies?: EmitHelper[];
3373 }
3374 export interface ScopedEmitHelper extends EmitHelperBase {
3375 readonly scoped: true;
3376 }
3377 export interface UnscopedEmitHelper extends EmitHelperBase {
3378 readonly scoped: false;
3379 readonly text: string;
3380 }
3381 export type EmitHelper = ScopedEmitHelper | UnscopedEmitHelper;
3382 export type EmitHelperUniqueNameCallback = (name: string) => string;
3383 export enum EmitHint {
3384 SourceFile = 0,
3385 Expression = 1,
3386 IdentifierName = 2,
3387 MappedTypeParameter = 3,
3388 Unspecified = 4,
3389 EmbeddedStatement = 5,
3390 JsxAttributeValue = 6
3391 }
3392 export enum OuterExpressionKinds {
3393 Parentheses = 1,
3394 TypeAssertions = 2,
3395 NonNullAssertions = 4,
3396 PartiallyEmittedExpressions = 8,
3397 Assertions = 6,
3398 All = 15,
3399 ExcludeJSDocTypeAssertion = 16
3400 }
3401 export type TypeOfTag = "undefined" | "number" | "bigint" | "boolean" | "string" | "symbol" | "object" | "function";
3402 export interface NodeFactory {
3403 createNodeArray<T extends Node>(elements?: readonly T[], hasTrailingComma?: boolean): NodeArray<T>;
3404 createNumericLiteral(value: string | number, numericLiteralFlags?: TokenFlags): NumericLiteral;
3405 createBigIntLiteral(value: string | PseudoBigInt): BigIntLiteral;
3406 createStringLiteral(text: string, isSingleQuote?: boolean): StringLiteral;
3407 createStringLiteralFromNode(sourceNode: PropertyNameLiteral | PrivateIdentifier, isSingleQuote?: boolean): StringLiteral;
3408 createRegularExpressionLiteral(text: string): RegularExpressionLiteral;
3409 createIdentifier(text: string): Identifier;
3410 /**
3411 * Create a unique temporary variable.
3412 * @param recordTempVariable An optional callback used to record the temporary variable name. This
3413 * should usually be a reference to `hoistVariableDeclaration` from a `TransformationContext`, but
3414 * can be `undefined` if you plan to record the temporary variable manually.
3415 * @param reservedInNestedScopes When `true`, reserves the temporary variable name in all nested scopes
3416 * during emit so that the variable can be referenced in a nested function body. This is an alternative to
3417 * setting `EmitFlags.ReuseTempVariableScope` on the nested function itself.
3418 */
3419 createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined, reservedInNestedScopes?: boolean): Identifier;
3420 /**
3421 * Create a unique temporary variable for use in a loop.
3422 * @param reservedInNestedScopes When `true`, reserves the temporary variable name in all nested scopes
3423 * during emit so that the variable can be referenced in a nested function body. This is an alternative to
3424 * setting `EmitFlags.ReuseTempVariableScope` on the nested function itself.
3425 */
3426 createLoopVariable(reservedInNestedScopes?: boolean): Identifier;
3427 /** Create a unique name based on the supplied text. */
3428 createUniqueName(text: string, flags?: GeneratedIdentifierFlags): Identifier;
3429 /** Create a unique name generated for a node. */
3430 getGeneratedNameForNode(node: Node | undefined, flags?: GeneratedIdentifierFlags): Identifier;
3431 createPrivateIdentifier(text: string): PrivateIdentifier;
3432 createUniquePrivateName(text?: string): PrivateIdentifier;
3433 getGeneratedPrivateNameForNode(node: Node): PrivateIdentifier;
3434 createToken(token: SyntaxKind.SuperKeyword): SuperExpression;
3435 createToken(token: SyntaxKind.ThisKeyword): ThisExpression;
3436 createToken(token: SyntaxKind.NullKeyword): NullLiteral;
3437 createToken(token: SyntaxKind.TrueKeyword): TrueLiteral;
3438 createToken(token: SyntaxKind.FalseKeyword): FalseLiteral;
3439 createToken<TKind extends PunctuationSyntaxKind>(token: TKind): PunctuationToken<TKind>;
3440 createToken<TKind extends KeywordTypeSyntaxKind>(token: TKind): KeywordTypeNode<TKind>;
3441 createToken<TKind extends ModifierSyntaxKind>(token: TKind): ModifierToken<TKind>;
3442 createToken<TKind extends KeywordSyntaxKind>(token: TKind): KeywordToken<TKind>;
3443 createToken<TKind extends SyntaxKind.Unknown | SyntaxKind.EndOfFileToken>(token: TKind): Token<TKind>;
3444 createSuper(): SuperExpression;
3445 createThis(): ThisExpression;
3446 createNull(): NullLiteral;
3447 createTrue(): TrueLiteral;
3448 createFalse(): FalseLiteral;
3449 createModifier<T extends ModifierSyntaxKind>(kind: T): ModifierToken<T>;
3450 createModifiersFromModifierFlags(flags: ModifierFlags): Modifier[] | undefined;
3451 createQualifiedName(left: EntityName, right: string | Identifier): QualifiedName;
3452 updateQualifiedName(node: QualifiedName, left: EntityName, right: Identifier): QualifiedName;
3453 createComputedPropertyName(expression: Expression): ComputedPropertyName;
3454 updateComputedPropertyName(node: ComputedPropertyName, expression: Expression): ComputedPropertyName;
3455 createTypeParameterDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, constraint?: TypeNode, defaultType?: TypeNode): TypeParameterDeclaration;
3456 updateTypeParameterDeclaration(node: TypeParameterDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration;
3457 createParameterDeclaration(modifiers: readonly ModifierLike[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken?: QuestionToken, type?: TypeNode, initializer?: Expression): ParameterDeclaration;
3458 updateParameterDeclaration(node: ParameterDeclaration, modifiers: readonly ModifierLike[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): ParameterDeclaration;
3459 createDecorator(expression: Expression): Decorator;
3460 updateDecorator(node: Decorator, expression: Expression): Decorator;
3461 createPropertySignature(modifiers: readonly Modifier[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature;
3462 updatePropertySignature(node: PropertySignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature;
3463 createPropertyDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
3464 updatePropertyDeclaration(node: PropertyDeclaration, modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
3465 createMethodSignature(modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): MethodSignature;
3466 updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): MethodSignature;
3467 createMethodDeclaration(modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
3468 updateMethodDeclaration(node: MethodDeclaration, modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
3469 createConstructorDeclaration(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
3470 updateConstructorDeclaration(node: ConstructorDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
3471 createGetAccessorDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
3472 updateGetAccessorDeclaration(node: GetAccessorDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
3473 createSetAccessorDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration;
3474 updateSetAccessorDeclaration(node: SetAccessorDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration;
3475 createCallSignature(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): CallSignatureDeclaration;
3476 updateCallSignature(node: CallSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): CallSignatureDeclaration;
3477 createConstructSignature(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): ConstructSignatureDeclaration;
3478 updateConstructSignature(node: ConstructSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): ConstructSignatureDeclaration;
3479 createIndexSignature(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration;
3480 updateIndexSignature(node: IndexSignatureDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration;
3481 createTemplateLiteralTypeSpan(type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan;
3482 updateTemplateLiteralTypeSpan(node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan;
3483 createClassStaticBlockDeclaration(body: Block): ClassStaticBlockDeclaration;
3484 updateClassStaticBlockDeclaration(node: ClassStaticBlockDeclaration, body: Block): ClassStaticBlockDeclaration;
3485 createKeywordTypeNode<TKind extends KeywordTypeSyntaxKind>(kind: TKind): KeywordTypeNode<TKind>;
3486 createTypePredicateNode(assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode | string, type: TypeNode | undefined): TypePredicateNode;
3487 updateTypePredicateNode(node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined): TypePredicateNode;
3488 createTypeReferenceNode(typeName: string | EntityName, typeArguments?: readonly TypeNode[]): TypeReferenceNode;
3489 updateTypeReferenceNode(node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray<TypeNode> | undefined): TypeReferenceNode;
3490 createFunctionTypeNode(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): FunctionTypeNode;
3491 updateFunctionTypeNode(node: FunctionTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode): FunctionTypeNode;
3492 createConstructorTypeNode(modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode;
3493 updateConstructorTypeNode(node: ConstructorTypeNode, modifiers: readonly Modifier[] | undefined, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode): ConstructorTypeNode;
3494 createTypeQueryNode(exprName: EntityName, typeArguments?: readonly TypeNode[]): TypeQueryNode;
3495 updateTypeQueryNode(node: TypeQueryNode, exprName: EntityName, typeArguments?: readonly TypeNode[]): TypeQueryNode;
3496 createTypeLiteralNode(members: readonly TypeElement[] | undefined): TypeLiteralNode;
3497 updateTypeLiteralNode(node: TypeLiteralNode, members: NodeArray<TypeElement>): TypeLiteralNode;
3498 createArrayTypeNode(elementType: TypeNode): ArrayTypeNode;
3499 updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode;
3500 createTupleTypeNode(elements: readonly (TypeNode | NamedTupleMember)[]): TupleTypeNode;
3501 updateTupleTypeNode(node: TupleTypeNode, elements: readonly (TypeNode | NamedTupleMember)[]): TupleTypeNode;
3502 createNamedTupleMember(dotDotDotToken: DotDotDotToken | undefined, name: Identifier, questionToken: QuestionToken | undefined, type: TypeNode): NamedTupleMember;
3503 updateNamedTupleMember(node: NamedTupleMember, dotDotDotToken: DotDotDotToken | undefined, name: Identifier, questionToken: QuestionToken | undefined, type: TypeNode): NamedTupleMember;
3504 createOptionalTypeNode(type: TypeNode): OptionalTypeNode;
3505 updateOptionalTypeNode(node: OptionalTypeNode, type: TypeNode): OptionalTypeNode;
3506 createRestTypeNode(type: TypeNode): RestTypeNode;
3507 updateRestTypeNode(node: RestTypeNode, type: TypeNode): RestTypeNode;
3508 createUnionTypeNode(types: readonly TypeNode[]): UnionTypeNode;
3509 updateUnionTypeNode(node: UnionTypeNode, types: NodeArray<TypeNode>): UnionTypeNode;
3510 createIntersectionTypeNode(types: readonly TypeNode[]): IntersectionTypeNode;
3511 updateIntersectionTypeNode(node: IntersectionTypeNode, types: NodeArray<TypeNode>): IntersectionTypeNode;
3512 createConditionalTypeNode(checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode;
3513 updateConditionalTypeNode(node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode;
3514 createInferTypeNode(typeParameter: TypeParameterDeclaration): InferTypeNode;
3515 updateInferTypeNode(node: InferTypeNode, typeParameter: TypeParameterDeclaration): InferTypeNode;
3516 createImportTypeNode(argument: TypeNode, assertions?: ImportTypeAssertionContainer, qualifier?: EntityName, typeArguments?: readonly TypeNode[], isTypeOf?: boolean): ImportTypeNode;
3517 updateImportTypeNode(node: ImportTypeNode, argument: TypeNode, assertions: ImportTypeAssertionContainer | undefined, qualifier: EntityName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf?: boolean): ImportTypeNode;
3518 createParenthesizedType(type: TypeNode): ParenthesizedTypeNode;
3519 updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode;
3520 createThisTypeNode(): ThisTypeNode;
3521 createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode;
3522 updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode;
3523 createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode;
3524 updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode;
3525 createMappedTypeNode(readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined, members: NodeArray<TypeElement> | undefined): MappedTypeNode;
3526 updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined, members: NodeArray<TypeElement> | undefined): MappedTypeNode;
3527 createLiteralTypeNode(literal: LiteralTypeNode["literal"]): LiteralTypeNode;
3528 updateLiteralTypeNode(node: LiteralTypeNode, literal: LiteralTypeNode["literal"]): LiteralTypeNode;
3529 createTemplateLiteralType(head: TemplateHead, templateSpans: readonly TemplateLiteralTypeSpan[]): TemplateLiteralTypeNode;
3530 updateTemplateLiteralType(node: TemplateLiteralTypeNode, head: TemplateHead, templateSpans: readonly TemplateLiteralTypeSpan[]): TemplateLiteralTypeNode;
3531 createObjectBindingPattern(elements: readonly BindingElement[]): ObjectBindingPattern;
3532 updateObjectBindingPattern(node: ObjectBindingPattern, elements: readonly BindingElement[]): ObjectBindingPattern;
3533 createArrayBindingPattern(elements: readonly ArrayBindingElement[]): ArrayBindingPattern;
3534 updateArrayBindingPattern(node: ArrayBindingPattern, elements: readonly ArrayBindingElement[]): ArrayBindingPattern;
3535 createBindingElement(dotDotDotToken: DotDotDotToken | undefined, propertyName: string | PropertyName | undefined, name: string | BindingName, initializer?: Expression): BindingElement;
3536 updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken | undefined, propertyName: PropertyName | undefined, name: BindingName, initializer: Expression | undefined): BindingElement;
3537 createArrayLiteralExpression(elements?: readonly Expression[], multiLine?: boolean): ArrayLiteralExpression;
3538 updateArrayLiteralExpression(node: ArrayLiteralExpression, elements: readonly Expression[]): ArrayLiteralExpression;
3539 createObjectLiteralExpression(properties?: readonly ObjectLiteralElementLike[], multiLine?: boolean): ObjectLiteralExpression;
3540 updateObjectLiteralExpression(node: ObjectLiteralExpression, properties: readonly ObjectLiteralElementLike[]): ObjectLiteralExpression;
3541 createPropertyAccessExpression(expression: Expression, name: string | MemberName): PropertyAccessExpression;
3542 updatePropertyAccessExpression(node: PropertyAccessExpression, expression: Expression, name: MemberName): PropertyAccessExpression;
3543 createPropertyAccessChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, name: string | MemberName): PropertyAccessChain;
3544 updatePropertyAccessChain(node: PropertyAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, name: MemberName): PropertyAccessChain;
3545 createElementAccessExpression(expression: Expression, index: number | Expression): ElementAccessExpression;
3546 updateElementAccessExpression(node: ElementAccessExpression, expression: Expression, argumentExpression: Expression): ElementAccessExpression;
3547 createElementAccessChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, index: number | Expression): ElementAccessChain;
3548 updateElementAccessChain(node: ElementAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, argumentExpression: Expression): ElementAccessChain;
3549 createCallExpression(expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): CallExpression;
3550 updateCallExpression(node: CallExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]): CallExpression;
3551 createCallChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): CallChain;
3552 updateCallChain(node: CallChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]): CallChain;
3553 createNewExpression(expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): NewExpression;
3554 updateNewExpression(node: NewExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): NewExpression;
3555 createTaggedTemplateExpression(tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression;
3556 updateTaggedTemplateExpression(node: TaggedTemplateExpression, tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression;
3557 createTypeAssertion(type: TypeNode, expression: Expression): TypeAssertion;
3558 updateTypeAssertion(node: TypeAssertion, type: TypeNode, expression: Expression): TypeAssertion;
3559 createParenthesizedExpression(expression: Expression): ParenthesizedExpression;
3560 updateParenthesizedExpression(node: ParenthesizedExpression, expression: Expression): ParenthesizedExpression;
3561 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;
3562 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;
3563 createArrowFunction(modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction;
3564 updateArrowFunction(node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken, body: ConciseBody): ArrowFunction;
3565 createDeleteExpression(expression: Expression): DeleteExpression;
3566 updateDeleteExpression(node: DeleteExpression, expression: Expression): DeleteExpression;
3567 createTypeOfExpression(expression: Expression): TypeOfExpression;
3568 updateTypeOfExpression(node: TypeOfExpression, expression: Expression): TypeOfExpression;
3569 createVoidExpression(expression: Expression): VoidExpression;
3570 updateVoidExpression(node: VoidExpression, expression: Expression): VoidExpression;
3571 createAwaitExpression(expression: Expression): AwaitExpression;
3572 updateAwaitExpression(node: AwaitExpression, expression: Expression): AwaitExpression;
3573 createPrefixUnaryExpression(operator: PrefixUnaryOperator, operand: Expression): PrefixUnaryExpression;
3574 updatePrefixUnaryExpression(node: PrefixUnaryExpression, operand: Expression): PrefixUnaryExpression;
3575 createPostfixUnaryExpression(operand: Expression, operator: PostfixUnaryOperator): PostfixUnaryExpression;
3576 updatePostfixUnaryExpression(node: PostfixUnaryExpression, operand: Expression): PostfixUnaryExpression;
3577 createBinaryExpression(left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression): BinaryExpression;
3578 updateBinaryExpression(node: BinaryExpression, left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression): BinaryExpression;
3579 createConditionalExpression(condition: Expression, questionToken: QuestionToken | undefined, whenTrue: Expression, colonToken: ColonToken | undefined, whenFalse: Expression): ConditionalExpression;
3580 updateConditionalExpression(node: ConditionalExpression, condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression;
3581 createTemplateExpression(head: TemplateHead, templateSpans: readonly TemplateSpan[]): TemplateExpression;
3582 updateTemplateExpression(node: TemplateExpression, head: TemplateHead, templateSpans: readonly TemplateSpan[]): TemplateExpression;
3583 createTemplateHead(text: string, rawText?: string, templateFlags?: TokenFlags): TemplateHead;
3584 createTemplateHead(text: string | undefined, rawText: string, templateFlags?: TokenFlags): TemplateHead;
3585 createTemplateMiddle(text: string, rawText?: string, templateFlags?: TokenFlags): TemplateMiddle;
3586 createTemplateMiddle(text: string | undefined, rawText: string, templateFlags?: TokenFlags): TemplateMiddle;
3587 createTemplateTail(text: string, rawText?: string, templateFlags?: TokenFlags): TemplateTail;
3588 createTemplateTail(text: string | undefined, rawText: string, templateFlags?: TokenFlags): TemplateTail;
3589 createNoSubstitutionTemplateLiteral(text: string, rawText?: string): NoSubstitutionTemplateLiteral;
3590 createNoSubstitutionTemplateLiteral(text: string | undefined, rawText: string): NoSubstitutionTemplateLiteral;
3591 createYieldExpression(asteriskToken: AsteriskToken, expression: Expression): YieldExpression;
3592 createYieldExpression(asteriskToken: undefined, expression: Expression | undefined): YieldExpression;
3593 updateYieldExpression(node: YieldExpression, asteriskToken: AsteriskToken | undefined, expression: Expression | undefined): YieldExpression;
3594 createSpreadElement(expression: Expression): SpreadElement;
3595 updateSpreadElement(node: SpreadElement, expression: Expression): SpreadElement;
3596 createClassExpression(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassExpression;
3597 updateClassExpression(node: ClassExpression, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassExpression;
3598 createOmittedExpression(): OmittedExpression;
3599 createExpressionWithTypeArguments(expression: Expression, typeArguments: readonly TypeNode[] | undefined): ExpressionWithTypeArguments;
3600 updateExpressionWithTypeArguments(node: ExpressionWithTypeArguments, expression: Expression, typeArguments: readonly TypeNode[] | undefined): ExpressionWithTypeArguments;
3601 createAsExpression(expression: Expression, type: TypeNode): AsExpression;
3602 updateAsExpression(node: AsExpression, expression: Expression, type: TypeNode): AsExpression;
3603 createNonNullExpression(expression: Expression): NonNullExpression;
3604 updateNonNullExpression(node: NonNullExpression, expression: Expression): NonNullExpression;
3605 createNonNullChain(expression: Expression): NonNullChain;
3606 updateNonNullChain(node: NonNullChain, expression: Expression): NonNullChain;
3607 createMetaProperty(keywordToken: MetaProperty["keywordToken"], name: Identifier): MetaProperty;
3608 updateMetaProperty(node: MetaProperty, name: Identifier): MetaProperty;
3609 createSatisfiesExpression(expression: Expression, type: TypeNode): SatisfiesExpression;
3610 updateSatisfiesExpression(node: SatisfiesExpression, expression: Expression, type: TypeNode): SatisfiesExpression;
3611 createTemplateSpan(expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan;
3612 updateTemplateSpan(node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan;
3613 createSemicolonClassElement(): SemicolonClassElement;
3614 createBlock(statements: readonly Statement[], multiLine?: boolean): Block;
3615 updateBlock(node: Block, statements: readonly Statement[]): Block;
3616 createVariableStatement(modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList | readonly VariableDeclaration[]): VariableStatement;
3617 updateVariableStatement(node: VariableStatement, modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList): VariableStatement;
3618 createEmptyStatement(): EmptyStatement;
3619 createExpressionStatement(expression: Expression): ExpressionStatement;
3620 updateExpressionStatement(node: ExpressionStatement, expression: Expression): ExpressionStatement;
3621 createIfStatement(expression: Expression, thenStatement: Statement, elseStatement?: Statement): IfStatement;
3622 updateIfStatement(node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement | undefined): IfStatement;
3623 createDoStatement(statement: Statement, expression: Expression): DoStatement;
3624 updateDoStatement(node: DoStatement, statement: Statement, expression: Expression): DoStatement;
3625 createWhileStatement(expression: Expression, statement: Statement): WhileStatement;
3626 updateWhileStatement(node: WhileStatement, expression: Expression, statement: Statement): WhileStatement;
3627 createForStatement(initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement;
3628 updateForStatement(node: ForStatement, initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement;
3629 createForInStatement(initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement;
3630 updateForInStatement(node: ForInStatement, initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement;
3631 createForOfStatement(awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement;
3632 updateForOfStatement(node: ForOfStatement, awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement;
3633 createContinueStatement(label?: string | Identifier): ContinueStatement;
3634 updateContinueStatement(node: ContinueStatement, label: Identifier | undefined): ContinueStatement;
3635 createBreakStatement(label?: string | Identifier): BreakStatement;
3636 updateBreakStatement(node: BreakStatement, label: Identifier | undefined): BreakStatement;
3637 createReturnStatement(expression?: Expression): ReturnStatement;
3638 updateReturnStatement(node: ReturnStatement, expression: Expression | undefined): ReturnStatement;
3639 createWithStatement(expression: Expression, statement: Statement): WithStatement;
3640 updateWithStatement(node: WithStatement, expression: Expression, statement: Statement): WithStatement;
3641 createSwitchStatement(expression: Expression, caseBlock: CaseBlock): SwitchStatement;
3642 updateSwitchStatement(node: SwitchStatement, expression: Expression, caseBlock: CaseBlock): SwitchStatement;
3643 createLabeledStatement(label: string | Identifier, statement: Statement): LabeledStatement;
3644 updateLabeledStatement(node: LabeledStatement, label: Identifier, statement: Statement): LabeledStatement;
3645 createThrowStatement(expression: Expression): ThrowStatement;
3646 updateThrowStatement(node: ThrowStatement, expression: Expression): ThrowStatement;
3647 createTryStatement(tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement;
3648 updateTryStatement(node: TryStatement, tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement;
3649 createDebuggerStatement(): DebuggerStatement;
3650 createVariableDeclaration(name: string | BindingName, exclamationToken?: ExclamationToken, type?: TypeNode, initializer?: Expression): VariableDeclaration;
3651 updateVariableDeclaration(node: VariableDeclaration, name: BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration;
3652 createVariableDeclarationList(declarations: readonly VariableDeclaration[], flags?: NodeFlags): VariableDeclarationList;
3653 updateVariableDeclarationList(node: VariableDeclarationList, declarations: readonly VariableDeclaration[]): VariableDeclarationList;
3654 createFunctionDeclaration(modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration;
3655 updateFunctionDeclaration(node: FunctionDeclaration, modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration;
3656 createClassDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassDeclaration;
3657 updateClassDeclaration(node: ClassDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassDeclaration;
3658 createInterfaceDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
3659 updateInterfaceDeclaration(node: InterfaceDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
3660 createTypeAliasDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
3661 updateTypeAliasDeclaration(node: TypeAliasDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
3662 createEnumDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration;
3663 updateEnumDeclaration(node: EnumDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration;
3664 createModuleDeclaration(modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration;
3665 updateModuleDeclaration(node: ModuleDeclaration, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration;
3666 createModuleBlock(statements: readonly Statement[]): ModuleBlock;
3667 updateModuleBlock(node: ModuleBlock, statements: readonly Statement[]): ModuleBlock;
3668 createCaseBlock(clauses: readonly CaseOrDefaultClause[]): CaseBlock;
3669 updateCaseBlock(node: CaseBlock, clauses: readonly CaseOrDefaultClause[]): CaseBlock;
3670 createNamespaceExportDeclaration(name: string | Identifier): NamespaceExportDeclaration;
3671 updateNamespaceExportDeclaration(node: NamespaceExportDeclaration, name: Identifier): NamespaceExportDeclaration;
3672 createImportEqualsDeclaration(modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration;
3673 updateImportEqualsDeclaration(node: ImportEqualsDeclaration, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration;
3674 createImportDeclaration(modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause?: AssertClause): ImportDeclaration;
3675 updateImportDeclaration(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration;
3676 createImportClause(isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause;
3677 updateImportClause(node: ImportClause, isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause;
3678 createAssertClause(elements: NodeArray<AssertEntry>, multiLine?: boolean): AssertClause;
3679 updateAssertClause(node: AssertClause, elements: NodeArray<AssertEntry>, multiLine?: boolean): AssertClause;
3680 createAssertEntry(name: AssertionKey, value: Expression): AssertEntry;
3681 updateAssertEntry(node: AssertEntry, name: AssertionKey, value: Expression): AssertEntry;
3682 createImportTypeAssertionContainer(clause: AssertClause, multiLine?: boolean): ImportTypeAssertionContainer;
3683 updateImportTypeAssertionContainer(node: ImportTypeAssertionContainer, clause: AssertClause, multiLine?: boolean): ImportTypeAssertionContainer;
3684 createNamespaceImport(name: Identifier): NamespaceImport;
3685 updateNamespaceImport(node: NamespaceImport, name: Identifier): NamespaceImport;
3686 createNamespaceExport(name: Identifier): NamespaceExport;
3687 updateNamespaceExport(node: NamespaceExport, name: Identifier): NamespaceExport;
3688 createNamedImports(elements: readonly ImportSpecifier[]): NamedImports;
3689 updateNamedImports(node: NamedImports, elements: readonly ImportSpecifier[]): NamedImports;
3690 createImportSpecifier(isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier;
3691 updateImportSpecifier(node: ImportSpecifier, isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier;
3692 createExportAssignment(modifiers: readonly Modifier[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment;
3693 updateExportAssignment(node: ExportAssignment, modifiers: readonly Modifier[] | undefined, expression: Expression): ExportAssignment;
3694 createExportDeclaration(modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, assertClause?: AssertClause): ExportDeclaration;
3695 updateExportDeclaration(node: ExportDeclaration, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, assertClause: AssertClause | undefined): ExportDeclaration;
3696 createNamedExports(elements: readonly ExportSpecifier[]): NamedExports;
3697 updateNamedExports(node: NamedExports, elements: readonly ExportSpecifier[]): NamedExports;
3698 createExportSpecifier(isTypeOnly: boolean, propertyName: string | Identifier | undefined, name: string | Identifier): ExportSpecifier;
3699 updateExportSpecifier(node: ExportSpecifier, isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier): ExportSpecifier;
3700 createExternalModuleReference(expression: Expression): ExternalModuleReference;
3701 updateExternalModuleReference(node: ExternalModuleReference, expression: Expression): ExternalModuleReference;
3702 createJSDocAllType(): JSDocAllType;
3703 createJSDocUnknownType(): JSDocUnknownType;
3704 createJSDocNonNullableType(type: TypeNode, postfix?: boolean): JSDocNonNullableType;
3705 updateJSDocNonNullableType(node: JSDocNonNullableType, type: TypeNode): JSDocNonNullableType;
3706 createJSDocNullableType(type: TypeNode, postfix?: boolean): JSDocNullableType;
3707 updateJSDocNullableType(node: JSDocNullableType, type: TypeNode): JSDocNullableType;
3708 createJSDocOptionalType(type: TypeNode): JSDocOptionalType;
3709 updateJSDocOptionalType(node: JSDocOptionalType, type: TypeNode): JSDocOptionalType;
3710 createJSDocFunctionType(parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): JSDocFunctionType;
3711 updateJSDocFunctionType(node: JSDocFunctionType, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): JSDocFunctionType;
3712 createJSDocVariadicType(type: TypeNode): JSDocVariadicType;
3713 updateJSDocVariadicType(node: JSDocVariadicType, type: TypeNode): JSDocVariadicType;
3714 createJSDocNamepathType(type: TypeNode): JSDocNamepathType;
3715 updateJSDocNamepathType(node: JSDocNamepathType, type: TypeNode): JSDocNamepathType;
3716 createJSDocTypeExpression(type: TypeNode): JSDocTypeExpression;
3717 updateJSDocTypeExpression(node: JSDocTypeExpression, type: TypeNode): JSDocTypeExpression;
3718 createJSDocNameReference(name: EntityName | JSDocMemberName): JSDocNameReference;
3719 updateJSDocNameReference(node: JSDocNameReference, name: EntityName | JSDocMemberName): JSDocNameReference;
3720 createJSDocMemberName(left: EntityName | JSDocMemberName, right: Identifier): JSDocMemberName;
3721 updateJSDocMemberName(node: JSDocMemberName, left: EntityName | JSDocMemberName, right: Identifier): JSDocMemberName;
3722 createJSDocLink(name: EntityName | JSDocMemberName | undefined, text: string): JSDocLink;
3723 updateJSDocLink(node: JSDocLink, name: EntityName | JSDocMemberName | undefined, text: string): JSDocLink;
3724 createJSDocLinkCode(name: EntityName | JSDocMemberName | undefined, text: string): JSDocLinkCode;
3725 updateJSDocLinkCode(node: JSDocLinkCode, name: EntityName | JSDocMemberName | undefined, text: string): JSDocLinkCode;
3726 createJSDocLinkPlain(name: EntityName | JSDocMemberName | undefined, text: string): JSDocLinkPlain;
3727 updateJSDocLinkPlain(node: JSDocLinkPlain, name: EntityName | JSDocMemberName | undefined, text: string): JSDocLinkPlain;
3728 createJSDocTypeLiteral(jsDocPropertyTags?: readonly JSDocPropertyLikeTag[], isArrayType?: boolean): JSDocTypeLiteral;
3729 updateJSDocTypeLiteral(node: JSDocTypeLiteral, jsDocPropertyTags: readonly JSDocPropertyLikeTag[] | undefined, isArrayType: boolean | undefined): JSDocTypeLiteral;
3730 createJSDocSignature(typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type?: JSDocReturnTag): JSDocSignature;
3731 updateJSDocSignature(node: JSDocSignature, typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type: JSDocReturnTag | undefined): JSDocSignature;
3732 createJSDocTemplateTag(tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment?: string | NodeArray<JSDocComment>): JSDocTemplateTag;
3733 updateJSDocTemplateTag(node: JSDocTemplateTag, tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment: string | NodeArray<JSDocComment> | undefined): JSDocTemplateTag;
3734 createJSDocTypedefTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression | JSDocTypeLiteral, fullName?: Identifier | JSDocNamespaceDeclaration, comment?: string | NodeArray<JSDocComment>): JSDocTypedefTag;
3735 updateJSDocTypedefTag(node: JSDocTypedefTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | JSDocTypeLiteral | undefined, fullName: Identifier | JSDocNamespaceDeclaration | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocTypedefTag;
3736 createJSDocParameterTag(tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression, isNameFirst?: boolean, comment?: string | NodeArray<JSDocComment>): JSDocParameterTag;
3737 updateJSDocParameterTag(node: JSDocParameterTag, tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression: JSDocTypeExpression | undefined, isNameFirst: boolean, comment: string | NodeArray<JSDocComment> | undefined): JSDocParameterTag;
3738 createJSDocPropertyTag(tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression, isNameFirst?: boolean, comment?: string | NodeArray<JSDocComment>): JSDocPropertyTag;
3739 updateJSDocPropertyTag(node: JSDocPropertyTag, tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression: JSDocTypeExpression | undefined, isNameFirst: boolean, comment: string | NodeArray<JSDocComment> | undefined): JSDocPropertyTag;
3740 createJSDocTypeTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment>): JSDocTypeTag;
3741 updateJSDocTypeTag(node: JSDocTypeTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | NodeArray<JSDocComment> | undefined): JSDocTypeTag;
3742 createJSDocSeeTag(tagName: Identifier | undefined, nameExpression: JSDocNameReference | undefined, comment?: string | NodeArray<JSDocComment>): JSDocSeeTag;
3743 updateJSDocSeeTag(node: JSDocSeeTag, tagName: Identifier | undefined, nameExpression: JSDocNameReference | undefined, comment?: string | NodeArray<JSDocComment>): JSDocSeeTag;
3744 createJSDocReturnTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment>): JSDocReturnTag;
3745 updateJSDocReturnTag(node: JSDocReturnTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocReturnTag;
3746 createJSDocThisTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment>): JSDocThisTag;
3747 updateJSDocThisTag(node: JSDocThisTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocThisTag;
3748 createJSDocEnumTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment>): JSDocEnumTag;
3749 updateJSDocEnumTag(node: JSDocEnumTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | NodeArray<JSDocComment> | undefined): JSDocEnumTag;
3750 createJSDocCallbackTag(tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName?: Identifier | JSDocNamespaceDeclaration, comment?: string | NodeArray<JSDocComment>): JSDocCallbackTag;
3751 updateJSDocCallbackTag(node: JSDocCallbackTag, tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName: Identifier | JSDocNamespaceDeclaration | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocCallbackTag;
3752 createJSDocAugmentsTag(tagName: Identifier | undefined, className: JSDocAugmentsTag["class"], comment?: string | NodeArray<JSDocComment>): JSDocAugmentsTag;
3753 updateJSDocAugmentsTag(node: JSDocAugmentsTag, tagName: Identifier | undefined, className: JSDocAugmentsTag["class"], comment: string | NodeArray<JSDocComment> | undefined): JSDocAugmentsTag;
3754 createJSDocImplementsTag(tagName: Identifier | undefined, className: JSDocImplementsTag["class"], comment?: string | NodeArray<JSDocComment>): JSDocImplementsTag;
3755 updateJSDocImplementsTag(node: JSDocImplementsTag, tagName: Identifier | undefined, className: JSDocImplementsTag["class"], comment: string | NodeArray<JSDocComment> | undefined): JSDocImplementsTag;
3756 createJSDocAuthorTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocAuthorTag;
3757 updateJSDocAuthorTag(node: JSDocAuthorTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocAuthorTag;
3758 createJSDocClassTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocClassTag;
3759 updateJSDocClassTag(node: JSDocClassTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocClassTag;
3760 createJSDocPublicTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocPublicTag;
3761 updateJSDocPublicTag(node: JSDocPublicTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocPublicTag;
3762 createJSDocPrivateTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocPrivateTag;
3763 updateJSDocPrivateTag(node: JSDocPrivateTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocPrivateTag;
3764 createJSDocProtectedTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocProtectedTag;
3765 updateJSDocProtectedTag(node: JSDocProtectedTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocProtectedTag;
3766 createJSDocReadonlyTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocReadonlyTag;
3767 updateJSDocReadonlyTag(node: JSDocReadonlyTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocReadonlyTag;
3768 createJSDocUnknownTag(tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocUnknownTag;
3769 updateJSDocUnknownTag(node: JSDocUnknownTag, tagName: Identifier, comment: string | NodeArray<JSDocComment> | undefined): JSDocUnknownTag;
3770 createJSDocDeprecatedTag(tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag;
3771 updateJSDocDeprecatedTag(node: JSDocDeprecatedTag, tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag;
3772 createJSDocOverrideTag(tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag;
3773 updateJSDocOverrideTag(node: JSDocOverrideTag, tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag;
3774 createJSDocText(text: string): JSDocText;
3775 updateJSDocText(node: JSDocText, text: string): JSDocText;
3776 createJSDocComment(comment?: string | NodeArray<JSDocComment> | undefined, tags?: readonly JSDocTag[] | undefined): JSDoc;
3777 updateJSDocComment(node: JSDoc, comment: string | NodeArray<JSDocComment> | undefined, tags: readonly JSDocTag[] | undefined): JSDoc;
3778 createJsxElement(openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement): JsxElement;
3779 updateJsxElement(node: JsxElement, openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement): JsxElement;
3780 createJsxSelfClosingElement(tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxSelfClosingElement;
3781 updateJsxSelfClosingElement(node: JsxSelfClosingElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxSelfClosingElement;
3782 createJsxOpeningElement(tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxOpeningElement;
3783 updateJsxOpeningElement(node: JsxOpeningElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxOpeningElement;
3784 createJsxClosingElement(tagName: JsxTagNameExpression): JsxClosingElement;
3785 updateJsxClosingElement(node: JsxClosingElement, tagName: JsxTagNameExpression): JsxClosingElement;
3786 createJsxFragment(openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment): JsxFragment;
3787 createJsxText(text: string, containsOnlyTriviaWhiteSpaces?: boolean): JsxText;
3788 updateJsxText(node: JsxText, text: string, containsOnlyTriviaWhiteSpaces?: boolean): JsxText;
3789 createJsxOpeningFragment(): JsxOpeningFragment;
3790 createJsxJsxClosingFragment(): JsxClosingFragment;
3791 updateJsxFragment(node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment): JsxFragment;
3792 createJsxAttribute(name: Identifier, initializer: JsxAttributeValue | undefined): JsxAttribute;
3793 updateJsxAttribute(node: JsxAttribute, name: Identifier, initializer: JsxAttributeValue | undefined): JsxAttribute;
3794 createJsxAttributes(properties: readonly JsxAttributeLike[]): JsxAttributes;
3795 updateJsxAttributes(node: JsxAttributes, properties: readonly JsxAttributeLike[]): JsxAttributes;
3796 createJsxSpreadAttribute(expression: Expression): JsxSpreadAttribute;
3797 updateJsxSpreadAttribute(node: JsxSpreadAttribute, expression: Expression): JsxSpreadAttribute;
3798 createJsxExpression(dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined): JsxExpression;
3799 updateJsxExpression(node: JsxExpression, expression: Expression | undefined): JsxExpression;
3800 createCaseClause(expression: Expression, statements: readonly Statement[]): CaseClause;
3801 updateCaseClause(node: CaseClause, expression: Expression, statements: readonly Statement[]): CaseClause;
3802 createDefaultClause(statements: readonly Statement[]): DefaultClause;
3803 updateDefaultClause(node: DefaultClause, statements: readonly Statement[]): DefaultClause;
3804 createHeritageClause(token: HeritageClause["token"], types: readonly ExpressionWithTypeArguments[]): HeritageClause;
3805 updateHeritageClause(node: HeritageClause, types: readonly ExpressionWithTypeArguments[]): HeritageClause;
3806 createCatchClause(variableDeclaration: string | BindingName | VariableDeclaration | undefined, block: Block): CatchClause;
3807 updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration | undefined, block: Block): CatchClause;
3808 createPropertyAssignment(name: string | PropertyName, initializer: Expression): PropertyAssignment;
3809 updatePropertyAssignment(node: PropertyAssignment, name: PropertyName, initializer: Expression): PropertyAssignment;
3810 createShorthandPropertyAssignment(name: string | Identifier, objectAssignmentInitializer?: Expression): ShorthandPropertyAssignment;
3811 updateShorthandPropertyAssignment(node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression | undefined): ShorthandPropertyAssignment;
3812 createSpreadAssignment(expression: Expression): SpreadAssignment;
3813 updateSpreadAssignment(node: SpreadAssignment, expression: Expression): SpreadAssignment;
3814 createEnumMember(name: string | PropertyName, initializer?: Expression): EnumMember;
3815 updateEnumMember(node: EnumMember, name: PropertyName, initializer: Expression | undefined): EnumMember;
3816 createSourceFile(statements: readonly Statement[], endOfFileToken: EndOfFileToken, flags: NodeFlags): SourceFile;
3817 updateSourceFile(node: SourceFile, statements: readonly Statement[], isDeclarationFile?: boolean, referencedFiles?: readonly FileReference[], typeReferences?: readonly FileReference[], hasNoDefaultLib?: boolean, libReferences?: readonly FileReference[]): SourceFile;
3818 createNotEmittedStatement(original: Node): NotEmittedStatement;
3819 createPartiallyEmittedExpression(expression: Expression, original?: Node): PartiallyEmittedExpression;
3820 updatePartiallyEmittedExpression(node: PartiallyEmittedExpression, expression: Expression): PartiallyEmittedExpression;
3821 createCommaListExpression(elements: readonly Expression[]): CommaListExpression;
3822 updateCommaListExpression(node: CommaListExpression, elements: readonly Expression[]): CommaListExpression;
3823 createBundle(sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle;
3824 updateBundle(node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle;
3825 createComma(left: Expression, right: Expression): BinaryExpression;
3826 createAssignment(left: ObjectLiteralExpression | ArrayLiteralExpression, right: Expression): DestructuringAssignment;
3827 createAssignment(left: Expression, right: Expression): AssignmentExpression<EqualsToken>;
3828 createLogicalOr(left: Expression, right: Expression): BinaryExpression;
3829 createLogicalAnd(left: Expression, right: Expression): BinaryExpression;
3830 createBitwiseOr(left: Expression, right: Expression): BinaryExpression;
3831 createBitwiseXor(left: Expression, right: Expression): BinaryExpression;
3832 createBitwiseAnd(left: Expression, right: Expression): BinaryExpression;
3833 createStrictEquality(left: Expression, right: Expression): BinaryExpression;
3834 createStrictInequality(left: Expression, right: Expression): BinaryExpression;
3835 createEquality(left: Expression, right: Expression): BinaryExpression;
3836 createInequality(left: Expression, right: Expression): BinaryExpression;
3837 createLessThan(left: Expression, right: Expression): BinaryExpression;
3838 createLessThanEquals(left: Expression, right: Expression): BinaryExpression;
3839 createGreaterThan(left: Expression, right: Expression): BinaryExpression;
3840 createGreaterThanEquals(left: Expression, right: Expression): BinaryExpression;
3841 createLeftShift(left: Expression, right: Expression): BinaryExpression;
3842 createRightShift(left: Expression, right: Expression): BinaryExpression;
3843 createUnsignedRightShift(left: Expression, right: Expression): BinaryExpression;
3844 createAdd(left: Expression, right: Expression): BinaryExpression;
3845 createSubtract(left: Expression, right: Expression): BinaryExpression;
3846 createMultiply(left: Expression, right: Expression): BinaryExpression;
3847 createDivide(left: Expression, right: Expression): BinaryExpression;
3848 createModulo(left: Expression, right: Expression): BinaryExpression;
3849 createExponent(left: Expression, right: Expression): BinaryExpression;
3850 createPrefixPlus(operand: Expression): PrefixUnaryExpression;
3851 createPrefixMinus(operand: Expression): PrefixUnaryExpression;
3852 createPrefixIncrement(operand: Expression): PrefixUnaryExpression;
3853 createPrefixDecrement(operand: Expression): PrefixUnaryExpression;
3854 createBitwiseNot(operand: Expression): PrefixUnaryExpression;
3855 createLogicalNot(operand: Expression): PrefixUnaryExpression;
3856 createPostfixIncrement(operand: Expression): PostfixUnaryExpression;
3857 createPostfixDecrement(operand: Expression): PostfixUnaryExpression;
3858 createImmediatelyInvokedFunctionExpression(statements: readonly Statement[]): CallExpression;
3859 createImmediatelyInvokedFunctionExpression(statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression;
3860 createImmediatelyInvokedArrowFunction(statements: readonly Statement[]): CallExpression;
3861 createImmediatelyInvokedArrowFunction(statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression;
3862 createVoidZero(): VoidExpression;
3863 createExportDefault(expression: Expression): ExportAssignment;
3864 createExternalModuleExport(exportName: Identifier): ExportDeclaration;
3865 restoreOuterExpressions(outerExpression: Expression | undefined, innerExpression: Expression, kinds?: OuterExpressionKinds): Expression;
3866 }
3867 export interface CoreTransformationContext {
3868 readonly factory: NodeFactory;
3869 /** Gets the compiler options supplied to the transformer. */
3870 getCompilerOptions(): CompilerOptions;
3871 /** Starts a new lexical environment. */
3872 startLexicalEnvironment(): void;
3873 /** Suspends the current lexical environment, usually after visiting a parameter list. */
3874 suspendLexicalEnvironment(): void;
3875 /** Resumes a suspended lexical environment, usually before visiting a function body. */
3876 resumeLexicalEnvironment(): void;
3877 /** Ends a lexical environment, returning any declarations. */
3878 endLexicalEnvironment(): Statement[] | undefined;
3879 /** Hoists a function declaration to the containing scope. */
3880 hoistFunctionDeclaration(node: FunctionDeclaration): void;
3881 /** Hoists a variable declaration to the containing scope. */
3882 hoistVariableDeclaration(node: Identifier): void;
3883 }
3884 export interface TransformationContext extends CoreTransformationContext {
3885 /** Records a request for a non-scoped emit helper in the current context. */
3886 requestEmitHelper(helper: EmitHelper): void;
3887 /** Gets and resets the requested non-scoped emit helpers. */
3888 readEmitHelpers(): EmitHelper[] | undefined;
3889 /** Enables expression substitutions in the pretty printer for the provided SyntaxKind. */
3890 enableSubstitution(kind: SyntaxKind): void;
3891 /** Determines whether expression substitutions are enabled for the provided node. */
3892 isSubstitutionEnabled(node: Node): boolean;
3893 /**
3894 * Hook used by transformers to substitute expressions just before they
3895 * are emitted by the pretty printer.
3896 *
3897 * NOTE: Transformation hooks should only be modified during `Transformer` initialization,
3898 * before returning the `NodeTransformer` callback.
3899 */
3900 onSubstituteNode: (hint: EmitHint, node: Node) => Node;
3901 /**
3902 * Enables before/after emit notifications in the pretty printer for the provided
3903 * SyntaxKind.
3904 */
3905 enableEmitNotification(kind: SyntaxKind): void;
3906 /**
3907 * Determines whether before/after emit notifications should be raised in the pretty
3908 * printer when it emits a node.
3909 */
3910 isEmitNotificationEnabled(node: Node): boolean;
3911 /**
3912 * Hook used to allow transformers to capture state before or after
3913 * the printer emits a node.
3914 *
3915 * NOTE: Transformation hooks should only be modified during `Transformer` initialization,
3916 * before returning the `NodeTransformer` callback.
3917 */
3918 onEmitNode: (hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void) => void;
3919 }
3920 export interface TransformationResult<T extends Node> {
3921 /** Gets the transformed source files. */
3922 transformed: T[];
3923 /** Gets diagnostics for the transformation. */
3924 diagnostics?: DiagnosticWithLocation[];
3925 /**
3926 * Gets a substitute for a node, if one is available; otherwise, returns the original node.
3927 *
3928 * @param hint A hint as to the intended usage of the node.
3929 * @param node The node to substitute.
3930 */
3931 substituteNode(hint: EmitHint, node: Node): Node;
3932 /**
3933 * Emits a node with possible notification.
3934 *
3935 * @param hint A hint as to the intended usage of the node.
3936 * @param node The node to emit.
3937 * @param emitCallback A callback used to emit the node.
3938 */
3939 emitNodeWithNotification(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void;
3940 /**
3941 * Indicates if a given node needs an emit notification
3942 *
3943 * @param node The node to emit.
3944 */
3945 isEmitNotificationEnabled?(node: Node): boolean;
3946 /**
3947 * Clean up EmitNode entries on any parse-tree nodes.
3948 */
3949 dispose(): void;
3950 }
3951 /**
3952 * A function that is used to initialize and return a `Transformer` callback, which in turn
3953 * will be used to transform one or more nodes.
3954 */
3955 export type TransformerFactory<T extends Node> = (context: TransformationContext) => Transformer<T>;
3956 /**
3957 * A function that transforms a node.
3958 */
3959 export type Transformer<T extends Node> = (node: T) => T;
3960 /**
3961 * A function that accepts and possibly transforms a node.
3962 */
3963 export type Visitor = (node: Node) => VisitResult<Node>;
3964 export interface NodeVisitor {
3965 <T extends Node>(nodes: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T;
3966 <T extends Node>(nodes: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T | undefined;
3967 }
3968 export interface NodesVisitor {
3969 <T extends Node>(nodes: NodeArray<T>, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T>;
3970 <T extends Node>(nodes: NodeArray<T> | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T> | undefined;
3971 }
3972 export type VisitResult<T extends Node> = T | readonly T[] | undefined;
3973 export interface Printer {
3974 /**
3975 * Print a node and its subtree as-is, without any emit transformations.
3976 * @param hint A value indicating the purpose of a node. This is primarily used to
3977 * distinguish between an `Identifier` used in an expression position, versus an
3978 * `Identifier` used as an `IdentifierName` as part of a declaration. For most nodes you
3979 * should just pass `Unspecified`.
3980 * @param node The node to print. The node and its subtree are printed as-is, without any
3981 * emit transformations.
3982 * @param sourceFile A source file that provides context for the node. The source text of
3983 * the file is used to emit the original source content for literals and identifiers, while
3984 * the identifiers of the source file are used when generating unique names to avoid
3985 * collisions.
3986 */
3987 printNode(hint: EmitHint, node: Node, sourceFile: SourceFile): string;
3988 /**
3989 * Prints a list of nodes using the given format flags
3990 */
3991 printList<T extends Node>(format: ListFormat, list: NodeArray<T>, sourceFile: SourceFile): string;
3992 /**
3993 * Prints a source file as-is, without any emit transformations.
3994 */
3995 printFile(sourceFile: SourceFile): string;
3996 /**
3997 * Prints a bundle of source files as-is, without any emit transformations.
3998 */
3999 printBundle(bundle: Bundle): string;
4000 }
4001 export interface PrintHandlers {
4002 /**
4003 * A hook used by the Printer when generating unique names to avoid collisions with
4004 * globally defined names that exist outside of the current source file.
4005 */
4006 hasGlobalName?(name: string): boolean;
4007 /**
4008 * A hook used by the Printer to provide notifications prior to emitting a node. A
4009 * compatible implementation **must** invoke `emitCallback` with the provided `hint` and
4010 * `node` values.
4011 * @param hint A hint indicating the intended purpose of the node.
4012 * @param node The node to emit.
4013 * @param emitCallback A callback that, when invoked, will emit the node.
4014 * @example
4015 * ```ts
4016 * var printer = createPrinter(printerOptions, {
4017 * onEmitNode(hint, node, emitCallback) {
4018 * // set up or track state prior to emitting the node...
4019 * emitCallback(hint, node);
4020 * // restore state after emitting the node...
4021 * }
4022 * });
4023 * ```
4024 */
4025 onEmitNode?(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void;
4026 /**
4027 * A hook used to check if an emit notification is required for a node.
4028 * @param node The node to emit.
4029 */
4030 isEmitNotificationEnabled?(node: Node): boolean;
4031 /**
4032 * A hook used by the Printer to perform just-in-time substitution of a node. This is
4033 * primarily used by node transformations that need to substitute one node for another,
4034 * such as replacing `myExportedVar` with `exports.myExportedVar`.
4035 * @param hint A hint indicating the intended purpose of the node.
4036 * @param node The node to emit.
4037 * @example
4038 * ```ts
4039 * var printer = createPrinter(printerOptions, {
4040 * substituteNode(hint, node) {
4041 * // perform substitution if necessary...
4042 * return node;
4043 * }
4044 * });
4045 * ```
4046 */
4047 substituteNode?(hint: EmitHint, node: Node): Node;
4048 }
4049 export interface PrinterOptions {
4050 removeComments?: boolean;
4051 newLine?: NewLineKind;
4052 omitTrailingSemicolon?: boolean;
4053 noEmitHelpers?: boolean;
4054 }
4055 export interface GetEffectiveTypeRootsHost {
4056 directoryExists?(directoryName: string): boolean;
4057 getCurrentDirectory?(): string;
4058 }
4059 export interface TextSpan {
4060 start: number;
4061 length: number;
4062 }
4063 export interface TextChangeRange {
4064 span: TextSpan;
4065 newLength: number;
4066 }
4067 export interface SyntaxList extends Node {
4068 kind: SyntaxKind.SyntaxList;
4069 _children: Node[];
4070 }
4071 export enum ListFormat {
4072 None = 0,
4073 SingleLine = 0,
4074 MultiLine = 1,
4075 PreserveLines = 2,
4076 LinesMask = 3,
4077 NotDelimited = 0,
4078 BarDelimited = 4,
4079 AmpersandDelimited = 8,
4080 CommaDelimited = 16,
4081 AsteriskDelimited = 32,
4082 DelimitersMask = 60,
4083 AllowTrailingComma = 64,
4084 Indented = 128,
4085 SpaceBetweenBraces = 256,
4086 SpaceBetweenSiblings = 512,
4087 Braces = 1024,
4088 Parenthesis = 2048,
4089 AngleBrackets = 4096,
4090 SquareBrackets = 8192,
4091 BracketsMask = 15360,
4092 OptionalIfUndefined = 16384,
4093 OptionalIfEmpty = 32768,
4094 Optional = 49152,
4095 PreferNewLine = 65536,
4096 NoTrailingNewLine = 131072,
4097 NoInterveningComments = 262144,
4098 NoSpaceIfEmpty = 524288,
4099 SingleElement = 1048576,
4100 SpaceAfterList = 2097152,
4101 Modifiers = 2359808,
4102 HeritageClauses = 512,
4103 SingleLineTypeLiteralMembers = 768,
4104 MultiLineTypeLiteralMembers = 32897,
4105 SingleLineTupleTypeElements = 528,
4106 MultiLineTupleTypeElements = 657,
4107 UnionTypeConstituents = 516,
4108 IntersectionTypeConstituents = 520,
4109 ObjectBindingPatternElements = 525136,
4110 ArrayBindingPatternElements = 524880,
4111 ObjectLiteralExpressionProperties = 526226,
4112 ImportClauseEntries = 526226,
4113 ArrayLiteralExpressionElements = 8914,
4114 CommaListElements = 528,
4115 CallExpressionArguments = 2576,
4116 NewExpressionArguments = 18960,
4117 TemplateExpressionSpans = 262144,
4118 SingleLineBlockStatements = 768,
4119 MultiLineBlockStatements = 129,
4120 VariableDeclarationList = 528,
4121 SingleLineFunctionBodyStatements = 768,
4122 MultiLineFunctionBodyStatements = 1,
4123 ClassHeritageClauses = 0,
4124 ClassMembers = 129,
4125 InterfaceMembers = 129,
4126 EnumMembers = 145,
4127 CaseBlockClauses = 129,
4128 NamedImportsOrExportsElements = 525136,
4129 JsxElementOrFragmentChildren = 262144,
4130 JsxElementAttributes = 262656,
4131 CaseOrDefaultClauseStatements = 163969,
4132 HeritageClauseTypes = 528,
4133 SourceFileStatements = 131073,
4134 Decorators = 2146305,
4135 TypeArguments = 53776,
4136 TypeParameters = 53776,
4137 Parameters = 2576,
4138 IndexSignatureParameters = 8848,
4139 JSDocComment = 33
4140 }
4141 export interface UserPreferences {
4142 readonly disableSuggestions?: boolean;
4143 readonly quotePreference?: "auto" | "double" | "single";
4144 readonly includeCompletionsForModuleExports?: boolean;
4145 readonly includeCompletionsForImportStatements?: boolean;
4146 readonly includeCompletionsWithSnippetText?: boolean;
4147 readonly includeAutomaticOptionalChainCompletions?: boolean;
4148 readonly includeCompletionsWithInsertText?: boolean;
4149 readonly includeCompletionsWithClassMemberSnippets?: boolean;
4150 readonly includeCompletionsWithObjectLiteralMethodSnippets?: boolean;
4151 readonly useLabelDetailsInCompletionEntries?: boolean;
4152 readonly allowIncompleteCompletions?: boolean;
4153 readonly importModuleSpecifierPreference?: "shortest" | "project-relative" | "relative" | "non-relative";
4154 /** Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js" */
4155 readonly importModuleSpecifierEnding?: "auto" | "minimal" | "index" | "js";
4156 readonly allowTextChangesInNewFiles?: boolean;
4157 readonly providePrefixAndSuffixTextForRename?: boolean;
4158 readonly includePackageJsonAutoImports?: "auto" | "on" | "off";
4159 readonly provideRefactorNotApplicableReason?: boolean;
4160 readonly jsxAttributeCompletionStyle?: "auto" | "braces" | "none";
4161 readonly includeInlayParameterNameHints?: "none" | "literals" | "all";
4162 readonly includeInlayParameterNameHintsWhenArgumentMatchesName?: boolean;
4163 readonly includeInlayFunctionParameterTypeHints?: boolean;
4164 readonly includeInlayVariableTypeHints?: boolean;
4165 readonly includeInlayVariableTypeHintsWhenTypeMatchesName?: boolean;
4166 readonly includeInlayPropertyDeclarationTypeHints?: boolean;
4167 readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
4168 readonly includeInlayEnumMemberValueHints?: boolean;
4169 readonly allowRenameOfImportPath?: boolean;
4170 readonly autoImportFileExcludePatterns?: string[];
4171 }
4172 /** Represents a bigint literal value without requiring bigint support */
4173 export interface PseudoBigInt {
4174 negative: boolean;
4175 base10Value: string;
4176 }
4177 export {};
4178}
4179declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any;
4180declare function clearTimeout(handle: any): void;
4181declare namespace ts {
4182 export enum FileWatcherEventKind {
4183 Created = 0,
4184 Changed = 1,
4185 Deleted = 2
4186 }
4187 export type FileWatcherCallback = (fileName: string, eventKind: FileWatcherEventKind, modifiedTime?: Date) => void;
4188 export type DirectoryWatcherCallback = (fileName: string) => void;
4189 export interface System {
4190 args: string[];
4191 newLine: string;
4192 useCaseSensitiveFileNames: boolean;
4193 write(s: string): void;
4194 writeOutputIsTTY?(): boolean;
4195 getWidthOfTerminal?(): number;
4196 readFile(path: string, encoding?: string): string | undefined;
4197 getFileSize?(path: string): number;
4198 writeFile(path: string, data: string, writeByteOrderMark?: boolean): void;
4199 /**
4200 * @pollingInterval - this parameter is used in polling-based watchers and ignored in watchers that
4201 * use native OS file watching
4202 */
4203 watchFile?(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: WatchOptions): FileWatcher;
4204 watchDirectory?(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: WatchOptions): FileWatcher;
4205 resolvePath(path: string): string;
4206 fileExists(path: string): boolean;
4207 directoryExists(path: string): boolean;
4208 createDirectory(path: string): void;
4209 getExecutingFilePath(): string;
4210 getCurrentDirectory(): string;
4211 getDirectories(path: string): string[];
4212 readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
4213 getModifiedTime?(path: string): Date | undefined;
4214 setModifiedTime?(path: string, time: Date): void;
4215 deleteFile?(path: string): void;
4216 /**
4217 * A good implementation is node.js' `crypto.createHash`. (https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm)
4218 */
4219 createHash?(data: string): string;
4220 /** This must be cryptographically secure. Only implement this method using `crypto.createHash("sha256")`. */
4221 createSHA256Hash?(data: string): string;
4222 getMemoryUsage?(): number;
4223 exit(exitCode?: number): void;
4224 realpath?(path: string): string;
4225 setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
4226 clearTimeout?(timeoutId: any): void;
4227 clearScreen?(): void;
4228 base64decode?(input: string): string;
4229 base64encode?(input: string): string;
4230 }
4231 export interface FileWatcher {
4232 close(): void;
4233 }
4234 export function getNodeMajorVersion(): number | undefined;
4235 export let sys: System;
4236 export {};
4237}
4238declare namespace ts {
4239 type ErrorCallback = (message: DiagnosticMessage, length: number) => void;
4240 interface Scanner {
4241 getStartPos(): number;
4242 getToken(): SyntaxKind;
4243 getTextPos(): number;
4244 getTokenPos(): number;
4245 getTokenText(): string;
4246 getTokenValue(): string;
4247 hasUnicodeEscape(): boolean;
4248 hasExtendedUnicodeEscape(): boolean;
4249 hasPrecedingLineBreak(): boolean;
4250 isIdentifier(): boolean;
4251 isReservedWord(): boolean;
4252 isUnterminated(): boolean;
4253 reScanGreaterToken(): SyntaxKind;
4254 reScanSlashToken(): SyntaxKind;
4255 reScanAsteriskEqualsToken(): SyntaxKind;
4256 reScanTemplateToken(isTaggedTemplate: boolean): SyntaxKind;
4257 reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind;
4258 scanJsxIdentifier(): SyntaxKind;
4259 scanJsxAttributeValue(): SyntaxKind;
4260 reScanJsxAttributeValue(): SyntaxKind;
4261 reScanJsxToken(allowMultilineJsxText?: boolean): JsxTokenSyntaxKind;
4262 reScanLessThanToken(): SyntaxKind;
4263 reScanHashToken(): SyntaxKind;
4264 reScanQuestionToken(): SyntaxKind;
4265 reScanInvalidIdentifier(): SyntaxKind;
4266 scanJsxToken(): JsxTokenSyntaxKind;
4267 scanJsDocToken(): JSDocSyntaxKind;
4268 scan(): SyntaxKind;
4269 getText(): string;
4270 setText(text: string | undefined, start?: number, length?: number): void;
4271 setOnError(onError: ErrorCallback | undefined): void;
4272 setScriptTarget(scriptTarget: ScriptTarget): void;
4273 setLanguageVariant(variant: LanguageVariant): void;
4274 setTextPos(textPos: number): void;
4275 lookAhead<T>(callback: () => T): T;
4276 scanRange<T>(start: number, length: number, callback: () => T): T;
4277 tryScan<T>(callback: () => T): T;
4278 }
4279 function tokenToString(t: SyntaxKind): string | undefined;
4280 function getPositionOfLineAndCharacter(sourceFile: SourceFileLike, line: number, character: number): number;
4281 function getLineAndCharacterOfPosition(sourceFile: SourceFileLike, position: number): LineAndCharacter;
4282 function isWhiteSpaceLike(ch: number): boolean;
4283 /** Does not include line breaks. For that, see isWhiteSpaceLike. */
4284 function isWhiteSpaceSingleLine(ch: number): boolean;
4285 function isLineBreak(ch: number): boolean;
4286 function couldStartTrivia(text: string, pos: number): boolean;
4287 function forEachLeadingCommentRange<U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined;
4288 function forEachLeadingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined;
4289 function forEachTrailingCommentRange<U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined;
4290 function forEachTrailingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined;
4291 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;
4292 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;
4293 function getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined;
4294 function getTrailingCommentRanges(text: string, pos: number): CommentRange[] | undefined;
4295 /** Optionally, get the shebang */
4296 function getShebang(text: string): string | undefined;
4297 function isIdentifierStart(ch: number, languageVersion: ScriptTarget | undefined): boolean;
4298 function isIdentifierPart(ch: number, languageVersion: ScriptTarget | undefined, identifierVariant?: LanguageVariant): boolean;
4299 function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, textInitial?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner;
4300}
4301declare namespace ts {
4302 function isExternalModuleNameRelative(moduleName: string): boolean;
4303 function sortAndDeduplicateDiagnostics<T extends Diagnostic>(diagnostics: readonly T[]): SortedReadonlyArray<T>;
4304 function getDefaultLibFileName(options: CompilerOptions): string;
4305 function textSpanEnd(span: TextSpan): number;
4306 function textSpanIsEmpty(span: TextSpan): boolean;
4307 function textSpanContainsPosition(span: TextSpan, position: number): boolean;
4308 function textSpanContainsTextSpan(span: TextSpan, other: TextSpan): boolean;
4309 function textSpanOverlapsWith(span: TextSpan, other: TextSpan): boolean;
4310 function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan | undefined;
4311 function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan): boolean;
4312 function textSpanIntersectsWith(span: TextSpan, start: number, length: number): boolean;
4313 function decodedTextSpanIntersectsWith(start1: number, length1: number, start2: number, length2: number): boolean;
4314 function textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean;
4315 function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan | undefined;
4316 function createTextSpan(start: number, length: number): TextSpan;
4317 function createTextSpanFromBounds(start: number, end: number): TextSpan;
4318 function textChangeRangeNewSpan(range: TextChangeRange): TextSpan;
4319 function textChangeRangeIsUnchanged(range: TextChangeRange): boolean;
4320 function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange;
4321 let unchangedTextChangeRange: TextChangeRange;
4322 /**
4323 * Called to merge all the changes that occurred across several versions of a script snapshot
4324 * into a single change. i.e. if a user keeps making successive edits to a script we will
4325 * have a text change from V1 to V2, V2 to V3, ..., Vn.
4326 *
4327 * This function will then merge those changes into a single change range valid between V1 and
4328 * Vn.
4329 */
4330 function collapseTextChangeRangesAcrossMultipleVersions(changes: readonly TextChangeRange[]): TextChangeRange;
4331 function getTypeParameterOwner(d: Declaration): Declaration | undefined;
4332 type ParameterPropertyDeclaration = ParameterDeclaration & {
4333 parent: ConstructorDeclaration;
4334 name: Identifier;
4335 };
4336 function isParameterPropertyDeclaration(node: Node, parent: Node): node is ParameterPropertyDeclaration;
4337 function isEmptyBindingPattern(node: BindingName): node is BindingPattern;
4338 function isEmptyBindingElement(node: BindingElement): boolean;
4339 function walkUpBindingElementsAndPatterns(binding: BindingElement): VariableDeclaration | ParameterDeclaration;
4340 function getCombinedModifierFlags(node: Declaration): ModifierFlags;
4341 function getCombinedNodeFlags(node: Node): NodeFlags;
4342 /**
4343 * Checks to see if the locale is in the appropriate format,
4344 * and if it is, attempts to set the appropriate language.
4345 */
4346 function validateLocaleAndSetLanguage(locale: string, sys: {
4347 getExecutingFilePath(): string;
4348 resolvePath(path: string): string;
4349 fileExists(fileName: string): boolean;
4350 readFile(fileName: string): string | undefined;
4351 }, errors?: Push<Diagnostic>): void;
4352 function getOriginalNode(node: Node): Node;
4353 function getOriginalNode<T extends Node>(node: Node, nodeTest: (node: Node) => node is T): T;
4354 function getOriginalNode(node: Node | undefined): Node | undefined;
4355 function getOriginalNode<T extends Node>(node: Node | undefined, nodeTest: (node: Node | undefined) => node is T): T | undefined;
4356 /**
4357 * Iterates through the parent chain of a node and performs the callback on each parent until the callback
4358 * returns a truthy value, then returns that value.
4359 * If no such value is found, it applies the callback until the parent pointer is undefined or the callback returns "quit"
4360 * At that point findAncestor returns undefined.
4361 */
4362 function findAncestor<T extends Node>(node: Node | undefined, callback: (element: Node) => element is T): T | undefined;
4363 function findAncestor(node: Node | undefined, callback: (element: Node) => boolean | "quit"): Node | undefined;
4364 /**
4365 * Gets a value indicating whether a node originated in the parse tree.
4366 *
4367 * @param node The node to test.
4368 */
4369 function isParseTreeNode(node: Node): boolean;
4370 /**
4371 * Gets the original parse tree node for a node.
4372 *
4373 * @param node The original node.
4374 * @returns The original parse tree node if found; otherwise, undefined.
4375 */
4376 function getParseTreeNode(node: Node | undefined): Node | undefined;
4377 /**
4378 * Gets the original parse tree node for a node.
4379 *
4380 * @param node The original node.
4381 * @param nodeTest A callback used to ensure the correct type of parse tree node is returned.
4382 * @returns The original parse tree node if found; otherwise, undefined.
4383 */
4384 function getParseTreeNode<T extends Node>(node: T | undefined, nodeTest?: (node: Node) => node is T): T | undefined;
4385 /** Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' */
4386 function escapeLeadingUnderscores(identifier: string): __String;
4387 /**
4388 * Remove extra underscore from escaped identifier text content.
4389 *
4390 * @param identifier The escaped identifier text.
4391 * @returns The unescaped identifier text.
4392 */
4393 function unescapeLeadingUnderscores(identifier: __String): string;
4394 function idText(identifierOrPrivateName: Identifier | PrivateIdentifier): string;
4395 function symbolName(symbol: Symbol): string;
4396 function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | PrivateIdentifier | undefined;
4397 function getNameOfDeclaration(declaration: Declaration | Expression | undefined): DeclarationName | undefined;
4398 function getDecorators(node: HasDecorators): readonly Decorator[] | undefined;
4399 function getModifiers(node: HasModifiers): readonly Modifier[] | undefined;
4400 /**
4401 * Gets the JSDoc parameter tags for the node if present.
4402 *
4403 * @remarks Returns any JSDoc param tag whose name matches the provided
4404 * parameter, whether a param tag on a containing function
4405 * expression, or a param tag on a variable declaration whose
4406 * initializer is the containing function. The tags closest to the
4407 * node are returned first, so in the previous example, the param
4408 * tag on the containing function expression would be first.
4409 *
4410 * For binding patterns, parameter tags are matched by position.
4411 */
4412 function getJSDocParameterTags(param: ParameterDeclaration): readonly JSDocParameterTag[];
4413 /**
4414 * Gets the JSDoc type parameter tags for the node if present.
4415 *
4416 * @remarks Returns any JSDoc template tag whose names match the provided
4417 * parameter, whether a template tag on a containing function
4418 * expression, or a template tag on a variable declaration whose
4419 * initializer is the containing function. The tags closest to the
4420 * node are returned first, so in the previous example, the template
4421 * tag on the containing function expression would be first.
4422 */
4423 function getJSDocTypeParameterTags(param: TypeParameterDeclaration): readonly JSDocTemplateTag[];
4424 /**
4425 * Return true if the node has JSDoc parameter tags.
4426 *
4427 * @remarks Includes parameter tags that are not directly on the node,
4428 * for example on a variable declaration whose initializer is a function expression.
4429 */
4430 function hasJSDocParameterTags(node: FunctionLikeDeclaration | SignatureDeclaration): boolean;
4431 /** Gets the JSDoc augments tag for the node if present */
4432 function getJSDocAugmentsTag(node: Node): JSDocAugmentsTag | undefined;
4433 /** Gets the JSDoc implements tags for the node if present */
4434 function getJSDocImplementsTags(node: Node): readonly JSDocImplementsTag[];
4435 /** Gets the JSDoc class tag for the node if present */
4436 function getJSDocClassTag(node: Node): JSDocClassTag | undefined;
4437 /** Gets the JSDoc public tag for the node if present */
4438 function getJSDocPublicTag(node: Node): JSDocPublicTag | undefined;
4439 /** Gets the JSDoc private tag for the node if present */
4440 function getJSDocPrivateTag(node: Node): JSDocPrivateTag | undefined;
4441 /** Gets the JSDoc protected tag for the node if present */
4442 function getJSDocProtectedTag(node: Node): JSDocProtectedTag | undefined;
4443 /** Gets the JSDoc protected tag for the node if present */
4444 function getJSDocReadonlyTag(node: Node): JSDocReadonlyTag | undefined;
4445 function getJSDocOverrideTagNoCache(node: Node): JSDocOverrideTag | undefined;
4446 /** Gets the JSDoc deprecated tag for the node if present */
4447 function getJSDocDeprecatedTag(node: Node): JSDocDeprecatedTag | undefined;
4448 /** Gets the JSDoc enum tag for the node if present */
4449 function getJSDocEnumTag(node: Node): JSDocEnumTag | undefined;
4450 /** Gets the JSDoc this tag for the node if present */
4451 function getJSDocThisTag(node: Node): JSDocThisTag | undefined;
4452 /** Gets the JSDoc return tag for the node if present */
4453 function getJSDocReturnTag(node: Node): JSDocReturnTag | undefined;
4454 /** Gets the JSDoc template tag for the node if present */
4455 function getJSDocTemplateTag(node: Node): JSDocTemplateTag | undefined;
4456 /** Gets the JSDoc type tag for the node if present and valid */
4457 function getJSDocTypeTag(node: Node): JSDocTypeTag | undefined;
4458 /**
4459 * Gets the type node for the node if provided via JSDoc.
4460 *
4461 * @remarks The search includes any JSDoc param tag that relates
4462 * to the provided parameter, for example a type tag on the
4463 * parameter itself, or a param tag on a containing function
4464 * expression, or a param tag on a variable declaration whose
4465 * initializer is the containing function. The tags closest to the
4466 * node are examined first, so in the previous example, the type
4467 * tag directly on the node would be returned.
4468 */
4469 function getJSDocType(node: Node): TypeNode | undefined;
4470 /**
4471 * Gets the return type node for the node if provided via JSDoc return tag or type tag.
4472 *
4473 * @remarks `getJSDocReturnTag` just gets the whole JSDoc tag. This function
4474 * gets the type from inside the braces, after the fat arrow, etc.
4475 */
4476 function getJSDocReturnType(node: Node): TypeNode | undefined;
4477 /** Get all JSDoc tags related to a node, including those on parent nodes. */
4478 function getJSDocTags(node: Node): readonly JSDocTag[];
4479 /** Gets all JSDoc tags that match a specified predicate */
4480 function getAllJSDocTags<T extends JSDocTag>(node: Node, predicate: (tag: JSDocTag) => tag is T): readonly T[];
4481 /** Gets all JSDoc tags of a specified kind */
4482 function getAllJSDocTagsOfKind(node: Node, kind: SyntaxKind): readonly JSDocTag[];
4483 /** Gets the text of a jsdoc comment, flattening links to their text. */
4484 function getTextOfJSDocComment(comment?: string | NodeArray<JSDocComment>): string | undefined;
4485 /**
4486 * Gets the effective type parameters. If the node was parsed in a
4487 * JavaScript file, gets the type parameters from the `@template` tag from JSDoc.
4488 *
4489 * This does *not* return type parameters from a jsdoc reference to a generic type, eg
4490 *
4491 * type Id = <T>(x: T) => T
4492 * /** @type {Id} /
4493 * function id(x) { return x }
4494 */
4495 function getEffectiveTypeParameterDeclarations(node: DeclarationWithTypeParameters): readonly TypeParameterDeclaration[];
4496 function getEffectiveConstraintOfTypeParameter(node: TypeParameterDeclaration): TypeNode | undefined;
4497 function isMemberName(node: Node): node is MemberName;
4498 function isPropertyAccessChain(node: Node): node is PropertyAccessChain;
4499 function isElementAccessChain(node: Node): node is ElementAccessChain;
4500 function isCallChain(node: Node): node is CallChain;
4501 function isOptionalChain(node: Node): node is PropertyAccessChain | ElementAccessChain | CallChain | NonNullChain;
4502 function isNullishCoalesce(node: Node): boolean;
4503 function isConstTypeReference(node: Node): boolean;
4504 function skipPartiallyEmittedExpressions(node: Expression): Expression;
4505 function skipPartiallyEmittedExpressions(node: Node): Node;
4506 function isNonNullChain(node: Node): node is NonNullChain;
4507 function isBreakOrContinueStatement(node: Node): node is BreakOrContinueStatement;
4508 function isNamedExportBindings(node: Node): node is NamedExportBindings;
4509 function isUnparsedTextLike(node: Node): node is UnparsedTextLike;
4510 function isUnparsedNode(node: Node): node is UnparsedNode;
4511 function isJSDocPropertyLikeTag(node: Node): node is JSDocPropertyLikeTag;
4512 /**
4513 * True if kind is of some token syntax kind.
4514 * For example, this is true for an IfKeyword but not for an IfStatement.
4515 * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail.
4516 */
4517 function isTokenKind(kind: SyntaxKind): boolean;
4518 /**
4519 * True if node is of some token syntax kind.
4520 * For example, this is true for an IfKeyword but not for an IfStatement.
4521 * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail.
4522 */
4523 function isToken(n: Node): boolean;
4524 function isLiteralExpression(node: Node): node is LiteralExpression;
4525 function isTemplateLiteralToken(node: Node): node is TemplateLiteralToken;
4526 function isTemplateMiddleOrTemplateTail(node: Node): node is TemplateMiddle | TemplateTail;
4527 function isImportOrExportSpecifier(node: Node): node is ImportSpecifier | ExportSpecifier;
4528 function isTypeOnlyImportOrExportDeclaration(node: Node): node is TypeOnlyAliasDeclaration;
4529 function isAssertionKey(node: Node): node is AssertionKey;
4530 function isStringTextContainingNode(node: Node): node is StringLiteral | TemplateLiteralToken;
4531 function isModifier(node: Node): node is Modifier;
4532 function isEntityName(node: Node): node is EntityName;
4533 function isPropertyName(node: Node): node is PropertyName;
4534 function isBindingName(node: Node): node is BindingName;
4535 function isFunctionLike(node: Node | undefined): node is SignatureDeclaration;
4536 function isClassElement(node: Node): node is ClassElement;
4537 function isClassLike(node: Node): node is ClassLikeDeclaration;
4538 function isAccessor(node: Node): node is AccessorDeclaration;
4539 function isAutoAccessorPropertyDeclaration(node: Node): node is AutoAccessorPropertyDeclaration;
4540 function isModifierLike(node: Node): node is ModifierLike;
4541 function isTypeElement(node: Node): node is TypeElement;
4542 function isClassOrTypeElement(node: Node): node is ClassElement | TypeElement;
4543 function isObjectLiteralElementLike(node: Node): node is ObjectLiteralElementLike;
4544 /**
4545 * Node test that determines whether a node is a valid type node.
4546 * This differs from the `isPartOfTypeNode` function which determines whether a node is *part*
4547 * of a TypeNode.
4548 */
4549 function isTypeNode(node: Node): node is TypeNode;
4550 function isFunctionOrConstructorTypeNode(node: Node): node is FunctionTypeNode | ConstructorTypeNode;
4551 function isPropertyAccessOrQualifiedName(node: Node): node is PropertyAccessExpression | QualifiedName;
4552 function isCallLikeExpression(node: Node): node is CallLikeExpression;
4553 function isCallOrNewExpression(node: Node): node is CallExpression | NewExpression;
4554 function isTemplateLiteral(node: Node): node is TemplateLiteral;
4555 function isAssertionExpression(node: Node): node is AssertionExpression;
4556 function isIterationStatement(node: Node, lookInLabeledStatements: false): node is IterationStatement;
4557 function isIterationStatement(node: Node, lookInLabeledStatements: boolean): node is IterationStatement | LabeledStatement;
4558 function isJsxOpeningLikeElement(node: Node): node is JsxOpeningLikeElement;
4559 function isCaseOrDefaultClause(node: Node): node is CaseOrDefaultClause;
4560 /** True if node is of a kind that may contain comment text. */
4561 function isJSDocCommentContainingNode(node: Node): boolean;
4562 function isSetAccessor(node: Node): node is SetAccessorDeclaration;
4563 function isGetAccessor(node: Node): node is GetAccessorDeclaration;
4564 /** True if has initializer node attached to it. */
4565 function hasOnlyExpressionInitializer(node: Node): node is HasExpressionInitializer;
4566 function isObjectLiteralElement(node: Node): node is ObjectLiteralElement;
4567 function isStringLiteralLike(node: Node): node is StringLiteralLike;
4568 function isJSDocLinkLike(node: Node): node is JSDocLink | JSDocLinkCode | JSDocLinkPlain;
4569 function hasRestParameter(s: SignatureDeclaration | JSDocSignature): boolean;
4570 function isRestParameter(node: ParameterDeclaration | JSDocParameterTag): boolean;
4571}
4572declare namespace ts {
4573 const factory: NodeFactory;
4574 function createUnparsedSourceFile(text: string): UnparsedSource;
4575 function createUnparsedSourceFile(inputFile: InputFiles, type: "js" | "dts", stripInternal?: boolean): UnparsedSource;
4576 function createUnparsedSourceFile(text: string, mapPath: string | undefined, map: string | undefined): UnparsedSource;
4577 function createInputFiles(javascriptText: string, declarationText: string): InputFiles;
4578 function createInputFiles(readFileText: (path: string) => string | undefined, javascriptPath: string, javascriptMapPath: string | undefined, declarationPath: string, declarationMapPath: string | undefined, buildInfoPath: string | undefined): InputFiles;
4579 function createInputFiles(javascriptText: string, declarationText: string, javascriptMapPath: string | undefined, javascriptMapText: string | undefined, declarationMapPath: string | undefined, declarationMapText: string | undefined): InputFiles;
4580 /**
4581 * Create an external source map source file reference
4582 */
4583 function createSourceMapSource(fileName: string, text: string, skipTrivia?: (pos: number) => number): SourceMapSource;
4584 function setOriginalNode<T extends Node>(node: T, original: Node | undefined): T;
4585}
4586declare namespace ts {
4587 /**
4588 * Clears any `EmitNode` entries from parse-tree nodes.
4589 * @param sourceFile A source file.
4590 */
4591 function disposeEmitNodes(sourceFile: SourceFile | undefined): void;
4592 /**
4593 * Sets flags that control emit behavior of a node.
4594 */
4595 function setEmitFlags<T extends Node>(node: T, emitFlags: EmitFlags): T;
4596 /**
4597 * Gets a custom text range to use when emitting source maps.
4598 */
4599 function getSourceMapRange(node: Node): SourceMapRange;
4600 /**
4601 * Sets a custom text range to use when emitting source maps.
4602 */
4603 function setSourceMapRange<T extends Node>(node: T, range: SourceMapRange | undefined): T;
4604 /**
4605 * Gets the TextRange to use for source maps for a token of a node.
4606 */
4607 function getTokenSourceMapRange(node: Node, token: SyntaxKind): SourceMapRange | undefined;
4608 /**
4609 * Sets the TextRange to use for source maps for a token of a node.
4610 */
4611 function setTokenSourceMapRange<T extends Node>(node: T, token: SyntaxKind, range: SourceMapRange | undefined): T;
4612 /**
4613 * Gets a custom text range to use when emitting comments.
4614 */
4615 function getCommentRange(node: Node): TextRange;
4616 /**
4617 * Sets a custom text range to use when emitting comments.
4618 */
4619 function setCommentRange<T extends Node>(node: T, range: TextRange): T;
4620 function getSyntheticLeadingComments(node: Node): SynthesizedComment[] | undefined;
4621 function setSyntheticLeadingComments<T extends Node>(node: T, comments: SynthesizedComment[] | undefined): T;
4622 function addSyntheticLeadingComment<T extends Node>(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T;
4623 function getSyntheticTrailingComments(node: Node): SynthesizedComment[] | undefined;
4624 function setSyntheticTrailingComments<T extends Node>(node: T, comments: SynthesizedComment[] | undefined): T;
4625 function addSyntheticTrailingComment<T extends Node>(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T;
4626 function moveSyntheticComments<T extends Node>(node: T, original: Node): T;
4627 /**
4628 * Gets the constant value to emit for an expression representing an enum.
4629 */
4630 function getConstantValue(node: AccessExpression): string | number | undefined;
4631 /**
4632 * Sets the constant value to emit for an expression.
4633 */
4634 function setConstantValue(node: AccessExpression, value: string | number): AccessExpression;
4635 /**
4636 * Adds an EmitHelper to a node.
4637 */
4638 function addEmitHelper<T extends Node>(node: T, helper: EmitHelper): T;
4639 /**
4640 * Add EmitHelpers to a node.
4641 */
4642 function addEmitHelpers<T extends Node>(node: T, helpers: EmitHelper[] | undefined): T;
4643 /**
4644 * Removes an EmitHelper from a node.
4645 */
4646 function removeEmitHelper(node: Node, helper: EmitHelper): boolean;
4647 /**
4648 * Gets the EmitHelpers of a node.
4649 */
4650 function getEmitHelpers(node: Node): EmitHelper[] | undefined;
4651 /**
4652 * Moves matching emit helpers from a source node to a target node.
4653 */
4654 function moveEmitHelpers(source: Node, target: Node, predicate: (helper: EmitHelper) => boolean): void;
4655}
4656declare namespace ts {
4657 function isNumericLiteral(node: Node): node is NumericLiteral;
4658 function isBigIntLiteral(node: Node): node is BigIntLiteral;
4659 function isStringLiteral(node: Node): node is StringLiteral;
4660 function isJsxText(node: Node): node is JsxText;
4661 function isRegularExpressionLiteral(node: Node): node is RegularExpressionLiteral;
4662 function isNoSubstitutionTemplateLiteral(node: Node): node is NoSubstitutionTemplateLiteral;
4663 function isTemplateHead(node: Node): node is TemplateHead;
4664 function isTemplateMiddle(node: Node): node is TemplateMiddle;
4665 function isTemplateTail(node: Node): node is TemplateTail;
4666 function isDotDotDotToken(node: Node): node is DotDotDotToken;
4667 function isPlusToken(node: Node): node is PlusToken;
4668 function isMinusToken(node: Node): node is MinusToken;
4669 function isAsteriskToken(node: Node): node is AsteriskToken;
4670 function isIdentifier(node: Node): node is Identifier;
4671 function isPrivateIdentifier(node: Node): node is PrivateIdentifier;
4672 function isQualifiedName(node: Node): node is QualifiedName;
4673 function isComputedPropertyName(node: Node): node is ComputedPropertyName;
4674 function isTypeParameterDeclaration(node: Node): node is TypeParameterDeclaration;
4675 function isParameter(node: Node): node is ParameterDeclaration;
4676 function isDecorator(node: Node): node is Decorator;
4677 function isPropertySignature(node: Node): node is PropertySignature;
4678 function isPropertyDeclaration(node: Node): node is PropertyDeclaration;
4679 function isMethodSignature(node: Node): node is MethodSignature;
4680 function isMethodDeclaration(node: Node): node is MethodDeclaration;
4681 function isClassStaticBlockDeclaration(node: Node): node is ClassStaticBlockDeclaration;
4682 function isConstructorDeclaration(node: Node): node is ConstructorDeclaration;
4683 function isGetAccessorDeclaration(node: Node): node is GetAccessorDeclaration;
4684 function isSetAccessorDeclaration(node: Node): node is SetAccessorDeclaration;
4685 function isCallSignatureDeclaration(node: Node): node is CallSignatureDeclaration;
4686 function isConstructSignatureDeclaration(node: Node): node is ConstructSignatureDeclaration;
4687 function isIndexSignatureDeclaration(node: Node): node is IndexSignatureDeclaration;
4688 function isTypePredicateNode(node: Node): node is TypePredicateNode;
4689 function isTypeReferenceNode(node: Node): node is TypeReferenceNode;
4690 function isFunctionTypeNode(node: Node): node is FunctionTypeNode;
4691 function isConstructorTypeNode(node: Node): node is ConstructorTypeNode;
4692 function isTypeQueryNode(node: Node): node is TypeQueryNode;
4693 function isTypeLiteralNode(node: Node): node is TypeLiteralNode;
4694 function isArrayTypeNode(node: Node): node is ArrayTypeNode;
4695 function isTupleTypeNode(node: Node): node is TupleTypeNode;
4696 function isNamedTupleMember(node: Node): node is NamedTupleMember;
4697 function isOptionalTypeNode(node: Node): node is OptionalTypeNode;
4698 function isRestTypeNode(node: Node): node is RestTypeNode;
4699 function isUnionTypeNode(node: Node): node is UnionTypeNode;
4700 function isIntersectionTypeNode(node: Node): node is IntersectionTypeNode;
4701 function isConditionalTypeNode(node: Node): node is ConditionalTypeNode;
4702 function isInferTypeNode(node: Node): node is InferTypeNode;
4703 function isParenthesizedTypeNode(node: Node): node is ParenthesizedTypeNode;
4704 function isThisTypeNode(node: Node): node is ThisTypeNode;
4705 function isTypeOperatorNode(node: Node): node is TypeOperatorNode;
4706 function isIndexedAccessTypeNode(node: Node): node is IndexedAccessTypeNode;
4707 function isMappedTypeNode(node: Node): node is MappedTypeNode;
4708 function isLiteralTypeNode(node: Node): node is LiteralTypeNode;
4709 function isImportTypeNode(node: Node): node is ImportTypeNode;
4710 function isTemplateLiteralTypeSpan(node: Node): node is TemplateLiteralTypeSpan;
4711 function isTemplateLiteralTypeNode(node: Node): node is TemplateLiteralTypeNode;
4712 function isObjectBindingPattern(node: Node): node is ObjectBindingPattern;
4713 function isArrayBindingPattern(node: Node): node is ArrayBindingPattern;
4714 function isBindingElement(node: Node): node is BindingElement;
4715 function isArrayLiteralExpression(node: Node): node is ArrayLiteralExpression;
4716 function isObjectLiteralExpression(node: Node): node is ObjectLiteralExpression;
4717 function isPropertyAccessExpression(node: Node): node is PropertyAccessExpression;
4718 function isElementAccessExpression(node: Node): node is ElementAccessExpression;
4719 function isCallExpression(node: Node): node is CallExpression;
4720 function isNewExpression(node: Node): node is NewExpression;
4721 function isTaggedTemplateExpression(node: Node): node is TaggedTemplateExpression;
4722 function isTypeAssertionExpression(node: Node): node is TypeAssertion;
4723 function isParenthesizedExpression(node: Node): node is ParenthesizedExpression;
4724 function isFunctionExpression(node: Node): node is FunctionExpression;
4725 function isArrowFunction(node: Node): node is ArrowFunction;
4726 function isDeleteExpression(node: Node): node is DeleteExpression;
4727 function isTypeOfExpression(node: Node): node is TypeOfExpression;
4728 function isVoidExpression(node: Node): node is VoidExpression;
4729 function isAwaitExpression(node: Node): node is AwaitExpression;
4730 function isPrefixUnaryExpression(node: Node): node is PrefixUnaryExpression;
4731 function isPostfixUnaryExpression(node: Node): node is PostfixUnaryExpression;
4732 function isBinaryExpression(node: Node): node is BinaryExpression;
4733 function isConditionalExpression(node: Node): node is ConditionalExpression;
4734 function isTemplateExpression(node: Node): node is TemplateExpression;
4735 function isYieldExpression(node: Node): node is YieldExpression;
4736 function isSpreadElement(node: Node): node is SpreadElement;
4737 function isClassExpression(node: Node): node is ClassExpression;
4738 function isOmittedExpression(node: Node): node is OmittedExpression;
4739 function isExpressionWithTypeArguments(node: Node): node is ExpressionWithTypeArguments;
4740 function isAsExpression(node: Node): node is AsExpression;
4741 function isSatisfiesExpression(node: Node): node is SatisfiesExpression;
4742 function isNonNullExpression(node: Node): node is NonNullExpression;
4743 function isMetaProperty(node: Node): node is MetaProperty;
4744 function isSyntheticExpression(node: Node): node is SyntheticExpression;
4745 function isPartiallyEmittedExpression(node: Node): node is PartiallyEmittedExpression;
4746 function isCommaListExpression(node: Node): node is CommaListExpression;
4747 function isTemplateSpan(node: Node): node is TemplateSpan;
4748 function isSemicolonClassElement(node: Node): node is SemicolonClassElement;
4749 function isBlock(node: Node): node is Block;
4750 function isVariableStatement(node: Node): node is VariableStatement;
4751 function isEmptyStatement(node: Node): node is EmptyStatement;
4752 function isExpressionStatement(node: Node): node is ExpressionStatement;
4753 function isIfStatement(node: Node): node is IfStatement;
4754 function isDoStatement(node: Node): node is DoStatement;
4755 function isWhileStatement(node: Node): node is WhileStatement;
4756 function isForStatement(node: Node): node is ForStatement;
4757 function isForInStatement(node: Node): node is ForInStatement;
4758 function isForOfStatement(node: Node): node is ForOfStatement;
4759 function isContinueStatement(node: Node): node is ContinueStatement;
4760 function isBreakStatement(node: Node): node is BreakStatement;
4761 function isReturnStatement(node: Node): node is ReturnStatement;
4762 function isWithStatement(node: Node): node is WithStatement;
4763 function isSwitchStatement(node: Node): node is SwitchStatement;
4764 function isLabeledStatement(node: Node): node is LabeledStatement;
4765 function isThrowStatement(node: Node): node is ThrowStatement;
4766 function isTryStatement(node: Node): node is TryStatement;
4767 function isDebuggerStatement(node: Node): node is DebuggerStatement;
4768 function isVariableDeclaration(node: Node): node is VariableDeclaration;
4769 function isVariableDeclarationList(node: Node): node is VariableDeclarationList;
4770 function isFunctionDeclaration(node: Node): node is FunctionDeclaration;
4771 function isClassDeclaration(node: Node): node is ClassDeclaration;
4772 function isInterfaceDeclaration(node: Node): node is InterfaceDeclaration;
4773 function isTypeAliasDeclaration(node: Node): node is TypeAliasDeclaration;
4774 function isEnumDeclaration(node: Node): node is EnumDeclaration;
4775 function isModuleDeclaration(node: Node): node is ModuleDeclaration;
4776 function isModuleBlock(node: Node): node is ModuleBlock;
4777 function isCaseBlock(node: Node): node is CaseBlock;
4778 function isNamespaceExportDeclaration(node: Node): node is NamespaceExportDeclaration;
4779 function isImportEqualsDeclaration(node: Node): node is ImportEqualsDeclaration;
4780 function isImportDeclaration(node: Node): node is ImportDeclaration;
4781 function isImportClause(node: Node): node is ImportClause;
4782 function isImportTypeAssertionContainer(node: Node): node is ImportTypeAssertionContainer;
4783 function isAssertClause(node: Node): node is AssertClause;
4784 function isAssertEntry(node: Node): node is AssertEntry;
4785 function isNamespaceImport(node: Node): node is NamespaceImport;
4786 function isNamespaceExport(node: Node): node is NamespaceExport;
4787 function isNamedImports(node: Node): node is NamedImports;
4788 function isImportSpecifier(node: Node): node is ImportSpecifier;
4789 function isExportAssignment(node: Node): node is ExportAssignment;
4790 function isExportDeclaration(node: Node): node is ExportDeclaration;
4791 function isNamedExports(node: Node): node is NamedExports;
4792 function isExportSpecifier(node: Node): node is ExportSpecifier;
4793 function isMissingDeclaration(node: Node): node is MissingDeclaration;
4794 function isNotEmittedStatement(node: Node): node is NotEmittedStatement;
4795 function isExternalModuleReference(node: Node): node is ExternalModuleReference;
4796 function isJsxElement(node: Node): node is JsxElement;
4797 function isJsxSelfClosingElement(node: Node): node is JsxSelfClosingElement;
4798 function isJsxOpeningElement(node: Node): node is JsxOpeningElement;
4799 function isJsxClosingElement(node: Node): node is JsxClosingElement;
4800 function isJsxFragment(node: Node): node is JsxFragment;
4801 function isJsxOpeningFragment(node: Node): node is JsxOpeningFragment;
4802 function isJsxClosingFragment(node: Node): node is JsxClosingFragment;
4803 function isJsxAttribute(node: Node): node is JsxAttribute;
4804 function isJsxAttributes(node: Node): node is JsxAttributes;
4805 function isJsxSpreadAttribute(node: Node): node is JsxSpreadAttribute;
4806 function isJsxExpression(node: Node): node is JsxExpression;
4807 function isCaseClause(node: Node): node is CaseClause;
4808 function isDefaultClause(node: Node): node is DefaultClause;
4809 function isHeritageClause(node: Node): node is HeritageClause;
4810 function isCatchClause(node: Node): node is CatchClause;
4811 function isPropertyAssignment(node: Node): node is PropertyAssignment;
4812 function isShorthandPropertyAssignment(node: Node): node is ShorthandPropertyAssignment;
4813 function isSpreadAssignment(node: Node): node is SpreadAssignment;
4814 function isEnumMember(node: Node): node is EnumMember;
4815 function isUnparsedPrepend(node: Node): node is UnparsedPrepend;
4816 function isSourceFile(node: Node): node is SourceFile;
4817 function isBundle(node: Node): node is Bundle;
4818 function isUnparsedSource(node: Node): node is UnparsedSource;
4819 function isJSDocTypeExpression(node: Node): node is JSDocTypeExpression;
4820 function isJSDocNameReference(node: Node): node is JSDocNameReference;
4821 function isJSDocMemberName(node: Node): node is JSDocMemberName;
4822 function isJSDocLink(node: Node): node is JSDocLink;
4823 function isJSDocLinkCode(node: Node): node is JSDocLinkCode;
4824 function isJSDocLinkPlain(node: Node): node is JSDocLinkPlain;
4825 function isJSDocAllType(node: Node): node is JSDocAllType;
4826 function isJSDocUnknownType(node: Node): node is JSDocUnknownType;
4827 function isJSDocNullableType(node: Node): node is JSDocNullableType;
4828 function isJSDocNonNullableType(node: Node): node is JSDocNonNullableType;
4829 function isJSDocOptionalType(node: Node): node is JSDocOptionalType;
4830 function isJSDocFunctionType(node: Node): node is JSDocFunctionType;
4831 function isJSDocVariadicType(node: Node): node is JSDocVariadicType;
4832 function isJSDocNamepathType(node: Node): node is JSDocNamepathType;
4833 function isJSDoc(node: Node): node is JSDoc;
4834 function isJSDocTypeLiteral(node: Node): node is JSDocTypeLiteral;
4835 function isJSDocSignature(node: Node): node is JSDocSignature;
4836 function isJSDocAugmentsTag(node: Node): node is JSDocAugmentsTag;
4837 function isJSDocAuthorTag(node: Node): node is JSDocAuthorTag;
4838 function isJSDocClassTag(node: Node): node is JSDocClassTag;
4839 function isJSDocCallbackTag(node: Node): node is JSDocCallbackTag;
4840 function isJSDocPublicTag(node: Node): node is JSDocPublicTag;
4841 function isJSDocPrivateTag(node: Node): node is JSDocPrivateTag;
4842 function isJSDocProtectedTag(node: Node): node is JSDocProtectedTag;
4843 function isJSDocReadonlyTag(node: Node): node is JSDocReadonlyTag;
4844 function isJSDocOverrideTag(node: Node): node is JSDocOverrideTag;
4845 function isJSDocDeprecatedTag(node: Node): node is JSDocDeprecatedTag;
4846 function isJSDocSeeTag(node: Node): node is JSDocSeeTag;
4847 function isJSDocEnumTag(node: Node): node is JSDocEnumTag;
4848 function isJSDocParameterTag(node: Node): node is JSDocParameterTag;
4849 function isJSDocReturnTag(node: Node): node is JSDocReturnTag;
4850 function isJSDocThisTag(node: Node): node is JSDocThisTag;
4851 function isJSDocTypeTag(node: Node): node is JSDocTypeTag;
4852 function isJSDocTemplateTag(node: Node): node is JSDocTemplateTag;
4853 function isJSDocTypedefTag(node: Node): node is JSDocTypedefTag;
4854 function isJSDocUnknownTag(node: Node): node is JSDocUnknownTag;
4855 function isJSDocPropertyTag(node: Node): node is JSDocPropertyTag;
4856 function isJSDocImplementsTag(node: Node): node is JSDocImplementsTag;
4857}
4858declare namespace ts {
4859 function setTextRange<T extends TextRange>(range: T, location: TextRange | undefined): T;
4860 function canHaveModifiers(node: Node): node is HasModifiers;
4861 function canHaveDecorators(node: Node): node is HasDecorators;
4862}
4863declare namespace ts {
4864 /**
4865 * Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes
4866 * stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise,
4867 * embedded arrays are flattened and the 'cbNode' callback is invoked for each element. If a callback returns
4868 * a truthy value, iteration stops and that value is returned. Otherwise, undefined is returned.
4869 *
4870 * @param node a given node to visit its children
4871 * @param cbNode a callback to be invoked for all child nodes
4872 * @param cbNodes a callback to be invoked for embedded array
4873 *
4874 * @remarks `forEachChild` must visit the children of a node in the order
4875 * that they appear in the source code. The language service depends on this property to locate nodes by position.
4876 */
4877 export function forEachChild<T>(node: Node, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined;
4878 export interface CreateSourceFileOptions {
4879 languageVersion: ScriptTarget;
4880 /**
4881 * Controls the format the file is detected as - this can be derived from only the path
4882 * and files on disk, but needs to be done with a module resolution cache in scope to be performant.
4883 * This is usually `undefined` for compilations that do not have `moduleResolution` values of `node16` or `nodenext`.
4884 */
4885 impliedNodeFormat?: ModuleKind.ESNext | ModuleKind.CommonJS;
4886 /**
4887 * Controls how module-y-ness is set for the given file. Usually the result of calling
4888 * `getSetExternalModuleIndicator` on a valid `CompilerOptions` object. If not present, the default
4889 * check specified by `isFileProbablyExternalModule` will be used to set the field.
4890 */
4891 setExternalModuleIndicator?: (file: SourceFile) => void;
4892 }
4893 export function createSourceFile(fileName: string, sourceText: string, languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions, setParentNodes?: boolean, scriptKind?: ScriptKind): SourceFile;
4894 export function parseIsolatedEntityName(text: string, languageVersion: ScriptTarget): EntityName | undefined;
4895 /**
4896 * Parse json text into SyntaxTree and return node and parse errors if any
4897 * @param fileName
4898 * @param sourceText
4899 */
4900 export function parseJsonText(fileName: string, sourceText: string): JsonSourceFile;
4901 export function isExternalModule(file: SourceFile): boolean;
4902 export function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
4903 export {};
4904}
4905declare namespace ts {
4906 export function parseCommandLine(commandLine: readonly string[], readFile?: (path: string) => string | undefined): ParsedCommandLine;
4907 export type DiagnosticReporter = (diagnostic: Diagnostic) => void;
4908 /**
4909 * Reports config file diagnostics
4910 */
4911 export interface ConfigFileDiagnosticsReporter {
4912 /**
4913 * Reports unrecoverable error when parsing config file
4914 */
4915 onUnRecoverableConfigFileDiagnostic: DiagnosticReporter;
4916 }
4917 /**
4918 * Interface extending ParseConfigHost to support ParseConfigFile that reads config file and reports errors
4919 */
4920 export interface ParseConfigFileHost extends ParseConfigHost, ConfigFileDiagnosticsReporter {
4921 getCurrentDirectory(): string;
4922 }
4923 /**
4924 * Reads the config file, reports errors if any and exits if the config file cannot be found
4925 */
4926 export function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions | undefined, host: ParseConfigFileHost, extendedConfigCache?: Map<ExtendedConfigCacheEntry>, watchOptionsToExtend?: WatchOptions, extraFileExtensions?: readonly FileExtensionInfo[]): ParsedCommandLine | undefined;
4927 /**
4928 * Read tsconfig.json file
4929 * @param fileName The path to the config file
4930 */
4931 export function readConfigFile(fileName: string, readFile: (path: string) => string | undefined): {
4932 config?: any;
4933 error?: Diagnostic;
4934 };
4935 /**
4936 * Parse the text of the tsconfig.json file
4937 * @param fileName The path to the config file
4938 * @param jsonText The text of the config file
4939 */
4940 export function parseConfigFileTextToJson(fileName: string, jsonText: string): {
4941 config?: any;
4942 error?: Diagnostic;
4943 };
4944 /**
4945 * Read tsconfig.json file
4946 * @param fileName The path to the config file
4947 */
4948 export function readJsonConfigFile(fileName: string, readFile: (path: string) => string | undefined): TsConfigSourceFile;
4949 /**
4950 * Convert the json syntax tree into the json value
4951 */
4952 export function convertToObject(sourceFile: JsonSourceFile, errors: Push<Diagnostic>): any;
4953 /**
4954 * Parse the contents of a config file (tsconfig.json).
4955 * @param json The contents of the config file to parse
4956 * @param host Instance of ParseConfigHost used to enumerate files in folder.
4957 * @param basePath A root directory to resolve relative path entries in the config
4958 * file to. e.g. outDir
4959 */
4960 export function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: readonly FileExtensionInfo[], extendedConfigCache?: Map<ExtendedConfigCacheEntry>, existingWatchOptions?: WatchOptions): ParsedCommandLine;
4961 /**
4962 * Parse the contents of a config file (tsconfig.json).
4963 * @param jsonNode The contents of the config file to parse
4964 * @param host Instance of ParseConfigHost used to enumerate files in folder.
4965 * @param basePath A root directory to resolve relative path entries in the config
4966 * file to. e.g. outDir
4967 */
4968 export function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: readonly FileExtensionInfo[], extendedConfigCache?: Map<ExtendedConfigCacheEntry>, existingWatchOptions?: WatchOptions): ParsedCommandLine;
4969 export interface ParsedTsconfig {
4970 raw: any;
4971 options?: CompilerOptions;
4972 watchOptions?: WatchOptions;
4973 typeAcquisition?: TypeAcquisition;
4974 /**
4975 * Note that the case of the config path has not yet been normalized, as no files have been imported into the project yet
4976 */
4977 extendedConfigPath?: string;
4978 }
4979 export interface ExtendedConfigCacheEntry {
4980 extendedResult: TsConfigSourceFile;
4981 extendedConfig: ParsedTsconfig | undefined;
4982 }
4983 export function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
4984 options: CompilerOptions;
4985 errors: Diagnostic[];
4986 };
4987 export function convertTypeAcquisitionFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
4988 options: TypeAcquisition;
4989 errors: Diagnostic[];
4990 };
4991 export {};
4992}
4993declare namespace ts {
4994 export function getEffectiveTypeRoots(options: CompilerOptions, host: GetEffectiveTypeRootsHost): string[] | undefined;
4995 /**
4996 * @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown.
4997 * This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups
4998 * is assumed to be the same as root directory of the project.
4999 */
5000 export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference, cache?: TypeReferenceDirectiveResolutionCache, resolutionMode?: SourceFile["impliedNodeFormat"]): ResolvedTypeReferenceDirectiveWithFailedLookupLocations;
5001 /**
5002 * Given a set of options, returns the set of type directive names
5003 * that should be included for this program automatically.
5004 * This list could either come from the config file,
5005 * or from enumerating the types root + initial secondary types lookup location.
5006 * More type directives might appear in the program later as a result of loading actual source files;
5007 * this list is only the set of defaults that are implicitly included.
5008 */
5009 export function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[];
5010 export interface TypeReferenceDirectiveResolutionCache extends PerDirectoryResolutionCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>, PackageJsonInfoCache {
5011 }
5012 export interface ModeAwareCache<T> {
5013 get(key: string, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined): T | undefined;
5014 set(key: string, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined, value: T): this;
5015 delete(key: string, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined): this;
5016 has(key: string, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined): boolean;
5017 forEach(cb: (elem: T, key: string, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined) => void): void;
5018 size(): number;
5019 }
5020 /**
5021 * Cached resolutions per containing directory.
5022 * This assumes that any module id will have the same resolution for sibling files located in the same folder.
5023 */
5024 export interface PerDirectoryResolutionCache<T> {
5025 getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference): ModeAwareCache<T>;
5026 clear(): void;
5027 /**
5028 * Updates with the current compilerOptions the cache will operate with.
5029 * This updates the redirects map as well if needed so module resolutions are cached if they can across the projects
5030 */
5031 update(options: CompilerOptions): void;
5032 }
5033 export interface ModuleResolutionCache extends PerDirectoryResolutionCache<ResolvedModuleWithFailedLookupLocations>, NonRelativeModuleNameResolutionCache, PackageJsonInfoCache {
5034 getPackageJsonInfoCache(): PackageJsonInfoCache;
5035 }
5036 /**
5037 * Stored map from non-relative module name to a table: directory -> result of module lookup in this directory
5038 * We support only non-relative module names because resolution of relative module names is usually more deterministic and thus less expensive.
5039 */
5040 export interface NonRelativeModuleNameResolutionCache extends PackageJsonInfoCache {
5041 getOrCreateCacheForModuleName(nonRelativeModuleName: string, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined, redirectedReference?: ResolvedProjectReference): PerModuleNameCache;
5042 }
5043 export interface PackageJsonInfoCache {
5044 clear(): void;
5045 }
5046 export interface PerModuleNameCache {
5047 get(directory: string): ResolvedModuleWithFailedLookupLocations | undefined;
5048 set(directory: string, result: ResolvedModuleWithFailedLookupLocations): void;
5049 }
5050 export function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions): ModuleResolutionCache;
5051 export function createTypeReferenceDirectiveResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions, packageJsonInfoCache?: PackageJsonInfoCache): TypeReferenceDirectiveResolutionCache;
5052 export function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache, mode?: ModuleKind.CommonJS | ModuleKind.ESNext): ResolvedModuleWithFailedLookupLocations | undefined;
5053 export function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference, resolutionMode?: ModuleKind.CommonJS | ModuleKind.ESNext): ResolvedModuleWithFailedLookupLocations;
5054 export function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
5055 export function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
5056 export {};
5057}
5058declare namespace ts {
5059 /**
5060 * Visits a Node using the supplied visitor, possibly returning a new Node in its place.
5061 *
5062 * @param node The Node to visit.
5063 * @param visitor The callback used to visit the Node.
5064 * @param test A callback to execute to verify the Node is valid.
5065 * @param lift An optional callback to execute to lift a NodeArray into a valid Node.
5066 */
5067 function visitNode<T extends Node>(node: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T;
5068 /**
5069 * Visits a Node using the supplied visitor, possibly returning a new Node in its place.
5070 *
5071 * @param node The Node to visit.
5072 * @param visitor The callback used to visit the Node.
5073 * @param test A callback to execute to verify the Node is valid.
5074 * @param lift An optional callback to execute to lift a NodeArray into a valid Node.
5075 */
5076 function visitNode<T extends Node>(node: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T | undefined;
5077 /**
5078 * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
5079 *
5080 * @param nodes The NodeArray to visit.
5081 * @param visitor The callback used to visit a Node.
5082 * @param test A node test to execute for each node.
5083 * @param start An optional value indicating the starting offset at which to start visiting.
5084 * @param count An optional value indicating the maximum number of nodes to visit.
5085 */
5086 function visitNodes<T extends Node>(nodes: NodeArray<T>, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T>;
5087 /**
5088 * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
5089 *
5090 * @param nodes The NodeArray to visit.
5091 * @param visitor The callback used to visit a Node.
5092 * @param test A node test to execute for each node.
5093 * @param start An optional value indicating the starting offset at which to start visiting.
5094 * @param count An optional value indicating the maximum number of nodes to visit.
5095 */
5096 function visitNodes<T extends Node>(nodes: NodeArray<T> | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T> | undefined;
5097 /**
5098 * Starts a new lexical environment and visits a statement list, ending the lexical environment
5099 * and merging hoisted declarations upon completion.
5100 */
5101 function visitLexicalEnvironment(statements: NodeArray<Statement>, visitor: Visitor, context: TransformationContext, start?: number, ensureUseStrict?: boolean, nodesVisitor?: NodesVisitor): NodeArray<Statement>;
5102 /**
5103 * Starts a new lexical environment and visits a parameter list, suspending the lexical
5104 * environment upon completion.
5105 */
5106 function visitParameterList(nodes: NodeArray<ParameterDeclaration>, visitor: Visitor, context: TransformationContext, nodesVisitor?: NodesVisitor): NodeArray<ParameterDeclaration>;
5107 function visitParameterList(nodes: NodeArray<ParameterDeclaration> | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: NodesVisitor): NodeArray<ParameterDeclaration> | undefined;
5108 /**
5109 * Resumes a suspended lexical environment and visits a function body, ending the lexical
5110 * environment and merging hoisted declarations upon completion.
5111 */
5112 function visitFunctionBody(node: FunctionBody, visitor: Visitor, context: TransformationContext): FunctionBody;
5113 /**
5114 * Resumes a suspended lexical environment and visits a function body, ending the lexical
5115 * environment and merging hoisted declarations upon completion.
5116 */
5117 function visitFunctionBody(node: FunctionBody | undefined, visitor: Visitor, context: TransformationContext): FunctionBody | undefined;
5118 /**
5119 * Resumes a suspended lexical environment and visits a concise body, ending the lexical
5120 * environment and merging hoisted declarations upon completion.
5121 */
5122 function visitFunctionBody(node: ConciseBody, visitor: Visitor, context: TransformationContext): ConciseBody;
5123 /**
5124 * Visits an iteration body, adding any block-scoped variables required by the transformation.
5125 */
5126 function visitIterationBody(body: Statement, visitor: Visitor, context: TransformationContext): Statement;
5127 /**
5128 * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.
5129 *
5130 * @param node The Node whose children will be visited.
5131 * @param visitor The callback used to visit each child.
5132 * @param context A lexical environment context for the visitor.
5133 */
5134 function visitEachChild<T extends Node>(node: T, visitor: Visitor, context: TransformationContext): T;
5135 /**
5136 * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.
5137 *
5138 * @param node The Node whose children will be visited.
5139 * @param visitor The callback used to visit each child.
5140 * @param context A lexical environment context for the visitor.
5141 */
5142 function visitEachChild<T extends Node>(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined;
5143}
5144declare namespace ts {
5145 function getTsBuildInfoEmitOutputFilePath(options: CompilerOptions): string | undefined;
5146 function getOutputFileNames(commandLine: ParsedCommandLine, inputFileName: string, ignoreCase: boolean): readonly string[];
5147 function createPrinter(printerOptions?: PrinterOptions, handlers?: PrintHandlers): Printer;
5148}
5149declare namespace ts {
5150 export function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string | undefined;
5151 export function resolveTripleslashReference(moduleName: string, containingFile: string): string;
5152 export function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
5153 export function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
5154 export interface FormatDiagnosticsHost {
5155 getCurrentDirectory(): string;
5156 getCanonicalFileName(fileName: string): string;
5157 getNewLine(): string;
5158 }
5159 export function formatDiagnostics(diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost): string;
5160 export function formatDiagnostic(diagnostic: Diagnostic, host: FormatDiagnosticsHost): string;
5161 export function formatDiagnosticsWithColorAndContext(diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost): string;
5162 export function flattenDiagnosticMessageText(diag: string | DiagnosticMessageChain | undefined, newLine: string, indent?: number): string;
5163 /**
5164 * Calculates the resulting resolution mode for some reference in some file - this is generally the explicitly
5165 * provided resolution mode in the reference, unless one is not present, in which case it is the mode of the containing file.
5166 */
5167 export function getModeForFileReference(ref: FileReference | string, containingFileMode: SourceFile["impliedNodeFormat"]): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
5168 /**
5169 * Calculates the final resolution mode for an import at some index within a file's imports list. This is generally the explicitly
5170 * defined mode of the import if provided, or, if not, the mode of the containing file (with some exceptions: import=require is always commonjs, dynamic import is always esm).
5171 * If you have an actual import node, prefer using getModeForUsageLocation on the reference string node.
5172 * @param file File to fetch the resolution mode within
5173 * @param index Index into the file's complete resolution list to get the resolution of - this is a concatenation of the file's imports and module augmentations
5174 */
5175 export function getModeForResolutionAtIndex(file: SourceFile, index: number): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
5176 /**
5177 * Calculates the final resolution mode for a given module reference node. This is generally the explicitly provided resolution mode, if
5178 * one exists, or the mode of the containing source file. (Excepting import=require, which is always commonjs, and dynamic import, which is always esm).
5179 * Notably, this function always returns `undefined` if the containing file has an `undefined` `impliedNodeFormat` - this field is only set when
5180 * `moduleResolution` is `node16`+.
5181 * @param file The file the import or import-like reference is contained within
5182 * @param usage The module reference string
5183 * @returns The final resolution mode of the import
5184 */
5185 export function getModeForUsageLocation(file: {
5186 impliedNodeFormat?: SourceFile["impliedNodeFormat"];
5187 }, usage: StringLiteralLike): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
5188 export function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): readonly Diagnostic[];
5189 /**
5190 * A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the
5191 * `options` parameter.
5192 *
5193 * @param fileName The normalized absolute path to check the format of (it need not exist on disk)
5194 * @param [packageJsonInfoCache] A cache for package file lookups - it's best to have a cache when this function is called often
5195 * @param host The ModuleResolutionHost which can perform the filesystem lookups for package json data
5196 * @param options The compiler options to perform the analysis under - relevant options are `moduleResolution` and `traceResolution`
5197 * @returns `undefined` if the path has no relevant implied format, `ModuleKind.ESNext` for esm format, and `ModuleKind.CommonJS` for cjs format
5198 */
5199 export function getImpliedNodeFormatForFile(fileName: Path, packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions): ModuleKind.ESNext | ModuleKind.CommonJS | undefined;
5200 /**
5201 * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions'
5202 * that represent a compilation unit.
5203 *
5204 * Creating a program proceeds from a set of root files, expanding the set of inputs by following imports and
5205 * triple-slash-reference-path directives transitively. '@types' and triple-slash-reference-types are also pulled in.
5206 *
5207 * @param createProgramOptions - The options for creating a program.
5208 * @returns A 'Program' object.
5209 */
5210 export function createProgram(createProgramOptions: CreateProgramOptions): Program;
5211 /**
5212 * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions'
5213 * that represent a compilation unit.
5214 *
5215 * Creating a program proceeds from a set of root files, expanding the set of inputs by following imports and
5216 * triple-slash-reference-path directives transitively. '@types' and triple-slash-reference-types are also pulled in.
5217 *
5218 * @param rootNames - A set of root files.
5219 * @param options - The compiler options which should be used.
5220 * @param host - The host interacts with the underlying file system.
5221 * @param oldProgram - Reuses an old program structure.
5222 * @param configFileParsingDiagnostics - error during config file parsing
5223 * @returns A 'Program' object.
5224 */
5225 export function createProgram(rootNames: readonly string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program, configFileParsingDiagnostics?: readonly Diagnostic[]): Program;
5226 /** @deprecated */ export interface ResolveProjectReferencePathHost {
5227 fileExists(fileName: string): boolean;
5228 }
5229 /**
5230 * Returns the target config filename of a project reference.
5231 * Note: The file might not exist.
5232 */
5233 export function resolveProjectReferencePath(ref: ProjectReference): ResolvedConfigFileName;
5234 /** @deprecated */ export function resolveProjectReferencePath(host: ResolveProjectReferencePathHost, ref: ProjectReference): ResolvedConfigFileName;
5235 export {};
5236}
5237declare namespace ts {
5238 interface EmitOutput {
5239 outputFiles: OutputFile[];
5240 emitSkipped: boolean;
5241 }
5242 interface OutputFile {
5243 name: string;
5244 writeByteOrderMark: boolean;
5245 text: string;
5246 }
5247}
5248declare namespace ts {
5249 type AffectedFileResult<T> = {
5250 result: T;
5251 affected: SourceFile | Program;
5252 } | undefined;
5253 interface BuilderProgramHost {
5254 /**
5255 * return true if file names are treated with case sensitivity
5256 */
5257 useCaseSensitiveFileNames(): boolean;
5258 /**
5259 * If provided this would be used this hash instead of actual file shape text for detecting changes
5260 */
5261 createHash?: (data: string) => string;
5262 /**
5263 * When emit or emitNextAffectedFile are called without writeFile,
5264 * this callback if present would be used to write files
5265 */
5266 writeFile?: WriteFileCallback;
5267 }
5268 /**
5269 * Builder to manage the program state changes
5270 */
5271 interface BuilderProgram {
5272 /**
5273 * Returns current program
5274 */
5275 getProgram(): Program;
5276 /**
5277 * Get compiler options of the program
5278 */
5279 getCompilerOptions(): CompilerOptions;
5280 /**
5281 * Get the source file in the program with file name
5282 */
5283 getSourceFile(fileName: string): SourceFile | undefined;
5284 /**
5285 * Get a list of files in the program
5286 */
5287 getSourceFiles(): readonly SourceFile[];
5288 /**
5289 * Get the diagnostics for compiler options
5290 */
5291 getOptionsDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
5292 /**
5293 * Get the diagnostics that dont belong to any file
5294 */
5295 getGlobalDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
5296 /**
5297 * Get the diagnostics from config file parsing
5298 */
5299 getConfigFileParsingDiagnostics(): readonly Diagnostic[];
5300 /**
5301 * Get the syntax diagnostics, for all source files if source file is not supplied
5302 */
5303 getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
5304 /**
5305 * Get the declaration diagnostics, for all source files if source file is not supplied
5306 */
5307 getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[];
5308 /**
5309 * Get all the dependencies of the file
5310 */
5311 getAllDependencies(sourceFile: SourceFile): readonly string[];
5312 /**
5313 * Gets the semantic diagnostics from the program corresponding to this state of file (if provided) or whole program
5314 * The semantic diagnostics are cached and managed here
5315 * Note that it is assumed that when asked about semantic diagnostics through this API,
5316 * the file has been taken out of affected files so it is safe to use cache or get from program and cache the diagnostics
5317 * In case of SemanticDiagnosticsBuilderProgram if the source file is not provided,
5318 * it will iterate through all the affected files, to ensure that cache stays valid and yet provide a way to get all semantic diagnostics
5319 */
5320 getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
5321 /**
5322 * Emits the JavaScript and declaration files.
5323 * When targetSource file is specified, emits the files corresponding to that source file,
5324 * otherwise for the whole program.
5325 * In case of EmitAndSemanticDiagnosticsBuilderProgram, when targetSourceFile is specified,
5326 * it is assumed that that file is handled from affected file list. If targetSourceFile is not specified,
5327 * it will only emit all the affected files instead of whole program
5328 *
5329 * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host
5330 * in that order would be used to write the files
5331 */
5332 emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult;
5333 /**
5334 * Get the current directory of the program
5335 */
5336 getCurrentDirectory(): string;
5337 }
5338 /**
5339 * The builder that caches the semantic diagnostics for the program and handles the changed files and affected files
5340 */
5341 interface SemanticDiagnosticsBuilderProgram extends BuilderProgram {
5342 /**
5343 * Gets the semantic diagnostics from the program for the next affected file and caches it
5344 * Returns undefined if the iteration is complete
5345 */
5346 getSemanticDiagnosticsOfNextAffectedFile(cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean): AffectedFileResult<readonly Diagnostic[]>;
5347 }
5348 /**
5349 * The builder that can handle the changes in program and iterate through changed file to emit the files
5350 * The semantic diagnostics are cached per file and managed by clearing for the changed/affected files
5351 */
5352 interface EmitAndSemanticDiagnosticsBuilderProgram extends SemanticDiagnosticsBuilderProgram {
5353 /**
5354 * Emits the next affected file's emit result (EmitResult and sourceFiles emitted) or returns undefined if iteration is complete
5355 * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host
5356 * in that order would be used to write the files
5357 */
5358 emitNextAffectedFile(writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): AffectedFileResult<EmitResult>;
5359 }
5360 /**
5361 * Create the builder to manage semantic diagnostics and cache them
5362 */
5363 function createSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[]): SemanticDiagnosticsBuilderProgram;
5364 function createSemanticDiagnosticsBuilderProgram(rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]): SemanticDiagnosticsBuilderProgram;
5365 /**
5366 * Create the builder that can handle the changes in program and iterate through changed files
5367 * to emit the those files and manage semantic diagnostics cache as well
5368 */
5369 function createEmitAndSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[]): EmitAndSemanticDiagnosticsBuilderProgram;
5370 function createEmitAndSemanticDiagnosticsBuilderProgram(rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]): EmitAndSemanticDiagnosticsBuilderProgram;
5371 /**
5372 * Creates a builder thats just abstraction over program and can be used with watch
5373 */
5374 function createAbstractBuilder(newProgram: Program, host: BuilderProgramHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[]): BuilderProgram;
5375 function createAbstractBuilder(rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]): BuilderProgram;
5376}
5377declare namespace ts {
5378 interface ReadBuildProgramHost {
5379 useCaseSensitiveFileNames(): boolean;
5380 getCurrentDirectory(): string;
5381 readFile(fileName: string): string | undefined;
5382 }
5383 function readBuilderProgram(compilerOptions: CompilerOptions, host: ReadBuildProgramHost): EmitAndSemanticDiagnosticsBuilderProgram | undefined;
5384 function createIncrementalCompilerHost(options: CompilerOptions, system?: System): CompilerHost;
5385 interface IncrementalProgramOptions<T extends BuilderProgram> {
5386 rootNames: readonly string[];
5387 options: CompilerOptions;
5388 configFileParsingDiagnostics?: readonly Diagnostic[];
5389 projectReferences?: readonly ProjectReference[];
5390 host?: CompilerHost;
5391 createProgram?: CreateProgram<T>;
5392 }
5393 function createIncrementalProgram<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>({ rootNames, options, configFileParsingDiagnostics, projectReferences, host, createProgram }: IncrementalProgramOptions<T>): T;
5394 type WatchStatusReporter = (diagnostic: Diagnostic, newLine: string, options: CompilerOptions, errorCount?: number) => void;
5395 /** Create the program with rootNames and options, if they are undefined, oldProgram and new configFile diagnostics create new program */
5396 type CreateProgram<T extends BuilderProgram> = (rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: T, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[] | undefined) => T;
5397 /** Host that has watch functionality used in --watch mode */
5398 interface WatchHost {
5399 /** If provided, called with Diagnostic message that informs about change in watch status */
5400 onWatchStatusChange?(diagnostic: Diagnostic, newLine: string, options: CompilerOptions, errorCount?: number): void;
5401 /** Used to watch changes in source files, missing files needed to update the program or config file */
5402 watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: WatchOptions): FileWatcher;
5403 /** Used to watch resolved module's failed lookup locations, config file specs, type roots where auto type reference directives are added */
5404 watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: WatchOptions): FileWatcher;
5405 /** If provided, will be used to set delayed compilation, so that multiple changes in short span are compiled together */
5406 setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
5407 /** If provided, will be used to reset existing delayed compilation */
5408 clearTimeout?(timeoutId: any): void;
5409 }
5410 interface ProgramHost<T extends BuilderProgram> {
5411 /**
5412 * Used to create the program when need for program creation or recreation detected
5413 */
5414 createProgram: CreateProgram<T>;
5415 useCaseSensitiveFileNames(): boolean;
5416 getNewLine(): string;
5417 getCurrentDirectory(): string;
5418 getDefaultLibFileName(options: CompilerOptions): string;
5419 getDefaultLibLocation?(): string;
5420 createHash?(data: string): string;
5421 /**
5422 * Use to check file presence for source files and
5423 * if resolveModuleNames is not provided (complier is in charge of module resolution) then module files as well
5424 */
5425 fileExists(path: string): boolean;
5426 /**
5427 * Use to read file text for source files and
5428 * if resolveModuleNames is not provided (complier is in charge of module resolution) then module files as well
5429 */
5430 readFile(path: string, encoding?: string): string | undefined;
5431 /** If provided, used for module resolution as well as to handle directory structure */
5432 directoryExists?(path: string): boolean;
5433 /** If provided, used in resolutions as well as handling directory structure */
5434 getDirectories?(path: string): string[];
5435 /** If provided, used to cache and handle directory structure modifications */
5436 readDirectory?(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
5437 /** Symbol links resolution */
5438 realpath?(path: string): string;
5439 /** If provided would be used to write log about compilation */
5440 trace?(s: string): void;
5441 /** If provided is used to get the environment variable */
5442 getEnvironmentVariable?(name: string): string | undefined;
5443 /** If provided, used to resolve the module names, otherwise typescript's default module resolution */
5444 resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[];
5445 /** If provided, used to resolve type reference directives, otherwise typescript's default resolution */
5446 resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
5447 /** If provided along with custom resolveModuleNames or resolveTypeReferenceDirectives, used to determine if unchanged file path needs to re-resolve modules/type reference directives */
5448 hasInvalidatedResolutions?(filePath: Path): boolean;
5449 /**
5450 * Returns the module resolution cache used by a provided `resolveModuleNames` implementation so that any non-name module resolution operations (eg, package.json lookup) can reuse it
5451 */
5452 getModuleResolutionCache?(): ModuleResolutionCache | undefined;
5453 }
5454 interface WatchCompilerHost<T extends BuilderProgram> extends ProgramHost<T>, WatchHost {
5455 /** Instead of using output d.ts file from project reference, use its source file */
5456 useSourceOfProjectReferenceRedirect?(): boolean;
5457 /** If provided, use this method to get parsed command lines for referenced projects */
5458 getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
5459 /** If provided, callback to invoke after every new program creation */
5460 afterProgramCreate?(program: T): void;
5461 }
5462 /**
5463 * Host to create watch with root files and options
5464 */
5465 interface WatchCompilerHostOfFilesAndCompilerOptions<T extends BuilderProgram> extends WatchCompilerHost<T> {
5466 /** root files to use to generate program */
5467 rootFiles: string[];
5468 /** Compiler options */
5469 options: CompilerOptions;
5470 watchOptions?: WatchOptions;
5471 /** Project References */
5472 projectReferences?: readonly ProjectReference[];
5473 }
5474 /**
5475 * Host to create watch with config file
5476 */
5477 interface WatchCompilerHostOfConfigFile<T extends BuilderProgram> extends WatchCompilerHost<T>, ConfigFileDiagnosticsReporter {
5478 /** Name of the config file to compile */
5479 configFileName: string;
5480 /** Options to extend */
5481 optionsToExtend?: CompilerOptions;
5482 watchOptionsToExtend?: WatchOptions;
5483 extraFileExtensions?: readonly FileExtensionInfo[];
5484 /**
5485 * Used to generate source file names from the config file and its include, exclude, files rules
5486 * and also to cache the directory stucture
5487 */
5488 readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
5489 }
5490 interface Watch<T> {
5491 /** Synchronize with host and get updated program */
5492 getProgram(): T;
5493 /** Closes the watch */
5494 close(): void;
5495 }
5496 /**
5497 * Creates the watch what generates program using the config file
5498 */
5499 interface WatchOfConfigFile<T> extends Watch<T> {
5500 }
5501 /**
5502 * Creates the watch that generates program using the root files and compiler options
5503 */
5504 interface WatchOfFilesAndCompilerOptions<T> extends Watch<T> {
5505 /** Updates the root files in the program, only if this is not config file compilation */
5506 updateRootFileNames(fileNames: string[]): void;
5507 }
5508 /**
5509 * Create the watch compiler host for either configFile or fileNames and its options
5510 */
5511 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>;
5512 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>;
5513 /**
5514 * Creates the watch from the host for root files and compiler options
5515 */
5516 function createWatchProgram<T extends BuilderProgram>(host: WatchCompilerHostOfFilesAndCompilerOptions<T>): WatchOfFilesAndCompilerOptions<T>;
5517 /**
5518 * Creates the watch from the host for config file
5519 */
5520 function createWatchProgram<T extends BuilderProgram>(host: WatchCompilerHostOfConfigFile<T>): WatchOfConfigFile<T>;
5521}
5522declare namespace ts {
5523 interface BuildOptions {
5524 dry?: boolean;
5525 force?: boolean;
5526 verbose?: boolean;
5527 incremental?: boolean;
5528 assumeChangesOnlyAffectDirectDependencies?: boolean;
5529 traceResolution?: boolean;
5530 [option: string]: CompilerOptionsValue | undefined;
5531 }
5532 type ReportEmitErrorSummary = (errorCount: number, filesInError: (ReportFileInError | undefined)[]) => void;
5533 interface ReportFileInError {
5534 fileName: string;
5535 line: number;
5536 }
5537 interface SolutionBuilderHostBase<T extends BuilderProgram> extends ProgramHost<T> {
5538 createDirectory?(path: string): void;
5539 /**
5540 * Should provide create directory and writeFile if done of invalidatedProjects is not invoked with
5541 * writeFileCallback
5542 */
5543 writeFile?(path: string, data: string, writeByteOrderMark?: boolean): void;
5544 getCustomTransformers?: (project: string) => CustomTransformers | undefined;
5545 getModifiedTime(fileName: string): Date | undefined;
5546 setModifiedTime(fileName: string, date: Date): void;
5547 deleteFile(fileName: string): void;
5548 getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
5549 reportDiagnostic: DiagnosticReporter;
5550 reportSolutionBuilderStatus: DiagnosticReporter;
5551 afterProgramEmitAndDiagnostics?(program: T): void;
5552 }
5553 interface SolutionBuilderHost<T extends BuilderProgram> extends SolutionBuilderHostBase<T> {
5554 reportErrorSummary?: ReportEmitErrorSummary;
5555 }
5556 interface SolutionBuilderWithWatchHost<T extends BuilderProgram> extends SolutionBuilderHostBase<T>, WatchHost {
5557 }
5558 interface SolutionBuilder<T extends BuilderProgram> {
5559 build(project?: string, cancellationToken?: CancellationToken, writeFile?: WriteFileCallback, getCustomTransformers?: (project: string) => CustomTransformers): ExitStatus;
5560 clean(project?: string): ExitStatus;
5561 buildReferences(project: string, cancellationToken?: CancellationToken, writeFile?: WriteFileCallback, getCustomTransformers?: (project: string) => CustomTransformers): ExitStatus;
5562 cleanReferences(project?: string): ExitStatus;
5563 getNextInvalidatedProject(cancellationToken?: CancellationToken): InvalidatedProject<T> | undefined;
5564 }
5565 /**
5566 * Create a function that reports watch status by writing to the system and handles the formating of the diagnostic
5567 */
5568 function createBuilderStatusReporter(system: System, pretty?: boolean): DiagnosticReporter;
5569 function createSolutionBuilderHost<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>(system?: System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportSolutionBuilderStatus?: DiagnosticReporter, reportErrorSummary?: ReportEmitErrorSummary): SolutionBuilderHost<T>;
5570 function createSolutionBuilderWithWatchHost<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>(system?: System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportSolutionBuilderStatus?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter): SolutionBuilderWithWatchHost<T>;
5571 function createSolutionBuilder<T extends BuilderProgram>(host: SolutionBuilderHost<T>, rootNames: readonly string[], defaultOptions: BuildOptions): SolutionBuilder<T>;
5572 function createSolutionBuilderWithWatch<T extends BuilderProgram>(host: SolutionBuilderWithWatchHost<T>, rootNames: readonly string[], defaultOptions: BuildOptions, baseWatchOptions?: WatchOptions): SolutionBuilder<T>;
5573 enum InvalidatedProjectKind {
5574 Build = 0,
5575 UpdateBundle = 1,
5576 UpdateOutputFileStamps = 2
5577 }
5578 interface InvalidatedProjectBase {
5579 readonly kind: InvalidatedProjectKind;
5580 readonly project: ResolvedConfigFileName;
5581 /**
5582 * To dispose this project and ensure that all the necessary actions are taken and state is updated accordingly
5583 */
5584 done(cancellationToken?: CancellationToken, writeFile?: WriteFileCallback, customTransformers?: CustomTransformers): ExitStatus;
5585 getCompilerOptions(): CompilerOptions;
5586 getCurrentDirectory(): string;
5587 }
5588 interface UpdateOutputFileStampsProject extends InvalidatedProjectBase {
5589 readonly kind: InvalidatedProjectKind.UpdateOutputFileStamps;
5590 updateOutputFileStatmps(): void;
5591 }
5592 interface BuildInvalidedProject<T extends BuilderProgram> extends InvalidatedProjectBase {
5593 readonly kind: InvalidatedProjectKind.Build;
5594 getBuilderProgram(): T | undefined;
5595 getProgram(): Program | undefined;
5596 getSourceFile(fileName: string): SourceFile | undefined;
5597 getSourceFiles(): readonly SourceFile[];
5598 getOptionsDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
5599 getGlobalDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
5600 getConfigFileParsingDiagnostics(): readonly Diagnostic[];
5601 getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
5602 getAllDependencies(sourceFile: SourceFile): readonly string[];
5603 getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
5604 getSemanticDiagnosticsOfNextAffectedFile(cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean): AffectedFileResult<readonly Diagnostic[]>;
5605 emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult | undefined;
5606 }
5607 interface UpdateBundleProject<T extends BuilderProgram> extends InvalidatedProjectBase {
5608 readonly kind: InvalidatedProjectKind.UpdateBundle;
5609 emit(writeFile?: WriteFileCallback, customTransformers?: CustomTransformers): EmitResult | BuildInvalidedProject<T> | undefined;
5610 }
5611 type InvalidatedProject<T extends BuilderProgram> = UpdateOutputFileStampsProject | BuildInvalidedProject<T> | UpdateBundleProject<T>;
5612}
5613declare namespace ts.server {
5614 type ActionSet = "action::set";
5615 type ActionInvalidate = "action::invalidate";
5616 type ActionPackageInstalled = "action::packageInstalled";
5617 type EventTypesRegistry = "event::typesRegistry";
5618 type EventBeginInstallTypes = "event::beginInstallTypes";
5619 type EventEndInstallTypes = "event::endInstallTypes";
5620 type EventInitializationFailed = "event::initializationFailed";
5621}
5622declare namespace ts.server {
5623 interface TypingInstallerResponse {
5624 readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed;
5625 }
5626 interface TypingInstallerRequestWithProjectName {
5627 readonly projectName: string;
5628 }
5629 interface DiscoverTypings extends TypingInstallerRequestWithProjectName {
5630 readonly fileNames: string[];
5631 readonly projectRootPath: Path;
5632 readonly compilerOptions: CompilerOptions;
5633 readonly watchOptions?: WatchOptions;
5634 readonly typeAcquisition: TypeAcquisition;
5635 readonly unresolvedImports: SortedReadonlyArray<string>;
5636 readonly cachePath?: string;
5637 readonly kind: "discover";
5638 }
5639 interface CloseProject extends TypingInstallerRequestWithProjectName {
5640 readonly kind: "closeProject";
5641 }
5642 interface TypesRegistryRequest {
5643 readonly kind: "typesRegistry";
5644 }
5645 interface InstallPackageRequest extends TypingInstallerRequestWithProjectName {
5646 readonly kind: "installPackage";
5647 readonly fileName: Path;
5648 readonly packageName: string;
5649 readonly projectRootPath: Path;
5650 }
5651 interface PackageInstalledResponse extends ProjectResponse {
5652 readonly kind: ActionPackageInstalled;
5653 readonly success: boolean;
5654 readonly message: string;
5655 }
5656 interface InitializationFailedResponse extends TypingInstallerResponse {
5657 readonly kind: EventInitializationFailed;
5658 readonly message: string;
5659 readonly stack?: string;
5660 }
5661 interface ProjectResponse extends TypingInstallerResponse {
5662 readonly projectName: string;
5663 }
5664 interface InvalidateCachedTypings extends ProjectResponse {
5665 readonly kind: ActionInvalidate;
5666 }
5667 interface InstallTypes extends ProjectResponse {
5668 readonly kind: EventBeginInstallTypes | EventEndInstallTypes;
5669 readonly eventId: number;
5670 readonly typingsInstallerVersion: string;
5671 readonly packagesToInstall: readonly string[];
5672 }
5673 interface BeginInstallTypes extends InstallTypes {
5674 readonly kind: EventBeginInstallTypes;
5675 }
5676 interface EndInstallTypes extends InstallTypes {
5677 readonly kind: EventEndInstallTypes;
5678 readonly installSuccess: boolean;
5679 }
5680 interface SetTypings extends ProjectResponse {
5681 readonly typeAcquisition: TypeAcquisition;
5682 readonly compilerOptions: CompilerOptions;
5683 readonly typings: string[];
5684 readonly unresolvedImports: SortedReadonlyArray<string>;
5685 readonly kind: ActionSet;
5686 }
5687}
5688declare namespace ts {
5689 interface Node {
5690 getSourceFile(): SourceFile;
5691 getChildCount(sourceFile?: SourceFile): number;
5692 getChildAt(index: number, sourceFile?: SourceFile): Node;
5693 getChildren(sourceFile?: SourceFile): Node[];
5694 getStart(sourceFile?: SourceFile, includeJsDocComment?: boolean): number;
5695 getFullStart(): number;
5696 getEnd(): number;
5697 getWidth(sourceFile?: SourceFileLike): number;
5698 getFullWidth(): number;
5699 getLeadingTriviaWidth(sourceFile?: SourceFile): number;
5700 getFullText(sourceFile?: SourceFile): string;
5701 getText(sourceFile?: SourceFile): string;
5702 getFirstToken(sourceFile?: SourceFile): Node | undefined;
5703 getLastToken(sourceFile?: SourceFile): Node | undefined;
5704 forEachChild<T>(cbNode: (node: Node) => T | undefined, cbNodeArray?: (nodes: NodeArray<Node>) => T | undefined): T | undefined;
5705 }
5706 interface Identifier {
5707 readonly text: string;
5708 }
5709 interface PrivateIdentifier {
5710 readonly text: string;
5711 }
5712 interface Symbol {
5713 readonly name: string;
5714 getFlags(): SymbolFlags;
5715 getEscapedName(): __String;
5716 getName(): string;
5717 getDeclarations(): Declaration[] | undefined;
5718 getDocumentationComment(typeChecker: TypeChecker | undefined): SymbolDisplayPart[];
5719 getJsDocTags(checker?: TypeChecker): JSDocTagInfo[];
5720 }
5721 interface Type {
5722 getFlags(): TypeFlags;
5723 getSymbol(): Symbol | undefined;
5724 getProperties(): Symbol[];
5725 getProperty(propertyName: string): Symbol | undefined;
5726 getApparentProperties(): Symbol[];
5727 getCallSignatures(): readonly Signature[];
5728 getConstructSignatures(): readonly Signature[];
5729 getStringIndexType(): Type | undefined;
5730 getNumberIndexType(): Type | undefined;
5731 getBaseTypes(): BaseType[] | undefined;
5732 getNonNullableType(): Type;
5733 getConstraint(): Type | undefined;
5734 getDefault(): Type | undefined;
5735 isUnion(): this is UnionType;
5736 isIntersection(): this is IntersectionType;
5737 isUnionOrIntersection(): this is UnionOrIntersectionType;
5738 isLiteral(): this is LiteralType;
5739 isStringLiteral(): this is StringLiteralType;
5740 isNumberLiteral(): this is NumberLiteralType;
5741 isTypeParameter(): this is TypeParameter;
5742 isClassOrInterface(): this is InterfaceType;
5743 isClass(): this is InterfaceType;
5744 isIndexType(): this is IndexType;
5745 }
5746 interface TypeReference {
5747 typeArguments?: readonly Type[];
5748 }
5749 interface Signature {
5750 getDeclaration(): SignatureDeclaration;
5751 getTypeParameters(): TypeParameter[] | undefined;
5752 getParameters(): Symbol[];
5753 getTypeParameterAtPosition(pos: number): Type;
5754 getReturnType(): Type;
5755 getDocumentationComment(typeChecker: TypeChecker | undefined): SymbolDisplayPart[];
5756 getJsDocTags(): JSDocTagInfo[];
5757 }
5758 interface SourceFile {
5759 getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
5760 getLineEndOfPosition(pos: number): number;
5761 getLineStarts(): readonly number[];
5762 getPositionOfLineAndCharacter(line: number, character: number): number;
5763 update(newText: string, textChangeRange: TextChangeRange): SourceFile;
5764 }
5765 interface SourceFileLike {
5766 getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
5767 }
5768 interface SourceMapSource {
5769 getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
5770 }
5771 /**
5772 * Represents an immutable snapshot of a script at a specified time.Once acquired, the
5773 * snapshot is observably immutable. i.e. the same calls with the same parameters will return
5774 * the same values.
5775 */
5776 interface IScriptSnapshot {
5777 /** Gets a portion of the script snapshot specified by [start, end). */
5778 getText(start: number, end: number): string;
5779 /** Gets the length of this script snapshot. */
5780 getLength(): number;
5781 /**
5782 * Gets the TextChangeRange that describe how the text changed between this text and
5783 * an older version. This information is used by the incremental parser to determine
5784 * what sections of the script need to be re-parsed. 'undefined' can be returned if the
5785 * change range cannot be determined. However, in that case, incremental parsing will
5786 * not happen and the entire document will be re - parsed.
5787 */
5788 getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange | undefined;
5789 /** Releases all resources held by this script snapshot */
5790 dispose?(): void;
5791 }
5792 namespace ScriptSnapshot {
5793 function fromString(text: string): IScriptSnapshot;
5794 }
5795 interface PreProcessedFileInfo {
5796 referencedFiles: FileReference[];
5797 typeReferenceDirectives: FileReference[];
5798 libReferenceDirectives: FileReference[];
5799 importedFiles: FileReference[];
5800 ambientExternalModules?: string[];
5801 isLibFile: boolean;
5802 }
5803 interface HostCancellationToken {
5804 isCancellationRequested(): boolean;
5805 }
5806 interface InstallPackageOptions {
5807 fileName: Path;
5808 packageName: string;
5809 }
5810 interface PerformanceEvent {
5811 kind: "UpdateGraph" | "CreatePackageJsonAutoImportProvider";
5812 durationMs: number;
5813 }
5814 enum LanguageServiceMode {
5815 Semantic = 0,
5816 PartialSemantic = 1,
5817 Syntactic = 2
5818 }
5819 interface IncompleteCompletionsCache {
5820 get(): CompletionInfo | undefined;
5821 set(response: CompletionInfo): void;
5822 clear(): void;
5823 }
5824 interface LanguageServiceHost extends GetEffectiveTypeRootsHost, MinimalResolutionCacheHost {
5825 getCompilationSettings(): CompilerOptions;
5826 getNewLine?(): string;
5827 getProjectVersion?(): string;
5828 getScriptFileNames(): string[];
5829 getScriptKind?(fileName: string): ScriptKind;
5830 getScriptVersion(fileName: string): string;
5831 getScriptSnapshot(fileName: string): IScriptSnapshot | undefined;
5832 getProjectReferences?(): readonly ProjectReference[] | undefined;
5833 getLocalizedDiagnosticMessages?(): any;
5834 getCancellationToken?(): HostCancellationToken;
5835 getCurrentDirectory(): string;
5836 getDefaultLibFileName(options: CompilerOptions): string;
5837 log?(s: string): void;
5838 trace?(s: string): void;
5839 error?(s: string): void;
5840 useCaseSensitiveFileNames?(): boolean;
5841 readDirectory?(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
5842 realpath?(path: string): string;
5843 readFile(path: string, encoding?: string): string | undefined;
5844 fileExists(path: string): boolean;
5845 getTypeRootsVersion?(): number;
5846 resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[];
5847 getResolvedModuleWithFailedLookupLocationsFromCache?(modulename: string, containingFile: string, resolutionMode?: ModuleKind.CommonJS | ModuleKind.ESNext): ResolvedModuleWithFailedLookupLocations | undefined;
5848 resolveTypeReferenceDirectives?(typeDirectiveNames: string[] | FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
5849 getDirectories?(directoryName: string): string[];
5850 /**
5851 * Gets a set of custom transformers to use during emit.
5852 */
5853 getCustomTransformers?(): CustomTransformers | undefined;
5854 isKnownTypesPackageName?(name: string): boolean;
5855 installPackage?(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
5856 writeFile?(fileName: string, content: string): void;
5857 getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
5858 }
5859 type WithMetadata<T> = T & {
5860 metadata?: unknown;
5861 };
5862 enum SemanticClassificationFormat {
5863 Original = "original",
5864 TwentyTwenty = "2020"
5865 }
5866 interface LanguageService {
5867 /** This is used as a part of restarting the language service. */
5868 cleanupSemanticCache(): void;
5869 /**
5870 * Gets errors indicating invalid syntax in a file.
5871 *
5872 * In English, "this cdeo have, erorrs" is syntactically invalid because it has typos,
5873 * grammatical errors, and misplaced punctuation. Likewise, examples of syntax
5874 * errors in TypeScript are missing parentheses in an `if` statement, mismatched
5875 * curly braces, and using a reserved keyword as a variable name.
5876 *
5877 * These diagnostics are inexpensive to compute and don't require knowledge of
5878 * other files. Note that a non-empty result increases the likelihood of false positives
5879 * from `getSemanticDiagnostics`.
5880 *
5881 * While these represent the majority of syntax-related diagnostics, there are some
5882 * that require the type system, which will be present in `getSemanticDiagnostics`.
5883 *
5884 * @param fileName A path to the file you want syntactic diagnostics for
5885 */
5886 getSyntacticDiagnostics(fileName: string): DiagnosticWithLocation[];
5887 /**
5888 * Gets warnings or errors indicating type system issues in a given file.
5889 * Requesting semantic diagnostics may start up the type system and
5890 * run deferred work, so the first call may take longer than subsequent calls.
5891 *
5892 * Unlike the other get*Diagnostics functions, these diagnostics can potentially not
5893 * include a reference to a source file. Specifically, the first time this is called,
5894 * it will return global diagnostics with no associated location.
5895 *
5896 * To contrast the differences between semantic and syntactic diagnostics, consider the
5897 * sentence: "The sun is green." is syntactically correct; those are real English words with
5898 * correct sentence structure. However, it is semantically invalid, because it is not true.
5899 *
5900 * @param fileName A path to the file you want semantic diagnostics for
5901 */
5902 getSemanticDiagnostics(fileName: string): Diagnostic[];
5903 /**
5904 * Gets suggestion diagnostics for a specific file. These diagnostics tend to
5905 * proactively suggest refactors, as opposed to diagnostics that indicate
5906 * potentially incorrect runtime behavior.
5907 *
5908 * @param fileName A path to the file you want semantic diagnostics for
5909 */
5910 getSuggestionDiagnostics(fileName: string): DiagnosticWithLocation[];
5911 /**
5912 * Gets global diagnostics related to the program configuration and compiler options.
5913 */
5914 getCompilerOptionsDiagnostics(): Diagnostic[];
5915 /** @deprecated Use getEncodedSyntacticClassifications instead. */
5916 getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[];
5917 getSyntacticClassifications(fileName: string, span: TextSpan, format: SemanticClassificationFormat): ClassifiedSpan[] | ClassifiedSpan2020[];
5918 /** @deprecated Use getEncodedSemanticClassifications instead. */
5919 getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[];
5920 getSemanticClassifications(fileName: string, span: TextSpan, format: SemanticClassificationFormat): ClassifiedSpan[] | ClassifiedSpan2020[];
5921 /** Encoded as triples of [start, length, ClassificationType]. */
5922 getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications;
5923 /**
5924 * Gets semantic highlights information for a particular file. Has two formats, an older
5925 * version used by VS and a format used by VS Code.
5926 *
5927 * @param fileName The path to the file
5928 * @param position A text span to return results within
5929 * @param format Which format to use, defaults to "original"
5930 * @returns a number array encoded as triples of [start, length, ClassificationType, ...].
5931 */
5932 getEncodedSemanticClassifications(fileName: string, span: TextSpan, format?: SemanticClassificationFormat): Classifications;
5933 /**
5934 * Gets completion entries at a particular position in a file.
5935 *
5936 * @param fileName The path to the file
5937 * @param position A zero-based index of the character where you want the entries
5938 * @param options An object describing how the request was triggered and what kinds
5939 * of code actions can be returned with the completions.
5940 * @param formattingSettings settings needed for calling formatting functions.
5941 */
5942 getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined, formattingSettings?: FormatCodeSettings): WithMetadata<CompletionInfo> | undefined;
5943 /**
5944 * Gets the extended details for a completion entry retrieved from `getCompletionsAtPosition`.
5945 *
5946 * @param fileName The path to the file
5947 * @param position A zero based index of the character where you want the entries
5948 * @param entryName The `name` from an existing completion which came from `getCompletionsAtPosition`
5949 * @param formatOptions How should code samples in the completions be formatted, can be undefined for backwards compatibility
5950 * @param source `source` property from the completion entry
5951 * @param preferences User settings, can be undefined for backwards compatibility
5952 * @param data `data` property from the completion entry
5953 */
5954 getCompletionEntryDetails(fileName: string, position: number, entryName: string, formatOptions: FormatCodeOptions | FormatCodeSettings | undefined, source: string | undefined, preferences: UserPreferences | undefined, data: CompletionEntryData | undefined): CompletionEntryDetails | undefined;
5955 getCompletionEntrySymbol(fileName: string, position: number, name: string, source: string | undefined): Symbol | undefined;
5956 /**
5957 * Gets semantic information about the identifier at a particular position in a
5958 * file. Quick info is what you typically see when you hover in an editor.
5959 *
5960 * @param fileName The path to the file
5961 * @param position A zero-based index of the character where you want the quick info
5962 */
5963 getQuickInfoAtPosition(fileName: string, position: number): QuickInfo | undefined;
5964 getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan | undefined;
5965 getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan | undefined;
5966 getSignatureHelpItems(fileName: string, position: number, options: SignatureHelpItemsOptions | undefined): SignatureHelpItems | undefined;
5967 getRenameInfo(fileName: string, position: number, preferences: UserPreferences): RenameInfo;
5968 /** @deprecated Use the signature with `UserPreferences` instead. */
5969 getRenameInfo(fileName: string, position: number, options?: RenameInfoOptions): RenameInfo;
5970 findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename?: boolean): readonly RenameLocation[] | undefined;
5971 getSmartSelectionRange(fileName: string, position: number): SelectionRange;
5972 getDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined;
5973 getDefinitionAndBoundSpan(fileName: string, position: number): DefinitionInfoAndBoundSpan | undefined;
5974 getTypeDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined;
5975 getImplementationAtPosition(fileName: string, position: number): readonly ImplementationLocation[] | undefined;
5976 getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[] | undefined;
5977 findReferences(fileName: string, position: number): ReferencedSymbol[] | undefined;
5978 getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): DocumentHighlights[] | undefined;
5979 getFileReferences(fileName: string): ReferenceEntry[];
5980 /** @deprecated */
5981 getOccurrencesAtPosition(fileName: string, position: number): readonly ReferenceEntry[] | undefined;
5982 getNavigateToItems(searchValue: string, maxResultCount?: number, fileName?: string, excludeDtsFiles?: boolean): NavigateToItem[];
5983 getNavigationBarItems(fileName: string): NavigationBarItem[];
5984 getNavigationTree(fileName: string): NavigationTree;
5985 prepareCallHierarchy(fileName: string, position: number): CallHierarchyItem | CallHierarchyItem[] | undefined;
5986 provideCallHierarchyIncomingCalls(fileName: string, position: number): CallHierarchyIncomingCall[];
5987 provideCallHierarchyOutgoingCalls(fileName: string, position: number): CallHierarchyOutgoingCall[];
5988 provideInlayHints(fileName: string, span: TextSpan, preferences: UserPreferences | undefined): InlayHint[];
5989 getOutliningSpans(fileName: string): OutliningSpan[];
5990 getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[];
5991 getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[];
5992 getIndentationAtPosition(fileName: string, position: number, options: EditorOptions | EditorSettings): number;
5993 getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
5994 getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
5995 getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
5996 getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions): TextInsertion | undefined;
5997 isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean;
5998 /**
5999 * 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.
6000 * Editors should call this after `>` is typed.
6001 */
6002 getJsxClosingTagAtPosition(fileName: string, position: number): JsxClosingTagInfo | undefined;
6003 getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan | undefined;
6004 toLineColumnOffset?(fileName: string, position: number): LineAndCharacter;
6005 getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: readonly number[], formatOptions: FormatCodeSettings, preferences: UserPreferences): readonly CodeFixAction[];
6006 getCombinedCodeFix(scope: CombinedCodeFixScope, fixId: {}, formatOptions: FormatCodeSettings, preferences: UserPreferences): CombinedCodeActions;
6007 applyCodeActionCommand(action: CodeActionCommand, formatSettings?: FormatCodeSettings): Promise<ApplyCodeActionCommandResult>;
6008 applyCodeActionCommand(action: CodeActionCommand[], formatSettings?: FormatCodeSettings): Promise<ApplyCodeActionCommandResult[]>;
6009 applyCodeActionCommand(action: CodeActionCommand | CodeActionCommand[], formatSettings?: FormatCodeSettings): Promise<ApplyCodeActionCommandResult | ApplyCodeActionCommandResult[]>;
6010 /** @deprecated `fileName` will be ignored */
6011 applyCodeActionCommand(fileName: string, action: CodeActionCommand): Promise<ApplyCodeActionCommandResult>;
6012 /** @deprecated `fileName` will be ignored */
6013 applyCodeActionCommand(fileName: string, action: CodeActionCommand[]): Promise<ApplyCodeActionCommandResult[]>;
6014 /** @deprecated `fileName` will be ignored */
6015 applyCodeActionCommand(fileName: string, action: CodeActionCommand | CodeActionCommand[]): Promise<ApplyCodeActionCommandResult | ApplyCodeActionCommandResult[]>;
6016 getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined, triggerReason?: RefactorTriggerReason, kind?: string): ApplicableRefactorInfo[];
6017 getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | undefined): RefactorEditInfo | undefined;
6018 organizeImports(args: OrganizeImportsArgs, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[];
6019 getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[];
6020 getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean, forceDtsEmit?: boolean): EmitOutput;
6021 getProgram(): Program | undefined;
6022 toggleLineComment(fileName: string, textRange: TextRange): TextChange[];
6023 toggleMultilineComment(fileName: string, textRange: TextRange): TextChange[];
6024 commentSelection(fileName: string, textRange: TextRange): TextChange[];
6025 uncommentSelection(fileName: string, textRange: TextRange): TextChange[];
6026 dispose(): void;
6027 }
6028 interface JsxClosingTagInfo {
6029 readonly newText: string;
6030 }
6031 interface CombinedCodeFixScope {
6032 type: "file";
6033 fileName: string;
6034 }
6035 enum OrganizeImportsMode {
6036 All = "All",
6037 SortAndCombine = "SortAndCombine",
6038 RemoveUnused = "RemoveUnused"
6039 }
6040 interface OrganizeImportsArgs extends CombinedCodeFixScope {
6041 /** @deprecated Use `mode` instead */
6042 skipDestructiveCodeActions?: boolean;
6043 mode?: OrganizeImportsMode;
6044 }
6045 type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<" | "#" | " ";
6046 enum CompletionTriggerKind {
6047 /** Completion was triggered by typing an identifier, manual invocation (e.g Ctrl+Space) or via API. */
6048 Invoked = 1,
6049 /** Completion was triggered by a trigger character. */
6050 TriggerCharacter = 2,
6051 /** Completion was re-triggered as the current completion list is incomplete. */
6052 TriggerForIncompleteCompletions = 3
6053 }
6054 interface GetCompletionsAtPositionOptions extends UserPreferences {
6055 /**
6056 * If the editor is asking for completions because a certain character was typed
6057 * (as opposed to when the user explicitly requested them) this should be set.
6058 */
6059 triggerCharacter?: CompletionsTriggerCharacter;
6060 triggerKind?: CompletionTriggerKind;
6061 /** @deprecated Use includeCompletionsForModuleExports */
6062 includeExternalModuleExports?: boolean;
6063 /** @deprecated Use includeCompletionsWithInsertText */
6064 includeInsertTextCompletions?: boolean;
6065 }
6066 type SignatureHelpTriggerCharacter = "," | "(" | "<";
6067 type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")";
6068 interface SignatureHelpItemsOptions {
6069 triggerReason?: SignatureHelpTriggerReason;
6070 }
6071 type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason;
6072 /**
6073 * Signals that the user manually requested signature help.
6074 * The language service will unconditionally attempt to provide a result.
6075 */
6076 interface SignatureHelpInvokedReason {
6077 kind: "invoked";
6078 triggerCharacter?: undefined;
6079 }
6080 /**
6081 * Signals that the signature help request came from a user typing a character.
6082 * Depending on the character and the syntactic context, the request may or may not be served a result.
6083 */
6084 interface SignatureHelpCharacterTypedReason {
6085 kind: "characterTyped";
6086 /**
6087 * Character that was responsible for triggering signature help.
6088 */
6089 triggerCharacter: SignatureHelpTriggerCharacter;
6090 }
6091 /**
6092 * Signals that this signature help request came from typing a character or moving the cursor.
6093 * This should only occur if a signature help session was already active and the editor needs to see if it should adjust.
6094 * The language service will unconditionally attempt to provide a result.
6095 * `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move.
6096 */
6097 interface SignatureHelpRetriggeredReason {
6098 kind: "retrigger";
6099 /**
6100 * Character that was responsible for triggering signature help.
6101 */
6102 triggerCharacter?: SignatureHelpRetriggerCharacter;
6103 }
6104 interface ApplyCodeActionCommandResult {
6105 successMessage: string;
6106 }
6107 interface Classifications {
6108 spans: number[];
6109 endOfLineState: EndOfLineState;
6110 }
6111 interface ClassifiedSpan {
6112 textSpan: TextSpan;
6113 classificationType: ClassificationTypeNames;
6114 }
6115 interface ClassifiedSpan2020 {
6116 textSpan: TextSpan;
6117 classificationType: number;
6118 }
6119 /**
6120 * Navigation bar interface designed for visual studio's dual-column layout.
6121 * This does not form a proper tree.
6122 * The navbar is returned as a list of top-level items, each of which has a list of child items.
6123 * Child items always have an empty array for their `childItems`.
6124 */
6125 interface NavigationBarItem {
6126 text: string;
6127 kind: ScriptElementKind;
6128 kindModifiers: string;
6129 spans: TextSpan[];
6130 childItems: NavigationBarItem[];
6131 indent: number;
6132 bolded: boolean;
6133 grayed: boolean;
6134 }
6135 /**
6136 * Node in a tree of nested declarations in a file.
6137 * The top node is always a script or module node.
6138 */
6139 interface NavigationTree {
6140 /** Name of the declaration, or a short description, e.g. "<class>". */
6141 text: string;
6142 kind: ScriptElementKind;
6143 /** ScriptElementKindModifier separated by commas, e.g. "public,abstract" */
6144 kindModifiers: string;
6145 /**
6146 * Spans of the nodes that generated this declaration.
6147 * There will be more than one if this is the result of merging.
6148 */
6149 spans: TextSpan[];
6150 nameSpan: TextSpan | undefined;
6151 /** Present if non-empty */
6152 childItems?: NavigationTree[];
6153 }
6154 interface CallHierarchyItem {
6155 name: string;
6156 kind: ScriptElementKind;
6157 kindModifiers?: string;
6158 file: string;
6159 span: TextSpan;
6160 selectionSpan: TextSpan;
6161 containerName?: string;
6162 }
6163 interface CallHierarchyIncomingCall {
6164 from: CallHierarchyItem;
6165 fromSpans: TextSpan[];
6166 }
6167 interface CallHierarchyOutgoingCall {
6168 to: CallHierarchyItem;
6169 fromSpans: TextSpan[];
6170 }
6171 enum InlayHintKind {
6172 Type = "Type",
6173 Parameter = "Parameter",
6174 Enum = "Enum"
6175 }
6176 interface InlayHint {
6177 text: string;
6178 position: number;
6179 kind: InlayHintKind;
6180 whitespaceBefore?: boolean;
6181 whitespaceAfter?: boolean;
6182 }
6183 interface TodoCommentDescriptor {
6184 text: string;
6185 priority: number;
6186 }
6187 interface TodoComment {
6188 descriptor: TodoCommentDescriptor;
6189 message: string;
6190 position: number;
6191 }
6192 interface TextChange {
6193 span: TextSpan;
6194 newText: string;
6195 }
6196 interface FileTextChanges {
6197 fileName: string;
6198 textChanges: readonly TextChange[];
6199 isNewFile?: boolean;
6200 }
6201 interface CodeAction {
6202 /** Description of the code action to display in the UI of the editor */
6203 description: string;
6204 /** Text changes to apply to each file as part of the code action */
6205 changes: FileTextChanges[];
6206 /**
6207 * If the user accepts the code fix, the editor should send the action back in a `applyAction` request.
6208 * This allows the language service to have side effects (e.g. installing dependencies) upon a code fix.
6209 */
6210 commands?: CodeActionCommand[];
6211 }
6212 interface CodeFixAction extends CodeAction {
6213 /** Short name to identify the fix, for use by telemetry. */
6214 fixName: string;
6215 /**
6216 * If present, one may call 'getCombinedCodeFix' with this fixId.
6217 * This may be omitted to indicate that the code fix can't be applied in a group.
6218 */
6219 fixId?: {};
6220 fixAllDescription?: string;
6221 }
6222 interface CombinedCodeActions {
6223 changes: readonly FileTextChanges[];
6224 commands?: readonly CodeActionCommand[];
6225 }
6226 type CodeActionCommand = InstallPackageAction;
6227 interface InstallPackageAction {
6228 }
6229 /**
6230 * A set of one or more available refactoring actions, grouped under a parent refactoring.
6231 */
6232 interface ApplicableRefactorInfo {
6233 /**
6234 * The programmatic name of the refactoring
6235 */
6236 name: string;
6237 /**
6238 * A description of this refactoring category to show to the user.
6239 * If the refactoring gets inlined (see below), this text will not be visible.
6240 */
6241 description: string;
6242 /**
6243 * Inlineable refactorings can have their actions hoisted out to the top level
6244 * of a context menu. Non-inlineanable refactorings should always be shown inside
6245 * their parent grouping.
6246 *
6247 * If not specified, this value is assumed to be 'true'
6248 */
6249 inlineable?: boolean;
6250 actions: RefactorActionInfo[];
6251 }
6252 /**
6253 * Represents a single refactoring action - for example, the "Extract Method..." refactor might
6254 * offer several actions, each corresponding to a surround class or closure to extract into.
6255 */
6256 interface RefactorActionInfo {
6257 /**
6258 * The programmatic name of the refactoring action
6259 */
6260 name: string;
6261 /**
6262 * A description of this refactoring action to show to the user.
6263 * If the parent refactoring is inlined away, this will be the only text shown,
6264 * so this description should make sense by itself if the parent is inlineable=true
6265 */
6266 description: string;
6267 /**
6268 * A message to show to the user if the refactoring cannot be applied in
6269 * the current context.
6270 */
6271 notApplicableReason?: string;
6272 /**
6273 * The hierarchical dotted name of the refactor action.
6274 */
6275 kind?: string;
6276 }
6277 /**
6278 * A set of edits to make in response to a refactor action, plus an optional
6279 * location where renaming should be invoked from
6280 */
6281 interface RefactorEditInfo {
6282 edits: FileTextChanges[];
6283 renameFilename?: string;
6284 renameLocation?: number;
6285 commands?: CodeActionCommand[];
6286 }
6287 type RefactorTriggerReason = "implicit" | "invoked";
6288 interface TextInsertion {
6289 newText: string;
6290 /** The position in newText the caret should point to after the insertion. */
6291 caretOffset: number;
6292 }
6293 interface DocumentSpan {
6294 textSpan: TextSpan;
6295 fileName: string;
6296 /**
6297 * If the span represents a location that was remapped (e.g. via a .d.ts.map file),
6298 * then the original filename and span will be specified here
6299 */
6300 originalTextSpan?: TextSpan;
6301 originalFileName?: string;
6302 /**
6303 * If DocumentSpan.textSpan is the span for name of the declaration,
6304 * then this is the span for relevant declaration
6305 */
6306 contextSpan?: TextSpan;
6307 originalContextSpan?: TextSpan;
6308 }
6309 interface RenameLocation extends DocumentSpan {
6310 readonly prefixText?: string;
6311 readonly suffixText?: string;
6312 }
6313 interface ReferenceEntry extends DocumentSpan {
6314 isWriteAccess: boolean;
6315 isInString?: true;
6316 }
6317 interface ImplementationLocation extends DocumentSpan {
6318 kind: ScriptElementKind;
6319 displayParts: SymbolDisplayPart[];
6320 }
6321 enum HighlightSpanKind {
6322 none = "none",
6323 definition = "definition",
6324 reference = "reference",
6325 writtenReference = "writtenReference"
6326 }
6327 interface HighlightSpan {
6328 fileName?: string;
6329 isInString?: true;
6330 textSpan: TextSpan;
6331 contextSpan?: TextSpan;
6332 kind: HighlightSpanKind;
6333 }
6334 interface NavigateToItem {
6335 name: string;
6336 kind: ScriptElementKind;
6337 kindModifiers: string;
6338 matchKind: "exact" | "prefix" | "substring" | "camelCase";
6339 isCaseSensitive: boolean;
6340 fileName: string;
6341 textSpan: TextSpan;
6342 containerName: string;
6343 containerKind: ScriptElementKind;
6344 }
6345 enum IndentStyle {
6346 None = 0,
6347 Block = 1,
6348 Smart = 2
6349 }
6350 enum SemicolonPreference {
6351 Ignore = "ignore",
6352 Insert = "insert",
6353 Remove = "remove"
6354 }
6355 /** @deprecated - consider using EditorSettings instead */
6356 interface EditorOptions {
6357 BaseIndentSize?: number;
6358 IndentSize: number;
6359 TabSize: number;
6360 NewLineCharacter: string;
6361 ConvertTabsToSpaces: boolean;
6362 IndentStyle: IndentStyle;
6363 }
6364 interface EditorSettings {
6365 baseIndentSize?: number;
6366 indentSize?: number;
6367 tabSize?: number;
6368 newLineCharacter?: string;
6369 convertTabsToSpaces?: boolean;
6370 indentStyle?: IndentStyle;
6371 trimTrailingWhitespace?: boolean;
6372 }
6373 /** @deprecated - consider using FormatCodeSettings instead */
6374 interface FormatCodeOptions extends EditorOptions {
6375 InsertSpaceAfterCommaDelimiter: boolean;
6376 InsertSpaceAfterSemicolonInForStatements: boolean;
6377 InsertSpaceBeforeAndAfterBinaryOperators: boolean;
6378 InsertSpaceAfterConstructor?: boolean;
6379 InsertSpaceAfterKeywordsInControlFlowStatements: boolean;
6380 InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean;
6381 InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean;
6382 InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: boolean;
6383 InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
6384 InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean;
6385 InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
6386 InsertSpaceAfterTypeAssertion?: boolean;
6387 InsertSpaceBeforeFunctionParenthesis?: boolean;
6388 PlaceOpenBraceOnNewLineForFunctions: boolean;
6389 PlaceOpenBraceOnNewLineForControlBlocks: boolean;
6390 insertSpaceBeforeTypeAnnotation?: boolean;
6391 }
6392 interface FormatCodeSettings extends EditorSettings {
6393 readonly insertSpaceAfterCommaDelimiter?: boolean;
6394 readonly insertSpaceAfterSemicolonInForStatements?: boolean;
6395 readonly insertSpaceBeforeAndAfterBinaryOperators?: boolean;
6396 readonly insertSpaceAfterConstructor?: boolean;
6397 readonly insertSpaceAfterKeywordsInControlFlowStatements?: boolean;
6398 readonly insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean;
6399 readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean;
6400 readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean;
6401 readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
6402 readonly insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean;
6403 readonly insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean;
6404 readonly insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
6405 readonly insertSpaceAfterTypeAssertion?: boolean;
6406 readonly insertSpaceBeforeFunctionParenthesis?: boolean;
6407 readonly placeOpenBraceOnNewLineForFunctions?: boolean;
6408 readonly placeOpenBraceOnNewLineForControlBlocks?: boolean;
6409 readonly insertSpaceBeforeTypeAnnotation?: boolean;
6410 readonly indentMultiLineObjectLiteralBeginningOnBlankLine?: boolean;
6411 readonly semicolons?: SemicolonPreference;
6412 }
6413 function getDefaultFormatCodeSettings(newLineCharacter?: string): FormatCodeSettings;
6414 interface DefinitionInfo extends DocumentSpan {
6415 kind: ScriptElementKind;
6416 name: string;
6417 containerKind: ScriptElementKind;
6418 containerName: string;
6419 unverified?: boolean;
6420 }
6421 interface DefinitionInfoAndBoundSpan {
6422 definitions?: readonly DefinitionInfo[];
6423 textSpan: TextSpan;
6424 }
6425 interface ReferencedSymbolDefinitionInfo extends DefinitionInfo {
6426 displayParts: SymbolDisplayPart[];
6427 }
6428 interface ReferencedSymbol {
6429 definition: ReferencedSymbolDefinitionInfo;
6430 references: ReferencedSymbolEntry[];
6431 }
6432 interface ReferencedSymbolEntry extends ReferenceEntry {
6433 isDefinition?: boolean;
6434 }
6435 enum SymbolDisplayPartKind {
6436 aliasName = 0,
6437 className = 1,
6438 enumName = 2,
6439 fieldName = 3,
6440 interfaceName = 4,
6441 keyword = 5,
6442 lineBreak = 6,
6443 numericLiteral = 7,
6444 stringLiteral = 8,
6445 localName = 9,
6446 methodName = 10,
6447 moduleName = 11,
6448 operator = 12,
6449 parameterName = 13,
6450 propertyName = 14,
6451 punctuation = 15,
6452 space = 16,
6453 text = 17,
6454 typeParameterName = 18,
6455 enumMemberName = 19,
6456 functionName = 20,
6457 regularExpressionLiteral = 21,
6458 link = 22,
6459 linkName = 23,
6460 linkText = 24
6461 }
6462 interface SymbolDisplayPart {
6463 text: string;
6464 kind: string;
6465 }
6466 interface JSDocLinkDisplayPart extends SymbolDisplayPart {
6467 target: DocumentSpan;
6468 }
6469 interface JSDocTagInfo {
6470 name: string;
6471 text?: SymbolDisplayPart[];
6472 }
6473 interface QuickInfo {
6474 kind: ScriptElementKind;
6475 kindModifiers: string;
6476 textSpan: TextSpan;
6477 displayParts?: SymbolDisplayPart[];
6478 documentation?: SymbolDisplayPart[];
6479 tags?: JSDocTagInfo[];
6480 }
6481 type RenameInfo = RenameInfoSuccess | RenameInfoFailure;
6482 interface RenameInfoSuccess {
6483 canRename: true;
6484 /**
6485 * File or directory to rename.
6486 * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`.
6487 */
6488 fileToRename?: string;
6489 displayName: string;
6490 fullDisplayName: string;
6491 kind: ScriptElementKind;
6492 kindModifiers: string;
6493 triggerSpan: TextSpan;
6494 }
6495 interface RenameInfoFailure {
6496 canRename: false;
6497 localizedErrorMessage: string;
6498 }
6499 /**
6500 * @deprecated Use `UserPreferences` instead.
6501 */
6502 interface RenameInfoOptions {
6503 readonly allowRenameOfImportPath?: boolean;
6504 }
6505 interface DocCommentTemplateOptions {
6506 readonly generateReturnInDocTemplate?: boolean;
6507 }
6508 interface SignatureHelpParameter {
6509 name: string;
6510 documentation: SymbolDisplayPart[];
6511 displayParts: SymbolDisplayPart[];
6512 isOptional: boolean;
6513 isRest?: boolean;
6514 }
6515 interface SelectionRange {
6516 textSpan: TextSpan;
6517 parent?: SelectionRange;
6518 }
6519 /**
6520 * Represents a single signature to show in signature help.
6521 * The id is used for subsequent calls into the language service to ask questions about the
6522 * signature help item in the context of any documents that have been updated. i.e. after
6523 * an edit has happened, while signature help is still active, the host can ask important
6524 * questions like 'what parameter is the user currently contained within?'.
6525 */
6526 interface SignatureHelpItem {
6527 isVariadic: boolean;
6528 prefixDisplayParts: SymbolDisplayPart[];
6529 suffixDisplayParts: SymbolDisplayPart[];
6530 separatorDisplayParts: SymbolDisplayPart[];
6531 parameters: SignatureHelpParameter[];
6532 documentation: SymbolDisplayPart[];
6533 tags: JSDocTagInfo[];
6534 }
6535 /**
6536 * Represents a set of signature help items, and the preferred item that should be selected.
6537 */
6538 interface SignatureHelpItems {
6539 items: SignatureHelpItem[];
6540 applicableSpan: TextSpan;
6541 selectedItemIndex: number;
6542 argumentIndex: number;
6543 argumentCount: number;
6544 }
6545 enum CompletionInfoFlags {
6546 None = 0,
6547 MayIncludeAutoImports = 1,
6548 IsImportStatementCompletion = 2,
6549 IsContinuation = 4,
6550 ResolvedModuleSpecifiers = 8,
6551 ResolvedModuleSpecifiersBeyondLimit = 16,
6552 MayIncludeMethodSnippets = 32
6553 }
6554 interface CompletionInfo {
6555 /** For performance telemetry. */
6556 flags?: CompletionInfoFlags;
6557 /** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */
6558 isGlobalCompletion: boolean;
6559 isMemberCompletion: boolean;
6560 /**
6561 * In the absence of `CompletionEntry["replacementSpan"]`, the editor may choose whether to use
6562 * this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span
6563 * must be used to commit that completion entry.
6564 */
6565 optionalReplacementSpan?: TextSpan;
6566 /**
6567 * true when the current location also allows for a new identifier
6568 */
6569 isNewIdentifierLocation: boolean;
6570 /**
6571 * Indicates to client to continue requesting completions on subsequent keystrokes.
6572 */
6573 isIncomplete?: true;
6574 entries: CompletionEntry[];
6575 }
6576 interface CompletionEntryDataAutoImport {
6577 /**
6578 * The name of the property or export in the module's symbol table. Differs from the completion name
6579 * in the case of InternalSymbolName.ExportEquals and InternalSymbolName.Default.
6580 */
6581 exportName: string;
6582 moduleSpecifier?: string;
6583 /** The file name declaring the export's module symbol, if it was an external module */
6584 fileName?: string;
6585 /** The module name (with quotes stripped) of the export's module symbol, if it was an ambient module */
6586 ambientModuleName?: string;
6587 /** True if the export was found in the package.json AutoImportProvider */
6588 isPackageJsonImport?: true;
6589 }
6590 interface CompletionEntryDataUnresolved extends CompletionEntryDataAutoImport {
6591 /** The key in the `ExportMapCache` where the completion entry's `SymbolExportInfo[]` is found */
6592 exportMapKey: string;
6593 }
6594 interface CompletionEntryDataResolved extends CompletionEntryDataAutoImport {
6595 moduleSpecifier: string;
6596 }
6597 type CompletionEntryData = CompletionEntryDataUnresolved | CompletionEntryDataResolved;
6598 interface CompletionEntry {
6599 name: string;
6600 kind: ScriptElementKind;
6601 kindModifiers?: string;
6602 sortText: string;
6603 insertText?: string;
6604 isSnippet?: true;
6605 /**
6606 * An optional span that indicates the text to be replaced by this completion item.
6607 * If present, this span should be used instead of the default one.
6608 * It will be set if the required span differs from the one generated by the default replacement behavior.
6609 */
6610 replacementSpan?: TextSpan;
6611 hasAction?: true;
6612 source?: string;
6613 sourceDisplay?: SymbolDisplayPart[];
6614 labelDetails?: CompletionEntryLabelDetails;
6615 isRecommended?: true;
6616 isFromUncheckedFile?: true;
6617 isPackageJsonImport?: true;
6618 isImportStatementCompletion?: true;
6619 /**
6620 * A property to be sent back to TS Server in the CompletionDetailsRequest, along with `name`,
6621 * that allows TS Server to look up the symbol represented by the completion item, disambiguating
6622 * items with the same name. Currently only defined for auto-import completions, but the type is
6623 * `unknown` in the protocol, so it can be changed as needed to support other kinds of completions.
6624 * The presence of this property should generally not be used to assume that this completion entry
6625 * is an auto-import.
6626 */
6627 data?: CompletionEntryData;
6628 }
6629 interface CompletionEntryLabelDetails {
6630 detail?: string;
6631 description?: string;
6632 }
6633 interface CompletionEntryDetails {
6634 name: string;
6635 kind: ScriptElementKind;
6636 kindModifiers: string;
6637 displayParts: SymbolDisplayPart[];
6638 documentation?: SymbolDisplayPart[];
6639 tags?: JSDocTagInfo[];
6640 codeActions?: CodeAction[];
6641 /** @deprecated Use `sourceDisplay` instead. */
6642 source?: SymbolDisplayPart[];
6643 sourceDisplay?: SymbolDisplayPart[];
6644 }
6645 interface OutliningSpan {
6646 /** The span of the document to actually collapse. */
6647 textSpan: TextSpan;
6648 /** The span of the document to display when the user hovers over the collapsed span. */
6649 hintSpan: TextSpan;
6650 /** The text to display in the editor for the collapsed region. */
6651 bannerText: string;
6652 /**
6653 * Whether or not this region should be automatically collapsed when
6654 * the 'Collapse to Definitions' command is invoked.
6655 */
6656 autoCollapse: boolean;
6657 /**
6658 * Classification of the contents of the span
6659 */
6660 kind: OutliningSpanKind;
6661 }
6662 enum OutliningSpanKind {
6663 /** Single or multi-line comments */
6664 Comment = "comment",
6665 /** Sections marked by '// #region' and '// #endregion' comments */
6666 Region = "region",
6667 /** Declarations and expressions */
6668 Code = "code",
6669 /** Contiguous blocks of import declarations */
6670 Imports = "imports"
6671 }
6672 enum OutputFileType {
6673 JavaScript = 0,
6674 SourceMap = 1,
6675 Declaration = 2
6676 }
6677 enum EndOfLineState {
6678 None = 0,
6679 InMultiLineCommentTrivia = 1,
6680 InSingleQuoteStringLiteral = 2,
6681 InDoubleQuoteStringLiteral = 3,
6682 InTemplateHeadOrNoSubstitutionTemplate = 4,
6683 InTemplateMiddleOrTail = 5,
6684 InTemplateSubstitutionPosition = 6
6685 }
6686 enum TokenClass {
6687 Punctuation = 0,
6688 Keyword = 1,
6689 Operator = 2,
6690 Comment = 3,
6691 Whitespace = 4,
6692 Identifier = 5,
6693 NumberLiteral = 6,
6694 BigIntLiteral = 7,
6695 StringLiteral = 8,
6696 RegExpLiteral = 9
6697 }
6698 interface ClassificationResult {
6699 finalLexState: EndOfLineState;
6700 entries: ClassificationInfo[];
6701 }
6702 interface ClassificationInfo {
6703 length: number;
6704 classification: TokenClass;
6705 }
6706 interface Classifier {
6707 /**
6708 * Gives lexical classifications of tokens on a line without any syntactic context.
6709 * For instance, a token consisting of the text 'string' can be either an identifier
6710 * named 'string' or the keyword 'string', however, because this classifier is not aware,
6711 * it relies on certain heuristics to give acceptable results. For classifications where
6712 * speed trumps accuracy, this function is preferable; however, for true accuracy, the
6713 * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the
6714 * lexical, syntactic, and semantic classifiers may issue the best user experience.
6715 *
6716 * @param text The text of a line to classify.
6717 * @param lexState The state of the lexical classifier at the end of the previous line.
6718 * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier.
6719 * If there is no syntactic classifier (syntacticClassifierAbsent=true),
6720 * certain heuristics may be used in its place; however, if there is a
6721 * syntactic classifier (syntacticClassifierAbsent=false), certain
6722 * classifications which may be incorrectly categorized will be given
6723 * back as Identifiers in order to allow the syntactic classifier to
6724 * subsume the classification.
6725 * @deprecated Use getLexicalClassifications instead.
6726 */
6727 getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult;
6728 getEncodedLexicalClassifications(text: string, endOfLineState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications;
6729 }
6730 enum ScriptElementKind {
6731 unknown = "",
6732 warning = "warning",
6733 /** predefined type (void) or keyword (class) */
6734 keyword = "keyword",
6735 /** top level script node */
6736 scriptElement = "script",
6737 /** module foo {} */
6738 moduleElement = "module",
6739 /** class X {} */
6740 classElement = "class",
6741 /** var x = class X {} */
6742 localClassElement = "local class",
6743 /** interface Y {} */
6744 interfaceElement = "interface",
6745 /** type T = ... */
6746 typeElement = "type",
6747 /** enum E */
6748 enumElement = "enum",
6749 enumMemberElement = "enum member",
6750 /**
6751 * Inside module and script only
6752 * const v = ..
6753 */
6754 variableElement = "var",
6755 /** Inside function */
6756 localVariableElement = "local var",
6757 /**
6758 * Inside module and script only
6759 * function f() { }
6760 */
6761 functionElement = "function",
6762 /** Inside function */
6763 localFunctionElement = "local function",
6764 /** class X { [public|private]* foo() {} } */
6765 memberFunctionElement = "method",
6766 /** class X { [public|private]* [get|set] foo:number; } */
6767 memberGetAccessorElement = "getter",
6768 memberSetAccessorElement = "setter",
6769 /**
6770 * class X { [public|private]* foo:number; }
6771 * interface Y { foo:number; }
6772 */
6773 memberVariableElement = "property",
6774 /** class X { [public|private]* accessor foo: number; } */
6775 memberAccessorVariableElement = "accessor",
6776 /**
6777 * class X { constructor() { } }
6778 * class X { static { } }
6779 */
6780 constructorImplementationElement = "constructor",
6781 /** interface Y { ():number; } */
6782 callSignatureElement = "call",
6783 /** interface Y { []:number; } */
6784 indexSignatureElement = "index",
6785 /** interface Y { new():Y; } */
6786 constructSignatureElement = "construct",
6787 /** function foo(*Y*: string) */
6788 parameterElement = "parameter",
6789 typeParameterElement = "type parameter",
6790 primitiveType = "primitive type",
6791 label = "label",
6792 alias = "alias",
6793 constElement = "const",
6794 letElement = "let",
6795 directory = "directory",
6796 externalModuleName = "external module name",
6797 /**
6798 * <JsxTagName attribute1 attribute2={0} />
6799 * @deprecated
6800 */
6801 jsxAttribute = "JSX attribute",
6802 /** String literal */
6803 string = "string",
6804 /** Jsdoc @link: in `{@link C link text}`, the before and after text "{@link " and "}" */
6805 link = "link",
6806 /** Jsdoc @link: in `{@link C link text}`, the entity name "C" */
6807 linkName = "link name",
6808 /** Jsdoc @link: in `{@link C link text}`, the link text "link text" */
6809 linkText = "link text"
6810 }
6811 enum ScriptElementKindModifier {
6812 none = "",
6813 publicMemberModifier = "public",
6814 privateMemberModifier = "private",
6815 protectedMemberModifier = "protected",
6816 exportedModifier = "export",
6817 ambientModifier = "declare",
6818 staticModifier = "static",
6819 abstractModifier = "abstract",
6820 optionalModifier = "optional",
6821 deprecatedModifier = "deprecated",
6822 dtsModifier = ".d.ts",
6823 tsModifier = ".ts",
6824 tsxModifier = ".tsx",
6825 jsModifier = ".js",
6826 jsxModifier = ".jsx",
6827 jsonModifier = ".json",
6828 dmtsModifier = ".d.mts",
6829 mtsModifier = ".mts",
6830 mjsModifier = ".mjs",
6831 dctsModifier = ".d.cts",
6832 ctsModifier = ".cts",
6833 cjsModifier = ".cjs"
6834 }
6835 enum ClassificationTypeNames {
6836 comment = "comment",
6837 identifier = "identifier",
6838 keyword = "keyword",
6839 numericLiteral = "number",
6840 bigintLiteral = "bigint",
6841 operator = "operator",
6842 stringLiteral = "string",
6843 whiteSpace = "whitespace",
6844 text = "text",
6845 punctuation = "punctuation",
6846 className = "class name",
6847 enumName = "enum name",
6848 interfaceName = "interface name",
6849 moduleName = "module name",
6850 typeParameterName = "type parameter name",
6851 typeAliasName = "type alias name",
6852 parameterName = "parameter name",
6853 docCommentTagName = "doc comment tag name",
6854 jsxOpenTagName = "jsx open tag name",
6855 jsxCloseTagName = "jsx close tag name",
6856 jsxSelfClosingTagName = "jsx self closing tag name",
6857 jsxAttribute = "jsx attribute",
6858 jsxText = "jsx text",
6859 jsxAttributeStringLiteralValue = "jsx attribute string literal value"
6860 }
6861 enum ClassificationType {
6862 comment = 1,
6863 identifier = 2,
6864 keyword = 3,
6865 numericLiteral = 4,
6866 operator = 5,
6867 stringLiteral = 6,
6868 regularExpressionLiteral = 7,
6869 whiteSpace = 8,
6870 text = 9,
6871 punctuation = 10,
6872 className = 11,
6873 enumName = 12,
6874 interfaceName = 13,
6875 moduleName = 14,
6876 typeParameterName = 15,
6877 typeAliasName = 16,
6878 parameterName = 17,
6879 docCommentTagName = 18,
6880 jsxOpenTagName = 19,
6881 jsxCloseTagName = 20,
6882 jsxSelfClosingTagName = 21,
6883 jsxAttribute = 22,
6884 jsxText = 23,
6885 jsxAttributeStringLiteralValue = 24,
6886 bigintLiteral = 25
6887 }
6888 interface InlayHintsContext {
6889 file: SourceFile;
6890 program: Program;
6891 cancellationToken: CancellationToken;
6892 host: LanguageServiceHost;
6893 span: TextSpan;
6894 preferences: UserPreferences;
6895 }
6896}
6897declare namespace ts {
6898 /** The classifier is used for syntactic highlighting in editors via the TSServer */
6899 function createClassifier(): Classifier;
6900}
6901declare namespace ts {
6902 interface DocumentHighlights {
6903 fileName: string;
6904 highlightSpans: HighlightSpan[];
6905 }
6906}
6907declare namespace ts {
6908 /**
6909 * The document registry represents a store of SourceFile objects that can be shared between
6910 * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST)
6911 * of files in the context.
6912 * SourceFile objects account for most of the memory usage by the language service. Sharing
6913 * the same DocumentRegistry instance between different instances of LanguageService allow
6914 * for more efficient memory utilization since all projects will share at least the library
6915 * file (lib.d.ts).
6916 *
6917 * A more advanced use of the document registry is to serialize sourceFile objects to disk
6918 * and re-hydrate them when needed.
6919 *
6920 * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it
6921 * to all subsequent createLanguageService calls.
6922 */
6923 interface DocumentRegistry {
6924 /**
6925 * Request a stored SourceFile with a given fileName and compilationSettings.
6926 * The first call to acquire will call createLanguageServiceSourceFile to generate
6927 * the SourceFile if was not found in the registry.
6928 *
6929 * @param fileName The name of the file requested
6930 * @param compilationSettingsOrHost Some compilation settings like target affects the
6931 * shape of a the resulting SourceFile. This allows the DocumentRegistry to store
6932 * multiple copies of the same file for different compilation settings. A minimal
6933 * resolution cache is needed to fully define a source file's shape when
6934 * the compilation settings include `module: node16`+, so providing a cache host
6935 * object should be preferred. A common host is a language service `ConfiguredProject`.
6936 * @param scriptSnapshot Text of the file. Only used if the file was not found
6937 * in the registry and a new one was created.
6938 * @param version Current version of the file. Only used if the file was not found
6939 * in the registry and a new one was created.
6940 */
6941 acquireDocument(fileName: string, compilationSettingsOrHost: CompilerOptions | MinimalResolutionCacheHost, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind, sourceFileOptions?: CreateSourceFileOptions | ScriptTarget): SourceFile;
6942 acquireDocumentWithKey(fileName: string, path: Path, compilationSettingsOrHost: CompilerOptions | MinimalResolutionCacheHost, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind, sourceFileOptions?: CreateSourceFileOptions | ScriptTarget): SourceFile;
6943 /**
6944 * Request an updated version of an already existing SourceFile with a given fileName
6945 * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile
6946 * to get an updated SourceFile.
6947 *
6948 * @param fileName The name of the file requested
6949 * @param compilationSettingsOrHost Some compilation settings like target affects the
6950 * shape of a the resulting SourceFile. This allows the DocumentRegistry to store
6951 * multiple copies of the same file for different compilation settings. A minimal
6952 * resolution cache is needed to fully define a source file's shape when
6953 * the compilation settings include `module: node16`+, so providing a cache host
6954 * object should be preferred. A common host is a language service `ConfiguredProject`.
6955 * @param scriptSnapshot Text of the file.
6956 * @param version Current version of the file.
6957 */
6958 updateDocument(fileName: string, compilationSettingsOrHost: CompilerOptions | MinimalResolutionCacheHost, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind, sourceFileOptions?: CreateSourceFileOptions | ScriptTarget): SourceFile;
6959 updateDocumentWithKey(fileName: string, path: Path, compilationSettingsOrHost: CompilerOptions | MinimalResolutionCacheHost, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind, sourceFileOptions?: CreateSourceFileOptions | ScriptTarget): SourceFile;
6960 getKeyForCompilationSettings(settings: CompilerOptions): DocumentRegistryBucketKey;
6961 /**
6962 * Informs the DocumentRegistry that a file is not needed any longer.
6963 *
6964 * Note: It is not allowed to call release on a SourceFile that was not acquired from
6965 * this registry originally.
6966 *
6967 * @param fileName The name of the file to be released
6968 * @param compilationSettings The compilation settings used to acquire the file
6969 * @param scriptKind The script kind of the file to be released
6970 */
6971 /**@deprecated pass scriptKind and impliedNodeFormat for correctness */
6972 releaseDocument(fileName: string, compilationSettings: CompilerOptions, scriptKind?: ScriptKind): void;
6973 /**
6974 * Informs the DocumentRegistry that a file is not needed any longer.
6975 *
6976 * Note: It is not allowed to call release on a SourceFile that was not acquired from
6977 * this registry originally.
6978 *
6979 * @param fileName The name of the file to be released
6980 * @param compilationSettings The compilation settings used to acquire the file
6981 * @param scriptKind The script kind of the file to be released
6982 * @param impliedNodeFormat The implied source file format of the file to be released
6983 */
6984 releaseDocument(fileName: string, compilationSettings: CompilerOptions, scriptKind: ScriptKind, impliedNodeFormat: SourceFile["impliedNodeFormat"]): void;
6985 /**
6986 * @deprecated pass scriptKind for and impliedNodeFormat correctness */
6987 releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey, scriptKind?: ScriptKind): void;
6988 releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey, scriptKind: ScriptKind, impliedNodeFormat: SourceFile["impliedNodeFormat"]): void;
6989 reportStats(): string;
6990 }
6991 type DocumentRegistryBucketKey = string & {
6992 __bucketKey: any;
6993 };
6994 function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory?: string): DocumentRegistry;
6995}
6996declare namespace ts {
6997 function preProcessFile(sourceText: string, readImportFiles?: boolean, detectJavaScriptImports?: boolean): PreProcessedFileInfo;
6998}
6999declare namespace ts {
7000 interface TranspileOptions {
7001 compilerOptions?: CompilerOptions;
7002 fileName?: string;
7003 reportDiagnostics?: boolean;
7004 moduleName?: string;
7005 renamedDependencies?: MapLike<string>;
7006 transformers?: CustomTransformers;
7007 }
7008 interface TranspileOutput {
7009 outputText: string;
7010 diagnostics?: Diagnostic[];
7011 sourceMapText?: string;
7012 }
7013 function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput;
7014 function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string;
7015}
7016declare namespace ts {
7017 /** The version of the language service API */
7018 const servicesVersion = "0.8";
7019 function toEditorSettings(options: EditorOptions | EditorSettings): EditorSettings;
7020 function displayPartsToString(displayParts: SymbolDisplayPart[] | undefined): string;
7021 function getDefaultCompilerOptions(): CompilerOptions;
7022 function getSupportedCodeFixes(): string[];
7023 function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTargetOrOptions: ScriptTarget | CreateSourceFileOptions, version: string, setNodeParents: boolean, scriptKind?: ScriptKind): SourceFile;
7024 function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange | undefined, aggressiveChecks?: boolean): SourceFile;
7025 function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry, syntaxOnlyOrLanguageServiceMode?: boolean | LanguageServiceMode): LanguageService;
7026 /**
7027 * Get the path of the default library files (lib.d.ts) as distributed with the typescript
7028 * node package.
7029 * The functionality is not supported if the ts module is consumed outside of a node module.
7030 */
7031 function getDefaultLibFilePath(options: CompilerOptions): string;
7032}
7033declare namespace ts {
7034 /**
7035 * Transform one or more nodes using the supplied transformers.
7036 * @param source A single `Node` or an array of `Node` objects.
7037 * @param transformers An array of `TransformerFactory` callbacks used to process the transformation.
7038 * @param compilerOptions Optional compiler options.
7039 */
7040 function transform<T extends Node>(source: T | T[], transformers: TransformerFactory<T>[], compilerOptions?: CompilerOptions): TransformationResult<T>;
7041}
7042declare namespace ts.server {
7043 interface CompressedData {
7044 length: number;
7045 compressionKind: string;
7046 data: any;
7047 }
7048 type ModuleImportResult = {
7049 module: {};
7050 error: undefined;
7051 } | {
7052 module: undefined;
7053 error: {
7054 stack?: string;
7055 message?: string;
7056 };
7057 };
7058 /** @deprecated Use {@link ModuleImportResult} instead. */
7059 type RequireResult = ModuleImportResult;
7060 interface ServerHost extends System {
7061 watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: WatchOptions): FileWatcher;
7062 watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: WatchOptions): FileWatcher;
7063 setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
7064 clearTimeout(timeoutId: any): void;
7065 setImmediate(callback: (...args: any[]) => void, ...args: any[]): any;
7066 clearImmediate(timeoutId: any): void;
7067 gc?(): void;
7068 trace?(s: string): void;
7069 require?(initialPath: string, moduleName: string): ModuleImportResult;
7070 }
7071}
7072declare namespace ts.server {
7073 enum LogLevel {
7074 terse = 0,
7075 normal = 1,
7076 requestTime = 2,
7077 verbose = 3
7078 }
7079 const emptyArray: SortedReadonlyArray<never>;
7080 interface Logger {
7081 close(): void;
7082 hasLevel(level: LogLevel): boolean;
7083 loggingEnabled(): boolean;
7084 perftrc(s: string): void;
7085 info(s: string): void;
7086 startGroup(): void;
7087 endGroup(): void;
7088 msg(s: string, type?: Msg): void;
7089 getLogFileName(): string | undefined;
7090 }
7091 enum Msg {
7092 Err = "Err",
7093 Info = "Info",
7094 Perf = "Perf"
7095 }
7096 namespace Msg {
7097 /** @deprecated Only here for backwards-compatibility. Prefer just `Msg`. */
7098 type Types = Msg;
7099 }
7100 function createInstallTypingsRequest(project: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string>, cachePath?: string): DiscoverTypings;
7101 namespace Errors {
7102 function ThrowNoProject(): never;
7103 function ThrowProjectLanguageServiceDisabled(): never;
7104 function ThrowProjectDoesNotContainDocument(fileName: string, project: Project): never;
7105 }
7106 type NormalizedPath = string & {
7107 __normalizedPathTag: any;
7108 };
7109 function toNormalizedPath(fileName: string): NormalizedPath;
7110 function normalizedPathToPath(normalizedPath: NormalizedPath, currentDirectory: string, getCanonicalFileName: (f: string) => string): Path;
7111 function asNormalizedPath(fileName: string): NormalizedPath;
7112 interface NormalizedPathMap<T> {
7113 get(path: NormalizedPath): T | undefined;
7114 set(path: NormalizedPath, value: T): void;
7115 contains(path: NormalizedPath): boolean;
7116 remove(path: NormalizedPath): void;
7117 }
7118 function createNormalizedPathMap<T>(): NormalizedPathMap<T>;
7119 function isInferredProjectName(name: string): boolean;
7120 function makeInferredProjectName(counter: number): string;
7121 function createSortedArray<T>(): SortedArray<T>;
7122}
7123/**
7124 * Declaration module describing the TypeScript Server protocol
7125 */
7126declare namespace ts.server.protocol {
7127 enum CommandTypes {
7128 JsxClosingTag = "jsxClosingTag",
7129 Brace = "brace",
7130 BraceCompletion = "braceCompletion",
7131 GetSpanOfEnclosingComment = "getSpanOfEnclosingComment",
7132 Change = "change",
7133 Close = "close",
7134 /** @deprecated Prefer CompletionInfo -- see comment on CompletionsResponse */
7135 Completions = "completions",
7136 CompletionInfo = "completionInfo",
7137 CompletionDetails = "completionEntryDetails",
7138 CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList",
7139 CompileOnSaveEmitFile = "compileOnSaveEmitFile",
7140 Configure = "configure",
7141 Definition = "definition",
7142 DefinitionAndBoundSpan = "definitionAndBoundSpan",
7143 Implementation = "implementation",
7144 Exit = "exit",
7145 FileReferences = "fileReferences",
7146 Format = "format",
7147 Formatonkey = "formatonkey",
7148 Geterr = "geterr",
7149 GeterrForProject = "geterrForProject",
7150 SemanticDiagnosticsSync = "semanticDiagnosticsSync",
7151 SyntacticDiagnosticsSync = "syntacticDiagnosticsSync",
7152 SuggestionDiagnosticsSync = "suggestionDiagnosticsSync",
7153 NavBar = "navbar",
7154 Navto = "navto",
7155 NavTree = "navtree",
7156 NavTreeFull = "navtree-full",
7157 /** @deprecated */
7158 Occurrences = "occurrences",
7159 DocumentHighlights = "documentHighlights",
7160 Open = "open",
7161 Quickinfo = "quickinfo",
7162 References = "references",
7163 Reload = "reload",
7164 Rename = "rename",
7165 Saveto = "saveto",
7166 SignatureHelp = "signatureHelp",
7167 FindSourceDefinition = "findSourceDefinition",
7168 Status = "status",
7169 TypeDefinition = "typeDefinition",
7170 ProjectInfo = "projectInfo",
7171 ReloadProjects = "reloadProjects",
7172 Unknown = "unknown",
7173 OpenExternalProject = "openExternalProject",
7174 OpenExternalProjects = "openExternalProjects",
7175 CloseExternalProject = "closeExternalProject",
7176 UpdateOpen = "updateOpen",
7177 GetOutliningSpans = "getOutliningSpans",
7178 TodoComments = "todoComments",
7179 Indentation = "indentation",
7180 DocCommentTemplate = "docCommentTemplate",
7181 CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects",
7182 GetCodeFixes = "getCodeFixes",
7183 GetCombinedCodeFix = "getCombinedCodeFix",
7184 ApplyCodeActionCommand = "applyCodeActionCommand",
7185 GetSupportedCodeFixes = "getSupportedCodeFixes",
7186 GetApplicableRefactors = "getApplicableRefactors",
7187 GetEditsForRefactor = "getEditsForRefactor",
7188 OrganizeImports = "organizeImports",
7189 GetEditsForFileRename = "getEditsForFileRename",
7190 ConfigurePlugin = "configurePlugin",
7191 SelectionRange = "selectionRange",
7192 ToggleLineComment = "toggleLineComment",
7193 ToggleMultilineComment = "toggleMultilineComment",
7194 CommentSelection = "commentSelection",
7195 UncommentSelection = "uncommentSelection",
7196 PrepareCallHierarchy = "prepareCallHierarchy",
7197 ProvideCallHierarchyIncomingCalls = "provideCallHierarchyIncomingCalls",
7198 ProvideCallHierarchyOutgoingCalls = "provideCallHierarchyOutgoingCalls",
7199 ProvideInlayHints = "provideInlayHints"
7200 }
7201 /**
7202 * A TypeScript Server message
7203 */
7204 interface Message {
7205 /**
7206 * Sequence number of the message
7207 */
7208 seq: number;
7209 /**
7210 * One of "request", "response", or "event"
7211 */
7212 type: "request" | "response" | "event";
7213 }
7214 /**
7215 * Client-initiated request message
7216 */
7217 interface Request extends Message {
7218 type: "request";
7219 /**
7220 * The command to execute
7221 */
7222 command: string;
7223 /**
7224 * Object containing arguments for the command
7225 */
7226 arguments?: any;
7227 }
7228 /**
7229 * Request to reload the project structure for all the opened files
7230 */
7231 interface ReloadProjectsRequest extends Message {
7232 command: CommandTypes.ReloadProjects;
7233 }
7234 /**
7235 * Server-initiated event message
7236 */
7237 interface Event extends Message {
7238 type: "event";
7239 /**
7240 * Name of event
7241 */
7242 event: string;
7243 /**
7244 * Event-specific information
7245 */
7246 body?: any;
7247 }
7248 /**
7249 * Response by server to client request message.
7250 */
7251 interface Response extends Message {
7252 type: "response";
7253 /**
7254 * Sequence number of the request message.
7255 */
7256 request_seq: number;
7257 /**
7258 * Outcome of the request.
7259 */
7260 success: boolean;
7261 /**
7262 * The command requested.
7263 */
7264 command: string;
7265 /**
7266 * If success === false, this should always be provided.
7267 * Otherwise, may (or may not) contain a success message.
7268 */
7269 message?: string;
7270 /**
7271 * Contains message body if success === true.
7272 */
7273 body?: any;
7274 /**
7275 * Contains extra information that plugin can include to be passed on
7276 */
7277 metadata?: unknown;
7278 /**
7279 * Exposes information about the performance of this request-response pair.
7280 */
7281 performanceData?: PerformanceData;
7282 }
7283 interface PerformanceData {
7284 /**
7285 * Time spent updating the program graph, in milliseconds.
7286 */
7287 updateGraphDurationMs?: number;
7288 /**
7289 * The time spent creating or updating the auto-import program, in milliseconds.
7290 */
7291 createAutoImportProviderProgramDurationMs?: number;
7292 }
7293 /**
7294 * Arguments for FileRequest messages.
7295 */
7296 interface FileRequestArgs {
7297 /**
7298 * The file for the request (absolute pathname required).
7299 */
7300 file: string;
7301 projectFileName?: string;
7302 }
7303 interface StatusRequest extends Request {
7304 command: CommandTypes.Status;
7305 }
7306 interface StatusResponseBody {
7307 /**
7308 * The TypeScript version (`ts.version`).
7309 */
7310 version: string;
7311 }
7312 /**
7313 * Response to StatusRequest
7314 */
7315 interface StatusResponse extends Response {
7316 body: StatusResponseBody;
7317 }
7318 /**
7319 * Requests a JS Doc comment template for a given position
7320 */
7321 interface DocCommentTemplateRequest extends FileLocationRequest {
7322 command: CommandTypes.DocCommentTemplate;
7323 }
7324 /**
7325 * Response to DocCommentTemplateRequest
7326 */
7327 interface DocCommandTemplateResponse extends Response {
7328 body?: TextInsertion;
7329 }
7330 /**
7331 * A request to get TODO comments from the file
7332 */
7333 interface TodoCommentRequest extends FileRequest {
7334 command: CommandTypes.TodoComments;
7335 arguments: TodoCommentRequestArgs;
7336 }
7337 /**
7338 * Arguments for TodoCommentRequest request.
7339 */
7340 interface TodoCommentRequestArgs extends FileRequestArgs {
7341 /**
7342 * Array of target TodoCommentDescriptors that describes TODO comments to be found
7343 */
7344 descriptors: TodoCommentDescriptor[];
7345 }
7346 /**
7347 * Response for TodoCommentRequest request.
7348 */
7349 interface TodoCommentsResponse extends Response {
7350 body?: TodoComment[];
7351 }
7352 /**
7353 * A request to determine if the caret is inside a comment.
7354 */
7355 interface SpanOfEnclosingCommentRequest extends FileLocationRequest {
7356 command: CommandTypes.GetSpanOfEnclosingComment;
7357 arguments: SpanOfEnclosingCommentRequestArgs;
7358 }
7359 interface SpanOfEnclosingCommentRequestArgs extends FileLocationRequestArgs {
7360 /**
7361 * Requires that the enclosing span be a multi-line comment, or else the request returns undefined.
7362 */
7363 onlyMultiLine: boolean;
7364 }
7365 /**
7366 * Request to obtain outlining spans in file.
7367 */
7368 interface OutliningSpansRequest extends FileRequest {
7369 command: CommandTypes.GetOutliningSpans;
7370 }
7371 interface OutliningSpan {
7372 /** The span of the document to actually collapse. */
7373 textSpan: TextSpan;
7374 /** The span of the document to display when the user hovers over the collapsed span. */
7375 hintSpan: TextSpan;
7376 /** The text to display in the editor for the collapsed region. */
7377 bannerText: string;
7378 /**
7379 * Whether or not this region should be automatically collapsed when
7380 * the 'Collapse to Definitions' command is invoked.
7381 */
7382 autoCollapse: boolean;
7383 /**
7384 * Classification of the contents of the span
7385 */
7386 kind: OutliningSpanKind;
7387 }
7388 /**
7389 * Response to OutliningSpansRequest request.
7390 */
7391 interface OutliningSpansResponse extends Response {
7392 body?: OutliningSpan[];
7393 }
7394 /**
7395 * A request to get indentation for a location in file
7396 */
7397 interface IndentationRequest extends FileLocationRequest {
7398 command: CommandTypes.Indentation;
7399 arguments: IndentationRequestArgs;
7400 }
7401 /**
7402 * Response for IndentationRequest request.
7403 */
7404 interface IndentationResponse extends Response {
7405 body?: IndentationResult;
7406 }
7407 /**
7408 * Indentation result representing where indentation should be placed
7409 */
7410 interface IndentationResult {
7411 /**
7412 * The base position in the document that the indent should be relative to
7413 */
7414 position: number;
7415 /**
7416 * The number of columns the indent should be at relative to the position's column.
7417 */
7418 indentation: number;
7419 }
7420 /**
7421 * Arguments for IndentationRequest request.
7422 */
7423 interface IndentationRequestArgs extends FileLocationRequestArgs {
7424 /**
7425 * An optional set of settings to be used when computing indentation.
7426 * If argument is omitted - then it will use settings for file that were previously set via 'configure' request or global settings.
7427 */
7428 options?: EditorSettings;
7429 }
7430 /**
7431 * Arguments for ProjectInfoRequest request.
7432 */
7433 interface ProjectInfoRequestArgs extends FileRequestArgs {
7434 /**
7435 * Indicate if the file name list of the project is needed
7436 */
7437 needFileNameList: boolean;
7438 }
7439 /**
7440 * A request to get the project information of the current file.
7441 */
7442 interface ProjectInfoRequest extends Request {
7443 command: CommandTypes.ProjectInfo;
7444 arguments: ProjectInfoRequestArgs;
7445 }
7446 /**
7447 * A request to retrieve compiler options diagnostics for a project
7448 */
7449 interface CompilerOptionsDiagnosticsRequest extends Request {
7450 arguments: CompilerOptionsDiagnosticsRequestArgs;
7451 }
7452 /**
7453 * Arguments for CompilerOptionsDiagnosticsRequest request.
7454 */
7455 interface CompilerOptionsDiagnosticsRequestArgs {
7456 /**
7457 * Name of the project to retrieve compiler options diagnostics.
7458 */
7459 projectFileName: string;
7460 }
7461 /**
7462 * Response message body for "projectInfo" request
7463 */
7464 interface ProjectInfo {
7465 /**
7466 * For configured project, this is the normalized path of the 'tsconfig.json' file
7467 * For inferred project, this is undefined
7468 */
7469 configFileName: string;
7470 /**
7471 * The list of normalized file name in the project, including 'lib.d.ts'
7472 */
7473 fileNames?: string[];
7474 /**
7475 * Indicates if the project has a active language service instance
7476 */
7477 languageServiceDisabled?: boolean;
7478 }
7479 /**
7480 * Represents diagnostic info that includes location of diagnostic in two forms
7481 * - start position and length of the error span
7482 * - startLocation and endLocation - a pair of Location objects that store start/end line and offset of the error span.
7483 */
7484 interface DiagnosticWithLinePosition {
7485 message: string;
7486 start: number;
7487 length: number;
7488 startLocation: Location;
7489 endLocation: Location;
7490 category: string;
7491 code: number;
7492 /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
7493 reportsUnnecessary?: {};
7494 reportsDeprecated?: {};
7495 relatedInformation?: DiagnosticRelatedInformation[];
7496 }
7497 /**
7498 * Response message for "projectInfo" request
7499 */
7500 interface ProjectInfoResponse extends Response {
7501 body?: ProjectInfo;
7502 }
7503 /**
7504 * Request whose sole parameter is a file name.
7505 */
7506 interface FileRequest extends Request {
7507 arguments: FileRequestArgs;
7508 }
7509 /**
7510 * Instances of this interface specify a location in a source file:
7511 * (file, line, character offset), where line and character offset are 1-based.
7512 */
7513 interface FileLocationRequestArgs extends FileRequestArgs {
7514 /**
7515 * The line number for the request (1-based).
7516 */
7517 line: number;
7518 /**
7519 * The character offset (on the line) for the request (1-based).
7520 */
7521 offset: number;
7522 }
7523 type FileLocationOrRangeRequestArgs = FileLocationRequestArgs | FileRangeRequestArgs;
7524 /**
7525 * Request refactorings at a given position or selection area.
7526 */
7527 interface GetApplicableRefactorsRequest extends Request {
7528 command: CommandTypes.GetApplicableRefactors;
7529 arguments: GetApplicableRefactorsRequestArgs;
7530 }
7531 type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs & {
7532 triggerReason?: RefactorTriggerReason;
7533 kind?: string;
7534 };
7535 type RefactorTriggerReason = "implicit" | "invoked";
7536 /**
7537 * Response is a list of available refactorings.
7538 * Each refactoring exposes one or more "Actions"; a user selects one action to invoke a refactoring
7539 */
7540 interface GetApplicableRefactorsResponse extends Response {
7541 body?: ApplicableRefactorInfo[];
7542 }
7543 /**
7544 * A set of one or more available refactoring actions, grouped under a parent refactoring.
7545 */
7546 interface ApplicableRefactorInfo {
7547 /**
7548 * The programmatic name of the refactoring
7549 */
7550 name: string;
7551 /**
7552 * A description of this refactoring category to show to the user.
7553 * If the refactoring gets inlined (see below), this text will not be visible.
7554 */
7555 description: string;
7556 /**
7557 * Inlineable refactorings can have their actions hoisted out to the top level
7558 * of a context menu. Non-inlineanable refactorings should always be shown inside
7559 * their parent grouping.
7560 *
7561 * If not specified, this value is assumed to be 'true'
7562 */
7563 inlineable?: boolean;
7564 actions: RefactorActionInfo[];
7565 }
7566 /**
7567 * Represents a single refactoring action - for example, the "Extract Method..." refactor might
7568 * offer several actions, each corresponding to a surround class or closure to extract into.
7569 */
7570 interface RefactorActionInfo {
7571 /**
7572 * The programmatic name of the refactoring action
7573 */
7574 name: string;
7575 /**
7576 * A description of this refactoring action to show to the user.
7577 * If the parent refactoring is inlined away, this will be the only text shown,
7578 * so this description should make sense by itself if the parent is inlineable=true
7579 */
7580 description: string;
7581 /**
7582 * A message to show to the user if the refactoring cannot be applied in
7583 * the current context.
7584 */
7585 notApplicableReason?: string;
7586 /**
7587 * The hierarchical dotted name of the refactor action.
7588 */
7589 kind?: string;
7590 }
7591 interface GetEditsForRefactorRequest extends Request {
7592 command: CommandTypes.GetEditsForRefactor;
7593 arguments: GetEditsForRefactorRequestArgs;
7594 }
7595 /**
7596 * Request the edits that a particular refactoring action produces.
7597 * Callers must specify the name of the refactor and the name of the action.
7598 */
7599 type GetEditsForRefactorRequestArgs = FileLocationOrRangeRequestArgs & {
7600 refactor: string;
7601 action: string;
7602 };
7603 interface GetEditsForRefactorResponse extends Response {
7604 body?: RefactorEditInfo;
7605 }
7606 interface RefactorEditInfo {
7607 edits: FileCodeEdits[];
7608 /**
7609 * An optional location where the editor should start a rename operation once
7610 * the refactoring edits have been applied
7611 */
7612 renameLocation?: Location;
7613 renameFilename?: string;
7614 }
7615 /**
7616 * Organize imports by:
7617 * 1) Removing unused imports
7618 * 2) Coalescing imports from the same module
7619 * 3) Sorting imports
7620 */
7621 interface OrganizeImportsRequest extends Request {
7622 command: CommandTypes.OrganizeImports;
7623 arguments: OrganizeImportsRequestArgs;
7624 }
7625 type OrganizeImportsScope = GetCombinedCodeFixScope;
7626 enum OrganizeImportsMode {
7627 All = "All",
7628 SortAndCombine = "SortAndCombine",
7629 RemoveUnused = "RemoveUnused"
7630 }
7631 interface OrganizeImportsRequestArgs {
7632 scope: OrganizeImportsScope;
7633 /** @deprecated Use `mode` instead */
7634 skipDestructiveCodeActions?: boolean;
7635 mode?: OrganizeImportsMode;
7636 }
7637 interface OrganizeImportsResponse extends Response {
7638 body: readonly FileCodeEdits[];
7639 }
7640 interface GetEditsForFileRenameRequest extends Request {
7641 command: CommandTypes.GetEditsForFileRename;
7642 arguments: GetEditsForFileRenameRequestArgs;
7643 }
7644 /** Note: Paths may also be directories. */
7645 interface GetEditsForFileRenameRequestArgs {
7646 readonly oldFilePath: string;
7647 readonly newFilePath: string;
7648 }
7649 interface GetEditsForFileRenameResponse extends Response {
7650 body: readonly FileCodeEdits[];
7651 }
7652 /**
7653 * Request for the available codefixes at a specific position.
7654 */
7655 interface CodeFixRequest extends Request {
7656 command: CommandTypes.GetCodeFixes;
7657 arguments: CodeFixRequestArgs;
7658 }
7659 interface GetCombinedCodeFixRequest extends Request {
7660 command: CommandTypes.GetCombinedCodeFix;
7661 arguments: GetCombinedCodeFixRequestArgs;
7662 }
7663 interface GetCombinedCodeFixResponse extends Response {
7664 body: CombinedCodeActions;
7665 }
7666 interface ApplyCodeActionCommandRequest extends Request {
7667 command: CommandTypes.ApplyCodeActionCommand;
7668 arguments: ApplyCodeActionCommandRequestArgs;
7669 }
7670 interface ApplyCodeActionCommandResponse extends Response {
7671 }
7672 interface FileRangeRequestArgs extends FileRequestArgs {
7673 /**
7674 * The line number for the request (1-based).
7675 */
7676 startLine: number;
7677 /**
7678 * The character offset (on the line) for the request (1-based).
7679 */
7680 startOffset: number;
7681 /**
7682 * The line number for the request (1-based).
7683 */
7684 endLine: number;
7685 /**
7686 * The character offset (on the line) for the request (1-based).
7687 */
7688 endOffset: number;
7689 }
7690 /**
7691 * Instances of this interface specify errorcodes on a specific location in a sourcefile.
7692 */
7693 interface CodeFixRequestArgs extends FileRangeRequestArgs {
7694 /**
7695 * Errorcodes we want to get the fixes for.
7696 */
7697 errorCodes: readonly number[];
7698 }
7699 interface GetCombinedCodeFixRequestArgs {
7700 scope: GetCombinedCodeFixScope;
7701 fixId: {};
7702 }
7703 interface GetCombinedCodeFixScope {
7704 type: "file";
7705 args: FileRequestArgs;
7706 }
7707 interface ApplyCodeActionCommandRequestArgs {
7708 /** May also be an array of commands. */
7709 command: {};
7710 }
7711 /**
7712 * Response for GetCodeFixes request.
7713 */
7714 interface GetCodeFixesResponse extends Response {
7715 body?: CodeAction[];
7716 }
7717 /**
7718 * A request whose arguments specify a file location (file, line, col).
7719 */
7720 interface FileLocationRequest extends FileRequest {
7721 arguments: FileLocationRequestArgs;
7722 }
7723 /**
7724 * A request to get codes of supported code fixes.
7725 */
7726 interface GetSupportedCodeFixesRequest extends Request {
7727 command: CommandTypes.GetSupportedCodeFixes;
7728 }
7729 /**
7730 * A response for GetSupportedCodeFixesRequest request.
7731 */
7732 interface GetSupportedCodeFixesResponse extends Response {
7733 /**
7734 * List of error codes supported by the server.
7735 */
7736 body?: string[];
7737 }
7738 /**
7739 * A request to get encoded semantic classifications for a span in the file
7740 */
7741 interface EncodedSemanticClassificationsRequest extends FileRequest {
7742 arguments: EncodedSemanticClassificationsRequestArgs;
7743 }
7744 /**
7745 * Arguments for EncodedSemanticClassificationsRequest request.
7746 */
7747 interface EncodedSemanticClassificationsRequestArgs extends FileRequestArgs {
7748 /**
7749 * Start position of the span.
7750 */
7751 start: number;
7752 /**
7753 * Length of the span.
7754 */
7755 length: number;
7756 /**
7757 * Optional parameter for the semantic highlighting response, if absent it
7758 * defaults to "original".
7759 */
7760 format?: "original" | "2020";
7761 }
7762 /** The response for a EncodedSemanticClassificationsRequest */
7763 interface EncodedSemanticClassificationsResponse extends Response {
7764 body?: EncodedSemanticClassificationsResponseBody;
7765 }
7766 /**
7767 * Implementation response message. Gives series of text spans depending on the format ar.
7768 */
7769 interface EncodedSemanticClassificationsResponseBody {
7770 endOfLineState: EndOfLineState;
7771 spans: number[];
7772 }
7773 /**
7774 * Arguments in document highlight request; include: filesToSearch, file,
7775 * line, offset.
7776 */
7777 interface DocumentHighlightsRequestArgs extends FileLocationRequestArgs {
7778 /**
7779 * List of files to search for document highlights.
7780 */
7781 filesToSearch: string[];
7782 }
7783 /**
7784 * Go to definition request; value of command field is
7785 * "definition". Return response giving the file locations that
7786 * define the symbol found in file at location line, col.
7787 */
7788 interface DefinitionRequest extends FileLocationRequest {
7789 command: CommandTypes.Definition;
7790 }
7791 interface DefinitionAndBoundSpanRequest extends FileLocationRequest {
7792 readonly command: CommandTypes.DefinitionAndBoundSpan;
7793 }
7794 interface FindSourceDefinitionRequest extends FileLocationRequest {
7795 readonly command: CommandTypes.FindSourceDefinition;
7796 }
7797 interface DefinitionAndBoundSpanResponse extends Response {
7798 readonly body: DefinitionInfoAndBoundSpan;
7799 }
7800 /**
7801 * Go to type request; value of command field is
7802 * "typeDefinition". Return response giving the file locations that
7803 * define the type for the symbol found in file at location line, col.
7804 */
7805 interface TypeDefinitionRequest extends FileLocationRequest {
7806 command: CommandTypes.TypeDefinition;
7807 }
7808 /**
7809 * Go to implementation request; value of command field is
7810 * "implementation". Return response giving the file locations that
7811 * implement the symbol found in file at location line, col.
7812 */
7813 interface ImplementationRequest extends FileLocationRequest {
7814 command: CommandTypes.Implementation;
7815 }
7816 /**
7817 * Location in source code expressed as (one-based) line and (one-based) column offset.
7818 */
7819 interface Location {
7820 line: number;
7821 offset: number;
7822 }
7823 /**
7824 * Object found in response messages defining a span of text in source code.
7825 */
7826 interface TextSpan {
7827 /**
7828 * First character of the definition.
7829 */
7830 start: Location;
7831 /**
7832 * One character past last character of the definition.
7833 */
7834 end: Location;
7835 }
7836 /**
7837 * Object found in response messages defining a span of text in a specific source file.
7838 */
7839 interface FileSpan extends TextSpan {
7840 /**
7841 * File containing text span.
7842 */
7843 file: string;
7844 }
7845 interface JSDocTagInfo {
7846 /** Name of the JSDoc tag */
7847 name: string;
7848 /**
7849 * Comment text after the JSDoc tag -- the text after the tag name until the next tag or end of comment
7850 * Display parts when UserPreferences.displayPartsForJSDoc is true, flattened to string otherwise.
7851 */
7852 text?: string | SymbolDisplayPart[];
7853 }
7854 interface TextSpanWithContext extends TextSpan {
7855 contextStart?: Location;
7856 contextEnd?: Location;
7857 }
7858 interface FileSpanWithContext extends FileSpan, TextSpanWithContext {
7859 }
7860 interface DefinitionInfo extends FileSpanWithContext {
7861 /**
7862 * When true, the file may or may not exist.
7863 */
7864 unverified?: boolean;
7865 }
7866 interface DefinitionInfoAndBoundSpan {
7867 definitions: readonly DefinitionInfo[];
7868 textSpan: TextSpan;
7869 }
7870 /**
7871 * Definition response message. Gives text range for definition.
7872 */
7873 interface DefinitionResponse extends Response {
7874 body?: DefinitionInfo[];
7875 }
7876 interface DefinitionInfoAndBoundSpanResponse extends Response {
7877 body?: DefinitionInfoAndBoundSpan;
7878 }
7879 /** @deprecated Use `DefinitionInfoAndBoundSpanResponse` instead. */
7880 type DefinitionInfoAndBoundSpanReponse = DefinitionInfoAndBoundSpanResponse;
7881 /**
7882 * Definition response message. Gives text range for definition.
7883 */
7884 interface TypeDefinitionResponse extends Response {
7885 body?: FileSpanWithContext[];
7886 }
7887 /**
7888 * Implementation response message. Gives text range for implementations.
7889 */
7890 interface ImplementationResponse extends Response {
7891 body?: FileSpanWithContext[];
7892 }
7893 /**
7894 * Request to get brace completion for a location in the file.
7895 */
7896 interface BraceCompletionRequest extends FileLocationRequest {
7897 command: CommandTypes.BraceCompletion;
7898 arguments: BraceCompletionRequestArgs;
7899 }
7900 /**
7901 * Argument for BraceCompletionRequest request.
7902 */
7903 interface BraceCompletionRequestArgs extends FileLocationRequestArgs {
7904 /**
7905 * Kind of opening brace
7906 */
7907 openingBrace: string;
7908 }
7909 interface JsxClosingTagRequest extends FileLocationRequest {
7910 readonly command: CommandTypes.JsxClosingTag;
7911 readonly arguments: JsxClosingTagRequestArgs;
7912 }
7913 interface JsxClosingTagRequestArgs extends FileLocationRequestArgs {
7914 }
7915 interface JsxClosingTagResponse extends Response {
7916 readonly body: TextInsertion;
7917 }
7918 /**
7919 * @deprecated
7920 * Get occurrences request; value of command field is
7921 * "occurrences". Return response giving spans that are relevant
7922 * in the file at a given line and column.
7923 */
7924 interface OccurrencesRequest extends FileLocationRequest {
7925 command: CommandTypes.Occurrences;
7926 }
7927 /** @deprecated */
7928 interface OccurrencesResponseItem extends FileSpanWithContext {
7929 /**
7930 * True if the occurrence is a write location, false otherwise.
7931 */
7932 isWriteAccess: boolean;
7933 /**
7934 * True if the occurrence is in a string, undefined otherwise;
7935 */
7936 isInString?: true;
7937 }
7938 /** @deprecated */
7939 interface OccurrencesResponse extends Response {
7940 body?: OccurrencesResponseItem[];
7941 }
7942 /**
7943 * Get document highlights request; value of command field is
7944 * "documentHighlights". Return response giving spans that are relevant
7945 * in the file at a given line and column.
7946 */
7947 interface DocumentHighlightsRequest extends FileLocationRequest {
7948 command: CommandTypes.DocumentHighlights;
7949 arguments: DocumentHighlightsRequestArgs;
7950 }
7951 /**
7952 * Span augmented with extra information that denotes the kind of the highlighting to be used for span.
7953 */
7954 interface HighlightSpan extends TextSpanWithContext {
7955 kind: HighlightSpanKind;
7956 }
7957 /**
7958 * Represents a set of highligh spans for a give name
7959 */
7960 interface DocumentHighlightsItem {
7961 /**
7962 * File containing highlight spans.
7963 */
7964 file: string;
7965 /**
7966 * Spans to highlight in file.
7967 */
7968 highlightSpans: HighlightSpan[];
7969 }
7970 /**
7971 * Response for a DocumentHighlightsRequest request.
7972 */
7973 interface DocumentHighlightsResponse extends Response {
7974 body?: DocumentHighlightsItem[];
7975 }
7976 /**
7977 * Find references request; value of command field is
7978 * "references". Return response giving the file locations that
7979 * reference the symbol found in file at location line, col.
7980 */
7981 interface ReferencesRequest extends FileLocationRequest {
7982 command: CommandTypes.References;
7983 }
7984 interface ReferencesResponseItem extends FileSpanWithContext {
7985 /**
7986 * Text of line containing the reference. Including this
7987 * with the response avoids latency of editor loading files
7988 * to show text of reference line (the server already has loaded the referencing files).
7989 *
7990 * If {@link UserPreferences.disableLineTextInReferences} is enabled, the property won't be filled
7991 */
7992 lineText?: string;
7993 /**
7994 * True if reference is a write location, false otherwise.
7995 */
7996 isWriteAccess: boolean;
7997 /**
7998 * Present only if the search was triggered from a declaration.
7999 * True indicates that the references refers to the same symbol
8000 * (i.e. has the same meaning) as the declaration that began the
8001 * search.
8002 */
8003 isDefinition?: boolean;
8004 }
8005 /**
8006 * The body of a "references" response message.
8007 */
8008 interface ReferencesResponseBody {
8009 /**
8010 * The file locations referencing the symbol.
8011 */
8012 refs: readonly ReferencesResponseItem[];
8013 /**
8014 * The name of the symbol.
8015 */
8016 symbolName: string;
8017 /**
8018 * The start character offset of the symbol (on the line provided by the references request).
8019 */
8020 symbolStartOffset: number;
8021 /**
8022 * The full display name of the symbol.
8023 */
8024 symbolDisplayString: string;
8025 }
8026 /**
8027 * Response to "references" request.
8028 */
8029 interface ReferencesResponse extends Response {
8030 body?: ReferencesResponseBody;
8031 }
8032 interface FileReferencesRequest extends FileRequest {
8033 command: CommandTypes.FileReferences;
8034 }
8035 interface FileReferencesResponseBody {
8036 /**
8037 * The file locations referencing the symbol.
8038 */
8039 refs: readonly ReferencesResponseItem[];
8040 /**
8041 * The name of the symbol.
8042 */
8043 symbolName: string;
8044 }
8045 interface FileReferencesResponse extends Response {
8046 body?: FileReferencesResponseBody;
8047 }
8048 /**
8049 * Argument for RenameRequest request.
8050 */
8051 interface RenameRequestArgs extends FileLocationRequestArgs {
8052 /**
8053 * Should text at specified location be found/changed in comments?
8054 */
8055 findInComments?: boolean;
8056 /**
8057 * Should text at specified location be found/changed in strings?
8058 */
8059 findInStrings?: boolean;
8060 }
8061 /**
8062 * Rename request; value of command field is "rename". Return
8063 * response giving the file locations that reference the symbol
8064 * found in file at location line, col. Also return full display
8065 * name of the symbol so that client can print it unambiguously.
8066 */
8067 interface RenameRequest extends FileLocationRequest {
8068 command: CommandTypes.Rename;
8069 arguments: RenameRequestArgs;
8070 }
8071 /**
8072 * Information about the item to be renamed.
8073 */
8074 type RenameInfo = RenameInfoSuccess | RenameInfoFailure;
8075 interface RenameInfoSuccess {
8076 /**
8077 * True if item can be renamed.
8078 */
8079 canRename: true;
8080 /**
8081 * File or directory to rename.
8082 * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`.
8083 */
8084 fileToRename?: string;
8085 /**
8086 * Display name of the item to be renamed.
8087 */
8088 displayName: string;
8089 /**
8090 * Full display name of item to be renamed.
8091 */
8092 fullDisplayName: string;
8093 /**
8094 * The items's kind (such as 'className' or 'parameterName' or plain 'text').
8095 */
8096 kind: ScriptElementKind;
8097 /**
8098 * Optional modifiers for the kind (such as 'public').
8099 */
8100 kindModifiers: string;
8101 /** Span of text to rename. */
8102 triggerSpan: TextSpan;
8103 }
8104 interface RenameInfoFailure {
8105 canRename: false;
8106 /**
8107 * Error message if item can not be renamed.
8108 */
8109 localizedErrorMessage: string;
8110 }
8111 /**
8112 * A group of text spans, all in 'file'.
8113 */
8114 interface SpanGroup {
8115 /** The file to which the spans apply */
8116 file: string;
8117 /** The text spans in this group */
8118 locs: RenameTextSpan[];
8119 }
8120 interface RenameTextSpan extends TextSpanWithContext {
8121 readonly prefixText?: string;
8122 readonly suffixText?: string;
8123 }
8124 interface RenameResponseBody {
8125 /**
8126 * Information about the item to be renamed.
8127 */
8128 info: RenameInfo;
8129 /**
8130 * An array of span groups (one per file) that refer to the item to be renamed.
8131 */
8132 locs: readonly SpanGroup[];
8133 }
8134 /**
8135 * Rename response message.
8136 */
8137 interface RenameResponse extends Response {
8138 body?: RenameResponseBody;
8139 }
8140 /**
8141 * Represents a file in external project.
8142 * External project is project whose set of files, compilation options and open\close state
8143 * is maintained by the client (i.e. if all this data come from .csproj file in Visual Studio).
8144 * External project will exist even if all files in it are closed and should be closed explicitly.
8145 * If external project includes one or more tsconfig.json/jsconfig.json files then tsserver will
8146 * create configured project for every config file but will maintain a link that these projects were created
8147 * as a result of opening external project so they should be removed once external project is closed.
8148 */
8149 interface ExternalFile {
8150 /**
8151 * Name of file file
8152 */
8153 fileName: string;
8154 /**
8155 * Script kind of the file
8156 */
8157 scriptKind?: ScriptKindName | ts.ScriptKind;
8158 /**
8159 * Whether file has mixed content (i.e. .cshtml file that combines html markup with C#/JavaScript)
8160 */
8161 hasMixedContent?: boolean;
8162 /**
8163 * Content of the file
8164 */
8165 content?: string;
8166 }
8167 /**
8168 * Represent an external project
8169 */
8170 interface ExternalProject {
8171 /**
8172 * Project name
8173 */
8174 projectFileName: string;
8175 /**
8176 * List of root files in project
8177 */
8178 rootFiles: ExternalFile[];
8179 /**
8180 * Compiler options for the project
8181 */
8182 options: ExternalProjectCompilerOptions;
8183 /**
8184 * @deprecated typingOptions. Use typeAcquisition instead
8185 */
8186 typingOptions?: TypeAcquisition;
8187 /**
8188 * Explicitly specified type acquisition for the project
8189 */
8190 typeAcquisition?: TypeAcquisition;
8191 }
8192 interface CompileOnSaveMixin {
8193 /**
8194 * If compile on save is enabled for the project
8195 */
8196 compileOnSave?: boolean;
8197 }
8198 /**
8199 * For external projects, some of the project settings are sent together with
8200 * compiler settings.
8201 */
8202 type ExternalProjectCompilerOptions = CompilerOptions & CompileOnSaveMixin & WatchOptions;
8203 interface FileWithProjectReferenceRedirectInfo {
8204 /**
8205 * Name of file
8206 */
8207 fileName: string;
8208 /**
8209 * True if the file is primarily included in a referenced project
8210 */
8211 isSourceOfProjectReferenceRedirect: boolean;
8212 }
8213 /**
8214 * Represents a set of changes that happen in project
8215 */
8216 interface ProjectChanges {
8217 /**
8218 * List of added files
8219 */
8220 added: string[] | FileWithProjectReferenceRedirectInfo[];
8221 /**
8222 * List of removed files
8223 */
8224 removed: string[] | FileWithProjectReferenceRedirectInfo[];
8225 /**
8226 * List of updated files
8227 */
8228 updated: string[] | FileWithProjectReferenceRedirectInfo[];
8229 /**
8230 * List of files that have had their project reference redirect status updated
8231 * Only provided when the synchronizeProjectList request has includeProjectReferenceRedirectInfo set to true
8232 */
8233 updatedRedirects?: FileWithProjectReferenceRedirectInfo[];
8234 }
8235 /**
8236 * Information found in a configure request.
8237 */
8238 interface ConfigureRequestArguments {
8239 /**
8240 * Information about the host, for example 'Emacs 24.4' or
8241 * 'Sublime Text version 3075'
8242 */
8243 hostInfo?: string;
8244 /**
8245 * If present, tab settings apply only to this file.
8246 */
8247 file?: string;
8248 /**
8249 * The format options to use during formatting and other code editing features.
8250 */
8251 formatOptions?: FormatCodeSettings;
8252 preferences?: UserPreferences;
8253 /**
8254 * The host's additional supported .js file extensions
8255 */
8256 extraFileExtensions?: FileExtensionInfo[];
8257 watchOptions?: WatchOptions;
8258 }
8259 enum WatchFileKind {
8260 FixedPollingInterval = "FixedPollingInterval",
8261 PriorityPollingInterval = "PriorityPollingInterval",
8262 DynamicPriorityPolling = "DynamicPriorityPolling",
8263 FixedChunkSizePolling = "FixedChunkSizePolling",
8264 UseFsEvents = "UseFsEvents",
8265 UseFsEventsOnParentDirectory = "UseFsEventsOnParentDirectory"
8266 }
8267 enum WatchDirectoryKind {
8268 UseFsEvents = "UseFsEvents",
8269 FixedPollingInterval = "FixedPollingInterval",
8270 DynamicPriorityPolling = "DynamicPriorityPolling",
8271 FixedChunkSizePolling = "FixedChunkSizePolling"
8272 }
8273 enum PollingWatchKind {
8274 FixedInterval = "FixedInterval",
8275 PriorityInterval = "PriorityInterval",
8276 DynamicPriority = "DynamicPriority",
8277 FixedChunkSize = "FixedChunkSize"
8278 }
8279 interface WatchOptions {
8280 watchFile?: WatchFileKind | ts.WatchFileKind;
8281 watchDirectory?: WatchDirectoryKind | ts.WatchDirectoryKind;
8282 fallbackPolling?: PollingWatchKind | ts.PollingWatchKind;
8283 synchronousWatchDirectory?: boolean;
8284 excludeDirectories?: string[];
8285 excludeFiles?: string[];
8286 [option: string]: CompilerOptionsValue | undefined;
8287 }
8288 /**
8289 * Configure request; value of command field is "configure". Specifies
8290 * host information, such as host type, tab size, and indent size.
8291 */
8292 interface ConfigureRequest extends Request {
8293 command: CommandTypes.Configure;
8294 arguments: ConfigureRequestArguments;
8295 }
8296 /**
8297 * Response to "configure" request. This is just an acknowledgement, so
8298 * no body field is required.
8299 */
8300 interface ConfigureResponse extends Response {
8301 }
8302 interface ConfigurePluginRequestArguments {
8303 pluginName: string;
8304 configuration: any;
8305 }
8306 interface ConfigurePluginRequest extends Request {
8307 command: CommandTypes.ConfigurePlugin;
8308 arguments: ConfigurePluginRequestArguments;
8309 }
8310 interface ConfigurePluginResponse extends Response {
8311 }
8312 interface SelectionRangeRequest extends FileRequest {
8313 command: CommandTypes.SelectionRange;
8314 arguments: SelectionRangeRequestArgs;
8315 }
8316 interface SelectionRangeRequestArgs extends FileRequestArgs {
8317 locations: Location[];
8318 }
8319 interface SelectionRangeResponse extends Response {
8320 body?: SelectionRange[];
8321 }
8322 interface SelectionRange {
8323 textSpan: TextSpan;
8324 parent?: SelectionRange;
8325 }
8326 interface ToggleLineCommentRequest extends FileRequest {
8327 command: CommandTypes.ToggleLineComment;
8328 arguments: FileRangeRequestArgs;
8329 }
8330 interface ToggleMultilineCommentRequest extends FileRequest {
8331 command: CommandTypes.ToggleMultilineComment;
8332 arguments: FileRangeRequestArgs;
8333 }
8334 interface CommentSelectionRequest extends FileRequest {
8335 command: CommandTypes.CommentSelection;
8336 arguments: FileRangeRequestArgs;
8337 }
8338 interface UncommentSelectionRequest extends FileRequest {
8339 command: CommandTypes.UncommentSelection;
8340 arguments: FileRangeRequestArgs;
8341 }
8342 /**
8343 * Information found in an "open" request.
8344 */
8345 interface OpenRequestArgs extends FileRequestArgs {
8346 /**
8347 * Used when a version of the file content is known to be more up to date than the one on disk.
8348 * Then the known content will be used upon opening instead of the disk copy
8349 */
8350 fileContent?: string;
8351 /**
8352 * Used to specify the script kind of the file explicitly. It could be one of the following:
8353 * "TS", "JS", "TSX", "JSX"
8354 */
8355 scriptKindName?: ScriptKindName;
8356 /**
8357 * Used to limit the searching for project config file. If given the searching will stop at this
8358 * root path; otherwise it will go all the way up to the dist root path.
8359 */
8360 projectRootPath?: string;
8361 }
8362 type ScriptKindName = "TS" | "JS" | "TSX" | "JSX";
8363 /**
8364 * Open request; value of command field is "open". Notify the
8365 * server that the client has file open. The server will not
8366 * monitor the filesystem for changes in this file and will assume
8367 * that the client is updating the server (using the change and/or
8368 * reload messages) when the file changes. Server does not currently
8369 * send a response to an open request.
8370 */
8371 interface OpenRequest extends Request {
8372 command: CommandTypes.Open;
8373 arguments: OpenRequestArgs;
8374 }
8375 /**
8376 * Request to open or update external project
8377 */
8378 interface OpenExternalProjectRequest extends Request {
8379 command: CommandTypes.OpenExternalProject;
8380 arguments: OpenExternalProjectArgs;
8381 }
8382 /**
8383 * Arguments to OpenExternalProjectRequest request
8384 */
8385 type OpenExternalProjectArgs = ExternalProject;
8386 /**
8387 * Request to open multiple external projects
8388 */
8389 interface OpenExternalProjectsRequest extends Request {
8390 command: CommandTypes.OpenExternalProjects;
8391 arguments: OpenExternalProjectsArgs;
8392 }
8393 /**
8394 * Arguments to OpenExternalProjectsRequest
8395 */
8396 interface OpenExternalProjectsArgs {
8397 /**
8398 * List of external projects to open or update
8399 */
8400 projects: ExternalProject[];
8401 }
8402 /**
8403 * Response to OpenExternalProjectRequest request. This is just an acknowledgement, so
8404 * no body field is required.
8405 */
8406 interface OpenExternalProjectResponse extends Response {
8407 }
8408 /**
8409 * Response to OpenExternalProjectsRequest request. This is just an acknowledgement, so
8410 * no body field is required.
8411 */
8412 interface OpenExternalProjectsResponse extends Response {
8413 }
8414 /**
8415 * Request to close external project.
8416 */
8417 interface CloseExternalProjectRequest extends Request {
8418 command: CommandTypes.CloseExternalProject;
8419 arguments: CloseExternalProjectRequestArgs;
8420 }
8421 /**
8422 * Arguments to CloseExternalProjectRequest request
8423 */
8424 interface CloseExternalProjectRequestArgs {
8425 /**
8426 * Name of the project to close
8427 */
8428 projectFileName: string;
8429 }
8430 /**
8431 * Response to CloseExternalProjectRequest request. This is just an acknowledgement, so
8432 * no body field is required.
8433 */
8434 interface CloseExternalProjectResponse extends Response {
8435 }
8436 /**
8437 * Request to synchronize list of open files with the client
8438 */
8439 interface UpdateOpenRequest extends Request {
8440 command: CommandTypes.UpdateOpen;
8441 arguments: UpdateOpenRequestArgs;
8442 }
8443 /**
8444 * Arguments to UpdateOpenRequest
8445 */
8446 interface UpdateOpenRequestArgs {
8447 /**
8448 * List of newly open files
8449 */
8450 openFiles?: OpenRequestArgs[];
8451 /**
8452 * List of open files files that were changes
8453 */
8454 changedFiles?: FileCodeEdits[];
8455 /**
8456 * List of files that were closed
8457 */
8458 closedFiles?: string[];
8459 }
8460 /**
8461 * External projects have a typeAcquisition option so they need to be added separately to compiler options for inferred projects.
8462 */
8463 type InferredProjectCompilerOptions = ExternalProjectCompilerOptions & TypeAcquisition;
8464 /**
8465 * Request to set compiler options for inferred projects.
8466 * External projects are opened / closed explicitly.
8467 * Configured projects are opened when user opens loose file that has 'tsconfig.json' or 'jsconfig.json' anywhere in one of containing folders.
8468 * This configuration file will be used to obtain a list of files and configuration settings for the project.
8469 * Inferred projects are created when user opens a loose file that is not the part of external project
8470 * or configured project and will contain only open file and transitive closure of referenced files if 'useOneInferredProject' is false,
8471 * or all open loose files and its transitive closure of referenced files if 'useOneInferredProject' is true.
8472 */
8473 interface SetCompilerOptionsForInferredProjectsRequest extends Request {
8474 command: CommandTypes.CompilerOptionsForInferredProjects;
8475 arguments: SetCompilerOptionsForInferredProjectsArgs;
8476 }
8477 /**
8478 * Argument for SetCompilerOptionsForInferredProjectsRequest request.
8479 */
8480 interface SetCompilerOptionsForInferredProjectsArgs {
8481 /**
8482 * Compiler options to be used with inferred projects.
8483 */
8484 options: InferredProjectCompilerOptions;
8485 /**
8486 * Specifies the project root path used to scope compiler options.
8487 * It is an error to provide this property if the server has not been started with
8488 * `useInferredProjectPerProjectRoot` enabled.
8489 */
8490 projectRootPath?: string;
8491 }
8492 /**
8493 * Response to SetCompilerOptionsForInferredProjectsResponse request. This is just an acknowledgement, so
8494 * no body field is required.
8495 */
8496 interface SetCompilerOptionsForInferredProjectsResponse extends Response {
8497 }
8498 /**
8499 * Exit request; value of command field is "exit". Ask the server process
8500 * to exit.
8501 */
8502 interface ExitRequest extends Request {
8503 command: CommandTypes.Exit;
8504 }
8505 /**
8506 * Close request; value of command field is "close". Notify the
8507 * server that the client has closed a previously open file. If
8508 * file is still referenced by open files, the server will resume
8509 * monitoring the filesystem for changes to file. Server does not
8510 * currently send a response to a close request.
8511 */
8512 interface CloseRequest extends FileRequest {
8513 command: CommandTypes.Close;
8514 }
8515 /**
8516 * Request to obtain the list of files that should be regenerated if target file is recompiled.
8517 * NOTE: this us query-only operation and does not generate any output on disk.
8518 */
8519 interface CompileOnSaveAffectedFileListRequest extends FileRequest {
8520 command: CommandTypes.CompileOnSaveAffectedFileList;
8521 }
8522 /**
8523 * Contains a list of files that should be regenerated in a project
8524 */
8525 interface CompileOnSaveAffectedFileListSingleProject {
8526 /**
8527 * Project name
8528 */
8529 projectFileName: string;
8530 /**
8531 * List of files names that should be recompiled
8532 */
8533 fileNames: string[];
8534 /**
8535 * true if project uses outFile or out compiler option
8536 */
8537 projectUsesOutFile: boolean;
8538 }
8539 /**
8540 * Response for CompileOnSaveAffectedFileListRequest request;
8541 */
8542 interface CompileOnSaveAffectedFileListResponse extends Response {
8543 body: CompileOnSaveAffectedFileListSingleProject[];
8544 }
8545 /**
8546 * Request to recompile the file. All generated outputs (.js, .d.ts or .js.map files) is written on disk.
8547 */
8548 interface CompileOnSaveEmitFileRequest extends FileRequest {
8549 command: CommandTypes.CompileOnSaveEmitFile;
8550 arguments: CompileOnSaveEmitFileRequestArgs;
8551 }
8552 /**
8553 * Arguments for CompileOnSaveEmitFileRequest
8554 */
8555 interface CompileOnSaveEmitFileRequestArgs extends FileRequestArgs {
8556 /**
8557 * if true - then file should be recompiled even if it does not have any changes.
8558 */
8559 forced?: boolean;
8560 includeLinePosition?: boolean;
8561 /** if true - return response as object with emitSkipped and diagnostics */
8562 richResponse?: boolean;
8563 }
8564 interface CompileOnSaveEmitFileResponse extends Response {
8565 body: boolean | EmitResult;
8566 }
8567 interface EmitResult {
8568 emitSkipped: boolean;
8569 diagnostics: Diagnostic[] | DiagnosticWithLinePosition[];
8570 }
8571 /**
8572 * Quickinfo request; value of command field is
8573 * "quickinfo". Return response giving a quick type and
8574 * documentation string for the symbol found in file at location
8575 * line, col.
8576 */
8577 interface QuickInfoRequest extends FileLocationRequest {
8578 command: CommandTypes.Quickinfo;
8579 arguments: FileLocationRequestArgs;
8580 }
8581 /**
8582 * Body of QuickInfoResponse.
8583 */
8584 interface QuickInfoResponseBody {
8585 /**
8586 * The symbol's kind (such as 'className' or 'parameterName' or plain 'text').
8587 */
8588 kind: ScriptElementKind;
8589 /**
8590 * Optional modifiers for the kind (such as 'public').
8591 */
8592 kindModifiers: string;
8593 /**
8594 * Starting file location of symbol.
8595 */
8596 start: Location;
8597 /**
8598 * One past last character of symbol.
8599 */
8600 end: Location;
8601 /**
8602 * Type and kind of symbol.
8603 */
8604 displayString: string;
8605 /**
8606 * Documentation associated with symbol.
8607 * Display parts when UserPreferences.displayPartsForJSDoc is true, flattened to string otherwise.
8608 */
8609 documentation: string | SymbolDisplayPart[];
8610 /**
8611 * JSDoc tags associated with symbol.
8612 */
8613 tags: JSDocTagInfo[];
8614 }
8615 /**
8616 * Quickinfo response message.
8617 */
8618 interface QuickInfoResponse extends Response {
8619 body?: QuickInfoResponseBody;
8620 }
8621 /**
8622 * Arguments for format messages.
8623 */
8624 interface FormatRequestArgs extends FileLocationRequestArgs {
8625 /**
8626 * Last line of range for which to format text in file.
8627 */
8628 endLine: number;
8629 /**
8630 * Character offset on last line of range for which to format text in file.
8631 */
8632 endOffset: number;
8633 /**
8634 * Format options to be used.
8635 */
8636 options?: FormatCodeSettings;
8637 }
8638 /**
8639 * Format request; value of command field is "format". Return
8640 * response giving zero or more edit instructions. The edit
8641 * instructions will be sorted in file order. Applying the edit
8642 * instructions in reverse to file will result in correctly
8643 * reformatted text.
8644 */
8645 interface FormatRequest extends FileLocationRequest {
8646 command: CommandTypes.Format;
8647 arguments: FormatRequestArgs;
8648 }
8649 /**
8650 * Object found in response messages defining an editing
8651 * instruction for a span of text in source code. The effect of
8652 * this instruction is to replace the text starting at start and
8653 * ending one character before end with newText. For an insertion,
8654 * the text span is empty. For a deletion, newText is empty.
8655 */
8656 interface CodeEdit {
8657 /**
8658 * First character of the text span to edit.
8659 */
8660 start: Location;
8661 /**
8662 * One character past last character of the text span to edit.
8663 */
8664 end: Location;
8665 /**
8666 * Replace the span defined above with this string (may be
8667 * the empty string).
8668 */
8669 newText: string;
8670 }
8671 interface FileCodeEdits {
8672 fileName: string;
8673 textChanges: CodeEdit[];
8674 }
8675 interface CodeFixResponse extends Response {
8676 /** The code actions that are available */
8677 body?: CodeFixAction[];
8678 }
8679 interface CodeAction {
8680 /** Description of the code action to display in the UI of the editor */
8681 description: string;
8682 /** Text changes to apply to each file as part of the code action */
8683 changes: FileCodeEdits[];
8684 /** A command is an opaque object that should be passed to `ApplyCodeActionCommandRequestArgs` without modification. */
8685 commands?: {}[];
8686 }
8687 interface CombinedCodeActions {
8688 changes: readonly FileCodeEdits[];
8689 commands?: readonly {}[];
8690 }
8691 interface CodeFixAction extends CodeAction {
8692 /** Short name to identify the fix, for use by telemetry. */
8693 fixName: string;
8694 /**
8695 * If present, one may call 'getCombinedCodeFix' with this fixId.
8696 * This may be omitted to indicate that the code fix can't be applied in a group.
8697 */
8698 fixId?: {};
8699 /** Should be present if and only if 'fixId' is. */
8700 fixAllDescription?: string;
8701 }
8702 /**
8703 * Format and format on key response message.
8704 */
8705 interface FormatResponse extends Response {
8706 body?: CodeEdit[];
8707 }
8708 /**
8709 * Arguments for format on key messages.
8710 */
8711 interface FormatOnKeyRequestArgs extends FileLocationRequestArgs {
8712 /**
8713 * Key pressed (';', '\n', or '}').
8714 */
8715 key: string;
8716 options?: FormatCodeSettings;
8717 }
8718 /**
8719 * Format on key request; value of command field is
8720 * "formatonkey". Given file location and key typed (as string),
8721 * return response giving zero or more edit instructions. The
8722 * edit instructions will be sorted in file order. Applying the
8723 * edit instructions in reverse to file will result in correctly
8724 * reformatted text.
8725 */
8726 interface FormatOnKeyRequest extends FileLocationRequest {
8727 command: CommandTypes.Formatonkey;
8728 arguments: FormatOnKeyRequestArgs;
8729 }
8730 type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<" | "#" | " ";
8731 enum CompletionTriggerKind {
8732 /** Completion was triggered by typing an identifier, manual invocation (e.g Ctrl+Space) or via API. */
8733 Invoked = 1,
8734 /** Completion was triggered by a trigger character. */
8735 TriggerCharacter = 2,
8736 /** Completion was re-triggered as the current completion list is incomplete. */
8737 TriggerForIncompleteCompletions = 3
8738 }
8739 /**
8740 * Arguments for completions messages.
8741 */
8742 interface CompletionsRequestArgs extends FileLocationRequestArgs {
8743 /**
8744 * Optional prefix to apply to possible completions.
8745 */
8746 prefix?: string;
8747 /**
8748 * Character that was responsible for triggering completion.
8749 * Should be `undefined` if a user manually requested completion.
8750 */
8751 triggerCharacter?: CompletionsTriggerCharacter;
8752 triggerKind?: CompletionTriggerKind;
8753 /**
8754 * @deprecated Use UserPreferences.includeCompletionsForModuleExports
8755 */
8756 includeExternalModuleExports?: boolean;
8757 /**
8758 * @deprecated Use UserPreferences.includeCompletionsWithInsertText
8759 */
8760 includeInsertTextCompletions?: boolean;
8761 }
8762 /**
8763 * Completions request; value of command field is "completions".
8764 * Given a file location (file, line, col) and a prefix (which may
8765 * be the empty string), return the possible completions that
8766 * begin with prefix.
8767 */
8768 interface CompletionsRequest extends FileLocationRequest {
8769 command: CommandTypes.Completions | CommandTypes.CompletionInfo;
8770 arguments: CompletionsRequestArgs;
8771 }
8772 /**
8773 * Arguments for completion details request.
8774 */
8775 interface CompletionDetailsRequestArgs extends FileLocationRequestArgs {
8776 /**
8777 * Names of one or more entries for which to obtain details.
8778 */
8779 entryNames: (string | CompletionEntryIdentifier)[];
8780 }
8781 interface CompletionEntryIdentifier {
8782 name: string;
8783 source?: string;
8784 data?: unknown;
8785 }
8786 /**
8787 * Completion entry details request; value of command field is
8788 * "completionEntryDetails". Given a file location (file, line,
8789 * col) and an array of completion entry names return more
8790 * detailed information for each completion entry.
8791 */
8792 interface CompletionDetailsRequest extends FileLocationRequest {
8793 command: CommandTypes.CompletionDetails;
8794 arguments: CompletionDetailsRequestArgs;
8795 }
8796 /**
8797 * Part of a symbol description.
8798 */
8799 interface SymbolDisplayPart {
8800 /**
8801 * Text of an item describing the symbol.
8802 */
8803 text: string;
8804 /**
8805 * The symbol's kind (such as 'className' or 'parameterName' or plain 'text').
8806 */
8807 kind: string;
8808 }
8809 /** A part of a symbol description that links from a jsdoc @link tag to a declaration */
8810 interface JSDocLinkDisplayPart extends SymbolDisplayPart {
8811 /** The location of the declaration that the @link tag links to. */
8812 target: FileSpan;
8813 }
8814 /**
8815 * An item found in a completion response.
8816 */
8817 interface CompletionEntry {
8818 /**
8819 * The symbol's name.
8820 */
8821 name: string;
8822 /**
8823 * The symbol's kind (such as 'className' or 'parameterName').
8824 */
8825 kind: ScriptElementKind;
8826 /**
8827 * Optional modifiers for the kind (such as 'public').
8828 */
8829 kindModifiers?: string;
8830 /**
8831 * A string that is used for comparing completion items so that they can be ordered. This
8832 * is often the same as the name but may be different in certain circumstances.
8833 */
8834 sortText: string;
8835 /**
8836 * Text to insert instead of `name`.
8837 * This is used to support bracketed completions; If `name` might be "a-b" but `insertText` would be `["a-b"]`,
8838 * coupled with `replacementSpan` to replace a dotted access with a bracket access.
8839 */
8840 insertText?: string;
8841 /**
8842 * `insertText` should be interpreted as a snippet if true.
8843 */
8844 isSnippet?: true;
8845 /**
8846 * An optional span that indicates the text to be replaced by this completion item.
8847 * If present, this span should be used instead of the default one.
8848 * It will be set if the required span differs from the one generated by the default replacement behavior.
8849 */
8850 replacementSpan?: TextSpan;
8851 /**
8852 * Indicates whether commiting this completion entry will require additional code actions to be
8853 * made to avoid errors. The CompletionEntryDetails will have these actions.
8854 */
8855 hasAction?: true;
8856 /**
8857 * Identifier (not necessarily human-readable) identifying where this completion came from.
8858 */
8859 source?: string;
8860 /**
8861 * Human-readable description of the `source`.
8862 */
8863 sourceDisplay?: SymbolDisplayPart[];
8864 /**
8865 * Additional details for the label.
8866 */
8867 labelDetails?: CompletionEntryLabelDetails;
8868 /**
8869 * If true, this completion should be highlighted as recommended. There will only be one of these.
8870 * This will be set when we know the user should write an expression with a certain type and that type is an enum or constructable class.
8871 * Then either that enum/class or a namespace containing it will be the recommended symbol.
8872 */
8873 isRecommended?: true;
8874 /**
8875 * If true, this completion was generated from traversing the name table of an unchecked JS file,
8876 * and therefore may not be accurate.
8877 */
8878 isFromUncheckedFile?: true;
8879 /**
8880 * If true, this completion was for an auto-import of a module not yet in the program, but listed
8881 * in the project package.json. Used for telemetry reporting.
8882 */
8883 isPackageJsonImport?: true;
8884 /**
8885 * If true, this completion was an auto-import-style completion of an import statement (i.e., the
8886 * module specifier was inserted along with the imported identifier). Used for telemetry reporting.
8887 */
8888 isImportStatementCompletion?: true;
8889 /**
8890 * A property to be sent back to TS Server in the CompletionDetailsRequest, along with `name`,
8891 * that allows TS Server to look up the symbol represented by the completion item, disambiguating
8892 * items with the same name.
8893 */
8894 data?: unknown;
8895 }
8896 interface CompletionEntryLabelDetails {
8897 /**
8898 * An optional string which is rendered less prominently directly after
8899 * {@link CompletionEntry.name name}, without any spacing. Should be
8900 * used for function signatures or type annotations.
8901 */
8902 detail?: string;
8903 /**
8904 * An optional string which is rendered less prominently after
8905 * {@link CompletionEntryLabelDetails.detail}. Should be used for fully qualified
8906 * names or file path.
8907 */
8908 description?: string;
8909 }
8910 /**
8911 * Additional completion entry details, available on demand
8912 */
8913 interface CompletionEntryDetails {
8914 /**
8915 * The symbol's name.
8916 */
8917 name: string;
8918 /**
8919 * The symbol's kind (such as 'className' or 'parameterName').
8920 */
8921 kind: ScriptElementKind;
8922 /**
8923 * Optional modifiers for the kind (such as 'public').
8924 */
8925 kindModifiers: string;
8926 /**
8927 * Display parts of the symbol (similar to quick info).
8928 */
8929 displayParts: SymbolDisplayPart[];
8930 /**
8931 * Documentation strings for the symbol.
8932 */
8933 documentation?: SymbolDisplayPart[];
8934 /**
8935 * JSDoc tags for the symbol.
8936 */
8937 tags?: JSDocTagInfo[];
8938 /**
8939 * The associated code actions for this entry
8940 */
8941 codeActions?: CodeAction[];
8942 /**
8943 * @deprecated Use `sourceDisplay` instead.
8944 */
8945 source?: SymbolDisplayPart[];
8946 /**
8947 * Human-readable description of the `source` from the CompletionEntry.
8948 */
8949 sourceDisplay?: SymbolDisplayPart[];
8950 }
8951 /** @deprecated Prefer CompletionInfoResponse, which supports several top-level fields in addition to the array of entries. */
8952 interface CompletionsResponse extends Response {
8953 body?: CompletionEntry[];
8954 }
8955 interface CompletionInfoResponse extends Response {
8956 body?: CompletionInfo;
8957 }
8958 interface CompletionInfo {
8959 readonly flags?: number;
8960 readonly isGlobalCompletion: boolean;
8961 readonly isMemberCompletion: boolean;
8962 readonly isNewIdentifierLocation: boolean;
8963 /**
8964 * In the absence of `CompletionEntry["replacementSpan"]`, the editor may choose whether to use
8965 * this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span
8966 * must be used to commit that completion entry.
8967 */
8968 readonly optionalReplacementSpan?: TextSpan;
8969 readonly isIncomplete?: boolean;
8970 readonly entries: readonly CompletionEntry[];
8971 }
8972 interface CompletionDetailsResponse extends Response {
8973 body?: CompletionEntryDetails[];
8974 }
8975 /**
8976 * Signature help information for a single parameter
8977 */
8978 interface SignatureHelpParameter {
8979 /**
8980 * The parameter's name
8981 */
8982 name: string;
8983 /**
8984 * Documentation of the parameter.
8985 */
8986 documentation: SymbolDisplayPart[];
8987 /**
8988 * Display parts of the parameter.
8989 */
8990 displayParts: SymbolDisplayPart[];
8991 /**
8992 * Whether the parameter is optional or not.
8993 */
8994 isOptional: boolean;
8995 }
8996 /**
8997 * Represents a single signature to show in signature help.
8998 */
8999 interface SignatureHelpItem {
9000 /**
9001 * Whether the signature accepts a variable number of arguments.
9002 */
9003 isVariadic: boolean;
9004 /**
9005 * The prefix display parts.
9006 */
9007 prefixDisplayParts: SymbolDisplayPart[];
9008 /**
9009 * The suffix display parts.
9010 */
9011 suffixDisplayParts: SymbolDisplayPart[];
9012 /**
9013 * The separator display parts.
9014 */
9015 separatorDisplayParts: SymbolDisplayPart[];
9016 /**
9017 * The signature helps items for the parameters.
9018 */
9019 parameters: SignatureHelpParameter[];
9020 /**
9021 * The signature's documentation
9022 */
9023 documentation: SymbolDisplayPart[];
9024 /**
9025 * The signature's JSDoc tags
9026 */
9027 tags: JSDocTagInfo[];
9028 }
9029 /**
9030 * Signature help items found in the response of a signature help request.
9031 */
9032 interface SignatureHelpItems {
9033 /**
9034 * The signature help items.
9035 */
9036 items: SignatureHelpItem[];
9037 /**
9038 * The span for which signature help should appear on a signature
9039 */
9040 applicableSpan: TextSpan;
9041 /**
9042 * The item selected in the set of available help items.
9043 */
9044 selectedItemIndex: number;
9045 /**
9046 * The argument selected in the set of parameters.
9047 */
9048 argumentIndex: number;
9049 /**
9050 * The argument count
9051 */
9052 argumentCount: number;
9053 }
9054 type SignatureHelpTriggerCharacter = "," | "(" | "<";
9055 type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")";
9056 /**
9057 * Arguments of a signature help request.
9058 */
9059 interface SignatureHelpRequestArgs extends FileLocationRequestArgs {
9060 /**
9061 * Reason why signature help was invoked.
9062 * See each individual possible
9063 */
9064 triggerReason?: SignatureHelpTriggerReason;
9065 }
9066 type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason;
9067 /**
9068 * Signals that the user manually requested signature help.
9069 * The language service will unconditionally attempt to provide a result.
9070 */
9071 interface SignatureHelpInvokedReason {
9072 kind: "invoked";
9073 triggerCharacter?: undefined;
9074 }
9075 /**
9076 * Signals that the signature help request came from a user typing a character.
9077 * Depending on the character and the syntactic context, the request may or may not be served a result.
9078 */
9079 interface SignatureHelpCharacterTypedReason {
9080 kind: "characterTyped";
9081 /**
9082 * Character that was responsible for triggering signature help.
9083 */
9084 triggerCharacter: SignatureHelpTriggerCharacter;
9085 }
9086 /**
9087 * Signals that this signature help request came from typing a character or moving the cursor.
9088 * This should only occur if a signature help session was already active and the editor needs to see if it should adjust.
9089 * The language service will unconditionally attempt to provide a result.
9090 * `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move.
9091 */
9092 interface SignatureHelpRetriggeredReason {
9093 kind: "retrigger";
9094 /**
9095 * Character that was responsible for triggering signature help.
9096 */
9097 triggerCharacter?: SignatureHelpRetriggerCharacter;
9098 }
9099 /**
9100 * Signature help request; value of command field is "signatureHelp".
9101 * Given a file location (file, line, col), return the signature
9102 * help.
9103 */
9104 interface SignatureHelpRequest extends FileLocationRequest {
9105 command: CommandTypes.SignatureHelp;
9106 arguments: SignatureHelpRequestArgs;
9107 }
9108 /**
9109 * Response object for a SignatureHelpRequest.
9110 */
9111 interface SignatureHelpResponse extends Response {
9112 body?: SignatureHelpItems;
9113 }
9114 type InlayHintKind = "Type" | "Parameter" | "Enum";
9115 interface InlayHintsRequestArgs extends FileRequestArgs {
9116 /**
9117 * Start position of the span.
9118 */
9119 start: number;
9120 /**
9121 * Length of the span.
9122 */
9123 length: number;
9124 }
9125 interface InlayHintsRequest extends Request {
9126 command: CommandTypes.ProvideInlayHints;
9127 arguments: InlayHintsRequestArgs;
9128 }
9129 interface InlayHintItem {
9130 text: string;
9131 position: Location;
9132 kind: InlayHintKind;
9133 whitespaceBefore?: boolean;
9134 whitespaceAfter?: boolean;
9135 }
9136 interface InlayHintsResponse extends Response {
9137 body?: InlayHintItem[];
9138 }
9139 /**
9140 * Synchronous request for semantic diagnostics of one file.
9141 */
9142 interface SemanticDiagnosticsSyncRequest extends FileRequest {
9143 command: CommandTypes.SemanticDiagnosticsSync;
9144 arguments: SemanticDiagnosticsSyncRequestArgs;
9145 }
9146 interface SemanticDiagnosticsSyncRequestArgs extends FileRequestArgs {
9147 includeLinePosition?: boolean;
9148 }
9149 /**
9150 * Response object for synchronous sematic diagnostics request.
9151 */
9152 interface SemanticDiagnosticsSyncResponse extends Response {
9153 body?: Diagnostic[] | DiagnosticWithLinePosition[];
9154 }
9155 interface SuggestionDiagnosticsSyncRequest extends FileRequest {
9156 command: CommandTypes.SuggestionDiagnosticsSync;
9157 arguments: SuggestionDiagnosticsSyncRequestArgs;
9158 }
9159 type SuggestionDiagnosticsSyncRequestArgs = SemanticDiagnosticsSyncRequestArgs;
9160 type SuggestionDiagnosticsSyncResponse = SemanticDiagnosticsSyncResponse;
9161 /**
9162 * Synchronous request for syntactic diagnostics of one file.
9163 */
9164 interface SyntacticDiagnosticsSyncRequest extends FileRequest {
9165 command: CommandTypes.SyntacticDiagnosticsSync;
9166 arguments: SyntacticDiagnosticsSyncRequestArgs;
9167 }
9168 interface SyntacticDiagnosticsSyncRequestArgs extends FileRequestArgs {
9169 includeLinePosition?: boolean;
9170 }
9171 /**
9172 * Response object for synchronous syntactic diagnostics request.
9173 */
9174 interface SyntacticDiagnosticsSyncResponse extends Response {
9175 body?: Diagnostic[] | DiagnosticWithLinePosition[];
9176 }
9177 /**
9178 * Arguments for GeterrForProject request.
9179 */
9180 interface GeterrForProjectRequestArgs {
9181 /**
9182 * the file requesting project error list
9183 */
9184 file: string;
9185 /**
9186 * Delay in milliseconds to wait before starting to compute
9187 * errors for the files in the file list
9188 */
9189 delay: number;
9190 }
9191 /**
9192 * GeterrForProjectRequest request; value of command field is
9193 * "geterrForProject". It works similarly with 'Geterr', only
9194 * it request for every file in this project.
9195 */
9196 interface GeterrForProjectRequest extends Request {
9197 command: CommandTypes.GeterrForProject;
9198 arguments: GeterrForProjectRequestArgs;
9199 }
9200 /**
9201 * Arguments for geterr messages.
9202 */
9203 interface GeterrRequestArgs {
9204 /**
9205 * List of file names for which to compute compiler errors.
9206 * The files will be checked in list order.
9207 */
9208 files: string[];
9209 /**
9210 * Delay in milliseconds to wait before starting to compute
9211 * errors for the files in the file list
9212 */
9213 delay: number;
9214 }
9215 /**
9216 * Geterr request; value of command field is "geterr". Wait for
9217 * delay milliseconds and then, if during the wait no change or
9218 * reload messages have arrived for the first file in the files
9219 * list, get the syntactic errors for the file, field requests,
9220 * and then get the semantic errors for the file. Repeat with a
9221 * smaller delay for each subsequent file on the files list. Best
9222 * practice for an editor is to send a file list containing each
9223 * file that is currently visible, in most-recently-used order.
9224 */
9225 interface GeterrRequest extends Request {
9226 command: CommandTypes.Geterr;
9227 arguments: GeterrRequestArgs;
9228 }
9229 type RequestCompletedEventName = "requestCompleted";
9230 /**
9231 * Event that is sent when server have finished processing request with specified id.
9232 */
9233 interface RequestCompletedEvent extends Event {
9234 event: RequestCompletedEventName;
9235 body: RequestCompletedEventBody;
9236 }
9237 interface RequestCompletedEventBody {
9238 request_seq: number;
9239 }
9240 /**
9241 * Item of diagnostic information found in a DiagnosticEvent message.
9242 */
9243 interface Diagnostic {
9244 /**
9245 * Starting file location at which text applies.
9246 */
9247 start: Location;
9248 /**
9249 * The last file location at which the text applies.
9250 */
9251 end: Location;
9252 /**
9253 * Text of diagnostic message.
9254 */
9255 text: string;
9256 /**
9257 * The category of the diagnostic message, e.g. "error", "warning", or "suggestion".
9258 */
9259 category: string;
9260 reportsUnnecessary?: {};
9261 reportsDeprecated?: {};
9262 /**
9263 * Any related spans the diagnostic may have, such as other locations relevant to an error, such as declarartion sites
9264 */
9265 relatedInformation?: DiagnosticRelatedInformation[];
9266 /**
9267 * The error code of the diagnostic message.
9268 */
9269 code?: number;
9270 /**
9271 * The name of the plugin reporting the message.
9272 */
9273 source?: string;
9274 }
9275 interface DiagnosticWithFileName extends Diagnostic {
9276 /**
9277 * Name of the file the diagnostic is in
9278 */
9279 fileName: string;
9280 }
9281 /**
9282 * Represents additional spans returned with a diagnostic which are relevant to it
9283 */
9284 interface DiagnosticRelatedInformation {
9285 /**
9286 * The category of the related information message, e.g. "error", "warning", or "suggestion".
9287 */
9288 category: string;
9289 /**
9290 * The code used ot identify the related information
9291 */
9292 code: number;
9293 /**
9294 * Text of related or additional information.
9295 */
9296 message: string;
9297 /**
9298 * Associated location
9299 */
9300 span?: FileSpan;
9301 }
9302 interface DiagnosticEventBody {
9303 /**
9304 * The file for which diagnostic information is reported.
9305 */
9306 file: string;
9307 /**
9308 * An array of diagnostic information items.
9309 */
9310 diagnostics: Diagnostic[];
9311 }
9312 type DiagnosticEventKind = "semanticDiag" | "syntaxDiag" | "suggestionDiag";
9313 /**
9314 * Event message for DiagnosticEventKind event types.
9315 * These events provide syntactic and semantic errors for a file.
9316 */
9317 interface DiagnosticEvent extends Event {
9318 body?: DiagnosticEventBody;
9319 event: DiagnosticEventKind;
9320 }
9321 interface ConfigFileDiagnosticEventBody {
9322 /**
9323 * The file which trigged the searching and error-checking of the config file
9324 */
9325 triggerFile: string;
9326 /**
9327 * The name of the found config file.
9328 */
9329 configFile: string;
9330 /**
9331 * An arry of diagnostic information items for the found config file.
9332 */
9333 diagnostics: DiagnosticWithFileName[];
9334 }
9335 /**
9336 * Event message for "configFileDiag" event type.
9337 * This event provides errors for a found config file.
9338 */
9339 interface ConfigFileDiagnosticEvent extends Event {
9340 body?: ConfigFileDiagnosticEventBody;
9341 event: "configFileDiag";
9342 }
9343 type ProjectLanguageServiceStateEventName = "projectLanguageServiceState";
9344 interface ProjectLanguageServiceStateEvent extends Event {
9345 event: ProjectLanguageServiceStateEventName;
9346 body?: ProjectLanguageServiceStateEventBody;
9347 }
9348 interface ProjectLanguageServiceStateEventBody {
9349 /**
9350 * Project name that has changes in the state of language service.
9351 * For configured projects this will be the config file path.
9352 * For external projects this will be the name of the projects specified when project was open.
9353 * For inferred projects this event is not raised.
9354 */
9355 projectName: string;
9356 /**
9357 * True if language service state switched from disabled to enabled
9358 * and false otherwise.
9359 */
9360 languageServiceEnabled: boolean;
9361 }
9362 type ProjectsUpdatedInBackgroundEventName = "projectsUpdatedInBackground";
9363 interface ProjectsUpdatedInBackgroundEvent extends Event {
9364 event: ProjectsUpdatedInBackgroundEventName;
9365 body: ProjectsUpdatedInBackgroundEventBody;
9366 }
9367 interface ProjectsUpdatedInBackgroundEventBody {
9368 /**
9369 * Current set of open files
9370 */
9371 openFiles: string[];
9372 }
9373 type ProjectLoadingStartEventName = "projectLoadingStart";
9374 interface ProjectLoadingStartEvent extends Event {
9375 event: ProjectLoadingStartEventName;
9376 body: ProjectLoadingStartEventBody;
9377 }
9378 interface ProjectLoadingStartEventBody {
9379 /** name of the project */
9380 projectName: string;
9381 /** reason for loading */
9382 reason: string;
9383 }
9384 type ProjectLoadingFinishEventName = "projectLoadingFinish";
9385 interface ProjectLoadingFinishEvent extends Event {
9386 event: ProjectLoadingFinishEventName;
9387 body: ProjectLoadingFinishEventBody;
9388 }
9389 interface ProjectLoadingFinishEventBody {
9390 /** name of the project */
9391 projectName: string;
9392 }
9393 type SurveyReadyEventName = "surveyReady";
9394 interface SurveyReadyEvent extends Event {
9395 event: SurveyReadyEventName;
9396 body: SurveyReadyEventBody;
9397 }
9398 interface SurveyReadyEventBody {
9399 /** Name of the survey. This is an internal machine- and programmer-friendly name */
9400 surveyId: string;
9401 }
9402 type LargeFileReferencedEventName = "largeFileReferenced";
9403 interface LargeFileReferencedEvent extends Event {
9404 event: LargeFileReferencedEventName;
9405 body: LargeFileReferencedEventBody;
9406 }
9407 interface LargeFileReferencedEventBody {
9408 /**
9409 * name of the large file being loaded
9410 */
9411 file: string;
9412 /**
9413 * size of the file
9414 */
9415 fileSize: number;
9416 /**
9417 * max file size allowed on the server
9418 */
9419 maxFileSize: number;
9420 }
9421 /**
9422 * Arguments for reload request.
9423 */
9424 interface ReloadRequestArgs extends FileRequestArgs {
9425 /**
9426 * Name of temporary file from which to reload file
9427 * contents. May be same as file.
9428 */
9429 tmpfile: string;
9430 }
9431 /**
9432 * Reload request message; value of command field is "reload".
9433 * Reload contents of file with name given by the 'file' argument
9434 * from temporary file with name given by the 'tmpfile' argument.
9435 * The two names can be identical.
9436 */
9437 interface ReloadRequest extends FileRequest {
9438 command: CommandTypes.Reload;
9439 arguments: ReloadRequestArgs;
9440 }
9441 /**
9442 * Response to "reload" request. This is just an acknowledgement, so
9443 * no body field is required.
9444 */
9445 interface ReloadResponse extends Response {
9446 }
9447 /**
9448 * Arguments for saveto request.
9449 */
9450 interface SavetoRequestArgs extends FileRequestArgs {
9451 /**
9452 * Name of temporary file into which to save server's view of
9453 * file contents.
9454 */
9455 tmpfile: string;
9456 }
9457 /**
9458 * Saveto request message; value of command field is "saveto".
9459 * For debugging purposes, save to a temporaryfile (named by
9460 * argument 'tmpfile') the contents of file named by argument
9461 * 'file'. The server does not currently send a response to a
9462 * "saveto" request.
9463 */
9464 interface SavetoRequest extends FileRequest {
9465 command: CommandTypes.Saveto;
9466 arguments: SavetoRequestArgs;
9467 }
9468 /**
9469 * Arguments for navto request message.
9470 */
9471 interface NavtoRequestArgs {
9472 /**
9473 * Search term to navigate to from current location; term can
9474 * be '.*' or an identifier prefix.
9475 */
9476 searchValue: string;
9477 /**
9478 * Optional limit on the number of items to return.
9479 */
9480 maxResultCount?: number;
9481 /**
9482 * The file for the request (absolute pathname required).
9483 */
9484 file?: string;
9485 /**
9486 * Optional flag to indicate we want results for just the current file
9487 * or the entire project.
9488 */
9489 currentFileOnly?: boolean;
9490 projectFileName?: string;
9491 }
9492 /**
9493 * Navto request message; value of command field is "navto".
9494 * Return list of objects giving file locations and symbols that
9495 * match the search term given in argument 'searchTerm'. The
9496 * context for the search is given by the named file.
9497 */
9498 interface NavtoRequest extends Request {
9499 command: CommandTypes.Navto;
9500 arguments: NavtoRequestArgs;
9501 }
9502 /**
9503 * An item found in a navto response.
9504 */
9505 interface NavtoItem extends FileSpan {
9506 /**
9507 * The symbol's name.
9508 */
9509 name: string;
9510 /**
9511 * The symbol's kind (such as 'className' or 'parameterName').
9512 */
9513 kind: ScriptElementKind;
9514 /**
9515 * exact, substring, or prefix.
9516 */
9517 matchKind: string;
9518 /**
9519 * If this was a case sensitive or insensitive match.
9520 */
9521 isCaseSensitive: boolean;
9522 /**
9523 * Optional modifiers for the kind (such as 'public').
9524 */
9525 kindModifiers?: string;
9526 /**
9527 * Name of symbol's container symbol (if any); for example,
9528 * the class name if symbol is a class member.
9529 */
9530 containerName?: string;
9531 /**
9532 * Kind of symbol's container symbol (if any).
9533 */
9534 containerKind?: ScriptElementKind;
9535 }
9536 /**
9537 * Navto response message. Body is an array of navto items. Each
9538 * item gives a symbol that matched the search term.
9539 */
9540 interface NavtoResponse extends Response {
9541 body?: NavtoItem[];
9542 }
9543 /**
9544 * Arguments for change request message.
9545 */
9546 interface ChangeRequestArgs extends FormatRequestArgs {
9547 /**
9548 * Optional string to insert at location (file, line, offset).
9549 */
9550 insertString?: string;
9551 }
9552 /**
9553 * Change request message; value of command field is "change".
9554 * Update the server's view of the file named by argument 'file'.
9555 * Server does not currently send a response to a change request.
9556 */
9557 interface ChangeRequest extends FileLocationRequest {
9558 command: CommandTypes.Change;
9559 arguments: ChangeRequestArgs;
9560 }
9561 /**
9562 * Response to "brace" request.
9563 */
9564 interface BraceResponse extends Response {
9565 body?: TextSpan[];
9566 }
9567 /**
9568 * Brace matching request; value of command field is "brace".
9569 * Return response giving the file locations of matching braces
9570 * found in file at location line, offset.
9571 */
9572 interface BraceRequest extends FileLocationRequest {
9573 command: CommandTypes.Brace;
9574 }
9575 /**
9576 * NavBar items request; value of command field is "navbar".
9577 * Return response giving the list of navigation bar entries
9578 * extracted from the requested file.
9579 */
9580 interface NavBarRequest extends FileRequest {
9581 command: CommandTypes.NavBar;
9582 }
9583 /**
9584 * NavTree request; value of command field is "navtree".
9585 * Return response giving the navigation tree of the requested file.
9586 */
9587 interface NavTreeRequest extends FileRequest {
9588 command: CommandTypes.NavTree;
9589 }
9590 interface NavigationBarItem {
9591 /**
9592 * The item's display text.
9593 */
9594 text: string;
9595 /**
9596 * The symbol's kind (such as 'className' or 'parameterName').
9597 */
9598 kind: ScriptElementKind;
9599 /**
9600 * Optional modifiers for the kind (such as 'public').
9601 */
9602 kindModifiers?: string;
9603 /**
9604 * The definition locations of the item.
9605 */
9606 spans: TextSpan[];
9607 /**
9608 * Optional children.
9609 */
9610 childItems?: NavigationBarItem[];
9611 /**
9612 * Number of levels deep this item should appear.
9613 */
9614 indent: number;
9615 }
9616 /** protocol.NavigationTree is identical to ts.NavigationTree, except using protocol.TextSpan instead of ts.TextSpan */
9617 interface NavigationTree {
9618 text: string;
9619 kind: ScriptElementKind;
9620 kindModifiers: string;
9621 spans: TextSpan[];
9622 nameSpan: TextSpan | undefined;
9623 childItems?: NavigationTree[];
9624 }
9625 type TelemetryEventName = "telemetry";
9626 interface TelemetryEvent extends Event {
9627 event: TelemetryEventName;
9628 body: TelemetryEventBody;
9629 }
9630 interface TelemetryEventBody {
9631 telemetryEventName: string;
9632 payload: any;
9633 }
9634 type TypesInstallerInitializationFailedEventName = "typesInstallerInitializationFailed";
9635 interface TypesInstallerInitializationFailedEvent extends Event {
9636 event: TypesInstallerInitializationFailedEventName;
9637 body: TypesInstallerInitializationFailedEventBody;
9638 }
9639 interface TypesInstallerInitializationFailedEventBody {
9640 message: string;
9641 }
9642 type TypingsInstalledTelemetryEventName = "typingsInstalled";
9643 interface TypingsInstalledTelemetryEventBody extends TelemetryEventBody {
9644 telemetryEventName: TypingsInstalledTelemetryEventName;
9645 payload: TypingsInstalledTelemetryEventPayload;
9646 }
9647 interface TypingsInstalledTelemetryEventPayload {
9648 /**
9649 * Comma separated list of installed typing packages
9650 */
9651 installedPackages: string;
9652 /**
9653 * true if install request succeeded, otherwise - false
9654 */
9655 installSuccess: boolean;
9656 /**
9657 * version of typings installer
9658 */
9659 typingsInstallerVersion: string;
9660 }
9661 type BeginInstallTypesEventName = "beginInstallTypes";
9662 type EndInstallTypesEventName = "endInstallTypes";
9663 interface BeginInstallTypesEvent extends Event {
9664 event: BeginInstallTypesEventName;
9665 body: BeginInstallTypesEventBody;
9666 }
9667 interface EndInstallTypesEvent extends Event {
9668 event: EndInstallTypesEventName;
9669 body: EndInstallTypesEventBody;
9670 }
9671 interface InstallTypesEventBody {
9672 /**
9673 * correlation id to match begin and end events
9674 */
9675 eventId: number;
9676 /**
9677 * list of packages to install
9678 */
9679 packages: readonly string[];
9680 }
9681 interface BeginInstallTypesEventBody extends InstallTypesEventBody {
9682 }
9683 interface EndInstallTypesEventBody extends InstallTypesEventBody {
9684 /**
9685 * true if installation succeeded, otherwise false
9686 */
9687 success: boolean;
9688 }
9689 interface NavBarResponse extends Response {
9690 body?: NavigationBarItem[];
9691 }
9692 interface NavTreeResponse extends Response {
9693 body?: NavigationTree;
9694 }
9695 interface CallHierarchyItem {
9696 name: string;
9697 kind: ScriptElementKind;
9698 kindModifiers?: string;
9699 file: string;
9700 span: TextSpan;
9701 selectionSpan: TextSpan;
9702 containerName?: string;
9703 }
9704 interface CallHierarchyIncomingCall {
9705 from: CallHierarchyItem;
9706 fromSpans: TextSpan[];
9707 }
9708 interface CallHierarchyOutgoingCall {
9709 to: CallHierarchyItem;
9710 fromSpans: TextSpan[];
9711 }
9712 interface PrepareCallHierarchyRequest extends FileLocationRequest {
9713 command: CommandTypes.PrepareCallHierarchy;
9714 }
9715 interface PrepareCallHierarchyResponse extends Response {
9716 readonly body: CallHierarchyItem | CallHierarchyItem[];
9717 }
9718 interface ProvideCallHierarchyIncomingCallsRequest extends FileLocationRequest {
9719 command: CommandTypes.ProvideCallHierarchyIncomingCalls;
9720 }
9721 interface ProvideCallHierarchyIncomingCallsResponse extends Response {
9722 readonly body: CallHierarchyIncomingCall[];
9723 }
9724 interface ProvideCallHierarchyOutgoingCallsRequest extends FileLocationRequest {
9725 command: CommandTypes.ProvideCallHierarchyOutgoingCalls;
9726 }
9727 interface ProvideCallHierarchyOutgoingCallsResponse extends Response {
9728 readonly body: CallHierarchyOutgoingCall[];
9729 }
9730 enum IndentStyle {
9731 None = "None",
9732 Block = "Block",
9733 Smart = "Smart"
9734 }
9735 enum SemicolonPreference {
9736 Ignore = "ignore",
9737 Insert = "insert",
9738 Remove = "remove"
9739 }
9740 interface EditorSettings {
9741 baseIndentSize?: number;
9742 indentSize?: number;
9743 tabSize?: number;
9744 newLineCharacter?: string;
9745 convertTabsToSpaces?: boolean;
9746 indentStyle?: IndentStyle | ts.IndentStyle;
9747 trimTrailingWhitespace?: boolean;
9748 }
9749 interface FormatCodeSettings extends EditorSettings {
9750 insertSpaceAfterCommaDelimiter?: boolean;
9751 insertSpaceAfterSemicolonInForStatements?: boolean;
9752 insertSpaceBeforeAndAfterBinaryOperators?: boolean;
9753 insertSpaceAfterConstructor?: boolean;
9754 insertSpaceAfterKeywordsInControlFlowStatements?: boolean;
9755 insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean;
9756 insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean;
9757 insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean;
9758 insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean;
9759 insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
9760 insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean;
9761 insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
9762 insertSpaceAfterTypeAssertion?: boolean;
9763 insertSpaceBeforeFunctionParenthesis?: boolean;
9764 placeOpenBraceOnNewLineForFunctions?: boolean;
9765 placeOpenBraceOnNewLineForControlBlocks?: boolean;
9766 insertSpaceBeforeTypeAnnotation?: boolean;
9767 semicolons?: SemicolonPreference;
9768 }
9769 interface UserPreferences {
9770 readonly disableSuggestions?: boolean;
9771 readonly quotePreference?: "auto" | "double" | "single";
9772 /**
9773 * If enabled, TypeScript will search through all external modules' exports and add them to the completions list.
9774 * This affects lone identifier completions but not completions on the right hand side of `obj.`.
9775 */
9776 readonly includeCompletionsForModuleExports?: boolean;
9777 /**
9778 * Enables auto-import-style completions on partially-typed import statements. E.g., allows
9779 * `import write|` to be completed to `import { writeFile } from "fs"`.
9780 */
9781 readonly includeCompletionsForImportStatements?: boolean;
9782 /**
9783 * Allows completions to be formatted with snippet text, indicated by `CompletionItem["isSnippet"]`.
9784 */
9785 readonly includeCompletionsWithSnippetText?: boolean;
9786 /**
9787 * If enabled, the completion list will include completions with invalid identifier names.
9788 * For those entries, The `insertText` and `replacementSpan` properties will be set to change from `.x` property access to `["x"]`.
9789 */
9790 readonly includeCompletionsWithInsertText?: boolean;
9791 /**
9792 * Unless this option is `false`, or `includeCompletionsWithInsertText` is not enabled,
9793 * member completion lists triggered with `.` will include entries on potentially-null and potentially-undefined
9794 * values, with insertion text to replace preceding `.` tokens with `?.`.
9795 */
9796 readonly includeAutomaticOptionalChainCompletions?: boolean;
9797 /**
9798 * If enabled, completions for class members (e.g. methods and properties) will include
9799 * a whole declaration for the member.
9800 * E.g., `class A { f| }` could be completed to `class A { foo(): number {} }`, instead of
9801 * `class A { foo }`.
9802 */
9803 readonly includeCompletionsWithClassMemberSnippets?: boolean;
9804 /**
9805 * If enabled, object literal methods will have a method declaration completion entry in addition
9806 * to the regular completion entry containing just the method name.
9807 * E.g., `const objectLiteral: T = { f| }` could be completed to `const objectLiteral: T = { foo(): void {} }`,
9808 * in addition to `const objectLiteral: T = { foo }`.
9809 */
9810 readonly includeCompletionsWithObjectLiteralMethodSnippets?: boolean;
9811 /**
9812 * Indicates whether {@link CompletionEntry.labelDetails completion entry label details} are supported.
9813 * If not, contents of `labelDetails` may be included in the {@link CompletionEntry.name} property.
9814 */
9815 readonly useLabelDetailsInCompletionEntries?: boolean;
9816 readonly allowIncompleteCompletions?: boolean;
9817 readonly importModuleSpecifierPreference?: "shortest" | "project-relative" | "relative" | "non-relative";
9818 /** Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js" */
9819 readonly importModuleSpecifierEnding?: "auto" | "minimal" | "index" | "js";
9820 readonly allowTextChangesInNewFiles?: boolean;
9821 readonly lazyConfiguredProjectsFromExternalProject?: boolean;
9822 readonly providePrefixAndSuffixTextForRename?: boolean;
9823 readonly provideRefactorNotApplicableReason?: boolean;
9824 readonly allowRenameOfImportPath?: boolean;
9825 readonly includePackageJsonAutoImports?: "auto" | "on" | "off";
9826 readonly jsxAttributeCompletionStyle?: "auto" | "braces" | "none";
9827 readonly displayPartsForJSDoc?: boolean;
9828 readonly generateReturnInDocTemplate?: boolean;
9829 readonly includeInlayParameterNameHints?: "none" | "literals" | "all";
9830 readonly includeInlayParameterNameHintsWhenArgumentMatchesName?: boolean;
9831 readonly includeInlayFunctionParameterTypeHints?: boolean;
9832 readonly includeInlayVariableTypeHints?: boolean;
9833 readonly includeInlayVariableTypeHintsWhenTypeMatchesName?: boolean;
9834 readonly includeInlayPropertyDeclarationTypeHints?: boolean;
9835 readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
9836 readonly includeInlayEnumMemberValueHints?: boolean;
9837 readonly autoImportFileExcludePatterns?: string[];
9838 /**
9839 * Indicates whether {@link ReferencesResponseItem.lineText} is supported.
9840 */
9841 readonly disableLineTextInReferences?: boolean;
9842 }
9843 interface CompilerOptions {
9844 allowJs?: boolean;
9845 allowSyntheticDefaultImports?: boolean;
9846 allowUnreachableCode?: boolean;
9847 allowUnusedLabels?: boolean;
9848 alwaysStrict?: boolean;
9849 baseUrl?: string;
9850 charset?: string;
9851 checkJs?: boolean;
9852 declaration?: boolean;
9853 declarationDir?: string;
9854 disableSizeLimit?: boolean;
9855 downlevelIteration?: boolean;
9856 emitBOM?: boolean;
9857 emitDecoratorMetadata?: boolean;
9858 experimentalDecorators?: boolean;
9859 forceConsistentCasingInFileNames?: boolean;
9860 importHelpers?: boolean;
9861 inlineSourceMap?: boolean;
9862 inlineSources?: boolean;
9863 isolatedModules?: boolean;
9864 jsx?: JsxEmit | ts.JsxEmit;
9865 lib?: string[];
9866 locale?: string;
9867 mapRoot?: string;
9868 maxNodeModuleJsDepth?: number;
9869 module?: ModuleKind | ts.ModuleKind;
9870 moduleResolution?: ModuleResolutionKind | ts.ModuleResolutionKind;
9871 newLine?: NewLineKind | ts.NewLineKind;
9872 noEmit?: boolean;
9873 noEmitHelpers?: boolean;
9874 noEmitOnError?: boolean;
9875 noErrorTruncation?: boolean;
9876 noFallthroughCasesInSwitch?: boolean;
9877 noImplicitAny?: boolean;
9878 noImplicitReturns?: boolean;
9879 noImplicitThis?: boolean;
9880 noUnusedLocals?: boolean;
9881 noUnusedParameters?: boolean;
9882 noImplicitUseStrict?: boolean;
9883 noLib?: boolean;
9884 noResolve?: boolean;
9885 out?: string;
9886 outDir?: string;
9887 outFile?: string;
9888 paths?: MapLike<string[]>;
9889 plugins?: PluginImport[];
9890 preserveConstEnums?: boolean;
9891 preserveSymlinks?: boolean;
9892 project?: string;
9893 reactNamespace?: string;
9894 removeComments?: boolean;
9895 references?: ProjectReference[];
9896 rootDir?: string;
9897 rootDirs?: string[];
9898 skipLibCheck?: boolean;
9899 skipDefaultLibCheck?: boolean;
9900 sourceMap?: boolean;
9901 sourceRoot?: string;
9902 strict?: boolean;
9903 strictNullChecks?: boolean;
9904 suppressExcessPropertyErrors?: boolean;
9905 suppressImplicitAnyIndexErrors?: boolean;
9906 useDefineForClassFields?: boolean;
9907 target?: ScriptTarget | ts.ScriptTarget;
9908 traceResolution?: boolean;
9909 resolveJsonModule?: boolean;
9910 types?: string[];
9911 /** Paths used to used to compute primary types search locations */
9912 typeRoots?: string[];
9913 [option: string]: CompilerOptionsValue | undefined;
9914 }
9915 enum JsxEmit {
9916 None = "None",
9917 Preserve = "Preserve",
9918 ReactNative = "ReactNative",
9919 React = "React"
9920 }
9921 enum ModuleKind {
9922 None = "None",
9923 CommonJS = "CommonJS",
9924 AMD = "AMD",
9925 UMD = "UMD",
9926 System = "System",
9927 ES6 = "ES6",
9928 ES2015 = "ES2015",
9929 ESNext = "ESNext"
9930 }
9931 enum ModuleResolutionKind {
9932 Classic = "Classic",
9933 Node = "Node"
9934 }
9935 enum NewLineKind {
9936 Crlf = "Crlf",
9937 Lf = "Lf"
9938 }
9939 enum ScriptTarget {
9940 ES3 = "ES3",
9941 ES5 = "ES5",
9942 ES6 = "ES6",
9943 ES2015 = "ES2015",
9944 ES2016 = "ES2016",
9945 ES2017 = "ES2017",
9946 ES2018 = "ES2018",
9947 ES2019 = "ES2019",
9948 ES2020 = "ES2020",
9949 ES2021 = "ES2021",
9950 ES2022 = "ES2022",
9951 ESNext = "ESNext"
9952 }
9953 enum ClassificationType {
9954 comment = 1,
9955 identifier = 2,
9956 keyword = 3,
9957 numericLiteral = 4,
9958 operator = 5,
9959 stringLiteral = 6,
9960 regularExpressionLiteral = 7,
9961 whiteSpace = 8,
9962 text = 9,
9963 punctuation = 10,
9964 className = 11,
9965 enumName = 12,
9966 interfaceName = 13,
9967 moduleName = 14,
9968 typeParameterName = 15,
9969 typeAliasName = 16,
9970 parameterName = 17,
9971 docCommentTagName = 18,
9972 jsxOpenTagName = 19,
9973 jsxCloseTagName = 20,
9974 jsxSelfClosingTagName = 21,
9975 jsxAttribute = 22,
9976 jsxText = 23,
9977 jsxAttributeStringLiteralValue = 24,
9978 bigintLiteral = 25
9979 }
9980}
9981declare namespace ts.server {
9982 interface ScriptInfoVersion {
9983 svc: number;
9984 text: number;
9985 }
9986 function isDynamicFileName(fileName: NormalizedPath): boolean;
9987 class ScriptInfo {
9988 private readonly host;
9989 readonly fileName: NormalizedPath;
9990 readonly scriptKind: ScriptKind;
9991 readonly hasMixedContent: boolean;
9992 readonly path: Path;
9993 /**
9994 * All projects that include this file
9995 */
9996 readonly containingProjects: Project[];
9997 private formatSettings;
9998 private preferences;
9999 private textStorage;
10000 constructor(host: ServerHost, fileName: NormalizedPath, scriptKind: ScriptKind, hasMixedContent: boolean, path: Path, initialVersion?: ScriptInfoVersion);
10001 isScriptOpen(): boolean;
10002 open(newText: string): void;
10003 close(fileExists?: boolean): void;
10004 getSnapshot(): IScriptSnapshot;
10005 private ensureRealPath;
10006 getFormatCodeSettings(): FormatCodeSettings | undefined;
10007 getPreferences(): protocol.UserPreferences | undefined;
10008 attachToProject(project: Project): boolean;
10009 isAttached(project: Project): boolean;
10010 detachFromProject(project: Project): void;
10011 detachAllProjects(): void;
10012 getDefaultProject(): Project;
10013 registerFileUpdate(): void;
10014 setOptions(formatSettings: FormatCodeSettings, preferences: protocol.UserPreferences | undefined): void;
10015 getLatestVersion(): string;
10016 saveTo(fileName: string): void;
10017 reloadFromFile(tempFileName?: NormalizedPath): boolean;
10018 editContent(start: number, end: number, newText: string): void;
10019 markContainingProjectsAsDirty(): void;
10020 isOrphan(): boolean;
10021 /**
10022 * @param line 1 based index
10023 */
10024 lineToTextSpan(line: number): TextSpan;
10025 /**
10026 * @param line 1 based index
10027 * @param offset 1 based index
10028 */
10029 lineOffsetToPosition(line: number, offset: number): number;
10030 positionToLineOffset(position: number): protocol.Location;
10031 isJavaScript(): boolean;
10032 }
10033}
10034declare namespace ts.server {
10035 interface InstallPackageOptionsWithProject extends InstallPackageOptions {
10036 projectName: string;
10037 projectRootPath: Path;
10038 }
10039 interface ITypingsInstaller {
10040 isKnownTypesPackageName(name: string): boolean;
10041 installPackage(options: InstallPackageOptionsWithProject): Promise<ApplyCodeActionCommandResult>;
10042 enqueueInstallTypingsRequest(p: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string> | undefined): void;
10043 attach(projectService: ProjectService): void;
10044 onProjectClosed(p: Project): void;
10045 readonly globalTypingsCacheLocation: string | undefined;
10046 }
10047 const nullTypingsInstaller: ITypingsInstaller;
10048}
10049declare namespace ts.server {
10050 enum ProjectKind {
10051 Inferred = 0,
10052 Configured = 1,
10053 External = 2,
10054 AutoImportProvider = 3,
10055 Auxiliary = 4
10056 }
10057 function allRootFilesAreJsOrDts(project: Project): boolean;
10058 function allFilesAreJsOrDts(project: Project): boolean;
10059 interface PluginCreateInfo {
10060 project: Project;
10061 languageService: LanguageService;
10062 languageServiceHost: LanguageServiceHost;
10063 serverHost: ServerHost;
10064 session?: Session<unknown>;
10065 config: any;
10066 }
10067 interface PluginModule {
10068 create(createInfo: PluginCreateInfo): LanguageService;
10069 getExternalFiles?(proj: Project): string[];
10070 onConfigurationChanged?(config: any): void;
10071 }
10072 interface PluginModuleWithName {
10073 name: string;
10074 module: PluginModule;
10075 }
10076 type PluginModuleFactory = (mod: {
10077 typescript: typeof ts;
10078 }) => PluginModule;
10079 abstract class Project implements LanguageServiceHost, ModuleResolutionHost {
10080 readonly projectName: string;
10081 readonly projectKind: ProjectKind;
10082 readonly projectService: ProjectService;
10083 private documentRegistry;
10084 private compilerOptions;
10085 compileOnSaveEnabled: boolean;
10086 protected watchOptions: WatchOptions | undefined;
10087 private rootFiles;
10088 private rootFilesMap;
10089 private program;
10090 private externalFiles;
10091 private missingFilesMap;
10092 private generatedFilesMap;
10093 protected languageService: LanguageService;
10094 languageServiceEnabled: boolean;
10095 readonly trace?: (s: string) => void;
10096 readonly realpath?: (path: string) => string;
10097 private builderState;
10098 /**
10099 * Set of files names that were updated since the last call to getChangesSinceVersion.
10100 */
10101 private updatedFileNames;
10102 /**
10103 * Set of files that was returned from the last call to getChangesSinceVersion.
10104 */
10105 private lastReportedFileNames;
10106 /**
10107 * Last version that was reported.
10108 */
10109 private lastReportedVersion;
10110 /**
10111 * Current project's program version. (incremented everytime new program is created that is not complete reuse from the old one)
10112 * This property is changed in 'updateGraph' based on the set of files in program
10113 */
10114 private projectProgramVersion;
10115 /**
10116 * Current version of the project state. It is changed when:
10117 * - new root file was added/removed
10118 * - edit happen in some file that is currently included in the project.
10119 * This property is different from projectStructureVersion since in most cases edits don't affect set of files in the project
10120 */
10121 private projectStateVersion;
10122 protected projectErrors: Diagnostic[] | undefined;
10123 protected isInitialLoadPending: () => boolean;
10124 private readonly cancellationToken;
10125 isNonTsProject(): boolean;
10126 isJsOnlyProject(): boolean;
10127 static resolveModule(moduleName: string, initialDir: string, host: ServerHost, log: (message: string) => void, logErrors?: (message: string) => void): {} | undefined;
10128 isKnownTypesPackageName(name: string): boolean;
10129 installPackage(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
10130 private get typingsCache();
10131 getCompilationSettings(): CompilerOptions;
10132 getCompilerOptions(): CompilerOptions;
10133 getNewLine(): string;
10134 getProjectVersion(): string;
10135 getProjectReferences(): readonly ProjectReference[] | undefined;
10136 getScriptFileNames(): string[];
10137 private getOrCreateScriptInfoAndAttachToProject;
10138 getScriptKind(fileName: string): ScriptKind;
10139 getScriptVersion(filename: string): string;
10140 getScriptSnapshot(filename: string): IScriptSnapshot | undefined;
10141 getCancellationToken(): HostCancellationToken;
10142 getCurrentDirectory(): string;
10143 getDefaultLibFileName(): string;
10144 useCaseSensitiveFileNames(): boolean;
10145 readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
10146 readFile(fileName: string): string | undefined;
10147 writeFile(fileName: string, content: string): void;
10148 fileExists(file: string): boolean;
10149 resolveModuleNames(moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference, _options?: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModuleFull | undefined)[];
10150 getModuleResolutionCache(): ModuleResolutionCache | undefined;
10151 getResolvedModuleWithFailedLookupLocationsFromCache(moduleName: string, containingFile: string, resolutionMode?: ModuleKind.CommonJS | ModuleKind.ESNext): ResolvedModuleWithFailedLookupLocations | undefined;
10152 resolveTypeReferenceDirectives(typeDirectiveNames: string[] | FileReference[], containingFile: string, redirectedReference?: ResolvedProjectReference, _options?: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
10153 directoryExists(path: string): boolean;
10154 getDirectories(path: string): string[];
10155 log(s: string): void;
10156 error(s: string): void;
10157 private setInternalCompilerOptionsForEmittingJsFiles;
10158 /**
10159 * Get the errors that dont have any file name associated
10160 */
10161 getGlobalProjectErrors(): readonly Diagnostic[];
10162 /**
10163 * Get all the project errors
10164 */
10165 getAllProjectErrors(): readonly Diagnostic[];
10166 setProjectErrors(projectErrors: Diagnostic[] | undefined): void;
10167 getLanguageService(ensureSynchronized?: boolean): LanguageService;
10168 getCompileOnSaveAffectedFileList(scriptInfo: ScriptInfo): string[];
10169 /**
10170 * Returns true if emit was conducted
10171 */
10172 emitFile(scriptInfo: ScriptInfo, writeFile: (path: string, data: string, writeByteOrderMark?: boolean) => void): EmitResult;
10173 enableLanguageService(): void;
10174 disableLanguageService(lastFileExceededProgramSize?: string): void;
10175 getProjectName(): string;
10176 protected removeLocalTypingsFromTypeAcquisition(newTypeAcquisition: TypeAcquisition): TypeAcquisition;
10177 getExternalFiles(): SortedReadonlyArray<string>;
10178 getSourceFile(path: Path): SourceFile | undefined;
10179 close(): void;
10180 private detachScriptInfoIfNotRoot;
10181 isClosed(): boolean;
10182 hasRoots(): boolean;
10183 getRootFiles(): NormalizedPath[];
10184 getRootScriptInfos(): ScriptInfo[];
10185 getScriptInfos(): ScriptInfo[];
10186 getExcludedFiles(): readonly NormalizedPath[];
10187 getFileNames(excludeFilesFromExternalLibraries?: boolean, excludeConfigFiles?: boolean): NormalizedPath[];
10188 hasConfigFile(configFilePath: NormalizedPath): boolean;
10189 containsScriptInfo(info: ScriptInfo): boolean;
10190 containsFile(filename: NormalizedPath, requireOpen?: boolean): boolean;
10191 isRoot(info: ScriptInfo): boolean;
10192 addRoot(info: ScriptInfo, fileName?: NormalizedPath): void;
10193 addMissingFileRoot(fileName: NormalizedPath): void;
10194 removeFile(info: ScriptInfo, fileExists: boolean, detachFromProject: boolean): void;
10195 registerFileUpdate(fileName: string): void;
10196 markAsDirty(): void;
10197 /**
10198 * Updates set of files that contribute to this project
10199 * @returns: true if set of files in the project stays the same and false - otherwise.
10200 */
10201 updateGraph(): boolean;
10202 protected removeExistingTypings(include: string[]): string[];
10203 private updateGraphWorker;
10204 private detachScriptInfoFromProject;
10205 private addMissingFileWatcher;
10206 private isWatchedMissingFile;
10207 private createGeneratedFileWatcher;
10208 private isValidGeneratedFileWatcher;
10209 private clearGeneratedFileWatch;
10210 getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo | undefined;
10211 getScriptInfo(uncheckedFileName: string): ScriptInfo | undefined;
10212 filesToString(writeProjectFileNames: boolean): string;
10213 setCompilerOptions(compilerOptions: CompilerOptions): void;
10214 setTypeAcquisition(newTypeAcquisition: TypeAcquisition | undefined): void;
10215 getTypeAcquisition(): TypeAcquisition;
10216 protected removeRoot(info: ScriptInfo): void;
10217 protected enableGlobalPlugins(options: CompilerOptions, pluginConfigOverrides: Map<any> | undefined): void;
10218 protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[], pluginConfigOverrides: Map<any> | undefined): void;
10219 private enableProxy;
10220 /** Starts a new check for diagnostics. Call this if some file has updated that would cause diagnostics to be changed. */
10221 refreshDiagnostics(): void;
10222 }
10223 /**
10224 * If a file is opened and no tsconfig (or jsconfig) is found,
10225 * the file and its imports/references are put into an InferredProject.
10226 */
10227 class InferredProject extends Project {
10228 private _isJsInferredProject;
10229 toggleJsInferredProject(isJsInferredProject: boolean): void;
10230 setCompilerOptions(options?: CompilerOptions): void;
10231 /** this is canonical project root path */
10232 readonly projectRootPath: string | undefined;
10233 addRoot(info: ScriptInfo): void;
10234 removeRoot(info: ScriptInfo): void;
10235 isProjectWithSingleRoot(): boolean;
10236 close(): void;
10237 getTypeAcquisition(): TypeAcquisition;
10238 }
10239 class AutoImportProviderProject extends Project {
10240 private hostProject;
10241 private rootFileNames;
10242 isOrphan(): boolean;
10243 updateGraph(): boolean;
10244 hasRoots(): boolean;
10245 markAsDirty(): void;
10246 getScriptFileNames(): string[];
10247 getLanguageService(): never;
10248 getModuleResolutionHostForAutoImportProvider(): never;
10249 getProjectReferences(): readonly ProjectReference[] | undefined;
10250 getTypeAcquisition(): TypeAcquisition;
10251 }
10252 /**
10253 * If a file is opened, the server will look for a tsconfig (or jsconfig)
10254 * and if successful create a ConfiguredProject for it.
10255 * Otherwise it will create an InferredProject.
10256 */
10257 class ConfiguredProject extends Project {
10258 readonly canonicalConfigFilePath: NormalizedPath;
10259 /** Ref count to the project when opened from external project */
10260 private externalProjectRefCount;
10261 private projectReferences;
10262 /**
10263 * If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph
10264 * @returns: true if set of files in the project stays the same and false - otherwise.
10265 */
10266 updateGraph(): boolean;
10267 getConfigFilePath(): NormalizedPath;
10268 getProjectReferences(): readonly ProjectReference[] | undefined;
10269 updateReferences(refs: readonly ProjectReference[] | undefined): void;
10270 /**
10271 * Get the errors that dont have any file name associated
10272 */
10273 getGlobalProjectErrors(): readonly Diagnostic[];
10274 /**
10275 * Get all the project errors
10276 */
10277 getAllProjectErrors(): readonly Diagnostic[];
10278 setProjectErrors(projectErrors: Diagnostic[]): void;
10279 close(): void;
10280 getEffectiveTypeRoots(): string[];
10281 }
10282 /**
10283 * Project whose configuration is handled externally, such as in a '.csproj'.
10284 * These are created only if a host explicitly calls `openExternalProject`.
10285 */
10286 class ExternalProject extends Project {
10287 externalProjectName: string;
10288 compileOnSaveEnabled: boolean;
10289 excludedFiles: readonly NormalizedPath[];
10290 updateGraph(): boolean;
10291 getExcludedFiles(): readonly NormalizedPath[];
10292 }
10293}
10294declare namespace ts.server {
10295 export const maxProgramSizeForNonTsFiles: number;
10296 export const ProjectsUpdatedInBackgroundEvent = "projectsUpdatedInBackground";
10297 export const ProjectLoadingStartEvent = "projectLoadingStart";
10298 export const ProjectLoadingFinishEvent = "projectLoadingFinish";
10299 export const LargeFileReferencedEvent = "largeFileReferenced";
10300 export const ConfigFileDiagEvent = "configFileDiag";
10301 export const ProjectLanguageServiceStateEvent = "projectLanguageServiceState";
10302 export const ProjectInfoTelemetryEvent = "projectInfo";
10303 export const OpenFileInfoTelemetryEvent = "openFileInfo";
10304 export interface ProjectsUpdatedInBackgroundEvent {
10305 eventName: typeof ProjectsUpdatedInBackgroundEvent;
10306 data: {
10307 openFiles: string[];
10308 };
10309 }
10310 export interface ProjectLoadingStartEvent {
10311 eventName: typeof ProjectLoadingStartEvent;
10312 data: {
10313 project: Project;
10314 reason: string;
10315 };
10316 }
10317 export interface ProjectLoadingFinishEvent {
10318 eventName: typeof ProjectLoadingFinishEvent;
10319 data: {
10320 project: Project;
10321 };
10322 }
10323 export interface LargeFileReferencedEvent {
10324 eventName: typeof LargeFileReferencedEvent;
10325 data: {
10326 file: string;
10327 fileSize: number;
10328 maxFileSize: number;
10329 };
10330 }
10331 export interface ConfigFileDiagEvent {
10332 eventName: typeof ConfigFileDiagEvent;
10333 data: {
10334 triggerFile: string;
10335 configFileName: string;
10336 diagnostics: readonly Diagnostic[];
10337 };
10338 }
10339 export interface ProjectLanguageServiceStateEvent {
10340 eventName: typeof ProjectLanguageServiceStateEvent;
10341 data: {
10342 project: Project;
10343 languageServiceEnabled: boolean;
10344 };
10345 }
10346 /** This will be converted to the payload of a protocol.TelemetryEvent in session.defaultEventHandler. */
10347 export interface ProjectInfoTelemetryEvent {
10348 readonly eventName: typeof ProjectInfoTelemetryEvent;
10349 readonly data: ProjectInfoTelemetryEventData;
10350 }
10351 export interface ProjectInfoTelemetryEventData {
10352 /** Cryptographically secure hash of project file location. */
10353 readonly projectId: string;
10354 /** Count of file extensions seen in the project. */
10355 readonly fileStats: FileStats;
10356 /**
10357 * Any compiler options that might contain paths will be taken out.
10358 * Enum compiler options will be converted to strings.
10359 */
10360 readonly compilerOptions: CompilerOptions;
10361 readonly extends: boolean | undefined;
10362 readonly files: boolean | undefined;
10363 readonly include: boolean | undefined;
10364 readonly exclude: boolean | undefined;
10365 readonly compileOnSave: boolean;
10366 readonly typeAcquisition: ProjectInfoTypeAcquisitionData;
10367 readonly configFileName: "tsconfig.json" | "jsconfig.json" | "other";
10368 readonly projectType: "external" | "configured";
10369 readonly languageServiceEnabled: boolean;
10370 /** TypeScript version used by the server. */
10371 readonly version: string;
10372 }
10373 /**
10374 * Info that we may send about a file that was just opened.
10375 * Info about a file will only be sent once per session, even if the file changes in ways that might affect the info.
10376 * Currently this is only sent for '.js' files.
10377 */
10378 export interface OpenFileInfoTelemetryEvent {
10379 readonly eventName: typeof OpenFileInfoTelemetryEvent;
10380 readonly data: OpenFileInfoTelemetryEventData;
10381 }
10382 export interface OpenFileInfoTelemetryEventData {
10383 readonly info: OpenFileInfo;
10384 }
10385 export interface ProjectInfoTypeAcquisitionData {
10386 readonly enable: boolean | undefined;
10387 readonly include: boolean;
10388 readonly exclude: boolean;
10389 }
10390 export interface FileStats {
10391 readonly js: number;
10392 readonly jsSize?: number;
10393 readonly jsx: number;
10394 readonly jsxSize?: number;
10395 readonly ts: number;
10396 readonly tsSize?: number;
10397 readonly tsx: number;
10398 readonly tsxSize?: number;
10399 readonly dts: number;
10400 readonly dtsSize?: number;
10401 readonly deferred: number;
10402 readonly deferredSize?: number;
10403 }
10404 export interface OpenFileInfo {
10405 readonly checkJs: boolean;
10406 }
10407 export type ProjectServiceEvent = LargeFileReferencedEvent | ProjectsUpdatedInBackgroundEvent | ProjectLoadingStartEvent | ProjectLoadingFinishEvent | ConfigFileDiagEvent | ProjectLanguageServiceStateEvent | ProjectInfoTelemetryEvent | OpenFileInfoTelemetryEvent;
10408 export type ProjectServiceEventHandler = (event: ProjectServiceEvent) => void;
10409 export interface SafeList {
10410 [name: string]: {
10411 match: RegExp;
10412 exclude?: (string | number)[][];
10413 types?: string[];
10414 };
10415 }
10416 export interface TypesMapFile {
10417 typesMap: SafeList;
10418 simpleMap: {
10419 [libName: string]: string;
10420 };
10421 }
10422 export function convertFormatOptions(protocolOptions: protocol.FormatCodeSettings): FormatCodeSettings;
10423 export function convertCompilerOptions(protocolOptions: protocol.ExternalProjectCompilerOptions): CompilerOptions & protocol.CompileOnSaveMixin;
10424 export function convertWatchOptions(protocolOptions: protocol.ExternalProjectCompilerOptions, currentDirectory?: string): WatchOptionsAndErrors | undefined;
10425 export function convertTypeAcquisition(protocolOptions: protocol.InferredProjectCompilerOptions): TypeAcquisition | undefined;
10426 export function tryConvertScriptKindName(scriptKindName: protocol.ScriptKindName | ScriptKind): ScriptKind;
10427 export function convertScriptKindName(scriptKindName: protocol.ScriptKindName): ScriptKind.Unknown | ScriptKind.JS | ScriptKind.JSX | ScriptKind.TS | ScriptKind.TSX;
10428 export interface HostConfiguration {
10429 formatCodeOptions: FormatCodeSettings;
10430 preferences: protocol.UserPreferences;
10431 hostInfo: string;
10432 extraFileExtensions?: FileExtensionInfo[];
10433 watchOptions?: WatchOptions;
10434 }
10435 export interface OpenConfiguredProjectResult {
10436 configFileName?: NormalizedPath;
10437 configFileErrors?: readonly Diagnostic[];
10438 }
10439 export interface ProjectServiceOptions {
10440 host: ServerHost;
10441 logger: Logger;
10442 cancellationToken: HostCancellationToken;
10443 useSingleInferredProject: boolean;
10444 useInferredProjectPerProjectRoot: boolean;
10445 typingsInstaller: ITypingsInstaller;
10446 eventHandler?: ProjectServiceEventHandler;
10447 suppressDiagnosticEvents?: boolean;
10448 throttleWaitMilliseconds?: number;
10449 globalPlugins?: readonly string[];
10450 pluginProbeLocations?: readonly string[];
10451 allowLocalPluginLoads?: boolean;
10452 typesMapLocation?: string;
10453 /** @deprecated use serverMode instead */
10454 syntaxOnly?: boolean;
10455 serverMode?: LanguageServiceMode;
10456 session: Session<unknown> | undefined;
10457 }
10458 export interface WatchOptionsAndErrors {
10459 watchOptions: WatchOptions;
10460 errors: Diagnostic[] | undefined;
10461 }
10462 export class ProjectService {
10463 private readonly nodeModulesWatchers;
10464 /**
10465 * Contains all the deleted script info's version information so that
10466 * it does not reset when creating script info again
10467 * (and could have potentially collided with version where contents mismatch)
10468 */
10469 private readonly filenameToScriptInfoVersion;
10470 private readonly allJsFilesForOpenFileTelemetry;
10471 /**
10472 * maps external project file name to list of config files that were the part of this project
10473 */
10474 private readonly externalProjectToConfiguredProjectMap;
10475 /**
10476 * external projects (configuration and list of root files is not controlled by tsserver)
10477 */
10478 readonly externalProjects: ExternalProject[];
10479 /**
10480 * projects built from openFileRoots
10481 */
10482 readonly inferredProjects: InferredProject[];
10483 /**
10484 * projects specified by a tsconfig.json file
10485 */
10486 readonly configuredProjects: Map<ConfiguredProject>;
10487 /**
10488 * Open files: with value being project root path, and key being Path of the file that is open
10489 */
10490 readonly openFiles: Map<NormalizedPath | undefined>;
10491 /**
10492 * Map of open files that are opened without complete path but have projectRoot as current directory
10493 */
10494 private readonly openFilesWithNonRootedDiskPath;
10495 private compilerOptionsForInferredProjects;
10496 private compilerOptionsForInferredProjectsPerProjectRoot;
10497 private watchOptionsForInferredProjects;
10498 private watchOptionsForInferredProjectsPerProjectRoot;
10499 private typeAcquisitionForInferredProjects;
10500 private typeAcquisitionForInferredProjectsPerProjectRoot;
10501 /**
10502 * Project size for configured or external projects
10503 */
10504 private readonly projectToSizeMap;
10505 private readonly hostConfiguration;
10506 private safelist;
10507 private readonly legacySafelist;
10508 private pendingProjectUpdates;
10509 readonly currentDirectory: NormalizedPath;
10510 readonly toCanonicalFileName: (f: string) => string;
10511 readonly host: ServerHost;
10512 readonly logger: Logger;
10513 readonly cancellationToken: HostCancellationToken;
10514 readonly useSingleInferredProject: boolean;
10515 readonly useInferredProjectPerProjectRoot: boolean;
10516 readonly typingsInstaller: ITypingsInstaller;
10517 private readonly globalCacheLocationDirectoryPath;
10518 readonly throttleWaitMilliseconds?: number;
10519 private readonly eventHandler?;
10520 private readonly suppressDiagnosticEvents?;
10521 readonly globalPlugins: readonly string[];
10522 readonly pluginProbeLocations: readonly string[];
10523 readonly allowLocalPluginLoads: boolean;
10524 private currentPluginConfigOverrides;
10525 readonly typesMapLocation: string | undefined;
10526 /** @deprecated use serverMode instead */
10527 readonly syntaxOnly: boolean;
10528 readonly serverMode: LanguageServiceMode;
10529 /** Tracks projects that we have already sent telemetry for. */
10530 private readonly seenProjects;
10531 private performanceEventHandler?;
10532 private pendingPluginEnablements?;
10533 private currentPluginEnablementPromise?;
10534 constructor(opts: ProjectServiceOptions);
10535 toPath(fileName: string): Path;
10536 private loadTypesMap;
10537 updateTypingsForProject(response: SetTypings | InvalidateCachedTypings | PackageInstalledResponse): void;
10538 private delayUpdateProjectGraph;
10539 private delayUpdateProjectGraphs;
10540 setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.InferredProjectCompilerOptions, projectRootPath?: string): void;
10541 findProject(projectName: string): Project | undefined;
10542 getDefaultProjectForFile(fileName: NormalizedPath, ensureProject: boolean): Project | undefined;
10543 private doEnsureDefaultProjectForFile;
10544 getScriptInfoEnsuringProjectsUptoDate(uncheckedFileName: string): ScriptInfo | undefined;
10545 /**
10546 * Ensures the project structures are upto date
10547 * This means,
10548 * - we go through all the projects and update them if they are dirty
10549 * - if updates reflect some change in structure or there was pending request to ensure projects for open files
10550 * ensure that each open script info has project
10551 */
10552 private ensureProjectStructuresUptoDate;
10553 getFormatCodeOptions(file: NormalizedPath): FormatCodeSettings;
10554 getPreferences(file: NormalizedPath): protocol.UserPreferences;
10555 getHostFormatCodeOptions(): FormatCodeSettings;
10556 getHostPreferences(): protocol.UserPreferences;
10557 private onSourceFileChanged;
10558 private handleSourceMapProjects;
10559 private delayUpdateSourceInfoProjects;
10560 private delayUpdateProjectsOfScriptInfoPath;
10561 private handleDeletedFile;
10562 private removeProject;
10563 private assignOrphanScriptInfosToInferredProject;
10564 /**
10565 * Remove this file from the set of open, non-configured files.
10566 * @param info The file that has been closed or newly configured
10567 */
10568 private closeOpenFile;
10569 private deleteScriptInfo;
10570 private configFileExists;
10571 /**
10572 * Returns true if the configFileExistenceInfo is needed/impacted by open files that are root of inferred project
10573 */
10574 private configFileExistenceImpactsRootOfInferredProject;
10575 /**
10576 * This is called on file close, so that we stop watching the config file for this script info
10577 */
10578 private stopWatchingConfigFilesForClosedScriptInfo;
10579 /**
10580 * This function tries to search for a tsconfig.json for the given file.
10581 * This is different from the method the compiler uses because
10582 * the compiler can assume it will always start searching in the
10583 * current directory (the directory in which tsc was invoked).
10584 * The server must start searching from the directory containing
10585 * the newly opened file.
10586 */
10587 private forEachConfigFileLocation;
10588 /**
10589 * This function tries to search for a tsconfig.json for the given file.
10590 * This is different from the method the compiler uses because
10591 * the compiler can assume it will always start searching in the
10592 * current directory (the directory in which tsc was invoked).
10593 * The server must start searching from the directory containing
10594 * the newly opened file.
10595 * If script info is passed in, it is asserted to be open script info
10596 * otherwise just file name
10597 */
10598 private getConfigFileNameForFile;
10599 private printProjects;
10600 private getConfiguredProjectByCanonicalConfigFilePath;
10601 private findExternalProjectByProjectName;
10602 /** Get a filename if the language service exceeds the maximum allowed program size; otherwise returns undefined. */
10603 private getFilenameForExceededTotalSizeLimitForNonTsFiles;
10604 private createExternalProject;
10605 private addFilesToNonInferredProject;
10606 private updateNonInferredProjectFiles;
10607 private updateRootAndOptionsOfNonInferredProject;
10608 private sendConfigFileDiagEvent;
10609 private getOrCreateInferredProjectForProjectRootPathIfEnabled;
10610 private getOrCreateSingleInferredProjectIfEnabled;
10611 private getOrCreateSingleInferredWithoutProjectRoot;
10612 private createInferredProject;
10613 getScriptInfo(uncheckedFileName: string): ScriptInfo | undefined;
10614 private watchClosedScriptInfo;
10615 private createNodeModulesWatcher;
10616 private watchClosedScriptInfoInNodeModules;
10617 private getModifiedTime;
10618 private refreshScriptInfo;
10619 private refreshScriptInfosInDirectory;
10620 private stopWatchingScriptInfo;
10621 private getOrCreateScriptInfoNotOpenedByClientForNormalizedPath;
10622 private getOrCreateScriptInfoOpenedByClientForNormalizedPath;
10623 getOrCreateScriptInfoForNormalizedPath(fileName: NormalizedPath, openedByClient: boolean, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, hostToQueryFileExistsOn?: {
10624 fileExists(path: string): boolean;
10625 }): ScriptInfo | undefined;
10626 private getOrCreateScriptInfoWorker;
10627 /**
10628 * This gets the script info for the normalized path. If the path is not rooted disk path then the open script info with project root context is preferred
10629 */
10630 getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo | undefined;
10631 getScriptInfoForPath(fileName: Path): ScriptInfo | undefined;
10632 private addSourceInfoToSourceMap;
10633 private addMissingSourceMapFile;
10634 setHostConfiguration(args: protocol.ConfigureRequestArguments): void;
10635 closeLog(): void;
10636 /**
10637 * This function rebuilds the project for every file opened by the client
10638 * This does not reload contents of open files from disk. But we could do that if needed
10639 */
10640 reloadProjects(): void;
10641 /**
10642 * This function goes through all the openFiles and tries to file the config file for them.
10643 * If the config file is found and it refers to existing project, it reloads it either immediately
10644 * or schedules it for reload depending on delayReload option
10645 * If there is no existing project it just opens the configured project for the config file
10646 * reloadForInfo provides a way to filter out files to reload configured project for
10647 */
10648 private reloadConfiguredProjectForFiles;
10649 /**
10650 * Remove the root of inferred project if script info is part of another project
10651 */
10652 private removeRootOfInferredProjectIfNowPartOfOtherProject;
10653 /**
10654 * This function is to update the project structure for every inferred project.
10655 * It is called on the premise that all the configured projects are
10656 * up to date.
10657 * This will go through open files and assign them to inferred project if open file is not part of any other project
10658 * After that all the inferred project graphs are updated
10659 */
10660 private ensureProjectForOpenFiles;
10661 /**
10662 * Open file whose contents is managed by the client
10663 * @param filename is absolute pathname
10664 * @param fileContent is a known version of the file content that is more up to date than the one on disk
10665 */
10666 openClientFile(fileName: string, fileContent?: string, scriptKind?: ScriptKind, projectRootPath?: string): OpenConfiguredProjectResult;
10667 private findExternalProjectContainingOpenScriptInfo;
10668 private getOrCreateOpenScriptInfo;
10669 private assignProjectToOpenedScriptInfo;
10670 private createAncestorProjects;
10671 private ensureProjectChildren;
10672 private cleanupAfterOpeningFile;
10673 openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult;
10674 private removeOrphanConfiguredProjects;
10675 private removeOrphanScriptInfos;
10676 private telemetryOnOpenFile;
10677 /**
10678 * Close file whose contents is managed by the client
10679 * @param filename is absolute pathname
10680 */
10681 closeClientFile(uncheckedFileName: string): void;
10682 private collectChanges;
10683 private closeConfiguredProjectReferencedFromExternalProject;
10684 closeExternalProject(uncheckedFileName: string): void;
10685 openExternalProjects(projects: protocol.ExternalProject[]): void;
10686 /** Makes a filename safe to insert in a RegExp */
10687 private static readonly filenameEscapeRegexp;
10688 private static escapeFilenameForRegex;
10689 resetSafeList(): void;
10690 applySafeList(proj: protocol.ExternalProject): NormalizedPath[];
10691 openExternalProject(proj: protocol.ExternalProject): void;
10692 hasDeferredExtension(): boolean;
10693 private enableRequestedPluginsAsync;
10694 private enableRequestedPluginsWorker;
10695 private enableRequestedPluginsForProjectAsync;
10696 configurePlugin(args: protocol.ConfigurePluginRequestArguments): void;
10697 }
10698 export {};
10699}
10700declare namespace ts.server {
10701 interface ServerCancellationToken extends HostCancellationToken {
10702 setRequest(requestId: number): void;
10703 resetRequest(requestId: number): void;
10704 }
10705 const nullCancellationToken: ServerCancellationToken;
10706 interface PendingErrorCheck {
10707 fileName: NormalizedPath;
10708 project: Project;
10709 }
10710 type CommandNames = protocol.CommandTypes;
10711 const CommandNames: any;
10712 function formatMessage<T extends protocol.Message>(msg: T, logger: Logger, byteLength: (s: string, encoding: string) => number, newLine: string): string;
10713 type Event = <T extends object>(body: T, eventName: string) => void;
10714 interface EventSender {
10715 event: Event;
10716 }
10717 interface SessionOptions {
10718 host: ServerHost;
10719 cancellationToken: ServerCancellationToken;
10720 useSingleInferredProject: boolean;
10721 useInferredProjectPerProjectRoot: boolean;
10722 typingsInstaller: ITypingsInstaller;
10723 byteLength: (buf: string, encoding?: string) => number;
10724 hrtime: (start?: number[]) => number[];
10725 logger: Logger;
10726 /**
10727 * If falsy, all events are suppressed.
10728 */
10729 canUseEvents: boolean;
10730 eventHandler?: ProjectServiceEventHandler;
10731 /** Has no effect if eventHandler is also specified. */
10732 suppressDiagnosticEvents?: boolean;
10733 /** @deprecated use serverMode instead */
10734 syntaxOnly?: boolean;
10735 serverMode?: LanguageServiceMode;
10736 throttleWaitMilliseconds?: number;
10737 noGetErrOnBackgroundUpdate?: boolean;
10738 globalPlugins?: readonly string[];
10739 pluginProbeLocations?: readonly string[];
10740 allowLocalPluginLoads?: boolean;
10741 typesMapLocation?: string;
10742 }
10743 class Session<TMessage = string> implements EventSender {
10744 private readonly gcTimer;
10745 protected projectService: ProjectService;
10746 private changeSeq;
10747 private performanceData;
10748 private currentRequestId;
10749 private errorCheck;
10750 protected host: ServerHost;
10751 private readonly cancellationToken;
10752 protected readonly typingsInstaller: ITypingsInstaller;
10753 protected byteLength: (buf: string, encoding?: string) => number;
10754 private hrtime;
10755 protected logger: Logger;
10756 protected canUseEvents: boolean;
10757 private suppressDiagnosticEvents?;
10758 private eventHandler;
10759 private readonly noGetErrOnBackgroundUpdate?;
10760 constructor(opts: SessionOptions);
10761 private sendRequestCompletedEvent;
10762 private addPerformanceData;
10763 private performanceEventHandler;
10764 private defaultEventHandler;
10765 private projectsUpdatedInBackgroundEvent;
10766 logError(err: Error, cmd: string): void;
10767 private logErrorWorker;
10768 send(msg: protocol.Message): void;
10769 protected writeMessage(msg: protocol.Message): void;
10770 event<T extends object>(body: T, eventName: string): void;
10771 /** @deprecated */
10772 output(info: any, cmdName: string, reqSeq?: number, errorMsg?: string): void;
10773 private doOutput;
10774 private semanticCheck;
10775 private syntacticCheck;
10776 private suggestionCheck;
10777 private sendDiagnosticsEvent;
10778 /** It is the caller's responsibility to verify that `!this.suppressDiagnosticEvents`. */
10779 private updateErrorCheck;
10780 private cleanProjects;
10781 private cleanup;
10782 private getEncodedSyntacticClassifications;
10783 private getEncodedSemanticClassifications;
10784 private getProject;
10785 private getConfigFileAndProject;
10786 private getConfigFileDiagnostics;
10787 private convertToDiagnosticsWithLinePositionFromDiagnosticFile;
10788 private getCompilerOptionsDiagnostics;
10789 private convertToDiagnosticsWithLinePosition;
10790 private getDiagnosticsWorker;
10791 private getDefinition;
10792 private mapDefinitionInfoLocations;
10793 private getDefinitionAndBoundSpan;
10794 private findSourceDefinition;
10795 private getEmitOutput;
10796 private mapJSDocTagInfo;
10797 private mapDisplayParts;
10798 private mapSignatureHelpItems;
10799 private mapDefinitionInfo;
10800 private static mapToOriginalLocation;
10801 private toFileSpan;
10802 private toFileSpanWithContext;
10803 private getTypeDefinition;
10804 private mapImplementationLocations;
10805 private getImplementation;
10806 private getOccurrences;
10807 private getSyntacticDiagnosticsSync;
10808 private getSemanticDiagnosticsSync;
10809 private getSuggestionDiagnosticsSync;
10810 private getJsxClosingTag;
10811 private getDocumentHighlights;
10812 private provideInlayHints;
10813 private setCompilerOptionsForInferredProjects;
10814 private getProjectInfo;
10815 private getProjectInfoWorker;
10816 private getRenameInfo;
10817 private getProjects;
10818 private getDefaultProject;
10819 private getRenameLocations;
10820 private mapRenameInfo;
10821 private toSpanGroups;
10822 private getReferences;
10823 private getFileReferences;
10824 /**
10825 * @param fileName is the name of the file to be opened
10826 * @param fileContent is a version of the file content that is known to be more up to date than the one on disk
10827 */
10828 private openClientFile;
10829 private getPosition;
10830 private getPositionInFile;
10831 private getFileAndProject;
10832 private getFileAndLanguageServiceForSyntacticOperation;
10833 private getFileAndProjectWorker;
10834 private getOutliningSpans;
10835 private getTodoComments;
10836 private getDocCommentTemplate;
10837 private getSpanOfEnclosingComment;
10838 private getIndentation;
10839 private getBreakpointStatement;
10840 private getNameOrDottedNameSpan;
10841 private isValidBraceCompletion;
10842 private getQuickInfoWorker;
10843 private getFormattingEditsForRange;
10844 private getFormattingEditsForRangeFull;
10845 private getFormattingEditsForDocumentFull;
10846 private getFormattingEditsAfterKeystrokeFull;
10847 private getFormattingEditsAfterKeystroke;
10848 private getCompletions;
10849 private getCompletionEntryDetails;
10850 private getCompileOnSaveAffectedFileList;
10851 private emitFile;
10852 private getSignatureHelpItems;
10853 private toPendingErrorCheck;
10854 private getDiagnostics;
10855 private change;
10856 private reload;
10857 private saveToTmp;
10858 private closeClientFile;
10859 private mapLocationNavigationBarItems;
10860 private getNavigationBarItems;
10861 private toLocationNavigationTree;
10862 private getNavigationTree;
10863 private getNavigateToItems;
10864 private getFullNavigateToItems;
10865 private getSupportedCodeFixes;
10866 private isLocation;
10867 private extractPositionOrRange;
10868 private getRange;
10869 private getApplicableRefactors;
10870 private getEditsForRefactor;
10871 private organizeImports;
10872 private getEditsForFileRename;
10873 private getCodeFixes;
10874 private getCombinedCodeFix;
10875 private applyCodeActionCommand;
10876 private getStartAndEndPosition;
10877 private mapCodeAction;
10878 private mapCodeFixAction;
10879 private mapTextChangesToCodeEdits;
10880 private mapTextChangeToCodeEdit;
10881 private convertTextChangeToCodeEdit;
10882 private getBraceMatching;
10883 private getDiagnosticsForProject;
10884 private configurePlugin;
10885 private getSmartSelectionRange;
10886 private toggleLineComment;
10887 private toggleMultilineComment;
10888 private commentSelection;
10889 private uncommentSelection;
10890 private mapSelectionRange;
10891 private getScriptInfoFromProjectService;
10892 private toProtocolCallHierarchyItem;
10893 private toProtocolCallHierarchyIncomingCall;
10894 private toProtocolCallHierarchyOutgoingCall;
10895 private prepareCallHierarchy;
10896 private provideCallHierarchyIncomingCalls;
10897 private provideCallHierarchyOutgoingCalls;
10898 getCanonicalFileName(fileName: string): string;
10899 exit(): void;
10900 private notRequired;
10901 private requiredResponse;
10902 private handlers;
10903 addProtocolHandler(command: string, handler: (request: protocol.Request) => HandlerResponse): void;
10904 private setCurrentRequest;
10905 private resetCurrentRequest;
10906 executeWithRequestId<T>(requestId: number, f: () => T): T;
10907 executeCommand(request: protocol.Request): HandlerResponse;
10908 onMessage(message: TMessage): void;
10909 protected parseMessage(message: TMessage): protocol.Request;
10910 protected toStringMessage(message: TMessage): string;
10911 private getFormatOptions;
10912 private getPreferences;
10913 private getHostFormatOptions;
10914 private getHostPreferences;
10915 }
10916 interface HandlerResponse {
10917 response?: {};
10918 responseRequired?: boolean;
10919 }
10920}
10921declare namespace ts {
10922 /** @deprecated Use `factory.createNodeArray` or the factory supplied by your transformation context instead. */
10923 const createNodeArray: <T extends Node>(elements?: readonly T[] | undefined, hasTrailingComma?: boolean | undefined) => NodeArray<T>;
10924 /** @deprecated Use `factory.createNumericLiteral` or the factory supplied by your transformation context instead. */
10925 const createNumericLiteral: (value: string | number, numericLiteralFlags?: TokenFlags | undefined) => NumericLiteral;
10926 /** @deprecated Use `factory.createBigIntLiteral` or the factory supplied by your transformation context instead. */
10927 const createBigIntLiteral: (value: string | PseudoBigInt) => BigIntLiteral;
10928 /** @deprecated Use `factory.createStringLiteral` or the factory supplied by your transformation context instead. */
10929 const createStringLiteral: {
10930 (text: string, isSingleQuote?: boolean | undefined): StringLiteral;
10931 (text: string, isSingleQuote?: boolean | undefined, hasExtendedUnicodeEscape?: boolean | undefined): StringLiteral;
10932 };
10933 /** @deprecated Use `factory.createStringLiteralFromNode` or the factory supplied by your transformation context instead. */
10934 const createStringLiteralFromNode: (sourceNode: PrivateIdentifier | PropertyNameLiteral, isSingleQuote?: boolean | undefined) => StringLiteral;
10935 /** @deprecated Use `factory.createRegularExpressionLiteral` or the factory supplied by your transformation context instead. */
10936 const createRegularExpressionLiteral: (text: string) => RegularExpressionLiteral;
10937 /** @deprecated Use `factory.createLoopVariable` or the factory supplied by your transformation context instead. */
10938 const createLoopVariable: (reservedInNestedScopes?: boolean | undefined) => Identifier;
10939 /** @deprecated Use `factory.createUniqueName` or the factory supplied by your transformation context instead. */
10940 const createUniqueName: (text: string, flags?: GeneratedIdentifierFlags | undefined) => Identifier;
10941 /** @deprecated Use `factory.createPrivateIdentifier` or the factory supplied by your transformation context instead. */
10942 const createPrivateIdentifier: (text: string) => PrivateIdentifier;
10943 /** @deprecated Use `factory.createSuper` or the factory supplied by your transformation context instead. */
10944 const createSuper: () => SuperExpression;
10945 /** @deprecated Use `factory.createThis` or the factory supplied by your transformation context instead. */
10946 const createThis: () => ThisExpression;
10947 /** @deprecated Use `factory.createNull` or the factory supplied by your transformation context instead. */
10948 const createNull: () => NullLiteral;
10949 /** @deprecated Use `factory.createTrue` or the factory supplied by your transformation context instead. */
10950 const createTrue: () => TrueLiteral;
10951 /** @deprecated Use `factory.createFalse` or the factory supplied by your transformation context instead. */
10952 const createFalse: () => FalseLiteral;
10953 /** @deprecated Use `factory.createModifier` or the factory supplied by your transformation context instead. */
10954 const createModifier: <T extends ModifierSyntaxKind>(kind: T) => ModifierToken<T>;
10955 /** @deprecated Use `factory.createModifiersFromModifierFlags` or the factory supplied by your transformation context instead. */
10956 const createModifiersFromModifierFlags: (flags: ModifierFlags) => Modifier[] | undefined;
10957 /** @deprecated Use `factory.createQualifiedName` or the factory supplied by your transformation context instead. */
10958 const createQualifiedName: (left: EntityName, right: string | Identifier) => QualifiedName;
10959 /** @deprecated Use `factory.updateQualifiedName` or the factory supplied by your transformation context instead. */
10960 const updateQualifiedName: (node: QualifiedName, left: EntityName, right: Identifier) => QualifiedName;
10961 /** @deprecated Use `factory.createComputedPropertyName` or the factory supplied by your transformation context instead. */
10962 const createComputedPropertyName: (expression: Expression) => ComputedPropertyName;
10963 /** @deprecated Use `factory.updateComputedPropertyName` or the factory supplied by your transformation context instead. */
10964 const updateComputedPropertyName: (node: ComputedPropertyName, expression: Expression) => ComputedPropertyName;
10965 /** @deprecated Use `factory.createTypeParameterDeclaration` or the factory supplied by your transformation context instead. */
10966 const createTypeParameterDeclaration: {
10967 (modifiers: readonly Modifier[] | undefined, name: string | Identifier, constraint?: TypeNode | undefined, defaultType?: TypeNode | undefined): TypeParameterDeclaration;
10968 (name: string | Identifier, constraint?: TypeNode | undefined, defaultType?: TypeNode | undefined): TypeParameterDeclaration;
10969 };
10970 /** @deprecated Use `factory.updateTypeParameterDeclaration` or the factory supplied by your transformation context instead. */
10971 const updateTypeParameterDeclaration: {
10972 (node: TypeParameterDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration;
10973 (node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration;
10974 };
10975 /** @deprecated Use `factory.createParameterDeclaration` or the factory supplied by your transformation context instead. */
10976 const createParameter: {
10977 (modifiers: readonly ModifierLike[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken?: QuestionToken | undefined, type?: TypeNode | undefined, initializer?: Expression | undefined): ParameterDeclaration;
10978 (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken?: QuestionToken | undefined, type?: TypeNode | undefined, initializer?: Expression | undefined): ParameterDeclaration;
10979 };
10980 /** @deprecated Use `factory.updateParameterDeclaration` or the factory supplied by your transformation context instead. */
10981 const updateParameter: {
10982 (node: ParameterDeclaration, modifiers: readonly ModifierLike[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): ParameterDeclaration;
10983 (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;
10984 };
10985 /** @deprecated Use `factory.createDecorator` or the factory supplied by your transformation context instead. */
10986 const createDecorator: (expression: Expression) => Decorator;
10987 /** @deprecated Use `factory.updateDecorator` or the factory supplied by your transformation context instead. */
10988 const updateDecorator: (node: Decorator, expression: Expression) => Decorator;
10989 /** @deprecated Use `factory.createPropertyDeclaration` or the factory supplied by your transformation context instead. */
10990 const createProperty: {
10991 (modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
10992 (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
10993 };
10994 /** @deprecated Use `factory.updatePropertyDeclaration` or the factory supplied by your transformation context instead. */
10995 const updateProperty: {
10996 (node: PropertyDeclaration, modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
10997 (node: PropertyDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
10998 };
10999 /** @deprecated Use `factory.createMethodDeclaration` or the factory supplied by your transformation context instead. */
11000 const createMethod: {
11001 (modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
11002 (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;
11003 };
11004 /** @deprecated Use `factory.updateMethodDeclaration` or the factory supplied by your transformation context instead. */
11005 const updateMethod: {
11006 (node: MethodDeclaration, modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
11007 (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;
11008 };
11009 /** @deprecated Use `factory.createConstructorDeclaration` or the factory supplied by your transformation context instead. */
11010 const createConstructor: {
11011 (modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
11012 (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
11013 };
11014 /** @deprecated Use `factory.updateConstructorDeclaration` or the factory supplied by your transformation context instead. */
11015 const updateConstructor: {
11016 (node: ConstructorDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
11017 (node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
11018 };
11019 /** @deprecated Use `factory.createGetAccessorDeclaration` or the factory supplied by your transformation context instead. */
11020 const createGetAccessor: {
11021 (modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
11022 (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
11023 };
11024 /** @deprecated Use `factory.updateGetAccessorDeclaration` or the factory supplied by your transformation context instead. */
11025 const updateGetAccessor: {
11026 (node: GetAccessorDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
11027 (node: GetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
11028 };
11029 /** @deprecated Use `factory.createSetAccessorDeclaration` or the factory supplied by your transformation context instead. */
11030 const createSetAccessor: {
11031 (modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration;
11032 (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration;
11033 };
11034 /** @deprecated Use `factory.updateSetAccessorDeclaration` or the factory supplied by your transformation context instead. */
11035 const updateSetAccessor: {
11036 (node: SetAccessorDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration;
11037 (node: SetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration;
11038 };
11039 /** @deprecated Use `factory.createCallSignature` or the factory supplied by your transformation context instead. */
11040 const createCallSignature: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined) => CallSignatureDeclaration;
11041 /** @deprecated Use `factory.updateCallSignature` or the factory supplied by your transformation context instead. */
11042 const updateCallSignature: (node: CallSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined) => CallSignatureDeclaration;
11043 /** @deprecated Use `factory.createConstructSignature` or the factory supplied by your transformation context instead. */
11044 const createConstructSignature: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined) => ConstructSignatureDeclaration;
11045 /** @deprecated Use `factory.updateConstructSignature` or the factory supplied by your transformation context instead. */
11046 const updateConstructSignature: (node: ConstructSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined) => ConstructSignatureDeclaration;
11047 /** @deprecated Use `factory.updateIndexSignature` or the factory supplied by your transformation context instead. */
11048 const updateIndexSignature: {
11049 (node: IndexSignatureDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration;
11050 (node: IndexSignatureDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration;
11051 };
11052 /** @deprecated Use `factory.createKeywordTypeNode` or the factory supplied by your transformation context instead. */
11053 const createKeywordTypeNode: <TKind extends KeywordTypeSyntaxKind>(kind: TKind) => KeywordTypeNode<TKind>;
11054 /** @deprecated Use `factory.createTypePredicateNode` or the factory supplied by your transformation context instead. */
11055 const createTypePredicateNodeWithModifier: (assertsModifier: AssertsKeyword | undefined, parameterName: string | Identifier | ThisTypeNode, type: TypeNode | undefined) => TypePredicateNode;
11056 /** @deprecated Use `factory.updateTypePredicateNode` or the factory supplied by your transformation context instead. */
11057 const updateTypePredicateNodeWithModifier: (node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined) => TypePredicateNode;
11058 /** @deprecated Use `factory.createTypeReferenceNode` or the factory supplied by your transformation context instead. */
11059 const createTypeReferenceNode: (typeName: string | EntityName, typeArguments?: readonly TypeNode[] | undefined) => TypeReferenceNode;
11060 /** @deprecated Use `factory.updateTypeReferenceNode` or the factory supplied by your transformation context instead. */
11061 const updateTypeReferenceNode: (node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray<TypeNode> | undefined) => TypeReferenceNode;
11062 /** @deprecated Use `factory.createFunctionTypeNode` or the factory supplied by your transformation context instead. */
11063 const createFunctionTypeNode: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => FunctionTypeNode;
11064 /** @deprecated Use `factory.updateFunctionTypeNode` or the factory supplied by your transformation context instead. */
11065 const updateFunctionTypeNode: (node: FunctionTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode) => FunctionTypeNode;
11066 /** @deprecated Use `factory.createConstructorTypeNode` or the factory supplied by your transformation context instead. */
11067 const createConstructorTypeNode: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => ConstructorTypeNode;
11068 /** @deprecated Use `factory.updateConstructorTypeNode` or the factory supplied by your transformation context instead. */
11069 const updateConstructorTypeNode: (node: ConstructorTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode) => ConstructorTypeNode;
11070 /** @deprecated Use `factory.createTypeQueryNode` or the factory supplied by your transformation context instead. */
11071 const createTypeQueryNode: (exprName: EntityName, typeArguments?: readonly TypeNode[] | undefined) => TypeQueryNode;
11072 /** @deprecated Use `factory.updateTypeQueryNode` or the factory supplied by your transformation context instead. */
11073 const updateTypeQueryNode: (node: TypeQueryNode, exprName: EntityName, typeArguments?: readonly TypeNode[] | undefined) => TypeQueryNode;
11074 /** @deprecated Use `factory.createTypeLiteralNode` or the factory supplied by your transformation context instead. */
11075 const createTypeLiteralNode: (members: readonly TypeElement[] | undefined) => TypeLiteralNode;
11076 /** @deprecated Use `factory.updateTypeLiteralNode` or the factory supplied by your transformation context instead. */
11077 const updateTypeLiteralNode: (node: TypeLiteralNode, members: NodeArray<TypeElement>) => TypeLiteralNode;
11078 /** @deprecated Use `factory.createArrayTypeNode` or the factory supplied by your transformation context instead. */
11079 const createArrayTypeNode: (elementType: TypeNode) => ArrayTypeNode;
11080 /** @deprecated Use `factory.updateArrayTypeNode` or the factory supplied by your transformation context instead. */
11081 const updateArrayTypeNode: (node: ArrayTypeNode, elementType: TypeNode) => ArrayTypeNode;
11082 /** @deprecated Use `factory.createTupleTypeNode` or the factory supplied by your transformation context instead. */
11083 const createTupleTypeNode: (elements: readonly (TypeNode | NamedTupleMember)[]) => TupleTypeNode;
11084 /** @deprecated Use `factory.updateTupleTypeNode` or the factory supplied by your transformation context instead. */
11085 const updateTupleTypeNode: (node: TupleTypeNode, elements: readonly (TypeNode | NamedTupleMember)[]) => TupleTypeNode;
11086 /** @deprecated Use `factory.createOptionalTypeNode` or the factory supplied by your transformation context instead. */
11087 const createOptionalTypeNode: (type: TypeNode) => OptionalTypeNode;
11088 /** @deprecated Use `factory.updateOptionalTypeNode` or the factory supplied by your transformation context instead. */
11089 const updateOptionalTypeNode: (node: OptionalTypeNode, type: TypeNode) => OptionalTypeNode;
11090 /** @deprecated Use `factory.createRestTypeNode` or the factory supplied by your transformation context instead. */
11091 const createRestTypeNode: (type: TypeNode) => RestTypeNode;
11092 /** @deprecated Use `factory.updateRestTypeNode` or the factory supplied by your transformation context instead. */
11093 const updateRestTypeNode: (node: RestTypeNode, type: TypeNode) => RestTypeNode;
11094 /** @deprecated Use `factory.createUnionTypeNode` or the factory supplied by your transformation context instead. */
11095 const createUnionTypeNode: (types: readonly TypeNode[]) => UnionTypeNode;
11096 /** @deprecated Use `factory.updateUnionTypeNode` or the factory supplied by your transformation context instead. */
11097 const updateUnionTypeNode: (node: UnionTypeNode, types: NodeArray<TypeNode>) => UnionTypeNode;
11098 /** @deprecated Use `factory.createIntersectionTypeNode` or the factory supplied by your transformation context instead. */
11099 const createIntersectionTypeNode: (types: readonly TypeNode[]) => IntersectionTypeNode;
11100 /** @deprecated Use `factory.updateIntersectionTypeNode` or the factory supplied by your transformation context instead. */
11101 const updateIntersectionTypeNode: (node: IntersectionTypeNode, types: NodeArray<TypeNode>) => IntersectionTypeNode;
11102 /** @deprecated Use `factory.createConditionalTypeNode` or the factory supplied by your transformation context instead. */
11103 const createConditionalTypeNode: (checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode) => ConditionalTypeNode;
11104 /** @deprecated Use `factory.updateConditionalTypeNode` or the factory supplied by your transformation context instead. */
11105 const updateConditionalTypeNode: (node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode) => ConditionalTypeNode;
11106 /** @deprecated Use `factory.createInferTypeNode` or the factory supplied by your transformation context instead. */
11107 const createInferTypeNode: (typeParameter: TypeParameterDeclaration) => InferTypeNode;
11108 /** @deprecated Use `factory.updateInferTypeNode` or the factory supplied by your transformation context instead. */
11109 const updateInferTypeNode: (node: InferTypeNode, typeParameter: TypeParameterDeclaration) => InferTypeNode;
11110 /** @deprecated Use `factory.createImportTypeNode` or the factory supplied by your transformation context instead. */
11111 const createImportTypeNode: {
11112 (argument: TypeNode, assertions?: ImportTypeAssertionContainer | undefined, qualifier?: EntityName | undefined, typeArguments?: readonly TypeNode[] | undefined, isTypeOf?: boolean | undefined): ImportTypeNode;
11113 (argument: TypeNode, assertions?: ImportTypeAssertionContainer | undefined, qualifier?: EntityName | undefined, typeArguments?: readonly TypeNode[] | undefined, isTypeOf?: boolean | undefined): ImportTypeNode;
11114 (argument: TypeNode, qualifier?: EntityName | undefined, typeArguments?: readonly TypeNode[] | undefined, isTypeOf?: boolean | undefined): ImportTypeNode;
11115 };
11116 /** @deprecated Use `factory.updateImportTypeNode` or the factory supplied by your transformation context instead. */
11117 const updateImportTypeNode: {
11118 (node: ImportTypeNode, argument: TypeNode, assertions: ImportTypeAssertionContainer | undefined, qualifier: EntityName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf?: boolean | undefined): ImportTypeNode;
11119 (node: ImportTypeNode, argument: TypeNode, qualifier: EntityName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf?: boolean | undefined): ImportTypeNode;
11120 };
11121 /** @deprecated Use `factory.createParenthesizedType` or the factory supplied by your transformation context instead. */
11122 const createParenthesizedType: (type: TypeNode) => ParenthesizedTypeNode;
11123 /** @deprecated Use `factory.updateParenthesizedType` or the factory supplied by your transformation context instead. */
11124 const updateParenthesizedType: (node: ParenthesizedTypeNode, type: TypeNode) => ParenthesizedTypeNode;
11125 /** @deprecated Use `factory.createThisTypeNode` or the factory supplied by your transformation context instead. */
11126 const createThisTypeNode: () => ThisTypeNode;
11127 /** @deprecated Use `factory.updateTypeOperatorNode` or the factory supplied by your transformation context instead. */
11128 const updateTypeOperatorNode: (node: TypeOperatorNode, type: TypeNode) => TypeOperatorNode;
11129 /** @deprecated Use `factory.createIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */
11130 const createIndexedAccessTypeNode: (objectType: TypeNode, indexType: TypeNode) => IndexedAccessTypeNode;
11131 /** @deprecated Use `factory.updateIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */
11132 const updateIndexedAccessTypeNode: (node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode) => IndexedAccessTypeNode;
11133 /** @deprecated Use `factory.createMappedTypeNode` or the factory supplied by your transformation context instead. */
11134 const createMappedTypeNode: (readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined, members: NodeArray<TypeElement> | undefined) => MappedTypeNode;
11135 /** @deprecated Use `factory.updateMappedTypeNode` or the factory supplied by your transformation context instead. */
11136 const updateMappedTypeNode: (node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined, members: NodeArray<TypeElement> | undefined) => MappedTypeNode;
11137 /** @deprecated Use `factory.createLiteralTypeNode` or the factory supplied by your transformation context instead. */
11138 const createLiteralTypeNode: (literal: LiteralExpression | BooleanLiteral | PrefixUnaryExpression | NullLiteral) => LiteralTypeNode;
11139 /** @deprecated Use `factory.updateLiteralTypeNode` or the factory supplied by your transformation context instead. */
11140 const updateLiteralTypeNode: (node: LiteralTypeNode, literal: LiteralExpression | BooleanLiteral | PrefixUnaryExpression | NullLiteral) => LiteralTypeNode;
11141 /** @deprecated Use `factory.createObjectBindingPattern` or the factory supplied by your transformation context instead. */
11142 const createObjectBindingPattern: (elements: readonly BindingElement[]) => ObjectBindingPattern;
11143 /** @deprecated Use `factory.updateObjectBindingPattern` or the factory supplied by your transformation context instead. */
11144 const updateObjectBindingPattern: (node: ObjectBindingPattern, elements: readonly BindingElement[]) => ObjectBindingPattern;
11145 /** @deprecated Use `factory.createArrayBindingPattern` or the factory supplied by your transformation context instead. */
11146 const createArrayBindingPattern: (elements: readonly ArrayBindingElement[]) => ArrayBindingPattern;
11147 /** @deprecated Use `factory.updateArrayBindingPattern` or the factory supplied by your transformation context instead. */
11148 const updateArrayBindingPattern: (node: ArrayBindingPattern, elements: readonly ArrayBindingElement[]) => ArrayBindingPattern;
11149 /** @deprecated Use `factory.createBindingElement` or the factory supplied by your transformation context instead. */
11150 const createBindingElement: (dotDotDotToken: DotDotDotToken | undefined, propertyName: string | PropertyName | undefined, name: string | BindingName, initializer?: Expression | undefined) => BindingElement;
11151 /** @deprecated Use `factory.updateBindingElement` or the factory supplied by your transformation context instead. */
11152 const updateBindingElement: (node: BindingElement, dotDotDotToken: DotDotDotToken | undefined, propertyName: PropertyName | undefined, name: BindingName, initializer: Expression | undefined) => BindingElement;
11153 /** @deprecated Use `factory.createArrayLiteralExpression` or the factory supplied by your transformation context instead. */
11154 const createArrayLiteral: (elements?: readonly Expression[] | undefined, multiLine?: boolean | undefined) => ArrayLiteralExpression;
11155 /** @deprecated Use `factory.updateArrayLiteralExpression` or the factory supplied by your transformation context instead. */
11156 const updateArrayLiteral: (node: ArrayLiteralExpression, elements: readonly Expression[]) => ArrayLiteralExpression;
11157 /** @deprecated Use `factory.createObjectLiteralExpression` or the factory supplied by your transformation context instead. */
11158 const createObjectLiteral: (properties?: readonly ObjectLiteralElementLike[] | undefined, multiLine?: boolean | undefined) => ObjectLiteralExpression;
11159 /** @deprecated Use `factory.updateObjectLiteralExpression` or the factory supplied by your transformation context instead. */
11160 const updateObjectLiteral: (node: ObjectLiteralExpression, properties: readonly ObjectLiteralElementLike[]) => ObjectLiteralExpression;
11161 /** @deprecated Use `factory.createPropertyAccessExpression` or the factory supplied by your transformation context instead. */
11162 const createPropertyAccess: (expression: Expression, name: string | MemberName) => PropertyAccessExpression;
11163 /** @deprecated Use `factory.updatePropertyAccessExpression` or the factory supplied by your transformation context instead. */
11164 const updatePropertyAccess: (node: PropertyAccessExpression, expression: Expression, name: MemberName) => PropertyAccessExpression;
11165 /** @deprecated Use `factory.createPropertyAccessChain` or the factory supplied by your transformation context instead. */
11166 const createPropertyAccessChain: (expression: Expression, questionDotToken: QuestionDotToken | undefined, name: string | MemberName) => PropertyAccessChain;
11167 /** @deprecated Use `factory.updatePropertyAccessChain` or the factory supplied by your transformation context instead. */
11168 const updatePropertyAccessChain: (node: PropertyAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, name: MemberName) => PropertyAccessChain;
11169 /** @deprecated Use `factory.createElementAccessExpression` or the factory supplied by your transformation context instead. */
11170 const createElementAccess: (expression: Expression, index: number | Expression) => ElementAccessExpression;
11171 /** @deprecated Use `factory.updateElementAccessExpression` or the factory supplied by your transformation context instead. */
11172 const updateElementAccess: (node: ElementAccessExpression, expression: Expression, argumentExpression: Expression) => ElementAccessExpression;
11173 /** @deprecated Use `factory.createElementAccessChain` or the factory supplied by your transformation context instead. */
11174 const createElementAccessChain: (expression: Expression, questionDotToken: QuestionDotToken | undefined, index: number | Expression) => ElementAccessChain;
11175 /** @deprecated Use `factory.updateElementAccessChain` or the factory supplied by your transformation context instead. */
11176 const updateElementAccessChain: (node: ElementAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, argumentExpression: Expression) => ElementAccessChain;
11177 /** @deprecated Use `factory.createCallExpression` or the factory supplied by your transformation context instead. */
11178 const createCall: (expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => CallExpression;
11179 /** @deprecated Use `factory.updateCallExpression` or the factory supplied by your transformation context instead. */
11180 const updateCall: (node: CallExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]) => CallExpression;
11181 /** @deprecated Use `factory.createCallChain` or the factory supplied by your transformation context instead. */
11182 const createCallChain: (expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => CallChain;
11183 /** @deprecated Use `factory.updateCallChain` or the factory supplied by your transformation context instead. */
11184 const updateCallChain: (node: CallChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]) => CallChain;
11185 /** @deprecated Use `factory.createNewExpression` or the factory supplied by your transformation context instead. */
11186 const createNew: (expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => NewExpression;
11187 /** @deprecated Use `factory.updateNewExpression` or the factory supplied by your transformation context instead. */
11188 const updateNew: (node: NewExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => NewExpression;
11189 /** @deprecated Use `factory.createTypeAssertion` or the factory supplied by your transformation context instead. */
11190 const createTypeAssertion: (type: TypeNode, expression: Expression) => TypeAssertion;
11191 /** @deprecated Use `factory.updateTypeAssertion` or the factory supplied by your transformation context instead. */
11192 const updateTypeAssertion: (node: TypeAssertion, type: TypeNode, expression: Expression) => TypeAssertion;
11193 /** @deprecated Use `factory.createParenthesizedExpression` or the factory supplied by your transformation context instead. */
11194 const createParen: (expression: Expression) => ParenthesizedExpression;
11195 /** @deprecated Use `factory.updateParenthesizedExpression` or the factory supplied by your transformation context instead. */
11196 const updateParen: (node: ParenthesizedExpression, expression: Expression) => ParenthesizedExpression;
11197 /** @deprecated Use `factory.createFunctionExpression` or the factory supplied by your transformation context instead. */
11198 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;
11199 /** @deprecated Use `factory.updateFunctionExpression` or the factory supplied by your transformation context instead. */
11200 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;
11201 /** @deprecated Use `factory.createDeleteExpression` or the factory supplied by your transformation context instead. */
11202 const createDelete: (expression: Expression) => DeleteExpression;
11203 /** @deprecated Use `factory.updateDeleteExpression` or the factory supplied by your transformation context instead. */
11204 const updateDelete: (node: DeleteExpression, expression: Expression) => DeleteExpression;
11205 /** @deprecated Use `factory.createTypeOfExpression` or the factory supplied by your transformation context instead. */
11206 const createTypeOf: (expression: Expression) => TypeOfExpression;
11207 /** @deprecated Use `factory.updateTypeOfExpression` or the factory supplied by your transformation context instead. */
11208 const updateTypeOf: (node: TypeOfExpression, expression: Expression) => TypeOfExpression;
11209 /** @deprecated Use `factory.createVoidExpression` or the factory supplied by your transformation context instead. */
11210 const createVoid: (expression: Expression) => VoidExpression;
11211 /** @deprecated Use `factory.updateVoidExpression` or the factory supplied by your transformation context instead. */
11212 const updateVoid: (node: VoidExpression, expression: Expression) => VoidExpression;
11213 /** @deprecated Use `factory.createAwaitExpression` or the factory supplied by your transformation context instead. */
11214 const createAwait: (expression: Expression) => AwaitExpression;
11215 /** @deprecated Use `factory.updateAwaitExpression` or the factory supplied by your transformation context instead. */
11216 const updateAwait: (node: AwaitExpression, expression: Expression) => AwaitExpression;
11217 /** @deprecated Use `factory.createPrefixExpression` or the factory supplied by your transformation context instead. */
11218 const createPrefix: (operator: PrefixUnaryOperator, operand: Expression) => PrefixUnaryExpression;
11219 /** @deprecated Use `factory.updatePrefixExpression` or the factory supplied by your transformation context instead. */
11220 const updatePrefix: (node: PrefixUnaryExpression, operand: Expression) => PrefixUnaryExpression;
11221 /** @deprecated Use `factory.createPostfixUnaryExpression` or the factory supplied by your transformation context instead. */
11222 const createPostfix: (operand: Expression, operator: PostfixUnaryOperator) => PostfixUnaryExpression;
11223 /** @deprecated Use `factory.updatePostfixUnaryExpression` or the factory supplied by your transformation context instead. */
11224 const updatePostfix: (node: PostfixUnaryExpression, operand: Expression) => PostfixUnaryExpression;
11225 /** @deprecated Use `factory.createBinaryExpression` or the factory supplied by your transformation context instead. */
11226 const createBinary: (left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression) => BinaryExpression;
11227 /** @deprecated Use `factory.updateConditionalExpression` or the factory supplied by your transformation context instead. */
11228 const updateConditional: (node: ConditionalExpression, condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression) => ConditionalExpression;
11229 /** @deprecated Use `factory.createTemplateExpression` or the factory supplied by your transformation context instead. */
11230 const createTemplateExpression: (head: TemplateHead, templateSpans: readonly TemplateSpan[]) => TemplateExpression;
11231 /** @deprecated Use `factory.updateTemplateExpression` or the factory supplied by your transformation context instead. */
11232 const updateTemplateExpression: (node: TemplateExpression, head: TemplateHead, templateSpans: readonly TemplateSpan[]) => TemplateExpression;
11233 /** @deprecated Use `factory.createTemplateHead` or the factory supplied by your transformation context instead. */
11234 const createTemplateHead: {
11235 (text: string, rawText?: string | undefined, templateFlags?: TokenFlags | undefined): TemplateHead;
11236 (text: string | undefined, rawText: string, templateFlags?: TokenFlags | undefined): TemplateHead;
11237 };
11238 /** @deprecated Use `factory.createTemplateMiddle` or the factory supplied by your transformation context instead. */
11239 const createTemplateMiddle: {
11240 (text: string, rawText?: string | undefined, templateFlags?: TokenFlags | undefined): TemplateMiddle;
11241 (text: string | undefined, rawText: string, templateFlags?: TokenFlags | undefined): TemplateMiddle;
11242 };
11243 /** @deprecated Use `factory.createTemplateTail` or the factory supplied by your transformation context instead. */
11244 const createTemplateTail: {
11245 (text: string, rawText?: string | undefined, templateFlags?: TokenFlags | undefined): TemplateTail;
11246 (text: string | undefined, rawText: string, templateFlags?: TokenFlags | undefined): TemplateTail;
11247 };
11248 /** @deprecated Use `factory.createNoSubstitutionTemplateLiteral` or the factory supplied by your transformation context instead. */
11249 const createNoSubstitutionTemplateLiteral: {
11250 (text: string, rawText?: string | undefined): NoSubstitutionTemplateLiteral;
11251 (text: string | undefined, rawText: string): NoSubstitutionTemplateLiteral;
11252 };
11253 /** @deprecated Use `factory.updateYieldExpression` or the factory supplied by your transformation context instead. */
11254 const updateYield: (node: YieldExpression, asteriskToken: AsteriskToken | undefined, expression: Expression | undefined) => YieldExpression;
11255 /** @deprecated Use `factory.createSpreadExpression` or the factory supplied by your transformation context instead. */
11256 const createSpread: (expression: Expression) => SpreadElement;
11257 /** @deprecated Use `factory.updateSpreadExpression` or the factory supplied by your transformation context instead. */
11258 const updateSpread: (node: SpreadElement, expression: Expression) => SpreadElement;
11259 /** @deprecated Use `factory.createOmittedExpression` or the factory supplied by your transformation context instead. */
11260 const createOmittedExpression: () => OmittedExpression;
11261 /** @deprecated Use `factory.createAsExpression` or the factory supplied by your transformation context instead. */
11262 const createAsExpression: (expression: Expression, type: TypeNode) => AsExpression;
11263 /** @deprecated Use `factory.updateAsExpression` or the factory supplied by your transformation context instead. */
11264 const updateAsExpression: (node: AsExpression, expression: Expression, type: TypeNode) => AsExpression;
11265 /** @deprecated Use `factory.createNonNullExpression` or the factory supplied by your transformation context instead. */
11266 const createNonNullExpression: (expression: Expression) => NonNullExpression;
11267 /** @deprecated Use `factory.updateNonNullExpression` or the factory supplied by your transformation context instead. */
11268 const updateNonNullExpression: (node: NonNullExpression, expression: Expression) => NonNullExpression;
11269 /** @deprecated Use `factory.createNonNullChain` or the factory supplied by your transformation context instead. */
11270 const createNonNullChain: (expression: Expression) => NonNullChain;
11271 /** @deprecated Use `factory.updateNonNullChain` or the factory supplied by your transformation context instead. */
11272 const updateNonNullChain: (node: NonNullChain, expression: Expression) => NonNullChain;
11273 /** @deprecated Use `factory.createMetaProperty` or the factory supplied by your transformation context instead. */
11274 const createMetaProperty: (keywordToken: SyntaxKind.ImportKeyword | SyntaxKind.NewKeyword, name: Identifier) => MetaProperty;
11275 /** @deprecated Use `factory.updateMetaProperty` or the factory supplied by your transformation context instead. */
11276 const updateMetaProperty: (node: MetaProperty, name: Identifier) => MetaProperty;
11277 /** @deprecated Use `factory.createTemplateSpan` or the factory supplied by your transformation context instead. */
11278 const createTemplateSpan: (expression: Expression, literal: TemplateMiddle | TemplateTail) => TemplateSpan;
11279 /** @deprecated Use `factory.updateTemplateSpan` or the factory supplied by your transformation context instead. */
11280 const updateTemplateSpan: (node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail) => TemplateSpan;
11281 /** @deprecated Use `factory.createSemicolonClassElement` or the factory supplied by your transformation context instead. */
11282 const createSemicolonClassElement: () => SemicolonClassElement;
11283 /** @deprecated Use `factory.createBlock` or the factory supplied by your transformation context instead. */
11284 const createBlock: (statements: readonly Statement[], multiLine?: boolean | undefined) => Block;
11285 /** @deprecated Use `factory.updateBlock` or the factory supplied by your transformation context instead. */
11286 const updateBlock: (node: Block, statements: readonly Statement[]) => Block;
11287 /** @deprecated Use `factory.createVariableStatement` or the factory supplied by your transformation context instead. */
11288 const createVariableStatement: (modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList | readonly VariableDeclaration[]) => VariableStatement;
11289 /** @deprecated Use `factory.updateVariableStatement` or the factory supplied by your transformation context instead. */
11290 const updateVariableStatement: (node: VariableStatement, modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList) => VariableStatement;
11291 /** @deprecated Use `factory.createEmptyStatement` or the factory supplied by your transformation context instead. */
11292 const createEmptyStatement: () => EmptyStatement;
11293 /** @deprecated Use `factory.createExpressionStatement` or the factory supplied by your transformation context instead. */
11294 const createExpressionStatement: (expression: Expression) => ExpressionStatement;
11295 /** @deprecated Use `factory.updateExpressionStatement` or the factory supplied by your transformation context instead. */
11296 const updateExpressionStatement: (node: ExpressionStatement, expression: Expression) => ExpressionStatement;
11297 /** @deprecated Use `factory.createExpressionStatement` or the factory supplied by your transformation context instead. */
11298 const createStatement: (expression: Expression) => ExpressionStatement;
11299 /** @deprecated Use `factory.updateExpressionStatement` or the factory supplied by your transformation context instead. */
11300 const updateStatement: (node: ExpressionStatement, expression: Expression) => ExpressionStatement;
11301 /** @deprecated Use `factory.createIfStatement` or the factory supplied by your transformation context instead. */
11302 const createIf: (expression: Expression, thenStatement: Statement, elseStatement?: Statement | undefined) => IfStatement;
11303 /** @deprecated Use `factory.updateIfStatement` or the factory supplied by your transformation context instead. */
11304 const updateIf: (node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement | undefined) => IfStatement;
11305 /** @deprecated Use `factory.createDoStatement` or the factory supplied by your transformation context instead. */
11306 const createDo: (statement: Statement, expression: Expression) => DoStatement;
11307 /** @deprecated Use `factory.updateDoStatement` or the factory supplied by your transformation context instead. */
11308 const updateDo: (node: DoStatement, statement: Statement, expression: Expression) => DoStatement;
11309 /** @deprecated Use `factory.createWhileStatement` or the factory supplied by your transformation context instead. */
11310 const createWhile: (expression: Expression, statement: Statement) => WhileStatement;
11311 /** @deprecated Use `factory.updateWhileStatement` or the factory supplied by your transformation context instead. */
11312 const updateWhile: (node: WhileStatement, expression: Expression, statement: Statement) => WhileStatement;
11313 /** @deprecated Use `factory.createForStatement` or the factory supplied by your transformation context instead. */
11314 const createFor: (initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement) => ForStatement;
11315 /** @deprecated Use `factory.updateForStatement` or the factory supplied by your transformation context instead. */
11316 const updateFor: (node: ForStatement, initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement) => ForStatement;
11317 /** @deprecated Use `factory.createForInStatement` or the factory supplied by your transformation context instead. */
11318 const createForIn: (initializer: ForInitializer, expression: Expression, statement: Statement) => ForInStatement;
11319 /** @deprecated Use `factory.updateForInStatement` or the factory supplied by your transformation context instead. */
11320 const updateForIn: (node: ForInStatement, initializer: ForInitializer, expression: Expression, statement: Statement) => ForInStatement;
11321 /** @deprecated Use `factory.createForOfStatement` or the factory supplied by your transformation context instead. */
11322 const createForOf: (awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement) => ForOfStatement;
11323 /** @deprecated Use `factory.updateForOfStatement` or the factory supplied by your transformation context instead. */
11324 const updateForOf: (node: ForOfStatement, awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement) => ForOfStatement;
11325 /** @deprecated Use `factory.createContinueStatement` or the factory supplied by your transformation context instead. */
11326 const createContinue: (label?: string | Identifier | undefined) => ContinueStatement;
11327 /** @deprecated Use `factory.updateContinueStatement` or the factory supplied by your transformation context instead. */
11328 const updateContinue: (node: ContinueStatement, label: Identifier | undefined) => ContinueStatement;
11329 /** @deprecated Use `factory.createBreakStatement` or the factory supplied by your transformation context instead. */
11330 const createBreak: (label?: string | Identifier | undefined) => BreakStatement;
11331 /** @deprecated Use `factory.updateBreakStatement` or the factory supplied by your transformation context instead. */
11332 const updateBreak: (node: BreakStatement, label: Identifier | undefined) => BreakStatement;
11333 /** @deprecated Use `factory.createReturnStatement` or the factory supplied by your transformation context instead. */
11334 const createReturn: (expression?: Expression | undefined) => ReturnStatement;
11335 /** @deprecated Use `factory.updateReturnStatement` or the factory supplied by your transformation context instead. */
11336 const updateReturn: (node: ReturnStatement, expression: Expression | undefined) => ReturnStatement;
11337 /** @deprecated Use `factory.createWithStatement` or the factory supplied by your transformation context instead. */
11338 const createWith: (expression: Expression, statement: Statement) => WithStatement;
11339 /** @deprecated Use `factory.updateWithStatement` or the factory supplied by your transformation context instead. */
11340 const updateWith: (node: WithStatement, expression: Expression, statement: Statement) => WithStatement;
11341 /** @deprecated Use `factory.createSwitchStatement` or the factory supplied by your transformation context instead. */
11342 const createSwitch: (expression: Expression, caseBlock: CaseBlock) => SwitchStatement;
11343 /** @deprecated Use `factory.updateSwitchStatement` or the factory supplied by your transformation context instead. */
11344 const updateSwitch: (node: SwitchStatement, expression: Expression, caseBlock: CaseBlock) => SwitchStatement;
11345 /** @deprecated Use `factory.createLabelStatement` or the factory supplied by your transformation context instead. */
11346 const createLabel: (label: string | Identifier, statement: Statement) => LabeledStatement;
11347 /** @deprecated Use `factory.updateLabelStatement` or the factory supplied by your transformation context instead. */
11348 const updateLabel: (node: LabeledStatement, label: Identifier, statement: Statement) => LabeledStatement;
11349 /** @deprecated Use `factory.createThrowStatement` or the factory supplied by your transformation context instead. */
11350 const createThrow: (expression: Expression) => ThrowStatement;
11351 /** @deprecated Use `factory.updateThrowStatement` or the factory supplied by your transformation context instead. */
11352 const updateThrow: (node: ThrowStatement, expression: Expression) => ThrowStatement;
11353 /** @deprecated Use `factory.createTryStatement` or the factory supplied by your transformation context instead. */
11354 const createTry: (tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined) => TryStatement;
11355 /** @deprecated Use `factory.updateTryStatement` or the factory supplied by your transformation context instead. */
11356 const updateTry: (node: TryStatement, tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined) => TryStatement;
11357 /** @deprecated Use `factory.createDebuggerStatement` or the factory supplied by your transformation context instead. */
11358 const createDebuggerStatement: () => DebuggerStatement;
11359 /** @deprecated Use `factory.createVariableDeclarationList` or the factory supplied by your transformation context instead. */
11360 const createVariableDeclarationList: (declarations: readonly VariableDeclaration[], flags?: NodeFlags | undefined) => VariableDeclarationList;
11361 /** @deprecated Use `factory.updateVariableDeclarationList` or the factory supplied by your transformation context instead. */
11362 const updateVariableDeclarationList: (node: VariableDeclarationList, declarations: readonly VariableDeclaration[]) => VariableDeclarationList;
11363 /** @deprecated Use `factory.createFunctionDeclaration` or the factory supplied by your transformation context instead. */
11364 const createFunctionDeclaration: {
11365 (modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration;
11366 (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;
11367 };
11368 /** @deprecated Use `factory.updateFunctionDeclaration` or the factory supplied by your transformation context instead. */
11369 const updateFunctionDeclaration: {
11370 (node: FunctionDeclaration, modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration;
11371 (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;
11372 };
11373 /** @deprecated Use `factory.createClassDeclaration` or the factory supplied by your transformation context instead. */
11374 const createClassDeclaration: {
11375 (modifiers: readonly ModifierLike[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassDeclaration;
11376 (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassDeclaration;
11377 };
11378 /** @deprecated Use `factory.updateClassDeclaration` or the factory supplied by your transformation context instead. */
11379 const updateClassDeclaration: {
11380 (node: ClassDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassDeclaration;
11381 (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;
11382 };
11383 /** @deprecated Use `factory.createInterfaceDeclaration` or the factory supplied by your transformation context instead. */
11384 const createInterfaceDeclaration: {
11385 (modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
11386 (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
11387 };
11388 /** @deprecated Use `factory.updateInterfaceDeclaration` or the factory supplied by your transformation context instead. */
11389 const updateInterfaceDeclaration: {
11390 (node: InterfaceDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
11391 (node: InterfaceDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
11392 };
11393 /** @deprecated Use `factory.createTypeAliasDeclaration` or the factory supplied by your transformation context instead. */
11394 const createTypeAliasDeclaration: {
11395 (modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
11396 (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
11397 };
11398 /** @deprecated Use `factory.updateTypeAliasDeclaration` or the factory supplied by your transformation context instead. */
11399 const updateTypeAliasDeclaration: {
11400 (node: TypeAliasDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
11401 (node: TypeAliasDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
11402 };
11403 /** @deprecated Use `factory.createEnumDeclaration` or the factory supplied by your transformation context instead. */
11404 const createEnumDeclaration: {
11405 (modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration;
11406 (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration;
11407 };
11408 /** @deprecated Use `factory.updateEnumDeclaration` or the factory supplied by your transformation context instead. */
11409 const updateEnumDeclaration: {
11410 (node: EnumDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration;
11411 (node: EnumDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration;
11412 };
11413 /** @deprecated Use `factory.createModuleDeclaration` or the factory supplied by your transformation context instead. */
11414 const createModuleDeclaration: {
11415 (modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags | undefined): ModuleDeclaration;
11416 (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags | undefined): ModuleDeclaration;
11417 };
11418 /** @deprecated Use `factory.updateModuleDeclaration` or the factory supplied by your transformation context instead. */
11419 const updateModuleDeclaration: {
11420 (node: ModuleDeclaration, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration;
11421 (node: ModuleDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration;
11422 };
11423 /** @deprecated Use `factory.createModuleBlock` or the factory supplied by your transformation context instead. */
11424 const createModuleBlock: (statements: readonly Statement[]) => ModuleBlock;
11425 /** @deprecated Use `factory.updateModuleBlock` or the factory supplied by your transformation context instead. */
11426 const updateModuleBlock: (node: ModuleBlock, statements: readonly Statement[]) => ModuleBlock;
11427 /** @deprecated Use `factory.createCaseBlock` or the factory supplied by your transformation context instead. */
11428 const createCaseBlock: (clauses: readonly CaseOrDefaultClause[]) => CaseBlock;
11429 /** @deprecated Use `factory.updateCaseBlock` or the factory supplied by your transformation context instead. */
11430 const updateCaseBlock: (node: CaseBlock, clauses: readonly CaseOrDefaultClause[]) => CaseBlock;
11431 /** @deprecated Use `factory.createNamespaceExportDeclaration` or the factory supplied by your transformation context instead. */
11432 const createNamespaceExportDeclaration: (name: string | Identifier) => NamespaceExportDeclaration;
11433 /** @deprecated Use `factory.updateNamespaceExportDeclaration` or the factory supplied by your transformation context instead. */
11434 const updateNamespaceExportDeclaration: (node: NamespaceExportDeclaration, name: Identifier) => NamespaceExportDeclaration;
11435 /** @deprecated Use `factory.createImportEqualsDeclaration` or the factory supplied by your transformation context instead. */
11436 const createImportEqualsDeclaration: {
11437 (modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration;
11438 (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration;
11439 };
11440 /** @deprecated Use `factory.updateImportEqualsDeclaration` or the factory supplied by your transformation context instead. */
11441 const updateImportEqualsDeclaration: {
11442 (node: ImportEqualsDeclaration, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration;
11443 (node: ImportEqualsDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration;
11444 };
11445 /** @deprecated Use `factory.createImportDeclaration` or the factory supplied by your transformation context instead. */
11446 const createImportDeclaration: {
11447 (modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause?: AssertClause | undefined): ImportDeclaration;
11448 (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause?: AssertClause | undefined): ImportDeclaration;
11449 };
11450 /** @deprecated Use `factory.updateImportDeclaration` or the factory supplied by your transformation context instead. */
11451 const updateImportDeclaration: {
11452 (node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration;
11453 (node: ImportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration;
11454 };
11455 /** @deprecated Use `factory.createNamespaceImport` or the factory supplied by your transformation context instead. */
11456 const createNamespaceImport: (name: Identifier) => NamespaceImport;
11457 /** @deprecated Use `factory.updateNamespaceImport` or the factory supplied by your transformation context instead. */
11458 const updateNamespaceImport: (node: NamespaceImport, name: Identifier) => NamespaceImport;
11459 /** @deprecated Use `factory.createNamedImports` or the factory supplied by your transformation context instead. */
11460 const createNamedImports: (elements: readonly ImportSpecifier[]) => NamedImports;
11461 /** @deprecated Use `factory.updateNamedImports` or the factory supplied by your transformation context instead. */
11462 const updateNamedImports: (node: NamedImports, elements: readonly ImportSpecifier[]) => NamedImports;
11463 /** @deprecated Use `factory.createImportSpecifier` or the factory supplied by your transformation context instead. */
11464 const createImportSpecifier: (isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier) => ImportSpecifier;
11465 /** @deprecated Use `factory.updateImportSpecifier` or the factory supplied by your transformation context instead. */
11466 const updateImportSpecifier: (node: ImportSpecifier, isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier) => ImportSpecifier;
11467 /** @deprecated Use `factory.createExportAssignment` or the factory supplied by your transformation context instead. */
11468 const createExportAssignment: {
11469 (modifiers: readonly Modifier[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment;
11470 (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment;
11471 };
11472 /** @deprecated Use `factory.updateExportAssignment` or the factory supplied by your transformation context instead. */
11473 const updateExportAssignment: {
11474 (node: ExportAssignment, modifiers: readonly Modifier[] | undefined, expression: Expression): ExportAssignment;
11475 (node: ExportAssignment, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, expression: Expression): ExportAssignment;
11476 };
11477 /** @deprecated Use `factory.createNamedExports` or the factory supplied by your transformation context instead. */
11478 const createNamedExports: (elements: readonly ExportSpecifier[]) => NamedExports;
11479 /** @deprecated Use `factory.updateNamedExports` or the factory supplied by your transformation context instead. */
11480 const updateNamedExports: (node: NamedExports, elements: readonly ExportSpecifier[]) => NamedExports;
11481 /** @deprecated Use `factory.createExportSpecifier` or the factory supplied by your transformation context instead. */
11482 const createExportSpecifier: (isTypeOnly: boolean, propertyName: string | Identifier | undefined, name: string | Identifier) => ExportSpecifier;
11483 /** @deprecated Use `factory.updateExportSpecifier` or the factory supplied by your transformation context instead. */
11484 const updateExportSpecifier: (node: ExportSpecifier, isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier) => ExportSpecifier;
11485 /** @deprecated Use `factory.createExternalModuleReference` or the factory supplied by your transformation context instead. */
11486 const createExternalModuleReference: (expression: Expression) => ExternalModuleReference;
11487 /** @deprecated Use `factory.updateExternalModuleReference` or the factory supplied by your transformation context instead. */
11488 const updateExternalModuleReference: (node: ExternalModuleReference, expression: Expression) => ExternalModuleReference;
11489 /** @deprecated Use `factory.createJSDocTypeExpression` or the factory supplied by your transformation context instead. */
11490 const createJSDocTypeExpression: (type: TypeNode) => JSDocTypeExpression;
11491 /** @deprecated Use `factory.createJSDocTypeTag` or the factory supplied by your transformation context instead. */
11492 const createJSDocTypeTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocTypeTag;
11493 /** @deprecated Use `factory.createJSDocReturnTag` or the factory supplied by your transformation context instead. */
11494 const createJSDocReturnTag: (tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocReturnTag;
11495 /** @deprecated Use `factory.createJSDocThisTag` or the factory supplied by your transformation context instead. */
11496 const createJSDocThisTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocThisTag;
11497 /** @deprecated Use `factory.createJSDocComment` or the factory supplied by your transformation context instead. */
11498 const createJSDocComment: (comment?: string | NodeArray<JSDocComment> | undefined, tags?: readonly JSDocTag[] | undefined) => JSDoc;
11499 /** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */
11500 const createJSDocParameterTag: (tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, isNameFirst?: boolean | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocParameterTag;
11501 /** @deprecated Use `factory.createJSDocClassTag` or the factory supplied by your transformation context instead. */
11502 const createJSDocClassTag: (tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocClassTag;
11503 /** @deprecated Use `factory.createJSDocAugmentsTag` or the factory supplied by your transformation context instead. */
11504 const createJSDocAugmentsTag: (tagName: Identifier | undefined, className: ExpressionWithTypeArguments & {
11505 readonly expression: Identifier | PropertyAccessEntityNameExpression;
11506 }, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocAugmentsTag;
11507 /** @deprecated Use `factory.createJSDocEnumTag` or the factory supplied by your transformation context instead. */
11508 const createJSDocEnumTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocEnumTag;
11509 /** @deprecated Use `factory.createJSDocTemplateTag` or the factory supplied by your transformation context instead. */
11510 const createJSDocTemplateTag: (tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment?: string | NodeArray<JSDocComment> | undefined) => JSDocTemplateTag;
11511 /** @deprecated Use `factory.createJSDocTypedefTag` or the factory supplied by your transformation context instead. */
11512 const createJSDocTypedefTag: (tagName: Identifier | undefined, typeExpression?: JSDocTypeLiteral | JSDocTypeExpression | undefined, fullName?: Identifier | JSDocNamespaceDeclaration | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocTypedefTag;
11513 /** @deprecated Use `factory.createJSDocCallbackTag` or the factory supplied by your transformation context instead. */
11514 const createJSDocCallbackTag: (tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName?: Identifier | JSDocNamespaceDeclaration | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocCallbackTag;
11515 /** @deprecated Use `factory.createJSDocSignature` or the factory supplied by your transformation context instead. */
11516 const createJSDocSignature: (typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type?: JSDocReturnTag | undefined) => JSDocSignature;
11517 /** @deprecated Use `factory.createJSDocPropertyTag` or the factory supplied by your transformation context instead. */
11518 const createJSDocPropertyTag: (tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, isNameFirst?: boolean | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocPropertyTag;
11519 /** @deprecated Use `factory.createJSDocTypeLiteral` or the factory supplied by your transformation context instead. */
11520 const createJSDocTypeLiteral: (jsDocPropertyTags?: readonly JSDocPropertyLikeTag[] | undefined, isArrayType?: boolean | undefined) => JSDocTypeLiteral;
11521 /** @deprecated Use `factory.createJSDocImplementsTag` or the factory supplied by your transformation context instead. */
11522 const createJSDocImplementsTag: (tagName: Identifier | undefined, className: ExpressionWithTypeArguments & {
11523 readonly expression: Identifier | PropertyAccessEntityNameExpression;
11524 }, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocImplementsTag;
11525 /** @deprecated Use `factory.createJSDocAuthorTag` or the factory supplied by your transformation context instead. */
11526 const createJSDocAuthorTag: (tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocAuthorTag;
11527 /** @deprecated Use `factory.createJSDocPublicTag` or the factory supplied by your transformation context instead. */
11528 const createJSDocPublicTag: (tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocPublicTag;
11529 /** @deprecated Use `factory.createJSDocPrivateTag` or the factory supplied by your transformation context instead. */
11530 const createJSDocPrivateTag: (tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocPrivateTag;
11531 /** @deprecated Use `factory.createJSDocProtectedTag` or the factory supplied by your transformation context instead. */
11532 const createJSDocProtectedTag: (tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocProtectedTag;
11533 /** @deprecated Use `factory.createJSDocReadonlyTag` or the factory supplied by your transformation context instead. */
11534 const createJSDocReadonlyTag: (tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocReadonlyTag;
11535 /** @deprecated Use `factory.createJSDocUnknownTag` or the factory supplied by your transformation context instead. */
11536 const createJSDocTag: (tagName: Identifier, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocUnknownTag;
11537 /** @deprecated Use `factory.createJsxElement` or the factory supplied by your transformation context instead. */
11538 const createJsxElement: (openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement) => JsxElement;
11539 /** @deprecated Use `factory.updateJsxElement` or the factory supplied by your transformation context instead. */
11540 const updateJsxElement: (node: JsxElement, openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement) => JsxElement;
11541 /** @deprecated Use `factory.createJsxSelfClosingElement` or the factory supplied by your transformation context instead. */
11542 const createJsxSelfClosingElement: (tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxSelfClosingElement;
11543 /** @deprecated Use `factory.updateJsxSelfClosingElement` or the factory supplied by your transformation context instead. */
11544 const updateJsxSelfClosingElement: (node: JsxSelfClosingElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxSelfClosingElement;
11545 /** @deprecated Use `factory.createJsxOpeningElement` or the factory supplied by your transformation context instead. */
11546 const createJsxOpeningElement: (tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxOpeningElement;
11547 /** @deprecated Use `factory.updateJsxOpeningElement` or the factory supplied by your transformation context instead. */
11548 const updateJsxOpeningElement: (node: JsxOpeningElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxOpeningElement;
11549 /** @deprecated Use `factory.createJsxClosingElement` or the factory supplied by your transformation context instead. */
11550 const createJsxClosingElement: (tagName: JsxTagNameExpression) => JsxClosingElement;
11551 /** @deprecated Use `factory.updateJsxClosingElement` or the factory supplied by your transformation context instead. */
11552 const updateJsxClosingElement: (node: JsxClosingElement, tagName: JsxTagNameExpression) => JsxClosingElement;
11553 /** @deprecated Use `factory.createJsxFragment` or the factory supplied by your transformation context instead. */
11554 const createJsxFragment: (openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment) => JsxFragment;
11555 /** @deprecated Use `factory.createJsxText` or the factory supplied by your transformation context instead. */
11556 const createJsxText: (text: string, containsOnlyTriviaWhiteSpaces?: boolean | undefined) => JsxText;
11557 /** @deprecated Use `factory.updateJsxText` or the factory supplied by your transformation context instead. */
11558 const updateJsxText: (node: JsxText, text: string, containsOnlyTriviaWhiteSpaces?: boolean | undefined) => JsxText;
11559 /** @deprecated Use `factory.createJsxOpeningFragment` or the factory supplied by your transformation context instead. */
11560 const createJsxOpeningFragment: () => JsxOpeningFragment;
11561 /** @deprecated Use `factory.createJsxJsxClosingFragment` or the factory supplied by your transformation context instead. */
11562 const createJsxJsxClosingFragment: () => JsxClosingFragment;
11563 /** @deprecated Use `factory.updateJsxFragment` or the factory supplied by your transformation context instead. */
11564 const updateJsxFragment: (node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment) => JsxFragment;
11565 /** @deprecated Use `factory.createJsxAttribute` or the factory supplied by your transformation context instead. */
11566 const createJsxAttribute: (name: Identifier, initializer: JsxAttributeValue | undefined) => JsxAttribute;
11567 /** @deprecated Use `factory.updateJsxAttribute` or the factory supplied by your transformation context instead. */
11568 const updateJsxAttribute: (node: JsxAttribute, name: Identifier, initializer: JsxAttributeValue | undefined) => JsxAttribute;
11569 /** @deprecated Use `factory.createJsxAttributes` or the factory supplied by your transformation context instead. */
11570 const createJsxAttributes: (properties: readonly JsxAttributeLike[]) => JsxAttributes;
11571 /** @deprecated Use `factory.updateJsxAttributes` or the factory supplied by your transformation context instead. */
11572 const updateJsxAttributes: (node: JsxAttributes, properties: readonly JsxAttributeLike[]) => JsxAttributes;
11573 /** @deprecated Use `factory.createJsxSpreadAttribute` or the factory supplied by your transformation context instead. */
11574 const createJsxSpreadAttribute: (expression: Expression) => JsxSpreadAttribute;
11575 /** @deprecated Use `factory.updateJsxSpreadAttribute` or the factory supplied by your transformation context instead. */
11576 const updateJsxSpreadAttribute: (node: JsxSpreadAttribute, expression: Expression) => JsxSpreadAttribute;
11577 /** @deprecated Use `factory.createJsxExpression` or the factory supplied by your transformation context instead. */
11578 const createJsxExpression: (dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined) => JsxExpression;
11579 /** @deprecated Use `factory.updateJsxExpression` or the factory supplied by your transformation context instead. */
11580 const updateJsxExpression: (node: JsxExpression, expression: Expression | undefined) => JsxExpression;
11581 /** @deprecated Use `factory.createCaseClause` or the factory supplied by your transformation context instead. */
11582 const createCaseClause: (expression: Expression, statements: readonly Statement[]) => CaseClause;
11583 /** @deprecated Use `factory.updateCaseClause` or the factory supplied by your transformation context instead. */
11584 const updateCaseClause: (node: CaseClause, expression: Expression, statements: readonly Statement[]) => CaseClause;
11585 /** @deprecated Use `factory.createDefaultClause` or the factory supplied by your transformation context instead. */
11586 const createDefaultClause: (statements: readonly Statement[]) => DefaultClause;
11587 /** @deprecated Use `factory.updateDefaultClause` or the factory supplied by your transformation context instead. */
11588 const updateDefaultClause: (node: DefaultClause, statements: readonly Statement[]) => DefaultClause;
11589 /** @deprecated Use `factory.createHeritageClause` or the factory supplied by your transformation context instead. */
11590 const createHeritageClause: (token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword, types: readonly ExpressionWithTypeArguments[]) => HeritageClause;
11591 /** @deprecated Use `factory.updateHeritageClause` or the factory supplied by your transformation context instead. */
11592 const updateHeritageClause: (node: HeritageClause, types: readonly ExpressionWithTypeArguments[]) => HeritageClause;
11593 /** @deprecated Use `factory.createCatchClause` or the factory supplied by your transformation context instead. */
11594 const createCatchClause: (variableDeclaration: string | VariableDeclaration | BindingName | undefined, block: Block) => CatchClause;
11595 /** @deprecated Use `factory.updateCatchClause` or the factory supplied by your transformation context instead. */
11596 const updateCatchClause: (node: CatchClause, variableDeclaration: VariableDeclaration | undefined, block: Block) => CatchClause;
11597 /** @deprecated Use `factory.createPropertyAssignment` or the factory supplied by your transformation context instead. */
11598 const createPropertyAssignment: (name: string | PropertyName, initializer: Expression) => PropertyAssignment;
11599 /** @deprecated Use `factory.updatePropertyAssignment` or the factory supplied by your transformation context instead. */
11600 const updatePropertyAssignment: (node: PropertyAssignment, name: PropertyName, initializer: Expression) => PropertyAssignment;
11601 /** @deprecated Use `factory.createShorthandPropertyAssignment` or the factory supplied by your transformation context instead. */
11602 const createShorthandPropertyAssignment: (name: string | Identifier, objectAssignmentInitializer?: Expression | undefined) => ShorthandPropertyAssignment;
11603 /** @deprecated Use `factory.updateShorthandPropertyAssignment` or the factory supplied by your transformation context instead. */
11604 const updateShorthandPropertyAssignment: (node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression | undefined) => ShorthandPropertyAssignment;
11605 /** @deprecated Use `factory.createSpreadAssignment` or the factory supplied by your transformation context instead. */
11606 const createSpreadAssignment: (expression: Expression) => SpreadAssignment;
11607 /** @deprecated Use `factory.updateSpreadAssignment` or the factory supplied by your transformation context instead. */
11608 const updateSpreadAssignment: (node: SpreadAssignment, expression: Expression) => SpreadAssignment;
11609 /** @deprecated Use `factory.createEnumMember` or the factory supplied by your transformation context instead. */
11610 const createEnumMember: (name: string | PropertyName, initializer?: Expression | undefined) => EnumMember;
11611 /** @deprecated Use `factory.updateEnumMember` or the factory supplied by your transformation context instead. */
11612 const updateEnumMember: (node: EnumMember, name: PropertyName, initializer: Expression | undefined) => EnumMember;
11613 /** @deprecated Use `factory.updateSourceFile` or the factory supplied by your transformation context instead. */
11614 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;
11615 /** @deprecated Use `factory.createNotEmittedStatement` or the factory supplied by your transformation context instead. */
11616 const createNotEmittedStatement: (original: Node) => NotEmittedStatement;
11617 /** @deprecated Use `factory.createPartiallyEmittedExpression` or the factory supplied by your transformation context instead. */
11618 const createPartiallyEmittedExpression: (expression: Expression, original?: Node | undefined) => PartiallyEmittedExpression;
11619 /** @deprecated Use `factory.updatePartiallyEmittedExpression` or the factory supplied by your transformation context instead. */
11620 const updatePartiallyEmittedExpression: (node: PartiallyEmittedExpression, expression: Expression) => PartiallyEmittedExpression;
11621 /** @deprecated Use `factory.createCommaListExpression` or the factory supplied by your transformation context instead. */
11622 const createCommaList: (elements: readonly Expression[]) => CommaListExpression;
11623 /** @deprecated Use `factory.updateCommaListExpression` or the factory supplied by your transformation context instead. */
11624 const updateCommaList: (node: CommaListExpression, elements: readonly Expression[]) => CommaListExpression;
11625 /** @deprecated Use `factory.createBundle` or the factory supplied by your transformation context instead. */
11626 const createBundle: (sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[] | undefined) => Bundle;
11627 /** @deprecated Use `factory.updateBundle` or the factory supplied by your transformation context instead. */
11628 const updateBundle: (node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[] | undefined) => Bundle;
11629 /** @deprecated Use `factory.createImmediatelyInvokedFunctionExpression` or the factory supplied by your transformation context instead. */
11630 const createImmediatelyInvokedFunctionExpression: {
11631 (statements: readonly Statement[]): CallExpression;
11632 (statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression;
11633 };
11634 /** @deprecated Use `factory.createImmediatelyInvokedArrowFunction` or the factory supplied by your transformation context instead. */
11635 const createImmediatelyInvokedArrowFunction: {
11636 (statements: readonly Statement[]): CallExpression;
11637 (statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression;
11638 };
11639 /** @deprecated Use `factory.createVoidZero` or the factory supplied by your transformation context instead. */
11640 const createVoidZero: () => VoidExpression;
11641 /** @deprecated Use `factory.createExportDefault` or the factory supplied by your transformation context instead. */
11642 const createExportDefault: (expression: Expression) => ExportAssignment;
11643 /** @deprecated Use `factory.createExternalModuleExport` or the factory supplied by your transformation context instead. */
11644 const createExternalModuleExport: (exportName: Identifier) => ExportDeclaration;
11645 /** @deprecated Use `factory.createNamespaceExport` or the factory supplied by your transformation context instead. */
11646 const createNamespaceExport: (name: Identifier) => NamespaceExport;
11647 /** @deprecated Use `factory.updateNamespaceExport` or the factory supplied by your transformation context instead. */
11648 const updateNamespaceExport: (node: NamespaceExport, name: Identifier) => NamespaceExport;
11649 /** @deprecated Use `factory.createToken` or the factory supplied by your transformation context instead. */
11650 const createToken: <TKind extends SyntaxKind>(kind: TKind) => Token<TKind>;
11651 /** @deprecated Use `factory.createIdentifier` or the factory supplied by your transformation context instead. */
11652 const createIdentifier: (text: string) => Identifier;
11653 /** @deprecated Use `factory.createTempVariable` or the factory supplied by your transformation context instead. */
11654 const createTempVariable: (recordTempVariable: ((node: Identifier) => void) | undefined) => Identifier;
11655 /** @deprecated Use `factory.getGeneratedNameForNode` or the factory supplied by your transformation context instead. */
11656 const getGeneratedNameForNode: (node: Node | undefined) => Identifier;
11657 /** @deprecated Use `factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic)` or the factory supplied by your transformation context instead. */
11658 const createOptimisticUniqueName: (text: string) => Identifier;
11659 /** @deprecated Use `factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic | GeneratedIdentifierFlags.FileLevel)` or the factory supplied by your transformation context instead. */
11660 const createFileLevelUniqueName: (text: string) => Identifier;
11661 /** @deprecated Use `factory.createIndexSignature` or the factory supplied by your transformation context instead. */
11662 const createIndexSignature: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => IndexSignatureDeclaration;
11663 /** @deprecated Use `factory.createTypePredicateNode` or the factory supplied by your transformation context instead. */
11664 const createTypePredicateNode: (parameterName: Identifier | ThisTypeNode | string, type: TypeNode) => TypePredicateNode;
11665 /** @deprecated Use `factory.updateTypePredicateNode` or the factory supplied by your transformation context instead. */
11666 const updateTypePredicateNode: (node: TypePredicateNode, parameterName: Identifier | ThisTypeNode, type: TypeNode) => TypePredicateNode;
11667 /** @deprecated Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead. */
11668 const createLiteral: {
11669 (value: string | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier): StringLiteral;
11670 (value: number | PseudoBigInt): NumericLiteral;
11671 (value: boolean): BooleanLiteral;
11672 (value: string | number | PseudoBigInt | boolean): PrimaryExpression;
11673 };
11674 /** @deprecated Use `factory.createMethodSignature` or the factory supplied by your transformation context instead. */
11675 const createMethodSignature: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined) => MethodSignature;
11676 /** @deprecated Use `factory.updateMethodSignature` or the factory supplied by your transformation context instead. */
11677 const updateMethodSignature: (node: MethodSignature, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined, name: PropertyName, questionToken: QuestionToken | undefined) => MethodSignature;
11678 /** @deprecated Use `factory.createTypeOperatorNode` or the factory supplied by your transformation context instead. */
11679 const createTypeOperatorNode: {
11680 (type: TypeNode): TypeOperatorNode;
11681 (operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode;
11682 };
11683 /** @deprecated Use `factory.createTaggedTemplate` or the factory supplied by your transformation context instead. */
11684 const createTaggedTemplate: {
11685 (tag: Expression, template: TemplateLiteral): TaggedTemplateExpression;
11686 (tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression;
11687 };
11688 /** @deprecated Use `factory.updateTaggedTemplate` or the factory supplied by your transformation context instead. */
11689 const updateTaggedTemplate: {
11690 (node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression;
11691 (node: TaggedTemplateExpression, tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression;
11692 };
11693 /** @deprecated Use `factory.updateBinary` or the factory supplied by your transformation context instead. */
11694 const updateBinary: (node: BinaryExpression, left: Expression, right: Expression, operator?: BinaryOperator | BinaryOperatorToken) => BinaryExpression;
11695 /** @deprecated Use `factory.createConditional` or the factory supplied by your transformation context instead. */
11696 const createConditional: {
11697 (condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression;
11698 (condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression;
11699 };
11700 /** @deprecated Use `factory.createYield` or the factory supplied by your transformation context instead. */
11701 const createYield: {
11702 (expression?: Expression | undefined): YieldExpression;
11703 (asteriskToken: AsteriskToken | undefined, expression: Expression): YieldExpression;
11704 };
11705 /** @deprecated Use `factory.createClassExpression` or the factory supplied by your transformation context instead. */
11706 const createClassExpression: (modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassExpression;
11707 /** @deprecated Use `factory.updateClassExpression` or the factory supplied by your transformation context instead. */
11708 const updateClassExpression: (node: ClassExpression, modifiers: readonly Modifier[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassExpression;
11709 /** @deprecated Use `factory.createPropertySignature` or the factory supplied by your transformation context instead. */
11710 const createPropertySignature: (modifiers: readonly Modifier[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer?: Expression | undefined) => PropertySignature;
11711 /** @deprecated Use `factory.updatePropertySignature` or the factory supplied by your transformation context instead. */
11712 const updatePropertySignature: (node: PropertySignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined) => PropertySignature;
11713 /** @deprecated Use `factory.createExpressionWithTypeArguments` or the factory supplied by your transformation context instead. */
11714 const createExpressionWithTypeArguments: (typeArguments: readonly TypeNode[] | undefined, expression: Expression) => ExpressionWithTypeArguments;
11715 /** @deprecated Use `factory.updateExpressionWithTypeArguments` or the factory supplied by your transformation context instead. */
11716 const updateExpressionWithTypeArguments: (node: ExpressionWithTypeArguments, typeArguments: readonly TypeNode[] | undefined, expression: Expression) => ExpressionWithTypeArguments;
11717 /** @deprecated Use `factory.createArrowFunction` or the factory supplied by your transformation context instead. */
11718 const createArrowFunction: {
11719 (modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction;
11720 (modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction;
11721 };
11722 /** @deprecated Use `factory.updateArrowFunction` or the factory supplied by your transformation context instead. */
11723 const updateArrowFunction: {
11724 (node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken, body: ConciseBody): ArrowFunction;
11725 (node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction;
11726 };
11727 /** @deprecated Use `factory.createVariableDeclaration` or the factory supplied by your transformation context instead. */
11728 const createVariableDeclaration: {
11729 (name: string | BindingName, type?: TypeNode | undefined, initializer?: Expression | undefined): VariableDeclaration;
11730 (name: string | BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration;
11731 };
11732 /** @deprecated Use `factory.updateVariableDeclaration` or the factory supplied by your transformation context instead. */
11733 const updateVariableDeclaration: {
11734 (node: VariableDeclaration, name: BindingName, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration;
11735 (node: VariableDeclaration, name: BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration;
11736 };
11737 /** @deprecated Use `factory.createImportClause` or the factory supplied by your transformation context instead. */
11738 const createImportClause: (name: Identifier | undefined, namedBindings: NamedImportBindings | undefined, isTypeOnly?: any) => ImportClause;
11739 /** @deprecated Use `factory.updateImportClause` or the factory supplied by your transformation context instead. */
11740 const updateImportClause: (node: ImportClause, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined, isTypeOnly: boolean) => ImportClause;
11741 /** @deprecated Use `factory.createExportDeclaration` or the factory supplied by your transformation context instead. */
11742 const createExportDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression | undefined, isTypeOnly?: any) => ExportDeclaration;
11743 /** @deprecated Use `factory.updateExportDeclaration` or the factory supplied by your transformation context instead. */
11744 const updateExportDeclaration: (node: ExportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, isTypeOnly: boolean) => ExportDeclaration;
11745 /** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */
11746 const createJSDocParamTag: (name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, comment?: string | undefined) => JSDocParameterTag;
11747 /** @deprecated Use `factory.createComma` or the factory supplied by your transformation context instead. */
11748 const createComma: (left: Expression, right: Expression) => Expression;
11749 /** @deprecated Use `factory.createLessThan` or the factory supplied by your transformation context instead. */
11750 const createLessThan: (left: Expression, right: Expression) => Expression;
11751 /** @deprecated Use `factory.createAssignment` or the factory supplied by your transformation context instead. */
11752 const createAssignment: (left: Expression, right: Expression) => BinaryExpression;
11753 /** @deprecated Use `factory.createStrictEquality` or the factory supplied by your transformation context instead. */
11754 const createStrictEquality: (left: Expression, right: Expression) => BinaryExpression;
11755 /** @deprecated Use `factory.createStrictInequality` or the factory supplied by your transformation context instead. */
11756 const createStrictInequality: (left: Expression, right: Expression) => BinaryExpression;
11757 /** @deprecated Use `factory.createAdd` or the factory supplied by your transformation context instead. */
11758 const createAdd: (left: Expression, right: Expression) => BinaryExpression;
11759 /** @deprecated Use `factory.createSubtract` or the factory supplied by your transformation context instead. */
11760 const createSubtract: (left: Expression, right: Expression) => BinaryExpression;
11761 /** @deprecated Use `factory.createLogicalAnd` or the factory supplied by your transformation context instead. */
11762 const createLogicalAnd: (left: Expression, right: Expression) => BinaryExpression;
11763 /** @deprecated Use `factory.createLogicalOr` or the factory supplied by your transformation context instead. */
11764 const createLogicalOr: (left: Expression, right: Expression) => BinaryExpression;
11765 /** @deprecated Use `factory.createPostfixIncrement` or the factory supplied by your transformation context instead. */
11766 const createPostfixIncrement: (operand: Expression) => PostfixUnaryExpression;
11767 /** @deprecated Use `factory.createLogicalNot` or the factory supplied by your transformation context instead. */
11768 const createLogicalNot: (operand: Expression) => PrefixUnaryExpression;
11769 /** @deprecated Use an appropriate `factory` method instead. */
11770 const createNode: (kind: SyntaxKind, pos?: any, end?: any) => Node;
11771 /**
11772 * Creates a shallow, memberwise clone of a node ~for mutation~ with its `pos`, `end`, and `parent` set.
11773 *
11774 * NOTE: It is unsafe to change any properties of a `Node` that relate to its AST children, as those changes won't be
11775 * captured with respect to transformations.
11776 *
11777 * @deprecated Use an appropriate `factory.update...` method instead, use `setCommentRange` or `setSourceMapRange`, and avoid setting `parent`.
11778 */
11779 const getMutableClone: <T extends Node>(node: T) => T;
11780}
11781declare namespace ts {
11782 /** @deprecated Use `isTypeAssertionExpression` instead. */
11783 const isTypeAssertion: (node: Node) => node is TypeAssertion;
11784}
11785declare namespace ts {
11786 /**
11787 * @deprecated Use `ts.ReadonlyESMap<K, V>` instead.
11788 */
11789 interface ReadonlyMap<T> extends ReadonlyESMap<string, T> {
11790 }
11791 /**
11792 * @deprecated Use `ts.ESMap<K, V>` instead.
11793 */
11794 interface Map<T> extends ESMap<string, T> {
11795 }
11796}
11797declare namespace ts {
11798 /**
11799 * @deprecated Use `isMemberName` instead.
11800 */
11801 const isIdentifierOrPrivateIdentifier: (node: Node) => node is MemberName;
11802}
11803declare namespace ts {
11804 interface NodeFactory {
11805 /** @deprecated Use the overload that accepts 'modifiers' */
11806 createConstructorTypeNode(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode;
11807 /** @deprecated Use the overload that accepts 'modifiers' */
11808 updateConstructorTypeNode(node: ConstructorTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode): ConstructorTypeNode;
11809 }
11810}
11811declare namespace ts {
11812 interface NodeFactory {
11813 createImportTypeNode(argument: TypeNode, assertions?: ImportTypeAssertionContainer, qualifier?: EntityName, typeArguments?: readonly TypeNode[], isTypeOf?: boolean): ImportTypeNode;
11814 /** @deprecated Use the overload that accepts 'assertions' */
11815 createImportTypeNode(argument: TypeNode, qualifier?: EntityName, typeArguments?: readonly TypeNode[], isTypeOf?: boolean): ImportTypeNode;
11816 /** @deprecated Use the overload that accepts 'assertions' */
11817 updateImportTypeNode(node: ImportTypeNode, argument: TypeNode, qualifier: EntityName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf?: boolean): ImportTypeNode;
11818 }
11819}
11820declare namespace ts {
11821 interface NodeFactory {
11822 /** @deprecated Use the overload that accepts 'modifiers' */
11823 createTypeParameterDeclaration(name: string | Identifier, constraint?: TypeNode, defaultType?: TypeNode): TypeParameterDeclaration;
11824 /** @deprecated Use the overload that accepts 'modifiers' */
11825 updateTypeParameterDeclaration(node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration;
11826 }
11827}
11828declare namespace ts {
11829 interface Node {
11830 /**
11831 * @deprecated `decorators` has been removed from `Node` and merged with `modifiers` on the `Node` subtypes that support them.
11832 * Use `ts.canHaveDecorators()` to test whether a `Node` can have decorators.
11833 * Use `ts.getDecorators()` to get the decorators of a `Node`.
11834 *
11835 * For example:
11836 * ```ts
11837 * const decorators = ts.canHaveDecorators(node) ? ts.getDecorators(node) : undefined;
11838 * ```
11839 */
11840 readonly decorators?: undefined;
11841 /**
11842 * @deprecated `modifiers` has been removed from `Node` and moved to the `Node` subtypes that support them.
11843 * Use `ts.canHaveModifiers()` to test whether a `Node` can have modifiers.
11844 * Use `ts.getModifiers()` to get the modifiers of a `Node`.
11845 *
11846 * For example:
11847 * ```ts
11848 * const modifiers = ts.canHaveModifiers(node) ? ts.getModifiers(node) : undefined;
11849 * ```
11850 */
11851 readonly modifiers?: NodeArray<ModifierLike> | undefined;
11852 }
11853 interface PropertySignature {
11854 /** @deprecated A property signature cannot have an initializer */
11855 readonly initializer?: Expression | undefined;
11856 }
11857 interface PropertyAssignment {
11858 /** @deprecated A property assignment cannot have a question token */
11859 readonly questionToken?: QuestionToken | undefined;
11860 /** @deprecated A property assignment cannot have an exclamation token */
11861 readonly exclamationToken?: ExclamationToken | undefined;
11862 }
11863 interface ShorthandPropertyAssignment {
11864 /** @deprecated A shorthand property assignment cannot have modifiers */
11865 readonly modifiers?: NodeArray<Modifier> | undefined;
11866 /** @deprecated A shorthand property assignment cannot have a question token */
11867 readonly questionToken?: QuestionToken | undefined;
11868 /** @deprecated A shorthand property assignment cannot have an exclamation token */
11869 readonly exclamationToken?: ExclamationToken | undefined;
11870 }
11871 interface FunctionTypeNode {
11872 /** @deprecated A function type cannot have modifiers */
11873 readonly modifiers?: NodeArray<Modifier> | undefined;
11874 }
11875 interface NodeFactory {
11876 /**
11877 * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter.
11878 */
11879 createParameterDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken?: QuestionToken, type?: TypeNode, initializer?: Expression): ParameterDeclaration;
11880 /**
11881 * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter.
11882 */
11883 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;
11884 /**
11885 * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter.
11886 */
11887 createPropertyDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
11888 /**
11889 * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter.
11890 */
11891 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;
11892 /**
11893 * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter.
11894 */
11895 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;
11896 /**
11897 * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter.
11898 */
11899 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;
11900 /**
11901 * @deprecated This node does not support Decorators. Callers should use an overload that does not accept a `decorators` parameter.
11902 */
11903 createConstructorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
11904 /**
11905 * @deprecated This node does not support Decorators. Callers should use an overload that does not accept a `decorators` parameter.
11906 */
11907 updateConstructorDeclaration(node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
11908 /**
11909 * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter.
11910 */
11911 createGetAccessorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
11912 /**
11913 * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter.
11914 */
11915 updateGetAccessorDeclaration(node: GetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
11916 /**
11917 * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter.
11918 */
11919 createSetAccessorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration;
11920 /**
11921 * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter.
11922 */
11923 updateSetAccessorDeclaration(node: SetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration;
11924 /**
11925 * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter.
11926 */
11927 createIndexSignature(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration;
11928 /**
11929 * @deprecated Decorators and modifiers are no longer supported for this function. Callers should use an overload that does not accept the `decorators` and `modifiers` parameters.
11930 */
11931 updateIndexSignature(node: IndexSignatureDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration;
11932 /**
11933 * @deprecated Decorators and modifiers are no longer supported for this function. Callers should use an overload that does not accept the `decorators` and `modifiers` parameters.
11934 */
11935 createClassStaticBlockDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, body: Block): ClassStaticBlockDeclaration;
11936 /**
11937 * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter.
11938 */
11939 updateClassStaticBlockDeclaration(node: ClassStaticBlockDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, body: Block): ClassStaticBlockDeclaration;
11940 /**
11941 * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter.
11942 */
11943 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;
11944 /**
11945 * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter.
11946 */
11947 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;
11948 /**
11949 * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter.
11950 */
11951 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;
11952 /**
11953 * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter.
11954 */
11955 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;
11956 /**
11957 * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter.
11958 */
11959 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;
11960 /**
11961 * @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter.
11962 */
11963 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;
11964 /**
11965 * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter.
11966 */
11967 createInterfaceDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
11968 /**
11969 * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter.
11970 */
11971 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;
11972 /**
11973 * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter.
11974 */
11975 createTypeAliasDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
11976 /**
11977 * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter.
11978 */
11979 updateTypeAliasDeclaration(node: TypeAliasDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
11980 /**
11981 * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter.
11982 */
11983 createEnumDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration;
11984 /**
11985 * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter.
11986 */
11987 updateEnumDeclaration(node: EnumDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration;
11988 /**
11989 * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter.
11990 */
11991 createModuleDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration;
11992 /**
11993 * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter.
11994 */
11995 updateModuleDeclaration(node: ModuleDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration;
11996 /**
11997 * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter.
11998 */
11999 createImportEqualsDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration;
12000 /**
12001 * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter.
12002 */
12003 updateImportEqualsDeclaration(node: ImportEqualsDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration;
12004 /**
12005 * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter.
12006 */
12007 createImportDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause?: AssertClause): ImportDeclaration;
12008 /**
12009 * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter.
12010 */
12011 updateImportDeclaration(node: ImportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration;
12012 /**
12013 * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter.
12014 */
12015 createExportAssignment(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment;
12016 /**
12017 * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter.
12018 */
12019 updateExportAssignment(node: ExportAssignment, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, expression: Expression): ExportAssignment;
12020 /**
12021 * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter.
12022 */
12023 createExportDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, assertClause?: AssertClause): ExportDeclaration;
12024 /**
12025 * @deprecated Decorators are no longer supported for this function. Callers should use an overload that does not accept a `decorators` parameter.
12026 */
12027 updateExportDeclaration(node: ExportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, assertClause: AssertClause | undefined): ExportDeclaration;
12028 }
12029}
12030
12031export = ts;
12032export as namespace ts;
\No newline at end of file