1/*! ***************************************************************************** 2Copyright (c) Microsoft Corporation. All rights reserved. 3Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4this file except in compliance with the License. You may obtain a copy of the 5License at http://www.apache.org/licenses/LICENSE-2.0 6 7THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10MERCHANTABLITY OR NON-INFRINGEMENT. 11 12See the Apache Version 2.0 License for specific language governing permissions 13and limitations under the License. 14***************************************************************************** */ 15 16declare namespace ts { 17 const versionMajorMinor = "4.2"; 18 /** The version of the TypeScript compiler release */ 19 const version: string; 20 /** 21 * Type of objects whose values are all of the same type. 22 * The `in` and `for-in` operators can *not* be safely used, 23 * since `Object.prototype` may be modified by outside code. 24 */ 25 interface MapLike<T> { 26 [index: string]: T; 27 } 28 interface SortedReadonlyArray<T> extends ReadonlyArray<T> { 29 " __sortedArrayBrand": any; 30 } 31 interface SortedArray<T> extends Array<T> { 32 " __sortedArrayBrand": any; 33 } 34 /** Common read methods for ES6 Map/Set. */ 35 interface ReadonlyCollection<K> { 36 readonly size: number; 37 has(key: K): boolean; 38 keys(): Iterator<K>; 39 } 40 /** Common write methods for ES6 Map/Set. */ 41 interface Collection<K> extends ReadonlyCollection<K> { 42 delete(key: K): boolean; 43 clear(): void; 44 } 45 /** ES6 Map interface, only read methods included. */ 46 interface ReadonlyESMap<K, V> extends ReadonlyCollection<K> { 47 get(key: K): V | undefined; 48 values(): Iterator<V>; 49 entries(): Iterator<[K, V]>; 50 forEach(action: (value: V, key: K) => void): void; 51 } 52 /** 53 * ES6 Map interface, only read methods included. 54 */ 55 interface ReadonlyMap<T> extends ReadonlyESMap<string, T> { 56 } 57 /** ES6 Map interface. */ 58 interface ESMap<K, V> extends ReadonlyESMap<K, V>, Collection<K> { 59 set(key: K, value: V): this; 60 } 61 /** 62 * ES6 Map interface. 63 */ 64 interface Map<T> extends ESMap<string, T> { 65 } 66 /** ES6 Set interface, only read methods included. */ 67 interface ReadonlySet<T> extends ReadonlyCollection<T> { 68 has(value: T): boolean; 69 values(): Iterator<T>; 70 entries(): Iterator<[T, T]>; 71 forEach(action: (value: T, key: T) => void): void; 72 } 73 /** ES6 Set interface. */ 74 interface Set<T> extends ReadonlySet<T>, Collection<T> { 75 add(value: T): this; 76 delete(value: T): boolean; 77 } 78 /** ES6 Iterator type. */ 79 interface Iterator<T> { 80 next(): { 81 value: T; 82 done?: false; 83 } | { 84 value: void; 85 done: true; 86 }; 87 } 88 /** Array that is only intended to be pushed to, never read. */ 89 interface Push<T> { 90 push(...values: T[]): void; 91 } 92} 93declare namespace ts { 94 export type Path = string & { 95 __pathBrand: any; 96 }; 97 export interface TextRange { 98 pos: number; 99 end: number; 100 } 101 export interface ReadonlyTextRange { 102 readonly pos: number; 103 readonly end: number; 104 } 105 export enum SyntaxKind { 106 Unknown = 0, 107 EndOfFileToken = 1, 108 SingleLineCommentTrivia = 2, 109 MultiLineCommentTrivia = 3, 110 NewLineTrivia = 4, 111 WhitespaceTrivia = 5, 112 ShebangTrivia = 6, 113 ConflictMarkerTrivia = 7, 114 NumericLiteral = 8, 115 BigIntLiteral = 9, 116 StringLiteral = 10, 117 JsxText = 11, 118 JsxTextAllWhiteSpaces = 12, 119 RegularExpressionLiteral = 13, 120 NoSubstitutionTemplateLiteral = 14, 121 TemplateHead = 15, 122 TemplateMiddle = 16, 123 TemplateTail = 17, 124 OpenBraceToken = 18, 125 CloseBraceToken = 19, 126 OpenParenToken = 20, 127 CloseParenToken = 21, 128 OpenBracketToken = 22, 129 CloseBracketToken = 23, 130 DotToken = 24, 131 DotDotDotToken = 25, 132 SemicolonToken = 26, 133 CommaToken = 27, 134 QuestionDotToken = 28, 135 LessThanToken = 29, 136 LessThanSlashToken = 30, 137 GreaterThanToken = 31, 138 LessThanEqualsToken = 32, 139 GreaterThanEqualsToken = 33, 140 EqualsEqualsToken = 34, 141 ExclamationEqualsToken = 35, 142 EqualsEqualsEqualsToken = 36, 143 ExclamationEqualsEqualsToken = 37, 144 EqualsGreaterThanToken = 38, 145 PlusToken = 39, 146 MinusToken = 40, 147 AsteriskToken = 41, 148 AsteriskAsteriskToken = 42, 149 SlashToken = 43, 150 PercentToken = 44, 151 PlusPlusToken = 45, 152 MinusMinusToken = 46, 153 LessThanLessThanToken = 47, 154 GreaterThanGreaterThanToken = 48, 155 GreaterThanGreaterThanGreaterThanToken = 49, 156 AmpersandToken = 50, 157 BarToken = 51, 158 CaretToken = 52, 159 ExclamationToken = 53, 160 TildeToken = 54, 161 AmpersandAmpersandToken = 55, 162 BarBarToken = 56, 163 QuestionToken = 57, 164 ColonToken = 58, 165 AtToken = 59, 166 QuestionQuestionToken = 60, 167 /** Only the JSDoc scanner produces BacktickToken. The normal scanner produces NoSubstitutionTemplateLiteral and related kinds. */ 168 BacktickToken = 61, 169 EqualsToken = 62, 170 PlusEqualsToken = 63, 171 MinusEqualsToken = 64, 172 AsteriskEqualsToken = 65, 173 AsteriskAsteriskEqualsToken = 66, 174 SlashEqualsToken = 67, 175 PercentEqualsToken = 68, 176 LessThanLessThanEqualsToken = 69, 177 GreaterThanGreaterThanEqualsToken = 70, 178 GreaterThanGreaterThanGreaterThanEqualsToken = 71, 179 AmpersandEqualsToken = 72, 180 BarEqualsToken = 73, 181 BarBarEqualsToken = 74, 182 AmpersandAmpersandEqualsToken = 75, 183 QuestionQuestionEqualsToken = 76, 184 CaretEqualsToken = 77, 185 Identifier = 78, 186 PrivateIdentifier = 79, 187 BreakKeyword = 80, 188 CaseKeyword = 81, 189 CatchKeyword = 82, 190 ClassKeyword = 83, 191 StructKeyword = 84, 192 ConstKeyword = 85, 193 ContinueKeyword = 86, 194 DebuggerKeyword = 87, 195 DefaultKeyword = 88, 196 DeleteKeyword = 89, 197 DoKeyword = 90, 198 ElseKeyword = 91, 199 EnumKeyword = 92, 200 ExportKeyword = 93, 201 ExtendsKeyword = 94, 202 FalseKeyword = 95, 203 FinallyKeyword = 96, 204 ForKeyword = 97, 205 FunctionKeyword = 98, 206 IfKeyword = 99, 207 ImportKeyword = 100, 208 InKeyword = 101, 209 InstanceOfKeyword = 102, 210 NewKeyword = 103, 211 NullKeyword = 104, 212 ReturnKeyword = 105, 213 SuperKeyword = 106, 214 SwitchKeyword = 107, 215 ThisKeyword = 108, 216 ThrowKeyword = 109, 217 TrueKeyword = 110, 218 TryKeyword = 111, 219 TypeOfKeyword = 112, 220 VarKeyword = 113, 221 VoidKeyword = 114, 222 WhileKeyword = 115, 223 WithKeyword = 116, 224 ImplementsKeyword = 117, 225 InterfaceKeyword = 118, 226 LetKeyword = 119, 227 PackageKeyword = 120, 228 PrivateKeyword = 121, 229 ProtectedKeyword = 122, 230 PublicKeyword = 123, 231 StaticKeyword = 124, 232 YieldKeyword = 125, 233 AbstractKeyword = 126, 234 AsKeyword = 127, 235 AssertsKeyword = 128, 236 AnyKeyword = 129, 237 AsyncKeyword = 130, 238 AwaitKeyword = 131, 239 BooleanKeyword = 132, 240 ConstructorKeyword = 133, 241 DeclareKeyword = 134, 242 GetKeyword = 135, 243 InferKeyword = 136, 244 IntrinsicKeyword = 137, 245 IsKeyword = 138, 246 KeyOfKeyword = 139, 247 ModuleKeyword = 140, 248 NamespaceKeyword = 141, 249 NeverKeyword = 142, 250 ReadonlyKeyword = 143, 251 RequireKeyword = 144, 252 NumberKeyword = 145, 253 ObjectKeyword = 146, 254 SetKeyword = 147, 255 StringKeyword = 148, 256 SymbolKeyword = 149, 257 TypeKeyword = 150, 258 UndefinedKeyword = 151, 259 UniqueKeyword = 152, 260 UnknownKeyword = 153, 261 FromKeyword = 154, 262 GlobalKeyword = 155, 263 BigIntKeyword = 156, 264 OfKeyword = 157, 265 QualifiedName = 158, 266 ComputedPropertyName = 159, 267 TypeParameter = 160, 268 Parameter = 161, 269 Decorator = 162, 270 PropertySignature = 163, 271 PropertyDeclaration = 164, 272 MethodSignature = 165, 273 MethodDeclaration = 166, 274 Constructor = 167, 275 GetAccessor = 168, 276 SetAccessor = 169, 277 CallSignature = 170, 278 ConstructSignature = 171, 279 IndexSignature = 172, 280 TypePredicate = 173, 281 TypeReference = 174, 282 FunctionType = 175, 283 ConstructorType = 176, 284 TypeQuery = 177, 285 TypeLiteral = 178, 286 ArrayType = 179, 287 TupleType = 180, 288 OptionalType = 181, 289 RestType = 182, 290 UnionType = 183, 291 IntersectionType = 184, 292 ConditionalType = 185, 293 InferType = 186, 294 ParenthesizedType = 187, 295 ThisType = 188, 296 TypeOperator = 189, 297 IndexedAccessType = 190, 298 MappedType = 191, 299 LiteralType = 192, 300 NamedTupleMember = 193, 301 TemplateLiteralType = 194, 302 TemplateLiteralTypeSpan = 195, 303 ImportType = 196, 304 ObjectBindingPattern = 197, 305 ArrayBindingPattern = 198, 306 BindingElement = 199, 307 ArrayLiteralExpression = 200, 308 ObjectLiteralExpression = 201, 309 PropertyAccessExpression = 202, 310 ElementAccessExpression = 203, 311 CallExpression = 204, 312 NewExpression = 205, 313 TaggedTemplateExpression = 206, 314 TypeAssertionExpression = 207, 315 ParenthesizedExpression = 208, 316 FunctionExpression = 209, 317 ArrowFunction = 210, 318 EtsComponentExpression = 211, 319 DeleteExpression = 212, 320 TypeOfExpression = 213, 321 VoidExpression = 214, 322 AwaitExpression = 215, 323 PrefixUnaryExpression = 216, 324 PostfixUnaryExpression = 217, 325 BinaryExpression = 218, 326 ConditionalExpression = 219, 327 TemplateExpression = 220, 328 YieldExpression = 221, 329 SpreadElement = 222, 330 ClassExpression = 223, 331 OmittedExpression = 224, 332 ExpressionWithTypeArguments = 225, 333 AsExpression = 226, 334 NonNullExpression = 227, 335 MetaProperty = 228, 336 SyntheticExpression = 229, 337 TemplateSpan = 230, 338 SemicolonClassElement = 231, 339 Block = 232, 340 EmptyStatement = 233, 341 VariableStatement = 234, 342 ExpressionStatement = 235, 343 IfStatement = 236, 344 DoStatement = 237, 345 WhileStatement = 238, 346 ForStatement = 239, 347 ForInStatement = 240, 348 ForOfStatement = 241, 349 ContinueStatement = 242, 350 BreakStatement = 243, 351 ReturnStatement = 244, 352 WithStatement = 245, 353 SwitchStatement = 246, 354 LabeledStatement = 247, 355 ThrowStatement = 248, 356 TryStatement = 249, 357 DebuggerStatement = 250, 358 VariableDeclaration = 251, 359 VariableDeclarationList = 252, 360 FunctionDeclaration = 253, 361 ClassDeclaration = 254, 362 StructDeclaration = 255, 363 InterfaceDeclaration = 256, 364 TypeAliasDeclaration = 257, 365 EnumDeclaration = 258, 366 ModuleDeclaration = 259, 367 ModuleBlock = 260, 368 CaseBlock = 261, 369 NamespaceExportDeclaration = 262, 370 ImportEqualsDeclaration = 263, 371 ImportDeclaration = 264, 372 ImportClause = 265, 373 NamespaceImport = 266, 374 NamedImports = 267, 375 ImportSpecifier = 268, 376 ExportAssignment = 269, 377 ExportDeclaration = 270, 378 NamedExports = 271, 379 NamespaceExport = 272, 380 ExportSpecifier = 273, 381 MissingDeclaration = 274, 382 ExternalModuleReference = 275, 383 JsxElement = 276, 384 JsxSelfClosingElement = 277, 385 JsxOpeningElement = 278, 386 JsxClosingElement = 279, 387 JsxFragment = 280, 388 JsxOpeningFragment = 281, 389 JsxClosingFragment = 282, 390 JsxAttribute = 283, 391 JsxAttributes = 284, 392 JsxSpreadAttribute = 285, 393 JsxExpression = 286, 394 CaseClause = 287, 395 DefaultClause = 288, 396 HeritageClause = 289, 397 CatchClause = 290, 398 PropertyAssignment = 291, 399 ShorthandPropertyAssignment = 292, 400 SpreadAssignment = 293, 401 EnumMember = 294, 402 UnparsedPrologue = 295, 403 UnparsedPrepend = 296, 404 UnparsedText = 297, 405 UnparsedInternalText = 298, 406 UnparsedSyntheticReference = 299, 407 SourceFile = 300, 408 Bundle = 301, 409 UnparsedSource = 302, 410 InputFiles = 303, 411 JSDocTypeExpression = 304, 412 JSDocNameReference = 305, 413 JSDocAllType = 306, 414 JSDocUnknownType = 307, 415 JSDocNullableType = 308, 416 JSDocNonNullableType = 309, 417 JSDocOptionalType = 310, 418 JSDocFunctionType = 311, 419 JSDocVariadicType = 312, 420 JSDocNamepathType = 313, 421 JSDocComment = 314, 422 JSDocTypeLiteral = 315, 423 JSDocSignature = 316, 424 JSDocTag = 317, 425 JSDocAugmentsTag = 318, 426 JSDocImplementsTag = 319, 427 JSDocAuthorTag = 320, 428 JSDocDeprecatedTag = 321, 429 JSDocClassTag = 322, 430 JSDocPublicTag = 323, 431 JSDocPrivateTag = 324, 432 JSDocProtectedTag = 325, 433 JSDocReadonlyTag = 326, 434 JSDocCallbackTag = 327, 435 JSDocEnumTag = 328, 436 JSDocParameterTag = 329, 437 JSDocReturnTag = 330, 438 JSDocThisTag = 331, 439 JSDocTypeTag = 332, 440 JSDocTemplateTag = 333, 441 JSDocTypedefTag = 334, 442 JSDocSeeTag = 335, 443 JSDocPropertyTag = 336, 444 SyntaxList = 337, 445 NotEmittedStatement = 338, 446 PartiallyEmittedExpression = 339, 447 CommaListExpression = 340, 448 MergeDeclarationMarker = 341, 449 EndOfDeclarationMarker = 342, 450 SyntheticReferenceExpression = 343, 451 Count = 344, 452 FirstAssignment = 62, 453 LastAssignment = 77, 454 FirstCompoundAssignment = 63, 455 LastCompoundAssignment = 77, 456 FirstReservedWord = 80, 457 LastReservedWord = 116, 458 FirstKeyword = 80, 459 LastKeyword = 157, 460 FirstFutureReservedWord = 117, 461 LastFutureReservedWord = 125, 462 FirstTypeNode = 173, 463 LastTypeNode = 196, 464 FirstPunctuation = 18, 465 LastPunctuation = 77, 466 FirstToken = 0, 467 LastToken = 157, 468 FirstTriviaToken = 2, 469 LastTriviaToken = 7, 470 FirstLiteralToken = 8, 471 LastLiteralToken = 14, 472 FirstTemplateToken = 14, 473 LastTemplateToken = 17, 474 FirstBinaryOperator = 29, 475 LastBinaryOperator = 77, 476 FirstStatement = 234, 477 LastStatement = 250, 478 FirstNode = 158, 479 FirstJSDocNode = 304, 480 LastJSDocNode = 336, 481 FirstJSDocTagNode = 317, 482 LastJSDocTagNode = 336, 483 } 484 export type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; 485 export type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral; 486 export type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail; 487 export type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken; 488 export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.StructKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword; 489 export type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.StaticKeyword; 490 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; 491 export type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind; 492 export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; 493 export type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind; 494 export enum NodeFlags { 495 None = 0, 496 Let = 1, 497 Const = 2, 498 NestedNamespace = 4, 499 Synthesized = 8, 500 Namespace = 16, 501 OptionalChain = 32, 502 ExportContext = 64, 503 ContainsThis = 128, 504 HasImplicitReturn = 256, 505 HasExplicitReturn = 512, 506 GlobalAugmentation = 1024, 507 HasAsyncFunctions = 2048, 508 DisallowInContext = 4096, 509 YieldContext = 8192, 510 DecoratorContext = 16384, 511 AwaitContext = 32768, 512 ThisNodeHasError = 65536, 513 JavaScriptFile = 131072, 514 ThisNodeOrAnySubNodesHasError = 262144, 515 HasAggregatedChildData = 524288, 516 JSDoc = 4194304, 517 JsonFile = 33554432, 518 StructContext = 268435456, 519 EtsComponentsContext = 536870912, 520 EtsExtendComponentsContext = 1073741824, 521 BlockScoped = 3, 522 ReachabilityCheckFlags = 768, 523 ReachabilityAndEmitFlags = 2816, 524 ContextFlags = 1904406528, 525 TypeExcludesFlags = 40960, 526 } 527 export enum ModifierFlags { 528 None = 0, 529 Export = 1, 530 Ambient = 2, 531 Public = 4, 532 Private = 8, 533 Protected = 16, 534 Static = 32, 535 Readonly = 64, 536 Abstract = 128, 537 Async = 256, 538 Default = 512, 539 Const = 2048, 540 HasComputedJSDocModifiers = 4096, 541 Deprecated = 8192, 542 HasComputedFlags = 536870912, 543 AccessibilityModifier = 28, 544 ParameterPropertyModifier = 92, 545 NonPublicAccessibilityModifier = 24, 546 TypeScriptModifier = 2270, 547 ExportDefault = 513, 548 All = 11263 549 } 550 export enum JsxFlags { 551 None = 0, 552 /** An element from a named property of the JSX.IntrinsicElements interface */ 553 IntrinsicNamedElement = 1, 554 /** An element inferred from the string index signature of the JSX.IntrinsicElements interface */ 555 IntrinsicIndexedElement = 2, 556 IntrinsicElement = 3 557 } 558 export interface Node extends ReadonlyTextRange { 559 readonly kind: SyntaxKind; 560 readonly flags: NodeFlags; 561 readonly decorators?: NodeArray<Decorator>; 562 readonly modifiers?: ModifiersArray; 563 readonly parent: Node; 564 } 565 export interface JSDocContainer { 566 } 567 export type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | LabeledStatement | ExpressionStatement | VariableStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | EndOfFileToken; 568 export type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType; 569 export type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement; 570 export type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute; 571 export type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertySignature | PropertyDeclaration | PropertyAssignment | EnumMember; 572 export interface NodeArray<T extends Node> extends ReadonlyArray<T>, ReadonlyTextRange { 573 hasTrailingComma?: boolean; 574 } 575 export interface Token<TKind extends SyntaxKind> extends Node { 576 readonly kind: TKind; 577 } 578 export type EndOfFileToken = Token<SyntaxKind.EndOfFileToken> & JSDocContainer; 579 export interface PunctuationToken<TKind extends PunctuationSyntaxKind> extends Token<TKind> { 580 } 581 export type DotToken = PunctuationToken<SyntaxKind.DotToken>; 582 export type DotDotDotToken = PunctuationToken<SyntaxKind.DotDotDotToken>; 583 export type QuestionToken = PunctuationToken<SyntaxKind.QuestionToken>; 584 export type ExclamationToken = PunctuationToken<SyntaxKind.ExclamationToken>; 585 export type ColonToken = PunctuationToken<SyntaxKind.ColonToken>; 586 export type EqualsToken = PunctuationToken<SyntaxKind.EqualsToken>; 587 export type AsteriskToken = PunctuationToken<SyntaxKind.AsteriskToken>; 588 export type EqualsGreaterThanToken = PunctuationToken<SyntaxKind.EqualsGreaterThanToken>; 589 export type PlusToken = PunctuationToken<SyntaxKind.PlusToken>; 590 export type MinusToken = PunctuationToken<SyntaxKind.MinusToken>; 591 export type QuestionDotToken = PunctuationToken<SyntaxKind.QuestionDotToken>; 592 export interface KeywordToken<TKind extends KeywordSyntaxKind> extends Token<TKind> { 593 } 594 export type AssertsKeyword = KeywordToken<SyntaxKind.AssertsKeyword>; 595 export type AwaitKeyword = KeywordToken<SyntaxKind.AwaitKeyword>; 596 /** @deprecated Use `AwaitKeyword` instead. */ 597 export type AwaitKeywordToken = AwaitKeyword; 598 /** @deprecated Use `AssertsKeyword` instead. */ 599 export type AssertsToken = AssertsKeyword; 600 export interface ModifierToken<TKind extends ModifierSyntaxKind> extends KeywordToken<TKind> { 601 } 602 export type AbstractKeyword = ModifierToken<SyntaxKind.AbstractKeyword>; 603 export type AsyncKeyword = ModifierToken<SyntaxKind.AsyncKeyword>; 604 export type ConstKeyword = ModifierToken<SyntaxKind.ConstKeyword>; 605 export type DeclareKeyword = ModifierToken<SyntaxKind.DeclareKeyword>; 606 export type DefaultKeyword = ModifierToken<SyntaxKind.DefaultKeyword>; 607 export type ExportKeyword = ModifierToken<SyntaxKind.ExportKeyword>; 608 export type PrivateKeyword = ModifierToken<SyntaxKind.PrivateKeyword>; 609 export type ProtectedKeyword = ModifierToken<SyntaxKind.ProtectedKeyword>; 610 export type PublicKeyword = ModifierToken<SyntaxKind.PublicKeyword>; 611 export type ReadonlyKeyword = ModifierToken<SyntaxKind.ReadonlyKeyword>; 612 export type StaticKeyword = ModifierToken<SyntaxKind.StaticKeyword>; 613 /** @deprecated Use `ReadonlyKeyword` instead. */ 614 export type ReadonlyToken = ReadonlyKeyword; 615 export type Modifier = AbstractKeyword | AsyncKeyword | ConstKeyword | DeclareKeyword | DefaultKeyword | ExportKeyword | PrivateKeyword | ProtectedKeyword | PublicKeyword | ReadonlyKeyword | StaticKeyword; 616 export type AccessibilityModifier = PublicKeyword | PrivateKeyword | ProtectedKeyword; 617 export type ParameterPropertyModifier = AccessibilityModifier | ReadonlyKeyword; 618 export type ClassMemberModifier = AccessibilityModifier | ReadonlyKeyword | StaticKeyword; 619 export type ModifiersArray = NodeArray<Modifier>; 620 export enum GeneratedIdentifierFlags { 621 None = 0, 622 ReservedInNestedScopes = 8, 623 Optimistic = 16, 624 FileLevel = 32, 625 AllowNameSubstitution = 64 626 } 627 export interface Identifier extends PrimaryExpression, Declaration { 628 readonly kind: SyntaxKind.Identifier; 629 /** 630 * Prefer to use `id.unescapedText`. (Note: This is available only in services, not internally to the TypeScript compiler.) 631 * Text of identifier, but if the identifier begins with two underscores, this will begin with three. 632 */ 633 readonly escapedText: __String; 634 readonly originalKeywordKind?: SyntaxKind; 635 isInJSDocNamespace?: boolean; 636 } 637 export interface TransientIdentifier extends Identifier { 638 resolvedSymbol: Symbol; 639 } 640 export interface QualifiedName extends Node { 641 readonly kind: SyntaxKind.QualifiedName; 642 readonly left: EntityName; 643 readonly right: Identifier; 644 } 645 export type EntityName = Identifier | QualifiedName; 646 export type PropertyName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier; 647 export type DeclarationName = Identifier | PrivateIdentifier | StringLiteralLike | NumericLiteral | ComputedPropertyName | ElementAccessExpression | BindingPattern | EntityNameExpression; 648 export interface Declaration extends Node { 649 _declarationBrand: any; 650 } 651 export interface NamedDeclaration extends Declaration { 652 readonly name?: DeclarationName; 653 } 654 export interface DeclarationStatement extends NamedDeclaration, Statement { 655 readonly name?: Identifier | StringLiteral | NumericLiteral; 656 } 657 export interface ComputedPropertyName extends Node { 658 readonly kind: SyntaxKind.ComputedPropertyName; 659 readonly parent: Declaration; 660 readonly expression: Expression; 661 } 662 export interface PrivateIdentifier extends Node { 663 readonly kind: SyntaxKind.PrivateIdentifier; 664 readonly escapedText: __String; 665 } 666 export interface Decorator extends Node { 667 readonly kind: SyntaxKind.Decorator; 668 readonly parent: NamedDeclaration; 669 readonly expression: LeftHandSideExpression; 670 } 671 export interface TypeParameterDeclaration extends NamedDeclaration { 672 readonly kind: SyntaxKind.TypeParameter; 673 readonly parent: DeclarationWithTypeParameterChildren | InferTypeNode; 674 readonly name: Identifier; 675 /** Note: Consider calling `getEffectiveConstraintOfTypeParameter` */ 676 readonly constraint?: TypeNode; 677 readonly default?: TypeNode; 678 expression?: Expression; 679 } 680 export interface SignatureDeclarationBase extends NamedDeclaration, JSDocContainer { 681 readonly kind: SignatureDeclaration["kind"]; 682 readonly name?: PropertyName; 683 readonly typeParameters?: NodeArray<TypeParameterDeclaration>; 684 readonly parameters: NodeArray<ParameterDeclaration>; 685 readonly type?: TypeNode; 686 } 687 export type SignatureDeclaration = CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | AccessorDeclaration | FunctionExpression | ArrowFunction; 688 export interface CallSignatureDeclaration extends SignatureDeclarationBase, TypeElement { 689 readonly kind: SyntaxKind.CallSignature; 690 } 691 export interface ConstructSignatureDeclaration extends SignatureDeclarationBase, TypeElement { 692 readonly kind: SyntaxKind.ConstructSignature; 693 } 694 export type BindingName = Identifier | BindingPattern; 695 export interface VariableDeclaration extends NamedDeclaration { 696 readonly kind: SyntaxKind.VariableDeclaration; 697 readonly parent: VariableDeclarationList | CatchClause; 698 readonly name: BindingName; 699 readonly exclamationToken?: ExclamationToken; 700 readonly type?: TypeNode; 701 readonly initializer?: Expression; 702 } 703 export interface VariableDeclarationList extends Node { 704 readonly kind: SyntaxKind.VariableDeclarationList; 705 readonly parent: VariableStatement | ForStatement | ForOfStatement | ForInStatement; 706 readonly declarations: NodeArray<VariableDeclaration>; 707 } 708 export interface ParameterDeclaration extends NamedDeclaration, JSDocContainer { 709 readonly kind: SyntaxKind.Parameter; 710 readonly parent: SignatureDeclaration; 711 readonly dotDotDotToken?: DotDotDotToken; 712 readonly name: BindingName; 713 readonly questionToken?: QuestionToken; 714 readonly type?: TypeNode; 715 readonly initializer?: Expression; 716 } 717 export interface BindingElement extends NamedDeclaration { 718 readonly kind: SyntaxKind.BindingElement; 719 readonly parent: BindingPattern; 720 readonly propertyName?: PropertyName; 721 readonly dotDotDotToken?: DotDotDotToken; 722 readonly name: BindingName; 723 readonly initializer?: Expression; 724 } 725 export interface PropertySignature extends TypeElement, JSDocContainer { 726 readonly kind: SyntaxKind.PropertySignature; 727 readonly name: PropertyName; 728 readonly questionToken?: QuestionToken; 729 readonly type?: TypeNode; 730 initializer?: Expression; 731 } 732 export interface PropertyDeclaration extends ClassElement, JSDocContainer { 733 readonly kind: SyntaxKind.PropertyDeclaration; 734 readonly parent: ClassLikeDeclaration; 735 readonly name: PropertyName; 736 readonly questionToken?: QuestionToken; 737 readonly exclamationToken?: ExclamationToken; 738 readonly type?: TypeNode; 739 readonly initializer?: Expression; 740 } 741 export interface ObjectLiteralElement extends NamedDeclaration { 742 _objectLiteralBrand: any; 743 readonly name?: PropertyName; 744 } 745 /** Unlike ObjectLiteralElement, excludes JSXAttribute and JSXSpreadAttribute. */ 746 export type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | MethodDeclaration | AccessorDeclaration; 747 export interface PropertyAssignment extends ObjectLiteralElement, JSDocContainer { 748 readonly kind: SyntaxKind.PropertyAssignment; 749 readonly parent: ObjectLiteralExpression; 750 readonly name: PropertyName; 751 readonly questionToken?: QuestionToken; 752 readonly exclamationToken?: ExclamationToken; 753 readonly initializer: Expression; 754 } 755 export interface ShorthandPropertyAssignment extends ObjectLiteralElement, JSDocContainer { 756 readonly kind: SyntaxKind.ShorthandPropertyAssignment; 757 readonly parent: ObjectLiteralExpression; 758 readonly name: Identifier; 759 readonly questionToken?: QuestionToken; 760 readonly exclamationToken?: ExclamationToken; 761 readonly equalsToken?: EqualsToken; 762 readonly objectAssignmentInitializer?: Expression; 763 } 764 export interface SpreadAssignment extends ObjectLiteralElement, JSDocContainer { 765 readonly kind: SyntaxKind.SpreadAssignment; 766 readonly parent: ObjectLiteralExpression; 767 readonly expression: Expression; 768 } 769 export type VariableLikeDeclaration = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | PropertyAssignment | PropertySignature | JsxAttribute | ShorthandPropertyAssignment | EnumMember | JSDocPropertyTag | JSDocParameterTag; 770 export interface PropertyLikeDeclaration extends NamedDeclaration { 771 readonly name: PropertyName; 772 } 773 export interface ObjectBindingPattern extends Node { 774 readonly kind: SyntaxKind.ObjectBindingPattern; 775 readonly parent: VariableDeclaration | ParameterDeclaration | BindingElement; 776 readonly elements: NodeArray<BindingElement>; 777 } 778 export interface ArrayBindingPattern extends Node { 779 readonly kind: SyntaxKind.ArrayBindingPattern; 780 readonly parent: VariableDeclaration | ParameterDeclaration | BindingElement; 781 readonly elements: NodeArray<ArrayBindingElement>; 782 } 783 export type BindingPattern = ObjectBindingPattern | ArrayBindingPattern; 784 export type ArrayBindingElement = BindingElement | OmittedExpression; 785 /** 786 * Several node kinds share function-like features such as a signature, 787 * a name, and a body. These nodes should extend FunctionLikeDeclarationBase. 788 * Examples: 789 * - FunctionDeclaration 790 * - MethodDeclaration 791 * - AccessorDeclaration 792 */ 793 export interface FunctionLikeDeclarationBase extends SignatureDeclarationBase { 794 _functionLikeDeclarationBrand: any; 795 readonly asteriskToken?: AsteriskToken; 796 readonly questionToken?: QuestionToken; 797 readonly exclamationToken?: ExclamationToken; 798 readonly body?: Block | Expression; 799 } 800 export type FunctionLikeDeclaration = FunctionDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ConstructorDeclaration | FunctionExpression | ArrowFunction; 801 /** @deprecated Use SignatureDeclaration */ 802 export type FunctionLike = SignatureDeclaration; 803 export interface FunctionDeclaration extends FunctionLikeDeclarationBase, DeclarationStatement { 804 readonly kind: SyntaxKind.FunctionDeclaration; 805 readonly name?: Identifier; 806 readonly body?: FunctionBody; 807 } 808 export interface MethodSignature extends SignatureDeclarationBase, TypeElement { 809 readonly kind: SyntaxKind.MethodSignature; 810 readonly parent: ObjectTypeDeclaration; 811 readonly name: PropertyName; 812 } 813 export interface MethodDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer { 814 readonly kind: SyntaxKind.MethodDeclaration; 815 readonly parent: ClassLikeDeclaration | ObjectLiteralExpression; 816 readonly name: PropertyName; 817 readonly body?: FunctionBody; 818 } 819 export interface ConstructorDeclaration extends FunctionLikeDeclarationBase, ClassElement, JSDocContainer { 820 readonly kind: SyntaxKind.Constructor; 821 readonly parent: ClassLikeDeclaration; 822 readonly body?: FunctionBody; 823 } 824 /** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */ 825 export interface SemicolonClassElement extends ClassElement { 826 readonly kind: SyntaxKind.SemicolonClassElement; 827 readonly parent: ClassLikeDeclaration; 828 } 829 export interface GetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer { 830 readonly kind: SyntaxKind.GetAccessor; 831 readonly parent: ClassLikeDeclaration | ObjectLiteralExpression; 832 readonly name: PropertyName; 833 readonly body?: FunctionBody; 834 } 835 export interface SetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer { 836 readonly kind: SyntaxKind.SetAccessor; 837 readonly parent: ClassLikeDeclaration | ObjectLiteralExpression; 838 readonly name: PropertyName; 839 readonly body?: FunctionBody; 840 } 841 export type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration; 842 export interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement { 843 readonly kind: SyntaxKind.IndexSignature; 844 readonly parent: ObjectTypeDeclaration; 845 readonly type: TypeNode; 846 } 847 export interface TypeNode extends Node { 848 _typeNodeBrand: any; 849 } 850 export interface KeywordTypeNode<TKind extends KeywordTypeSyntaxKind = KeywordTypeSyntaxKind> extends KeywordToken<TKind>, TypeNode { 851 readonly kind: TKind; 852 } 853 export interface ImportTypeNode extends NodeWithTypeArguments { 854 readonly kind: SyntaxKind.ImportType; 855 readonly isTypeOf: boolean; 856 readonly argument: TypeNode; 857 readonly qualifier?: EntityName; 858 } 859 export interface ThisTypeNode extends TypeNode { 860 readonly kind: SyntaxKind.ThisType; 861 } 862 export type FunctionOrConstructorTypeNode = FunctionTypeNode | ConstructorTypeNode; 863 export interface FunctionOrConstructorTypeNodeBase extends TypeNode, SignatureDeclarationBase { 864 readonly kind: SyntaxKind.FunctionType | SyntaxKind.ConstructorType; 865 readonly type: TypeNode; 866 } 867 export interface FunctionTypeNode extends FunctionOrConstructorTypeNodeBase { 868 readonly kind: SyntaxKind.FunctionType; 869 } 870 export interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase { 871 readonly kind: SyntaxKind.ConstructorType; 872 } 873 export interface NodeWithTypeArguments extends TypeNode { 874 readonly typeArguments?: NodeArray<TypeNode>; 875 } 876 export type TypeReferenceType = TypeReferenceNode | ExpressionWithTypeArguments; 877 export interface TypeReferenceNode extends NodeWithTypeArguments { 878 readonly kind: SyntaxKind.TypeReference; 879 readonly typeName: EntityName; 880 } 881 export interface TypePredicateNode extends TypeNode { 882 readonly kind: SyntaxKind.TypePredicate; 883 readonly parent: SignatureDeclaration | JSDocTypeExpression; 884 readonly assertsModifier?: AssertsToken; 885 readonly parameterName: Identifier | ThisTypeNode; 886 readonly type?: TypeNode; 887 } 888 export interface TypeQueryNode extends TypeNode { 889 readonly kind: SyntaxKind.TypeQuery; 890 readonly exprName: EntityName; 891 } 892 export interface TypeLiteralNode extends TypeNode, Declaration { 893 readonly kind: SyntaxKind.TypeLiteral; 894 readonly members: NodeArray<TypeElement>; 895 } 896 export interface ArrayTypeNode extends TypeNode { 897 readonly kind: SyntaxKind.ArrayType; 898 readonly elementType: TypeNode; 899 } 900 export interface TupleTypeNode extends TypeNode { 901 readonly kind: SyntaxKind.TupleType; 902 readonly elements: NodeArray<TypeNode | NamedTupleMember>; 903 } 904 export interface NamedTupleMember extends TypeNode, JSDocContainer, Declaration { 905 readonly kind: SyntaxKind.NamedTupleMember; 906 readonly dotDotDotToken?: Token<SyntaxKind.DotDotDotToken>; 907 readonly name: Identifier; 908 readonly questionToken?: Token<SyntaxKind.QuestionToken>; 909 readonly type: TypeNode; 910 } 911 export interface OptionalTypeNode extends TypeNode { 912 readonly kind: SyntaxKind.OptionalType; 913 readonly type: TypeNode; 914 } 915 export interface RestTypeNode extends TypeNode { 916 readonly kind: SyntaxKind.RestType; 917 readonly type: TypeNode; 918 } 919 export type UnionOrIntersectionTypeNode = UnionTypeNode | IntersectionTypeNode; 920 export interface UnionTypeNode extends TypeNode { 921 readonly kind: SyntaxKind.UnionType; 922 readonly types: NodeArray<TypeNode>; 923 } 924 export interface IntersectionTypeNode extends TypeNode { 925 readonly kind: SyntaxKind.IntersectionType; 926 readonly types: NodeArray<TypeNode>; 927 } 928 export interface ConditionalTypeNode extends TypeNode { 929 readonly kind: SyntaxKind.ConditionalType; 930 readonly checkType: TypeNode; 931 readonly extendsType: TypeNode; 932 readonly trueType: TypeNode; 933 readonly falseType: TypeNode; 934 } 935 export interface InferTypeNode extends TypeNode { 936 readonly kind: SyntaxKind.InferType; 937 readonly typeParameter: TypeParameterDeclaration; 938 } 939 export interface ParenthesizedTypeNode extends TypeNode { 940 readonly kind: SyntaxKind.ParenthesizedType; 941 readonly type: TypeNode; 942 } 943 export interface TypeOperatorNode extends TypeNode { 944 readonly kind: SyntaxKind.TypeOperator; 945 readonly operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword; 946 readonly type: TypeNode; 947 } 948 export interface IndexedAccessTypeNode extends TypeNode { 949 readonly kind: SyntaxKind.IndexedAccessType; 950 readonly objectType: TypeNode; 951 readonly indexType: TypeNode; 952 } 953 export interface MappedTypeNode extends TypeNode, Declaration { 954 readonly kind: SyntaxKind.MappedType; 955 readonly readonlyToken?: ReadonlyToken | PlusToken | MinusToken; 956 readonly typeParameter: TypeParameterDeclaration; 957 readonly nameType?: TypeNode; 958 readonly questionToken?: QuestionToken | PlusToken | MinusToken; 959 readonly type?: TypeNode; 960 } 961 export interface LiteralTypeNode extends TypeNode { 962 readonly kind: SyntaxKind.LiteralType; 963 readonly literal: NullLiteral | BooleanLiteral | LiteralExpression | PrefixUnaryExpression; 964 } 965 export interface StringLiteral extends LiteralExpression, Declaration { 966 readonly kind: SyntaxKind.StringLiteral; 967 } 968 export type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral; 969 export type PropertyNameLiteral = Identifier | StringLiteralLike | NumericLiteral; 970 export interface TemplateLiteralTypeNode extends TypeNode { 971 kind: SyntaxKind.TemplateLiteralType; 972 readonly head: TemplateHead; 973 readonly templateSpans: NodeArray<TemplateLiteralTypeSpan>; 974 } 975 export interface TemplateLiteralTypeSpan extends TypeNode { 976 readonly kind: SyntaxKind.TemplateLiteralTypeSpan; 977 readonly parent: TemplateLiteralTypeNode; 978 readonly type: TypeNode; 979 readonly literal: TemplateMiddle | TemplateTail; 980 } 981 export interface Expression extends Node { 982 _expressionBrand: any; 983 } 984 export interface OmittedExpression extends Expression { 985 readonly kind: SyntaxKind.OmittedExpression; 986 } 987 export interface PartiallyEmittedExpression extends LeftHandSideExpression { 988 readonly kind: SyntaxKind.PartiallyEmittedExpression; 989 readonly expression: Expression; 990 } 991 export interface UnaryExpression extends Expression { 992 _unaryExpressionBrand: any; 993 } 994 /** Deprecated, please use UpdateExpression */ 995 export type IncrementExpression = UpdateExpression; 996 export interface UpdateExpression extends UnaryExpression { 997 _updateExpressionBrand: any; 998 } 999 export type PrefixUnaryOperator = SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.TildeToken | SyntaxKind.ExclamationToken; 1000 export interface PrefixUnaryExpression extends UpdateExpression { 1001 readonly kind: SyntaxKind.PrefixUnaryExpression; 1002 readonly operator: PrefixUnaryOperator; 1003 readonly operand: UnaryExpression; 1004 } 1005 export type PostfixUnaryOperator = SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken; 1006 export interface PostfixUnaryExpression extends UpdateExpression { 1007 readonly kind: SyntaxKind.PostfixUnaryExpression; 1008 readonly operand: LeftHandSideExpression; 1009 readonly operator: PostfixUnaryOperator; 1010 } 1011 export interface LeftHandSideExpression extends UpdateExpression { 1012 _leftHandSideExpressionBrand: any; 1013 } 1014 export interface MemberExpression extends LeftHandSideExpression { 1015 _memberExpressionBrand: any; 1016 } 1017 export interface PrimaryExpression extends MemberExpression { 1018 _primaryExpressionBrand: any; 1019 } 1020 export interface NullLiteral extends PrimaryExpression { 1021 readonly kind: SyntaxKind.NullKeyword; 1022 } 1023 export interface TrueLiteral extends PrimaryExpression { 1024 readonly kind: SyntaxKind.TrueKeyword; 1025 } 1026 export interface FalseLiteral extends PrimaryExpression { 1027 readonly kind: SyntaxKind.FalseKeyword; 1028 } 1029 export type BooleanLiteral = TrueLiteral | FalseLiteral; 1030 export interface ThisExpression extends PrimaryExpression { 1031 readonly kind: SyntaxKind.ThisKeyword; 1032 } 1033 export interface SuperExpression extends PrimaryExpression { 1034 readonly kind: SyntaxKind.SuperKeyword; 1035 } 1036 export interface ImportExpression extends PrimaryExpression { 1037 readonly kind: SyntaxKind.ImportKeyword; 1038 } 1039 export interface DeleteExpression extends UnaryExpression { 1040 readonly kind: SyntaxKind.DeleteExpression; 1041 readonly expression: UnaryExpression; 1042 } 1043 export interface TypeOfExpression extends UnaryExpression { 1044 readonly kind: SyntaxKind.TypeOfExpression; 1045 readonly expression: UnaryExpression; 1046 } 1047 export interface VoidExpression extends UnaryExpression { 1048 readonly kind: SyntaxKind.VoidExpression; 1049 readonly expression: UnaryExpression; 1050 } 1051 export interface AwaitExpression extends UnaryExpression { 1052 readonly kind: SyntaxKind.AwaitExpression; 1053 readonly expression: UnaryExpression; 1054 } 1055 export interface YieldExpression extends Expression { 1056 readonly kind: SyntaxKind.YieldExpression; 1057 readonly asteriskToken?: AsteriskToken; 1058 readonly expression?: Expression; 1059 } 1060 export interface SyntheticExpression extends Expression { 1061 readonly kind: SyntaxKind.SyntheticExpression; 1062 readonly isSpread: boolean; 1063 readonly type: Type; 1064 readonly tupleNameSource?: ParameterDeclaration | NamedTupleMember; 1065 } 1066 export type ExponentiationOperator = SyntaxKind.AsteriskAsteriskToken; 1067 export type MultiplicativeOperator = SyntaxKind.AsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken; 1068 export type MultiplicativeOperatorOrHigher = ExponentiationOperator | MultiplicativeOperator; 1069 export type AdditiveOperator = SyntaxKind.PlusToken | SyntaxKind.MinusToken; 1070 export type AdditiveOperatorOrHigher = MultiplicativeOperatorOrHigher | AdditiveOperator; 1071 export type ShiftOperator = SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken; 1072 export type ShiftOperatorOrHigher = AdditiveOperatorOrHigher | ShiftOperator; 1073 export type RelationalOperator = SyntaxKind.LessThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.InstanceOfKeyword | SyntaxKind.InKeyword; 1074 export type RelationalOperatorOrHigher = ShiftOperatorOrHigher | RelationalOperator; 1075 export type EqualityOperator = SyntaxKind.EqualsEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.ExclamationEqualsToken; 1076 export type EqualityOperatorOrHigher = RelationalOperatorOrHigher | EqualityOperator; 1077 export type BitwiseOperator = SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken; 1078 export type BitwiseOperatorOrHigher = EqualityOperatorOrHigher | BitwiseOperator; 1079 export type LogicalOperator = SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken; 1080 export type LogicalOperatorOrHigher = BitwiseOperatorOrHigher | LogicalOperator; 1081 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; 1082 export type AssignmentOperator = SyntaxKind.EqualsToken | CompoundAssignmentOperator; 1083 export type AssignmentOperatorOrHigher = SyntaxKind.QuestionQuestionToken | LogicalOperatorOrHigher | AssignmentOperator; 1084 export type BinaryOperator = AssignmentOperatorOrHigher | SyntaxKind.CommaToken; 1085 export type LogicalOrCoalescingAssignmentOperator = SyntaxKind.AmpersandAmpersandEqualsToken | SyntaxKind.BarBarEqualsToken | SyntaxKind.QuestionQuestionEqualsToken; 1086 export type BinaryOperatorToken = Token<BinaryOperator>; 1087 export interface BinaryExpression extends Expression, Declaration { 1088 readonly kind: SyntaxKind.BinaryExpression; 1089 readonly left: Expression; 1090 readonly operatorToken: BinaryOperatorToken; 1091 readonly right: Expression; 1092 } 1093 export type AssignmentOperatorToken = Token<AssignmentOperator>; 1094 export interface AssignmentExpression<TOperator extends AssignmentOperatorToken> extends BinaryExpression { 1095 readonly left: LeftHandSideExpression; 1096 readonly operatorToken: TOperator; 1097 } 1098 export interface ObjectDestructuringAssignment extends AssignmentExpression<EqualsToken> { 1099 readonly left: ObjectLiteralExpression; 1100 } 1101 export interface ArrayDestructuringAssignment extends AssignmentExpression<EqualsToken> { 1102 readonly left: ArrayLiteralExpression; 1103 } 1104 export type DestructuringAssignment = ObjectDestructuringAssignment | ArrayDestructuringAssignment; 1105 export type BindingOrAssignmentElement = VariableDeclaration | ParameterDeclaration | ObjectBindingOrAssignmentElement | ArrayBindingOrAssignmentElement; 1106 export type ObjectBindingOrAssignmentElement = BindingElement | PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment; 1107 export type ArrayBindingOrAssignmentElement = BindingElement | OmittedExpression | SpreadElement | ArrayLiteralExpression | ObjectLiteralExpression | AssignmentExpression<EqualsToken> | Identifier | PropertyAccessExpression | ElementAccessExpression; 1108 export type BindingOrAssignmentElementRestIndicator = DotDotDotToken | SpreadElement | SpreadAssignment; 1109 export type BindingOrAssignmentElementTarget = BindingOrAssignmentPattern | Identifier | PropertyAccessExpression | ElementAccessExpression | OmittedExpression; 1110 export type ObjectBindingOrAssignmentPattern = ObjectBindingPattern | ObjectLiteralExpression; 1111 export type ArrayBindingOrAssignmentPattern = ArrayBindingPattern | ArrayLiteralExpression; 1112 export type AssignmentPattern = ObjectLiteralExpression | ArrayLiteralExpression; 1113 export type BindingOrAssignmentPattern = ObjectBindingOrAssignmentPattern | ArrayBindingOrAssignmentPattern; 1114 export interface ConditionalExpression extends Expression { 1115 readonly kind: SyntaxKind.ConditionalExpression; 1116 readonly condition: Expression; 1117 readonly questionToken: QuestionToken; 1118 readonly whenTrue: Expression; 1119 readonly colonToken: ColonToken; 1120 readonly whenFalse: Expression; 1121 } 1122 export type FunctionBody = Block; 1123 export type ConciseBody = FunctionBody | Expression; 1124 export interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclarationBase, JSDocContainer { 1125 readonly kind: SyntaxKind.FunctionExpression; 1126 readonly name?: Identifier; 1127 readonly body: FunctionBody; 1128 } 1129 export interface EtsComponentExpression extends PrimaryExpression, Declaration { 1130 readonly kind: SyntaxKind.EtsComponentExpression; 1131 readonly expression: LeftHandSideExpression; 1132 readonly typeArguments?: NodeArray<TypeNode>; 1133 readonly arguments: NodeArray<Expression>; 1134 readonly body?: Block; 1135 } 1136 export interface ArrowFunction extends Expression, FunctionLikeDeclarationBase, JSDocContainer { 1137 readonly kind: SyntaxKind.ArrowFunction; 1138 readonly equalsGreaterThanToken: EqualsGreaterThanToken; 1139 readonly body: ConciseBody; 1140 readonly name: never; 1141 } 1142 export interface LiteralLikeNode extends Node { 1143 text: string; 1144 isUnterminated?: boolean; 1145 hasExtendedUnicodeEscape?: boolean; 1146 } 1147 export interface TemplateLiteralLikeNode extends LiteralLikeNode { 1148 rawText?: string; 1149 } 1150 export interface LiteralExpression extends LiteralLikeNode, PrimaryExpression { 1151 _literalExpressionBrand: any; 1152 } 1153 export interface RegularExpressionLiteral extends LiteralExpression { 1154 readonly kind: SyntaxKind.RegularExpressionLiteral; 1155 } 1156 export interface NoSubstitutionTemplateLiteral extends LiteralExpression, TemplateLiteralLikeNode, Declaration { 1157 readonly kind: SyntaxKind.NoSubstitutionTemplateLiteral; 1158 } 1159 export enum TokenFlags { 1160 None = 0, 1161 Scientific = 16, 1162 Octal = 32, 1163 HexSpecifier = 64, 1164 BinarySpecifier = 128, 1165 OctalSpecifier = 256, 1166 } 1167 export interface NumericLiteral extends LiteralExpression, Declaration { 1168 readonly kind: SyntaxKind.NumericLiteral; 1169 } 1170 export interface BigIntLiteral extends LiteralExpression { 1171 readonly kind: SyntaxKind.BigIntLiteral; 1172 } 1173 export type LiteralToken = NumericLiteral | BigIntLiteral | StringLiteral | JsxText | RegularExpressionLiteral | NoSubstitutionTemplateLiteral; 1174 export interface TemplateHead extends TemplateLiteralLikeNode { 1175 readonly kind: SyntaxKind.TemplateHead; 1176 readonly parent: TemplateExpression | TemplateLiteralTypeNode; 1177 } 1178 export interface TemplateMiddle extends TemplateLiteralLikeNode { 1179 readonly kind: SyntaxKind.TemplateMiddle; 1180 readonly parent: TemplateSpan | TemplateLiteralTypeSpan; 1181 } 1182 export interface TemplateTail extends TemplateLiteralLikeNode { 1183 readonly kind: SyntaxKind.TemplateTail; 1184 readonly parent: TemplateSpan | TemplateLiteralTypeSpan; 1185 } 1186 export type PseudoLiteralToken = TemplateHead | TemplateMiddle | TemplateTail; 1187 export type TemplateLiteralToken = NoSubstitutionTemplateLiteral | PseudoLiteralToken; 1188 export interface TemplateExpression extends PrimaryExpression { 1189 readonly kind: SyntaxKind.TemplateExpression; 1190 readonly head: TemplateHead; 1191 readonly templateSpans: NodeArray<TemplateSpan>; 1192 } 1193 export type TemplateLiteral = TemplateExpression | NoSubstitutionTemplateLiteral; 1194 export interface TemplateSpan extends Node { 1195 readonly kind: SyntaxKind.TemplateSpan; 1196 readonly parent: TemplateExpression; 1197 readonly expression: Expression; 1198 readonly literal: TemplateMiddle | TemplateTail; 1199 } 1200 export interface ParenthesizedExpression extends PrimaryExpression, JSDocContainer { 1201 readonly kind: SyntaxKind.ParenthesizedExpression; 1202 readonly expression: Expression; 1203 } 1204 export interface ArrayLiteralExpression extends PrimaryExpression { 1205 readonly kind: SyntaxKind.ArrayLiteralExpression; 1206 readonly elements: NodeArray<Expression>; 1207 } 1208 export interface SpreadElement extends Expression { 1209 readonly kind: SyntaxKind.SpreadElement; 1210 readonly parent: ArrayLiteralExpression | CallExpression | NewExpression; 1211 readonly expression: Expression; 1212 } 1213 /** 1214 * This interface is a base interface for ObjectLiteralExpression and JSXAttributes to extend from. JSXAttributes is similar to 1215 * ObjectLiteralExpression in that it contains array of properties; however, JSXAttributes' properties can only be 1216 * JSXAttribute or JSXSpreadAttribute. ObjectLiteralExpression, on the other hand, can only have properties of type 1217 * ObjectLiteralElement (e.g. PropertyAssignment, ShorthandPropertyAssignment etc.) 1218 */ 1219 export interface ObjectLiteralExpressionBase<T extends ObjectLiteralElement> extends PrimaryExpression, Declaration { 1220 readonly properties: NodeArray<T>; 1221 } 1222 export interface ObjectLiteralExpression extends ObjectLiteralExpressionBase<ObjectLiteralElementLike> { 1223 readonly kind: SyntaxKind.ObjectLiteralExpression; 1224 } 1225 export type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression; 1226 export type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression; 1227 export type AccessExpression = PropertyAccessExpression | ElementAccessExpression; 1228 export interface PropertyAccessExpression extends MemberExpression, NamedDeclaration { 1229 readonly kind: SyntaxKind.PropertyAccessExpression; 1230 readonly expression: LeftHandSideExpression; 1231 readonly questionDotToken?: QuestionDotToken; 1232 readonly name: Identifier | PrivateIdentifier; 1233 } 1234 export interface PropertyAccessChain extends PropertyAccessExpression { 1235 _optionalChainBrand: any; 1236 readonly name: Identifier | PrivateIdentifier; 1237 } 1238 export interface SuperPropertyAccessExpression extends PropertyAccessExpression { 1239 readonly expression: SuperExpression; 1240 } 1241 /** Brand for a PropertyAccessExpression which, like a QualifiedName, consists of a sequence of identifiers separated by dots. */ 1242 export interface PropertyAccessEntityNameExpression extends PropertyAccessExpression { 1243 _propertyAccessExpressionLikeQualifiedNameBrand?: any; 1244 readonly expression: EntityNameExpression; 1245 readonly name: Identifier; 1246 } 1247 export interface ElementAccessExpression extends MemberExpression { 1248 readonly kind: SyntaxKind.ElementAccessExpression; 1249 readonly expression: LeftHandSideExpression; 1250 readonly questionDotToken?: QuestionDotToken; 1251 readonly argumentExpression: Expression; 1252 } 1253 export interface ElementAccessChain extends ElementAccessExpression { 1254 _optionalChainBrand: any; 1255 } 1256 export interface SuperElementAccessExpression extends ElementAccessExpression { 1257 readonly expression: SuperExpression; 1258 } 1259 export type SuperProperty = SuperPropertyAccessExpression | SuperElementAccessExpression; 1260 export interface CallExpression extends LeftHandSideExpression, Declaration { 1261 readonly kind: SyntaxKind.CallExpression; 1262 readonly expression: LeftHandSideExpression; 1263 readonly questionDotToken?: QuestionDotToken; 1264 readonly typeArguments?: NodeArray<TypeNode>; 1265 readonly arguments: NodeArray<Expression>; 1266 } 1267 export interface CallChain extends CallExpression { 1268 _optionalChainBrand: any; 1269 } 1270 export type OptionalChain = PropertyAccessChain | ElementAccessChain | CallChain | NonNullChain; 1271 export interface SuperCall extends CallExpression { 1272 readonly expression: SuperExpression; 1273 } 1274 export interface ImportCall extends CallExpression { 1275 readonly expression: ImportExpression; 1276 } 1277 export interface ExpressionWithTypeArguments extends NodeWithTypeArguments { 1278 readonly kind: SyntaxKind.ExpressionWithTypeArguments; 1279 readonly parent: HeritageClause | JSDocAugmentsTag | JSDocImplementsTag; 1280 readonly expression: LeftHandSideExpression; 1281 } 1282 export interface NewExpression extends PrimaryExpression, Declaration { 1283 readonly kind: SyntaxKind.NewExpression; 1284 readonly expression: LeftHandSideExpression; 1285 readonly typeArguments?: NodeArray<TypeNode>; 1286 readonly arguments?: NodeArray<Expression>; 1287 } 1288 export interface TaggedTemplateExpression extends MemberExpression { 1289 readonly kind: SyntaxKind.TaggedTemplateExpression; 1290 readonly tag: LeftHandSideExpression; 1291 readonly typeArguments?: NodeArray<TypeNode>; 1292 readonly template: TemplateLiteral; 1293 } 1294 export type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression | Decorator | JsxOpeningLikeElement | EtsComponentExpression; 1295 export interface AsExpression extends Expression { 1296 readonly kind: SyntaxKind.AsExpression; 1297 readonly expression: Expression; 1298 readonly type: TypeNode; 1299 } 1300 export interface TypeAssertion extends UnaryExpression { 1301 readonly kind: SyntaxKind.TypeAssertionExpression; 1302 readonly type: TypeNode; 1303 readonly expression: UnaryExpression; 1304 } 1305 export type AssertionExpression = TypeAssertion | AsExpression; 1306 export interface NonNullExpression extends LeftHandSideExpression { 1307 readonly kind: SyntaxKind.NonNullExpression; 1308 readonly expression: Expression; 1309 } 1310 export interface NonNullChain extends NonNullExpression { 1311 _optionalChainBrand: any; 1312 } 1313 export interface MetaProperty extends PrimaryExpression { 1314 readonly kind: SyntaxKind.MetaProperty; 1315 readonly keywordToken: SyntaxKind.NewKeyword | SyntaxKind.ImportKeyword; 1316 readonly name: Identifier; 1317 } 1318 export interface JsxElement extends PrimaryExpression { 1319 readonly kind: SyntaxKind.JsxElement; 1320 readonly openingElement: JsxOpeningElement; 1321 readonly children: NodeArray<JsxChild>; 1322 readonly closingElement: JsxClosingElement; 1323 } 1324 export type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; 1325 export type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; 1326 export type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess; 1327 export interface JsxTagNamePropertyAccess extends PropertyAccessExpression { 1328 readonly expression: JsxTagNameExpression; 1329 } 1330 export interface JsxAttributes extends ObjectLiteralExpressionBase<JsxAttributeLike> { 1331 readonly kind: SyntaxKind.JsxAttributes; 1332 readonly parent: JsxOpeningLikeElement; 1333 } 1334 export interface JsxOpeningElement extends Expression { 1335 readonly kind: SyntaxKind.JsxOpeningElement; 1336 readonly parent: JsxElement; 1337 readonly tagName: JsxTagNameExpression; 1338 readonly typeArguments?: NodeArray<TypeNode>; 1339 readonly attributes: JsxAttributes; 1340 } 1341 export interface JsxSelfClosingElement extends PrimaryExpression { 1342 readonly kind: SyntaxKind.JsxSelfClosingElement; 1343 readonly tagName: JsxTagNameExpression; 1344 readonly typeArguments?: NodeArray<TypeNode>; 1345 readonly attributes: JsxAttributes; 1346 } 1347 export interface JsxFragment extends PrimaryExpression { 1348 readonly kind: SyntaxKind.JsxFragment; 1349 readonly openingFragment: JsxOpeningFragment; 1350 readonly children: NodeArray<JsxChild>; 1351 readonly closingFragment: JsxClosingFragment; 1352 } 1353 export interface JsxOpeningFragment extends Expression { 1354 readonly kind: SyntaxKind.JsxOpeningFragment; 1355 readonly parent: JsxFragment; 1356 } 1357 export interface JsxClosingFragment extends Expression { 1358 readonly kind: SyntaxKind.JsxClosingFragment; 1359 readonly parent: JsxFragment; 1360 } 1361 export interface JsxAttribute extends ObjectLiteralElement { 1362 readonly kind: SyntaxKind.JsxAttribute; 1363 readonly parent: JsxAttributes; 1364 readonly name: Identifier; 1365 readonly initializer?: StringLiteral | JsxExpression; 1366 } 1367 export interface JsxSpreadAttribute extends ObjectLiteralElement { 1368 readonly kind: SyntaxKind.JsxSpreadAttribute; 1369 readonly parent: JsxAttributes; 1370 readonly expression: Expression; 1371 } 1372 export interface JsxClosingElement extends Node { 1373 readonly kind: SyntaxKind.JsxClosingElement; 1374 readonly parent: JsxElement; 1375 readonly tagName: JsxTagNameExpression; 1376 } 1377 export interface JsxExpression extends Expression { 1378 readonly kind: SyntaxKind.JsxExpression; 1379 readonly parent: JsxElement | JsxAttributeLike; 1380 readonly dotDotDotToken?: Token<SyntaxKind.DotDotDotToken>; 1381 readonly expression?: Expression; 1382 } 1383 export interface JsxText extends LiteralLikeNode { 1384 readonly kind: SyntaxKind.JsxText; 1385 readonly parent: JsxElement; 1386 readonly containsOnlyTriviaWhiteSpaces: boolean; 1387 } 1388 export type JsxChild = JsxText | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment; 1389 export interface Statement extends Node { 1390 _statementBrand: any; 1391 } 1392 export interface NotEmittedStatement extends Statement { 1393 readonly kind: SyntaxKind.NotEmittedStatement; 1394 } 1395 /** 1396 * A list of comma-separated expressions. This node is only created by transformations. 1397 */ 1398 export interface CommaListExpression extends Expression { 1399 readonly kind: SyntaxKind.CommaListExpression; 1400 readonly elements: NodeArray<Expression>; 1401 } 1402 export interface EmptyStatement extends Statement { 1403 readonly kind: SyntaxKind.EmptyStatement; 1404 } 1405 export interface DebuggerStatement extends Statement { 1406 readonly kind: SyntaxKind.DebuggerStatement; 1407 } 1408 export interface MissingDeclaration extends DeclarationStatement { 1409 readonly kind: SyntaxKind.MissingDeclaration; 1410 readonly name?: Identifier; 1411 } 1412 export type BlockLike = SourceFile | Block | ModuleBlock | CaseOrDefaultClause; 1413 export interface Block extends Statement { 1414 readonly kind: SyntaxKind.Block; 1415 readonly statements: NodeArray<Statement>; 1416 } 1417 export interface VariableStatement extends Statement, JSDocContainer { 1418 readonly kind: SyntaxKind.VariableStatement; 1419 readonly declarationList: VariableDeclarationList; 1420 } 1421 export interface ExpressionStatement extends Statement, JSDocContainer { 1422 readonly kind: SyntaxKind.ExpressionStatement; 1423 readonly expression: Expression; 1424 } 1425 export interface IfStatement extends Statement { 1426 readonly kind: SyntaxKind.IfStatement; 1427 readonly expression: Expression; 1428 readonly thenStatement: Statement; 1429 readonly elseStatement?: Statement; 1430 } 1431 export interface IterationStatement extends Statement { 1432 readonly statement: Statement; 1433 } 1434 export interface DoStatement extends IterationStatement { 1435 readonly kind: SyntaxKind.DoStatement; 1436 readonly expression: Expression; 1437 } 1438 export interface WhileStatement extends IterationStatement { 1439 readonly kind: SyntaxKind.WhileStatement; 1440 readonly expression: Expression; 1441 } 1442 export type ForInitializer = VariableDeclarationList | Expression; 1443 export interface ForStatement extends IterationStatement { 1444 readonly kind: SyntaxKind.ForStatement; 1445 readonly initializer?: ForInitializer; 1446 readonly condition?: Expression; 1447 readonly incrementor?: Expression; 1448 } 1449 export type ForInOrOfStatement = ForInStatement | ForOfStatement; 1450 export interface ForInStatement extends IterationStatement { 1451 readonly kind: SyntaxKind.ForInStatement; 1452 readonly initializer: ForInitializer; 1453 readonly expression: Expression; 1454 } 1455 export interface ForOfStatement extends IterationStatement { 1456 readonly kind: SyntaxKind.ForOfStatement; 1457 readonly awaitModifier?: AwaitKeywordToken; 1458 readonly initializer: ForInitializer; 1459 readonly expression: Expression; 1460 } 1461 export interface BreakStatement extends Statement { 1462 readonly kind: SyntaxKind.BreakStatement; 1463 readonly label?: Identifier; 1464 } 1465 export interface ContinueStatement extends Statement { 1466 readonly kind: SyntaxKind.ContinueStatement; 1467 readonly label?: Identifier; 1468 } 1469 export type BreakOrContinueStatement = BreakStatement | ContinueStatement; 1470 export interface ReturnStatement extends Statement { 1471 readonly kind: SyntaxKind.ReturnStatement; 1472 readonly expression?: Expression; 1473 } 1474 export interface WithStatement extends Statement { 1475 readonly kind: SyntaxKind.WithStatement; 1476 readonly expression: Expression; 1477 readonly statement: Statement; 1478 } 1479 export interface SwitchStatement extends Statement { 1480 readonly kind: SyntaxKind.SwitchStatement; 1481 readonly expression: Expression; 1482 readonly caseBlock: CaseBlock; 1483 possiblyExhaustive?: boolean; 1484 } 1485 export interface CaseBlock extends Node { 1486 readonly kind: SyntaxKind.CaseBlock; 1487 readonly parent: SwitchStatement; 1488 readonly clauses: NodeArray<CaseOrDefaultClause>; 1489 } 1490 export interface CaseClause extends Node { 1491 readonly kind: SyntaxKind.CaseClause; 1492 readonly parent: CaseBlock; 1493 readonly expression: Expression; 1494 readonly statements: NodeArray<Statement>; 1495 } 1496 export interface DefaultClause extends Node { 1497 readonly kind: SyntaxKind.DefaultClause; 1498 readonly parent: CaseBlock; 1499 readonly statements: NodeArray<Statement>; 1500 } 1501 export type CaseOrDefaultClause = CaseClause | DefaultClause; 1502 export interface LabeledStatement extends Statement, JSDocContainer { 1503 readonly kind: SyntaxKind.LabeledStatement; 1504 readonly label: Identifier; 1505 readonly statement: Statement; 1506 } 1507 export interface ThrowStatement extends Statement { 1508 readonly kind: SyntaxKind.ThrowStatement; 1509 readonly expression: Expression; 1510 } 1511 export interface TryStatement extends Statement { 1512 readonly kind: SyntaxKind.TryStatement; 1513 readonly tryBlock: Block; 1514 readonly catchClause?: CatchClause; 1515 readonly finallyBlock?: Block; 1516 } 1517 export interface CatchClause extends Node { 1518 readonly kind: SyntaxKind.CatchClause; 1519 readonly parent: TryStatement; 1520 readonly variableDeclaration?: VariableDeclaration; 1521 readonly block: Block; 1522 } 1523 export type ObjectTypeDeclaration = ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode; 1524 export type DeclarationWithTypeParameters = DeclarationWithTypeParameterChildren | JSDocTypedefTag | JSDocCallbackTag | JSDocSignature; 1525 export type DeclarationWithTypeParameterChildren = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag; 1526 export interface ClassLikeDeclarationBase extends NamedDeclaration, JSDocContainer { 1527 readonly kind: SyntaxKind.ClassDeclaration | SyntaxKind.ClassExpression | SyntaxKind.StructDeclaration; 1528 readonly name?: Identifier; 1529 readonly typeParameters?: NodeArray<TypeParameterDeclaration>; 1530 readonly heritageClauses?: NodeArray<HeritageClause>; 1531 readonly members: NodeArray<ClassElement>; 1532 } 1533 export interface ClassDeclaration extends ClassLikeDeclarationBase, DeclarationStatement { 1534 readonly kind: SyntaxKind.ClassDeclaration; 1535 /** May be undefined in `export default class { ... }`. */ 1536 readonly name?: Identifier; 1537 } 1538 export interface StructDeclaration extends ClassLikeDeclarationBase, DeclarationStatement { 1539 readonly kind: SyntaxKind.StructDeclaration; 1540 /** May be undefined in `export default class { ... }`. */ 1541 readonly name?: Identifier; 1542 } 1543 export interface ClassExpression extends ClassLikeDeclarationBase, PrimaryExpression { 1544 readonly kind: SyntaxKind.ClassExpression; 1545 } 1546 export type ClassLikeDeclaration = ClassDeclaration | ClassExpression | StructDeclaration; 1547 export interface ClassElement extends NamedDeclaration { 1548 _classElementBrand: any; 1549 readonly name?: PropertyName; 1550 } 1551 export interface TypeElement extends NamedDeclaration { 1552 _typeElementBrand: any; 1553 readonly name?: PropertyName; 1554 readonly questionToken?: QuestionToken; 1555 } 1556 export interface InterfaceDeclaration extends DeclarationStatement, JSDocContainer { 1557 readonly kind: SyntaxKind.InterfaceDeclaration; 1558 readonly name: Identifier; 1559 readonly typeParameters?: NodeArray<TypeParameterDeclaration>; 1560 readonly heritageClauses?: NodeArray<HeritageClause>; 1561 readonly members: NodeArray<TypeElement>; 1562 } 1563 export interface HeritageClause extends Node { 1564 readonly kind: SyntaxKind.HeritageClause; 1565 readonly parent: InterfaceDeclaration | ClassLikeDeclaration; 1566 readonly token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword; 1567 readonly types: NodeArray<ExpressionWithTypeArguments>; 1568 } 1569 export interface TypeAliasDeclaration extends DeclarationStatement, JSDocContainer { 1570 readonly kind: SyntaxKind.TypeAliasDeclaration; 1571 readonly name: Identifier; 1572 readonly typeParameters?: NodeArray<TypeParameterDeclaration>; 1573 readonly type: TypeNode; 1574 } 1575 export interface EnumMember extends NamedDeclaration, JSDocContainer { 1576 readonly kind: SyntaxKind.EnumMember; 1577 readonly parent: EnumDeclaration; 1578 readonly name: PropertyName; 1579 readonly initializer?: Expression; 1580 } 1581 export interface EnumDeclaration extends DeclarationStatement, JSDocContainer { 1582 readonly kind: SyntaxKind.EnumDeclaration; 1583 readonly name: Identifier; 1584 readonly members: NodeArray<EnumMember>; 1585 } 1586 export type ModuleName = Identifier | StringLiteral; 1587 export type ModuleBody = NamespaceBody | JSDocNamespaceBody; 1588 export interface ModuleDeclaration extends DeclarationStatement, JSDocContainer { 1589 readonly kind: SyntaxKind.ModuleDeclaration; 1590 readonly parent: ModuleBody | SourceFile; 1591 readonly name: ModuleName; 1592 readonly body?: ModuleBody | JSDocNamespaceDeclaration; 1593 } 1594 export type NamespaceBody = ModuleBlock | NamespaceDeclaration; 1595 export interface NamespaceDeclaration extends ModuleDeclaration { 1596 readonly name: Identifier; 1597 readonly body: NamespaceBody; 1598 } 1599 export type JSDocNamespaceBody = Identifier | JSDocNamespaceDeclaration; 1600 export interface JSDocNamespaceDeclaration extends ModuleDeclaration { 1601 readonly name: Identifier; 1602 readonly body?: JSDocNamespaceBody; 1603 } 1604 export interface ModuleBlock extends Node, Statement { 1605 readonly kind: SyntaxKind.ModuleBlock; 1606 readonly parent: ModuleDeclaration; 1607 readonly statements: NodeArray<Statement>; 1608 } 1609 export type ModuleReference = EntityName | ExternalModuleReference; 1610 /** 1611 * One of: 1612 * - import x = require("mod"); 1613 * - import x = M.x; 1614 */ 1615 export interface ImportEqualsDeclaration extends DeclarationStatement, JSDocContainer { 1616 readonly kind: SyntaxKind.ImportEqualsDeclaration; 1617 readonly parent: SourceFile | ModuleBlock; 1618 readonly name: Identifier; 1619 readonly isTypeOnly: boolean; 1620 readonly moduleReference: ModuleReference; 1621 } 1622 export interface ExternalModuleReference extends Node { 1623 readonly kind: SyntaxKind.ExternalModuleReference; 1624 readonly parent: ImportEqualsDeclaration; 1625 readonly expression: Expression; 1626 } 1627 export interface ImportDeclaration extends Statement, JSDocContainer { 1628 readonly kind: SyntaxKind.ImportDeclaration; 1629 readonly parent: SourceFile | ModuleBlock; 1630 readonly importClause?: ImportClause; 1631 /** If this is not a StringLiteral it will be a grammar error. */ 1632 readonly moduleSpecifier: Expression; 1633 } 1634 export type NamedImportBindings = NamespaceImport | NamedImports; 1635 export type NamedExportBindings = NamespaceExport | NamedExports; 1636 export interface ImportClause extends NamedDeclaration { 1637 readonly kind: SyntaxKind.ImportClause; 1638 readonly parent: ImportDeclaration; 1639 readonly isTypeOnly: boolean; 1640 readonly name?: Identifier; 1641 readonly namedBindings?: NamedImportBindings; 1642 } 1643 export interface NamespaceImport extends NamedDeclaration { 1644 readonly kind: SyntaxKind.NamespaceImport; 1645 readonly parent: ImportClause; 1646 readonly name: Identifier; 1647 } 1648 export interface NamespaceExport extends NamedDeclaration { 1649 readonly kind: SyntaxKind.NamespaceExport; 1650 readonly parent: ExportDeclaration; 1651 readonly name: Identifier; 1652 } 1653 export interface NamespaceExportDeclaration extends DeclarationStatement, JSDocContainer { 1654 readonly kind: SyntaxKind.NamespaceExportDeclaration; 1655 readonly name: Identifier; 1656 } 1657 export interface ExportDeclaration extends DeclarationStatement, JSDocContainer { 1658 readonly kind: SyntaxKind.ExportDeclaration; 1659 readonly parent: SourceFile | ModuleBlock; 1660 readonly isTypeOnly: boolean; 1661 /** Will not be assigned in the case of `export * from "foo";` */ 1662 readonly exportClause?: NamedExportBindings; 1663 /** If this is not a StringLiteral it will be a grammar error. */ 1664 readonly moduleSpecifier?: Expression; 1665 } 1666 export interface NamedImports extends Node { 1667 readonly kind: SyntaxKind.NamedImports; 1668 readonly parent: ImportClause; 1669 readonly elements: NodeArray<ImportSpecifier>; 1670 } 1671 export interface NamedExports extends Node { 1672 readonly kind: SyntaxKind.NamedExports; 1673 readonly parent: ExportDeclaration; 1674 readonly elements: NodeArray<ExportSpecifier>; 1675 } 1676 export type NamedImportsOrExports = NamedImports | NamedExports; 1677 export interface ImportSpecifier extends NamedDeclaration { 1678 readonly kind: SyntaxKind.ImportSpecifier; 1679 readonly parent: NamedImports; 1680 readonly propertyName?: Identifier; 1681 readonly name: Identifier; 1682 } 1683 export interface ExportSpecifier extends NamedDeclaration { 1684 readonly kind: SyntaxKind.ExportSpecifier; 1685 readonly parent: NamedExports; 1686 readonly propertyName?: Identifier; 1687 readonly name: Identifier; 1688 } 1689 export type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier; 1690 export type TypeOnlyCompatibleAliasDeclaration = ImportClause | ImportEqualsDeclaration | NamespaceImport | ImportOrExportSpecifier; 1691 /** 1692 * This is either an `export =` or an `export default` declaration. 1693 * Unless `isExportEquals` is set, this node was parsed as an `export default`. 1694 */ 1695 export interface ExportAssignment extends DeclarationStatement, JSDocContainer { 1696 readonly kind: SyntaxKind.ExportAssignment; 1697 readonly parent: SourceFile; 1698 readonly isExportEquals?: boolean; 1699 readonly expression: Expression; 1700 } 1701 export interface FileReference extends TextRange { 1702 fileName: string; 1703 } 1704 export interface CheckJsDirective extends TextRange { 1705 enabled: boolean; 1706 } 1707 export type CommentKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia; 1708 export interface CommentRange extends TextRange { 1709 hasTrailingNewLine?: boolean; 1710 kind: CommentKind; 1711 } 1712 export interface SynthesizedComment extends CommentRange { 1713 text: string; 1714 pos: -1; 1715 end: -1; 1716 hasLeadingNewline?: boolean; 1717 } 1718 export interface JSDocTypeExpression extends TypeNode { 1719 readonly kind: SyntaxKind.JSDocTypeExpression; 1720 readonly type: TypeNode; 1721 } 1722 export interface JSDocNameReference extends Node { 1723 readonly kind: SyntaxKind.JSDocNameReference; 1724 readonly name: EntityName; 1725 } 1726 export interface JSDocType extends TypeNode { 1727 _jsDocTypeBrand: any; 1728 } 1729 export interface JSDocAllType extends JSDocType { 1730 readonly kind: SyntaxKind.JSDocAllType; 1731 } 1732 export interface JSDocUnknownType extends JSDocType { 1733 readonly kind: SyntaxKind.JSDocUnknownType; 1734 } 1735 export interface JSDocNonNullableType extends JSDocType { 1736 readonly kind: SyntaxKind.JSDocNonNullableType; 1737 readonly type: TypeNode; 1738 } 1739 export interface JSDocNullableType extends JSDocType { 1740 readonly kind: SyntaxKind.JSDocNullableType; 1741 readonly type: TypeNode; 1742 } 1743 export interface JSDocOptionalType extends JSDocType { 1744 readonly kind: SyntaxKind.JSDocOptionalType; 1745 readonly type: TypeNode; 1746 } 1747 export interface JSDocFunctionType extends JSDocType, SignatureDeclarationBase { 1748 readonly kind: SyntaxKind.JSDocFunctionType; 1749 } 1750 export interface JSDocVariadicType extends JSDocType { 1751 readonly kind: SyntaxKind.JSDocVariadicType; 1752 readonly type: TypeNode; 1753 } 1754 export interface JSDocNamepathType extends JSDocType { 1755 readonly kind: SyntaxKind.JSDocNamepathType; 1756 readonly type: TypeNode; 1757 } 1758 export type JSDocTypeReferencingNode = JSDocVariadicType | JSDocOptionalType | JSDocNullableType | JSDocNonNullableType; 1759 export interface JSDoc extends Node { 1760 readonly kind: SyntaxKind.JSDocComment; 1761 readonly parent: HasJSDoc; 1762 readonly tags?: NodeArray<JSDocTag>; 1763 readonly comment?: string; 1764 } 1765 export interface JSDocTag extends Node { 1766 readonly parent: JSDoc | JSDocTypeLiteral; 1767 readonly tagName: Identifier; 1768 readonly comment?: string; 1769 } 1770 export interface JSDocUnknownTag extends JSDocTag { 1771 readonly kind: SyntaxKind.JSDocTag; 1772 } 1773 /** 1774 * Note that `@extends` is a synonym of `@augments`. 1775 * Both tags are represented by this interface. 1776 */ 1777 export interface JSDocAugmentsTag extends JSDocTag { 1778 readonly kind: SyntaxKind.JSDocAugmentsTag; 1779 readonly class: ExpressionWithTypeArguments & { 1780 readonly expression: Identifier | PropertyAccessEntityNameExpression; 1781 }; 1782 } 1783 export interface JSDocImplementsTag extends JSDocTag { 1784 readonly kind: SyntaxKind.JSDocImplementsTag; 1785 readonly class: ExpressionWithTypeArguments & { 1786 readonly expression: Identifier | PropertyAccessEntityNameExpression; 1787 }; 1788 } 1789 export interface JSDocAuthorTag extends JSDocTag { 1790 readonly kind: SyntaxKind.JSDocAuthorTag; 1791 } 1792 export interface JSDocDeprecatedTag extends JSDocTag { 1793 kind: SyntaxKind.JSDocDeprecatedTag; 1794 } 1795 export interface JSDocClassTag extends JSDocTag { 1796 readonly kind: SyntaxKind.JSDocClassTag; 1797 } 1798 export interface JSDocPublicTag extends JSDocTag { 1799 readonly kind: SyntaxKind.JSDocPublicTag; 1800 } 1801 export interface JSDocPrivateTag extends JSDocTag { 1802 readonly kind: SyntaxKind.JSDocPrivateTag; 1803 } 1804 export interface JSDocProtectedTag extends JSDocTag { 1805 readonly kind: SyntaxKind.JSDocProtectedTag; 1806 } 1807 export interface JSDocReadonlyTag extends JSDocTag { 1808 readonly kind: SyntaxKind.JSDocReadonlyTag; 1809 } 1810 export interface JSDocEnumTag extends JSDocTag, Declaration { 1811 readonly kind: SyntaxKind.JSDocEnumTag; 1812 readonly parent: JSDoc; 1813 readonly typeExpression: JSDocTypeExpression; 1814 } 1815 export interface JSDocThisTag extends JSDocTag { 1816 readonly kind: SyntaxKind.JSDocThisTag; 1817 readonly typeExpression: JSDocTypeExpression; 1818 } 1819 export interface JSDocTemplateTag extends JSDocTag { 1820 readonly kind: SyntaxKind.JSDocTemplateTag; 1821 readonly constraint: JSDocTypeExpression | undefined; 1822 readonly typeParameters: NodeArray<TypeParameterDeclaration>; 1823 } 1824 export interface JSDocSeeTag extends JSDocTag { 1825 readonly kind: SyntaxKind.JSDocSeeTag; 1826 readonly name?: JSDocNameReference; 1827 } 1828 export interface JSDocReturnTag extends JSDocTag { 1829 readonly kind: SyntaxKind.JSDocReturnTag; 1830 readonly typeExpression?: JSDocTypeExpression; 1831 } 1832 export interface JSDocTypeTag extends JSDocTag { 1833 readonly kind: SyntaxKind.JSDocTypeTag; 1834 readonly typeExpression: JSDocTypeExpression; 1835 } 1836 export interface JSDocTypedefTag extends JSDocTag, NamedDeclaration { 1837 readonly kind: SyntaxKind.JSDocTypedefTag; 1838 readonly parent: JSDoc; 1839 readonly fullName?: JSDocNamespaceDeclaration | Identifier; 1840 readonly name?: Identifier; 1841 readonly typeExpression?: JSDocTypeExpression | JSDocTypeLiteral; 1842 } 1843 export interface JSDocCallbackTag extends JSDocTag, NamedDeclaration { 1844 readonly kind: SyntaxKind.JSDocCallbackTag; 1845 readonly parent: JSDoc; 1846 readonly fullName?: JSDocNamespaceDeclaration | Identifier; 1847 readonly name?: Identifier; 1848 readonly typeExpression: JSDocSignature; 1849 } 1850 export interface JSDocSignature extends JSDocType, Declaration { 1851 readonly kind: SyntaxKind.JSDocSignature; 1852 readonly typeParameters?: readonly JSDocTemplateTag[]; 1853 readonly parameters: readonly JSDocParameterTag[]; 1854 readonly type: JSDocReturnTag | undefined; 1855 } 1856 export interface JSDocPropertyLikeTag extends JSDocTag, Declaration { 1857 readonly parent: JSDoc; 1858 readonly name: EntityName; 1859 readonly typeExpression?: JSDocTypeExpression; 1860 /** Whether the property name came before the type -- non-standard for JSDoc, but Typescript-like */ 1861 readonly isNameFirst: boolean; 1862 readonly isBracketed: boolean; 1863 } 1864 export interface JSDocPropertyTag extends JSDocPropertyLikeTag { 1865 readonly kind: SyntaxKind.JSDocPropertyTag; 1866 } 1867 export interface JSDocParameterTag extends JSDocPropertyLikeTag { 1868 readonly kind: SyntaxKind.JSDocParameterTag; 1869 } 1870 export interface JSDocTypeLiteral extends JSDocType { 1871 readonly kind: SyntaxKind.JSDocTypeLiteral; 1872 readonly jsDocPropertyTags?: readonly JSDocPropertyLikeTag[]; 1873 /** If true, then this type literal represents an *array* of its type. */ 1874 readonly isArrayType: boolean; 1875 } 1876 export enum FlowFlags { 1877 Unreachable = 1, 1878 Start = 2, 1879 BranchLabel = 4, 1880 LoopLabel = 8, 1881 Assignment = 16, 1882 TrueCondition = 32, 1883 FalseCondition = 64, 1884 SwitchClause = 128, 1885 ArrayMutation = 256, 1886 Call = 512, 1887 ReduceLabel = 1024, 1888 Referenced = 2048, 1889 Shared = 4096, 1890 Label = 12, 1891 Condition = 96 1892 } 1893 export type FlowNode = FlowStart | FlowLabel | FlowAssignment | FlowCall | FlowCondition | FlowSwitchClause | FlowArrayMutation | FlowCall | FlowReduceLabel; 1894 export interface FlowNodeBase { 1895 flags: FlowFlags; 1896 id?: number; 1897 } 1898 export interface FlowStart extends FlowNodeBase { 1899 node?: FunctionExpression | ArrowFunction | MethodDeclaration; 1900 } 1901 export interface FlowLabel extends FlowNodeBase { 1902 antecedents: FlowNode[] | undefined; 1903 } 1904 export interface FlowAssignment extends FlowNodeBase { 1905 node: Expression | VariableDeclaration | BindingElement; 1906 antecedent: FlowNode; 1907 } 1908 export interface FlowCall extends FlowNodeBase { 1909 node: CallExpression; 1910 antecedent: FlowNode; 1911 } 1912 export interface FlowCondition extends FlowNodeBase { 1913 node: Expression; 1914 antecedent: FlowNode; 1915 } 1916 export interface FlowSwitchClause extends FlowNodeBase { 1917 switchStatement: SwitchStatement; 1918 clauseStart: number; 1919 clauseEnd: number; 1920 antecedent: FlowNode; 1921 } 1922 export interface FlowArrayMutation extends FlowNodeBase { 1923 node: CallExpression | BinaryExpression; 1924 antecedent: FlowNode; 1925 } 1926 export interface FlowReduceLabel extends FlowNodeBase { 1927 target: FlowLabel; 1928 antecedents: FlowNode[]; 1929 antecedent: FlowNode; 1930 } 1931 export type FlowType = Type | IncompleteType; 1932 export interface IncompleteType { 1933 flags: TypeFlags; 1934 type: Type; 1935 } 1936 export interface AmdDependency { 1937 path: string; 1938 name?: string; 1939 } 1940 export interface SourceFile extends Declaration { 1941 readonly kind: SyntaxKind.SourceFile; 1942 readonly statements: NodeArray<Statement>; 1943 readonly endOfFileToken: Token<SyntaxKind.EndOfFileToken>; 1944 fileName: string; 1945 text: string; 1946 amdDependencies: readonly AmdDependency[]; 1947 moduleName?: string; 1948 referencedFiles: readonly FileReference[]; 1949 typeReferenceDirectives: readonly FileReference[]; 1950 libReferenceDirectives: readonly FileReference[]; 1951 languageVariant: LanguageVariant; 1952 isDeclarationFile: boolean; 1953 /** 1954 * lib.d.ts should have a reference comment like 1955 * 1956 * /// <reference no-default-lib="true"/> 1957 * 1958 * If any other file has this comment, it signals not to include lib.d.ts 1959 * because this containing file is intended to act as a default library. 1960 */ 1961 hasNoDefaultLib: boolean; 1962 languageVersion: ScriptTarget; 1963 } 1964 export interface Bundle extends Node { 1965 readonly kind: SyntaxKind.Bundle; 1966 readonly prepends: readonly (InputFiles | UnparsedSource)[]; 1967 readonly sourceFiles: readonly SourceFile[]; 1968 } 1969 export interface InputFiles extends Node { 1970 readonly kind: SyntaxKind.InputFiles; 1971 javascriptPath?: string; 1972 javascriptText: string; 1973 javascriptMapPath?: string; 1974 javascriptMapText?: string; 1975 declarationPath?: string; 1976 declarationText: string; 1977 declarationMapPath?: string; 1978 declarationMapText?: string; 1979 } 1980 export interface UnparsedSource extends Node { 1981 readonly kind: SyntaxKind.UnparsedSource; 1982 fileName: string; 1983 text: string; 1984 readonly prologues: readonly UnparsedPrologue[]; 1985 helpers: readonly UnscopedEmitHelper[] | undefined; 1986 referencedFiles: readonly FileReference[]; 1987 typeReferenceDirectives: readonly string[] | undefined; 1988 libReferenceDirectives: readonly FileReference[]; 1989 hasNoDefaultLib?: boolean; 1990 sourceMapPath?: string; 1991 sourceMapText?: string; 1992 readonly syntheticReferences?: readonly UnparsedSyntheticReference[]; 1993 readonly texts: readonly UnparsedSourceText[]; 1994 } 1995 export type UnparsedSourceText = UnparsedPrepend | UnparsedTextLike; 1996 export type UnparsedNode = UnparsedPrologue | UnparsedSourceText | UnparsedSyntheticReference; 1997 export interface UnparsedSection extends Node { 1998 readonly kind: SyntaxKind; 1999 readonly parent: UnparsedSource; 2000 readonly data?: string; 2001 } 2002 export interface UnparsedPrologue extends UnparsedSection { 2003 readonly kind: SyntaxKind.UnparsedPrologue; 2004 readonly parent: UnparsedSource; 2005 readonly data: string; 2006 } 2007 export interface UnparsedPrepend extends UnparsedSection { 2008 readonly kind: SyntaxKind.UnparsedPrepend; 2009 readonly parent: UnparsedSource; 2010 readonly data: string; 2011 readonly texts: readonly UnparsedTextLike[]; 2012 } 2013 export interface UnparsedTextLike extends UnparsedSection { 2014 readonly kind: SyntaxKind.UnparsedText | SyntaxKind.UnparsedInternalText; 2015 readonly parent: UnparsedSource; 2016 } 2017 export interface UnparsedSyntheticReference extends UnparsedSection { 2018 readonly kind: SyntaxKind.UnparsedSyntheticReference; 2019 readonly parent: UnparsedSource; 2020 } 2021 export interface JsonSourceFile extends SourceFile { 2022 readonly statements: NodeArray<JsonObjectExpressionStatement>; 2023 } 2024 export interface TsConfigSourceFile extends JsonSourceFile { 2025 extendedSourceFiles?: string[]; 2026 } 2027 export interface JsonMinusNumericLiteral extends PrefixUnaryExpression { 2028 readonly kind: SyntaxKind.PrefixUnaryExpression; 2029 readonly operator: SyntaxKind.MinusToken; 2030 readonly operand: NumericLiteral; 2031 } 2032 export type JsonObjectExpression = ObjectLiteralExpression | ArrayLiteralExpression | JsonMinusNumericLiteral | NumericLiteral | StringLiteral | BooleanLiteral | NullLiteral; 2033 export interface JsonObjectExpressionStatement extends ExpressionStatement { 2034 readonly expression: JsonObjectExpression; 2035 } 2036 export interface ScriptReferenceHost { 2037 getCompilerOptions(): CompilerOptions; 2038 getSourceFile(fileName: string): SourceFile | undefined; 2039 getSourceFileByPath(path: Path): SourceFile | undefined; 2040 getCurrentDirectory(): string; 2041 } 2042 export interface ParseConfigHost { 2043 useCaseSensitiveFileNames: boolean; 2044 readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number): readonly string[]; 2045 /** 2046 * Gets a value indicating whether the specified path exists and is a file. 2047 * @param path The path to test. 2048 */ 2049 fileExists(path: string): boolean; 2050 readFile(path: string): string | undefined; 2051 trace?(s: string): void; 2052 } 2053 /** 2054 * Branded string for keeping track of when we've turned an ambiguous path 2055 * specified like "./blah" to an absolute path to an actual 2056 * tsconfig file, e.g. "/root/blah/tsconfig.json" 2057 */ 2058 export type ResolvedConfigFileName = string & { 2059 _isResolvedConfigFileName: never; 2060 }; 2061 export type WriteFileCallback = (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[]) => void; 2062 export class OperationCanceledException { 2063 } 2064 export interface CancellationToken { 2065 isCancellationRequested(): boolean; 2066 /** @throws OperationCanceledException if isCancellationRequested is true */ 2067 throwIfCancellationRequested(): void; 2068 } 2069 export interface Program extends ScriptReferenceHost { 2070 getCurrentDirectory(): string; 2071 /** 2072 * Get a list of root file names that were passed to a 'createProgram' 2073 */ 2074 getRootFileNames(): readonly string[]; 2075 /** 2076 * Get a list of files in the program 2077 */ 2078 getSourceFiles(): readonly SourceFile[]; 2079 /** 2080 * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then 2081 * the JavaScript and declaration files will be produced for all the files in this program. 2082 * If targetSourceFile is specified, then only the JavaScript and declaration for that 2083 * specific file will be generated. 2084 * 2085 * If writeFile is not specified then the writeFile callback from the compiler host will be 2086 * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter 2087 * will be invoked when writing the JavaScript and declaration files. 2088 */ 2089 emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult; 2090 getOptionsDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[]; 2091 getGlobalDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[]; 2092 getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[]; 2093 /** The first time this is called, it will return global diagnostics (no location). */ 2094 getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[]; 2095 getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[]; 2096 getConfigFileParsingDiagnostics(): readonly Diagnostic[]; 2097 /** 2098 * Gets a type checker that can be used to semantically analyze source files in the program. 2099 */ 2100 getTypeChecker(): TypeChecker; 2101 getTypeCatalog(): readonly Type[]; 2102 getNodeCount(): number; 2103 getIdentifierCount(): number; 2104 getSymbolCount(): number; 2105 getTypeCount(): number; 2106 getInstantiationCount(): number; 2107 getRelationCacheSizes(): { 2108 assignable: number; 2109 identity: number; 2110 subtype: number; 2111 strictSubtype: number; 2112 }; 2113 isSourceFileFromExternalLibrary(file: SourceFile): boolean; 2114 isSourceFileDefaultLibrary(file: SourceFile): boolean; 2115 getProjectReferences(): readonly ProjectReference[] | undefined; 2116 getResolvedProjectReferences(): readonly (ResolvedProjectReference | undefined)[] | undefined; 2117 } 2118 export interface ResolvedProjectReference { 2119 commandLine: ParsedCommandLine; 2120 sourceFile: SourceFile; 2121 references?: readonly (ResolvedProjectReference | undefined)[]; 2122 } 2123 export type CustomTransformerFactory = (context: TransformationContext) => CustomTransformer; 2124 export interface CustomTransformer { 2125 transformSourceFile(node: SourceFile): SourceFile; 2126 transformBundle(node: Bundle): Bundle; 2127 } 2128 export interface CustomTransformers { 2129 /** Custom transformers to evaluate before built-in .js transformations. */ 2130 before?: (TransformerFactory<SourceFile> | CustomTransformerFactory)[]; 2131 /** Custom transformers to evaluate after built-in .js transformations. */ 2132 after?: (TransformerFactory<SourceFile> | CustomTransformerFactory)[]; 2133 /** Custom transformers to evaluate after built-in .d.ts transformations. */ 2134 afterDeclarations?: (TransformerFactory<Bundle | SourceFile> | CustomTransformerFactory)[]; 2135 } 2136 export interface SourceMapSpan { 2137 /** Line number in the .js file. */ 2138 emittedLine: number; 2139 /** Column number in the .js file. */ 2140 emittedColumn: number; 2141 /** Line number in the .ts file. */ 2142 sourceLine: number; 2143 /** Column number in the .ts file. */ 2144 sourceColumn: number; 2145 /** Optional name (index into names array) associated with this span. */ 2146 nameIndex?: number; 2147 /** .ts file (index into sources array) associated with this span */ 2148 sourceIndex: number; 2149 } 2150 /** Return code used by getEmitOutput function to indicate status of the function */ 2151 export enum ExitStatus { 2152 Success = 0, 2153 DiagnosticsPresent_OutputsSkipped = 1, 2154 DiagnosticsPresent_OutputsGenerated = 2, 2155 InvalidProject_OutputsSkipped = 3, 2156 ProjectReferenceCycle_OutputsSkipped = 4, 2157 /** @deprecated Use ProjectReferenceCycle_OutputsSkipped instead. */ 2158 ProjectReferenceCycle_OutputsSkupped = 4 2159 } 2160 export interface EmitResult { 2161 emitSkipped: boolean; 2162 /** Contains declaration emit diagnostics */ 2163 diagnostics: readonly Diagnostic[]; 2164 emittedFiles?: string[]; 2165 } 2166 export interface TypeChecker { 2167 getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; 2168 getDeclaredTypeOfSymbol(symbol: Symbol): Type; 2169 getPropertiesOfType(type: Type): Symbol[]; 2170 getPropertyOfType(type: Type, propertyName: string): Symbol | undefined; 2171 getPrivateIdentifierPropertyOfType(leftType: Type, name: string, location: Node): Symbol | undefined; 2172 getIndexInfoOfType(type: Type, kind: IndexKind): IndexInfo | undefined; 2173 getSignaturesOfType(type: Type, kind: SignatureKind): readonly Signature[]; 2174 getIndexTypeOfType(type: Type, kind: IndexKind): Type | undefined; 2175 getBaseTypes(type: InterfaceType): BaseType[]; 2176 getBaseTypeOfLiteralType(type: Type): Type; 2177 getWidenedType(type: Type): Type; 2178 getReturnTypeOfSignature(signature: Signature): Type; 2179 getNullableType(type: Type, flags: TypeFlags): Type; 2180 getNonNullableType(type: Type): Type; 2181 getTypeArguments(type: TypeReference): readonly Type[]; 2182 /** Note that the resulting nodes cannot be checked. */ 2183 typeToTypeNode(type: Type, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): TypeNode | undefined; 2184 /** Note that the resulting nodes cannot be checked. */ 2185 signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): SignatureDeclaration & { 2186 typeArguments?: NodeArray<TypeNode>; 2187 } | undefined; 2188 /** Note that the resulting nodes cannot be checked. */ 2189 indexInfoToIndexSignatureDeclaration(indexInfo: IndexInfo, kind: IndexKind, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): IndexSignatureDeclaration | undefined; 2190 /** Note that the resulting nodes cannot be checked. */ 2191 symbolToEntityName(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): EntityName | undefined; 2192 /** Note that the resulting nodes cannot be checked. */ 2193 symbolToExpression(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): Expression | undefined; 2194 /** Note that the resulting nodes cannot be checked. */ 2195 symbolToTypeParameterDeclarations(symbol: Symbol, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): NodeArray<TypeParameterDeclaration> | undefined; 2196 /** Note that the resulting nodes cannot be checked. */ 2197 symbolToParameterDeclaration(symbol: Symbol, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): ParameterDeclaration | undefined; 2198 /** Note that the resulting nodes cannot be checked. */ 2199 typeParameterToDeclaration(parameter: TypeParameter, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): TypeParameterDeclaration | undefined; 2200 getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; 2201 getSymbolAtLocation(node: Node): Symbol | undefined; 2202 getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[]; 2203 /** 2204 * The function returns the value (local variable) symbol of an identifier in the short-hand property assignment. 2205 * This is necessary as an identifier in short-hand property assignment can contains two meaning: property name and property value. 2206 */ 2207 getShorthandAssignmentValueSymbol(location: Node): Symbol | undefined; 2208 getExportSpecifierLocalTargetSymbol(location: ExportSpecifier | Identifier): Symbol | undefined; 2209 /** 2210 * If a symbol is a local symbol with an associated exported symbol, returns the exported symbol. 2211 * Otherwise returns its input. 2212 * For example, at `export type T = number;`: 2213 * - `getSymbolAtLocation` at the location `T` will return the exported symbol for `T`. 2214 * - But the result of `getSymbolsInScope` will contain the *local* symbol for `T`, not the exported symbol. 2215 * - Calling `getExportSymbolOfSymbol` on that local symbol will return the exported symbol. 2216 */ 2217 getExportSymbolOfSymbol(symbol: Symbol): Symbol; 2218 getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol | undefined; 2219 getTypeOfAssignmentPattern(pattern: AssignmentPattern): Type; 2220 getTypeAtLocation(node: Node): Type; 2221 getTypeFromTypeNode(node: TypeNode): Type; 2222 signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string; 2223 typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; 2224 symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): string; 2225 typePredicateToString(predicate: TypePredicate, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; 2226 getFullyQualifiedName(symbol: Symbol): string; 2227 getAugmentedPropertiesOfType(type: Type): Symbol[]; 2228 getRootSymbols(symbol: Symbol): readonly Symbol[]; 2229 getSymbolOfExpando(node: Node, allowDeclaration: boolean): Symbol | undefined; 2230 getContextualType(node: Expression): Type | undefined; 2231 /** 2232 * returns unknownSignature in the case of an error. 2233 * returns undefined if the node is not valid. 2234 * @param argumentCount Apparent number of arguments, passed in case of a possibly incomplete call. This should come from an ArgumentListInfo. See `signatureHelp.ts`. 2235 */ 2236 getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[], argumentCount?: number): Signature | undefined; 2237 getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature | undefined; 2238 isImplementationOfOverload(node: SignatureDeclaration): boolean | undefined; 2239 isUndefinedSymbol(symbol: Symbol): boolean; 2240 isArgumentsSymbol(symbol: Symbol): boolean; 2241 isUnknownSymbol(symbol: Symbol): boolean; 2242 getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): string | number | undefined; 2243 isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName | ImportTypeNode, propertyName: string): boolean; 2244 /** Follow all aliases to get the original symbol. */ 2245 getAliasedSymbol(symbol: Symbol): Symbol; 2246 getExportsOfModule(moduleSymbol: Symbol): Symbol[]; 2247 getJsxIntrinsicTagNamesAt(location: Node): Symbol[]; 2248 isOptionalParameter(node: ParameterDeclaration): boolean; 2249 getAmbientModules(): Symbol[]; 2250 tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined; 2251 getApparentType(type: Type): Type; 2252 getBaseConstraintOfType(type: Type): Type | undefined; 2253 getDefaultFromTypeParameter(type: Type): Type | undefined; 2254 /** 2255 * Depending on the operation performed, it may be appropriate to throw away the checker 2256 * if the cancellation token is triggered. Typically, if it is used for error checking 2257 * and the operation is cancelled, then it should be discarded, otherwise it is safe to keep. 2258 */ 2259 runWithCancellationToken<T>(token: CancellationToken, cb: (checker: TypeChecker) => T): T; 2260 } 2261 export enum NodeBuilderFlags { 2262 None = 0, 2263 NoTruncation = 1, 2264 WriteArrayAsGenericType = 2, 2265 GenerateNamesForShadowedTypeParams = 4, 2266 UseStructuralFallback = 8, 2267 ForbidIndexedAccessSymbolReferences = 16, 2268 WriteTypeArgumentsOfSignature = 32, 2269 UseFullyQualifiedType = 64, 2270 UseOnlyExternalAliasing = 128, 2271 SuppressAnyReturnType = 256, 2272 WriteTypeParametersInQualifiedName = 512, 2273 MultilineObjectLiterals = 1024, 2274 WriteClassExpressionAsTypeLiteral = 2048, 2275 UseTypeOfFunction = 4096, 2276 OmitParameterModifiers = 8192, 2277 UseAliasDefinedOutsideCurrentScope = 16384, 2278 UseSingleQuotesForStringLiteralType = 268435456, 2279 NoTypeReduction = 536870912, 2280 NoUndefinedOptionalParameterType = 1073741824, 2281 AllowThisInObjectLiteral = 32768, 2282 AllowQualifedNameInPlaceOfIdentifier = 65536, 2283 AllowAnonymousIdentifier = 131072, 2284 AllowEmptyUnionOrIntersection = 262144, 2285 AllowEmptyTuple = 524288, 2286 AllowUniqueESSymbolType = 1048576, 2287 AllowEmptyIndexInfoType = 2097152, 2288 AllowNodeModulesRelativePaths = 67108864, 2289 IgnoreErrors = 70221824, 2290 InObjectTypeLiteral = 4194304, 2291 InTypeAlias = 8388608, 2292 InInitialEntityName = 16777216, 2293 InReverseMappedType = 33554432 2294 } 2295 export enum TypeFormatFlags { 2296 None = 0, 2297 NoTruncation = 1, 2298 WriteArrayAsGenericType = 2, 2299 UseStructuralFallback = 8, 2300 WriteTypeArgumentsOfSignature = 32, 2301 UseFullyQualifiedType = 64, 2302 SuppressAnyReturnType = 256, 2303 MultilineObjectLiterals = 1024, 2304 WriteClassExpressionAsTypeLiteral = 2048, 2305 UseTypeOfFunction = 4096, 2306 OmitParameterModifiers = 8192, 2307 UseAliasDefinedOutsideCurrentScope = 16384, 2308 UseSingleQuotesForStringLiteralType = 268435456, 2309 NoTypeReduction = 536870912, 2310 AllowUniqueESSymbolType = 1048576, 2311 AddUndefined = 131072, 2312 WriteArrowStyleSignature = 262144, 2313 InArrayType = 524288, 2314 InElementType = 2097152, 2315 InFirstTypeArgument = 4194304, 2316 InTypeAlias = 8388608, 2317 /** @deprecated */ WriteOwnNameForAnyLike = 0, 2318 NodeBuilderFlagsMask = 814775659 2319 } 2320 export enum SymbolFormatFlags { 2321 None = 0, 2322 WriteTypeParametersOrArguments = 1, 2323 UseOnlyExternalAliasing = 2, 2324 AllowAnyNodeKind = 4, 2325 UseAliasDefinedOutsideCurrentScope = 8, 2326 } 2327 export enum TypePredicateKind { 2328 This = 0, 2329 Identifier = 1, 2330 AssertsThis = 2, 2331 AssertsIdentifier = 3 2332 } 2333 export interface TypePredicateBase { 2334 kind: TypePredicateKind; 2335 type: Type | undefined; 2336 } 2337 export interface ThisTypePredicate extends TypePredicateBase { 2338 kind: TypePredicateKind.This; 2339 parameterName: undefined; 2340 parameterIndex: undefined; 2341 type: Type; 2342 } 2343 export interface IdentifierTypePredicate extends TypePredicateBase { 2344 kind: TypePredicateKind.Identifier; 2345 parameterName: string; 2346 parameterIndex: number; 2347 type: Type; 2348 } 2349 export interface AssertsThisTypePredicate extends TypePredicateBase { 2350 kind: TypePredicateKind.AssertsThis; 2351 parameterName: undefined; 2352 parameterIndex: undefined; 2353 type: Type | undefined; 2354 } 2355 export interface AssertsIdentifierTypePredicate extends TypePredicateBase { 2356 kind: TypePredicateKind.AssertsIdentifier; 2357 parameterName: string; 2358 parameterIndex: number; 2359 type: Type | undefined; 2360 } 2361 export type TypePredicate = ThisTypePredicate | IdentifierTypePredicate | AssertsThisTypePredicate | AssertsIdentifierTypePredicate; 2362 export enum SymbolFlags { 2363 None = 0, 2364 FunctionScopedVariable = 1, 2365 BlockScopedVariable = 2, 2366 Property = 4, 2367 EnumMember = 8, 2368 Function = 16, 2369 Class = 32, 2370 Interface = 64, 2371 ConstEnum = 128, 2372 RegularEnum = 256, 2373 ValueModule = 512, 2374 NamespaceModule = 1024, 2375 TypeLiteral = 2048, 2376 ObjectLiteral = 4096, 2377 Method = 8192, 2378 Constructor = 16384, 2379 GetAccessor = 32768, 2380 SetAccessor = 65536, 2381 Signature = 131072, 2382 TypeParameter = 262144, 2383 TypeAlias = 524288, 2384 ExportValue = 1048576, 2385 Alias = 2097152, 2386 Prototype = 4194304, 2387 ExportStar = 8388608, 2388 Optional = 16777216, 2389 Transient = 33554432, 2390 Assignment = 67108864, 2391 ModuleExports = 134217728, 2392 Enum = 384, 2393 Variable = 3, 2394 Value = 111551, 2395 Type = 788968, 2396 Namespace = 1920, 2397 Module = 1536, 2398 Accessor = 98304, 2399 FunctionScopedVariableExcludes = 111550, 2400 BlockScopedVariableExcludes = 111551, 2401 ParameterExcludes = 111551, 2402 PropertyExcludes = 0, 2403 EnumMemberExcludes = 900095, 2404 FunctionExcludes = 110991, 2405 ClassExcludes = 899503, 2406 InterfaceExcludes = 788872, 2407 RegularEnumExcludes = 899327, 2408 ConstEnumExcludes = 899967, 2409 ValueModuleExcludes = 110735, 2410 NamespaceModuleExcludes = 0, 2411 MethodExcludes = 103359, 2412 GetAccessorExcludes = 46015, 2413 SetAccessorExcludes = 78783, 2414 TypeParameterExcludes = 526824, 2415 TypeAliasExcludes = 788968, 2416 AliasExcludes = 2097152, 2417 ModuleMember = 2623475, 2418 ExportHasLocal = 944, 2419 BlockScoped = 418, 2420 PropertyOrAccessor = 98308, 2421 ClassMember = 106500, 2422 } 2423 export interface Symbol { 2424 flags: SymbolFlags; 2425 escapedName: __String; 2426 declarations: Declaration[]; 2427 valueDeclaration: Declaration; 2428 members?: SymbolTable; 2429 exports?: SymbolTable; 2430 globalExports?: SymbolTable; 2431 } 2432 export enum InternalSymbolName { 2433 Call = "__call", 2434 Constructor = "__constructor", 2435 New = "__new", 2436 Index = "__index", 2437 ExportStar = "__export", 2438 Global = "__global", 2439 Missing = "__missing", 2440 Type = "__type", 2441 Object = "__object", 2442 JSXAttributes = "__jsxAttributes", 2443 Class = "__class", 2444 Function = "__function", 2445 Computed = "__computed", 2446 Resolving = "__resolving__", 2447 ExportEquals = "export=", 2448 Default = "default", 2449 This = "this" 2450 } 2451 /** 2452 * This represents a string whose leading underscore have been escaped by adding extra leading underscores. 2453 * The shape of this brand is rather unique compared to others we've used. 2454 * Instead of just an intersection of a string and an object, it is that union-ed 2455 * with an intersection of void and an object. This makes it wholly incompatible 2456 * with a normal string (which is good, it cannot be misused on assignment or on usage), 2457 * while still being comparable with a normal string via === (also good) and castable from a string. 2458 */ 2459 export type __String = (string & { 2460 __escapedIdentifier: void; 2461 }) | (void & { 2462 __escapedIdentifier: void; 2463 }) | InternalSymbolName; 2464 /** ReadonlyMap where keys are `__String`s. */ 2465 export interface ReadonlyUnderscoreEscapedMap<T> extends ReadonlyESMap<__String, T> { 2466 } 2467 /** Map where keys are `__String`s. */ 2468 export interface UnderscoreEscapedMap<T> extends ESMap<__String, T>, ReadonlyUnderscoreEscapedMap<T> { 2469 } 2470 /** SymbolTable based on ES6 Map interface. */ 2471 export type SymbolTable = UnderscoreEscapedMap<Symbol>; 2472 export enum TypeFlags { 2473 Any = 1, 2474 Unknown = 2, 2475 String = 4, 2476 Number = 8, 2477 Boolean = 16, 2478 Enum = 32, 2479 BigInt = 64, 2480 StringLiteral = 128, 2481 NumberLiteral = 256, 2482 BooleanLiteral = 512, 2483 EnumLiteral = 1024, 2484 BigIntLiteral = 2048, 2485 ESSymbol = 4096, 2486 UniqueESSymbol = 8192, 2487 Void = 16384, 2488 Undefined = 32768, 2489 Null = 65536, 2490 Never = 131072, 2491 TypeParameter = 262144, 2492 Object = 524288, 2493 Union = 1048576, 2494 Intersection = 2097152, 2495 Index = 4194304, 2496 IndexedAccess = 8388608, 2497 Conditional = 16777216, 2498 Substitution = 33554432, 2499 NonPrimitive = 67108864, 2500 TemplateLiteral = 134217728, 2501 StringMapping = 268435456, 2502 Literal = 2944, 2503 Unit = 109440, 2504 StringOrNumberLiteral = 384, 2505 PossiblyFalsy = 117724, 2506 StringLike = 402653316, 2507 NumberLike = 296, 2508 BigIntLike = 2112, 2509 BooleanLike = 528, 2510 EnumLike = 1056, 2511 ESSymbolLike = 12288, 2512 VoidLike = 49152, 2513 UnionOrIntersection = 3145728, 2514 StructuredType = 3670016, 2515 TypeVariable = 8650752, 2516 InstantiableNonPrimitive = 58982400, 2517 InstantiablePrimitive = 406847488, 2518 Instantiable = 465829888, 2519 StructuredOrInstantiable = 469499904, 2520 Narrowable = 536624127, 2521 } 2522 export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; 2523 export interface Type { 2524 flags: TypeFlags; 2525 symbol: Symbol; 2526 pattern?: DestructuringPattern; 2527 aliasSymbol?: Symbol; 2528 aliasTypeArguments?: readonly Type[]; 2529 } 2530 export interface LiteralType extends Type { 2531 value: string | number | PseudoBigInt; 2532 freshType: LiteralType; 2533 regularType: LiteralType; 2534 } 2535 export interface UniqueESSymbolType extends Type { 2536 symbol: Symbol; 2537 escapedName: __String; 2538 } 2539 export interface StringLiteralType extends LiteralType { 2540 value: string; 2541 } 2542 export interface NumberLiteralType extends LiteralType { 2543 value: number; 2544 } 2545 export interface BigIntLiteralType extends LiteralType { 2546 value: PseudoBigInt; 2547 } 2548 export interface EnumType extends Type { 2549 } 2550 export enum ObjectFlags { 2551 Class = 1, 2552 Interface = 2, 2553 Reference = 4, 2554 Tuple = 8, 2555 Anonymous = 16, 2556 Mapped = 32, 2557 Instantiated = 64, 2558 ObjectLiteral = 128, 2559 EvolvingArray = 256, 2560 ObjectLiteralPatternWithComputedProperties = 512, 2561 ContainsSpread = 1024, 2562 ReverseMapped = 2048, 2563 JsxAttributes = 4096, 2564 MarkerType = 8192, 2565 JSLiteral = 16384, 2566 FreshLiteral = 32768, 2567 ArrayLiteral = 65536, 2568 ObjectRestType = 131072, 2569 ClassOrInterface = 3, 2570 } 2571 export interface ObjectType extends Type { 2572 objectFlags: ObjectFlags; 2573 } 2574 /** Class and interface types (ObjectFlags.Class and ObjectFlags.Interface). */ 2575 export interface InterfaceType extends ObjectType { 2576 typeParameters: TypeParameter[] | undefined; 2577 outerTypeParameters: TypeParameter[] | undefined; 2578 localTypeParameters: TypeParameter[] | undefined; 2579 thisType: TypeParameter | undefined; 2580 } 2581 export type BaseType = ObjectType | IntersectionType | TypeVariable; 2582 export interface InterfaceTypeWithDeclaredMembers extends InterfaceType { 2583 declaredProperties: Symbol[]; 2584 declaredCallSignatures: Signature[]; 2585 declaredConstructSignatures: Signature[]; 2586 declaredStringIndexInfo?: IndexInfo; 2587 declaredNumberIndexInfo?: IndexInfo; 2588 } 2589 /** 2590 * Type references (ObjectFlags.Reference). When a class or interface has type parameters or 2591 * a "this" type, references to the class or interface are made using type references. The 2592 * typeArguments property specifies the types to substitute for the type parameters of the 2593 * class or interface and optionally includes an extra element that specifies the type to 2594 * substitute for "this" in the resulting instantiation. When no extra argument is present, 2595 * the type reference itself is substituted for "this". The typeArguments property is undefined 2596 * if the class or interface has no type parameters and the reference isn't specifying an 2597 * explicit "this" argument. 2598 */ 2599 export interface TypeReference extends ObjectType { 2600 target: GenericType; 2601 node?: TypeReferenceNode | ArrayTypeNode | TupleTypeNode; 2602 } 2603 export interface DeferredTypeReference extends TypeReference { 2604 } 2605 export interface GenericType extends InterfaceType, TypeReference { 2606 } 2607 export enum ElementFlags { 2608 Required = 1, 2609 Optional = 2, 2610 Rest = 4, 2611 Variadic = 8, 2612 Fixed = 3, 2613 Variable = 12, 2614 NonRequired = 14, 2615 NonRest = 11 2616 } 2617 export interface TupleType extends GenericType { 2618 elementFlags: readonly ElementFlags[]; 2619 minLength: number; 2620 fixedLength: number; 2621 hasRestElement: boolean; 2622 combinedFlags: ElementFlags; 2623 readonly: boolean; 2624 labeledElementDeclarations?: readonly (NamedTupleMember | ParameterDeclaration)[]; 2625 } 2626 export interface TupleTypeReference extends TypeReference { 2627 target: TupleType; 2628 } 2629 export interface UnionOrIntersectionType extends Type { 2630 types: Type[]; 2631 } 2632 export interface UnionType extends UnionOrIntersectionType { 2633 } 2634 export interface IntersectionType extends UnionOrIntersectionType { 2635 } 2636 export type StructuredType = ObjectType | UnionType | IntersectionType; 2637 export interface EvolvingArrayType extends ObjectType { 2638 elementType: Type; 2639 finalArrayType?: Type; 2640 } 2641 export interface InstantiableType extends Type { 2642 } 2643 export interface TypeParameter extends InstantiableType { 2644 } 2645 export interface IndexedAccessType extends InstantiableType { 2646 objectType: Type; 2647 indexType: Type; 2648 constraint?: Type; 2649 simplifiedForReading?: Type; 2650 simplifiedForWriting?: Type; 2651 } 2652 export type TypeVariable = TypeParameter | IndexedAccessType; 2653 export interface IndexType extends InstantiableType { 2654 type: InstantiableType | UnionOrIntersectionType; 2655 } 2656 export interface ConditionalRoot { 2657 node: ConditionalTypeNode; 2658 checkType: Type; 2659 extendsType: Type; 2660 isDistributive: boolean; 2661 inferTypeParameters?: TypeParameter[]; 2662 outerTypeParameters?: TypeParameter[]; 2663 instantiations?: Map<Type>; 2664 aliasSymbol?: Symbol; 2665 aliasTypeArguments?: Type[]; 2666 } 2667 export interface ConditionalType extends InstantiableType { 2668 root: ConditionalRoot; 2669 checkType: Type; 2670 extendsType: Type; 2671 resolvedTrueType: Type; 2672 resolvedFalseType: Type; 2673 } 2674 export interface TemplateLiteralType extends InstantiableType { 2675 texts: readonly string[]; 2676 types: readonly Type[]; 2677 } 2678 export interface StringMappingType extends InstantiableType { 2679 symbol: Symbol; 2680 type: Type; 2681 } 2682 export interface SubstitutionType extends InstantiableType { 2683 baseType: Type; 2684 substitute: Type; 2685 } 2686 export enum SignatureKind { 2687 Call = 0, 2688 Construct = 1 2689 } 2690 export interface Signature { 2691 declaration?: SignatureDeclaration | JSDocSignature; 2692 typeParameters?: readonly TypeParameter[]; 2693 parameters: readonly Symbol[]; 2694 } 2695 export enum IndexKind { 2696 String = 0, 2697 Number = 1 2698 } 2699 export interface IndexInfo { 2700 type: Type; 2701 isReadonly: boolean; 2702 declaration?: IndexSignatureDeclaration; 2703 } 2704 export enum InferencePriority { 2705 NakedTypeVariable = 1, 2706 SpeculativeTuple = 2, 2707 HomomorphicMappedType = 4, 2708 PartialHomomorphicMappedType = 8, 2709 MappedTypeConstraint = 16, 2710 ContravariantConditional = 32, 2711 ReturnType = 64, 2712 LiteralKeyof = 128, 2713 NoConstraints = 256, 2714 AlwaysStrict = 512, 2715 MaxValue = 1024, 2716 PriorityImpliesCombination = 208, 2717 Circularity = -1 2718 } 2719 /** @deprecated Use FileExtensionInfo instead. */ 2720 export type JsFileExtensionInfo = FileExtensionInfo; 2721 export interface FileExtensionInfo { 2722 extension: string; 2723 isMixedContent: boolean; 2724 scriptKind?: ScriptKind; 2725 } 2726 export interface DiagnosticMessage { 2727 key: string; 2728 category: DiagnosticCategory; 2729 code: number; 2730 message: string; 2731 reportsUnnecessary?: {}; 2732 reportsDeprecated?: {}; 2733 } 2734 /** 2735 * A linked list of formatted diagnostic messages to be used as part of a multiline message. 2736 * It is built from the bottom up, leaving the head to be the "main" diagnostic. 2737 * While it seems that DiagnosticMessageChain is structurally similar to DiagnosticMessage, 2738 * the difference is that messages are all preformatted in DMC. 2739 */ 2740 export interface DiagnosticMessageChain { 2741 messageText: string; 2742 category: DiagnosticCategory; 2743 code: number; 2744 next?: DiagnosticMessageChain[]; 2745 } 2746 export interface Diagnostic extends DiagnosticRelatedInformation { 2747 /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */ 2748 reportsUnnecessary?: {}; 2749 reportsDeprecated?: {}; 2750 source?: string; 2751 relatedInformation?: DiagnosticRelatedInformation[]; 2752 } 2753 export interface DiagnosticRelatedInformation { 2754 category: DiagnosticCategory; 2755 code: number; 2756 file: SourceFile | undefined; 2757 start: number | undefined; 2758 length: number | undefined; 2759 messageText: string | DiagnosticMessageChain; 2760 } 2761 export interface DiagnosticWithLocation extends Diagnostic { 2762 file: SourceFile; 2763 start: number; 2764 length: number; 2765 } 2766 export enum DiagnosticCategory { 2767 Warning = 0, 2768 Error = 1, 2769 Suggestion = 2, 2770 Message = 3 2771 } 2772 export enum ModuleResolutionKind { 2773 Classic = 1, 2774 NodeJs = 2 2775 } 2776 export interface PluginImport { 2777 name: string; 2778 } 2779 export interface ProjectReference { 2780 /** A normalized path on disk */ 2781 path: string; 2782 /** The path as the user originally wrote it */ 2783 originalPath?: string; 2784 /** True if the output of this reference should be prepended to the output of this project. Only valid for --outFile compilations */ 2785 prepend?: boolean; 2786 /** True if it is intended that this reference form a circularity */ 2787 circular?: boolean; 2788 } 2789 export enum WatchFileKind { 2790 FixedPollingInterval = 0, 2791 PriorityPollingInterval = 1, 2792 DynamicPriorityPolling = 2, 2793 UseFsEvents = 3, 2794 UseFsEventsOnParentDirectory = 4 2795 } 2796 export enum WatchDirectoryKind { 2797 UseFsEvents = 0, 2798 FixedPollingInterval = 1, 2799 DynamicPriorityPolling = 2 2800 } 2801 export enum PollingWatchKind { 2802 FixedInterval = 0, 2803 PriorityInterval = 1, 2804 DynamicPriority = 2 2805 } 2806 export type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | PluginImport[] | ProjectReference[] | null | undefined | EtsOptions; 2807 export interface CompilerOptions { 2808 allowJs?: boolean; 2809 allowSyntheticDefaultImports?: boolean; 2810 allowUmdGlobalAccess?: boolean; 2811 allowUnreachableCode?: boolean; 2812 allowUnusedLabels?: boolean; 2813 alwaysStrict?: boolean; 2814 baseUrl?: string; 2815 charset?: string; 2816 checkJs?: boolean; 2817 declaration?: boolean; 2818 declarationMap?: boolean; 2819 emitDeclarationOnly?: boolean; 2820 declarationDir?: string; 2821 disableSizeLimit?: boolean; 2822 disableSourceOfProjectReferenceRedirect?: boolean; 2823 disableSolutionSearching?: boolean; 2824 disableReferencedProjectLoad?: boolean; 2825 downlevelIteration?: boolean; 2826 emitBOM?: boolean; 2827 emitDecoratorMetadata?: boolean; 2828 experimentalDecorators?: boolean; 2829 forceConsistentCasingInFileNames?: boolean; 2830 importHelpers?: boolean; 2831 importsNotUsedAsValues?: ImportsNotUsedAsValues; 2832 inlineSourceMap?: boolean; 2833 inlineSources?: boolean; 2834 isolatedModules?: boolean; 2835 jsx?: JsxEmit; 2836 keyofStringsOnly?: boolean; 2837 lib?: string[]; 2838 locale?: string; 2839 mapRoot?: string; 2840 maxNodeModuleJsDepth?: number; 2841 module?: ModuleKind; 2842 moduleResolution?: ModuleResolutionKind; 2843 newLine?: NewLineKind; 2844 noEmit?: boolean; 2845 noEmitHelpers?: boolean; 2846 noEmitOnError?: boolean; 2847 noErrorTruncation?: boolean; 2848 noFallthroughCasesInSwitch?: boolean; 2849 noImplicitAny?: boolean; 2850 noImplicitReturns?: boolean; 2851 noImplicitThis?: boolean; 2852 noStrictGenericChecks?: boolean; 2853 noUnusedLocals?: boolean; 2854 noUnusedParameters?: boolean; 2855 noImplicitUseStrict?: boolean; 2856 noPropertyAccessFromIndexSignature?: boolean; 2857 assumeChangesOnlyAffectDirectDependencies?: boolean; 2858 noLib?: boolean; 2859 noResolve?: boolean; 2860 noUncheckedIndexedAccess?: boolean; 2861 out?: string; 2862 outDir?: string; 2863 outFile?: string; 2864 paths?: MapLike<string[]>; 2865 preserveConstEnums?: boolean; 2866 preserveSymlinks?: boolean; 2867 project?: string; 2868 reactNamespace?: string; 2869 jsxFactory?: string; 2870 jsxFragmentFactory?: string; 2871 jsxImportSource?: string; 2872 composite?: boolean; 2873 incremental?: boolean; 2874 tsBuildInfoFile?: string; 2875 removeComments?: boolean; 2876 rootDir?: string; 2877 rootDirs?: string[]; 2878 skipLibCheck?: boolean; 2879 skipDefaultLibCheck?: boolean; 2880 sourceMap?: boolean; 2881 sourceRoot?: string; 2882 strict?: boolean; 2883 strictFunctionTypes?: boolean; 2884 strictBindCallApply?: boolean; 2885 strictNullChecks?: boolean; 2886 strictPropertyInitialization?: boolean; 2887 stripInternal?: boolean; 2888 suppressExcessPropertyErrors?: boolean; 2889 suppressImplicitAnyIndexErrors?: boolean; 2890 target?: ScriptTarget; 2891 traceResolution?: boolean; 2892 resolveJsonModule?: boolean; 2893 types?: string[]; 2894 /** Paths used to compute primary types search locations */ 2895 typeRoots?: string[]; 2896 esModuleInterop?: boolean; 2897 useDefineForClassFields?: boolean; 2898 ets?: EtsOptions; 2899 [option: string]: CompilerOptionsValue | TsConfigSourceFile | undefined; 2900 } 2901 export interface EtsOptions { 2902 render: { 2903 method: string; 2904 decorator: string; 2905 }; 2906 components: string[]; 2907 libs: string[]; 2908 extend: { 2909 decorator: string; 2910 components: { 2911 name: string; 2912 type: string; 2913 instance: string; 2914 }[]; 2915 }; 2916 customComponent?: string; 2917 } 2918 export interface WatchOptions { 2919 watchFile?: WatchFileKind; 2920 watchDirectory?: WatchDirectoryKind; 2921 fallbackPolling?: PollingWatchKind; 2922 synchronousWatchDirectory?: boolean; 2923 excludeDirectories?: string[]; 2924 excludeFiles?: string[]; 2925 [option: string]: CompilerOptionsValue | undefined; 2926 } 2927 export interface TypeAcquisition { 2928 /** 2929 * @deprecated typingOptions.enableAutoDiscovery 2930 * Use typeAcquisition.enable instead. 2931 */ 2932 enableAutoDiscovery?: boolean; 2933 enable?: boolean; 2934 include?: string[]; 2935 exclude?: string[]; 2936 disableFilenameBasedTypeAcquisition?: boolean; 2937 [option: string]: CompilerOptionsValue | undefined; 2938 } 2939 export enum ModuleKind { 2940 None = 0, 2941 CommonJS = 1, 2942 AMD = 2, 2943 UMD = 3, 2944 System = 4, 2945 ES2015 = 5, 2946 ES2020 = 6, 2947 ESNext = 99 2948 } 2949 export enum JsxEmit { 2950 None = 0, 2951 Preserve = 1, 2952 React = 2, 2953 ReactNative = 3, 2954 ReactJSX = 4, 2955 ReactJSXDev = 5 2956 } 2957 export enum ImportsNotUsedAsValues { 2958 Remove = 0, 2959 Preserve = 1, 2960 Error = 2 2961 } 2962 export enum NewLineKind { 2963 CarriageReturnLineFeed = 0, 2964 LineFeed = 1 2965 } 2966 export interface LineAndCharacter { 2967 /** 0-based. */ 2968 line: number; 2969 character: number; 2970 } 2971 export enum ScriptKind { 2972 Unknown = 0, 2973 JS = 1, 2974 JSX = 2, 2975 TS = 3, 2976 TSX = 4, 2977 External = 5, 2978 JSON = 6, 2979 /** 2980 * Used on extensions that doesn't define the ScriptKind but the content defines it. 2981 * Deferred extensions are going to be included in all project contexts. 2982 */ 2983 Deferred = 7 2984 } 2985 export enum ScriptTarget { 2986 ES3 = 0, 2987 ES5 = 1, 2988 ES2015 = 2, 2989 ES2016 = 3, 2990 ES2017 = 4, 2991 ES2018 = 5, 2992 ES2019 = 6, 2993 ES2020 = 7, 2994 ESNext = 99, 2995 JSON = 100, 2996 Latest = 99 2997 } 2998 export enum LanguageVariant { 2999 Standard = 0, 3000 JSX = 1 3001 } 3002 /** Either a parsed command line or a parsed tsconfig.json */ 3003 export interface ParsedCommandLine { 3004 options: CompilerOptions; 3005 typeAcquisition?: TypeAcquisition; 3006 fileNames: string[]; 3007 projectReferences?: readonly ProjectReference[]; 3008 watchOptions?: WatchOptions; 3009 raw?: any; 3010 errors: Diagnostic[]; 3011 wildcardDirectories?: MapLike<WatchDirectoryFlags>; 3012 compileOnSave?: boolean; 3013 } 3014 export enum WatchDirectoryFlags { 3015 None = 0, 3016 Recursive = 1 3017 } 3018 export interface CreateProgramOptions { 3019 rootNames: readonly string[]; 3020 options: CompilerOptions; 3021 projectReferences?: readonly ProjectReference[]; 3022 host?: CompilerHost; 3023 oldProgram?: Program; 3024 configFileParsingDiagnostics?: readonly Diagnostic[]; 3025 } 3026 export interface ModuleResolutionHost { 3027 fileExists(fileName: string): boolean; 3028 readFile(fileName: string): string | undefined; 3029 trace?(s: string): void; 3030 directoryExists?(directoryName: string): boolean; 3031 /** 3032 * Resolve a symbolic link. 3033 * @see https://nodejs.org/api/fs.html#fs_fs_realpathsync_path_options 3034 */ 3035 realpath?(path: string): string; 3036 getCurrentDirectory?(): string; 3037 getDirectories?(path: string): string[]; 3038 } 3039 /** 3040 * Represents the result of module resolution. 3041 * Module resolution will pick up tsx/jsx/js files even if '--jsx' and '--allowJs' are turned off. 3042 * The Program will then filter results based on these flags. 3043 * 3044 * Prefer to return a `ResolvedModuleFull` so that the file type does not have to be inferred. 3045 */ 3046 export interface ResolvedModule { 3047 /** Path of the file the module was resolved to. */ 3048 resolvedFileName: string; 3049 /** True if `resolvedFileName` comes from `node_modules`. */ 3050 isExternalLibraryImport?: boolean; 3051 } 3052 /** 3053 * ResolvedModule with an explicitly provided `extension` property. 3054 * Prefer this over `ResolvedModule`. 3055 * If changing this, remember to change `moduleResolutionIsEqualTo`. 3056 */ 3057 export interface ResolvedModuleFull extends ResolvedModule { 3058 /** 3059 * Extension of resolvedFileName. This must match what's at the end of resolvedFileName. 3060 * This is optional for backwards-compatibility, but will be added if not provided. 3061 */ 3062 extension: Extension; 3063 packageId?: PackageId; 3064 } 3065 /** 3066 * Unique identifier with a package name and version. 3067 * If changing this, remember to change `packageIdIsEqual`. 3068 */ 3069 export interface PackageId { 3070 /** 3071 * Name of the package. 3072 * Should not include `@types`. 3073 * If accessing a non-index file, this should include its name e.g. "foo/bar". 3074 */ 3075 name: string; 3076 /** 3077 * Name of a submodule within this package. 3078 * May be "". 3079 */ 3080 subModuleName: string; 3081 /** Version of the package, e.g. "1.2.3" */ 3082 version: string; 3083 } 3084 export enum Extension { 3085 Ts = ".ts", 3086 Tsx = ".tsx", 3087 Dts = ".d.ts", 3088 Js = ".js", 3089 Jsx = ".jsx", 3090 Json = ".json", 3091 TsBuildInfo = ".tsbuildinfo" 3092 } 3093 export interface ResolvedModuleWithFailedLookupLocations { 3094 readonly resolvedModule: ResolvedModuleFull | undefined; 3095 } 3096 export interface ResolvedTypeReferenceDirective { 3097 primary: boolean; 3098 resolvedFileName: string | undefined; 3099 packageId?: PackageId; 3100 /** True if `resolvedFileName` comes from `node_modules`. */ 3101 isExternalLibraryImport?: boolean; 3102 } 3103 export interface ResolvedTypeReferenceDirectiveWithFailedLookupLocations { 3104 readonly resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective | undefined; 3105 readonly failedLookupLocations: string[]; 3106 } 3107 export interface CompilerHost extends ModuleResolutionHost { 3108 getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): SourceFile | undefined; 3109 getSourceFileByPath?(fileName: string, path: Path, languageVersion: ScriptTarget, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): SourceFile | undefined; 3110 getCancellationToken?(): CancellationToken; 3111 getDefaultLibFileName(options: CompilerOptions): string; 3112 getDefaultLibLocation?(): string; 3113 writeFile: WriteFileCallback; 3114 getCurrentDirectory(): string; 3115 getCanonicalFileName(fileName: string): string; 3116 useCaseSensitiveFileNames(): boolean; 3117 getNewLine(): string; 3118 readDirectory?(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number): string[]; 3119 resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedModule | undefined)[]; 3120 /** 3121 * This method is a companion for 'resolveModuleNames' and is used to resolve 'types' references to actual type declaration files 3122 */ 3123 resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[]; 3124 getEnvironmentVariable?(name: string): string | undefined; 3125 createHash?(data: string): string; 3126 getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined; 3127 } 3128 export interface SourceMapRange extends TextRange { 3129 source?: SourceMapSource; 3130 } 3131 export interface SourceMapSource { 3132 fileName: string; 3133 text: string; 3134 skipTrivia?: (pos: number) => number; 3135 } 3136 export enum EmitFlags { 3137 None = 0, 3138 SingleLine = 1, 3139 AdviseOnEmitNode = 2, 3140 NoSubstitution = 4, 3141 CapturesThis = 8, 3142 NoLeadingSourceMap = 16, 3143 NoTrailingSourceMap = 32, 3144 NoSourceMap = 48, 3145 NoNestedSourceMaps = 64, 3146 NoTokenLeadingSourceMaps = 128, 3147 NoTokenTrailingSourceMaps = 256, 3148 NoTokenSourceMaps = 384, 3149 NoLeadingComments = 512, 3150 NoTrailingComments = 1024, 3151 NoComments = 1536, 3152 NoNestedComments = 2048, 3153 HelperName = 4096, 3154 ExportName = 8192, 3155 LocalName = 16384, 3156 InternalName = 32768, 3157 Indented = 65536, 3158 NoIndentation = 131072, 3159 AsyncFunctionBody = 262144, 3160 ReuseTempVariableScope = 524288, 3161 CustomPrologue = 1048576, 3162 NoHoisting = 2097152, 3163 HasEndOfDeclarationMarker = 4194304, 3164 Iterator = 8388608, 3165 NoAsciiEscaping = 16777216, 3166 } 3167 export interface EmitHelper { 3168 readonly name: string; 3169 readonly scoped: boolean; 3170 readonly text: string | ((node: EmitHelperUniqueNameCallback) => string); 3171 readonly priority?: number; 3172 readonly dependencies?: EmitHelper[]; 3173 } 3174 export interface UnscopedEmitHelper extends EmitHelper { 3175 readonly scoped: false; 3176 readonly text: string; 3177 } 3178 export type EmitHelperUniqueNameCallback = (name: string) => string; 3179 export enum EmitHint { 3180 SourceFile = 0, 3181 Expression = 1, 3182 IdentifierName = 2, 3183 MappedTypeParameter = 3, 3184 Unspecified = 4, 3185 EmbeddedStatement = 5, 3186 JsxAttributeValue = 6 3187 } 3188 export enum OuterExpressionKinds { 3189 Parentheses = 1, 3190 TypeAssertions = 2, 3191 NonNullAssertions = 4, 3192 PartiallyEmittedExpressions = 8, 3193 Assertions = 6, 3194 All = 15 3195 } 3196 export type TypeOfTag = "undefined" | "number" | "bigint" | "boolean" | "string" | "symbol" | "object" | "function"; 3197 export interface NodeFactory { 3198 createNodeArray<T extends Node>(elements?: readonly T[], hasTrailingComma?: boolean): NodeArray<T>; 3199 createNumericLiteral(value: string | number, numericLiteralFlags?: TokenFlags): NumericLiteral; 3200 createBigIntLiteral(value: string | PseudoBigInt): BigIntLiteral; 3201 createStringLiteral(text: string, isSingleQuote?: boolean): StringLiteral; 3202 createStringLiteralFromNode(sourceNode: PropertyNameLiteral, isSingleQuote?: boolean): StringLiteral; 3203 createRegularExpressionLiteral(text: string): RegularExpressionLiteral; 3204 createIdentifier(text: string): Identifier; 3205 /** Create a unique temporary variable. */ 3206 createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined): Identifier; 3207 /** Create a unique temporary variable for use in a loop. */ 3208 createLoopVariable(): Identifier; 3209 /** Create a unique name based on the supplied text. */ 3210 createUniqueName(text: string, flags?: GeneratedIdentifierFlags): Identifier; 3211 /** Create a unique name generated for a node. */ 3212 getGeneratedNameForNode(node: Node | undefined): Identifier; 3213 createPrivateIdentifier(text: string): PrivateIdentifier; 3214 createToken(token: SyntaxKind.SuperKeyword): SuperExpression; 3215 createToken(token: SyntaxKind.ThisKeyword): ThisExpression; 3216 createToken(token: SyntaxKind.NullKeyword): NullLiteral; 3217 createToken(token: SyntaxKind.TrueKeyword): TrueLiteral; 3218 createToken(token: SyntaxKind.FalseKeyword): FalseLiteral; 3219 createToken<TKind extends PunctuationSyntaxKind>(token: TKind): PunctuationToken<TKind>; 3220 createToken<TKind extends KeywordTypeSyntaxKind>(token: TKind): KeywordTypeNode<TKind>; 3221 createToken<TKind extends ModifierSyntaxKind>(token: TKind): ModifierToken<TKind>; 3222 createToken<TKind extends KeywordSyntaxKind>(token: TKind): KeywordToken<TKind>; 3223 createToken<TKind extends SyntaxKind.Unknown | SyntaxKind.EndOfFileToken>(token: TKind): Token<TKind>; 3224 createSuper(): SuperExpression; 3225 createThis(): ThisExpression; 3226 createNull(): NullLiteral; 3227 createTrue(): TrueLiteral; 3228 createFalse(): FalseLiteral; 3229 createModifier<T extends ModifierSyntaxKind>(kind: T): ModifierToken<T>; 3230 createModifiersFromModifierFlags(flags: ModifierFlags): Modifier[]; 3231 createQualifiedName(left: EntityName, right: string | Identifier): QualifiedName; 3232 updateQualifiedName(node: QualifiedName, left: EntityName, right: Identifier): QualifiedName; 3233 createComputedPropertyName(expression: Expression): ComputedPropertyName; 3234 updateComputedPropertyName(node: ComputedPropertyName, expression: Expression): ComputedPropertyName; 3235 createTypeParameterDeclaration(name: string | Identifier, constraint?: TypeNode, defaultType?: TypeNode): TypeParameterDeclaration; 3236 updateTypeParameterDeclaration(node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration; 3237 createParameterDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken?: QuestionToken, type?: TypeNode, initializer?: Expression): ParameterDeclaration; 3238 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; 3239 createDecorator(expression: Expression): Decorator; 3240 updateDecorator(node: Decorator, expression: Expression): Decorator; 3241 createPropertySignature(modifiers: readonly Modifier[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature; 3242 updatePropertySignature(node: PropertySignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature; 3243 createPropertyDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; 3244 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; 3245 createMethodSignature(modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): MethodSignature; 3246 updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): MethodSignature; 3247 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; 3248 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; 3249 createConstructorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; 3250 updateConstructorDeclaration(node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; 3251 createGetAccessorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; 3252 updateGetAccessorDeclaration(node: GetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; 3253 createSetAccessorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration; 3254 updateSetAccessorDeclaration(node: SetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration; 3255 createCallSignature(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): CallSignatureDeclaration; 3256 updateCallSignature(node: CallSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): CallSignatureDeclaration; 3257 createConstructSignature(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): ConstructSignatureDeclaration; 3258 updateConstructSignature(node: ConstructSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): ConstructSignatureDeclaration; 3259 createIndexSignature(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; 3260 updateIndexSignature(node: IndexSignatureDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; 3261 createTemplateLiteralTypeSpan(type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; 3262 updateTemplateLiteralTypeSpan(node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; 3263 createKeywordTypeNode<TKind extends KeywordTypeSyntaxKind>(kind: TKind): KeywordTypeNode<TKind>; 3264 createTypePredicateNode(assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode | string, type: TypeNode | undefined): TypePredicateNode; 3265 updateTypePredicateNode(node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined): TypePredicateNode; 3266 createTypeReferenceNode(typeName: string | EntityName, typeArguments?: readonly TypeNode[]): TypeReferenceNode; 3267 updateTypeReferenceNode(node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray<TypeNode> | undefined): TypeReferenceNode; 3268 createFunctionTypeNode(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): FunctionTypeNode; 3269 updateFunctionTypeNode(node: FunctionTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode): FunctionTypeNode; 3270 createConstructorTypeNode(modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode; 3271 /** @deprecated */ 3272 createConstructorTypeNode(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode; 3273 updateConstructorTypeNode(node: ConstructorTypeNode, modifiers: readonly Modifier[] | undefined, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode): ConstructorTypeNode; 3274 /** @deprecated */ 3275 updateConstructorTypeNode(node: ConstructorTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode): ConstructorTypeNode; 3276 createTypeQueryNode(exprName: EntityName): TypeQueryNode; 3277 updateTypeQueryNode(node: TypeQueryNode, exprName: EntityName): TypeQueryNode; 3278 createTypeLiteralNode(members: readonly TypeElement[] | undefined): TypeLiteralNode; 3279 updateTypeLiteralNode(node: TypeLiteralNode, members: NodeArray<TypeElement>): TypeLiteralNode; 3280 createArrayTypeNode(elementType: TypeNode): ArrayTypeNode; 3281 updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode; 3282 createTupleTypeNode(elements: readonly (TypeNode | NamedTupleMember)[]): TupleTypeNode; 3283 updateTupleTypeNode(node: TupleTypeNode, elements: readonly (TypeNode | NamedTupleMember)[]): TupleTypeNode; 3284 createNamedTupleMember(dotDotDotToken: DotDotDotToken | undefined, name: Identifier, questionToken: QuestionToken | undefined, type: TypeNode): NamedTupleMember; 3285 updateNamedTupleMember(node: NamedTupleMember, dotDotDotToken: DotDotDotToken | undefined, name: Identifier, questionToken: QuestionToken | undefined, type: TypeNode): NamedTupleMember; 3286 createOptionalTypeNode(type: TypeNode): OptionalTypeNode; 3287 updateOptionalTypeNode(node: OptionalTypeNode, type: TypeNode): OptionalTypeNode; 3288 createRestTypeNode(type: TypeNode): RestTypeNode; 3289 updateRestTypeNode(node: RestTypeNode, type: TypeNode): RestTypeNode; 3290 createUnionTypeNode(types: readonly TypeNode[]): UnionTypeNode; 3291 updateUnionTypeNode(node: UnionTypeNode, types: NodeArray<TypeNode>): UnionTypeNode; 3292 createIntersectionTypeNode(types: readonly TypeNode[]): IntersectionTypeNode; 3293 updateIntersectionTypeNode(node: IntersectionTypeNode, types: NodeArray<TypeNode>): IntersectionTypeNode; 3294 createConditionalTypeNode(checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode; 3295 updateConditionalTypeNode(node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode; 3296 createInferTypeNode(typeParameter: TypeParameterDeclaration): InferTypeNode; 3297 updateInferTypeNode(node: InferTypeNode, typeParameter: TypeParameterDeclaration): InferTypeNode; 3298 createImportTypeNode(argument: TypeNode, qualifier?: EntityName, typeArguments?: readonly TypeNode[], isTypeOf?: boolean): ImportTypeNode; 3299 updateImportTypeNode(node: ImportTypeNode, argument: TypeNode, qualifier: EntityName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf?: boolean): ImportTypeNode; 3300 createParenthesizedType(type: TypeNode): ParenthesizedTypeNode; 3301 updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode; 3302 createThisTypeNode(): ThisTypeNode; 3303 createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode; 3304 updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; 3305 createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; 3306 updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; 3307 createMappedTypeNode(readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; 3308 updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; 3309 createLiteralTypeNode(literal: LiteralTypeNode["literal"]): LiteralTypeNode; 3310 updateLiteralTypeNode(node: LiteralTypeNode, literal: LiteralTypeNode["literal"]): LiteralTypeNode; 3311 createTemplateLiteralType(head: TemplateHead, templateSpans: readonly TemplateLiteralTypeSpan[]): TemplateLiteralTypeNode; 3312 updateTemplateLiteralType(node: TemplateLiteralTypeNode, head: TemplateHead, templateSpans: readonly TemplateLiteralTypeSpan[]): TemplateLiteralTypeNode; 3313 createObjectBindingPattern(elements: readonly BindingElement[]): ObjectBindingPattern; 3314 updateObjectBindingPattern(node: ObjectBindingPattern, elements: readonly BindingElement[]): ObjectBindingPattern; 3315 createArrayBindingPattern(elements: readonly ArrayBindingElement[]): ArrayBindingPattern; 3316 updateArrayBindingPattern(node: ArrayBindingPattern, elements: readonly ArrayBindingElement[]): ArrayBindingPattern; 3317 createBindingElement(dotDotDotToken: DotDotDotToken | undefined, propertyName: string | PropertyName | undefined, name: string | BindingName, initializer?: Expression): BindingElement; 3318 updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken | undefined, propertyName: PropertyName | undefined, name: BindingName, initializer: Expression | undefined): BindingElement; 3319 createArrayLiteralExpression(elements?: readonly Expression[], multiLine?: boolean): ArrayLiteralExpression; 3320 updateArrayLiteralExpression(node: ArrayLiteralExpression, elements: readonly Expression[]): ArrayLiteralExpression; 3321 createObjectLiteralExpression(properties?: readonly ObjectLiteralElementLike[], multiLine?: boolean): ObjectLiteralExpression; 3322 updateObjectLiteralExpression(node: ObjectLiteralExpression, properties: readonly ObjectLiteralElementLike[]): ObjectLiteralExpression; 3323 createPropertyAccessExpression(expression: Expression, name: string | Identifier | PrivateIdentifier): PropertyAccessExpression; 3324 updatePropertyAccessExpression(node: PropertyAccessExpression, expression: Expression, name: Identifier | PrivateIdentifier): PropertyAccessExpression; 3325 createPropertyAccessChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, name: string | Identifier | PrivateIdentifier): PropertyAccessChain; 3326 updatePropertyAccessChain(node: PropertyAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, name: Identifier | PrivateIdentifier): PropertyAccessChain; 3327 createElementAccessExpression(expression: Expression, index: number | Expression): ElementAccessExpression; 3328 updateElementAccessExpression(node: ElementAccessExpression, expression: Expression, argumentExpression: Expression): ElementAccessExpression; 3329 createElementAccessChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, index: number | Expression): ElementAccessChain; 3330 updateElementAccessChain(node: ElementAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, argumentExpression: Expression): ElementAccessChain; 3331 createCallExpression(expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): CallExpression; 3332 updateCallExpression(node: CallExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]): CallExpression; 3333 createCallChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): CallChain; 3334 updateCallChain(node: CallChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]): CallChain; 3335 createNewExpression(expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): NewExpression; 3336 updateNewExpression(node: NewExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): NewExpression; 3337 createTaggedTemplateExpression(tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression; 3338 updateTaggedTemplateExpression(node: TaggedTemplateExpression, tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression; 3339 createTypeAssertion(type: TypeNode, expression: Expression): TypeAssertion; 3340 updateTypeAssertion(node: TypeAssertion, type: TypeNode, expression: Expression): TypeAssertion; 3341 createParenthesizedExpression(expression: Expression): ParenthesizedExpression; 3342 updateParenthesizedExpression(node: ParenthesizedExpression, expression: Expression): ParenthesizedExpression; 3343 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; 3344 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; 3345 createArrowFunction(modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction; 3346 updateArrowFunction(node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken, body: ConciseBody): ArrowFunction; 3347 createEtsComponentExpression(name: Identifier, argumentExpression: readonly Expression[] | undefined, body: Block | undefined): EtsComponentExpression; 3348 updateEtsComponentExpression(node: EtsComponentExpression, name: Identifier | undefined, argumentExpression: readonly Expression[] | undefined, body: Block | undefined): EtsComponentExpression; 3349 createDeleteExpression(expression: Expression): DeleteExpression; 3350 updateDeleteExpression(node: DeleteExpression, expression: Expression): DeleteExpression; 3351 createTypeOfExpression(expression: Expression): TypeOfExpression; 3352 updateTypeOfExpression(node: TypeOfExpression, expression: Expression): TypeOfExpression; 3353 createVoidExpression(expression: Expression): VoidExpression; 3354 updateVoidExpression(node: VoidExpression, expression: Expression): VoidExpression; 3355 createAwaitExpression(expression: Expression): AwaitExpression; 3356 updateAwaitExpression(node: AwaitExpression, expression: Expression): AwaitExpression; 3357 createPrefixUnaryExpression(operator: PrefixUnaryOperator, operand: Expression): PrefixUnaryExpression; 3358 updatePrefixUnaryExpression(node: PrefixUnaryExpression, operand: Expression): PrefixUnaryExpression; 3359 createPostfixUnaryExpression(operand: Expression, operator: PostfixUnaryOperator): PostfixUnaryExpression; 3360 updatePostfixUnaryExpression(node: PostfixUnaryExpression, operand: Expression): PostfixUnaryExpression; 3361 createBinaryExpression(left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression): BinaryExpression; 3362 updateBinaryExpression(node: BinaryExpression, left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression): BinaryExpression; 3363 createConditionalExpression(condition: Expression, questionToken: QuestionToken | undefined, whenTrue: Expression, colonToken: ColonToken | undefined, whenFalse: Expression): ConditionalExpression; 3364 updateConditionalExpression(node: ConditionalExpression, condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression; 3365 createTemplateExpression(head: TemplateHead, templateSpans: readonly TemplateSpan[]): TemplateExpression; 3366 updateTemplateExpression(node: TemplateExpression, head: TemplateHead, templateSpans: readonly TemplateSpan[]): TemplateExpression; 3367 createTemplateHead(text: string, rawText?: string, templateFlags?: TokenFlags): TemplateHead; 3368 createTemplateHead(text: string | undefined, rawText: string, templateFlags?: TokenFlags): TemplateHead; 3369 createTemplateMiddle(text: string, rawText?: string, templateFlags?: TokenFlags): TemplateMiddle; 3370 createTemplateMiddle(text: string | undefined, rawText: string, templateFlags?: TokenFlags): TemplateMiddle; 3371 createTemplateTail(text: string, rawText?: string, templateFlags?: TokenFlags): TemplateTail; 3372 createTemplateTail(text: string | undefined, rawText: string, templateFlags?: TokenFlags): TemplateTail; 3373 createNoSubstitutionTemplateLiteral(text: string, rawText?: string): NoSubstitutionTemplateLiteral; 3374 createNoSubstitutionTemplateLiteral(text: string | undefined, rawText: string): NoSubstitutionTemplateLiteral; 3375 createYieldExpression(asteriskToken: AsteriskToken, expression: Expression): YieldExpression; 3376 createYieldExpression(asteriskToken: undefined, expression: Expression | undefined): YieldExpression; 3377 updateYieldExpression(node: YieldExpression, asteriskToken: AsteriskToken | undefined, expression: Expression | undefined): YieldExpression; 3378 createSpreadElement(expression: Expression): SpreadElement; 3379 updateSpreadElement(node: SpreadElement, expression: Expression): SpreadElement; 3380 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; 3381 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; 3382 createOmittedExpression(): OmittedExpression; 3383 createExpressionWithTypeArguments(expression: Expression, typeArguments: readonly TypeNode[] | undefined): ExpressionWithTypeArguments; 3384 updateExpressionWithTypeArguments(node: ExpressionWithTypeArguments, expression: Expression, typeArguments: readonly TypeNode[] | undefined): ExpressionWithTypeArguments; 3385 createAsExpression(expression: Expression, type: TypeNode): AsExpression; 3386 updateAsExpression(node: AsExpression, expression: Expression, type: TypeNode): AsExpression; 3387 createNonNullExpression(expression: Expression): NonNullExpression; 3388 updateNonNullExpression(node: NonNullExpression, expression: Expression): NonNullExpression; 3389 createNonNullChain(expression: Expression): NonNullChain; 3390 updateNonNullChain(node: NonNullChain, expression: Expression): NonNullChain; 3391 createMetaProperty(keywordToken: MetaProperty["keywordToken"], name: Identifier): MetaProperty; 3392 updateMetaProperty(node: MetaProperty, name: Identifier): MetaProperty; 3393 createTemplateSpan(expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; 3394 updateTemplateSpan(node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; 3395 createSemicolonClassElement(): SemicolonClassElement; 3396 createBlock(statements: readonly Statement[], multiLine?: boolean): Block; 3397 updateBlock(node: Block, statements: readonly Statement[]): Block; 3398 createVariableStatement(modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList | readonly VariableDeclaration[]): VariableStatement; 3399 updateVariableStatement(node: VariableStatement, modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList): VariableStatement; 3400 createEmptyStatement(): EmptyStatement; 3401 createExpressionStatement(expression: Expression): ExpressionStatement; 3402 updateExpressionStatement(node: ExpressionStatement, expression: Expression): ExpressionStatement; 3403 createIfStatement(expression: Expression, thenStatement: Statement, elseStatement?: Statement): IfStatement; 3404 updateIfStatement(node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement | undefined): IfStatement; 3405 createDoStatement(statement: Statement, expression: Expression): DoStatement; 3406 updateDoStatement(node: DoStatement, statement: Statement, expression: Expression): DoStatement; 3407 createWhileStatement(expression: Expression, statement: Statement): WhileStatement; 3408 updateWhileStatement(node: WhileStatement, expression: Expression, statement: Statement): WhileStatement; 3409 createForStatement(initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement; 3410 updateForStatement(node: ForStatement, initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement; 3411 createForInStatement(initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement; 3412 updateForInStatement(node: ForInStatement, initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement; 3413 createForOfStatement(awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement; 3414 updateForOfStatement(node: ForOfStatement, awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement; 3415 createContinueStatement(label?: string | Identifier): ContinueStatement; 3416 updateContinueStatement(node: ContinueStatement, label: Identifier | undefined): ContinueStatement; 3417 createBreakStatement(label?: string | Identifier): BreakStatement; 3418 updateBreakStatement(node: BreakStatement, label: Identifier | undefined): BreakStatement; 3419 createReturnStatement(expression?: Expression): ReturnStatement; 3420 updateReturnStatement(node: ReturnStatement, expression: Expression | undefined): ReturnStatement; 3421 createWithStatement(expression: Expression, statement: Statement): WithStatement; 3422 updateWithStatement(node: WithStatement, expression: Expression, statement: Statement): WithStatement; 3423 createSwitchStatement(expression: Expression, caseBlock: CaseBlock): SwitchStatement; 3424 updateSwitchStatement(node: SwitchStatement, expression: Expression, caseBlock: CaseBlock): SwitchStatement; 3425 createLabeledStatement(label: string | Identifier, statement: Statement): LabeledStatement; 3426 updateLabeledStatement(node: LabeledStatement, label: Identifier, statement: Statement): LabeledStatement; 3427 createThrowStatement(expression: Expression): ThrowStatement; 3428 updateThrowStatement(node: ThrowStatement, expression: Expression): ThrowStatement; 3429 createTryStatement(tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement; 3430 updateTryStatement(node: TryStatement, tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement; 3431 createDebuggerStatement(): DebuggerStatement; 3432 createVariableDeclaration(name: string | BindingName, exclamationToken?: ExclamationToken, type?: TypeNode, initializer?: Expression): VariableDeclaration; 3433 updateVariableDeclaration(node: VariableDeclaration, name: BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration; 3434 createVariableDeclarationList(declarations: readonly VariableDeclaration[], flags?: NodeFlags): VariableDeclarationList; 3435 updateVariableDeclarationList(node: VariableDeclarationList, declarations: readonly VariableDeclaration[]): VariableDeclarationList; 3436 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; 3437 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; 3438 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; 3439 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; 3440 createStructDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): StructDeclaration; 3441 updateStructDeclaration(node: StructDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): StructDeclaration; 3442 createInterfaceDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration; 3443 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; 3444 createTypeAliasDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration; 3445 updateTypeAliasDeclaration(node: TypeAliasDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration; 3446 createEnumDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration; 3447 updateEnumDeclaration(node: EnumDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration; 3448 createModuleDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration; 3449 updateModuleDeclaration(node: ModuleDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration; 3450 createModuleBlock(statements: readonly Statement[]): ModuleBlock; 3451 updateModuleBlock(node: ModuleBlock, statements: readonly Statement[]): ModuleBlock; 3452 createCaseBlock(clauses: readonly CaseOrDefaultClause[]): CaseBlock; 3453 updateCaseBlock(node: CaseBlock, clauses: readonly CaseOrDefaultClause[]): CaseBlock; 3454 createNamespaceExportDeclaration(name: string | Identifier): NamespaceExportDeclaration; 3455 updateNamespaceExportDeclaration(node: NamespaceExportDeclaration, name: Identifier): NamespaceExportDeclaration; 3456 createImportEqualsDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; 3457 updateImportEqualsDeclaration(node: ImportEqualsDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; 3458 createImportDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression): ImportDeclaration; 3459 updateImportDeclaration(node: ImportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression): ImportDeclaration; 3460 createImportClause(isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; 3461 updateImportClause(node: ImportClause, isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; 3462 createNamespaceImport(name: Identifier): NamespaceImport; 3463 updateNamespaceImport(node: NamespaceImport, name: Identifier): NamespaceImport; 3464 createNamespaceExport(name: Identifier): NamespaceExport; 3465 updateNamespaceExport(node: NamespaceExport, name: Identifier): NamespaceExport; 3466 createNamedImports(elements: readonly ImportSpecifier[]): NamedImports; 3467 updateNamedImports(node: NamedImports, elements: readonly ImportSpecifier[]): NamedImports; 3468 createImportSpecifier(propertyName: Identifier | undefined, name: Identifier): ImportSpecifier; 3469 updateImportSpecifier(node: ImportSpecifier, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier; 3470 createExportAssignment(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment; 3471 updateExportAssignment(node: ExportAssignment, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, expression: Expression): ExportAssignment; 3472 createExportDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression): ExportDeclaration; 3473 updateExportDeclaration(node: ExportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined): ExportDeclaration; 3474 createNamedExports(elements: readonly ExportSpecifier[]): NamedExports; 3475 updateNamedExports(node: NamedExports, elements: readonly ExportSpecifier[]): NamedExports; 3476 createExportSpecifier(propertyName: string | Identifier | undefined, name: string | Identifier): ExportSpecifier; 3477 updateExportSpecifier(node: ExportSpecifier, propertyName: Identifier | undefined, name: Identifier): ExportSpecifier; 3478 createExternalModuleReference(expression: Expression): ExternalModuleReference; 3479 updateExternalModuleReference(node: ExternalModuleReference, expression: Expression): ExternalModuleReference; 3480 createJSDocAllType(): JSDocAllType; 3481 createJSDocUnknownType(): JSDocUnknownType; 3482 createJSDocNonNullableType(type: TypeNode): JSDocNonNullableType; 3483 updateJSDocNonNullableType(node: JSDocNonNullableType, type: TypeNode): JSDocNonNullableType; 3484 createJSDocNullableType(type: TypeNode): JSDocNullableType; 3485 updateJSDocNullableType(node: JSDocNullableType, type: TypeNode): JSDocNullableType; 3486 createJSDocOptionalType(type: TypeNode): JSDocOptionalType; 3487 updateJSDocOptionalType(node: JSDocOptionalType, type: TypeNode): JSDocOptionalType; 3488 createJSDocFunctionType(parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): JSDocFunctionType; 3489 updateJSDocFunctionType(node: JSDocFunctionType, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): JSDocFunctionType; 3490 createJSDocVariadicType(type: TypeNode): JSDocVariadicType; 3491 updateJSDocVariadicType(node: JSDocVariadicType, type: TypeNode): JSDocVariadicType; 3492 createJSDocNamepathType(type: TypeNode): JSDocNamepathType; 3493 updateJSDocNamepathType(node: JSDocNamepathType, type: TypeNode): JSDocNamepathType; 3494 createJSDocTypeExpression(type: TypeNode): JSDocTypeExpression; 3495 updateJSDocTypeExpression(node: JSDocTypeExpression, type: TypeNode): JSDocTypeExpression; 3496 createJSDocNameReference(name: EntityName): JSDocNameReference; 3497 updateJSDocNameReference(node: JSDocNameReference, name: EntityName): JSDocNameReference; 3498 createJSDocTypeLiteral(jsDocPropertyTags?: readonly JSDocPropertyLikeTag[], isArrayType?: boolean): JSDocTypeLiteral; 3499 updateJSDocTypeLiteral(node: JSDocTypeLiteral, jsDocPropertyTags: readonly JSDocPropertyLikeTag[] | undefined, isArrayType: boolean | undefined): JSDocTypeLiteral; 3500 createJSDocSignature(typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type?: JSDocReturnTag): JSDocSignature; 3501 updateJSDocSignature(node: JSDocSignature, typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type: JSDocReturnTag | undefined): JSDocSignature; 3502 createJSDocTemplateTag(tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment?: string): JSDocTemplateTag; 3503 updateJSDocTemplateTag(node: JSDocTemplateTag, tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment: string | undefined): JSDocTemplateTag; 3504 createJSDocTypedefTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression | JSDocTypeLiteral, fullName?: Identifier | JSDocNamespaceDeclaration, comment?: string): JSDocTypedefTag; 3505 updateJSDocTypedefTag(node: JSDocTypedefTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | JSDocTypeLiteral | undefined, fullName: Identifier | JSDocNamespaceDeclaration | undefined, comment: string | undefined): JSDocTypedefTag; 3506 createJSDocParameterTag(tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression, isNameFirst?: boolean, comment?: string): JSDocParameterTag; 3507 updateJSDocParameterTag(node: JSDocParameterTag, tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression: JSDocTypeExpression | undefined, isNameFirst: boolean, comment: string | undefined): JSDocParameterTag; 3508 createJSDocPropertyTag(tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression, isNameFirst?: boolean, comment?: string): JSDocPropertyTag; 3509 updateJSDocPropertyTag(node: JSDocPropertyTag, tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression: JSDocTypeExpression | undefined, isNameFirst: boolean, comment: string | undefined): JSDocPropertyTag; 3510 createJSDocTypeTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocTypeTag; 3511 updateJSDocTypeTag(node: JSDocTypeTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | undefined): JSDocTypeTag; 3512 createJSDocSeeTag(tagName: Identifier | undefined, nameExpression: JSDocNameReference | undefined, comment?: string): JSDocSeeTag; 3513 updateJSDocSeeTag(node: JSDocSeeTag, tagName: Identifier | undefined, nameExpression: JSDocNameReference | undefined, comment?: string): JSDocSeeTag; 3514 createJSDocReturnTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression, comment?: string): JSDocReturnTag; 3515 updateJSDocReturnTag(node: JSDocReturnTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | undefined): JSDocReturnTag; 3516 createJSDocThisTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocThisTag; 3517 updateJSDocThisTag(node: JSDocThisTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | undefined): JSDocThisTag; 3518 createJSDocEnumTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocEnumTag; 3519 updateJSDocEnumTag(node: JSDocEnumTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | undefined): JSDocEnumTag; 3520 createJSDocCallbackTag(tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName?: Identifier | JSDocNamespaceDeclaration, comment?: string): JSDocCallbackTag; 3521 updateJSDocCallbackTag(node: JSDocCallbackTag, tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName: Identifier | JSDocNamespaceDeclaration | undefined, comment: string | undefined): JSDocCallbackTag; 3522 createJSDocAugmentsTag(tagName: Identifier | undefined, className: JSDocAugmentsTag["class"], comment?: string): JSDocAugmentsTag; 3523 updateJSDocAugmentsTag(node: JSDocAugmentsTag, tagName: Identifier | undefined, className: JSDocAugmentsTag["class"], comment: string | undefined): JSDocAugmentsTag; 3524 createJSDocImplementsTag(tagName: Identifier | undefined, className: JSDocImplementsTag["class"], comment?: string): JSDocImplementsTag; 3525 updateJSDocImplementsTag(node: JSDocImplementsTag, tagName: Identifier | undefined, className: JSDocImplementsTag["class"], comment: string | undefined): JSDocImplementsTag; 3526 createJSDocAuthorTag(tagName: Identifier | undefined, comment?: string): JSDocAuthorTag; 3527 updateJSDocAuthorTag(node: JSDocAuthorTag, tagName: Identifier | undefined, comment: string | undefined): JSDocAuthorTag; 3528 createJSDocClassTag(tagName: Identifier | undefined, comment?: string): JSDocClassTag; 3529 updateJSDocClassTag(node: JSDocClassTag, tagName: Identifier | undefined, comment: string | undefined): JSDocClassTag; 3530 createJSDocPublicTag(tagName: Identifier | undefined, comment?: string): JSDocPublicTag; 3531 updateJSDocPublicTag(node: JSDocPublicTag, tagName: Identifier | undefined, comment: string | undefined): JSDocPublicTag; 3532 createJSDocPrivateTag(tagName: Identifier | undefined, comment?: string): JSDocPrivateTag; 3533 updateJSDocPrivateTag(node: JSDocPrivateTag, tagName: Identifier | undefined, comment: string | undefined): JSDocPrivateTag; 3534 createJSDocProtectedTag(tagName: Identifier | undefined, comment?: string): JSDocProtectedTag; 3535 updateJSDocProtectedTag(node: JSDocProtectedTag, tagName: Identifier | undefined, comment: string | undefined): JSDocProtectedTag; 3536 createJSDocReadonlyTag(tagName: Identifier | undefined, comment?: string): JSDocReadonlyTag; 3537 updateJSDocReadonlyTag(node: JSDocReadonlyTag, tagName: Identifier | undefined, comment: string | undefined): JSDocReadonlyTag; 3538 createJSDocUnknownTag(tagName: Identifier, comment?: string): JSDocUnknownTag; 3539 updateJSDocUnknownTag(node: JSDocUnknownTag, tagName: Identifier, comment: string | undefined): JSDocUnknownTag; 3540 createJSDocDeprecatedTag(tagName: Identifier, comment?: string): JSDocDeprecatedTag; 3541 updateJSDocDeprecatedTag(node: JSDocDeprecatedTag, tagName: Identifier, comment?: string): JSDocDeprecatedTag; 3542 createJSDocComment(comment?: string | undefined, tags?: readonly JSDocTag[] | undefined): JSDoc; 3543 updateJSDocComment(node: JSDoc, comment: string | undefined, tags: readonly JSDocTag[] | undefined): JSDoc; 3544 createJsxElement(openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement): JsxElement; 3545 updateJsxElement(node: JsxElement, openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement): JsxElement; 3546 createJsxSelfClosingElement(tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxSelfClosingElement; 3547 updateJsxSelfClosingElement(node: JsxSelfClosingElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxSelfClosingElement; 3548 createJsxOpeningElement(tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxOpeningElement; 3549 updateJsxOpeningElement(node: JsxOpeningElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxOpeningElement; 3550 createJsxClosingElement(tagName: JsxTagNameExpression): JsxClosingElement; 3551 updateJsxClosingElement(node: JsxClosingElement, tagName: JsxTagNameExpression): JsxClosingElement; 3552 createJsxFragment(openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment): JsxFragment; 3553 createJsxText(text: string, containsOnlyTriviaWhiteSpaces?: boolean): JsxText; 3554 updateJsxText(node: JsxText, text: string, containsOnlyTriviaWhiteSpaces?: boolean): JsxText; 3555 createJsxOpeningFragment(): JsxOpeningFragment; 3556 createJsxJsxClosingFragment(): JsxClosingFragment; 3557 updateJsxFragment(node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment): JsxFragment; 3558 createJsxAttribute(name: Identifier, initializer: StringLiteral | JsxExpression | undefined): JsxAttribute; 3559 updateJsxAttribute(node: JsxAttribute, name: Identifier, initializer: StringLiteral | JsxExpression | undefined): JsxAttribute; 3560 createJsxAttributes(properties: readonly JsxAttributeLike[]): JsxAttributes; 3561 updateJsxAttributes(node: JsxAttributes, properties: readonly JsxAttributeLike[]): JsxAttributes; 3562 createJsxSpreadAttribute(expression: Expression): JsxSpreadAttribute; 3563 updateJsxSpreadAttribute(node: JsxSpreadAttribute, expression: Expression): JsxSpreadAttribute; 3564 createJsxExpression(dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined): JsxExpression; 3565 updateJsxExpression(node: JsxExpression, expression: Expression | undefined): JsxExpression; 3566 createCaseClause(expression: Expression, statements: readonly Statement[]): CaseClause; 3567 updateCaseClause(node: CaseClause, expression: Expression, statements: readonly Statement[]): CaseClause; 3568 createDefaultClause(statements: readonly Statement[]): DefaultClause; 3569 updateDefaultClause(node: DefaultClause, statements: readonly Statement[]): DefaultClause; 3570 createHeritageClause(token: HeritageClause["token"], types: readonly ExpressionWithTypeArguments[]): HeritageClause; 3571 updateHeritageClause(node: HeritageClause, types: readonly ExpressionWithTypeArguments[]): HeritageClause; 3572 createCatchClause(variableDeclaration: string | VariableDeclaration | undefined, block: Block): CatchClause; 3573 updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration | undefined, block: Block): CatchClause; 3574 createPropertyAssignment(name: string | PropertyName, initializer: Expression): PropertyAssignment; 3575 updatePropertyAssignment(node: PropertyAssignment, name: PropertyName, initializer: Expression): PropertyAssignment; 3576 createShorthandPropertyAssignment(name: string | Identifier, objectAssignmentInitializer?: Expression): ShorthandPropertyAssignment; 3577 updateShorthandPropertyAssignment(node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression | undefined): ShorthandPropertyAssignment; 3578 createSpreadAssignment(expression: Expression): SpreadAssignment; 3579 updateSpreadAssignment(node: SpreadAssignment, expression: Expression): SpreadAssignment; 3580 createEnumMember(name: string | PropertyName, initializer?: Expression): EnumMember; 3581 updateEnumMember(node: EnumMember, name: PropertyName, initializer: Expression | undefined): EnumMember; 3582 createSourceFile(statements: readonly Statement[], endOfFileToken: EndOfFileToken, flags: NodeFlags): SourceFile; 3583 updateSourceFile(node: SourceFile, statements: readonly Statement[], isDeclarationFile?: boolean, referencedFiles?: readonly FileReference[], typeReferences?: readonly FileReference[], hasNoDefaultLib?: boolean, libReferences?: readonly FileReference[]): SourceFile; 3584 createNotEmittedStatement(original: Node): NotEmittedStatement; 3585 createPartiallyEmittedExpression(expression: Expression, original?: Node): PartiallyEmittedExpression; 3586 updatePartiallyEmittedExpression(node: PartiallyEmittedExpression, expression: Expression): PartiallyEmittedExpression; 3587 createCommaListExpression(elements: readonly Expression[]): CommaListExpression; 3588 updateCommaListExpression(node: CommaListExpression, elements: readonly Expression[]): CommaListExpression; 3589 createBundle(sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; 3590 updateBundle(node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; 3591 createComma(left: Expression, right: Expression): BinaryExpression; 3592 createAssignment(left: ObjectLiteralExpression | ArrayLiteralExpression, right: Expression): DestructuringAssignment; 3593 createAssignment(left: Expression, right: Expression): AssignmentExpression<EqualsToken>; 3594 createLogicalOr(left: Expression, right: Expression): BinaryExpression; 3595 createLogicalAnd(left: Expression, right: Expression): BinaryExpression; 3596 createBitwiseOr(left: Expression, right: Expression): BinaryExpression; 3597 createBitwiseXor(left: Expression, right: Expression): BinaryExpression; 3598 createBitwiseAnd(left: Expression, right: Expression): BinaryExpression; 3599 createStrictEquality(left: Expression, right: Expression): BinaryExpression; 3600 createStrictInequality(left: Expression, right: Expression): BinaryExpression; 3601 createEquality(left: Expression, right: Expression): BinaryExpression; 3602 createInequality(left: Expression, right: Expression): BinaryExpression; 3603 createLessThan(left: Expression, right: Expression): BinaryExpression; 3604 createLessThanEquals(left: Expression, right: Expression): BinaryExpression; 3605 createGreaterThan(left: Expression, right: Expression): BinaryExpression; 3606 createGreaterThanEquals(left: Expression, right: Expression): BinaryExpression; 3607 createLeftShift(left: Expression, right: Expression): BinaryExpression; 3608 createRightShift(left: Expression, right: Expression): BinaryExpression; 3609 createUnsignedRightShift(left: Expression, right: Expression): BinaryExpression; 3610 createAdd(left: Expression, right: Expression): BinaryExpression; 3611 createSubtract(left: Expression, right: Expression): BinaryExpression; 3612 createMultiply(left: Expression, right: Expression): BinaryExpression; 3613 createDivide(left: Expression, right: Expression): BinaryExpression; 3614 createModulo(left: Expression, right: Expression): BinaryExpression; 3615 createExponent(left: Expression, right: Expression): BinaryExpression; 3616 createPrefixPlus(operand: Expression): PrefixUnaryExpression; 3617 createPrefixMinus(operand: Expression): PrefixUnaryExpression; 3618 createPrefixIncrement(operand: Expression): PrefixUnaryExpression; 3619 createPrefixDecrement(operand: Expression): PrefixUnaryExpression; 3620 createBitwiseNot(operand: Expression): PrefixUnaryExpression; 3621 createLogicalNot(operand: Expression): PrefixUnaryExpression; 3622 createPostfixIncrement(operand: Expression): PostfixUnaryExpression; 3623 createPostfixDecrement(operand: Expression): PostfixUnaryExpression; 3624 createImmediatelyInvokedFunctionExpression(statements: readonly Statement[]): CallExpression; 3625 createImmediatelyInvokedFunctionExpression(statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression; 3626 createImmediatelyInvokedArrowFunction(statements: readonly Statement[]): CallExpression; 3627 createImmediatelyInvokedArrowFunction(statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression; 3628 createVoidZero(): VoidExpression; 3629 createExportDefault(expression: Expression): ExportAssignment; 3630 createExternalModuleExport(exportName: Identifier): ExportDeclaration; 3631 restoreOuterExpressions(outerExpression: Expression | undefined, innerExpression: Expression, kinds?: OuterExpressionKinds): Expression; 3632 } 3633 export interface CoreTransformationContext { 3634 readonly factory: NodeFactory; 3635 /** Gets the compiler options supplied to the transformer. */ 3636 getCompilerOptions(): CompilerOptions; 3637 /** Starts a new lexical environment. */ 3638 startLexicalEnvironment(): void; 3639 /** Suspends the current lexical environment, usually after visiting a parameter list. */ 3640 suspendLexicalEnvironment(): void; 3641 /** Resumes a suspended lexical environment, usually before visiting a function body. */ 3642 resumeLexicalEnvironment(): void; 3643 /** Ends a lexical environment, returning any declarations. */ 3644 endLexicalEnvironment(): Statement[] | undefined; 3645 /** Hoists a function declaration to the containing scope. */ 3646 hoistFunctionDeclaration(node: FunctionDeclaration): void; 3647 /** Hoists a variable declaration to the containing scope. */ 3648 hoistVariableDeclaration(node: Identifier): void; 3649 } 3650 export interface TransformationContext extends CoreTransformationContext { 3651 /** Records a request for a non-scoped emit helper in the current context. */ 3652 requestEmitHelper(helper: EmitHelper): void; 3653 /** Gets and resets the requested non-scoped emit helpers. */ 3654 readEmitHelpers(): EmitHelper[] | undefined; 3655 /** Enables expression substitutions in the pretty printer for the provided SyntaxKind. */ 3656 enableSubstitution(kind: SyntaxKind): void; 3657 /** Determines whether expression substitutions are enabled for the provided node. */ 3658 isSubstitutionEnabled(node: Node): boolean; 3659 /** 3660 * Hook used by transformers to substitute expressions just before they 3661 * are emitted by the pretty printer. 3662 * 3663 * NOTE: Transformation hooks should only be modified during `Transformer` initialization, 3664 * before returning the `NodeTransformer` callback. 3665 */ 3666 onSubstituteNode: (hint: EmitHint, node: Node) => Node; 3667 /** 3668 * Enables before/after emit notifications in the pretty printer for the provided 3669 * SyntaxKind. 3670 */ 3671 enableEmitNotification(kind: SyntaxKind): void; 3672 /** 3673 * Determines whether before/after emit notifications should be raised in the pretty 3674 * printer when it emits a node. 3675 */ 3676 isEmitNotificationEnabled(node: Node): boolean; 3677 /** 3678 * Hook used to allow transformers to capture state before or after 3679 * the printer emits a node. 3680 * 3681 * NOTE: Transformation hooks should only be modified during `Transformer` initialization, 3682 * before returning the `NodeTransformer` callback. 3683 */ 3684 onEmitNode: (hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void) => void; 3685 } 3686 export interface TransformationResult<T extends Node> { 3687 /** Gets the transformed source files. */ 3688 transformed: T[]; 3689 /** Gets diagnostics for the transformation. */ 3690 diagnostics?: DiagnosticWithLocation[]; 3691 /** 3692 * Gets a substitute for a node, if one is available; otherwise, returns the original node. 3693 * 3694 * @param hint A hint as to the intended usage of the node. 3695 * @param node The node to substitute. 3696 */ 3697 substituteNode(hint: EmitHint, node: Node): Node; 3698 /** 3699 * Emits a node with possible notification. 3700 * 3701 * @param hint A hint as to the intended usage of the node. 3702 * @param node The node to emit. 3703 * @param emitCallback A callback used to emit the node. 3704 */ 3705 emitNodeWithNotification(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void; 3706 /** 3707 * Indicates if a given node needs an emit notification 3708 * 3709 * @param node The node to emit. 3710 */ 3711 isEmitNotificationEnabled?(node: Node): boolean; 3712 /** 3713 * Clean up EmitNode entries on any parse-tree nodes. 3714 */ 3715 dispose(): void; 3716 } 3717 /** 3718 * A function that is used to initialize and return a `Transformer` callback, which in turn 3719 * will be used to transform one or more nodes. 3720 */ 3721 export type TransformerFactory<T extends Node> = (context: TransformationContext) => Transformer<T>; 3722 /** 3723 * A function that transforms a node. 3724 */ 3725 export type Transformer<T extends Node> = (node: T) => T; 3726 /** 3727 * A function that accepts and possibly transforms a node. 3728 */ 3729 export type Visitor = (node: Node) => VisitResult<Node>; 3730 export interface NodeVisitor { 3731 <T extends Node>(nodes: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T; 3732 <T extends Node>(nodes: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T | undefined; 3733 } 3734 export interface NodesVisitor { 3735 <T extends Node>(nodes: NodeArray<T>, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T>; 3736 <T extends Node>(nodes: NodeArray<T> | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T> | undefined; 3737 } 3738 export type VisitResult<T extends Node> = T | T[] | undefined; 3739 export interface Printer { 3740 /** 3741 * Print a node and its subtree as-is, without any emit transformations. 3742 * @param hint A value indicating the purpose of a node. This is primarily used to 3743 * distinguish between an `Identifier` used in an expression position, versus an 3744 * `Identifier` used as an `IdentifierName` as part of a declaration. For most nodes you 3745 * should just pass `Unspecified`. 3746 * @param node The node to print. The node and its subtree are printed as-is, without any 3747 * emit transformations. 3748 * @param sourceFile A source file that provides context for the node. The source text of 3749 * the file is used to emit the original source content for literals and identifiers, while 3750 * the identifiers of the source file are used when generating unique names to avoid 3751 * collisions. 3752 */ 3753 printNode(hint: EmitHint, node: Node, sourceFile: SourceFile): string; 3754 /** 3755 * Prints a list of nodes using the given format flags 3756 */ 3757 printList<T extends Node>(format: ListFormat, list: NodeArray<T>, sourceFile: SourceFile): string; 3758 /** 3759 * Prints a source file as-is, without any emit transformations. 3760 */ 3761 printFile(sourceFile: SourceFile): string; 3762 /** 3763 * Prints a bundle of source files as-is, without any emit transformations. 3764 */ 3765 printBundle(bundle: Bundle): string; 3766 } 3767 export interface PrintHandlers { 3768 /** 3769 * A hook used by the Printer when generating unique names to avoid collisions with 3770 * globally defined names that exist outside of the current source file. 3771 */ 3772 hasGlobalName?(name: string): boolean; 3773 /** 3774 * A hook used by the Printer to provide notifications prior to emitting a node. A 3775 * compatible implementation **must** invoke `emitCallback` with the provided `hint` and 3776 * `node` values. 3777 * @param hint A hint indicating the intended purpose of the node. 3778 * @param node The node to emit. 3779 * @param emitCallback A callback that, when invoked, will emit the node. 3780 * @example 3781 * ```ts 3782 * var printer = createPrinter(printerOptions, { 3783 * onEmitNode(hint, node, emitCallback) { 3784 * // set up or track state prior to emitting the node... 3785 * emitCallback(hint, node); 3786 * // restore state after emitting the node... 3787 * } 3788 * }); 3789 * ``` 3790 */ 3791 onEmitNode?(hint: EmitHint, node: Node | undefined, emitCallback: (hint: EmitHint, node: Node | undefined) => void): void; 3792 /** 3793 * A hook used to check if an emit notification is required for a node. 3794 * @param node The node to emit. 3795 */ 3796 isEmitNotificationEnabled?(node: Node | undefined): boolean; 3797 /** 3798 * A hook used by the Printer to perform just-in-time substitution of a node. This is 3799 * primarily used by node transformations that need to substitute one node for another, 3800 * such as replacing `myExportedVar` with `exports.myExportedVar`. 3801 * @param hint A hint indicating the intended purpose of the node. 3802 * @param node The node to emit. 3803 * @example 3804 * ```ts 3805 * var printer = createPrinter(printerOptions, { 3806 * substituteNode(hint, node) { 3807 * // perform substitution if necessary... 3808 * return node; 3809 * } 3810 * }); 3811 * ``` 3812 */ 3813 substituteNode?(hint: EmitHint, node: Node): Node; 3814 } 3815 export interface PrinterOptions { 3816 removeComments?: boolean; 3817 newLine?: NewLineKind; 3818 omitTrailingSemicolon?: boolean; 3819 noEmitHelpers?: boolean; 3820 } 3821 export interface GetEffectiveTypeRootsHost { 3822 directoryExists?(directoryName: string): boolean; 3823 getCurrentDirectory?(): string; 3824 } 3825 export interface TextSpan { 3826 start: number; 3827 length: number; 3828 } 3829 export interface TextChangeRange { 3830 span: TextSpan; 3831 newLength: number; 3832 } 3833 export interface SyntaxList extends Node { 3834 kind: SyntaxKind.SyntaxList; 3835 _children: Node[]; 3836 } 3837 export enum ListFormat { 3838 None = 0, 3839 SingleLine = 0, 3840 MultiLine = 1, 3841 PreserveLines = 2, 3842 LinesMask = 3, 3843 NotDelimited = 0, 3844 BarDelimited = 4, 3845 AmpersandDelimited = 8, 3846 CommaDelimited = 16, 3847 AsteriskDelimited = 32, 3848 DelimitersMask = 60, 3849 AllowTrailingComma = 64, 3850 Indented = 128, 3851 SpaceBetweenBraces = 256, 3852 SpaceBetweenSiblings = 512, 3853 Braces = 1024, 3854 Parenthesis = 2048, 3855 AngleBrackets = 4096, 3856 SquareBrackets = 8192, 3857 BracketsMask = 15360, 3858 OptionalIfUndefined = 16384, 3859 OptionalIfEmpty = 32768, 3860 Optional = 49152, 3861 PreferNewLine = 65536, 3862 NoTrailingNewLine = 131072, 3863 NoInterveningComments = 262144, 3864 NoSpaceIfEmpty = 524288, 3865 SingleElement = 1048576, 3866 SpaceAfterList = 2097152, 3867 Modifiers = 262656, 3868 HeritageClauses = 512, 3869 SingleLineTypeLiteralMembers = 768, 3870 MultiLineTypeLiteralMembers = 32897, 3871 SingleLineTupleTypeElements = 528, 3872 MultiLineTupleTypeElements = 657, 3873 UnionTypeConstituents = 516, 3874 IntersectionTypeConstituents = 520, 3875 ObjectBindingPatternElements = 525136, 3876 ArrayBindingPatternElements = 524880, 3877 ObjectLiteralExpressionProperties = 526226, 3878 ArrayLiteralExpressionElements = 8914, 3879 CommaListElements = 528, 3880 CallExpressionArguments = 2576, 3881 NewExpressionArguments = 18960, 3882 TemplateExpressionSpans = 262144, 3883 SingleLineBlockStatements = 768, 3884 MultiLineBlockStatements = 129, 3885 VariableDeclarationList = 528, 3886 SingleLineFunctionBodyStatements = 768, 3887 MultiLineFunctionBodyStatements = 1, 3888 ClassHeritageClauses = 0, 3889 ClassMembers = 129, 3890 InterfaceMembers = 129, 3891 EnumMembers = 145, 3892 CaseBlockClauses = 129, 3893 NamedImportsOrExportsElements = 525136, 3894 JsxElementOrFragmentChildren = 262144, 3895 JsxElementAttributes = 262656, 3896 CaseOrDefaultClauseStatements = 163969, 3897 HeritageClauseTypes = 528, 3898 SourceFileStatements = 131073, 3899 Decorators = 2146305, 3900 TypeArguments = 53776, 3901 TypeParameters = 53776, 3902 Parameters = 2576, 3903 IndexSignatureParameters = 8848, 3904 JSDocComment = 33 3905 } 3906 export interface UserPreferences { 3907 readonly disableSuggestions?: boolean; 3908 readonly quotePreference?: "auto" | "double" | "single"; 3909 readonly includeCompletionsForModuleExports?: boolean; 3910 readonly includeAutomaticOptionalChainCompletions?: boolean; 3911 readonly includeCompletionsWithInsertText?: boolean; 3912 readonly importModuleSpecifierPreference?: "shortest" | "project-relative" | "relative" | "non-relative"; 3913 /** Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js" */ 3914 readonly importModuleSpecifierEnding?: "auto" | "minimal" | "index" | "js"; 3915 readonly allowTextChangesInNewFiles?: boolean; 3916 readonly providePrefixAndSuffixTextForRename?: boolean; 3917 readonly includePackageJsonAutoImports?: "auto" | "on" | "off"; 3918 readonly provideRefactorNotApplicableReason?: boolean; 3919 } 3920 /** Represents a bigint literal value without requiring bigint support */ 3921 export interface PseudoBigInt { 3922 negative: boolean; 3923 base10Value: string; 3924 } 3925 export {}; 3926} 3927declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any; 3928declare function clearTimeout(handle: any): void; 3929declare namespace ts { 3930 export enum FileWatcherEventKind { 3931 Created = 0, 3932 Changed = 1, 3933 Deleted = 2 3934 } 3935 export type FileWatcherCallback = (fileName: string, eventKind: FileWatcherEventKind) => void; 3936 export type DirectoryWatcherCallback = (fileName: string) => void; 3937 export interface System { 3938 args: string[]; 3939 newLine: string; 3940 useCaseSensitiveFileNames: boolean; 3941 write(s: string): void; 3942 writeOutputIsTTY?(): boolean; 3943 readFile(path: string, encoding?: string): string | undefined; 3944 getFileSize?(path: string): number; 3945 writeFile(path: string, data: string, writeByteOrderMark?: boolean): void; 3946 /** 3947 * @pollingInterval - this parameter is used in polling-based watchers and ignored in watchers that 3948 * use native OS file watching 3949 */ 3950 watchFile?(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: WatchOptions): FileWatcher; 3951 watchDirectory?(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: WatchOptions): FileWatcher; 3952 resolvePath(path: string): string; 3953 fileExists(path: string): boolean; 3954 directoryExists(path: string): boolean; 3955 createDirectory(path: string): void; 3956 getExecutingFilePath(): string; 3957 getCurrentDirectory(): string; 3958 getDirectories(path: string): string[]; 3959 readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[]; 3960 getModifiedTime?(path: string): Date | undefined; 3961 setModifiedTime?(path: string, time: Date): void; 3962 deleteFile?(path: string): void; 3963 /** 3964 * A good implementation is node.js' `crypto.createHash`. (https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm) 3965 */ 3966 createHash?(data: string): string; 3967 /** This must be cryptographically secure. Only implement this method using `crypto.createHash("sha256")`. */ 3968 createSHA256Hash?(data: string): string; 3969 getMemoryUsage?(): number; 3970 exit(exitCode?: number): void; 3971 realpath?(path: string): string; 3972 setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any; 3973 clearTimeout?(timeoutId: any): void; 3974 clearScreen?(): void; 3975 base64decode?(input: string): string; 3976 base64encode?(input: string): string; 3977 } 3978 export interface FileWatcher { 3979 close(): void; 3980 } 3981 export function getNodeMajorVersion(): number | undefined; 3982 export let sys: System; 3983 export {}; 3984} 3985declare namespace ts { 3986 type ErrorCallback = (message: DiagnosticMessage, length: number) => void; 3987 interface Scanner { 3988 getStartPos(): number; 3989 getToken(): SyntaxKind; 3990 getTextPos(): number; 3991 getTokenPos(): number; 3992 getTokenText(): string; 3993 getTokenValue(): string; 3994 hasUnicodeEscape(): boolean; 3995 hasExtendedUnicodeEscape(): boolean; 3996 hasPrecedingLineBreak(): boolean; 3997 isIdentifier(): boolean; 3998 isReservedWord(): boolean; 3999 isUnterminated(): boolean; 4000 reScanGreaterToken(): SyntaxKind; 4001 reScanSlashToken(): SyntaxKind; 4002 reScanAsteriskEqualsToken(): SyntaxKind; 4003 reScanTemplateToken(isTaggedTemplate: boolean): SyntaxKind; 4004 reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind; 4005 scanJsxIdentifier(): SyntaxKind; 4006 scanJsxAttributeValue(): SyntaxKind; 4007 reScanJsxAttributeValue(): SyntaxKind; 4008 reScanJsxToken(): JsxTokenSyntaxKind; 4009 reScanLessThanToken(): SyntaxKind; 4010 reScanQuestionToken(): SyntaxKind; 4011 reScanInvalidIdentifier(): SyntaxKind; 4012 scanJsxToken(): JsxTokenSyntaxKind; 4013 scanJsDocToken(): JSDocSyntaxKind; 4014 scan(): SyntaxKind; 4015 getText(): string; 4016 setText(text: string | undefined, start?: number, length?: number): void; 4017 setOnError(onError: ErrorCallback | undefined): void; 4018 setScriptTarget(scriptTarget: ScriptTarget): void; 4019 setLanguageVariant(variant: LanguageVariant): void; 4020 setTextPos(textPos: number): void; 4021 lookAhead<T>(callback: () => T): T; 4022 scanRange<T>(start: number, length: number, callback: () => T): T; 4023 tryScan<T>(callback: () => T): T; 4024 } 4025 function tokenToString(t: SyntaxKind): string | undefined; 4026 function getPositionOfLineAndCharacter(sourceFile: SourceFileLike, line: number, character: number): number; 4027 function getLineAndCharacterOfPosition(sourceFile: SourceFileLike, position: number): LineAndCharacter; 4028 function isWhiteSpaceLike(ch: number): boolean; 4029 /** Does not include line breaks. For that, see isWhiteSpaceLike. */ 4030 function isWhiteSpaceSingleLine(ch: number): boolean; 4031 function isLineBreak(ch: number): boolean; 4032 function couldStartTrivia(text: string, pos: number): boolean; 4033 function forEachLeadingCommentRange<U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined; 4034 function forEachLeadingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined; 4035 function forEachTrailingCommentRange<U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined; 4036 function forEachTrailingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined; 4037 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; 4038 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; 4039 function getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined; 4040 function getTrailingCommentRanges(text: string, pos: number): CommentRange[] | undefined; 4041 /** Optionally, get the shebang */ 4042 function getShebang(text: string): string | undefined; 4043 function isIdentifierStart(ch: number, languageVersion: ScriptTarget | undefined): boolean; 4044 function isIdentifierPart(ch: number, languageVersion: ScriptTarget | undefined, identifierVariant?: LanguageVariant): boolean; 4045 function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, textInitial?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner; 4046} 4047declare namespace ts { 4048 function isExternalModuleNameRelative(moduleName: string): boolean; 4049 function sortAndDeduplicateDiagnostics<T extends Diagnostic>(diagnostics: readonly T[]): SortedReadonlyArray<T>; 4050 function getDefaultLibFileName(options: CompilerOptions): string; 4051 function textSpanEnd(span: TextSpan): number; 4052 function textSpanIsEmpty(span: TextSpan): boolean; 4053 function textSpanContainsPosition(span: TextSpan, position: number): boolean; 4054 function textSpanContainsTextSpan(span: TextSpan, other: TextSpan): boolean; 4055 function textSpanOverlapsWith(span: TextSpan, other: TextSpan): boolean; 4056 function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan | undefined; 4057 function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan): boolean; 4058 function textSpanIntersectsWith(span: TextSpan, start: number, length: number): boolean; 4059 function decodedTextSpanIntersectsWith(start1: number, length1: number, start2: number, length2: number): boolean; 4060 function textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean; 4061 function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan | undefined; 4062 function createTextSpan(start: number, length: number): TextSpan; 4063 function createTextSpanFromBounds(start: number, end: number): TextSpan; 4064 function textChangeRangeNewSpan(range: TextChangeRange): TextSpan; 4065 function textChangeRangeIsUnchanged(range: TextChangeRange): boolean; 4066 function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange; 4067 let unchangedTextChangeRange: TextChangeRange; 4068 /** 4069 * Called to merge all the changes that occurred across several versions of a script snapshot 4070 * into a single change. i.e. if a user keeps making successive edits to a script we will 4071 * have a text change from V1 to V2, V2 to V3, ..., Vn. 4072 * 4073 * This function will then merge those changes into a single change range valid between V1 and 4074 * Vn. 4075 */ 4076 function collapseTextChangeRangesAcrossMultipleVersions(changes: readonly TextChangeRange[]): TextChangeRange; 4077 function getTypeParameterOwner(d: Declaration): Declaration | undefined; 4078 type ParameterPropertyDeclaration = ParameterDeclaration & { 4079 parent: ConstructorDeclaration; 4080 name: Identifier; 4081 }; 4082 function isParameterPropertyDeclaration(node: Node, parent: Node): node is ParameterPropertyDeclaration; 4083 function isEmptyBindingPattern(node: BindingName): node is BindingPattern; 4084 function isEmptyBindingElement(node: BindingElement): boolean; 4085 function walkUpBindingElementsAndPatterns(binding: BindingElement): VariableDeclaration | ParameterDeclaration; 4086 function getCombinedModifierFlags(node: Declaration): ModifierFlags; 4087 function getCombinedNodeFlags(node: Node): NodeFlags; 4088 /** 4089 * Checks to see if the locale is in the appropriate format, 4090 * and if it is, attempts to set the appropriate language. 4091 */ 4092 function validateLocaleAndSetLanguage(locale: string, sys: { 4093 getExecutingFilePath(): string; 4094 resolvePath(path: string): string; 4095 fileExists(fileName: string): boolean; 4096 readFile(fileName: string): string | undefined; 4097 }, errors?: Push<Diagnostic>): void; 4098 function getOriginalNode(node: Node): Node; 4099 function getOriginalNode<T extends Node>(node: Node, nodeTest: (node: Node) => node is T): T; 4100 function getOriginalNode(node: Node | undefined): Node | undefined; 4101 function getOriginalNode<T extends Node>(node: Node | undefined, nodeTest: (node: Node | undefined) => node is T): T | undefined; 4102 /** 4103 * Iterates through the parent chain of a node and performs the callback on each parent until the callback 4104 * returns a truthy value, then returns that value. 4105 * If no such value is found, it applies the callback until the parent pointer is undefined or the callback returns "quit" 4106 * At that point findAncestor returns undefined. 4107 */ 4108 function findAncestor<T extends Node>(node: Node | undefined, callback: (element: Node) => element is T): T | undefined; 4109 function findAncestor(node: Node | undefined, callback: (element: Node) => boolean | "quit"): Node | undefined; 4110 /** 4111 * Gets a value indicating whether a node originated in the parse tree. 4112 * 4113 * @param node The node to test. 4114 */ 4115 function isParseTreeNode(node: Node): boolean; 4116 /** 4117 * Gets the original parse tree node for a node. 4118 * 4119 * @param node The original node. 4120 * @returns The original parse tree node if found; otherwise, undefined. 4121 */ 4122 function getParseTreeNode(node: Node | undefined): Node | undefined; 4123 /** 4124 * Gets the original parse tree node for a node. 4125 * 4126 * @param node The original node. 4127 * @param nodeTest A callback used to ensure the correct type of parse tree node is returned. 4128 * @returns The original parse tree node if found; otherwise, undefined. 4129 */ 4130 function getParseTreeNode<T extends Node>(node: T | undefined, nodeTest?: (node: Node) => node is T): T | undefined; 4131 /** Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' */ 4132 function escapeLeadingUnderscores(identifier: string): __String; 4133 /** 4134 * Remove extra underscore from escaped identifier text content. 4135 * 4136 * @param identifier The escaped identifier text. 4137 * @returns The unescaped identifier text. 4138 */ 4139 function unescapeLeadingUnderscores(identifier: __String): string; 4140 function idText(identifierOrPrivateName: Identifier | PrivateIdentifier): string; 4141 function symbolName(symbol: Symbol): string; 4142 function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | PrivateIdentifier | undefined; 4143 function getNameOfDeclaration(declaration: Declaration | Expression): DeclarationName | undefined; 4144 /** 4145 * Gets the JSDoc parameter tags for the node if present. 4146 * 4147 * @remarks Returns any JSDoc param tag whose name matches the provided 4148 * parameter, whether a param tag on a containing function 4149 * expression, or a param tag on a variable declaration whose 4150 * initializer is the containing function. The tags closest to the 4151 * node are returned first, so in the previous example, the param 4152 * tag on the containing function expression would be first. 4153 * 4154 * For binding patterns, parameter tags are matched by position. 4155 */ 4156 function getJSDocParameterTags(param: ParameterDeclaration): readonly JSDocParameterTag[]; 4157 /** 4158 * Gets the JSDoc type parameter tags for the node if present. 4159 * 4160 * @remarks Returns any JSDoc template tag whose names match the provided 4161 * parameter, whether a template tag on a containing function 4162 * expression, or a template tag on a variable declaration whose 4163 * initializer is the containing function. The tags closest to the 4164 * node are returned first, so in the previous example, the template 4165 * tag on the containing function expression would be first. 4166 */ 4167 function getJSDocTypeParameterTags(param: TypeParameterDeclaration): readonly JSDocTemplateTag[]; 4168 /** 4169 * Return true if the node has JSDoc parameter tags. 4170 * 4171 * @remarks Includes parameter tags that are not directly on the node, 4172 * for example on a variable declaration whose initializer is a function expression. 4173 */ 4174 function hasJSDocParameterTags(node: FunctionLikeDeclaration | SignatureDeclaration): boolean; 4175 /** Gets the JSDoc augments tag for the node if present */ 4176 function getJSDocAugmentsTag(node: Node): JSDocAugmentsTag | undefined; 4177 /** Gets the JSDoc implements tags for the node if present */ 4178 function getJSDocImplementsTags(node: Node): readonly JSDocImplementsTag[]; 4179 /** Gets the JSDoc class tag for the node if present */ 4180 function getJSDocClassTag(node: Node): JSDocClassTag | undefined; 4181 /** Gets the JSDoc public tag for the node if present */ 4182 function getJSDocPublicTag(node: Node): JSDocPublicTag | undefined; 4183 /** Gets the JSDoc private tag for the node if present */ 4184 function getJSDocPrivateTag(node: Node): JSDocPrivateTag | undefined; 4185 /** Gets the JSDoc protected tag for the node if present */ 4186 function getJSDocProtectedTag(node: Node): JSDocProtectedTag | undefined; 4187 /** Gets the JSDoc protected tag for the node if present */ 4188 function getJSDocReadonlyTag(node: Node): JSDocReadonlyTag | undefined; 4189 /** Gets the JSDoc deprecated tag for the node if present */ 4190 function getJSDocDeprecatedTag(node: Node): JSDocDeprecatedTag | undefined; 4191 /** Gets the JSDoc enum tag for the node if present */ 4192 function getJSDocEnumTag(node: Node): JSDocEnumTag | undefined; 4193 /** Gets the JSDoc this tag for the node if present */ 4194 function getJSDocThisTag(node: Node): JSDocThisTag | undefined; 4195 /** Gets the JSDoc return tag for the node if present */ 4196 function getJSDocReturnTag(node: Node): JSDocReturnTag | undefined; 4197 /** Gets the JSDoc template tag for the node if present */ 4198 function getJSDocTemplateTag(node: Node): JSDocTemplateTag | undefined; 4199 /** Gets the JSDoc type tag for the node if present and valid */ 4200 function getJSDocTypeTag(node: Node): JSDocTypeTag | undefined; 4201 /** 4202 * Gets the type node for the node if provided via JSDoc. 4203 * 4204 * @remarks The search includes any JSDoc param tag that relates 4205 * to the provided parameter, for example a type tag on the 4206 * parameter itself, or a param tag on a containing function 4207 * expression, or a param tag on a variable declaration whose 4208 * initializer is the containing function. The tags closest to the 4209 * node are examined first, so in the previous example, the type 4210 * tag directly on the node would be returned. 4211 */ 4212 function getJSDocType(node: Node): TypeNode | undefined; 4213 /** 4214 * Gets the return type node for the node if provided via JSDoc return tag or type tag. 4215 * 4216 * @remarks `getJSDocReturnTag` just gets the whole JSDoc tag. This function 4217 * gets the type from inside the braces, after the fat arrow, etc. 4218 */ 4219 function getJSDocReturnType(node: Node): TypeNode | undefined; 4220 /** Get all JSDoc tags related to a node, including those on parent nodes. */ 4221 function getJSDocTags(node: Node): readonly JSDocTag[]; 4222 /** Gets all JSDoc tags that match a specified predicate */ 4223 function getAllJSDocTags<T extends JSDocTag>(node: Node, predicate: (tag: JSDocTag) => tag is T): readonly T[]; 4224 /** Gets all JSDoc tags of a specified kind */ 4225 function getAllJSDocTagsOfKind(node: Node, kind: SyntaxKind): readonly JSDocTag[]; 4226 /** 4227 * Gets the effective type parameters. If the node was parsed in a 4228 * JavaScript file, gets the type parameters from the `@template` tag from JSDoc. 4229 */ 4230 function getEffectiveTypeParameterDeclarations(node: DeclarationWithTypeParameters): readonly TypeParameterDeclaration[]; 4231 function getEffectiveConstraintOfTypeParameter(node: TypeParameterDeclaration): TypeNode | undefined; 4232 function isIdentifierOrPrivateIdentifier(node: Node): node is Identifier | PrivateIdentifier; 4233 function isPropertyAccessChain(node: Node): node is PropertyAccessChain; 4234 function isElementAccessChain(node: Node): node is ElementAccessChain; 4235 function isCallChain(node: Node): node is CallChain; 4236 function isOptionalChain(node: Node): node is PropertyAccessChain | ElementAccessChain | CallChain | NonNullChain; 4237 function isNullishCoalesce(node: Node): boolean; 4238 function isConstTypeReference(node: Node): boolean; 4239 function skipPartiallyEmittedExpressions(node: Expression): Expression; 4240 function skipPartiallyEmittedExpressions(node: Node): Node; 4241 function isNonNullChain(node: Node): node is NonNullChain; 4242 function isBreakOrContinueStatement(node: Node): node is BreakOrContinueStatement; 4243 function isNamedExportBindings(node: Node): node is NamedExportBindings; 4244 function isUnparsedTextLike(node: Node): node is UnparsedTextLike; 4245 function isUnparsedNode(node: Node): node is UnparsedNode; 4246 function isJSDocPropertyLikeTag(node: Node): node is JSDocPropertyLikeTag; 4247 /** 4248 * True if node is of some token syntax kind. 4249 * For example, this is true for an IfKeyword but not for an IfStatement. 4250 * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. 4251 */ 4252 function isToken(n: Node): boolean; 4253 function isLiteralExpression(node: Node): node is LiteralExpression; 4254 function isTemplateLiteralToken(node: Node): node is TemplateLiteralToken; 4255 function isTemplateMiddleOrTemplateTail(node: Node): node is TemplateMiddle | TemplateTail; 4256 function isImportOrExportSpecifier(node: Node): node is ImportSpecifier | ExportSpecifier; 4257 function isTypeOnlyImportOrExportDeclaration(node: Node): node is TypeOnlyCompatibleAliasDeclaration; 4258 function isStringTextContainingNode(node: Node): node is StringLiteral | TemplateLiteralToken; 4259 function isModifier(node: Node): node is Modifier; 4260 function isEntityName(node: Node): node is EntityName; 4261 function isPropertyName(node: Node): node is PropertyName; 4262 function isBindingName(node: Node): node is BindingName; 4263 function isFunctionLike(node: Node): node is SignatureDeclaration; 4264 function isClassElement(node: Node): node is ClassElement; 4265 function isClassLike(node: Node): node is ClassLikeDeclaration; 4266 function isAccessor(node: Node): node is AccessorDeclaration; 4267 function isTypeElement(node: Node): node is TypeElement; 4268 function isClassOrTypeElement(node: Node): node is ClassElement | TypeElement; 4269 function isObjectLiteralElementLike(node: Node): node is ObjectLiteralElementLike; 4270 /** 4271 * Node test that determines whether a node is a valid type node. 4272 * This differs from the `isPartOfTypeNode` function which determines whether a node is *part* 4273 * of a TypeNode. 4274 */ 4275 function isTypeNode(node: Node): node is TypeNode; 4276 function isFunctionOrConstructorTypeNode(node: Node): node is FunctionTypeNode | ConstructorTypeNode; 4277 function isPropertyAccessOrQualifiedName(node: Node): node is PropertyAccessExpression | QualifiedName; 4278 function isCallLikeExpression(node: Node): node is CallLikeExpression; 4279 function isCallOrNewExpression(node: Node): node is CallExpression | NewExpression; 4280 function isTemplateLiteral(node: Node): node is TemplateLiteral; 4281 function isAssertionExpression(node: Node): node is AssertionExpression; 4282 function isIterationStatement(node: Node, lookInLabeledStatements: false): node is IterationStatement; 4283 function isIterationStatement(node: Node, lookInLabeledStatements: boolean): node is IterationStatement | LabeledStatement; 4284 function isJsxOpeningLikeElement(node: Node): node is JsxOpeningLikeElement; 4285 function isCaseOrDefaultClause(node: Node): node is CaseOrDefaultClause; 4286 /** True if node is of a kind that may contain comment text. */ 4287 function isJSDocCommentContainingNode(node: Node): boolean; 4288 function isSetAccessor(node: Node): node is SetAccessorDeclaration; 4289 function isGetAccessor(node: Node): node is GetAccessorDeclaration; 4290 /** True if has initializer node attached to it. */ 4291 function hasOnlyExpressionInitializer(node: Node): node is HasExpressionInitializer; 4292 function isObjectLiteralElement(node: Node): node is ObjectLiteralElement; 4293 function isStringLiteralLike(node: Node): node is StringLiteralLike; 4294} 4295declare namespace ts { 4296 const factory: NodeFactory; 4297 function createUnparsedSourceFile(text: string): UnparsedSource; 4298 function createUnparsedSourceFile(inputFile: InputFiles, type: "js" | "dts", stripInternal?: boolean): UnparsedSource; 4299 function createUnparsedSourceFile(text: string, mapPath: string | undefined, map: string | undefined): UnparsedSource; 4300 function createInputFiles(javascriptText: string, declarationText: string): InputFiles; 4301 function createInputFiles(readFileText: (path: string) => string | undefined, javascriptPath: string, javascriptMapPath: string | undefined, declarationPath: string, declarationMapPath: string | undefined, buildInfoPath: string | undefined): InputFiles; 4302 function createInputFiles(javascriptText: string, declarationText: string, javascriptMapPath: string | undefined, javascriptMapText: string | undefined, declarationMapPath: string | undefined, declarationMapText: string | undefined): InputFiles; 4303 /** 4304 * Create an external source map source file reference 4305 */ 4306 function createSourceMapSource(fileName: string, text: string, skipTrivia?: (pos: number) => number): SourceMapSource; 4307 function setOriginalNode<T extends Node>(node: T, original: Node | undefined): T; 4308} 4309declare namespace ts { 4310 /** 4311 * Clears any `EmitNode` entries from parse-tree nodes. 4312 * @param sourceFile A source file. 4313 */ 4314 function disposeEmitNodes(sourceFile: SourceFile | undefined): void; 4315 /** 4316 * Sets flags that control emit behavior of a node. 4317 */ 4318 function setEmitFlags<T extends Node>(node: T, emitFlags: EmitFlags): T; 4319 /** 4320 * Gets a custom text range to use when emitting source maps. 4321 */ 4322 function getSourceMapRange(node: Node): SourceMapRange; 4323 /** 4324 * Sets a custom text range to use when emitting source maps. 4325 */ 4326 function setSourceMapRange<T extends Node>(node: T, range: SourceMapRange | undefined): T; 4327 /** 4328 * Gets the TextRange to use for source maps for a token of a node. 4329 */ 4330 function getTokenSourceMapRange(node: Node, token: SyntaxKind): SourceMapRange | undefined; 4331 /** 4332 * Sets the TextRange to use for source maps for a token of a node. 4333 */ 4334 function setTokenSourceMapRange<T extends Node>(node: T, token: SyntaxKind, range: SourceMapRange | undefined): T; 4335 /** 4336 * Gets a custom text range to use when emitting comments. 4337 */ 4338 function getCommentRange(node: Node): TextRange; 4339 /** 4340 * Sets a custom text range to use when emitting comments. 4341 */ 4342 function setCommentRange<T extends Node>(node: T, range: TextRange): T; 4343 function getSyntheticLeadingComments(node: Node): SynthesizedComment[] | undefined; 4344 function setSyntheticLeadingComments<T extends Node>(node: T, comments: SynthesizedComment[] | undefined): T; 4345 function addSyntheticLeadingComment<T extends Node>(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T; 4346 function getSyntheticTrailingComments(node: Node): SynthesizedComment[] | undefined; 4347 function setSyntheticTrailingComments<T extends Node>(node: T, comments: SynthesizedComment[] | undefined): T; 4348 function addSyntheticTrailingComment<T extends Node>(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T; 4349 function moveSyntheticComments<T extends Node>(node: T, original: Node): T; 4350 /** 4351 * Gets the constant value to emit for an expression representing an enum. 4352 */ 4353 function getConstantValue(node: AccessExpression): string | number | undefined; 4354 /** 4355 * Sets the constant value to emit for an expression. 4356 */ 4357 function setConstantValue(node: AccessExpression, value: string | number): AccessExpression; 4358 /** 4359 * Adds an EmitHelper to a node. 4360 */ 4361 function addEmitHelper<T extends Node>(node: T, helper: EmitHelper): T; 4362 /** 4363 * Add EmitHelpers to a node. 4364 */ 4365 function addEmitHelpers<T extends Node>(node: T, helpers: EmitHelper[] | undefined): T; 4366 /** 4367 * Removes an EmitHelper from a node. 4368 */ 4369 function removeEmitHelper(node: Node, helper: EmitHelper): boolean; 4370 /** 4371 * Gets the EmitHelpers of a node. 4372 */ 4373 function getEmitHelpers(node: Node): EmitHelper[] | undefined; 4374 /** 4375 * Moves matching emit helpers from a source node to a target node. 4376 */ 4377 function moveEmitHelpers(source: Node, target: Node, predicate: (helper: EmitHelper) => boolean): void; 4378} 4379declare namespace ts { 4380 function isNumericLiteral(node: Node): node is NumericLiteral; 4381 function isBigIntLiteral(node: Node): node is BigIntLiteral; 4382 function isStringLiteral(node: Node): node is StringLiteral; 4383 function isJsxText(node: Node): node is JsxText; 4384 function isRegularExpressionLiteral(node: Node): node is RegularExpressionLiteral; 4385 function isNoSubstitutionTemplateLiteral(node: Node): node is NoSubstitutionTemplateLiteral; 4386 function isTemplateHead(node: Node): node is TemplateHead; 4387 function isTemplateMiddle(node: Node): node is TemplateMiddle; 4388 function isTemplateTail(node: Node): node is TemplateTail; 4389 function isIdentifier(node: Node): node is Identifier; 4390 function isQualifiedName(node: Node): node is QualifiedName; 4391 function isComputedPropertyName(node: Node): node is ComputedPropertyName; 4392 function isPrivateIdentifier(node: Node): node is PrivateIdentifier; 4393 function isTypeParameterDeclaration(node: Node): node is TypeParameterDeclaration; 4394 function isParameter(node: Node): node is ParameterDeclaration; 4395 function isDecorator(node: Node): node is Decorator; 4396 function isPropertySignature(node: Node): node is PropertySignature; 4397 function isPropertyDeclaration(node: Node): node is PropertyDeclaration; 4398 function isMethodSignature(node: Node): node is MethodSignature; 4399 function isMethodDeclaration(node: Node): node is MethodDeclaration; 4400 function isConstructorDeclaration(node: Node): node is ConstructorDeclaration; 4401 function isGetAccessorDeclaration(node: Node): node is GetAccessorDeclaration; 4402 function isSetAccessorDeclaration(node: Node): node is SetAccessorDeclaration; 4403 function isCallSignatureDeclaration(node: Node): node is CallSignatureDeclaration; 4404 function isConstructSignatureDeclaration(node: Node): node is ConstructSignatureDeclaration; 4405 function isIndexSignatureDeclaration(node: Node): node is IndexSignatureDeclaration; 4406 function isTypePredicateNode(node: Node): node is TypePredicateNode; 4407 function isTypeReferenceNode(node: Node): node is TypeReferenceNode; 4408 function isFunctionTypeNode(node: Node): node is FunctionTypeNode; 4409 function isConstructorTypeNode(node: Node): node is ConstructorTypeNode; 4410 function isTypeQueryNode(node: Node): node is TypeQueryNode; 4411 function isTypeLiteralNode(node: Node): node is TypeLiteralNode; 4412 function isArrayTypeNode(node: Node): node is ArrayTypeNode; 4413 function isTupleTypeNode(node: Node): node is TupleTypeNode; 4414 function isNamedTupleMember(node: Node): node is NamedTupleMember; 4415 function isOptionalTypeNode(node: Node): node is OptionalTypeNode; 4416 function isRestTypeNode(node: Node): node is RestTypeNode; 4417 function isUnionTypeNode(node: Node): node is UnionTypeNode; 4418 function isIntersectionTypeNode(node: Node): node is IntersectionTypeNode; 4419 function isConditionalTypeNode(node: Node): node is ConditionalTypeNode; 4420 function isInferTypeNode(node: Node): node is InferTypeNode; 4421 function isParenthesizedTypeNode(node: Node): node is ParenthesizedTypeNode; 4422 function isThisTypeNode(node: Node): node is ThisTypeNode; 4423 function isTypeOperatorNode(node: Node): node is TypeOperatorNode; 4424 function isIndexedAccessTypeNode(node: Node): node is IndexedAccessTypeNode; 4425 function isMappedTypeNode(node: Node): node is MappedTypeNode; 4426 function isLiteralTypeNode(node: Node): node is LiteralTypeNode; 4427 function isImportTypeNode(node: Node): node is ImportTypeNode; 4428 function isTemplateLiteralTypeSpan(node: Node): node is TemplateLiteralTypeSpan; 4429 function isTemplateLiteralTypeNode(node: Node): node is TemplateLiteralTypeNode; 4430 function isObjectBindingPattern(node: Node): node is ObjectBindingPattern; 4431 function isArrayBindingPattern(node: Node): node is ArrayBindingPattern; 4432 function isBindingElement(node: Node): node is BindingElement; 4433 function isArrayLiteralExpression(node: Node): node is ArrayLiteralExpression; 4434 function isObjectLiteralExpression(node: Node): node is ObjectLiteralExpression; 4435 function isPropertyAccessExpression(node: Node): node is PropertyAccessExpression; 4436 function isElementAccessExpression(node: Node): node is ElementAccessExpression; 4437 function isCallExpression(node: Node): node is CallExpression; 4438 function isNewExpression(node: Node): node is NewExpression; 4439 function isTaggedTemplateExpression(node: Node): node is TaggedTemplateExpression; 4440 function isTypeAssertionExpression(node: Node): node is TypeAssertion; 4441 function isParenthesizedExpression(node: Node): node is ParenthesizedExpression; 4442 function isFunctionExpression(node: Node): node is FunctionExpression; 4443 function isEtsComponentExpression(node: Node): node is EtsComponentExpression; 4444 function isArrowFunction(node: Node): node is ArrowFunction; 4445 function isDeleteExpression(node: Node): node is DeleteExpression; 4446 function isTypeOfExpression(node: Node): node is TypeOfExpression; 4447 function isVoidExpression(node: Node): node is VoidExpression; 4448 function isAwaitExpression(node: Node): node is AwaitExpression; 4449 function isPrefixUnaryExpression(node: Node): node is PrefixUnaryExpression; 4450 function isPostfixUnaryExpression(node: Node): node is PostfixUnaryExpression; 4451 function isBinaryExpression(node: Node): node is BinaryExpression; 4452 function isConditionalExpression(node: Node): node is ConditionalExpression; 4453 function isTemplateExpression(node: Node): node is TemplateExpression; 4454 function isYieldExpression(node: Node): node is YieldExpression; 4455 function isSpreadElement(node: Node): node is SpreadElement; 4456 function isClassExpression(node: Node): node is ClassExpression; 4457 function isOmittedExpression(node: Node): node is OmittedExpression; 4458 function isExpressionWithTypeArguments(node: Node): node is ExpressionWithTypeArguments; 4459 function isAsExpression(node: Node): node is AsExpression; 4460 function isNonNullExpression(node: Node): node is NonNullExpression; 4461 function isMetaProperty(node: Node): node is MetaProperty; 4462 function isSyntheticExpression(node: Node): node is SyntheticExpression; 4463 function isPartiallyEmittedExpression(node: Node): node is PartiallyEmittedExpression; 4464 function isCommaListExpression(node: Node): node is CommaListExpression; 4465 function isTemplateSpan(node: Node): node is TemplateSpan; 4466 function isSemicolonClassElement(node: Node): node is SemicolonClassElement; 4467 function isBlock(node: Node): node is Block; 4468 function isVariableStatement(node: Node): node is VariableStatement; 4469 function isEmptyStatement(node: Node): node is EmptyStatement; 4470 function isExpressionStatement(node: Node): node is ExpressionStatement; 4471 function isIfStatement(node: Node): node is IfStatement; 4472 function isDoStatement(node: Node): node is DoStatement; 4473 function isWhileStatement(node: Node): node is WhileStatement; 4474 function isForStatement(node: Node): node is ForStatement; 4475 function isForInStatement(node: Node): node is ForInStatement; 4476 function isForOfStatement(node: Node): node is ForOfStatement; 4477 function isContinueStatement(node: Node): node is ContinueStatement; 4478 function isBreakStatement(node: Node): node is BreakStatement; 4479 function isReturnStatement(node: Node): node is ReturnStatement; 4480 function isWithStatement(node: Node): node is WithStatement; 4481 function isSwitchStatement(node: Node): node is SwitchStatement; 4482 function isLabeledStatement(node: Node): node is LabeledStatement; 4483 function isThrowStatement(node: Node): node is ThrowStatement; 4484 function isTryStatement(node: Node): node is TryStatement; 4485 function isDebuggerStatement(node: Node): node is DebuggerStatement; 4486 function isVariableDeclaration(node: Node): node is VariableDeclaration; 4487 function isVariableDeclarationList(node: Node): node is VariableDeclarationList; 4488 function isFunctionDeclaration(node: Node): node is FunctionDeclaration; 4489 function isClassDeclaration(node: Node): node is ClassDeclaration; 4490 function isStructDeclaration(node: Node): node is StructDeclaration; 4491 function isInterfaceDeclaration(node: Node): node is InterfaceDeclaration; 4492 function isTypeAliasDeclaration(node: Node): node is TypeAliasDeclaration; 4493 function isEnumDeclaration(node: Node): node is EnumDeclaration; 4494 function isModuleDeclaration(node: Node): node is ModuleDeclaration; 4495 function isModuleBlock(node: Node): node is ModuleBlock; 4496 function isCaseBlock(node: Node): node is CaseBlock; 4497 function isNamespaceExportDeclaration(node: Node): node is NamespaceExportDeclaration; 4498 function isImportEqualsDeclaration(node: Node): node is ImportEqualsDeclaration; 4499 function isImportDeclaration(node: Node): node is ImportDeclaration; 4500 function isImportClause(node: Node): node is ImportClause; 4501 function isNamespaceImport(node: Node): node is NamespaceImport; 4502 function isNamespaceExport(node: Node): node is NamespaceExport; 4503 function isNamedImports(node: Node): node is NamedImports; 4504 function isImportSpecifier(node: Node): node is ImportSpecifier; 4505 function isExportAssignment(node: Node): node is ExportAssignment; 4506 function isExportDeclaration(node: Node): node is ExportDeclaration; 4507 function isNamedExports(node: Node): node is NamedExports; 4508 function isExportSpecifier(node: Node): node is ExportSpecifier; 4509 function isMissingDeclaration(node: Node): node is MissingDeclaration; 4510 function isNotEmittedStatement(node: Node): node is NotEmittedStatement; 4511 function isExternalModuleReference(node: Node): node is ExternalModuleReference; 4512 function isJsxElement(node: Node): node is JsxElement; 4513 function isJsxSelfClosingElement(node: Node): node is JsxSelfClosingElement; 4514 function isJsxOpeningElement(node: Node): node is JsxOpeningElement; 4515 function isJsxClosingElement(node: Node): node is JsxClosingElement; 4516 function isJsxFragment(node: Node): node is JsxFragment; 4517 function isJsxOpeningFragment(node: Node): node is JsxOpeningFragment; 4518 function isJsxClosingFragment(node: Node): node is JsxClosingFragment; 4519 function isJsxAttribute(node: Node): node is JsxAttribute; 4520 function isJsxAttributes(node: Node): node is JsxAttributes; 4521 function isJsxSpreadAttribute(node: Node): node is JsxSpreadAttribute; 4522 function isJsxExpression(node: Node): node is JsxExpression; 4523 function isCaseClause(node: Node): node is CaseClause; 4524 function isDefaultClause(node: Node): node is DefaultClause; 4525 function isHeritageClause(node: Node): node is HeritageClause; 4526 function isCatchClause(node: Node): node is CatchClause; 4527 function isPropertyAssignment(node: Node): node is PropertyAssignment; 4528 function isShorthandPropertyAssignment(node: Node): node is ShorthandPropertyAssignment; 4529 function isSpreadAssignment(node: Node): node is SpreadAssignment; 4530 function isEnumMember(node: Node): node is EnumMember; 4531 function isUnparsedPrepend(node: Node): node is UnparsedPrepend; 4532 function isSourceFile(node: Node): node is SourceFile; 4533 function isBundle(node: Node): node is Bundle; 4534 function isUnparsedSource(node: Node): node is UnparsedSource; 4535 function isJSDocTypeExpression(node: Node): node is JSDocTypeExpression; 4536 function isJSDocNameReference(node: Node): node is JSDocNameReference; 4537 function isJSDocAllType(node: Node): node is JSDocAllType; 4538 function isJSDocUnknownType(node: Node): node is JSDocUnknownType; 4539 function isJSDocNullableType(node: Node): node is JSDocNullableType; 4540 function isJSDocNonNullableType(node: Node): node is JSDocNonNullableType; 4541 function isJSDocOptionalType(node: Node): node is JSDocOptionalType; 4542 function isJSDocFunctionType(node: Node): node is JSDocFunctionType; 4543 function isJSDocVariadicType(node: Node): node is JSDocVariadicType; 4544 function isJSDocNamepathType(node: Node): node is JSDocNamepathType; 4545 function isJSDoc(node: Node): node is JSDoc; 4546 function isJSDocTypeLiteral(node: Node): node is JSDocTypeLiteral; 4547 function isJSDocSignature(node: Node): node is JSDocSignature; 4548 function isJSDocAugmentsTag(node: Node): node is JSDocAugmentsTag; 4549 function isJSDocAuthorTag(node: Node): node is JSDocAuthorTag; 4550 function isJSDocClassTag(node: Node): node is JSDocClassTag; 4551 function isJSDocCallbackTag(node: Node): node is JSDocCallbackTag; 4552 function isJSDocPublicTag(node: Node): node is JSDocPublicTag; 4553 function isJSDocPrivateTag(node: Node): node is JSDocPrivateTag; 4554 function isJSDocProtectedTag(node: Node): node is JSDocProtectedTag; 4555 function isJSDocReadonlyTag(node: Node): node is JSDocReadonlyTag; 4556 function isJSDocDeprecatedTag(node: Node): node is JSDocDeprecatedTag; 4557 function isJSDocSeeTag(node: Node): node is JSDocSeeTag; 4558 function isJSDocEnumTag(node: Node): node is JSDocEnumTag; 4559 function isJSDocParameterTag(node: Node): node is JSDocParameterTag; 4560 function isJSDocReturnTag(node: Node): node is JSDocReturnTag; 4561 function isJSDocThisTag(node: Node): node is JSDocThisTag; 4562 function isJSDocTypeTag(node: Node): node is JSDocTypeTag; 4563 function isJSDocTemplateTag(node: Node): node is JSDocTemplateTag; 4564 function isJSDocTypedefTag(node: Node): node is JSDocTypedefTag; 4565 function isJSDocUnknownTag(node: Node): node is JSDocUnknownTag; 4566 function isJSDocPropertyTag(node: Node): node is JSDocPropertyTag; 4567 function isJSDocImplementsTag(node: Node): node is JSDocImplementsTag; 4568} 4569declare namespace ts { 4570 function setTextRange<T extends TextRange>(range: T, location: TextRange | undefined): T; 4571} 4572declare namespace ts { 4573 /** 4574 * Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes 4575 * stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise, 4576 * embedded arrays are flattened and the 'cbNode' callback is invoked for each element. If a callback returns 4577 * a truthy value, iteration stops and that value is returned. Otherwise, undefined is returned. 4578 * 4579 * @param node a given node to visit its children 4580 * @param cbNode a callback to be invoked for all child nodes 4581 * @param cbNodes a callback to be invoked for embedded array 4582 * 4583 * @remarks `forEachChild` must visit the children of a node in the order 4584 * that they appear in the source code. The language service depends on this property to locate nodes by position. 4585 */ 4586 export function forEachChild<T>(node: Node, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined; 4587 export function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean, scriptKind?: ScriptKind, option?: CompilerOptions): SourceFile; 4588 export function parseIsolatedEntityName(text: string, languageVersion: ScriptTarget): EntityName | undefined; 4589 /** 4590 * Parse json text into SyntaxTree and return node and parse errors if any 4591 * @param fileName 4592 * @param sourceText 4593 */ 4594 export function parseJsonText(fileName: string, sourceText: string): JsonSourceFile; 4595 export function isExternalModule(file: SourceFile): boolean; 4596 export function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean, option?: CompilerOptions): SourceFile; 4597 export {}; 4598} 4599declare namespace ts { 4600 export function parseCommandLine(commandLine: readonly string[], readFile?: (path: string) => string | undefined): ParsedCommandLine; 4601 export type DiagnosticReporter = (diagnostic: Diagnostic) => void; 4602 /** 4603 * Reports config file diagnostics 4604 */ 4605 export interface ConfigFileDiagnosticsReporter { 4606 /** 4607 * Reports unrecoverable error when parsing config file 4608 */ 4609 onUnRecoverableConfigFileDiagnostic: DiagnosticReporter; 4610 } 4611 /** 4612 * Interface extending ParseConfigHost to support ParseConfigFile that reads config file and reports errors 4613 */ 4614 export interface ParseConfigFileHost extends ParseConfigHost, ConfigFileDiagnosticsReporter { 4615 getCurrentDirectory(): string; 4616 } 4617 /** 4618 * Reads the config file, reports errors if any and exits if the config file cannot be found 4619 */ 4620 export function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions, host: ParseConfigFileHost, extendedConfigCache?: Map<ExtendedConfigCacheEntry>, watchOptionsToExtend?: WatchOptions, extraFileExtensions?: readonly FileExtensionInfo[]): ParsedCommandLine | undefined; 4621 /** 4622 * Read tsconfig.json file 4623 * @param fileName The path to the config file 4624 */ 4625 export function readConfigFile(fileName: string, readFile: (path: string) => string | undefined): { 4626 config?: any; 4627 error?: Diagnostic; 4628 }; 4629 /** 4630 * Parse the text of the tsconfig.json file 4631 * @param fileName The path to the config file 4632 * @param jsonText The text of the config file 4633 */ 4634 export function parseConfigFileTextToJson(fileName: string, jsonText: string): { 4635 config?: any; 4636 error?: Diagnostic; 4637 }; 4638 /** 4639 * Read tsconfig.json file 4640 * @param fileName The path to the config file 4641 */ 4642 export function readJsonConfigFile(fileName: string, readFile: (path: string) => string | undefined): TsConfigSourceFile; 4643 /** 4644 * Convert the json syntax tree into the json value 4645 */ 4646 export function convertToObject(sourceFile: JsonSourceFile, errors: Push<Diagnostic>): any; 4647 /** 4648 * Parse the contents of a config file (tsconfig.json). 4649 * @param json The contents of the config file to parse 4650 * @param host Instance of ParseConfigHost used to enumerate files in folder. 4651 * @param basePath A root directory to resolve relative path entries in the config 4652 * file to. e.g. outDir 4653 */ 4654 export function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: readonly FileExtensionInfo[], extendedConfigCache?: Map<ExtendedConfigCacheEntry>, existingWatchOptions?: WatchOptions): ParsedCommandLine; 4655 /** 4656 * Parse the contents of a config file (tsconfig.json). 4657 * @param jsonNode The contents of the config file to parse 4658 * @param host Instance of ParseConfigHost used to enumerate files in folder. 4659 * @param basePath A root directory to resolve relative path entries in the config 4660 * file to. e.g. outDir 4661 */ 4662 export function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: readonly FileExtensionInfo[], extendedConfigCache?: Map<ExtendedConfigCacheEntry>, existingWatchOptions?: WatchOptions): ParsedCommandLine; 4663 export interface ParsedTsconfig { 4664 raw: any; 4665 options?: CompilerOptions; 4666 watchOptions?: WatchOptions; 4667 typeAcquisition?: TypeAcquisition; 4668 /** 4669 * Note that the case of the config path has not yet been normalized, as no files have been imported into the project yet 4670 */ 4671 extendedConfigPath?: string; 4672 } 4673 export interface ExtendedConfigCacheEntry { 4674 extendedResult: TsConfigSourceFile; 4675 extendedConfig: ParsedTsconfig | undefined; 4676 } 4677 export function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): { 4678 options: CompilerOptions; 4679 errors: Diagnostic[]; 4680 }; 4681 export function convertTypeAcquisitionFromJson(jsonOptions: any, basePath: string, configFileName?: string): { 4682 options: TypeAcquisition; 4683 errors: Diagnostic[]; 4684 }; 4685 export {}; 4686} 4687declare namespace ts { 4688 function getEffectiveTypeRoots(options: CompilerOptions, host: GetEffectiveTypeRootsHost): string[] | undefined; 4689 /** 4690 * @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown. 4691 * This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups 4692 * is assumed to be the same as root directory of the project. 4693 */ 4694 function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference): ResolvedTypeReferenceDirectiveWithFailedLookupLocations; 4695 /** 4696 * Given a set of options, returns the set of type directive names 4697 * that should be included for this program automatically. 4698 * This list could either come from the config file, 4699 * or from enumerating the types root + initial secondary types lookup location. 4700 * More type directives might appear in the program later as a result of loading actual source files; 4701 * this list is only the set of defaults that are implicitly included. 4702 */ 4703 function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[]; 4704 /** 4705 * Cached module resolutions per containing directory. 4706 * This assumes that any module id will have the same resolution for sibling files located in the same folder. 4707 */ 4708 interface ModuleResolutionCache extends NonRelativeModuleNameResolutionCache { 4709 getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference): Map<ResolvedModuleWithFailedLookupLocations>; 4710 } 4711 /** 4712 * Stored map from non-relative module name to a table: directory -> result of module lookup in this directory 4713 * We support only non-relative module names because resolution of relative module names is usually more deterministic and thus less expensive. 4714 */ 4715 interface NonRelativeModuleNameResolutionCache { 4716 getOrCreateCacheForModuleName(nonRelativeModuleName: string, redirectedReference?: ResolvedProjectReference): PerModuleNameCache; 4717 } 4718 interface PerModuleNameCache { 4719 get(directory: string): ResolvedModuleWithFailedLookupLocations | undefined; 4720 set(directory: string, result: ResolvedModuleWithFailedLookupLocations): void; 4721 } 4722 function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions): ModuleResolutionCache; 4723 function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations | undefined; 4724 function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations; 4725 function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations; 4726 function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations; 4727} 4728declare namespace ts { 4729 /** 4730 * Visits a Node using the supplied visitor, possibly returning a new Node in its place. 4731 * 4732 * @param node The Node to visit. 4733 * @param visitor The callback used to visit the Node. 4734 * @param test A callback to execute to verify the Node is valid. 4735 * @param lift An optional callback to execute to lift a NodeArray into a valid Node. 4736 */ 4737 function visitNode<T extends Node>(node: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T; 4738 /** 4739 * Visits a Node using the supplied visitor, possibly returning a new Node in its place. 4740 * 4741 * @param node The Node to visit. 4742 * @param visitor The callback used to visit the Node. 4743 * @param test A callback to execute to verify the Node is valid. 4744 * @param lift An optional callback to execute to lift a NodeArray into a valid Node. 4745 */ 4746 function visitNode<T extends Node>(node: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T | undefined; 4747 /** 4748 * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place. 4749 * 4750 * @param nodes The NodeArray to visit. 4751 * @param visitor The callback used to visit a Node. 4752 * @param test A node test to execute for each node. 4753 * @param start An optional value indicating the starting offset at which to start visiting. 4754 * @param count An optional value indicating the maximum number of nodes to visit. 4755 */ 4756 function visitNodes<T extends Node>(nodes: NodeArray<T>, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T>; 4757 /** 4758 * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place. 4759 * 4760 * @param nodes The NodeArray to visit. 4761 * @param visitor The callback used to visit a Node. 4762 * @param test A node test to execute for each node. 4763 * @param start An optional value indicating the starting offset at which to start visiting. 4764 * @param count An optional value indicating the maximum number of nodes to visit. 4765 */ 4766 function visitNodes<T extends Node>(nodes: NodeArray<T> | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T> | undefined; 4767 /** 4768 * Starts a new lexical environment and visits a statement list, ending the lexical environment 4769 * and merging hoisted declarations upon completion. 4770 */ 4771 function visitLexicalEnvironment(statements: NodeArray<Statement>, visitor: Visitor, context: TransformationContext, start?: number, ensureUseStrict?: boolean, nodesVisitor?: NodesVisitor): NodeArray<Statement>; 4772 /** 4773 * Starts a new lexical environment and visits a parameter list, suspending the lexical 4774 * environment upon completion. 4775 */ 4776 function visitParameterList(nodes: NodeArray<ParameterDeclaration>, visitor: Visitor, context: TransformationContext, nodesVisitor?: NodesVisitor): NodeArray<ParameterDeclaration>; 4777 function visitParameterList(nodes: NodeArray<ParameterDeclaration> | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: NodesVisitor): NodeArray<ParameterDeclaration> | undefined; 4778 /** 4779 * Resumes a suspended lexical environment and visits a function body, ending the lexical 4780 * environment and merging hoisted declarations upon completion. 4781 */ 4782 function visitFunctionBody(node: FunctionBody, visitor: Visitor, context: TransformationContext): FunctionBody; 4783 /** 4784 * Resumes a suspended lexical environment and visits a function body, ending the lexical 4785 * environment and merging hoisted declarations upon completion. 4786 */ 4787 function visitFunctionBody(node: FunctionBody | undefined, visitor: Visitor, context: TransformationContext): FunctionBody | undefined; 4788 /** 4789 * Resumes a suspended lexical environment and visits a concise body, ending the lexical 4790 * environment and merging hoisted declarations upon completion. 4791 */ 4792 function visitFunctionBody(node: ConciseBody, visitor: Visitor, context: TransformationContext): ConciseBody; 4793 /** 4794 * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place. 4795 * 4796 * @param node The Node whose children will be visited. 4797 * @param visitor The callback used to visit each child. 4798 * @param context A lexical environment context for the visitor. 4799 */ 4800 function visitEachChild<T extends Node>(node: T, visitor: Visitor, context: TransformationContext): T; 4801 /** 4802 * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place. 4803 * 4804 * @param node The Node whose children will be visited. 4805 * @param visitor The callback used to visit each child. 4806 * @param context A lexical environment context for the visitor. 4807 */ 4808 function visitEachChild<T extends Node>(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined; 4809} 4810declare namespace ts { 4811 function getTsBuildInfoEmitOutputFilePath(options: CompilerOptions): string | undefined; 4812 function getOutputFileNames(commandLine: ParsedCommandLine, inputFileName: string, ignoreCase: boolean): readonly string[]; 4813 function createPrinter(printerOptions?: PrinterOptions, handlers?: PrintHandlers): Printer; 4814} 4815declare namespace ts { 4816 export function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string | undefined; 4817 export function resolveTripleslashReference(moduleName: string, containingFile: string): string; 4818 export function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; 4819 export function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[]; 4820 export interface FormatDiagnosticsHost { 4821 getCurrentDirectory(): string; 4822 getCanonicalFileName(fileName: string): string; 4823 getNewLine(): string; 4824 } 4825 export function formatDiagnostics(diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost): string; 4826 export function formatDiagnostic(diagnostic: Diagnostic, host: FormatDiagnosticsHost): string; 4827 export function formatDiagnosticsWithColorAndContext(diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost): string; 4828 export function flattenDiagnosticMessageText(diag: string | DiagnosticMessageChain | undefined, newLine: string, indent?: number): string; 4829 export function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): readonly Diagnostic[]; 4830 /** 4831 * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions' 4832 * that represent a compilation unit. 4833 * 4834 * Creating a program proceeds from a set of root files, expanding the set of inputs by following imports and 4835 * triple-slash-reference-path directives transitively. '@types' and triple-slash-reference-types are also pulled in. 4836 * 4837 * @param createProgramOptions - The options for creating a program. 4838 * @returns A 'Program' object. 4839 */ 4840 export function createProgram(createProgramOptions: CreateProgramOptions): Program; 4841 /** 4842 * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions' 4843 * that represent a compilation unit. 4844 * 4845 * Creating a program proceeds from a set of root files, expanding the set of inputs by following imports and 4846 * triple-slash-reference-path directives transitively. '@types' and triple-slash-reference-types are also pulled in. 4847 * 4848 * @param rootNames - A set of root files. 4849 * @param options - The compiler options which should be used. 4850 * @param host - The host interacts with the underlying file system. 4851 * @param oldProgram - Reuses an old program structure. 4852 * @param configFileParsingDiagnostics - error during config file parsing 4853 * @returns A 'Program' object. 4854 */ 4855 export function createProgram(rootNames: readonly string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program, configFileParsingDiagnostics?: readonly Diagnostic[]): Program; 4856 /** @deprecated */ export interface ResolveProjectReferencePathHost { 4857 fileExists(fileName: string): boolean; 4858 } 4859 /** 4860 * Returns the target config filename of a project reference. 4861 * Note: The file might not exist. 4862 */ 4863 export function resolveProjectReferencePath(ref: ProjectReference): ResolvedConfigFileName; 4864 /** @deprecated */ export function resolveProjectReferencePath(host: ResolveProjectReferencePathHost, ref: ProjectReference): ResolvedConfigFileName; 4865 export {}; 4866} 4867declare namespace ts { 4868 interface EmitOutput { 4869 outputFiles: OutputFile[]; 4870 emitSkipped: boolean; 4871 } 4872 interface OutputFile { 4873 name: string; 4874 writeByteOrderMark: boolean; 4875 text: string; 4876 } 4877} 4878declare namespace ts { 4879 type AffectedFileResult<T> = { 4880 result: T; 4881 affected: SourceFile | Program; 4882 } | undefined; 4883 interface BuilderProgramHost { 4884 /** 4885 * return true if file names are treated with case sensitivity 4886 */ 4887 useCaseSensitiveFileNames(): boolean; 4888 /** 4889 * If provided this would be used this hash instead of actual file shape text for detecting changes 4890 */ 4891 createHash?: (data: string) => string; 4892 /** 4893 * When emit or emitNextAffectedFile are called without writeFile, 4894 * this callback if present would be used to write files 4895 */ 4896 writeFile?: WriteFileCallback; 4897 } 4898 /** 4899 * Builder to manage the program state changes 4900 */ 4901 interface BuilderProgram { 4902 /** 4903 * Returns current program 4904 */ 4905 getProgram(): Program; 4906 /** 4907 * Get compiler options of the program 4908 */ 4909 getCompilerOptions(): CompilerOptions; 4910 /** 4911 * Get the source file in the program with file name 4912 */ 4913 getSourceFile(fileName: string): SourceFile | undefined; 4914 /** 4915 * Get a list of files in the program 4916 */ 4917 getSourceFiles(): readonly SourceFile[]; 4918 /** 4919 * Get the diagnostics for compiler options 4920 */ 4921 getOptionsDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[]; 4922 /** 4923 * Get the diagnostics that dont belong to any file 4924 */ 4925 getGlobalDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[]; 4926 /** 4927 * Get the diagnostics from config file parsing 4928 */ 4929 getConfigFileParsingDiagnostics(): readonly Diagnostic[]; 4930 /** 4931 * Get the syntax diagnostics, for all source files if source file is not supplied 4932 */ 4933 getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[]; 4934 /** 4935 * Get the declaration diagnostics, for all source files if source file is not supplied 4936 */ 4937 getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[]; 4938 /** 4939 * Get all the dependencies of the file 4940 */ 4941 getAllDependencies(sourceFile: SourceFile): readonly string[]; 4942 /** 4943 * Gets the semantic diagnostics from the program corresponding to this state of file (if provided) or whole program 4944 * The semantic diagnostics are cached and managed here 4945 * Note that it is assumed that when asked about semantic diagnostics through this API, 4946 * the file has been taken out of affected files so it is safe to use cache or get from program and cache the diagnostics 4947 * In case of SemanticDiagnosticsBuilderProgram if the source file is not provided, 4948 * it will iterate through all the affected files, to ensure that cache stays valid and yet provide a way to get all semantic diagnostics 4949 */ 4950 getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[]; 4951 /** 4952 * Emits the JavaScript and declaration files. 4953 * When targetSource file is specified, emits the files corresponding to that source file, 4954 * otherwise for the whole program. 4955 * In case of EmitAndSemanticDiagnosticsBuilderProgram, when targetSourceFile is specified, 4956 * it is assumed that that file is handled from affected file list. If targetSourceFile is not specified, 4957 * it will only emit all the affected files instead of whole program 4958 * 4959 * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host 4960 * in that order would be used to write the files 4961 */ 4962 emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult; 4963 /** 4964 * Get the current directory of the program 4965 */ 4966 getCurrentDirectory(): string; 4967 } 4968 /** 4969 * The builder that caches the semantic diagnostics for the program and handles the changed files and affected files 4970 */ 4971 interface SemanticDiagnosticsBuilderProgram extends BuilderProgram { 4972 /** 4973 * Gets the semantic diagnostics from the program for the next affected file and caches it 4974 * Returns undefined if the iteration is complete 4975 */ 4976 getSemanticDiagnosticsOfNextAffectedFile(cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean): AffectedFileResult<readonly Diagnostic[]>; 4977 } 4978 /** 4979 * The builder that can handle the changes in program and iterate through changed file to emit the files 4980 * The semantic diagnostics are cached per file and managed by clearing for the changed/affected files 4981 */ 4982 interface EmitAndSemanticDiagnosticsBuilderProgram extends SemanticDiagnosticsBuilderProgram { 4983 /** 4984 * Emits the next affected file's emit result (EmitResult and sourceFiles emitted) or returns undefined if iteration is complete 4985 * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host 4986 * in that order would be used to write the files 4987 */ 4988 emitNextAffectedFile(writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): AffectedFileResult<EmitResult>; 4989 } 4990 /** 4991 * Create the builder to manage semantic diagnostics and cache them 4992 */ 4993 function createSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[]): SemanticDiagnosticsBuilderProgram; 4994 function createSemanticDiagnosticsBuilderProgram(rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]): SemanticDiagnosticsBuilderProgram; 4995 /** 4996 * Create the builder that can handle the changes in program and iterate through changed files 4997 * to emit the those files and manage semantic diagnostics cache as well 4998 */ 4999 function createEmitAndSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[]): EmitAndSemanticDiagnosticsBuilderProgram; 5000 function createEmitAndSemanticDiagnosticsBuilderProgram(rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]): EmitAndSemanticDiagnosticsBuilderProgram; 5001 /** 5002 * Creates a builder thats just abstraction over program and can be used with watch 5003 */ 5004 function createAbstractBuilder(newProgram: Program, host: BuilderProgramHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[]): BuilderProgram; 5005 function createAbstractBuilder(rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]): BuilderProgram; 5006} 5007declare namespace ts { 5008 interface ReadBuildProgramHost { 5009 useCaseSensitiveFileNames(): boolean; 5010 getCurrentDirectory(): string; 5011 readFile(fileName: string): string | undefined; 5012 } 5013 function readBuilderProgram(compilerOptions: CompilerOptions, host: ReadBuildProgramHost): EmitAndSemanticDiagnosticsBuilderProgram | undefined; 5014 function createIncrementalCompilerHost(options: CompilerOptions, system?: System): CompilerHost; 5015 interface IncrementalProgramOptions<T extends BuilderProgram> { 5016 rootNames: readonly string[]; 5017 options: CompilerOptions; 5018 configFileParsingDiagnostics?: readonly Diagnostic[]; 5019 projectReferences?: readonly ProjectReference[]; 5020 host?: CompilerHost; 5021 createProgram?: CreateProgram<T>; 5022 } 5023 function createIncrementalProgram<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>({ rootNames, options, configFileParsingDiagnostics, projectReferences, host, createProgram }: IncrementalProgramOptions<T>): T; 5024 type WatchStatusReporter = (diagnostic: Diagnostic, newLine: string, options: CompilerOptions, errorCount?: number) => void; 5025 /** Create the program with rootNames and options, if they are undefined, oldProgram and new configFile diagnostics create new program */ 5026 type CreateProgram<T extends BuilderProgram> = (rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: T, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[] | undefined) => T; 5027 /** Host that has watch functionality used in --watch mode */ 5028 interface WatchHost { 5029 /** If provided, called with Diagnostic message that informs about change in watch status */ 5030 onWatchStatusChange?(diagnostic: Diagnostic, newLine: string, options: CompilerOptions, errorCount?: number): void; 5031 /** Used to watch changes in source files, missing files needed to update the program or config file */ 5032 watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: CompilerOptions): FileWatcher; 5033 /** Used to watch resolved module's failed lookup locations, config file specs, type roots where auto type reference directives are added */ 5034 watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: CompilerOptions): FileWatcher; 5035 /** If provided, will be used to set delayed compilation, so that multiple changes in short span are compiled together */ 5036 setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any; 5037 /** If provided, will be used to reset existing delayed compilation */ 5038 clearTimeout?(timeoutId: any): void; 5039 } 5040 interface ProgramHost<T extends BuilderProgram> { 5041 /** 5042 * Used to create the program when need for program creation or recreation detected 5043 */ 5044 createProgram: CreateProgram<T>; 5045 useCaseSensitiveFileNames(): boolean; 5046 getNewLine(): string; 5047 getCurrentDirectory(): string; 5048 getDefaultLibFileName(options: CompilerOptions): string; 5049 getDefaultLibLocation?(): string; 5050 createHash?(data: string): string; 5051 /** 5052 * Use to check file presence for source files and 5053 * if resolveModuleNames is not provided (complier is in charge of module resolution) then module files as well 5054 */ 5055 fileExists(path: string): boolean; 5056 /** 5057 * Use to read file text for source files and 5058 * if resolveModuleNames is not provided (complier is in charge of module resolution) then module files as well 5059 */ 5060 readFile(path: string, encoding?: string): string | undefined; 5061 /** If provided, used for module resolution as well as to handle directory structure */ 5062 directoryExists?(path: string): boolean; 5063 /** If provided, used in resolutions as well as handling directory structure */ 5064 getDirectories?(path: string): string[]; 5065 /** If provided, used to cache and handle directory structure modifications */ 5066 readDirectory?(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[]; 5067 /** Symbol links resolution */ 5068 realpath?(path: string): string; 5069 /** If provided would be used to write log about compilation */ 5070 trace?(s: string): void; 5071 /** If provided is used to get the environment variable */ 5072 getEnvironmentVariable?(name: string): string | undefined; 5073 /** If provided, used to resolve the module names, otherwise typescript's default module resolution */ 5074 resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedModule | undefined)[]; 5075 /** If provided, used to resolve type reference directives, otherwise typescript's default resolution */ 5076 resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[]; 5077 } 5078 interface WatchCompilerHost<T extends BuilderProgram> extends ProgramHost<T>, WatchHost { 5079 /** Instead of using output d.ts file from project reference, use its source file */ 5080 useSourceOfProjectReferenceRedirect?(): boolean; 5081 /** If provided, callback to invoke after every new program creation */ 5082 afterProgramCreate?(program: T): void; 5083 } 5084 /** 5085 * Host to create watch with root files and options 5086 */ 5087 interface WatchCompilerHostOfFilesAndCompilerOptions<T extends BuilderProgram> extends WatchCompilerHost<T> { 5088 /** root files to use to generate program */ 5089 rootFiles: string[]; 5090 /** Compiler options */ 5091 options: CompilerOptions; 5092 watchOptions?: WatchOptions; 5093 /** Project References */ 5094 projectReferences?: readonly ProjectReference[]; 5095 } 5096 /** 5097 * Host to create watch with config file 5098 */ 5099 interface WatchCompilerHostOfConfigFile<T extends BuilderProgram> extends WatchCompilerHost<T>, ConfigFileDiagnosticsReporter { 5100 /** Name of the config file to compile */ 5101 configFileName: string; 5102 /** Options to extend */ 5103 optionsToExtend?: CompilerOptions; 5104 watchOptionsToExtend?: WatchOptions; 5105 extraFileExtensions?: readonly FileExtensionInfo[]; 5106 /** 5107 * Used to generate source file names from the config file and its include, exclude, files rules 5108 * and also to cache the directory stucture 5109 */ 5110 readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[]; 5111 } 5112 interface Watch<T> { 5113 /** Synchronize with host and get updated program */ 5114 getProgram(): T; 5115 /** Closes the watch */ 5116 close(): void; 5117 } 5118 /** 5119 * Creates the watch what generates program using the config file 5120 */ 5121 interface WatchOfConfigFile<T> extends Watch<T> { 5122 } 5123 /** 5124 * Creates the watch that generates program using the root files and compiler options 5125 */ 5126 interface WatchOfFilesAndCompilerOptions<T> extends Watch<T> { 5127 /** Updates the root files in the program, only if this is not config file compilation */ 5128 updateRootFileNames(fileNames: string[]): void; 5129 } 5130 /** 5131 * Create the watch compiler host for either configFile or fileNames and its options 5132 */ 5133 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>; 5134 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>; 5135 /** 5136 * Creates the watch from the host for root files and compiler options 5137 */ 5138 function createWatchProgram<T extends BuilderProgram>(host: WatchCompilerHostOfFilesAndCompilerOptions<T>): WatchOfFilesAndCompilerOptions<T>; 5139 /** 5140 * Creates the watch from the host for config file 5141 */ 5142 function createWatchProgram<T extends BuilderProgram>(host: WatchCompilerHostOfConfigFile<T>): WatchOfConfigFile<T>; 5143} 5144declare namespace ts { 5145 interface BuildOptions { 5146 dry?: boolean; 5147 force?: boolean; 5148 verbose?: boolean; 5149 incremental?: boolean; 5150 assumeChangesOnlyAffectDirectDependencies?: boolean; 5151 traceResolution?: boolean; 5152 [option: string]: CompilerOptionsValue | undefined; 5153 } 5154 type ReportEmitErrorSummary = (errorCount: number) => void; 5155 interface SolutionBuilderHostBase<T extends BuilderProgram> extends ProgramHost<T> { 5156 createDirectory?(path: string): void; 5157 /** 5158 * Should provide create directory and writeFile if done of invalidatedProjects is not invoked with 5159 * writeFileCallback 5160 */ 5161 writeFile?(path: string, data: string, writeByteOrderMark?: boolean): void; 5162 getModifiedTime(fileName: string): Date | undefined; 5163 setModifiedTime(fileName: string, date: Date): void; 5164 deleteFile(fileName: string): void; 5165 getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined; 5166 reportDiagnostic: DiagnosticReporter; 5167 reportSolutionBuilderStatus: DiagnosticReporter; 5168 afterProgramEmitAndDiagnostics?(program: T): void; 5169 } 5170 interface SolutionBuilderHost<T extends BuilderProgram> extends SolutionBuilderHostBase<T> { 5171 reportErrorSummary?: ReportEmitErrorSummary; 5172 } 5173 interface SolutionBuilderWithWatchHost<T extends BuilderProgram> extends SolutionBuilderHostBase<T>, WatchHost { 5174 } 5175 interface SolutionBuilder<T extends BuilderProgram> { 5176 build(project?: string, cancellationToken?: CancellationToken): ExitStatus; 5177 clean(project?: string): ExitStatus; 5178 buildReferences(project: string, cancellationToken?: CancellationToken): ExitStatus; 5179 cleanReferences(project?: string): ExitStatus; 5180 getNextInvalidatedProject(cancellationToken?: CancellationToken): InvalidatedProject<T> | undefined; 5181 } 5182 /** 5183 * Create a function that reports watch status by writing to the system and handles the formating of the diagnostic 5184 */ 5185 function createBuilderStatusReporter(system: System, pretty?: boolean): DiagnosticReporter; 5186 function createSolutionBuilderHost<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>(system?: System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportSolutionBuilderStatus?: DiagnosticReporter, reportErrorSummary?: ReportEmitErrorSummary): SolutionBuilderHost<T>; 5187 function createSolutionBuilderWithWatchHost<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>(system?: System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportSolutionBuilderStatus?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter): SolutionBuilderWithWatchHost<T>; 5188 function createSolutionBuilder<T extends BuilderProgram>(host: SolutionBuilderHost<T>, rootNames: readonly string[], defaultOptions: BuildOptions): SolutionBuilder<T>; 5189 function createSolutionBuilderWithWatch<T extends BuilderProgram>(host: SolutionBuilderWithWatchHost<T>, rootNames: readonly string[], defaultOptions: BuildOptions, baseWatchOptions?: WatchOptions): SolutionBuilder<T>; 5190 enum InvalidatedProjectKind { 5191 Build = 0, 5192 UpdateBundle = 1, 5193 UpdateOutputFileStamps = 2 5194 } 5195 interface InvalidatedProjectBase { 5196 readonly kind: InvalidatedProjectKind; 5197 readonly project: ResolvedConfigFileName; 5198 /** 5199 * To dispose this project and ensure that all the necessary actions are taken and state is updated accordingly 5200 */ 5201 done(cancellationToken?: CancellationToken, writeFile?: WriteFileCallback, customTransformers?: CustomTransformers): ExitStatus; 5202 getCompilerOptions(): CompilerOptions; 5203 getCurrentDirectory(): string; 5204 } 5205 interface UpdateOutputFileStampsProject extends InvalidatedProjectBase { 5206 readonly kind: InvalidatedProjectKind.UpdateOutputFileStamps; 5207 updateOutputFileStatmps(): void; 5208 } 5209 interface BuildInvalidedProject<T extends BuilderProgram> extends InvalidatedProjectBase { 5210 readonly kind: InvalidatedProjectKind.Build; 5211 getBuilderProgram(): T | undefined; 5212 getProgram(): Program | undefined; 5213 getSourceFile(fileName: string): SourceFile | undefined; 5214 getSourceFiles(): readonly SourceFile[]; 5215 getOptionsDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[]; 5216 getGlobalDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[]; 5217 getConfigFileParsingDiagnostics(): readonly Diagnostic[]; 5218 getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[]; 5219 getAllDependencies(sourceFile: SourceFile): readonly string[]; 5220 getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[]; 5221 getSemanticDiagnosticsOfNextAffectedFile(cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean): AffectedFileResult<readonly Diagnostic[]>; 5222 emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult | undefined; 5223 } 5224 interface UpdateBundleProject<T extends BuilderProgram> extends InvalidatedProjectBase { 5225 readonly kind: InvalidatedProjectKind.UpdateBundle; 5226 emit(writeFile?: WriteFileCallback, customTransformers?: CustomTransformers): EmitResult | BuildInvalidedProject<T> | undefined; 5227 } 5228 type InvalidatedProject<T extends BuilderProgram> = UpdateOutputFileStampsProject | BuildInvalidedProject<T> | UpdateBundleProject<T>; 5229} 5230declare namespace ts.server { 5231 type ActionSet = "action::set"; 5232 type ActionInvalidate = "action::invalidate"; 5233 type ActionPackageInstalled = "action::packageInstalled"; 5234 type EventTypesRegistry = "event::typesRegistry"; 5235 type EventBeginInstallTypes = "event::beginInstallTypes"; 5236 type EventEndInstallTypes = "event::endInstallTypes"; 5237 type EventInitializationFailed = "event::initializationFailed"; 5238} 5239declare namespace ts.server { 5240 interface TypingInstallerResponse { 5241 readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed; 5242 } 5243 interface TypingInstallerRequestWithProjectName { 5244 readonly projectName: string; 5245 } 5246 interface DiscoverTypings extends TypingInstallerRequestWithProjectName { 5247 readonly fileNames: string[]; 5248 readonly projectRootPath: Path; 5249 readonly compilerOptions: CompilerOptions; 5250 readonly watchOptions?: WatchOptions; 5251 readonly typeAcquisition: TypeAcquisition; 5252 readonly unresolvedImports: SortedReadonlyArray<string>; 5253 readonly cachePath?: string; 5254 readonly kind: "discover"; 5255 } 5256 interface CloseProject extends TypingInstallerRequestWithProjectName { 5257 readonly kind: "closeProject"; 5258 } 5259 interface TypesRegistryRequest { 5260 readonly kind: "typesRegistry"; 5261 } 5262 interface InstallPackageRequest extends TypingInstallerRequestWithProjectName { 5263 readonly kind: "installPackage"; 5264 readonly fileName: Path; 5265 readonly packageName: string; 5266 readonly projectRootPath: Path; 5267 } 5268 interface PackageInstalledResponse extends ProjectResponse { 5269 readonly kind: ActionPackageInstalled; 5270 readonly success: boolean; 5271 readonly message: string; 5272 } 5273 interface InitializationFailedResponse extends TypingInstallerResponse { 5274 readonly kind: EventInitializationFailed; 5275 readonly message: string; 5276 readonly stack?: string; 5277 } 5278 interface ProjectResponse extends TypingInstallerResponse { 5279 readonly projectName: string; 5280 } 5281 interface InvalidateCachedTypings extends ProjectResponse { 5282 readonly kind: ActionInvalidate; 5283 } 5284 interface InstallTypes extends ProjectResponse { 5285 readonly kind: EventBeginInstallTypes | EventEndInstallTypes; 5286 readonly eventId: number; 5287 readonly typingsInstallerVersion: string; 5288 readonly packagesToInstall: readonly string[]; 5289 } 5290 interface BeginInstallTypes extends InstallTypes { 5291 readonly kind: EventBeginInstallTypes; 5292 } 5293 interface EndInstallTypes extends InstallTypes { 5294 readonly kind: EventEndInstallTypes; 5295 readonly installSuccess: boolean; 5296 } 5297 interface SetTypings extends ProjectResponse { 5298 readonly typeAcquisition: TypeAcquisition; 5299 readonly compilerOptions: CompilerOptions; 5300 readonly typings: string[]; 5301 readonly unresolvedImports: SortedReadonlyArray<string>; 5302 readonly kind: ActionSet; 5303 } 5304} 5305declare namespace ts { 5306 interface Node { 5307 getSourceFile(): SourceFile; 5308 getChildCount(sourceFile?: SourceFile): number; 5309 getChildAt(index: number, sourceFile?: SourceFile): Node; 5310 getChildren(sourceFile?: SourceFile): Node[]; 5311 getStart(sourceFile?: SourceFile, includeJsDocComment?: boolean): number; 5312 getFullStart(): number; 5313 getEnd(): number; 5314 getWidth(sourceFile?: SourceFileLike): number; 5315 getFullWidth(): number; 5316 getLeadingTriviaWidth(sourceFile?: SourceFile): number; 5317 getFullText(sourceFile?: SourceFile): string; 5318 getText(sourceFile?: SourceFile): string; 5319 getFirstToken(sourceFile?: SourceFile): Node | undefined; 5320 getLastToken(sourceFile?: SourceFile): Node | undefined; 5321 forEachChild<T>(cbNode: (node: Node) => T | undefined, cbNodeArray?: (nodes: NodeArray<Node>) => T | undefined): T | undefined; 5322 } 5323 interface Identifier { 5324 readonly text: string; 5325 } 5326 interface PrivateIdentifier { 5327 readonly text: string; 5328 } 5329 interface Symbol { 5330 readonly name: string; 5331 getFlags(): SymbolFlags; 5332 getEscapedName(): __String; 5333 getName(): string; 5334 getDeclarations(): Declaration[] | undefined; 5335 getDocumentationComment(typeChecker: TypeChecker | undefined): SymbolDisplayPart[]; 5336 getJsDocTags(): JSDocTagInfo[]; 5337 } 5338 interface Type { 5339 getFlags(): TypeFlags; 5340 getSymbol(): Symbol | undefined; 5341 getProperties(): Symbol[]; 5342 getProperty(propertyName: string): Symbol | undefined; 5343 getApparentProperties(): Symbol[]; 5344 getCallSignatures(): readonly Signature[]; 5345 getConstructSignatures(): readonly Signature[]; 5346 getStringIndexType(): Type | undefined; 5347 getNumberIndexType(): Type | undefined; 5348 getBaseTypes(): BaseType[] | undefined; 5349 getNonNullableType(): Type; 5350 getConstraint(): Type | undefined; 5351 getDefault(): Type | undefined; 5352 isUnion(): this is UnionType; 5353 isIntersection(): this is IntersectionType; 5354 isUnionOrIntersection(): this is UnionOrIntersectionType; 5355 isLiteral(): this is LiteralType; 5356 isStringLiteral(): this is StringLiteralType; 5357 isNumberLiteral(): this is NumberLiteralType; 5358 isTypeParameter(): this is TypeParameter; 5359 isClassOrInterface(): this is InterfaceType; 5360 isClass(): this is InterfaceType; 5361 } 5362 interface TypeReference { 5363 typeArguments?: readonly Type[]; 5364 } 5365 interface Signature { 5366 getDeclaration(): SignatureDeclaration; 5367 getTypeParameters(): TypeParameter[] | undefined; 5368 getParameters(): Symbol[]; 5369 getReturnType(): Type; 5370 getDocumentationComment(typeChecker: TypeChecker | undefined): SymbolDisplayPart[]; 5371 getJsDocTags(): JSDocTagInfo[]; 5372 } 5373 interface SourceFile { 5374 getLineAndCharacterOfPosition(pos: number): LineAndCharacter; 5375 getLineEndOfPosition(pos: number): number; 5376 getLineStarts(): readonly number[]; 5377 getPositionOfLineAndCharacter(line: number, character: number): number; 5378 update(newText: string, textChangeRange: TextChangeRange): SourceFile; 5379 } 5380 interface SourceFileLike { 5381 getLineAndCharacterOfPosition(pos: number): LineAndCharacter; 5382 } 5383 interface SourceMapSource { 5384 getLineAndCharacterOfPosition(pos: number): LineAndCharacter; 5385 } 5386 /** 5387 * Represents an immutable snapshot of a script at a specified time.Once acquired, the 5388 * snapshot is observably immutable. i.e. the same calls with the same parameters will return 5389 * the same values. 5390 */ 5391 interface IScriptSnapshot { 5392 /** Gets a portion of the script snapshot specified by [start, end). */ 5393 getText(start: number, end: number): string; 5394 /** Gets the length of this script snapshot. */ 5395 getLength(): number; 5396 /** 5397 * Gets the TextChangeRange that describe how the text changed between this text and 5398 * an older version. This information is used by the incremental parser to determine 5399 * what sections of the script need to be re-parsed. 'undefined' can be returned if the 5400 * change range cannot be determined. However, in that case, incremental parsing will 5401 * not happen and the entire document will be re - parsed. 5402 */ 5403 getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange | undefined; 5404 /** Releases all resources held by this script snapshot */ 5405 dispose?(): void; 5406 } 5407 namespace ScriptSnapshot { 5408 function fromString(text: string): IScriptSnapshot; 5409 } 5410 interface PreProcessedFileInfo { 5411 referencedFiles: FileReference[]; 5412 typeReferenceDirectives: FileReference[]; 5413 libReferenceDirectives: FileReference[]; 5414 importedFiles: FileReference[]; 5415 ambientExternalModules?: string[]; 5416 isLibFile: boolean; 5417 } 5418 interface HostCancellationToken { 5419 isCancellationRequested(): boolean; 5420 } 5421 interface InstallPackageOptions { 5422 fileName: Path; 5423 packageName: string; 5424 } 5425 interface PerformanceEvent { 5426 kind: "UpdateGraph" | "CreatePackageJsonAutoImportProvider"; 5427 durationMs: number; 5428 } 5429 enum LanguageServiceMode { 5430 Semantic = 0, 5431 PartialSemantic = 1, 5432 Syntactic = 2 5433 } 5434 interface LanguageServiceHost extends GetEffectiveTypeRootsHost { 5435 getCompilationSettings(): CompilerOptions; 5436 getNewLine?(): string; 5437 getProjectVersion?(): string; 5438 getScriptFileNames(): string[]; 5439 getScriptKind?(fileName: string): ScriptKind; 5440 getScriptVersion(fileName: string): string; 5441 getScriptSnapshot(fileName: string): IScriptSnapshot | undefined; 5442 getProjectReferences?(): readonly ProjectReference[] | undefined; 5443 getLocalizedDiagnosticMessages?(): any; 5444 getCancellationToken?(): HostCancellationToken; 5445 getCurrentDirectory(): string; 5446 getDefaultLibFileName(options: CompilerOptions): string; 5447 log?(s: string): void; 5448 trace?(s: string): void; 5449 error?(s: string): void; 5450 useCaseSensitiveFileNames?(): boolean; 5451 readDirectory?(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[]; 5452 readFile?(path: string, encoding?: string): string | undefined; 5453 realpath?(path: string): string; 5454 fileExists?(path: string): boolean; 5455 getTypeRootsVersion?(): number; 5456 resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedModule | undefined)[]; 5457 getResolvedModuleWithFailedLookupLocationsFromCache?(modulename: string, containingFile: string): ResolvedModuleWithFailedLookupLocations | undefined; 5458 resolveTypeReferenceDirectives?(typeDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[]; 5459 getDirectories?(directoryName: string): string[]; 5460 /** 5461 * Gets a set of custom transformers to use during emit. 5462 */ 5463 getCustomTransformers?(): CustomTransformers | undefined; 5464 isKnownTypesPackageName?(name: string): boolean; 5465 installPackage?(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>; 5466 writeFile?(fileName: string, content: string): void; 5467 } 5468 type WithMetadata<T> = T & { 5469 metadata?: unknown; 5470 }; 5471 enum SemanticClassificationFormat { 5472 Original = "original", 5473 TwentyTwenty = "2020" 5474 } 5475 interface LanguageService { 5476 /** This is used as a part of restarting the language service. */ 5477 cleanupSemanticCache(): void; 5478 /** 5479 * Gets errors indicating invalid syntax in a file. 5480 * 5481 * In English, "this cdeo have, erorrs" is syntactically invalid because it has typos, 5482 * grammatical errors, and misplaced punctuation. Likewise, examples of syntax 5483 * errors in TypeScript are missing parentheses in an `if` statement, mismatched 5484 * curly braces, and using a reserved keyword as a variable name. 5485 * 5486 * These diagnostics are inexpensive to compute and don't require knowledge of 5487 * other files. Note that a non-empty result increases the likelihood of false positives 5488 * from `getSemanticDiagnostics`. 5489 * 5490 * While these represent the majority of syntax-related diagnostics, there are some 5491 * that require the type system, which will be present in `getSemanticDiagnostics`. 5492 * 5493 * @param fileName A path to the file you want syntactic diagnostics for 5494 */ 5495 getSyntacticDiagnostics(fileName: string): DiagnosticWithLocation[]; 5496 /** 5497 * Gets warnings or errors indicating type system issues in a given file. 5498 * Requesting semantic diagnostics may start up the type system and 5499 * run deferred work, so the first call may take longer than subsequent calls. 5500 * 5501 * Unlike the other get*Diagnostics functions, these diagnostics can potentially not 5502 * include a reference to a source file. Specifically, the first time this is called, 5503 * it will return global diagnostics with no associated location. 5504 * 5505 * To contrast the differences between semantic and syntactic diagnostics, consider the 5506 * sentence: "The sun is green." is syntactically correct; those are real English words with 5507 * correct sentence structure. However, it is semantically invalid, because it is not true. 5508 * 5509 * @param fileName A path to the file you want semantic diagnostics for 5510 */ 5511 getSemanticDiagnostics(fileName: string): Diagnostic[]; 5512 /** 5513 * Gets suggestion diagnostics for a specific file. These diagnostics tend to 5514 * proactively suggest refactors, as opposed to diagnostics that indicate 5515 * potentially incorrect runtime behavior. 5516 * 5517 * @param fileName A path to the file you want semantic diagnostics for 5518 */ 5519 getSuggestionDiagnostics(fileName: string): DiagnosticWithLocation[]; 5520 /** 5521 * Gets global diagnostics related to the program configuration and compiler options. 5522 */ 5523 getCompilerOptionsDiagnostics(): Diagnostic[]; 5524 /** @deprecated Use getEncodedSyntacticClassifications instead. */ 5525 getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; 5526 getSyntacticClassifications(fileName: string, span: TextSpan, format: SemanticClassificationFormat): ClassifiedSpan[] | ClassifiedSpan2020[]; 5527 /** @deprecated Use getEncodedSemanticClassifications instead. */ 5528 getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; 5529 getSemanticClassifications(fileName: string, span: TextSpan, format: SemanticClassificationFormat): ClassifiedSpan[] | ClassifiedSpan2020[]; 5530 /** Encoded as triples of [start, length, ClassificationType]. */ 5531 getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications; 5532 /** 5533 * Gets semantic highlights information for a particular file. Has two formats, an older 5534 * version used by VS and a format used by VS Code. 5535 * 5536 * @param fileName The path to the file 5537 * @param position A text span to return results within 5538 * @param format Which format to use, defaults to "original" 5539 * @returns a number array encoded as triples of [start, length, ClassificationType, ...]. 5540 */ 5541 getEncodedSemanticClassifications(fileName: string, span: TextSpan, format?: SemanticClassificationFormat): Classifications; 5542 /** 5543 * Gets completion entries at a particular position in a file. 5544 * 5545 * @param fileName The path to the file 5546 * @param position A zero-based index of the character where you want the entries 5547 * @param options An object describing how the request was triggered and what kinds 5548 * of code actions can be returned with the completions. 5549 */ 5550 getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined): WithMetadata<CompletionInfo> | undefined; 5551 /** 5552 * Gets the extended details for a completion entry retrieved from `getCompletionsAtPosition`. 5553 * 5554 * @param fileName The path to the file 5555 * @param position A zero based index of the character where you want the entries 5556 * @param entryName The name from an existing completion which came from `getCompletionsAtPosition` 5557 * @param formatOptions How should code samples in the completions be formatted, can be undefined for backwards compatibility 5558 * @param source Source code for the current file, can be undefined for backwards compatibility 5559 * @param preferences User settings, can be undefined for backwards compatibility 5560 */ 5561 getCompletionEntryDetails(fileName: string, position: number, entryName: string, formatOptions: FormatCodeOptions | FormatCodeSettings | undefined, source: string | undefined, preferences: UserPreferences | undefined): CompletionEntryDetails | undefined; 5562 getCompletionEntrySymbol(fileName: string, position: number, name: string, source: string | undefined): Symbol | undefined; 5563 /** 5564 * Gets semantic information about the identifier at a particular position in a 5565 * file. Quick info is what you typically see when you hover in an editor. 5566 * 5567 * @param fileName The path to the file 5568 * @param position A zero-based index of the character where you want the quick info 5569 */ 5570 getQuickInfoAtPosition(fileName: string, position: number): QuickInfo | undefined; 5571 getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan | undefined; 5572 getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan | undefined; 5573 getSignatureHelpItems(fileName: string, position: number, options: SignatureHelpItemsOptions | undefined): SignatureHelpItems | undefined; 5574 getRenameInfo(fileName: string, position: number, options?: RenameInfoOptions): RenameInfo; 5575 findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename?: boolean): readonly RenameLocation[] | undefined; 5576 getSmartSelectionRange(fileName: string, position: number): SelectionRange; 5577 getDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined; 5578 getDefinitionAndBoundSpan(fileName: string, position: number): DefinitionInfoAndBoundSpan | undefined; 5579 getTypeDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined; 5580 getImplementationAtPosition(fileName: string, position: number): readonly ImplementationLocation[] | undefined; 5581 getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[] | undefined; 5582 findReferences(fileName: string, position: number): ReferencedSymbol[] | undefined; 5583 getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): DocumentHighlights[] | undefined; 5584 getFileReferences(fileName: string): ReferenceEntry[]; 5585 /** @deprecated */ 5586 getOccurrencesAtPosition(fileName: string, position: number): readonly ReferenceEntry[] | undefined; 5587 getNavigateToItems(searchValue: string, maxResultCount?: number, fileName?: string, excludeDtsFiles?: boolean): NavigateToItem[]; 5588 getNavigationBarItems(fileName: string): NavigationBarItem[]; 5589 getNavigationTree(fileName: string): NavigationTree; 5590 prepareCallHierarchy(fileName: string, position: number): CallHierarchyItem | CallHierarchyItem[] | undefined; 5591 provideCallHierarchyIncomingCalls(fileName: string, position: number): CallHierarchyIncomingCall[]; 5592 provideCallHierarchyOutgoingCalls(fileName: string, position: number): CallHierarchyOutgoingCall[]; 5593 getOutliningSpans(fileName: string): OutliningSpan[]; 5594 getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; 5595 getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; 5596 getIndentationAtPosition(fileName: string, position: number, options: EditorOptions | EditorSettings): number; 5597 getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; 5598 getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; 5599 getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; 5600 getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions): TextInsertion | undefined; 5601 isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; 5602 /** 5603 * 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. 5604 * Editors should call this after `>` is typed. 5605 */ 5606 getJsxClosingTagAtPosition(fileName: string, position: number): JsxClosingTagInfo | undefined; 5607 getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan | undefined; 5608 toLineColumnOffset?(fileName: string, position: number): LineAndCharacter; 5609 getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: readonly number[], formatOptions: FormatCodeSettings, preferences: UserPreferences): readonly CodeFixAction[]; 5610 getCombinedCodeFix(scope: CombinedCodeFixScope, fixId: {}, formatOptions: FormatCodeSettings, preferences: UserPreferences): CombinedCodeActions; 5611 applyCodeActionCommand(action: CodeActionCommand, formatSettings?: FormatCodeSettings): Promise<ApplyCodeActionCommandResult>; 5612 applyCodeActionCommand(action: CodeActionCommand[], formatSettings?: FormatCodeSettings): Promise<ApplyCodeActionCommandResult[]>; 5613 applyCodeActionCommand(action: CodeActionCommand | CodeActionCommand[], formatSettings?: FormatCodeSettings): Promise<ApplyCodeActionCommandResult | ApplyCodeActionCommandResult[]>; 5614 /** @deprecated `fileName` will be ignored */ 5615 applyCodeActionCommand(fileName: string, action: CodeActionCommand): Promise<ApplyCodeActionCommandResult>; 5616 /** @deprecated `fileName` will be ignored */ 5617 applyCodeActionCommand(fileName: string, action: CodeActionCommand[]): Promise<ApplyCodeActionCommandResult[]>; 5618 /** @deprecated `fileName` will be ignored */ 5619 applyCodeActionCommand(fileName: string, action: CodeActionCommand | CodeActionCommand[]): Promise<ApplyCodeActionCommandResult | ApplyCodeActionCommandResult[]>; 5620 getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined, triggerReason?: RefactorTriggerReason, kind?: string): ApplicableRefactorInfo[]; 5621 getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | undefined): RefactorEditInfo | undefined; 5622 organizeImports(scope: OrganizeImportsScope, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[]; 5623 getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[]; 5624 getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean, forceDtsEmit?: boolean): EmitOutput; 5625 getProgram(): Program | undefined; 5626 toggleLineComment(fileName: string, textRange: TextRange): TextChange[]; 5627 toggleMultilineComment(fileName: string, textRange: TextRange): TextChange[]; 5628 commentSelection(fileName: string, textRange: TextRange): TextChange[]; 5629 uncommentSelection(fileName: string, textRange: TextRange): TextChange[]; 5630 dispose(): void; 5631 } 5632 interface JsxClosingTagInfo { 5633 readonly newText: string; 5634 } 5635 interface CombinedCodeFixScope { 5636 type: "file"; 5637 fileName: string; 5638 } 5639 type OrganizeImportsScope = CombinedCodeFixScope; 5640 type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<" | "#"; 5641 interface GetCompletionsAtPositionOptions extends UserPreferences { 5642 /** 5643 * If the editor is asking for completions because a certain character was typed 5644 * (as opposed to when the user explicitly requested them) this should be set. 5645 */ 5646 triggerCharacter?: CompletionsTriggerCharacter; 5647 /** @deprecated Use includeCompletionsForModuleExports */ 5648 includeExternalModuleExports?: boolean; 5649 /** @deprecated Use includeCompletionsWithInsertText */ 5650 includeInsertTextCompletions?: boolean; 5651 } 5652 type SignatureHelpTriggerCharacter = "," | "(" | "<"; 5653 type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")"; 5654 interface SignatureHelpItemsOptions { 5655 triggerReason?: SignatureHelpTriggerReason; 5656 } 5657 type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason; 5658 /** 5659 * Signals that the user manually requested signature help. 5660 * The language service will unconditionally attempt to provide a result. 5661 */ 5662 interface SignatureHelpInvokedReason { 5663 kind: "invoked"; 5664 triggerCharacter?: undefined; 5665 } 5666 /** 5667 * Signals that the signature help request came from a user typing a character. 5668 * Depending on the character and the syntactic context, the request may or may not be served a result. 5669 */ 5670 interface SignatureHelpCharacterTypedReason { 5671 kind: "characterTyped"; 5672 /** 5673 * Character that was responsible for triggering signature help. 5674 */ 5675 triggerCharacter: SignatureHelpTriggerCharacter; 5676 } 5677 /** 5678 * Signals that this signature help request came from typing a character or moving the cursor. 5679 * This should only occur if a signature help session was already active and the editor needs to see if it should adjust. 5680 * The language service will unconditionally attempt to provide a result. 5681 * `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move. 5682 */ 5683 interface SignatureHelpRetriggeredReason { 5684 kind: "retrigger"; 5685 /** 5686 * Character that was responsible for triggering signature help. 5687 */ 5688 triggerCharacter?: SignatureHelpRetriggerCharacter; 5689 } 5690 interface ApplyCodeActionCommandResult { 5691 successMessage: string; 5692 } 5693 interface Classifications { 5694 spans: number[]; 5695 endOfLineState: EndOfLineState; 5696 } 5697 interface ClassifiedSpan { 5698 textSpan: TextSpan; 5699 classificationType: ClassificationTypeNames; 5700 } 5701 interface ClassifiedSpan2020 { 5702 textSpan: TextSpan; 5703 classificationType: number; 5704 } 5705 /** 5706 * Navigation bar interface designed for visual studio's dual-column layout. 5707 * This does not form a proper tree. 5708 * The navbar is returned as a list of top-level items, each of which has a list of child items. 5709 * Child items always have an empty array for their `childItems`. 5710 */ 5711 interface NavigationBarItem { 5712 text: string; 5713 kind: ScriptElementKind; 5714 kindModifiers: string; 5715 spans: TextSpan[]; 5716 childItems: NavigationBarItem[]; 5717 indent: number; 5718 bolded: boolean; 5719 grayed: boolean; 5720 } 5721 /** 5722 * Node in a tree of nested declarations in a file. 5723 * The top node is always a script or module node. 5724 */ 5725 interface NavigationTree { 5726 /** Name of the declaration, or a short description, e.g. "<class>". */ 5727 text: string; 5728 kind: ScriptElementKind; 5729 /** ScriptElementKindModifier separated by commas, e.g. "public,abstract" */ 5730 kindModifiers: string; 5731 /** 5732 * Spans of the nodes that generated this declaration. 5733 * There will be more than one if this is the result of merging. 5734 */ 5735 spans: TextSpan[]; 5736 nameSpan: TextSpan | undefined; 5737 /** Present if non-empty */ 5738 childItems?: NavigationTree[]; 5739 } 5740 interface CallHierarchyItem { 5741 name: string; 5742 kind: ScriptElementKind; 5743 kindModifiers?: string; 5744 file: string; 5745 span: TextSpan; 5746 selectionSpan: TextSpan; 5747 containerName?: string; 5748 } 5749 interface CallHierarchyIncomingCall { 5750 from: CallHierarchyItem; 5751 fromSpans: TextSpan[]; 5752 } 5753 interface CallHierarchyOutgoingCall { 5754 to: CallHierarchyItem; 5755 fromSpans: TextSpan[]; 5756 } 5757 interface TodoCommentDescriptor { 5758 text: string; 5759 priority: number; 5760 } 5761 interface TodoComment { 5762 descriptor: TodoCommentDescriptor; 5763 message: string; 5764 position: number; 5765 } 5766 interface TextChange { 5767 span: TextSpan; 5768 newText: string; 5769 } 5770 interface FileTextChanges { 5771 fileName: string; 5772 textChanges: readonly TextChange[]; 5773 isNewFile?: boolean; 5774 } 5775 interface CodeAction { 5776 /** Description of the code action to display in the UI of the editor */ 5777 description: string; 5778 /** Text changes to apply to each file as part of the code action */ 5779 changes: FileTextChanges[]; 5780 /** 5781 * If the user accepts the code fix, the editor should send the action back in a `applyAction` request. 5782 * This allows the language service to have side effects (e.g. installing dependencies) upon a code fix. 5783 */ 5784 commands?: CodeActionCommand[]; 5785 } 5786 interface CodeFixAction extends CodeAction { 5787 /** Short name to identify the fix, for use by telemetry. */ 5788 fixName: string; 5789 /** 5790 * If present, one may call 'getCombinedCodeFix' with this fixId. 5791 * This may be omitted to indicate that the code fix can't be applied in a group. 5792 */ 5793 fixId?: {}; 5794 fixAllDescription?: string; 5795 } 5796 interface CombinedCodeActions { 5797 changes: readonly FileTextChanges[]; 5798 commands?: readonly CodeActionCommand[]; 5799 } 5800 type CodeActionCommand = InstallPackageAction; 5801 interface InstallPackageAction { 5802 } 5803 /** 5804 * A set of one or more available refactoring actions, grouped under a parent refactoring. 5805 */ 5806 interface ApplicableRefactorInfo { 5807 /** 5808 * The programmatic name of the refactoring 5809 */ 5810 name: string; 5811 /** 5812 * A description of this refactoring category to show to the user. 5813 * If the refactoring gets inlined (see below), this text will not be visible. 5814 */ 5815 description: string; 5816 /** 5817 * Inlineable refactorings can have their actions hoisted out to the top level 5818 * of a context menu. Non-inlineanable refactorings should always be shown inside 5819 * their parent grouping. 5820 * 5821 * If not specified, this value is assumed to be 'true' 5822 */ 5823 inlineable?: boolean; 5824 actions: RefactorActionInfo[]; 5825 } 5826 /** 5827 * Represents a single refactoring action - for example, the "Extract Method..." refactor might 5828 * offer several actions, each corresponding to a surround class or closure to extract into. 5829 */ 5830 interface RefactorActionInfo { 5831 /** 5832 * The programmatic name of the refactoring action 5833 */ 5834 name: string; 5835 /** 5836 * A description of this refactoring action to show to the user. 5837 * If the parent refactoring is inlined away, this will be the only text shown, 5838 * so this description should make sense by itself if the parent is inlineable=true 5839 */ 5840 description: string; 5841 /** 5842 * A message to show to the user if the refactoring cannot be applied in 5843 * the current context. 5844 */ 5845 notApplicableReason?: string; 5846 /** 5847 * The hierarchical dotted name of the refactor action. 5848 */ 5849 kind?: string; 5850 } 5851 /** 5852 * A set of edits to make in response to a refactor action, plus an optional 5853 * location where renaming should be invoked from 5854 */ 5855 interface RefactorEditInfo { 5856 edits: FileTextChanges[]; 5857 renameFilename?: string; 5858 renameLocation?: number; 5859 commands?: CodeActionCommand[]; 5860 } 5861 type RefactorTriggerReason = "implicit" | "invoked"; 5862 interface TextInsertion { 5863 newText: string; 5864 /** The position in newText the caret should point to after the insertion. */ 5865 caretOffset: number; 5866 } 5867 interface DocumentSpan { 5868 textSpan: TextSpan; 5869 fileName: string; 5870 /** 5871 * If the span represents a location that was remapped (e.g. via a .d.ts.map file), 5872 * then the original filename and span will be specified here 5873 */ 5874 originalTextSpan?: TextSpan; 5875 originalFileName?: string; 5876 /** 5877 * If DocumentSpan.textSpan is the span for name of the declaration, 5878 * then this is the span for relevant declaration 5879 */ 5880 contextSpan?: TextSpan; 5881 originalContextSpan?: TextSpan; 5882 } 5883 interface RenameLocation extends DocumentSpan { 5884 readonly prefixText?: string; 5885 readonly suffixText?: string; 5886 } 5887 interface ReferenceEntry extends DocumentSpan { 5888 isWriteAccess: boolean; 5889 isDefinition: boolean; 5890 isInString?: true; 5891 } 5892 interface ImplementationLocation extends DocumentSpan { 5893 kind: ScriptElementKind; 5894 displayParts: SymbolDisplayPart[]; 5895 } 5896 enum HighlightSpanKind { 5897 none = "none", 5898 definition = "definition", 5899 reference = "reference", 5900 writtenReference = "writtenReference" 5901 } 5902 interface HighlightSpan { 5903 fileName?: string; 5904 isInString?: true; 5905 textSpan: TextSpan; 5906 contextSpan?: TextSpan; 5907 kind: HighlightSpanKind; 5908 } 5909 interface NavigateToItem { 5910 name: string; 5911 kind: ScriptElementKind; 5912 kindModifiers: string; 5913 matchKind: "exact" | "prefix" | "substring" | "camelCase"; 5914 isCaseSensitive: boolean; 5915 fileName: string; 5916 textSpan: TextSpan; 5917 containerName: string; 5918 containerKind: ScriptElementKind; 5919 } 5920 enum IndentStyle { 5921 None = 0, 5922 Block = 1, 5923 Smart = 2 5924 } 5925 enum SemicolonPreference { 5926 Ignore = "ignore", 5927 Insert = "insert", 5928 Remove = "remove" 5929 } 5930 interface EditorOptions { 5931 BaseIndentSize?: number; 5932 IndentSize: number; 5933 TabSize: number; 5934 NewLineCharacter: string; 5935 ConvertTabsToSpaces: boolean; 5936 IndentStyle: IndentStyle; 5937 } 5938 interface EditorSettings { 5939 baseIndentSize?: number; 5940 indentSize?: number; 5941 tabSize?: number; 5942 newLineCharacter?: string; 5943 convertTabsToSpaces?: boolean; 5944 indentStyle?: IndentStyle; 5945 trimTrailingWhitespace?: boolean; 5946 } 5947 interface FormatCodeOptions extends EditorOptions { 5948 InsertSpaceAfterCommaDelimiter: boolean; 5949 InsertSpaceAfterSemicolonInForStatements: boolean; 5950 InsertSpaceBeforeAndAfterBinaryOperators: boolean; 5951 InsertSpaceAfterConstructor?: boolean; 5952 InsertSpaceAfterKeywordsInControlFlowStatements: boolean; 5953 InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; 5954 InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; 5955 InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: boolean; 5956 InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean; 5957 InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean; 5958 InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean; 5959 InsertSpaceAfterTypeAssertion?: boolean; 5960 InsertSpaceBeforeFunctionParenthesis?: boolean; 5961 PlaceOpenBraceOnNewLineForFunctions: boolean; 5962 PlaceOpenBraceOnNewLineForControlBlocks: boolean; 5963 insertSpaceBeforeTypeAnnotation?: boolean; 5964 } 5965 interface FormatCodeSettings extends EditorSettings { 5966 readonly insertSpaceAfterCommaDelimiter?: boolean; 5967 readonly insertSpaceAfterSemicolonInForStatements?: boolean; 5968 readonly insertSpaceBeforeAndAfterBinaryOperators?: boolean; 5969 readonly insertSpaceAfterConstructor?: boolean; 5970 readonly insertSpaceAfterKeywordsInControlFlowStatements?: boolean; 5971 readonly insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean; 5972 readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean; 5973 readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean; 5974 readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean; 5975 readonly insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean; 5976 readonly insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean; 5977 readonly insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean; 5978 readonly insertSpaceAfterTypeAssertion?: boolean; 5979 readonly insertSpaceBeforeFunctionParenthesis?: boolean; 5980 readonly placeOpenBraceOnNewLineForFunctions?: boolean; 5981 readonly placeOpenBraceOnNewLineForControlBlocks?: boolean; 5982 readonly insertSpaceBeforeTypeAnnotation?: boolean; 5983 readonly indentMultiLineObjectLiteralBeginningOnBlankLine?: boolean; 5984 readonly semicolons?: SemicolonPreference; 5985 } 5986 function getDefaultFormatCodeSettings(newLineCharacter?: string): FormatCodeSettings; 5987 interface DefinitionInfo extends DocumentSpan { 5988 kind: ScriptElementKind; 5989 name: string; 5990 containerKind: ScriptElementKind; 5991 containerName: string; 5992 } 5993 interface DefinitionInfoAndBoundSpan { 5994 definitions?: readonly DefinitionInfo[]; 5995 textSpan: TextSpan; 5996 } 5997 interface ReferencedSymbolDefinitionInfo extends DefinitionInfo { 5998 displayParts: SymbolDisplayPart[]; 5999 } 6000 interface ReferencedSymbol { 6001 definition: ReferencedSymbolDefinitionInfo; 6002 references: ReferenceEntry[]; 6003 } 6004 enum SymbolDisplayPartKind { 6005 aliasName = 0, 6006 className = 1, 6007 enumName = 2, 6008 fieldName = 3, 6009 interfaceName = 4, 6010 keyword = 5, 6011 lineBreak = 6, 6012 numericLiteral = 7, 6013 stringLiteral = 8, 6014 localName = 9, 6015 methodName = 10, 6016 moduleName = 11, 6017 operator = 12, 6018 parameterName = 13, 6019 propertyName = 14, 6020 punctuation = 15, 6021 space = 16, 6022 text = 17, 6023 typeParameterName = 18, 6024 enumMemberName = 19, 6025 functionName = 20, 6026 regularExpressionLiteral = 21 6027 } 6028 interface SymbolDisplayPart { 6029 text: string; 6030 kind: string; 6031 } 6032 interface JSDocTagInfo { 6033 name: string; 6034 text?: string; 6035 } 6036 interface QuickInfo { 6037 kind: ScriptElementKind; 6038 kindModifiers: string; 6039 textSpan: TextSpan; 6040 displayParts?: SymbolDisplayPart[]; 6041 documentation?: SymbolDisplayPart[]; 6042 tags?: JSDocTagInfo[]; 6043 } 6044 type RenameInfo = RenameInfoSuccess | RenameInfoFailure; 6045 interface RenameInfoSuccess { 6046 canRename: true; 6047 /** 6048 * File or directory to rename. 6049 * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`. 6050 */ 6051 fileToRename?: string; 6052 displayName: string; 6053 fullDisplayName: string; 6054 kind: ScriptElementKind; 6055 kindModifiers: string; 6056 triggerSpan: TextSpan; 6057 } 6058 interface RenameInfoFailure { 6059 canRename: false; 6060 localizedErrorMessage: string; 6061 } 6062 interface RenameInfoOptions { 6063 readonly allowRenameOfImportPath?: boolean; 6064 } 6065 interface DocCommentTemplateOptions { 6066 readonly generateReturnInDocTemplate?: boolean; 6067 } 6068 interface SignatureHelpParameter { 6069 name: string; 6070 documentation: SymbolDisplayPart[]; 6071 displayParts: SymbolDisplayPart[]; 6072 isOptional: boolean; 6073 isRest?: boolean; 6074 } 6075 interface SelectionRange { 6076 textSpan: TextSpan; 6077 parent?: SelectionRange; 6078 } 6079 /** 6080 * Represents a single signature to show in signature help. 6081 * The id is used for subsequent calls into the language service to ask questions about the 6082 * signature help item in the context of any documents that have been updated. i.e. after 6083 * an edit has happened, while signature help is still active, the host can ask important 6084 * questions like 'what parameter is the user currently contained within?'. 6085 */ 6086 interface SignatureHelpItem { 6087 isVariadic: boolean; 6088 prefixDisplayParts: SymbolDisplayPart[]; 6089 suffixDisplayParts: SymbolDisplayPart[]; 6090 separatorDisplayParts: SymbolDisplayPart[]; 6091 parameters: SignatureHelpParameter[]; 6092 documentation: SymbolDisplayPart[]; 6093 tags: JSDocTagInfo[]; 6094 } 6095 /** 6096 * Represents a set of signature help items, and the preferred item that should be selected. 6097 */ 6098 interface SignatureHelpItems { 6099 items: SignatureHelpItem[]; 6100 applicableSpan: TextSpan; 6101 selectedItemIndex: number; 6102 argumentIndex: number; 6103 argumentCount: number; 6104 } 6105 interface CompletionInfo { 6106 /** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */ 6107 isGlobalCompletion: boolean; 6108 isMemberCompletion: boolean; 6109 /** 6110 * In the absence of `CompletionEntry["replacementSpan"], the editor may choose whether to use 6111 * this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span 6112 * must be used to commit that completion entry. 6113 */ 6114 optionalReplacementSpan?: TextSpan; 6115 /** 6116 * true when the current location also allows for a new identifier 6117 */ 6118 isNewIdentifierLocation: boolean; 6119 entries: CompletionEntry[]; 6120 } 6121 interface CompletionEntry { 6122 name: string; 6123 kind: ScriptElementKind; 6124 kindModifiers?: string; 6125 sortText: string; 6126 insertText?: string; 6127 /** 6128 * An optional span that indicates the text to be replaced by this completion item. 6129 * If present, this span should be used instead of the default one. 6130 * It will be set if the required span differs from the one generated by the default replacement behavior. 6131 */ 6132 replacementSpan?: TextSpan; 6133 hasAction?: true; 6134 source?: string; 6135 isRecommended?: true; 6136 isFromUncheckedFile?: true; 6137 isPackageJsonImport?: true; 6138 } 6139 interface CompletionEntryDetails { 6140 name: string; 6141 kind: ScriptElementKind; 6142 kindModifiers: string; 6143 displayParts: SymbolDisplayPart[]; 6144 documentation?: SymbolDisplayPart[]; 6145 tags?: JSDocTagInfo[]; 6146 codeActions?: CodeAction[]; 6147 source?: SymbolDisplayPart[]; 6148 } 6149 interface OutliningSpan { 6150 /** The span of the document to actually collapse. */ 6151 textSpan: TextSpan; 6152 /** The span of the document to display when the user hovers over the collapsed span. */ 6153 hintSpan: TextSpan; 6154 /** The text to display in the editor for the collapsed region. */ 6155 bannerText: string; 6156 /** 6157 * Whether or not this region should be automatically collapsed when 6158 * the 'Collapse to Definitions' command is invoked. 6159 */ 6160 autoCollapse: boolean; 6161 /** 6162 * Classification of the contents of the span 6163 */ 6164 kind: OutliningSpanKind; 6165 } 6166 enum OutliningSpanKind { 6167 /** Single or multi-line comments */ 6168 Comment = "comment", 6169 /** Sections marked by '// #region' and '// #endregion' comments */ 6170 Region = "region", 6171 /** Declarations and expressions */ 6172 Code = "code", 6173 /** Contiguous blocks of import declarations */ 6174 Imports = "imports" 6175 } 6176 enum OutputFileType { 6177 JavaScript = 0, 6178 SourceMap = 1, 6179 Declaration = 2 6180 } 6181 enum EndOfLineState { 6182 None = 0, 6183 InMultiLineCommentTrivia = 1, 6184 InSingleQuoteStringLiteral = 2, 6185 InDoubleQuoteStringLiteral = 3, 6186 InTemplateHeadOrNoSubstitutionTemplate = 4, 6187 InTemplateMiddleOrTail = 5, 6188 InTemplateSubstitutionPosition = 6 6189 } 6190 enum TokenClass { 6191 Punctuation = 0, 6192 Keyword = 1, 6193 Operator = 2, 6194 Comment = 3, 6195 Whitespace = 4, 6196 Identifier = 5, 6197 NumberLiteral = 6, 6198 BigIntLiteral = 7, 6199 StringLiteral = 8, 6200 RegExpLiteral = 9 6201 } 6202 interface ClassificationResult { 6203 finalLexState: EndOfLineState; 6204 entries: ClassificationInfo[]; 6205 } 6206 interface ClassificationInfo { 6207 length: number; 6208 classification: TokenClass; 6209 } 6210 interface Classifier { 6211 /** 6212 * Gives lexical classifications of tokens on a line without any syntactic context. 6213 * For instance, a token consisting of the text 'string' can be either an identifier 6214 * named 'string' or the keyword 'string', however, because this classifier is not aware, 6215 * it relies on certain heuristics to give acceptable results. For classifications where 6216 * speed trumps accuracy, this function is preferable; however, for true accuracy, the 6217 * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the 6218 * lexical, syntactic, and semantic classifiers may issue the best user experience. 6219 * 6220 * @param text The text of a line to classify. 6221 * @param lexState The state of the lexical classifier at the end of the previous line. 6222 * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. 6223 * If there is no syntactic classifier (syntacticClassifierAbsent=true), 6224 * certain heuristics may be used in its place; however, if there is a 6225 * syntactic classifier (syntacticClassifierAbsent=false), certain 6226 * classifications which may be incorrectly categorized will be given 6227 * back as Identifiers in order to allow the syntactic classifier to 6228 * subsume the classification. 6229 * @deprecated Use getLexicalClassifications instead. 6230 */ 6231 getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; 6232 getEncodedLexicalClassifications(text: string, endOfLineState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications; 6233 } 6234 enum ScriptElementKind { 6235 unknown = "", 6236 warning = "warning", 6237 /** predefined type (void) or keyword (class) */ 6238 keyword = "keyword", 6239 /** top level script node */ 6240 scriptElement = "script", 6241 /** module foo {} */ 6242 moduleElement = "module", 6243 /** class X {} */ 6244 classElement = "class", 6245 /** var x = class X {} */ 6246 localClassElement = "local class", 6247 /** struct X {} */ 6248 structElement = "struct", 6249 /** interface Y {} */ 6250 interfaceElement = "interface", 6251 /** type T = ... */ 6252 typeElement = "type", 6253 /** enum E */ 6254 enumElement = "enum", 6255 enumMemberElement = "enum member", 6256 /** 6257 * Inside module and script only 6258 * const v = .. 6259 */ 6260 variableElement = "var", 6261 /** Inside function */ 6262 localVariableElement = "local var", 6263 /** 6264 * Inside module and script only 6265 * function f() { } 6266 */ 6267 functionElement = "function", 6268 /** Inside function */ 6269 localFunctionElement = "local function", 6270 /** class X { [public|private]* foo() {} } */ 6271 memberFunctionElement = "method", 6272 /** class X { [public|private]* [get|set] foo:number; } */ 6273 memberGetAccessorElement = "getter", 6274 memberSetAccessorElement = "setter", 6275 /** 6276 * class X { [public|private]* foo:number; } 6277 * interface Y { foo:number; } 6278 */ 6279 memberVariableElement = "property", 6280 /** class X { constructor() { } } */ 6281 constructorImplementationElement = "constructor", 6282 /** interface Y { ():number; } */ 6283 callSignatureElement = "call", 6284 /** interface Y { []:number; } */ 6285 indexSignatureElement = "index", 6286 /** interface Y { new():Y; } */ 6287 constructSignatureElement = "construct", 6288 /** function foo(*Y*: string) */ 6289 parameterElement = "parameter", 6290 typeParameterElement = "type parameter", 6291 primitiveType = "primitive type", 6292 label = "label", 6293 alias = "alias", 6294 constElement = "const", 6295 letElement = "let", 6296 directory = "directory", 6297 externalModuleName = "external module name", 6298 /** 6299 * <JsxTagName attribute1 attribute2={0} /> 6300 */ 6301 jsxAttribute = "JSX attribute", 6302 /** String literal */ 6303 string = "string" 6304 } 6305 enum ScriptElementKindModifier { 6306 none = "", 6307 publicMemberModifier = "public", 6308 privateMemberModifier = "private", 6309 protectedMemberModifier = "protected", 6310 exportedModifier = "export", 6311 ambientModifier = "declare", 6312 staticModifier = "static", 6313 abstractModifier = "abstract", 6314 optionalModifier = "optional", 6315 deprecatedModifier = "deprecated", 6316 dtsModifier = ".d.ts", 6317 tsModifier = ".ts", 6318 tsxModifier = ".tsx", 6319 jsModifier = ".js", 6320 jsxModifier = ".jsx", 6321 jsonModifier = ".json" 6322 } 6323 enum ClassificationTypeNames { 6324 comment = "comment", 6325 identifier = "identifier", 6326 keyword = "keyword", 6327 numericLiteral = "number", 6328 bigintLiteral = "bigint", 6329 operator = "operator", 6330 stringLiteral = "string", 6331 whiteSpace = "whitespace", 6332 text = "text", 6333 punctuation = "punctuation", 6334 className = "class name", 6335 enumName = "enum name", 6336 interfaceName = "interface name", 6337 moduleName = "module name", 6338 typeParameterName = "type parameter name", 6339 typeAliasName = "type alias name", 6340 parameterName = "parameter name", 6341 docCommentTagName = "doc comment tag name", 6342 jsxOpenTagName = "jsx open tag name", 6343 jsxCloseTagName = "jsx close tag name", 6344 jsxSelfClosingTagName = "jsx self closing tag name", 6345 jsxAttribute = "jsx attribute", 6346 jsxText = "jsx text", 6347 jsxAttributeStringLiteralValue = "jsx attribute string literal value" 6348 } 6349 enum ClassificationType { 6350 comment = 1, 6351 identifier = 2, 6352 keyword = 3, 6353 numericLiteral = 4, 6354 operator = 5, 6355 stringLiteral = 6, 6356 regularExpressionLiteral = 7, 6357 whiteSpace = 8, 6358 text = 9, 6359 punctuation = 10, 6360 className = 11, 6361 enumName = 12, 6362 interfaceName = 13, 6363 moduleName = 14, 6364 typeParameterName = 15, 6365 typeAliasName = 16, 6366 parameterName = 17, 6367 docCommentTagName = 18, 6368 jsxOpenTagName = 19, 6369 jsxCloseTagName = 20, 6370 jsxSelfClosingTagName = 21, 6371 jsxAttribute = 22, 6372 jsxText = 23, 6373 jsxAttributeStringLiteralValue = 24, 6374 bigintLiteral = 25 6375 } 6376} 6377declare namespace ts { 6378 /** The classifier is used for syntactic highlighting in editors via the TSServer */ 6379 function createClassifier(): Classifier; 6380} 6381declare namespace ts { 6382 interface DocumentHighlights { 6383 fileName: string; 6384 highlightSpans: HighlightSpan[]; 6385 } 6386} 6387declare namespace ts { 6388 /** 6389 * The document registry represents a store of SourceFile objects that can be shared between 6390 * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) 6391 * of files in the context. 6392 * SourceFile objects account for most of the memory usage by the language service. Sharing 6393 * the same DocumentRegistry instance between different instances of LanguageService allow 6394 * for more efficient memory utilization since all projects will share at least the library 6395 * file (lib.d.ts). 6396 * 6397 * A more advanced use of the document registry is to serialize sourceFile objects to disk 6398 * and re-hydrate them when needed. 6399 * 6400 * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it 6401 * to all subsequent createLanguageService calls. 6402 */ 6403 interface DocumentRegistry { 6404 /** 6405 * Request a stored SourceFile with a given fileName and compilationSettings. 6406 * The first call to acquire will call createLanguageServiceSourceFile to generate 6407 * the SourceFile if was not found in the registry. 6408 * 6409 * @param fileName The name of the file requested 6410 * @param compilationSettings Some compilation settings like target affects the 6411 * shape of a the resulting SourceFile. This allows the DocumentRegistry to store 6412 * multiple copies of the same file for different compilation settings. 6413 * @param scriptSnapshot Text of the file. Only used if the file was not found 6414 * in the registry and a new one was created. 6415 * @param version Current version of the file. Only used if the file was not found 6416 * in the registry and a new one was created. 6417 */ 6418 acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile; 6419 acquireDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile; 6420 /** 6421 * Request an updated version of an already existing SourceFile with a given fileName 6422 * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile 6423 * to get an updated SourceFile. 6424 * 6425 * @param fileName The name of the file requested 6426 * @param compilationSettings Some compilation settings like target affects the 6427 * shape of a the resulting SourceFile. This allows the DocumentRegistry to store 6428 * multiple copies of the same file for different compilation settings. 6429 * @param scriptSnapshot Text of the file. 6430 * @param version Current version of the file. 6431 */ 6432 updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile; 6433 updateDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile; 6434 getKeyForCompilationSettings(settings: CompilerOptions): DocumentRegistryBucketKey; 6435 /** 6436 * Informs the DocumentRegistry that a file is not needed any longer. 6437 * 6438 * Note: It is not allowed to call release on a SourceFile that was not acquired from 6439 * this registry originally. 6440 * 6441 * @param fileName The name of the file to be released 6442 * @param compilationSettings The compilation settings used to acquire the file 6443 */ 6444 releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; 6445 releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey): void; 6446 reportStats(): string; 6447 } 6448 type DocumentRegistryBucketKey = string & { 6449 __bucketKey: any; 6450 }; 6451 function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory?: string): DocumentRegistry; 6452} 6453declare namespace ts { 6454 function preProcessFile(sourceText: string, readImportFiles?: boolean, detectJavaScriptImports?: boolean): PreProcessedFileInfo; 6455} 6456declare namespace ts { 6457 interface TranspileOptions { 6458 compilerOptions?: CompilerOptions; 6459 fileName?: string; 6460 reportDiagnostics?: boolean; 6461 moduleName?: string; 6462 renamedDependencies?: MapLike<string>; 6463 transformers?: CustomTransformers; 6464 } 6465 interface TranspileOutput { 6466 outputText: string; 6467 diagnostics?: Diagnostic[]; 6468 sourceMapText?: string; 6469 } 6470 function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput; 6471 function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string; 6472} 6473declare namespace ts { 6474 /** The version of the language service API */ 6475 const servicesVersion = "0.8"; 6476 function toEditorSettings(options: EditorOptions | EditorSettings): EditorSettings; 6477 function displayPartsToString(displayParts: SymbolDisplayPart[] | undefined): string; 6478 function getDefaultCompilerOptions(): CompilerOptions; 6479 function getSupportedCodeFixes(): string[]; 6480 function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean, scriptKind?: ScriptKind, option?: CompilerOptions): SourceFile; 6481 function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange | undefined, aggressiveChecks?: boolean, option?: CompilerOptions): SourceFile; 6482 function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry, syntaxOnlyOrLanguageServiceMode?: boolean | LanguageServiceMode): LanguageService; 6483 /** 6484 * Get the path of the default library files (lib.d.ts) as distributed with the typescript 6485 * node package. 6486 * The functionality is not supported if the ts module is consumed outside of a node module. 6487 */ 6488 function getDefaultLibFilePath(options: CompilerOptions): string; 6489} 6490declare namespace ts { 6491 /** 6492 * Transform one or more nodes using the supplied transformers. 6493 * @param source A single `Node` or an array of `Node` objects. 6494 * @param transformers An array of `TransformerFactory` callbacks used to process the transformation. 6495 * @param compilerOptions Optional compiler options. 6496 */ 6497 function transform<T extends Node>(source: T | T[], transformers: TransformerFactory<T>[], compilerOptions?: CompilerOptions): TransformationResult<T>; 6498} 6499declare namespace ts.server { 6500 interface CompressedData { 6501 length: number; 6502 compressionKind: string; 6503 data: any; 6504 } 6505 type RequireResult = { 6506 module: {}; 6507 error: undefined; 6508 } | { 6509 module: undefined; 6510 error: { 6511 stack?: string; 6512 message?: string; 6513 }; 6514 }; 6515 interface ServerHost extends System { 6516 watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: WatchOptions): FileWatcher; 6517 watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: WatchOptions): FileWatcher; 6518 setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): any; 6519 clearTimeout(timeoutId: any): void; 6520 setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; 6521 clearImmediate(timeoutId: any): void; 6522 gc?(): void; 6523 trace?(s: string): void; 6524 require?(initialPath: string, moduleName: string): RequireResult; 6525 } 6526} 6527declare namespace ts.server { 6528 enum LogLevel { 6529 terse = 0, 6530 normal = 1, 6531 requestTime = 2, 6532 verbose = 3 6533 } 6534 const emptyArray: SortedReadonlyArray<never>; 6535 interface Logger { 6536 close(): void; 6537 hasLevel(level: LogLevel): boolean; 6538 loggingEnabled(): boolean; 6539 perftrc(s: string): void; 6540 info(s: string): void; 6541 startGroup(): void; 6542 endGroup(): void; 6543 msg(s: string, type?: Msg): void; 6544 getLogFileName(): string | undefined; 6545 } 6546 enum Msg { 6547 Err = "Err", 6548 Info = "Info", 6549 Perf = "Perf" 6550 } 6551 namespace Msg { 6552 /** @deprecated Only here for backwards-compatibility. Prefer just `Msg`. */ 6553 type Types = Msg; 6554 } 6555 function createInstallTypingsRequest(project: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string>, cachePath?: string): DiscoverTypings; 6556 namespace Errors { 6557 function ThrowNoProject(): never; 6558 function ThrowProjectLanguageServiceDisabled(): never; 6559 function ThrowProjectDoesNotContainDocument(fileName: string, project: Project): never; 6560 } 6561 type NormalizedPath = string & { 6562 __normalizedPathTag: any; 6563 }; 6564 function toNormalizedPath(fileName: string): NormalizedPath; 6565 function normalizedPathToPath(normalizedPath: NormalizedPath, currentDirectory: string, getCanonicalFileName: (f: string) => string): Path; 6566 function asNormalizedPath(fileName: string): NormalizedPath; 6567 interface NormalizedPathMap<T> { 6568 get(path: NormalizedPath): T | undefined; 6569 set(path: NormalizedPath, value: T): void; 6570 contains(path: NormalizedPath): boolean; 6571 remove(path: NormalizedPath): void; 6572 } 6573 function createNormalizedPathMap<T>(): NormalizedPathMap<T>; 6574 function isInferredProjectName(name: string): boolean; 6575 function makeInferredProjectName(counter: number): string; 6576 function createSortedArray<T>(): SortedArray<T>; 6577} 6578/** 6579 * Declaration module describing the TypeScript Server protocol 6580 */ 6581declare namespace ts.server.protocol { 6582 enum CommandTypes { 6583 JsxClosingTag = "jsxClosingTag", 6584 Brace = "brace", 6585 BraceCompletion = "braceCompletion", 6586 GetSpanOfEnclosingComment = "getSpanOfEnclosingComment", 6587 Change = "change", 6588 Close = "close", 6589 /** @deprecated Prefer CompletionInfo -- see comment on CompletionsResponse */ 6590 Completions = "completions", 6591 CompletionInfo = "completionInfo", 6592 CompletionDetails = "completionEntryDetails", 6593 CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList", 6594 CompileOnSaveEmitFile = "compileOnSaveEmitFile", 6595 Configure = "configure", 6596 Definition = "definition", 6597 DefinitionAndBoundSpan = "definitionAndBoundSpan", 6598 Implementation = "implementation", 6599 Exit = "exit", 6600 FileReferences = "fileReferences", 6601 Format = "format", 6602 Formatonkey = "formatonkey", 6603 Geterr = "geterr", 6604 GeterrForProject = "geterrForProject", 6605 SemanticDiagnosticsSync = "semanticDiagnosticsSync", 6606 SyntacticDiagnosticsSync = "syntacticDiagnosticsSync", 6607 SuggestionDiagnosticsSync = "suggestionDiagnosticsSync", 6608 NavBar = "navbar", 6609 Navto = "navto", 6610 NavTree = "navtree", 6611 NavTreeFull = "navtree-full", 6612 /** @deprecated */ 6613 Occurrences = "occurrences", 6614 DocumentHighlights = "documentHighlights", 6615 Open = "open", 6616 Quickinfo = "quickinfo", 6617 References = "references", 6618 Reload = "reload", 6619 Rename = "rename", 6620 Saveto = "saveto", 6621 SignatureHelp = "signatureHelp", 6622 Status = "status", 6623 TypeDefinition = "typeDefinition", 6624 ProjectInfo = "projectInfo", 6625 ReloadProjects = "reloadProjects", 6626 Unknown = "unknown", 6627 OpenExternalProject = "openExternalProject", 6628 OpenExternalProjects = "openExternalProjects", 6629 CloseExternalProject = "closeExternalProject", 6630 UpdateOpen = "updateOpen", 6631 GetOutliningSpans = "getOutliningSpans", 6632 TodoComments = "todoComments", 6633 Indentation = "indentation", 6634 DocCommentTemplate = "docCommentTemplate", 6635 CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects", 6636 GetCodeFixes = "getCodeFixes", 6637 GetCombinedCodeFix = "getCombinedCodeFix", 6638 ApplyCodeActionCommand = "applyCodeActionCommand", 6639 GetSupportedCodeFixes = "getSupportedCodeFixes", 6640 GetApplicableRefactors = "getApplicableRefactors", 6641 GetEditsForRefactor = "getEditsForRefactor", 6642 OrganizeImports = "organizeImports", 6643 GetEditsForFileRename = "getEditsForFileRename", 6644 ConfigurePlugin = "configurePlugin", 6645 SelectionRange = "selectionRange", 6646 ToggleLineComment = "toggleLineComment", 6647 ToggleMultilineComment = "toggleMultilineComment", 6648 CommentSelection = "commentSelection", 6649 UncommentSelection = "uncommentSelection", 6650 PrepareCallHierarchy = "prepareCallHierarchy", 6651 ProvideCallHierarchyIncomingCalls = "provideCallHierarchyIncomingCalls", 6652 ProvideCallHierarchyOutgoingCalls = "provideCallHierarchyOutgoingCalls" 6653 } 6654 /** 6655 * A TypeScript Server message 6656 */ 6657 interface Message { 6658 /** 6659 * Sequence number of the message 6660 */ 6661 seq: number; 6662 /** 6663 * One of "request", "response", or "event" 6664 */ 6665 type: "request" | "response" | "event"; 6666 } 6667 /** 6668 * Client-initiated request message 6669 */ 6670 interface Request extends Message { 6671 type: "request"; 6672 /** 6673 * The command to execute 6674 */ 6675 command: string; 6676 /** 6677 * Object containing arguments for the command 6678 */ 6679 arguments?: any; 6680 } 6681 /** 6682 * Request to reload the project structure for all the opened files 6683 */ 6684 interface ReloadProjectsRequest extends Message { 6685 command: CommandTypes.ReloadProjects; 6686 } 6687 /** 6688 * Server-initiated event message 6689 */ 6690 interface Event extends Message { 6691 type: "event"; 6692 /** 6693 * Name of event 6694 */ 6695 event: string; 6696 /** 6697 * Event-specific information 6698 */ 6699 body?: any; 6700 } 6701 /** 6702 * Response by server to client request message. 6703 */ 6704 interface Response extends Message { 6705 type: "response"; 6706 /** 6707 * Sequence number of the request message. 6708 */ 6709 request_seq: number; 6710 /** 6711 * Outcome of the request. 6712 */ 6713 success: boolean; 6714 /** 6715 * The command requested. 6716 */ 6717 command: string; 6718 /** 6719 * If success === false, this should always be provided. 6720 * Otherwise, may (or may not) contain a success message. 6721 */ 6722 message?: string; 6723 /** 6724 * Contains message body if success === true. 6725 */ 6726 body?: any; 6727 /** 6728 * Contains extra information that plugin can include to be passed on 6729 */ 6730 metadata?: unknown; 6731 /** 6732 * Exposes information about the performance of this request-response pair. 6733 */ 6734 performanceData?: PerformanceData; 6735 } 6736 interface PerformanceData { 6737 /** 6738 * Time spent updating the program graph, in milliseconds. 6739 */ 6740 updateGraphDurationMs?: number; 6741 /** 6742 * The time spent creating or updating the auto-import program, in milliseconds. 6743 */ 6744 createAutoImportProviderProgramDurationMs?: number; 6745 } 6746 /** 6747 * Arguments for FileRequest messages. 6748 */ 6749 interface FileRequestArgs { 6750 /** 6751 * The file for the request (absolute pathname required). 6752 */ 6753 file: string; 6754 projectFileName?: string; 6755 } 6756 interface StatusRequest extends Request { 6757 command: CommandTypes.Status; 6758 } 6759 interface StatusResponseBody { 6760 /** 6761 * The TypeScript version (`ts.version`). 6762 */ 6763 version: string; 6764 } 6765 /** 6766 * Response to StatusRequest 6767 */ 6768 interface StatusResponse extends Response { 6769 body: StatusResponseBody; 6770 } 6771 /** 6772 * Requests a JS Doc comment template for a given position 6773 */ 6774 interface DocCommentTemplateRequest extends FileLocationRequest { 6775 command: CommandTypes.DocCommentTemplate; 6776 } 6777 /** 6778 * Response to DocCommentTemplateRequest 6779 */ 6780 interface DocCommandTemplateResponse extends Response { 6781 body?: TextInsertion; 6782 } 6783 /** 6784 * A request to get TODO comments from the file 6785 */ 6786 interface TodoCommentRequest extends FileRequest { 6787 command: CommandTypes.TodoComments; 6788 arguments: TodoCommentRequestArgs; 6789 } 6790 /** 6791 * Arguments for TodoCommentRequest request. 6792 */ 6793 interface TodoCommentRequestArgs extends FileRequestArgs { 6794 /** 6795 * Array of target TodoCommentDescriptors that describes TODO comments to be found 6796 */ 6797 descriptors: TodoCommentDescriptor[]; 6798 } 6799 /** 6800 * Response for TodoCommentRequest request. 6801 */ 6802 interface TodoCommentsResponse extends Response { 6803 body?: TodoComment[]; 6804 } 6805 /** 6806 * A request to determine if the caret is inside a comment. 6807 */ 6808 interface SpanOfEnclosingCommentRequest extends FileLocationRequest { 6809 command: CommandTypes.GetSpanOfEnclosingComment; 6810 arguments: SpanOfEnclosingCommentRequestArgs; 6811 } 6812 interface SpanOfEnclosingCommentRequestArgs extends FileLocationRequestArgs { 6813 /** 6814 * Requires that the enclosing span be a multi-line comment, or else the request returns undefined. 6815 */ 6816 onlyMultiLine: boolean; 6817 } 6818 /** 6819 * Request to obtain outlining spans in file. 6820 */ 6821 interface OutliningSpansRequest extends FileRequest { 6822 command: CommandTypes.GetOutliningSpans; 6823 } 6824 interface OutliningSpan { 6825 /** The span of the document to actually collapse. */ 6826 textSpan: TextSpan; 6827 /** The span of the document to display when the user hovers over the collapsed span. */ 6828 hintSpan: TextSpan; 6829 /** The text to display in the editor for the collapsed region. */ 6830 bannerText: string; 6831 /** 6832 * Whether or not this region should be automatically collapsed when 6833 * the 'Collapse to Definitions' command is invoked. 6834 */ 6835 autoCollapse: boolean; 6836 /** 6837 * Classification of the contents of the span 6838 */ 6839 kind: OutliningSpanKind; 6840 } 6841 /** 6842 * Response to OutliningSpansRequest request. 6843 */ 6844 interface OutliningSpansResponse extends Response { 6845 body?: OutliningSpan[]; 6846 } 6847 /** 6848 * A request to get indentation for a location in file 6849 */ 6850 interface IndentationRequest extends FileLocationRequest { 6851 command: CommandTypes.Indentation; 6852 arguments: IndentationRequestArgs; 6853 } 6854 /** 6855 * Response for IndentationRequest request. 6856 */ 6857 interface IndentationResponse extends Response { 6858 body?: IndentationResult; 6859 } 6860 /** 6861 * Indentation result representing where indentation should be placed 6862 */ 6863 interface IndentationResult { 6864 /** 6865 * The base position in the document that the indent should be relative to 6866 */ 6867 position: number; 6868 /** 6869 * The number of columns the indent should be at relative to the position's column. 6870 */ 6871 indentation: number; 6872 } 6873 /** 6874 * Arguments for IndentationRequest request. 6875 */ 6876 interface IndentationRequestArgs extends FileLocationRequestArgs { 6877 /** 6878 * An optional set of settings to be used when computing indentation. 6879 * If argument is omitted - then it will use settings for file that were previously set via 'configure' request or global settings. 6880 */ 6881 options?: EditorSettings; 6882 } 6883 /** 6884 * Arguments for ProjectInfoRequest request. 6885 */ 6886 interface ProjectInfoRequestArgs extends FileRequestArgs { 6887 /** 6888 * Indicate if the file name list of the project is needed 6889 */ 6890 needFileNameList: boolean; 6891 } 6892 /** 6893 * A request to get the project information of the current file. 6894 */ 6895 interface ProjectInfoRequest extends Request { 6896 command: CommandTypes.ProjectInfo; 6897 arguments: ProjectInfoRequestArgs; 6898 } 6899 /** 6900 * A request to retrieve compiler options diagnostics for a project 6901 */ 6902 interface CompilerOptionsDiagnosticsRequest extends Request { 6903 arguments: CompilerOptionsDiagnosticsRequestArgs; 6904 } 6905 /** 6906 * Arguments for CompilerOptionsDiagnosticsRequest request. 6907 */ 6908 interface CompilerOptionsDiagnosticsRequestArgs { 6909 /** 6910 * Name of the project to retrieve compiler options diagnostics. 6911 */ 6912 projectFileName: string; 6913 } 6914 /** 6915 * Response message body for "projectInfo" request 6916 */ 6917 interface ProjectInfo { 6918 /** 6919 * For configured project, this is the normalized path of the 'tsconfig.json' file 6920 * For inferred project, this is undefined 6921 */ 6922 configFileName: string; 6923 /** 6924 * The list of normalized file name in the project, including 'lib.d.ts' 6925 */ 6926 fileNames?: string[]; 6927 /** 6928 * Indicates if the project has a active language service instance 6929 */ 6930 languageServiceDisabled?: boolean; 6931 } 6932 /** 6933 * Represents diagnostic info that includes location of diagnostic in two forms 6934 * - start position and length of the error span 6935 * - startLocation and endLocation - a pair of Location objects that store start/end line and offset of the error span. 6936 */ 6937 interface DiagnosticWithLinePosition { 6938 message: string; 6939 start: number; 6940 length: number; 6941 startLocation: Location; 6942 endLocation: Location; 6943 category: string; 6944 code: number; 6945 /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */ 6946 reportsUnnecessary?: {}; 6947 reportsDeprecated?: {}; 6948 relatedInformation?: DiagnosticRelatedInformation[]; 6949 } 6950 /** 6951 * Response message for "projectInfo" request 6952 */ 6953 interface ProjectInfoResponse extends Response { 6954 body?: ProjectInfo; 6955 } 6956 /** 6957 * Request whose sole parameter is a file name. 6958 */ 6959 interface FileRequest extends Request { 6960 arguments: FileRequestArgs; 6961 } 6962 /** 6963 * Instances of this interface specify a location in a source file: 6964 * (file, line, character offset), where line and character offset are 1-based. 6965 */ 6966 interface FileLocationRequestArgs extends FileRequestArgs { 6967 /** 6968 * The line number for the request (1-based). 6969 */ 6970 line: number; 6971 /** 6972 * The character offset (on the line) for the request (1-based). 6973 */ 6974 offset: number; 6975 } 6976 type FileLocationOrRangeRequestArgs = FileLocationRequestArgs | FileRangeRequestArgs; 6977 /** 6978 * Request refactorings at a given position or selection area. 6979 */ 6980 interface GetApplicableRefactorsRequest extends Request { 6981 command: CommandTypes.GetApplicableRefactors; 6982 arguments: GetApplicableRefactorsRequestArgs; 6983 } 6984 type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs & { 6985 triggerReason?: RefactorTriggerReason; 6986 kind?: string; 6987 }; 6988 type RefactorTriggerReason = "implicit" | "invoked"; 6989 /** 6990 * Response is a list of available refactorings. 6991 * Each refactoring exposes one or more "Actions"; a user selects one action to invoke a refactoring 6992 */ 6993 interface GetApplicableRefactorsResponse extends Response { 6994 body?: ApplicableRefactorInfo[]; 6995 } 6996 /** 6997 * A set of one or more available refactoring actions, grouped under a parent refactoring. 6998 */ 6999 interface ApplicableRefactorInfo { 7000 /** 7001 * The programmatic name of the refactoring 7002 */ 7003 name: string; 7004 /** 7005 * A description of this refactoring category to show to the user. 7006 * If the refactoring gets inlined (see below), this text will not be visible. 7007 */ 7008 description: string; 7009 /** 7010 * Inlineable refactorings can have their actions hoisted out to the top level 7011 * of a context menu. Non-inlineanable refactorings should always be shown inside 7012 * their parent grouping. 7013 * 7014 * If not specified, this value is assumed to be 'true' 7015 */ 7016 inlineable?: boolean; 7017 actions: RefactorActionInfo[]; 7018 } 7019 /** 7020 * Represents a single refactoring action - for example, the "Extract Method..." refactor might 7021 * offer several actions, each corresponding to a surround class or closure to extract into. 7022 */ 7023 interface RefactorActionInfo { 7024 /** 7025 * The programmatic name of the refactoring action 7026 */ 7027 name: string; 7028 /** 7029 * A description of this refactoring action to show to the user. 7030 * If the parent refactoring is inlined away, this will be the only text shown, 7031 * so this description should make sense by itself if the parent is inlineable=true 7032 */ 7033 description: string; 7034 /** 7035 * A message to show to the user if the refactoring cannot be applied in 7036 * the current context. 7037 */ 7038 notApplicableReason?: string; 7039 /** 7040 * The hierarchical dotted name of the refactor action. 7041 */ 7042 kind?: string; 7043 } 7044 interface GetEditsForRefactorRequest extends Request { 7045 command: CommandTypes.GetEditsForRefactor; 7046 arguments: GetEditsForRefactorRequestArgs; 7047 } 7048 /** 7049 * Request the edits that a particular refactoring action produces. 7050 * Callers must specify the name of the refactor and the name of the action. 7051 */ 7052 type GetEditsForRefactorRequestArgs = FileLocationOrRangeRequestArgs & { 7053 refactor: string; 7054 action: string; 7055 }; 7056 interface GetEditsForRefactorResponse extends Response { 7057 body?: RefactorEditInfo; 7058 } 7059 interface RefactorEditInfo { 7060 edits: FileCodeEdits[]; 7061 /** 7062 * An optional location where the editor should start a rename operation once 7063 * the refactoring edits have been applied 7064 */ 7065 renameLocation?: Location; 7066 renameFilename?: string; 7067 } 7068 /** 7069 * Organize imports by: 7070 * 1) Removing unused imports 7071 * 2) Coalescing imports from the same module 7072 * 3) Sorting imports 7073 */ 7074 interface OrganizeImportsRequest extends Request { 7075 command: CommandTypes.OrganizeImports; 7076 arguments: OrganizeImportsRequestArgs; 7077 } 7078 type OrganizeImportsScope = GetCombinedCodeFixScope; 7079 interface OrganizeImportsRequestArgs { 7080 scope: OrganizeImportsScope; 7081 } 7082 interface OrganizeImportsResponse extends Response { 7083 body: readonly FileCodeEdits[]; 7084 } 7085 interface GetEditsForFileRenameRequest extends Request { 7086 command: CommandTypes.GetEditsForFileRename; 7087 arguments: GetEditsForFileRenameRequestArgs; 7088 } 7089 /** Note: Paths may also be directories. */ 7090 interface GetEditsForFileRenameRequestArgs { 7091 readonly oldFilePath: string; 7092 readonly newFilePath: string; 7093 } 7094 interface GetEditsForFileRenameResponse extends Response { 7095 body: readonly FileCodeEdits[]; 7096 } 7097 /** 7098 * Request for the available codefixes at a specific position. 7099 */ 7100 interface CodeFixRequest extends Request { 7101 command: CommandTypes.GetCodeFixes; 7102 arguments: CodeFixRequestArgs; 7103 } 7104 interface GetCombinedCodeFixRequest extends Request { 7105 command: CommandTypes.GetCombinedCodeFix; 7106 arguments: GetCombinedCodeFixRequestArgs; 7107 } 7108 interface GetCombinedCodeFixResponse extends Response { 7109 body: CombinedCodeActions; 7110 } 7111 interface ApplyCodeActionCommandRequest extends Request { 7112 command: CommandTypes.ApplyCodeActionCommand; 7113 arguments: ApplyCodeActionCommandRequestArgs; 7114 } 7115 interface ApplyCodeActionCommandResponse extends Response { 7116 } 7117 interface FileRangeRequestArgs extends FileRequestArgs { 7118 /** 7119 * The line number for the request (1-based). 7120 */ 7121 startLine: number; 7122 /** 7123 * The character offset (on the line) for the request (1-based). 7124 */ 7125 startOffset: number; 7126 /** 7127 * The line number for the request (1-based). 7128 */ 7129 endLine: number; 7130 /** 7131 * The character offset (on the line) for the request (1-based). 7132 */ 7133 endOffset: number; 7134 } 7135 /** 7136 * Instances of this interface specify errorcodes on a specific location in a sourcefile. 7137 */ 7138 interface CodeFixRequestArgs extends FileRangeRequestArgs { 7139 /** 7140 * Errorcodes we want to get the fixes for. 7141 */ 7142 errorCodes: readonly number[]; 7143 } 7144 interface GetCombinedCodeFixRequestArgs { 7145 scope: GetCombinedCodeFixScope; 7146 fixId: {}; 7147 } 7148 interface GetCombinedCodeFixScope { 7149 type: "file"; 7150 args: FileRequestArgs; 7151 } 7152 interface ApplyCodeActionCommandRequestArgs { 7153 /** May also be an array of commands. */ 7154 command: {}; 7155 } 7156 /** 7157 * Response for GetCodeFixes request. 7158 */ 7159 interface GetCodeFixesResponse extends Response { 7160 body?: CodeAction[]; 7161 } 7162 /** 7163 * A request whose arguments specify a file location (file, line, col). 7164 */ 7165 interface FileLocationRequest extends FileRequest { 7166 arguments: FileLocationRequestArgs; 7167 } 7168 /** 7169 * A request to get codes of supported code fixes. 7170 */ 7171 interface GetSupportedCodeFixesRequest extends Request { 7172 command: CommandTypes.GetSupportedCodeFixes; 7173 } 7174 /** 7175 * A response for GetSupportedCodeFixesRequest request. 7176 */ 7177 interface GetSupportedCodeFixesResponse extends Response { 7178 /** 7179 * List of error codes supported by the server. 7180 */ 7181 body?: string[]; 7182 } 7183 /** 7184 * A request to get encoded semantic classifications for a span in the file 7185 */ 7186 interface EncodedSemanticClassificationsRequest extends FileRequest { 7187 arguments: EncodedSemanticClassificationsRequestArgs; 7188 } 7189 /** 7190 * Arguments for EncodedSemanticClassificationsRequest request. 7191 */ 7192 interface EncodedSemanticClassificationsRequestArgs extends FileRequestArgs { 7193 /** 7194 * Start position of the span. 7195 */ 7196 start: number; 7197 /** 7198 * Length of the span. 7199 */ 7200 length: number; 7201 /** 7202 * Optional parameter for the semantic highlighting response, if absent it 7203 * defaults to "original". 7204 */ 7205 format?: "original" | "2020"; 7206 } 7207 /** The response for a EncodedSemanticClassificationsRequest */ 7208 interface EncodedSemanticClassificationsResponse extends Response { 7209 body?: EncodedSemanticClassificationsResponseBody; 7210 } 7211 /** 7212 * Implementation response message. Gives series of text spans depending on the format ar. 7213 */ 7214 interface EncodedSemanticClassificationsResponseBody { 7215 endOfLineState: EndOfLineState; 7216 spans: number[]; 7217 } 7218 /** 7219 * Arguments in document highlight request; include: filesToSearch, file, 7220 * line, offset. 7221 */ 7222 interface DocumentHighlightsRequestArgs extends FileLocationRequestArgs { 7223 /** 7224 * List of files to search for document highlights. 7225 */ 7226 filesToSearch: string[]; 7227 } 7228 /** 7229 * Go to definition request; value of command field is 7230 * "definition". Return response giving the file locations that 7231 * define the symbol found in file at location line, col. 7232 */ 7233 interface DefinitionRequest extends FileLocationRequest { 7234 command: CommandTypes.Definition; 7235 } 7236 interface DefinitionAndBoundSpanRequest extends FileLocationRequest { 7237 readonly command: CommandTypes.DefinitionAndBoundSpan; 7238 } 7239 interface DefinitionAndBoundSpanResponse extends Response { 7240 readonly body: DefinitionInfoAndBoundSpan; 7241 } 7242 /** 7243 * Go to type request; value of command field is 7244 * "typeDefinition". Return response giving the file locations that 7245 * define the type for the symbol found in file at location line, col. 7246 */ 7247 interface TypeDefinitionRequest extends FileLocationRequest { 7248 command: CommandTypes.TypeDefinition; 7249 } 7250 /** 7251 * Go to implementation request; value of command field is 7252 * "implementation". Return response giving the file locations that 7253 * implement the symbol found in file at location line, col. 7254 */ 7255 interface ImplementationRequest extends FileLocationRequest { 7256 command: CommandTypes.Implementation; 7257 } 7258 /** 7259 * Location in source code expressed as (one-based) line and (one-based) column offset. 7260 */ 7261 interface Location { 7262 line: number; 7263 offset: number; 7264 } 7265 /** 7266 * Object found in response messages defining a span of text in source code. 7267 */ 7268 interface TextSpan { 7269 /** 7270 * First character of the definition. 7271 */ 7272 start: Location; 7273 /** 7274 * One character past last character of the definition. 7275 */ 7276 end: Location; 7277 } 7278 /** 7279 * Object found in response messages defining a span of text in a specific source file. 7280 */ 7281 interface FileSpan extends TextSpan { 7282 /** 7283 * File containing text span. 7284 */ 7285 file: string; 7286 } 7287 interface TextSpanWithContext extends TextSpan { 7288 contextStart?: Location; 7289 contextEnd?: Location; 7290 } 7291 interface FileSpanWithContext extends FileSpan, TextSpanWithContext { 7292 } 7293 interface DefinitionInfoAndBoundSpan { 7294 definitions: readonly FileSpanWithContext[]; 7295 textSpan: TextSpan; 7296 } 7297 /** 7298 * Definition response message. Gives text range for definition. 7299 */ 7300 interface DefinitionResponse extends Response { 7301 body?: FileSpanWithContext[]; 7302 } 7303 interface DefinitionInfoAndBoundSpanResponse extends Response { 7304 body?: DefinitionInfoAndBoundSpan; 7305 } 7306 /** @deprecated Use `DefinitionInfoAndBoundSpanResponse` instead. */ 7307 type DefinitionInfoAndBoundSpanReponse = DefinitionInfoAndBoundSpanResponse; 7308 /** 7309 * Definition response message. Gives text range for definition. 7310 */ 7311 interface TypeDefinitionResponse extends Response { 7312 body?: FileSpanWithContext[]; 7313 } 7314 /** 7315 * Implementation response message. Gives text range for implementations. 7316 */ 7317 interface ImplementationResponse extends Response { 7318 body?: FileSpanWithContext[]; 7319 } 7320 /** 7321 * Request to get brace completion for a location in the file. 7322 */ 7323 interface BraceCompletionRequest extends FileLocationRequest { 7324 command: CommandTypes.BraceCompletion; 7325 arguments: BraceCompletionRequestArgs; 7326 } 7327 /** 7328 * Argument for BraceCompletionRequest request. 7329 */ 7330 interface BraceCompletionRequestArgs extends FileLocationRequestArgs { 7331 /** 7332 * Kind of opening brace 7333 */ 7334 openingBrace: string; 7335 } 7336 interface JsxClosingTagRequest extends FileLocationRequest { 7337 readonly command: CommandTypes.JsxClosingTag; 7338 readonly arguments: JsxClosingTagRequestArgs; 7339 } 7340 interface JsxClosingTagRequestArgs extends FileLocationRequestArgs { 7341 } 7342 interface JsxClosingTagResponse extends Response { 7343 readonly body: TextInsertion; 7344 } 7345 /** 7346 * @deprecated 7347 * Get occurrences request; value of command field is 7348 * "occurrences". Return response giving spans that are relevant 7349 * in the file at a given line and column. 7350 */ 7351 interface OccurrencesRequest extends FileLocationRequest { 7352 command: CommandTypes.Occurrences; 7353 } 7354 /** @deprecated */ 7355 interface OccurrencesResponseItem extends FileSpanWithContext { 7356 /** 7357 * True if the occurrence is a write location, false otherwise. 7358 */ 7359 isWriteAccess: boolean; 7360 /** 7361 * True if the occurrence is in a string, undefined otherwise; 7362 */ 7363 isInString?: true; 7364 } 7365 /** @deprecated */ 7366 interface OccurrencesResponse extends Response { 7367 body?: OccurrencesResponseItem[]; 7368 } 7369 /** 7370 * Get document highlights request; value of command field is 7371 * "documentHighlights". Return response giving spans that are relevant 7372 * in the file at a given line and column. 7373 */ 7374 interface DocumentHighlightsRequest extends FileLocationRequest { 7375 command: CommandTypes.DocumentHighlights; 7376 arguments: DocumentHighlightsRequestArgs; 7377 } 7378 /** 7379 * Span augmented with extra information that denotes the kind of the highlighting to be used for span. 7380 */ 7381 interface HighlightSpan extends TextSpanWithContext { 7382 kind: HighlightSpanKind; 7383 } 7384 /** 7385 * Represents a set of highligh spans for a give name 7386 */ 7387 interface DocumentHighlightsItem { 7388 /** 7389 * File containing highlight spans. 7390 */ 7391 file: string; 7392 /** 7393 * Spans to highlight in file. 7394 */ 7395 highlightSpans: HighlightSpan[]; 7396 } 7397 /** 7398 * Response for a DocumentHighlightsRequest request. 7399 */ 7400 interface DocumentHighlightsResponse extends Response { 7401 body?: DocumentHighlightsItem[]; 7402 } 7403 /** 7404 * Find references request; value of command field is 7405 * "references". Return response giving the file locations that 7406 * reference the symbol found in file at location line, col. 7407 */ 7408 interface ReferencesRequest extends FileLocationRequest { 7409 command: CommandTypes.References; 7410 } 7411 interface ReferencesResponseItem extends FileSpanWithContext { 7412 /** Text of line containing the reference. Including this 7413 * with the response avoids latency of editor loading files 7414 * to show text of reference line (the server already has 7415 * loaded the referencing files). 7416 */ 7417 lineText: string; 7418 /** 7419 * True if reference is a write location, false otherwise. 7420 */ 7421 isWriteAccess: boolean; 7422 /** 7423 * True if reference is a definition, false otherwise. 7424 */ 7425 isDefinition: boolean; 7426 } 7427 /** 7428 * The body of a "references" response message. 7429 */ 7430 interface ReferencesResponseBody { 7431 /** 7432 * The file locations referencing the symbol. 7433 */ 7434 refs: readonly ReferencesResponseItem[]; 7435 /** 7436 * The name of the symbol. 7437 */ 7438 symbolName: string; 7439 /** 7440 * The start character offset of the symbol (on the line provided by the references request). 7441 */ 7442 symbolStartOffset: number; 7443 /** 7444 * The full display name of the symbol. 7445 */ 7446 symbolDisplayString: string; 7447 } 7448 /** 7449 * Response to "references" request. 7450 */ 7451 interface ReferencesResponse extends Response { 7452 body?: ReferencesResponseBody; 7453 } 7454 interface FileReferencesRequest extends FileRequest { 7455 command: CommandTypes.FileReferences; 7456 } 7457 interface FileReferencesResponseBody { 7458 /** 7459 * The file locations referencing the symbol. 7460 */ 7461 refs: readonly ReferencesResponseItem[]; 7462 /** 7463 * The name of the symbol. 7464 */ 7465 symbolName: string; 7466 } 7467 interface FileReferencesResponse extends Response { 7468 body?: FileReferencesResponseBody; 7469 } 7470 /** 7471 * Argument for RenameRequest request. 7472 */ 7473 interface RenameRequestArgs extends FileLocationRequestArgs { 7474 /** 7475 * Should text at specified location be found/changed in comments? 7476 */ 7477 findInComments?: boolean; 7478 /** 7479 * Should text at specified location be found/changed in strings? 7480 */ 7481 findInStrings?: boolean; 7482 } 7483 /** 7484 * Rename request; value of command field is "rename". Return 7485 * response giving the file locations that reference the symbol 7486 * found in file at location line, col. Also return full display 7487 * name of the symbol so that client can print it unambiguously. 7488 */ 7489 interface RenameRequest extends FileLocationRequest { 7490 command: CommandTypes.Rename; 7491 arguments: RenameRequestArgs; 7492 } 7493 /** 7494 * Information about the item to be renamed. 7495 */ 7496 type RenameInfo = RenameInfoSuccess | RenameInfoFailure; 7497 interface RenameInfoSuccess { 7498 /** 7499 * True if item can be renamed. 7500 */ 7501 canRename: true; 7502 /** 7503 * File or directory to rename. 7504 * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`. 7505 */ 7506 fileToRename?: string; 7507 /** 7508 * Display name of the item to be renamed. 7509 */ 7510 displayName: string; 7511 /** 7512 * Full display name of item to be renamed. 7513 */ 7514 fullDisplayName: string; 7515 /** 7516 * The items's kind (such as 'className' or 'parameterName' or plain 'text'). 7517 */ 7518 kind: ScriptElementKind; 7519 /** 7520 * Optional modifiers for the kind (such as 'public'). 7521 */ 7522 kindModifiers: string; 7523 /** Span of text to rename. */ 7524 triggerSpan: TextSpan; 7525 } 7526 interface RenameInfoFailure { 7527 canRename: false; 7528 /** 7529 * Error message if item can not be renamed. 7530 */ 7531 localizedErrorMessage: string; 7532 } 7533 /** 7534 * A group of text spans, all in 'file'. 7535 */ 7536 interface SpanGroup { 7537 /** The file to which the spans apply */ 7538 file: string; 7539 /** The text spans in this group */ 7540 locs: RenameTextSpan[]; 7541 } 7542 interface RenameTextSpan extends TextSpanWithContext { 7543 readonly prefixText?: string; 7544 readonly suffixText?: string; 7545 } 7546 interface RenameResponseBody { 7547 /** 7548 * Information about the item to be renamed. 7549 */ 7550 info: RenameInfo; 7551 /** 7552 * An array of span groups (one per file) that refer to the item to be renamed. 7553 */ 7554 locs: readonly SpanGroup[]; 7555 } 7556 /** 7557 * Rename response message. 7558 */ 7559 interface RenameResponse extends Response { 7560 body?: RenameResponseBody; 7561 } 7562 /** 7563 * Represents a file in external project. 7564 * External project is project whose set of files, compilation options and open\close state 7565 * is maintained by the client (i.e. if all this data come from .csproj file in Visual Studio). 7566 * External project will exist even if all files in it are closed and should be closed explicitly. 7567 * If external project includes one or more tsconfig.json/jsconfig.json files then tsserver will 7568 * create configured project for every config file but will maintain a link that these projects were created 7569 * as a result of opening external project so they should be removed once external project is closed. 7570 */ 7571 interface ExternalFile { 7572 /** 7573 * Name of file file 7574 */ 7575 fileName: string; 7576 /** 7577 * Script kind of the file 7578 */ 7579 scriptKind?: ScriptKindName | ts.ScriptKind; 7580 /** 7581 * Whether file has mixed content (i.e. .cshtml file that combines html markup with C#/JavaScript) 7582 */ 7583 hasMixedContent?: boolean; 7584 /** 7585 * Content of the file 7586 */ 7587 content?: string; 7588 } 7589 /** 7590 * Represent an external project 7591 */ 7592 interface ExternalProject { 7593 /** 7594 * Project name 7595 */ 7596 projectFileName: string; 7597 /** 7598 * List of root files in project 7599 */ 7600 rootFiles: ExternalFile[]; 7601 /** 7602 * Compiler options for the project 7603 */ 7604 options: ExternalProjectCompilerOptions; 7605 /** 7606 * @deprecated typingOptions. Use typeAcquisition instead 7607 */ 7608 typingOptions?: TypeAcquisition; 7609 /** 7610 * Explicitly specified type acquisition for the project 7611 */ 7612 typeAcquisition?: TypeAcquisition; 7613 } 7614 interface CompileOnSaveMixin { 7615 /** 7616 * If compile on save is enabled for the project 7617 */ 7618 compileOnSave?: boolean; 7619 } 7620 /** 7621 * For external projects, some of the project settings are sent together with 7622 * compiler settings. 7623 */ 7624 type ExternalProjectCompilerOptions = CompilerOptions & CompileOnSaveMixin & WatchOptions; 7625 interface FileWithProjectReferenceRedirectInfo { 7626 /** 7627 * Name of file 7628 */ 7629 fileName: string; 7630 /** 7631 * True if the file is primarily included in a referenced project 7632 */ 7633 isSourceOfProjectReferenceRedirect: boolean; 7634 } 7635 /** 7636 * Represents a set of changes that happen in project 7637 */ 7638 interface ProjectChanges { 7639 /** 7640 * List of added files 7641 */ 7642 added: string[] | FileWithProjectReferenceRedirectInfo[]; 7643 /** 7644 * List of removed files 7645 */ 7646 removed: string[] | FileWithProjectReferenceRedirectInfo[]; 7647 /** 7648 * List of updated files 7649 */ 7650 updated: string[] | FileWithProjectReferenceRedirectInfo[]; 7651 /** 7652 * List of files that have had their project reference redirect status updated 7653 * Only provided when the synchronizeProjectList request has includeProjectReferenceRedirectInfo set to true 7654 */ 7655 updatedRedirects?: FileWithProjectReferenceRedirectInfo[]; 7656 } 7657 /** 7658 * Information found in a configure request. 7659 */ 7660 interface ConfigureRequestArguments { 7661 /** 7662 * Information about the host, for example 'Emacs 24.4' or 7663 * 'Sublime Text version 3075' 7664 */ 7665 hostInfo?: string; 7666 /** 7667 * If present, tab settings apply only to this file. 7668 */ 7669 file?: string; 7670 /** 7671 * The format options to use during formatting and other code editing features. 7672 */ 7673 formatOptions?: FormatCodeSettings; 7674 preferences?: UserPreferences; 7675 /** 7676 * The host's additional supported .js file extensions 7677 */ 7678 extraFileExtensions?: FileExtensionInfo[]; 7679 watchOptions?: WatchOptions; 7680 } 7681 enum WatchFileKind { 7682 FixedPollingInterval = "FixedPollingInterval", 7683 PriorityPollingInterval = "PriorityPollingInterval", 7684 DynamicPriorityPolling = "DynamicPriorityPolling", 7685 UseFsEvents = "UseFsEvents", 7686 UseFsEventsOnParentDirectory = "UseFsEventsOnParentDirectory" 7687 } 7688 enum WatchDirectoryKind { 7689 UseFsEvents = "UseFsEvents", 7690 FixedPollingInterval = "FixedPollingInterval", 7691 DynamicPriorityPolling = "DynamicPriorityPolling" 7692 } 7693 enum PollingWatchKind { 7694 FixedInterval = "FixedInterval", 7695 PriorityInterval = "PriorityInterval", 7696 DynamicPriority = "DynamicPriority" 7697 } 7698 interface WatchOptions { 7699 watchFile?: WatchFileKind | ts.WatchFileKind; 7700 watchDirectory?: WatchDirectoryKind | ts.WatchDirectoryKind; 7701 fallbackPolling?: PollingWatchKind | ts.PollingWatchKind; 7702 synchronousWatchDirectory?: boolean; 7703 excludeDirectories?: string[]; 7704 excludeFiles?: string[]; 7705 [option: string]: CompilerOptionsValue | undefined; 7706 } 7707 /** 7708 * Configure request; value of command field is "configure". Specifies 7709 * host information, such as host type, tab size, and indent size. 7710 */ 7711 interface ConfigureRequest extends Request { 7712 command: CommandTypes.Configure; 7713 arguments: ConfigureRequestArguments; 7714 } 7715 /** 7716 * Response to "configure" request. This is just an acknowledgement, so 7717 * no body field is required. 7718 */ 7719 interface ConfigureResponse extends Response { 7720 } 7721 interface ConfigurePluginRequestArguments { 7722 pluginName: string; 7723 configuration: any; 7724 } 7725 interface ConfigurePluginRequest extends Request { 7726 command: CommandTypes.ConfigurePlugin; 7727 arguments: ConfigurePluginRequestArguments; 7728 } 7729 interface ConfigurePluginResponse extends Response { 7730 } 7731 interface SelectionRangeRequest extends FileRequest { 7732 command: CommandTypes.SelectionRange; 7733 arguments: SelectionRangeRequestArgs; 7734 } 7735 interface SelectionRangeRequestArgs extends FileRequestArgs { 7736 locations: Location[]; 7737 } 7738 interface SelectionRangeResponse extends Response { 7739 body?: SelectionRange[]; 7740 } 7741 interface SelectionRange { 7742 textSpan: TextSpan; 7743 parent?: SelectionRange; 7744 } 7745 interface ToggleLineCommentRequest extends FileRequest { 7746 command: CommandTypes.ToggleLineComment; 7747 arguments: FileRangeRequestArgs; 7748 } 7749 interface ToggleMultilineCommentRequest extends FileRequest { 7750 command: CommandTypes.ToggleMultilineComment; 7751 arguments: FileRangeRequestArgs; 7752 } 7753 interface CommentSelectionRequest extends FileRequest { 7754 command: CommandTypes.CommentSelection; 7755 arguments: FileRangeRequestArgs; 7756 } 7757 interface UncommentSelectionRequest extends FileRequest { 7758 command: CommandTypes.UncommentSelection; 7759 arguments: FileRangeRequestArgs; 7760 } 7761 /** 7762 * Information found in an "open" request. 7763 */ 7764 interface OpenRequestArgs extends FileRequestArgs { 7765 /** 7766 * Used when a version of the file content is known to be more up to date than the one on disk. 7767 * Then the known content will be used upon opening instead of the disk copy 7768 */ 7769 fileContent?: string; 7770 /** 7771 * Used to specify the script kind of the file explicitly. It could be one of the following: 7772 * "TS", "JS", "TSX", "JSX" 7773 */ 7774 scriptKindName?: ScriptKindName; 7775 /** 7776 * Used to limit the searching for project config file. If given the searching will stop at this 7777 * root path; otherwise it will go all the way up to the dist root path. 7778 */ 7779 projectRootPath?: string; 7780 } 7781 type ScriptKindName = "TS" | "JS" | "TSX" | "JSX"; 7782 /** 7783 * Open request; value of command field is "open". Notify the 7784 * server that the client has file open. The server will not 7785 * monitor the filesystem for changes in this file and will assume 7786 * that the client is updating the server (using the change and/or 7787 * reload messages) when the file changes. Server does not currently 7788 * send a response to an open request. 7789 */ 7790 interface OpenRequest extends Request { 7791 command: CommandTypes.Open; 7792 arguments: OpenRequestArgs; 7793 } 7794 /** 7795 * Request to open or update external project 7796 */ 7797 interface OpenExternalProjectRequest extends Request { 7798 command: CommandTypes.OpenExternalProject; 7799 arguments: OpenExternalProjectArgs; 7800 } 7801 /** 7802 * Arguments to OpenExternalProjectRequest request 7803 */ 7804 type OpenExternalProjectArgs = ExternalProject; 7805 /** 7806 * Request to open multiple external projects 7807 */ 7808 interface OpenExternalProjectsRequest extends Request { 7809 command: CommandTypes.OpenExternalProjects; 7810 arguments: OpenExternalProjectsArgs; 7811 } 7812 /** 7813 * Arguments to OpenExternalProjectsRequest 7814 */ 7815 interface OpenExternalProjectsArgs { 7816 /** 7817 * List of external projects to open or update 7818 */ 7819 projects: ExternalProject[]; 7820 } 7821 /** 7822 * Response to OpenExternalProjectRequest request. This is just an acknowledgement, so 7823 * no body field is required. 7824 */ 7825 interface OpenExternalProjectResponse extends Response { 7826 } 7827 /** 7828 * Response to OpenExternalProjectsRequest request. This is just an acknowledgement, so 7829 * no body field is required. 7830 */ 7831 interface OpenExternalProjectsResponse extends Response { 7832 } 7833 /** 7834 * Request to close external project. 7835 */ 7836 interface CloseExternalProjectRequest extends Request { 7837 command: CommandTypes.CloseExternalProject; 7838 arguments: CloseExternalProjectRequestArgs; 7839 } 7840 /** 7841 * Arguments to CloseExternalProjectRequest request 7842 */ 7843 interface CloseExternalProjectRequestArgs { 7844 /** 7845 * Name of the project to close 7846 */ 7847 projectFileName: string; 7848 } 7849 /** 7850 * Response to CloseExternalProjectRequest request. This is just an acknowledgement, so 7851 * no body field is required. 7852 */ 7853 interface CloseExternalProjectResponse extends Response { 7854 } 7855 /** 7856 * Request to synchronize list of open files with the client 7857 */ 7858 interface UpdateOpenRequest extends Request { 7859 command: CommandTypes.UpdateOpen; 7860 arguments: UpdateOpenRequestArgs; 7861 } 7862 /** 7863 * Arguments to UpdateOpenRequest 7864 */ 7865 interface UpdateOpenRequestArgs { 7866 /** 7867 * List of newly open files 7868 */ 7869 openFiles?: OpenRequestArgs[]; 7870 /** 7871 * List of open files files that were changes 7872 */ 7873 changedFiles?: FileCodeEdits[]; 7874 /** 7875 * List of files that were closed 7876 */ 7877 closedFiles?: string[]; 7878 } 7879 /** 7880 * External projects have a typeAcquisition option so they need to be added separately to compiler options for inferred projects. 7881 */ 7882 type InferredProjectCompilerOptions = ExternalProjectCompilerOptions & TypeAcquisition; 7883 /** 7884 * Request to set compiler options for inferred projects. 7885 * External projects are opened / closed explicitly. 7886 * Configured projects are opened when user opens loose file that has 'tsconfig.json' or 'jsconfig.json' anywhere in one of containing folders. 7887 * This configuration file will be used to obtain a list of files and configuration settings for the project. 7888 * Inferred projects are created when user opens a loose file that is not the part of external project 7889 * or configured project and will contain only open file and transitive closure of referenced files if 'useOneInferredProject' is false, 7890 * or all open loose files and its transitive closure of referenced files if 'useOneInferredProject' is true. 7891 */ 7892 interface SetCompilerOptionsForInferredProjectsRequest extends Request { 7893 command: CommandTypes.CompilerOptionsForInferredProjects; 7894 arguments: SetCompilerOptionsForInferredProjectsArgs; 7895 } 7896 /** 7897 * Argument for SetCompilerOptionsForInferredProjectsRequest request. 7898 */ 7899 interface SetCompilerOptionsForInferredProjectsArgs { 7900 /** 7901 * Compiler options to be used with inferred projects. 7902 */ 7903 options: InferredProjectCompilerOptions; 7904 /** 7905 * Specifies the project root path used to scope compiler options. 7906 * It is an error to provide this property if the server has not been started with 7907 * `useInferredProjectPerProjectRoot` enabled. 7908 */ 7909 projectRootPath?: string; 7910 } 7911 /** 7912 * Response to SetCompilerOptionsForInferredProjectsResponse request. This is just an acknowledgement, so 7913 * no body field is required. 7914 */ 7915 interface SetCompilerOptionsForInferredProjectsResponse extends Response { 7916 } 7917 /** 7918 * Exit request; value of command field is "exit". Ask the server process 7919 * to exit. 7920 */ 7921 interface ExitRequest extends Request { 7922 command: CommandTypes.Exit; 7923 } 7924 /** 7925 * Close request; value of command field is "close". Notify the 7926 * server that the client has closed a previously open file. If 7927 * file is still referenced by open files, the server will resume 7928 * monitoring the filesystem for changes to file. Server does not 7929 * currently send a response to a close request. 7930 */ 7931 interface CloseRequest extends FileRequest { 7932 command: CommandTypes.Close; 7933 } 7934 /** 7935 * Request to obtain the list of files that should be regenerated if target file is recompiled. 7936 * NOTE: this us query-only operation and does not generate any output on disk. 7937 */ 7938 interface CompileOnSaveAffectedFileListRequest extends FileRequest { 7939 command: CommandTypes.CompileOnSaveAffectedFileList; 7940 } 7941 /** 7942 * Contains a list of files that should be regenerated in a project 7943 */ 7944 interface CompileOnSaveAffectedFileListSingleProject { 7945 /** 7946 * Project name 7947 */ 7948 projectFileName: string; 7949 /** 7950 * List of files names that should be recompiled 7951 */ 7952 fileNames: string[]; 7953 /** 7954 * true if project uses outFile or out compiler option 7955 */ 7956 projectUsesOutFile: boolean; 7957 } 7958 /** 7959 * Response for CompileOnSaveAffectedFileListRequest request; 7960 */ 7961 interface CompileOnSaveAffectedFileListResponse extends Response { 7962 body: CompileOnSaveAffectedFileListSingleProject[]; 7963 } 7964 /** 7965 * Request to recompile the file. All generated outputs (.js, .d.ts or .js.map files) is written on disk. 7966 */ 7967 interface CompileOnSaveEmitFileRequest extends FileRequest { 7968 command: CommandTypes.CompileOnSaveEmitFile; 7969 arguments: CompileOnSaveEmitFileRequestArgs; 7970 } 7971 /** 7972 * Arguments for CompileOnSaveEmitFileRequest 7973 */ 7974 interface CompileOnSaveEmitFileRequestArgs extends FileRequestArgs { 7975 /** 7976 * if true - then file should be recompiled even if it does not have any changes. 7977 */ 7978 forced?: boolean; 7979 includeLinePosition?: boolean; 7980 /** if true - return response as object with emitSkipped and diagnostics */ 7981 richResponse?: boolean; 7982 } 7983 interface CompileOnSaveEmitFileResponse extends Response { 7984 body: boolean | EmitResult; 7985 } 7986 interface EmitResult { 7987 emitSkipped: boolean; 7988 diagnostics: Diagnostic[] | DiagnosticWithLinePosition[]; 7989 } 7990 /** 7991 * Quickinfo request; value of command field is 7992 * "quickinfo". Return response giving a quick type and 7993 * documentation string for the symbol found in file at location 7994 * line, col. 7995 */ 7996 interface QuickInfoRequest extends FileLocationRequest { 7997 command: CommandTypes.Quickinfo; 7998 } 7999 /** 8000 * Body of QuickInfoResponse. 8001 */ 8002 interface QuickInfoResponseBody { 8003 /** 8004 * The symbol's kind (such as 'className' or 'parameterName' or plain 'text'). 8005 */ 8006 kind: ScriptElementKind; 8007 /** 8008 * Optional modifiers for the kind (such as 'public'). 8009 */ 8010 kindModifiers: string; 8011 /** 8012 * Starting file location of symbol. 8013 */ 8014 start: Location; 8015 /** 8016 * One past last character of symbol. 8017 */ 8018 end: Location; 8019 /** 8020 * Type and kind of symbol. 8021 */ 8022 displayString: string; 8023 /** 8024 * Documentation associated with symbol. 8025 */ 8026 documentation: string; 8027 /** 8028 * JSDoc tags associated with symbol. 8029 */ 8030 tags: JSDocTagInfo[]; 8031 } 8032 /** 8033 * Quickinfo response message. 8034 */ 8035 interface QuickInfoResponse extends Response { 8036 body?: QuickInfoResponseBody; 8037 } 8038 /** 8039 * Arguments for format messages. 8040 */ 8041 interface FormatRequestArgs extends FileLocationRequestArgs { 8042 /** 8043 * Last line of range for which to format text in file. 8044 */ 8045 endLine: number; 8046 /** 8047 * Character offset on last line of range for which to format text in file. 8048 */ 8049 endOffset: number; 8050 /** 8051 * Format options to be used. 8052 */ 8053 options?: FormatCodeSettings; 8054 } 8055 /** 8056 * Format request; value of command field is "format". Return 8057 * response giving zero or more edit instructions. The edit 8058 * instructions will be sorted in file order. Applying the edit 8059 * instructions in reverse to file will result in correctly 8060 * reformatted text. 8061 */ 8062 interface FormatRequest extends FileLocationRequest { 8063 command: CommandTypes.Format; 8064 arguments: FormatRequestArgs; 8065 } 8066 /** 8067 * Object found in response messages defining an editing 8068 * instruction for a span of text in source code. The effect of 8069 * this instruction is to replace the text starting at start and 8070 * ending one character before end with newText. For an insertion, 8071 * the text span is empty. For a deletion, newText is empty. 8072 */ 8073 interface CodeEdit { 8074 /** 8075 * First character of the text span to edit. 8076 */ 8077 start: Location; 8078 /** 8079 * One character past last character of the text span to edit. 8080 */ 8081 end: Location; 8082 /** 8083 * Replace the span defined above with this string (may be 8084 * the empty string). 8085 */ 8086 newText: string; 8087 } 8088 interface FileCodeEdits { 8089 fileName: string; 8090 textChanges: CodeEdit[]; 8091 } 8092 interface CodeFixResponse extends Response { 8093 /** The code actions that are available */ 8094 body?: CodeFixAction[]; 8095 } 8096 interface CodeAction { 8097 /** Description of the code action to display in the UI of the editor */ 8098 description: string; 8099 /** Text changes to apply to each file as part of the code action */ 8100 changes: FileCodeEdits[]; 8101 /** A command is an opaque object that should be passed to `ApplyCodeActionCommandRequestArgs` without modification. */ 8102 commands?: {}[]; 8103 } 8104 interface CombinedCodeActions { 8105 changes: readonly FileCodeEdits[]; 8106 commands?: readonly {}[]; 8107 } 8108 interface CodeFixAction extends CodeAction { 8109 /** Short name to identify the fix, for use by telemetry. */ 8110 fixName: string; 8111 /** 8112 * If present, one may call 'getCombinedCodeFix' with this fixId. 8113 * This may be omitted to indicate that the code fix can't be applied in a group. 8114 */ 8115 fixId?: {}; 8116 /** Should be present if and only if 'fixId' is. */ 8117 fixAllDescription?: string; 8118 } 8119 /** 8120 * Format and format on key response message. 8121 */ 8122 interface FormatResponse extends Response { 8123 body?: CodeEdit[]; 8124 } 8125 /** 8126 * Arguments for format on key messages. 8127 */ 8128 interface FormatOnKeyRequestArgs extends FileLocationRequestArgs { 8129 /** 8130 * Key pressed (';', '\n', or '}'). 8131 */ 8132 key: string; 8133 options?: FormatCodeSettings; 8134 } 8135 /** 8136 * Format on key request; value of command field is 8137 * "formatonkey". Given file location and key typed (as string), 8138 * return response giving zero or more edit instructions. The 8139 * edit instructions will be sorted in file order. Applying the 8140 * edit instructions in reverse to file will result in correctly 8141 * reformatted text. 8142 */ 8143 interface FormatOnKeyRequest extends FileLocationRequest { 8144 command: CommandTypes.Formatonkey; 8145 arguments: FormatOnKeyRequestArgs; 8146 } 8147 type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<" | "#"; 8148 /** 8149 * Arguments for completions messages. 8150 */ 8151 interface CompletionsRequestArgs extends FileLocationRequestArgs { 8152 /** 8153 * Optional prefix to apply to possible completions. 8154 */ 8155 prefix?: string; 8156 /** 8157 * Character that was responsible for triggering completion. 8158 * Should be `undefined` if a user manually requested completion. 8159 */ 8160 triggerCharacter?: CompletionsTriggerCharacter; 8161 /** 8162 * @deprecated Use UserPreferences.includeCompletionsForModuleExports 8163 */ 8164 includeExternalModuleExports?: boolean; 8165 /** 8166 * @deprecated Use UserPreferences.includeCompletionsWithInsertText 8167 */ 8168 includeInsertTextCompletions?: boolean; 8169 } 8170 interface EtsOptions { 8171 render: { 8172 method: string; 8173 decorator: string; 8174 }; 8175 components: string[]; 8176 libs: string[]; 8177 extend: { 8178 decorator: string; 8179 components: { 8180 name: string; 8181 type: string; 8182 instance: string; 8183 }[]; 8184 }; 8185 customComponent?: string; 8186 } 8187 /** 8188 * Completions request; value of command field is "completions". 8189 * Given a file location (file, line, col) and a prefix (which may 8190 * be the empty string), return the possible completions that 8191 * begin with prefix. 8192 */ 8193 interface CompletionsRequest extends FileLocationRequest { 8194 command: CommandTypes.Completions | CommandTypes.CompletionInfo; 8195 arguments: CompletionsRequestArgs; 8196 } 8197 /** 8198 * Arguments for completion details request. 8199 */ 8200 interface CompletionDetailsRequestArgs extends FileLocationRequestArgs { 8201 /** 8202 * Names of one or more entries for which to obtain details. 8203 */ 8204 entryNames: (string | CompletionEntryIdentifier)[]; 8205 } 8206 interface CompletionEntryIdentifier { 8207 name: string; 8208 source?: string; 8209 } 8210 /** 8211 * Completion entry details request; value of command field is 8212 * "completionEntryDetails". Given a file location (file, line, 8213 * col) and an array of completion entry names return more 8214 * detailed information for each completion entry. 8215 */ 8216 interface CompletionDetailsRequest extends FileLocationRequest { 8217 command: CommandTypes.CompletionDetails; 8218 arguments: CompletionDetailsRequestArgs; 8219 } 8220 /** 8221 * Part of a symbol description. 8222 */ 8223 interface SymbolDisplayPart { 8224 /** 8225 * Text of an item describing the symbol. 8226 */ 8227 text: string; 8228 /** 8229 * The symbol's kind (such as 'className' or 'parameterName' or plain 'text'). 8230 */ 8231 kind: string; 8232 } 8233 /** 8234 * An item found in a completion response. 8235 */ 8236 interface CompletionEntry { 8237 /** 8238 * The symbol's name. 8239 */ 8240 name: string; 8241 /** 8242 * The symbol's kind (such as 'className' or 'parameterName'). 8243 */ 8244 kind: ScriptElementKind; 8245 /** 8246 * Optional modifiers for the kind (such as 'public'). 8247 */ 8248 kindModifiers?: string; 8249 /** 8250 * A string that is used for comparing completion items so that they can be ordered. This 8251 * is often the same as the name but may be different in certain circumstances. 8252 */ 8253 sortText: string; 8254 /** 8255 * Text to insert instead of `name`. 8256 * This is used to support bracketed completions; If `name` might be "a-b" but `insertText` would be `["a-b"]`, 8257 * coupled with `replacementSpan` to replace a dotted access with a bracket access. 8258 */ 8259 insertText?: string; 8260 /** 8261 * An optional span that indicates the text to be replaced by this completion item. 8262 * If present, this span should be used instead of the default one. 8263 * It will be set if the required span differs from the one generated by the default replacement behavior. 8264 */ 8265 replacementSpan?: TextSpan; 8266 /** 8267 * Indicates whether commiting this completion entry will require additional code actions to be 8268 * made to avoid errors. The CompletionEntryDetails will have these actions. 8269 */ 8270 hasAction?: true; 8271 /** 8272 * Identifier (not necessarily human-readable) identifying where this completion came from. 8273 */ 8274 source?: string; 8275 /** 8276 * If true, this completion should be highlighted as recommended. There will only be one of these. 8277 * 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. 8278 * Then either that enum/class or a namespace containing it will be the recommended symbol. 8279 */ 8280 isRecommended?: true; 8281 /** 8282 * If true, this completion was generated from traversing the name table of an unchecked JS file, 8283 * and therefore may not be accurate. 8284 */ 8285 isFromUncheckedFile?: true; 8286 /** 8287 * If true, this completion was for an auto-import of a module not yet in the program, but listed 8288 * in the project package.json. 8289 */ 8290 isPackageJsonImport?: true; 8291 } 8292 /** 8293 * Additional completion entry details, available on demand 8294 */ 8295 interface CompletionEntryDetails { 8296 /** 8297 * The symbol's name. 8298 */ 8299 name: string; 8300 /** 8301 * The symbol's kind (such as 'className' or 'parameterName'). 8302 */ 8303 kind: ScriptElementKind; 8304 /** 8305 * Optional modifiers for the kind (such as 'public'). 8306 */ 8307 kindModifiers: string; 8308 /** 8309 * Display parts of the symbol (similar to quick info). 8310 */ 8311 displayParts: SymbolDisplayPart[]; 8312 /** 8313 * Documentation strings for the symbol. 8314 */ 8315 documentation?: SymbolDisplayPart[]; 8316 /** 8317 * JSDoc tags for the symbol. 8318 */ 8319 tags?: JSDocTagInfo[]; 8320 /** 8321 * The associated code actions for this entry 8322 */ 8323 codeActions?: CodeAction[]; 8324 /** 8325 * Human-readable description of the `source` from the CompletionEntry. 8326 */ 8327 source?: SymbolDisplayPart[]; 8328 } 8329 /** @deprecated Prefer CompletionInfoResponse, which supports several top-level fields in addition to the array of entries. */ 8330 interface CompletionsResponse extends Response { 8331 body?: CompletionEntry[]; 8332 } 8333 interface CompletionInfoResponse extends Response { 8334 body?: CompletionInfo; 8335 } 8336 interface CompletionInfo { 8337 readonly isGlobalCompletion: boolean; 8338 readonly isMemberCompletion: boolean; 8339 readonly isNewIdentifierLocation: boolean; 8340 /** 8341 * In the absence of `CompletionEntry["replacementSpan"]`, the editor may choose whether to use 8342 * this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span 8343 * must be used to commit that completion entry. 8344 */ 8345 readonly optionalReplacementSpan?: TextSpan; 8346 readonly entries: readonly CompletionEntry[]; 8347 } 8348 interface CompletionDetailsResponse extends Response { 8349 body?: CompletionEntryDetails[]; 8350 } 8351 /** 8352 * Signature help information for a single parameter 8353 */ 8354 interface SignatureHelpParameter { 8355 /** 8356 * The parameter's name 8357 */ 8358 name: string; 8359 /** 8360 * Documentation of the parameter. 8361 */ 8362 documentation: SymbolDisplayPart[]; 8363 /** 8364 * Display parts of the parameter. 8365 */ 8366 displayParts: SymbolDisplayPart[]; 8367 /** 8368 * Whether the parameter is optional or not. 8369 */ 8370 isOptional: boolean; 8371 } 8372 /** 8373 * Represents a single signature to show in signature help. 8374 */ 8375 interface SignatureHelpItem { 8376 /** 8377 * Whether the signature accepts a variable number of arguments. 8378 */ 8379 isVariadic: boolean; 8380 /** 8381 * The prefix display parts. 8382 */ 8383 prefixDisplayParts: SymbolDisplayPart[]; 8384 /** 8385 * The suffix display parts. 8386 */ 8387 suffixDisplayParts: SymbolDisplayPart[]; 8388 /** 8389 * The separator display parts. 8390 */ 8391 separatorDisplayParts: SymbolDisplayPart[]; 8392 /** 8393 * The signature helps items for the parameters. 8394 */ 8395 parameters: SignatureHelpParameter[]; 8396 /** 8397 * The signature's documentation 8398 */ 8399 documentation: SymbolDisplayPart[]; 8400 /** 8401 * The signature's JSDoc tags 8402 */ 8403 tags: JSDocTagInfo[]; 8404 } 8405 /** 8406 * Signature help items found in the response of a signature help request. 8407 */ 8408 interface SignatureHelpItems { 8409 /** 8410 * The signature help items. 8411 */ 8412 items: SignatureHelpItem[]; 8413 /** 8414 * The span for which signature help should appear on a signature 8415 */ 8416 applicableSpan: TextSpan; 8417 /** 8418 * The item selected in the set of available help items. 8419 */ 8420 selectedItemIndex: number; 8421 /** 8422 * The argument selected in the set of parameters. 8423 */ 8424 argumentIndex: number; 8425 /** 8426 * The argument count 8427 */ 8428 argumentCount: number; 8429 } 8430 type SignatureHelpTriggerCharacter = "," | "(" | "<"; 8431 type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")"; 8432 /** 8433 * Arguments of a signature help request. 8434 */ 8435 interface SignatureHelpRequestArgs extends FileLocationRequestArgs { 8436 /** 8437 * Reason why signature help was invoked. 8438 * See each individual possible 8439 */ 8440 triggerReason?: SignatureHelpTriggerReason; 8441 } 8442 type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason; 8443 /** 8444 * Signals that the user manually requested signature help. 8445 * The language service will unconditionally attempt to provide a result. 8446 */ 8447 interface SignatureHelpInvokedReason { 8448 kind: "invoked"; 8449 triggerCharacter?: undefined; 8450 } 8451 /** 8452 * Signals that the signature help request came from a user typing a character. 8453 * Depending on the character and the syntactic context, the request may or may not be served a result. 8454 */ 8455 interface SignatureHelpCharacterTypedReason { 8456 kind: "characterTyped"; 8457 /** 8458 * Character that was responsible for triggering signature help. 8459 */ 8460 triggerCharacter: SignatureHelpTriggerCharacter; 8461 } 8462 /** 8463 * Signals that this signature help request came from typing a character or moving the cursor. 8464 * This should only occur if a signature help session was already active and the editor needs to see if it should adjust. 8465 * The language service will unconditionally attempt to provide a result. 8466 * `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move. 8467 */ 8468 interface SignatureHelpRetriggeredReason { 8469 kind: "retrigger"; 8470 /** 8471 * Character that was responsible for triggering signature help. 8472 */ 8473 triggerCharacter?: SignatureHelpRetriggerCharacter; 8474 } 8475 /** 8476 * Signature help request; value of command field is "signatureHelp". 8477 * Given a file location (file, line, col), return the signature 8478 * help. 8479 */ 8480 interface SignatureHelpRequest extends FileLocationRequest { 8481 command: CommandTypes.SignatureHelp; 8482 arguments: SignatureHelpRequestArgs; 8483 } 8484 /** 8485 * Response object for a SignatureHelpRequest. 8486 */ 8487 interface SignatureHelpResponse extends Response { 8488 body?: SignatureHelpItems; 8489 } 8490 /** 8491 * Synchronous request for semantic diagnostics of one file. 8492 */ 8493 interface SemanticDiagnosticsSyncRequest extends FileRequest { 8494 command: CommandTypes.SemanticDiagnosticsSync; 8495 arguments: SemanticDiagnosticsSyncRequestArgs; 8496 } 8497 interface SemanticDiagnosticsSyncRequestArgs extends FileRequestArgs { 8498 includeLinePosition?: boolean; 8499 } 8500 /** 8501 * Response object for synchronous sematic diagnostics request. 8502 */ 8503 interface SemanticDiagnosticsSyncResponse extends Response { 8504 body?: Diagnostic[] | DiagnosticWithLinePosition[]; 8505 } 8506 interface SuggestionDiagnosticsSyncRequest extends FileRequest { 8507 command: CommandTypes.SuggestionDiagnosticsSync; 8508 arguments: SuggestionDiagnosticsSyncRequestArgs; 8509 } 8510 type SuggestionDiagnosticsSyncRequestArgs = SemanticDiagnosticsSyncRequestArgs; 8511 type SuggestionDiagnosticsSyncResponse = SemanticDiagnosticsSyncResponse; 8512 /** 8513 * Synchronous request for syntactic diagnostics of one file. 8514 */ 8515 interface SyntacticDiagnosticsSyncRequest extends FileRequest { 8516 command: CommandTypes.SyntacticDiagnosticsSync; 8517 arguments: SyntacticDiagnosticsSyncRequestArgs; 8518 } 8519 interface SyntacticDiagnosticsSyncRequestArgs extends FileRequestArgs { 8520 includeLinePosition?: boolean; 8521 } 8522 /** 8523 * Response object for synchronous syntactic diagnostics request. 8524 */ 8525 interface SyntacticDiagnosticsSyncResponse extends Response { 8526 body?: Diagnostic[] | DiagnosticWithLinePosition[]; 8527 } 8528 /** 8529 * Arguments for GeterrForProject request. 8530 */ 8531 interface GeterrForProjectRequestArgs { 8532 /** 8533 * the file requesting project error list 8534 */ 8535 file: string; 8536 /** 8537 * Delay in milliseconds to wait before starting to compute 8538 * errors for the files in the file list 8539 */ 8540 delay: number; 8541 } 8542 /** 8543 * GeterrForProjectRequest request; value of command field is 8544 * "geterrForProject". It works similarly with 'Geterr', only 8545 * it request for every file in this project. 8546 */ 8547 interface GeterrForProjectRequest extends Request { 8548 command: CommandTypes.GeterrForProject; 8549 arguments: GeterrForProjectRequestArgs; 8550 } 8551 /** 8552 * Arguments for geterr messages. 8553 */ 8554 interface GeterrRequestArgs { 8555 /** 8556 * List of file names for which to compute compiler errors. 8557 * The files will be checked in list order. 8558 */ 8559 files: string[]; 8560 /** 8561 * Delay in milliseconds to wait before starting to compute 8562 * errors for the files in the file list 8563 */ 8564 delay: number; 8565 } 8566 /** 8567 * Geterr request; value of command field is "geterr". Wait for 8568 * delay milliseconds and then, if during the wait no change or 8569 * reload messages have arrived for the first file in the files 8570 * list, get the syntactic errors for the file, field requests, 8571 * and then get the semantic errors for the file. Repeat with a 8572 * smaller delay for each subsequent file on the files list. Best 8573 * practice for an editor is to send a file list containing each 8574 * file that is currently visible, in most-recently-used order. 8575 */ 8576 interface GeterrRequest extends Request { 8577 command: CommandTypes.Geterr; 8578 arguments: GeterrRequestArgs; 8579 } 8580 type RequestCompletedEventName = "requestCompleted"; 8581 /** 8582 * Event that is sent when server have finished processing request with specified id. 8583 */ 8584 interface RequestCompletedEvent extends Event { 8585 event: RequestCompletedEventName; 8586 body: RequestCompletedEventBody; 8587 } 8588 interface RequestCompletedEventBody { 8589 request_seq: number; 8590 } 8591 /** 8592 * Item of diagnostic information found in a DiagnosticEvent message. 8593 */ 8594 interface Diagnostic { 8595 /** 8596 * Starting file location at which text applies. 8597 */ 8598 start: Location; 8599 /** 8600 * The last file location at which the text applies. 8601 */ 8602 end: Location; 8603 /** 8604 * Text of diagnostic message. 8605 */ 8606 text: string; 8607 /** 8608 * The category of the diagnostic message, e.g. "error", "warning", or "suggestion". 8609 */ 8610 category: string; 8611 reportsUnnecessary?: {}; 8612 reportsDeprecated?: {}; 8613 /** 8614 * Any related spans the diagnostic may have, such as other locations relevant to an error, such as declarartion sites 8615 */ 8616 relatedInformation?: DiagnosticRelatedInformation[]; 8617 /** 8618 * The error code of the diagnostic message. 8619 */ 8620 code?: number; 8621 /** 8622 * The name of the plugin reporting the message. 8623 */ 8624 source?: string; 8625 } 8626 interface DiagnosticWithFileName extends Diagnostic { 8627 /** 8628 * Name of the file the diagnostic is in 8629 */ 8630 fileName: string; 8631 } 8632 /** 8633 * Represents additional spans returned with a diagnostic which are relevant to it 8634 */ 8635 interface DiagnosticRelatedInformation { 8636 /** 8637 * The category of the related information message, e.g. "error", "warning", or "suggestion". 8638 */ 8639 category: string; 8640 /** 8641 * The code used ot identify the related information 8642 */ 8643 code: number; 8644 /** 8645 * Text of related or additional information. 8646 */ 8647 message: string; 8648 /** 8649 * Associated location 8650 */ 8651 span?: FileSpan; 8652 } 8653 interface DiagnosticEventBody { 8654 /** 8655 * The file for which diagnostic information is reported. 8656 */ 8657 file: string; 8658 /** 8659 * An array of diagnostic information items. 8660 */ 8661 diagnostics: Diagnostic[]; 8662 } 8663 type DiagnosticEventKind = "semanticDiag" | "syntaxDiag" | "suggestionDiag"; 8664 /** 8665 * Event message for DiagnosticEventKind event types. 8666 * These events provide syntactic and semantic errors for a file. 8667 */ 8668 interface DiagnosticEvent extends Event { 8669 body?: DiagnosticEventBody; 8670 event: DiagnosticEventKind; 8671 } 8672 interface ConfigFileDiagnosticEventBody { 8673 /** 8674 * The file which trigged the searching and error-checking of the config file 8675 */ 8676 triggerFile: string; 8677 /** 8678 * The name of the found config file. 8679 */ 8680 configFile: string; 8681 /** 8682 * An arry of diagnostic information items for the found config file. 8683 */ 8684 diagnostics: DiagnosticWithFileName[]; 8685 } 8686 /** 8687 * Event message for "configFileDiag" event type. 8688 * This event provides errors for a found config file. 8689 */ 8690 interface ConfigFileDiagnosticEvent extends Event { 8691 body?: ConfigFileDiagnosticEventBody; 8692 event: "configFileDiag"; 8693 } 8694 type ProjectLanguageServiceStateEventName = "projectLanguageServiceState"; 8695 interface ProjectLanguageServiceStateEvent extends Event { 8696 event: ProjectLanguageServiceStateEventName; 8697 body?: ProjectLanguageServiceStateEventBody; 8698 } 8699 interface ProjectLanguageServiceStateEventBody { 8700 /** 8701 * Project name that has changes in the state of language service. 8702 * For configured projects this will be the config file path. 8703 * For external projects this will be the name of the projects specified when project was open. 8704 * For inferred projects this event is not raised. 8705 */ 8706 projectName: string; 8707 /** 8708 * True if language service state switched from disabled to enabled 8709 * and false otherwise. 8710 */ 8711 languageServiceEnabled: boolean; 8712 } 8713 type ProjectsUpdatedInBackgroundEventName = "projectsUpdatedInBackground"; 8714 interface ProjectsUpdatedInBackgroundEvent extends Event { 8715 event: ProjectsUpdatedInBackgroundEventName; 8716 body: ProjectsUpdatedInBackgroundEventBody; 8717 } 8718 interface ProjectsUpdatedInBackgroundEventBody { 8719 /** 8720 * Current set of open files 8721 */ 8722 openFiles: string[]; 8723 } 8724 type ProjectLoadingStartEventName = "projectLoadingStart"; 8725 interface ProjectLoadingStartEvent extends Event { 8726 event: ProjectLoadingStartEventName; 8727 body: ProjectLoadingStartEventBody; 8728 } 8729 interface ProjectLoadingStartEventBody { 8730 /** name of the project */ 8731 projectName: string; 8732 /** reason for loading */ 8733 reason: string; 8734 } 8735 type ProjectLoadingFinishEventName = "projectLoadingFinish"; 8736 interface ProjectLoadingFinishEvent extends Event { 8737 event: ProjectLoadingFinishEventName; 8738 body: ProjectLoadingFinishEventBody; 8739 } 8740 interface ProjectLoadingFinishEventBody { 8741 /** name of the project */ 8742 projectName: string; 8743 } 8744 type SurveyReadyEventName = "surveyReady"; 8745 interface SurveyReadyEvent extends Event { 8746 event: SurveyReadyEventName; 8747 body: SurveyReadyEventBody; 8748 } 8749 interface SurveyReadyEventBody { 8750 /** Name of the survey. This is an internal machine- and programmer-friendly name */ 8751 surveyId: string; 8752 } 8753 type LargeFileReferencedEventName = "largeFileReferenced"; 8754 interface LargeFileReferencedEvent extends Event { 8755 event: LargeFileReferencedEventName; 8756 body: LargeFileReferencedEventBody; 8757 } 8758 interface LargeFileReferencedEventBody { 8759 /** 8760 * name of the large file being loaded 8761 */ 8762 file: string; 8763 /** 8764 * size of the file 8765 */ 8766 fileSize: number; 8767 /** 8768 * max file size allowed on the server 8769 */ 8770 maxFileSize: number; 8771 } 8772 /** 8773 * Arguments for reload request. 8774 */ 8775 interface ReloadRequestArgs extends FileRequestArgs { 8776 /** 8777 * Name of temporary file from which to reload file 8778 * contents. May be same as file. 8779 */ 8780 tmpfile: string; 8781 } 8782 /** 8783 * Reload request message; value of command field is "reload". 8784 * Reload contents of file with name given by the 'file' argument 8785 * from temporary file with name given by the 'tmpfile' argument. 8786 * The two names can be identical. 8787 */ 8788 interface ReloadRequest extends FileRequest { 8789 command: CommandTypes.Reload; 8790 arguments: ReloadRequestArgs; 8791 } 8792 /** 8793 * Response to "reload" request. This is just an acknowledgement, so 8794 * no body field is required. 8795 */ 8796 interface ReloadResponse extends Response { 8797 } 8798 /** 8799 * Arguments for saveto request. 8800 */ 8801 interface SavetoRequestArgs extends FileRequestArgs { 8802 /** 8803 * Name of temporary file into which to save server's view of 8804 * file contents. 8805 */ 8806 tmpfile: string; 8807 } 8808 /** 8809 * Saveto request message; value of command field is "saveto". 8810 * For debugging purposes, save to a temporaryfile (named by 8811 * argument 'tmpfile') the contents of file named by argument 8812 * 'file'. The server does not currently send a response to a 8813 * "saveto" request. 8814 */ 8815 interface SavetoRequest extends FileRequest { 8816 command: CommandTypes.Saveto; 8817 arguments: SavetoRequestArgs; 8818 } 8819 /** 8820 * Arguments for navto request message. 8821 */ 8822 interface NavtoRequestArgs { 8823 /** 8824 * Search term to navigate to from current location; term can 8825 * be '.*' or an identifier prefix. 8826 */ 8827 searchValue: string; 8828 /** 8829 * Optional limit on the number of items to return. 8830 */ 8831 maxResultCount?: number; 8832 /** 8833 * The file for the request (absolute pathname required). 8834 */ 8835 file?: string; 8836 /** 8837 * Optional flag to indicate we want results for just the current file 8838 * or the entire project. 8839 */ 8840 currentFileOnly?: boolean; 8841 projectFileName?: string; 8842 } 8843 /** 8844 * Navto request message; value of command field is "navto". 8845 * Return list of objects giving file locations and symbols that 8846 * match the search term given in argument 'searchTerm'. The 8847 * context for the search is given by the named file. 8848 */ 8849 interface NavtoRequest extends Request { 8850 command: CommandTypes.Navto; 8851 arguments: NavtoRequestArgs; 8852 } 8853 /** 8854 * An item found in a navto response. 8855 */ 8856 interface NavtoItem extends FileSpan { 8857 /** 8858 * The symbol's name. 8859 */ 8860 name: string; 8861 /** 8862 * The symbol's kind (such as 'className' or 'parameterName'). 8863 */ 8864 kind: ScriptElementKind; 8865 /** 8866 * exact, substring, or prefix. 8867 */ 8868 matchKind: string; 8869 /** 8870 * If this was a case sensitive or insensitive match. 8871 */ 8872 isCaseSensitive: boolean; 8873 /** 8874 * Optional modifiers for the kind (such as 'public'). 8875 */ 8876 kindModifiers?: string; 8877 /** 8878 * Name of symbol's container symbol (if any); for example, 8879 * the class name if symbol is a class member. 8880 */ 8881 containerName?: string; 8882 /** 8883 * Kind of symbol's container symbol (if any). 8884 */ 8885 containerKind?: ScriptElementKind; 8886 } 8887 /** 8888 * Navto response message. Body is an array of navto items. Each 8889 * item gives a symbol that matched the search term. 8890 */ 8891 interface NavtoResponse extends Response { 8892 body?: NavtoItem[]; 8893 } 8894 /** 8895 * Arguments for change request message. 8896 */ 8897 interface ChangeRequestArgs extends FormatRequestArgs { 8898 /** 8899 * Optional string to insert at location (file, line, offset). 8900 */ 8901 insertString?: string; 8902 } 8903 /** 8904 * Change request message; value of command field is "change". 8905 * Update the server's view of the file named by argument 'file'. 8906 * Server does not currently send a response to a change request. 8907 */ 8908 interface ChangeRequest extends FileLocationRequest { 8909 command: CommandTypes.Change; 8910 arguments: ChangeRequestArgs; 8911 } 8912 /** 8913 * Response to "brace" request. 8914 */ 8915 interface BraceResponse extends Response { 8916 body?: TextSpan[]; 8917 } 8918 /** 8919 * Brace matching request; value of command field is "brace". 8920 * Return response giving the file locations of matching braces 8921 * found in file at location line, offset. 8922 */ 8923 interface BraceRequest extends FileLocationRequest { 8924 command: CommandTypes.Brace; 8925 } 8926 /** 8927 * NavBar items request; value of command field is "navbar". 8928 * Return response giving the list of navigation bar entries 8929 * extracted from the requested file. 8930 */ 8931 interface NavBarRequest extends FileRequest { 8932 command: CommandTypes.NavBar; 8933 } 8934 /** 8935 * NavTree request; value of command field is "navtree". 8936 * Return response giving the navigation tree of the requested file. 8937 */ 8938 interface NavTreeRequest extends FileRequest { 8939 command: CommandTypes.NavTree; 8940 } 8941 interface NavigationBarItem { 8942 /** 8943 * The item's display text. 8944 */ 8945 text: string; 8946 /** 8947 * The symbol's kind (such as 'className' or 'parameterName'). 8948 */ 8949 kind: ScriptElementKind; 8950 /** 8951 * Optional modifiers for the kind (such as 'public'). 8952 */ 8953 kindModifiers?: string; 8954 /** 8955 * The definition locations of the item. 8956 */ 8957 spans: TextSpan[]; 8958 /** 8959 * Optional children. 8960 */ 8961 childItems?: NavigationBarItem[]; 8962 /** 8963 * Number of levels deep this item should appear. 8964 */ 8965 indent: number; 8966 } 8967 /** protocol.NavigationTree is identical to ts.NavigationTree, except using protocol.TextSpan instead of ts.TextSpan */ 8968 interface NavigationTree { 8969 text: string; 8970 kind: ScriptElementKind; 8971 kindModifiers: string; 8972 spans: TextSpan[]; 8973 nameSpan: TextSpan | undefined; 8974 childItems?: NavigationTree[]; 8975 } 8976 type TelemetryEventName = "telemetry"; 8977 interface TelemetryEvent extends Event { 8978 event: TelemetryEventName; 8979 body: TelemetryEventBody; 8980 } 8981 interface TelemetryEventBody { 8982 telemetryEventName: string; 8983 payload: any; 8984 } 8985 type TypesInstallerInitializationFailedEventName = "typesInstallerInitializationFailed"; 8986 interface TypesInstallerInitializationFailedEvent extends Event { 8987 event: TypesInstallerInitializationFailedEventName; 8988 body: TypesInstallerInitializationFailedEventBody; 8989 } 8990 interface TypesInstallerInitializationFailedEventBody { 8991 message: string; 8992 } 8993 type TypingsInstalledTelemetryEventName = "typingsInstalled"; 8994 interface TypingsInstalledTelemetryEventBody extends TelemetryEventBody { 8995 telemetryEventName: TypingsInstalledTelemetryEventName; 8996 payload: TypingsInstalledTelemetryEventPayload; 8997 } 8998 interface TypingsInstalledTelemetryEventPayload { 8999 /** 9000 * Comma separated list of installed typing packages 9001 */ 9002 installedPackages: string; 9003 /** 9004 * true if install request succeeded, otherwise - false 9005 */ 9006 installSuccess: boolean; 9007 /** 9008 * version of typings installer 9009 */ 9010 typingsInstallerVersion: string; 9011 } 9012 type BeginInstallTypesEventName = "beginInstallTypes"; 9013 type EndInstallTypesEventName = "endInstallTypes"; 9014 interface BeginInstallTypesEvent extends Event { 9015 event: BeginInstallTypesEventName; 9016 body: BeginInstallTypesEventBody; 9017 } 9018 interface EndInstallTypesEvent extends Event { 9019 event: EndInstallTypesEventName; 9020 body: EndInstallTypesEventBody; 9021 } 9022 interface InstallTypesEventBody { 9023 /** 9024 * correlation id to match begin and end events 9025 */ 9026 eventId: number; 9027 /** 9028 * list of packages to install 9029 */ 9030 packages: readonly string[]; 9031 } 9032 interface BeginInstallTypesEventBody extends InstallTypesEventBody { 9033 } 9034 interface EndInstallTypesEventBody extends InstallTypesEventBody { 9035 /** 9036 * true if installation succeeded, otherwise false 9037 */ 9038 success: boolean; 9039 } 9040 interface NavBarResponse extends Response { 9041 body?: NavigationBarItem[]; 9042 } 9043 interface NavTreeResponse extends Response { 9044 body?: NavigationTree; 9045 } 9046 interface CallHierarchyItem { 9047 name: string; 9048 kind: ScriptElementKind; 9049 kindModifiers?: string; 9050 file: string; 9051 span: TextSpan; 9052 selectionSpan: TextSpan; 9053 containerName?: string; 9054 } 9055 interface CallHierarchyIncomingCall { 9056 from: CallHierarchyItem; 9057 fromSpans: TextSpan[]; 9058 } 9059 interface CallHierarchyOutgoingCall { 9060 to: CallHierarchyItem; 9061 fromSpans: TextSpan[]; 9062 } 9063 interface PrepareCallHierarchyRequest extends FileLocationRequest { 9064 command: CommandTypes.PrepareCallHierarchy; 9065 } 9066 interface PrepareCallHierarchyResponse extends Response { 9067 readonly body: CallHierarchyItem | CallHierarchyItem[]; 9068 } 9069 interface ProvideCallHierarchyIncomingCallsRequest extends FileLocationRequest { 9070 command: CommandTypes.ProvideCallHierarchyIncomingCalls; 9071 } 9072 interface ProvideCallHierarchyIncomingCallsResponse extends Response { 9073 readonly body: CallHierarchyIncomingCall[]; 9074 } 9075 interface ProvideCallHierarchyOutgoingCallsRequest extends FileLocationRequest { 9076 command: CommandTypes.ProvideCallHierarchyOutgoingCalls; 9077 } 9078 interface ProvideCallHierarchyOutgoingCallsResponse extends Response { 9079 readonly body: CallHierarchyOutgoingCall[]; 9080 } 9081 enum IndentStyle { 9082 None = "None", 9083 Block = "Block", 9084 Smart = "Smart" 9085 } 9086 enum SemicolonPreference { 9087 Ignore = "ignore", 9088 Insert = "insert", 9089 Remove = "remove" 9090 } 9091 interface EditorSettings { 9092 baseIndentSize?: number; 9093 indentSize?: number; 9094 tabSize?: number; 9095 newLineCharacter?: string; 9096 convertTabsToSpaces?: boolean; 9097 indentStyle?: IndentStyle | ts.IndentStyle; 9098 trimTrailingWhitespace?: boolean; 9099 } 9100 interface FormatCodeSettings extends EditorSettings { 9101 insertSpaceAfterCommaDelimiter?: boolean; 9102 insertSpaceAfterSemicolonInForStatements?: boolean; 9103 insertSpaceBeforeAndAfterBinaryOperators?: boolean; 9104 insertSpaceAfterConstructor?: boolean; 9105 insertSpaceAfterKeywordsInControlFlowStatements?: boolean; 9106 insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean; 9107 insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean; 9108 insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean; 9109 insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean; 9110 insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean; 9111 insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean; 9112 insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean; 9113 insertSpaceAfterTypeAssertion?: boolean; 9114 insertSpaceBeforeFunctionParenthesis?: boolean; 9115 placeOpenBraceOnNewLineForFunctions?: boolean; 9116 placeOpenBraceOnNewLineForControlBlocks?: boolean; 9117 insertSpaceBeforeTypeAnnotation?: boolean; 9118 semicolons?: SemicolonPreference; 9119 } 9120 interface UserPreferences { 9121 readonly disableSuggestions?: boolean; 9122 readonly quotePreference?: "auto" | "double" | "single"; 9123 /** 9124 * If enabled, TypeScript will search through all external modules' exports and add them to the completions list. 9125 * This affects lone identifier completions but not completions on the right hand side of `obj.`. 9126 */ 9127 readonly includeCompletionsForModuleExports?: boolean; 9128 /** 9129 * If enabled, the completion list will include completions with invalid identifier names. 9130 * For those entries, The `insertText` and `replacementSpan` properties will be set to change from `.x` property access to `["x"]`. 9131 */ 9132 readonly includeCompletionsWithInsertText?: boolean; 9133 /** 9134 * Unless this option is `false`, or `includeCompletionsWithInsertText` is not enabled, 9135 * member completion lists triggered with `.` will include entries on potentially-null and potentially-undefined 9136 * values, with insertion text to replace preceding `.` tokens with `?.`. 9137 */ 9138 readonly includeAutomaticOptionalChainCompletions?: boolean; 9139 readonly importModuleSpecifierPreference?: "shortest" | "project-relative" | "relative" | "non-relative"; 9140 /** Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js" */ 9141 readonly importModuleSpecifierEnding?: "auto" | "minimal" | "index" | "js"; 9142 readonly allowTextChangesInNewFiles?: boolean; 9143 readonly lazyConfiguredProjectsFromExternalProject?: boolean; 9144 readonly providePrefixAndSuffixTextForRename?: boolean; 9145 readonly provideRefactorNotApplicableReason?: boolean; 9146 readonly allowRenameOfImportPath?: boolean; 9147 readonly includePackageJsonAutoImports?: "auto" | "on" | "off"; 9148 readonly generateReturnInDocTemplate?: boolean; 9149 } 9150 interface CompilerOptions { 9151 allowJs?: boolean; 9152 allowSyntheticDefaultImports?: boolean; 9153 allowUnreachableCode?: boolean; 9154 allowUnusedLabels?: boolean; 9155 alwaysStrict?: boolean; 9156 baseUrl?: string; 9157 charset?: string; 9158 checkJs?: boolean; 9159 declaration?: boolean; 9160 declarationDir?: string; 9161 disableSizeLimit?: boolean; 9162 downlevelIteration?: boolean; 9163 emitBOM?: boolean; 9164 emitDecoratorMetadata?: boolean; 9165 experimentalDecorators?: boolean; 9166 forceConsistentCasingInFileNames?: boolean; 9167 importHelpers?: boolean; 9168 inlineSourceMap?: boolean; 9169 inlineSources?: boolean; 9170 isolatedModules?: boolean; 9171 jsx?: JsxEmit | ts.JsxEmit; 9172 lib?: string[]; 9173 locale?: string; 9174 mapRoot?: string; 9175 maxNodeModuleJsDepth?: number; 9176 module?: ModuleKind | ts.ModuleKind; 9177 moduleResolution?: ModuleResolutionKind | ts.ModuleResolutionKind; 9178 newLine?: NewLineKind | ts.NewLineKind; 9179 noEmit?: boolean; 9180 noEmitHelpers?: boolean; 9181 noEmitOnError?: boolean; 9182 noErrorTruncation?: boolean; 9183 noFallthroughCasesInSwitch?: boolean; 9184 noImplicitAny?: boolean; 9185 noImplicitReturns?: boolean; 9186 noImplicitThis?: boolean; 9187 noUnusedLocals?: boolean; 9188 noUnusedParameters?: boolean; 9189 noImplicitUseStrict?: boolean; 9190 noLib?: boolean; 9191 noResolve?: boolean; 9192 out?: string; 9193 outDir?: string; 9194 outFile?: string; 9195 paths?: MapLike<string[]>; 9196 plugins?: PluginImport[]; 9197 preserveConstEnums?: boolean; 9198 preserveSymlinks?: boolean; 9199 project?: string; 9200 reactNamespace?: string; 9201 removeComments?: boolean; 9202 references?: ProjectReference[]; 9203 rootDir?: string; 9204 rootDirs?: string[]; 9205 skipLibCheck?: boolean; 9206 skipDefaultLibCheck?: boolean; 9207 sourceMap?: boolean; 9208 sourceRoot?: string; 9209 strict?: boolean; 9210 strictNullChecks?: boolean; 9211 suppressExcessPropertyErrors?: boolean; 9212 suppressImplicitAnyIndexErrors?: boolean; 9213 useDefineForClassFields?: boolean; 9214 target?: ScriptTarget | ts.ScriptTarget; 9215 traceResolution?: boolean; 9216 resolveJsonModule?: boolean; 9217 types?: string[]; 9218 /** Paths used to used to compute primary types search locations */ 9219 typeRoots?: string[]; 9220 ets?: EtsOptions; 9221 [option: string]: CompilerOptionsValue | undefined; 9222 } 9223 enum JsxEmit { 9224 None = "None", 9225 Preserve = "Preserve", 9226 ReactNative = "ReactNative", 9227 React = "React" 9228 } 9229 enum ModuleKind { 9230 None = "None", 9231 CommonJS = "CommonJS", 9232 AMD = "AMD", 9233 UMD = "UMD", 9234 System = "System", 9235 ES6 = "ES6", 9236 ES2015 = "ES2015", 9237 ESNext = "ESNext" 9238 } 9239 enum ModuleResolutionKind { 9240 Classic = "Classic", 9241 Node = "Node" 9242 } 9243 enum NewLineKind { 9244 Crlf = "Crlf", 9245 Lf = "Lf" 9246 } 9247 enum ScriptTarget { 9248 ES3 = "ES3", 9249 ES5 = "ES5", 9250 ES6 = "ES6", 9251 ES2015 = "ES2015", 9252 ES2016 = "ES2016", 9253 ES2017 = "ES2017", 9254 ES2018 = "ES2018", 9255 ES2019 = "ES2019", 9256 ES2020 = "ES2020", 9257 ESNext = "ESNext" 9258 } 9259 enum ClassificationType { 9260 comment = 1, 9261 identifier = 2, 9262 keyword = 3, 9263 numericLiteral = 4, 9264 operator = 5, 9265 stringLiteral = 6, 9266 regularExpressionLiteral = 7, 9267 whiteSpace = 8, 9268 text = 9, 9269 punctuation = 10, 9270 className = 11, 9271 enumName = 12, 9272 interfaceName = 13, 9273 moduleName = 14, 9274 typeParameterName = 15, 9275 typeAliasName = 16, 9276 parameterName = 17, 9277 docCommentTagName = 18, 9278 jsxOpenTagName = 19, 9279 jsxCloseTagName = 20, 9280 jsxSelfClosingTagName = 21, 9281 jsxAttribute = 22, 9282 jsxText = 23, 9283 jsxAttributeStringLiteralValue = 24, 9284 bigintLiteral = 25 9285 } 9286} 9287declare namespace ts.server { 9288 interface ScriptInfoVersion { 9289 svc: number; 9290 text: number; 9291 } 9292 function isDynamicFileName(fileName: NormalizedPath): boolean; 9293 class ScriptInfo { 9294 private readonly host; 9295 readonly fileName: NormalizedPath; 9296 readonly scriptKind: ScriptKind; 9297 readonly hasMixedContent: boolean; 9298 readonly path: Path; 9299 /** 9300 * All projects that include this file 9301 */ 9302 readonly containingProjects: Project[]; 9303 private formatSettings; 9304 private preferences; 9305 private textStorage; 9306 constructor(host: ServerHost, fileName: NormalizedPath, scriptKind: ScriptKind, hasMixedContent: boolean, path: Path, initialVersion?: ScriptInfoVersion); 9307 isScriptOpen(): boolean; 9308 open(newText: string): void; 9309 close(fileExists?: boolean): void; 9310 getSnapshot(): IScriptSnapshot; 9311 private ensureRealPath; 9312 getFormatCodeSettings(): FormatCodeSettings | undefined; 9313 getPreferences(): protocol.UserPreferences | undefined; 9314 attachToProject(project: Project): boolean; 9315 isAttached(project: Project): boolean; 9316 detachFromProject(project: Project): void; 9317 detachAllProjects(): void; 9318 getDefaultProject(): Project; 9319 registerFileUpdate(): void; 9320 setOptions(formatSettings: FormatCodeSettings, preferences: protocol.UserPreferences | undefined): void; 9321 getLatestVersion(): string; 9322 saveTo(fileName: string): void; 9323 reloadFromFile(tempFileName?: NormalizedPath): boolean; 9324 editContent(start: number, end: number, newText: string): void; 9325 markContainingProjectsAsDirty(): void; 9326 isOrphan(): boolean; 9327 /** 9328 * @param line 1 based index 9329 */ 9330 lineToTextSpan(line: number): TextSpan; 9331 /** 9332 * @param line 1 based index 9333 * @param offset 1 based index 9334 */ 9335 lineOffsetToPosition(line: number, offset: number): number; 9336 positionToLineOffset(position: number): protocol.Location; 9337 isJavaScript(): boolean; 9338 } 9339} 9340declare namespace ts.server { 9341 interface InstallPackageOptionsWithProject extends InstallPackageOptions { 9342 projectName: string; 9343 projectRootPath: Path; 9344 } 9345 interface ITypingsInstaller { 9346 isKnownTypesPackageName(name: string): boolean; 9347 installPackage(options: InstallPackageOptionsWithProject): Promise<ApplyCodeActionCommandResult>; 9348 enqueueInstallTypingsRequest(p: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string> | undefined): void; 9349 attach(projectService: ProjectService): void; 9350 onProjectClosed(p: Project): void; 9351 readonly globalTypingsCacheLocation: string | undefined; 9352 } 9353 const nullTypingsInstaller: ITypingsInstaller; 9354} 9355declare namespace ts.server { 9356 enum ProjectKind { 9357 Inferred = 0, 9358 Configured = 1, 9359 External = 2, 9360 AutoImportProvider = 3 9361 } 9362 function allRootFilesAreJsOrDts(project: Project): boolean; 9363 function allFilesAreJsOrDts(project: Project): boolean; 9364 interface PluginCreateInfo { 9365 project: Project; 9366 languageService: LanguageService; 9367 languageServiceHost: LanguageServiceHost; 9368 serverHost: ServerHost; 9369 config: any; 9370 } 9371 interface PluginModule { 9372 create(createInfo: PluginCreateInfo): LanguageService; 9373 getExternalFiles?(proj: Project): string[]; 9374 onConfigurationChanged?(config: any): void; 9375 } 9376 interface PluginModuleWithName { 9377 name: string; 9378 module: PluginModule; 9379 } 9380 type PluginModuleFactory = (mod: { 9381 typescript: typeof ts; 9382 }) => PluginModule; 9383 abstract class Project implements LanguageServiceHost, ModuleResolutionHost { 9384 readonly projectName: string; 9385 readonly projectKind: ProjectKind; 9386 readonly projectService: ProjectService; 9387 private documentRegistry; 9388 private compilerOptions; 9389 compileOnSaveEnabled: boolean; 9390 protected watchOptions: WatchOptions | undefined; 9391 private rootFiles; 9392 private rootFilesMap; 9393 private program; 9394 private externalFiles; 9395 private missingFilesMap; 9396 private generatedFilesMap; 9397 private plugins; 9398 protected languageService: LanguageService; 9399 languageServiceEnabled: boolean; 9400 readonly trace?: (s: string) => void; 9401 readonly realpath?: (path: string) => string; 9402 private builderState; 9403 /** 9404 * Set of files names that were updated since the last call to getChangesSinceVersion. 9405 */ 9406 private updatedFileNames; 9407 /** 9408 * Set of files that was returned from the last call to getChangesSinceVersion. 9409 */ 9410 private lastReportedFileNames; 9411 /** 9412 * Last version that was reported. 9413 */ 9414 private lastReportedVersion; 9415 /** 9416 * Current project's program version. (incremented everytime new program is created that is not complete reuse from the old one) 9417 * This property is changed in 'updateGraph' based on the set of files in program 9418 */ 9419 private projectProgramVersion; 9420 /** 9421 * Current version of the project state. It is changed when: 9422 * - new root file was added/removed 9423 * - edit happen in some file that is currently included in the project. 9424 * This property is different from projectStructureVersion since in most cases edits don't affect set of files in the project 9425 */ 9426 private projectStateVersion; 9427 protected projectErrors: Diagnostic[] | undefined; 9428 protected isInitialLoadPending: () => boolean; 9429 private readonly cancellationToken; 9430 isNonTsProject(): boolean; 9431 isJsOnlyProject(): boolean; 9432 static resolveModule(moduleName: string, initialDir: string, host: ServerHost, log: (message: string) => void, logErrors?: (message: string) => void): {} | undefined; 9433 isKnownTypesPackageName(name: string): boolean; 9434 installPackage(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>; 9435 private get typingsCache(); 9436 getCompilationSettings(): CompilerOptions; 9437 getCompilerOptions(): CompilerOptions; 9438 getNewLine(): string; 9439 getProjectVersion(): string; 9440 getProjectReferences(): readonly ProjectReference[] | undefined; 9441 getScriptFileNames(): string[]; 9442 private getOrCreateScriptInfoAndAttachToProject; 9443 getScriptKind(fileName: string): ScriptKind; 9444 getScriptVersion(filename: string): string; 9445 getScriptSnapshot(filename: string): IScriptSnapshot | undefined; 9446 getCancellationToken(): HostCancellationToken; 9447 getCurrentDirectory(): string; 9448 getDefaultLibFileName(): string; 9449 useCaseSensitiveFileNames(): boolean; 9450 readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[]; 9451 readFile(fileName: string): string | undefined; 9452 writeFile(fileName: string, content: string): void; 9453 fileExists(file: string): boolean; 9454 resolveModuleNames(moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference): (ResolvedModuleFull | undefined)[]; 9455 getResolvedModuleWithFailedLookupLocationsFromCache(moduleName: string, containingFile: string): ResolvedModuleWithFailedLookupLocations | undefined; 9456 resolveTypeReferenceDirectives(typeDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference): (ResolvedTypeReferenceDirective | undefined)[]; 9457 directoryExists(path: string): boolean; 9458 getDirectories(path: string): string[]; 9459 log(s: string): void; 9460 error(s: string): void; 9461 private setInternalCompilerOptionsForEmittingJsFiles; 9462 /** 9463 * Get the errors that dont have any file name associated 9464 */ 9465 getGlobalProjectErrors(): readonly Diagnostic[]; 9466 /** 9467 * Get all the project errors 9468 */ 9469 getAllProjectErrors(): readonly Diagnostic[]; 9470 setProjectErrors(projectErrors: Diagnostic[] | undefined): void; 9471 getLanguageService(ensureSynchronized?: boolean): LanguageService; 9472 getCompileOnSaveAffectedFileList(scriptInfo: ScriptInfo): string[]; 9473 /** 9474 * Returns true if emit was conducted 9475 */ 9476 emitFile(scriptInfo: ScriptInfo, writeFile: (path: string, data: string, writeByteOrderMark?: boolean) => void): EmitResult; 9477 enableLanguageService(): void; 9478 disableLanguageService(lastFileExceededProgramSize?: string): void; 9479 getProjectName(): string; 9480 protected removeLocalTypingsFromTypeAcquisition(newTypeAcquisition: TypeAcquisition): TypeAcquisition; 9481 getExternalFiles(): SortedReadonlyArray<string>; 9482 getSourceFile(path: Path): SourceFile | undefined; 9483 close(): void; 9484 private detachScriptInfoIfNotRoot; 9485 isClosed(): boolean; 9486 hasRoots(): boolean; 9487 getRootFiles(): NormalizedPath[]; 9488 getRootScriptInfos(): ScriptInfo[]; 9489 getScriptInfos(): ScriptInfo[]; 9490 getExcludedFiles(): readonly NormalizedPath[]; 9491 getFileNames(excludeFilesFromExternalLibraries?: boolean, excludeConfigFiles?: boolean): NormalizedPath[]; 9492 hasConfigFile(configFilePath: NormalizedPath): boolean; 9493 containsScriptInfo(info: ScriptInfo): boolean; 9494 containsFile(filename: NormalizedPath, requireOpen?: boolean): boolean; 9495 isRoot(info: ScriptInfo): boolean; 9496 addRoot(info: ScriptInfo, fileName?: NormalizedPath): void; 9497 addMissingFileRoot(fileName: NormalizedPath): void; 9498 removeFile(info: ScriptInfo, fileExists: boolean, detachFromProject: boolean): void; 9499 registerFileUpdate(fileName: string): void; 9500 markAsDirty(): void; 9501 /** 9502 * Updates set of files that contribute to this project 9503 * @returns: true if set of files in the project stays the same and false - otherwise. 9504 */ 9505 updateGraph(): boolean; 9506 protected removeExistingTypings(include: string[]): string[]; 9507 private updateGraphWorker; 9508 private detachScriptInfoFromProject; 9509 private addMissingFileWatcher; 9510 private isWatchedMissingFile; 9511 private createGeneratedFileWatcher; 9512 private isValidGeneratedFileWatcher; 9513 private clearGeneratedFileWatch; 9514 getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo | undefined; 9515 getScriptInfo(uncheckedFileName: string): ScriptInfo | undefined; 9516 filesToString(writeProjectFileNames: boolean): string; 9517 setCompilerOptions(compilerOptions: CompilerOptions): void; 9518 setTypeAcquisition(newTypeAcquisition: TypeAcquisition | undefined): void; 9519 getTypeAcquisition(): TypeAcquisition; 9520 protected removeRoot(info: ScriptInfo): void; 9521 protected enableGlobalPlugins(options: CompilerOptions, pluginConfigOverrides: Map<any> | undefined): void; 9522 protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[], pluginConfigOverrides: Map<any> | undefined): void; 9523 private enableProxy; 9524 /** Starts a new check for diagnostics. Call this if some file has updated that would cause diagnostics to be changed. */ 9525 refreshDiagnostics(): void; 9526 } 9527 /** 9528 * If a file is opened and no tsconfig (or jsconfig) is found, 9529 * the file and its imports/references are put into an InferredProject. 9530 */ 9531 class InferredProject extends Project { 9532 private static readonly newName; 9533 private _isJsInferredProject; 9534 toggleJsInferredProject(isJsInferredProject: boolean): void; 9535 setCompilerOptions(options?: CompilerOptions): void; 9536 /** this is canonical project root path */ 9537 readonly projectRootPath: string | undefined; 9538 addRoot(info: ScriptInfo): void; 9539 removeRoot(info: ScriptInfo): void; 9540 isProjectWithSingleRoot(): boolean; 9541 close(): void; 9542 getTypeAcquisition(): TypeAcquisition; 9543 } 9544 class AutoImportProviderProject extends Project { 9545 private hostProject; 9546 private static readonly newName; 9547 private rootFileNames; 9548 isOrphan(): boolean; 9549 updateGraph(): boolean; 9550 hasRoots(): boolean; 9551 markAsDirty(): void; 9552 getScriptFileNames(): string[]; 9553 getLanguageService(): never; 9554 markAutoImportProviderAsDirty(): never; 9555 getModuleResolutionHostForAutoImportProvider(): never; 9556 getProjectReferences(): readonly ProjectReference[] | undefined; 9557 useSourceOfProjectReferenceRedirect(): boolean; 9558 getTypeAcquisition(): TypeAcquisition; 9559 } 9560 /** 9561 * If a file is opened, the server will look for a tsconfig (or jsconfig) 9562 * and if successful create a ConfiguredProject for it. 9563 * Otherwise it will create an InferredProject. 9564 */ 9565 class ConfiguredProject extends Project { 9566 private directoriesWatchedForWildcards; 9567 readonly canonicalConfigFilePath: NormalizedPath; 9568 /** Ref count to the project when opened from external project */ 9569 private externalProjectRefCount; 9570 private projectReferences; 9571 /** 9572 * If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph 9573 * @returns: true if set of files in the project stays the same and false - otherwise. 9574 */ 9575 updateGraph(): boolean; 9576 getConfigFilePath(): NormalizedPath; 9577 getProjectReferences(): readonly ProjectReference[] | undefined; 9578 updateReferences(refs: readonly ProjectReference[] | undefined): void; 9579 /** 9580 * Get the errors that dont have any file name associated 9581 */ 9582 getGlobalProjectErrors(): readonly Diagnostic[]; 9583 /** 9584 * Get all the project errors 9585 */ 9586 getAllProjectErrors(): readonly Diagnostic[]; 9587 setProjectErrors(projectErrors: Diagnostic[]): void; 9588 close(): void; 9589 getEffectiveTypeRoots(): string[]; 9590 } 9591 /** 9592 * Project whose configuration is handled externally, such as in a '.csproj'. 9593 * These are created only if a host explicitly calls `openExternalProject`. 9594 */ 9595 class ExternalProject extends Project { 9596 externalProjectName: string; 9597 compileOnSaveEnabled: boolean; 9598 excludedFiles: readonly NormalizedPath[]; 9599 updateGraph(): boolean; 9600 getExcludedFiles(): readonly NormalizedPath[]; 9601 } 9602} 9603declare namespace ts.server { 9604 export const maxProgramSizeForNonTsFiles: number; 9605 export const ProjectsUpdatedInBackgroundEvent = "projectsUpdatedInBackground"; 9606 export const ProjectLoadingStartEvent = "projectLoadingStart"; 9607 export const ProjectLoadingFinishEvent = "projectLoadingFinish"; 9608 export const LargeFileReferencedEvent = "largeFileReferenced"; 9609 export const ConfigFileDiagEvent = "configFileDiag"; 9610 export const ProjectLanguageServiceStateEvent = "projectLanguageServiceState"; 9611 export const ProjectInfoTelemetryEvent = "projectInfo"; 9612 export const OpenFileInfoTelemetryEvent = "openFileInfo"; 9613 export interface ProjectsUpdatedInBackgroundEvent { 9614 eventName: typeof ProjectsUpdatedInBackgroundEvent; 9615 data: { 9616 openFiles: string[]; 9617 }; 9618 } 9619 export interface ProjectLoadingStartEvent { 9620 eventName: typeof ProjectLoadingStartEvent; 9621 data: { 9622 project: Project; 9623 reason: string; 9624 }; 9625 } 9626 export interface ProjectLoadingFinishEvent { 9627 eventName: typeof ProjectLoadingFinishEvent; 9628 data: { 9629 project: Project; 9630 }; 9631 } 9632 export interface LargeFileReferencedEvent { 9633 eventName: typeof LargeFileReferencedEvent; 9634 data: { 9635 file: string; 9636 fileSize: number; 9637 maxFileSize: number; 9638 }; 9639 } 9640 export interface ConfigFileDiagEvent { 9641 eventName: typeof ConfigFileDiagEvent; 9642 data: { 9643 triggerFile: string; 9644 configFileName: string; 9645 diagnostics: readonly Diagnostic[]; 9646 }; 9647 } 9648 export interface ProjectLanguageServiceStateEvent { 9649 eventName: typeof ProjectLanguageServiceStateEvent; 9650 data: { 9651 project: Project; 9652 languageServiceEnabled: boolean; 9653 }; 9654 } 9655 /** This will be converted to the payload of a protocol.TelemetryEvent in session.defaultEventHandler. */ 9656 export interface ProjectInfoTelemetryEvent { 9657 readonly eventName: typeof ProjectInfoTelemetryEvent; 9658 readonly data: ProjectInfoTelemetryEventData; 9659 } 9660 export interface ProjectInfoTelemetryEventData { 9661 /** Cryptographically secure hash of project file location. */ 9662 readonly projectId: string; 9663 /** Count of file extensions seen in the project. */ 9664 readonly fileStats: FileStats; 9665 /** 9666 * Any compiler options that might contain paths will be taken out. 9667 * Enum compiler options will be converted to strings. 9668 */ 9669 readonly compilerOptions: CompilerOptions; 9670 readonly extends: boolean | undefined; 9671 readonly files: boolean | undefined; 9672 readonly include: boolean | undefined; 9673 readonly exclude: boolean | undefined; 9674 readonly compileOnSave: boolean; 9675 readonly typeAcquisition: ProjectInfoTypeAcquisitionData; 9676 readonly configFileName: "tsconfig.json" | "jsconfig.json" | "other"; 9677 readonly projectType: "external" | "configured"; 9678 readonly languageServiceEnabled: boolean; 9679 /** TypeScript version used by the server. */ 9680 readonly version: string; 9681 } 9682 /** 9683 * Info that we may send about a file that was just opened. 9684 * Info about a file will only be sent once per session, even if the file changes in ways that might affect the info. 9685 * Currently this is only sent for '.js' files. 9686 */ 9687 export interface OpenFileInfoTelemetryEvent { 9688 readonly eventName: typeof OpenFileInfoTelemetryEvent; 9689 readonly data: OpenFileInfoTelemetryEventData; 9690 } 9691 export interface OpenFileInfoTelemetryEventData { 9692 readonly info: OpenFileInfo; 9693 } 9694 export interface ProjectInfoTypeAcquisitionData { 9695 readonly enable: boolean | undefined; 9696 readonly include: boolean; 9697 readonly exclude: boolean; 9698 } 9699 export interface FileStats { 9700 readonly js: number; 9701 readonly jsSize?: number; 9702 readonly jsx: number; 9703 readonly jsxSize?: number; 9704 readonly ts: number; 9705 readonly tsSize?: number; 9706 readonly tsx: number; 9707 readonly tsxSize?: number; 9708 readonly dts: number; 9709 readonly dtsSize?: number; 9710 readonly deferred: number; 9711 readonly deferredSize?: number; 9712 } 9713 export interface OpenFileInfo { 9714 readonly checkJs: boolean; 9715 } 9716 export type ProjectServiceEvent = LargeFileReferencedEvent | ProjectsUpdatedInBackgroundEvent | ProjectLoadingStartEvent | ProjectLoadingFinishEvent | ConfigFileDiagEvent | ProjectLanguageServiceStateEvent | ProjectInfoTelemetryEvent | OpenFileInfoTelemetryEvent; 9717 export type ProjectServiceEventHandler = (event: ProjectServiceEvent) => void; 9718 export interface SafeList { 9719 [name: string]: { 9720 match: RegExp; 9721 exclude?: (string | number)[][]; 9722 types?: string[]; 9723 }; 9724 } 9725 export interface TypesMapFile { 9726 typesMap: SafeList; 9727 simpleMap: { 9728 [libName: string]: string; 9729 }; 9730 } 9731 export function convertFormatOptions(protocolOptions: protocol.FormatCodeSettings): FormatCodeSettings; 9732 export function convertCompilerOptions(protocolOptions: protocol.ExternalProjectCompilerOptions): CompilerOptions & protocol.CompileOnSaveMixin; 9733 export function convertWatchOptions(protocolOptions: protocol.ExternalProjectCompilerOptions, currentDirectory?: string): WatchOptionsAndErrors | undefined; 9734 export function convertTypeAcquisition(protocolOptions: protocol.InferredProjectCompilerOptions): TypeAcquisition | undefined; 9735 export function tryConvertScriptKindName(scriptKindName: protocol.ScriptKindName | ScriptKind): ScriptKind; 9736 export function convertScriptKindName(scriptKindName: protocol.ScriptKindName): ScriptKind.Unknown | ScriptKind.JS | ScriptKind.JSX | ScriptKind.TS | ScriptKind.TSX; 9737 export interface HostConfiguration { 9738 formatCodeOptions: FormatCodeSettings; 9739 preferences: protocol.UserPreferences; 9740 hostInfo: string; 9741 extraFileExtensions?: FileExtensionInfo[]; 9742 watchOptions?: WatchOptions; 9743 } 9744 export interface OpenConfiguredProjectResult { 9745 configFileName?: NormalizedPath; 9746 configFileErrors?: readonly Diagnostic[]; 9747 } 9748 export interface ProjectServiceOptions { 9749 host: ServerHost; 9750 logger: Logger; 9751 cancellationToken: HostCancellationToken; 9752 useSingleInferredProject: boolean; 9753 useInferredProjectPerProjectRoot: boolean; 9754 typingsInstaller: ITypingsInstaller; 9755 eventHandler?: ProjectServiceEventHandler; 9756 suppressDiagnosticEvents?: boolean; 9757 throttleWaitMilliseconds?: number; 9758 globalPlugins?: readonly string[]; 9759 pluginProbeLocations?: readonly string[]; 9760 allowLocalPluginLoads?: boolean; 9761 typesMapLocation?: string; 9762 /** @deprecated use serverMode instead */ 9763 syntaxOnly?: boolean; 9764 serverMode?: LanguageServiceMode; 9765 } 9766 export interface WatchOptionsAndErrors { 9767 watchOptions: WatchOptions; 9768 errors: Diagnostic[] | undefined; 9769 } 9770 export class ProjectService { 9771 private readonly scriptInfoInNodeModulesWatchers; 9772 /** 9773 * Contains all the deleted script info's version information so that 9774 * it does not reset when creating script info again 9775 * (and could have potentially collided with version where contents mismatch) 9776 */ 9777 private readonly filenameToScriptInfoVersion; 9778 private readonly allJsFilesForOpenFileTelemetry; 9779 /** 9780 * maps external project file name to list of config files that were the part of this project 9781 */ 9782 private readonly externalProjectToConfiguredProjectMap; 9783 /** 9784 * external projects (configuration and list of root files is not controlled by tsserver) 9785 */ 9786 readonly externalProjects: ExternalProject[]; 9787 /** 9788 * projects built from openFileRoots 9789 */ 9790 readonly inferredProjects: InferredProject[]; 9791 /** 9792 * projects specified by a tsconfig.json file 9793 */ 9794 readonly configuredProjects: Map<ConfiguredProject>; 9795 /** 9796 * Open files: with value being project root path, and key being Path of the file that is open 9797 */ 9798 readonly openFiles: Map<NormalizedPath | undefined>; 9799 /** 9800 * Map of open files that are opened without complete path but have projectRoot as current directory 9801 */ 9802 private readonly openFilesWithNonRootedDiskPath; 9803 private compilerOptionsForInferredProjects; 9804 private compilerOptionsForInferredProjectsPerProjectRoot; 9805 private watchOptionsForInferredProjects; 9806 private watchOptionsForInferredProjectsPerProjectRoot; 9807 private typeAcquisitionForInferredProjects; 9808 private typeAcquisitionForInferredProjectsPerProjectRoot; 9809 /** 9810 * Project size for configured or external projects 9811 */ 9812 private readonly projectToSizeMap; 9813 /** 9814 * This is a map of config file paths existence that doesnt need query to disk 9815 * - The entry can be present because there is inferred project that needs to watch addition of config file to directory 9816 * In this case the exists could be true/false based on config file is present or not 9817 * - Or it is present if we have configured project open with config file at that location 9818 * In this case the exists property is always true 9819 */ 9820 private readonly configFileExistenceInfoCache; 9821 private readonly hostConfiguration; 9822 private safelist; 9823 private readonly legacySafelist; 9824 private pendingProjectUpdates; 9825 readonly currentDirectory: NormalizedPath; 9826 readonly toCanonicalFileName: (f: string) => string; 9827 readonly host: ServerHost; 9828 readonly logger: Logger; 9829 readonly cancellationToken: HostCancellationToken; 9830 readonly useSingleInferredProject: boolean; 9831 readonly useInferredProjectPerProjectRoot: boolean; 9832 readonly typingsInstaller: ITypingsInstaller; 9833 private readonly globalCacheLocationDirectoryPath; 9834 readonly throttleWaitMilliseconds?: number; 9835 private readonly eventHandler?; 9836 private readonly suppressDiagnosticEvents?; 9837 readonly globalPlugins: readonly string[]; 9838 readonly pluginProbeLocations: readonly string[]; 9839 readonly allowLocalPluginLoads: boolean; 9840 private currentPluginConfigOverrides; 9841 readonly typesMapLocation: string | undefined; 9842 /** @deprecated use serverMode instead */ 9843 readonly syntaxOnly: boolean; 9844 readonly serverMode: LanguageServiceMode; 9845 /** Tracks projects that we have already sent telemetry for. */ 9846 private readonly seenProjects; 9847 private performanceEventHandler?; 9848 constructor(opts: ProjectServiceOptions); 9849 toPath(fileName: string): Path; 9850 private loadTypesMap; 9851 updateTypingsForProject(response: SetTypings | InvalidateCachedTypings | PackageInstalledResponse): void; 9852 private delayUpdateProjectGraph; 9853 private delayUpdateProjectGraphs; 9854 setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.InferredProjectCompilerOptions, projectRootPath?: string): void; 9855 findProject(projectName: string): Project | undefined; 9856 getDefaultProjectForFile(fileName: NormalizedPath, ensureProject: boolean): Project | undefined; 9857 private doEnsureDefaultProjectForFile; 9858 getScriptInfoEnsuringProjectsUptoDate(uncheckedFileName: string): ScriptInfo | undefined; 9859 /** 9860 * Ensures the project structures are upto date 9861 * This means, 9862 * - we go through all the projects and update them if they are dirty 9863 * - if updates reflect some change in structure or there was pending request to ensure projects for open files 9864 * ensure that each open script info has project 9865 */ 9866 private ensureProjectStructuresUptoDate; 9867 getFormatCodeOptions(file: NormalizedPath): FormatCodeSettings; 9868 getPreferences(file: NormalizedPath): protocol.UserPreferences; 9869 getHostFormatCodeOptions(): FormatCodeSettings; 9870 getHostPreferences(): protocol.UserPreferences; 9871 private onSourceFileChanged; 9872 private handleSourceMapProjects; 9873 private delayUpdateSourceInfoProjects; 9874 private delayUpdateProjectsOfScriptInfoPath; 9875 private handleDeletedFile; 9876 /** 9877 * This is the callback function for the config file add/remove/change at any location 9878 * that matters to open script info but doesnt have configured project open 9879 * for the config file 9880 */ 9881 private onConfigFileChangeForOpenScriptInfo; 9882 private removeProject; 9883 private assignOrphanScriptInfosToInferredProject; 9884 /** 9885 * Remove this file from the set of open, non-configured files. 9886 * @param info The file that has been closed or newly configured 9887 */ 9888 private closeOpenFile; 9889 private deleteScriptInfo; 9890 private configFileExists; 9891 private setConfigFileExistenceByNewConfiguredProject; 9892 /** 9893 * Returns true if the configFileExistenceInfo is needed/impacted by open files that are root of inferred project 9894 */ 9895 private configFileExistenceImpactsRootOfInferredProject; 9896 private setConfigFileExistenceInfoByClosedConfiguredProject; 9897 private logConfigFileWatchUpdate; 9898 /** 9899 * Create the watcher for the configFileExistenceInfo 9900 */ 9901 private createConfigFileWatcherOfConfigFileExistence; 9902 /** 9903 * Close the config file watcher in the cached ConfigFileExistenceInfo 9904 * if there arent any open files that are root of inferred project 9905 */ 9906 private closeConfigFileWatcherOfConfigFileExistenceInfo; 9907 /** 9908 * This is called on file close, so that we stop watching the config file for this script info 9909 */ 9910 private stopWatchingConfigFilesForClosedScriptInfo; 9911 /** 9912 * This function tries to search for a tsconfig.json for the given file. 9913 * This is different from the method the compiler uses because 9914 * the compiler can assume it will always start searching in the 9915 * current directory (the directory in which tsc was invoked). 9916 * The server must start searching from the directory containing 9917 * the newly opened file. 9918 */ 9919 private forEachConfigFileLocation; 9920 /** 9921 * This function tries to search for a tsconfig.json for the given file. 9922 * This is different from the method the compiler uses because 9923 * the compiler can assume it will always start searching in the 9924 * current directory (the directory in which tsc was invoked). 9925 * The server must start searching from the directory containing 9926 * the newly opened file. 9927 * If script info is passed in, it is asserted to be open script info 9928 * otherwise just file name 9929 */ 9930 private getConfigFileNameForFile; 9931 private printProjects; 9932 private getConfiguredProjectByCanonicalConfigFilePath; 9933 private findExternalProjectByProjectName; 9934 /** Get a filename if the language service exceeds the maximum allowed program size; otherwise returns undefined. */ 9935 private getFilenameForExceededTotalSizeLimitForNonTsFiles; 9936 private createExternalProject; 9937 private addFilesToNonInferredProject; 9938 private updateNonInferredProjectFiles; 9939 private updateRootAndOptionsOfNonInferredProject; 9940 private sendConfigFileDiagEvent; 9941 private getOrCreateInferredProjectForProjectRootPathIfEnabled; 9942 private getOrCreateSingleInferredProjectIfEnabled; 9943 private getOrCreateSingleInferredWithoutProjectRoot; 9944 private createInferredProject; 9945 getScriptInfo(uncheckedFileName: string): ScriptInfo | undefined; 9946 private watchClosedScriptInfo; 9947 private watchClosedScriptInfoInNodeModules; 9948 private getModifiedTime; 9949 private refreshScriptInfo; 9950 private refreshScriptInfosInDirectory; 9951 private stopWatchingScriptInfo; 9952 private getOrCreateScriptInfoNotOpenedByClientForNormalizedPath; 9953 private getOrCreateScriptInfoOpenedByClientForNormalizedPath; 9954 getOrCreateScriptInfoForNormalizedPath(fileName: NormalizedPath, openedByClient: boolean, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, hostToQueryFileExistsOn?: { 9955 fileExists(path: string): boolean; 9956 }): ScriptInfo | undefined; 9957 private getOrCreateScriptInfoWorker; 9958 /** 9959 * 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 9960 */ 9961 getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo | undefined; 9962 getScriptInfoForPath(fileName: Path): ScriptInfo | undefined; 9963 private addSourceInfoToSourceMap; 9964 private addMissingSourceMapFile; 9965 setHostConfiguration(args: protocol.ConfigureRequestArguments): void; 9966 closeLog(): void; 9967 /** 9968 * This function rebuilds the project for every file opened by the client 9969 * This does not reload contents of open files from disk. But we could do that if needed 9970 */ 9971 reloadProjects(): void; 9972 private delayReloadConfiguredProjectForFiles; 9973 /** 9974 * This function goes through all the openFiles and tries to file the config file for them. 9975 * If the config file is found and it refers to existing project, it reloads it either immediately 9976 * or schedules it for reload depending on delayReload option 9977 * If the there is no existing project it just opens the configured project for the config file 9978 * reloadForInfo provides a way to filter out files to reload configured project for 9979 */ 9980 private reloadConfiguredProjectForFiles; 9981 /** 9982 * Remove the root of inferred project if script info is part of another project 9983 */ 9984 private removeRootOfInferredProjectIfNowPartOfOtherProject; 9985 /** 9986 * This function is to update the project structure for every inferred project. 9987 * It is called on the premise that all the configured projects are 9988 * up to date. 9989 * This will go through open files and assign them to inferred project if open file is not part of any other project 9990 * After that all the inferred project graphs are updated 9991 */ 9992 private ensureProjectForOpenFiles; 9993 /** 9994 * Open file whose contents is managed by the client 9995 * @param filename is absolute pathname 9996 * @param fileContent is a known version of the file content that is more up to date than the one on disk 9997 */ 9998 openClientFile(fileName: string, fileContent?: string, scriptKind?: ScriptKind, projectRootPath?: string): OpenConfiguredProjectResult; 9999 private findExternalProjectContainingOpenScriptInfo; 10000 private getOrCreateOpenScriptInfo; 10001 private assignProjectToOpenedScriptInfo; 10002 private createAncestorProjects; 10003 private ensureProjectChildren; 10004 private cleanupAfterOpeningFile; 10005 openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult; 10006 private removeOrphanConfiguredProjects; 10007 private removeOrphanScriptInfos; 10008 private telemetryOnOpenFile; 10009 /** 10010 * Close file whose contents is managed by the client 10011 * @param filename is absolute pathname 10012 */ 10013 closeClientFile(uncheckedFileName: string): void; 10014 private collectChanges; 10015 private closeConfiguredProjectReferencedFromExternalProject; 10016 closeExternalProject(uncheckedFileName: string): void; 10017 openExternalProjects(projects: protocol.ExternalProject[]): void; 10018 /** Makes a filename safe to insert in a RegExp */ 10019 private static readonly filenameEscapeRegexp; 10020 private static escapeFilenameForRegex; 10021 resetSafeList(): void; 10022 applySafeList(proj: protocol.ExternalProject): NormalizedPath[]; 10023 openExternalProject(proj: protocol.ExternalProject): void; 10024 hasDeferredExtension(): boolean; 10025 configurePlugin(args: protocol.ConfigurePluginRequestArguments): void; 10026 } 10027 export {}; 10028} 10029declare namespace ts.server { 10030 interface ServerCancellationToken extends HostCancellationToken { 10031 setRequest(requestId: number): void; 10032 resetRequest(requestId: number): void; 10033 } 10034 const nullCancellationToken: ServerCancellationToken; 10035 interface PendingErrorCheck { 10036 fileName: NormalizedPath; 10037 project: Project; 10038 } 10039 type CommandNames = protocol.CommandTypes; 10040 const CommandNames: any; 10041 function formatMessage<T extends protocol.Message>(msg: T, logger: Logger, byteLength: (s: string, encoding: string) => number, newLine: string): string; 10042 type Event = <T extends object>(body: T, eventName: string) => void; 10043 interface EventSender { 10044 event: Event; 10045 } 10046 interface SessionOptions { 10047 host: ServerHost; 10048 cancellationToken: ServerCancellationToken; 10049 useSingleInferredProject: boolean; 10050 useInferredProjectPerProjectRoot: boolean; 10051 typingsInstaller: ITypingsInstaller; 10052 byteLength: (buf: string, encoding?: string) => number; 10053 hrtime: (start?: number[]) => number[]; 10054 logger: Logger; 10055 /** 10056 * If falsy, all events are suppressed. 10057 */ 10058 canUseEvents: boolean; 10059 eventHandler?: ProjectServiceEventHandler; 10060 /** Has no effect if eventHandler is also specified. */ 10061 suppressDiagnosticEvents?: boolean; 10062 /** @deprecated use serverMode instead */ 10063 syntaxOnly?: boolean; 10064 serverMode?: LanguageServiceMode; 10065 throttleWaitMilliseconds?: number; 10066 noGetErrOnBackgroundUpdate?: boolean; 10067 globalPlugins?: readonly string[]; 10068 pluginProbeLocations?: readonly string[]; 10069 allowLocalPluginLoads?: boolean; 10070 typesMapLocation?: string; 10071 } 10072 class Session<TMessage = string> implements EventSender { 10073 private readonly gcTimer; 10074 protected projectService: ProjectService; 10075 private changeSeq; 10076 private performanceData; 10077 private currentRequestId; 10078 private errorCheck; 10079 protected host: ServerHost; 10080 private readonly cancellationToken; 10081 protected readonly typingsInstaller: ITypingsInstaller; 10082 protected byteLength: (buf: string, encoding?: string) => number; 10083 private hrtime; 10084 protected logger: Logger; 10085 protected canUseEvents: boolean; 10086 private suppressDiagnosticEvents?; 10087 private eventHandler; 10088 private readonly noGetErrOnBackgroundUpdate?; 10089 constructor(opts: SessionOptions); 10090 private sendRequestCompletedEvent; 10091 private addPerformanceData; 10092 private performanceEventHandler; 10093 private defaultEventHandler; 10094 private projectsUpdatedInBackgroundEvent; 10095 logError(err: Error, cmd: string): void; 10096 private logErrorWorker; 10097 send(msg: protocol.Message): void; 10098 event<T extends object>(body: T, eventName: string): void; 10099 /** @deprecated */ 10100 output(info: any, cmdName: string, reqSeq?: number, errorMsg?: string): void; 10101 private doOutput; 10102 private semanticCheck; 10103 private syntacticCheck; 10104 private suggestionCheck; 10105 private sendDiagnosticsEvent; 10106 /** It is the caller's responsibility to verify that `!this.suppressDiagnosticEvents`. */ 10107 private updateErrorCheck; 10108 private cleanProjects; 10109 private cleanup; 10110 private getEncodedSyntacticClassifications; 10111 private getEncodedSemanticClassifications; 10112 private getProject; 10113 private getConfigFileAndProject; 10114 private getConfigFileDiagnostics; 10115 private convertToDiagnosticsWithLinePositionFromDiagnosticFile; 10116 private getCompilerOptionsDiagnostics; 10117 private convertToDiagnosticsWithLinePosition; 10118 private getDiagnosticsWorker; 10119 private getDefinition; 10120 private mapDefinitionInfoLocations; 10121 private getDefinitionAndBoundSpan; 10122 private getEmitOutput; 10123 private mapDefinitionInfo; 10124 private static mapToOriginalLocation; 10125 private toFileSpan; 10126 private toFileSpanWithContext; 10127 private getTypeDefinition; 10128 private mapImplementationLocations; 10129 private getImplementation; 10130 private getOccurrences; 10131 private getSyntacticDiagnosticsSync; 10132 private getSemanticDiagnosticsSync; 10133 private getSuggestionDiagnosticsSync; 10134 private getJsxClosingTag; 10135 private getDocumentHighlights; 10136 private setCompilerOptionsForInferredProjects; 10137 private getProjectInfo; 10138 private getProjectInfoWorker; 10139 private getRenameInfo; 10140 private getProjects; 10141 private getDefaultProject; 10142 private getRenameLocations; 10143 private mapRenameInfo; 10144 private toSpanGroups; 10145 private getReferences; 10146 private getFileReferences; 10147 /** 10148 * @param fileName is the name of the file to be opened 10149 * @param fileContent is a version of the file content that is known to be more up to date than the one on disk 10150 */ 10151 private openClientFile; 10152 private getPosition; 10153 private getPositionInFile; 10154 private getFileAndProject; 10155 private getFileAndLanguageServiceForSyntacticOperation; 10156 private getFileAndProjectWorker; 10157 private getOutliningSpans; 10158 private getTodoComments; 10159 private getDocCommentTemplate; 10160 private getSpanOfEnclosingComment; 10161 private getIndentation; 10162 private getBreakpointStatement; 10163 private getNameOrDottedNameSpan; 10164 private isValidBraceCompletion; 10165 private getQuickInfoWorker; 10166 private getFormattingEditsForRange; 10167 private getFormattingEditsForRangeFull; 10168 private getFormattingEditsForDocumentFull; 10169 private getFormattingEditsAfterKeystrokeFull; 10170 private getFormattingEditsAfterKeystroke; 10171 private getCompletions; 10172 private getCompletionEntryDetails; 10173 private getCompileOnSaveAffectedFileList; 10174 private emitFile; 10175 private getSignatureHelpItems; 10176 private toPendingErrorCheck; 10177 private getDiagnostics; 10178 private change; 10179 private reload; 10180 private saveToTmp; 10181 private closeClientFile; 10182 private mapLocationNavigationBarItems; 10183 private getNavigationBarItems; 10184 private toLocationNavigationTree; 10185 private getNavigationTree; 10186 private getNavigateToItems; 10187 private getFullNavigateToItems; 10188 private getSupportedCodeFixes; 10189 private isLocation; 10190 private extractPositionOrRange; 10191 private getRange; 10192 private getApplicableRefactors; 10193 private getEditsForRefactor; 10194 private organizeImports; 10195 private getEditsForFileRename; 10196 private getCodeFixes; 10197 private getCombinedCodeFix; 10198 private applyCodeActionCommand; 10199 private getStartAndEndPosition; 10200 private mapCodeAction; 10201 private mapCodeFixAction; 10202 private mapTextChangesToCodeEdits; 10203 private mapTextChangeToCodeEdit; 10204 private convertTextChangeToCodeEdit; 10205 private getBraceMatching; 10206 private getDiagnosticsForProject; 10207 private configurePlugin; 10208 private getSmartSelectionRange; 10209 private toggleLineComment; 10210 private toggleMultilineComment; 10211 private commentSelection; 10212 private uncommentSelection; 10213 private mapSelectionRange; 10214 private getScriptInfoFromProjectService; 10215 private toProtocolCallHierarchyItem; 10216 private toProtocolCallHierarchyIncomingCall; 10217 private toProtocolCallHierarchyOutgoingCall; 10218 private prepareCallHierarchy; 10219 private provideCallHierarchyIncomingCalls; 10220 private provideCallHierarchyOutgoingCalls; 10221 getCanonicalFileName(fileName: string): string; 10222 exit(): void; 10223 private notRequired; 10224 private requiredResponse; 10225 private handlers; 10226 addProtocolHandler(command: string, handler: (request: protocol.Request) => HandlerResponse): void; 10227 private setCurrentRequest; 10228 private resetCurrentRequest; 10229 executeWithRequestId<T>(requestId: number, f: () => T): T; 10230 executeCommand(request: protocol.Request): HandlerResponse; 10231 onMessage(message: TMessage): void; 10232 protected parseMessage(message: TMessage): protocol.Request; 10233 protected toStringMessage(message: TMessage): string; 10234 private getFormatOptions; 10235 private getPreferences; 10236 private getHostFormatOptions; 10237 private getHostPreferences; 10238 } 10239 interface HandlerResponse { 10240 response?: {}; 10241 responseRequired?: boolean; 10242 } 10243} 10244declare namespace ts { 10245 /** @deprecated Use `factory.createNodeArray` or the factory supplied by your transformation context instead. */ 10246 const createNodeArray: <T extends Node>(elements?: readonly T[] | undefined, hasTrailingComma?: boolean | undefined) => NodeArray<T>; 10247 /** @deprecated Use `factory.createNumericLiteral` or the factory supplied by your transformation context instead. */ 10248 const createNumericLiteral: (value: string | number, numericLiteralFlags?: TokenFlags | undefined) => NumericLiteral; 10249 /** @deprecated Use `factory.createBigIntLiteral` or the factory supplied by your transformation context instead. */ 10250 const createBigIntLiteral: (value: string | PseudoBigInt) => BigIntLiteral; 10251 /** @deprecated Use `factory.createStringLiteral` or the factory supplied by your transformation context instead. */ 10252 const createStringLiteral: { 10253 (text: string, isSingleQuote?: boolean | undefined): StringLiteral; 10254 (text: string, isSingleQuote?: boolean | undefined, hasExtendedUnicodeEscape?: boolean | undefined): StringLiteral; 10255 }; 10256 /** @deprecated Use `factory.createStringLiteralFromNode` or the factory supplied by your transformation context instead. */ 10257 const createStringLiteralFromNode: (sourceNode: PropertyNameLiteral, isSingleQuote?: boolean | undefined) => StringLiteral; 10258 /** @deprecated Use `factory.createRegularExpressionLiteral` or the factory supplied by your transformation context instead. */ 10259 const createRegularExpressionLiteral: (text: string) => RegularExpressionLiteral; 10260 /** @deprecated Use `factory.createLoopVariable` or the factory supplied by your transformation context instead. */ 10261 const createLoopVariable: () => Identifier; 10262 /** @deprecated Use `factory.createUniqueName` or the factory supplied by your transformation context instead. */ 10263 const createUniqueName: (text: string, flags?: GeneratedIdentifierFlags | undefined) => Identifier; 10264 /** @deprecated Use `factory.createPrivateIdentifier` or the factory supplied by your transformation context instead. */ 10265 const createPrivateIdentifier: (text: string) => PrivateIdentifier; 10266 /** @deprecated Use `factory.createSuper` or the factory supplied by your transformation context instead. */ 10267 const createSuper: () => SuperExpression; 10268 /** @deprecated Use `factory.createThis` or the factory supplied by your transformation context instead. */ 10269 const createThis: () => ThisExpression; 10270 /** @deprecated Use `factory.createNull` or the factory supplied by your transformation context instead. */ 10271 const createNull: () => NullLiteral; 10272 /** @deprecated Use `factory.createTrue` or the factory supplied by your transformation context instead. */ 10273 const createTrue: () => TrueLiteral; 10274 /** @deprecated Use `factory.createFalse` or the factory supplied by your transformation context instead. */ 10275 const createFalse: () => FalseLiteral; 10276 /** @deprecated Use `factory.createModifier` or the factory supplied by your transformation context instead. */ 10277 const createModifier: <T extends ModifierSyntaxKind>(kind: T) => ModifierToken<T>; 10278 /** @deprecated Use `factory.createModifiersFromModifierFlags` or the factory supplied by your transformation context instead. */ 10279 const createModifiersFromModifierFlags: (flags: ModifierFlags) => Modifier[]; 10280 /** @deprecated Use `factory.createQualifiedName` or the factory supplied by your transformation context instead. */ 10281 const createQualifiedName: (left: EntityName, right: string | Identifier) => QualifiedName; 10282 /** @deprecated Use `factory.updateQualifiedName` or the factory supplied by your transformation context instead. */ 10283 const updateQualifiedName: (node: QualifiedName, left: EntityName, right: Identifier) => QualifiedName; 10284 /** @deprecated Use `factory.createComputedPropertyName` or the factory supplied by your transformation context instead. */ 10285 const createComputedPropertyName: (expression: Expression) => ComputedPropertyName; 10286 /** @deprecated Use `factory.updateComputedPropertyName` or the factory supplied by your transformation context instead. */ 10287 const updateComputedPropertyName: (node: ComputedPropertyName, expression: Expression) => ComputedPropertyName; 10288 /** @deprecated Use `factory.createTypeParameterDeclaration` or the factory supplied by your transformation context instead. */ 10289 const createTypeParameterDeclaration: (name: string | Identifier, constraint?: TypeNode | undefined, defaultType?: TypeNode | undefined) => TypeParameterDeclaration; 10290 /** @deprecated Use `factory.updateTypeParameterDeclaration` or the factory supplied by your transformation context instead. */ 10291 const updateTypeParameterDeclaration: (node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined) => TypeParameterDeclaration; 10292 /** @deprecated Use `factory.createParameterDeclaration` or the factory supplied by your transformation context instead. */ 10293 const createParameter: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken?: QuestionToken | undefined, type?: TypeNode | undefined, initializer?: Expression | undefined) => ParameterDeclaration; 10294 /** @deprecated Use `factory.updateParameterDeclaration` or the factory supplied by your transformation context instead. */ 10295 const updateParameter: (node: ParameterDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined) => ParameterDeclaration; 10296 /** @deprecated Use `factory.createDecorator` or the factory supplied by your transformation context instead. */ 10297 const createDecorator: (expression: Expression) => Decorator; 10298 /** @deprecated Use `factory.updateDecorator` or the factory supplied by your transformation context instead. */ 10299 const updateDecorator: (node: Decorator, expression: Expression) => Decorator; 10300 /** @deprecated Use `factory.createPropertyDeclaration` or the factory supplied by your transformation context instead. */ 10301 const createProperty: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined) => PropertyDeclaration; 10302 /** @deprecated Use `factory.updatePropertyDeclaration` or the factory supplied by your transformation context instead. */ 10303 const updateProperty: (node: PropertyDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined) => PropertyDeclaration; 10304 /** @deprecated Use `factory.createMethodDeclaration` or the factory supplied by your transformation context instead. */ 10305 const createMethod: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => MethodDeclaration; 10306 /** @deprecated Use `factory.updateMethodDeclaration` or the factory supplied by your transformation context instead. */ 10307 const updateMethod: (node: MethodDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => MethodDeclaration; 10308 /** @deprecated Use `factory.createConstructorDeclaration` or the factory supplied by your transformation context instead. */ 10309 const createConstructor: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined) => ConstructorDeclaration; 10310 /** @deprecated Use `factory.updateConstructorDeclaration` or the factory supplied by your transformation context instead. */ 10311 const updateConstructor: (node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined) => ConstructorDeclaration; 10312 /** @deprecated Use `factory.createGetAccessorDeclaration` or the factory supplied by your transformation context instead. */ 10313 const createGetAccessor: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => GetAccessorDeclaration; 10314 /** @deprecated Use `factory.updateGetAccessorDeclaration` or the factory supplied by your transformation context instead. */ 10315 const updateGetAccessor: (node: GetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => GetAccessorDeclaration; 10316 /** @deprecated Use `factory.createSetAccessorDeclaration` or the factory supplied by your transformation context instead. */ 10317 const createSetAccessor: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined) => SetAccessorDeclaration; 10318 /** @deprecated Use `factory.updateSetAccessorDeclaration` or the factory supplied by your transformation context instead. */ 10319 const updateSetAccessor: (node: SetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined) => SetAccessorDeclaration; 10320 /** @deprecated Use `factory.createCallSignature` or the factory supplied by your transformation context instead. */ 10321 const createCallSignature: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined) => CallSignatureDeclaration; 10322 /** @deprecated Use `factory.updateCallSignature` or the factory supplied by your transformation context instead. */ 10323 const updateCallSignature: (node: CallSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined) => CallSignatureDeclaration; 10324 /** @deprecated Use `factory.createConstructSignature` or the factory supplied by your transformation context instead. */ 10325 const createConstructSignature: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined) => ConstructSignatureDeclaration; 10326 /** @deprecated Use `factory.updateConstructSignature` or the factory supplied by your transformation context instead. */ 10327 const updateConstructSignature: (node: ConstructSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined) => ConstructSignatureDeclaration; 10328 /** @deprecated Use `factory.updateIndexSignature` or the factory supplied by your transformation context instead. */ 10329 const updateIndexSignature: (node: IndexSignatureDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => IndexSignatureDeclaration; 10330 /** @deprecated Use `factory.createKeywordTypeNode` or the factory supplied by your transformation context instead. */ 10331 const createKeywordTypeNode: <TKind extends KeywordTypeSyntaxKind>(kind: TKind) => KeywordTypeNode<TKind>; 10332 /** @deprecated Use `factory.createTypePredicateNode` or the factory supplied by your transformation context instead. */ 10333 const createTypePredicateNodeWithModifier: (assertsModifier: AssertsKeyword | undefined, parameterName: string | Identifier | ThisTypeNode, type: TypeNode | undefined) => TypePredicateNode; 10334 /** @deprecated Use `factory.updateTypePredicateNode` or the factory supplied by your transformation context instead. */ 10335 const updateTypePredicateNodeWithModifier: (node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined) => TypePredicateNode; 10336 /** @deprecated Use `factory.createTypeReferenceNode` or the factory supplied by your transformation context instead. */ 10337 const createTypeReferenceNode: (typeName: string | EntityName, typeArguments?: readonly TypeNode[] | undefined) => TypeReferenceNode; 10338 /** @deprecated Use `factory.updateTypeReferenceNode` or the factory supplied by your transformation context instead. */ 10339 const updateTypeReferenceNode: (node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray<TypeNode> | undefined) => TypeReferenceNode; 10340 /** @deprecated Use `factory.createFunctionTypeNode` or the factory supplied by your transformation context instead. */ 10341 const createFunctionTypeNode: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => FunctionTypeNode; 10342 /** @deprecated Use `factory.updateFunctionTypeNode` or the factory supplied by your transformation context instead. */ 10343 const updateFunctionTypeNode: (node: FunctionTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode) => FunctionTypeNode; 10344 /** @deprecated Use `factory.createConstructorTypeNode` or the factory supplied by your transformation context instead. */ 10345 const createConstructorTypeNode: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => ConstructorTypeNode; 10346 /** @deprecated Use `factory.updateConstructorTypeNode` or the factory supplied by your transformation context instead. */ 10347 const updateConstructorTypeNode: (node: ConstructorTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode) => ConstructorTypeNode; 10348 /** @deprecated Use `factory.createTypeQueryNode` or the factory supplied by your transformation context instead. */ 10349 const createTypeQueryNode: (exprName: EntityName) => TypeQueryNode; 10350 /** @deprecated Use `factory.updateTypeQueryNode` or the factory supplied by your transformation context instead. */ 10351 const updateTypeQueryNode: (node: TypeQueryNode, exprName: EntityName) => TypeQueryNode; 10352 /** @deprecated Use `factory.createTypeLiteralNode` or the factory supplied by your transformation context instead. */ 10353 const createTypeLiteralNode: (members: readonly TypeElement[] | undefined) => TypeLiteralNode; 10354 /** @deprecated Use `factory.updateTypeLiteralNode` or the factory supplied by your transformation context instead. */ 10355 const updateTypeLiteralNode: (node: TypeLiteralNode, members: NodeArray<TypeElement>) => TypeLiteralNode; 10356 /** @deprecated Use `factory.createArrayTypeNode` or the factory supplied by your transformation context instead. */ 10357 const createArrayTypeNode: (elementType: TypeNode) => ArrayTypeNode; 10358 /** @deprecated Use `factory.updateArrayTypeNode` or the factory supplied by your transformation context instead. */ 10359 const updateArrayTypeNode: (node: ArrayTypeNode, elementType: TypeNode) => ArrayTypeNode; 10360 /** @deprecated Use `factory.createTupleTypeNode` or the factory supplied by your transformation context instead. */ 10361 const createTupleTypeNode: (elements: readonly (TypeNode | NamedTupleMember)[]) => TupleTypeNode; 10362 /** @deprecated Use `factory.updateTupleTypeNode` or the factory supplied by your transformation context instead. */ 10363 const updateTupleTypeNode: (node: TupleTypeNode, elements: readonly (TypeNode | NamedTupleMember)[]) => TupleTypeNode; 10364 /** @deprecated Use `factory.createOptionalTypeNode` or the factory supplied by your transformation context instead. */ 10365 const createOptionalTypeNode: (type: TypeNode) => OptionalTypeNode; 10366 /** @deprecated Use `factory.updateOptionalTypeNode` or the factory supplied by your transformation context instead. */ 10367 const updateOptionalTypeNode: (node: OptionalTypeNode, type: TypeNode) => OptionalTypeNode; 10368 /** @deprecated Use `factory.createRestTypeNode` or the factory supplied by your transformation context instead. */ 10369 const createRestTypeNode: (type: TypeNode) => RestTypeNode; 10370 /** @deprecated Use `factory.updateRestTypeNode` or the factory supplied by your transformation context instead. */ 10371 const updateRestTypeNode: (node: RestTypeNode, type: TypeNode) => RestTypeNode; 10372 /** @deprecated Use `factory.createUnionTypeNode` or the factory supplied by your transformation context instead. */ 10373 const createUnionTypeNode: (types: readonly TypeNode[]) => UnionTypeNode; 10374 /** @deprecated Use `factory.updateUnionTypeNode` or the factory supplied by your transformation context instead. */ 10375 const updateUnionTypeNode: (node: UnionTypeNode, types: NodeArray<TypeNode>) => UnionTypeNode; 10376 /** @deprecated Use `factory.createIntersectionTypeNode` or the factory supplied by your transformation context instead. */ 10377 const createIntersectionTypeNode: (types: readonly TypeNode[]) => IntersectionTypeNode; 10378 /** @deprecated Use `factory.updateIntersectionTypeNode` or the factory supplied by your transformation context instead. */ 10379 const updateIntersectionTypeNode: (node: IntersectionTypeNode, types: NodeArray<TypeNode>) => IntersectionTypeNode; 10380 /** @deprecated Use `factory.createConditionalTypeNode` or the factory supplied by your transformation context instead. */ 10381 const createConditionalTypeNode: (checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode) => ConditionalTypeNode; 10382 /** @deprecated Use `factory.updateConditionalTypeNode` or the factory supplied by your transformation context instead. */ 10383 const updateConditionalTypeNode: (node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode) => ConditionalTypeNode; 10384 /** @deprecated Use `factory.createInferTypeNode` or the factory supplied by your transformation context instead. */ 10385 const createInferTypeNode: (typeParameter: TypeParameterDeclaration) => InferTypeNode; 10386 /** @deprecated Use `factory.updateInferTypeNode` or the factory supplied by your transformation context instead. */ 10387 const updateInferTypeNode: (node: InferTypeNode, typeParameter: TypeParameterDeclaration) => InferTypeNode; 10388 /** @deprecated Use `factory.createImportTypeNode` or the factory supplied by your transformation context instead. */ 10389 const createImportTypeNode: (argument: TypeNode, qualifier?: EntityName | undefined, typeArguments?: readonly TypeNode[] | undefined, isTypeOf?: boolean | undefined) => ImportTypeNode; 10390 /** @deprecated Use `factory.updateImportTypeNode` or the factory supplied by your transformation context instead. */ 10391 const updateImportTypeNode: (node: ImportTypeNode, argument: TypeNode, qualifier: EntityName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf?: boolean | undefined) => ImportTypeNode; 10392 /** @deprecated Use `factory.createParenthesizedType` or the factory supplied by your transformation context instead. */ 10393 const createParenthesizedType: (type: TypeNode) => ParenthesizedTypeNode; 10394 /** @deprecated Use `factory.updateParenthesizedType` or the factory supplied by your transformation context instead. */ 10395 const updateParenthesizedType: (node: ParenthesizedTypeNode, type: TypeNode) => ParenthesizedTypeNode; 10396 /** @deprecated Use `factory.createThisTypeNode` or the factory supplied by your transformation context instead. */ 10397 const createThisTypeNode: () => ThisTypeNode; 10398 /** @deprecated Use `factory.updateTypeOperatorNode` or the factory supplied by your transformation context instead. */ 10399 const updateTypeOperatorNode: (node: TypeOperatorNode, type: TypeNode) => TypeOperatorNode; 10400 /** @deprecated Use `factory.createIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */ 10401 const createIndexedAccessTypeNode: (objectType: TypeNode, indexType: TypeNode) => IndexedAccessTypeNode; 10402 /** @deprecated Use `factory.updateIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */ 10403 const updateIndexedAccessTypeNode: (node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode) => IndexedAccessTypeNode; 10404 /** @deprecated Use `factory.createMappedTypeNode` or the factory supplied by your transformation context instead. */ 10405 const createMappedTypeNode: (readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined) => MappedTypeNode; 10406 /** @deprecated Use `factory.updateMappedTypeNode` or the factory supplied by your transformation context instead. */ 10407 const updateMappedTypeNode: (node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined) => MappedTypeNode; 10408 /** @deprecated Use `factory.createLiteralTypeNode` or the factory supplied by your transformation context instead. */ 10409 const createLiteralTypeNode: (literal: LiteralExpression | BooleanLiteral | PrefixUnaryExpression | NullLiteral) => LiteralTypeNode; 10410 /** @deprecated Use `factory.updateLiteralTypeNode` or the factory supplied by your transformation context instead. */ 10411 const updateLiteralTypeNode: (node: LiteralTypeNode, literal: LiteralExpression | BooleanLiteral | PrefixUnaryExpression | NullLiteral) => LiteralTypeNode; 10412 /** @deprecated Use `factory.createObjectBindingPattern` or the factory supplied by your transformation context instead. */ 10413 const createObjectBindingPattern: (elements: readonly BindingElement[]) => ObjectBindingPattern; 10414 /** @deprecated Use `factory.updateObjectBindingPattern` or the factory supplied by your transformation context instead. */ 10415 const updateObjectBindingPattern: (node: ObjectBindingPattern, elements: readonly BindingElement[]) => ObjectBindingPattern; 10416 /** @deprecated Use `factory.createArrayBindingPattern` or the factory supplied by your transformation context instead. */ 10417 const createArrayBindingPattern: (elements: readonly ArrayBindingElement[]) => ArrayBindingPattern; 10418 /** @deprecated Use `factory.updateArrayBindingPattern` or the factory supplied by your transformation context instead. */ 10419 const updateArrayBindingPattern: (node: ArrayBindingPattern, elements: readonly ArrayBindingElement[]) => ArrayBindingPattern; 10420 /** @deprecated Use `factory.createBindingElement` or the factory supplied by your transformation context instead. */ 10421 const createBindingElement: (dotDotDotToken: DotDotDotToken | undefined, propertyName: string | PropertyName | undefined, name: string | BindingName, initializer?: Expression | undefined) => BindingElement; 10422 /** @deprecated Use `factory.updateBindingElement` or the factory supplied by your transformation context instead. */ 10423 const updateBindingElement: (node: BindingElement, dotDotDotToken: DotDotDotToken | undefined, propertyName: PropertyName | undefined, name: BindingName, initializer: Expression | undefined) => BindingElement; 10424 /** @deprecated Use `factory.createArrayLiteralExpression` or the factory supplied by your transformation context instead. */ 10425 const createArrayLiteral: (elements?: readonly Expression[] | undefined, multiLine?: boolean | undefined) => ArrayLiteralExpression; 10426 /** @deprecated Use `factory.updateArrayLiteralExpression` or the factory supplied by your transformation context instead. */ 10427 const updateArrayLiteral: (node: ArrayLiteralExpression, elements: readonly Expression[]) => ArrayLiteralExpression; 10428 /** @deprecated Use `factory.createObjectLiteralExpression` or the factory supplied by your transformation context instead. */ 10429 const createObjectLiteral: (properties?: readonly ObjectLiteralElementLike[] | undefined, multiLine?: boolean | undefined) => ObjectLiteralExpression; 10430 /** @deprecated Use `factory.updateObjectLiteralExpression` or the factory supplied by your transformation context instead. */ 10431 const updateObjectLiteral: (node: ObjectLiteralExpression, properties: readonly ObjectLiteralElementLike[]) => ObjectLiteralExpression; 10432 /** @deprecated Use `factory.createPropertyAccessExpression` or the factory supplied by your transformation context instead. */ 10433 const createPropertyAccess: (expression: Expression, name: string | Identifier | PrivateIdentifier) => PropertyAccessExpression; 10434 /** @deprecated Use `factory.updatePropertyAccessExpression` or the factory supplied by your transformation context instead. */ 10435 const updatePropertyAccess: (node: PropertyAccessExpression, expression: Expression, name: Identifier | PrivateIdentifier) => PropertyAccessExpression; 10436 /** @deprecated Use `factory.createPropertyAccessChain` or the factory supplied by your transformation context instead. */ 10437 const createPropertyAccessChain: (expression: Expression, questionDotToken: QuestionDotToken | undefined, name: string | Identifier | PrivateIdentifier) => PropertyAccessChain; 10438 /** @deprecated Use `factory.updatePropertyAccessChain` or the factory supplied by your transformation context instead. */ 10439 const updatePropertyAccessChain: (node: PropertyAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, name: Identifier | PrivateIdentifier) => PropertyAccessChain; 10440 /** @deprecated Use `factory.createElementAccessExpression` or the factory supplied by your transformation context instead. */ 10441 const createElementAccess: (expression: Expression, index: number | Expression) => ElementAccessExpression; 10442 /** @deprecated Use `factory.updateElementAccessExpression` or the factory supplied by your transformation context instead. */ 10443 const updateElementAccess: (node: ElementAccessExpression, expression: Expression, argumentExpression: Expression) => ElementAccessExpression; 10444 /** @deprecated Use `factory.createElementAccessChain` or the factory supplied by your transformation context instead. */ 10445 const createElementAccessChain: (expression: Expression, questionDotToken: QuestionDotToken | undefined, index: number | Expression) => ElementAccessChain; 10446 /** @deprecated Use `factory.updateElementAccessChain` or the factory supplied by your transformation context instead. */ 10447 const updateElementAccessChain: (node: ElementAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, argumentExpression: Expression) => ElementAccessChain; 10448 /** @deprecated Use `factory.createCallExpression` or the factory supplied by your transformation context instead. */ 10449 const createCall: (expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => CallExpression; 10450 /** @deprecated Use `factory.updateCallExpression` or the factory supplied by your transformation context instead. */ 10451 const updateCall: (node: CallExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]) => CallExpression; 10452 /** @deprecated Use `factory.createCallChain` or the factory supplied by your transformation context instead. */ 10453 const createCallChain: (expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => CallChain; 10454 /** @deprecated Use `factory.updateCallChain` or the factory supplied by your transformation context instead. */ 10455 const updateCallChain: (node: CallChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]) => CallChain; 10456 /** @deprecated Use `factory.createNewExpression` or the factory supplied by your transformation context instead. */ 10457 const createNew: (expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => NewExpression; 10458 /** @deprecated Use `factory.updateNewExpression` or the factory supplied by your transformation context instead. */ 10459 const updateNew: (node: NewExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => NewExpression; 10460 /** @deprecated Use `factory.createTypeAssertion` or the factory supplied by your transformation context instead. */ 10461 const createTypeAssertion: (type: TypeNode, expression: Expression) => TypeAssertion; 10462 /** @deprecated Use `factory.updateTypeAssertion` or the factory supplied by your transformation context instead. */ 10463 const updateTypeAssertion: (node: TypeAssertion, type: TypeNode, expression: Expression) => TypeAssertion; 10464 /** @deprecated Use `factory.createParenthesizedExpression` or the factory supplied by your transformation context instead. */ 10465 const createParen: (expression: Expression) => ParenthesizedExpression; 10466 /** @deprecated Use `factory.updateParenthesizedExpression` or the factory supplied by your transformation context instead. */ 10467 const updateParen: (node: ParenthesizedExpression, expression: Expression) => ParenthesizedExpression; 10468 /** @deprecated Use `factory.createFunctionExpression` or the factory supplied by your transformation context instead. */ 10469 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; 10470 /** @deprecated Use `factory.updateFunctionExpression` or the factory supplied by your transformation context instead. */ 10471 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; 10472 /** @deprecated Use `factory.createDeleteExpression` or the factory supplied by your transformation context instead. */ 10473 const createDelete: (expression: Expression) => DeleteExpression; 10474 /** @deprecated Use `factory.updateDeleteExpression` or the factory supplied by your transformation context instead. */ 10475 const updateDelete: (node: DeleteExpression, expression: Expression) => DeleteExpression; 10476 /** @deprecated Use `factory.createTypeOfExpression` or the factory supplied by your transformation context instead. */ 10477 const createTypeOf: (expression: Expression) => TypeOfExpression; 10478 /** @deprecated Use `factory.updateTypeOfExpression` or the factory supplied by your transformation context instead. */ 10479 const updateTypeOf: (node: TypeOfExpression, expression: Expression) => TypeOfExpression; 10480 /** @deprecated Use `factory.createVoidExpression` or the factory supplied by your transformation context instead. */ 10481 const createVoid: (expression: Expression) => VoidExpression; 10482 /** @deprecated Use `factory.updateVoidExpression` or the factory supplied by your transformation context instead. */ 10483 const updateVoid: (node: VoidExpression, expression: Expression) => VoidExpression; 10484 /** @deprecated Use `factory.createAwaitExpression` or the factory supplied by your transformation context instead. */ 10485 const createAwait: (expression: Expression) => AwaitExpression; 10486 /** @deprecated Use `factory.updateAwaitExpression` or the factory supplied by your transformation context instead. */ 10487 const updateAwait: (node: AwaitExpression, expression: Expression) => AwaitExpression; 10488 /** @deprecated Use `factory.createPrefixExpression` or the factory supplied by your transformation context instead. */ 10489 const createPrefix: (operator: PrefixUnaryOperator, operand: Expression) => PrefixUnaryExpression; 10490 /** @deprecated Use `factory.updatePrefixExpression` or the factory supplied by your transformation context instead. */ 10491 const updatePrefix: (node: PrefixUnaryExpression, operand: Expression) => PrefixUnaryExpression; 10492 /** @deprecated Use `factory.createPostfixUnaryExpression` or the factory supplied by your transformation context instead. */ 10493 const createPostfix: (operand: Expression, operator: PostfixUnaryOperator) => PostfixUnaryExpression; 10494 /** @deprecated Use `factory.updatePostfixUnaryExpression` or the factory supplied by your transformation context instead. */ 10495 const updatePostfix: (node: PostfixUnaryExpression, operand: Expression) => PostfixUnaryExpression; 10496 /** @deprecated Use `factory.createBinaryExpression` or the factory supplied by your transformation context instead. */ 10497 const createBinary: (left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression) => BinaryExpression; 10498 /** @deprecated Use `factory.updateConditionalExpression` or the factory supplied by your transformation context instead. */ 10499 const updateConditional: (node: ConditionalExpression, condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression) => ConditionalExpression; 10500 /** @deprecated Use `factory.createTemplateExpression` or the factory supplied by your transformation context instead. */ 10501 const createTemplateExpression: (head: TemplateHead, templateSpans: readonly TemplateSpan[]) => TemplateExpression; 10502 /** @deprecated Use `factory.updateTemplateExpression` or the factory supplied by your transformation context instead. */ 10503 const updateTemplateExpression: (node: TemplateExpression, head: TemplateHead, templateSpans: readonly TemplateSpan[]) => TemplateExpression; 10504 /** @deprecated Use `factory.createTemplateHead` or the factory supplied by your transformation context instead. */ 10505 const createTemplateHead: { 10506 (text: string, rawText?: string | undefined, templateFlags?: TokenFlags | undefined): TemplateHead; 10507 (text: string | undefined, rawText: string, templateFlags?: TokenFlags | undefined): TemplateHead; 10508 }; 10509 /** @deprecated Use `factory.createTemplateMiddle` or the factory supplied by your transformation context instead. */ 10510 const createTemplateMiddle: { 10511 (text: string, rawText?: string | undefined, templateFlags?: TokenFlags | undefined): TemplateMiddle; 10512 (text: string | undefined, rawText: string, templateFlags?: TokenFlags | undefined): TemplateMiddle; 10513 }; 10514 /** @deprecated Use `factory.createTemplateTail` or the factory supplied by your transformation context instead. */ 10515 const createTemplateTail: { 10516 (text: string, rawText?: string | undefined, templateFlags?: TokenFlags | undefined): TemplateTail; 10517 (text: string | undefined, rawText: string, templateFlags?: TokenFlags | undefined): TemplateTail; 10518 }; 10519 /** @deprecated Use `factory.createNoSubstitutionTemplateLiteral` or the factory supplied by your transformation context instead. */ 10520 const createNoSubstitutionTemplateLiteral: { 10521 (text: string, rawText?: string | undefined): NoSubstitutionTemplateLiteral; 10522 (text: string | undefined, rawText: string): NoSubstitutionTemplateLiteral; 10523 }; 10524 /** @deprecated Use `factory.updateYieldExpression` or the factory supplied by your transformation context instead. */ 10525 const updateYield: (node: YieldExpression, asteriskToken: AsteriskToken | undefined, expression: Expression | undefined) => YieldExpression; 10526 /** @deprecated Use `factory.createSpreadExpression` or the factory supplied by your transformation context instead. */ 10527 const createSpread: (expression: Expression) => SpreadElement; 10528 /** @deprecated Use `factory.updateSpreadExpression` or the factory supplied by your transformation context instead. */ 10529 const updateSpread: (node: SpreadElement, expression: Expression) => SpreadElement; 10530 /** @deprecated Use `factory.createOmittedExpression` or the factory supplied by your transformation context instead. */ 10531 const createOmittedExpression: () => OmittedExpression; 10532 /** @deprecated Use `factory.createAsExpression` or the factory supplied by your transformation context instead. */ 10533 const createAsExpression: (expression: Expression, type: TypeNode) => AsExpression; 10534 /** @deprecated Use `factory.updateAsExpression` or the factory supplied by your transformation context instead. */ 10535 const updateAsExpression: (node: AsExpression, expression: Expression, type: TypeNode) => AsExpression; 10536 /** @deprecated Use `factory.createNonNullExpression` or the factory supplied by your transformation context instead. */ 10537 const createNonNullExpression: (expression: Expression) => NonNullExpression; 10538 /** @deprecated Use `factory.updateNonNullExpression` or the factory supplied by your transformation context instead. */ 10539 const updateNonNullExpression: (node: NonNullExpression, expression: Expression) => NonNullExpression; 10540 /** @deprecated Use `factory.createNonNullChain` or the factory supplied by your transformation context instead. */ 10541 const createNonNullChain: (expression: Expression) => NonNullChain; 10542 /** @deprecated Use `factory.updateNonNullChain` or the factory supplied by your transformation context instead. */ 10543 const updateNonNullChain: (node: NonNullChain, expression: Expression) => NonNullChain; 10544 /** @deprecated Use `factory.createMetaProperty` or the factory supplied by your transformation context instead. */ 10545 const createMetaProperty: (keywordToken: SyntaxKind.ImportKeyword | SyntaxKind.NewKeyword, name: Identifier) => MetaProperty; 10546 /** @deprecated Use `factory.updateMetaProperty` or the factory supplied by your transformation context instead. */ 10547 const updateMetaProperty: (node: MetaProperty, name: Identifier) => MetaProperty; 10548 /** @deprecated Use `factory.createTemplateSpan` or the factory supplied by your transformation context instead. */ 10549 const createTemplateSpan: (expression: Expression, literal: TemplateMiddle | TemplateTail) => TemplateSpan; 10550 /** @deprecated Use `factory.updateTemplateSpan` or the factory supplied by your transformation context instead. */ 10551 const updateTemplateSpan: (node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail) => TemplateSpan; 10552 /** @deprecated Use `factory.createSemicolonClassElement` or the factory supplied by your transformation context instead. */ 10553 const createSemicolonClassElement: () => SemicolonClassElement; 10554 /** @deprecated Use `factory.createBlock` or the factory supplied by your transformation context instead. */ 10555 const createBlock: (statements: readonly Statement[], multiLine?: boolean | undefined) => Block; 10556 /** @deprecated Use `factory.updateBlock` or the factory supplied by your transformation context instead. */ 10557 const updateBlock: (node: Block, statements: readonly Statement[]) => Block; 10558 /** @deprecated Use `factory.createVariableStatement` or the factory supplied by your transformation context instead. */ 10559 const createVariableStatement: (modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList | readonly VariableDeclaration[]) => VariableStatement; 10560 /** @deprecated Use `factory.updateVariableStatement` or the factory supplied by your transformation context instead. */ 10561 const updateVariableStatement: (node: VariableStatement, modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList) => VariableStatement; 10562 /** @deprecated Use `factory.createEmptyStatement` or the factory supplied by your transformation context instead. */ 10563 const createEmptyStatement: () => EmptyStatement; 10564 /** @deprecated Use `factory.createExpressionStatement` or the factory supplied by your transformation context instead. */ 10565 const createExpressionStatement: (expression: Expression) => ExpressionStatement; 10566 /** @deprecated Use `factory.updateExpressionStatement` or the factory supplied by your transformation context instead. */ 10567 const updateExpressionStatement: (node: ExpressionStatement, expression: Expression) => ExpressionStatement; 10568 /** @deprecated Use `factory.createExpressionStatement` or the factory supplied by your transformation context instead. */ 10569 const createStatement: (expression: Expression) => ExpressionStatement; 10570 /** @deprecated Use `factory.updateExpressionStatement` or the factory supplied by your transformation context instead. */ 10571 const updateStatement: (node: ExpressionStatement, expression: Expression) => ExpressionStatement; 10572 /** @deprecated Use `factory.createIfStatement` or the factory supplied by your transformation context instead. */ 10573 const createIf: (expression: Expression, thenStatement: Statement, elseStatement?: Statement | undefined) => IfStatement; 10574 /** @deprecated Use `factory.updateIfStatement` or the factory supplied by your transformation context instead. */ 10575 const updateIf: (node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement | undefined) => IfStatement; 10576 /** @deprecated Use `factory.createDoStatement` or the factory supplied by your transformation context instead. */ 10577 const createDo: (statement: Statement, expression: Expression) => DoStatement; 10578 /** @deprecated Use `factory.updateDoStatement` or the factory supplied by your transformation context instead. */ 10579 const updateDo: (node: DoStatement, statement: Statement, expression: Expression) => DoStatement; 10580 /** @deprecated Use `factory.createWhileStatement` or the factory supplied by your transformation context instead. */ 10581 const createWhile: (expression: Expression, statement: Statement) => WhileStatement; 10582 /** @deprecated Use `factory.updateWhileStatement` or the factory supplied by your transformation context instead. */ 10583 const updateWhile: (node: WhileStatement, expression: Expression, statement: Statement) => WhileStatement; 10584 /** @deprecated Use `factory.createForStatement` or the factory supplied by your transformation context instead. */ 10585 const createFor: (initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement) => ForStatement; 10586 /** @deprecated Use `factory.updateForStatement` or the factory supplied by your transformation context instead. */ 10587 const updateFor: (node: ForStatement, initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement) => ForStatement; 10588 /** @deprecated Use `factory.createForInStatement` or the factory supplied by your transformation context instead. */ 10589 const createForIn: (initializer: ForInitializer, expression: Expression, statement: Statement) => ForInStatement; 10590 /** @deprecated Use `factory.updateForInStatement` or the factory supplied by your transformation context instead. */ 10591 const updateForIn: (node: ForInStatement, initializer: ForInitializer, expression: Expression, statement: Statement) => ForInStatement; 10592 /** @deprecated Use `factory.createForOfStatement` or the factory supplied by your transformation context instead. */ 10593 const createForOf: (awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement) => ForOfStatement; 10594 /** @deprecated Use `factory.updateForOfStatement` or the factory supplied by your transformation context instead. */ 10595 const updateForOf: (node: ForOfStatement, awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement) => ForOfStatement; 10596 /** @deprecated Use `factory.createContinueStatement` or the factory supplied by your transformation context instead. */ 10597 const createContinue: (label?: string | Identifier | undefined) => ContinueStatement; 10598 /** @deprecated Use `factory.updateContinueStatement` or the factory supplied by your transformation context instead. */ 10599 const updateContinue: (node: ContinueStatement, label: Identifier | undefined) => ContinueStatement; 10600 /** @deprecated Use `factory.createBreakStatement` or the factory supplied by your transformation context instead. */ 10601 const createBreak: (label?: string | Identifier | undefined) => BreakStatement; 10602 /** @deprecated Use `factory.updateBreakStatement` or the factory supplied by your transformation context instead. */ 10603 const updateBreak: (node: BreakStatement, label: Identifier | undefined) => BreakStatement; 10604 /** @deprecated Use `factory.createReturnStatement` or the factory supplied by your transformation context instead. */ 10605 const createReturn: (expression?: Expression | undefined) => ReturnStatement; 10606 /** @deprecated Use `factory.updateReturnStatement` or the factory supplied by your transformation context instead. */ 10607 const updateReturn: (node: ReturnStatement, expression: Expression | undefined) => ReturnStatement; 10608 /** @deprecated Use `factory.createWithStatement` or the factory supplied by your transformation context instead. */ 10609 const createWith: (expression: Expression, statement: Statement) => WithStatement; 10610 /** @deprecated Use `factory.updateWithStatement` or the factory supplied by your transformation context instead. */ 10611 const updateWith: (node: WithStatement, expression: Expression, statement: Statement) => WithStatement; 10612 /** @deprecated Use `factory.createSwitchStatement` or the factory supplied by your transformation context instead. */ 10613 const createSwitch: (expression: Expression, caseBlock: CaseBlock) => SwitchStatement; 10614 /** @deprecated Use `factory.updateSwitchStatement` or the factory supplied by your transformation context instead. */ 10615 const updateSwitch: (node: SwitchStatement, expression: Expression, caseBlock: CaseBlock) => SwitchStatement; 10616 /** @deprecated Use `factory.createLabelStatement` or the factory supplied by your transformation context instead. */ 10617 const createLabel: (label: string | Identifier, statement: Statement) => LabeledStatement; 10618 /** @deprecated Use `factory.updateLabelStatement` or the factory supplied by your transformation context instead. */ 10619 const updateLabel: (node: LabeledStatement, label: Identifier, statement: Statement) => LabeledStatement; 10620 /** @deprecated Use `factory.createThrowStatement` or the factory supplied by your transformation context instead. */ 10621 const createThrow: (expression: Expression) => ThrowStatement; 10622 /** @deprecated Use `factory.updateThrowStatement` or the factory supplied by your transformation context instead. */ 10623 const updateThrow: (node: ThrowStatement, expression: Expression) => ThrowStatement; 10624 /** @deprecated Use `factory.createTryStatement` or the factory supplied by your transformation context instead. */ 10625 const createTry: (tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined) => TryStatement; 10626 /** @deprecated Use `factory.updateTryStatement` or the factory supplied by your transformation context instead. */ 10627 const updateTry: (node: TryStatement, tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined) => TryStatement; 10628 /** @deprecated Use `factory.createDebuggerStatement` or the factory supplied by your transformation context instead. */ 10629 const createDebuggerStatement: () => DebuggerStatement; 10630 /** @deprecated Use `factory.createVariableDeclarationList` or the factory supplied by your transformation context instead. */ 10631 const createVariableDeclarationList: (declarations: readonly VariableDeclaration[], flags?: NodeFlags | undefined) => VariableDeclarationList; 10632 /** @deprecated Use `factory.updateVariableDeclarationList` or the factory supplied by your transformation context instead. */ 10633 const updateVariableDeclarationList: (node: VariableDeclarationList, declarations: readonly VariableDeclaration[]) => VariableDeclarationList; 10634 /** @deprecated Use `factory.createFunctionDeclaration` or the factory supplied by your transformation context instead. */ 10635 const createFunctionDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => FunctionDeclaration; 10636 /** @deprecated Use `factory.updateFunctionDeclaration` or the factory supplied by your transformation context instead. */ 10637 const updateFunctionDeclaration: (node: FunctionDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => FunctionDeclaration; 10638 /** @deprecated Use `factory.createClassDeclaration` or the factory supplied by your transformation context instead. */ 10639 const createClassDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassDeclaration; 10640 /** @deprecated Use `factory.updateClassDeclaration` or the factory supplied by your transformation context instead. */ 10641 const updateClassDeclaration: (node: ClassDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassDeclaration; 10642 /** @deprecated Use `factory.createInterfaceDeclaration` or the factory supplied by your transformation context instead. */ 10643 const createInterfaceDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]) => InterfaceDeclaration; 10644 /** @deprecated Use `factory.updateInterfaceDeclaration` or the factory supplied by your transformation context instead. */ 10645 const updateInterfaceDeclaration: (node: InterfaceDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]) => InterfaceDeclaration; 10646 /** @deprecated Use `factory.createTypeAliasDeclaration` or the factory supplied by your transformation context instead. */ 10647 const createTypeAliasDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode) => TypeAliasDeclaration; 10648 /** @deprecated Use `factory.updateTypeAliasDeclaration` or the factory supplied by your transformation context instead. */ 10649 const updateTypeAliasDeclaration: (node: TypeAliasDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode) => TypeAliasDeclaration; 10650 /** @deprecated Use `factory.createEnumDeclaration` or the factory supplied by your transformation context instead. */ 10651 const createEnumDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]) => EnumDeclaration; 10652 /** @deprecated Use `factory.updateEnumDeclaration` or the factory supplied by your transformation context instead. */ 10653 const updateEnumDeclaration: (node: EnumDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]) => EnumDeclaration; 10654 /** @deprecated Use `factory.createModuleDeclaration` or the factory supplied by your transformation context instead. */ 10655 const createModuleDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags | undefined) => ModuleDeclaration; 10656 /** @deprecated Use `factory.updateModuleDeclaration` or the factory supplied by your transformation context instead. */ 10657 const updateModuleDeclaration: (node: ModuleDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined) => ModuleDeclaration; 10658 /** @deprecated Use `factory.createModuleBlock` or the factory supplied by your transformation context instead. */ 10659 const createModuleBlock: (statements: readonly Statement[]) => ModuleBlock; 10660 /** @deprecated Use `factory.updateModuleBlock` or the factory supplied by your transformation context instead. */ 10661 const updateModuleBlock: (node: ModuleBlock, statements: readonly Statement[]) => ModuleBlock; 10662 /** @deprecated Use `factory.createCaseBlock` or the factory supplied by your transformation context instead. */ 10663 const createCaseBlock: (clauses: readonly CaseOrDefaultClause[]) => CaseBlock; 10664 /** @deprecated Use `factory.updateCaseBlock` or the factory supplied by your transformation context instead. */ 10665 const updateCaseBlock: (node: CaseBlock, clauses: readonly CaseOrDefaultClause[]) => CaseBlock; 10666 /** @deprecated Use `factory.createNamespaceExportDeclaration` or the factory supplied by your transformation context instead. */ 10667 const createNamespaceExportDeclaration: (name: string | Identifier) => NamespaceExportDeclaration; 10668 /** @deprecated Use `factory.updateNamespaceExportDeclaration` or the factory supplied by your transformation context instead. */ 10669 const updateNamespaceExportDeclaration: (node: NamespaceExportDeclaration, name: Identifier) => NamespaceExportDeclaration; 10670 /** @deprecated Use `factory.createImportEqualsDeclaration` or the factory supplied by your transformation context instead. */ 10671 const createImportEqualsDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference) => ImportEqualsDeclaration; 10672 /** @deprecated Use `factory.updateImportEqualsDeclaration` or the factory supplied by your transformation context instead. */ 10673 const updateImportEqualsDeclaration: (node: ImportEqualsDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference) => ImportEqualsDeclaration; 10674 /** @deprecated Use `factory.createImportDeclaration` or the factory supplied by your transformation context instead. */ 10675 const createImportDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression) => ImportDeclaration; 10676 /** @deprecated Use `factory.updateImportDeclaration` or the factory supplied by your transformation context instead. */ 10677 const updateImportDeclaration: (node: ImportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression) => ImportDeclaration; 10678 /** @deprecated Use `factory.createNamespaceImport` or the factory supplied by your transformation context instead. */ 10679 const createNamespaceImport: (name: Identifier) => NamespaceImport; 10680 /** @deprecated Use `factory.updateNamespaceImport` or the factory supplied by your transformation context instead. */ 10681 const updateNamespaceImport: (node: NamespaceImport, name: Identifier) => NamespaceImport; 10682 /** @deprecated Use `factory.createNamedImports` or the factory supplied by your transformation context instead. */ 10683 const createNamedImports: (elements: readonly ImportSpecifier[]) => NamedImports; 10684 /** @deprecated Use `factory.updateNamedImports` or the factory supplied by your transformation context instead. */ 10685 const updateNamedImports: (node: NamedImports, elements: readonly ImportSpecifier[]) => NamedImports; 10686 /** @deprecated Use `factory.createImportSpecifier` or the factory supplied by your transformation context instead. */ 10687 const createImportSpecifier: (propertyName: Identifier | undefined, name: Identifier) => ImportSpecifier; 10688 /** @deprecated Use `factory.updateImportSpecifier` or the factory supplied by your transformation context instead. */ 10689 const updateImportSpecifier: (node: ImportSpecifier, propertyName: Identifier | undefined, name: Identifier) => ImportSpecifier; 10690 /** @deprecated Use `factory.createExportAssignment` or the factory supplied by your transformation context instead. */ 10691 const createExportAssignment: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isExportEquals: boolean | undefined, expression: Expression) => ExportAssignment; 10692 /** @deprecated Use `factory.updateExportAssignment` or the factory supplied by your transformation context instead. */ 10693 const updateExportAssignment: (node: ExportAssignment, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, expression: Expression) => ExportAssignment; 10694 /** @deprecated Use `factory.createNamedExports` or the factory supplied by your transformation context instead. */ 10695 const createNamedExports: (elements: readonly ExportSpecifier[]) => NamedExports; 10696 /** @deprecated Use `factory.updateNamedExports` or the factory supplied by your transformation context instead. */ 10697 const updateNamedExports: (node: NamedExports, elements: readonly ExportSpecifier[]) => NamedExports; 10698 /** @deprecated Use `factory.createExportSpecifier` or the factory supplied by your transformation context instead. */ 10699 const createExportSpecifier: (propertyName: string | Identifier | undefined, name: string | Identifier) => ExportSpecifier; 10700 /** @deprecated Use `factory.updateExportSpecifier` or the factory supplied by your transformation context instead. */ 10701 const updateExportSpecifier: (node: ExportSpecifier, propertyName: Identifier | undefined, name: Identifier) => ExportSpecifier; 10702 /** @deprecated Use `factory.createExternalModuleReference` or the factory supplied by your transformation context instead. */ 10703 const createExternalModuleReference: (expression: Expression) => ExternalModuleReference; 10704 /** @deprecated Use `factory.updateExternalModuleReference` or the factory supplied by your transformation context instead. */ 10705 const updateExternalModuleReference: (node: ExternalModuleReference, expression: Expression) => ExternalModuleReference; 10706 /** @deprecated Use `factory.createJSDocTypeExpression` or the factory supplied by your transformation context instead. */ 10707 const createJSDocTypeExpression: (type: TypeNode) => JSDocTypeExpression; 10708 /** @deprecated Use `factory.createJSDocTypeTag` or the factory supplied by your transformation context instead. */ 10709 const createJSDocTypeTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | undefined) => JSDocTypeTag; 10710 /** @deprecated Use `factory.createJSDocReturnTag` or the factory supplied by your transformation context instead. */ 10711 const createJSDocReturnTag: (tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression | undefined, comment?: string | undefined) => JSDocReturnTag; 10712 /** @deprecated Use `factory.createJSDocThisTag` or the factory supplied by your transformation context instead. */ 10713 const createJSDocThisTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | undefined) => JSDocThisTag; 10714 /** @deprecated Use `factory.createJSDocComment` or the factory supplied by your transformation context instead. */ 10715 const createJSDocComment: (comment?: string | undefined, tags?: readonly JSDocTag[] | undefined) => JSDoc; 10716 /** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */ 10717 const createJSDocParameterTag: (tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, isNameFirst?: boolean | undefined, comment?: string | undefined) => JSDocParameterTag; 10718 /** @deprecated Use `factory.createJSDocClassTag` or the factory supplied by your transformation context instead. */ 10719 const createJSDocClassTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocClassTag; 10720 /** @deprecated Use `factory.createJSDocAugmentsTag` or the factory supplied by your transformation context instead. */ 10721 const createJSDocAugmentsTag: (tagName: Identifier | undefined, className: ExpressionWithTypeArguments & { 10722 readonly expression: Identifier | PropertyAccessEntityNameExpression; 10723 }, comment?: string | undefined) => JSDocAugmentsTag; 10724 /** @deprecated Use `factory.createJSDocEnumTag` or the factory supplied by your transformation context instead. */ 10725 const createJSDocEnumTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | undefined) => JSDocEnumTag; 10726 /** @deprecated Use `factory.createJSDocTemplateTag` or the factory supplied by your transformation context instead. */ 10727 const createJSDocTemplateTag: (tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment?: string | undefined) => JSDocTemplateTag; 10728 /** @deprecated Use `factory.createJSDocTypedefTag` or the factory supplied by your transformation context instead. */ 10729 const createJSDocTypedefTag: (tagName: Identifier | undefined, typeExpression?: JSDocTypeLiteral | JSDocTypeExpression | undefined, fullName?: Identifier | JSDocNamespaceDeclaration | undefined, comment?: string | undefined) => JSDocTypedefTag; 10730 /** @deprecated Use `factory.createJSDocCallbackTag` or the factory supplied by your transformation context instead. */ 10731 const createJSDocCallbackTag: (tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName?: Identifier | JSDocNamespaceDeclaration | undefined, comment?: string | undefined) => JSDocCallbackTag; 10732 /** @deprecated Use `factory.createJSDocSignature` or the factory supplied by your transformation context instead. */ 10733 const createJSDocSignature: (typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type?: JSDocReturnTag | undefined) => JSDocSignature; 10734 /** @deprecated Use `factory.createJSDocPropertyTag` or the factory supplied by your transformation context instead. */ 10735 const createJSDocPropertyTag: (tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, isNameFirst?: boolean | undefined, comment?: string | undefined) => JSDocPropertyTag; 10736 /** @deprecated Use `factory.createJSDocTypeLiteral` or the factory supplied by your transformation context instead. */ 10737 const createJSDocTypeLiteral: (jsDocPropertyTags?: readonly JSDocPropertyLikeTag[] | undefined, isArrayType?: boolean | undefined) => JSDocTypeLiteral; 10738 /** @deprecated Use `factory.createJSDocImplementsTag` or the factory supplied by your transformation context instead. */ 10739 const createJSDocImplementsTag: (tagName: Identifier | undefined, className: ExpressionWithTypeArguments & { 10740 readonly expression: Identifier | PropertyAccessEntityNameExpression; 10741 }, comment?: string | undefined) => JSDocImplementsTag; 10742 /** @deprecated Use `factory.createJSDocAuthorTag` or the factory supplied by your transformation context instead. */ 10743 const createJSDocAuthorTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocAuthorTag; 10744 /** @deprecated Use `factory.createJSDocPublicTag` or the factory supplied by your transformation context instead. */ 10745 const createJSDocPublicTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocPublicTag; 10746 /** @deprecated Use `factory.createJSDocPrivateTag` or the factory supplied by your transformation context instead. */ 10747 const createJSDocPrivateTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocPrivateTag; 10748 /** @deprecated Use `factory.createJSDocProtectedTag` or the factory supplied by your transformation context instead. */ 10749 const createJSDocProtectedTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocProtectedTag; 10750 /** @deprecated Use `factory.createJSDocReadonlyTag` or the factory supplied by your transformation context instead. */ 10751 const createJSDocReadonlyTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocReadonlyTag; 10752 /** @deprecated Use `factory.createJSDocUnknownTag` or the factory supplied by your transformation context instead. */ 10753 const createJSDocTag: (tagName: Identifier, comment?: string | undefined) => JSDocUnknownTag; 10754 /** @deprecated Use `factory.createJsxElement` or the factory supplied by your transformation context instead. */ 10755 const createJsxElement: (openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement) => JsxElement; 10756 /** @deprecated Use `factory.updateJsxElement` or the factory supplied by your transformation context instead. */ 10757 const updateJsxElement: (node: JsxElement, openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement) => JsxElement; 10758 /** @deprecated Use `factory.createJsxSelfClosingElement` or the factory supplied by your transformation context instead. */ 10759 const createJsxSelfClosingElement: (tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxSelfClosingElement; 10760 /** @deprecated Use `factory.updateJsxSelfClosingElement` or the factory supplied by your transformation context instead. */ 10761 const updateJsxSelfClosingElement: (node: JsxSelfClosingElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxSelfClosingElement; 10762 /** @deprecated Use `factory.createJsxOpeningElement` or the factory supplied by your transformation context instead. */ 10763 const createJsxOpeningElement: (tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxOpeningElement; 10764 /** @deprecated Use `factory.updateJsxOpeningElement` or the factory supplied by your transformation context instead. */ 10765 const updateJsxOpeningElement: (node: JsxOpeningElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxOpeningElement; 10766 /** @deprecated Use `factory.createJsxClosingElement` or the factory supplied by your transformation context instead. */ 10767 const createJsxClosingElement: (tagName: JsxTagNameExpression) => JsxClosingElement; 10768 /** @deprecated Use `factory.updateJsxClosingElement` or the factory supplied by your transformation context instead. */ 10769 const updateJsxClosingElement: (node: JsxClosingElement, tagName: JsxTagNameExpression) => JsxClosingElement; 10770 /** @deprecated Use `factory.createJsxFragment` or the factory supplied by your transformation context instead. */ 10771 const createJsxFragment: (openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment) => JsxFragment; 10772 /** @deprecated Use `factory.createJsxText` or the factory supplied by your transformation context instead. */ 10773 const createJsxText: (text: string, containsOnlyTriviaWhiteSpaces?: boolean | undefined) => JsxText; 10774 /** @deprecated Use `factory.updateJsxText` or the factory supplied by your transformation context instead. */ 10775 const updateJsxText: (node: JsxText, text: string, containsOnlyTriviaWhiteSpaces?: boolean | undefined) => JsxText; 10776 /** @deprecated Use `factory.createJsxOpeningFragment` or the factory supplied by your transformation context instead. */ 10777 const createJsxOpeningFragment: () => JsxOpeningFragment; 10778 /** @deprecated Use `factory.createJsxJsxClosingFragment` or the factory supplied by your transformation context instead. */ 10779 const createJsxJsxClosingFragment: () => JsxClosingFragment; 10780 /** @deprecated Use `factory.updateJsxFragment` or the factory supplied by your transformation context instead. */ 10781 const updateJsxFragment: (node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment) => JsxFragment; 10782 /** @deprecated Use `factory.createJsxAttribute` or the factory supplied by your transformation context instead. */ 10783 const createJsxAttribute: (name: Identifier, initializer: StringLiteral | JsxExpression | undefined) => JsxAttribute; 10784 /** @deprecated Use `factory.updateJsxAttribute` or the factory supplied by your transformation context instead. */ 10785 const updateJsxAttribute: (node: JsxAttribute, name: Identifier, initializer: StringLiteral | JsxExpression | undefined) => JsxAttribute; 10786 /** @deprecated Use `factory.createJsxAttributes` or the factory supplied by your transformation context instead. */ 10787 const createJsxAttributes: (properties: readonly JsxAttributeLike[]) => JsxAttributes; 10788 /** @deprecated Use `factory.updateJsxAttributes` or the factory supplied by your transformation context instead. */ 10789 const updateJsxAttributes: (node: JsxAttributes, properties: readonly JsxAttributeLike[]) => JsxAttributes; 10790 /** @deprecated Use `factory.createJsxSpreadAttribute` or the factory supplied by your transformation context instead. */ 10791 const createJsxSpreadAttribute: (expression: Expression) => JsxSpreadAttribute; 10792 /** @deprecated Use `factory.updateJsxSpreadAttribute` or the factory supplied by your transformation context instead. */ 10793 const updateJsxSpreadAttribute: (node: JsxSpreadAttribute, expression: Expression) => JsxSpreadAttribute; 10794 /** @deprecated Use `factory.createJsxExpression` or the factory supplied by your transformation context instead. */ 10795 const createJsxExpression: (dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined) => JsxExpression; 10796 /** @deprecated Use `factory.updateJsxExpression` or the factory supplied by your transformation context instead. */ 10797 const updateJsxExpression: (node: JsxExpression, expression: Expression | undefined) => JsxExpression; 10798 /** @deprecated Use `factory.createCaseClause` or the factory supplied by your transformation context instead. */ 10799 const createCaseClause: (expression: Expression, statements: readonly Statement[]) => CaseClause; 10800 /** @deprecated Use `factory.updateCaseClause` or the factory supplied by your transformation context instead. */ 10801 const updateCaseClause: (node: CaseClause, expression: Expression, statements: readonly Statement[]) => CaseClause; 10802 /** @deprecated Use `factory.createDefaultClause` or the factory supplied by your transformation context instead. */ 10803 const createDefaultClause: (statements: readonly Statement[]) => DefaultClause; 10804 /** @deprecated Use `factory.updateDefaultClause` or the factory supplied by your transformation context instead. */ 10805 const updateDefaultClause: (node: DefaultClause, statements: readonly Statement[]) => DefaultClause; 10806 /** @deprecated Use `factory.createHeritageClause` or the factory supplied by your transformation context instead. */ 10807 const createHeritageClause: (token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword, types: readonly ExpressionWithTypeArguments[]) => HeritageClause; 10808 /** @deprecated Use `factory.updateHeritageClause` or the factory supplied by your transformation context instead. */ 10809 const updateHeritageClause: (node: HeritageClause, types: readonly ExpressionWithTypeArguments[]) => HeritageClause; 10810 /** @deprecated Use `factory.createCatchClause` or the factory supplied by your transformation context instead. */ 10811 const createCatchClause: (variableDeclaration: string | VariableDeclaration | undefined, block: Block) => CatchClause; 10812 /** @deprecated Use `factory.updateCatchClause` or the factory supplied by your transformation context instead. */ 10813 const updateCatchClause: (node: CatchClause, variableDeclaration: VariableDeclaration | undefined, block: Block) => CatchClause; 10814 /** @deprecated Use `factory.createPropertyAssignment` or the factory supplied by your transformation context instead. */ 10815 const createPropertyAssignment: (name: string | PropertyName, initializer: Expression) => PropertyAssignment; 10816 /** @deprecated Use `factory.updatePropertyAssignment` or the factory supplied by your transformation context instead. */ 10817 const updatePropertyAssignment: (node: PropertyAssignment, name: PropertyName, initializer: Expression) => PropertyAssignment; 10818 /** @deprecated Use `factory.createShorthandPropertyAssignment` or the factory supplied by your transformation context instead. */ 10819 const createShorthandPropertyAssignment: (name: string | Identifier, objectAssignmentInitializer?: Expression | undefined) => ShorthandPropertyAssignment; 10820 /** @deprecated Use `factory.updateShorthandPropertyAssignment` or the factory supplied by your transformation context instead. */ 10821 const updateShorthandPropertyAssignment: (node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression | undefined) => ShorthandPropertyAssignment; 10822 /** @deprecated Use `factory.createSpreadAssignment` or the factory supplied by your transformation context instead. */ 10823 const createSpreadAssignment: (expression: Expression) => SpreadAssignment; 10824 /** @deprecated Use `factory.updateSpreadAssignment` or the factory supplied by your transformation context instead. */ 10825 const updateSpreadAssignment: (node: SpreadAssignment, expression: Expression) => SpreadAssignment; 10826 /** @deprecated Use `factory.createEnumMember` or the factory supplied by your transformation context instead. */ 10827 const createEnumMember: (name: string | PropertyName, initializer?: Expression | undefined) => EnumMember; 10828 /** @deprecated Use `factory.updateEnumMember` or the factory supplied by your transformation context instead. */ 10829 const updateEnumMember: (node: EnumMember, name: PropertyName, initializer: Expression | undefined) => EnumMember; 10830 /** @deprecated Use `factory.updateSourceFile` or the factory supplied by your transformation context instead. */ 10831 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; 10832 /** @deprecated Use `factory.createNotEmittedStatement` or the factory supplied by your transformation context instead. */ 10833 const createNotEmittedStatement: (original: Node) => NotEmittedStatement; 10834 /** @deprecated Use `factory.createPartiallyEmittedExpression` or the factory supplied by your transformation context instead. */ 10835 const createPartiallyEmittedExpression: (expression: Expression, original?: Node | undefined) => PartiallyEmittedExpression; 10836 /** @deprecated Use `factory.updatePartiallyEmittedExpression` or the factory supplied by your transformation context instead. */ 10837 const updatePartiallyEmittedExpression: (node: PartiallyEmittedExpression, expression: Expression) => PartiallyEmittedExpression; 10838 /** @deprecated Use `factory.createCommaListExpression` or the factory supplied by your transformation context instead. */ 10839 const createCommaList: (elements: readonly Expression[]) => CommaListExpression; 10840 /** @deprecated Use `factory.updateCommaListExpression` or the factory supplied by your transformation context instead. */ 10841 const updateCommaList: (node: CommaListExpression, elements: readonly Expression[]) => CommaListExpression; 10842 /** @deprecated Use `factory.createBundle` or the factory supplied by your transformation context instead. */ 10843 const createBundle: (sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[] | undefined) => Bundle; 10844 /** @deprecated Use `factory.updateBundle` or the factory supplied by your transformation context instead. */ 10845 const updateBundle: (node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[] | undefined) => Bundle; 10846 /** @deprecated Use `factory.createImmediatelyInvokedFunctionExpression` or the factory supplied by your transformation context instead. */ 10847 const createImmediatelyInvokedFunctionExpression: { 10848 (statements: readonly Statement[]): CallExpression; 10849 (statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression; 10850 }; 10851 /** @deprecated Use `factory.createImmediatelyInvokedArrowFunction` or the factory supplied by your transformation context instead. */ 10852 const createImmediatelyInvokedArrowFunction: { 10853 (statements: readonly Statement[]): CallExpression; 10854 (statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression; 10855 }; 10856 /** @deprecated Use `factory.createVoidZero` or the factory supplied by your transformation context instead. */ 10857 const createVoidZero: () => VoidExpression; 10858 /** @deprecated Use `factory.createExportDefault` or the factory supplied by your transformation context instead. */ 10859 const createExportDefault: (expression: Expression) => ExportAssignment; 10860 /** @deprecated Use `factory.createExternalModuleExport` or the factory supplied by your transformation context instead. */ 10861 const createExternalModuleExport: (exportName: Identifier) => ExportDeclaration; 10862 /** @deprecated Use `factory.createNamespaceExport` or the factory supplied by your transformation context instead. */ 10863 const createNamespaceExport: (name: Identifier) => NamespaceExport; 10864 /** @deprecated Use `factory.updateNamespaceExport` or the factory supplied by your transformation context instead. */ 10865 const updateNamespaceExport: (node: NamespaceExport, name: Identifier) => NamespaceExport; 10866 /** @deprecated Use `factory.createToken` or the factory supplied by your transformation context instead. */ 10867 const createToken: <TKind extends SyntaxKind>(kind: TKind) => Token<TKind>; 10868 /** @deprecated Use `factory.createIdentifier` or the factory supplied by your transformation context instead. */ 10869 const createIdentifier: (text: string) => Identifier; 10870 /** @deprecated Use `factory.createTempVariable` or the factory supplied by your transformation context instead. */ 10871 const createTempVariable: (recordTempVariable: ((node: Identifier) => void) | undefined) => Identifier; 10872 /** @deprecated Use `factory.getGeneratedNameForNode` or the factory supplied by your transformation context instead. */ 10873 const getGeneratedNameForNode: (node: Node | undefined) => Identifier; 10874 /** @deprecated Use `factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic)` or the factory supplied by your transformation context instead. */ 10875 const createOptimisticUniqueName: (text: string) => Identifier; 10876 /** @deprecated Use `factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic | GeneratedIdentifierFlags.FileLevel)` or the factory supplied by your transformation context instead. */ 10877 const createFileLevelUniqueName: (text: string) => Identifier; 10878 /** @deprecated Use `factory.createIndexSignature` or the factory supplied by your transformation context instead. */ 10879 const createIndexSignature: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => IndexSignatureDeclaration; 10880 /** @deprecated Use `factory.createTypePredicateNode` or the factory supplied by your transformation context instead. */ 10881 const createTypePredicateNode: (parameterName: Identifier | ThisTypeNode | string, type: TypeNode) => TypePredicateNode; 10882 /** @deprecated Use `factory.updateTypePredicateNode` or the factory supplied by your transformation context instead. */ 10883 const updateTypePredicateNode: (node: TypePredicateNode, parameterName: Identifier | ThisTypeNode, type: TypeNode) => TypePredicateNode; 10884 /** @deprecated Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead. */ 10885 const createLiteral: { 10886 (value: string | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier): StringLiteral; 10887 (value: number | PseudoBigInt): NumericLiteral; 10888 (value: boolean): BooleanLiteral; 10889 (value: string | number | PseudoBigInt | boolean): PrimaryExpression; 10890 }; 10891 /** @deprecated Use `factory.createMethodSignature` or the factory supplied by your transformation context instead. */ 10892 const createMethodSignature: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined) => MethodSignature; 10893 /** @deprecated Use `factory.updateMethodSignature` or the factory supplied by your transformation context instead. */ 10894 const updateMethodSignature: (node: MethodSignature, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined, name: PropertyName, questionToken: QuestionToken | undefined) => MethodSignature; 10895 /** @deprecated Use `factory.createTypeOperatorNode` or the factory supplied by your transformation context instead. */ 10896 const createTypeOperatorNode: { 10897 (type: TypeNode): TypeOperatorNode; 10898 (operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode; 10899 }; 10900 /** @deprecated Use `factory.createTaggedTemplate` or the factory supplied by your transformation context instead. */ 10901 const createTaggedTemplate: { 10902 (tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; 10903 (tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression; 10904 }; 10905 /** @deprecated Use `factory.updateTaggedTemplate` or the factory supplied by your transformation context instead. */ 10906 const updateTaggedTemplate: { 10907 (node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; 10908 (node: TaggedTemplateExpression, tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression; 10909 }; 10910 /** @deprecated Use `factory.updateBinary` or the factory supplied by your transformation context instead. */ 10911 const updateBinary: (node: BinaryExpression, left: Expression, right: Expression, operator?: BinaryOperator | BinaryOperatorToken) => BinaryExpression; 10912 /** @deprecated Use `factory.createConditional` or the factory supplied by your transformation context instead. */ 10913 const createConditional: { 10914 (condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; 10915 (condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression; 10916 }; 10917 /** @deprecated Use `factory.createYield` or the factory supplied by your transformation context instead. */ 10918 const createYield: { 10919 (expression?: Expression | undefined): YieldExpression; 10920 (asteriskToken: AsteriskToken | undefined, expression: Expression): YieldExpression; 10921 }; 10922 /** @deprecated Use `factory.createClassExpression` or the factory supplied by your transformation context instead. */ 10923 const createClassExpression: (modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassExpression; 10924 /** @deprecated Use `factory.updateClassExpression` or the factory supplied by your transformation context instead. */ 10925 const updateClassExpression: (node: ClassExpression, modifiers: readonly Modifier[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassExpression; 10926 /** @deprecated Use `factory.createPropertySignature` or the factory supplied by your transformation context instead. */ 10927 const createPropertySignature: (modifiers: readonly Modifier[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer?: Expression | undefined) => PropertySignature; 10928 /** @deprecated Use `factory.updatePropertySignature` or the factory supplied by your transformation context instead. */ 10929 const updatePropertySignature: (node: PropertySignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined) => PropertySignature; 10930 /** @deprecated Use `factory.createExpressionWithTypeArguments` or the factory supplied by your transformation context instead. */ 10931 const createExpressionWithTypeArguments: (typeArguments: readonly TypeNode[] | undefined, expression: Expression) => ExpressionWithTypeArguments; 10932 /** @deprecated Use `factory.updateExpressionWithTypeArguments` or the factory supplied by your transformation context instead. */ 10933 const updateExpressionWithTypeArguments: (node: ExpressionWithTypeArguments, typeArguments: readonly TypeNode[] | undefined, expression: Expression) => ExpressionWithTypeArguments; 10934 /** @deprecated Use `factory.createArrowFunction` or the factory supplied by your transformation context instead. */ 10935 const createArrowFunction: { 10936 (modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction; 10937 (modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction; 10938 }; 10939 /** @deprecated Use `factory.updateArrowFunction` or the factory supplied by your transformation context instead. */ 10940 const updateArrowFunction: { 10941 (node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken, body: ConciseBody): ArrowFunction; 10942 (node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction; 10943 }; 10944 /** @deprecated Use `factory.createVariableDeclaration` or the factory supplied by your transformation context instead. */ 10945 const createVariableDeclaration: { 10946 (name: string | BindingName, type?: TypeNode | undefined, initializer?: Expression | undefined): VariableDeclaration; 10947 (name: string | BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration; 10948 }; 10949 /** @deprecated Use `factory.updateVariableDeclaration` or the factory supplied by your transformation context instead. */ 10950 const updateVariableDeclaration: { 10951 (node: VariableDeclaration, name: BindingName, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration; 10952 (node: VariableDeclaration, name: BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration; 10953 }; 10954 /** @deprecated Use `factory.createImportClause` or the factory supplied by your transformation context instead. */ 10955 const createImportClause: (name: Identifier | undefined, namedBindings: NamedImportBindings | undefined, isTypeOnly?: any) => ImportClause; 10956 /** @deprecated Use `factory.updateImportClause` or the factory supplied by your transformation context instead. */ 10957 const updateImportClause: (node: ImportClause, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined, isTypeOnly: boolean) => ImportClause; 10958 /** @deprecated Use `factory.createExportDeclaration` or the factory supplied by your transformation context instead. */ 10959 const createExportDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression | undefined, isTypeOnly?: any) => ExportDeclaration; 10960 /** @deprecated Use `factory.updateExportDeclaration` or the factory supplied by your transformation context instead. */ 10961 const updateExportDeclaration: (node: ExportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, isTypeOnly: boolean) => ExportDeclaration; 10962 /** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */ 10963 const createJSDocParamTag: (name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, comment?: string | undefined) => JSDocParameterTag; 10964 /** @deprecated Use `factory.createComma` or the factory supplied by your transformation context instead. */ 10965 const createComma: (left: Expression, right: Expression) => Expression; 10966 /** @deprecated Use `factory.createLessThan` or the factory supplied by your transformation context instead. */ 10967 const createLessThan: (left: Expression, right: Expression) => Expression; 10968 /** @deprecated Use `factory.createAssignment` or the factory supplied by your transformation context instead. */ 10969 const createAssignment: (left: Expression, right: Expression) => BinaryExpression; 10970 /** @deprecated Use `factory.createStrictEquality` or the factory supplied by your transformation context instead. */ 10971 const createStrictEquality: (left: Expression, right: Expression) => BinaryExpression; 10972 /** @deprecated Use `factory.createStrictInequality` or the factory supplied by your transformation context instead. */ 10973 const createStrictInequality: (left: Expression, right: Expression) => BinaryExpression; 10974 /** @deprecated Use `factory.createAdd` or the factory supplied by your transformation context instead. */ 10975 const createAdd: (left: Expression, right: Expression) => BinaryExpression; 10976 /** @deprecated Use `factory.createSubtract` or the factory supplied by your transformation context instead. */ 10977 const createSubtract: (left: Expression, right: Expression) => BinaryExpression; 10978 /** @deprecated Use `factory.createLogicalAnd` or the factory supplied by your transformation context instead. */ 10979 const createLogicalAnd: (left: Expression, right: Expression) => BinaryExpression; 10980 /** @deprecated Use `factory.createLogicalOr` or the factory supplied by your transformation context instead. */ 10981 const createLogicalOr: (left: Expression, right: Expression) => BinaryExpression; 10982 /** @deprecated Use `factory.createPostfixIncrement` or the factory supplied by your transformation context instead. */ 10983 const createPostfixIncrement: (operand: Expression) => PostfixUnaryExpression; 10984 /** @deprecated Use `factory.createLogicalNot` or the factory supplied by your transformation context instead. */ 10985 const createLogicalNot: (operand: Expression) => PrefixUnaryExpression; 10986 /** @deprecated Use an appropriate `factory` method instead. */ 10987 const createNode: (kind: SyntaxKind, pos?: any, end?: any) => Node; 10988 /** 10989 * Creates a shallow, memberwise clone of a node ~for mutation~ with its `pos`, `end`, and `parent` set. 10990 * 10991 * NOTE: It is unsafe to change any properties of a `Node` that relate to its AST children, as those changes won't be 10992 * captured with respect to transformations. 10993 * 10994 * @deprecated Use an appropriate `factory.update...` method instead, use `setCommentRange` or `setSourceMapRange`, and avoid setting `parent`. 10995 */ 10996 const getMutableClone: <T extends Node>(node: T) => T; 10997 /** @deprecated Use `isTypeAssertionExpression` instead. */ 10998 const isTypeAssertion: (node: Node) => node is TypeAssertion; 10999 /** 11000 * @deprecated Use `ts.ReadonlyESMap<K, V>` instead. 11001 */ 11002 interface ReadonlyMap<T> extends ReadonlyESMap<string, T> { 11003 } 11004 /** 11005 * @deprecated Use `ts.ESMap<K, V>` instead. 11006 */ 11007 interface Map<T> extends ESMap<string, T> { 11008 } 11009} 11010 11011export = ts; 11012export as namespace ts;