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