1 /*! *****************************************************************************
2 Copyright (c) Microsoft Corporation. All rights reserved.
3 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 this file except in compliance with the License. You may obtain a copy of the
5 License at http://www.apache.org/licenses/LICENSE-2.0
7 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8 KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9 WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10 MERCHANTABLITY OR NON-INFRINGEMENT.
12 See the Apache Version 2.0 License for specific language governing permissions
13 and limitations under the License.
14 ***************************************************************************** */
16 declare namespace ts {
17 const versionMajorMinor = "4.5";
18 /** The version of the TypeScript compiler release */
19 const version: string;
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.
25 interface MapLike<T> {
28 interface SortedReadonlyArray<T> extends ReadonlyArray<T> {
29 " __sortedArrayBrand": any;
31 interface SortedArray<T> extends Array<T> {
32 " __sortedArrayBrand": any;
34 /** Common read methods for ES6 Map/Set. */
35 interface ReadonlyCollection<K> {
36 readonly size: number;
40 /** Common write methods for ES6 Map/Set. */
41 interface Collection<K> extends ReadonlyCollection<K> {
42 delete(key: K): boolean;
45 /** ES6 Map interface, only read methods included. */
46 interface ReadonlyESMap<K, V> extends ReadonlyCollection<K> {
47 get(key: K): V | undefined;
48 values(): Iterator<V>;
49 entries(): Iterator<[K, V]>;
50 forEach(action: (value: V, key: K) => void): void;
53 * ES6 Map interface, only read methods included.
55 interface ReadonlyMap<T> extends ReadonlyESMap<string, T> {
57 /** ES6 Map interface. */
58 interface ESMap<K, V> extends ReadonlyESMap<K, V>, Collection<K> {
59 set(key: K, value: V): this;
64 interface Map<T> extends ESMap<string, T> {
66 /** ES6 Set interface, only read methods included. */
67 interface ReadonlySet<T> extends ReadonlyCollection<T> {
68 has(value: T): boolean;
69 values(): Iterator<T>;
70 entries(): Iterator<[T, T]>;
71 forEach(action: (value: T, key: T) => void): void;
73 /** ES6 Set interface. */
74 interface Set<T> extends ReadonlySet<T>, Collection<T> {
76 delete(value: T): boolean;
78 /** ES6 Iterator type. */
79 interface Iterator<T> {
88 /** Array that is only intended to be pushed to, never read. */
90 push(...values: T[]): void;
93 declare namespace ts {
94 export type Path = string & {
97 export interface TextRange {
101 export interface ReadonlyTextRange {
102 readonly pos: number;
103 readonly end: number;
105 export enum SyntaxKind {
108 SingleLineCommentTrivia = 2,
109 MultiLineCommentTrivia = 3,
111 WhitespaceTrivia = 5,
113 ConflictMarkerTrivia = 7,
118 JsxTextAllWhiteSpaces = 12,
119 RegularExpressionLiteral = 13,
120 NoSubstitutionTemplateLiteral = 14,
125 CloseBraceToken = 19,
127 CloseParenToken = 21,
128 OpenBracketToken = 22,
129 CloseBracketToken = 23,
134 QuestionDotToken = 28,
136 LessThanSlashToken = 30,
137 GreaterThanToken = 31,
138 LessThanEqualsToken = 32,
139 GreaterThanEqualsToken = 33,
140 EqualsEqualsToken = 34,
141 ExclamationEqualsToken = 35,
142 EqualsEqualsEqualsToken = 36,
143 ExclamationEqualsEqualsToken = 37,
144 EqualsGreaterThanToken = 38,
148 AsteriskAsteriskToken = 42,
152 MinusMinusToken = 46,
153 LessThanLessThanToken = 47,
154 GreaterThanGreaterThanToken = 48,
155 GreaterThanGreaterThanGreaterThanToken = 49,
159 ExclamationToken = 53,
161 AmpersandAmpersandToken = 55,
166 QuestionQuestionToken = 60,
167 /** Only the JSDoc scanner produces BacktickToken. The normal scanner produces NoSubstitutionTemplateLiteral and related kinds. */
169 /** Only the JSDoc scanner produces HashToken. The normal scanner produces PrivateIdentifier. */
172 PlusEqualsToken = 64,
173 MinusEqualsToken = 65,
174 AsteriskEqualsToken = 66,
175 AsteriskAsteriskEqualsToken = 67,
176 SlashEqualsToken = 68,
177 PercentEqualsToken = 69,
178 LessThanLessThanEqualsToken = 70,
179 GreaterThanGreaterThanEqualsToken = 71,
180 GreaterThanGreaterThanGreaterThanEqualsToken = 72,
181 AmpersandEqualsToken = 73,
183 BarBarEqualsToken = 75,
184 AmpersandAmpersandEqualsToken = 76,
185 QuestionQuestionEqualsToken = 77,
186 CaretEqualsToken = 78,
188 PrivateIdentifier = 80,
194 ContinueKeyword = 86,
195 DebuggerKeyword = 87,
206 FunctionKeyword = 98,
210 InstanceOfKeyword = 102,
225 ImplementsKeyword = 117,
226 InterfaceKeyword = 118,
228 PackageKeyword = 120,
229 PrivateKeyword = 121,
230 ProtectedKeyword = 122,
234 AbstractKeyword = 126,
236 AssertsKeyword = 128,
241 BooleanKeyword = 133,
242 ConstructorKeyword = 134,
243 DeclareKeyword = 135,
246 IntrinsicKeyword = 138,
250 NamespaceKeyword = 142,
252 ReadonlyKeyword = 144,
253 RequireKeyword = 145,
260 UndefinedKeyword = 152,
262 UnknownKeyword = 154,
266 OverrideKeyword = 158,
269 ComputedPropertyName = 161,
273 PropertySignature = 165,
274 PropertyDeclaration = 166,
275 MethodSignature = 167,
276 MethodDeclaration = 168,
277 ClassStaticBlockDeclaration = 169,
282 ConstructSignature = 174,
283 IndexSignature = 175,
287 ConstructorType = 179,
295 IntersectionType = 187,
296 ConditionalType = 188,
298 ParenthesizedType = 190,
301 IndexedAccessType = 193,
304 NamedTupleMember = 196,
305 TemplateLiteralType = 197,
306 TemplateLiteralTypeSpan = 198,
308 ObjectBindingPattern = 200,
309 ArrayBindingPattern = 201,
310 BindingElement = 202,
311 ArrayLiteralExpression = 203,
312 ObjectLiteralExpression = 204,
313 PropertyAccessExpression = 205,
314 ElementAccessExpression = 206,
315 CallExpression = 207,
317 TaggedTemplateExpression = 209,
318 TypeAssertionExpression = 210,
319 ParenthesizedExpression = 211,
320 FunctionExpression = 212,
322 DeleteExpression = 214,
323 TypeOfExpression = 215,
324 VoidExpression = 216,
325 AwaitExpression = 217,
326 PrefixUnaryExpression = 218,
327 PostfixUnaryExpression = 219,
328 BinaryExpression = 220,
329 ConditionalExpression = 221,
330 TemplateExpression = 222,
331 YieldExpression = 223,
333 ClassExpression = 225,
334 OmittedExpression = 226,
335 ExpressionWithTypeArguments = 227,
337 NonNullExpression = 229,
339 SyntheticExpression = 231,
341 SemicolonClassElement = 233,
343 EmptyStatement = 235,
344 VariableStatement = 236,
345 ExpressionStatement = 237,
348 WhileStatement = 240,
350 ForInStatement = 242,
351 ForOfStatement = 243,
352 ContinueStatement = 244,
353 BreakStatement = 245,
354 ReturnStatement = 246,
356 SwitchStatement = 248,
357 LabeledStatement = 249,
358 ThrowStatement = 250,
360 DebuggerStatement = 252,
361 VariableDeclaration = 253,
362 VariableDeclarationList = 254,
363 FunctionDeclaration = 255,
364 ClassDeclaration = 256,
365 InterfaceDeclaration = 257,
366 TypeAliasDeclaration = 258,
367 EnumDeclaration = 259,
368 ModuleDeclaration = 260,
371 NamespaceExportDeclaration = 263,
372 ImportEqualsDeclaration = 264,
373 ImportDeclaration = 265,
375 NamespaceImport = 267,
377 ImportSpecifier = 269,
378 ExportAssignment = 270,
379 ExportDeclaration = 271,
381 NamespaceExport = 273,
382 ExportSpecifier = 274,
383 MissingDeclaration = 275,
384 ExternalModuleReference = 276,
386 JsxSelfClosingElement = 278,
387 JsxOpeningElement = 279,
388 JsxClosingElement = 280,
390 JsxOpeningFragment = 282,
391 JsxClosingFragment = 283,
394 JsxSpreadAttribute = 286,
398 HeritageClause = 290,
402 PropertyAssignment = 294,
403 ShorthandPropertyAssignment = 295,
404 SpreadAssignment = 296,
406 UnparsedPrologue = 298,
407 UnparsedPrepend = 299,
409 UnparsedInternalText = 301,
410 UnparsedSyntheticReference = 302,
413 UnparsedSource = 305,
415 JSDocTypeExpression = 307,
416 JSDocNameReference = 308,
417 JSDocMemberName = 309,
419 JSDocUnknownType = 311,
420 JSDocNullableType = 312,
421 JSDocNonNullableType = 313,
422 JSDocOptionalType = 314,
423 JSDocFunctionType = 315,
424 JSDocVariadicType = 316,
425 JSDocNamepathType = 317,
428 JSDocTypeLiteral = 320,
429 JSDocSignature = 321,
432 JSDocLinkPlain = 324,
434 JSDocAugmentsTag = 326,
435 JSDocImplementsTag = 327,
436 JSDocAuthorTag = 328,
437 JSDocDeprecatedTag = 329,
439 JSDocPublicTag = 331,
440 JSDocPrivateTag = 332,
441 JSDocProtectedTag = 333,
442 JSDocReadonlyTag = 334,
443 JSDocOverrideTag = 335,
444 JSDocCallbackTag = 336,
446 JSDocParameterTag = 338,
447 JSDocReturnTag = 339,
450 JSDocTemplateTag = 342,
451 JSDocTypedefTag = 343,
453 JSDocPropertyTag = 345,
455 NotEmittedStatement = 347,
456 PartiallyEmittedExpression = 348,
457 CommaListExpression = 349,
458 MergeDeclarationMarker = 350,
459 EndOfDeclarationMarker = 351,
460 SyntheticReferenceExpression = 352,
462 FirstAssignment = 63,
464 FirstCompoundAssignment = 64,
465 LastCompoundAssignment = 78,
466 FirstReservedWord = 81,
467 LastReservedWord = 116,
470 FirstFutureReservedWord = 117,
471 LastFutureReservedWord = 125,
474 FirstPunctuation = 18,
475 LastPunctuation = 78,
478 FirstTriviaToken = 2,
480 FirstLiteralToken = 8,
481 LastLiteralToken = 14,
482 FirstTemplateToken = 14,
483 LastTemplateToken = 17,
484 FirstBinaryOperator = 29,
485 LastBinaryOperator = 78,
486 FirstStatement = 236,
489 FirstJSDocNode = 307,
491 FirstJSDocTagNode = 325,
492 LastJSDocTagNode = 345,
494 export type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia;
495 export type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral;
496 export type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail;
497 export type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken;
498 export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AssertKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword;
499 export type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.StaticKeyword;
500 export type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword;
501 export type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind;
502 export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken;
503 export type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.Unknown | KeywordSyntaxKind;
504 export enum NodeFlags {
514 HasImplicitReturn = 256,
515 HasExplicitReturn = 512,
516 GlobalAugmentation = 1024,
517 HasAsyncFunctions = 2048,
518 DisallowInContext = 4096,
520 DecoratorContext = 16384,
521 AwaitContext = 32768,
522 ThisNodeHasError = 65536,
523 JavaScriptFile = 131072,
524 ThisNodeOrAnySubNodesHasError = 262144,
525 HasAggregatedChildData = 524288,
529 ReachabilityCheckFlags = 768,
530 ReachabilityAndEmitFlags = 2816,
531 ContextFlags = 25358336,
532 TypeExcludesFlags = 40960,
534 export enum ModifierFlags {
547 HasComputedJSDocModifiers = 4096,
550 HasComputedFlags = 536870912,
551 AccessibilityModifier = 28,
552 ParameterPropertyModifier = 16476,
553 NonPublicAccessibilityModifier = 24,
554 TypeScriptModifier = 18654,
558 export enum JsxFlags {
560 /** An element from a named property of the JSX.IntrinsicElements interface */
561 IntrinsicNamedElement = 1,
562 /** An element inferred from the string index signature of the JSX.IntrinsicElements interface */
563 IntrinsicIndexedElement = 2,
566 export interface Node extends ReadonlyTextRange {
567 readonly kind: SyntaxKind;
568 readonly flags: NodeFlags;
569 readonly decorators?: NodeArray<Decorator>;
570 readonly modifiers?: ModifiersArray;
571 readonly parent: Node;
573 export interface JSDocContainer {
575 export type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | EndOfFileToken;
576 export type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType;
577 export type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
578 export type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
579 export type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertySignature | PropertyDeclaration | PropertyAssignment | EnumMember;
580 export interface NodeArray<T extends Node> extends ReadonlyArray<T>, ReadonlyTextRange {
581 readonly hasTrailingComma: boolean;
583 export interface Token<TKind extends SyntaxKind> extends Node {
584 readonly kind: TKind;
586 export type EndOfFileToken = Token<SyntaxKind.EndOfFileToken> & JSDocContainer;
587 export interface PunctuationToken<TKind extends PunctuationSyntaxKind> extends Token<TKind> {
589 export type DotToken = PunctuationToken<SyntaxKind.DotToken>;
590 export type DotDotDotToken = PunctuationToken<SyntaxKind.DotDotDotToken>;
591 export type QuestionToken = PunctuationToken<SyntaxKind.QuestionToken>;
592 export type ExclamationToken = PunctuationToken<SyntaxKind.ExclamationToken>;
593 export type ColonToken = PunctuationToken<SyntaxKind.ColonToken>;
594 export type EqualsToken = PunctuationToken<SyntaxKind.EqualsToken>;
595 export type AsteriskToken = PunctuationToken<SyntaxKind.AsteriskToken>;
596 export type EqualsGreaterThanToken = PunctuationToken<SyntaxKind.EqualsGreaterThanToken>;
597 export type PlusToken = PunctuationToken<SyntaxKind.PlusToken>;
598 export type MinusToken = PunctuationToken<SyntaxKind.MinusToken>;
599 export type QuestionDotToken = PunctuationToken<SyntaxKind.QuestionDotToken>;
600 export interface KeywordToken<TKind extends KeywordSyntaxKind> extends Token<TKind> {
602 export type AssertsKeyword = KeywordToken<SyntaxKind.AssertsKeyword>;
603 export type AssertKeyword = KeywordToken<SyntaxKind.AssertKeyword>;
604 export type AwaitKeyword = KeywordToken<SyntaxKind.AwaitKeyword>;
605 /** @deprecated Use `AwaitKeyword` instead. */
606 export type AwaitKeywordToken = AwaitKeyword;
607 /** @deprecated Use `AssertsKeyword` instead. */
608 export type AssertsToken = AssertsKeyword;
609 export interface ModifierToken<TKind extends ModifierSyntaxKind> extends KeywordToken<TKind> {
611 export type AbstractKeyword = ModifierToken<SyntaxKind.AbstractKeyword>;
612 export type AsyncKeyword = ModifierToken<SyntaxKind.AsyncKeyword>;
613 export type ConstKeyword = ModifierToken<SyntaxKind.ConstKeyword>;
614 export type DeclareKeyword = ModifierToken<SyntaxKind.DeclareKeyword>;
615 export type DefaultKeyword = ModifierToken<SyntaxKind.DefaultKeyword>;
616 export type ExportKeyword = ModifierToken<SyntaxKind.ExportKeyword>;
617 export type PrivateKeyword = ModifierToken<SyntaxKind.PrivateKeyword>;
618 export type ProtectedKeyword = ModifierToken<SyntaxKind.ProtectedKeyword>;
619 export type PublicKeyword = ModifierToken<SyntaxKind.PublicKeyword>;
620 export type ReadonlyKeyword = ModifierToken<SyntaxKind.ReadonlyKeyword>;
621 export type OverrideKeyword = ModifierToken<SyntaxKind.OverrideKeyword>;
622 export type StaticKeyword = ModifierToken<SyntaxKind.StaticKeyword>;
623 /** @deprecated Use `ReadonlyKeyword` instead. */
624 export type ReadonlyToken = ReadonlyKeyword;
625 export type Modifier = AbstractKeyword | AsyncKeyword | ConstKeyword | DeclareKeyword | DefaultKeyword | ExportKeyword | PrivateKeyword | ProtectedKeyword | PublicKeyword | OverrideKeyword | ReadonlyKeyword | StaticKeyword;
626 export type AccessibilityModifier = PublicKeyword | PrivateKeyword | ProtectedKeyword;
627 export type ParameterPropertyModifier = AccessibilityModifier | ReadonlyKeyword;
628 export type ClassMemberModifier = AccessibilityModifier | ReadonlyKeyword | StaticKeyword;
629 export type ModifiersArray = NodeArray<Modifier>;
630 export enum GeneratedIdentifierFlags {
632 ReservedInNestedScopes = 8,
635 AllowNameSubstitution = 64
637 export interface Identifier extends PrimaryExpression, Declaration {
638 readonly kind: SyntaxKind.Identifier;
640 * Prefer to use `id.unescapedText`. (Note: This is available only in services, not internally to the TypeScript compiler.)
641 * Text of identifier, but if the identifier begins with two underscores, this will begin with three.
643 readonly escapedText: __String;
644 readonly originalKeywordKind?: SyntaxKind;
645 isInJSDocNamespace?: boolean;
647 export interface TransientIdentifier extends Identifier {
648 resolvedSymbol: Symbol;
650 export interface QualifiedName extends Node {
651 readonly kind: SyntaxKind.QualifiedName;
652 readonly left: EntityName;
653 readonly right: Identifier;
655 export type EntityName = Identifier | QualifiedName;
656 export type PropertyName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier;
657 export type MemberName = Identifier | PrivateIdentifier;
658 export type DeclarationName = Identifier | PrivateIdentifier | StringLiteralLike | NumericLiteral | ComputedPropertyName | ElementAccessExpression | BindingPattern | EntityNameExpression;
659 export interface Declaration extends Node {
660 _declarationBrand: any;
662 export interface NamedDeclaration extends Declaration {
663 readonly name?: DeclarationName;
665 export interface DeclarationStatement extends NamedDeclaration, Statement {
666 readonly name?: Identifier | StringLiteral | NumericLiteral;
668 export interface ComputedPropertyName extends Node {
669 readonly kind: SyntaxKind.ComputedPropertyName;
670 readonly parent: Declaration;
671 readonly expression: Expression;
673 export interface PrivateIdentifier extends PrimaryExpression {
674 readonly kind: SyntaxKind.PrivateIdentifier;
675 readonly escapedText: __String;
677 export interface Decorator extends Node {
678 readonly kind: SyntaxKind.Decorator;
679 readonly parent: NamedDeclaration;
680 readonly expression: LeftHandSideExpression;
682 export interface TypeParameterDeclaration extends NamedDeclaration {
683 readonly kind: SyntaxKind.TypeParameter;
684 readonly parent: DeclarationWithTypeParameterChildren | InferTypeNode;
685 readonly name: Identifier;
686 /** Note: Consider calling `getEffectiveConstraintOfTypeParameter` */
687 readonly constraint?: TypeNode;
688 readonly default?: TypeNode;
689 expression?: Expression;
691 export interface SignatureDeclarationBase extends NamedDeclaration, JSDocContainer {
692 readonly kind: SignatureDeclaration["kind"];
693 readonly name?: PropertyName;
694 readonly typeParameters?: NodeArray<TypeParameterDeclaration>;
695 readonly parameters: NodeArray<ParameterDeclaration>;
696 readonly type?: TypeNode;
698 export type SignatureDeclaration = CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | AccessorDeclaration | FunctionExpression | ArrowFunction;
699 export interface CallSignatureDeclaration extends SignatureDeclarationBase, TypeElement {
700 readonly kind: SyntaxKind.CallSignature;
702 export interface ConstructSignatureDeclaration extends SignatureDeclarationBase, TypeElement {
703 readonly kind: SyntaxKind.ConstructSignature;
705 export type BindingName = Identifier | BindingPattern;
706 export interface VariableDeclaration extends NamedDeclaration, JSDocContainer {
707 readonly kind: SyntaxKind.VariableDeclaration;
708 readonly parent: VariableDeclarationList | CatchClause;
709 readonly name: BindingName;
710 readonly exclamationToken?: ExclamationToken;
711 readonly type?: TypeNode;
712 readonly initializer?: Expression;
714 export interface VariableDeclarationList extends Node {
715 readonly kind: SyntaxKind.VariableDeclarationList;
716 readonly parent: VariableStatement | ForStatement | ForOfStatement | ForInStatement;
717 readonly declarations: NodeArray<VariableDeclaration>;
719 export interface ParameterDeclaration extends NamedDeclaration, JSDocContainer {
720 readonly kind: SyntaxKind.Parameter;
721 readonly parent: SignatureDeclaration;
722 readonly dotDotDotToken?: DotDotDotToken;
723 readonly name: BindingName;
724 readonly questionToken?: QuestionToken;
725 readonly type?: TypeNode;
726 readonly initializer?: Expression;
728 export interface BindingElement extends NamedDeclaration {
729 readonly kind: SyntaxKind.BindingElement;
730 readonly parent: BindingPattern;
731 readonly propertyName?: PropertyName;
732 readonly dotDotDotToken?: DotDotDotToken;
733 readonly name: BindingName;
734 readonly initializer?: Expression;
736 export interface PropertySignature extends TypeElement, JSDocContainer {
737 readonly kind: SyntaxKind.PropertySignature;
738 readonly name: PropertyName;
739 readonly questionToken?: QuestionToken;
740 readonly type?: TypeNode;
741 initializer?: Expression;
743 export interface PropertyDeclaration extends ClassElement, JSDocContainer {
744 readonly kind: SyntaxKind.PropertyDeclaration;
745 readonly parent: ClassLikeDeclaration;
746 readonly name: PropertyName;
747 readonly questionToken?: QuestionToken;
748 readonly exclamationToken?: ExclamationToken;
749 readonly type?: TypeNode;
750 readonly initializer?: Expression;
752 export interface ObjectLiteralElement extends NamedDeclaration {
753 _objectLiteralBrand: any;
754 readonly name?: PropertyName;
756 /** Unlike ObjectLiteralElement, excludes JSXAttribute and JSXSpreadAttribute. */
757 export type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | MethodDeclaration | AccessorDeclaration;
758 export interface PropertyAssignment extends ObjectLiteralElement, JSDocContainer {
759 readonly kind: SyntaxKind.PropertyAssignment;
760 readonly parent: ObjectLiteralExpression;
761 readonly name: PropertyName;
762 readonly questionToken?: QuestionToken;
763 readonly exclamationToken?: ExclamationToken;
764 readonly initializer: Expression;
766 export interface ShorthandPropertyAssignment extends ObjectLiteralElement, JSDocContainer {
767 readonly kind: SyntaxKind.ShorthandPropertyAssignment;
768 readonly parent: ObjectLiteralExpression;
769 readonly name: Identifier;
770 readonly questionToken?: QuestionToken;
771 readonly exclamationToken?: ExclamationToken;
772 readonly equalsToken?: EqualsToken;
773 readonly objectAssignmentInitializer?: Expression;
775 export interface SpreadAssignment extends ObjectLiteralElement, JSDocContainer {
776 readonly kind: SyntaxKind.SpreadAssignment;
777 readonly parent: ObjectLiteralExpression;
778 readonly expression: Expression;
780 export type VariableLikeDeclaration = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | PropertyAssignment | PropertySignature | JsxAttribute | ShorthandPropertyAssignment | EnumMember | JSDocPropertyTag | JSDocParameterTag;
781 export interface PropertyLikeDeclaration extends NamedDeclaration {
782 readonly name: PropertyName;
784 export interface ObjectBindingPattern extends Node {
785 readonly kind: SyntaxKind.ObjectBindingPattern;
786 readonly parent: VariableDeclaration | ParameterDeclaration | BindingElement;
787 readonly elements: NodeArray<BindingElement>;
789 export interface ArrayBindingPattern extends Node {
790 readonly kind: SyntaxKind.ArrayBindingPattern;
791 readonly parent: VariableDeclaration | ParameterDeclaration | BindingElement;
792 readonly elements: NodeArray<ArrayBindingElement>;
794 export type BindingPattern = ObjectBindingPattern | ArrayBindingPattern;
795 export type ArrayBindingElement = BindingElement | OmittedExpression;
797 * Several node kinds share function-like features such as a signature,
798 * a name, and a body. These nodes should extend FunctionLikeDeclarationBase.
800 * - FunctionDeclaration
801 * - MethodDeclaration
802 * - AccessorDeclaration
804 export interface FunctionLikeDeclarationBase extends SignatureDeclarationBase {
805 _functionLikeDeclarationBrand: any;
806 readonly asteriskToken?: AsteriskToken;
807 readonly questionToken?: QuestionToken;
808 readonly exclamationToken?: ExclamationToken;
809 readonly body?: Block | Expression;
811 export type FunctionLikeDeclaration = FunctionDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ConstructorDeclaration | FunctionExpression | ArrowFunction;
812 /** @deprecated Use SignatureDeclaration */
813 export type FunctionLike = SignatureDeclaration;
814 export interface FunctionDeclaration extends FunctionLikeDeclarationBase, DeclarationStatement {
815 readonly kind: SyntaxKind.FunctionDeclaration;
816 readonly name?: Identifier;
817 readonly body?: FunctionBody;
819 export interface MethodSignature extends SignatureDeclarationBase, TypeElement {
820 readonly kind: SyntaxKind.MethodSignature;
821 readonly parent: ObjectTypeDeclaration;
822 readonly name: PropertyName;
824 export interface MethodDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer {
825 readonly kind: SyntaxKind.MethodDeclaration;
826 readonly parent: ClassLikeDeclaration | ObjectLiteralExpression;
827 readonly name: PropertyName;
828 readonly body?: FunctionBody;
830 export interface ConstructorDeclaration extends FunctionLikeDeclarationBase, ClassElement, JSDocContainer {
831 readonly kind: SyntaxKind.Constructor;
832 readonly parent: ClassLikeDeclaration;
833 readonly body?: FunctionBody;
835 /** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */
836 export interface SemicolonClassElement extends ClassElement {
837 readonly kind: SyntaxKind.SemicolonClassElement;
838 readonly parent: ClassLikeDeclaration;
840 export interface GetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, TypeElement, ObjectLiteralElement, JSDocContainer {
841 readonly kind: SyntaxKind.GetAccessor;
842 readonly parent: ClassLikeDeclaration | ObjectLiteralExpression | TypeLiteralNode | InterfaceDeclaration;
843 readonly name: PropertyName;
844 readonly body?: FunctionBody;
846 export interface SetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, TypeElement, ObjectLiteralElement, JSDocContainer {
847 readonly kind: SyntaxKind.SetAccessor;
848 readonly parent: ClassLikeDeclaration | ObjectLiteralExpression | TypeLiteralNode | InterfaceDeclaration;
849 readonly name: PropertyName;
850 readonly body?: FunctionBody;
852 export type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration;
853 export interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement {
854 readonly kind: SyntaxKind.IndexSignature;
855 readonly parent: ObjectTypeDeclaration;
856 readonly type: TypeNode;
858 export interface ClassStaticBlockDeclaration extends ClassElement, JSDocContainer {
859 readonly kind: SyntaxKind.ClassStaticBlockDeclaration;
860 readonly parent: ClassDeclaration | ClassExpression;
861 readonly body: Block;
863 export interface TypeNode extends Node {
866 export interface KeywordTypeNode<TKind extends KeywordTypeSyntaxKind = KeywordTypeSyntaxKind> extends KeywordToken<TKind>, TypeNode {
867 readonly kind: TKind;
869 export interface ImportTypeNode extends NodeWithTypeArguments {
870 readonly kind: SyntaxKind.ImportType;
871 readonly isTypeOf: boolean;
872 readonly argument: TypeNode;
873 readonly qualifier?: EntityName;
875 export interface ThisTypeNode extends TypeNode {
876 readonly kind: SyntaxKind.ThisType;
878 export type FunctionOrConstructorTypeNode = FunctionTypeNode | ConstructorTypeNode;
879 export interface FunctionOrConstructorTypeNodeBase extends TypeNode, SignatureDeclarationBase {
880 readonly kind: SyntaxKind.FunctionType | SyntaxKind.ConstructorType;
881 readonly type: TypeNode;
883 export interface FunctionTypeNode extends FunctionOrConstructorTypeNodeBase {
884 readonly kind: SyntaxKind.FunctionType;
886 export interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase {
887 readonly kind: SyntaxKind.ConstructorType;
889 export interface NodeWithTypeArguments extends TypeNode {
890 readonly typeArguments?: NodeArray<TypeNode>;
892 export type TypeReferenceType = TypeReferenceNode | ExpressionWithTypeArguments;
893 export interface TypeReferenceNode extends NodeWithTypeArguments {
894 readonly kind: SyntaxKind.TypeReference;
895 readonly typeName: EntityName;
897 export interface TypePredicateNode extends TypeNode {
898 readonly kind: SyntaxKind.TypePredicate;
899 readonly parent: SignatureDeclaration | JSDocTypeExpression;
900 readonly assertsModifier?: AssertsToken;
901 readonly parameterName: Identifier | ThisTypeNode;
902 readonly type?: TypeNode;
904 export interface TypeQueryNode extends TypeNode {
905 readonly kind: SyntaxKind.TypeQuery;
906 readonly exprName: EntityName;
908 export interface TypeLiteralNode extends TypeNode, Declaration {
909 readonly kind: SyntaxKind.TypeLiteral;
910 readonly members: NodeArray<TypeElement>;
912 export interface ArrayTypeNode extends TypeNode {
913 readonly kind: SyntaxKind.ArrayType;
914 readonly elementType: TypeNode;
916 export interface TupleTypeNode extends TypeNode {
917 readonly kind: SyntaxKind.TupleType;
918 readonly elements: NodeArray<TypeNode | NamedTupleMember>;
920 export interface NamedTupleMember extends TypeNode, JSDocContainer, Declaration {
921 readonly kind: SyntaxKind.NamedTupleMember;
922 readonly dotDotDotToken?: Token<SyntaxKind.DotDotDotToken>;
923 readonly name: Identifier;
924 readonly questionToken?: Token<SyntaxKind.QuestionToken>;
925 readonly type: TypeNode;
927 export interface OptionalTypeNode extends TypeNode {
928 readonly kind: SyntaxKind.OptionalType;
929 readonly type: TypeNode;
931 export interface RestTypeNode extends TypeNode {
932 readonly kind: SyntaxKind.RestType;
933 readonly type: TypeNode;
935 export type UnionOrIntersectionTypeNode = UnionTypeNode | IntersectionTypeNode;
936 export interface UnionTypeNode extends TypeNode {
937 readonly kind: SyntaxKind.UnionType;
938 readonly types: NodeArray<TypeNode>;
940 export interface IntersectionTypeNode extends TypeNode {
941 readonly kind: SyntaxKind.IntersectionType;
942 readonly types: NodeArray<TypeNode>;
944 export interface ConditionalTypeNode extends TypeNode {
945 readonly kind: SyntaxKind.ConditionalType;
946 readonly checkType: TypeNode;
947 readonly extendsType: TypeNode;
948 readonly trueType: TypeNode;
949 readonly falseType: TypeNode;
951 export interface InferTypeNode extends TypeNode {
952 readonly kind: SyntaxKind.InferType;
953 readonly typeParameter: TypeParameterDeclaration;
955 export interface ParenthesizedTypeNode extends TypeNode {
956 readonly kind: SyntaxKind.ParenthesizedType;
957 readonly type: TypeNode;
959 export interface TypeOperatorNode extends TypeNode {
960 readonly kind: SyntaxKind.TypeOperator;
961 readonly operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword;
962 readonly type: TypeNode;
964 export interface IndexedAccessTypeNode extends TypeNode {
965 readonly kind: SyntaxKind.IndexedAccessType;
966 readonly objectType: TypeNode;
967 readonly indexType: TypeNode;
969 export interface MappedTypeNode extends TypeNode, Declaration {
970 readonly kind: SyntaxKind.MappedType;
971 readonly readonlyToken?: ReadonlyToken | PlusToken | MinusToken;
972 readonly typeParameter: TypeParameterDeclaration;
973 readonly nameType?: TypeNode;
974 readonly questionToken?: QuestionToken | PlusToken | MinusToken;
975 readonly type?: TypeNode;
976 /** Used only to produce grammar errors */
977 readonly members?: NodeArray<TypeElement>;
979 export interface LiteralTypeNode extends TypeNode {
980 readonly kind: SyntaxKind.LiteralType;
981 readonly literal: NullLiteral | BooleanLiteral | LiteralExpression | PrefixUnaryExpression;
983 export interface StringLiteral extends LiteralExpression, Declaration {
984 readonly kind: SyntaxKind.StringLiteral;
986 export type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral;
987 export type PropertyNameLiteral = Identifier | StringLiteralLike | NumericLiteral;
988 export interface TemplateLiteralTypeNode extends TypeNode {
989 kind: SyntaxKind.TemplateLiteralType;
990 readonly head: TemplateHead;
991 readonly templateSpans: NodeArray<TemplateLiteralTypeSpan>;
993 export interface TemplateLiteralTypeSpan extends TypeNode {
994 readonly kind: SyntaxKind.TemplateLiteralTypeSpan;
995 readonly parent: TemplateLiteralTypeNode;
996 readonly type: TypeNode;
997 readonly literal: TemplateMiddle | TemplateTail;
999 export interface Expression extends Node {
1000 _expressionBrand: any;
1002 export interface OmittedExpression extends Expression {
1003 readonly kind: SyntaxKind.OmittedExpression;
1005 export interface PartiallyEmittedExpression extends LeftHandSideExpression {
1006 readonly kind: SyntaxKind.PartiallyEmittedExpression;
1007 readonly expression: Expression;
1009 export interface UnaryExpression extends Expression {
1010 _unaryExpressionBrand: any;
1012 /** Deprecated, please use UpdateExpression */
1013 export type IncrementExpression = UpdateExpression;
1014 export interface UpdateExpression extends UnaryExpression {
1015 _updateExpressionBrand: any;
1017 export type PrefixUnaryOperator = SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.TildeToken | SyntaxKind.ExclamationToken;
1018 export interface PrefixUnaryExpression extends UpdateExpression {
1019 readonly kind: SyntaxKind.PrefixUnaryExpression;
1020 readonly operator: PrefixUnaryOperator;
1021 readonly operand: UnaryExpression;
1023 export type PostfixUnaryOperator = SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken;
1024 export interface PostfixUnaryExpression extends UpdateExpression {
1025 readonly kind: SyntaxKind.PostfixUnaryExpression;
1026 readonly operand: LeftHandSideExpression;
1027 readonly operator: PostfixUnaryOperator;
1029 export interface LeftHandSideExpression extends UpdateExpression {
1030 _leftHandSideExpressionBrand: any;
1032 export interface MemberExpression extends LeftHandSideExpression {
1033 _memberExpressionBrand: any;
1035 export interface PrimaryExpression extends MemberExpression {
1036 _primaryExpressionBrand: any;
1038 export interface NullLiteral extends PrimaryExpression {
1039 readonly kind: SyntaxKind.NullKeyword;
1041 export interface TrueLiteral extends PrimaryExpression {
1042 readonly kind: SyntaxKind.TrueKeyword;
1044 export interface FalseLiteral extends PrimaryExpression {
1045 readonly kind: SyntaxKind.FalseKeyword;
1047 export type BooleanLiteral = TrueLiteral | FalseLiteral;
1048 export interface ThisExpression extends PrimaryExpression {
1049 readonly kind: SyntaxKind.ThisKeyword;
1051 export interface SuperExpression extends PrimaryExpression {
1052 readonly kind: SyntaxKind.SuperKeyword;
1054 export interface ImportExpression extends PrimaryExpression {
1055 readonly kind: SyntaxKind.ImportKeyword;
1057 export interface DeleteExpression extends UnaryExpression {
1058 readonly kind: SyntaxKind.DeleteExpression;
1059 readonly expression: UnaryExpression;
1061 export interface TypeOfExpression extends UnaryExpression {
1062 readonly kind: SyntaxKind.TypeOfExpression;
1063 readonly expression: UnaryExpression;
1065 export interface VoidExpression extends UnaryExpression {
1066 readonly kind: SyntaxKind.VoidExpression;
1067 readonly expression: UnaryExpression;
1069 export interface AwaitExpression extends UnaryExpression {
1070 readonly kind: SyntaxKind.AwaitExpression;
1071 readonly expression: UnaryExpression;
1073 export interface YieldExpression extends Expression {
1074 readonly kind: SyntaxKind.YieldExpression;
1075 readonly asteriskToken?: AsteriskToken;
1076 readonly expression?: Expression;
1078 export interface SyntheticExpression extends Expression {
1079 readonly kind: SyntaxKind.SyntheticExpression;
1080 readonly isSpread: boolean;
1081 readonly type: Type;
1082 readonly tupleNameSource?: ParameterDeclaration | NamedTupleMember;
1084 export type ExponentiationOperator = SyntaxKind.AsteriskAsteriskToken;
1085 export type MultiplicativeOperator = SyntaxKind.AsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken;
1086 export type MultiplicativeOperatorOrHigher = ExponentiationOperator | MultiplicativeOperator;
1087 export type AdditiveOperator = SyntaxKind.PlusToken | SyntaxKind.MinusToken;
1088 export type AdditiveOperatorOrHigher = MultiplicativeOperatorOrHigher | AdditiveOperator;
1089 export type ShiftOperator = SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken;
1090 export type ShiftOperatorOrHigher = AdditiveOperatorOrHigher | ShiftOperator;
1091 export type RelationalOperator = SyntaxKind.LessThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.InstanceOfKeyword | SyntaxKind.InKeyword;
1092 export type RelationalOperatorOrHigher = ShiftOperatorOrHigher | RelationalOperator;
1093 export type EqualityOperator = SyntaxKind.EqualsEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.ExclamationEqualsToken;
1094 export type EqualityOperatorOrHigher = RelationalOperatorOrHigher | EqualityOperator;
1095 export type BitwiseOperator = SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken;
1096 export type BitwiseOperatorOrHigher = EqualityOperatorOrHigher | BitwiseOperator;
1097 export type LogicalOperator = SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken;
1098 export type LogicalOperatorOrHigher = BitwiseOperatorOrHigher | LogicalOperator;
1099 export type CompoundAssignmentOperator = SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.BarBarEqualsToken | SyntaxKind.AmpersandAmpersandEqualsToken | SyntaxKind.QuestionQuestionEqualsToken;
1100 export type AssignmentOperator = SyntaxKind.EqualsToken | CompoundAssignmentOperator;
1101 export type AssignmentOperatorOrHigher = SyntaxKind.QuestionQuestionToken | LogicalOperatorOrHigher | AssignmentOperator;
1102 export type BinaryOperator = AssignmentOperatorOrHigher | SyntaxKind.CommaToken;
1103 export type LogicalOrCoalescingAssignmentOperator = SyntaxKind.AmpersandAmpersandEqualsToken | SyntaxKind.BarBarEqualsToken | SyntaxKind.QuestionQuestionEqualsToken;
1104 export type BinaryOperatorToken = Token<BinaryOperator>;
1105 export interface BinaryExpression extends Expression, Declaration {
1106 readonly kind: SyntaxKind.BinaryExpression;
1107 readonly left: Expression;
1108 readonly operatorToken: BinaryOperatorToken;
1109 readonly right: Expression;
1111 export type AssignmentOperatorToken = Token<AssignmentOperator>;
1112 export interface AssignmentExpression<TOperator extends AssignmentOperatorToken> extends BinaryExpression {
1113 readonly left: LeftHandSideExpression;
1114 readonly operatorToken: TOperator;
1116 export interface ObjectDestructuringAssignment extends AssignmentExpression<EqualsToken> {
1117 readonly left: ObjectLiteralExpression;
1119 export interface ArrayDestructuringAssignment extends AssignmentExpression<EqualsToken> {
1120 readonly left: ArrayLiteralExpression;
1122 export type DestructuringAssignment = ObjectDestructuringAssignment | ArrayDestructuringAssignment;
1123 export type BindingOrAssignmentElement = VariableDeclaration | ParameterDeclaration | ObjectBindingOrAssignmentElement | ArrayBindingOrAssignmentElement;
1124 export type ObjectBindingOrAssignmentElement = BindingElement | PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment;
1125 export type ArrayBindingOrAssignmentElement = BindingElement | OmittedExpression | SpreadElement | ArrayLiteralExpression | ObjectLiteralExpression | AssignmentExpression<EqualsToken> | Identifier | PropertyAccessExpression | ElementAccessExpression;
1126 export type BindingOrAssignmentElementRestIndicator = DotDotDotToken | SpreadElement | SpreadAssignment;
1127 export type BindingOrAssignmentElementTarget = BindingOrAssignmentPattern | Identifier | PropertyAccessExpression | ElementAccessExpression | OmittedExpression;
1128 export type ObjectBindingOrAssignmentPattern = ObjectBindingPattern | ObjectLiteralExpression;
1129 export type ArrayBindingOrAssignmentPattern = ArrayBindingPattern | ArrayLiteralExpression;
1130 export type AssignmentPattern = ObjectLiteralExpression | ArrayLiteralExpression;
1131 export type BindingOrAssignmentPattern = ObjectBindingOrAssignmentPattern | ArrayBindingOrAssignmentPattern;
1132 export interface ConditionalExpression extends Expression {
1133 readonly kind: SyntaxKind.ConditionalExpression;
1134 readonly condition: Expression;
1135 readonly questionToken: QuestionToken;
1136 readonly whenTrue: Expression;
1137 readonly colonToken: ColonToken;
1138 readonly whenFalse: Expression;
1140 export type FunctionBody = Block;
1141 export type ConciseBody = FunctionBody | Expression;
1142 export interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclarationBase, JSDocContainer {
1143 readonly kind: SyntaxKind.FunctionExpression;
1144 readonly name?: Identifier;
1145 readonly body: FunctionBody;
1147 export interface ArrowFunction extends Expression, FunctionLikeDeclarationBase, JSDocContainer {
1148 readonly kind: SyntaxKind.ArrowFunction;
1149 readonly equalsGreaterThanToken: EqualsGreaterThanToken;
1150 readonly body: ConciseBody;
1151 readonly name: never;
1153 export interface LiteralLikeNode extends Node {
1155 isUnterminated?: boolean;
1156 hasExtendedUnicodeEscape?: boolean;
1158 export interface TemplateLiteralLikeNode extends LiteralLikeNode {
1161 export interface LiteralExpression extends LiteralLikeNode, PrimaryExpression {
1162 _literalExpressionBrand: any;
1164 export interface RegularExpressionLiteral extends LiteralExpression {
1165 readonly kind: SyntaxKind.RegularExpressionLiteral;
1167 export interface NoSubstitutionTemplateLiteral extends LiteralExpression, TemplateLiteralLikeNode, Declaration {
1168 readonly kind: SyntaxKind.NoSubstitutionTemplateLiteral;
1170 export enum TokenFlags {
1175 BinarySpecifier = 128,
1176 OctalSpecifier = 256,
1178 export interface NumericLiteral extends LiteralExpression, Declaration {
1179 readonly kind: SyntaxKind.NumericLiteral;
1181 export interface BigIntLiteral extends LiteralExpression {
1182 readonly kind: SyntaxKind.BigIntLiteral;
1184 export type LiteralToken = NumericLiteral | BigIntLiteral | StringLiteral | JsxText | RegularExpressionLiteral | NoSubstitutionTemplateLiteral;
1185 export interface TemplateHead extends TemplateLiteralLikeNode {
1186 readonly kind: SyntaxKind.TemplateHead;
1187 readonly parent: TemplateExpression | TemplateLiteralTypeNode;
1189 export interface TemplateMiddle extends TemplateLiteralLikeNode {
1190 readonly kind: SyntaxKind.TemplateMiddle;
1191 readonly parent: TemplateSpan | TemplateLiteralTypeSpan;
1193 export interface TemplateTail extends TemplateLiteralLikeNode {
1194 readonly kind: SyntaxKind.TemplateTail;
1195 readonly parent: TemplateSpan | TemplateLiteralTypeSpan;
1197 export type PseudoLiteralToken = TemplateHead | TemplateMiddle | TemplateTail;
1198 export type TemplateLiteralToken = NoSubstitutionTemplateLiteral | PseudoLiteralToken;
1199 export interface TemplateExpression extends PrimaryExpression {
1200 readonly kind: SyntaxKind.TemplateExpression;
1201 readonly head: TemplateHead;
1202 readonly templateSpans: NodeArray<TemplateSpan>;
1204 export type TemplateLiteral = TemplateExpression | NoSubstitutionTemplateLiteral;
1205 export interface TemplateSpan extends Node {
1206 readonly kind: SyntaxKind.TemplateSpan;
1207 readonly parent: TemplateExpression;
1208 readonly expression: Expression;
1209 readonly literal: TemplateMiddle | TemplateTail;
1211 export interface ParenthesizedExpression extends PrimaryExpression, JSDocContainer {
1212 readonly kind: SyntaxKind.ParenthesizedExpression;
1213 readonly expression: Expression;
1215 export interface ArrayLiteralExpression extends PrimaryExpression {
1216 readonly kind: SyntaxKind.ArrayLiteralExpression;
1217 readonly elements: NodeArray<Expression>;
1219 export interface SpreadElement extends Expression {
1220 readonly kind: SyntaxKind.SpreadElement;
1221 readonly parent: ArrayLiteralExpression | CallExpression | NewExpression;
1222 readonly expression: Expression;
1225 * This interface is a base interface for ObjectLiteralExpression and JSXAttributes to extend from. JSXAttributes is similar to
1226 * ObjectLiteralExpression in that it contains array of properties; however, JSXAttributes' properties can only be
1227 * JSXAttribute or JSXSpreadAttribute. ObjectLiteralExpression, on the other hand, can only have properties of type
1228 * ObjectLiteralElement (e.g. PropertyAssignment, ShorthandPropertyAssignment etc.)
1230 export interface ObjectLiteralExpressionBase<T extends ObjectLiteralElement> extends PrimaryExpression, Declaration {
1231 readonly properties: NodeArray<T>;
1233 export interface ObjectLiteralExpression extends ObjectLiteralExpressionBase<ObjectLiteralElementLike> {
1234 readonly kind: SyntaxKind.ObjectLiteralExpression;
1236 export type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression;
1237 export type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression;
1238 export type AccessExpression = PropertyAccessExpression | ElementAccessExpression;
1239 export interface PropertyAccessExpression extends MemberExpression, NamedDeclaration {
1240 readonly kind: SyntaxKind.PropertyAccessExpression;
1241 readonly expression: LeftHandSideExpression;
1242 readonly questionDotToken?: QuestionDotToken;
1243 readonly name: MemberName;
1245 export interface PropertyAccessChain extends PropertyAccessExpression {
1246 _optionalChainBrand: any;
1247 readonly name: MemberName;
1249 export interface SuperPropertyAccessExpression extends PropertyAccessExpression {
1250 readonly expression: SuperExpression;
1252 /** Brand for a PropertyAccessExpression which, like a QualifiedName, consists of a sequence of identifiers separated by dots. */
1253 export interface PropertyAccessEntityNameExpression extends PropertyAccessExpression {
1254 _propertyAccessExpressionLikeQualifiedNameBrand?: any;
1255 readonly expression: EntityNameExpression;
1256 readonly name: Identifier;
1258 export interface ElementAccessExpression extends MemberExpression {
1259 readonly kind: SyntaxKind.ElementAccessExpression;
1260 readonly expression: LeftHandSideExpression;
1261 readonly questionDotToken?: QuestionDotToken;
1262 readonly argumentExpression: Expression;
1264 export interface ElementAccessChain extends ElementAccessExpression {
1265 _optionalChainBrand: any;
1267 export interface SuperElementAccessExpression extends ElementAccessExpression {
1268 readonly expression: SuperExpression;
1270 export type SuperProperty = SuperPropertyAccessExpression | SuperElementAccessExpression;
1271 export interface CallExpression extends LeftHandSideExpression, Declaration {
1272 readonly kind: SyntaxKind.CallExpression;
1273 readonly expression: LeftHandSideExpression;
1274 readonly questionDotToken?: QuestionDotToken;
1275 readonly typeArguments?: NodeArray<TypeNode>;
1276 readonly arguments: NodeArray<Expression>;
1278 export interface CallChain extends CallExpression {
1279 _optionalChainBrand: any;
1281 export type OptionalChain = PropertyAccessChain | ElementAccessChain | CallChain | NonNullChain;
1282 export interface SuperCall extends CallExpression {
1283 readonly expression: SuperExpression;
1285 export interface ImportCall extends CallExpression {
1286 readonly expression: ImportExpression;
1288 export interface ExpressionWithTypeArguments extends NodeWithTypeArguments {
1289 readonly kind: SyntaxKind.ExpressionWithTypeArguments;
1290 readonly parent: HeritageClause | JSDocAugmentsTag | JSDocImplementsTag;
1291 readonly expression: LeftHandSideExpression;
1293 export interface NewExpression extends PrimaryExpression, Declaration {
1294 readonly kind: SyntaxKind.NewExpression;
1295 readonly expression: LeftHandSideExpression;
1296 readonly typeArguments?: NodeArray<TypeNode>;
1297 readonly arguments?: NodeArray<Expression>;
1299 export interface TaggedTemplateExpression extends MemberExpression {
1300 readonly kind: SyntaxKind.TaggedTemplateExpression;
1301 readonly tag: LeftHandSideExpression;
1302 readonly typeArguments?: NodeArray<TypeNode>;
1303 readonly template: TemplateLiteral;
1305 export type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression | Decorator | JsxOpeningLikeElement;
1306 export interface AsExpression extends Expression {
1307 readonly kind: SyntaxKind.AsExpression;
1308 readonly expression: Expression;
1309 readonly type: TypeNode;
1311 export interface TypeAssertion extends UnaryExpression {
1312 readonly kind: SyntaxKind.TypeAssertionExpression;
1313 readonly type: TypeNode;
1314 readonly expression: UnaryExpression;
1316 export type AssertionExpression = TypeAssertion | AsExpression;
1317 export interface NonNullExpression extends LeftHandSideExpression {
1318 readonly kind: SyntaxKind.NonNullExpression;
1319 readonly expression: Expression;
1321 export interface NonNullChain extends NonNullExpression {
1322 _optionalChainBrand: any;
1324 export interface MetaProperty extends PrimaryExpression {
1325 readonly kind: SyntaxKind.MetaProperty;
1326 readonly keywordToken: SyntaxKind.NewKeyword | SyntaxKind.ImportKeyword;
1327 readonly name: Identifier;
1329 export interface JsxElement extends PrimaryExpression {
1330 readonly kind: SyntaxKind.JsxElement;
1331 readonly openingElement: JsxOpeningElement;
1332 readonly children: NodeArray<JsxChild>;
1333 readonly closingElement: JsxClosingElement;
1335 export type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement;
1336 export type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute;
1337 export type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess;
1338 export interface JsxTagNamePropertyAccess extends PropertyAccessExpression {
1339 readonly expression: JsxTagNameExpression;
1341 export interface JsxAttributes extends ObjectLiteralExpressionBase<JsxAttributeLike> {
1342 readonly kind: SyntaxKind.JsxAttributes;
1343 readonly parent: JsxOpeningLikeElement;
1345 export interface JsxOpeningElement extends Expression {
1346 readonly kind: SyntaxKind.JsxOpeningElement;
1347 readonly parent: JsxElement;
1348 readonly tagName: JsxTagNameExpression;
1349 readonly typeArguments?: NodeArray<TypeNode>;
1350 readonly attributes: JsxAttributes;
1352 export interface JsxSelfClosingElement extends PrimaryExpression {
1353 readonly kind: SyntaxKind.JsxSelfClosingElement;
1354 readonly tagName: JsxTagNameExpression;
1355 readonly typeArguments?: NodeArray<TypeNode>;
1356 readonly attributes: JsxAttributes;
1358 export interface JsxFragment extends PrimaryExpression {
1359 readonly kind: SyntaxKind.JsxFragment;
1360 readonly openingFragment: JsxOpeningFragment;
1361 readonly children: NodeArray<JsxChild>;
1362 readonly closingFragment: JsxClosingFragment;
1364 export interface JsxOpeningFragment extends Expression {
1365 readonly kind: SyntaxKind.JsxOpeningFragment;
1366 readonly parent: JsxFragment;
1368 export interface JsxClosingFragment extends Expression {
1369 readonly kind: SyntaxKind.JsxClosingFragment;
1370 readonly parent: JsxFragment;
1372 export interface JsxAttribute extends ObjectLiteralElement {
1373 readonly kind: SyntaxKind.JsxAttribute;
1374 readonly parent: JsxAttributes;
1375 readonly name: Identifier;
1376 readonly initializer?: StringLiteral | JsxExpression;
1378 export interface JsxSpreadAttribute extends ObjectLiteralElement {
1379 readonly kind: SyntaxKind.JsxSpreadAttribute;
1380 readonly parent: JsxAttributes;
1381 readonly expression: Expression;
1383 export interface JsxClosingElement extends Node {
1384 readonly kind: SyntaxKind.JsxClosingElement;
1385 readonly parent: JsxElement;
1386 readonly tagName: JsxTagNameExpression;
1388 export interface JsxExpression extends Expression {
1389 readonly kind: SyntaxKind.JsxExpression;
1390 readonly parent: JsxElement | JsxFragment | JsxAttributeLike;
1391 readonly dotDotDotToken?: Token<SyntaxKind.DotDotDotToken>;
1392 readonly expression?: Expression;
1394 export interface JsxText extends LiteralLikeNode {
1395 readonly kind: SyntaxKind.JsxText;
1396 readonly parent: JsxElement | JsxFragment;
1397 readonly containsOnlyTriviaWhiteSpaces: boolean;
1399 export type JsxChild = JsxText | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment;
1400 export interface Statement extends Node, JSDocContainer {
1401 _statementBrand: any;
1403 export interface NotEmittedStatement extends Statement {
1404 readonly kind: SyntaxKind.NotEmittedStatement;
1407 * A list of comma-separated expressions. This node is only created by transformations.
1409 export interface CommaListExpression extends Expression {
1410 readonly kind: SyntaxKind.CommaListExpression;
1411 readonly elements: NodeArray<Expression>;
1413 export interface EmptyStatement extends Statement {
1414 readonly kind: SyntaxKind.EmptyStatement;
1416 export interface DebuggerStatement extends Statement {
1417 readonly kind: SyntaxKind.DebuggerStatement;
1419 export interface MissingDeclaration extends DeclarationStatement {
1420 readonly kind: SyntaxKind.MissingDeclaration;
1421 readonly name?: Identifier;
1423 export type BlockLike = SourceFile | Block | ModuleBlock | CaseOrDefaultClause;
1424 export interface Block extends Statement {
1425 readonly kind: SyntaxKind.Block;
1426 readonly statements: NodeArray<Statement>;
1428 export interface VariableStatement extends Statement {
1429 readonly kind: SyntaxKind.VariableStatement;
1430 readonly declarationList: VariableDeclarationList;
1432 export interface ExpressionStatement extends Statement {
1433 readonly kind: SyntaxKind.ExpressionStatement;
1434 readonly expression: Expression;
1436 export interface IfStatement extends Statement {
1437 readonly kind: SyntaxKind.IfStatement;
1438 readonly expression: Expression;
1439 readonly thenStatement: Statement;
1440 readonly elseStatement?: Statement;
1442 export interface IterationStatement extends Statement {
1443 readonly statement: Statement;
1445 export interface DoStatement extends IterationStatement {
1446 readonly kind: SyntaxKind.DoStatement;
1447 readonly expression: Expression;
1449 export interface WhileStatement extends IterationStatement {
1450 readonly kind: SyntaxKind.WhileStatement;
1451 readonly expression: Expression;
1453 export type ForInitializer = VariableDeclarationList | Expression;
1454 export interface ForStatement extends IterationStatement {
1455 readonly kind: SyntaxKind.ForStatement;
1456 readonly initializer?: ForInitializer;
1457 readonly condition?: Expression;
1458 readonly incrementor?: Expression;
1460 export type ForInOrOfStatement = ForInStatement | ForOfStatement;
1461 export interface ForInStatement extends IterationStatement {
1462 readonly kind: SyntaxKind.ForInStatement;
1463 readonly initializer: ForInitializer;
1464 readonly expression: Expression;
1466 export interface ForOfStatement extends IterationStatement {
1467 readonly kind: SyntaxKind.ForOfStatement;
1468 readonly awaitModifier?: AwaitKeywordToken;
1469 readonly initializer: ForInitializer;
1470 readonly expression: Expression;
1472 export interface BreakStatement extends Statement {
1473 readonly kind: SyntaxKind.BreakStatement;
1474 readonly label?: Identifier;
1476 export interface ContinueStatement extends Statement {
1477 readonly kind: SyntaxKind.ContinueStatement;
1478 readonly label?: Identifier;
1480 export type BreakOrContinueStatement = BreakStatement | ContinueStatement;
1481 export interface ReturnStatement extends Statement {
1482 readonly kind: SyntaxKind.ReturnStatement;
1483 readonly expression?: Expression;
1485 export interface WithStatement extends Statement {
1486 readonly kind: SyntaxKind.WithStatement;
1487 readonly expression: Expression;
1488 readonly statement: Statement;
1490 export interface SwitchStatement extends Statement {
1491 readonly kind: SyntaxKind.SwitchStatement;
1492 readonly expression: Expression;
1493 readonly caseBlock: CaseBlock;
1494 possiblyExhaustive?: boolean;
1496 export interface CaseBlock extends Node {
1497 readonly kind: SyntaxKind.CaseBlock;
1498 readonly parent: SwitchStatement;
1499 readonly clauses: NodeArray<CaseOrDefaultClause>;
1501 export interface CaseClause extends Node {
1502 readonly kind: SyntaxKind.CaseClause;
1503 readonly parent: CaseBlock;
1504 readonly expression: Expression;
1505 readonly statements: NodeArray<Statement>;
1507 export interface DefaultClause extends Node {
1508 readonly kind: SyntaxKind.DefaultClause;
1509 readonly parent: CaseBlock;
1510 readonly statements: NodeArray<Statement>;
1512 export type CaseOrDefaultClause = CaseClause | DefaultClause;
1513 export interface LabeledStatement extends Statement {
1514 readonly kind: SyntaxKind.LabeledStatement;
1515 readonly label: Identifier;
1516 readonly statement: Statement;
1518 export interface ThrowStatement extends Statement {
1519 readonly kind: SyntaxKind.ThrowStatement;
1520 readonly expression: Expression;
1522 export interface TryStatement extends Statement {
1523 readonly kind: SyntaxKind.TryStatement;
1524 readonly tryBlock: Block;
1525 readonly catchClause?: CatchClause;
1526 readonly finallyBlock?: Block;
1528 export interface CatchClause extends Node {
1529 readonly kind: SyntaxKind.CatchClause;
1530 readonly parent: TryStatement;
1531 readonly variableDeclaration?: VariableDeclaration;
1532 readonly block: Block;
1534 export type ObjectTypeDeclaration = ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode;
1535 export type DeclarationWithTypeParameters = DeclarationWithTypeParameterChildren | JSDocTypedefTag | JSDocCallbackTag | JSDocSignature;
1536 export type DeclarationWithTypeParameterChildren = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag;
1537 export interface ClassLikeDeclarationBase extends NamedDeclaration, JSDocContainer {
1538 readonly kind: SyntaxKind.ClassDeclaration | SyntaxKind.ClassExpression;
1539 readonly name?: Identifier;
1540 readonly typeParameters?: NodeArray<TypeParameterDeclaration>;
1541 readonly heritageClauses?: NodeArray<HeritageClause>;
1542 readonly members: NodeArray<ClassElement>;
1544 export interface ClassDeclaration extends ClassLikeDeclarationBase, DeclarationStatement {
1545 readonly kind: SyntaxKind.ClassDeclaration;
1546 /** May be undefined in `export default class { ... }`. */
1547 readonly name?: Identifier;
1549 export interface ClassExpression extends ClassLikeDeclarationBase, PrimaryExpression {
1550 readonly kind: SyntaxKind.ClassExpression;
1552 export type ClassLikeDeclaration = ClassDeclaration | ClassExpression;
1553 export interface ClassElement extends NamedDeclaration {
1554 _classElementBrand: any;
1555 readonly name?: PropertyName;
1557 export interface TypeElement extends NamedDeclaration {
1558 _typeElementBrand: any;
1559 readonly name?: PropertyName;
1560 readonly questionToken?: QuestionToken;
1562 export interface InterfaceDeclaration extends DeclarationStatement, JSDocContainer {
1563 readonly kind: SyntaxKind.InterfaceDeclaration;
1564 readonly name: Identifier;
1565 readonly typeParameters?: NodeArray<TypeParameterDeclaration>;
1566 readonly heritageClauses?: NodeArray<HeritageClause>;
1567 readonly members: NodeArray<TypeElement>;
1569 export interface HeritageClause extends Node {
1570 readonly kind: SyntaxKind.HeritageClause;
1571 readonly parent: InterfaceDeclaration | ClassLikeDeclaration;
1572 readonly token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword;
1573 readonly types: NodeArray<ExpressionWithTypeArguments>;
1575 export interface TypeAliasDeclaration extends DeclarationStatement, JSDocContainer {
1576 readonly kind: SyntaxKind.TypeAliasDeclaration;
1577 readonly name: Identifier;
1578 readonly typeParameters?: NodeArray<TypeParameterDeclaration>;
1579 readonly type: TypeNode;
1581 export interface EnumMember extends NamedDeclaration, JSDocContainer {
1582 readonly kind: SyntaxKind.EnumMember;
1583 readonly parent: EnumDeclaration;
1584 readonly name: PropertyName;
1585 readonly initializer?: Expression;
1587 export interface EnumDeclaration extends DeclarationStatement, JSDocContainer {
1588 readonly kind: SyntaxKind.EnumDeclaration;
1589 readonly name: Identifier;
1590 readonly members: NodeArray<EnumMember>;
1592 export type ModuleName = Identifier | StringLiteral;
1593 export type ModuleBody = NamespaceBody | JSDocNamespaceBody;
1594 export interface ModuleDeclaration extends DeclarationStatement, JSDocContainer {
1595 readonly kind: SyntaxKind.ModuleDeclaration;
1596 readonly parent: ModuleBody | SourceFile;
1597 readonly name: ModuleName;
1598 readonly body?: ModuleBody | JSDocNamespaceDeclaration;
1600 export type NamespaceBody = ModuleBlock | NamespaceDeclaration;
1601 export interface NamespaceDeclaration extends ModuleDeclaration {
1602 readonly name: Identifier;
1603 readonly body: NamespaceBody;
1605 export type JSDocNamespaceBody = Identifier | JSDocNamespaceDeclaration;
1606 export interface JSDocNamespaceDeclaration extends ModuleDeclaration {
1607 readonly name: Identifier;
1608 readonly body?: JSDocNamespaceBody;
1610 export interface ModuleBlock extends Node, Statement {
1611 readonly kind: SyntaxKind.ModuleBlock;
1612 readonly parent: ModuleDeclaration;
1613 readonly statements: NodeArray<Statement>;
1615 export type ModuleReference = EntityName | ExternalModuleReference;
1618 * - import x = require("mod");
1621 export interface ImportEqualsDeclaration extends DeclarationStatement, JSDocContainer {
1622 readonly kind: SyntaxKind.ImportEqualsDeclaration;
1623 readonly parent: SourceFile | ModuleBlock;
1624 readonly name: Identifier;
1625 readonly isTypeOnly: boolean;
1626 readonly moduleReference: ModuleReference;
1628 export interface ExternalModuleReference extends Node {
1629 readonly kind: SyntaxKind.ExternalModuleReference;
1630 readonly parent: ImportEqualsDeclaration;
1631 readonly expression: Expression;
1633 export interface ImportDeclaration extends Statement {
1634 readonly kind: SyntaxKind.ImportDeclaration;
1635 readonly parent: SourceFile | ModuleBlock;
1636 readonly importClause?: ImportClause;
1637 /** If this is not a StringLiteral it will be a grammar error. */
1638 readonly moduleSpecifier: Expression;
1639 readonly assertClause?: AssertClause;
1641 export type NamedImportBindings = NamespaceImport | NamedImports;
1642 export type NamedExportBindings = NamespaceExport | NamedExports;
1643 export interface ImportClause extends NamedDeclaration {
1644 readonly kind: SyntaxKind.ImportClause;
1645 readonly parent: ImportDeclaration;
1646 readonly isTypeOnly: boolean;
1647 readonly name?: Identifier;
1648 readonly namedBindings?: NamedImportBindings;
1650 export type AssertionKey = Identifier | StringLiteral;
1651 export interface AssertEntry extends Node {
1652 readonly kind: SyntaxKind.AssertEntry;
1653 readonly parent: AssertClause;
1654 readonly name: AssertionKey;
1655 readonly value: StringLiteral;
1657 export interface AssertClause extends Node {
1658 readonly kind: SyntaxKind.AssertClause;
1659 readonly parent: ImportDeclaration | ExportDeclaration;
1660 readonly elements: NodeArray<AssertEntry>;
1661 readonly multiLine?: boolean;
1663 export interface NamespaceImport extends NamedDeclaration {
1664 readonly kind: SyntaxKind.NamespaceImport;
1665 readonly parent: ImportClause;
1666 readonly name: Identifier;
1668 export interface NamespaceExport extends NamedDeclaration {
1669 readonly kind: SyntaxKind.NamespaceExport;
1670 readonly parent: ExportDeclaration;
1671 readonly name: Identifier;
1673 export interface NamespaceExportDeclaration extends DeclarationStatement, JSDocContainer {
1674 readonly kind: SyntaxKind.NamespaceExportDeclaration;
1675 readonly name: Identifier;
1677 export interface ExportDeclaration extends DeclarationStatement, JSDocContainer {
1678 readonly kind: SyntaxKind.ExportDeclaration;
1679 readonly parent: SourceFile | ModuleBlock;
1680 readonly isTypeOnly: boolean;
1681 /** Will not be assigned in the case of `export * from "foo";` */
1682 readonly exportClause?: NamedExportBindings;
1683 /** If this is not a StringLiteral it will be a grammar error. */
1684 readonly moduleSpecifier?: Expression;
1685 readonly assertClause?: AssertClause;
1687 export interface NamedImports extends Node {
1688 readonly kind: SyntaxKind.NamedImports;
1689 readonly parent: ImportClause;
1690 readonly elements: NodeArray<ImportSpecifier>;
1692 export interface NamedExports extends Node {
1693 readonly kind: SyntaxKind.NamedExports;
1694 readonly parent: ExportDeclaration;
1695 readonly elements: NodeArray<ExportSpecifier>;
1697 export type NamedImportsOrExports = NamedImports | NamedExports;
1698 export interface ImportSpecifier extends NamedDeclaration {
1699 readonly kind: SyntaxKind.ImportSpecifier;
1700 readonly parent: NamedImports;
1701 readonly propertyName?: Identifier;
1702 readonly name: Identifier;
1703 readonly isTypeOnly: boolean;
1705 export interface ExportSpecifier extends NamedDeclaration {
1706 readonly kind: SyntaxKind.ExportSpecifier;
1707 readonly parent: NamedExports;
1708 readonly isTypeOnly: boolean;
1709 readonly propertyName?: Identifier;
1710 readonly name: Identifier;
1712 export type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier;
1713 export type TypeOnlyCompatibleAliasDeclaration = ImportClause | ImportEqualsDeclaration | NamespaceImport | ImportOrExportSpecifier;
1714 export type TypeOnlyAliasDeclaration = ImportClause & {
1715 readonly isTypeOnly: true;
1716 readonly name: Identifier;
1717 } | ImportEqualsDeclaration & {
1718 readonly isTypeOnly: true;
1719 } | NamespaceImport & {
1720 readonly parent: ImportClause & {
1721 readonly isTypeOnly: true;
1723 } | ImportSpecifier & {
1724 readonly parent: NamedImports & {
1725 readonly parent: ImportClause & {
1726 readonly isTypeOnly: true;
1729 } | ExportSpecifier & {
1730 readonly parent: NamedExports & {
1731 readonly parent: ExportDeclaration & {
1732 readonly isTypeOnly: true;
1737 * This is either an `export =` or an `export default` declaration.
1738 * Unless `isExportEquals` is set, this node was parsed as an `export default`.
1740 export interface ExportAssignment extends DeclarationStatement, JSDocContainer {
1741 readonly kind: SyntaxKind.ExportAssignment;
1742 readonly parent: SourceFile;
1743 readonly isExportEquals?: boolean;
1744 readonly expression: Expression;
1746 export interface FileReference extends TextRange {
1749 export interface CheckJsDirective extends TextRange {
1752 export type CommentKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia;
1753 export interface CommentRange extends TextRange {
1754 hasTrailingNewLine?: boolean;
1757 export interface SynthesizedComment extends CommentRange {
1761 hasLeadingNewline?: boolean;
1763 export interface JSDocTypeExpression extends TypeNode {
1764 readonly kind: SyntaxKind.JSDocTypeExpression;
1765 readonly type: TypeNode;
1767 export interface JSDocNameReference extends Node {
1768 readonly kind: SyntaxKind.JSDocNameReference;
1769 readonly name: EntityName | JSDocMemberName;
1771 /** Class#method reference in JSDoc */
1772 export interface JSDocMemberName extends Node {
1773 readonly kind: SyntaxKind.JSDocMemberName;
1774 readonly left: EntityName | JSDocMemberName;
1775 readonly right: Identifier;
1777 export interface JSDocType extends TypeNode {
1778 _jsDocTypeBrand: any;
1780 export interface JSDocAllType extends JSDocType {
1781 readonly kind: SyntaxKind.JSDocAllType;
1783 export interface JSDocUnknownType extends JSDocType {
1784 readonly kind: SyntaxKind.JSDocUnknownType;
1786 export interface JSDocNonNullableType extends JSDocType {
1787 readonly kind: SyntaxKind.JSDocNonNullableType;
1788 readonly type: TypeNode;
1790 export interface JSDocNullableType extends JSDocType {
1791 readonly kind: SyntaxKind.JSDocNullableType;
1792 readonly type: TypeNode;
1794 export interface JSDocOptionalType extends JSDocType {
1795 readonly kind: SyntaxKind.JSDocOptionalType;
1796 readonly type: TypeNode;
1798 export interface JSDocFunctionType extends JSDocType, SignatureDeclarationBase {
1799 readonly kind: SyntaxKind.JSDocFunctionType;
1801 export interface JSDocVariadicType extends JSDocType {
1802 readonly kind: SyntaxKind.JSDocVariadicType;
1803 readonly type: TypeNode;
1805 export interface JSDocNamepathType extends JSDocType {
1806 readonly kind: SyntaxKind.JSDocNamepathType;
1807 readonly type: TypeNode;
1809 export type JSDocTypeReferencingNode = JSDocVariadicType | JSDocOptionalType | JSDocNullableType | JSDocNonNullableType;
1810 export interface JSDoc extends Node {
1811 readonly kind: SyntaxKind.JSDocComment;
1812 readonly parent: HasJSDoc;
1813 readonly tags?: NodeArray<JSDocTag>;
1814 readonly comment?: string | NodeArray<JSDocComment>;
1816 export interface JSDocTag extends Node {
1817 readonly parent: JSDoc | JSDocTypeLiteral;
1818 readonly tagName: Identifier;
1819 readonly comment?: string | NodeArray<JSDocComment>;
1821 export interface JSDocLink extends Node {
1822 readonly kind: SyntaxKind.JSDocLink;
1823 readonly name?: EntityName | JSDocMemberName;
1826 export interface JSDocLinkCode extends Node {
1827 readonly kind: SyntaxKind.JSDocLinkCode;
1828 readonly name?: EntityName | JSDocMemberName;
1831 export interface JSDocLinkPlain extends Node {
1832 readonly kind: SyntaxKind.JSDocLinkPlain;
1833 readonly name?: EntityName | JSDocMemberName;
1836 export type JSDocComment = JSDocText | JSDocLink | JSDocLinkCode | JSDocLinkPlain;
1837 export interface JSDocText extends Node {
1838 readonly kind: SyntaxKind.JSDocText;
1841 export interface JSDocUnknownTag extends JSDocTag {
1842 readonly kind: SyntaxKind.JSDocTag;
1845 * Note that `@extends` is a synonym of `@augments`.
1846 * Both tags are represented by this interface.
1848 export interface JSDocAugmentsTag extends JSDocTag {
1849 readonly kind: SyntaxKind.JSDocAugmentsTag;
1850 readonly class: ExpressionWithTypeArguments & {
1851 readonly expression: Identifier | PropertyAccessEntityNameExpression;
1854 export interface JSDocImplementsTag extends JSDocTag {
1855 readonly kind: SyntaxKind.JSDocImplementsTag;
1856 readonly class: ExpressionWithTypeArguments & {
1857 readonly expression: Identifier | PropertyAccessEntityNameExpression;
1860 export interface JSDocAuthorTag extends JSDocTag {
1861 readonly kind: SyntaxKind.JSDocAuthorTag;
1863 export interface JSDocDeprecatedTag extends JSDocTag {
1864 kind: SyntaxKind.JSDocDeprecatedTag;
1866 export interface JSDocClassTag extends JSDocTag {
1867 readonly kind: SyntaxKind.JSDocClassTag;
1869 export interface JSDocPublicTag extends JSDocTag {
1870 readonly kind: SyntaxKind.JSDocPublicTag;
1872 export interface JSDocPrivateTag extends JSDocTag {
1873 readonly kind: SyntaxKind.JSDocPrivateTag;
1875 export interface JSDocProtectedTag extends JSDocTag {
1876 readonly kind: SyntaxKind.JSDocProtectedTag;
1878 export interface JSDocReadonlyTag extends JSDocTag {
1879 readonly kind: SyntaxKind.JSDocReadonlyTag;
1881 export interface JSDocOverrideTag extends JSDocTag {
1882 readonly kind: SyntaxKind.JSDocOverrideTag;
1884 export interface JSDocEnumTag extends JSDocTag, Declaration {
1885 readonly kind: SyntaxKind.JSDocEnumTag;
1886 readonly parent: JSDoc;
1887 readonly typeExpression: JSDocTypeExpression;
1889 export interface JSDocThisTag extends JSDocTag {
1890 readonly kind: SyntaxKind.JSDocThisTag;
1891 readonly typeExpression: JSDocTypeExpression;
1893 export interface JSDocTemplateTag extends JSDocTag {
1894 readonly kind: SyntaxKind.JSDocTemplateTag;
1895 readonly constraint: JSDocTypeExpression | undefined;
1896 readonly typeParameters: NodeArray<TypeParameterDeclaration>;
1898 export interface JSDocSeeTag extends JSDocTag {
1899 readonly kind: SyntaxKind.JSDocSeeTag;
1900 readonly name?: JSDocNameReference;
1902 export interface JSDocReturnTag extends JSDocTag {
1903 readonly kind: SyntaxKind.JSDocReturnTag;
1904 readonly typeExpression?: JSDocTypeExpression;
1906 export interface JSDocTypeTag extends JSDocTag {
1907 readonly kind: SyntaxKind.JSDocTypeTag;
1908 readonly typeExpression: JSDocTypeExpression;
1910 export interface JSDocTypedefTag extends JSDocTag, NamedDeclaration {
1911 readonly kind: SyntaxKind.JSDocTypedefTag;
1912 readonly parent: JSDoc;
1913 readonly fullName?: JSDocNamespaceDeclaration | Identifier;
1914 readonly name?: Identifier;
1915 readonly typeExpression?: JSDocTypeExpression | JSDocTypeLiteral;
1917 export interface JSDocCallbackTag extends JSDocTag, NamedDeclaration {
1918 readonly kind: SyntaxKind.JSDocCallbackTag;
1919 readonly parent: JSDoc;
1920 readonly fullName?: JSDocNamespaceDeclaration | Identifier;
1921 readonly name?: Identifier;
1922 readonly typeExpression: JSDocSignature;
1924 export interface JSDocSignature extends JSDocType, Declaration {
1925 readonly kind: SyntaxKind.JSDocSignature;
1926 readonly typeParameters?: readonly JSDocTemplateTag[];
1927 readonly parameters: readonly JSDocParameterTag[];
1928 readonly type: JSDocReturnTag | undefined;
1930 export interface JSDocPropertyLikeTag extends JSDocTag, Declaration {
1931 readonly parent: JSDoc;
1932 readonly name: EntityName;
1933 readonly typeExpression?: JSDocTypeExpression;
1934 /** Whether the property name came before the type -- non-standard for JSDoc, but Typescript-like */
1935 readonly isNameFirst: boolean;
1936 readonly isBracketed: boolean;
1938 export interface JSDocPropertyTag extends JSDocPropertyLikeTag {
1939 readonly kind: SyntaxKind.JSDocPropertyTag;
1941 export interface JSDocParameterTag extends JSDocPropertyLikeTag {
1942 readonly kind: SyntaxKind.JSDocParameterTag;
1944 export interface JSDocTypeLiteral extends JSDocType {
1945 readonly kind: SyntaxKind.JSDocTypeLiteral;
1946 readonly jsDocPropertyTags?: readonly JSDocPropertyLikeTag[];
1947 /** If true, then this type literal represents an *array* of its type. */
1948 readonly isArrayType: boolean;
1950 export enum FlowFlags {
1957 FalseCondition = 64,
1959 ArrayMutation = 256,
1967 export type FlowNode = FlowStart | FlowLabel | FlowAssignment | FlowCall | FlowCondition | FlowSwitchClause | FlowArrayMutation | FlowCall | FlowReduceLabel;
1968 export interface FlowNodeBase {
1972 export interface FlowStart extends FlowNodeBase {
1973 node?: FunctionExpression | ArrowFunction | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration;
1975 export interface FlowLabel extends FlowNodeBase {
1976 antecedents: FlowNode[] | undefined;
1978 export interface FlowAssignment extends FlowNodeBase {
1979 node: Expression | VariableDeclaration | BindingElement;
1980 antecedent: FlowNode;
1982 export interface FlowCall extends FlowNodeBase {
1983 node: CallExpression;
1984 antecedent: FlowNode;
1986 export interface FlowCondition extends FlowNodeBase {
1988 antecedent: FlowNode;
1990 export interface FlowSwitchClause extends FlowNodeBase {
1991 switchStatement: SwitchStatement;
1992 clauseStart: number;
1994 antecedent: FlowNode;
1996 export interface FlowArrayMutation extends FlowNodeBase {
1997 node: CallExpression | BinaryExpression;
1998 antecedent: FlowNode;
2000 export interface FlowReduceLabel extends FlowNodeBase {
2002 antecedents: FlowNode[];
2003 antecedent: FlowNode;
2005 export type FlowType = Type | IncompleteType;
2006 export interface IncompleteType {
2010 export interface AmdDependency {
2014 export interface SourceFile extends Declaration {
2015 readonly kind: SyntaxKind.SourceFile;
2016 readonly statements: NodeArray<Statement>;
2017 readonly endOfFileToken: Token<SyntaxKind.EndOfFileToken>;
2020 amdDependencies: readonly AmdDependency[];
2021 moduleName?: string;
2022 referencedFiles: readonly FileReference[];
2023 typeReferenceDirectives: readonly FileReference[];
2024 libReferenceDirectives: readonly FileReference[];
2025 languageVariant: LanguageVariant;
2026 isDeclarationFile: boolean;
2028 * lib.d.ts should have a reference comment like
2030 * /// <reference no-default-lib="true"/>
2032 * If any other file has this comment, it signals not to include lib.d.ts
2033 * because this containing file is intended to act as a default library.
2035 hasNoDefaultLib: boolean;
2036 languageVersion: ScriptTarget;
2038 * When `module` is `Node12` or `NodeNext`, this field controls whether the
2039 * source file in question is an ESNext-output-format file, or a CommonJS-output-format
2040 * module. This is derived by the module resolver as it looks up the file, since
2041 * it is derived from either the file extension of the module, or the containing
2042 * `package.json` context, and affects both checking and emit.
2044 * It is _public_ so that (pre)transformers can set this field,
2045 * since it switches the builtin `node` module transform. Generally speaking, if unset,
2046 * the field is treated as though it is `ModuleKind.CommonJS`.
2048 impliedNodeFormat?: ModuleKind.ESNext | ModuleKind.CommonJS;
2050 export interface Bundle extends Node {
2051 readonly kind: SyntaxKind.Bundle;
2052 readonly prepends: readonly (InputFiles | UnparsedSource)[];
2053 readonly sourceFiles: readonly SourceFile[];
2055 export interface InputFiles extends Node {
2056 readonly kind: SyntaxKind.InputFiles;
2057 javascriptPath?: string;
2058 javascriptText: string;
2059 javascriptMapPath?: string;
2060 javascriptMapText?: string;
2061 declarationPath?: string;
2062 declarationText: string;
2063 declarationMapPath?: string;
2064 declarationMapText?: string;
2066 export interface UnparsedSource extends Node {
2067 readonly kind: SyntaxKind.UnparsedSource;
2070 readonly prologues: readonly UnparsedPrologue[];
2071 helpers: readonly UnscopedEmitHelper[] | undefined;
2072 referencedFiles: readonly FileReference[];
2073 typeReferenceDirectives: readonly string[] | undefined;
2074 libReferenceDirectives: readonly FileReference[];
2075 hasNoDefaultLib?: boolean;
2076 sourceMapPath?: string;
2077 sourceMapText?: string;
2078 readonly syntheticReferences?: readonly UnparsedSyntheticReference[];
2079 readonly texts: readonly UnparsedSourceText[];
2081 export type UnparsedSourceText = UnparsedPrepend | UnparsedTextLike;
2082 export type UnparsedNode = UnparsedPrologue | UnparsedSourceText | UnparsedSyntheticReference;
2083 export interface UnparsedSection extends Node {
2084 readonly kind: SyntaxKind;
2085 readonly parent: UnparsedSource;
2086 readonly data?: string;
2088 export interface UnparsedPrologue extends UnparsedSection {
2089 readonly kind: SyntaxKind.UnparsedPrologue;
2090 readonly parent: UnparsedSource;
2091 readonly data: string;
2093 export interface UnparsedPrepend extends UnparsedSection {
2094 readonly kind: SyntaxKind.UnparsedPrepend;
2095 readonly parent: UnparsedSource;
2096 readonly data: string;
2097 readonly texts: readonly UnparsedTextLike[];
2099 export interface UnparsedTextLike extends UnparsedSection {
2100 readonly kind: SyntaxKind.UnparsedText | SyntaxKind.UnparsedInternalText;
2101 readonly parent: UnparsedSource;
2103 export interface UnparsedSyntheticReference extends UnparsedSection {
2104 readonly kind: SyntaxKind.UnparsedSyntheticReference;
2105 readonly parent: UnparsedSource;
2107 export interface JsonSourceFile extends SourceFile {
2108 readonly statements: NodeArray<JsonObjectExpressionStatement>;
2110 export interface TsConfigSourceFile extends JsonSourceFile {
2111 extendedSourceFiles?: string[];
2113 export interface JsonMinusNumericLiteral extends PrefixUnaryExpression {
2114 readonly kind: SyntaxKind.PrefixUnaryExpression;
2115 readonly operator: SyntaxKind.MinusToken;
2116 readonly operand: NumericLiteral;
2118 export type JsonObjectExpression = ObjectLiteralExpression | ArrayLiteralExpression | JsonMinusNumericLiteral | NumericLiteral | StringLiteral | BooleanLiteral | NullLiteral;
2119 export interface JsonObjectExpressionStatement extends ExpressionStatement {
2120 readonly expression: JsonObjectExpression;
2122 export interface ScriptReferenceHost {
2123 getCompilerOptions(): CompilerOptions;
2124 getSourceFile(fileName: string): SourceFile | undefined;
2125 getSourceFileByPath(path: Path): SourceFile | undefined;
2126 getCurrentDirectory(): string;
2128 export interface ParseConfigHost {
2129 useCaseSensitiveFileNames: boolean;
2130 readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number): readonly string[];
2132 * Gets a value indicating whether the specified path exists and is a file.
2133 * @param path The path to test.
2135 fileExists(path: string): boolean;
2136 readFile(path: string): string | undefined;
2137 trace?(s: string): void;
2140 * Branded string for keeping track of when we've turned an ambiguous path
2141 * specified like "./blah" to an absolute path to an actual
2142 * tsconfig file, e.g. "/root/blah/tsconfig.json"
2144 export type ResolvedConfigFileName = string & {
2145 _isResolvedConfigFileName: never;
2147 export type WriteFileCallback = (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[]) => void;
2148 export class OperationCanceledException {
2150 export interface CancellationToken {
2151 isCancellationRequested(): boolean;
2152 /** @throws OperationCanceledException if isCancellationRequested is true */
2153 throwIfCancellationRequested(): void;
2155 export interface Program extends ScriptReferenceHost {
2156 getCurrentDirectory(): string;
2158 * Get a list of root file names that were passed to a 'createProgram'
2160 getRootFileNames(): readonly string[];
2162 * Get a list of files in the program
2164 getSourceFiles(): readonly SourceFile[];
2166 * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then
2167 * the JavaScript and declaration files will be produced for all the files in this program.
2168 * If targetSourceFile is specified, then only the JavaScript and declaration for that
2169 * specific file will be generated.
2171 * If writeFile is not specified then the writeFile callback from the compiler host will be
2172 * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter
2173 * will be invoked when writing the JavaScript and declaration files.
2175 emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult;
2176 getOptionsDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
2177 getGlobalDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
2178 getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[];
2179 /** The first time this is called, it will return global diagnostics (no location). */
2180 getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
2181 getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[];
2182 getConfigFileParsingDiagnostics(): readonly Diagnostic[];
2184 * Gets a type checker that can be used to semantically analyze source files in the program.
2186 getTypeChecker(): TypeChecker;
2187 getNodeCount(): number;
2188 getIdentifierCount(): number;
2189 getSymbolCount(): number;
2190 getTypeCount(): number;
2191 getInstantiationCount(): number;
2192 getRelationCacheSizes(): {
2196 strictSubtype: number;
2198 isSourceFileFromExternalLibrary(file: SourceFile): boolean;
2199 isSourceFileDefaultLibrary(file: SourceFile): boolean;
2200 getProjectReferences(): readonly ProjectReference[] | undefined;
2201 getResolvedProjectReferences(): readonly (ResolvedProjectReference | undefined)[] | undefined;
2203 export interface ResolvedProjectReference {
2204 commandLine: ParsedCommandLine;
2205 sourceFile: SourceFile;
2206 references?: readonly (ResolvedProjectReference | undefined)[];
2208 export type CustomTransformerFactory = (context: TransformationContext) => CustomTransformer;
2209 export interface CustomTransformer {
2210 transformSourceFile(node: SourceFile): SourceFile;
2211 transformBundle(node: Bundle): Bundle;
2213 export interface CustomTransformers {
2214 /** Custom transformers to evaluate before built-in .js transformations. */
2215 before?: (TransformerFactory<SourceFile> | CustomTransformerFactory)[];
2216 /** Custom transformers to evaluate after built-in .js transformations. */
2217 after?: (TransformerFactory<SourceFile> | CustomTransformerFactory)[];
2218 /** Custom transformers to evaluate after built-in .d.ts transformations. */
2219 afterDeclarations?: (TransformerFactory<Bundle | SourceFile> | CustomTransformerFactory)[];
2221 export interface SourceMapSpan {
2222 /** Line number in the .js file. */
2223 emittedLine: number;
2224 /** Column number in the .js file. */
2225 emittedColumn: number;
2226 /** Line number in the .ts file. */
2228 /** Column number in the .ts file. */
2229 sourceColumn: number;
2230 /** Optional name (index into names array) associated with this span. */
2232 /** .ts file (index into sources array) associated with this span */
2233 sourceIndex: number;
2235 /** Return code used by getEmitOutput function to indicate status of the function */
2236 export enum ExitStatus {
2238 DiagnosticsPresent_OutputsSkipped = 1,
2239 DiagnosticsPresent_OutputsGenerated = 2,
2240 InvalidProject_OutputsSkipped = 3,
2241 ProjectReferenceCycle_OutputsSkipped = 4,
2242 /** @deprecated Use ProjectReferenceCycle_OutputsSkipped instead. */
2243 ProjectReferenceCycle_OutputsSkupped = 4
2245 export interface EmitResult {
2246 emitSkipped: boolean;
2247 /** Contains declaration emit diagnostics */
2248 diagnostics: readonly Diagnostic[];
2249 emittedFiles?: string[];
2251 export interface TypeChecker {
2252 getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type;
2253 getDeclaredTypeOfSymbol(symbol: Symbol): Type;
2254 getPropertiesOfType(type: Type): Symbol[];
2255 getPropertyOfType(type: Type, propertyName: string): Symbol | undefined;
2256 getPrivateIdentifierPropertyOfType(leftType: Type, name: string, location: Node): Symbol | undefined;
2257 getIndexInfoOfType(type: Type, kind: IndexKind): IndexInfo | undefined;
2258 getIndexInfosOfType(type: Type): readonly IndexInfo[];
2259 getSignaturesOfType(type: Type, kind: SignatureKind): readonly Signature[];
2260 getIndexTypeOfType(type: Type, kind: IndexKind): Type | undefined;
2261 getBaseTypes(type: InterfaceType): BaseType[];
2262 getBaseTypeOfLiteralType(type: Type): Type;
2263 getWidenedType(type: Type): Type;
2264 getReturnTypeOfSignature(signature: Signature): Type;
2265 getNullableType(type: Type, flags: TypeFlags): Type;
2266 getNonNullableType(type: Type): Type;
2267 getTypeArguments(type: TypeReference): readonly Type[];
2268 /** Note that the resulting nodes cannot be checked. */
2269 typeToTypeNode(type: Type, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): TypeNode | undefined;
2270 /** Note that the resulting nodes cannot be checked. */
2271 signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): SignatureDeclaration & {
2272 typeArguments?: NodeArray<TypeNode>;
2274 /** Note that the resulting nodes cannot be checked. */
2275 indexInfoToIndexSignatureDeclaration(indexInfo: IndexInfo, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): IndexSignatureDeclaration | undefined;
2276 /** Note that the resulting nodes cannot be checked. */
2277 symbolToEntityName(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): EntityName | undefined;
2278 /** Note that the resulting nodes cannot be checked. */
2279 symbolToExpression(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): Expression | undefined;
2280 /** Note that the resulting nodes cannot be checked. */
2281 symbolToTypeParameterDeclarations(symbol: Symbol, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): NodeArray<TypeParameterDeclaration> | undefined;
2282 /** Note that the resulting nodes cannot be checked. */
2283 symbolToParameterDeclaration(symbol: Symbol, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): ParameterDeclaration | undefined;
2284 /** Note that the resulting nodes cannot be checked. */
2285 typeParameterToDeclaration(parameter: TypeParameter, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): TypeParameterDeclaration | undefined;
2286 getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[];
2287 getSymbolAtLocation(node: Node): Symbol | undefined;
2288 getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[];
2290 * The function returns the value (local variable) symbol of an identifier in the short-hand property assignment.
2291 * This is necessary as an identifier in short-hand property assignment can contains two meaning: property name and property value.
2293 getShorthandAssignmentValueSymbol(location: Node | undefined): Symbol | undefined;
2294 getExportSpecifierLocalTargetSymbol(location: ExportSpecifier | Identifier): Symbol | undefined;
2296 * If a symbol is a local symbol with an associated exported symbol, returns the exported symbol.
2297 * Otherwise returns its input.
2298 * For example, at `export type T = number;`:
2299 * - `getSymbolAtLocation` at the location `T` will return the exported symbol for `T`.
2300 * - But the result of `getSymbolsInScope` will contain the *local* symbol for `T`, not the exported symbol.
2301 * - Calling `getExportSymbolOfSymbol` on that local symbol will return the exported symbol.
2303 getExportSymbolOfSymbol(symbol: Symbol): Symbol;
2304 getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol | undefined;
2305 getTypeOfAssignmentPattern(pattern: AssignmentPattern): Type;
2306 getTypeAtLocation(node: Node): Type;
2307 getTypeFromTypeNode(node: TypeNode): Type;
2308 signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string;
2309 typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string;
2310 symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): string;
2311 typePredicateToString(predicate: TypePredicate, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string;
2312 getFullyQualifiedName(symbol: Symbol): string;
2313 getAugmentedPropertiesOfType(type: Type): Symbol[];
2314 getRootSymbols(symbol: Symbol): readonly Symbol[];
2315 getSymbolOfExpando(node: Node, allowDeclaration: boolean): Symbol | undefined;
2316 getContextualType(node: Expression): Type | undefined;
2318 * returns unknownSignature in the case of an error.
2319 * returns undefined if the node is not valid.
2320 * @param argumentCount Apparent number of arguments, passed in case of a possibly incomplete call. This should come from an ArgumentListInfo. See `signatureHelp.ts`.
2322 getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[], argumentCount?: number): Signature | undefined;
2323 getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature | undefined;
2324 isImplementationOfOverload(node: SignatureDeclaration): boolean | undefined;
2325 isUndefinedSymbol(symbol: Symbol): boolean;
2326 isArgumentsSymbol(symbol: Symbol): boolean;
2327 isUnknownSymbol(symbol: Symbol): boolean;
2328 getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): string | number | undefined;
2329 isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName | ImportTypeNode, propertyName: string): boolean;
2330 /** Follow all aliases to get the original symbol. */
2331 getAliasedSymbol(symbol: Symbol): Symbol;
2332 /** Follow a *single* alias to get the immediately aliased symbol. */
2333 getImmediateAliasedSymbol(symbol: Symbol): Symbol | undefined;
2334 getExportsOfModule(moduleSymbol: Symbol): Symbol[];
2335 getJsxIntrinsicTagNamesAt(location: Node): Symbol[];
2336 isOptionalParameter(node: ParameterDeclaration): boolean;
2337 getAmbientModules(): Symbol[];
2338 tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined;
2339 getApparentType(type: Type): Type;
2340 getBaseConstraintOfType(type: Type): Type | undefined;
2341 getDefaultFromTypeParameter(type: Type): Type | undefined;
2342 getTypePredicateOfSignature(signature: Signature): TypePredicate | undefined;
2344 * Depending on the operation performed, it may be appropriate to throw away the checker
2345 * if the cancellation token is triggered. Typically, if it is used for error checking
2346 * and the operation is cancelled, then it should be discarded, otherwise it is safe to keep.
2348 runWithCancellationToken<T>(token: CancellationToken, cb: (checker: TypeChecker) => T): T;
2350 export enum NodeBuilderFlags {
2353 WriteArrayAsGenericType = 2,
2354 GenerateNamesForShadowedTypeParams = 4,
2355 UseStructuralFallback = 8,
2356 ForbidIndexedAccessSymbolReferences = 16,
2357 WriteTypeArgumentsOfSignature = 32,
2358 UseFullyQualifiedType = 64,
2359 UseOnlyExternalAliasing = 128,
2360 SuppressAnyReturnType = 256,
2361 WriteTypeParametersInQualifiedName = 512,
2362 MultilineObjectLiterals = 1024,
2363 WriteClassExpressionAsTypeLiteral = 2048,
2364 UseTypeOfFunction = 4096,
2365 OmitParameterModifiers = 8192,
2366 UseAliasDefinedOutsideCurrentScope = 16384,
2367 UseSingleQuotesForStringLiteralType = 268435456,
2368 NoTypeReduction = 536870912,
2369 NoUndefinedOptionalParameterType = 1073741824,
2370 AllowThisInObjectLiteral = 32768,
2371 AllowQualifiedNameInPlaceOfIdentifier = 65536,
2372 /** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */
2373 AllowQualifedNameInPlaceOfIdentifier = 65536,
2374 AllowAnonymousIdentifier = 131072,
2375 AllowEmptyUnionOrIntersection = 262144,
2376 AllowEmptyTuple = 524288,
2377 AllowUniqueESSymbolType = 1048576,
2378 AllowEmptyIndexInfoType = 2097152,
2379 AllowNodeModulesRelativePaths = 67108864,
2380 IgnoreErrors = 70221824,
2381 InObjectTypeLiteral = 4194304,
2382 InTypeAlias = 8388608,
2383 InInitialEntityName = 16777216
2385 export enum TypeFormatFlags {
2388 WriteArrayAsGenericType = 2,
2389 UseStructuralFallback = 8,
2390 WriteTypeArgumentsOfSignature = 32,
2391 UseFullyQualifiedType = 64,
2392 SuppressAnyReturnType = 256,
2393 MultilineObjectLiterals = 1024,
2394 WriteClassExpressionAsTypeLiteral = 2048,
2395 UseTypeOfFunction = 4096,
2396 OmitParameterModifiers = 8192,
2397 UseAliasDefinedOutsideCurrentScope = 16384,
2398 UseSingleQuotesForStringLiteralType = 268435456,
2399 NoTypeReduction = 536870912,
2400 AllowUniqueESSymbolType = 1048576,
2401 AddUndefined = 131072,
2402 WriteArrowStyleSignature = 262144,
2403 InArrayType = 524288,
2404 InElementType = 2097152,
2405 InFirstTypeArgument = 4194304,
2406 InTypeAlias = 8388608,
2407 /** @deprecated */ WriteOwnNameForAnyLike = 0,
2408 NodeBuilderFlagsMask = 814775659
2410 export enum SymbolFormatFlags {
2412 WriteTypeParametersOrArguments = 1,
2413 UseOnlyExternalAliasing = 2,
2414 AllowAnyNodeKind = 4,
2415 UseAliasDefinedOutsideCurrentScope = 8,
2417 export enum TypePredicateKind {
2421 AssertsIdentifier = 3
2423 export interface TypePredicateBase {
2424 kind: TypePredicateKind;
2425 type: Type | undefined;
2427 export interface ThisTypePredicate extends TypePredicateBase {
2428 kind: TypePredicateKind.This;
2429 parameterName: undefined;
2430 parameterIndex: undefined;
2433 export interface IdentifierTypePredicate extends TypePredicateBase {
2434 kind: TypePredicateKind.Identifier;
2435 parameterName: string;
2436 parameterIndex: number;
2439 export interface AssertsThisTypePredicate extends TypePredicateBase {
2440 kind: TypePredicateKind.AssertsThis;
2441 parameterName: undefined;
2442 parameterIndex: undefined;
2443 type: Type | undefined;
2445 export interface AssertsIdentifierTypePredicate extends TypePredicateBase {
2446 kind: TypePredicateKind.AssertsIdentifier;
2447 parameterName: string;
2448 parameterIndex: number;
2449 type: Type | undefined;
2451 export type TypePredicate = ThisTypePredicate | IdentifierTypePredicate | AssertsThisTypePredicate | AssertsIdentifierTypePredicate;
2452 export enum SymbolFlags {
2454 FunctionScopedVariable = 1,
2455 BlockScopedVariable = 2,
2464 NamespaceModule = 1024,
2466 ObjectLiteral = 4096,
2468 Constructor = 16384,
2469 GetAccessor = 32768,
2470 SetAccessor = 65536,
2472 TypeParameter = 262144,
2474 ExportValue = 1048576,
2476 Prototype = 4194304,
2477 ExportStar = 8388608,
2478 Optional = 16777216,
2479 Transient = 33554432,
2480 Assignment = 67108864,
2481 ModuleExports = 134217728,
2489 FunctionScopedVariableExcludes = 111550,
2490 BlockScopedVariableExcludes = 111551,
2491 ParameterExcludes = 111551,
2492 PropertyExcludes = 0,
2493 EnumMemberExcludes = 900095,
2494 FunctionExcludes = 110991,
2495 ClassExcludes = 899503,
2496 InterfaceExcludes = 788872,
2497 RegularEnumExcludes = 899327,
2498 ConstEnumExcludes = 899967,
2499 ValueModuleExcludes = 110735,
2500 NamespaceModuleExcludes = 0,
2501 MethodExcludes = 103359,
2502 GetAccessorExcludes = 46015,
2503 SetAccessorExcludes = 78783,
2504 TypeParameterExcludes = 526824,
2505 TypeAliasExcludes = 788968,
2506 AliasExcludes = 2097152,
2507 ModuleMember = 2623475,
2508 ExportHasLocal = 944,
2510 PropertyOrAccessor = 98308,
2511 ClassMember = 106500,
2513 export interface Symbol {
2515 escapedName: __String;
2516 declarations?: Declaration[];
2517 valueDeclaration?: Declaration;
2518 members?: SymbolTable;
2519 exports?: SymbolTable;
2520 globalExports?: SymbolTable;
2522 export enum InternalSymbolName {
2524 Constructor = "__constructor",
2527 ExportStar = "__export",
2528 Global = "__global",
2529 Missing = "__missing",
2531 Object = "__object",
2532 JSXAttributes = "__jsxAttributes",
2534 Function = "__function",
2535 Computed = "__computed",
2536 Resolving = "__resolving__",
2537 ExportEquals = "export=",
2538 Default = "default",
2542 * This represents a string whose leading underscore have been escaped by adding extra leading underscores.
2543 * The shape of this brand is rather unique compared to others we've used.
2544 * Instead of just an intersection of a string and an object, it is that union-ed
2545 * with an intersection of void and an object. This makes it wholly incompatible
2546 * with a normal string (which is good, it cannot be misused on assignment or on usage),
2547 * while still being comparable with a normal string via === (also good) and castable from a string.
2549 export type __String = (string & {
2550 __escapedIdentifier: void;
2552 __escapedIdentifier: void;
2553 }) | InternalSymbolName;
2554 /** ReadonlyMap where keys are `__String`s. */
2555 export interface ReadonlyUnderscoreEscapedMap<T> extends ReadonlyESMap<__String, T> {
2557 /** Map where keys are `__String`s. */
2558 export interface UnderscoreEscapedMap<T> extends ESMap<__String, T>, ReadonlyUnderscoreEscapedMap<T> {
2560 /** SymbolTable based on ES6 Map interface. */
2561 export type SymbolTable = UnderscoreEscapedMap<Symbol>;
2562 export enum TypeFlags {
2570 StringLiteral = 128,
2571 NumberLiteral = 256,
2572 BooleanLiteral = 512,
2574 BigIntLiteral = 2048,
2576 UniqueESSymbol = 8192,
2581 TypeParameter = 262144,
2584 Intersection = 2097152,
2586 IndexedAccess = 8388608,
2587 Conditional = 16777216,
2588 Substitution = 33554432,
2589 NonPrimitive = 67108864,
2590 TemplateLiteral = 134217728,
2591 StringMapping = 268435456,
2594 StringOrNumberLiteral = 384,
2595 PossiblyFalsy = 117724,
2596 StringLike = 402653316,
2601 ESSymbolLike = 12288,
2603 UnionOrIntersection = 3145728,
2604 StructuredType = 3670016,
2605 TypeVariable = 8650752,
2606 InstantiableNonPrimitive = 58982400,
2607 InstantiablePrimitive = 406847488,
2608 Instantiable = 465829888,
2609 StructuredOrInstantiable = 469499904,
2610 Narrowable = 536624127,
2612 export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression;
2613 export interface Type {
2616 pattern?: DestructuringPattern;
2617 aliasSymbol?: Symbol;
2618 aliasTypeArguments?: readonly Type[];
2620 export interface LiteralType extends Type {
2621 value: string | number | PseudoBigInt;
2622 freshType: LiteralType;
2623 regularType: LiteralType;
2625 export interface UniqueESSymbolType extends Type {
2627 escapedName: __String;
2629 export interface StringLiteralType extends LiteralType {
2632 export interface NumberLiteralType extends LiteralType {
2635 export interface BigIntLiteralType extends LiteralType {
2636 value: PseudoBigInt;
2638 export interface EnumType extends Type {
2640 export enum ObjectFlags {
2648 ObjectLiteral = 128,
2649 EvolvingArray = 256,
2650 ObjectLiteralPatternWithComputedProperties = 512,
2651 ReverseMapped = 1024,
2652 JsxAttributes = 2048,
2655 FreshLiteral = 16384,
2656 ArrayLiteral = 32768,
2657 ClassOrInterface = 3,
2658 ContainsSpread = 4194304,
2659 ObjectRestType = 8388608,
2661 export interface ObjectType extends Type {
2662 objectFlags: ObjectFlags;
2664 /** Class and interface types (ObjectFlags.Class and ObjectFlags.Interface). */
2665 export interface InterfaceType extends ObjectType {
2666 typeParameters: TypeParameter[] | undefined;
2667 outerTypeParameters: TypeParameter[] | undefined;
2668 localTypeParameters: TypeParameter[] | undefined;
2669 thisType: TypeParameter | undefined;
2671 export type BaseType = ObjectType | IntersectionType | TypeVariable;
2672 export interface InterfaceTypeWithDeclaredMembers extends InterfaceType {
2673 declaredProperties: Symbol[];
2674 declaredCallSignatures: Signature[];
2675 declaredConstructSignatures: Signature[];
2676 declaredIndexInfos: IndexInfo[];
2679 * Type references (ObjectFlags.Reference). When a class or interface has type parameters or
2680 * a "this" type, references to the class or interface are made using type references. The
2681 * typeArguments property specifies the types to substitute for the type parameters of the
2682 * class or interface and optionally includes an extra element that specifies the type to
2683 * substitute for "this" in the resulting instantiation. When no extra argument is present,
2684 * the type reference itself is substituted for "this". The typeArguments property is undefined
2685 * if the class or interface has no type parameters and the reference isn't specifying an
2686 * explicit "this" argument.
2688 export interface TypeReference extends ObjectType {
2689 target: GenericType;
2690 node?: TypeReferenceNode | ArrayTypeNode | TupleTypeNode;
2692 export interface DeferredTypeReference extends TypeReference {
2694 export interface GenericType extends InterfaceType, TypeReference {
2696 export enum ElementFlags {
2706 export interface TupleType extends GenericType {
2707 elementFlags: readonly ElementFlags[];
2709 fixedLength: number;
2710 hasRestElement: boolean;
2711 combinedFlags: ElementFlags;
2713 labeledElementDeclarations?: readonly (NamedTupleMember | ParameterDeclaration)[];
2715 export interface TupleTypeReference extends TypeReference {
2718 export interface UnionOrIntersectionType extends Type {
2721 export interface UnionType extends UnionOrIntersectionType {
2723 export interface IntersectionType extends UnionOrIntersectionType {
2725 export type StructuredType = ObjectType | UnionType | IntersectionType;
2726 export interface EvolvingArrayType extends ObjectType {
2728 finalArrayType?: Type;
2730 export interface InstantiableType extends Type {
2732 export interface TypeParameter extends InstantiableType {
2734 export interface IndexedAccessType extends InstantiableType {
2738 simplifiedForReading?: Type;
2739 simplifiedForWriting?: Type;
2741 export type TypeVariable = TypeParameter | IndexedAccessType;
2742 export interface IndexType extends InstantiableType {
2743 type: InstantiableType | UnionOrIntersectionType;
2745 export interface ConditionalRoot {
2746 node: ConditionalTypeNode;
2749 isDistributive: boolean;
2750 inferTypeParameters?: TypeParameter[];
2751 outerTypeParameters?: TypeParameter[];
2752 instantiations?: Map<Type>;
2753 aliasSymbol?: Symbol;
2754 aliasTypeArguments?: Type[];
2756 export interface ConditionalType extends InstantiableType {
2757 root: ConditionalRoot;
2760 resolvedTrueType?: Type;
2761 resolvedFalseType?: Type;
2763 export interface TemplateLiteralType extends InstantiableType {
2764 texts: readonly string[];
2765 types: readonly Type[];
2767 export interface StringMappingType extends InstantiableType {
2771 export interface SubstitutionType extends InstantiableType {
2772 objectFlags: ObjectFlags;
2776 export enum SignatureKind {
2780 export interface Signature {
2781 declaration?: SignatureDeclaration | JSDocSignature;
2782 typeParameters?: readonly TypeParameter[];
2783 parameters: readonly Symbol[];
2785 export enum IndexKind {
2789 export interface IndexInfo {
2792 isReadonly: boolean;
2793 declaration?: IndexSignatureDeclaration;
2795 export enum InferencePriority {
2796 NakedTypeVariable = 1,
2797 SpeculativeTuple = 2,
2798 SubstituteSource = 4,
2799 HomomorphicMappedType = 8,
2800 PartialHomomorphicMappedType = 16,
2801 MappedTypeConstraint = 32,
2802 ContravariantConditional = 64,
2805 NoConstraints = 512,
2806 AlwaysStrict = 1024,
2808 PriorityImpliesCombination = 416,
2811 /** @deprecated Use FileExtensionInfo instead. */
2812 export type JsFileExtensionInfo = FileExtensionInfo;
2813 export interface FileExtensionInfo {
2815 isMixedContent: boolean;
2816 scriptKind?: ScriptKind;
2818 export interface DiagnosticMessage {
2820 category: DiagnosticCategory;
2823 reportsUnnecessary?: {};
2824 reportsDeprecated?: {};
2827 * A linked list of formatted diagnostic messages to be used as part of a multiline message.
2828 * It is built from the bottom up, leaving the head to be the "main" diagnostic.
2829 * While it seems that DiagnosticMessageChain is structurally similar to DiagnosticMessage,
2830 * the difference is that messages are all preformatted in DMC.
2832 export interface DiagnosticMessageChain {
2833 messageText: string;
2834 category: DiagnosticCategory;
2836 next?: DiagnosticMessageChain[];
2838 export interface Diagnostic extends DiagnosticRelatedInformation {
2839 /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
2840 reportsUnnecessary?: {};
2841 reportsDeprecated?: {};
2843 relatedInformation?: DiagnosticRelatedInformation[];
2845 export interface DiagnosticRelatedInformation {
2846 category: DiagnosticCategory;
2848 file: SourceFile | undefined;
2849 start: number | undefined;
2850 length: number | undefined;
2851 messageText: string | DiagnosticMessageChain;
2853 export interface DiagnosticWithLocation extends Diagnostic {
2858 export enum DiagnosticCategory {
2864 export enum ModuleResolutionKind {
2870 export interface PluginImport {
2873 export interface ProjectReference {
2874 /** A normalized path on disk */
2876 /** The path as the user originally wrote it */
2877 originalPath?: string;
2878 /** True if the output of this reference should be prepended to the output of this project. Only valid for --outFile compilations */
2880 /** True if it is intended that this reference form a circularity */
2883 export enum WatchFileKind {
2884 FixedPollingInterval = 0,
2885 PriorityPollingInterval = 1,
2886 DynamicPriorityPolling = 2,
2887 FixedChunkSizePolling = 3,
2889 UseFsEventsOnParentDirectory = 5
2891 export enum WatchDirectoryKind {
2893 FixedPollingInterval = 1,
2894 DynamicPriorityPolling = 2,
2895 FixedChunkSizePolling = 3
2897 export enum PollingWatchKind {
2899 PriorityInterval = 1,
2900 DynamicPriority = 2,
2903 export type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | PluginImport[] | ProjectReference[] | null | undefined;
2904 export interface CompilerOptions {
2906 allowSyntheticDefaultImports?: boolean;
2907 allowUmdGlobalAccess?: boolean;
2908 allowUnreachableCode?: boolean;
2909 allowUnusedLabels?: boolean;
2910 alwaysStrict?: boolean;
2914 declaration?: boolean;
2915 declarationMap?: boolean;
2916 emitDeclarationOnly?: boolean;
2917 declarationDir?: string;
2918 disableSizeLimit?: boolean;
2919 disableSourceOfProjectReferenceRedirect?: boolean;
2920 disableSolutionSearching?: boolean;
2921 disableReferencedProjectLoad?: boolean;
2922 downlevelIteration?: boolean;
2924 emitDecoratorMetadata?: boolean;
2925 exactOptionalPropertyTypes?: boolean;
2926 experimentalDecorators?: boolean;
2927 forceConsistentCasingInFileNames?: boolean;
2928 importHelpers?: boolean;
2929 importsNotUsedAsValues?: ImportsNotUsedAsValues;
2930 inlineSourceMap?: boolean;
2931 inlineSources?: boolean;
2932 isolatedModules?: boolean;
2934 keyofStringsOnly?: boolean;
2938 maxNodeModuleJsDepth?: number;
2939 module?: ModuleKind;
2940 moduleResolution?: ModuleResolutionKind;
2941 newLine?: NewLineKind;
2943 noEmitHelpers?: boolean;
2944 noEmitOnError?: boolean;
2945 noErrorTruncation?: boolean;
2946 noFallthroughCasesInSwitch?: boolean;
2947 noImplicitAny?: boolean;
2948 noImplicitReturns?: boolean;
2949 noImplicitThis?: boolean;
2950 noStrictGenericChecks?: boolean;
2951 noUnusedLocals?: boolean;
2952 noUnusedParameters?: boolean;
2953 noImplicitUseStrict?: boolean;
2954 noPropertyAccessFromIndexSignature?: boolean;
2955 assumeChangesOnlyAffectDirectDependencies?: boolean;
2957 noResolve?: boolean;
2958 noUncheckedIndexedAccess?: boolean;
2962 paths?: MapLike<string[]>;
2963 preserveConstEnums?: boolean;
2964 noImplicitOverride?: boolean;
2965 preserveSymlinks?: boolean;
2966 preserveValueImports?: boolean;
2968 reactNamespace?: string;
2969 jsxFactory?: string;
2970 jsxFragmentFactory?: string;
2971 jsxImportSource?: string;
2972 composite?: boolean;
2973 incremental?: boolean;
2974 tsBuildInfoFile?: string;
2975 removeComments?: boolean;
2977 rootDirs?: string[];
2978 skipLibCheck?: boolean;
2979 skipDefaultLibCheck?: boolean;
2980 sourceMap?: boolean;
2981 sourceRoot?: string;
2983 strictFunctionTypes?: boolean;
2984 strictBindCallApply?: boolean;
2985 strictNullChecks?: boolean;
2986 strictPropertyInitialization?: boolean;
2987 stripInternal?: boolean;
2988 suppressExcessPropertyErrors?: boolean;
2989 suppressImplicitAnyIndexErrors?: boolean;
2990 target?: ScriptTarget;
2991 traceResolution?: boolean;
2992 useUnknownInCatchVariables?: boolean;
2993 resolveJsonModule?: boolean;
2995 /** Paths used to compute primary types search locations */
2996 typeRoots?: string[];
2997 esModuleInterop?: boolean;
2998 useDefineForClassFields?: boolean;
2999 [option: string]: CompilerOptionsValue | TsConfigSourceFile | undefined;
3001 export interface WatchOptions {
3002 watchFile?: WatchFileKind;
3003 watchDirectory?: WatchDirectoryKind;
3004 fallbackPolling?: PollingWatchKind;
3005 synchronousWatchDirectory?: boolean;
3006 excludeDirectories?: string[];
3007 excludeFiles?: string[];
3008 [option: string]: CompilerOptionsValue | undefined;
3010 export interface TypeAcquisition {
3012 * @deprecated typingOptions.enableAutoDiscovery
3013 * Use typeAcquisition.enable instead.
3015 enableAutoDiscovery?: boolean;
3019 disableFilenameBasedTypeAcquisition?: boolean;
3020 [option: string]: CompilerOptionsValue | undefined;
3022 export enum ModuleKind {
3035 export enum JsxEmit {
3043 export enum ImportsNotUsedAsValues {
3048 export enum NewLineKind {
3049 CarriageReturnLineFeed = 0,
3052 export interface LineAndCharacter {
3057 export enum ScriptKind {
3066 * Used on extensions that doesn't define the ScriptKind but the content defines it.
3067 * Deferred extensions are going to be included in all project contexts.
3071 export enum ScriptTarget {
3085 export enum LanguageVariant {
3089 /** Either a parsed command line or a parsed tsconfig.json */
3090 export interface ParsedCommandLine {
3091 options: CompilerOptions;
3092 typeAcquisition?: TypeAcquisition;
3093 fileNames: string[];
3094 projectReferences?: readonly ProjectReference[];
3095 watchOptions?: WatchOptions;
3097 errors: Diagnostic[];
3098 wildcardDirectories?: MapLike<WatchDirectoryFlags>;
3099 compileOnSave?: boolean;
3101 export enum WatchDirectoryFlags {
3105 export interface CreateProgramOptions {
3106 rootNames: readonly string[];
3107 options: CompilerOptions;
3108 projectReferences?: readonly ProjectReference[];
3109 host?: CompilerHost;
3110 oldProgram?: Program;
3111 configFileParsingDiagnostics?: readonly Diagnostic[];
3113 export interface ModuleResolutionHost {
3114 fileExists(fileName: string): boolean;
3115 readFile(fileName: string): string | undefined;
3116 trace?(s: string): void;
3117 directoryExists?(directoryName: string): boolean;
3119 * Resolve a symbolic link.
3120 * @see https://nodejs.org/api/fs.html#fs_fs_realpathsync_path_options
3122 realpath?(path: string): string;
3123 getCurrentDirectory?(): string;
3124 getDirectories?(path: string): string[];
3125 useCaseSensitiveFileNames?: boolean | (() => boolean);
3128 * Represents the result of module resolution.
3129 * Module resolution will pick up tsx/jsx/js files even if '--jsx' and '--allowJs' are turned off.
3130 * The Program will then filter results based on these flags.
3132 * Prefer to return a `ResolvedModuleFull` so that the file type does not have to be inferred.
3134 export interface ResolvedModule {
3135 /** Path of the file the module was resolved to. */
3136 resolvedFileName: string;
3137 /** True if `resolvedFileName` comes from `node_modules`. */
3138 isExternalLibraryImport?: boolean;
3141 * ResolvedModule with an explicitly provided `extension` property.
3142 * Prefer this over `ResolvedModule`.
3143 * If changing this, remember to change `moduleResolutionIsEqualTo`.
3145 export interface ResolvedModuleFull extends ResolvedModule {
3147 * Extension of resolvedFileName. This must match what's at the end of resolvedFileName.
3148 * This is optional for backwards-compatibility, but will be added if not provided.
3150 extension: Extension;
3151 packageId?: PackageId;
3154 * Unique identifier with a package name and version.
3155 * If changing this, remember to change `packageIdIsEqual`.
3157 export interface PackageId {
3159 * Name of the package.
3160 * Should not include `@types`.
3161 * If accessing a non-index file, this should include its name e.g. "foo/bar".
3165 * Name of a submodule within this package.
3168 subModuleName: string;
3169 /** Version of the package, e.g. "1.2.3" */
3172 export enum Extension {
3179 TsBuildInfo = ".tsbuildinfo",
3187 export interface ResolvedModuleWithFailedLookupLocations {
3188 readonly resolvedModule: ResolvedModuleFull | undefined;
3190 export interface ResolvedTypeReferenceDirective {
3192 resolvedFileName: string | undefined;
3193 packageId?: PackageId;
3194 /** True if `resolvedFileName` comes from `node_modules`. */
3195 isExternalLibraryImport?: boolean;
3197 export interface ResolvedTypeReferenceDirectiveWithFailedLookupLocations {
3198 readonly resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective | undefined;
3199 readonly failedLookupLocations: string[];
3201 export interface CompilerHost extends ModuleResolutionHost {
3202 getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): SourceFile | undefined;
3203 getSourceFileByPath?(fileName: string, path: Path, languageVersion: ScriptTarget, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): SourceFile | undefined;
3204 getCancellationToken?(): CancellationToken;
3205 getDefaultLibFileName(options: CompilerOptions): string;
3206 getDefaultLibLocation?(): string;
3207 writeFile: WriteFileCallback;
3208 getCurrentDirectory(): string;
3209 getCanonicalFileName(fileName: string): string;
3210 useCaseSensitiveFileNames(): boolean;
3211 getNewLine(): string;
3212 readDirectory?(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number): string[];
3213 resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[];
3215 * Returns the module resolution cache used by a provided `resolveModuleNames` implementation so that any non-name module resolution operations (eg, package.json lookup) can reuse it
3217 getModuleResolutionCache?(): ModuleResolutionCache | undefined;
3219 * This method is a companion for 'resolveModuleNames' and is used to resolve 'types' references to actual type declaration files
3221 resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
3222 getEnvironmentVariable?(name: string): string | undefined;
3223 createHash?(data: string): string;
3224 getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
3226 export interface SourceMapRange extends TextRange {
3227 source?: SourceMapSource;
3229 export interface SourceMapSource {
3232 skipTrivia?: (pos: number) => number;
3234 export enum EmitFlags {
3237 AdviseOnEmitNode = 2,
3240 NoLeadingSourceMap = 16,
3241 NoTrailingSourceMap = 32,
3243 NoNestedSourceMaps = 64,
3244 NoTokenLeadingSourceMaps = 128,
3245 NoTokenTrailingSourceMaps = 256,
3246 NoTokenSourceMaps = 384,
3247 NoLeadingComments = 512,
3248 NoTrailingComments = 1024,
3250 NoNestedComments = 2048,
3254 InternalName = 32768,
3256 NoIndentation = 131072,
3257 AsyncFunctionBody = 262144,
3258 ReuseTempVariableScope = 524288,
3259 CustomPrologue = 1048576,
3260 NoHoisting = 2097152,
3261 HasEndOfDeclarationMarker = 4194304,
3263 NoAsciiEscaping = 16777216,
3265 export interface EmitHelperBase {
3266 readonly name: string;
3267 readonly scoped: boolean;
3268 readonly text: string | ((node: EmitHelperUniqueNameCallback) => string);
3269 readonly priority?: number;
3270 readonly dependencies?: EmitHelper[];
3272 export interface ScopedEmitHelper extends EmitHelperBase {
3273 readonly scoped: true;
3275 export interface UnscopedEmitHelper extends EmitHelperBase {
3276 readonly scoped: false;
3277 readonly text: string;
3279 export type EmitHelper = ScopedEmitHelper | UnscopedEmitHelper;
3280 export type EmitHelperUniqueNameCallback = (name: string) => string;
3281 export enum EmitHint {
3285 MappedTypeParameter = 3,
3287 EmbeddedStatement = 5,
3288 JsxAttributeValue = 6
3290 export enum OuterExpressionKinds {
3293 NonNullAssertions = 4,
3294 PartiallyEmittedExpressions = 8,
3297 ExcludeJSDocTypeAssertion = 16
3299 export type TypeOfTag = "undefined" | "number" | "bigint" | "boolean" | "string" | "symbol" | "object" | "function";
3300 export interface NodeFactory {
3301 createNodeArray<T extends Node>(elements?: readonly T[], hasTrailingComma?: boolean): NodeArray<T>;
3302 createNumericLiteral(value: string | number, numericLiteralFlags?: TokenFlags): NumericLiteral;
3303 createBigIntLiteral(value: string | PseudoBigInt): BigIntLiteral;
3304 createStringLiteral(text: string, isSingleQuote?: boolean): StringLiteral;
3305 createStringLiteralFromNode(sourceNode: PropertyNameLiteral, isSingleQuote?: boolean): StringLiteral;
3306 createRegularExpressionLiteral(text: string): RegularExpressionLiteral;
3307 createIdentifier(text: string): Identifier;
3309 * Create a unique temporary variable.
3310 * @param recordTempVariable An optional callback used to record the temporary variable name. This
3311 * should usually be a reference to `hoistVariableDeclaration` from a `TransformationContext`, but
3312 * can be `undefined` if you plan to record the temporary variable manually.
3313 * @param reservedInNestedScopes When `true`, reserves the temporary variable name in all nested scopes
3314 * during emit so that the variable can be referenced in a nested function body. This is an alternative to
3315 * setting `EmitFlags.ReuseTempVariableScope` on the nested function itself.
3317 createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined, reservedInNestedScopes?: boolean): Identifier;
3319 * Create a unique temporary variable for use in a loop.
3320 * @param reservedInNestedScopes When `true`, reserves the temporary variable name in all nested scopes
3321 * during emit so that the variable can be referenced in a nested function body. This is an alternative to
3322 * setting `EmitFlags.ReuseTempVariableScope` on the nested function itself.
3324 createLoopVariable(reservedInNestedScopes?: boolean): Identifier;
3325 /** Create a unique name based on the supplied text. */
3326 createUniqueName(text: string, flags?: GeneratedIdentifierFlags): Identifier;
3327 /** Create a unique name generated for a node. */
3328 getGeneratedNameForNode(node: Node | undefined, flags?: GeneratedIdentifierFlags): Identifier;
3329 createPrivateIdentifier(text: string): PrivateIdentifier;
3330 createToken(token: SyntaxKind.SuperKeyword): SuperExpression;
3331 createToken(token: SyntaxKind.ThisKeyword): ThisExpression;
3332 createToken(token: SyntaxKind.NullKeyword): NullLiteral;
3333 createToken(token: SyntaxKind.TrueKeyword): TrueLiteral;
3334 createToken(token: SyntaxKind.FalseKeyword): FalseLiteral;
3335 createToken<TKind extends PunctuationSyntaxKind>(token: TKind): PunctuationToken<TKind>;
3336 createToken<TKind extends KeywordTypeSyntaxKind>(token: TKind): KeywordTypeNode<TKind>;
3337 createToken<TKind extends ModifierSyntaxKind>(token: TKind): ModifierToken<TKind>;
3338 createToken<TKind extends KeywordSyntaxKind>(token: TKind): KeywordToken<TKind>;
3339 createToken<TKind extends SyntaxKind.Unknown | SyntaxKind.EndOfFileToken>(token: TKind): Token<TKind>;
3340 createSuper(): SuperExpression;
3341 createThis(): ThisExpression;
3342 createNull(): NullLiteral;
3343 createTrue(): TrueLiteral;
3344 createFalse(): FalseLiteral;
3345 createModifier<T extends ModifierSyntaxKind>(kind: T): ModifierToken<T>;
3346 createModifiersFromModifierFlags(flags: ModifierFlags): Modifier[];
3347 createQualifiedName(left: EntityName, right: string | Identifier): QualifiedName;
3348 updateQualifiedName(node: QualifiedName, left: EntityName, right: Identifier): QualifiedName;
3349 createComputedPropertyName(expression: Expression): ComputedPropertyName;
3350 updateComputedPropertyName(node: ComputedPropertyName, expression: Expression): ComputedPropertyName;
3351 createTypeParameterDeclaration(name: string | Identifier, constraint?: TypeNode, defaultType?: TypeNode): TypeParameterDeclaration;
3352 updateTypeParameterDeclaration(node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration;
3353 createParameterDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken?: QuestionToken, type?: TypeNode, initializer?: Expression): ParameterDeclaration;
3354 updateParameterDeclaration(node: ParameterDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): ParameterDeclaration;
3355 createDecorator(expression: Expression): Decorator;
3356 updateDecorator(node: Decorator, expression: Expression): Decorator;
3357 createPropertySignature(modifiers: readonly Modifier[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature;
3358 updatePropertySignature(node: PropertySignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature;
3359 createPropertyDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
3360 updatePropertyDeclaration(node: PropertyDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
3361 createMethodSignature(modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): MethodSignature;
3362 updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): MethodSignature;
3363 createMethodDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
3364 updateMethodDeclaration(node: MethodDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
3365 createConstructorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
3366 updateConstructorDeclaration(node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
3367 createGetAccessorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
3368 updateGetAccessorDeclaration(node: GetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
3369 createSetAccessorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration;
3370 updateSetAccessorDeclaration(node: SetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration;
3371 createCallSignature(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): CallSignatureDeclaration;
3372 updateCallSignature(node: CallSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): CallSignatureDeclaration;
3373 createConstructSignature(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): ConstructSignatureDeclaration;
3374 updateConstructSignature(node: ConstructSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): ConstructSignatureDeclaration;
3375 createIndexSignature(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration;
3376 updateIndexSignature(node: IndexSignatureDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration;
3377 createTemplateLiteralTypeSpan(type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan;
3378 updateTemplateLiteralTypeSpan(node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan;
3379 createClassStaticBlockDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, body: Block): ClassStaticBlockDeclaration;
3380 updateClassStaticBlockDeclaration(node: ClassStaticBlockDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, body: Block): ClassStaticBlockDeclaration;
3381 createKeywordTypeNode<TKind extends KeywordTypeSyntaxKind>(kind: TKind): KeywordTypeNode<TKind>;
3382 createTypePredicateNode(assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode | string, type: TypeNode | undefined): TypePredicateNode;
3383 updateTypePredicateNode(node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined): TypePredicateNode;
3384 createTypeReferenceNode(typeName: string | EntityName, typeArguments?: readonly TypeNode[]): TypeReferenceNode;
3385 updateTypeReferenceNode(node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray<TypeNode> | undefined): TypeReferenceNode;
3386 createFunctionTypeNode(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): FunctionTypeNode;
3387 updateFunctionTypeNode(node: FunctionTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode): FunctionTypeNode;
3388 createConstructorTypeNode(modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode;
3390 createConstructorTypeNode(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode;
3391 updateConstructorTypeNode(node: ConstructorTypeNode, modifiers: readonly Modifier[] | undefined, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode): ConstructorTypeNode;
3393 updateConstructorTypeNode(node: ConstructorTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode): ConstructorTypeNode;
3394 createTypeQueryNode(exprName: EntityName): TypeQueryNode;
3395 updateTypeQueryNode(node: TypeQueryNode, exprName: EntityName): TypeQueryNode;
3396 createTypeLiteralNode(members: readonly TypeElement[] | undefined): TypeLiteralNode;
3397 updateTypeLiteralNode(node: TypeLiteralNode, members: NodeArray<TypeElement>): TypeLiteralNode;
3398 createArrayTypeNode(elementType: TypeNode): ArrayTypeNode;
3399 updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode;
3400 createTupleTypeNode(elements: readonly (TypeNode | NamedTupleMember)[]): TupleTypeNode;
3401 updateTupleTypeNode(node: TupleTypeNode, elements: readonly (TypeNode | NamedTupleMember)[]): TupleTypeNode;
3402 createNamedTupleMember(dotDotDotToken: DotDotDotToken | undefined, name: Identifier, questionToken: QuestionToken | undefined, type: TypeNode): NamedTupleMember;
3403 updateNamedTupleMember(node: NamedTupleMember, dotDotDotToken: DotDotDotToken | undefined, name: Identifier, questionToken: QuestionToken | undefined, type: TypeNode): NamedTupleMember;
3404 createOptionalTypeNode(type: TypeNode): OptionalTypeNode;
3405 updateOptionalTypeNode(node: OptionalTypeNode, type: TypeNode): OptionalTypeNode;
3406 createRestTypeNode(type: TypeNode): RestTypeNode;
3407 updateRestTypeNode(node: RestTypeNode, type: TypeNode): RestTypeNode;
3408 createUnionTypeNode(types: readonly TypeNode[]): UnionTypeNode;
3409 updateUnionTypeNode(node: UnionTypeNode, types: NodeArray<TypeNode>): UnionTypeNode;
3410 createIntersectionTypeNode(types: readonly TypeNode[]): IntersectionTypeNode;
3411 updateIntersectionTypeNode(node: IntersectionTypeNode, types: NodeArray<TypeNode>): IntersectionTypeNode;
3412 createConditionalTypeNode(checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode;
3413 updateConditionalTypeNode(node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode;
3414 createInferTypeNode(typeParameter: TypeParameterDeclaration): InferTypeNode;
3415 updateInferTypeNode(node: InferTypeNode, typeParameter: TypeParameterDeclaration): InferTypeNode;
3416 createImportTypeNode(argument: TypeNode, qualifier?: EntityName, typeArguments?: readonly TypeNode[], isTypeOf?: boolean): ImportTypeNode;
3417 updateImportTypeNode(node: ImportTypeNode, argument: TypeNode, qualifier: EntityName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf?: boolean): ImportTypeNode;
3418 createParenthesizedType(type: TypeNode): ParenthesizedTypeNode;
3419 updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode;
3420 createThisTypeNode(): ThisTypeNode;
3421 createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode;
3422 updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode;
3423 createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode;
3424 updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode;
3425 createMappedTypeNode(readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined, members: NodeArray<TypeElement> | undefined): MappedTypeNode;
3426 updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined, members: NodeArray<TypeElement> | undefined): MappedTypeNode;
3427 createLiteralTypeNode(literal: LiteralTypeNode["literal"]): LiteralTypeNode;
3428 updateLiteralTypeNode(node: LiteralTypeNode, literal: LiteralTypeNode["literal"]): LiteralTypeNode;
3429 createTemplateLiteralType(head: TemplateHead, templateSpans: readonly TemplateLiteralTypeSpan[]): TemplateLiteralTypeNode;
3430 updateTemplateLiteralType(node: TemplateLiteralTypeNode, head: TemplateHead, templateSpans: readonly TemplateLiteralTypeSpan[]): TemplateLiteralTypeNode;
3431 createObjectBindingPattern(elements: readonly BindingElement[]): ObjectBindingPattern;
3432 updateObjectBindingPattern(node: ObjectBindingPattern, elements: readonly BindingElement[]): ObjectBindingPattern;
3433 createArrayBindingPattern(elements: readonly ArrayBindingElement[]): ArrayBindingPattern;
3434 updateArrayBindingPattern(node: ArrayBindingPattern, elements: readonly ArrayBindingElement[]): ArrayBindingPattern;
3435 createBindingElement(dotDotDotToken: DotDotDotToken | undefined, propertyName: string | PropertyName | undefined, name: string | BindingName, initializer?: Expression): BindingElement;
3436 updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken | undefined, propertyName: PropertyName | undefined, name: BindingName, initializer: Expression | undefined): BindingElement;
3437 createArrayLiteralExpression(elements?: readonly Expression[], multiLine?: boolean): ArrayLiteralExpression;
3438 updateArrayLiteralExpression(node: ArrayLiteralExpression, elements: readonly Expression[]): ArrayLiteralExpression;
3439 createObjectLiteralExpression(properties?: readonly ObjectLiteralElementLike[], multiLine?: boolean): ObjectLiteralExpression;
3440 updateObjectLiteralExpression(node: ObjectLiteralExpression, properties: readonly ObjectLiteralElementLike[]): ObjectLiteralExpression;
3441 createPropertyAccessExpression(expression: Expression, name: string | MemberName): PropertyAccessExpression;
3442 updatePropertyAccessExpression(node: PropertyAccessExpression, expression: Expression, name: MemberName): PropertyAccessExpression;
3443 createPropertyAccessChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, name: string | MemberName): PropertyAccessChain;
3444 updatePropertyAccessChain(node: PropertyAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, name: MemberName): PropertyAccessChain;
3445 createElementAccessExpression(expression: Expression, index: number | Expression): ElementAccessExpression;
3446 updateElementAccessExpression(node: ElementAccessExpression, expression: Expression, argumentExpression: Expression): ElementAccessExpression;
3447 createElementAccessChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, index: number | Expression): ElementAccessChain;
3448 updateElementAccessChain(node: ElementAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, argumentExpression: Expression): ElementAccessChain;
3449 createCallExpression(expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): CallExpression;
3450 updateCallExpression(node: CallExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]): CallExpression;
3451 createCallChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): CallChain;
3452 updateCallChain(node: CallChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]): CallChain;
3453 createNewExpression(expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): NewExpression;
3454 updateNewExpression(node: NewExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): NewExpression;
3455 createTaggedTemplateExpression(tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression;
3456 updateTaggedTemplateExpression(node: TaggedTemplateExpression, tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression;
3457 createTypeAssertion(type: TypeNode, expression: Expression): TypeAssertion;
3458 updateTypeAssertion(node: TypeAssertion, type: TypeNode, expression: Expression): TypeAssertion;
3459 createParenthesizedExpression(expression: Expression): ParenthesizedExpression;
3460 updateParenthesizedExpression(node: ParenthesizedExpression, expression: Expression): ParenthesizedExpression;
3461 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;
3462 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;
3463 createArrowFunction(modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction;
3464 updateArrowFunction(node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken, body: ConciseBody): ArrowFunction;
3465 createDeleteExpression(expression: Expression): DeleteExpression;
3466 updateDeleteExpression(node: DeleteExpression, expression: Expression): DeleteExpression;
3467 createTypeOfExpression(expression: Expression): TypeOfExpression;
3468 updateTypeOfExpression(node: TypeOfExpression, expression: Expression): TypeOfExpression;
3469 createVoidExpression(expression: Expression): VoidExpression;
3470 updateVoidExpression(node: VoidExpression, expression: Expression): VoidExpression;
3471 createAwaitExpression(expression: Expression): AwaitExpression;
3472 updateAwaitExpression(node: AwaitExpression, expression: Expression): AwaitExpression;
3473 createPrefixUnaryExpression(operator: PrefixUnaryOperator, operand: Expression): PrefixUnaryExpression;
3474 updatePrefixUnaryExpression(node: PrefixUnaryExpression, operand: Expression): PrefixUnaryExpression;
3475 createPostfixUnaryExpression(operand: Expression, operator: PostfixUnaryOperator): PostfixUnaryExpression;
3476 updatePostfixUnaryExpression(node: PostfixUnaryExpression, operand: Expression): PostfixUnaryExpression;
3477 createBinaryExpression(left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression): BinaryExpression;
3478 updateBinaryExpression(node: BinaryExpression, left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression): BinaryExpression;
3479 createConditionalExpression(condition: Expression, questionToken: QuestionToken | undefined, whenTrue: Expression, colonToken: ColonToken | undefined, whenFalse: Expression): ConditionalExpression;
3480 updateConditionalExpression(node: ConditionalExpression, condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression;
3481 createTemplateExpression(head: TemplateHead, templateSpans: readonly TemplateSpan[]): TemplateExpression;
3482 updateTemplateExpression(node: TemplateExpression, head: TemplateHead, templateSpans: readonly TemplateSpan[]): TemplateExpression;
3483 createTemplateHead(text: string, rawText?: string, templateFlags?: TokenFlags): TemplateHead;
3484 createTemplateHead(text: string | undefined, rawText: string, templateFlags?: TokenFlags): TemplateHead;
3485 createTemplateMiddle(text: string, rawText?: string, templateFlags?: TokenFlags): TemplateMiddle;
3486 createTemplateMiddle(text: string | undefined, rawText: string, templateFlags?: TokenFlags): TemplateMiddle;
3487 createTemplateTail(text: string, rawText?: string, templateFlags?: TokenFlags): TemplateTail;
3488 createTemplateTail(text: string | undefined, rawText: string, templateFlags?: TokenFlags): TemplateTail;
3489 createNoSubstitutionTemplateLiteral(text: string, rawText?: string): NoSubstitutionTemplateLiteral;
3490 createNoSubstitutionTemplateLiteral(text: string | undefined, rawText: string): NoSubstitutionTemplateLiteral;
3491 createYieldExpression(asteriskToken: AsteriskToken, expression: Expression): YieldExpression;
3492 createYieldExpression(asteriskToken: undefined, expression: Expression | undefined): YieldExpression;
3493 updateYieldExpression(node: YieldExpression, asteriskToken: AsteriskToken | undefined, expression: Expression | undefined): YieldExpression;
3494 createSpreadElement(expression: Expression): SpreadElement;
3495 updateSpreadElement(node: SpreadElement, expression: Expression): SpreadElement;
3496 createClassExpression(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassExpression;
3497 updateClassExpression(node: ClassExpression, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassExpression;
3498 createOmittedExpression(): OmittedExpression;
3499 createExpressionWithTypeArguments(expression: Expression, typeArguments: readonly TypeNode[] | undefined): ExpressionWithTypeArguments;
3500 updateExpressionWithTypeArguments(node: ExpressionWithTypeArguments, expression: Expression, typeArguments: readonly TypeNode[] | undefined): ExpressionWithTypeArguments;
3501 createAsExpression(expression: Expression, type: TypeNode): AsExpression;
3502 updateAsExpression(node: AsExpression, expression: Expression, type: TypeNode): AsExpression;
3503 createNonNullExpression(expression: Expression): NonNullExpression;
3504 updateNonNullExpression(node: NonNullExpression, expression: Expression): NonNullExpression;
3505 createNonNullChain(expression: Expression): NonNullChain;
3506 updateNonNullChain(node: NonNullChain, expression: Expression): NonNullChain;
3507 createMetaProperty(keywordToken: MetaProperty["keywordToken"], name: Identifier): MetaProperty;
3508 updateMetaProperty(node: MetaProperty, name: Identifier): MetaProperty;
3509 createTemplateSpan(expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan;
3510 updateTemplateSpan(node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan;
3511 createSemicolonClassElement(): SemicolonClassElement;
3512 createBlock(statements: readonly Statement[], multiLine?: boolean): Block;
3513 updateBlock(node: Block, statements: readonly Statement[]): Block;
3514 createVariableStatement(modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList | readonly VariableDeclaration[]): VariableStatement;
3515 updateVariableStatement(node: VariableStatement, modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList): VariableStatement;
3516 createEmptyStatement(): EmptyStatement;
3517 createExpressionStatement(expression: Expression): ExpressionStatement;
3518 updateExpressionStatement(node: ExpressionStatement, expression: Expression): ExpressionStatement;
3519 createIfStatement(expression: Expression, thenStatement: Statement, elseStatement?: Statement): IfStatement;
3520 updateIfStatement(node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement | undefined): IfStatement;
3521 createDoStatement(statement: Statement, expression: Expression): DoStatement;
3522 updateDoStatement(node: DoStatement, statement: Statement, expression: Expression): DoStatement;
3523 createWhileStatement(expression: Expression, statement: Statement): WhileStatement;
3524 updateWhileStatement(node: WhileStatement, expression: Expression, statement: Statement): WhileStatement;
3525 createForStatement(initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement;
3526 updateForStatement(node: ForStatement, initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement;
3527 createForInStatement(initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement;
3528 updateForInStatement(node: ForInStatement, initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement;
3529 createForOfStatement(awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement;
3530 updateForOfStatement(node: ForOfStatement, awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement;
3531 createContinueStatement(label?: string | Identifier): ContinueStatement;
3532 updateContinueStatement(node: ContinueStatement, label: Identifier | undefined): ContinueStatement;
3533 createBreakStatement(label?: string | Identifier): BreakStatement;
3534 updateBreakStatement(node: BreakStatement, label: Identifier | undefined): BreakStatement;
3535 createReturnStatement(expression?: Expression): ReturnStatement;
3536 updateReturnStatement(node: ReturnStatement, expression: Expression | undefined): ReturnStatement;
3537 createWithStatement(expression: Expression, statement: Statement): WithStatement;
3538 updateWithStatement(node: WithStatement, expression: Expression, statement: Statement): WithStatement;
3539 createSwitchStatement(expression: Expression, caseBlock: CaseBlock): SwitchStatement;
3540 updateSwitchStatement(node: SwitchStatement, expression: Expression, caseBlock: CaseBlock): SwitchStatement;
3541 createLabeledStatement(label: string | Identifier, statement: Statement): LabeledStatement;
3542 updateLabeledStatement(node: LabeledStatement, label: Identifier, statement: Statement): LabeledStatement;
3543 createThrowStatement(expression: Expression): ThrowStatement;
3544 updateThrowStatement(node: ThrowStatement, expression: Expression): ThrowStatement;
3545 createTryStatement(tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement;
3546 updateTryStatement(node: TryStatement, tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement;
3547 createDebuggerStatement(): DebuggerStatement;
3548 createVariableDeclaration(name: string | BindingName, exclamationToken?: ExclamationToken, type?: TypeNode, initializer?: Expression): VariableDeclaration;
3549 updateVariableDeclaration(node: VariableDeclaration, name: BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration;
3550 createVariableDeclarationList(declarations: readonly VariableDeclaration[], flags?: NodeFlags): VariableDeclarationList;
3551 updateVariableDeclarationList(node: VariableDeclarationList, declarations: readonly VariableDeclaration[]): VariableDeclarationList;
3552 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;
3553 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;
3554 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;
3555 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;
3556 createInterfaceDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
3557 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;
3558 createTypeAliasDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
3559 updateTypeAliasDeclaration(node: TypeAliasDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
3560 createEnumDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration;
3561 updateEnumDeclaration(node: EnumDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration;
3562 createModuleDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration;
3563 updateModuleDeclaration(node: ModuleDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration;
3564 createModuleBlock(statements: readonly Statement[]): ModuleBlock;
3565 updateModuleBlock(node: ModuleBlock, statements: readonly Statement[]): ModuleBlock;
3566 createCaseBlock(clauses: readonly CaseOrDefaultClause[]): CaseBlock;
3567 updateCaseBlock(node: CaseBlock, clauses: readonly CaseOrDefaultClause[]): CaseBlock;
3568 createNamespaceExportDeclaration(name: string | Identifier): NamespaceExportDeclaration;
3569 updateNamespaceExportDeclaration(node: NamespaceExportDeclaration, name: Identifier): NamespaceExportDeclaration;
3570 createImportEqualsDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration;
3571 updateImportEqualsDeclaration(node: ImportEqualsDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration;
3572 createImportDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause?: AssertClause): ImportDeclaration;
3573 updateImportDeclaration(node: ImportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration;
3574 createImportClause(isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause;
3575 updateImportClause(node: ImportClause, isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause;
3576 createAssertClause(elements: NodeArray<AssertEntry>, multiLine?: boolean): AssertClause;
3577 updateAssertClause(node: AssertClause, elements: NodeArray<AssertEntry>, multiLine?: boolean): AssertClause;
3578 createAssertEntry(name: AssertionKey, value: StringLiteral): AssertEntry;
3579 updateAssertEntry(node: AssertEntry, name: AssertionKey, value: StringLiteral): AssertEntry;
3580 createNamespaceImport(name: Identifier): NamespaceImport;
3581 updateNamespaceImport(node: NamespaceImport, name: Identifier): NamespaceImport;
3582 createNamespaceExport(name: Identifier): NamespaceExport;
3583 updateNamespaceExport(node: NamespaceExport, name: Identifier): NamespaceExport;
3584 createNamedImports(elements: readonly ImportSpecifier[]): NamedImports;
3585 updateNamedImports(node: NamedImports, elements: readonly ImportSpecifier[]): NamedImports;
3586 createImportSpecifier(isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier;
3587 updateImportSpecifier(node: ImportSpecifier, isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier;
3588 createExportAssignment(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment;
3589 updateExportAssignment(node: ExportAssignment, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, expression: Expression): ExportAssignment;
3590 createExportDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, assertClause?: AssertClause): ExportDeclaration;
3591 updateExportDeclaration(node: ExportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, assertClause: AssertClause | undefined): ExportDeclaration;
3592 createNamedExports(elements: readonly ExportSpecifier[]): NamedExports;
3593 updateNamedExports(node: NamedExports, elements: readonly ExportSpecifier[]): NamedExports;
3594 createExportSpecifier(isTypeOnly: boolean, propertyName: string | Identifier | undefined, name: string | Identifier): ExportSpecifier;
3595 updateExportSpecifier(node: ExportSpecifier, isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier): ExportSpecifier;
3596 createExternalModuleReference(expression: Expression): ExternalModuleReference;
3597 updateExternalModuleReference(node: ExternalModuleReference, expression: Expression): ExternalModuleReference;
3598 createJSDocAllType(): JSDocAllType;
3599 createJSDocUnknownType(): JSDocUnknownType;
3600 createJSDocNonNullableType(type: TypeNode): JSDocNonNullableType;
3601 updateJSDocNonNullableType(node: JSDocNonNullableType, type: TypeNode): JSDocNonNullableType;
3602 createJSDocNullableType(type: TypeNode): JSDocNullableType;
3603 updateJSDocNullableType(node: JSDocNullableType, type: TypeNode): JSDocNullableType;
3604 createJSDocOptionalType(type: TypeNode): JSDocOptionalType;
3605 updateJSDocOptionalType(node: JSDocOptionalType, type: TypeNode): JSDocOptionalType;
3606 createJSDocFunctionType(parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): JSDocFunctionType;
3607 updateJSDocFunctionType(node: JSDocFunctionType, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): JSDocFunctionType;
3608 createJSDocVariadicType(type: TypeNode): JSDocVariadicType;
3609 updateJSDocVariadicType(node: JSDocVariadicType, type: TypeNode): JSDocVariadicType;
3610 createJSDocNamepathType(type: TypeNode): JSDocNamepathType;
3611 updateJSDocNamepathType(node: JSDocNamepathType, type: TypeNode): JSDocNamepathType;
3612 createJSDocTypeExpression(type: TypeNode): JSDocTypeExpression;
3613 updateJSDocTypeExpression(node: JSDocTypeExpression, type: TypeNode): JSDocTypeExpression;
3614 createJSDocNameReference(name: EntityName | JSDocMemberName): JSDocNameReference;
3615 updateJSDocNameReference(node: JSDocNameReference, name: EntityName | JSDocMemberName): JSDocNameReference;
3616 createJSDocMemberName(left: EntityName | JSDocMemberName, right: Identifier): JSDocMemberName;
3617 updateJSDocMemberName(node: JSDocMemberName, left: EntityName | JSDocMemberName, right: Identifier): JSDocMemberName;
3618 createJSDocLink(name: EntityName | JSDocMemberName | undefined, text: string): JSDocLink;
3619 updateJSDocLink(node: JSDocLink, name: EntityName | JSDocMemberName | undefined, text: string): JSDocLink;
3620 createJSDocLinkCode(name: EntityName | JSDocMemberName | undefined, text: string): JSDocLinkCode;
3621 updateJSDocLinkCode(node: JSDocLinkCode, name: EntityName | JSDocMemberName | undefined, text: string): JSDocLinkCode;
3622 createJSDocLinkPlain(name: EntityName | JSDocMemberName | undefined, text: string): JSDocLinkPlain;
3623 updateJSDocLinkPlain(node: JSDocLinkPlain, name: EntityName | JSDocMemberName | undefined, text: string): JSDocLinkPlain;
3624 createJSDocTypeLiteral(jsDocPropertyTags?: readonly JSDocPropertyLikeTag[], isArrayType?: boolean): JSDocTypeLiteral;
3625 updateJSDocTypeLiteral(node: JSDocTypeLiteral, jsDocPropertyTags: readonly JSDocPropertyLikeTag[] | undefined, isArrayType: boolean | undefined): JSDocTypeLiteral;
3626 createJSDocSignature(typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type?: JSDocReturnTag): JSDocSignature;
3627 updateJSDocSignature(node: JSDocSignature, typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type: JSDocReturnTag | undefined): JSDocSignature;
3628 createJSDocTemplateTag(tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment?: string | NodeArray<JSDocComment>): JSDocTemplateTag;
3629 updateJSDocTemplateTag(node: JSDocTemplateTag, tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment: string | NodeArray<JSDocComment> | undefined): JSDocTemplateTag;
3630 createJSDocTypedefTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression | JSDocTypeLiteral, fullName?: Identifier | JSDocNamespaceDeclaration, comment?: string | NodeArray<JSDocComment>): JSDocTypedefTag;
3631 updateJSDocTypedefTag(node: JSDocTypedefTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | JSDocTypeLiteral | undefined, fullName: Identifier | JSDocNamespaceDeclaration | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocTypedefTag;
3632 createJSDocParameterTag(tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression, isNameFirst?: boolean, comment?: string | NodeArray<JSDocComment>): JSDocParameterTag;
3633 updateJSDocParameterTag(node: JSDocParameterTag, tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression: JSDocTypeExpression | undefined, isNameFirst: boolean, comment: string | NodeArray<JSDocComment> | undefined): JSDocParameterTag;
3634 createJSDocPropertyTag(tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression, isNameFirst?: boolean, comment?: string | NodeArray<JSDocComment>): JSDocPropertyTag;
3635 updateJSDocPropertyTag(node: JSDocPropertyTag, tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression: JSDocTypeExpression | undefined, isNameFirst: boolean, comment: string | NodeArray<JSDocComment> | undefined): JSDocPropertyTag;
3636 createJSDocTypeTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment>): JSDocTypeTag;
3637 updateJSDocTypeTag(node: JSDocTypeTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | NodeArray<JSDocComment> | undefined): JSDocTypeTag;
3638 createJSDocSeeTag(tagName: Identifier | undefined, nameExpression: JSDocNameReference | undefined, comment?: string | NodeArray<JSDocComment>): JSDocSeeTag;
3639 updateJSDocSeeTag(node: JSDocSeeTag, tagName: Identifier | undefined, nameExpression: JSDocNameReference | undefined, comment?: string | NodeArray<JSDocComment>): JSDocSeeTag;
3640 createJSDocReturnTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment>): JSDocReturnTag;
3641 updateJSDocReturnTag(node: JSDocReturnTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocReturnTag;
3642 createJSDocThisTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment>): JSDocThisTag;
3643 updateJSDocThisTag(node: JSDocThisTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocThisTag;
3644 createJSDocEnumTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment>): JSDocEnumTag;
3645 updateJSDocEnumTag(node: JSDocEnumTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | NodeArray<JSDocComment> | undefined): JSDocEnumTag;
3646 createJSDocCallbackTag(tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName?: Identifier | JSDocNamespaceDeclaration, comment?: string | NodeArray<JSDocComment>): JSDocCallbackTag;
3647 updateJSDocCallbackTag(node: JSDocCallbackTag, tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName: Identifier | JSDocNamespaceDeclaration | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocCallbackTag;
3648 createJSDocAugmentsTag(tagName: Identifier | undefined, className: JSDocAugmentsTag["class"], comment?: string | NodeArray<JSDocComment>): JSDocAugmentsTag;
3649 updateJSDocAugmentsTag(node: JSDocAugmentsTag, tagName: Identifier | undefined, className: JSDocAugmentsTag["class"], comment: string | NodeArray<JSDocComment> | undefined): JSDocAugmentsTag;
3650 createJSDocImplementsTag(tagName: Identifier | undefined, className: JSDocImplementsTag["class"], comment?: string | NodeArray<JSDocComment>): JSDocImplementsTag;
3651 updateJSDocImplementsTag(node: JSDocImplementsTag, tagName: Identifier | undefined, className: JSDocImplementsTag["class"], comment: string | NodeArray<JSDocComment> | undefined): JSDocImplementsTag;
3652 createJSDocAuthorTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocAuthorTag;
3653 updateJSDocAuthorTag(node: JSDocAuthorTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocAuthorTag;
3654 createJSDocClassTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocClassTag;
3655 updateJSDocClassTag(node: JSDocClassTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocClassTag;
3656 createJSDocPublicTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocPublicTag;
3657 updateJSDocPublicTag(node: JSDocPublicTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocPublicTag;
3658 createJSDocPrivateTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocPrivateTag;
3659 updateJSDocPrivateTag(node: JSDocPrivateTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocPrivateTag;
3660 createJSDocProtectedTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocProtectedTag;
3661 updateJSDocProtectedTag(node: JSDocProtectedTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocProtectedTag;
3662 createJSDocReadonlyTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocReadonlyTag;
3663 updateJSDocReadonlyTag(node: JSDocReadonlyTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocReadonlyTag;
3664 createJSDocUnknownTag(tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocUnknownTag;
3665 updateJSDocUnknownTag(node: JSDocUnknownTag, tagName: Identifier, comment: string | NodeArray<JSDocComment> | undefined): JSDocUnknownTag;
3666 createJSDocDeprecatedTag(tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag;
3667 updateJSDocDeprecatedTag(node: JSDocDeprecatedTag, tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag;
3668 createJSDocOverrideTag(tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag;
3669 updateJSDocOverrideTag(node: JSDocOverrideTag, tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag;
3670 createJSDocText(text: string): JSDocText;
3671 updateJSDocText(node: JSDocText, text: string): JSDocText;
3672 createJSDocComment(comment?: string | NodeArray<JSDocComment> | undefined, tags?: readonly JSDocTag[] | undefined): JSDoc;
3673 updateJSDocComment(node: JSDoc, comment: string | NodeArray<JSDocComment> | undefined, tags: readonly JSDocTag[] | undefined): JSDoc;
3674 createJsxElement(openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement): JsxElement;
3675 updateJsxElement(node: JsxElement, openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement): JsxElement;
3676 createJsxSelfClosingElement(tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxSelfClosingElement;
3677 updateJsxSelfClosingElement(node: JsxSelfClosingElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxSelfClosingElement;
3678 createJsxOpeningElement(tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxOpeningElement;
3679 updateJsxOpeningElement(node: JsxOpeningElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxOpeningElement;
3680 createJsxClosingElement(tagName: JsxTagNameExpression): JsxClosingElement;
3681 updateJsxClosingElement(node: JsxClosingElement, tagName: JsxTagNameExpression): JsxClosingElement;
3682 createJsxFragment(openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment): JsxFragment;
3683 createJsxText(text: string, containsOnlyTriviaWhiteSpaces?: boolean): JsxText;
3684 updateJsxText(node: JsxText, text: string, containsOnlyTriviaWhiteSpaces?: boolean): JsxText;
3685 createJsxOpeningFragment(): JsxOpeningFragment;
3686 createJsxJsxClosingFragment(): JsxClosingFragment;
3687 updateJsxFragment(node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment): JsxFragment;
3688 createJsxAttribute(name: Identifier, initializer: StringLiteral | JsxExpression | undefined): JsxAttribute;
3689 updateJsxAttribute(node: JsxAttribute, name: Identifier, initializer: StringLiteral | JsxExpression | undefined): JsxAttribute;
3690 createJsxAttributes(properties: readonly JsxAttributeLike[]): JsxAttributes;
3691 updateJsxAttributes(node: JsxAttributes, properties: readonly JsxAttributeLike[]): JsxAttributes;
3692 createJsxSpreadAttribute(expression: Expression): JsxSpreadAttribute;
3693 updateJsxSpreadAttribute(node: JsxSpreadAttribute, expression: Expression): JsxSpreadAttribute;
3694 createJsxExpression(dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined): JsxExpression;
3695 updateJsxExpression(node: JsxExpression, expression: Expression | undefined): JsxExpression;
3696 createCaseClause(expression: Expression, statements: readonly Statement[]): CaseClause;
3697 updateCaseClause(node: CaseClause, expression: Expression, statements: readonly Statement[]): CaseClause;
3698 createDefaultClause(statements: readonly Statement[]): DefaultClause;
3699 updateDefaultClause(node: DefaultClause, statements: readonly Statement[]): DefaultClause;
3700 createHeritageClause(token: HeritageClause["token"], types: readonly ExpressionWithTypeArguments[]): HeritageClause;
3701 updateHeritageClause(node: HeritageClause, types: readonly ExpressionWithTypeArguments[]): HeritageClause;
3702 createCatchClause(variableDeclaration: string | BindingName | VariableDeclaration | undefined, block: Block): CatchClause;
3703 updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration | undefined, block: Block): CatchClause;
3704 createPropertyAssignment(name: string | PropertyName, initializer: Expression): PropertyAssignment;
3705 updatePropertyAssignment(node: PropertyAssignment, name: PropertyName, initializer: Expression): PropertyAssignment;
3706 createShorthandPropertyAssignment(name: string | Identifier, objectAssignmentInitializer?: Expression): ShorthandPropertyAssignment;
3707 updateShorthandPropertyAssignment(node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression | undefined): ShorthandPropertyAssignment;
3708 createSpreadAssignment(expression: Expression): SpreadAssignment;
3709 updateSpreadAssignment(node: SpreadAssignment, expression: Expression): SpreadAssignment;
3710 createEnumMember(name: string | PropertyName, initializer?: Expression): EnumMember;
3711 updateEnumMember(node: EnumMember, name: PropertyName, initializer: Expression | undefined): EnumMember;
3712 createSourceFile(statements: readonly Statement[], endOfFileToken: EndOfFileToken, flags: NodeFlags): SourceFile;
3713 updateSourceFile(node: SourceFile, statements: readonly Statement[], isDeclarationFile?: boolean, referencedFiles?: readonly FileReference[], typeReferences?: readonly FileReference[], hasNoDefaultLib?: boolean, libReferences?: readonly FileReference[]): SourceFile;
3714 createNotEmittedStatement(original: Node): NotEmittedStatement;
3715 createPartiallyEmittedExpression(expression: Expression, original?: Node): PartiallyEmittedExpression;
3716 updatePartiallyEmittedExpression(node: PartiallyEmittedExpression, expression: Expression): PartiallyEmittedExpression;
3717 createCommaListExpression(elements: readonly Expression[]): CommaListExpression;
3718 updateCommaListExpression(node: CommaListExpression, elements: readonly Expression[]): CommaListExpression;
3719 createBundle(sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle;
3720 updateBundle(node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle;
3721 createComma(left: Expression, right: Expression): BinaryExpression;
3722 createAssignment(left: ObjectLiteralExpression | ArrayLiteralExpression, right: Expression): DestructuringAssignment;
3723 createAssignment(left: Expression, right: Expression): AssignmentExpression<EqualsToken>;
3724 createLogicalOr(left: Expression, right: Expression): BinaryExpression;
3725 createLogicalAnd(left: Expression, right: Expression): BinaryExpression;
3726 createBitwiseOr(left: Expression, right: Expression): BinaryExpression;
3727 createBitwiseXor(left: Expression, right: Expression): BinaryExpression;
3728 createBitwiseAnd(left: Expression, right: Expression): BinaryExpression;
3729 createStrictEquality(left: Expression, right: Expression): BinaryExpression;
3730 createStrictInequality(left: Expression, right: Expression): BinaryExpression;
3731 createEquality(left: Expression, right: Expression): BinaryExpression;
3732 createInequality(left: Expression, right: Expression): BinaryExpression;
3733 createLessThan(left: Expression, right: Expression): BinaryExpression;
3734 createLessThanEquals(left: Expression, right: Expression): BinaryExpression;
3735 createGreaterThan(left: Expression, right: Expression): BinaryExpression;
3736 createGreaterThanEquals(left: Expression, right: Expression): BinaryExpression;
3737 createLeftShift(left: Expression, right: Expression): BinaryExpression;
3738 createRightShift(left: Expression, right: Expression): BinaryExpression;
3739 createUnsignedRightShift(left: Expression, right: Expression): BinaryExpression;
3740 createAdd(left: Expression, right: Expression): BinaryExpression;
3741 createSubtract(left: Expression, right: Expression): BinaryExpression;
3742 createMultiply(left: Expression, right: Expression): BinaryExpression;
3743 createDivide(left: Expression, right: Expression): BinaryExpression;
3744 createModulo(left: Expression, right: Expression): BinaryExpression;
3745 createExponent(left: Expression, right: Expression): BinaryExpression;
3746 createPrefixPlus(operand: Expression): PrefixUnaryExpression;
3747 createPrefixMinus(operand: Expression): PrefixUnaryExpression;
3748 createPrefixIncrement(operand: Expression): PrefixUnaryExpression;
3749 createPrefixDecrement(operand: Expression): PrefixUnaryExpression;
3750 createBitwiseNot(operand: Expression): PrefixUnaryExpression;
3751 createLogicalNot(operand: Expression): PrefixUnaryExpression;
3752 createPostfixIncrement(operand: Expression): PostfixUnaryExpression;
3753 createPostfixDecrement(operand: Expression): PostfixUnaryExpression;
3754 createImmediatelyInvokedFunctionExpression(statements: readonly Statement[]): CallExpression;
3755 createImmediatelyInvokedFunctionExpression(statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression;
3756 createImmediatelyInvokedArrowFunction(statements: readonly Statement[]): CallExpression;
3757 createImmediatelyInvokedArrowFunction(statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression;
3758 createVoidZero(): VoidExpression;
3759 createExportDefault(expression: Expression): ExportAssignment;
3760 createExternalModuleExport(exportName: Identifier): ExportDeclaration;
3761 restoreOuterExpressions(outerExpression: Expression | undefined, innerExpression: Expression, kinds?: OuterExpressionKinds): Expression;
3763 export interface CoreTransformationContext {
3764 readonly factory: NodeFactory;
3765 /** Gets the compiler options supplied to the transformer. */
3766 getCompilerOptions(): CompilerOptions;
3767 /** Starts a new lexical environment. */
3768 startLexicalEnvironment(): void;
3769 /** Suspends the current lexical environment, usually after visiting a parameter list. */
3770 suspendLexicalEnvironment(): void;
3771 /** Resumes a suspended lexical environment, usually before visiting a function body. */
3772 resumeLexicalEnvironment(): void;
3773 /** Ends a lexical environment, returning any declarations. */
3774 endLexicalEnvironment(): Statement[] | undefined;
3775 /** Hoists a function declaration to the containing scope. */
3776 hoistFunctionDeclaration(node: FunctionDeclaration): void;
3777 /** Hoists a variable declaration to the containing scope. */
3778 hoistVariableDeclaration(node: Identifier): void;
3780 export interface TransformationContext extends CoreTransformationContext {
3781 /** Records a request for a non-scoped emit helper in the current context. */
3782 requestEmitHelper(helper: EmitHelper): void;
3783 /** Gets and resets the requested non-scoped emit helpers. */
3784 readEmitHelpers(): EmitHelper[] | undefined;
3785 /** Enables expression substitutions in the pretty printer for the provided SyntaxKind. */
3786 enableSubstitution(kind: SyntaxKind): void;
3787 /** Determines whether expression substitutions are enabled for the provided node. */
3788 isSubstitutionEnabled(node: Node): boolean;
3790 * Hook used by transformers to substitute expressions just before they
3791 * are emitted by the pretty printer.
3793 * NOTE: Transformation hooks should only be modified during `Transformer` initialization,
3794 * before returning the `NodeTransformer` callback.
3796 onSubstituteNode: (hint: EmitHint, node: Node) => Node;
3798 * Enables before/after emit notifications in the pretty printer for the provided
3801 enableEmitNotification(kind: SyntaxKind): void;
3803 * Determines whether before/after emit notifications should be raised in the pretty
3804 * printer when it emits a node.
3806 isEmitNotificationEnabled(node: Node): boolean;
3808 * Hook used to allow transformers to capture state before or after
3809 * the printer emits a node.
3811 * NOTE: Transformation hooks should only be modified during `Transformer` initialization,
3812 * before returning the `NodeTransformer` callback.
3814 onEmitNode: (hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void) => void;
3816 export interface TransformationResult<T extends Node> {
3817 /** Gets the transformed source files. */
3819 /** Gets diagnostics for the transformation. */
3820 diagnostics?: DiagnosticWithLocation[];
3822 * Gets a substitute for a node, if one is available; otherwise, returns the original node.
3824 * @param hint A hint as to the intended usage of the node.
3825 * @param node The node to substitute.
3827 substituteNode(hint: EmitHint, node: Node): Node;
3829 * Emits a node with possible notification.
3831 * @param hint A hint as to the intended usage of the node.
3832 * @param node The node to emit.
3833 * @param emitCallback A callback used to emit the node.
3835 emitNodeWithNotification(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void;
3837 * Indicates if a given node needs an emit notification
3839 * @param node The node to emit.
3841 isEmitNotificationEnabled?(node: Node): boolean;
3843 * Clean up EmitNode entries on any parse-tree nodes.
3848 * A function that is used to initialize and return a `Transformer` callback, which in turn
3849 * will be used to transform one or more nodes.
3851 export type TransformerFactory<T extends Node> = (context: TransformationContext) => Transformer<T>;
3853 * A function that transforms a node.
3855 export type Transformer<T extends Node> = (node: T) => T;
3857 * A function that accepts and possibly transforms a node.
3859 export type Visitor = (node: Node) => VisitResult<Node>;
3860 export interface NodeVisitor {
3861 <T extends Node>(nodes: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T;
3862 <T extends Node>(nodes: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T | undefined;
3864 export interface NodesVisitor {
3865 <T extends Node>(nodes: NodeArray<T>, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T>;
3866 <T extends Node>(nodes: NodeArray<T> | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T> | undefined;
3868 export type VisitResult<T extends Node> = T | T[] | undefined;
3869 export interface Printer {
3871 * Print a node and its subtree as-is, without any emit transformations.
3872 * @param hint A value indicating the purpose of a node. This is primarily used to
3873 * distinguish between an `Identifier` used in an expression position, versus an
3874 * `Identifier` used as an `IdentifierName` as part of a declaration. For most nodes you
3875 * should just pass `Unspecified`.
3876 * @param node The node to print. The node and its subtree are printed as-is, without any
3877 * emit transformations.
3878 * @param sourceFile A source file that provides context for the node. The source text of
3879 * the file is used to emit the original source content for literals and identifiers, while
3880 * the identifiers of the source file are used when generating unique names to avoid
3883 printNode(hint: EmitHint, node: Node, sourceFile: SourceFile): string;
3885 * Prints a list of nodes using the given format flags
3887 printList<T extends Node>(format: ListFormat, list: NodeArray<T>, sourceFile: SourceFile): string;
3889 * Prints a source file as-is, without any emit transformations.
3891 printFile(sourceFile: SourceFile): string;
3893 * Prints a bundle of source files as-is, without any emit transformations.
3895 printBundle(bundle: Bundle): string;
3897 export interface PrintHandlers {
3899 * A hook used by the Printer when generating unique names to avoid collisions with
3900 * globally defined names that exist outside of the current source file.
3902 hasGlobalName?(name: string): boolean;
3904 * A hook used by the Printer to provide notifications prior to emitting a node. A
3905 * compatible implementation **must** invoke `emitCallback` with the provided `hint` and
3907 * @param hint A hint indicating the intended purpose of the node.
3908 * @param node The node to emit.
3909 * @param emitCallback A callback that, when invoked, will emit the node.
3912 * var printer = createPrinter(printerOptions, {
3913 * onEmitNode(hint, node, emitCallback) {
3914 * // set up or track state prior to emitting the node...
3915 * emitCallback(hint, node);
3916 * // restore state after emitting the node...
3921 onEmitNode?(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void;
3923 * A hook used to check if an emit notification is required for a node.
3924 * @param node The node to emit.
3926 isEmitNotificationEnabled?(node: Node): boolean;
3928 * A hook used by the Printer to perform just-in-time substitution of a node. This is
3929 * primarily used by node transformations that need to substitute one node for another,
3930 * such as replacing `myExportedVar` with `exports.myExportedVar`.
3931 * @param hint A hint indicating the intended purpose of the node.
3932 * @param node The node to emit.
3935 * var printer = createPrinter(printerOptions, {
3936 * substituteNode(hint, node) {
3937 * // perform substitution if necessary...
3943 substituteNode?(hint: EmitHint, node: Node): Node;
3945 export interface PrinterOptions {
3946 removeComments?: boolean;
3947 newLine?: NewLineKind;
3948 omitTrailingSemicolon?: boolean;
3949 noEmitHelpers?: boolean;
3951 export interface GetEffectiveTypeRootsHost {
3952 directoryExists?(directoryName: string): boolean;
3953 getCurrentDirectory?(): string;
3955 export interface TextSpan {
3959 export interface TextChangeRange {
3963 export interface SyntaxList extends Node {
3964 kind: SyntaxKind.SyntaxList;
3967 export enum ListFormat {
3975 AmpersandDelimited = 8,
3976 CommaDelimited = 16,
3977 AsteriskDelimited = 32,
3978 DelimitersMask = 60,
3979 AllowTrailingComma = 64,
3981 SpaceBetweenBraces = 256,
3982 SpaceBetweenSiblings = 512,
3985 AngleBrackets = 4096,
3986 SquareBrackets = 8192,
3987 BracketsMask = 15360,
3988 OptionalIfUndefined = 16384,
3989 OptionalIfEmpty = 32768,
3991 PreferNewLine = 65536,
3992 NoTrailingNewLine = 131072,
3993 NoInterveningComments = 262144,
3994 NoSpaceIfEmpty = 524288,
3995 SingleElement = 1048576,
3996 SpaceAfterList = 2097152,
3998 HeritageClauses = 512,
3999 SingleLineTypeLiteralMembers = 768,
4000 MultiLineTypeLiteralMembers = 32897,
4001 SingleLineTupleTypeElements = 528,
4002 MultiLineTupleTypeElements = 657,
4003 UnionTypeConstituents = 516,
4004 IntersectionTypeConstituents = 520,
4005 ObjectBindingPatternElements = 525136,
4006 ArrayBindingPatternElements = 524880,
4007 ObjectLiteralExpressionProperties = 526226,
4008 ImportClauseEntries = 526226,
4009 ArrayLiteralExpressionElements = 8914,
4010 CommaListElements = 528,
4011 CallExpressionArguments = 2576,
4012 NewExpressionArguments = 18960,
4013 TemplateExpressionSpans = 262144,
4014 SingleLineBlockStatements = 768,
4015 MultiLineBlockStatements = 129,
4016 VariableDeclarationList = 528,
4017 SingleLineFunctionBodyStatements = 768,
4018 MultiLineFunctionBodyStatements = 1,
4019 ClassHeritageClauses = 0,
4021 InterfaceMembers = 129,
4023 CaseBlockClauses = 129,
4024 NamedImportsOrExportsElements = 525136,
4025 JsxElementOrFragmentChildren = 262144,
4026 JsxElementAttributes = 262656,
4027 CaseOrDefaultClauseStatements = 163969,
4028 HeritageClauseTypes = 528,
4029 SourceFileStatements = 131073,
4030 Decorators = 2146305,
4031 TypeArguments = 53776,
4032 TypeParameters = 53776,
4034 IndexSignatureParameters = 8848,
4037 export interface UserPreferences {
4038 readonly disableSuggestions?: boolean;
4039 readonly quotePreference?: "auto" | "double" | "single";
4040 readonly includeCompletionsForModuleExports?: boolean;
4041 readonly includeCompletionsForImportStatements?: boolean;
4042 readonly includeCompletionsWithSnippetText?: boolean;
4043 readonly includeAutomaticOptionalChainCompletions?: boolean;
4044 readonly includeCompletionsWithInsertText?: boolean;
4045 readonly includeCompletionsWithClassMemberSnippets?: boolean;
4046 readonly allowIncompleteCompletions?: boolean;
4047 readonly importModuleSpecifierPreference?: "shortest" | "project-relative" | "relative" | "non-relative";
4048 /** Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js" */
4049 readonly importModuleSpecifierEnding?: "auto" | "minimal" | "index" | "js";
4050 readonly allowTextChangesInNewFiles?: boolean;
4051 readonly providePrefixAndSuffixTextForRename?: boolean;
4052 readonly includePackageJsonAutoImports?: "auto" | "on" | "off";
4053 readonly provideRefactorNotApplicableReason?: boolean;
4054 readonly jsxAttributeCompletionStyle?: "auto" | "braces" | "none";
4056 /** Represents a bigint literal value without requiring bigint support */
4057 export interface PseudoBigInt {
4059 base10Value: string;
4063 declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any;
4064 declare function clearTimeout(handle: any): void;
4065 declare namespace ts {
4066 export enum FileWatcherEventKind {
4071 export type FileWatcherCallback = (fileName: string, eventKind: FileWatcherEventKind) => void;
4072 export type DirectoryWatcherCallback = (fileName: string) => void;
4073 export interface System {
4076 useCaseSensitiveFileNames: boolean;
4077 write(s: string): void;
4078 writeOutputIsTTY?(): boolean;
4079 getWidthOfTerminal?(): number;
4080 readFile(path: string, encoding?: string): string | undefined;
4081 getFileSize?(path: string): number;
4082 writeFile(path: string, data: string, writeByteOrderMark?: boolean): void;
4084 * @pollingInterval - this parameter is used in polling-based watchers and ignored in watchers that
4085 * use native OS file watching
4087 watchFile?(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: WatchOptions): FileWatcher;
4088 watchDirectory?(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: WatchOptions): FileWatcher;
4089 resolvePath(path: string): string;
4090 fileExists(path: string): boolean;
4091 directoryExists(path: string): boolean;
4092 createDirectory(path: string): void;
4093 getExecutingFilePath(): string;
4094 getCurrentDirectory(): string;
4095 getDirectories(path: string): string[];
4096 readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
4097 getModifiedTime?(path: string): Date | undefined;
4098 setModifiedTime?(path: string, time: Date): void;
4099 deleteFile?(path: string): void;
4101 * A good implementation is node.js' `crypto.createHash`. (https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm)
4103 createHash?(data: string): string;
4104 /** This must be cryptographically secure. Only implement this method using `crypto.createHash("sha256")`. */
4105 createSHA256Hash?(data: string): string;
4106 getMemoryUsage?(): number;
4107 exit(exitCode?: number): void;
4108 realpath?(path: string): string;
4109 setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
4110 clearTimeout?(timeoutId: any): void;
4111 clearScreen?(): void;
4112 base64decode?(input: string): string;
4113 base64encode?(input: string): string;
4115 export interface FileWatcher {
4118 export function getNodeMajorVersion(): number | undefined;
4119 export let sys: System;
4122 declare namespace ts {
4123 type ErrorCallback = (message: DiagnosticMessage, length: number) => void;
4125 getStartPos(): number;
4126 getToken(): SyntaxKind;
4127 getTextPos(): number;
4128 getTokenPos(): number;
4129 getTokenText(): string;
4130 getTokenValue(): string;
4131 hasUnicodeEscape(): boolean;
4132 hasExtendedUnicodeEscape(): boolean;
4133 hasPrecedingLineBreak(): boolean;
4134 isIdentifier(): boolean;
4135 isReservedWord(): boolean;
4136 isUnterminated(): boolean;
4137 reScanGreaterToken(): SyntaxKind;
4138 reScanSlashToken(): SyntaxKind;
4139 reScanAsteriskEqualsToken(): SyntaxKind;
4140 reScanTemplateToken(isTaggedTemplate: boolean): SyntaxKind;
4141 reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind;
4142 scanJsxIdentifier(): SyntaxKind;
4143 scanJsxAttributeValue(): SyntaxKind;
4144 reScanJsxAttributeValue(): SyntaxKind;
4145 reScanJsxToken(allowMultilineJsxText?: boolean): JsxTokenSyntaxKind;
4146 reScanLessThanToken(): SyntaxKind;
4147 reScanHashToken(): SyntaxKind;
4148 reScanQuestionToken(): SyntaxKind;
4149 reScanInvalidIdentifier(): SyntaxKind;
4150 scanJsxToken(): JsxTokenSyntaxKind;
4151 scanJsDocToken(): JSDocSyntaxKind;
4154 setText(text: string | undefined, start?: number, length?: number): void;
4155 setOnError(onError: ErrorCallback | undefined): void;
4156 setScriptTarget(scriptTarget: ScriptTarget): void;
4157 setLanguageVariant(variant: LanguageVariant): void;
4158 setTextPos(textPos: number): void;
4159 lookAhead<T>(callback: () => T): T;
4160 scanRange<T>(start: number, length: number, callback: () => T): T;
4161 tryScan<T>(callback: () => T): T;
4163 function tokenToString(t: SyntaxKind): string | undefined;
4164 function getPositionOfLineAndCharacter(sourceFile: SourceFileLike, line: number, character: number): number;
4165 function getLineAndCharacterOfPosition(sourceFile: SourceFileLike, position: number): LineAndCharacter;
4166 function isWhiteSpaceLike(ch: number): boolean;
4167 /** Does not include line breaks. For that, see isWhiteSpaceLike. */
4168 function isWhiteSpaceSingleLine(ch: number): boolean;
4169 function isLineBreak(ch: number): boolean;
4170 function couldStartTrivia(text: string, pos: number): boolean;
4171 function forEachLeadingCommentRange<U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined;
4172 function forEachLeadingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined;
4173 function forEachTrailingCommentRange<U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined;
4174 function forEachTrailingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined;
4175 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;
4176 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;
4177 function getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined;
4178 function getTrailingCommentRanges(text: string, pos: number): CommentRange[] | undefined;
4179 /** Optionally, get the shebang */
4180 function getShebang(text: string): string | undefined;
4181 function isIdentifierStart(ch: number, languageVersion: ScriptTarget | undefined): boolean;
4182 function isIdentifierPart(ch: number, languageVersion: ScriptTarget | undefined, identifierVariant?: LanguageVariant): boolean;
4183 function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, textInitial?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner;
4185 declare namespace ts {
4186 function isExternalModuleNameRelative(moduleName: string): boolean;
4187 function sortAndDeduplicateDiagnostics<T extends Diagnostic>(diagnostics: readonly T[]): SortedReadonlyArray<T>;
4188 function getDefaultLibFileName(options: CompilerOptions): string;
4189 function textSpanEnd(span: TextSpan): number;
4190 function textSpanIsEmpty(span: TextSpan): boolean;
4191 function textSpanContainsPosition(span: TextSpan, position: number): boolean;
4192 function textSpanContainsTextSpan(span: TextSpan, other: TextSpan): boolean;
4193 function textSpanOverlapsWith(span: TextSpan, other: TextSpan): boolean;
4194 function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan | undefined;
4195 function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan): boolean;
4196 function textSpanIntersectsWith(span: TextSpan, start: number, length: number): boolean;
4197 function decodedTextSpanIntersectsWith(start1: number, length1: number, start2: number, length2: number): boolean;
4198 function textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean;
4199 function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan | undefined;
4200 function createTextSpan(start: number, length: number): TextSpan;
4201 function createTextSpanFromBounds(start: number, end: number): TextSpan;
4202 function textChangeRangeNewSpan(range: TextChangeRange): TextSpan;
4203 function textChangeRangeIsUnchanged(range: TextChangeRange): boolean;
4204 function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange;
4205 let unchangedTextChangeRange: TextChangeRange;
4207 * Called to merge all the changes that occurred across several versions of a script snapshot
4208 * into a single change. i.e. if a user keeps making successive edits to a script we will
4209 * have a text change from V1 to V2, V2 to V3, ..., Vn.
4211 * This function will then merge those changes into a single change range valid between V1 and
4214 function collapseTextChangeRangesAcrossMultipleVersions(changes: readonly TextChangeRange[]): TextChangeRange;
4215 function getTypeParameterOwner(d: Declaration): Declaration | undefined;
4216 type ParameterPropertyDeclaration = ParameterDeclaration & {
4217 parent: ConstructorDeclaration;
4220 function isParameterPropertyDeclaration(node: Node, parent: Node): node is ParameterPropertyDeclaration;
4221 function isEmptyBindingPattern(node: BindingName): node is BindingPattern;
4222 function isEmptyBindingElement(node: BindingElement): boolean;
4223 function walkUpBindingElementsAndPatterns(binding: BindingElement): VariableDeclaration | ParameterDeclaration;
4224 function getCombinedModifierFlags(node: Declaration): ModifierFlags;
4225 function getCombinedNodeFlags(node: Node): NodeFlags;
4227 * Checks to see if the locale is in the appropriate format,
4228 * and if it is, attempts to set the appropriate language.
4230 function validateLocaleAndSetLanguage(locale: string, sys: {
4231 getExecutingFilePath(): string;
4232 resolvePath(path: string): string;
4233 fileExists(fileName: string): boolean;
4234 readFile(fileName: string): string | undefined;
4235 }, errors?: Push<Diagnostic>): void;
4236 function getOriginalNode(node: Node): Node;
4237 function getOriginalNode<T extends Node>(node: Node, nodeTest: (node: Node) => node is T): T;
4238 function getOriginalNode(node: Node | undefined): Node | undefined;
4239 function getOriginalNode<T extends Node>(node: Node | undefined, nodeTest: (node: Node | undefined) => node is T): T | undefined;
4241 * Iterates through the parent chain of a node and performs the callback on each parent until the callback
4242 * returns a truthy value, then returns that value.
4243 * If no such value is found, it applies the callback until the parent pointer is undefined or the callback returns "quit"
4244 * At that point findAncestor returns undefined.
4246 function findAncestor<T extends Node>(node: Node | undefined, callback: (element: Node) => element is T): T | undefined;
4247 function findAncestor(node: Node | undefined, callback: (element: Node) => boolean | "quit"): Node | undefined;
4249 * Gets a value indicating whether a node originated in the parse tree.
4251 * @param node The node to test.
4253 function isParseTreeNode(node: Node): boolean;
4255 * Gets the original parse tree node for a node.
4257 * @param node The original node.
4258 * @returns The original parse tree node if found; otherwise, undefined.
4260 function getParseTreeNode(node: Node | undefined): Node | undefined;
4262 * Gets the original parse tree node for a node.
4264 * @param node The original node.
4265 * @param nodeTest A callback used to ensure the correct type of parse tree node is returned.
4266 * @returns The original parse tree node if found; otherwise, undefined.
4268 function getParseTreeNode<T extends Node>(node: T | undefined, nodeTest?: (node: Node) => node is T): T | undefined;
4269 /** Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' */
4270 function escapeLeadingUnderscores(identifier: string): __String;
4272 * Remove extra underscore from escaped identifier text content.
4274 * @param identifier The escaped identifier text.
4275 * @returns The unescaped identifier text.
4277 function unescapeLeadingUnderscores(identifier: __String): string;
4278 function idText(identifierOrPrivateName: Identifier | PrivateIdentifier): string;
4279 function symbolName(symbol: Symbol): string;
4280 function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | PrivateIdentifier | undefined;
4281 function getNameOfDeclaration(declaration: Declaration | Expression | undefined): DeclarationName | undefined;
4283 * Gets the JSDoc parameter tags for the node if present.
4285 * @remarks Returns any JSDoc param tag whose name matches the provided
4286 * parameter, whether a param tag on a containing function
4287 * expression, or a param tag on a variable declaration whose
4288 * initializer is the containing function. The tags closest to the
4289 * node are returned first, so in the previous example, the param
4290 * tag on the containing function expression would be first.
4292 * For binding patterns, parameter tags are matched by position.
4294 function getJSDocParameterTags(param: ParameterDeclaration): readonly JSDocParameterTag[];
4296 * Gets the JSDoc type parameter tags for the node if present.
4298 * @remarks Returns any JSDoc template tag whose names match the provided
4299 * parameter, whether a template tag on a containing function
4300 * expression, or a template tag on a variable declaration whose
4301 * initializer is the containing function. The tags closest to the
4302 * node are returned first, so in the previous example, the template
4303 * tag on the containing function expression would be first.
4305 function getJSDocTypeParameterTags(param: TypeParameterDeclaration): readonly JSDocTemplateTag[];
4307 * Return true if the node has JSDoc parameter tags.
4309 * @remarks Includes parameter tags that are not directly on the node,
4310 * for example on a variable declaration whose initializer is a function expression.
4312 function hasJSDocParameterTags(node: FunctionLikeDeclaration | SignatureDeclaration): boolean;
4313 /** Gets the JSDoc augments tag for the node if present */
4314 function getJSDocAugmentsTag(node: Node): JSDocAugmentsTag | undefined;
4315 /** Gets the JSDoc implements tags for the node if present */
4316 function getJSDocImplementsTags(node: Node): readonly JSDocImplementsTag[];
4317 /** Gets the JSDoc class tag for the node if present */
4318 function getJSDocClassTag(node: Node): JSDocClassTag | undefined;
4319 /** Gets the JSDoc public tag for the node if present */
4320 function getJSDocPublicTag(node: Node): JSDocPublicTag | undefined;
4321 /** Gets the JSDoc private tag for the node if present */
4322 function getJSDocPrivateTag(node: Node): JSDocPrivateTag | undefined;
4323 /** Gets the JSDoc protected tag for the node if present */
4324 function getJSDocProtectedTag(node: Node): JSDocProtectedTag | undefined;
4325 /** Gets the JSDoc protected tag for the node if present */
4326 function getJSDocReadonlyTag(node: Node): JSDocReadonlyTag | undefined;
4327 function getJSDocOverrideTagNoCache(node: Node): JSDocOverrideTag | undefined;
4328 /** Gets the JSDoc deprecated tag for the node if present */
4329 function getJSDocDeprecatedTag(node: Node): JSDocDeprecatedTag | undefined;
4330 /** Gets the JSDoc enum tag for the node if present */
4331 function getJSDocEnumTag(node: Node): JSDocEnumTag | undefined;
4332 /** Gets the JSDoc this tag for the node if present */
4333 function getJSDocThisTag(node: Node): JSDocThisTag | undefined;
4334 /** Gets the JSDoc return tag for the node if present */
4335 function getJSDocReturnTag(node: Node): JSDocReturnTag | undefined;
4336 /** Gets the JSDoc template tag for the node if present */
4337 function getJSDocTemplateTag(node: Node): JSDocTemplateTag | undefined;
4338 /** Gets the JSDoc type tag for the node if present and valid */
4339 function getJSDocTypeTag(node: Node): JSDocTypeTag | undefined;
4341 * Gets the type node for the node if provided via JSDoc.
4343 * @remarks The search includes any JSDoc param tag that relates
4344 * to the provided parameter, for example a type tag on the
4345 * parameter itself, or a param tag on a containing function
4346 * expression, or a param tag on a variable declaration whose
4347 * initializer is the containing function. The tags closest to the
4348 * node are examined first, so in the previous example, the type
4349 * tag directly on the node would be returned.
4351 function getJSDocType(node: Node): TypeNode | undefined;
4353 * Gets the return type node for the node if provided via JSDoc return tag or type tag.
4355 * @remarks `getJSDocReturnTag` just gets the whole JSDoc tag. This function
4356 * gets the type from inside the braces, after the fat arrow, etc.
4358 function getJSDocReturnType(node: Node): TypeNode | undefined;
4359 /** Get all JSDoc tags related to a node, including those on parent nodes. */
4360 function getJSDocTags(node: Node): readonly JSDocTag[];
4361 /** Gets all JSDoc tags that match a specified predicate */
4362 function getAllJSDocTags<T extends JSDocTag>(node: Node, predicate: (tag: JSDocTag) => tag is T): readonly T[];
4363 /** Gets all JSDoc tags of a specified kind */
4364 function getAllJSDocTagsOfKind(node: Node, kind: SyntaxKind): readonly JSDocTag[];
4365 /** Gets the text of a jsdoc comment, flattening links to their text. */
4366 function getTextOfJSDocComment(comment?: string | NodeArray<JSDocComment>): string | undefined;
4368 * Gets the effective type parameters. If the node was parsed in a
4369 * JavaScript file, gets the type parameters from the `@template` tag from JSDoc.
4371 function getEffectiveTypeParameterDeclarations(node: DeclarationWithTypeParameters): readonly TypeParameterDeclaration[];
4372 function getEffectiveConstraintOfTypeParameter(node: TypeParameterDeclaration): TypeNode | undefined;
4373 function isMemberName(node: Node): node is MemberName;
4374 function isPropertyAccessChain(node: Node): node is PropertyAccessChain;
4375 function isElementAccessChain(node: Node): node is ElementAccessChain;
4376 function isCallChain(node: Node): node is CallChain;
4377 function isOptionalChain(node: Node): node is PropertyAccessChain | ElementAccessChain | CallChain | NonNullChain;
4378 function isNullishCoalesce(node: Node): boolean;
4379 function isConstTypeReference(node: Node): boolean;
4380 function skipPartiallyEmittedExpressions(node: Expression): Expression;
4381 function skipPartiallyEmittedExpressions(node: Node): Node;
4382 function isNonNullChain(node: Node): node is NonNullChain;
4383 function isBreakOrContinueStatement(node: Node): node is BreakOrContinueStatement;
4384 function isNamedExportBindings(node: Node): node is NamedExportBindings;
4385 function isUnparsedTextLike(node: Node): node is UnparsedTextLike;
4386 function isUnparsedNode(node: Node): node is UnparsedNode;
4387 function isJSDocPropertyLikeTag(node: Node): node is JSDocPropertyLikeTag;
4389 * True if kind is of some token syntax kind.
4390 * For example, this is true for an IfKeyword but not for an IfStatement.
4391 * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail.
4393 function isTokenKind(kind: SyntaxKind): boolean;
4395 * True if node is of some token syntax kind.
4396 * For example, this is true for an IfKeyword but not for an IfStatement.
4397 * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail.
4399 function isToken(n: Node): boolean;
4400 function isLiteralExpression(node: Node): node is LiteralExpression;
4401 function isTemplateLiteralToken(node: Node): node is TemplateLiteralToken;
4402 function isTemplateMiddleOrTemplateTail(node: Node): node is TemplateMiddle | TemplateTail;
4403 function isImportOrExportSpecifier(node: Node): node is ImportSpecifier | ExportSpecifier;
4404 function isTypeOnlyImportOrExportDeclaration(node: Node): node is TypeOnlyAliasDeclaration;
4405 function isAssertionKey(node: Node): node is AssertionKey;
4406 function isStringTextContainingNode(node: Node): node is StringLiteral | TemplateLiteralToken;
4407 function isModifier(node: Node): node is Modifier;
4408 function isEntityName(node: Node): node is EntityName;
4409 function isPropertyName(node: Node): node is PropertyName;
4410 function isBindingName(node: Node): node is BindingName;
4411 function isFunctionLike(node: Node | undefined): node is SignatureDeclaration;
4412 function isClassElement(node: Node): node is ClassElement;
4413 function isClassLike(node: Node): node is ClassLikeDeclaration;
4414 function isAccessor(node: Node): node is AccessorDeclaration;
4415 function isTypeElement(node: Node): node is TypeElement;
4416 function isClassOrTypeElement(node: Node): node is ClassElement | TypeElement;
4417 function isObjectLiteralElementLike(node: Node): node is ObjectLiteralElementLike;
4419 * Node test that determines whether a node is a valid type node.
4420 * This differs from the `isPartOfTypeNode` function which determines whether a node is *part*
4423 function isTypeNode(node: Node): node is TypeNode;
4424 function isFunctionOrConstructorTypeNode(node: Node): node is FunctionTypeNode | ConstructorTypeNode;
4425 function isPropertyAccessOrQualifiedName(node: Node): node is PropertyAccessExpression | QualifiedName;
4426 function isCallLikeExpression(node: Node): node is CallLikeExpression;
4427 function isCallOrNewExpression(node: Node): node is CallExpression | NewExpression;
4428 function isTemplateLiteral(node: Node): node is TemplateLiteral;
4429 function isAssertionExpression(node: Node): node is AssertionExpression;
4430 function isIterationStatement(node: Node, lookInLabeledStatements: false): node is IterationStatement;
4431 function isIterationStatement(node: Node, lookInLabeledStatements: boolean): node is IterationStatement | LabeledStatement;
4432 function isJsxOpeningLikeElement(node: Node): node is JsxOpeningLikeElement;
4433 function isCaseOrDefaultClause(node: Node): node is CaseOrDefaultClause;
4434 /** True if node is of a kind that may contain comment text. */
4435 function isJSDocCommentContainingNode(node: Node): boolean;
4436 function isSetAccessor(node: Node): node is SetAccessorDeclaration;
4437 function isGetAccessor(node: Node): node is GetAccessorDeclaration;
4438 /** True if has initializer node attached to it. */
4439 function hasOnlyExpressionInitializer(node: Node): node is HasExpressionInitializer;
4440 function isObjectLiteralElement(node: Node): node is ObjectLiteralElement;
4441 function isStringLiteralLike(node: Node): node is StringLiteralLike;
4442 function isJSDocLinkLike(node: Node): node is JSDocLink | JSDocLinkCode | JSDocLinkPlain;
4444 declare namespace ts {
4445 const factory: NodeFactory;
4446 function createUnparsedSourceFile(text: string): UnparsedSource;
4447 function createUnparsedSourceFile(inputFile: InputFiles, type: "js" | "dts", stripInternal?: boolean): UnparsedSource;
4448 function createUnparsedSourceFile(text: string, mapPath: string | undefined, map: string | undefined): UnparsedSource;
4449 function createInputFiles(javascriptText: string, declarationText: string): InputFiles;
4450 function createInputFiles(readFileText: (path: string) => string | undefined, javascriptPath: string, javascriptMapPath: string | undefined, declarationPath: string, declarationMapPath: string | undefined, buildInfoPath: string | undefined): InputFiles;
4451 function createInputFiles(javascriptText: string, declarationText: string, javascriptMapPath: string | undefined, javascriptMapText: string | undefined, declarationMapPath: string | undefined, declarationMapText: string | undefined): InputFiles;
4453 * Create an external source map source file reference
4455 function createSourceMapSource(fileName: string, text: string, skipTrivia?: (pos: number) => number): SourceMapSource;
4456 function setOriginalNode<T extends Node>(node: T, original: Node | undefined): T;
4458 declare namespace ts {
4460 * Clears any `EmitNode` entries from parse-tree nodes.
4461 * @param sourceFile A source file.
4463 function disposeEmitNodes(sourceFile: SourceFile | undefined): void;
4465 * Sets flags that control emit behavior of a node.
4467 function setEmitFlags<T extends Node>(node: T, emitFlags: EmitFlags): T;
4469 * Gets a custom text range to use when emitting source maps.
4471 function getSourceMapRange(node: Node): SourceMapRange;
4473 * Sets a custom text range to use when emitting source maps.
4475 function setSourceMapRange<T extends Node>(node: T, range: SourceMapRange | undefined): T;
4477 * Gets the TextRange to use for source maps for a token of a node.
4479 function getTokenSourceMapRange(node: Node, token: SyntaxKind): SourceMapRange | undefined;
4481 * Sets the TextRange to use for source maps for a token of a node.
4483 function setTokenSourceMapRange<T extends Node>(node: T, token: SyntaxKind, range: SourceMapRange | undefined): T;
4485 * Gets a custom text range to use when emitting comments.
4487 function getCommentRange(node: Node): TextRange;
4489 * Sets a custom text range to use when emitting comments.
4491 function setCommentRange<T extends Node>(node: T, range: TextRange): T;
4492 function getSyntheticLeadingComments(node: Node): SynthesizedComment[] | undefined;
4493 function setSyntheticLeadingComments<T extends Node>(node: T, comments: SynthesizedComment[] | undefined): T;
4494 function addSyntheticLeadingComment<T extends Node>(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T;
4495 function getSyntheticTrailingComments(node: Node): SynthesizedComment[] | undefined;
4496 function setSyntheticTrailingComments<T extends Node>(node: T, comments: SynthesizedComment[] | undefined): T;
4497 function addSyntheticTrailingComment<T extends Node>(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T;
4498 function moveSyntheticComments<T extends Node>(node: T, original: Node): T;
4500 * Gets the constant value to emit for an expression representing an enum.
4502 function getConstantValue(node: AccessExpression): string | number | undefined;
4504 * Sets the constant value to emit for an expression.
4506 function setConstantValue(node: AccessExpression, value: string | number): AccessExpression;
4508 * Adds an EmitHelper to a node.
4510 function addEmitHelper<T extends Node>(node: T, helper: EmitHelper): T;
4512 * Add EmitHelpers to a node.
4514 function addEmitHelpers<T extends Node>(node: T, helpers: EmitHelper[] | undefined): T;
4516 * Removes an EmitHelper from a node.
4518 function removeEmitHelper(node: Node, helper: EmitHelper): boolean;
4520 * Gets the EmitHelpers of a node.
4522 function getEmitHelpers(node: Node): EmitHelper[] | undefined;
4524 * Moves matching emit helpers from a source node to a target node.
4526 function moveEmitHelpers(source: Node, target: Node, predicate: (helper: EmitHelper) => boolean): void;
4528 declare namespace ts {
4529 function isNumericLiteral(node: Node): node is NumericLiteral;
4530 function isBigIntLiteral(node: Node): node is BigIntLiteral;
4531 function isStringLiteral(node: Node): node is StringLiteral;
4532 function isJsxText(node: Node): node is JsxText;
4533 function isRegularExpressionLiteral(node: Node): node is RegularExpressionLiteral;
4534 function isNoSubstitutionTemplateLiteral(node: Node): node is NoSubstitutionTemplateLiteral;
4535 function isTemplateHead(node: Node): node is TemplateHead;
4536 function isTemplateMiddle(node: Node): node is TemplateMiddle;
4537 function isTemplateTail(node: Node): node is TemplateTail;
4538 function isDotDotDotToken(node: Node): node is DotDotDotToken;
4539 function isPlusToken(node: Node): node is PlusToken;
4540 function isMinusToken(node: Node): node is MinusToken;
4541 function isAsteriskToken(node: Node): node is AsteriskToken;
4542 function isIdentifier(node: Node): node is Identifier;
4543 function isPrivateIdentifier(node: Node): node is PrivateIdentifier;
4544 function isQualifiedName(node: Node): node is QualifiedName;
4545 function isComputedPropertyName(node: Node): node is ComputedPropertyName;
4546 function isTypeParameterDeclaration(node: Node): node is TypeParameterDeclaration;
4547 function isParameter(node: Node): node is ParameterDeclaration;
4548 function isDecorator(node: Node): node is Decorator;
4549 function isPropertySignature(node: Node): node is PropertySignature;
4550 function isPropertyDeclaration(node: Node): node is PropertyDeclaration;
4551 function isMethodSignature(node: Node): node is MethodSignature;
4552 function isMethodDeclaration(node: Node): node is MethodDeclaration;
4553 function isClassStaticBlockDeclaration(node: Node): node is ClassStaticBlockDeclaration;
4554 function isConstructorDeclaration(node: Node): node is ConstructorDeclaration;
4555 function isGetAccessorDeclaration(node: Node): node is GetAccessorDeclaration;
4556 function isSetAccessorDeclaration(node: Node): node is SetAccessorDeclaration;
4557 function isCallSignatureDeclaration(node: Node): node is CallSignatureDeclaration;
4558 function isConstructSignatureDeclaration(node: Node): node is ConstructSignatureDeclaration;
4559 function isIndexSignatureDeclaration(node: Node): node is IndexSignatureDeclaration;
4560 function isTypePredicateNode(node: Node): node is TypePredicateNode;
4561 function isTypeReferenceNode(node: Node): node is TypeReferenceNode;
4562 function isFunctionTypeNode(node: Node): node is FunctionTypeNode;
4563 function isConstructorTypeNode(node: Node): node is ConstructorTypeNode;
4564 function isTypeQueryNode(node: Node): node is TypeQueryNode;
4565 function isTypeLiteralNode(node: Node): node is TypeLiteralNode;
4566 function isArrayTypeNode(node: Node): node is ArrayTypeNode;
4567 function isTupleTypeNode(node: Node): node is TupleTypeNode;
4568 function isNamedTupleMember(node: Node): node is NamedTupleMember;
4569 function isOptionalTypeNode(node: Node): node is OptionalTypeNode;
4570 function isRestTypeNode(node: Node): node is RestTypeNode;
4571 function isUnionTypeNode(node: Node): node is UnionTypeNode;
4572 function isIntersectionTypeNode(node: Node): node is IntersectionTypeNode;
4573 function isConditionalTypeNode(node: Node): node is ConditionalTypeNode;
4574 function isInferTypeNode(node: Node): node is InferTypeNode;
4575 function isParenthesizedTypeNode(node: Node): node is ParenthesizedTypeNode;
4576 function isThisTypeNode(node: Node): node is ThisTypeNode;
4577 function isTypeOperatorNode(node: Node): node is TypeOperatorNode;
4578 function isIndexedAccessTypeNode(node: Node): node is IndexedAccessTypeNode;
4579 function isMappedTypeNode(node: Node): node is MappedTypeNode;
4580 function isLiteralTypeNode(node: Node): node is LiteralTypeNode;
4581 function isImportTypeNode(node: Node): node is ImportTypeNode;
4582 function isTemplateLiteralTypeSpan(node: Node): node is TemplateLiteralTypeSpan;
4583 function isTemplateLiteralTypeNode(node: Node): node is TemplateLiteralTypeNode;
4584 function isObjectBindingPattern(node: Node): node is ObjectBindingPattern;
4585 function isArrayBindingPattern(node: Node): node is ArrayBindingPattern;
4586 function isBindingElement(node: Node): node is BindingElement;
4587 function isArrayLiteralExpression(node: Node): node is ArrayLiteralExpression;
4588 function isObjectLiteralExpression(node: Node): node is ObjectLiteralExpression;
4589 function isPropertyAccessExpression(node: Node): node is PropertyAccessExpression;
4590 function isElementAccessExpression(node: Node): node is ElementAccessExpression;
4591 function isCallExpression(node: Node): node is CallExpression;
4592 function isNewExpression(node: Node): node is NewExpression;
4593 function isTaggedTemplateExpression(node: Node): node is TaggedTemplateExpression;
4594 function isTypeAssertionExpression(node: Node): node is TypeAssertion;
4595 function isParenthesizedExpression(node: Node): node is ParenthesizedExpression;
4596 function isFunctionExpression(node: Node): node is FunctionExpression;
4597 function isArrowFunction(node: Node): node is ArrowFunction;
4598 function isDeleteExpression(node: Node): node is DeleteExpression;
4599 function isTypeOfExpression(node: Node): node is TypeOfExpression;
4600 function isVoidExpression(node: Node): node is VoidExpression;
4601 function isAwaitExpression(node: Node): node is AwaitExpression;
4602 function isPrefixUnaryExpression(node: Node): node is PrefixUnaryExpression;
4603 function isPostfixUnaryExpression(node: Node): node is PostfixUnaryExpression;
4604 function isBinaryExpression(node: Node): node is BinaryExpression;
4605 function isConditionalExpression(node: Node): node is ConditionalExpression;
4606 function isTemplateExpression(node: Node): node is TemplateExpression;
4607 function isYieldExpression(node: Node): node is YieldExpression;
4608 function isSpreadElement(node: Node): node is SpreadElement;
4609 function isClassExpression(node: Node): node is ClassExpression;
4610 function isOmittedExpression(node: Node): node is OmittedExpression;
4611 function isExpressionWithTypeArguments(node: Node): node is ExpressionWithTypeArguments;
4612 function isAsExpression(node: Node): node is AsExpression;
4613 function isNonNullExpression(node: Node): node is NonNullExpression;
4614 function isMetaProperty(node: Node): node is MetaProperty;
4615 function isSyntheticExpression(node: Node): node is SyntheticExpression;
4616 function isPartiallyEmittedExpression(node: Node): node is PartiallyEmittedExpression;
4617 function isCommaListExpression(node: Node): node is CommaListExpression;
4618 function isTemplateSpan(node: Node): node is TemplateSpan;
4619 function isSemicolonClassElement(node: Node): node is SemicolonClassElement;
4620 function isBlock(node: Node): node is Block;
4621 function isVariableStatement(node: Node): node is VariableStatement;
4622 function isEmptyStatement(node: Node): node is EmptyStatement;
4623 function isExpressionStatement(node: Node): node is ExpressionStatement;
4624 function isIfStatement(node: Node): node is IfStatement;
4625 function isDoStatement(node: Node): node is DoStatement;
4626 function isWhileStatement(node: Node): node is WhileStatement;
4627 function isForStatement(node: Node): node is ForStatement;
4628 function isForInStatement(node: Node): node is ForInStatement;
4629 function isForOfStatement(node: Node): node is ForOfStatement;
4630 function isContinueStatement(node: Node): node is ContinueStatement;
4631 function isBreakStatement(node: Node): node is BreakStatement;
4632 function isReturnStatement(node: Node): node is ReturnStatement;
4633 function isWithStatement(node: Node): node is WithStatement;
4634 function isSwitchStatement(node: Node): node is SwitchStatement;
4635 function isLabeledStatement(node: Node): node is LabeledStatement;
4636 function isThrowStatement(node: Node): node is ThrowStatement;
4637 function isTryStatement(node: Node): node is TryStatement;
4638 function isDebuggerStatement(node: Node): node is DebuggerStatement;
4639 function isVariableDeclaration(node: Node): node is VariableDeclaration;
4640 function isVariableDeclarationList(node: Node): node is VariableDeclarationList;
4641 function isFunctionDeclaration(node: Node): node is FunctionDeclaration;
4642 function isClassDeclaration(node: Node): node is ClassDeclaration;
4643 function isInterfaceDeclaration(node: Node): node is InterfaceDeclaration;
4644 function isTypeAliasDeclaration(node: Node): node is TypeAliasDeclaration;
4645 function isEnumDeclaration(node: Node): node is EnumDeclaration;
4646 function isModuleDeclaration(node: Node): node is ModuleDeclaration;
4647 function isModuleBlock(node: Node): node is ModuleBlock;
4648 function isCaseBlock(node: Node): node is CaseBlock;
4649 function isNamespaceExportDeclaration(node: Node): node is NamespaceExportDeclaration;
4650 function isImportEqualsDeclaration(node: Node): node is ImportEqualsDeclaration;
4651 function isImportDeclaration(node: Node): node is ImportDeclaration;
4652 function isImportClause(node: Node): node is ImportClause;
4653 function isAssertClause(node: Node): node is AssertClause;
4654 function isAssertEntry(node: Node): node is AssertEntry;
4655 function isNamespaceImport(node: Node): node is NamespaceImport;
4656 function isNamespaceExport(node: Node): node is NamespaceExport;
4657 function isNamedImports(node: Node): node is NamedImports;
4658 function isImportSpecifier(node: Node): node is ImportSpecifier;
4659 function isExportAssignment(node: Node): node is ExportAssignment;
4660 function isExportDeclaration(node: Node): node is ExportDeclaration;
4661 function isNamedExports(node: Node): node is NamedExports;
4662 function isExportSpecifier(node: Node): node is ExportSpecifier;
4663 function isMissingDeclaration(node: Node): node is MissingDeclaration;
4664 function isNotEmittedStatement(node: Node): node is NotEmittedStatement;
4665 function isExternalModuleReference(node: Node): node is ExternalModuleReference;
4666 function isJsxElement(node: Node): node is JsxElement;
4667 function isJsxSelfClosingElement(node: Node): node is JsxSelfClosingElement;
4668 function isJsxOpeningElement(node: Node): node is JsxOpeningElement;
4669 function isJsxClosingElement(node: Node): node is JsxClosingElement;
4670 function isJsxFragment(node: Node): node is JsxFragment;
4671 function isJsxOpeningFragment(node: Node): node is JsxOpeningFragment;
4672 function isJsxClosingFragment(node: Node): node is JsxClosingFragment;
4673 function isJsxAttribute(node: Node): node is JsxAttribute;
4674 function isJsxAttributes(node: Node): node is JsxAttributes;
4675 function isJsxSpreadAttribute(node: Node): node is JsxSpreadAttribute;
4676 function isJsxExpression(node: Node): node is JsxExpression;
4677 function isCaseClause(node: Node): node is CaseClause;
4678 function isDefaultClause(node: Node): node is DefaultClause;
4679 function isHeritageClause(node: Node): node is HeritageClause;
4680 function isCatchClause(node: Node): node is CatchClause;
4681 function isPropertyAssignment(node: Node): node is PropertyAssignment;
4682 function isShorthandPropertyAssignment(node: Node): node is ShorthandPropertyAssignment;
4683 function isSpreadAssignment(node: Node): node is SpreadAssignment;
4684 function isEnumMember(node: Node): node is EnumMember;
4685 function isUnparsedPrepend(node: Node): node is UnparsedPrepend;
4686 function isSourceFile(node: Node): node is SourceFile;
4687 function isBundle(node: Node): node is Bundle;
4688 function isUnparsedSource(node: Node): node is UnparsedSource;
4689 function isJSDocTypeExpression(node: Node): node is JSDocTypeExpression;
4690 function isJSDocNameReference(node: Node): node is JSDocNameReference;
4691 function isJSDocMemberName(node: Node): node is JSDocMemberName;
4692 function isJSDocLink(node: Node): node is JSDocLink;
4693 function isJSDocLinkCode(node: Node): node is JSDocLinkCode;
4694 function isJSDocLinkPlain(node: Node): node is JSDocLinkPlain;
4695 function isJSDocAllType(node: Node): node is JSDocAllType;
4696 function isJSDocUnknownType(node: Node): node is JSDocUnknownType;
4697 function isJSDocNullableType(node: Node): node is JSDocNullableType;
4698 function isJSDocNonNullableType(node: Node): node is JSDocNonNullableType;
4699 function isJSDocOptionalType(node: Node): node is JSDocOptionalType;
4700 function isJSDocFunctionType(node: Node): node is JSDocFunctionType;
4701 function isJSDocVariadicType(node: Node): node is JSDocVariadicType;
4702 function isJSDocNamepathType(node: Node): node is JSDocNamepathType;
4703 function isJSDoc(node: Node): node is JSDoc;
4704 function isJSDocTypeLiteral(node: Node): node is JSDocTypeLiteral;
4705 function isJSDocSignature(node: Node): node is JSDocSignature;
4706 function isJSDocAugmentsTag(node: Node): node is JSDocAugmentsTag;
4707 function isJSDocAuthorTag(node: Node): node is JSDocAuthorTag;
4708 function isJSDocClassTag(node: Node): node is JSDocClassTag;
4709 function isJSDocCallbackTag(node: Node): node is JSDocCallbackTag;
4710 function isJSDocPublicTag(node: Node): node is JSDocPublicTag;
4711 function isJSDocPrivateTag(node: Node): node is JSDocPrivateTag;
4712 function isJSDocProtectedTag(node: Node): node is JSDocProtectedTag;
4713 function isJSDocReadonlyTag(node: Node): node is JSDocReadonlyTag;
4714 function isJSDocOverrideTag(node: Node): node is JSDocOverrideTag;
4715 function isJSDocDeprecatedTag(node: Node): node is JSDocDeprecatedTag;
4716 function isJSDocSeeTag(node: Node): node is JSDocSeeTag;
4717 function isJSDocEnumTag(node: Node): node is JSDocEnumTag;
4718 function isJSDocParameterTag(node: Node): node is JSDocParameterTag;
4719 function isJSDocReturnTag(node: Node): node is JSDocReturnTag;
4720 function isJSDocThisTag(node: Node): node is JSDocThisTag;
4721 function isJSDocTypeTag(node: Node): node is JSDocTypeTag;
4722 function isJSDocTemplateTag(node: Node): node is JSDocTemplateTag;
4723 function isJSDocTypedefTag(node: Node): node is JSDocTypedefTag;
4724 function isJSDocUnknownTag(node: Node): node is JSDocUnknownTag;
4725 function isJSDocPropertyTag(node: Node): node is JSDocPropertyTag;
4726 function isJSDocImplementsTag(node: Node): node is JSDocImplementsTag;
4728 declare namespace ts {
4729 function setTextRange<T extends TextRange>(range: T, location: TextRange | undefined): T;
4731 declare namespace ts {
4733 * Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes
4734 * stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise,
4735 * embedded arrays are flattened and the 'cbNode' callback is invoked for each element. If a callback returns
4736 * a truthy value, iteration stops and that value is returned. Otherwise, undefined is returned.
4738 * @param node a given node to visit its children
4739 * @param cbNode a callback to be invoked for all child nodes
4740 * @param cbNodes a callback to be invoked for embedded array
4742 * @remarks `forEachChild` must visit the children of a node in the order
4743 * that they appear in the source code. The language service depends on this property to locate nodes by position.
4745 export function forEachChild<T>(node: Node, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined;
4746 export function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean, scriptKind?: ScriptKind): SourceFile;
4747 export function parseIsolatedEntityName(text: string, languageVersion: ScriptTarget): EntityName | undefined;
4749 * Parse json text into SyntaxTree and return node and parse errors if any
4753 export function parseJsonText(fileName: string, sourceText: string): JsonSourceFile;
4754 export function isExternalModule(file: SourceFile): boolean;
4755 export function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
4758 declare namespace ts {
4759 export function parseCommandLine(commandLine: readonly string[], readFile?: (path: string) => string | undefined): ParsedCommandLine;
4760 export type DiagnosticReporter = (diagnostic: Diagnostic) => void;
4762 * Reports config file diagnostics
4764 export interface ConfigFileDiagnosticsReporter {
4766 * Reports unrecoverable error when parsing config file
4768 onUnRecoverableConfigFileDiagnostic: DiagnosticReporter;
4771 * Interface extending ParseConfigHost to support ParseConfigFile that reads config file and reports errors
4773 export interface ParseConfigFileHost extends ParseConfigHost, ConfigFileDiagnosticsReporter {
4774 getCurrentDirectory(): string;
4777 * Reads the config file, reports errors if any and exits if the config file cannot be found
4779 export function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions | undefined, host: ParseConfigFileHost, extendedConfigCache?: Map<ExtendedConfigCacheEntry>, watchOptionsToExtend?: WatchOptions, extraFileExtensions?: readonly FileExtensionInfo[]): ParsedCommandLine | undefined;
4781 * Read tsconfig.json file
4782 * @param fileName The path to the config file
4784 export function readConfigFile(fileName: string, readFile: (path: string) => string | undefined): {
4789 * Parse the text of the tsconfig.json file
4790 * @param fileName The path to the config file
4791 * @param jsonText The text of the config file
4793 export function parseConfigFileTextToJson(fileName: string, jsonText: string): {
4798 * Read tsconfig.json file
4799 * @param fileName The path to the config file
4801 export function readJsonConfigFile(fileName: string, readFile: (path: string) => string | undefined): TsConfigSourceFile;
4803 * Convert the json syntax tree into the json value
4805 export function convertToObject(sourceFile: JsonSourceFile, errors: Push<Diagnostic>): any;
4807 * Parse the contents of a config file (tsconfig.json).
4808 * @param json The contents of the config file to parse
4809 * @param host Instance of ParseConfigHost used to enumerate files in folder.
4810 * @param basePath A root directory to resolve relative path entries in the config
4811 * file to. e.g. outDir
4813 export function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: readonly FileExtensionInfo[], extendedConfigCache?: Map<ExtendedConfigCacheEntry>, existingWatchOptions?: WatchOptions): ParsedCommandLine;
4815 * Parse the contents of a config file (tsconfig.json).
4816 * @param jsonNode The contents of the config file to parse
4817 * @param host Instance of ParseConfigHost used to enumerate files in folder.
4818 * @param basePath A root directory to resolve relative path entries in the config
4819 * file to. e.g. outDir
4821 export function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: readonly FileExtensionInfo[], extendedConfigCache?: Map<ExtendedConfigCacheEntry>, existingWatchOptions?: WatchOptions): ParsedCommandLine;
4822 export interface ParsedTsconfig {
4824 options?: CompilerOptions;
4825 watchOptions?: WatchOptions;
4826 typeAcquisition?: TypeAcquisition;
4828 * Note that the case of the config path has not yet been normalized, as no files have been imported into the project yet
4830 extendedConfigPath?: string;
4832 export interface ExtendedConfigCacheEntry {
4833 extendedResult: TsConfigSourceFile;
4834 extendedConfig: ParsedTsconfig | undefined;
4836 export function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
4837 options: CompilerOptions;
4838 errors: Diagnostic[];
4840 export function convertTypeAcquisitionFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
4841 options: TypeAcquisition;
4842 errors: Diagnostic[];
4846 declare namespace ts {
4847 export function getEffectiveTypeRoots(options: CompilerOptions, host: GetEffectiveTypeRootsHost): string[] | undefined;
4849 * @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown.
4850 * This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups
4851 * is assumed to be the same as root directory of the project.
4853 export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference, cache?: TypeReferenceDirectiveResolutionCache): ResolvedTypeReferenceDirectiveWithFailedLookupLocations;
4855 * Given a set of options, returns the set of type directive names
4856 * that should be included for this program automatically.
4857 * This list could either come from the config file,
4858 * or from enumerating the types root + initial secondary types lookup location.
4859 * More type directives might appear in the program later as a result of loading actual source files;
4860 * this list is only the set of defaults that are implicitly included.
4862 export function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[];
4863 export interface TypeReferenceDirectiveResolutionCache extends PerDirectoryResolutionCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>, PackageJsonInfoCache {
4865 export interface ModeAwareCache<T> {
4866 get(key: string, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined): T | undefined;
4867 set(key: string, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined, value: T): this;
4868 delete(key: string, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined): this;
4869 has(key: string, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined): boolean;
4870 forEach(cb: (elem: T, key: string, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined) => void): void;
4874 * Cached resolutions per containing directory.
4875 * This assumes that any module id will have the same resolution for sibling files located in the same folder.
4877 export interface PerDirectoryResolutionCache<T> {
4878 getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference): ModeAwareCache<T>;
4881 * Updates with the current compilerOptions the cache will operate with.
4882 * This updates the redirects map as well if needed so module resolutions are cached if they can across the projects
4884 update(options: CompilerOptions): void;
4886 export interface ModuleResolutionCache extends PerDirectoryResolutionCache<ResolvedModuleWithFailedLookupLocations>, NonRelativeModuleNameResolutionCache, PackageJsonInfoCache {
4887 getPackageJsonInfoCache(): PackageJsonInfoCache;
4890 * Stored map from non-relative module name to a table: directory -> result of module lookup in this directory
4891 * We support only non-relative module names because resolution of relative module names is usually more deterministic and thus less expensive.
4893 export interface NonRelativeModuleNameResolutionCache extends PackageJsonInfoCache {
4894 getOrCreateCacheForModuleName(nonRelativeModuleName: string, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined, redirectedReference?: ResolvedProjectReference): PerModuleNameCache;
4896 export interface PackageJsonInfoCache {
4899 export interface PerModuleNameCache {
4900 get(directory: string): ResolvedModuleWithFailedLookupLocations | undefined;
4901 set(directory: string, result: ResolvedModuleWithFailedLookupLocations): void;
4903 export function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions): ModuleResolutionCache;
4904 export function createTypeReferenceDirectiveResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions, packageJsonInfoCache?: PackageJsonInfoCache): TypeReferenceDirectiveResolutionCache;
4905 export function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache, mode?: ModuleKind.CommonJS | ModuleKind.ESNext): ResolvedModuleWithFailedLookupLocations | undefined;
4906 export function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference, resolutionMode?: ModuleKind.CommonJS | ModuleKind.ESNext): ResolvedModuleWithFailedLookupLocations;
4907 export function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
4908 export function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
4911 declare namespace ts {
4913 * Visits a Node using the supplied visitor, possibly returning a new Node in its place.
4915 * @param node The Node to visit.
4916 * @param visitor The callback used to visit the Node.
4917 * @param test A callback to execute to verify the Node is valid.
4918 * @param lift An optional callback to execute to lift a NodeArray into a valid Node.
4920 function visitNode<T extends Node>(node: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T;
4922 * Visits a Node using the supplied visitor, possibly returning a new Node in its place.
4924 * @param node The Node to visit.
4925 * @param visitor The callback used to visit the Node.
4926 * @param test A callback to execute to verify the Node is valid.
4927 * @param lift An optional callback to execute to lift a NodeArray into a valid Node.
4929 function visitNode<T extends Node>(node: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T | undefined;
4931 * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
4933 * @param nodes The NodeArray to visit.
4934 * @param visitor The callback used to visit a Node.
4935 * @param test A node test to execute for each node.
4936 * @param start An optional value indicating the starting offset at which to start visiting.
4937 * @param count An optional value indicating the maximum number of nodes to visit.
4939 function visitNodes<T extends Node>(nodes: NodeArray<T>, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T>;
4941 * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
4943 * @param nodes The NodeArray to visit.
4944 * @param visitor The callback used to visit a Node.
4945 * @param test A node test to execute for each node.
4946 * @param start An optional value indicating the starting offset at which to start visiting.
4947 * @param count An optional value indicating the maximum number of nodes to visit.
4949 function visitNodes<T extends Node>(nodes: NodeArray<T> | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T> | undefined;
4951 * Starts a new lexical environment and visits a statement list, ending the lexical environment
4952 * and merging hoisted declarations upon completion.
4954 function visitLexicalEnvironment(statements: NodeArray<Statement>, visitor: Visitor, context: TransformationContext, start?: number, ensureUseStrict?: boolean, nodesVisitor?: NodesVisitor): NodeArray<Statement>;
4956 * Starts a new lexical environment and visits a parameter list, suspending the lexical
4957 * environment upon completion.
4959 function visitParameterList(nodes: NodeArray<ParameterDeclaration>, visitor: Visitor, context: TransformationContext, nodesVisitor?: NodesVisitor): NodeArray<ParameterDeclaration>;
4960 function visitParameterList(nodes: NodeArray<ParameterDeclaration> | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: NodesVisitor): NodeArray<ParameterDeclaration> | undefined;
4962 * Resumes a suspended lexical environment and visits a function body, ending the lexical
4963 * environment and merging hoisted declarations upon completion.
4965 function visitFunctionBody(node: FunctionBody, visitor: Visitor, context: TransformationContext): FunctionBody;
4967 * Resumes a suspended lexical environment and visits a function body, ending the lexical
4968 * environment and merging hoisted declarations upon completion.
4970 function visitFunctionBody(node: FunctionBody | undefined, visitor: Visitor, context: TransformationContext): FunctionBody | undefined;
4972 * Resumes a suspended lexical environment and visits a concise body, ending the lexical
4973 * environment and merging hoisted declarations upon completion.
4975 function visitFunctionBody(node: ConciseBody, visitor: Visitor, context: TransformationContext): ConciseBody;
4977 * Visits an iteration body, adding any block-scoped variables required by the transformation.
4979 function visitIterationBody(body: Statement, visitor: Visitor, context: TransformationContext): Statement;
4981 * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.
4983 * @param node The Node whose children will be visited.
4984 * @param visitor The callback used to visit each child.
4985 * @param context A lexical environment context for the visitor.
4987 function visitEachChild<T extends Node>(node: T, visitor: Visitor, context: TransformationContext): T;
4989 * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.
4991 * @param node The Node whose children will be visited.
4992 * @param visitor The callback used to visit each child.
4993 * @param context A lexical environment context for the visitor.
4995 function visitEachChild<T extends Node>(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined;
4997 declare namespace ts {
4998 function getTsBuildInfoEmitOutputFilePath(options: CompilerOptions): string | undefined;
4999 function getOutputFileNames(commandLine: ParsedCommandLine, inputFileName: string, ignoreCase: boolean): readonly string[];
5000 function createPrinter(printerOptions?: PrinterOptions, handlers?: PrintHandlers): Printer;
5002 declare namespace ts {
5003 export function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string | undefined;
5004 export function resolveTripleslashReference(moduleName: string, containingFile: string): string;
5005 export function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
5006 export function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
5007 export interface FormatDiagnosticsHost {
5008 getCurrentDirectory(): string;
5009 getCanonicalFileName(fileName: string): string;
5010 getNewLine(): string;
5012 export function formatDiagnostics(diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost): string;
5013 export function formatDiagnostic(diagnostic: Diagnostic, host: FormatDiagnosticsHost): string;
5014 export function formatDiagnosticsWithColorAndContext(diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost): string;
5015 export function flattenDiagnosticMessageText(diag: string | DiagnosticMessageChain | undefined, newLine: string, indent?: number): string;
5016 export function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): readonly Diagnostic[];
5018 * A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the
5019 * `options` parameter.
5021 * @param fileName The normalized absolute path to check the format of (it need not exist on disk)
5022 * @param [packageJsonInfoCache] A cache for package file lookups - it's best to have a cache when this function is called often
5023 * @param host The ModuleResolutionHost which can perform the filesystem lookups for package json data
5024 * @param options The compiler options to perform the analysis under - relevant options are `moduleResolution` and `traceResolution`
5025 * @returns `undefined` if the path has no relevant implied format, `ModuleKind.ESNext` for esm format, and `ModuleKind.CommonJS` for cjs format
5027 export function getImpliedNodeFormatForFile(fileName: Path, packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions): ModuleKind.ESNext | ModuleKind.CommonJS | undefined;
5029 * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions'
5030 * that represent a compilation unit.
5032 * Creating a program proceeds from a set of root files, expanding the set of inputs by following imports and
5033 * triple-slash-reference-path directives transitively. '@types' and triple-slash-reference-types are also pulled in.
5035 * @param createProgramOptions - The options for creating a program.
5036 * @returns A 'Program' object.
5038 export function createProgram(createProgramOptions: CreateProgramOptions): Program;
5040 * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions'
5041 * that represent a compilation unit.
5043 * Creating a program proceeds from a set of root files, expanding the set of inputs by following imports and
5044 * triple-slash-reference-path directives transitively. '@types' and triple-slash-reference-types are also pulled in.
5046 * @param rootNames - A set of root files.
5047 * @param options - The compiler options which should be used.
5048 * @param host - The host interacts with the underlying file system.
5049 * @param oldProgram - Reuses an old program structure.
5050 * @param configFileParsingDiagnostics - error during config file parsing
5051 * @returns A 'Program' object.
5053 export function createProgram(rootNames: readonly string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program, configFileParsingDiagnostics?: readonly Diagnostic[]): Program;
5054 /** @deprecated */ export interface ResolveProjectReferencePathHost {
5055 fileExists(fileName: string): boolean;
5058 * Returns the target config filename of a project reference.
5059 * Note: The file might not exist.
5061 export function resolveProjectReferencePath(ref: ProjectReference): ResolvedConfigFileName;
5062 /** @deprecated */ export function resolveProjectReferencePath(host: ResolveProjectReferencePathHost, ref: ProjectReference): ResolvedConfigFileName;
5065 declare namespace ts {
5066 interface EmitOutput {
5067 outputFiles: OutputFile[];
5068 emitSkipped: boolean;
5070 interface OutputFile {
5072 writeByteOrderMark: boolean;
5076 declare namespace ts {
5077 type AffectedFileResult<T> = {
5079 affected: SourceFile | Program;
5081 interface BuilderProgramHost {
5083 * return true if file names are treated with case sensitivity
5085 useCaseSensitiveFileNames(): boolean;
5087 * If provided this would be used this hash instead of actual file shape text for detecting changes
5089 createHash?: (data: string) => string;
5091 * When emit or emitNextAffectedFile are called without writeFile,
5092 * this callback if present would be used to write files
5094 writeFile?: WriteFileCallback;
5097 * Builder to manage the program state changes
5099 interface BuilderProgram {
5101 * Returns current program
5103 getProgram(): Program;
5105 * Get compiler options of the program
5107 getCompilerOptions(): CompilerOptions;
5109 * Get the source file in the program with file name
5111 getSourceFile(fileName: string): SourceFile | undefined;
5113 * Get a list of files in the program
5115 getSourceFiles(): readonly SourceFile[];
5117 * Get the diagnostics for compiler options
5119 getOptionsDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
5121 * Get the diagnostics that dont belong to any file
5123 getGlobalDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
5125 * Get the diagnostics from config file parsing
5127 getConfigFileParsingDiagnostics(): readonly Diagnostic[];
5129 * Get the syntax diagnostics, for all source files if source file is not supplied
5131 getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
5133 * Get the declaration diagnostics, for all source files if source file is not supplied
5135 getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[];
5137 * Get all the dependencies of the file
5139 getAllDependencies(sourceFile: SourceFile): readonly string[];
5141 * Gets the semantic diagnostics from the program corresponding to this state of file (if provided) or whole program
5142 * The semantic diagnostics are cached and managed here
5143 * Note that it is assumed that when asked about semantic diagnostics through this API,
5144 * the file has been taken out of affected files so it is safe to use cache or get from program and cache the diagnostics
5145 * In case of SemanticDiagnosticsBuilderProgram if the source file is not provided,
5146 * it will iterate through all the affected files, to ensure that cache stays valid and yet provide a way to get all semantic diagnostics
5148 getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
5150 * Emits the JavaScript and declaration files.
5151 * When targetSource file is specified, emits the files corresponding to that source file,
5152 * otherwise for the whole program.
5153 * In case of EmitAndSemanticDiagnosticsBuilderProgram, when targetSourceFile is specified,
5154 * it is assumed that that file is handled from affected file list. If targetSourceFile is not specified,
5155 * it will only emit all the affected files instead of whole program
5157 * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host
5158 * in that order would be used to write the files
5160 emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult;
5162 * Get the current directory of the program
5164 getCurrentDirectory(): string;
5167 * The builder that caches the semantic diagnostics for the program and handles the changed files and affected files
5169 interface SemanticDiagnosticsBuilderProgram extends BuilderProgram {
5171 * Gets the semantic diagnostics from the program for the next affected file and caches it
5172 * Returns undefined if the iteration is complete
5174 getSemanticDiagnosticsOfNextAffectedFile(cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean): AffectedFileResult<readonly Diagnostic[]>;
5177 * The builder that can handle the changes in program and iterate through changed file to emit the files
5178 * The semantic diagnostics are cached per file and managed by clearing for the changed/affected files
5180 interface EmitAndSemanticDiagnosticsBuilderProgram extends SemanticDiagnosticsBuilderProgram {
5182 * Emits the next affected file's emit result (EmitResult and sourceFiles emitted) or returns undefined if iteration is complete
5183 * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host
5184 * in that order would be used to write the files
5186 emitNextAffectedFile(writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): AffectedFileResult<EmitResult>;
5189 * Create the builder to manage semantic diagnostics and cache them
5191 function createSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[]): SemanticDiagnosticsBuilderProgram;
5192 function createSemanticDiagnosticsBuilderProgram(rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]): SemanticDiagnosticsBuilderProgram;
5194 * Create the builder that can handle the changes in program and iterate through changed files
5195 * to emit the those files and manage semantic diagnostics cache as well
5197 function createEmitAndSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[]): EmitAndSemanticDiagnosticsBuilderProgram;
5198 function createEmitAndSemanticDiagnosticsBuilderProgram(rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]): EmitAndSemanticDiagnosticsBuilderProgram;
5200 * Creates a builder thats just abstraction over program and can be used with watch
5202 function createAbstractBuilder(newProgram: Program, host: BuilderProgramHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[]): BuilderProgram;
5203 function createAbstractBuilder(rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]): BuilderProgram;
5205 declare namespace ts {
5206 interface ReadBuildProgramHost {
5207 useCaseSensitiveFileNames(): boolean;
5208 getCurrentDirectory(): string;
5209 readFile(fileName: string): string | undefined;
5211 function readBuilderProgram(compilerOptions: CompilerOptions, host: ReadBuildProgramHost): EmitAndSemanticDiagnosticsBuilderProgram | undefined;
5212 function createIncrementalCompilerHost(options: CompilerOptions, system?: System): CompilerHost;
5213 interface IncrementalProgramOptions<T extends BuilderProgram> {
5214 rootNames: readonly string[];
5215 options: CompilerOptions;
5216 configFileParsingDiagnostics?: readonly Diagnostic[];
5217 projectReferences?: readonly ProjectReference[];
5218 host?: CompilerHost;
5219 createProgram?: CreateProgram<T>;
5221 function createIncrementalProgram<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>({ rootNames, options, configFileParsingDiagnostics, projectReferences, host, createProgram }: IncrementalProgramOptions<T>): T;
5222 type WatchStatusReporter = (diagnostic: Diagnostic, newLine: string, options: CompilerOptions, errorCount?: number) => void;
5223 /** Create the program with rootNames and options, if they are undefined, oldProgram and new configFile diagnostics create new program */
5224 type CreateProgram<T extends BuilderProgram> = (rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: T, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[] | undefined) => T;
5225 /** Host that has watch functionality used in --watch mode */
5226 interface WatchHost {
5227 /** If provided, called with Diagnostic message that informs about change in watch status */
5228 onWatchStatusChange?(diagnostic: Diagnostic, newLine: string, options: CompilerOptions, errorCount?: number): void;
5229 /** Used to watch changes in source files, missing files needed to update the program or config file */
5230 watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: CompilerOptions): FileWatcher;
5231 /** Used to watch resolved module's failed lookup locations, config file specs, type roots where auto type reference directives are added */
5232 watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: CompilerOptions): FileWatcher;
5233 /** If provided, will be used to set delayed compilation, so that multiple changes in short span are compiled together */
5234 setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
5235 /** If provided, will be used to reset existing delayed compilation */
5236 clearTimeout?(timeoutId: any): void;
5238 interface ProgramHost<T extends BuilderProgram> {
5240 * Used to create the program when need for program creation or recreation detected
5242 createProgram: CreateProgram<T>;
5243 useCaseSensitiveFileNames(): boolean;
5244 getNewLine(): string;
5245 getCurrentDirectory(): string;
5246 getDefaultLibFileName(options: CompilerOptions): string;
5247 getDefaultLibLocation?(): string;
5248 createHash?(data: string): string;
5250 * Use to check file presence for source files and
5251 * if resolveModuleNames is not provided (complier is in charge of module resolution) then module files as well
5253 fileExists(path: string): boolean;
5255 * Use to read file text for source files and
5256 * if resolveModuleNames is not provided (complier is in charge of module resolution) then module files as well
5258 readFile(path: string, encoding?: string): string | undefined;
5259 /** If provided, used for module resolution as well as to handle directory structure */
5260 directoryExists?(path: string): boolean;
5261 /** If provided, used in resolutions as well as handling directory structure */
5262 getDirectories?(path: string): string[];
5263 /** If provided, used to cache and handle directory structure modifications */
5264 readDirectory?(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
5265 /** Symbol links resolution */
5266 realpath?(path: string): string;
5267 /** If provided would be used to write log about compilation */
5268 trace?(s: string): void;
5269 /** If provided is used to get the environment variable */
5270 getEnvironmentVariable?(name: string): string | undefined;
5271 /** If provided, used to resolve the module names, otherwise typescript's default module resolution */
5272 resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[];
5273 /** If provided, used to resolve type reference directives, otherwise typescript's default resolution */
5274 resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
5276 interface WatchCompilerHost<T extends BuilderProgram> extends ProgramHost<T>, WatchHost {
5277 /** Instead of using output d.ts file from project reference, use its source file */
5278 useSourceOfProjectReferenceRedirect?(): boolean;
5279 /** If provided, use this method to get parsed command lines for referenced projects */
5280 getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
5281 /** If provided, callback to invoke after every new program creation */
5282 afterProgramCreate?(program: T): void;
5285 * Host to create watch with root files and options
5287 interface WatchCompilerHostOfFilesAndCompilerOptions<T extends BuilderProgram> extends WatchCompilerHost<T> {
5288 /** root files to use to generate program */
5289 rootFiles: string[];
5290 /** Compiler options */
5291 options: CompilerOptions;
5292 watchOptions?: WatchOptions;
5293 /** Project References */
5294 projectReferences?: readonly ProjectReference[];
5297 * Host to create watch with config file
5299 interface WatchCompilerHostOfConfigFile<T extends BuilderProgram> extends WatchCompilerHost<T>, ConfigFileDiagnosticsReporter {
5300 /** Name of the config file to compile */
5301 configFileName: string;
5302 /** Options to extend */
5303 optionsToExtend?: CompilerOptions;
5304 watchOptionsToExtend?: WatchOptions;
5305 extraFileExtensions?: readonly FileExtensionInfo[];
5307 * Used to generate source file names from the config file and its include, exclude, files rules
5308 * and also to cache the directory stucture
5310 readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
5312 interface Watch<T> {
5313 /** Synchronize with host and get updated program */
5315 /** Closes the watch */
5319 * Creates the watch what generates program using the config file
5321 interface WatchOfConfigFile<T> extends Watch<T> {
5324 * Creates the watch that generates program using the root files and compiler options
5326 interface WatchOfFilesAndCompilerOptions<T> extends Watch<T> {
5327 /** Updates the root files in the program, only if this is not config file compilation */
5328 updateRootFileNames(fileNames: string[]): void;
5331 * Create the watch compiler host for either configFile or fileNames and its options
5333 function createWatchCompilerHost<T extends BuilderProgram>(configFileName: string, optionsToExtend: CompilerOptions | undefined, system: System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter, watchOptionsToExtend?: WatchOptions, extraFileExtensions?: readonly FileExtensionInfo[]): WatchCompilerHostOfConfigFile<T>;
5334 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>;
5336 * Creates the watch from the host for root files and compiler options
5338 function createWatchProgram<T extends BuilderProgram>(host: WatchCompilerHostOfFilesAndCompilerOptions<T>): WatchOfFilesAndCompilerOptions<T>;
5340 * Creates the watch from the host for config file
5342 function createWatchProgram<T extends BuilderProgram>(host: WatchCompilerHostOfConfigFile<T>): WatchOfConfigFile<T>;
5344 declare namespace ts {
5345 interface BuildOptions {
5349 incremental?: boolean;
5350 assumeChangesOnlyAffectDirectDependencies?: boolean;
5351 traceResolution?: boolean;
5352 [option: string]: CompilerOptionsValue | undefined;
5354 type ReportEmitErrorSummary = (errorCount: number) => void;
5355 interface SolutionBuilderHostBase<T extends BuilderProgram> extends ProgramHost<T> {
5356 createDirectory?(path: string): void;
5358 * Should provide create directory and writeFile if done of invalidatedProjects is not invoked with
5361 writeFile?(path: string, data: string, writeByteOrderMark?: boolean): void;
5362 getCustomTransformers?: (project: string) => CustomTransformers | undefined;
5363 getModifiedTime(fileName: string): Date | undefined;
5364 setModifiedTime(fileName: string, date: Date): void;
5365 deleteFile(fileName: string): void;
5366 getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
5367 reportDiagnostic: DiagnosticReporter;
5368 reportSolutionBuilderStatus: DiagnosticReporter;
5369 afterProgramEmitAndDiagnostics?(program: T): void;
5371 interface SolutionBuilderHost<T extends BuilderProgram> extends SolutionBuilderHostBase<T> {
5372 reportErrorSummary?: ReportEmitErrorSummary;
5374 interface SolutionBuilderWithWatchHost<T extends BuilderProgram> extends SolutionBuilderHostBase<T>, WatchHost {
5376 interface SolutionBuilder<T extends BuilderProgram> {
5377 build(project?: string, cancellationToken?: CancellationToken, writeFile?: WriteFileCallback, getCustomTransformers?: (project: string) => CustomTransformers): ExitStatus;
5378 clean(project?: string): ExitStatus;
5379 buildReferences(project: string, cancellationToken?: CancellationToken, writeFile?: WriteFileCallback, getCustomTransformers?: (project: string) => CustomTransformers): ExitStatus;
5380 cleanReferences(project?: string): ExitStatus;
5381 getNextInvalidatedProject(cancellationToken?: CancellationToken): InvalidatedProject<T> | undefined;
5384 * Create a function that reports watch status by writing to the system and handles the formating of the diagnostic
5386 function createBuilderStatusReporter(system: System, pretty?: boolean): DiagnosticReporter;
5387 function createSolutionBuilderHost<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>(system?: System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportSolutionBuilderStatus?: DiagnosticReporter, reportErrorSummary?: ReportEmitErrorSummary): SolutionBuilderHost<T>;
5388 function createSolutionBuilderWithWatchHost<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>(system?: System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportSolutionBuilderStatus?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter): SolutionBuilderWithWatchHost<T>;
5389 function createSolutionBuilder<T extends BuilderProgram>(host: SolutionBuilderHost<T>, rootNames: readonly string[], defaultOptions: BuildOptions): SolutionBuilder<T>;
5390 function createSolutionBuilderWithWatch<T extends BuilderProgram>(host: SolutionBuilderWithWatchHost<T>, rootNames: readonly string[], defaultOptions: BuildOptions, baseWatchOptions?: WatchOptions): SolutionBuilder<T>;
5391 enum InvalidatedProjectKind {
5394 UpdateOutputFileStamps = 2
5396 interface InvalidatedProjectBase {
5397 readonly kind: InvalidatedProjectKind;
5398 readonly project: ResolvedConfigFileName;
5400 * To dispose this project and ensure that all the necessary actions are taken and state is updated accordingly
5402 done(cancellationToken?: CancellationToken, writeFile?: WriteFileCallback, customTransformers?: CustomTransformers): ExitStatus;
5403 getCompilerOptions(): CompilerOptions;
5404 getCurrentDirectory(): string;
5406 interface UpdateOutputFileStampsProject extends InvalidatedProjectBase {
5407 readonly kind: InvalidatedProjectKind.UpdateOutputFileStamps;
5408 updateOutputFileStatmps(): void;
5410 interface BuildInvalidedProject<T extends BuilderProgram> extends InvalidatedProjectBase {
5411 readonly kind: InvalidatedProjectKind.Build;
5412 getBuilderProgram(): T | undefined;
5413 getProgram(): Program | undefined;
5414 getSourceFile(fileName: string): SourceFile | undefined;
5415 getSourceFiles(): readonly SourceFile[];
5416 getOptionsDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
5417 getGlobalDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
5418 getConfigFileParsingDiagnostics(): readonly Diagnostic[];
5419 getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
5420 getAllDependencies(sourceFile: SourceFile): readonly string[];
5421 getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
5422 getSemanticDiagnosticsOfNextAffectedFile(cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean): AffectedFileResult<readonly Diagnostic[]>;
5423 emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult | undefined;
5425 interface UpdateBundleProject<T extends BuilderProgram> extends InvalidatedProjectBase {
5426 readonly kind: InvalidatedProjectKind.UpdateBundle;
5427 emit(writeFile?: WriteFileCallback, customTransformers?: CustomTransformers): EmitResult | BuildInvalidedProject<T> | undefined;
5429 type InvalidatedProject<T extends BuilderProgram> = UpdateOutputFileStampsProject | BuildInvalidedProject<T> | UpdateBundleProject<T>;
5431 declare namespace ts.server {
5432 type ActionSet = "action::set";
5433 type ActionInvalidate = "action::invalidate";
5434 type ActionPackageInstalled = "action::packageInstalled";
5435 type EventTypesRegistry = "event::typesRegistry";
5436 type EventBeginInstallTypes = "event::beginInstallTypes";
5437 type EventEndInstallTypes = "event::endInstallTypes";
5438 type EventInitializationFailed = "event::initializationFailed";
5440 declare namespace ts.server {
5441 interface TypingInstallerResponse {
5442 readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed;
5444 interface TypingInstallerRequestWithProjectName {
5445 readonly projectName: string;
5447 interface DiscoverTypings extends TypingInstallerRequestWithProjectName {
5448 readonly fileNames: string[];
5449 readonly projectRootPath: Path;
5450 readonly compilerOptions: CompilerOptions;
5451 readonly watchOptions?: WatchOptions;
5452 readonly typeAcquisition: TypeAcquisition;
5453 readonly unresolvedImports: SortedReadonlyArray<string>;
5454 readonly cachePath?: string;
5455 readonly kind: "discover";
5457 interface CloseProject extends TypingInstallerRequestWithProjectName {
5458 readonly kind: "closeProject";
5460 interface TypesRegistryRequest {
5461 readonly kind: "typesRegistry";
5463 interface InstallPackageRequest extends TypingInstallerRequestWithProjectName {
5464 readonly kind: "installPackage";
5465 readonly fileName: Path;
5466 readonly packageName: string;
5467 readonly projectRootPath: Path;
5469 interface PackageInstalledResponse extends ProjectResponse {
5470 readonly kind: ActionPackageInstalled;
5471 readonly success: boolean;
5472 readonly message: string;
5474 interface InitializationFailedResponse extends TypingInstallerResponse {
5475 readonly kind: EventInitializationFailed;
5476 readonly message: string;
5477 readonly stack?: string;
5479 interface ProjectResponse extends TypingInstallerResponse {
5480 readonly projectName: string;
5482 interface InvalidateCachedTypings extends ProjectResponse {
5483 readonly kind: ActionInvalidate;
5485 interface InstallTypes extends ProjectResponse {
5486 readonly kind: EventBeginInstallTypes | EventEndInstallTypes;
5487 readonly eventId: number;
5488 readonly typingsInstallerVersion: string;
5489 readonly packagesToInstall: readonly string[];
5491 interface BeginInstallTypes extends InstallTypes {
5492 readonly kind: EventBeginInstallTypes;
5494 interface EndInstallTypes extends InstallTypes {
5495 readonly kind: EventEndInstallTypes;
5496 readonly installSuccess: boolean;
5498 interface SetTypings extends ProjectResponse {
5499 readonly typeAcquisition: TypeAcquisition;
5500 readonly compilerOptions: CompilerOptions;
5501 readonly typings: string[];
5502 readonly unresolvedImports: SortedReadonlyArray<string>;
5503 readonly kind: ActionSet;
5506 declare namespace ts {
5508 getSourceFile(): SourceFile;
5509 getChildCount(sourceFile?: SourceFile): number;
5510 getChildAt(index: number, sourceFile?: SourceFile): Node;
5511 getChildren(sourceFile?: SourceFile): Node[];
5512 getStart(sourceFile?: SourceFile, includeJsDocComment?: boolean): number;
5513 getFullStart(): number;
5515 getWidth(sourceFile?: SourceFileLike): number;
5516 getFullWidth(): number;
5517 getLeadingTriviaWidth(sourceFile?: SourceFile): number;
5518 getFullText(sourceFile?: SourceFile): string;
5519 getText(sourceFile?: SourceFile): string;
5520 getFirstToken(sourceFile?: SourceFile): Node | undefined;
5521 getLastToken(sourceFile?: SourceFile): Node | undefined;
5522 forEachChild<T>(cbNode: (node: Node) => T | undefined, cbNodeArray?: (nodes: NodeArray<Node>) => T | undefined): T | undefined;
5524 interface Identifier {
5525 readonly text: string;
5527 interface PrivateIdentifier {
5528 readonly text: string;
5531 readonly name: string;
5532 getFlags(): SymbolFlags;
5533 getEscapedName(): __String;
5535 getDeclarations(): Declaration[] | undefined;
5536 getDocumentationComment(typeChecker: TypeChecker | undefined): SymbolDisplayPart[];
5537 getJsDocTags(checker?: TypeChecker): JSDocTagInfo[];
5540 getFlags(): TypeFlags;
5541 getSymbol(): Symbol | undefined;
5542 getProperties(): Symbol[];
5543 getProperty(propertyName: string): Symbol | undefined;
5544 getApparentProperties(): Symbol[];
5545 getCallSignatures(): readonly Signature[];
5546 getConstructSignatures(): readonly Signature[];
5547 getStringIndexType(): Type | undefined;
5548 getNumberIndexType(): Type | undefined;
5549 getBaseTypes(): BaseType[] | undefined;
5550 getNonNullableType(): Type;
5551 getConstraint(): Type | undefined;
5552 getDefault(): Type | undefined;
5553 isUnion(): this is UnionType;
5554 isIntersection(): this is IntersectionType;
5555 isUnionOrIntersection(): this is UnionOrIntersectionType;
5556 isLiteral(): this is LiteralType;
5557 isStringLiteral(): this is StringLiteralType;
5558 isNumberLiteral(): this is NumberLiteralType;
5559 isTypeParameter(): this is TypeParameter;
5560 isClassOrInterface(): this is InterfaceType;
5561 isClass(): this is InterfaceType;
5563 interface TypeReference {
5564 typeArguments?: readonly Type[];
5566 interface Signature {
5567 getDeclaration(): SignatureDeclaration;
5568 getTypeParameters(): TypeParameter[] | undefined;
5569 getParameters(): Symbol[];
5570 getReturnType(): Type;
5571 getDocumentationComment(typeChecker: TypeChecker | undefined): SymbolDisplayPart[];
5572 getJsDocTags(): JSDocTagInfo[];
5574 interface SourceFile {
5575 getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
5576 getLineEndOfPosition(pos: number): number;
5577 getLineStarts(): readonly number[];
5578 getPositionOfLineAndCharacter(line: number, character: number): number;
5579 update(newText: string, textChangeRange: TextChangeRange): SourceFile;
5581 interface SourceFileLike {
5582 getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
5584 interface SourceMapSource {
5585 getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
5588 * Represents an immutable snapshot of a script at a specified time.Once acquired, the
5589 * snapshot is observably immutable. i.e. the same calls with the same parameters will return
5592 interface IScriptSnapshot {
5593 /** Gets a portion of the script snapshot specified by [start, end). */
5594 getText(start: number, end: number): string;
5595 /** Gets the length of this script snapshot. */
5596 getLength(): number;
5598 * Gets the TextChangeRange that describe how the text changed between this text and
5599 * an older version. This information is used by the incremental parser to determine
5600 * what sections of the script need to be re-parsed. 'undefined' can be returned if the
5601 * change range cannot be determined. However, in that case, incremental parsing will
5602 * not happen and the entire document will be re - parsed.
5604 getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange | undefined;
5605 /** Releases all resources held by this script snapshot */
5608 namespace ScriptSnapshot {
5609 function fromString(text: string): IScriptSnapshot;
5611 interface PreProcessedFileInfo {
5612 referencedFiles: FileReference[];
5613 typeReferenceDirectives: FileReference[];
5614 libReferenceDirectives: FileReference[];
5615 importedFiles: FileReference[];
5616 ambientExternalModules?: string[];
5619 interface HostCancellationToken {
5620 isCancellationRequested(): boolean;
5622 interface InstallPackageOptions {
5624 packageName: string;
5626 interface PerformanceEvent {
5627 kind: "UpdateGraph" | "CreatePackageJsonAutoImportProvider";
5630 enum LanguageServiceMode {
5632 PartialSemantic = 1,
5635 interface IncompleteCompletionsCache {
5636 get(): CompletionInfo | undefined;
5637 set(response: CompletionInfo): void;
5640 interface LanguageServiceHost extends GetEffectiveTypeRootsHost {
5641 getCompilationSettings(): CompilerOptions;
5642 getNewLine?(): string;
5643 getProjectVersion?(): string;
5644 getScriptFileNames(): string[];
5645 getScriptKind?(fileName: string): ScriptKind;
5646 getScriptVersion(fileName: string): string;
5647 getScriptSnapshot(fileName: string): IScriptSnapshot | undefined;
5648 getProjectReferences?(): readonly ProjectReference[] | undefined;
5649 getLocalizedDiagnosticMessages?(): any;
5650 getCancellationToken?(): HostCancellationToken;
5651 getCurrentDirectory(): string;
5652 getDefaultLibFileName(options: CompilerOptions): string;
5653 log?(s: string): void;
5654 trace?(s: string): void;
5655 error?(s: string): void;
5656 useCaseSensitiveFileNames?(): boolean;
5657 readDirectory?(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
5658 readFile?(path: string, encoding?: string): string | undefined;
5659 realpath?(path: string): string;
5660 fileExists?(path: string): boolean;
5661 getTypeRootsVersion?(): number;
5662 resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[];
5663 getResolvedModuleWithFailedLookupLocationsFromCache?(modulename: string, containingFile: string, resolutionMode?: ModuleKind.CommonJS | ModuleKind.ESNext): ResolvedModuleWithFailedLookupLocations | undefined;
5664 resolveTypeReferenceDirectives?(typeDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
5665 getDirectories?(directoryName: string): string[];
5667 * Gets a set of custom transformers to use during emit.
5669 getCustomTransformers?(): CustomTransformers | undefined;
5670 isKnownTypesPackageName?(name: string): boolean;
5671 installPackage?(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
5672 writeFile?(fileName: string, content: string): void;
5673 getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
5675 type WithMetadata<T> = T & {
5678 enum SemanticClassificationFormat {
5679 Original = "original",
5680 TwentyTwenty = "2020"
5682 interface LanguageService {
5683 /** This is used as a part of restarting the language service. */
5684 cleanupSemanticCache(): void;
5686 * Gets errors indicating invalid syntax in a file.
5688 * In English, "this cdeo have, erorrs" is syntactically invalid because it has typos,
5689 * grammatical errors, and misplaced punctuation. Likewise, examples of syntax
5690 * errors in TypeScript are missing parentheses in an `if` statement, mismatched
5691 * curly braces, and using a reserved keyword as a variable name.
5693 * These diagnostics are inexpensive to compute and don't require knowledge of
5694 * other files. Note that a non-empty result increases the likelihood of false positives
5695 * from `getSemanticDiagnostics`.
5697 * While these represent the majority of syntax-related diagnostics, there are some
5698 * that require the type system, which will be present in `getSemanticDiagnostics`.
5700 * @param fileName A path to the file you want syntactic diagnostics for
5702 getSyntacticDiagnostics(fileName: string): DiagnosticWithLocation[];
5704 * Gets warnings or errors indicating type system issues in a given file.
5705 * Requesting semantic diagnostics may start up the type system and
5706 * run deferred work, so the first call may take longer than subsequent calls.
5708 * Unlike the other get*Diagnostics functions, these diagnostics can potentially not
5709 * include a reference to a source file. Specifically, the first time this is called,
5710 * it will return global diagnostics with no associated location.
5712 * To contrast the differences between semantic and syntactic diagnostics, consider the
5713 * sentence: "The sun is green." is syntactically correct; those are real English words with
5714 * correct sentence structure. However, it is semantically invalid, because it is not true.
5716 * @param fileName A path to the file you want semantic diagnostics for
5718 getSemanticDiagnostics(fileName: string): Diagnostic[];
5720 * Gets suggestion diagnostics for a specific file. These diagnostics tend to
5721 * proactively suggest refactors, as opposed to diagnostics that indicate
5722 * potentially incorrect runtime behavior.
5724 * @param fileName A path to the file you want semantic diagnostics for
5726 getSuggestionDiagnostics(fileName: string): DiagnosticWithLocation[];
5728 * Gets global diagnostics related to the program configuration and compiler options.
5730 getCompilerOptionsDiagnostics(): Diagnostic[];
5731 /** @deprecated Use getEncodedSyntacticClassifications instead. */
5732 getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[];
5733 getSyntacticClassifications(fileName: string, span: TextSpan, format: SemanticClassificationFormat): ClassifiedSpan[] | ClassifiedSpan2020[];
5734 /** @deprecated Use getEncodedSemanticClassifications instead. */
5735 getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[];
5736 getSemanticClassifications(fileName: string, span: TextSpan, format: SemanticClassificationFormat): ClassifiedSpan[] | ClassifiedSpan2020[];
5737 /** Encoded as triples of [start, length, ClassificationType]. */
5738 getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications;
5740 * Gets semantic highlights information for a particular file. Has two formats, an older
5741 * version used by VS and a format used by VS Code.
5743 * @param fileName The path to the file
5744 * @param position A text span to return results within
5745 * @param format Which format to use, defaults to "original"
5746 * @returns a number array encoded as triples of [start, length, ClassificationType, ...].
5748 getEncodedSemanticClassifications(fileName: string, span: TextSpan, format?: SemanticClassificationFormat): Classifications;
5750 * Gets completion entries at a particular position in a file.
5752 * @param fileName The path to the file
5753 * @param position A zero-based index of the character where you want the entries
5754 * @param options An object describing how the request was triggered and what kinds
5755 * of code actions can be returned with the completions.
5757 getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined): WithMetadata<CompletionInfo> | undefined;
5759 * Gets the extended details for a completion entry retrieved from `getCompletionsAtPosition`.
5761 * @param fileName The path to the file
5762 * @param position A zero based index of the character where you want the entries
5763 * @param entryName The `name` from an existing completion which came from `getCompletionsAtPosition`
5764 * @param formatOptions How should code samples in the completions be formatted, can be undefined for backwards compatibility
5765 * @param source `source` property from the completion entry
5766 * @param preferences User settings, can be undefined for backwards compatibility
5767 * @param data `data` property from the completion entry
5769 getCompletionEntryDetails(fileName: string, position: number, entryName: string, formatOptions: FormatCodeOptions | FormatCodeSettings | undefined, source: string | undefined, preferences: UserPreferences | undefined, data: CompletionEntryData | undefined): CompletionEntryDetails | undefined;
5770 getCompletionEntrySymbol(fileName: string, position: number, name: string, source: string | undefined): Symbol | undefined;
5772 * Gets semantic information about the identifier at a particular position in a
5773 * file. Quick info is what you typically see when you hover in an editor.
5775 * @param fileName The path to the file
5776 * @param position A zero-based index of the character where you want the quick info
5778 getQuickInfoAtPosition(fileName: string, position: number): QuickInfo | undefined;
5779 getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan | undefined;
5780 getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan | undefined;
5781 getSignatureHelpItems(fileName: string, position: number, options: SignatureHelpItemsOptions | undefined): SignatureHelpItems | undefined;
5782 getRenameInfo(fileName: string, position: number, options?: RenameInfoOptions): RenameInfo;
5783 findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename?: boolean): readonly RenameLocation[] | undefined;
5784 getSmartSelectionRange(fileName: string, position: number): SelectionRange;
5785 getDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined;
5786 getDefinitionAndBoundSpan(fileName: string, position: number): DefinitionInfoAndBoundSpan | undefined;
5787 getTypeDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined;
5788 getImplementationAtPosition(fileName: string, position: number): readonly ImplementationLocation[] | undefined;
5789 getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[] | undefined;
5790 findReferences(fileName: string, position: number): ReferencedSymbol[] | undefined;
5791 getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): DocumentHighlights[] | undefined;
5792 getFileReferences(fileName: string): ReferenceEntry[];
5794 getOccurrencesAtPosition(fileName: string, position: number): readonly ReferenceEntry[] | undefined;
5795 getNavigateToItems(searchValue: string, maxResultCount?: number, fileName?: string, excludeDtsFiles?: boolean): NavigateToItem[];
5796 getNavigationBarItems(fileName: string): NavigationBarItem[];
5797 getNavigationTree(fileName: string): NavigationTree;
5798 prepareCallHierarchy(fileName: string, position: number): CallHierarchyItem | CallHierarchyItem[] | undefined;
5799 provideCallHierarchyIncomingCalls(fileName: string, position: number): CallHierarchyIncomingCall[];
5800 provideCallHierarchyOutgoingCalls(fileName: string, position: number): CallHierarchyOutgoingCall[];
5801 provideInlayHints(fileName: string, span: TextSpan, preferences: UserPreferences | undefined): InlayHint[];
5802 getOutliningSpans(fileName: string): OutliningSpan[];
5803 getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[];
5804 getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[];
5805 getIndentationAtPosition(fileName: string, position: number, options: EditorOptions | EditorSettings): number;
5806 getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
5807 getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
5808 getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
5809 getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions): TextInsertion | undefined;
5810 isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean;
5812 * 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.
5813 * Editors should call this after `>` is typed.
5815 getJsxClosingTagAtPosition(fileName: string, position: number): JsxClosingTagInfo | undefined;
5816 getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan | undefined;
5817 toLineColumnOffset?(fileName: string, position: number): LineAndCharacter;
5818 getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: readonly number[], formatOptions: FormatCodeSettings, preferences: UserPreferences): readonly CodeFixAction[];
5819 getCombinedCodeFix(scope: CombinedCodeFixScope, fixId: {}, formatOptions: FormatCodeSettings, preferences: UserPreferences): CombinedCodeActions;
5820 applyCodeActionCommand(action: CodeActionCommand, formatSettings?: FormatCodeSettings): Promise<ApplyCodeActionCommandResult>;
5821 applyCodeActionCommand(action: CodeActionCommand[], formatSettings?: FormatCodeSettings): Promise<ApplyCodeActionCommandResult[]>;
5822 applyCodeActionCommand(action: CodeActionCommand | CodeActionCommand[], formatSettings?: FormatCodeSettings): Promise<ApplyCodeActionCommandResult | ApplyCodeActionCommandResult[]>;
5823 /** @deprecated `fileName` will be ignored */
5824 applyCodeActionCommand(fileName: string, action: CodeActionCommand): Promise<ApplyCodeActionCommandResult>;
5825 /** @deprecated `fileName` will be ignored */
5826 applyCodeActionCommand(fileName: string, action: CodeActionCommand[]): Promise<ApplyCodeActionCommandResult[]>;
5827 /** @deprecated `fileName` will be ignored */
5828 applyCodeActionCommand(fileName: string, action: CodeActionCommand | CodeActionCommand[]): Promise<ApplyCodeActionCommandResult | ApplyCodeActionCommandResult[]>;
5829 getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined, triggerReason?: RefactorTriggerReason, kind?: string): ApplicableRefactorInfo[];
5830 getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | undefined): RefactorEditInfo | undefined;
5831 organizeImports(args: OrganizeImportsArgs, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[];
5832 getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[];
5833 getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean, forceDtsEmit?: boolean): EmitOutput;
5834 getProgram(): Program | undefined;
5835 toggleLineComment(fileName: string, textRange: TextRange): TextChange[];
5836 toggleMultilineComment(fileName: string, textRange: TextRange): TextChange[];
5837 commentSelection(fileName: string, textRange: TextRange): TextChange[];
5838 uncommentSelection(fileName: string, textRange: TextRange): TextChange[];
5841 interface JsxClosingTagInfo {
5842 readonly newText: string;
5844 interface CombinedCodeFixScope {
5848 interface OrganizeImportsArgs extends CombinedCodeFixScope {
5849 skipDestructiveCodeActions?: boolean;
5851 type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<" | "#" | " ";
5852 enum CompletionTriggerKind {
5853 /** Completion was triggered by typing an identifier, manual invocation (e.g Ctrl+Space) or via API. */
5855 /** Completion was triggered by a trigger character. */
5856 TriggerCharacter = 2,
5857 /** Completion was re-triggered as the current completion list is incomplete. */
5858 TriggerForIncompleteCompletions = 3
5860 interface GetCompletionsAtPositionOptions extends UserPreferences {
5862 * If the editor is asking for completions because a certain character was typed
5863 * (as opposed to when the user explicitly requested them) this should be set.
5865 triggerCharacter?: CompletionsTriggerCharacter;
5866 triggerKind?: CompletionTriggerKind;
5867 /** @deprecated Use includeCompletionsForModuleExports */
5868 includeExternalModuleExports?: boolean;
5869 /** @deprecated Use includeCompletionsWithInsertText */
5870 includeInsertTextCompletions?: boolean;
5872 interface InlayHintsOptions extends UserPreferences {
5873 readonly includeInlayParameterNameHints?: "none" | "literals" | "all";
5874 readonly includeInlayParameterNameHintsWhenArgumentMatchesName?: boolean;
5875 readonly includeInlayFunctionParameterTypeHints?: boolean;
5876 readonly includeInlayVariableTypeHints?: boolean;
5877 readonly includeInlayPropertyDeclarationTypeHints?: boolean;
5878 readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
5879 readonly includeInlayEnumMemberValueHints?: boolean;
5881 type SignatureHelpTriggerCharacter = "," | "(" | "<";
5882 type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")";
5883 interface SignatureHelpItemsOptions {
5884 triggerReason?: SignatureHelpTriggerReason;
5886 type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason;
5888 * Signals that the user manually requested signature help.
5889 * The language service will unconditionally attempt to provide a result.
5891 interface SignatureHelpInvokedReason {
5893 triggerCharacter?: undefined;
5896 * Signals that the signature help request came from a user typing a character.
5897 * Depending on the character and the syntactic context, the request may or may not be served a result.
5899 interface SignatureHelpCharacterTypedReason {
5900 kind: "characterTyped";
5902 * Character that was responsible for triggering signature help.
5904 triggerCharacter: SignatureHelpTriggerCharacter;
5907 * Signals that this signature help request came from typing a character or moving the cursor.
5908 * This should only occur if a signature help session was already active and the editor needs to see if it should adjust.
5909 * The language service will unconditionally attempt to provide a result.
5910 * `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move.
5912 interface SignatureHelpRetriggeredReason {
5915 * Character that was responsible for triggering signature help.
5917 triggerCharacter?: SignatureHelpRetriggerCharacter;
5919 interface ApplyCodeActionCommandResult {
5920 successMessage: string;
5922 interface Classifications {
5924 endOfLineState: EndOfLineState;
5926 interface ClassifiedSpan {
5928 classificationType: ClassificationTypeNames;
5930 interface ClassifiedSpan2020 {
5932 classificationType: number;
5935 * Navigation bar interface designed for visual studio's dual-column layout.
5936 * This does not form a proper tree.
5937 * The navbar is returned as a list of top-level items, each of which has a list of child items.
5938 * Child items always have an empty array for their `childItems`.
5940 interface NavigationBarItem {
5942 kind: ScriptElementKind;
5943 kindModifiers: string;
5945 childItems: NavigationBarItem[];
5951 * Node in a tree of nested declarations in a file.
5952 * The top node is always a script or module node.
5954 interface NavigationTree {
5955 /** Name of the declaration, or a short description, e.g. "<class>". */
5957 kind: ScriptElementKind;
5958 /** ScriptElementKindModifier separated by commas, e.g. "public,abstract" */
5959 kindModifiers: string;
5961 * Spans of the nodes that generated this declaration.
5962 * There will be more than one if this is the result of merging.
5965 nameSpan: TextSpan | undefined;
5966 /** Present if non-empty */
5967 childItems?: NavigationTree[];
5969 interface CallHierarchyItem {
5971 kind: ScriptElementKind;
5972 kindModifiers?: string;
5975 selectionSpan: TextSpan;
5976 containerName?: string;
5978 interface CallHierarchyIncomingCall {
5979 from: CallHierarchyItem;
5980 fromSpans: TextSpan[];
5982 interface CallHierarchyOutgoingCall {
5983 to: CallHierarchyItem;
5984 fromSpans: TextSpan[];
5986 enum InlayHintKind {
5988 Parameter = "Parameter",
5991 interface InlayHint {
5994 kind: InlayHintKind;
5995 whitespaceBefore?: boolean;
5996 whitespaceAfter?: boolean;
5998 interface TodoCommentDescriptor {
6002 interface TodoComment {
6003 descriptor: TodoCommentDescriptor;
6007 interface TextChange {
6011 interface FileTextChanges {
6013 textChanges: readonly TextChange[];
6014 isNewFile?: boolean;
6016 interface CodeAction {
6017 /** Description of the code action to display in the UI of the editor */
6018 description: string;
6019 /** Text changes to apply to each file as part of the code action */
6020 changes: FileTextChanges[];
6022 * If the user accepts the code fix, the editor should send the action back in a `applyAction` request.
6023 * This allows the language service to have side effects (e.g. installing dependencies) upon a code fix.
6025 commands?: CodeActionCommand[];
6027 interface CodeFixAction extends CodeAction {
6028 /** Short name to identify the fix, for use by telemetry. */
6031 * If present, one may call 'getCombinedCodeFix' with this fixId.
6032 * This may be omitted to indicate that the code fix can't be applied in a group.
6035 fixAllDescription?: string;
6037 interface CombinedCodeActions {
6038 changes: readonly FileTextChanges[];
6039 commands?: readonly CodeActionCommand[];
6041 type CodeActionCommand = InstallPackageAction;
6042 interface InstallPackageAction {
6045 * A set of one or more available refactoring actions, grouped under a parent refactoring.
6047 interface ApplicableRefactorInfo {
6049 * The programmatic name of the refactoring
6053 * A description of this refactoring category to show to the user.
6054 * If the refactoring gets inlined (see below), this text will not be visible.
6056 description: string;
6058 * Inlineable refactorings can have their actions hoisted out to the top level
6059 * of a context menu. Non-inlineanable refactorings should always be shown inside
6060 * their parent grouping.
6062 * If not specified, this value is assumed to be 'true'
6064 inlineable?: boolean;
6065 actions: RefactorActionInfo[];
6068 * Represents a single refactoring action - for example, the "Extract Method..." refactor might
6069 * offer several actions, each corresponding to a surround class or closure to extract into.
6071 interface RefactorActionInfo {
6073 * The programmatic name of the refactoring action
6077 * A description of this refactoring action to show to the user.
6078 * If the parent refactoring is inlined away, this will be the only text shown,
6079 * so this description should make sense by itself if the parent is inlineable=true
6081 description: string;
6083 * A message to show to the user if the refactoring cannot be applied in
6084 * the current context.
6086 notApplicableReason?: string;
6088 * The hierarchical dotted name of the refactor action.
6093 * A set of edits to make in response to a refactor action, plus an optional
6094 * location where renaming should be invoked from
6096 interface RefactorEditInfo {
6097 edits: FileTextChanges[];
6098 renameFilename?: string;
6099 renameLocation?: number;
6100 commands?: CodeActionCommand[];
6102 type RefactorTriggerReason = "implicit" | "invoked";
6103 interface TextInsertion {
6105 /** The position in newText the caret should point to after the insertion. */
6106 caretOffset: number;
6108 interface DocumentSpan {
6112 * If the span represents a location that was remapped (e.g. via a .d.ts.map file),
6113 * then the original filename and span will be specified here
6115 originalTextSpan?: TextSpan;
6116 originalFileName?: string;
6118 * If DocumentSpan.textSpan is the span for name of the declaration,
6119 * then this is the span for relevant declaration
6121 contextSpan?: TextSpan;
6122 originalContextSpan?: TextSpan;
6124 interface RenameLocation extends DocumentSpan {
6125 readonly prefixText?: string;
6126 readonly suffixText?: string;
6128 interface ReferenceEntry extends DocumentSpan {
6129 isWriteAccess: boolean;
6130 isDefinition: boolean;
6133 interface ImplementationLocation extends DocumentSpan {
6134 kind: ScriptElementKind;
6135 displayParts: SymbolDisplayPart[];
6137 enum HighlightSpanKind {
6139 definition = "definition",
6140 reference = "reference",
6141 writtenReference = "writtenReference"
6143 interface HighlightSpan {
6147 contextSpan?: TextSpan;
6148 kind: HighlightSpanKind;
6150 interface NavigateToItem {
6152 kind: ScriptElementKind;
6153 kindModifiers: string;
6154 matchKind: "exact" | "prefix" | "substring" | "camelCase";
6155 isCaseSensitive: boolean;
6158 containerName: string;
6159 containerKind: ScriptElementKind;
6166 enum SemicolonPreference {
6171 interface EditorOptions {
6172 BaseIndentSize?: number;
6175 NewLineCharacter: string;
6176 ConvertTabsToSpaces: boolean;
6177 IndentStyle: IndentStyle;
6179 interface EditorSettings {
6180 baseIndentSize?: number;
6181 indentSize?: number;
6183 newLineCharacter?: string;
6184 convertTabsToSpaces?: boolean;
6185 indentStyle?: IndentStyle;
6186 trimTrailingWhitespace?: boolean;
6188 interface FormatCodeOptions extends EditorOptions {
6189 InsertSpaceAfterCommaDelimiter: boolean;
6190 InsertSpaceAfterSemicolonInForStatements: boolean;
6191 InsertSpaceBeforeAndAfterBinaryOperators: boolean;
6192 InsertSpaceAfterConstructor?: boolean;
6193 InsertSpaceAfterKeywordsInControlFlowStatements: boolean;
6194 InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean;
6195 InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean;
6196 InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: boolean;
6197 InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
6198 InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean;
6199 InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
6200 InsertSpaceAfterTypeAssertion?: boolean;
6201 InsertSpaceBeforeFunctionParenthesis?: boolean;
6202 PlaceOpenBraceOnNewLineForFunctions: boolean;
6203 PlaceOpenBraceOnNewLineForControlBlocks: boolean;
6204 insertSpaceBeforeTypeAnnotation?: boolean;
6206 interface FormatCodeSettings extends EditorSettings {
6207 readonly insertSpaceAfterCommaDelimiter?: boolean;
6208 readonly insertSpaceAfterSemicolonInForStatements?: boolean;
6209 readonly insertSpaceBeforeAndAfterBinaryOperators?: boolean;
6210 readonly insertSpaceAfterConstructor?: boolean;
6211 readonly insertSpaceAfterKeywordsInControlFlowStatements?: boolean;
6212 readonly insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean;
6213 readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean;
6214 readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean;
6215 readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
6216 readonly insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean;
6217 readonly insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean;
6218 readonly insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
6219 readonly insertSpaceAfterTypeAssertion?: boolean;
6220 readonly insertSpaceBeforeFunctionParenthesis?: boolean;
6221 readonly placeOpenBraceOnNewLineForFunctions?: boolean;
6222 readonly placeOpenBraceOnNewLineForControlBlocks?: boolean;
6223 readonly insertSpaceBeforeTypeAnnotation?: boolean;
6224 readonly indentMultiLineObjectLiteralBeginningOnBlankLine?: boolean;
6225 readonly semicolons?: SemicolonPreference;
6227 function getDefaultFormatCodeSettings(newLineCharacter?: string): FormatCodeSettings;
6228 interface DefinitionInfo extends DocumentSpan {
6229 kind: ScriptElementKind;
6231 containerKind: ScriptElementKind;
6232 containerName: string;
6233 unverified?: boolean;
6235 interface DefinitionInfoAndBoundSpan {
6236 definitions?: readonly DefinitionInfo[];
6239 interface ReferencedSymbolDefinitionInfo extends DefinitionInfo {
6240 displayParts: SymbolDisplayPart[];
6242 interface ReferencedSymbol {
6243 definition: ReferencedSymbolDefinitionInfo;
6244 references: ReferenceEntry[];
6246 enum SymbolDisplayPartKind {
6265 typeParameterName = 18,
6266 enumMemberName = 19,
6268 regularExpressionLiteral = 21,
6273 interface SymbolDisplayPart {
6277 interface JSDocLinkDisplayPart extends SymbolDisplayPart {
6278 target: DocumentSpan;
6280 interface JSDocTagInfo {
6282 text?: SymbolDisplayPart[];
6284 interface QuickInfo {
6285 kind: ScriptElementKind;
6286 kindModifiers: string;
6288 displayParts?: SymbolDisplayPart[];
6289 documentation?: SymbolDisplayPart[];
6290 tags?: JSDocTagInfo[];
6292 type RenameInfo = RenameInfoSuccess | RenameInfoFailure;
6293 interface RenameInfoSuccess {
6296 * File or directory to rename.
6297 * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`.
6299 fileToRename?: string;
6300 displayName: string;
6301 fullDisplayName: string;
6302 kind: ScriptElementKind;
6303 kindModifiers: string;
6304 triggerSpan: TextSpan;
6306 interface RenameInfoFailure {
6308 localizedErrorMessage: string;
6310 interface RenameInfoOptions {
6311 readonly allowRenameOfImportPath?: boolean;
6313 interface DocCommentTemplateOptions {
6314 readonly generateReturnInDocTemplate?: boolean;
6316 interface SignatureHelpParameter {
6318 documentation: SymbolDisplayPart[];
6319 displayParts: SymbolDisplayPart[];
6320 isOptional: boolean;
6323 interface SelectionRange {
6325 parent?: SelectionRange;
6328 * Represents a single signature to show in signature help.
6329 * The id is used for subsequent calls into the language service to ask questions about the
6330 * signature help item in the context of any documents that have been updated. i.e. after
6331 * an edit has happened, while signature help is still active, the host can ask important
6332 * questions like 'what parameter is the user currently contained within?'.
6334 interface SignatureHelpItem {
6335 isVariadic: boolean;
6336 prefixDisplayParts: SymbolDisplayPart[];
6337 suffixDisplayParts: SymbolDisplayPart[];
6338 separatorDisplayParts: SymbolDisplayPart[];
6339 parameters: SignatureHelpParameter[];
6340 documentation: SymbolDisplayPart[];
6341 tags: JSDocTagInfo[];
6344 * Represents a set of signature help items, and the preferred item that should be selected.
6346 interface SignatureHelpItems {
6347 items: SignatureHelpItem[];
6348 applicableSpan: TextSpan;
6349 selectedItemIndex: number;
6350 argumentIndex: number;
6351 argumentCount: number;
6353 interface CompletionInfo {
6354 /** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */
6355 isGlobalCompletion: boolean;
6356 isMemberCompletion: boolean;
6358 * In the absence of `CompletionEntry["replacementSpan"], the editor may choose whether to use
6359 * this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span
6360 * must be used to commit that completion entry.
6362 optionalReplacementSpan?: TextSpan;
6364 * true when the current location also allows for a new identifier
6366 isNewIdentifierLocation: boolean;
6368 * Indicates to client to continue requesting completions on subsequent keystrokes.
6370 isIncomplete?: true;
6371 entries: CompletionEntry[];
6373 interface CompletionEntryDataAutoImport {
6375 * The name of the property or export in the module's symbol table. Differs from the completion name
6376 * in the case of InternalSymbolName.ExportEquals and InternalSymbolName.Default.
6379 moduleSpecifier?: string;
6380 /** The file name declaring the export's module symbol, if it was an external module */
6382 /** The module name (with quotes stripped) of the export's module symbol, if it was an ambient module */
6383 ambientModuleName?: string;
6384 /** True if the export was found in the package.json AutoImportProvider */
6385 isPackageJsonImport?: true;
6387 interface CompletionEntryDataUnresolved extends CompletionEntryDataAutoImport {
6388 /** The key in the `ExportMapCache` where the completion entry's `SymbolExportInfo[]` is found */
6389 exportMapKey: string;
6391 interface CompletionEntryDataResolved extends CompletionEntryDataAutoImport {
6392 moduleSpecifier: string;
6394 type CompletionEntryData = CompletionEntryDataUnresolved | CompletionEntryDataResolved;
6395 interface CompletionEntry {
6397 kind: ScriptElementKind;
6398 kindModifiers?: string;
6400 insertText?: string;
6403 * An optional span that indicates the text to be replaced by this completion item.
6404 * If present, this span should be used instead of the default one.
6405 * It will be set if the required span differs from the one generated by the default replacement behavior.
6407 replacementSpan?: TextSpan;
6410 sourceDisplay?: SymbolDisplayPart[];
6411 isRecommended?: true;
6412 isFromUncheckedFile?: true;
6413 isPackageJsonImport?: true;
6414 isImportStatementCompletion?: true;
6416 * A property to be sent back to TS Server in the CompletionDetailsRequest, along with `name`,
6417 * that allows TS Server to look up the symbol represented by the completion item, disambiguating
6418 * items with the same name. Currently only defined for auto-import completions, but the type is
6419 * `unknown` in the protocol, so it can be changed as needed to support other kinds of completions.
6420 * The presence of this property should generally not be used to assume that this completion entry
6421 * is an auto-import.
6423 data?: CompletionEntryData;
6425 interface CompletionEntryDetails {
6427 kind: ScriptElementKind;
6428 kindModifiers: string;
6429 displayParts: SymbolDisplayPart[];
6430 documentation?: SymbolDisplayPart[];
6431 tags?: JSDocTagInfo[];
6432 codeActions?: CodeAction[];
6433 /** @deprecated Use `sourceDisplay` instead. */
6434 source?: SymbolDisplayPart[];
6435 sourceDisplay?: SymbolDisplayPart[];
6437 interface OutliningSpan {
6438 /** The span of the document to actually collapse. */
6440 /** The span of the document to display when the user hovers over the collapsed span. */
6442 /** The text to display in the editor for the collapsed region. */
6445 * Whether or not this region should be automatically collapsed when
6446 * the 'Collapse to Definitions' command is invoked.
6448 autoCollapse: boolean;
6450 * Classification of the contents of the span
6452 kind: OutliningSpanKind;
6454 enum OutliningSpanKind {
6455 /** Single or multi-line comments */
6456 Comment = "comment",
6457 /** Sections marked by '// #region' and '// #endregion' comments */
6459 /** Declarations and expressions */
6461 /** Contiguous blocks of import declarations */
6464 enum OutputFileType {
6469 enum EndOfLineState {
6471 InMultiLineCommentTrivia = 1,
6472 InSingleQuoteStringLiteral = 2,
6473 InDoubleQuoteStringLiteral = 3,
6474 InTemplateHeadOrNoSubstitutionTemplate = 4,
6475 InTemplateMiddleOrTail = 5,
6476 InTemplateSubstitutionPosition = 6
6490 interface ClassificationResult {
6491 finalLexState: EndOfLineState;
6492 entries: ClassificationInfo[];
6494 interface ClassificationInfo {
6496 classification: TokenClass;
6498 interface Classifier {
6500 * Gives lexical classifications of tokens on a line without any syntactic context.
6501 * For instance, a token consisting of the text 'string' can be either an identifier
6502 * named 'string' or the keyword 'string', however, because this classifier is not aware,
6503 * it relies on certain heuristics to give acceptable results. For classifications where
6504 * speed trumps accuracy, this function is preferable; however, for true accuracy, the
6505 * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the
6506 * lexical, syntactic, and semantic classifiers may issue the best user experience.
6508 * @param text The text of a line to classify.
6509 * @param lexState The state of the lexical classifier at the end of the previous line.
6510 * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier.
6511 * If there is no syntactic classifier (syntacticClassifierAbsent=true),
6512 * certain heuristics may be used in its place; however, if there is a
6513 * syntactic classifier (syntacticClassifierAbsent=false), certain
6514 * classifications which may be incorrectly categorized will be given
6515 * back as Identifiers in order to allow the syntactic classifier to
6516 * subsume the classification.
6517 * @deprecated Use getLexicalClassifications instead.
6519 getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult;
6520 getEncodedLexicalClassifications(text: string, endOfLineState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications;
6522 enum ScriptElementKind {
6524 warning = "warning",
6525 /** predefined type (void) or keyword (class) */
6526 keyword = "keyword",
6527 /** top level script node */
6528 scriptElement = "script",
6529 /** module foo {} */
6530 moduleElement = "module",
6532 classElement = "class",
6533 /** var x = class X {} */
6534 localClassElement = "local class",
6535 /** interface Y {} */
6536 interfaceElement = "interface",
6538 typeElement = "type",
6540 enumElement = "enum",
6541 enumMemberElement = "enum member",
6543 * Inside module and script only
6546 variableElement = "var",
6547 /** Inside function */
6548 localVariableElement = "local var",
6550 * Inside module and script only
6553 functionElement = "function",
6554 /** Inside function */
6555 localFunctionElement = "local function",
6556 /** class X { [public|private]* foo() {} } */
6557 memberFunctionElement = "method",
6558 /** class X { [public|private]* [get|set] foo:number; } */
6559 memberGetAccessorElement = "getter",
6560 memberSetAccessorElement = "setter",
6562 * class X { [public|private]* foo:number; }
6563 * interface Y { foo:number; }
6565 memberVariableElement = "property",
6567 * class X { constructor() { } }
6568 * class X { static { } }
6570 constructorImplementationElement = "constructor",
6571 /** interface Y { ():number; } */
6572 callSignatureElement = "call",
6573 /** interface Y { []:number; } */
6574 indexSignatureElement = "index",
6575 /** interface Y { new():Y; } */
6576 constructSignatureElement = "construct",
6577 /** function foo(*Y*: string) */
6578 parameterElement = "parameter",
6579 typeParameterElement = "type parameter",
6580 primitiveType = "primitive type",
6583 constElement = "const",
6585 directory = "directory",
6586 externalModuleName = "external module name",
6588 * <JsxTagName attribute1 attribute2={0} />
6590 jsxAttribute = "JSX attribute",
6591 /** String literal */
6593 /** Jsdoc @link: in `{@link C link text}`, the before and after text "{@link " and "}" */
6595 /** Jsdoc @link: in `{@link C link text}`, the entity name "C" */
6596 linkName = "link name",
6597 /** Jsdoc @link: in `{@link C link text}`, the link text "link text" */
6598 linkText = "link text"
6600 enum ScriptElementKindModifier {
6602 publicMemberModifier = "public",
6603 privateMemberModifier = "private",
6604 protectedMemberModifier = "protected",
6605 exportedModifier = "export",
6606 ambientModifier = "declare",
6607 staticModifier = "static",
6608 abstractModifier = "abstract",
6609 optionalModifier = "optional",
6610 deprecatedModifier = "deprecated",
6611 dtsModifier = ".d.ts",
6613 tsxModifier = ".tsx",
6615 jsxModifier = ".jsx",
6616 jsonModifier = ".json",
6617 dmtsModifier = ".d.mts",
6618 mtsModifier = ".mts",
6619 mjsModifier = ".mjs",
6620 dctsModifier = ".d.cts",
6621 ctsModifier = ".cts",
6622 cjsModifier = ".cjs"
6624 enum ClassificationTypeNames {
6625 comment = "comment",
6626 identifier = "identifier",
6627 keyword = "keyword",
6628 numericLiteral = "number",
6629 bigintLiteral = "bigint",
6630 operator = "operator",
6631 stringLiteral = "string",
6632 whiteSpace = "whitespace",
6634 punctuation = "punctuation",
6635 className = "class name",
6636 enumName = "enum name",
6637 interfaceName = "interface name",
6638 moduleName = "module name",
6639 typeParameterName = "type parameter name",
6640 typeAliasName = "type alias name",
6641 parameterName = "parameter name",
6642 docCommentTagName = "doc comment tag name",
6643 jsxOpenTagName = "jsx open tag name",
6644 jsxCloseTagName = "jsx close tag name",
6645 jsxSelfClosingTagName = "jsx self closing tag name",
6646 jsxAttribute = "jsx attribute",
6647 jsxText = "jsx text",
6648 jsxAttributeStringLiteralValue = "jsx attribute string literal value"
6650 enum ClassificationType {
6657 regularExpressionLiteral = 7,
6665 typeParameterName = 15,
6668 docCommentTagName = 18,
6669 jsxOpenTagName = 19,
6670 jsxCloseTagName = 20,
6671 jsxSelfClosingTagName = 21,
6674 jsxAttributeStringLiteralValue = 24,
6677 interface InlayHintsContext {
6680 cancellationToken: CancellationToken;
6681 host: LanguageServiceHost;
6683 preferences: InlayHintsOptions;
6686 declare namespace ts {
6687 /** The classifier is used for syntactic highlighting in editors via the TSServer */
6688 function createClassifier(): Classifier;
6690 declare namespace ts {
6691 interface DocumentHighlights {
6693 highlightSpans: HighlightSpan[];
6696 declare namespace ts {
6698 * The document registry represents a store of SourceFile objects that can be shared between
6699 * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST)
6700 * of files in the context.
6701 * SourceFile objects account for most of the memory usage by the language service. Sharing
6702 * the same DocumentRegistry instance between different instances of LanguageService allow
6703 * for more efficient memory utilization since all projects will share at least the library
6706 * A more advanced use of the document registry is to serialize sourceFile objects to disk
6707 * and re-hydrate them when needed.
6709 * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it
6710 * to all subsequent createLanguageService calls.
6712 interface DocumentRegistry {
6714 * Request a stored SourceFile with a given fileName and compilationSettings.
6715 * The first call to acquire will call createLanguageServiceSourceFile to generate
6716 * the SourceFile if was not found in the registry.
6718 * @param fileName The name of the file requested
6719 * @param compilationSettings Some compilation settings like target affects the
6720 * shape of a the resulting SourceFile. This allows the DocumentRegistry to store
6721 * multiple copies of the same file for different compilation settings.
6722 * @param scriptSnapshot Text of the file. Only used if the file was not found
6723 * in the registry and a new one was created.
6724 * @param version Current version of the file. Only used if the file was not found
6725 * in the registry and a new one was created.
6727 acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile;
6728 acquireDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile;
6730 * Request an updated version of an already existing SourceFile with a given fileName
6731 * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile
6732 * to get an updated SourceFile.
6734 * @param fileName The name of the file requested
6735 * @param compilationSettings Some compilation settings like target affects the
6736 * shape of a the resulting SourceFile. This allows the DocumentRegistry to store
6737 * multiple copies of the same file for different compilation settings.
6738 * @param scriptSnapshot Text of the file.
6739 * @param version Current version of the file.
6741 updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile;
6742 updateDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile;
6743 getKeyForCompilationSettings(settings: CompilerOptions): DocumentRegistryBucketKey;
6745 * Informs the DocumentRegistry that a file is not needed any longer.
6747 * Note: It is not allowed to call release on a SourceFile that was not acquired from
6748 * this registry originally.
6750 * @param fileName The name of the file to be released
6751 * @param compilationSettings The compilation settings used to acquire the file
6753 /**@deprecated pass scriptKind for correctness */
6754 releaseDocument(fileName: string, compilationSettings: CompilerOptions): void;
6756 * Informs the DocumentRegistry that a file is not needed any longer.
6758 * Note: It is not allowed to call release on a SourceFile that was not acquired from
6759 * this registry originally.
6761 * @param fileName The name of the file to be released
6762 * @param compilationSettings The compilation settings used to acquire the file
6763 * @param scriptKind The script kind of the file to be released
6765 releaseDocument(fileName: string, compilationSettings: CompilerOptions, scriptKind: ScriptKind): void;
6767 * @deprecated pass scriptKind for correctness */
6768 releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey): void;
6769 releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey, scriptKind: ScriptKind): void;
6770 reportStats(): string;
6772 type DocumentRegistryBucketKey = string & {
6775 function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory?: string): DocumentRegistry;
6777 declare namespace ts {
6778 function preProcessFile(sourceText: string, readImportFiles?: boolean, detectJavaScriptImports?: boolean): PreProcessedFileInfo;
6780 declare namespace ts {
6781 interface TranspileOptions {
6782 compilerOptions?: CompilerOptions;
6784 reportDiagnostics?: boolean;
6785 moduleName?: string;
6786 renamedDependencies?: MapLike<string>;
6787 transformers?: CustomTransformers;
6789 interface TranspileOutput {
6791 diagnostics?: Diagnostic[];
6792 sourceMapText?: string;
6794 function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput;
6795 function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string;
6797 declare namespace ts {
6798 /** The version of the language service API */
6799 const servicesVersion = "0.8";
6800 function toEditorSettings(options: EditorOptions | EditorSettings): EditorSettings;
6801 function displayPartsToString(displayParts: SymbolDisplayPart[] | undefined): string;
6802 function getDefaultCompilerOptions(): CompilerOptions;
6803 function getSupportedCodeFixes(): string[];
6804 function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean, scriptKind?: ScriptKind): SourceFile;
6805 function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange | undefined, aggressiveChecks?: boolean): SourceFile;
6806 function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry, syntaxOnlyOrLanguageServiceMode?: boolean | LanguageServiceMode): LanguageService;
6808 * Get the path of the default library files (lib.d.ts) as distributed with the typescript
6810 * The functionality is not supported if the ts module is consumed outside of a node module.
6812 function getDefaultLibFilePath(options: CompilerOptions): string;
6814 declare namespace ts {
6816 * Transform one or more nodes using the supplied transformers.
6817 * @param source A single `Node` or an array of `Node` objects.
6818 * @param transformers An array of `TransformerFactory` callbacks used to process the transformation.
6819 * @param compilerOptions Optional compiler options.
6821 function transform<T extends Node>(source: T | T[], transformers: TransformerFactory<T>[], compilerOptions?: CompilerOptions): TransformationResult<T>;
6823 declare namespace ts.server {
6824 interface CompressedData {
6826 compressionKind: string;
6829 type RequireResult = {
6839 interface ServerHost extends System {
6840 watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: WatchOptions): FileWatcher;
6841 watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: WatchOptions): FileWatcher;
6842 setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
6843 clearTimeout(timeoutId: any): void;
6844 setImmediate(callback: (...args: any[]) => void, ...args: any[]): any;
6845 clearImmediate(timeoutId: any): void;
6847 trace?(s: string): void;
6848 require?(initialPath: string, moduleName: string): RequireResult;
6851 declare namespace ts.server {
6858 const emptyArray: SortedReadonlyArray<never>;
6861 hasLevel(level: LogLevel): boolean;
6862 loggingEnabled(): boolean;
6863 perftrc(s: string): void;
6864 info(s: string): void;
6867 msg(s: string, type?: Msg): void;
6868 getLogFileName(): string | undefined;
6876 /** @deprecated Only here for backwards-compatibility. Prefer just `Msg`. */
6879 function createInstallTypingsRequest(project: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string>, cachePath?: string): DiscoverTypings;
6881 function ThrowNoProject(): never;
6882 function ThrowProjectLanguageServiceDisabled(): never;
6883 function ThrowProjectDoesNotContainDocument(fileName: string, project: Project): never;
6885 type NormalizedPath = string & {
6886 __normalizedPathTag: any;
6888 function toNormalizedPath(fileName: string): NormalizedPath;
6889 function normalizedPathToPath(normalizedPath: NormalizedPath, currentDirectory: string, getCanonicalFileName: (f: string) => string): Path;
6890 function asNormalizedPath(fileName: string): NormalizedPath;
6891 interface NormalizedPathMap<T> {
6892 get(path: NormalizedPath): T | undefined;
6893 set(path: NormalizedPath, value: T): void;
6894 contains(path: NormalizedPath): boolean;
6895 remove(path: NormalizedPath): void;
6897 function createNormalizedPathMap<T>(): NormalizedPathMap<T>;
6898 function isInferredProjectName(name: string): boolean;
6899 function makeInferredProjectName(counter: number): string;
6900 function createSortedArray<T>(): SortedArray<T>;
6903 * Declaration module describing the TypeScript Server protocol
6905 declare namespace ts.server.protocol {
6907 JsxClosingTag = "jsxClosingTag",
6909 BraceCompletion = "braceCompletion",
6910 GetSpanOfEnclosingComment = "getSpanOfEnclosingComment",
6913 /** @deprecated Prefer CompletionInfo -- see comment on CompletionsResponse */
6914 Completions = "completions",
6915 CompletionInfo = "completionInfo",
6916 CompletionDetails = "completionEntryDetails",
6917 CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList",
6918 CompileOnSaveEmitFile = "compileOnSaveEmitFile",
6919 Configure = "configure",
6920 Definition = "definition",
6921 DefinitionAndBoundSpan = "definitionAndBoundSpan",
6922 Implementation = "implementation",
6924 FileReferences = "fileReferences",
6926 Formatonkey = "formatonkey",
6928 GeterrForProject = "geterrForProject",
6929 SemanticDiagnosticsSync = "semanticDiagnosticsSync",
6930 SyntacticDiagnosticsSync = "syntacticDiagnosticsSync",
6931 SuggestionDiagnosticsSync = "suggestionDiagnosticsSync",
6934 NavTree = "navtree",
6935 NavTreeFull = "navtree-full",
6937 Occurrences = "occurrences",
6938 DocumentHighlights = "documentHighlights",
6940 Quickinfo = "quickinfo",
6941 References = "references",
6945 SignatureHelp = "signatureHelp",
6947 TypeDefinition = "typeDefinition",
6948 ProjectInfo = "projectInfo",
6949 ReloadProjects = "reloadProjects",
6950 Unknown = "unknown",
6951 OpenExternalProject = "openExternalProject",
6952 OpenExternalProjects = "openExternalProjects",
6953 CloseExternalProject = "closeExternalProject",
6954 UpdateOpen = "updateOpen",
6955 GetOutliningSpans = "getOutliningSpans",
6956 TodoComments = "todoComments",
6957 Indentation = "indentation",
6958 DocCommentTemplate = "docCommentTemplate",
6959 CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects",
6960 GetCodeFixes = "getCodeFixes",
6961 GetCombinedCodeFix = "getCombinedCodeFix",
6962 ApplyCodeActionCommand = "applyCodeActionCommand",
6963 GetSupportedCodeFixes = "getSupportedCodeFixes",
6964 GetApplicableRefactors = "getApplicableRefactors",
6965 GetEditsForRefactor = "getEditsForRefactor",
6966 OrganizeImports = "organizeImports",
6967 GetEditsForFileRename = "getEditsForFileRename",
6968 ConfigurePlugin = "configurePlugin",
6969 SelectionRange = "selectionRange",
6970 ToggleLineComment = "toggleLineComment",
6971 ToggleMultilineComment = "toggleMultilineComment",
6972 CommentSelection = "commentSelection",
6973 UncommentSelection = "uncommentSelection",
6974 PrepareCallHierarchy = "prepareCallHierarchy",
6975 ProvideCallHierarchyIncomingCalls = "provideCallHierarchyIncomingCalls",
6976 ProvideCallHierarchyOutgoingCalls = "provideCallHierarchyOutgoingCalls",
6977 ProvideInlayHints = "provideInlayHints"
6980 * A TypeScript Server message
6984 * Sequence number of the message
6988 * One of "request", "response", or "event"
6990 type: "request" | "response" | "event";
6993 * Client-initiated request message
6995 interface Request extends Message {
6998 * The command to execute
7002 * Object containing arguments for the command
7007 * Request to reload the project structure for all the opened files
7009 interface ReloadProjectsRequest extends Message {
7010 command: CommandTypes.ReloadProjects;
7013 * Server-initiated event message
7015 interface Event extends Message {
7022 * Event-specific information
7027 * Response by server to client request message.
7029 interface Response extends Message {
7032 * Sequence number of the request message.
7034 request_seq: number;
7036 * Outcome of the request.
7040 * The command requested.
7044 * If success === false, this should always be provided.
7045 * Otherwise, may (or may not) contain a success message.
7049 * Contains message body if success === true.
7053 * Contains extra information that plugin can include to be passed on
7057 * Exposes information about the performance of this request-response pair.
7059 performanceData?: PerformanceData;
7061 interface PerformanceData {
7063 * Time spent updating the program graph, in milliseconds.
7065 updateGraphDurationMs?: number;
7067 * The time spent creating or updating the auto-import program, in milliseconds.
7069 createAutoImportProviderProgramDurationMs?: number;
7072 * Arguments for FileRequest messages.
7074 interface FileRequestArgs {
7076 * The file for the request (absolute pathname required).
7079 projectFileName?: string;
7081 interface StatusRequest extends Request {
7082 command: CommandTypes.Status;
7084 interface StatusResponseBody {
7086 * The TypeScript version (`ts.version`).
7091 * Response to StatusRequest
7093 interface StatusResponse extends Response {
7094 body: StatusResponseBody;
7097 * Requests a JS Doc comment template for a given position
7099 interface DocCommentTemplateRequest extends FileLocationRequest {
7100 command: CommandTypes.DocCommentTemplate;
7103 * Response to DocCommentTemplateRequest
7105 interface DocCommandTemplateResponse extends Response {
7106 body?: TextInsertion;
7109 * A request to get TODO comments from the file
7111 interface TodoCommentRequest extends FileRequest {
7112 command: CommandTypes.TodoComments;
7113 arguments: TodoCommentRequestArgs;
7116 * Arguments for TodoCommentRequest request.
7118 interface TodoCommentRequestArgs extends FileRequestArgs {
7120 * Array of target TodoCommentDescriptors that describes TODO comments to be found
7122 descriptors: TodoCommentDescriptor[];
7125 * Response for TodoCommentRequest request.
7127 interface TodoCommentsResponse extends Response {
7128 body?: TodoComment[];
7131 * A request to determine if the caret is inside a comment.
7133 interface SpanOfEnclosingCommentRequest extends FileLocationRequest {
7134 command: CommandTypes.GetSpanOfEnclosingComment;
7135 arguments: SpanOfEnclosingCommentRequestArgs;
7137 interface SpanOfEnclosingCommentRequestArgs extends FileLocationRequestArgs {
7139 * Requires that the enclosing span be a multi-line comment, or else the request returns undefined.
7141 onlyMultiLine: boolean;
7144 * Request to obtain outlining spans in file.
7146 interface OutliningSpansRequest extends FileRequest {
7147 command: CommandTypes.GetOutliningSpans;
7149 interface OutliningSpan {
7150 /** The span of the document to actually collapse. */
7152 /** The span of the document to display when the user hovers over the collapsed span. */
7154 /** The text to display in the editor for the collapsed region. */
7157 * Whether or not this region should be automatically collapsed when
7158 * the 'Collapse to Definitions' command is invoked.
7160 autoCollapse: boolean;
7162 * Classification of the contents of the span
7164 kind: OutliningSpanKind;
7167 * Response to OutliningSpansRequest request.
7169 interface OutliningSpansResponse extends Response {
7170 body?: OutliningSpan[];
7173 * A request to get indentation for a location in file
7175 interface IndentationRequest extends FileLocationRequest {
7176 command: CommandTypes.Indentation;
7177 arguments: IndentationRequestArgs;
7180 * Response for IndentationRequest request.
7182 interface IndentationResponse extends Response {
7183 body?: IndentationResult;
7186 * Indentation result representing where indentation should be placed
7188 interface IndentationResult {
7190 * The base position in the document that the indent should be relative to
7194 * The number of columns the indent should be at relative to the position's column.
7196 indentation: number;
7199 * Arguments for IndentationRequest request.
7201 interface IndentationRequestArgs extends FileLocationRequestArgs {
7203 * An optional set of settings to be used when computing indentation.
7204 * If argument is omitted - then it will use settings for file that were previously set via 'configure' request or global settings.
7206 options?: EditorSettings;
7209 * Arguments for ProjectInfoRequest request.
7211 interface ProjectInfoRequestArgs extends FileRequestArgs {
7213 * Indicate if the file name list of the project is needed
7215 needFileNameList: boolean;
7218 * A request to get the project information of the current file.
7220 interface ProjectInfoRequest extends Request {
7221 command: CommandTypes.ProjectInfo;
7222 arguments: ProjectInfoRequestArgs;
7225 * A request to retrieve compiler options diagnostics for a project
7227 interface CompilerOptionsDiagnosticsRequest extends Request {
7228 arguments: CompilerOptionsDiagnosticsRequestArgs;
7231 * Arguments for CompilerOptionsDiagnosticsRequest request.
7233 interface CompilerOptionsDiagnosticsRequestArgs {
7235 * Name of the project to retrieve compiler options diagnostics.
7237 projectFileName: string;
7240 * Response message body for "projectInfo" request
7242 interface ProjectInfo {
7244 * For configured project, this is the normalized path of the 'tsconfig.json' file
7245 * For inferred project, this is undefined
7247 configFileName: string;
7249 * The list of normalized file name in the project, including 'lib.d.ts'
7251 fileNames?: string[];
7253 * Indicates if the project has a active language service instance
7255 languageServiceDisabled?: boolean;
7258 * Represents diagnostic info that includes location of diagnostic in two forms
7259 * - start position and length of the error span
7260 * - startLocation and endLocation - a pair of Location objects that store start/end line and offset of the error span.
7262 interface DiagnosticWithLinePosition {
7266 startLocation: Location;
7267 endLocation: Location;
7270 /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
7271 reportsUnnecessary?: {};
7272 reportsDeprecated?: {};
7273 relatedInformation?: DiagnosticRelatedInformation[];
7276 * Response message for "projectInfo" request
7278 interface ProjectInfoResponse extends Response {
7282 * Request whose sole parameter is a file name.
7284 interface FileRequest extends Request {
7285 arguments: FileRequestArgs;
7288 * Instances of this interface specify a location in a source file:
7289 * (file, line, character offset), where line and character offset are 1-based.
7291 interface FileLocationRequestArgs extends FileRequestArgs {
7293 * The line number for the request (1-based).
7297 * The character offset (on the line) for the request (1-based).
7301 type FileLocationOrRangeRequestArgs = FileLocationRequestArgs | FileRangeRequestArgs;
7303 * Request refactorings at a given position or selection area.
7305 interface GetApplicableRefactorsRequest extends Request {
7306 command: CommandTypes.GetApplicableRefactors;
7307 arguments: GetApplicableRefactorsRequestArgs;
7309 type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs & {
7310 triggerReason?: RefactorTriggerReason;
7313 type RefactorTriggerReason = "implicit" | "invoked";
7315 * Response is a list of available refactorings.
7316 * Each refactoring exposes one or more "Actions"; a user selects one action to invoke a refactoring
7318 interface GetApplicableRefactorsResponse extends Response {
7319 body?: ApplicableRefactorInfo[];
7322 * A set of one or more available refactoring actions, grouped under a parent refactoring.
7324 interface ApplicableRefactorInfo {
7326 * The programmatic name of the refactoring
7330 * A description of this refactoring category to show to the user.
7331 * If the refactoring gets inlined (see below), this text will not be visible.
7333 description: string;
7335 * Inlineable refactorings can have their actions hoisted out to the top level
7336 * of a context menu. Non-inlineanable refactorings should always be shown inside
7337 * their parent grouping.
7339 * If not specified, this value is assumed to be 'true'
7341 inlineable?: boolean;
7342 actions: RefactorActionInfo[];
7345 * Represents a single refactoring action - for example, the "Extract Method..." refactor might
7346 * offer several actions, each corresponding to a surround class or closure to extract into.
7348 interface RefactorActionInfo {
7350 * The programmatic name of the refactoring action
7354 * A description of this refactoring action to show to the user.
7355 * If the parent refactoring is inlined away, this will be the only text shown,
7356 * so this description should make sense by itself if the parent is inlineable=true
7358 description: string;
7360 * A message to show to the user if the refactoring cannot be applied in
7361 * the current context.
7363 notApplicableReason?: string;
7365 * The hierarchical dotted name of the refactor action.
7369 interface GetEditsForRefactorRequest extends Request {
7370 command: CommandTypes.GetEditsForRefactor;
7371 arguments: GetEditsForRefactorRequestArgs;
7374 * Request the edits that a particular refactoring action produces.
7375 * Callers must specify the name of the refactor and the name of the action.
7377 type GetEditsForRefactorRequestArgs = FileLocationOrRangeRequestArgs & {
7381 interface GetEditsForRefactorResponse extends Response {
7382 body?: RefactorEditInfo;
7384 interface RefactorEditInfo {
7385 edits: FileCodeEdits[];
7387 * An optional location where the editor should start a rename operation once
7388 * the refactoring edits have been applied
7390 renameLocation?: Location;
7391 renameFilename?: string;
7394 * Organize imports by:
7395 * 1) Removing unused imports
7396 * 2) Coalescing imports from the same module
7397 * 3) Sorting imports
7399 interface OrganizeImportsRequest extends Request {
7400 command: CommandTypes.OrganizeImports;
7401 arguments: OrganizeImportsRequestArgs;
7403 type OrganizeImportsScope = GetCombinedCodeFixScope;
7404 interface OrganizeImportsRequestArgs {
7405 scope: OrganizeImportsScope;
7406 skipDestructiveCodeActions?: boolean;
7408 interface OrganizeImportsResponse extends Response {
7409 body: readonly FileCodeEdits[];
7411 interface GetEditsForFileRenameRequest extends Request {
7412 command: CommandTypes.GetEditsForFileRename;
7413 arguments: GetEditsForFileRenameRequestArgs;
7415 /** Note: Paths may also be directories. */
7416 interface GetEditsForFileRenameRequestArgs {
7417 readonly oldFilePath: string;
7418 readonly newFilePath: string;
7420 interface GetEditsForFileRenameResponse extends Response {
7421 body: readonly FileCodeEdits[];
7424 * Request for the available codefixes at a specific position.
7426 interface CodeFixRequest extends Request {
7427 command: CommandTypes.GetCodeFixes;
7428 arguments: CodeFixRequestArgs;
7430 interface GetCombinedCodeFixRequest extends Request {
7431 command: CommandTypes.GetCombinedCodeFix;
7432 arguments: GetCombinedCodeFixRequestArgs;
7434 interface GetCombinedCodeFixResponse extends Response {
7435 body: CombinedCodeActions;
7437 interface ApplyCodeActionCommandRequest extends Request {
7438 command: CommandTypes.ApplyCodeActionCommand;
7439 arguments: ApplyCodeActionCommandRequestArgs;
7441 interface ApplyCodeActionCommandResponse extends Response {
7443 interface FileRangeRequestArgs extends FileRequestArgs {
7445 * The line number for the request (1-based).
7449 * The character offset (on the line) for the request (1-based).
7451 startOffset: number;
7453 * The line number for the request (1-based).
7457 * The character offset (on the line) for the request (1-based).
7462 * Instances of this interface specify errorcodes on a specific location in a sourcefile.
7464 interface CodeFixRequestArgs extends FileRangeRequestArgs {
7466 * Errorcodes we want to get the fixes for.
7468 errorCodes: readonly number[];
7470 interface GetCombinedCodeFixRequestArgs {
7471 scope: GetCombinedCodeFixScope;
7474 interface GetCombinedCodeFixScope {
7476 args: FileRequestArgs;
7478 interface ApplyCodeActionCommandRequestArgs {
7479 /** May also be an array of commands. */
7483 * Response for GetCodeFixes request.
7485 interface GetCodeFixesResponse extends Response {
7486 body?: CodeAction[];
7489 * A request whose arguments specify a file location (file, line, col).
7491 interface FileLocationRequest extends FileRequest {
7492 arguments: FileLocationRequestArgs;
7495 * A request to get codes of supported code fixes.
7497 interface GetSupportedCodeFixesRequest extends Request {
7498 command: CommandTypes.GetSupportedCodeFixes;
7501 * A response for GetSupportedCodeFixesRequest request.
7503 interface GetSupportedCodeFixesResponse extends Response {
7505 * List of error codes supported by the server.
7510 * A request to get encoded semantic classifications for a span in the file
7512 interface EncodedSemanticClassificationsRequest extends FileRequest {
7513 arguments: EncodedSemanticClassificationsRequestArgs;
7516 * Arguments for EncodedSemanticClassificationsRequest request.
7518 interface EncodedSemanticClassificationsRequestArgs extends FileRequestArgs {
7520 * Start position of the span.
7524 * Length of the span.
7528 * Optional parameter for the semantic highlighting response, if absent it
7529 * defaults to "original".
7531 format?: "original" | "2020";
7533 /** The response for a EncodedSemanticClassificationsRequest */
7534 interface EncodedSemanticClassificationsResponse extends Response {
7535 body?: EncodedSemanticClassificationsResponseBody;
7538 * Implementation response message. Gives series of text spans depending on the format ar.
7540 interface EncodedSemanticClassificationsResponseBody {
7541 endOfLineState: EndOfLineState;
7545 * Arguments in document highlight request; include: filesToSearch, file,
7548 interface DocumentHighlightsRequestArgs extends FileLocationRequestArgs {
7550 * List of files to search for document highlights.
7552 filesToSearch: string[];
7555 * Go to definition request; value of command field is
7556 * "definition". Return response giving the file locations that
7557 * define the symbol found in file at location line, col.
7559 interface DefinitionRequest extends FileLocationRequest {
7560 command: CommandTypes.Definition;
7562 interface DefinitionAndBoundSpanRequest extends FileLocationRequest {
7563 readonly command: CommandTypes.DefinitionAndBoundSpan;
7565 interface DefinitionAndBoundSpanResponse extends Response {
7566 readonly body: DefinitionInfoAndBoundSpan;
7569 * Go to type request; value of command field is
7570 * "typeDefinition". Return response giving the file locations that
7571 * define the type for the symbol found in file at location line, col.
7573 interface TypeDefinitionRequest extends FileLocationRequest {
7574 command: CommandTypes.TypeDefinition;
7577 * Go to implementation request; value of command field is
7578 * "implementation". Return response giving the file locations that
7579 * implement the symbol found in file at location line, col.
7581 interface ImplementationRequest extends FileLocationRequest {
7582 command: CommandTypes.Implementation;
7585 * Location in source code expressed as (one-based) line and (one-based) column offset.
7587 interface Location {
7592 * Object found in response messages defining a span of text in source code.
7594 interface TextSpan {
7596 * First character of the definition.
7600 * One character past last character of the definition.
7605 * Object found in response messages defining a span of text in a specific source file.
7607 interface FileSpan extends TextSpan {
7609 * File containing text span.
7613 interface JSDocTagInfo {
7614 /** Name of the JSDoc tag */
7617 * Comment text after the JSDoc tag -- the text after the tag name until the next tag or end of comment
7618 * Display parts when UserPreferences.displayPartsForJSDoc is true, flattened to string otherwise.
7620 text?: string | SymbolDisplayPart[];
7622 interface TextSpanWithContext extends TextSpan {
7623 contextStart?: Location;
7624 contextEnd?: Location;
7626 interface FileSpanWithContext extends FileSpan, TextSpanWithContext {
7628 interface DefinitionInfo extends FileSpanWithContext {
7630 * When true, the file may or may not exist.
7632 unverified?: boolean;
7634 interface DefinitionInfoAndBoundSpan {
7635 definitions: readonly DefinitionInfo[];
7639 * Definition response message. Gives text range for definition.
7641 interface DefinitionResponse extends Response {
7642 body?: DefinitionInfo[];
7644 interface DefinitionInfoAndBoundSpanResponse extends Response {
7645 body?: DefinitionInfoAndBoundSpan;
7647 /** @deprecated Use `DefinitionInfoAndBoundSpanResponse` instead. */
7648 type DefinitionInfoAndBoundSpanReponse = DefinitionInfoAndBoundSpanResponse;
7650 * Definition response message. Gives text range for definition.
7652 interface TypeDefinitionResponse extends Response {
7653 body?: FileSpanWithContext[];
7656 * Implementation response message. Gives text range for implementations.
7658 interface ImplementationResponse extends Response {
7659 body?: FileSpanWithContext[];
7662 * Request to get brace completion for a location in the file.
7664 interface BraceCompletionRequest extends FileLocationRequest {
7665 command: CommandTypes.BraceCompletion;
7666 arguments: BraceCompletionRequestArgs;
7669 * Argument for BraceCompletionRequest request.
7671 interface BraceCompletionRequestArgs extends FileLocationRequestArgs {
7673 * Kind of opening brace
7675 openingBrace: string;
7677 interface JsxClosingTagRequest extends FileLocationRequest {
7678 readonly command: CommandTypes.JsxClosingTag;
7679 readonly arguments: JsxClosingTagRequestArgs;
7681 interface JsxClosingTagRequestArgs extends FileLocationRequestArgs {
7683 interface JsxClosingTagResponse extends Response {
7684 readonly body: TextInsertion;
7688 * Get occurrences request; value of command field is
7689 * "occurrences". Return response giving spans that are relevant
7690 * in the file at a given line and column.
7692 interface OccurrencesRequest extends FileLocationRequest {
7693 command: CommandTypes.Occurrences;
7696 interface OccurrencesResponseItem extends FileSpanWithContext {
7698 * True if the occurrence is a write location, false otherwise.
7700 isWriteAccess: boolean;
7702 * True if the occurrence is in a string, undefined otherwise;
7707 interface OccurrencesResponse extends Response {
7708 body?: OccurrencesResponseItem[];
7711 * Get document highlights request; value of command field is
7712 * "documentHighlights". Return response giving spans that are relevant
7713 * in the file at a given line and column.
7715 interface DocumentHighlightsRequest extends FileLocationRequest {
7716 command: CommandTypes.DocumentHighlights;
7717 arguments: DocumentHighlightsRequestArgs;
7720 * Span augmented with extra information that denotes the kind of the highlighting to be used for span.
7722 interface HighlightSpan extends TextSpanWithContext {
7723 kind: HighlightSpanKind;
7726 * Represents a set of highligh spans for a give name
7728 interface DocumentHighlightsItem {
7730 * File containing highlight spans.
7734 * Spans to highlight in file.
7736 highlightSpans: HighlightSpan[];
7739 * Response for a DocumentHighlightsRequest request.
7741 interface DocumentHighlightsResponse extends Response {
7742 body?: DocumentHighlightsItem[];
7745 * Find references request; value of command field is
7746 * "references". Return response giving the file locations that
7747 * reference the symbol found in file at location line, col.
7749 interface ReferencesRequest extends FileLocationRequest {
7750 command: CommandTypes.References;
7752 interface ReferencesResponseItem extends FileSpanWithContext {
7753 /** Text of line containing the reference. Including this
7754 * with the response avoids latency of editor loading files
7755 * to show text of reference line (the server already has
7756 * loaded the referencing files).
7760 * True if reference is a write location, false otherwise.
7762 isWriteAccess: boolean;
7764 * True if reference is a definition, false otherwise.
7766 isDefinition: boolean;
7769 * The body of a "references" response message.
7771 interface ReferencesResponseBody {
7773 * The file locations referencing the symbol.
7775 refs: readonly ReferencesResponseItem[];
7777 * The name of the symbol.
7781 * The start character offset of the symbol (on the line provided by the references request).
7783 symbolStartOffset: number;
7785 * The full display name of the symbol.
7787 symbolDisplayString: string;
7790 * Response to "references" request.
7792 interface ReferencesResponse extends Response {
7793 body?: ReferencesResponseBody;
7795 interface FileReferencesRequest extends FileRequest {
7796 command: CommandTypes.FileReferences;
7798 interface FileReferencesResponseBody {
7800 * The file locations referencing the symbol.
7802 refs: readonly ReferencesResponseItem[];
7804 * The name of the symbol.
7808 interface FileReferencesResponse extends Response {
7809 body?: FileReferencesResponseBody;
7812 * Argument for RenameRequest request.
7814 interface RenameRequestArgs extends FileLocationRequestArgs {
7816 * Should text at specified location be found/changed in comments?
7818 findInComments?: boolean;
7820 * Should text at specified location be found/changed in strings?
7822 findInStrings?: boolean;
7825 * Rename request; value of command field is "rename". Return
7826 * response giving the file locations that reference the symbol
7827 * found in file at location line, col. Also return full display
7828 * name of the symbol so that client can print it unambiguously.
7830 interface RenameRequest extends FileLocationRequest {
7831 command: CommandTypes.Rename;
7832 arguments: RenameRequestArgs;
7835 * Information about the item to be renamed.
7837 type RenameInfo = RenameInfoSuccess | RenameInfoFailure;
7838 interface RenameInfoSuccess {
7840 * True if item can be renamed.
7844 * File or directory to rename.
7845 * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`.
7847 fileToRename?: string;
7849 * Display name of the item to be renamed.
7851 displayName: string;
7853 * Full display name of item to be renamed.
7855 fullDisplayName: string;
7857 * The items's kind (such as 'className' or 'parameterName' or plain 'text').
7859 kind: ScriptElementKind;
7861 * Optional modifiers for the kind (such as 'public').
7863 kindModifiers: string;
7864 /** Span of text to rename. */
7865 triggerSpan: TextSpan;
7867 interface RenameInfoFailure {
7870 * Error message if item can not be renamed.
7872 localizedErrorMessage: string;
7875 * A group of text spans, all in 'file'.
7877 interface SpanGroup {
7878 /** The file to which the spans apply */
7880 /** The text spans in this group */
7881 locs: RenameTextSpan[];
7883 interface RenameTextSpan extends TextSpanWithContext {
7884 readonly prefixText?: string;
7885 readonly suffixText?: string;
7887 interface RenameResponseBody {
7889 * Information about the item to be renamed.
7893 * An array of span groups (one per file) that refer to the item to be renamed.
7895 locs: readonly SpanGroup[];
7898 * Rename response message.
7900 interface RenameResponse extends Response {
7901 body?: RenameResponseBody;
7904 * Represents a file in external project.
7905 * External project is project whose set of files, compilation options and open\close state
7906 * is maintained by the client (i.e. if all this data come from .csproj file in Visual Studio).
7907 * External project will exist even if all files in it are closed and should be closed explicitly.
7908 * If external project includes one or more tsconfig.json/jsconfig.json files then tsserver will
7909 * create configured project for every config file but will maintain a link that these projects were created
7910 * as a result of opening external project so they should be removed once external project is closed.
7912 interface ExternalFile {
7918 * Script kind of the file
7920 scriptKind?: ScriptKindName | ts.ScriptKind;
7922 * Whether file has mixed content (i.e. .cshtml file that combines html markup with C#/JavaScript)
7924 hasMixedContent?: boolean;
7926 * Content of the file
7931 * Represent an external project
7933 interface ExternalProject {
7937 projectFileName: string;
7939 * List of root files in project
7941 rootFiles: ExternalFile[];
7943 * Compiler options for the project
7945 options: ExternalProjectCompilerOptions;
7947 * @deprecated typingOptions. Use typeAcquisition instead
7949 typingOptions?: TypeAcquisition;
7951 * Explicitly specified type acquisition for the project
7953 typeAcquisition?: TypeAcquisition;
7955 interface CompileOnSaveMixin {
7957 * If compile on save is enabled for the project
7959 compileOnSave?: boolean;
7962 * For external projects, some of the project settings are sent together with
7963 * compiler settings.
7965 type ExternalProjectCompilerOptions = CompilerOptions & CompileOnSaveMixin & WatchOptions;
7966 interface FileWithProjectReferenceRedirectInfo {
7972 * True if the file is primarily included in a referenced project
7974 isSourceOfProjectReferenceRedirect: boolean;
7977 * Represents a set of changes that happen in project
7979 interface ProjectChanges {
7981 * List of added files
7983 added: string[] | FileWithProjectReferenceRedirectInfo[];
7985 * List of removed files
7987 removed: string[] | FileWithProjectReferenceRedirectInfo[];
7989 * List of updated files
7991 updated: string[] | FileWithProjectReferenceRedirectInfo[];
7993 * List of files that have had their project reference redirect status updated
7994 * Only provided when the synchronizeProjectList request has includeProjectReferenceRedirectInfo set to true
7996 updatedRedirects?: FileWithProjectReferenceRedirectInfo[];
7999 * Information found in a configure request.
8001 interface ConfigureRequestArguments {
8003 * Information about the host, for example 'Emacs 24.4' or
8004 * 'Sublime Text version 3075'
8008 * If present, tab settings apply only to this file.
8012 * The format options to use during formatting and other code editing features.
8014 formatOptions?: FormatCodeSettings;
8015 preferences?: UserPreferences;
8017 * The host's additional supported .js file extensions
8019 extraFileExtensions?: FileExtensionInfo[];
8020 watchOptions?: WatchOptions;
8022 enum WatchFileKind {
8023 FixedPollingInterval = "FixedPollingInterval",
8024 PriorityPollingInterval = "PriorityPollingInterval",
8025 DynamicPriorityPolling = "DynamicPriorityPolling",
8026 FixedChunkSizePolling = "FixedChunkSizePolling",
8027 UseFsEvents = "UseFsEvents",
8028 UseFsEventsOnParentDirectory = "UseFsEventsOnParentDirectory"
8030 enum WatchDirectoryKind {
8031 UseFsEvents = "UseFsEvents",
8032 FixedPollingInterval = "FixedPollingInterval",
8033 DynamicPriorityPolling = "DynamicPriorityPolling",
8034 FixedChunkSizePolling = "FixedChunkSizePolling"
8036 enum PollingWatchKind {
8037 FixedInterval = "FixedInterval",
8038 PriorityInterval = "PriorityInterval",
8039 DynamicPriority = "DynamicPriority",
8040 FixedChunkSize = "FixedChunkSize"
8042 interface WatchOptions {
8043 watchFile?: WatchFileKind | ts.WatchFileKind;
8044 watchDirectory?: WatchDirectoryKind | ts.WatchDirectoryKind;
8045 fallbackPolling?: PollingWatchKind | ts.PollingWatchKind;
8046 synchronousWatchDirectory?: boolean;
8047 excludeDirectories?: string[];
8048 excludeFiles?: string[];
8049 [option: string]: CompilerOptionsValue | undefined;
8052 * Configure request; value of command field is "configure". Specifies
8053 * host information, such as host type, tab size, and indent size.
8055 interface ConfigureRequest extends Request {
8056 command: CommandTypes.Configure;
8057 arguments: ConfigureRequestArguments;
8060 * Response to "configure" request. This is just an acknowledgement, so
8061 * no body field is required.
8063 interface ConfigureResponse extends Response {
8065 interface ConfigurePluginRequestArguments {
8069 interface ConfigurePluginRequest extends Request {
8070 command: CommandTypes.ConfigurePlugin;
8071 arguments: ConfigurePluginRequestArguments;
8073 interface ConfigurePluginResponse extends Response {
8075 interface SelectionRangeRequest extends FileRequest {
8076 command: CommandTypes.SelectionRange;
8077 arguments: SelectionRangeRequestArgs;
8079 interface SelectionRangeRequestArgs extends FileRequestArgs {
8080 locations: Location[];
8082 interface SelectionRangeResponse extends Response {
8083 body?: SelectionRange[];
8085 interface SelectionRange {
8087 parent?: SelectionRange;
8089 interface ToggleLineCommentRequest extends FileRequest {
8090 command: CommandTypes.ToggleLineComment;
8091 arguments: FileRangeRequestArgs;
8093 interface ToggleMultilineCommentRequest extends FileRequest {
8094 command: CommandTypes.ToggleMultilineComment;
8095 arguments: FileRangeRequestArgs;
8097 interface CommentSelectionRequest extends FileRequest {
8098 command: CommandTypes.CommentSelection;
8099 arguments: FileRangeRequestArgs;
8101 interface UncommentSelectionRequest extends FileRequest {
8102 command: CommandTypes.UncommentSelection;
8103 arguments: FileRangeRequestArgs;
8106 * Information found in an "open" request.
8108 interface OpenRequestArgs extends FileRequestArgs {
8110 * Used when a version of the file content is known to be more up to date than the one on disk.
8111 * Then the known content will be used upon opening instead of the disk copy
8113 fileContent?: string;
8115 * Used to specify the script kind of the file explicitly. It could be one of the following:
8116 * "TS", "JS", "TSX", "JSX"
8118 scriptKindName?: ScriptKindName;
8120 * Used to limit the searching for project config file. If given the searching will stop at this
8121 * root path; otherwise it will go all the way up to the dist root path.
8123 projectRootPath?: string;
8125 type ScriptKindName = "TS" | "JS" | "TSX" | "JSX";
8127 * Open request; value of command field is "open". Notify the
8128 * server that the client has file open. The server will not
8129 * monitor the filesystem for changes in this file and will assume
8130 * that the client is updating the server (using the change and/or
8131 * reload messages) when the file changes. Server does not currently
8132 * send a response to an open request.
8134 interface OpenRequest extends Request {
8135 command: CommandTypes.Open;
8136 arguments: OpenRequestArgs;
8139 * Request to open or update external project
8141 interface OpenExternalProjectRequest extends Request {
8142 command: CommandTypes.OpenExternalProject;
8143 arguments: OpenExternalProjectArgs;
8146 * Arguments to OpenExternalProjectRequest request
8148 type OpenExternalProjectArgs = ExternalProject;
8150 * Request to open multiple external projects
8152 interface OpenExternalProjectsRequest extends Request {
8153 command: CommandTypes.OpenExternalProjects;
8154 arguments: OpenExternalProjectsArgs;
8157 * Arguments to OpenExternalProjectsRequest
8159 interface OpenExternalProjectsArgs {
8161 * List of external projects to open or update
8163 projects: ExternalProject[];
8166 * Response to OpenExternalProjectRequest request. This is just an acknowledgement, so
8167 * no body field is required.
8169 interface OpenExternalProjectResponse extends Response {
8172 * Response to OpenExternalProjectsRequest request. This is just an acknowledgement, so
8173 * no body field is required.
8175 interface OpenExternalProjectsResponse extends Response {
8178 * Request to close external project.
8180 interface CloseExternalProjectRequest extends Request {
8181 command: CommandTypes.CloseExternalProject;
8182 arguments: CloseExternalProjectRequestArgs;
8185 * Arguments to CloseExternalProjectRequest request
8187 interface CloseExternalProjectRequestArgs {
8189 * Name of the project to close
8191 projectFileName: string;
8194 * Response to CloseExternalProjectRequest request. This is just an acknowledgement, so
8195 * no body field is required.
8197 interface CloseExternalProjectResponse extends Response {
8200 * Request to synchronize list of open files with the client
8202 interface UpdateOpenRequest extends Request {
8203 command: CommandTypes.UpdateOpen;
8204 arguments: UpdateOpenRequestArgs;
8207 * Arguments to UpdateOpenRequest
8209 interface UpdateOpenRequestArgs {
8211 * List of newly open files
8213 openFiles?: OpenRequestArgs[];
8215 * List of open files files that were changes
8217 changedFiles?: FileCodeEdits[];
8219 * List of files that were closed
8221 closedFiles?: string[];
8224 * External projects have a typeAcquisition option so they need to be added separately to compiler options for inferred projects.
8226 type InferredProjectCompilerOptions = ExternalProjectCompilerOptions & TypeAcquisition;
8228 * Request to set compiler options for inferred projects.
8229 * External projects are opened / closed explicitly.
8230 * Configured projects are opened when user opens loose file that has 'tsconfig.json' or 'jsconfig.json' anywhere in one of containing folders.
8231 * This configuration file will be used to obtain a list of files and configuration settings for the project.
8232 * Inferred projects are created when user opens a loose file that is not the part of external project
8233 * or configured project and will contain only open file and transitive closure of referenced files if 'useOneInferredProject' is false,
8234 * or all open loose files and its transitive closure of referenced files if 'useOneInferredProject' is true.
8236 interface SetCompilerOptionsForInferredProjectsRequest extends Request {
8237 command: CommandTypes.CompilerOptionsForInferredProjects;
8238 arguments: SetCompilerOptionsForInferredProjectsArgs;
8241 * Argument for SetCompilerOptionsForInferredProjectsRequest request.
8243 interface SetCompilerOptionsForInferredProjectsArgs {
8245 * Compiler options to be used with inferred projects.
8247 options: InferredProjectCompilerOptions;
8249 * Specifies the project root path used to scope compiler options.
8250 * It is an error to provide this property if the server has not been started with
8251 * `useInferredProjectPerProjectRoot` enabled.
8253 projectRootPath?: string;
8256 * Response to SetCompilerOptionsForInferredProjectsResponse request. This is just an acknowledgement, so
8257 * no body field is required.
8259 interface SetCompilerOptionsForInferredProjectsResponse extends Response {
8262 * Exit request; value of command field is "exit". Ask the server process
8265 interface ExitRequest extends Request {
8266 command: CommandTypes.Exit;
8269 * Close request; value of command field is "close". Notify the
8270 * server that the client has closed a previously open file. If
8271 * file is still referenced by open files, the server will resume
8272 * monitoring the filesystem for changes to file. Server does not
8273 * currently send a response to a close request.
8275 interface CloseRequest extends FileRequest {
8276 command: CommandTypes.Close;
8279 * Request to obtain the list of files that should be regenerated if target file is recompiled.
8280 * NOTE: this us query-only operation and does not generate any output on disk.
8282 interface CompileOnSaveAffectedFileListRequest extends FileRequest {
8283 command: CommandTypes.CompileOnSaveAffectedFileList;
8286 * Contains a list of files that should be regenerated in a project
8288 interface CompileOnSaveAffectedFileListSingleProject {
8292 projectFileName: string;
8294 * List of files names that should be recompiled
8296 fileNames: string[];
8298 * true if project uses outFile or out compiler option
8300 projectUsesOutFile: boolean;
8303 * Response for CompileOnSaveAffectedFileListRequest request;
8305 interface CompileOnSaveAffectedFileListResponse extends Response {
8306 body: CompileOnSaveAffectedFileListSingleProject[];
8309 * Request to recompile the file. All generated outputs (.js, .d.ts or .js.map files) is written on disk.
8311 interface CompileOnSaveEmitFileRequest extends FileRequest {
8312 command: CommandTypes.CompileOnSaveEmitFile;
8313 arguments: CompileOnSaveEmitFileRequestArgs;
8316 * Arguments for CompileOnSaveEmitFileRequest
8318 interface CompileOnSaveEmitFileRequestArgs extends FileRequestArgs {
8320 * if true - then file should be recompiled even if it does not have any changes.
8323 includeLinePosition?: boolean;
8324 /** if true - return response as object with emitSkipped and diagnostics */
8325 richResponse?: boolean;
8327 interface CompileOnSaveEmitFileResponse extends Response {
8328 body: boolean | EmitResult;
8330 interface EmitResult {
8331 emitSkipped: boolean;
8332 diagnostics: Diagnostic[] | DiagnosticWithLinePosition[];
8335 * Quickinfo request; value of command field is
8336 * "quickinfo". Return response giving a quick type and
8337 * documentation string for the symbol found in file at location
8340 interface QuickInfoRequest extends FileLocationRequest {
8341 command: CommandTypes.Quickinfo;
8342 arguments: FileLocationRequestArgs;
8345 * Body of QuickInfoResponse.
8347 interface QuickInfoResponseBody {
8349 * The symbol's kind (such as 'className' or 'parameterName' or plain 'text').
8351 kind: ScriptElementKind;
8353 * Optional modifiers for the kind (such as 'public').
8355 kindModifiers: string;
8357 * Starting file location of symbol.
8361 * One past last character of symbol.
8365 * Type and kind of symbol.
8367 displayString: string;
8369 * Documentation associated with symbol.
8370 * Display parts when UserPreferences.displayPartsForJSDoc is true, flattened to string otherwise.
8372 documentation: string | SymbolDisplayPart[];
8374 * JSDoc tags associated with symbol.
8376 tags: JSDocTagInfo[];
8379 * Quickinfo response message.
8381 interface QuickInfoResponse extends Response {
8382 body?: QuickInfoResponseBody;
8385 * Arguments for format messages.
8387 interface FormatRequestArgs extends FileLocationRequestArgs {
8389 * Last line of range for which to format text in file.
8393 * Character offset on last line of range for which to format text in file.
8397 * Format options to be used.
8399 options?: FormatCodeSettings;
8402 * Format request; value of command field is "format". Return
8403 * response giving zero or more edit instructions. The edit
8404 * instructions will be sorted in file order. Applying the edit
8405 * instructions in reverse to file will result in correctly
8408 interface FormatRequest extends FileLocationRequest {
8409 command: CommandTypes.Format;
8410 arguments: FormatRequestArgs;
8413 * Object found in response messages defining an editing
8414 * instruction for a span of text in source code. The effect of
8415 * this instruction is to replace the text starting at start and
8416 * ending one character before end with newText. For an insertion,
8417 * the text span is empty. For a deletion, newText is empty.
8419 interface CodeEdit {
8421 * First character of the text span to edit.
8425 * One character past last character of the text span to edit.
8429 * Replace the span defined above with this string (may be
8430 * the empty string).
8434 interface FileCodeEdits {
8436 textChanges: CodeEdit[];
8438 interface CodeFixResponse extends Response {
8439 /** The code actions that are available */
8440 body?: CodeFixAction[];
8442 interface CodeAction {
8443 /** Description of the code action to display in the UI of the editor */
8444 description: string;
8445 /** Text changes to apply to each file as part of the code action */
8446 changes: FileCodeEdits[];
8447 /** A command is an opaque object that should be passed to `ApplyCodeActionCommandRequestArgs` without modification. */
8450 interface CombinedCodeActions {
8451 changes: readonly FileCodeEdits[];
8452 commands?: readonly {}[];
8454 interface CodeFixAction extends CodeAction {
8455 /** Short name to identify the fix, for use by telemetry. */
8458 * If present, one may call 'getCombinedCodeFix' with this fixId.
8459 * This may be omitted to indicate that the code fix can't be applied in a group.
8462 /** Should be present if and only if 'fixId' is. */
8463 fixAllDescription?: string;
8466 * Format and format on key response message.
8468 interface FormatResponse extends Response {
8472 * Arguments for format on key messages.
8474 interface FormatOnKeyRequestArgs extends FileLocationRequestArgs {
8476 * Key pressed (';', '\n', or '}').
8479 options?: FormatCodeSettings;
8482 * Format on key request; value of command field is
8483 * "formatonkey". Given file location and key typed (as string),
8484 * return response giving zero or more edit instructions. The
8485 * edit instructions will be sorted in file order. Applying the
8486 * edit instructions in reverse to file will result in correctly
8489 interface FormatOnKeyRequest extends FileLocationRequest {
8490 command: CommandTypes.Formatonkey;
8491 arguments: FormatOnKeyRequestArgs;
8493 type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<" | "#" | " ";
8494 enum CompletionTriggerKind {
8495 /** Completion was triggered by typing an identifier, manual invocation (e.g Ctrl+Space) or via API. */
8497 /** Completion was triggered by a trigger character. */
8498 TriggerCharacter = 2,
8499 /** Completion was re-triggered as the current completion list is incomplete. */
8500 TriggerForIncompleteCompletions = 3
8503 * Arguments for completions messages.
8505 interface CompletionsRequestArgs extends FileLocationRequestArgs {
8507 * Optional prefix to apply to possible completions.
8511 * Character that was responsible for triggering completion.
8512 * Should be `undefined` if a user manually requested completion.
8514 triggerCharacter?: CompletionsTriggerCharacter;
8515 triggerKind?: CompletionTriggerKind;
8517 * @deprecated Use UserPreferences.includeCompletionsForModuleExports
8519 includeExternalModuleExports?: boolean;
8521 * @deprecated Use UserPreferences.includeCompletionsWithInsertText
8523 includeInsertTextCompletions?: boolean;
8526 * Completions request; value of command field is "completions".
8527 * Given a file location (file, line, col) and a prefix (which may
8528 * be the empty string), return the possible completions that
8529 * begin with prefix.
8531 interface CompletionsRequest extends FileLocationRequest {
8532 command: CommandTypes.Completions | CommandTypes.CompletionInfo;
8533 arguments: CompletionsRequestArgs;
8536 * Arguments for completion details request.
8538 interface CompletionDetailsRequestArgs extends FileLocationRequestArgs {
8540 * Names of one or more entries for which to obtain details.
8542 entryNames: (string | CompletionEntryIdentifier)[];
8544 interface CompletionEntryIdentifier {
8550 * Completion entry details request; value of command field is
8551 * "completionEntryDetails". Given a file location (file, line,
8552 * col) and an array of completion entry names return more
8553 * detailed information for each completion entry.
8555 interface CompletionDetailsRequest extends FileLocationRequest {
8556 command: CommandTypes.CompletionDetails;
8557 arguments: CompletionDetailsRequestArgs;
8560 * Part of a symbol description.
8562 interface SymbolDisplayPart {
8564 * Text of an item describing the symbol.
8568 * The symbol's kind (such as 'className' or 'parameterName' or plain 'text').
8572 /** A part of a symbol description that links from a jsdoc @link tag to a declaration */
8573 interface JSDocLinkDisplayPart extends SymbolDisplayPart {
8574 /** The location of the declaration that the @link tag links to. */
8578 * An item found in a completion response.
8580 interface CompletionEntry {
8582 * The symbol's name.
8586 * The symbol's kind (such as 'className' or 'parameterName').
8588 kind: ScriptElementKind;
8590 * Optional modifiers for the kind (such as 'public').
8592 kindModifiers?: string;
8594 * A string that is used for comparing completion items so that they can be ordered. This
8595 * is often the same as the name but may be different in certain circumstances.
8599 * Text to insert instead of `name`.
8600 * This is used to support bracketed completions; If `name` might be "a-b" but `insertText` would be `["a-b"]`,
8601 * coupled with `replacementSpan` to replace a dotted access with a bracket access.
8603 insertText?: string;
8605 * `insertText` should be interpreted as a snippet if true.
8609 * An optional span that indicates the text to be replaced by this completion item.
8610 * If present, this span should be used instead of the default one.
8611 * It will be set if the required span differs from the one generated by the default replacement behavior.
8613 replacementSpan?: TextSpan;
8615 * Indicates whether commiting this completion entry will require additional code actions to be
8616 * made to avoid errors. The CompletionEntryDetails will have these actions.
8620 * Identifier (not necessarily human-readable) identifying where this completion came from.
8624 * Human-readable description of the `source`.
8626 sourceDisplay?: SymbolDisplayPart[];
8628 * If true, this completion should be highlighted as recommended. There will only be one of these.
8629 * This will be set when we know the user should write an expression with a certain type and that type is an enum or constructable class.
8630 * Then either that enum/class or a namespace containing it will be the recommended symbol.
8632 isRecommended?: true;
8634 * If true, this completion was generated from traversing the name table of an unchecked JS file,
8635 * and therefore may not be accurate.
8637 isFromUncheckedFile?: true;
8639 * If true, this completion was for an auto-import of a module not yet in the program, but listed
8640 * in the project package.json. Used for telemetry reporting.
8642 isPackageJsonImport?: true;
8644 * If true, this completion was an auto-import-style completion of an import statement (i.e., the
8645 * module specifier was inserted along with the imported identifier). Used for telemetry reporting.
8647 isImportStatementCompletion?: true;
8649 * A property to be sent back to TS Server in the CompletionDetailsRequest, along with `name`,
8650 * that allows TS Server to look up the symbol represented by the completion item, disambiguating
8651 * items with the same name.
8656 * Additional completion entry details, available on demand
8658 interface CompletionEntryDetails {
8660 * The symbol's name.
8664 * The symbol's kind (such as 'className' or 'parameterName').
8666 kind: ScriptElementKind;
8668 * Optional modifiers for the kind (such as 'public').
8670 kindModifiers: string;
8672 * Display parts of the symbol (similar to quick info).
8674 displayParts: SymbolDisplayPart[];
8676 * Documentation strings for the symbol.
8678 documentation?: SymbolDisplayPart[];
8680 * JSDoc tags for the symbol.
8682 tags?: JSDocTagInfo[];
8684 * The associated code actions for this entry
8686 codeActions?: CodeAction[];
8688 * @deprecated Use `sourceDisplay` instead.
8690 source?: SymbolDisplayPart[];
8692 * Human-readable description of the `source` from the CompletionEntry.
8694 sourceDisplay?: SymbolDisplayPart[];
8696 /** @deprecated Prefer CompletionInfoResponse, which supports several top-level fields in addition to the array of entries. */
8697 interface CompletionsResponse extends Response {
8698 body?: CompletionEntry[];
8700 interface CompletionInfoResponse extends Response {
8701 body?: CompletionInfo;
8703 interface CompletionInfo {
8704 readonly isGlobalCompletion: boolean;
8705 readonly isMemberCompletion: boolean;
8706 readonly isNewIdentifierLocation: boolean;
8708 * In the absence of `CompletionEntry["replacementSpan"]`, the editor may choose whether to use
8709 * this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span
8710 * must be used to commit that completion entry.
8712 readonly optionalReplacementSpan?: TextSpan;
8713 readonly isIncomplete?: boolean;
8714 readonly entries: readonly CompletionEntry[];
8716 interface CompletionDetailsResponse extends Response {
8717 body?: CompletionEntryDetails[];
8720 * Signature help information for a single parameter
8722 interface SignatureHelpParameter {
8724 * The parameter's name
8728 * Documentation of the parameter.
8730 documentation: SymbolDisplayPart[];
8732 * Display parts of the parameter.
8734 displayParts: SymbolDisplayPart[];
8736 * Whether the parameter is optional or not.
8738 isOptional: boolean;
8741 * Represents a single signature to show in signature help.
8743 interface SignatureHelpItem {
8745 * Whether the signature accepts a variable number of arguments.
8747 isVariadic: boolean;
8749 * The prefix display parts.
8751 prefixDisplayParts: SymbolDisplayPart[];
8753 * The suffix display parts.
8755 suffixDisplayParts: SymbolDisplayPart[];
8757 * The separator display parts.
8759 separatorDisplayParts: SymbolDisplayPart[];
8761 * The signature helps items for the parameters.
8763 parameters: SignatureHelpParameter[];
8765 * The signature's documentation
8767 documentation: SymbolDisplayPart[];
8769 * The signature's JSDoc tags
8771 tags: JSDocTagInfo[];
8774 * Signature help items found in the response of a signature help request.
8776 interface SignatureHelpItems {
8778 * The signature help items.
8780 items: SignatureHelpItem[];
8782 * The span for which signature help should appear on a signature
8784 applicableSpan: TextSpan;
8786 * The item selected in the set of available help items.
8788 selectedItemIndex: number;
8790 * The argument selected in the set of parameters.
8792 argumentIndex: number;
8794 * The argument count
8796 argumentCount: number;
8798 type SignatureHelpTriggerCharacter = "," | "(" | "<";
8799 type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")";
8801 * Arguments of a signature help request.
8803 interface SignatureHelpRequestArgs extends FileLocationRequestArgs {
8805 * Reason why signature help was invoked.
8806 * See each individual possible
8808 triggerReason?: SignatureHelpTriggerReason;
8810 type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason;
8812 * Signals that the user manually requested signature help.
8813 * The language service will unconditionally attempt to provide a result.
8815 interface SignatureHelpInvokedReason {
8817 triggerCharacter?: undefined;
8820 * Signals that the signature help request came from a user typing a character.
8821 * Depending on the character and the syntactic context, the request may or may not be served a result.
8823 interface SignatureHelpCharacterTypedReason {
8824 kind: "characterTyped";
8826 * Character that was responsible for triggering signature help.
8828 triggerCharacter: SignatureHelpTriggerCharacter;
8831 * Signals that this signature help request came from typing a character or moving the cursor.
8832 * This should only occur if a signature help session was already active and the editor needs to see if it should adjust.
8833 * The language service will unconditionally attempt to provide a result.
8834 * `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move.
8836 interface SignatureHelpRetriggeredReason {
8839 * Character that was responsible for triggering signature help.
8841 triggerCharacter?: SignatureHelpRetriggerCharacter;
8844 * Signature help request; value of command field is "signatureHelp".
8845 * Given a file location (file, line, col), return the signature
8848 interface SignatureHelpRequest extends FileLocationRequest {
8849 command: CommandTypes.SignatureHelp;
8850 arguments: SignatureHelpRequestArgs;
8853 * Response object for a SignatureHelpRequest.
8855 interface SignatureHelpResponse extends Response {
8856 body?: SignatureHelpItems;
8858 type InlayHintKind = "Type" | "Parameter" | "Enum";
8859 interface InlayHintsRequestArgs extends FileRequestArgs {
8861 * Start position of the span.
8865 * Length of the span.
8869 interface InlayHintsRequest extends Request {
8870 command: CommandTypes.ProvideInlayHints;
8871 arguments: InlayHintsRequestArgs;
8873 interface InlayHintItem {
8876 kind: InlayHintKind;
8877 whitespaceBefore?: boolean;
8878 whitespaceAfter?: boolean;
8880 interface InlayHintsResponse extends Response {
8881 body?: InlayHintItem[];
8884 * Synchronous request for semantic diagnostics of one file.
8886 interface SemanticDiagnosticsSyncRequest extends FileRequest {
8887 command: CommandTypes.SemanticDiagnosticsSync;
8888 arguments: SemanticDiagnosticsSyncRequestArgs;
8890 interface SemanticDiagnosticsSyncRequestArgs extends FileRequestArgs {
8891 includeLinePosition?: boolean;
8894 * Response object for synchronous sematic diagnostics request.
8896 interface SemanticDiagnosticsSyncResponse extends Response {
8897 body?: Diagnostic[] | DiagnosticWithLinePosition[];
8899 interface SuggestionDiagnosticsSyncRequest extends FileRequest {
8900 command: CommandTypes.SuggestionDiagnosticsSync;
8901 arguments: SuggestionDiagnosticsSyncRequestArgs;
8903 type SuggestionDiagnosticsSyncRequestArgs = SemanticDiagnosticsSyncRequestArgs;
8904 type SuggestionDiagnosticsSyncResponse = SemanticDiagnosticsSyncResponse;
8906 * Synchronous request for syntactic diagnostics of one file.
8908 interface SyntacticDiagnosticsSyncRequest extends FileRequest {
8909 command: CommandTypes.SyntacticDiagnosticsSync;
8910 arguments: SyntacticDiagnosticsSyncRequestArgs;
8912 interface SyntacticDiagnosticsSyncRequestArgs extends FileRequestArgs {
8913 includeLinePosition?: boolean;
8916 * Response object for synchronous syntactic diagnostics request.
8918 interface SyntacticDiagnosticsSyncResponse extends Response {
8919 body?: Diagnostic[] | DiagnosticWithLinePosition[];
8922 * Arguments for GeterrForProject request.
8924 interface GeterrForProjectRequestArgs {
8926 * the file requesting project error list
8930 * Delay in milliseconds to wait before starting to compute
8931 * errors for the files in the file list
8936 * GeterrForProjectRequest request; value of command field is
8937 * "geterrForProject". It works similarly with 'Geterr', only
8938 * it request for every file in this project.
8940 interface GeterrForProjectRequest extends Request {
8941 command: CommandTypes.GeterrForProject;
8942 arguments: GeterrForProjectRequestArgs;
8945 * Arguments for geterr messages.
8947 interface GeterrRequestArgs {
8949 * List of file names for which to compute compiler errors.
8950 * The files will be checked in list order.
8954 * Delay in milliseconds to wait before starting to compute
8955 * errors for the files in the file list
8960 * Geterr request; value of command field is "geterr". Wait for
8961 * delay milliseconds and then, if during the wait no change or
8962 * reload messages have arrived for the first file in the files
8963 * list, get the syntactic errors for the file, field requests,
8964 * and then get the semantic errors for the file. Repeat with a
8965 * smaller delay for each subsequent file on the files list. Best
8966 * practice for an editor is to send a file list containing each
8967 * file that is currently visible, in most-recently-used order.
8969 interface GeterrRequest extends Request {
8970 command: CommandTypes.Geterr;
8971 arguments: GeterrRequestArgs;
8973 type RequestCompletedEventName = "requestCompleted";
8975 * Event that is sent when server have finished processing request with specified id.
8977 interface RequestCompletedEvent extends Event {
8978 event: RequestCompletedEventName;
8979 body: RequestCompletedEventBody;
8981 interface RequestCompletedEventBody {
8982 request_seq: number;
8985 * Item of diagnostic information found in a DiagnosticEvent message.
8987 interface Diagnostic {
8989 * Starting file location at which text applies.
8993 * The last file location at which the text applies.
8997 * Text of diagnostic message.
9001 * The category of the diagnostic message, e.g. "error", "warning", or "suggestion".
9004 reportsUnnecessary?: {};
9005 reportsDeprecated?: {};
9007 * Any related spans the diagnostic may have, such as other locations relevant to an error, such as declarartion sites
9009 relatedInformation?: DiagnosticRelatedInformation[];
9011 * The error code of the diagnostic message.
9015 * The name of the plugin reporting the message.
9019 interface DiagnosticWithFileName extends Diagnostic {
9021 * Name of the file the diagnostic is in
9026 * Represents additional spans returned with a diagnostic which are relevant to it
9028 interface DiagnosticRelatedInformation {
9030 * The category of the related information message, e.g. "error", "warning", or "suggestion".
9034 * The code used ot identify the related information
9038 * Text of related or additional information.
9042 * Associated location
9046 interface DiagnosticEventBody {
9048 * The file for which diagnostic information is reported.
9052 * An array of diagnostic information items.
9054 diagnostics: Diagnostic[];
9056 type DiagnosticEventKind = "semanticDiag" | "syntaxDiag" | "suggestionDiag";
9058 * Event message for DiagnosticEventKind event types.
9059 * These events provide syntactic and semantic errors for a file.
9061 interface DiagnosticEvent extends Event {
9062 body?: DiagnosticEventBody;
9063 event: DiagnosticEventKind;
9065 interface ConfigFileDiagnosticEventBody {
9067 * The file which trigged the searching and error-checking of the config file
9069 triggerFile: string;
9071 * The name of the found config file.
9075 * An arry of diagnostic information items for the found config file.
9077 diagnostics: DiagnosticWithFileName[];
9080 * Event message for "configFileDiag" event type.
9081 * This event provides errors for a found config file.
9083 interface ConfigFileDiagnosticEvent extends Event {
9084 body?: ConfigFileDiagnosticEventBody;
9085 event: "configFileDiag";
9087 type ProjectLanguageServiceStateEventName = "projectLanguageServiceState";
9088 interface ProjectLanguageServiceStateEvent extends Event {
9089 event: ProjectLanguageServiceStateEventName;
9090 body?: ProjectLanguageServiceStateEventBody;
9092 interface ProjectLanguageServiceStateEventBody {
9094 * Project name that has changes in the state of language service.
9095 * For configured projects this will be the config file path.
9096 * For external projects this will be the name of the projects specified when project was open.
9097 * For inferred projects this event is not raised.
9099 projectName: string;
9101 * True if language service state switched from disabled to enabled
9102 * and false otherwise.
9104 languageServiceEnabled: boolean;
9106 type ProjectsUpdatedInBackgroundEventName = "projectsUpdatedInBackground";
9107 interface ProjectsUpdatedInBackgroundEvent extends Event {
9108 event: ProjectsUpdatedInBackgroundEventName;
9109 body: ProjectsUpdatedInBackgroundEventBody;
9111 interface ProjectsUpdatedInBackgroundEventBody {
9113 * Current set of open files
9115 openFiles: string[];
9117 type ProjectLoadingStartEventName = "projectLoadingStart";
9118 interface ProjectLoadingStartEvent extends Event {
9119 event: ProjectLoadingStartEventName;
9120 body: ProjectLoadingStartEventBody;
9122 interface ProjectLoadingStartEventBody {
9123 /** name of the project */
9124 projectName: string;
9125 /** reason for loading */
9128 type ProjectLoadingFinishEventName = "projectLoadingFinish";
9129 interface ProjectLoadingFinishEvent extends Event {
9130 event: ProjectLoadingFinishEventName;
9131 body: ProjectLoadingFinishEventBody;
9133 interface ProjectLoadingFinishEventBody {
9134 /** name of the project */
9135 projectName: string;
9137 type SurveyReadyEventName = "surveyReady";
9138 interface SurveyReadyEvent extends Event {
9139 event: SurveyReadyEventName;
9140 body: SurveyReadyEventBody;
9142 interface SurveyReadyEventBody {
9143 /** Name of the survey. This is an internal machine- and programmer-friendly name */
9146 type LargeFileReferencedEventName = "largeFileReferenced";
9147 interface LargeFileReferencedEvent extends Event {
9148 event: LargeFileReferencedEventName;
9149 body: LargeFileReferencedEventBody;
9151 interface LargeFileReferencedEventBody {
9153 * name of the large file being loaded
9161 * max file size allowed on the server
9163 maxFileSize: number;
9166 * Arguments for reload request.
9168 interface ReloadRequestArgs extends FileRequestArgs {
9170 * Name of temporary file from which to reload file
9171 * contents. May be same as file.
9176 * Reload request message; value of command field is "reload".
9177 * Reload contents of file with name given by the 'file' argument
9178 * from temporary file with name given by the 'tmpfile' argument.
9179 * The two names can be identical.
9181 interface ReloadRequest extends FileRequest {
9182 command: CommandTypes.Reload;
9183 arguments: ReloadRequestArgs;
9186 * Response to "reload" request. This is just an acknowledgement, so
9187 * no body field is required.
9189 interface ReloadResponse extends Response {
9192 * Arguments for saveto request.
9194 interface SavetoRequestArgs extends FileRequestArgs {
9196 * Name of temporary file into which to save server's view of
9202 * Saveto request message; value of command field is "saveto".
9203 * For debugging purposes, save to a temporaryfile (named by
9204 * argument 'tmpfile') the contents of file named by argument
9205 * 'file'. The server does not currently send a response to a
9208 interface SavetoRequest extends FileRequest {
9209 command: CommandTypes.Saveto;
9210 arguments: SavetoRequestArgs;
9213 * Arguments for navto request message.
9215 interface NavtoRequestArgs {
9217 * Search term to navigate to from current location; term can
9218 * be '.*' or an identifier prefix.
9220 searchValue: string;
9222 * Optional limit on the number of items to return.
9224 maxResultCount?: number;
9226 * The file for the request (absolute pathname required).
9230 * Optional flag to indicate we want results for just the current file
9231 * or the entire project.
9233 currentFileOnly?: boolean;
9234 projectFileName?: string;
9237 * Navto request message; value of command field is "navto".
9238 * Return list of objects giving file locations and symbols that
9239 * match the search term given in argument 'searchTerm'. The
9240 * context for the search is given by the named file.
9242 interface NavtoRequest extends Request {
9243 command: CommandTypes.Navto;
9244 arguments: NavtoRequestArgs;
9247 * An item found in a navto response.
9249 interface NavtoItem extends FileSpan {
9251 * The symbol's name.
9255 * The symbol's kind (such as 'className' or 'parameterName').
9257 kind: ScriptElementKind;
9259 * exact, substring, or prefix.
9263 * If this was a case sensitive or insensitive match.
9265 isCaseSensitive: boolean;
9267 * Optional modifiers for the kind (such as 'public').
9269 kindModifiers?: string;
9271 * Name of symbol's container symbol (if any); for example,
9272 * the class name if symbol is a class member.
9274 containerName?: string;
9276 * Kind of symbol's container symbol (if any).
9278 containerKind?: ScriptElementKind;
9281 * Navto response message. Body is an array of navto items. Each
9282 * item gives a symbol that matched the search term.
9284 interface NavtoResponse extends Response {
9288 * Arguments for change request message.
9290 interface ChangeRequestArgs extends FormatRequestArgs {
9292 * Optional string to insert at location (file, line, offset).
9294 insertString?: string;
9297 * Change request message; value of command field is "change".
9298 * Update the server's view of the file named by argument 'file'.
9299 * Server does not currently send a response to a change request.
9301 interface ChangeRequest extends FileLocationRequest {
9302 command: CommandTypes.Change;
9303 arguments: ChangeRequestArgs;
9306 * Response to "brace" request.
9308 interface BraceResponse extends Response {
9312 * Brace matching request; value of command field is "brace".
9313 * Return response giving the file locations of matching braces
9314 * found in file at location line, offset.
9316 interface BraceRequest extends FileLocationRequest {
9317 command: CommandTypes.Brace;
9320 * NavBar items request; value of command field is "navbar".
9321 * Return response giving the list of navigation bar entries
9322 * extracted from the requested file.
9324 interface NavBarRequest extends FileRequest {
9325 command: CommandTypes.NavBar;
9328 * NavTree request; value of command field is "navtree".
9329 * Return response giving the navigation tree of the requested file.
9331 interface NavTreeRequest extends FileRequest {
9332 command: CommandTypes.NavTree;
9334 interface NavigationBarItem {
9336 * The item's display text.
9340 * The symbol's kind (such as 'className' or 'parameterName').
9342 kind: ScriptElementKind;
9344 * Optional modifiers for the kind (such as 'public').
9346 kindModifiers?: string;
9348 * The definition locations of the item.
9352 * Optional children.
9354 childItems?: NavigationBarItem[];
9356 * Number of levels deep this item should appear.
9360 /** protocol.NavigationTree is identical to ts.NavigationTree, except using protocol.TextSpan instead of ts.TextSpan */
9361 interface NavigationTree {
9363 kind: ScriptElementKind;
9364 kindModifiers: string;
9366 nameSpan: TextSpan | undefined;
9367 childItems?: NavigationTree[];
9369 type TelemetryEventName = "telemetry";
9370 interface TelemetryEvent extends Event {
9371 event: TelemetryEventName;
9372 body: TelemetryEventBody;
9374 interface TelemetryEventBody {
9375 telemetryEventName: string;
9378 type TypesInstallerInitializationFailedEventName = "typesInstallerInitializationFailed";
9379 interface TypesInstallerInitializationFailedEvent extends Event {
9380 event: TypesInstallerInitializationFailedEventName;
9381 body: TypesInstallerInitializationFailedEventBody;
9383 interface TypesInstallerInitializationFailedEventBody {
9386 type TypingsInstalledTelemetryEventName = "typingsInstalled";
9387 interface TypingsInstalledTelemetryEventBody extends TelemetryEventBody {
9388 telemetryEventName: TypingsInstalledTelemetryEventName;
9389 payload: TypingsInstalledTelemetryEventPayload;
9391 interface TypingsInstalledTelemetryEventPayload {
9393 * Comma separated list of installed typing packages
9395 installedPackages: string;
9397 * true if install request succeeded, otherwise - false
9399 installSuccess: boolean;
9401 * version of typings installer
9403 typingsInstallerVersion: string;
9405 type BeginInstallTypesEventName = "beginInstallTypes";
9406 type EndInstallTypesEventName = "endInstallTypes";
9407 interface BeginInstallTypesEvent extends Event {
9408 event: BeginInstallTypesEventName;
9409 body: BeginInstallTypesEventBody;
9411 interface EndInstallTypesEvent extends Event {
9412 event: EndInstallTypesEventName;
9413 body: EndInstallTypesEventBody;
9415 interface InstallTypesEventBody {
9417 * correlation id to match begin and end events
9421 * list of packages to install
9423 packages: readonly string[];
9425 interface BeginInstallTypesEventBody extends InstallTypesEventBody {
9427 interface EndInstallTypesEventBody extends InstallTypesEventBody {
9429 * true if installation succeeded, otherwise false
9433 interface NavBarResponse extends Response {
9434 body?: NavigationBarItem[];
9436 interface NavTreeResponse extends Response {
9437 body?: NavigationTree;
9439 interface CallHierarchyItem {
9441 kind: ScriptElementKind;
9442 kindModifiers?: string;
9445 selectionSpan: TextSpan;
9446 containerName?: string;
9448 interface CallHierarchyIncomingCall {
9449 from: CallHierarchyItem;
9450 fromSpans: TextSpan[];
9452 interface CallHierarchyOutgoingCall {
9453 to: CallHierarchyItem;
9454 fromSpans: TextSpan[];
9456 interface PrepareCallHierarchyRequest extends FileLocationRequest {
9457 command: CommandTypes.PrepareCallHierarchy;
9459 interface PrepareCallHierarchyResponse extends Response {
9460 readonly body: CallHierarchyItem | CallHierarchyItem[];
9462 interface ProvideCallHierarchyIncomingCallsRequest extends FileLocationRequest {
9463 command: CommandTypes.ProvideCallHierarchyIncomingCalls;
9465 interface ProvideCallHierarchyIncomingCallsResponse extends Response {
9466 readonly body: CallHierarchyIncomingCall[];
9468 interface ProvideCallHierarchyOutgoingCallsRequest extends FileLocationRequest {
9469 command: CommandTypes.ProvideCallHierarchyOutgoingCalls;
9471 interface ProvideCallHierarchyOutgoingCallsResponse extends Response {
9472 readonly body: CallHierarchyOutgoingCall[];
9479 enum SemicolonPreference {
9484 interface EditorSettings {
9485 baseIndentSize?: number;
9486 indentSize?: number;
9488 newLineCharacter?: string;
9489 convertTabsToSpaces?: boolean;
9490 indentStyle?: IndentStyle | ts.IndentStyle;
9491 trimTrailingWhitespace?: boolean;
9493 interface FormatCodeSettings extends EditorSettings {
9494 insertSpaceAfterCommaDelimiter?: boolean;
9495 insertSpaceAfterSemicolonInForStatements?: boolean;
9496 insertSpaceBeforeAndAfterBinaryOperators?: boolean;
9497 insertSpaceAfterConstructor?: boolean;
9498 insertSpaceAfterKeywordsInControlFlowStatements?: boolean;
9499 insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean;
9500 insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean;
9501 insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean;
9502 insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean;
9503 insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
9504 insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean;
9505 insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
9506 insertSpaceAfterTypeAssertion?: boolean;
9507 insertSpaceBeforeFunctionParenthesis?: boolean;
9508 placeOpenBraceOnNewLineForFunctions?: boolean;
9509 placeOpenBraceOnNewLineForControlBlocks?: boolean;
9510 insertSpaceBeforeTypeAnnotation?: boolean;
9511 semicolons?: SemicolonPreference;
9513 interface UserPreferences {
9514 readonly disableSuggestions?: boolean;
9515 readonly quotePreference?: "auto" | "double" | "single";
9517 * If enabled, TypeScript will search through all external modules' exports and add them to the completions list.
9518 * This affects lone identifier completions but not completions on the right hand side of `obj.`.
9520 readonly includeCompletionsForModuleExports?: boolean;
9522 * Enables auto-import-style completions on partially-typed import statements. E.g., allows
9523 * `import write|` to be completed to `import { writeFile } from "fs"`.
9525 readonly includeCompletionsForImportStatements?: boolean;
9527 * Allows completions to be formatted with snippet text, indicated by `CompletionItem["isSnippet"]`.
9529 readonly includeCompletionsWithSnippetText?: boolean;
9531 * If enabled, the completion list will include completions with invalid identifier names.
9532 * For those entries, The `insertText` and `replacementSpan` properties will be set to change from `.x` property access to `["x"]`.
9534 readonly includeCompletionsWithInsertText?: boolean;
9536 * Unless this option is `false`, or `includeCompletionsWithInsertText` is not enabled,
9537 * member completion lists triggered with `.` will include entries on potentially-null and potentially-undefined
9538 * values, with insertion text to replace preceding `.` tokens with `?.`.
9540 readonly includeAutomaticOptionalChainCompletions?: boolean;
9542 * If enabled, completions for class members (e.g. methods and properties) will include
9543 * a whole declaration for the member.
9544 * E.g., `class A { f| }` could be completed to `class A { foo(): number {} }`, instead of
9545 * `class A { foo }`.
9547 readonly includeCompletionsWithClassMemberSnippets?: boolean;
9548 readonly allowIncompleteCompletions?: boolean;
9549 readonly importModuleSpecifierPreference?: "shortest" | "project-relative" | "relative" | "non-relative";
9550 /** Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js" */
9551 readonly importModuleSpecifierEnding?: "auto" | "minimal" | "index" | "js";
9552 readonly allowTextChangesInNewFiles?: boolean;
9553 readonly lazyConfiguredProjectsFromExternalProject?: boolean;
9554 readonly providePrefixAndSuffixTextForRename?: boolean;
9555 readonly provideRefactorNotApplicableReason?: boolean;
9556 readonly allowRenameOfImportPath?: boolean;
9557 readonly includePackageJsonAutoImports?: "auto" | "on" | "off";
9558 readonly jsxAttributeCompletionStyle?: "auto" | "braces" | "none";
9559 readonly displayPartsForJSDoc?: boolean;
9560 readonly generateReturnInDocTemplate?: boolean;
9562 interface CompilerOptions {
9564 allowSyntheticDefaultImports?: boolean;
9565 allowUnreachableCode?: boolean;
9566 allowUnusedLabels?: boolean;
9567 alwaysStrict?: boolean;
9571 declaration?: boolean;
9572 declarationDir?: string;
9573 disableSizeLimit?: boolean;
9574 downlevelIteration?: boolean;
9576 emitDecoratorMetadata?: boolean;
9577 experimentalDecorators?: boolean;
9578 forceConsistentCasingInFileNames?: boolean;
9579 importHelpers?: boolean;
9580 inlineSourceMap?: boolean;
9581 inlineSources?: boolean;
9582 isolatedModules?: boolean;
9583 jsx?: JsxEmit | ts.JsxEmit;
9587 maxNodeModuleJsDepth?: number;
9588 module?: ModuleKind | ts.ModuleKind;
9589 moduleResolution?: ModuleResolutionKind | ts.ModuleResolutionKind;
9590 newLine?: NewLineKind | ts.NewLineKind;
9592 noEmitHelpers?: boolean;
9593 noEmitOnError?: boolean;
9594 noErrorTruncation?: boolean;
9595 noFallthroughCasesInSwitch?: boolean;
9596 noImplicitAny?: boolean;
9597 noImplicitReturns?: boolean;
9598 noImplicitThis?: boolean;
9599 noUnusedLocals?: boolean;
9600 noUnusedParameters?: boolean;
9601 noImplicitUseStrict?: boolean;
9603 noResolve?: boolean;
9607 paths?: MapLike<string[]>;
9608 plugins?: PluginImport[];
9609 preserveConstEnums?: boolean;
9610 preserveSymlinks?: boolean;
9612 reactNamespace?: string;
9613 removeComments?: boolean;
9614 references?: ProjectReference[];
9616 rootDirs?: string[];
9617 skipLibCheck?: boolean;
9618 skipDefaultLibCheck?: boolean;
9619 sourceMap?: boolean;
9620 sourceRoot?: string;
9622 strictNullChecks?: boolean;
9623 suppressExcessPropertyErrors?: boolean;
9624 suppressImplicitAnyIndexErrors?: boolean;
9625 useDefineForClassFields?: boolean;
9626 target?: ScriptTarget | ts.ScriptTarget;
9627 traceResolution?: boolean;
9628 resolveJsonModule?: boolean;
9630 /** Paths used to used to compute primary types search locations */
9631 typeRoots?: string[];
9632 [option: string]: CompilerOptionsValue | undefined;
9636 Preserve = "Preserve",
9637 ReactNative = "ReactNative",
9642 CommonJS = "CommonJS",
9650 enum ModuleResolutionKind {
9651 Classic = "Classic",
9671 enum ClassificationType {
9678 regularExpressionLiteral = 7,
9686 typeParameterName = 15,
9689 docCommentTagName = 18,
9690 jsxOpenTagName = 19,
9691 jsxCloseTagName = 20,
9692 jsxSelfClosingTagName = 21,
9695 jsxAttributeStringLiteralValue = 24,
9699 declare namespace ts.server {
9700 interface ScriptInfoVersion {
9704 function isDynamicFileName(fileName: NormalizedPath): boolean;
9706 private readonly host;
9707 readonly fileName: NormalizedPath;
9708 readonly scriptKind: ScriptKind;
9709 readonly hasMixedContent: boolean;
9710 readonly path: Path;
9712 * All projects that include this file
9714 readonly containingProjects: Project[];
9715 private formatSettings;
9716 private preferences;
9717 private textStorage;
9718 constructor(host: ServerHost, fileName: NormalizedPath, scriptKind: ScriptKind, hasMixedContent: boolean, path: Path, initialVersion?: ScriptInfoVersion);
9719 isScriptOpen(): boolean;
9720 open(newText: string): void;
9721 close(fileExists?: boolean): void;
9722 getSnapshot(): IScriptSnapshot;
9723 private ensureRealPath;
9724 getFormatCodeSettings(): FormatCodeSettings | undefined;
9725 getPreferences(): protocol.UserPreferences | undefined;
9726 attachToProject(project: Project): boolean;
9727 isAttached(project: Project): boolean;
9728 detachFromProject(project: Project): void;
9729 detachAllProjects(): void;
9730 getDefaultProject(): Project;
9731 registerFileUpdate(): void;
9732 setOptions(formatSettings: FormatCodeSettings, preferences: protocol.UserPreferences | undefined): void;
9733 getLatestVersion(): string;
9734 saveTo(fileName: string): void;
9735 reloadFromFile(tempFileName?: NormalizedPath): boolean;
9736 editContent(start: number, end: number, newText: string): void;
9737 markContainingProjectsAsDirty(): void;
9738 isOrphan(): boolean;
9740 * @param line 1 based index
9742 lineToTextSpan(line: number): TextSpan;
9744 * @param line 1 based index
9745 * @param offset 1 based index
9747 lineOffsetToPosition(line: number, offset: number): number;
9748 positionToLineOffset(position: number): protocol.Location;
9749 isJavaScript(): boolean;
9752 declare namespace ts.server {
9753 interface InstallPackageOptionsWithProject extends InstallPackageOptions {
9754 projectName: string;
9755 projectRootPath: Path;
9757 interface ITypingsInstaller {
9758 isKnownTypesPackageName(name: string): boolean;
9759 installPackage(options: InstallPackageOptionsWithProject): Promise<ApplyCodeActionCommandResult>;
9760 enqueueInstallTypingsRequest(p: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string> | undefined): void;
9761 attach(projectService: ProjectService): void;
9762 onProjectClosed(p: Project): void;
9763 readonly globalTypingsCacheLocation: string | undefined;
9765 const nullTypingsInstaller: ITypingsInstaller;
9767 declare namespace ts.server {
9772 AutoImportProvider = 3
9774 function allRootFilesAreJsOrDts(project: Project): boolean;
9775 function allFilesAreJsOrDts(project: Project): boolean;
9776 interface PluginCreateInfo {
9778 languageService: LanguageService;
9779 languageServiceHost: LanguageServiceHost;
9780 serverHost: ServerHost;
9781 session?: Session<unknown>;
9784 interface PluginModule {
9785 create(createInfo: PluginCreateInfo): LanguageService;
9786 getExternalFiles?(proj: Project): string[];
9787 onConfigurationChanged?(config: any): void;
9789 interface PluginModuleWithName {
9791 module: PluginModule;
9793 type PluginModuleFactory = (mod: {
9794 typescript: typeof ts;
9796 abstract class Project implements LanguageServiceHost, ModuleResolutionHost {
9797 readonly projectName: string;
9798 readonly projectKind: ProjectKind;
9799 readonly projectService: ProjectService;
9800 private documentRegistry;
9801 private compilerOptions;
9802 compileOnSaveEnabled: boolean;
9803 protected watchOptions: WatchOptions | undefined;
9805 private rootFilesMap;
9807 private externalFiles;
9808 private missingFilesMap;
9809 private generatedFilesMap;
9811 protected languageService: LanguageService;
9812 languageServiceEnabled: boolean;
9813 readonly trace?: (s: string) => void;
9814 readonly realpath?: (path: string) => string;
9815 private builderState;
9817 * Set of files names that were updated since the last call to getChangesSinceVersion.
9819 private updatedFileNames;
9821 * Set of files that was returned from the last call to getChangesSinceVersion.
9823 private lastReportedFileNames;
9825 * Last version that was reported.
9827 private lastReportedVersion;
9829 * Current project's program version. (incremented everytime new program is created that is not complete reuse from the old one)
9830 * This property is changed in 'updateGraph' based on the set of files in program
9832 private projectProgramVersion;
9834 * Current version of the project state. It is changed when:
9835 * - new root file was added/removed
9836 * - edit happen in some file that is currently included in the project.
9837 * This property is different from projectStructureVersion since in most cases edits don't affect set of files in the project
9839 private projectStateVersion;
9840 protected projectErrors: Diagnostic[] | undefined;
9841 protected isInitialLoadPending: () => boolean;
9842 private readonly cancellationToken;
9843 isNonTsProject(): boolean;
9844 isJsOnlyProject(): boolean;
9845 static resolveModule(moduleName: string, initialDir: string, host: ServerHost, log: (message: string) => void, logErrors?: (message: string) => void): {} | undefined;
9846 isKnownTypesPackageName(name: string): boolean;
9847 installPackage(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
9848 private get typingsCache();
9849 getCompilationSettings(): CompilerOptions;
9850 getCompilerOptions(): CompilerOptions;
9851 getNewLine(): string;
9852 getProjectVersion(): string;
9853 getProjectReferences(): readonly ProjectReference[] | undefined;
9854 getScriptFileNames(): string[];
9855 private getOrCreateScriptInfoAndAttachToProject;
9856 getScriptKind(fileName: string): ScriptKind;
9857 getScriptVersion(filename: string): string;
9858 getScriptSnapshot(filename: string): IScriptSnapshot | undefined;
9859 getCancellationToken(): HostCancellationToken;
9860 getCurrentDirectory(): string;
9861 getDefaultLibFileName(): string;
9862 useCaseSensitiveFileNames(): boolean;
9863 readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
9864 readFile(fileName: string): string | undefined;
9865 writeFile(fileName: string, content: string): void;
9866 fileExists(file: string): boolean;
9867 resolveModuleNames(moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference, _options?: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModuleFull | undefined)[];
9868 getResolvedModuleWithFailedLookupLocationsFromCache(moduleName: string, containingFile: string, resolutionMode?: ModuleKind.CommonJS | ModuleKind.ESNext): ResolvedModuleWithFailedLookupLocations | undefined;
9869 resolveTypeReferenceDirectives(typeDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference): (ResolvedTypeReferenceDirective | undefined)[];
9870 directoryExists(path: string): boolean;
9871 getDirectories(path: string): string[];
9872 log(s: string): void;
9873 error(s: string): void;
9874 private setInternalCompilerOptionsForEmittingJsFiles;
9876 * Get the errors that dont have any file name associated
9878 getGlobalProjectErrors(): readonly Diagnostic[];
9880 * Get all the project errors
9882 getAllProjectErrors(): readonly Diagnostic[];
9883 setProjectErrors(projectErrors: Diagnostic[] | undefined): void;
9884 getLanguageService(ensureSynchronized?: boolean): LanguageService;
9885 getCompileOnSaveAffectedFileList(scriptInfo: ScriptInfo): string[];
9887 * Returns true if emit was conducted
9889 emitFile(scriptInfo: ScriptInfo, writeFile: (path: string, data: string, writeByteOrderMark?: boolean) => void): EmitResult;
9890 enableLanguageService(): void;
9891 disableLanguageService(lastFileExceededProgramSize?: string): void;
9892 getProjectName(): string;
9893 protected removeLocalTypingsFromTypeAcquisition(newTypeAcquisition: TypeAcquisition): TypeAcquisition;
9894 getExternalFiles(): SortedReadonlyArray<string>;
9895 getSourceFile(path: Path): SourceFile | undefined;
9897 private detachScriptInfoIfNotRoot;
9898 isClosed(): boolean;
9899 hasRoots(): boolean;
9900 getRootFiles(): NormalizedPath[];
9901 getRootScriptInfos(): ScriptInfo[];
9902 getScriptInfos(): ScriptInfo[];
9903 getExcludedFiles(): readonly NormalizedPath[];
9904 getFileNames(excludeFilesFromExternalLibraries?: boolean, excludeConfigFiles?: boolean): NormalizedPath[];
9905 hasConfigFile(configFilePath: NormalizedPath): boolean;
9906 containsScriptInfo(info: ScriptInfo): boolean;
9907 containsFile(filename: NormalizedPath, requireOpen?: boolean): boolean;
9908 isRoot(info: ScriptInfo): boolean;
9909 addRoot(info: ScriptInfo, fileName?: NormalizedPath): void;
9910 addMissingFileRoot(fileName: NormalizedPath): void;
9911 removeFile(info: ScriptInfo, fileExists: boolean, detachFromProject: boolean): void;
9912 registerFileUpdate(fileName: string): void;
9913 markAsDirty(): void;
9915 * Updates set of files that contribute to this project
9916 * @returns: true if set of files in the project stays the same and false - otherwise.
9918 updateGraph(): boolean;
9919 protected removeExistingTypings(include: string[]): string[];
9920 private updateGraphWorker;
9921 private detachScriptInfoFromProject;
9922 private addMissingFileWatcher;
9923 private isWatchedMissingFile;
9924 private createGeneratedFileWatcher;
9925 private isValidGeneratedFileWatcher;
9926 private clearGeneratedFileWatch;
9927 getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo | undefined;
9928 getScriptInfo(uncheckedFileName: string): ScriptInfo | undefined;
9929 filesToString(writeProjectFileNames: boolean): string;
9930 setCompilerOptions(compilerOptions: CompilerOptions): void;
9931 setTypeAcquisition(newTypeAcquisition: TypeAcquisition | undefined): void;
9932 getTypeAcquisition(): TypeAcquisition;
9933 protected removeRoot(info: ScriptInfo): void;
9934 protected enableGlobalPlugins(options: CompilerOptions, pluginConfigOverrides: Map<any> | undefined): void;
9935 protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[], pluginConfigOverrides: Map<any> | undefined): void;
9936 private enableProxy;
9937 /** Starts a new check for diagnostics. Call this if some file has updated that would cause diagnostics to be changed. */
9938 refreshDiagnostics(): void;
9941 * If a file is opened and no tsconfig (or jsconfig) is found,
9942 * the file and its imports/references are put into an InferredProject.
9944 class InferredProject extends Project {
9945 private _isJsInferredProject;
9946 toggleJsInferredProject(isJsInferredProject: boolean): void;
9947 setCompilerOptions(options?: CompilerOptions): void;
9948 /** this is canonical project root path */
9949 readonly projectRootPath: string | undefined;
9950 addRoot(info: ScriptInfo): void;
9951 removeRoot(info: ScriptInfo): void;
9952 isProjectWithSingleRoot(): boolean;
9954 getTypeAcquisition(): TypeAcquisition;
9956 class AutoImportProviderProject extends Project {
9957 private hostProject;
9958 private rootFileNames;
9959 isOrphan(): boolean;
9960 updateGraph(): boolean;
9961 hasRoots(): boolean;
9962 markAsDirty(): void;
9963 getScriptFileNames(): string[];
9964 getLanguageService(): never;
9965 getModuleResolutionHostForAutoImportProvider(): never;
9966 getProjectReferences(): readonly ProjectReference[] | undefined;
9967 getTypeAcquisition(): TypeAcquisition;
9970 * If a file is opened, the server will look for a tsconfig (or jsconfig)
9971 * and if successful create a ConfiguredProject for it.
9972 * Otherwise it will create an InferredProject.
9974 class ConfiguredProject extends Project {
9975 readonly canonicalConfigFilePath: NormalizedPath;
9976 /** Ref count to the project when opened from external project */
9977 private externalProjectRefCount;
9978 private projectReferences;
9980 * If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph
9981 * @returns: true if set of files in the project stays the same and false - otherwise.
9983 updateGraph(): boolean;
9984 getConfigFilePath(): NormalizedPath;
9985 getProjectReferences(): readonly ProjectReference[] | undefined;
9986 updateReferences(refs: readonly ProjectReference[] | undefined): void;
9988 * Get the errors that dont have any file name associated
9990 getGlobalProjectErrors(): readonly Diagnostic[];
9992 * Get all the project errors
9994 getAllProjectErrors(): readonly Diagnostic[];
9995 setProjectErrors(projectErrors: Diagnostic[]): void;
9997 getEffectiveTypeRoots(): string[];
10000 * Project whose configuration is handled externally, such as in a '.csproj'.
10001 * These are created only if a host explicitly calls `openExternalProject`.
10003 class ExternalProject extends Project {
10004 externalProjectName: string;
10005 compileOnSaveEnabled: boolean;
10006 excludedFiles: readonly NormalizedPath[];
10007 updateGraph(): boolean;
10008 getExcludedFiles(): readonly NormalizedPath[];
10011 declare namespace ts.server {
10012 export const maxProgramSizeForNonTsFiles: number;
10013 export const ProjectsUpdatedInBackgroundEvent = "projectsUpdatedInBackground";
10014 export const ProjectLoadingStartEvent = "projectLoadingStart";
10015 export const ProjectLoadingFinishEvent = "projectLoadingFinish";
10016 export const LargeFileReferencedEvent = "largeFileReferenced";
10017 export const ConfigFileDiagEvent = "configFileDiag";
10018 export const ProjectLanguageServiceStateEvent = "projectLanguageServiceState";
10019 export const ProjectInfoTelemetryEvent = "projectInfo";
10020 export const OpenFileInfoTelemetryEvent = "openFileInfo";
10021 export interface ProjectsUpdatedInBackgroundEvent {
10022 eventName: typeof ProjectsUpdatedInBackgroundEvent;
10024 openFiles: string[];
10027 export interface ProjectLoadingStartEvent {
10028 eventName: typeof ProjectLoadingStartEvent;
10034 export interface ProjectLoadingFinishEvent {
10035 eventName: typeof ProjectLoadingFinishEvent;
10040 export interface LargeFileReferencedEvent {
10041 eventName: typeof LargeFileReferencedEvent;
10045 maxFileSize: number;
10048 export interface ConfigFileDiagEvent {
10049 eventName: typeof ConfigFileDiagEvent;
10051 triggerFile: string;
10052 configFileName: string;
10053 diagnostics: readonly Diagnostic[];
10056 export interface ProjectLanguageServiceStateEvent {
10057 eventName: typeof ProjectLanguageServiceStateEvent;
10060 languageServiceEnabled: boolean;
10063 /** This will be converted to the payload of a protocol.TelemetryEvent in session.defaultEventHandler. */
10064 export interface ProjectInfoTelemetryEvent {
10065 readonly eventName: typeof ProjectInfoTelemetryEvent;
10066 readonly data: ProjectInfoTelemetryEventData;
10068 export interface ProjectInfoTelemetryEventData {
10069 /** Cryptographically secure hash of project file location. */
10070 readonly projectId: string;
10071 /** Count of file extensions seen in the project. */
10072 readonly fileStats: FileStats;
10074 * Any compiler options that might contain paths will be taken out.
10075 * Enum compiler options will be converted to strings.
10077 readonly compilerOptions: CompilerOptions;
10078 readonly extends: boolean | undefined;
10079 readonly files: boolean | undefined;
10080 readonly include: boolean | undefined;
10081 readonly exclude: boolean | undefined;
10082 readonly compileOnSave: boolean;
10083 readonly typeAcquisition: ProjectInfoTypeAcquisitionData;
10084 readonly configFileName: "tsconfig.json" | "jsconfig.json" | "other";
10085 readonly projectType: "external" | "configured";
10086 readonly languageServiceEnabled: boolean;
10087 /** TypeScript version used by the server. */
10088 readonly version: string;
10091 * Info that we may send about a file that was just opened.
10092 * Info about a file will only be sent once per session, even if the file changes in ways that might affect the info.
10093 * Currently this is only sent for '.js' files.
10095 export interface OpenFileInfoTelemetryEvent {
10096 readonly eventName: typeof OpenFileInfoTelemetryEvent;
10097 readonly data: OpenFileInfoTelemetryEventData;
10099 export interface OpenFileInfoTelemetryEventData {
10100 readonly info: OpenFileInfo;
10102 export interface ProjectInfoTypeAcquisitionData {
10103 readonly enable: boolean | undefined;
10104 readonly include: boolean;
10105 readonly exclude: boolean;
10107 export interface FileStats {
10108 readonly js: number;
10109 readonly jsSize?: number;
10110 readonly jsx: number;
10111 readonly jsxSize?: number;
10112 readonly ts: number;
10113 readonly tsSize?: number;
10114 readonly tsx: number;
10115 readonly tsxSize?: number;
10116 readonly dts: number;
10117 readonly dtsSize?: number;
10118 readonly deferred: number;
10119 readonly deferredSize?: number;
10121 export interface OpenFileInfo {
10122 readonly checkJs: boolean;
10124 export type ProjectServiceEvent = LargeFileReferencedEvent | ProjectsUpdatedInBackgroundEvent | ProjectLoadingStartEvent | ProjectLoadingFinishEvent | ConfigFileDiagEvent | ProjectLanguageServiceStateEvent | ProjectInfoTelemetryEvent | OpenFileInfoTelemetryEvent;
10125 export type ProjectServiceEventHandler = (event: ProjectServiceEvent) => void;
10126 export interface SafeList {
10129 exclude?: (string | number)[][];
10133 export interface TypesMapFile {
10134 typesMap: SafeList;
10136 [libName: string]: string;
10139 export function convertFormatOptions(protocolOptions: protocol.FormatCodeSettings): FormatCodeSettings;
10140 export function convertCompilerOptions(protocolOptions: protocol.ExternalProjectCompilerOptions): CompilerOptions & protocol.CompileOnSaveMixin;
10141 export function convertWatchOptions(protocolOptions: protocol.ExternalProjectCompilerOptions, currentDirectory?: string): WatchOptionsAndErrors | undefined;
10142 export function convertTypeAcquisition(protocolOptions: protocol.InferredProjectCompilerOptions): TypeAcquisition | undefined;
10143 export function tryConvertScriptKindName(scriptKindName: protocol.ScriptKindName | ScriptKind): ScriptKind;
10144 export function convertScriptKindName(scriptKindName: protocol.ScriptKindName): ScriptKind.Unknown | ScriptKind.JS | ScriptKind.JSX | ScriptKind.TS | ScriptKind.TSX;
10145 export interface HostConfiguration {
10146 formatCodeOptions: FormatCodeSettings;
10147 preferences: protocol.UserPreferences;
10149 extraFileExtensions?: FileExtensionInfo[];
10150 watchOptions?: WatchOptions;
10152 export interface OpenConfiguredProjectResult {
10153 configFileName?: NormalizedPath;
10154 configFileErrors?: readonly Diagnostic[];
10156 export interface ProjectServiceOptions {
10159 cancellationToken: HostCancellationToken;
10160 useSingleInferredProject: boolean;
10161 useInferredProjectPerProjectRoot: boolean;
10162 typingsInstaller: ITypingsInstaller;
10163 eventHandler?: ProjectServiceEventHandler;
10164 suppressDiagnosticEvents?: boolean;
10165 throttleWaitMilliseconds?: number;
10166 globalPlugins?: readonly string[];
10167 pluginProbeLocations?: readonly string[];
10168 allowLocalPluginLoads?: boolean;
10169 typesMapLocation?: string;
10170 /** @deprecated use serverMode instead */
10171 syntaxOnly?: boolean;
10172 serverMode?: LanguageServiceMode;
10173 session: Session<unknown> | undefined;
10175 export interface WatchOptionsAndErrors {
10176 watchOptions: WatchOptions;
10177 errors: Diagnostic[] | undefined;
10179 export class ProjectService {
10180 private readonly nodeModulesWatchers;
10182 * Contains all the deleted script info's version information so that
10183 * it does not reset when creating script info again
10184 * (and could have potentially collided with version where contents mismatch)
10186 private readonly filenameToScriptInfoVersion;
10187 private readonly allJsFilesForOpenFileTelemetry;
10189 * maps external project file name to list of config files that were the part of this project
10191 private readonly externalProjectToConfiguredProjectMap;
10193 * external projects (configuration and list of root files is not controlled by tsserver)
10195 readonly externalProjects: ExternalProject[];
10197 * projects built from openFileRoots
10199 readonly inferredProjects: InferredProject[];
10201 * projects specified by a tsconfig.json file
10203 readonly configuredProjects: Map<ConfiguredProject>;
10205 * Open files: with value being project root path, and key being Path of the file that is open
10207 readonly openFiles: Map<NormalizedPath | undefined>;
10209 * Map of open files that are opened without complete path but have projectRoot as current directory
10211 private readonly openFilesWithNonRootedDiskPath;
10212 private compilerOptionsForInferredProjects;
10213 private compilerOptionsForInferredProjectsPerProjectRoot;
10214 private watchOptionsForInferredProjects;
10215 private watchOptionsForInferredProjectsPerProjectRoot;
10216 private typeAcquisitionForInferredProjects;
10217 private typeAcquisitionForInferredProjectsPerProjectRoot;
10219 * Project size for configured or external projects
10221 private readonly projectToSizeMap;
10222 private readonly hostConfiguration;
10224 private readonly legacySafelist;
10225 private pendingProjectUpdates;
10226 readonly currentDirectory: NormalizedPath;
10227 readonly toCanonicalFileName: (f: string) => string;
10228 readonly host: ServerHost;
10229 readonly logger: Logger;
10230 readonly cancellationToken: HostCancellationToken;
10231 readonly useSingleInferredProject: boolean;
10232 readonly useInferredProjectPerProjectRoot: boolean;
10233 readonly typingsInstaller: ITypingsInstaller;
10234 private readonly globalCacheLocationDirectoryPath;
10235 readonly throttleWaitMilliseconds?: number;
10236 private readonly eventHandler?;
10237 private readonly suppressDiagnosticEvents?;
10238 readonly globalPlugins: readonly string[];
10239 readonly pluginProbeLocations: readonly string[];
10240 readonly allowLocalPluginLoads: boolean;
10241 private currentPluginConfigOverrides;
10242 readonly typesMapLocation: string | undefined;
10243 /** @deprecated use serverMode instead */
10244 readonly syntaxOnly: boolean;
10245 readonly serverMode: LanguageServiceMode;
10246 /** Tracks projects that we have already sent telemetry for. */
10247 private readonly seenProjects;
10248 private performanceEventHandler?;
10249 constructor(opts: ProjectServiceOptions);
10250 toPath(fileName: string): Path;
10251 private loadTypesMap;
10252 updateTypingsForProject(response: SetTypings | InvalidateCachedTypings | PackageInstalledResponse): void;
10253 private delayUpdateProjectGraph;
10254 private delayUpdateProjectGraphs;
10255 setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.InferredProjectCompilerOptions, projectRootPath?: string): void;
10256 findProject(projectName: string): Project | undefined;
10257 getDefaultProjectForFile(fileName: NormalizedPath, ensureProject: boolean): Project | undefined;
10258 private doEnsureDefaultProjectForFile;
10259 getScriptInfoEnsuringProjectsUptoDate(uncheckedFileName: string): ScriptInfo | undefined;
10261 * Ensures the project structures are upto date
10263 * - we go through all the projects and update them if they are dirty
10264 * - if updates reflect some change in structure or there was pending request to ensure projects for open files
10265 * ensure that each open script info has project
10267 private ensureProjectStructuresUptoDate;
10268 getFormatCodeOptions(file: NormalizedPath): FormatCodeSettings;
10269 getPreferences(file: NormalizedPath): protocol.UserPreferences;
10270 getHostFormatCodeOptions(): FormatCodeSettings;
10271 getHostPreferences(): protocol.UserPreferences;
10272 private onSourceFileChanged;
10273 private handleSourceMapProjects;
10274 private delayUpdateSourceInfoProjects;
10275 private delayUpdateProjectsOfScriptInfoPath;
10276 private handleDeletedFile;
10277 private removeProject;
10278 private assignOrphanScriptInfosToInferredProject;
10280 * Remove this file from the set of open, non-configured files.
10281 * @param info The file that has been closed or newly configured
10283 private closeOpenFile;
10284 private deleteScriptInfo;
10285 private configFileExists;
10287 * Returns true if the configFileExistenceInfo is needed/impacted by open files that are root of inferred project
10289 private configFileExistenceImpactsRootOfInferredProject;
10291 * This is called on file close, so that we stop watching the config file for this script info
10293 private stopWatchingConfigFilesForClosedScriptInfo;
10295 * This function tries to search for a tsconfig.json for the given file.
10296 * This is different from the method the compiler uses because
10297 * the compiler can assume it will always start searching in the
10298 * current directory (the directory in which tsc was invoked).
10299 * The server must start searching from the directory containing
10300 * the newly opened file.
10302 private forEachConfigFileLocation;
10304 * This function tries to search for a tsconfig.json for the given file.
10305 * This is different from the method the compiler uses because
10306 * the compiler can assume it will always start searching in the
10307 * current directory (the directory in which tsc was invoked).
10308 * The server must start searching from the directory containing
10309 * the newly opened file.
10310 * If script info is passed in, it is asserted to be open script info
10311 * otherwise just file name
10313 private getConfigFileNameForFile;
10314 private printProjects;
10315 private getConfiguredProjectByCanonicalConfigFilePath;
10316 private findExternalProjectByProjectName;
10317 /** Get a filename if the language service exceeds the maximum allowed program size; otherwise returns undefined. */
10318 private getFilenameForExceededTotalSizeLimitForNonTsFiles;
10319 private createExternalProject;
10320 private addFilesToNonInferredProject;
10321 private updateNonInferredProjectFiles;
10322 private updateRootAndOptionsOfNonInferredProject;
10323 private sendConfigFileDiagEvent;
10324 private getOrCreateInferredProjectForProjectRootPathIfEnabled;
10325 private getOrCreateSingleInferredProjectIfEnabled;
10326 private getOrCreateSingleInferredWithoutProjectRoot;
10327 private createInferredProject;
10328 getScriptInfo(uncheckedFileName: string): ScriptInfo | undefined;
10329 private watchClosedScriptInfo;
10330 private createNodeModulesWatcher;
10331 private watchClosedScriptInfoInNodeModules;
10332 private getModifiedTime;
10333 private refreshScriptInfo;
10334 private refreshScriptInfosInDirectory;
10335 private stopWatchingScriptInfo;
10336 private getOrCreateScriptInfoNotOpenedByClientForNormalizedPath;
10337 private getOrCreateScriptInfoOpenedByClientForNormalizedPath;
10338 getOrCreateScriptInfoForNormalizedPath(fileName: NormalizedPath, openedByClient: boolean, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, hostToQueryFileExistsOn?: {
10339 fileExists(path: string): boolean;
10340 }): ScriptInfo | undefined;
10341 private getOrCreateScriptInfoWorker;
10343 * This gets the script info for the normalized path. If the path is not rooted disk path then the open script info with project root context is preferred
10345 getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo | undefined;
10346 getScriptInfoForPath(fileName: Path): ScriptInfo | undefined;
10347 private addSourceInfoToSourceMap;
10348 private addMissingSourceMapFile;
10349 setHostConfiguration(args: protocol.ConfigureRequestArguments): void;
10352 * This function rebuilds the project for every file opened by the client
10353 * This does not reload contents of open files from disk. But we could do that if needed
10355 reloadProjects(): void;
10357 * This function goes through all the openFiles and tries to file the config file for them.
10358 * If the config file is found and it refers to existing project, it reloads it either immediately
10359 * or schedules it for reload depending on delayReload option
10360 * If there is no existing project it just opens the configured project for the config file
10361 * reloadForInfo provides a way to filter out files to reload configured project for
10363 private reloadConfiguredProjectForFiles;
10365 * Remove the root of inferred project if script info is part of another project
10367 private removeRootOfInferredProjectIfNowPartOfOtherProject;
10369 * This function is to update the project structure for every inferred project.
10370 * It is called on the premise that all the configured projects are
10372 * This will go through open files and assign them to inferred project if open file is not part of any other project
10373 * After that all the inferred project graphs are updated
10375 private ensureProjectForOpenFiles;
10377 * Open file whose contents is managed by the client
10378 * @param filename is absolute pathname
10379 * @param fileContent is a known version of the file content that is more up to date than the one on disk
10381 openClientFile(fileName: string, fileContent?: string, scriptKind?: ScriptKind, projectRootPath?: string): OpenConfiguredProjectResult;
10382 private findExternalProjectContainingOpenScriptInfo;
10383 private getOrCreateOpenScriptInfo;
10384 private assignProjectToOpenedScriptInfo;
10385 private createAncestorProjects;
10386 private ensureProjectChildren;
10387 private cleanupAfterOpeningFile;
10388 openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult;
10389 private removeOrphanConfiguredProjects;
10390 private removeOrphanScriptInfos;
10391 private telemetryOnOpenFile;
10393 * Close file whose contents is managed by the client
10394 * @param filename is absolute pathname
10396 closeClientFile(uncheckedFileName: string): void;
10397 private collectChanges;
10398 private closeConfiguredProjectReferencedFromExternalProject;
10399 closeExternalProject(uncheckedFileName: string): void;
10400 openExternalProjects(projects: protocol.ExternalProject[]): void;
10401 /** Makes a filename safe to insert in a RegExp */
10402 private static readonly filenameEscapeRegexp;
10403 private static escapeFilenameForRegex;
10404 resetSafeList(): void;
10405 applySafeList(proj: protocol.ExternalProject): NormalizedPath[];
10406 openExternalProject(proj: protocol.ExternalProject): void;
10407 hasDeferredExtension(): boolean;
10408 configurePlugin(args: protocol.ConfigurePluginRequestArguments): void;
10412 declare namespace ts.server {
10413 interface ServerCancellationToken extends HostCancellationToken {
10414 setRequest(requestId: number): void;
10415 resetRequest(requestId: number): void;
10417 const nullCancellationToken: ServerCancellationToken;
10418 interface PendingErrorCheck {
10419 fileName: NormalizedPath;
10422 type CommandNames = protocol.CommandTypes;
10423 const CommandNames: any;
10424 function formatMessage<T extends protocol.Message>(msg: T, logger: Logger, byteLength: (s: string, encoding: string) => number, newLine: string): string;
10425 type Event = <T extends object>(body: T, eventName: string) => void;
10426 interface EventSender {
10429 interface SessionOptions {
10431 cancellationToken: ServerCancellationToken;
10432 useSingleInferredProject: boolean;
10433 useInferredProjectPerProjectRoot: boolean;
10434 typingsInstaller: ITypingsInstaller;
10435 byteLength: (buf: string, encoding?: string) => number;
10436 hrtime: (start?: number[]) => number[];
10439 * If falsy, all events are suppressed.
10441 canUseEvents: boolean;
10442 eventHandler?: ProjectServiceEventHandler;
10443 /** Has no effect if eventHandler is also specified. */
10444 suppressDiagnosticEvents?: boolean;
10445 /** @deprecated use serverMode instead */
10446 syntaxOnly?: boolean;
10447 serverMode?: LanguageServiceMode;
10448 throttleWaitMilliseconds?: number;
10449 noGetErrOnBackgroundUpdate?: boolean;
10450 globalPlugins?: readonly string[];
10451 pluginProbeLocations?: readonly string[];
10452 allowLocalPluginLoads?: boolean;
10453 typesMapLocation?: string;
10455 class Session<TMessage = string> implements EventSender {
10456 private readonly gcTimer;
10457 protected projectService: ProjectService;
10459 private performanceData;
10460 private currentRequestId;
10461 private errorCheck;
10462 protected host: ServerHost;
10463 private readonly cancellationToken;
10464 protected readonly typingsInstaller: ITypingsInstaller;
10465 protected byteLength: (buf: string, encoding?: string) => number;
10467 protected logger: Logger;
10468 protected canUseEvents: boolean;
10469 private suppressDiagnosticEvents?;
10470 private eventHandler;
10471 private readonly noGetErrOnBackgroundUpdate?;
10472 constructor(opts: SessionOptions);
10473 private sendRequestCompletedEvent;
10474 private addPerformanceData;
10475 private performanceEventHandler;
10476 private defaultEventHandler;
10477 private projectsUpdatedInBackgroundEvent;
10478 logError(err: Error, cmd: string): void;
10479 private logErrorWorker;
10480 send(msg: protocol.Message): void;
10481 event<T extends object>(body: T, eventName: string): void;
10483 output(info: any, cmdName: string, reqSeq?: number, errorMsg?: string): void;
10485 private semanticCheck;
10486 private syntacticCheck;
10487 private suggestionCheck;
10488 private sendDiagnosticsEvent;
10489 /** It is the caller's responsibility to verify that `!this.suppressDiagnosticEvents`. */
10490 private updateErrorCheck;
10491 private cleanProjects;
10493 private getEncodedSyntacticClassifications;
10494 private getEncodedSemanticClassifications;
10495 private getProject;
10496 private getConfigFileAndProject;
10497 private getConfigFileDiagnostics;
10498 private convertToDiagnosticsWithLinePositionFromDiagnosticFile;
10499 private getCompilerOptionsDiagnostics;
10500 private convertToDiagnosticsWithLinePosition;
10501 private getDiagnosticsWorker;
10502 private getDefinition;
10503 private mapDefinitionInfoLocations;
10504 private getDefinitionAndBoundSpan;
10505 private getEmitOutput;
10506 private mapJSDocTagInfo;
10507 private mapDisplayParts;
10508 private mapSignatureHelpItems;
10509 private mapDefinitionInfo;
10510 private static mapToOriginalLocation;
10511 private toFileSpan;
10512 private toFileSpanWithContext;
10513 private getTypeDefinition;
10514 private mapImplementationLocations;
10515 private getImplementation;
10516 private getOccurrences;
10517 private getSyntacticDiagnosticsSync;
10518 private getSemanticDiagnosticsSync;
10519 private getSuggestionDiagnosticsSync;
10520 private getJsxClosingTag;
10521 private getDocumentHighlights;
10522 private provideInlayHints;
10523 private setCompilerOptionsForInferredProjects;
10524 private getProjectInfo;
10525 private getProjectInfoWorker;
10526 private getRenameInfo;
10527 private getProjects;
10528 private getDefaultProject;
10529 private getRenameLocations;
10530 private mapRenameInfo;
10531 private toSpanGroups;
10532 private getReferences;
10533 private getFileReferences;
10535 * @param fileName is the name of the file to be opened
10536 * @param fileContent is a version of the file content that is known to be more up to date than the one on disk
10538 private openClientFile;
10539 private getPosition;
10540 private getPositionInFile;
10541 private getFileAndProject;
10542 private getFileAndLanguageServiceForSyntacticOperation;
10543 private getFileAndProjectWorker;
10544 private getOutliningSpans;
10545 private getTodoComments;
10546 private getDocCommentTemplate;
10547 private getSpanOfEnclosingComment;
10548 private getIndentation;
10549 private getBreakpointStatement;
10550 private getNameOrDottedNameSpan;
10551 private isValidBraceCompletion;
10552 private getQuickInfoWorker;
10553 private getFormattingEditsForRange;
10554 private getFormattingEditsForRangeFull;
10555 private getFormattingEditsForDocumentFull;
10556 private getFormattingEditsAfterKeystrokeFull;
10557 private getFormattingEditsAfterKeystroke;
10558 private getCompletions;
10559 private getCompletionEntryDetails;
10560 private getCompileOnSaveAffectedFileList;
10562 private getSignatureHelpItems;
10563 private toPendingErrorCheck;
10564 private getDiagnostics;
10568 private closeClientFile;
10569 private mapLocationNavigationBarItems;
10570 private getNavigationBarItems;
10571 private toLocationNavigationTree;
10572 private getNavigationTree;
10573 private getNavigateToItems;
10574 private getFullNavigateToItems;
10575 private getSupportedCodeFixes;
10576 private isLocation;
10577 private extractPositionOrRange;
10579 private getApplicableRefactors;
10580 private getEditsForRefactor;
10581 private organizeImports;
10582 private getEditsForFileRename;
10583 private getCodeFixes;
10584 private getCombinedCodeFix;
10585 private applyCodeActionCommand;
10586 private getStartAndEndPosition;
10587 private mapCodeAction;
10588 private mapCodeFixAction;
10589 private mapTextChangesToCodeEdits;
10590 private mapTextChangeToCodeEdit;
10591 private convertTextChangeToCodeEdit;
10592 private getBraceMatching;
10593 private getDiagnosticsForProject;
10594 private configurePlugin;
10595 private getSmartSelectionRange;
10596 private toggleLineComment;
10597 private toggleMultilineComment;
10598 private commentSelection;
10599 private uncommentSelection;
10600 private mapSelectionRange;
10601 private getScriptInfoFromProjectService;
10602 private toProtocolCallHierarchyItem;
10603 private toProtocolCallHierarchyIncomingCall;
10604 private toProtocolCallHierarchyOutgoingCall;
10605 private prepareCallHierarchy;
10606 private provideCallHierarchyIncomingCalls;
10607 private provideCallHierarchyOutgoingCalls;
10608 getCanonicalFileName(fileName: string): string;
10610 private notRequired;
10611 private requiredResponse;
10613 addProtocolHandler(command: string, handler: (request: protocol.Request) => HandlerResponse): void;
10614 private setCurrentRequest;
10615 private resetCurrentRequest;
10616 executeWithRequestId<T>(requestId: number, f: () => T): T;
10617 executeCommand(request: protocol.Request): HandlerResponse;
10618 onMessage(message: TMessage): void;
10619 protected parseMessage(message: TMessage): protocol.Request;
10620 protected toStringMessage(message: TMessage): string;
10621 private getFormatOptions;
10622 private getPreferences;
10623 private getHostFormatOptions;
10624 private getHostPreferences;
10626 interface HandlerResponse {
10628 responseRequired?: boolean;
10631 declare namespace ts {
10632 /** @deprecated Use `factory.createNodeArray` or the factory supplied by your transformation context instead. */
10633 const createNodeArray: <T extends Node>(elements?: readonly T[] | undefined, hasTrailingComma?: boolean | undefined) => NodeArray<T>;
10634 /** @deprecated Use `factory.createNumericLiteral` or the factory supplied by your transformation context instead. */
10635 const createNumericLiteral: (value: string | number, numericLiteralFlags?: TokenFlags | undefined) => NumericLiteral;
10636 /** @deprecated Use `factory.createBigIntLiteral` or the factory supplied by your transformation context instead. */
10637 const createBigIntLiteral: (value: string | PseudoBigInt) => BigIntLiteral;
10638 /** @deprecated Use `factory.createStringLiteral` or the factory supplied by your transformation context instead. */
10639 const createStringLiteral: {
10640 (text: string, isSingleQuote?: boolean | undefined): StringLiteral;
10641 (text: string, isSingleQuote?: boolean | undefined, hasExtendedUnicodeEscape?: boolean | undefined): StringLiteral;
10643 /** @deprecated Use `factory.createStringLiteralFromNode` or the factory supplied by your transformation context instead. */
10644 const createStringLiteralFromNode: (sourceNode: PropertyNameLiteral, isSingleQuote?: boolean | undefined) => StringLiteral;
10645 /** @deprecated Use `factory.createRegularExpressionLiteral` or the factory supplied by your transformation context instead. */
10646 const createRegularExpressionLiteral: (text: string) => RegularExpressionLiteral;
10647 /** @deprecated Use `factory.createLoopVariable` or the factory supplied by your transformation context instead. */
10648 const createLoopVariable: (reservedInNestedScopes?: boolean | undefined) => Identifier;
10649 /** @deprecated Use `factory.createUniqueName` or the factory supplied by your transformation context instead. */
10650 const createUniqueName: (text: string, flags?: GeneratedIdentifierFlags | undefined) => Identifier;
10651 /** @deprecated Use `factory.createPrivateIdentifier` or the factory supplied by your transformation context instead. */
10652 const createPrivateIdentifier: (text: string) => PrivateIdentifier;
10653 /** @deprecated Use `factory.createSuper` or the factory supplied by your transformation context instead. */
10654 const createSuper: () => SuperExpression;
10655 /** @deprecated Use `factory.createThis` or the factory supplied by your transformation context instead. */
10656 const createThis: () => ThisExpression;
10657 /** @deprecated Use `factory.createNull` or the factory supplied by your transformation context instead. */
10658 const createNull: () => NullLiteral;
10659 /** @deprecated Use `factory.createTrue` or the factory supplied by your transformation context instead. */
10660 const createTrue: () => TrueLiteral;
10661 /** @deprecated Use `factory.createFalse` or the factory supplied by your transformation context instead. */
10662 const createFalse: () => FalseLiteral;
10663 /** @deprecated Use `factory.createModifier` or the factory supplied by your transformation context instead. */
10664 const createModifier: <T extends ModifierSyntaxKind>(kind: T) => ModifierToken<T>;
10665 /** @deprecated Use `factory.createModifiersFromModifierFlags` or the factory supplied by your transformation context instead. */
10666 const createModifiersFromModifierFlags: (flags: ModifierFlags) => Modifier[];
10667 /** @deprecated Use `factory.createQualifiedName` or the factory supplied by your transformation context instead. */
10668 const createQualifiedName: (left: EntityName, right: string | Identifier) => QualifiedName;
10669 /** @deprecated Use `factory.updateQualifiedName` or the factory supplied by your transformation context instead. */
10670 const updateQualifiedName: (node: QualifiedName, left: EntityName, right: Identifier) => QualifiedName;
10671 /** @deprecated Use `factory.createComputedPropertyName` or the factory supplied by your transformation context instead. */
10672 const createComputedPropertyName: (expression: Expression) => ComputedPropertyName;
10673 /** @deprecated Use `factory.updateComputedPropertyName` or the factory supplied by your transformation context instead. */
10674 const updateComputedPropertyName: (node: ComputedPropertyName, expression: Expression) => ComputedPropertyName;
10675 /** @deprecated Use `factory.createTypeParameterDeclaration` or the factory supplied by your transformation context instead. */
10676 const createTypeParameterDeclaration: (name: string | Identifier, constraint?: TypeNode | undefined, defaultType?: TypeNode | undefined) => TypeParameterDeclaration;
10677 /** @deprecated Use `factory.updateTypeParameterDeclaration` or the factory supplied by your transformation context instead. */
10678 const updateTypeParameterDeclaration: (node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined) => TypeParameterDeclaration;
10679 /** @deprecated Use `factory.createParameterDeclaration` or the factory supplied by your transformation context instead. */
10680 const createParameter: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken?: QuestionToken | undefined, type?: TypeNode | undefined, initializer?: Expression | undefined) => ParameterDeclaration;
10681 /** @deprecated Use `factory.updateParameterDeclaration` or the factory supplied by your transformation context instead. */
10682 const updateParameter: (node: ParameterDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined) => ParameterDeclaration;
10683 /** @deprecated Use `factory.createDecorator` or the factory supplied by your transformation context instead. */
10684 const createDecorator: (expression: Expression) => Decorator;
10685 /** @deprecated Use `factory.updateDecorator` or the factory supplied by your transformation context instead. */
10686 const updateDecorator: (node: Decorator, expression: Expression) => Decorator;
10687 /** @deprecated Use `factory.createPropertyDeclaration` or the factory supplied by your transformation context instead. */
10688 const createProperty: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined) => PropertyDeclaration;
10689 /** @deprecated Use `factory.updatePropertyDeclaration` or the factory supplied by your transformation context instead. */
10690 const updateProperty: (node: PropertyDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined) => PropertyDeclaration;
10691 /** @deprecated Use `factory.createMethodDeclaration` or the factory supplied by your transformation context instead. */
10692 const createMethod: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => MethodDeclaration;
10693 /** @deprecated Use `factory.updateMethodDeclaration` or the factory supplied by your transformation context instead. */
10694 const updateMethod: (node: MethodDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => MethodDeclaration;
10695 /** @deprecated Use `factory.createConstructorDeclaration` or the factory supplied by your transformation context instead. */
10696 const createConstructor: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined) => ConstructorDeclaration;
10697 /** @deprecated Use `factory.updateConstructorDeclaration` or the factory supplied by your transformation context instead. */
10698 const updateConstructor: (node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined) => ConstructorDeclaration;
10699 /** @deprecated Use `factory.createGetAccessorDeclaration` or the factory supplied by your transformation context instead. */
10700 const createGetAccessor: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => GetAccessorDeclaration;
10701 /** @deprecated Use `factory.updateGetAccessorDeclaration` or the factory supplied by your transformation context instead. */
10702 const updateGetAccessor: (node: GetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => GetAccessorDeclaration;
10703 /** @deprecated Use `factory.createSetAccessorDeclaration` or the factory supplied by your transformation context instead. */
10704 const createSetAccessor: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined) => SetAccessorDeclaration;
10705 /** @deprecated Use `factory.updateSetAccessorDeclaration` or the factory supplied by your transformation context instead. */
10706 const updateSetAccessor: (node: SetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined) => SetAccessorDeclaration;
10707 /** @deprecated Use `factory.createCallSignature` or the factory supplied by your transformation context instead. */
10708 const createCallSignature: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined) => CallSignatureDeclaration;
10709 /** @deprecated Use `factory.updateCallSignature` or the factory supplied by your transformation context instead. */
10710 const updateCallSignature: (node: CallSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined) => CallSignatureDeclaration;
10711 /** @deprecated Use `factory.createConstructSignature` or the factory supplied by your transformation context instead. */
10712 const createConstructSignature: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined) => ConstructSignatureDeclaration;
10713 /** @deprecated Use `factory.updateConstructSignature` or the factory supplied by your transformation context instead. */
10714 const updateConstructSignature: (node: ConstructSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined) => ConstructSignatureDeclaration;
10715 /** @deprecated Use `factory.updateIndexSignature` or the factory supplied by your transformation context instead. */
10716 const updateIndexSignature: (node: IndexSignatureDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => IndexSignatureDeclaration;
10717 /** @deprecated Use `factory.createKeywordTypeNode` or the factory supplied by your transformation context instead. */
10718 const createKeywordTypeNode: <TKind extends KeywordTypeSyntaxKind>(kind: TKind) => KeywordTypeNode<TKind>;
10719 /** @deprecated Use `factory.createTypePredicateNode` or the factory supplied by your transformation context instead. */
10720 const createTypePredicateNodeWithModifier: (assertsModifier: AssertsKeyword | undefined, parameterName: string | Identifier | ThisTypeNode, type: TypeNode | undefined) => TypePredicateNode;
10721 /** @deprecated Use `factory.updateTypePredicateNode` or the factory supplied by your transformation context instead. */
10722 const updateTypePredicateNodeWithModifier: (node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined) => TypePredicateNode;
10723 /** @deprecated Use `factory.createTypeReferenceNode` or the factory supplied by your transformation context instead. */
10724 const createTypeReferenceNode: (typeName: string | EntityName, typeArguments?: readonly TypeNode[] | undefined) => TypeReferenceNode;
10725 /** @deprecated Use `factory.updateTypeReferenceNode` or the factory supplied by your transformation context instead. */
10726 const updateTypeReferenceNode: (node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray<TypeNode> | undefined) => TypeReferenceNode;
10727 /** @deprecated Use `factory.createFunctionTypeNode` or the factory supplied by your transformation context instead. */
10728 const createFunctionTypeNode: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => FunctionTypeNode;
10729 /** @deprecated Use `factory.updateFunctionTypeNode` or the factory supplied by your transformation context instead. */
10730 const updateFunctionTypeNode: (node: FunctionTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode) => FunctionTypeNode;
10731 /** @deprecated Use `factory.createConstructorTypeNode` or the factory supplied by your transformation context instead. */
10732 const createConstructorTypeNode: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => ConstructorTypeNode;
10733 /** @deprecated Use `factory.updateConstructorTypeNode` or the factory supplied by your transformation context instead. */
10734 const updateConstructorTypeNode: (node: ConstructorTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode) => ConstructorTypeNode;
10735 /** @deprecated Use `factory.createTypeQueryNode` or the factory supplied by your transformation context instead. */
10736 const createTypeQueryNode: (exprName: EntityName) => TypeQueryNode;
10737 /** @deprecated Use `factory.updateTypeQueryNode` or the factory supplied by your transformation context instead. */
10738 const updateTypeQueryNode: (node: TypeQueryNode, exprName: EntityName) => TypeQueryNode;
10739 /** @deprecated Use `factory.createTypeLiteralNode` or the factory supplied by your transformation context instead. */
10740 const createTypeLiteralNode: (members: readonly TypeElement[] | undefined) => TypeLiteralNode;
10741 /** @deprecated Use `factory.updateTypeLiteralNode` or the factory supplied by your transformation context instead. */
10742 const updateTypeLiteralNode: (node: TypeLiteralNode, members: NodeArray<TypeElement>) => TypeLiteralNode;
10743 /** @deprecated Use `factory.createArrayTypeNode` or the factory supplied by your transformation context instead. */
10744 const createArrayTypeNode: (elementType: TypeNode) => ArrayTypeNode;
10745 /** @deprecated Use `factory.updateArrayTypeNode` or the factory supplied by your transformation context instead. */
10746 const updateArrayTypeNode: (node: ArrayTypeNode, elementType: TypeNode) => ArrayTypeNode;
10747 /** @deprecated Use `factory.createTupleTypeNode` or the factory supplied by your transformation context instead. */
10748 const createTupleTypeNode: (elements: readonly (TypeNode | NamedTupleMember)[]) => TupleTypeNode;
10749 /** @deprecated Use `factory.updateTupleTypeNode` or the factory supplied by your transformation context instead. */
10750 const updateTupleTypeNode: (node: TupleTypeNode, elements: readonly (TypeNode | NamedTupleMember)[]) => TupleTypeNode;
10751 /** @deprecated Use `factory.createOptionalTypeNode` or the factory supplied by your transformation context instead. */
10752 const createOptionalTypeNode: (type: TypeNode) => OptionalTypeNode;
10753 /** @deprecated Use `factory.updateOptionalTypeNode` or the factory supplied by your transformation context instead. */
10754 const updateOptionalTypeNode: (node: OptionalTypeNode, type: TypeNode) => OptionalTypeNode;
10755 /** @deprecated Use `factory.createRestTypeNode` or the factory supplied by your transformation context instead. */
10756 const createRestTypeNode: (type: TypeNode) => RestTypeNode;
10757 /** @deprecated Use `factory.updateRestTypeNode` or the factory supplied by your transformation context instead. */
10758 const updateRestTypeNode: (node: RestTypeNode, type: TypeNode) => RestTypeNode;
10759 /** @deprecated Use `factory.createUnionTypeNode` or the factory supplied by your transformation context instead. */
10760 const createUnionTypeNode: (types: readonly TypeNode[]) => UnionTypeNode;
10761 /** @deprecated Use `factory.updateUnionTypeNode` or the factory supplied by your transformation context instead. */
10762 const updateUnionTypeNode: (node: UnionTypeNode, types: NodeArray<TypeNode>) => UnionTypeNode;
10763 /** @deprecated Use `factory.createIntersectionTypeNode` or the factory supplied by your transformation context instead. */
10764 const createIntersectionTypeNode: (types: readonly TypeNode[]) => IntersectionTypeNode;
10765 /** @deprecated Use `factory.updateIntersectionTypeNode` or the factory supplied by your transformation context instead. */
10766 const updateIntersectionTypeNode: (node: IntersectionTypeNode, types: NodeArray<TypeNode>) => IntersectionTypeNode;
10767 /** @deprecated Use `factory.createConditionalTypeNode` or the factory supplied by your transformation context instead. */
10768 const createConditionalTypeNode: (checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode) => ConditionalTypeNode;
10769 /** @deprecated Use `factory.updateConditionalTypeNode` or the factory supplied by your transformation context instead. */
10770 const updateConditionalTypeNode: (node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode) => ConditionalTypeNode;
10771 /** @deprecated Use `factory.createInferTypeNode` or the factory supplied by your transformation context instead. */
10772 const createInferTypeNode: (typeParameter: TypeParameterDeclaration) => InferTypeNode;
10773 /** @deprecated Use `factory.updateInferTypeNode` or the factory supplied by your transformation context instead. */
10774 const updateInferTypeNode: (node: InferTypeNode, typeParameter: TypeParameterDeclaration) => InferTypeNode;
10775 /** @deprecated Use `factory.createImportTypeNode` or the factory supplied by your transformation context instead. */
10776 const createImportTypeNode: (argument: TypeNode, qualifier?: EntityName | undefined, typeArguments?: readonly TypeNode[] | undefined, isTypeOf?: boolean | undefined) => ImportTypeNode;
10777 /** @deprecated Use `factory.updateImportTypeNode` or the factory supplied by your transformation context instead. */
10778 const updateImportTypeNode: (node: ImportTypeNode, argument: TypeNode, qualifier: EntityName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf?: boolean | undefined) => ImportTypeNode;
10779 /** @deprecated Use `factory.createParenthesizedType` or the factory supplied by your transformation context instead. */
10780 const createParenthesizedType: (type: TypeNode) => ParenthesizedTypeNode;
10781 /** @deprecated Use `factory.updateParenthesizedType` or the factory supplied by your transformation context instead. */
10782 const updateParenthesizedType: (node: ParenthesizedTypeNode, type: TypeNode) => ParenthesizedTypeNode;
10783 /** @deprecated Use `factory.createThisTypeNode` or the factory supplied by your transformation context instead. */
10784 const createThisTypeNode: () => ThisTypeNode;
10785 /** @deprecated Use `factory.updateTypeOperatorNode` or the factory supplied by your transformation context instead. */
10786 const updateTypeOperatorNode: (node: TypeOperatorNode, type: TypeNode) => TypeOperatorNode;
10787 /** @deprecated Use `factory.createIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */
10788 const createIndexedAccessTypeNode: (objectType: TypeNode, indexType: TypeNode) => IndexedAccessTypeNode;
10789 /** @deprecated Use `factory.updateIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */
10790 const updateIndexedAccessTypeNode: (node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode) => IndexedAccessTypeNode;
10791 /** @deprecated Use `factory.createMappedTypeNode` or the factory supplied by your transformation context instead. */
10792 const createMappedTypeNode: (readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined, members: NodeArray<TypeElement> | undefined) => MappedTypeNode;
10793 /** @deprecated Use `factory.updateMappedTypeNode` or the factory supplied by your transformation context instead. */
10794 const updateMappedTypeNode: (node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined, members: NodeArray<TypeElement> | undefined) => MappedTypeNode;
10795 /** @deprecated Use `factory.createLiteralTypeNode` or the factory supplied by your transformation context instead. */
10796 const createLiteralTypeNode: (literal: LiteralExpression | BooleanLiteral | PrefixUnaryExpression | NullLiteral) => LiteralTypeNode;
10797 /** @deprecated Use `factory.updateLiteralTypeNode` or the factory supplied by your transformation context instead. */
10798 const updateLiteralTypeNode: (node: LiteralTypeNode, literal: LiteralExpression | BooleanLiteral | PrefixUnaryExpression | NullLiteral) => LiteralTypeNode;
10799 /** @deprecated Use `factory.createObjectBindingPattern` or the factory supplied by your transformation context instead. */
10800 const createObjectBindingPattern: (elements: readonly BindingElement[]) => ObjectBindingPattern;
10801 /** @deprecated Use `factory.updateObjectBindingPattern` or the factory supplied by your transformation context instead. */
10802 const updateObjectBindingPattern: (node: ObjectBindingPattern, elements: readonly BindingElement[]) => ObjectBindingPattern;
10803 /** @deprecated Use `factory.createArrayBindingPattern` or the factory supplied by your transformation context instead. */
10804 const createArrayBindingPattern: (elements: readonly ArrayBindingElement[]) => ArrayBindingPattern;
10805 /** @deprecated Use `factory.updateArrayBindingPattern` or the factory supplied by your transformation context instead. */
10806 const updateArrayBindingPattern: (node: ArrayBindingPattern, elements: readonly ArrayBindingElement[]) => ArrayBindingPattern;
10807 /** @deprecated Use `factory.createBindingElement` or the factory supplied by your transformation context instead. */
10808 const createBindingElement: (dotDotDotToken: DotDotDotToken | undefined, propertyName: string | PropertyName | undefined, name: string | BindingName, initializer?: Expression | undefined) => BindingElement;
10809 /** @deprecated Use `factory.updateBindingElement` or the factory supplied by your transformation context instead. */
10810 const updateBindingElement: (node: BindingElement, dotDotDotToken: DotDotDotToken | undefined, propertyName: PropertyName | undefined, name: BindingName, initializer: Expression | undefined) => BindingElement;
10811 /** @deprecated Use `factory.createArrayLiteralExpression` or the factory supplied by your transformation context instead. */
10812 const createArrayLiteral: (elements?: readonly Expression[] | undefined, multiLine?: boolean | undefined) => ArrayLiteralExpression;
10813 /** @deprecated Use `factory.updateArrayLiteralExpression` or the factory supplied by your transformation context instead. */
10814 const updateArrayLiteral: (node: ArrayLiteralExpression, elements: readonly Expression[]) => ArrayLiteralExpression;
10815 /** @deprecated Use `factory.createObjectLiteralExpression` or the factory supplied by your transformation context instead. */
10816 const createObjectLiteral: (properties?: readonly ObjectLiteralElementLike[] | undefined, multiLine?: boolean | undefined) => ObjectLiteralExpression;
10817 /** @deprecated Use `factory.updateObjectLiteralExpression` or the factory supplied by your transformation context instead. */
10818 const updateObjectLiteral: (node: ObjectLiteralExpression, properties: readonly ObjectLiteralElementLike[]) => ObjectLiteralExpression;
10819 /** @deprecated Use `factory.createPropertyAccessExpression` or the factory supplied by your transformation context instead. */
10820 const createPropertyAccess: (expression: Expression, name: string | MemberName) => PropertyAccessExpression;
10821 /** @deprecated Use `factory.updatePropertyAccessExpression` or the factory supplied by your transformation context instead. */
10822 const updatePropertyAccess: (node: PropertyAccessExpression, expression: Expression, name: MemberName) => PropertyAccessExpression;
10823 /** @deprecated Use `factory.createPropertyAccessChain` or the factory supplied by your transformation context instead. */
10824 const createPropertyAccessChain: (expression: Expression, questionDotToken: QuestionDotToken | undefined, name: string | MemberName) => PropertyAccessChain;
10825 /** @deprecated Use `factory.updatePropertyAccessChain` or the factory supplied by your transformation context instead. */
10826 const updatePropertyAccessChain: (node: PropertyAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, name: MemberName) => PropertyAccessChain;
10827 /** @deprecated Use `factory.createElementAccessExpression` or the factory supplied by your transformation context instead. */
10828 const createElementAccess: (expression: Expression, index: number | Expression) => ElementAccessExpression;
10829 /** @deprecated Use `factory.updateElementAccessExpression` or the factory supplied by your transformation context instead. */
10830 const updateElementAccess: (node: ElementAccessExpression, expression: Expression, argumentExpression: Expression) => ElementAccessExpression;
10831 /** @deprecated Use `factory.createElementAccessChain` or the factory supplied by your transformation context instead. */
10832 const createElementAccessChain: (expression: Expression, questionDotToken: QuestionDotToken | undefined, index: number | Expression) => ElementAccessChain;
10833 /** @deprecated Use `factory.updateElementAccessChain` or the factory supplied by your transformation context instead. */
10834 const updateElementAccessChain: (node: ElementAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, argumentExpression: Expression) => ElementAccessChain;
10835 /** @deprecated Use `factory.createCallExpression` or the factory supplied by your transformation context instead. */
10836 const createCall: (expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => CallExpression;
10837 /** @deprecated Use `factory.updateCallExpression` or the factory supplied by your transformation context instead. */
10838 const updateCall: (node: CallExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]) => CallExpression;
10839 /** @deprecated Use `factory.createCallChain` or the factory supplied by your transformation context instead. */
10840 const createCallChain: (expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => CallChain;
10841 /** @deprecated Use `factory.updateCallChain` or the factory supplied by your transformation context instead. */
10842 const updateCallChain: (node: CallChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]) => CallChain;
10843 /** @deprecated Use `factory.createNewExpression` or the factory supplied by your transformation context instead. */
10844 const createNew: (expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => NewExpression;
10845 /** @deprecated Use `factory.updateNewExpression` or the factory supplied by your transformation context instead. */
10846 const updateNew: (node: NewExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => NewExpression;
10847 /** @deprecated Use `factory.createTypeAssertion` or the factory supplied by your transformation context instead. */
10848 const createTypeAssertion: (type: TypeNode, expression: Expression) => TypeAssertion;
10849 /** @deprecated Use `factory.updateTypeAssertion` or the factory supplied by your transformation context instead. */
10850 const updateTypeAssertion: (node: TypeAssertion, type: TypeNode, expression: Expression) => TypeAssertion;
10851 /** @deprecated Use `factory.createParenthesizedExpression` or the factory supplied by your transformation context instead. */
10852 const createParen: (expression: Expression) => ParenthesizedExpression;
10853 /** @deprecated Use `factory.updateParenthesizedExpression` or the factory supplied by your transformation context instead. */
10854 const updateParen: (node: ParenthesizedExpression, expression: Expression) => ParenthesizedExpression;
10855 /** @deprecated Use `factory.createFunctionExpression` or the factory supplied by your transformation context instead. */
10856 const createFunctionExpression: (modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[] | undefined, type: TypeNode | undefined, body: Block) => FunctionExpression;
10857 /** @deprecated Use `factory.updateFunctionExpression` or the factory supplied by your transformation context instead. */
10858 const updateFunctionExpression: (node: FunctionExpression, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block) => FunctionExpression;
10859 /** @deprecated Use `factory.createDeleteExpression` or the factory supplied by your transformation context instead. */
10860 const createDelete: (expression: Expression) => DeleteExpression;
10861 /** @deprecated Use `factory.updateDeleteExpression` or the factory supplied by your transformation context instead. */
10862 const updateDelete: (node: DeleteExpression, expression: Expression) => DeleteExpression;
10863 /** @deprecated Use `factory.createTypeOfExpression` or the factory supplied by your transformation context instead. */
10864 const createTypeOf: (expression: Expression) => TypeOfExpression;
10865 /** @deprecated Use `factory.updateTypeOfExpression` or the factory supplied by your transformation context instead. */
10866 const updateTypeOf: (node: TypeOfExpression, expression: Expression) => TypeOfExpression;
10867 /** @deprecated Use `factory.createVoidExpression` or the factory supplied by your transformation context instead. */
10868 const createVoid: (expression: Expression) => VoidExpression;
10869 /** @deprecated Use `factory.updateVoidExpression` or the factory supplied by your transformation context instead. */
10870 const updateVoid: (node: VoidExpression, expression: Expression) => VoidExpression;
10871 /** @deprecated Use `factory.createAwaitExpression` or the factory supplied by your transformation context instead. */
10872 const createAwait: (expression: Expression) => AwaitExpression;
10873 /** @deprecated Use `factory.updateAwaitExpression` or the factory supplied by your transformation context instead. */
10874 const updateAwait: (node: AwaitExpression, expression: Expression) => AwaitExpression;
10875 /** @deprecated Use `factory.createPrefixExpression` or the factory supplied by your transformation context instead. */
10876 const createPrefix: (operator: PrefixUnaryOperator, operand: Expression) => PrefixUnaryExpression;
10877 /** @deprecated Use `factory.updatePrefixExpression` or the factory supplied by your transformation context instead. */
10878 const updatePrefix: (node: PrefixUnaryExpression, operand: Expression) => PrefixUnaryExpression;
10879 /** @deprecated Use `factory.createPostfixUnaryExpression` or the factory supplied by your transformation context instead. */
10880 const createPostfix: (operand: Expression, operator: PostfixUnaryOperator) => PostfixUnaryExpression;
10881 /** @deprecated Use `factory.updatePostfixUnaryExpression` or the factory supplied by your transformation context instead. */
10882 const updatePostfix: (node: PostfixUnaryExpression, operand: Expression) => PostfixUnaryExpression;
10883 /** @deprecated Use `factory.createBinaryExpression` or the factory supplied by your transformation context instead. */
10884 const createBinary: (left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression) => BinaryExpression;
10885 /** @deprecated Use `factory.updateConditionalExpression` or the factory supplied by your transformation context instead. */
10886 const updateConditional: (node: ConditionalExpression, condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression) => ConditionalExpression;
10887 /** @deprecated Use `factory.createTemplateExpression` or the factory supplied by your transformation context instead. */
10888 const createTemplateExpression: (head: TemplateHead, templateSpans: readonly TemplateSpan[]) => TemplateExpression;
10889 /** @deprecated Use `factory.updateTemplateExpression` or the factory supplied by your transformation context instead. */
10890 const updateTemplateExpression: (node: TemplateExpression, head: TemplateHead, templateSpans: readonly TemplateSpan[]) => TemplateExpression;
10891 /** @deprecated Use `factory.createTemplateHead` or the factory supplied by your transformation context instead. */
10892 const createTemplateHead: {
10893 (text: string, rawText?: string | undefined, templateFlags?: TokenFlags | undefined): TemplateHead;
10894 (text: string | undefined, rawText: string, templateFlags?: TokenFlags | undefined): TemplateHead;
10896 /** @deprecated Use `factory.createTemplateMiddle` or the factory supplied by your transformation context instead. */
10897 const createTemplateMiddle: {
10898 (text: string, rawText?: string | undefined, templateFlags?: TokenFlags | undefined): TemplateMiddle;
10899 (text: string | undefined, rawText: string, templateFlags?: TokenFlags | undefined): TemplateMiddle;
10901 /** @deprecated Use `factory.createTemplateTail` or the factory supplied by your transformation context instead. */
10902 const createTemplateTail: {
10903 (text: string, rawText?: string | undefined, templateFlags?: TokenFlags | undefined): TemplateTail;
10904 (text: string | undefined, rawText: string, templateFlags?: TokenFlags | undefined): TemplateTail;
10906 /** @deprecated Use `factory.createNoSubstitutionTemplateLiteral` or the factory supplied by your transformation context instead. */
10907 const createNoSubstitutionTemplateLiteral: {
10908 (text: string, rawText?: string | undefined): NoSubstitutionTemplateLiteral;
10909 (text: string | undefined, rawText: string): NoSubstitutionTemplateLiteral;
10911 /** @deprecated Use `factory.updateYieldExpression` or the factory supplied by your transformation context instead. */
10912 const updateYield: (node: YieldExpression, asteriskToken: AsteriskToken | undefined, expression: Expression | undefined) => YieldExpression;
10913 /** @deprecated Use `factory.createSpreadExpression` or the factory supplied by your transformation context instead. */
10914 const createSpread: (expression: Expression) => SpreadElement;
10915 /** @deprecated Use `factory.updateSpreadExpression` or the factory supplied by your transformation context instead. */
10916 const updateSpread: (node: SpreadElement, expression: Expression) => SpreadElement;
10917 /** @deprecated Use `factory.createOmittedExpression` or the factory supplied by your transformation context instead. */
10918 const createOmittedExpression: () => OmittedExpression;
10919 /** @deprecated Use `factory.createAsExpression` or the factory supplied by your transformation context instead. */
10920 const createAsExpression: (expression: Expression, type: TypeNode) => AsExpression;
10921 /** @deprecated Use `factory.updateAsExpression` or the factory supplied by your transformation context instead. */
10922 const updateAsExpression: (node: AsExpression, expression: Expression, type: TypeNode) => AsExpression;
10923 /** @deprecated Use `factory.createNonNullExpression` or the factory supplied by your transformation context instead. */
10924 const createNonNullExpression: (expression: Expression) => NonNullExpression;
10925 /** @deprecated Use `factory.updateNonNullExpression` or the factory supplied by your transformation context instead. */
10926 const updateNonNullExpression: (node: NonNullExpression, expression: Expression) => NonNullExpression;
10927 /** @deprecated Use `factory.createNonNullChain` or the factory supplied by your transformation context instead. */
10928 const createNonNullChain: (expression: Expression) => NonNullChain;
10929 /** @deprecated Use `factory.updateNonNullChain` or the factory supplied by your transformation context instead. */
10930 const updateNonNullChain: (node: NonNullChain, expression: Expression) => NonNullChain;
10931 /** @deprecated Use `factory.createMetaProperty` or the factory supplied by your transformation context instead. */
10932 const createMetaProperty: (keywordToken: SyntaxKind.ImportKeyword | SyntaxKind.NewKeyword, name: Identifier) => MetaProperty;
10933 /** @deprecated Use `factory.updateMetaProperty` or the factory supplied by your transformation context instead. */
10934 const updateMetaProperty: (node: MetaProperty, name: Identifier) => MetaProperty;
10935 /** @deprecated Use `factory.createTemplateSpan` or the factory supplied by your transformation context instead. */
10936 const createTemplateSpan: (expression: Expression, literal: TemplateMiddle | TemplateTail) => TemplateSpan;
10937 /** @deprecated Use `factory.updateTemplateSpan` or the factory supplied by your transformation context instead. */
10938 const updateTemplateSpan: (node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail) => TemplateSpan;
10939 /** @deprecated Use `factory.createSemicolonClassElement` or the factory supplied by your transformation context instead. */
10940 const createSemicolonClassElement: () => SemicolonClassElement;
10941 /** @deprecated Use `factory.createBlock` or the factory supplied by your transformation context instead. */
10942 const createBlock: (statements: readonly Statement[], multiLine?: boolean | undefined) => Block;
10943 /** @deprecated Use `factory.updateBlock` or the factory supplied by your transformation context instead. */
10944 const updateBlock: (node: Block, statements: readonly Statement[]) => Block;
10945 /** @deprecated Use `factory.createVariableStatement` or the factory supplied by your transformation context instead. */
10946 const createVariableStatement: (modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList | readonly VariableDeclaration[]) => VariableStatement;
10947 /** @deprecated Use `factory.updateVariableStatement` or the factory supplied by your transformation context instead. */
10948 const updateVariableStatement: (node: VariableStatement, modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList) => VariableStatement;
10949 /** @deprecated Use `factory.createEmptyStatement` or the factory supplied by your transformation context instead. */
10950 const createEmptyStatement: () => EmptyStatement;
10951 /** @deprecated Use `factory.createExpressionStatement` or the factory supplied by your transformation context instead. */
10952 const createExpressionStatement: (expression: Expression) => ExpressionStatement;
10953 /** @deprecated Use `factory.updateExpressionStatement` or the factory supplied by your transformation context instead. */
10954 const updateExpressionStatement: (node: ExpressionStatement, expression: Expression) => ExpressionStatement;
10955 /** @deprecated Use `factory.createExpressionStatement` or the factory supplied by your transformation context instead. */
10956 const createStatement: (expression: Expression) => ExpressionStatement;
10957 /** @deprecated Use `factory.updateExpressionStatement` or the factory supplied by your transformation context instead. */
10958 const updateStatement: (node: ExpressionStatement, expression: Expression) => ExpressionStatement;
10959 /** @deprecated Use `factory.createIfStatement` or the factory supplied by your transformation context instead. */
10960 const createIf: (expression: Expression, thenStatement: Statement, elseStatement?: Statement | undefined) => IfStatement;
10961 /** @deprecated Use `factory.updateIfStatement` or the factory supplied by your transformation context instead. */
10962 const updateIf: (node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement | undefined) => IfStatement;
10963 /** @deprecated Use `factory.createDoStatement` or the factory supplied by your transformation context instead. */
10964 const createDo: (statement: Statement, expression: Expression) => DoStatement;
10965 /** @deprecated Use `factory.updateDoStatement` or the factory supplied by your transformation context instead. */
10966 const updateDo: (node: DoStatement, statement: Statement, expression: Expression) => DoStatement;
10967 /** @deprecated Use `factory.createWhileStatement` or the factory supplied by your transformation context instead. */
10968 const createWhile: (expression: Expression, statement: Statement) => WhileStatement;
10969 /** @deprecated Use `factory.updateWhileStatement` or the factory supplied by your transformation context instead. */
10970 const updateWhile: (node: WhileStatement, expression: Expression, statement: Statement) => WhileStatement;
10971 /** @deprecated Use `factory.createForStatement` or the factory supplied by your transformation context instead. */
10972 const createFor: (initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement) => ForStatement;
10973 /** @deprecated Use `factory.updateForStatement` or the factory supplied by your transformation context instead. */
10974 const updateFor: (node: ForStatement, initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement) => ForStatement;
10975 /** @deprecated Use `factory.createForInStatement` or the factory supplied by your transformation context instead. */
10976 const createForIn: (initializer: ForInitializer, expression: Expression, statement: Statement) => ForInStatement;
10977 /** @deprecated Use `factory.updateForInStatement` or the factory supplied by your transformation context instead. */
10978 const updateForIn: (node: ForInStatement, initializer: ForInitializer, expression: Expression, statement: Statement) => ForInStatement;
10979 /** @deprecated Use `factory.createForOfStatement` or the factory supplied by your transformation context instead. */
10980 const createForOf: (awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement) => ForOfStatement;
10981 /** @deprecated Use `factory.updateForOfStatement` or the factory supplied by your transformation context instead. */
10982 const updateForOf: (node: ForOfStatement, awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement) => ForOfStatement;
10983 /** @deprecated Use `factory.createContinueStatement` or the factory supplied by your transformation context instead. */
10984 const createContinue: (label?: string | Identifier | undefined) => ContinueStatement;
10985 /** @deprecated Use `factory.updateContinueStatement` or the factory supplied by your transformation context instead. */
10986 const updateContinue: (node: ContinueStatement, label: Identifier | undefined) => ContinueStatement;
10987 /** @deprecated Use `factory.createBreakStatement` or the factory supplied by your transformation context instead. */
10988 const createBreak: (label?: string | Identifier | undefined) => BreakStatement;
10989 /** @deprecated Use `factory.updateBreakStatement` or the factory supplied by your transformation context instead. */
10990 const updateBreak: (node: BreakStatement, label: Identifier | undefined) => BreakStatement;
10991 /** @deprecated Use `factory.createReturnStatement` or the factory supplied by your transformation context instead. */
10992 const createReturn: (expression?: Expression | undefined) => ReturnStatement;
10993 /** @deprecated Use `factory.updateReturnStatement` or the factory supplied by your transformation context instead. */
10994 const updateReturn: (node: ReturnStatement, expression: Expression | undefined) => ReturnStatement;
10995 /** @deprecated Use `factory.createWithStatement` or the factory supplied by your transformation context instead. */
10996 const createWith: (expression: Expression, statement: Statement) => WithStatement;
10997 /** @deprecated Use `factory.updateWithStatement` or the factory supplied by your transformation context instead. */
10998 const updateWith: (node: WithStatement, expression: Expression, statement: Statement) => WithStatement;
10999 /** @deprecated Use `factory.createSwitchStatement` or the factory supplied by your transformation context instead. */
11000 const createSwitch: (expression: Expression, caseBlock: CaseBlock) => SwitchStatement;
11001 /** @deprecated Use `factory.updateSwitchStatement` or the factory supplied by your transformation context instead. */
11002 const updateSwitch: (node: SwitchStatement, expression: Expression, caseBlock: CaseBlock) => SwitchStatement;
11003 /** @deprecated Use `factory.createLabelStatement` or the factory supplied by your transformation context instead. */
11004 const createLabel: (label: string | Identifier, statement: Statement) => LabeledStatement;
11005 /** @deprecated Use `factory.updateLabelStatement` or the factory supplied by your transformation context instead. */
11006 const updateLabel: (node: LabeledStatement, label: Identifier, statement: Statement) => LabeledStatement;
11007 /** @deprecated Use `factory.createThrowStatement` or the factory supplied by your transformation context instead. */
11008 const createThrow: (expression: Expression) => ThrowStatement;
11009 /** @deprecated Use `factory.updateThrowStatement` or the factory supplied by your transformation context instead. */
11010 const updateThrow: (node: ThrowStatement, expression: Expression) => ThrowStatement;
11011 /** @deprecated Use `factory.createTryStatement` or the factory supplied by your transformation context instead. */
11012 const createTry: (tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined) => TryStatement;
11013 /** @deprecated Use `factory.updateTryStatement` or the factory supplied by your transformation context instead. */
11014 const updateTry: (node: TryStatement, tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined) => TryStatement;
11015 /** @deprecated Use `factory.createDebuggerStatement` or the factory supplied by your transformation context instead. */
11016 const createDebuggerStatement: () => DebuggerStatement;
11017 /** @deprecated Use `factory.createVariableDeclarationList` or the factory supplied by your transformation context instead. */
11018 const createVariableDeclarationList: (declarations: readonly VariableDeclaration[], flags?: NodeFlags | undefined) => VariableDeclarationList;
11019 /** @deprecated Use `factory.updateVariableDeclarationList` or the factory supplied by your transformation context instead. */
11020 const updateVariableDeclarationList: (node: VariableDeclarationList, declarations: readonly VariableDeclaration[]) => VariableDeclarationList;
11021 /** @deprecated Use `factory.createFunctionDeclaration` or the factory supplied by your transformation context instead. */
11022 const createFunctionDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => FunctionDeclaration;
11023 /** @deprecated Use `factory.updateFunctionDeclaration` or the factory supplied by your transformation context instead. */
11024 const updateFunctionDeclaration: (node: FunctionDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => FunctionDeclaration;
11025 /** @deprecated Use `factory.createClassDeclaration` or the factory supplied by your transformation context instead. */
11026 const createClassDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassDeclaration;
11027 /** @deprecated Use `factory.updateClassDeclaration` or the factory supplied by your transformation context instead. */
11028 const updateClassDeclaration: (node: ClassDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassDeclaration;
11029 /** @deprecated Use `factory.createInterfaceDeclaration` or the factory supplied by your transformation context instead. */
11030 const createInterfaceDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]) => InterfaceDeclaration;
11031 /** @deprecated Use `factory.updateInterfaceDeclaration` or the factory supplied by your transformation context instead. */
11032 const updateInterfaceDeclaration: (node: InterfaceDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]) => InterfaceDeclaration;
11033 /** @deprecated Use `factory.createTypeAliasDeclaration` or the factory supplied by your transformation context instead. */
11034 const createTypeAliasDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode) => TypeAliasDeclaration;
11035 /** @deprecated Use `factory.updateTypeAliasDeclaration` or the factory supplied by your transformation context instead. */
11036 const updateTypeAliasDeclaration: (node: TypeAliasDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode) => TypeAliasDeclaration;
11037 /** @deprecated Use `factory.createEnumDeclaration` or the factory supplied by your transformation context instead. */
11038 const createEnumDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]) => EnumDeclaration;
11039 /** @deprecated Use `factory.updateEnumDeclaration` or the factory supplied by your transformation context instead. */
11040 const updateEnumDeclaration: (node: EnumDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]) => EnumDeclaration;
11041 /** @deprecated Use `factory.createModuleDeclaration` or the factory supplied by your transformation context instead. */
11042 const createModuleDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags | undefined) => ModuleDeclaration;
11043 /** @deprecated Use `factory.updateModuleDeclaration` or the factory supplied by your transformation context instead. */
11044 const updateModuleDeclaration: (node: ModuleDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined) => ModuleDeclaration;
11045 /** @deprecated Use `factory.createModuleBlock` or the factory supplied by your transformation context instead. */
11046 const createModuleBlock: (statements: readonly Statement[]) => ModuleBlock;
11047 /** @deprecated Use `factory.updateModuleBlock` or the factory supplied by your transformation context instead. */
11048 const updateModuleBlock: (node: ModuleBlock, statements: readonly Statement[]) => ModuleBlock;
11049 /** @deprecated Use `factory.createCaseBlock` or the factory supplied by your transformation context instead. */
11050 const createCaseBlock: (clauses: readonly CaseOrDefaultClause[]) => CaseBlock;
11051 /** @deprecated Use `factory.updateCaseBlock` or the factory supplied by your transformation context instead. */
11052 const updateCaseBlock: (node: CaseBlock, clauses: readonly CaseOrDefaultClause[]) => CaseBlock;
11053 /** @deprecated Use `factory.createNamespaceExportDeclaration` or the factory supplied by your transformation context instead. */
11054 const createNamespaceExportDeclaration: (name: string | Identifier) => NamespaceExportDeclaration;
11055 /** @deprecated Use `factory.updateNamespaceExportDeclaration` or the factory supplied by your transformation context instead. */
11056 const updateNamespaceExportDeclaration: (node: NamespaceExportDeclaration, name: Identifier) => NamespaceExportDeclaration;
11057 /** @deprecated Use `factory.createImportEqualsDeclaration` or the factory supplied by your transformation context instead. */
11058 const createImportEqualsDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference) => ImportEqualsDeclaration;
11059 /** @deprecated Use `factory.updateImportEqualsDeclaration` or the factory supplied by your transformation context instead. */
11060 const updateImportEqualsDeclaration: (node: ImportEqualsDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference) => ImportEqualsDeclaration;
11061 /** @deprecated Use `factory.createImportDeclaration` or the factory supplied by your transformation context instead. */
11062 const createImportDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause?: AssertClause | undefined) => ImportDeclaration;
11063 /** @deprecated Use `factory.updateImportDeclaration` or the factory supplied by your transformation context instead. */
11064 const updateImportDeclaration: (node: ImportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined) => ImportDeclaration;
11065 /** @deprecated Use `factory.createNamespaceImport` or the factory supplied by your transformation context instead. */
11066 const createNamespaceImport: (name: Identifier) => NamespaceImport;
11067 /** @deprecated Use `factory.updateNamespaceImport` or the factory supplied by your transformation context instead. */
11068 const updateNamespaceImport: (node: NamespaceImport, name: Identifier) => NamespaceImport;
11069 /** @deprecated Use `factory.createNamedImports` or the factory supplied by your transformation context instead. */
11070 const createNamedImports: (elements: readonly ImportSpecifier[]) => NamedImports;
11071 /** @deprecated Use `factory.updateNamedImports` or the factory supplied by your transformation context instead. */
11072 const updateNamedImports: (node: NamedImports, elements: readonly ImportSpecifier[]) => NamedImports;
11073 /** @deprecated Use `factory.createImportSpecifier` or the factory supplied by your transformation context instead. */
11074 const createImportSpecifier: (isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier) => ImportSpecifier;
11075 /** @deprecated Use `factory.updateImportSpecifier` or the factory supplied by your transformation context instead. */
11076 const updateImportSpecifier: (node: ImportSpecifier, isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier) => ImportSpecifier;
11077 /** @deprecated Use `factory.createExportAssignment` or the factory supplied by your transformation context instead. */
11078 const createExportAssignment: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isExportEquals: boolean | undefined, expression: Expression) => ExportAssignment;
11079 /** @deprecated Use `factory.updateExportAssignment` or the factory supplied by your transformation context instead. */
11080 const updateExportAssignment: (node: ExportAssignment, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, expression: Expression) => ExportAssignment;
11081 /** @deprecated Use `factory.createNamedExports` or the factory supplied by your transformation context instead. */
11082 const createNamedExports: (elements: readonly ExportSpecifier[]) => NamedExports;
11083 /** @deprecated Use `factory.updateNamedExports` or the factory supplied by your transformation context instead. */
11084 const updateNamedExports: (node: NamedExports, elements: readonly ExportSpecifier[]) => NamedExports;
11085 /** @deprecated Use `factory.createExportSpecifier` or the factory supplied by your transformation context instead. */
11086 const createExportSpecifier: (isTypeOnly: boolean, propertyName: string | Identifier | undefined, name: string | Identifier) => ExportSpecifier;
11087 /** @deprecated Use `factory.updateExportSpecifier` or the factory supplied by your transformation context instead. */
11088 const updateExportSpecifier: (node: ExportSpecifier, isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier) => ExportSpecifier;
11089 /** @deprecated Use `factory.createExternalModuleReference` or the factory supplied by your transformation context instead. */
11090 const createExternalModuleReference: (expression: Expression) => ExternalModuleReference;
11091 /** @deprecated Use `factory.updateExternalModuleReference` or the factory supplied by your transformation context instead. */
11092 const updateExternalModuleReference: (node: ExternalModuleReference, expression: Expression) => ExternalModuleReference;
11093 /** @deprecated Use `factory.createJSDocTypeExpression` or the factory supplied by your transformation context instead. */
11094 const createJSDocTypeExpression: (type: TypeNode) => JSDocTypeExpression;
11095 /** @deprecated Use `factory.createJSDocTypeTag` or the factory supplied by your transformation context instead. */
11096 const createJSDocTypeTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocTypeTag;
11097 /** @deprecated Use `factory.createJSDocReturnTag` or the factory supplied by your transformation context instead. */
11098 const createJSDocReturnTag: (tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocReturnTag;
11099 /** @deprecated Use `factory.createJSDocThisTag` or the factory supplied by your transformation context instead. */
11100 const createJSDocThisTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocThisTag;
11101 /** @deprecated Use `factory.createJSDocComment` or the factory supplied by your transformation context instead. */
11102 const createJSDocComment: (comment?: string | NodeArray<JSDocComment> | undefined, tags?: readonly JSDocTag[] | undefined) => JSDoc;
11103 /** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */
11104 const createJSDocParameterTag: (tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, isNameFirst?: boolean | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocParameterTag;
11105 /** @deprecated Use `factory.createJSDocClassTag` or the factory supplied by your transformation context instead. */
11106 const createJSDocClassTag: (tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocClassTag;
11107 /** @deprecated Use `factory.createJSDocAugmentsTag` or the factory supplied by your transformation context instead. */
11108 const createJSDocAugmentsTag: (tagName: Identifier | undefined, className: ExpressionWithTypeArguments & {
11109 readonly expression: Identifier | PropertyAccessEntityNameExpression;
11110 }, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocAugmentsTag;
11111 /** @deprecated Use `factory.createJSDocEnumTag` or the factory supplied by your transformation context instead. */
11112 const createJSDocEnumTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocEnumTag;
11113 /** @deprecated Use `factory.createJSDocTemplateTag` or the factory supplied by your transformation context instead. */
11114 const createJSDocTemplateTag: (tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment?: string | NodeArray<JSDocComment> | undefined) => JSDocTemplateTag;
11115 /** @deprecated Use `factory.createJSDocTypedefTag` or the factory supplied by your transformation context instead. */
11116 const createJSDocTypedefTag: (tagName: Identifier | undefined, typeExpression?: JSDocTypeLiteral | JSDocTypeExpression | undefined, fullName?: Identifier | JSDocNamespaceDeclaration | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocTypedefTag;
11117 /** @deprecated Use `factory.createJSDocCallbackTag` or the factory supplied by your transformation context instead. */
11118 const createJSDocCallbackTag: (tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName?: Identifier | JSDocNamespaceDeclaration | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocCallbackTag;
11119 /** @deprecated Use `factory.createJSDocSignature` or the factory supplied by your transformation context instead. */
11120 const createJSDocSignature: (typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type?: JSDocReturnTag | undefined) => JSDocSignature;
11121 /** @deprecated Use `factory.createJSDocPropertyTag` or the factory supplied by your transformation context instead. */
11122 const createJSDocPropertyTag: (tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, isNameFirst?: boolean | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocPropertyTag;
11123 /** @deprecated Use `factory.createJSDocTypeLiteral` or the factory supplied by your transformation context instead. */
11124 const createJSDocTypeLiteral: (jsDocPropertyTags?: readonly JSDocPropertyLikeTag[] | undefined, isArrayType?: boolean | undefined) => JSDocTypeLiteral;
11125 /** @deprecated Use `factory.createJSDocImplementsTag` or the factory supplied by your transformation context instead. */
11126 const createJSDocImplementsTag: (tagName: Identifier | undefined, className: ExpressionWithTypeArguments & {
11127 readonly expression: Identifier | PropertyAccessEntityNameExpression;
11128 }, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocImplementsTag;
11129 /** @deprecated Use `factory.createJSDocAuthorTag` or the factory supplied by your transformation context instead. */
11130 const createJSDocAuthorTag: (tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocAuthorTag;
11131 /** @deprecated Use `factory.createJSDocPublicTag` or the factory supplied by your transformation context instead. */
11132 const createJSDocPublicTag: (tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocPublicTag;
11133 /** @deprecated Use `factory.createJSDocPrivateTag` or the factory supplied by your transformation context instead. */
11134 const createJSDocPrivateTag: (tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocPrivateTag;
11135 /** @deprecated Use `factory.createJSDocProtectedTag` or the factory supplied by your transformation context instead. */
11136 const createJSDocProtectedTag: (tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocProtectedTag;
11137 /** @deprecated Use `factory.createJSDocReadonlyTag` or the factory supplied by your transformation context instead. */
11138 const createJSDocReadonlyTag: (tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocReadonlyTag;
11139 /** @deprecated Use `factory.createJSDocUnknownTag` or the factory supplied by your transformation context instead. */
11140 const createJSDocTag: (tagName: Identifier, comment?: string | NodeArray<JSDocComment> | undefined) => JSDocUnknownTag;
11141 /** @deprecated Use `factory.createJsxElement` or the factory supplied by your transformation context instead. */
11142 const createJsxElement: (openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement) => JsxElement;
11143 /** @deprecated Use `factory.updateJsxElement` or the factory supplied by your transformation context instead. */
11144 const updateJsxElement: (node: JsxElement, openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement) => JsxElement;
11145 /** @deprecated Use `factory.createJsxSelfClosingElement` or the factory supplied by your transformation context instead. */
11146 const createJsxSelfClosingElement: (tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxSelfClosingElement;
11147 /** @deprecated Use `factory.updateJsxSelfClosingElement` or the factory supplied by your transformation context instead. */
11148 const updateJsxSelfClosingElement: (node: JsxSelfClosingElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxSelfClosingElement;
11149 /** @deprecated Use `factory.createJsxOpeningElement` or the factory supplied by your transformation context instead. */
11150 const createJsxOpeningElement: (tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxOpeningElement;
11151 /** @deprecated Use `factory.updateJsxOpeningElement` or the factory supplied by your transformation context instead. */
11152 const updateJsxOpeningElement: (node: JsxOpeningElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxOpeningElement;
11153 /** @deprecated Use `factory.createJsxClosingElement` or the factory supplied by your transformation context instead. */
11154 const createJsxClosingElement: (tagName: JsxTagNameExpression) => JsxClosingElement;
11155 /** @deprecated Use `factory.updateJsxClosingElement` or the factory supplied by your transformation context instead. */
11156 const updateJsxClosingElement: (node: JsxClosingElement, tagName: JsxTagNameExpression) => JsxClosingElement;
11157 /** @deprecated Use `factory.createJsxFragment` or the factory supplied by your transformation context instead. */
11158 const createJsxFragment: (openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment) => JsxFragment;
11159 /** @deprecated Use `factory.createJsxText` or the factory supplied by your transformation context instead. */
11160 const createJsxText: (text: string, containsOnlyTriviaWhiteSpaces?: boolean | undefined) => JsxText;
11161 /** @deprecated Use `factory.updateJsxText` or the factory supplied by your transformation context instead. */
11162 const updateJsxText: (node: JsxText, text: string, containsOnlyTriviaWhiteSpaces?: boolean | undefined) => JsxText;
11163 /** @deprecated Use `factory.createJsxOpeningFragment` or the factory supplied by your transformation context instead. */
11164 const createJsxOpeningFragment: () => JsxOpeningFragment;
11165 /** @deprecated Use `factory.createJsxJsxClosingFragment` or the factory supplied by your transformation context instead. */
11166 const createJsxJsxClosingFragment: () => JsxClosingFragment;
11167 /** @deprecated Use `factory.updateJsxFragment` or the factory supplied by your transformation context instead. */
11168 const updateJsxFragment: (node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment) => JsxFragment;
11169 /** @deprecated Use `factory.createJsxAttribute` or the factory supplied by your transformation context instead. */
11170 const createJsxAttribute: (name: Identifier, initializer: StringLiteral | JsxExpression | undefined) => JsxAttribute;
11171 /** @deprecated Use `factory.updateJsxAttribute` or the factory supplied by your transformation context instead. */
11172 const updateJsxAttribute: (node: JsxAttribute, name: Identifier, initializer: StringLiteral | JsxExpression | undefined) => JsxAttribute;
11173 /** @deprecated Use `factory.createJsxAttributes` or the factory supplied by your transformation context instead. */
11174 const createJsxAttributes: (properties: readonly JsxAttributeLike[]) => JsxAttributes;
11175 /** @deprecated Use `factory.updateJsxAttributes` or the factory supplied by your transformation context instead. */
11176 const updateJsxAttributes: (node: JsxAttributes, properties: readonly JsxAttributeLike[]) => JsxAttributes;
11177 /** @deprecated Use `factory.createJsxSpreadAttribute` or the factory supplied by your transformation context instead. */
11178 const createJsxSpreadAttribute: (expression: Expression) => JsxSpreadAttribute;
11179 /** @deprecated Use `factory.updateJsxSpreadAttribute` or the factory supplied by your transformation context instead. */
11180 const updateJsxSpreadAttribute: (node: JsxSpreadAttribute, expression: Expression) => JsxSpreadAttribute;
11181 /** @deprecated Use `factory.createJsxExpression` or the factory supplied by your transformation context instead. */
11182 const createJsxExpression: (dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined) => JsxExpression;
11183 /** @deprecated Use `factory.updateJsxExpression` or the factory supplied by your transformation context instead. */
11184 const updateJsxExpression: (node: JsxExpression, expression: Expression | undefined) => JsxExpression;
11185 /** @deprecated Use `factory.createCaseClause` or the factory supplied by your transformation context instead. */
11186 const createCaseClause: (expression: Expression, statements: readonly Statement[]) => CaseClause;
11187 /** @deprecated Use `factory.updateCaseClause` or the factory supplied by your transformation context instead. */
11188 const updateCaseClause: (node: CaseClause, expression: Expression, statements: readonly Statement[]) => CaseClause;
11189 /** @deprecated Use `factory.createDefaultClause` or the factory supplied by your transformation context instead. */
11190 const createDefaultClause: (statements: readonly Statement[]) => DefaultClause;
11191 /** @deprecated Use `factory.updateDefaultClause` or the factory supplied by your transformation context instead. */
11192 const updateDefaultClause: (node: DefaultClause, statements: readonly Statement[]) => DefaultClause;
11193 /** @deprecated Use `factory.createHeritageClause` or the factory supplied by your transformation context instead. */
11194 const createHeritageClause: (token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword, types: readonly ExpressionWithTypeArguments[]) => HeritageClause;
11195 /** @deprecated Use `factory.updateHeritageClause` or the factory supplied by your transformation context instead. */
11196 const updateHeritageClause: (node: HeritageClause, types: readonly ExpressionWithTypeArguments[]) => HeritageClause;
11197 /** @deprecated Use `factory.createCatchClause` or the factory supplied by your transformation context instead. */
11198 const createCatchClause: (variableDeclaration: string | VariableDeclaration | BindingName | undefined, block: Block) => CatchClause;
11199 /** @deprecated Use `factory.updateCatchClause` or the factory supplied by your transformation context instead. */
11200 const updateCatchClause: (node: CatchClause, variableDeclaration: VariableDeclaration | undefined, block: Block) => CatchClause;
11201 /** @deprecated Use `factory.createPropertyAssignment` or the factory supplied by your transformation context instead. */
11202 const createPropertyAssignment: (name: string | PropertyName, initializer: Expression) => PropertyAssignment;
11203 /** @deprecated Use `factory.updatePropertyAssignment` or the factory supplied by your transformation context instead. */
11204 const updatePropertyAssignment: (node: PropertyAssignment, name: PropertyName, initializer: Expression) => PropertyAssignment;
11205 /** @deprecated Use `factory.createShorthandPropertyAssignment` or the factory supplied by your transformation context instead. */
11206 const createShorthandPropertyAssignment: (name: string | Identifier, objectAssignmentInitializer?: Expression | undefined) => ShorthandPropertyAssignment;
11207 /** @deprecated Use `factory.updateShorthandPropertyAssignment` or the factory supplied by your transformation context instead. */
11208 const updateShorthandPropertyAssignment: (node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression | undefined) => ShorthandPropertyAssignment;
11209 /** @deprecated Use `factory.createSpreadAssignment` or the factory supplied by your transformation context instead. */
11210 const createSpreadAssignment: (expression: Expression) => SpreadAssignment;
11211 /** @deprecated Use `factory.updateSpreadAssignment` or the factory supplied by your transformation context instead. */
11212 const updateSpreadAssignment: (node: SpreadAssignment, expression: Expression) => SpreadAssignment;
11213 /** @deprecated Use `factory.createEnumMember` or the factory supplied by your transformation context instead. */
11214 const createEnumMember: (name: string | PropertyName, initializer?: Expression | undefined) => EnumMember;
11215 /** @deprecated Use `factory.updateEnumMember` or the factory supplied by your transformation context instead. */
11216 const updateEnumMember: (node: EnumMember, name: PropertyName, initializer: Expression | undefined) => EnumMember;
11217 /** @deprecated Use `factory.updateSourceFile` or the factory supplied by your transformation context instead. */
11218 const updateSourceFileNode: (node: SourceFile, statements: readonly Statement[], isDeclarationFile?: boolean | undefined, referencedFiles?: readonly FileReference[] | undefined, typeReferences?: readonly FileReference[] | undefined, hasNoDefaultLib?: boolean | undefined, libReferences?: readonly FileReference[] | undefined) => SourceFile;
11219 /** @deprecated Use `factory.createNotEmittedStatement` or the factory supplied by your transformation context instead. */
11220 const createNotEmittedStatement: (original: Node) => NotEmittedStatement;
11221 /** @deprecated Use `factory.createPartiallyEmittedExpression` or the factory supplied by your transformation context instead. */
11222 const createPartiallyEmittedExpression: (expression: Expression, original?: Node | undefined) => PartiallyEmittedExpression;
11223 /** @deprecated Use `factory.updatePartiallyEmittedExpression` or the factory supplied by your transformation context instead. */
11224 const updatePartiallyEmittedExpression: (node: PartiallyEmittedExpression, expression: Expression) => PartiallyEmittedExpression;
11225 /** @deprecated Use `factory.createCommaListExpression` or the factory supplied by your transformation context instead. */
11226 const createCommaList: (elements: readonly Expression[]) => CommaListExpression;
11227 /** @deprecated Use `factory.updateCommaListExpression` or the factory supplied by your transformation context instead. */
11228 const updateCommaList: (node: CommaListExpression, elements: readonly Expression[]) => CommaListExpression;
11229 /** @deprecated Use `factory.createBundle` or the factory supplied by your transformation context instead. */
11230 const createBundle: (sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[] | undefined) => Bundle;
11231 /** @deprecated Use `factory.updateBundle` or the factory supplied by your transformation context instead. */
11232 const updateBundle: (node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[] | undefined) => Bundle;
11233 /** @deprecated Use `factory.createImmediatelyInvokedFunctionExpression` or the factory supplied by your transformation context instead. */
11234 const createImmediatelyInvokedFunctionExpression: {
11235 (statements: readonly Statement[]): CallExpression;
11236 (statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression;
11238 /** @deprecated Use `factory.createImmediatelyInvokedArrowFunction` or the factory supplied by your transformation context instead. */
11239 const createImmediatelyInvokedArrowFunction: {
11240 (statements: readonly Statement[]): CallExpression;
11241 (statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression;
11243 /** @deprecated Use `factory.createVoidZero` or the factory supplied by your transformation context instead. */
11244 const createVoidZero: () => VoidExpression;
11245 /** @deprecated Use `factory.createExportDefault` or the factory supplied by your transformation context instead. */
11246 const createExportDefault: (expression: Expression) => ExportAssignment;
11247 /** @deprecated Use `factory.createExternalModuleExport` or the factory supplied by your transformation context instead. */
11248 const createExternalModuleExport: (exportName: Identifier) => ExportDeclaration;
11249 /** @deprecated Use `factory.createNamespaceExport` or the factory supplied by your transformation context instead. */
11250 const createNamespaceExport: (name: Identifier) => NamespaceExport;
11251 /** @deprecated Use `factory.updateNamespaceExport` or the factory supplied by your transformation context instead. */
11252 const updateNamespaceExport: (node: NamespaceExport, name: Identifier) => NamespaceExport;
11253 /** @deprecated Use `factory.createToken` or the factory supplied by your transformation context instead. */
11254 const createToken: <TKind extends SyntaxKind>(kind: TKind) => Token<TKind>;
11255 /** @deprecated Use `factory.createIdentifier` or the factory supplied by your transformation context instead. */
11256 const createIdentifier: (text: string) => Identifier;
11257 /** @deprecated Use `factory.createTempVariable` or the factory supplied by your transformation context instead. */
11258 const createTempVariable: (recordTempVariable: ((node: Identifier) => void) | undefined) => Identifier;
11259 /** @deprecated Use `factory.getGeneratedNameForNode` or the factory supplied by your transformation context instead. */
11260 const getGeneratedNameForNode: (node: Node | undefined) => Identifier;
11261 /** @deprecated Use `factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic)` or the factory supplied by your transformation context instead. */
11262 const createOptimisticUniqueName: (text: string) => Identifier;
11263 /** @deprecated Use `factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic | GeneratedIdentifierFlags.FileLevel)` or the factory supplied by your transformation context instead. */
11264 const createFileLevelUniqueName: (text: string) => Identifier;
11265 /** @deprecated Use `factory.createIndexSignature` or the factory supplied by your transformation context instead. */
11266 const createIndexSignature: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => IndexSignatureDeclaration;
11267 /** @deprecated Use `factory.createTypePredicateNode` or the factory supplied by your transformation context instead. */
11268 const createTypePredicateNode: (parameterName: Identifier | ThisTypeNode | string, type: TypeNode) => TypePredicateNode;
11269 /** @deprecated Use `factory.updateTypePredicateNode` or the factory supplied by your transformation context instead. */
11270 const updateTypePredicateNode: (node: TypePredicateNode, parameterName: Identifier | ThisTypeNode, type: TypeNode) => TypePredicateNode;
11271 /** @deprecated Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead. */
11272 const createLiteral: {
11273 (value: string | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier): StringLiteral;
11274 (value: number | PseudoBigInt): NumericLiteral;
11275 (value: boolean): BooleanLiteral;
11276 (value: string | number | PseudoBigInt | boolean): PrimaryExpression;
11278 /** @deprecated Use `factory.createMethodSignature` or the factory supplied by your transformation context instead. */
11279 const createMethodSignature: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined) => MethodSignature;
11280 /** @deprecated Use `factory.updateMethodSignature` or the factory supplied by your transformation context instead. */
11281 const updateMethodSignature: (node: MethodSignature, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined, name: PropertyName, questionToken: QuestionToken | undefined) => MethodSignature;
11282 /** @deprecated Use `factory.createTypeOperatorNode` or the factory supplied by your transformation context instead. */
11283 const createTypeOperatorNode: {
11284 (type: TypeNode): TypeOperatorNode;
11285 (operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode;
11287 /** @deprecated Use `factory.createTaggedTemplate` or the factory supplied by your transformation context instead. */
11288 const createTaggedTemplate: {
11289 (tag: Expression, template: TemplateLiteral): TaggedTemplateExpression;
11290 (tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression;
11292 /** @deprecated Use `factory.updateTaggedTemplate` or the factory supplied by your transformation context instead. */
11293 const updateTaggedTemplate: {
11294 (node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression;
11295 (node: TaggedTemplateExpression, tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression;
11297 /** @deprecated Use `factory.updateBinary` or the factory supplied by your transformation context instead. */
11298 const updateBinary: (node: BinaryExpression, left: Expression, right: Expression, operator?: BinaryOperator | BinaryOperatorToken) => BinaryExpression;
11299 /** @deprecated Use `factory.createConditional` or the factory supplied by your transformation context instead. */
11300 const createConditional: {
11301 (condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression;
11302 (condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression;
11304 /** @deprecated Use `factory.createYield` or the factory supplied by your transformation context instead. */
11305 const createYield: {
11306 (expression?: Expression | undefined): YieldExpression;
11307 (asteriskToken: AsteriskToken | undefined, expression: Expression): YieldExpression;
11309 /** @deprecated Use `factory.createClassExpression` or the factory supplied by your transformation context instead. */
11310 const createClassExpression: (modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassExpression;
11311 /** @deprecated Use `factory.updateClassExpression` or the factory supplied by your transformation context instead. */
11312 const updateClassExpression: (node: ClassExpression, modifiers: readonly Modifier[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassExpression;
11313 /** @deprecated Use `factory.createPropertySignature` or the factory supplied by your transformation context instead. */
11314 const createPropertySignature: (modifiers: readonly Modifier[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer?: Expression | undefined) => PropertySignature;
11315 /** @deprecated Use `factory.updatePropertySignature` or the factory supplied by your transformation context instead. */
11316 const updatePropertySignature: (node: PropertySignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined) => PropertySignature;
11317 /** @deprecated Use `factory.createExpressionWithTypeArguments` or the factory supplied by your transformation context instead. */
11318 const createExpressionWithTypeArguments: (typeArguments: readonly TypeNode[] | undefined, expression: Expression) => ExpressionWithTypeArguments;
11319 /** @deprecated Use `factory.updateExpressionWithTypeArguments` or the factory supplied by your transformation context instead. */
11320 const updateExpressionWithTypeArguments: (node: ExpressionWithTypeArguments, typeArguments: readonly TypeNode[] | undefined, expression: Expression) => ExpressionWithTypeArguments;
11321 /** @deprecated Use `factory.createArrowFunction` or the factory supplied by your transformation context instead. */
11322 const createArrowFunction: {
11323 (modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction;
11324 (modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction;
11326 /** @deprecated Use `factory.updateArrowFunction` or the factory supplied by your transformation context instead. */
11327 const updateArrowFunction: {
11328 (node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken, body: ConciseBody): ArrowFunction;
11329 (node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction;
11331 /** @deprecated Use `factory.createVariableDeclaration` or the factory supplied by your transformation context instead. */
11332 const createVariableDeclaration: {
11333 (name: string | BindingName, type?: TypeNode | undefined, initializer?: Expression | undefined): VariableDeclaration;
11334 (name: string | BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration;
11336 /** @deprecated Use `factory.updateVariableDeclaration` or the factory supplied by your transformation context instead. */
11337 const updateVariableDeclaration: {
11338 (node: VariableDeclaration, name: BindingName, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration;
11339 (node: VariableDeclaration, name: BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration;
11341 /** @deprecated Use `factory.createImportClause` or the factory supplied by your transformation context instead. */
11342 const createImportClause: (name: Identifier | undefined, namedBindings: NamedImportBindings | undefined, isTypeOnly?: any) => ImportClause;
11343 /** @deprecated Use `factory.updateImportClause` or the factory supplied by your transformation context instead. */
11344 const updateImportClause: (node: ImportClause, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined, isTypeOnly: boolean) => ImportClause;
11345 /** @deprecated Use `factory.createExportDeclaration` or the factory supplied by your transformation context instead. */
11346 const createExportDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression | undefined, isTypeOnly?: any) => ExportDeclaration;
11347 /** @deprecated Use `factory.updateExportDeclaration` or the factory supplied by your transformation context instead. */
11348 const updateExportDeclaration: (node: ExportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, isTypeOnly: boolean) => ExportDeclaration;
11349 /** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */
11350 const createJSDocParamTag: (name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, comment?: string | undefined) => JSDocParameterTag;
11351 /** @deprecated Use `factory.createComma` or the factory supplied by your transformation context instead. */
11352 const createComma: (left: Expression, right: Expression) => Expression;
11353 /** @deprecated Use `factory.createLessThan` or the factory supplied by your transformation context instead. */
11354 const createLessThan: (left: Expression, right: Expression) => Expression;
11355 /** @deprecated Use `factory.createAssignment` or the factory supplied by your transformation context instead. */
11356 const createAssignment: (left: Expression, right: Expression) => BinaryExpression;
11357 /** @deprecated Use `factory.createStrictEquality` or the factory supplied by your transformation context instead. */
11358 const createStrictEquality: (left: Expression, right: Expression) => BinaryExpression;
11359 /** @deprecated Use `factory.createStrictInequality` or the factory supplied by your transformation context instead. */
11360 const createStrictInequality: (left: Expression, right: Expression) => BinaryExpression;
11361 /** @deprecated Use `factory.createAdd` or the factory supplied by your transformation context instead. */
11362 const createAdd: (left: Expression, right: Expression) => BinaryExpression;
11363 /** @deprecated Use `factory.createSubtract` or the factory supplied by your transformation context instead. */
11364 const createSubtract: (left: Expression, right: Expression) => BinaryExpression;
11365 /** @deprecated Use `factory.createLogicalAnd` or the factory supplied by your transformation context instead. */
11366 const createLogicalAnd: (left: Expression, right: Expression) => BinaryExpression;
11367 /** @deprecated Use `factory.createLogicalOr` or the factory supplied by your transformation context instead. */
11368 const createLogicalOr: (left: Expression, right: Expression) => BinaryExpression;
11369 /** @deprecated Use `factory.createPostfixIncrement` or the factory supplied by your transformation context instead. */
11370 const createPostfixIncrement: (operand: Expression) => PostfixUnaryExpression;
11371 /** @deprecated Use `factory.createLogicalNot` or the factory supplied by your transformation context instead. */
11372 const createLogicalNot: (operand: Expression) => PrefixUnaryExpression;
11373 /** @deprecated Use an appropriate `factory` method instead. */
11374 const createNode: (kind: SyntaxKind, pos?: any, end?: any) => Node;
11376 * Creates a shallow, memberwise clone of a node ~for mutation~ with its `pos`, `end`, and `parent` set.
11378 * NOTE: It is unsafe to change any properties of a `Node` that relate to its AST children, as those changes won't be
11379 * captured with respect to transformations.
11381 * @deprecated Use an appropriate `factory.update...` method instead, use `setCommentRange` or `setSourceMapRange`, and avoid setting `parent`.
11383 const getMutableClone: <T extends Node>(node: T) => T;
11384 /** @deprecated Use `isTypeAssertionExpression` instead. */
11385 const isTypeAssertion: (node: Node) => node is TypeAssertion;
11387 * @deprecated Use `ts.ReadonlyESMap<K, V>` instead.
11389 interface ReadonlyMap<T> extends ReadonlyESMap<string, T> {
11392 * @deprecated Use `ts.ESMap<K, V>` instead.
11394 interface Map<T> extends ESMap<string, T> {
11397 * @deprecated Use `isMemberName` instead.
11399 const isIdentifierOrPrivateIdentifier: (node: Node) => node is MemberName;
11403 export as namespace ts;