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.1";
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. */
170 PlusEqualsToken = 63,
171 MinusEqualsToken = 64,
172 AsteriskEqualsToken = 65,
173 AsteriskAsteriskEqualsToken = 66,
174 SlashEqualsToken = 67,
175 PercentEqualsToken = 68,
176 LessThanLessThanEqualsToken = 69,
177 GreaterThanGreaterThanEqualsToken = 70,
178 GreaterThanGreaterThanGreaterThanEqualsToken = 71,
179 AmpersandEqualsToken = 72,
181 BarBarEqualsToken = 74,
182 AmpersandAmpersandEqualsToken = 75,
183 QuestionQuestionEqualsToken = 76,
184 CaretEqualsToken = 77,
186 PrivateIdentifier = 79,
192 ContinueKeyword = 85,
193 DebuggerKeyword = 86,
204 FunctionKeyword = 97,
208 InstanceOfKeyword = 101,
223 ImplementsKeyword = 116,
224 InterfaceKeyword = 117,
226 PackageKeyword = 119,
227 PrivateKeyword = 120,
228 ProtectedKeyword = 121,
232 AbstractKeyword = 125,
234 AssertsKeyword = 127,
238 BooleanKeyword = 131,
239 ConstructorKeyword = 132,
240 DeclareKeyword = 133,
243 IntrinsicKeyword = 136,
247 NamespaceKeyword = 140,
249 ReadonlyKeyword = 142,
250 RequireKeyword = 143,
257 UndefinedKeyword = 150,
259 UnknownKeyword = 152,
265 ComputedPropertyName = 158,
269 PropertySignature = 162,
270 PropertyDeclaration = 163,
271 MethodSignature = 164,
272 MethodDeclaration = 165,
277 ConstructSignature = 170,
278 IndexSignature = 171,
282 ConstructorType = 175,
290 IntersectionType = 183,
291 ConditionalType = 184,
293 ParenthesizedType = 186,
296 IndexedAccessType = 189,
299 NamedTupleMember = 192,
300 TemplateLiteralType = 193,
301 TemplateLiteralTypeSpan = 194,
303 ObjectBindingPattern = 196,
304 ArrayBindingPattern = 197,
305 BindingElement = 198,
306 ArrayLiteralExpression = 199,
307 ObjectLiteralExpression = 200,
308 PropertyAccessExpression = 201,
309 ElementAccessExpression = 202,
310 CallExpression = 203,
312 TaggedTemplateExpression = 205,
313 TypeAssertionExpression = 206,
314 ParenthesizedExpression = 207,
315 FunctionExpression = 208,
317 DeleteExpression = 210,
318 TypeOfExpression = 211,
319 VoidExpression = 212,
320 AwaitExpression = 213,
321 PrefixUnaryExpression = 214,
322 PostfixUnaryExpression = 215,
323 BinaryExpression = 216,
324 ConditionalExpression = 217,
325 TemplateExpression = 218,
326 YieldExpression = 219,
328 ClassExpression = 221,
329 OmittedExpression = 222,
330 ExpressionWithTypeArguments = 223,
332 NonNullExpression = 225,
334 SyntheticExpression = 227,
336 SemicolonClassElement = 229,
338 EmptyStatement = 231,
339 VariableStatement = 232,
340 ExpressionStatement = 233,
343 WhileStatement = 236,
345 ForInStatement = 238,
346 ForOfStatement = 239,
347 ContinueStatement = 240,
348 BreakStatement = 241,
349 ReturnStatement = 242,
351 SwitchStatement = 244,
352 LabeledStatement = 245,
353 ThrowStatement = 246,
355 DebuggerStatement = 248,
356 VariableDeclaration = 249,
357 VariableDeclarationList = 250,
358 FunctionDeclaration = 251,
359 ClassDeclaration = 252,
360 InterfaceDeclaration = 253,
361 TypeAliasDeclaration = 254,
362 EnumDeclaration = 255,
363 ModuleDeclaration = 256,
366 NamespaceExportDeclaration = 259,
367 ImportEqualsDeclaration = 260,
368 ImportDeclaration = 261,
370 NamespaceImport = 263,
372 ImportSpecifier = 265,
373 ExportAssignment = 266,
374 ExportDeclaration = 267,
376 NamespaceExport = 269,
377 ExportSpecifier = 270,
378 MissingDeclaration = 271,
379 ExternalModuleReference = 272,
381 JsxSelfClosingElement = 274,
382 JsxOpeningElement = 275,
383 JsxClosingElement = 276,
385 JsxOpeningFragment = 278,
386 JsxClosingFragment = 279,
389 JsxSpreadAttribute = 282,
393 HeritageClause = 286,
395 PropertyAssignment = 288,
396 ShorthandPropertyAssignment = 289,
397 SpreadAssignment = 290,
399 UnparsedPrologue = 292,
400 UnparsedPrepend = 293,
402 UnparsedInternalText = 295,
403 UnparsedSyntheticReference = 296,
406 UnparsedSource = 299,
408 JSDocTypeExpression = 301,
409 JSDocNameReference = 302,
411 JSDocUnknownType = 304,
412 JSDocNullableType = 305,
413 JSDocNonNullableType = 306,
414 JSDocOptionalType = 307,
415 JSDocFunctionType = 308,
416 JSDocVariadicType = 309,
417 JSDocNamepathType = 310,
419 JSDocTypeLiteral = 312,
420 JSDocSignature = 313,
422 JSDocAugmentsTag = 315,
423 JSDocImplementsTag = 316,
424 JSDocAuthorTag = 317,
425 JSDocDeprecatedTag = 318,
427 JSDocPublicTag = 320,
428 JSDocPrivateTag = 321,
429 JSDocProtectedTag = 322,
430 JSDocReadonlyTag = 323,
431 JSDocCallbackTag = 324,
433 JSDocParameterTag = 326,
434 JSDocReturnTag = 327,
437 JSDocTemplateTag = 330,
438 JSDocTypedefTag = 331,
440 JSDocPropertyTag = 333,
442 NotEmittedStatement = 335,
443 PartiallyEmittedExpression = 336,
444 CommaListExpression = 337,
445 MergeDeclarationMarker = 338,
446 EndOfDeclarationMarker = 339,
447 SyntheticReferenceExpression = 340,
449 FirstAssignment = 62,
451 FirstCompoundAssignment = 63,
452 LastCompoundAssignment = 77,
453 FirstReservedWord = 80,
454 LastReservedWord = 115,
457 FirstFutureReservedWord = 116,
458 LastFutureReservedWord = 124,
461 FirstPunctuation = 18,
462 LastPunctuation = 77,
465 FirstTriviaToken = 2,
467 FirstLiteralToken = 8,
468 LastLiteralToken = 14,
469 FirstTemplateToken = 14,
470 LastTemplateToken = 17,
471 FirstBinaryOperator = 29,
472 LastBinaryOperator = 77,
473 FirstStatement = 232,
476 FirstJSDocNode = 301,
478 FirstJSDocTagNode = 314,
479 LastJSDocTagNode = 333,
481 export type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia;
482 export type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral;
483 export type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail;
484 export type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken;
485 export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword;
486 export type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.StaticKeyword;
487 export type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword;
488 export type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind;
489 export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken;
490 export type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind;
491 export enum NodeFlags {
501 HasImplicitReturn = 256,
502 HasExplicitReturn = 512,
503 GlobalAugmentation = 1024,
504 HasAsyncFunctions = 2048,
505 DisallowInContext = 4096,
507 DecoratorContext = 16384,
508 AwaitContext = 32768,
509 ThisNodeHasError = 65536,
510 JavaScriptFile = 131072,
511 ThisNodeOrAnySubNodesHasError = 262144,
512 HasAggregatedChildData = 524288,
516 ReachabilityCheckFlags = 768,
517 ReachabilityAndEmitFlags = 2816,
518 ContextFlags = 25358336,
519 TypeExcludesFlags = 40960,
521 export enum ModifierFlags {
534 HasComputedJSDocModifiers = 4096,
536 HasComputedFlags = 536870912,
537 AccessibilityModifier = 28,
538 ParameterPropertyModifier = 92,
539 NonPublicAccessibilityModifier = 24,
540 TypeScriptModifier = 2270,
544 export enum JsxFlags {
546 /** An element from a named property of the JSX.IntrinsicElements interface */
547 IntrinsicNamedElement = 1,
548 /** An element inferred from the string index signature of the JSX.IntrinsicElements interface */
549 IntrinsicIndexedElement = 2,
552 export interface Node extends ReadonlyTextRange {
553 readonly kind: SyntaxKind;
554 readonly flags: NodeFlags;
555 readonly decorators?: NodeArray<Decorator>;
556 readonly modifiers?: ModifiersArray;
557 readonly parent: Node;
559 export interface JSDocContainer {
561 export type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | LabeledStatement | ExpressionStatement | VariableStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | EndOfFileToken;
562 export type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType;
563 export type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
564 export type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
565 export type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertySignature | PropertyDeclaration | PropertyAssignment | EnumMember;
566 export interface NodeArray<T extends Node> extends ReadonlyArray<T>, ReadonlyTextRange {
567 hasTrailingComma?: boolean;
569 export interface Token<TKind extends SyntaxKind> extends Node {
570 readonly kind: TKind;
572 export type EndOfFileToken = Token<SyntaxKind.EndOfFileToken> & JSDocContainer;
573 export interface PunctuationToken<TKind extends PunctuationSyntaxKind> extends Token<TKind> {
575 export type DotToken = PunctuationToken<SyntaxKind.DotToken>;
576 export type DotDotDotToken = PunctuationToken<SyntaxKind.DotDotDotToken>;
577 export type QuestionToken = PunctuationToken<SyntaxKind.QuestionToken>;
578 export type ExclamationToken = PunctuationToken<SyntaxKind.ExclamationToken>;
579 export type ColonToken = PunctuationToken<SyntaxKind.ColonToken>;
580 export type EqualsToken = PunctuationToken<SyntaxKind.EqualsToken>;
581 export type AsteriskToken = PunctuationToken<SyntaxKind.AsteriskToken>;
582 export type EqualsGreaterThanToken = PunctuationToken<SyntaxKind.EqualsGreaterThanToken>;
583 export type PlusToken = PunctuationToken<SyntaxKind.PlusToken>;
584 export type MinusToken = PunctuationToken<SyntaxKind.MinusToken>;
585 export type QuestionDotToken = PunctuationToken<SyntaxKind.QuestionDotToken>;
586 export interface KeywordToken<TKind extends KeywordSyntaxKind> extends Token<TKind> {
588 export type AssertsKeyword = KeywordToken<SyntaxKind.AssertsKeyword>;
589 export type AwaitKeyword = KeywordToken<SyntaxKind.AwaitKeyword>;
590 /** @deprecated Use `AwaitKeyword` instead. */
591 export type AwaitKeywordToken = AwaitKeyword;
592 /** @deprecated Use `AssertsKeyword` instead. */
593 export type AssertsToken = AssertsKeyword;
594 export interface ModifierToken<TKind extends ModifierSyntaxKind> extends KeywordToken<TKind> {
596 export type AbstractKeyword = ModifierToken<SyntaxKind.AbstractKeyword>;
597 export type AsyncKeyword = ModifierToken<SyntaxKind.AsyncKeyword>;
598 export type ConstKeyword = ModifierToken<SyntaxKind.ConstKeyword>;
599 export type DeclareKeyword = ModifierToken<SyntaxKind.DeclareKeyword>;
600 export type DefaultKeyword = ModifierToken<SyntaxKind.DefaultKeyword>;
601 export type ExportKeyword = ModifierToken<SyntaxKind.ExportKeyword>;
602 export type PrivateKeyword = ModifierToken<SyntaxKind.PrivateKeyword>;
603 export type ProtectedKeyword = ModifierToken<SyntaxKind.ProtectedKeyword>;
604 export type PublicKeyword = ModifierToken<SyntaxKind.PublicKeyword>;
605 export type ReadonlyKeyword = ModifierToken<SyntaxKind.ReadonlyKeyword>;
606 export type StaticKeyword = ModifierToken<SyntaxKind.StaticKeyword>;
607 /** @deprecated Use `ReadonlyKeyword` instead. */
608 export type ReadonlyToken = ReadonlyKeyword;
609 export type Modifier = AbstractKeyword | AsyncKeyword | ConstKeyword | DeclareKeyword | DefaultKeyword | ExportKeyword | PrivateKeyword | ProtectedKeyword | PublicKeyword | ReadonlyKeyword | StaticKeyword;
610 export type AccessibilityModifier = PublicKeyword | PrivateKeyword | ProtectedKeyword;
611 export type ParameterPropertyModifier = AccessibilityModifier | ReadonlyKeyword;
612 export type ClassMemberModifier = AccessibilityModifier | ReadonlyKeyword | StaticKeyword;
613 export type ModifiersArray = NodeArray<Modifier>;
614 export enum GeneratedIdentifierFlags {
616 ReservedInNestedScopes = 8,
619 AllowNameSubstitution = 64
621 export interface Identifier extends PrimaryExpression, Declaration {
622 readonly kind: SyntaxKind.Identifier;
624 * Prefer to use `id.unescapedText`. (Note: This is available only in services, not internally to the TypeScript compiler.)
625 * Text of identifier, but if the identifier begins with two underscores, this will begin with three.
627 readonly escapedText: __String;
628 readonly originalKeywordKind?: SyntaxKind;
629 isInJSDocNamespace?: boolean;
631 export interface TransientIdentifier extends Identifier {
632 resolvedSymbol: Symbol;
634 export interface QualifiedName extends Node {
635 readonly kind: SyntaxKind.QualifiedName;
636 readonly left: EntityName;
637 readonly right: Identifier;
639 export type EntityName = Identifier | QualifiedName;
640 export type PropertyName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier;
641 export type DeclarationName = Identifier | PrivateIdentifier | StringLiteralLike | NumericLiteral | ComputedPropertyName | ElementAccessExpression | BindingPattern | EntityNameExpression;
642 export interface Declaration extends Node {
643 _declarationBrand: any;
645 export interface NamedDeclaration extends Declaration {
646 readonly name?: DeclarationName;
648 export interface DeclarationStatement extends NamedDeclaration, Statement {
649 readonly name?: Identifier | StringLiteral | NumericLiteral;
651 export interface ComputedPropertyName extends Node {
652 readonly kind: SyntaxKind.ComputedPropertyName;
653 readonly parent: Declaration;
654 readonly expression: Expression;
656 export interface PrivateIdentifier extends Node {
657 readonly kind: SyntaxKind.PrivateIdentifier;
658 readonly escapedText: __String;
660 export interface Decorator extends Node {
661 readonly kind: SyntaxKind.Decorator;
662 readonly parent: NamedDeclaration;
663 readonly expression: LeftHandSideExpression;
665 export interface TypeParameterDeclaration extends NamedDeclaration {
666 readonly kind: SyntaxKind.TypeParameter;
667 readonly parent: DeclarationWithTypeParameterChildren | InferTypeNode;
668 readonly name: Identifier;
669 /** Note: Consider calling `getEffectiveConstraintOfTypeParameter` */
670 readonly constraint?: TypeNode;
671 readonly default?: TypeNode;
672 expression?: Expression;
674 export interface SignatureDeclarationBase extends NamedDeclaration, JSDocContainer {
675 readonly kind: SignatureDeclaration["kind"];
676 readonly name?: PropertyName;
677 readonly typeParameters?: NodeArray<TypeParameterDeclaration>;
678 readonly parameters: NodeArray<ParameterDeclaration>;
679 readonly type?: TypeNode;
681 export type SignatureDeclaration = CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | AccessorDeclaration | FunctionExpression | ArrowFunction;
682 export interface CallSignatureDeclaration extends SignatureDeclarationBase, TypeElement {
683 readonly kind: SyntaxKind.CallSignature;
685 export interface ConstructSignatureDeclaration extends SignatureDeclarationBase, TypeElement {
686 readonly kind: SyntaxKind.ConstructSignature;
688 export type BindingName = Identifier | BindingPattern;
689 export interface VariableDeclaration extends NamedDeclaration {
690 readonly kind: SyntaxKind.VariableDeclaration;
691 readonly parent: VariableDeclarationList | CatchClause;
692 readonly name: BindingName;
693 readonly exclamationToken?: ExclamationToken;
694 readonly type?: TypeNode;
695 readonly initializer?: Expression;
697 export interface VariableDeclarationList extends Node {
698 readonly kind: SyntaxKind.VariableDeclarationList;
699 readonly parent: VariableStatement | ForStatement | ForOfStatement | ForInStatement;
700 readonly declarations: NodeArray<VariableDeclaration>;
702 export interface ParameterDeclaration extends NamedDeclaration, JSDocContainer {
703 readonly kind: SyntaxKind.Parameter;
704 readonly parent: SignatureDeclaration;
705 readonly dotDotDotToken?: DotDotDotToken;
706 readonly name: BindingName;
707 readonly questionToken?: QuestionToken;
708 readonly type?: TypeNode;
709 readonly initializer?: Expression;
711 export interface BindingElement extends NamedDeclaration {
712 readonly kind: SyntaxKind.BindingElement;
713 readonly parent: BindingPattern;
714 readonly propertyName?: PropertyName;
715 readonly dotDotDotToken?: DotDotDotToken;
716 readonly name: BindingName;
717 readonly initializer?: Expression;
719 export interface PropertySignature extends TypeElement, JSDocContainer {
720 readonly kind: SyntaxKind.PropertySignature;
721 readonly name: PropertyName;
722 readonly questionToken?: QuestionToken;
723 readonly type?: TypeNode;
724 initializer?: Expression;
726 export interface PropertyDeclaration extends ClassElement, JSDocContainer {
727 readonly kind: SyntaxKind.PropertyDeclaration;
728 readonly parent: ClassLikeDeclaration;
729 readonly name: PropertyName;
730 readonly questionToken?: QuestionToken;
731 readonly exclamationToken?: ExclamationToken;
732 readonly type?: TypeNode;
733 readonly initializer?: Expression;
735 export interface ObjectLiteralElement extends NamedDeclaration {
736 _objectLiteralBrand: any;
737 readonly name?: PropertyName;
739 /** Unlike ObjectLiteralElement, excludes JSXAttribute and JSXSpreadAttribute. */
740 export type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | MethodDeclaration | AccessorDeclaration;
741 export interface PropertyAssignment extends ObjectLiteralElement, JSDocContainer {
742 readonly kind: SyntaxKind.PropertyAssignment;
743 readonly parent: ObjectLiteralExpression;
744 readonly name: PropertyName;
745 readonly questionToken?: QuestionToken;
746 readonly exclamationToken?: ExclamationToken;
747 readonly initializer: Expression;
749 export interface ShorthandPropertyAssignment extends ObjectLiteralElement, JSDocContainer {
750 readonly kind: SyntaxKind.ShorthandPropertyAssignment;
751 readonly parent: ObjectLiteralExpression;
752 readonly name: Identifier;
753 readonly questionToken?: QuestionToken;
754 readonly exclamationToken?: ExclamationToken;
755 readonly equalsToken?: EqualsToken;
756 readonly objectAssignmentInitializer?: Expression;
758 export interface SpreadAssignment extends ObjectLiteralElement, JSDocContainer {
759 readonly kind: SyntaxKind.SpreadAssignment;
760 readonly parent: ObjectLiteralExpression;
761 readonly expression: Expression;
763 export type VariableLikeDeclaration = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | PropertyAssignment | PropertySignature | JsxAttribute | ShorthandPropertyAssignment | EnumMember | JSDocPropertyTag | JSDocParameterTag;
764 export interface PropertyLikeDeclaration extends NamedDeclaration {
765 readonly name: PropertyName;
767 export interface ObjectBindingPattern extends Node {
768 readonly kind: SyntaxKind.ObjectBindingPattern;
769 readonly parent: VariableDeclaration | ParameterDeclaration | BindingElement;
770 readonly elements: NodeArray<BindingElement>;
772 export interface ArrayBindingPattern extends Node {
773 readonly kind: SyntaxKind.ArrayBindingPattern;
774 readonly parent: VariableDeclaration | ParameterDeclaration | BindingElement;
775 readonly elements: NodeArray<ArrayBindingElement>;
777 export type BindingPattern = ObjectBindingPattern | ArrayBindingPattern;
778 export type ArrayBindingElement = BindingElement | OmittedExpression;
780 * Several node kinds share function-like features such as a signature,
781 * a name, and a body. These nodes should extend FunctionLikeDeclarationBase.
783 * - FunctionDeclaration
784 * - MethodDeclaration
785 * - AccessorDeclaration
787 export interface FunctionLikeDeclarationBase extends SignatureDeclarationBase {
788 _functionLikeDeclarationBrand: any;
789 readonly asteriskToken?: AsteriskToken;
790 readonly questionToken?: QuestionToken;
791 readonly exclamationToken?: ExclamationToken;
792 readonly body?: Block | Expression;
794 export type FunctionLikeDeclaration = FunctionDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ConstructorDeclaration | FunctionExpression | ArrowFunction;
795 /** @deprecated Use SignatureDeclaration */
796 export type FunctionLike = SignatureDeclaration;
797 export interface FunctionDeclaration extends FunctionLikeDeclarationBase, DeclarationStatement {
798 readonly kind: SyntaxKind.FunctionDeclaration;
799 readonly name?: Identifier;
800 readonly body?: FunctionBody;
802 export interface MethodSignature extends SignatureDeclarationBase, TypeElement {
803 readonly kind: SyntaxKind.MethodSignature;
804 readonly parent: ObjectTypeDeclaration;
805 readonly name: PropertyName;
807 export interface MethodDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer {
808 readonly kind: SyntaxKind.MethodDeclaration;
809 readonly parent: ClassLikeDeclaration | ObjectLiteralExpression;
810 readonly name: PropertyName;
811 readonly body?: FunctionBody;
813 export interface ConstructorDeclaration extends FunctionLikeDeclarationBase, ClassElement, JSDocContainer {
814 readonly kind: SyntaxKind.Constructor;
815 readonly parent: ClassLikeDeclaration;
816 readonly body?: FunctionBody;
818 /** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */
819 export interface SemicolonClassElement extends ClassElement {
820 readonly kind: SyntaxKind.SemicolonClassElement;
821 readonly parent: ClassLikeDeclaration;
823 export interface GetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer {
824 readonly kind: SyntaxKind.GetAccessor;
825 readonly parent: ClassLikeDeclaration | ObjectLiteralExpression;
826 readonly name: PropertyName;
827 readonly body?: FunctionBody;
829 export interface SetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer {
830 readonly kind: SyntaxKind.SetAccessor;
831 readonly parent: ClassLikeDeclaration | ObjectLiteralExpression;
832 readonly name: PropertyName;
833 readonly body?: FunctionBody;
835 export type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration;
836 export interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement {
837 readonly kind: SyntaxKind.IndexSignature;
838 readonly parent: ObjectTypeDeclaration;
839 readonly type: TypeNode;
841 export interface TypeNode extends Node {
844 export interface KeywordTypeNode<TKind extends KeywordTypeSyntaxKind = KeywordTypeSyntaxKind> extends KeywordToken<TKind>, TypeNode {
845 readonly kind: TKind;
847 export interface ImportTypeNode extends NodeWithTypeArguments {
848 readonly kind: SyntaxKind.ImportType;
849 readonly isTypeOf: boolean;
850 readonly argument: TypeNode;
851 readonly qualifier?: EntityName;
853 export interface ThisTypeNode extends TypeNode {
854 readonly kind: SyntaxKind.ThisType;
856 export type FunctionOrConstructorTypeNode = FunctionTypeNode | ConstructorTypeNode;
857 export interface FunctionOrConstructorTypeNodeBase extends TypeNode, SignatureDeclarationBase {
858 readonly kind: SyntaxKind.FunctionType | SyntaxKind.ConstructorType;
859 readonly type: TypeNode;
861 export interface FunctionTypeNode extends FunctionOrConstructorTypeNodeBase {
862 readonly kind: SyntaxKind.FunctionType;
864 export interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase {
865 readonly kind: SyntaxKind.ConstructorType;
867 export interface NodeWithTypeArguments extends TypeNode {
868 readonly typeArguments?: NodeArray<TypeNode>;
870 export type TypeReferenceType = TypeReferenceNode | ExpressionWithTypeArguments;
871 export interface TypeReferenceNode extends NodeWithTypeArguments {
872 readonly kind: SyntaxKind.TypeReference;
873 readonly typeName: EntityName;
875 export interface TypePredicateNode extends TypeNode {
876 readonly kind: SyntaxKind.TypePredicate;
877 readonly parent: SignatureDeclaration | JSDocTypeExpression;
878 readonly assertsModifier?: AssertsToken;
879 readonly parameterName: Identifier | ThisTypeNode;
880 readonly type?: TypeNode;
882 export interface TypeQueryNode extends TypeNode {
883 readonly kind: SyntaxKind.TypeQuery;
884 readonly exprName: EntityName;
886 export interface TypeLiteralNode extends TypeNode, Declaration {
887 readonly kind: SyntaxKind.TypeLiteral;
888 readonly members: NodeArray<TypeElement>;
890 export interface ArrayTypeNode extends TypeNode {
891 readonly kind: SyntaxKind.ArrayType;
892 readonly elementType: TypeNode;
894 export interface TupleTypeNode extends TypeNode {
895 readonly kind: SyntaxKind.TupleType;
896 readonly elements: NodeArray<TypeNode | NamedTupleMember>;
898 export interface NamedTupleMember extends TypeNode, JSDocContainer, Declaration {
899 readonly kind: SyntaxKind.NamedTupleMember;
900 readonly dotDotDotToken?: Token<SyntaxKind.DotDotDotToken>;
901 readonly name: Identifier;
902 readonly questionToken?: Token<SyntaxKind.QuestionToken>;
903 readonly type: TypeNode;
905 export interface OptionalTypeNode extends TypeNode {
906 readonly kind: SyntaxKind.OptionalType;
907 readonly type: TypeNode;
909 export interface RestTypeNode extends TypeNode {
910 readonly kind: SyntaxKind.RestType;
911 readonly type: TypeNode;
913 export type UnionOrIntersectionTypeNode = UnionTypeNode | IntersectionTypeNode;
914 export interface UnionTypeNode extends TypeNode {
915 readonly kind: SyntaxKind.UnionType;
916 readonly types: NodeArray<TypeNode>;
918 export interface IntersectionTypeNode extends TypeNode {
919 readonly kind: SyntaxKind.IntersectionType;
920 readonly types: NodeArray<TypeNode>;
922 export interface ConditionalTypeNode extends TypeNode {
923 readonly kind: SyntaxKind.ConditionalType;
924 readonly checkType: TypeNode;
925 readonly extendsType: TypeNode;
926 readonly trueType: TypeNode;
927 readonly falseType: TypeNode;
929 export interface InferTypeNode extends TypeNode {
930 readonly kind: SyntaxKind.InferType;
931 readonly typeParameter: TypeParameterDeclaration;
933 export interface ParenthesizedTypeNode extends TypeNode {
934 readonly kind: SyntaxKind.ParenthesizedType;
935 readonly type: TypeNode;
937 export interface TypeOperatorNode extends TypeNode {
938 readonly kind: SyntaxKind.TypeOperator;
939 readonly operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword;
940 readonly type: TypeNode;
942 export interface IndexedAccessTypeNode extends TypeNode {
943 readonly kind: SyntaxKind.IndexedAccessType;
944 readonly objectType: TypeNode;
945 readonly indexType: TypeNode;
947 export interface MappedTypeNode extends TypeNode, Declaration {
948 readonly kind: SyntaxKind.MappedType;
949 readonly readonlyToken?: ReadonlyToken | PlusToken | MinusToken;
950 readonly typeParameter: TypeParameterDeclaration;
951 readonly nameType?: TypeNode;
952 readonly questionToken?: QuestionToken | PlusToken | MinusToken;
953 readonly type?: TypeNode;
955 export interface LiteralTypeNode extends TypeNode {
956 readonly kind: SyntaxKind.LiteralType;
957 readonly literal: NullLiteral | BooleanLiteral | LiteralExpression | PrefixUnaryExpression;
959 export interface StringLiteral extends LiteralExpression, Declaration {
960 readonly kind: SyntaxKind.StringLiteral;
962 export type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral;
963 export type PropertyNameLiteral = Identifier | StringLiteralLike | NumericLiteral;
964 export interface TemplateLiteralTypeNode extends TypeNode {
965 kind: SyntaxKind.TemplateLiteralType;
966 readonly head: TemplateHead;
967 readonly templateSpans: NodeArray<TemplateLiteralTypeSpan>;
969 export interface TemplateLiteralTypeSpan extends TypeNode {
970 readonly kind: SyntaxKind.TemplateLiteralTypeSpan;
971 readonly parent: TemplateLiteralTypeNode;
972 readonly type: TypeNode;
973 readonly literal: TemplateMiddle | TemplateTail;
975 export interface Expression extends Node {
976 _expressionBrand: any;
978 export interface OmittedExpression extends Expression {
979 readonly kind: SyntaxKind.OmittedExpression;
981 export interface PartiallyEmittedExpression extends LeftHandSideExpression {
982 readonly kind: SyntaxKind.PartiallyEmittedExpression;
983 readonly expression: Expression;
985 export interface UnaryExpression extends Expression {
986 _unaryExpressionBrand: any;
988 /** Deprecated, please use UpdateExpression */
989 export type IncrementExpression = UpdateExpression;
990 export interface UpdateExpression extends UnaryExpression {
991 _updateExpressionBrand: any;
993 export type PrefixUnaryOperator = SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.TildeToken | SyntaxKind.ExclamationToken;
994 export interface PrefixUnaryExpression extends UpdateExpression {
995 readonly kind: SyntaxKind.PrefixUnaryExpression;
996 readonly operator: PrefixUnaryOperator;
997 readonly operand: UnaryExpression;
999 export type PostfixUnaryOperator = SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken;
1000 export interface PostfixUnaryExpression extends UpdateExpression {
1001 readonly kind: SyntaxKind.PostfixUnaryExpression;
1002 readonly operand: LeftHandSideExpression;
1003 readonly operator: PostfixUnaryOperator;
1005 export interface LeftHandSideExpression extends UpdateExpression {
1006 _leftHandSideExpressionBrand: any;
1008 export interface MemberExpression extends LeftHandSideExpression {
1009 _memberExpressionBrand: any;
1011 export interface PrimaryExpression extends MemberExpression {
1012 _primaryExpressionBrand: any;
1014 export interface NullLiteral extends PrimaryExpression {
1015 readonly kind: SyntaxKind.NullKeyword;
1017 export interface TrueLiteral extends PrimaryExpression {
1018 readonly kind: SyntaxKind.TrueKeyword;
1020 export interface FalseLiteral extends PrimaryExpression {
1021 readonly kind: SyntaxKind.FalseKeyword;
1023 export type BooleanLiteral = TrueLiteral | FalseLiteral;
1024 export interface ThisExpression extends PrimaryExpression {
1025 readonly kind: SyntaxKind.ThisKeyword;
1027 export interface SuperExpression extends PrimaryExpression {
1028 readonly kind: SyntaxKind.SuperKeyword;
1030 export interface ImportExpression extends PrimaryExpression {
1031 readonly kind: SyntaxKind.ImportKeyword;
1033 export interface DeleteExpression extends UnaryExpression {
1034 readonly kind: SyntaxKind.DeleteExpression;
1035 readonly expression: UnaryExpression;
1037 export interface TypeOfExpression extends UnaryExpression {
1038 readonly kind: SyntaxKind.TypeOfExpression;
1039 readonly expression: UnaryExpression;
1041 export interface VoidExpression extends UnaryExpression {
1042 readonly kind: SyntaxKind.VoidExpression;
1043 readonly expression: UnaryExpression;
1045 export interface AwaitExpression extends UnaryExpression {
1046 readonly kind: SyntaxKind.AwaitExpression;
1047 readonly expression: UnaryExpression;
1049 export interface YieldExpression extends Expression {
1050 readonly kind: SyntaxKind.YieldExpression;
1051 readonly asteriskToken?: AsteriskToken;
1052 readonly expression?: Expression;
1054 export interface SyntheticExpression extends Expression {
1055 readonly kind: SyntaxKind.SyntheticExpression;
1056 readonly isSpread: boolean;
1057 readonly type: Type;
1058 readonly tupleNameSource?: ParameterDeclaration | NamedTupleMember;
1060 export type ExponentiationOperator = SyntaxKind.AsteriskAsteriskToken;
1061 export type MultiplicativeOperator = SyntaxKind.AsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken;
1062 export type MultiplicativeOperatorOrHigher = ExponentiationOperator | MultiplicativeOperator;
1063 export type AdditiveOperator = SyntaxKind.PlusToken | SyntaxKind.MinusToken;
1064 export type AdditiveOperatorOrHigher = MultiplicativeOperatorOrHigher | AdditiveOperator;
1065 export type ShiftOperator = SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken;
1066 export type ShiftOperatorOrHigher = AdditiveOperatorOrHigher | ShiftOperator;
1067 export type RelationalOperator = SyntaxKind.LessThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.InstanceOfKeyword | SyntaxKind.InKeyword;
1068 export type RelationalOperatorOrHigher = ShiftOperatorOrHigher | RelationalOperator;
1069 export type EqualityOperator = SyntaxKind.EqualsEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.ExclamationEqualsToken;
1070 export type EqualityOperatorOrHigher = RelationalOperatorOrHigher | EqualityOperator;
1071 export type BitwiseOperator = SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken;
1072 export type BitwiseOperatorOrHigher = EqualityOperatorOrHigher | BitwiseOperator;
1073 export type LogicalOperator = SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken;
1074 export type LogicalOperatorOrHigher = BitwiseOperatorOrHigher | LogicalOperator;
1075 export type CompoundAssignmentOperator = SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.BarBarEqualsToken | SyntaxKind.AmpersandAmpersandEqualsToken | SyntaxKind.QuestionQuestionEqualsToken;
1076 export type AssignmentOperator = SyntaxKind.EqualsToken | CompoundAssignmentOperator;
1077 export type AssignmentOperatorOrHigher = SyntaxKind.QuestionQuestionToken | LogicalOperatorOrHigher | AssignmentOperator;
1078 export type BinaryOperator = AssignmentOperatorOrHigher | SyntaxKind.CommaToken;
1079 export type LogicalOrCoalescingAssignmentOperator = SyntaxKind.AmpersandAmpersandEqualsToken | SyntaxKind.BarBarEqualsToken | SyntaxKind.QuestionQuestionEqualsToken;
1080 export type BinaryOperatorToken = Token<BinaryOperator>;
1081 export interface BinaryExpression extends Expression, Declaration {
1082 readonly kind: SyntaxKind.BinaryExpression;
1083 readonly left: Expression;
1084 readonly operatorToken: BinaryOperatorToken;
1085 readonly right: Expression;
1087 export type AssignmentOperatorToken = Token<AssignmentOperator>;
1088 export interface AssignmentExpression<TOperator extends AssignmentOperatorToken> extends BinaryExpression {
1089 readonly left: LeftHandSideExpression;
1090 readonly operatorToken: TOperator;
1092 export interface ObjectDestructuringAssignment extends AssignmentExpression<EqualsToken> {
1093 readonly left: ObjectLiteralExpression;
1095 export interface ArrayDestructuringAssignment extends AssignmentExpression<EqualsToken> {
1096 readonly left: ArrayLiteralExpression;
1098 export type DestructuringAssignment = ObjectDestructuringAssignment | ArrayDestructuringAssignment;
1099 export type BindingOrAssignmentElement = VariableDeclaration | ParameterDeclaration | ObjectBindingOrAssignmentElement | ArrayBindingOrAssignmentElement;
1100 export type ObjectBindingOrAssignmentElement = BindingElement | PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment;
1101 export type ArrayBindingOrAssignmentElement = BindingElement | OmittedExpression | SpreadElement | ArrayLiteralExpression | ObjectLiteralExpression | AssignmentExpression<EqualsToken> | Identifier | PropertyAccessExpression | ElementAccessExpression;
1102 export type BindingOrAssignmentElementRestIndicator = DotDotDotToken | SpreadElement | SpreadAssignment;
1103 export type BindingOrAssignmentElementTarget = BindingOrAssignmentPattern | Identifier | PropertyAccessExpression | ElementAccessExpression | OmittedExpression;
1104 export type ObjectBindingOrAssignmentPattern = ObjectBindingPattern | ObjectLiteralExpression;
1105 export type ArrayBindingOrAssignmentPattern = ArrayBindingPattern | ArrayLiteralExpression;
1106 export type AssignmentPattern = ObjectLiteralExpression | ArrayLiteralExpression;
1107 export type BindingOrAssignmentPattern = ObjectBindingOrAssignmentPattern | ArrayBindingOrAssignmentPattern;
1108 export interface ConditionalExpression extends Expression {
1109 readonly kind: SyntaxKind.ConditionalExpression;
1110 readonly condition: Expression;
1111 readonly questionToken: QuestionToken;
1112 readonly whenTrue: Expression;
1113 readonly colonToken: ColonToken;
1114 readonly whenFalse: Expression;
1116 export type FunctionBody = Block;
1117 export type ConciseBody = FunctionBody | Expression;
1118 export interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclarationBase, JSDocContainer {
1119 readonly kind: SyntaxKind.FunctionExpression;
1120 readonly name?: Identifier;
1121 readonly body: FunctionBody;
1123 export interface ArrowFunction extends Expression, FunctionLikeDeclarationBase, JSDocContainer {
1124 readonly kind: SyntaxKind.ArrowFunction;
1125 readonly equalsGreaterThanToken: EqualsGreaterThanToken;
1126 readonly body: ConciseBody;
1127 readonly name: never;
1129 export interface LiteralLikeNode extends Node {
1131 isUnterminated?: boolean;
1132 hasExtendedUnicodeEscape?: boolean;
1134 export interface TemplateLiteralLikeNode extends LiteralLikeNode {
1137 export interface LiteralExpression extends LiteralLikeNode, PrimaryExpression {
1138 _literalExpressionBrand: any;
1140 export interface RegularExpressionLiteral extends LiteralExpression {
1141 readonly kind: SyntaxKind.RegularExpressionLiteral;
1143 export interface NoSubstitutionTemplateLiteral extends LiteralExpression, TemplateLiteralLikeNode, Declaration {
1144 readonly kind: SyntaxKind.NoSubstitutionTemplateLiteral;
1146 export enum TokenFlags {
1151 BinarySpecifier = 128,
1152 OctalSpecifier = 256,
1154 export interface NumericLiteral extends LiteralExpression, Declaration {
1155 readonly kind: SyntaxKind.NumericLiteral;
1157 export interface BigIntLiteral extends LiteralExpression {
1158 readonly kind: SyntaxKind.BigIntLiteral;
1160 export type LiteralToken = NumericLiteral | BigIntLiteral | StringLiteral | JsxText | RegularExpressionLiteral | NoSubstitutionTemplateLiteral;
1161 export interface TemplateHead extends TemplateLiteralLikeNode {
1162 readonly kind: SyntaxKind.TemplateHead;
1163 readonly parent: TemplateExpression | TemplateLiteralTypeNode;
1165 export interface TemplateMiddle extends TemplateLiteralLikeNode {
1166 readonly kind: SyntaxKind.TemplateMiddle;
1167 readonly parent: TemplateSpan | TemplateLiteralTypeSpan;
1169 export interface TemplateTail extends TemplateLiteralLikeNode {
1170 readonly kind: SyntaxKind.TemplateTail;
1171 readonly parent: TemplateSpan | TemplateLiteralTypeSpan;
1173 export type PseudoLiteralToken = TemplateHead | TemplateMiddle | TemplateTail;
1174 export type TemplateLiteralToken = NoSubstitutionTemplateLiteral | PseudoLiteralToken;
1175 export interface TemplateExpression extends PrimaryExpression {
1176 readonly kind: SyntaxKind.TemplateExpression;
1177 readonly head: TemplateHead;
1178 readonly templateSpans: NodeArray<TemplateSpan>;
1180 export type TemplateLiteral = TemplateExpression | NoSubstitutionTemplateLiteral;
1181 export interface TemplateSpan extends Node {
1182 readonly kind: SyntaxKind.TemplateSpan;
1183 readonly parent: TemplateExpression;
1184 readonly expression: Expression;
1185 readonly literal: TemplateMiddle | TemplateTail;
1187 export interface ParenthesizedExpression extends PrimaryExpression, JSDocContainer {
1188 readonly kind: SyntaxKind.ParenthesizedExpression;
1189 readonly expression: Expression;
1191 export interface ArrayLiteralExpression extends PrimaryExpression {
1192 readonly kind: SyntaxKind.ArrayLiteralExpression;
1193 readonly elements: NodeArray<Expression>;
1195 export interface SpreadElement extends Expression {
1196 readonly kind: SyntaxKind.SpreadElement;
1197 readonly parent: ArrayLiteralExpression | CallExpression | NewExpression;
1198 readonly expression: Expression;
1201 * This interface is a base interface for ObjectLiteralExpression and JSXAttributes to extend from. JSXAttributes is similar to
1202 * ObjectLiteralExpression in that it contains array of properties; however, JSXAttributes' properties can only be
1203 * JSXAttribute or JSXSpreadAttribute. ObjectLiteralExpression, on the other hand, can only have properties of type
1204 * ObjectLiteralElement (e.g. PropertyAssignment, ShorthandPropertyAssignment etc.)
1206 export interface ObjectLiteralExpressionBase<T extends ObjectLiteralElement> extends PrimaryExpression, Declaration {
1207 readonly properties: NodeArray<T>;
1209 export interface ObjectLiteralExpression extends ObjectLiteralExpressionBase<ObjectLiteralElementLike> {
1210 readonly kind: SyntaxKind.ObjectLiteralExpression;
1212 export type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression;
1213 export type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression;
1214 export type AccessExpression = PropertyAccessExpression | ElementAccessExpression;
1215 export interface PropertyAccessExpression extends MemberExpression, NamedDeclaration {
1216 readonly kind: SyntaxKind.PropertyAccessExpression;
1217 readonly expression: LeftHandSideExpression;
1218 readonly questionDotToken?: QuestionDotToken;
1219 readonly name: Identifier | PrivateIdentifier;
1221 export interface PropertyAccessChain extends PropertyAccessExpression {
1222 _optionalChainBrand: any;
1223 readonly name: Identifier | PrivateIdentifier;
1225 export interface SuperPropertyAccessExpression extends PropertyAccessExpression {
1226 readonly expression: SuperExpression;
1228 /** Brand for a PropertyAccessExpression which, like a QualifiedName, consists of a sequence of identifiers separated by dots. */
1229 export interface PropertyAccessEntityNameExpression extends PropertyAccessExpression {
1230 _propertyAccessExpressionLikeQualifiedNameBrand?: any;
1231 readonly expression: EntityNameExpression;
1232 readonly name: Identifier;
1234 export interface ElementAccessExpression extends MemberExpression {
1235 readonly kind: SyntaxKind.ElementAccessExpression;
1236 readonly expression: LeftHandSideExpression;
1237 readonly questionDotToken?: QuestionDotToken;
1238 readonly argumentExpression: Expression;
1240 export interface ElementAccessChain extends ElementAccessExpression {
1241 _optionalChainBrand: any;
1243 export interface SuperElementAccessExpression extends ElementAccessExpression {
1244 readonly expression: SuperExpression;
1246 export type SuperProperty = SuperPropertyAccessExpression | SuperElementAccessExpression;
1247 export interface CallExpression extends LeftHandSideExpression, Declaration {
1248 readonly kind: SyntaxKind.CallExpression;
1249 readonly expression: LeftHandSideExpression;
1250 readonly questionDotToken?: QuestionDotToken;
1251 readonly typeArguments?: NodeArray<TypeNode>;
1252 readonly arguments: NodeArray<Expression>;
1254 export interface CallChain extends CallExpression {
1255 _optionalChainBrand: any;
1257 export type OptionalChain = PropertyAccessChain | ElementAccessChain | CallChain | NonNullChain;
1258 export interface SuperCall extends CallExpression {
1259 readonly expression: SuperExpression;
1261 export interface ImportCall extends CallExpression {
1262 readonly expression: ImportExpression;
1264 export interface ExpressionWithTypeArguments extends NodeWithTypeArguments {
1265 readonly kind: SyntaxKind.ExpressionWithTypeArguments;
1266 readonly parent: HeritageClause | JSDocAugmentsTag | JSDocImplementsTag;
1267 readonly expression: LeftHandSideExpression;
1269 export interface NewExpression extends PrimaryExpression, Declaration {
1270 readonly kind: SyntaxKind.NewExpression;
1271 readonly expression: LeftHandSideExpression;
1272 readonly typeArguments?: NodeArray<TypeNode>;
1273 readonly arguments?: NodeArray<Expression>;
1275 export interface TaggedTemplateExpression extends MemberExpression {
1276 readonly kind: SyntaxKind.TaggedTemplateExpression;
1277 readonly tag: LeftHandSideExpression;
1278 readonly typeArguments?: NodeArray<TypeNode>;
1279 readonly template: TemplateLiteral;
1281 export type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression | Decorator | JsxOpeningLikeElement;
1282 export interface AsExpression extends Expression {
1283 readonly kind: SyntaxKind.AsExpression;
1284 readonly expression: Expression;
1285 readonly type: TypeNode;
1287 export interface TypeAssertion extends UnaryExpression {
1288 readonly kind: SyntaxKind.TypeAssertionExpression;
1289 readonly type: TypeNode;
1290 readonly expression: UnaryExpression;
1292 export type AssertionExpression = TypeAssertion | AsExpression;
1293 export interface NonNullExpression extends LeftHandSideExpression {
1294 readonly kind: SyntaxKind.NonNullExpression;
1295 readonly expression: Expression;
1297 export interface NonNullChain extends NonNullExpression {
1298 _optionalChainBrand: any;
1300 export interface MetaProperty extends PrimaryExpression {
1301 readonly kind: SyntaxKind.MetaProperty;
1302 readonly keywordToken: SyntaxKind.NewKeyword | SyntaxKind.ImportKeyword;
1303 readonly name: Identifier;
1305 export interface JsxElement extends PrimaryExpression {
1306 readonly kind: SyntaxKind.JsxElement;
1307 readonly openingElement: JsxOpeningElement;
1308 readonly children: NodeArray<JsxChild>;
1309 readonly closingElement: JsxClosingElement;
1311 export type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement;
1312 export type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute;
1313 export type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess;
1314 export interface JsxTagNamePropertyAccess extends PropertyAccessExpression {
1315 readonly expression: JsxTagNameExpression;
1317 export interface JsxAttributes extends ObjectLiteralExpressionBase<JsxAttributeLike> {
1318 readonly kind: SyntaxKind.JsxAttributes;
1319 readonly parent: JsxOpeningLikeElement;
1321 export interface JsxOpeningElement extends Expression {
1322 readonly kind: SyntaxKind.JsxOpeningElement;
1323 readonly parent: JsxElement;
1324 readonly tagName: JsxTagNameExpression;
1325 readonly typeArguments?: NodeArray<TypeNode>;
1326 readonly attributes: JsxAttributes;
1328 export interface JsxSelfClosingElement extends PrimaryExpression {
1329 readonly kind: SyntaxKind.JsxSelfClosingElement;
1330 readonly tagName: JsxTagNameExpression;
1331 readonly typeArguments?: NodeArray<TypeNode>;
1332 readonly attributes: JsxAttributes;
1334 export interface JsxFragment extends PrimaryExpression {
1335 readonly kind: SyntaxKind.JsxFragment;
1336 readonly openingFragment: JsxOpeningFragment;
1337 readonly children: NodeArray<JsxChild>;
1338 readonly closingFragment: JsxClosingFragment;
1340 export interface JsxOpeningFragment extends Expression {
1341 readonly kind: SyntaxKind.JsxOpeningFragment;
1342 readonly parent: JsxFragment;
1344 export interface JsxClosingFragment extends Expression {
1345 readonly kind: SyntaxKind.JsxClosingFragment;
1346 readonly parent: JsxFragment;
1348 export interface JsxAttribute extends ObjectLiteralElement {
1349 readonly kind: SyntaxKind.JsxAttribute;
1350 readonly parent: JsxAttributes;
1351 readonly name: Identifier;
1352 readonly initializer?: StringLiteral | JsxExpression;
1354 export interface JsxSpreadAttribute extends ObjectLiteralElement {
1355 readonly kind: SyntaxKind.JsxSpreadAttribute;
1356 readonly parent: JsxAttributes;
1357 readonly expression: Expression;
1359 export interface JsxClosingElement extends Node {
1360 readonly kind: SyntaxKind.JsxClosingElement;
1361 readonly parent: JsxElement;
1362 readonly tagName: JsxTagNameExpression;
1364 export interface JsxExpression extends Expression {
1365 readonly kind: SyntaxKind.JsxExpression;
1366 readonly parent: JsxElement | JsxAttributeLike;
1367 readonly dotDotDotToken?: Token<SyntaxKind.DotDotDotToken>;
1368 readonly expression?: Expression;
1370 export interface JsxText extends LiteralLikeNode {
1371 readonly kind: SyntaxKind.JsxText;
1372 readonly parent: JsxElement;
1373 readonly containsOnlyTriviaWhiteSpaces: boolean;
1375 export type JsxChild = JsxText | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment;
1376 export interface Statement extends Node {
1377 _statementBrand: any;
1379 export interface NotEmittedStatement extends Statement {
1380 readonly kind: SyntaxKind.NotEmittedStatement;
1383 * A list of comma-separated expressions. This node is only created by transformations.
1385 export interface CommaListExpression extends Expression {
1386 readonly kind: SyntaxKind.CommaListExpression;
1387 readonly elements: NodeArray<Expression>;
1389 export interface EmptyStatement extends Statement {
1390 readonly kind: SyntaxKind.EmptyStatement;
1392 export interface DebuggerStatement extends Statement {
1393 readonly kind: SyntaxKind.DebuggerStatement;
1395 export interface MissingDeclaration extends DeclarationStatement {
1396 readonly kind: SyntaxKind.MissingDeclaration;
1397 readonly name?: Identifier;
1399 export type BlockLike = SourceFile | Block | ModuleBlock | CaseOrDefaultClause;
1400 export interface Block extends Statement {
1401 readonly kind: SyntaxKind.Block;
1402 readonly statements: NodeArray<Statement>;
1404 export interface VariableStatement extends Statement, JSDocContainer {
1405 readonly kind: SyntaxKind.VariableStatement;
1406 readonly declarationList: VariableDeclarationList;
1408 export interface ExpressionStatement extends Statement, JSDocContainer {
1409 readonly kind: SyntaxKind.ExpressionStatement;
1410 readonly expression: Expression;
1412 export interface IfStatement extends Statement {
1413 readonly kind: SyntaxKind.IfStatement;
1414 readonly expression: Expression;
1415 readonly thenStatement: Statement;
1416 readonly elseStatement?: Statement;
1418 export interface IterationStatement extends Statement {
1419 readonly statement: Statement;
1421 export interface DoStatement extends IterationStatement {
1422 readonly kind: SyntaxKind.DoStatement;
1423 readonly expression: Expression;
1425 export interface WhileStatement extends IterationStatement {
1426 readonly kind: SyntaxKind.WhileStatement;
1427 readonly expression: Expression;
1429 export type ForInitializer = VariableDeclarationList | Expression;
1430 export interface ForStatement extends IterationStatement {
1431 readonly kind: SyntaxKind.ForStatement;
1432 readonly initializer?: ForInitializer;
1433 readonly condition?: Expression;
1434 readonly incrementor?: Expression;
1436 export type ForInOrOfStatement = ForInStatement | ForOfStatement;
1437 export interface ForInStatement extends IterationStatement {
1438 readonly kind: SyntaxKind.ForInStatement;
1439 readonly initializer: ForInitializer;
1440 readonly expression: Expression;
1442 export interface ForOfStatement extends IterationStatement {
1443 readonly kind: SyntaxKind.ForOfStatement;
1444 readonly awaitModifier?: AwaitKeywordToken;
1445 readonly initializer: ForInitializer;
1446 readonly expression: Expression;
1448 export interface BreakStatement extends Statement {
1449 readonly kind: SyntaxKind.BreakStatement;
1450 readonly label?: Identifier;
1452 export interface ContinueStatement extends Statement {
1453 readonly kind: SyntaxKind.ContinueStatement;
1454 readonly label?: Identifier;
1456 export type BreakOrContinueStatement = BreakStatement | ContinueStatement;
1457 export interface ReturnStatement extends Statement {
1458 readonly kind: SyntaxKind.ReturnStatement;
1459 readonly expression?: Expression;
1461 export interface WithStatement extends Statement {
1462 readonly kind: SyntaxKind.WithStatement;
1463 readonly expression: Expression;
1464 readonly statement: Statement;
1466 export interface SwitchStatement extends Statement {
1467 readonly kind: SyntaxKind.SwitchStatement;
1468 readonly expression: Expression;
1469 readonly caseBlock: CaseBlock;
1470 possiblyExhaustive?: boolean;
1472 export interface CaseBlock extends Node {
1473 readonly kind: SyntaxKind.CaseBlock;
1474 readonly parent: SwitchStatement;
1475 readonly clauses: NodeArray<CaseOrDefaultClause>;
1477 export interface CaseClause extends Node {
1478 readonly kind: SyntaxKind.CaseClause;
1479 readonly parent: CaseBlock;
1480 readonly expression: Expression;
1481 readonly statements: NodeArray<Statement>;
1483 export interface DefaultClause extends Node {
1484 readonly kind: SyntaxKind.DefaultClause;
1485 readonly parent: CaseBlock;
1486 readonly statements: NodeArray<Statement>;
1488 export type CaseOrDefaultClause = CaseClause | DefaultClause;
1489 export interface LabeledStatement extends Statement, JSDocContainer {
1490 readonly kind: SyntaxKind.LabeledStatement;
1491 readonly label: Identifier;
1492 readonly statement: Statement;
1494 export interface ThrowStatement extends Statement {
1495 readonly kind: SyntaxKind.ThrowStatement;
1496 readonly expression: Expression;
1498 export interface TryStatement extends Statement {
1499 readonly kind: SyntaxKind.TryStatement;
1500 readonly tryBlock: Block;
1501 readonly catchClause?: CatchClause;
1502 readonly finallyBlock?: Block;
1504 export interface CatchClause extends Node {
1505 readonly kind: SyntaxKind.CatchClause;
1506 readonly parent: TryStatement;
1507 readonly variableDeclaration?: VariableDeclaration;
1508 readonly block: Block;
1510 export type ObjectTypeDeclaration = ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode;
1511 export type DeclarationWithTypeParameters = DeclarationWithTypeParameterChildren | JSDocTypedefTag | JSDocCallbackTag | JSDocSignature;
1512 export type DeclarationWithTypeParameterChildren = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag;
1513 export interface ClassLikeDeclarationBase extends NamedDeclaration, JSDocContainer {
1514 readonly kind: SyntaxKind.ClassDeclaration | SyntaxKind.ClassExpression;
1515 readonly name?: Identifier;
1516 readonly typeParameters?: NodeArray<TypeParameterDeclaration>;
1517 readonly heritageClauses?: NodeArray<HeritageClause>;
1518 readonly members: NodeArray<ClassElement>;
1520 export interface ClassDeclaration extends ClassLikeDeclarationBase, DeclarationStatement {
1521 readonly kind: SyntaxKind.ClassDeclaration;
1522 /** May be undefined in `export default class { ... }`. */
1523 readonly name?: Identifier;
1525 export interface ClassExpression extends ClassLikeDeclarationBase, PrimaryExpression {
1526 readonly kind: SyntaxKind.ClassExpression;
1528 export type ClassLikeDeclaration = ClassDeclaration | ClassExpression;
1529 export interface ClassElement extends NamedDeclaration {
1530 _classElementBrand: any;
1531 readonly name?: PropertyName;
1533 export interface TypeElement extends NamedDeclaration {
1534 _typeElementBrand: any;
1535 readonly name?: PropertyName;
1536 readonly questionToken?: QuestionToken;
1538 export interface InterfaceDeclaration extends DeclarationStatement, JSDocContainer {
1539 readonly kind: SyntaxKind.InterfaceDeclaration;
1540 readonly name: Identifier;
1541 readonly typeParameters?: NodeArray<TypeParameterDeclaration>;
1542 readonly heritageClauses?: NodeArray<HeritageClause>;
1543 readonly members: NodeArray<TypeElement>;
1545 export interface HeritageClause extends Node {
1546 readonly kind: SyntaxKind.HeritageClause;
1547 readonly parent: InterfaceDeclaration | ClassLikeDeclaration;
1548 readonly token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword;
1549 readonly types: NodeArray<ExpressionWithTypeArguments>;
1551 export interface TypeAliasDeclaration extends DeclarationStatement, JSDocContainer {
1552 readonly kind: SyntaxKind.TypeAliasDeclaration;
1553 readonly name: Identifier;
1554 readonly typeParameters?: NodeArray<TypeParameterDeclaration>;
1555 readonly type: TypeNode;
1557 export interface EnumMember extends NamedDeclaration, JSDocContainer {
1558 readonly kind: SyntaxKind.EnumMember;
1559 readonly parent: EnumDeclaration;
1560 readonly name: PropertyName;
1561 readonly initializer?: Expression;
1563 export interface EnumDeclaration extends DeclarationStatement, JSDocContainer {
1564 readonly kind: SyntaxKind.EnumDeclaration;
1565 readonly name: Identifier;
1566 readonly members: NodeArray<EnumMember>;
1568 export type ModuleName = Identifier | StringLiteral;
1569 export type ModuleBody = NamespaceBody | JSDocNamespaceBody;
1570 export interface ModuleDeclaration extends DeclarationStatement, JSDocContainer {
1571 readonly kind: SyntaxKind.ModuleDeclaration;
1572 readonly parent: ModuleBody | SourceFile;
1573 readonly name: ModuleName;
1574 readonly body?: ModuleBody | JSDocNamespaceDeclaration;
1576 export type NamespaceBody = ModuleBlock | NamespaceDeclaration;
1577 export interface NamespaceDeclaration extends ModuleDeclaration {
1578 readonly name: Identifier;
1579 readonly body: NamespaceBody;
1581 export type JSDocNamespaceBody = Identifier | JSDocNamespaceDeclaration;
1582 export interface JSDocNamespaceDeclaration extends ModuleDeclaration {
1583 readonly name: Identifier;
1584 readonly body?: JSDocNamespaceBody;
1586 export interface ModuleBlock extends Node, Statement {
1587 readonly kind: SyntaxKind.ModuleBlock;
1588 readonly parent: ModuleDeclaration;
1589 readonly statements: NodeArray<Statement>;
1591 export type ModuleReference = EntityName | ExternalModuleReference;
1594 * - import x = require("mod");
1597 export interface ImportEqualsDeclaration extends DeclarationStatement, JSDocContainer {
1598 readonly kind: SyntaxKind.ImportEqualsDeclaration;
1599 readonly parent: SourceFile | ModuleBlock;
1600 readonly name: Identifier;
1601 readonly moduleReference: ModuleReference;
1603 export interface ExternalModuleReference extends Node {
1604 readonly kind: SyntaxKind.ExternalModuleReference;
1605 readonly parent: ImportEqualsDeclaration;
1606 readonly expression: Expression;
1608 export interface ImportDeclaration extends Statement, JSDocContainer {
1609 readonly kind: SyntaxKind.ImportDeclaration;
1610 readonly parent: SourceFile | ModuleBlock;
1611 readonly importClause?: ImportClause;
1612 /** If this is not a StringLiteral it will be a grammar error. */
1613 readonly moduleSpecifier: Expression;
1615 export type NamedImportBindings = NamespaceImport | NamedImports;
1616 export type NamedExportBindings = NamespaceExport | NamedExports;
1617 export interface ImportClause extends NamedDeclaration {
1618 readonly kind: SyntaxKind.ImportClause;
1619 readonly parent: ImportDeclaration;
1620 readonly isTypeOnly: boolean;
1621 readonly name?: Identifier;
1622 readonly namedBindings?: NamedImportBindings;
1624 export interface NamespaceImport extends NamedDeclaration {
1625 readonly kind: SyntaxKind.NamespaceImport;
1626 readonly parent: ImportClause;
1627 readonly name: Identifier;
1629 export interface NamespaceExport extends NamedDeclaration {
1630 readonly kind: SyntaxKind.NamespaceExport;
1631 readonly parent: ExportDeclaration;
1632 readonly name: Identifier;
1634 export interface NamespaceExportDeclaration extends DeclarationStatement, JSDocContainer {
1635 readonly kind: SyntaxKind.NamespaceExportDeclaration;
1636 readonly name: Identifier;
1638 export interface ExportDeclaration extends DeclarationStatement, JSDocContainer {
1639 readonly kind: SyntaxKind.ExportDeclaration;
1640 readonly parent: SourceFile | ModuleBlock;
1641 readonly isTypeOnly: boolean;
1642 /** Will not be assigned in the case of `export * from "foo";` */
1643 readonly exportClause?: NamedExportBindings;
1644 /** If this is not a StringLiteral it will be a grammar error. */
1645 readonly moduleSpecifier?: Expression;
1647 export interface NamedImports extends Node {
1648 readonly kind: SyntaxKind.NamedImports;
1649 readonly parent: ImportClause;
1650 readonly elements: NodeArray<ImportSpecifier>;
1652 export interface NamedExports extends Node {
1653 readonly kind: SyntaxKind.NamedExports;
1654 readonly parent: ExportDeclaration;
1655 readonly elements: NodeArray<ExportSpecifier>;
1657 export type NamedImportsOrExports = NamedImports | NamedExports;
1658 export interface ImportSpecifier extends NamedDeclaration {
1659 readonly kind: SyntaxKind.ImportSpecifier;
1660 readonly parent: NamedImports;
1661 readonly propertyName?: Identifier;
1662 readonly name: Identifier;
1664 export interface ExportSpecifier extends NamedDeclaration {
1665 readonly kind: SyntaxKind.ExportSpecifier;
1666 readonly parent: NamedExports;
1667 readonly propertyName?: Identifier;
1668 readonly name: Identifier;
1670 export type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier;
1671 export type TypeOnlyCompatibleAliasDeclaration = ImportClause | NamespaceImport | ImportOrExportSpecifier;
1673 * This is either an `export =` or an `export default` declaration.
1674 * Unless `isExportEquals` is set, this node was parsed as an `export default`.
1676 export interface ExportAssignment extends DeclarationStatement, JSDocContainer {
1677 readonly kind: SyntaxKind.ExportAssignment;
1678 readonly parent: SourceFile;
1679 readonly isExportEquals?: boolean;
1680 readonly expression: Expression;
1682 export interface FileReference extends TextRange {
1685 export interface CheckJsDirective extends TextRange {
1688 export type CommentKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia;
1689 export interface CommentRange extends TextRange {
1690 hasTrailingNewLine?: boolean;
1693 export interface SynthesizedComment extends CommentRange {
1697 hasLeadingNewline?: boolean;
1699 export interface JSDocTypeExpression extends TypeNode {
1700 readonly kind: SyntaxKind.JSDocTypeExpression;
1701 readonly type: TypeNode;
1703 export interface JSDocNameReference extends Node {
1704 readonly kind: SyntaxKind.JSDocNameReference;
1705 readonly name: EntityName;
1707 export interface JSDocType extends TypeNode {
1708 _jsDocTypeBrand: any;
1710 export interface JSDocAllType extends JSDocType {
1711 readonly kind: SyntaxKind.JSDocAllType;
1713 export interface JSDocUnknownType extends JSDocType {
1714 readonly kind: SyntaxKind.JSDocUnknownType;
1716 export interface JSDocNonNullableType extends JSDocType {
1717 readonly kind: SyntaxKind.JSDocNonNullableType;
1718 readonly type: TypeNode;
1720 export interface JSDocNullableType extends JSDocType {
1721 readonly kind: SyntaxKind.JSDocNullableType;
1722 readonly type: TypeNode;
1724 export interface JSDocOptionalType extends JSDocType {
1725 readonly kind: SyntaxKind.JSDocOptionalType;
1726 readonly type: TypeNode;
1728 export interface JSDocFunctionType extends JSDocType, SignatureDeclarationBase {
1729 readonly kind: SyntaxKind.JSDocFunctionType;
1731 export interface JSDocVariadicType extends JSDocType {
1732 readonly kind: SyntaxKind.JSDocVariadicType;
1733 readonly type: TypeNode;
1735 export interface JSDocNamepathType extends JSDocType {
1736 readonly kind: SyntaxKind.JSDocNamepathType;
1737 readonly type: TypeNode;
1739 export type JSDocTypeReferencingNode = JSDocVariadicType | JSDocOptionalType | JSDocNullableType | JSDocNonNullableType;
1740 export interface JSDoc extends Node {
1741 readonly kind: SyntaxKind.JSDocComment;
1742 readonly parent: HasJSDoc;
1743 readonly tags?: NodeArray<JSDocTag>;
1744 readonly comment?: string;
1746 export interface JSDocTag extends Node {
1747 readonly parent: JSDoc | JSDocTypeLiteral;
1748 readonly tagName: Identifier;
1749 readonly comment?: string;
1751 export interface JSDocUnknownTag extends JSDocTag {
1752 readonly kind: SyntaxKind.JSDocTag;
1755 * Note that `@extends` is a synonym of `@augments`.
1756 * Both tags are represented by this interface.
1758 export interface JSDocAugmentsTag extends JSDocTag {
1759 readonly kind: SyntaxKind.JSDocAugmentsTag;
1760 readonly class: ExpressionWithTypeArguments & {
1761 readonly expression: Identifier | PropertyAccessEntityNameExpression;
1764 export interface JSDocImplementsTag extends JSDocTag {
1765 readonly kind: SyntaxKind.JSDocImplementsTag;
1766 readonly class: ExpressionWithTypeArguments & {
1767 readonly expression: Identifier | PropertyAccessEntityNameExpression;
1770 export interface JSDocAuthorTag extends JSDocTag {
1771 readonly kind: SyntaxKind.JSDocAuthorTag;
1773 export interface JSDocDeprecatedTag extends JSDocTag {
1774 kind: SyntaxKind.JSDocDeprecatedTag;
1776 export interface JSDocClassTag extends JSDocTag {
1777 readonly kind: SyntaxKind.JSDocClassTag;
1779 export interface JSDocPublicTag extends JSDocTag {
1780 readonly kind: SyntaxKind.JSDocPublicTag;
1782 export interface JSDocPrivateTag extends JSDocTag {
1783 readonly kind: SyntaxKind.JSDocPrivateTag;
1785 export interface JSDocProtectedTag extends JSDocTag {
1786 readonly kind: SyntaxKind.JSDocProtectedTag;
1788 export interface JSDocReadonlyTag extends JSDocTag {
1789 readonly kind: SyntaxKind.JSDocReadonlyTag;
1791 export interface JSDocEnumTag extends JSDocTag, Declaration {
1792 readonly kind: SyntaxKind.JSDocEnumTag;
1793 readonly parent: JSDoc;
1794 readonly typeExpression: JSDocTypeExpression;
1796 export interface JSDocThisTag extends JSDocTag {
1797 readonly kind: SyntaxKind.JSDocThisTag;
1798 readonly typeExpression: JSDocTypeExpression;
1800 export interface JSDocTemplateTag extends JSDocTag {
1801 readonly kind: SyntaxKind.JSDocTemplateTag;
1802 readonly constraint: JSDocTypeExpression | undefined;
1803 readonly typeParameters: NodeArray<TypeParameterDeclaration>;
1805 export interface JSDocSeeTag extends JSDocTag {
1806 readonly kind: SyntaxKind.JSDocSeeTag;
1807 readonly name?: JSDocNameReference;
1809 export interface JSDocReturnTag extends JSDocTag {
1810 readonly kind: SyntaxKind.JSDocReturnTag;
1811 readonly typeExpression?: JSDocTypeExpression;
1813 export interface JSDocTypeTag extends JSDocTag {
1814 readonly kind: SyntaxKind.JSDocTypeTag;
1815 readonly typeExpression: JSDocTypeExpression;
1817 export interface JSDocTypedefTag extends JSDocTag, NamedDeclaration {
1818 readonly kind: SyntaxKind.JSDocTypedefTag;
1819 readonly parent: JSDoc;
1820 readonly fullName?: JSDocNamespaceDeclaration | Identifier;
1821 readonly name?: Identifier;
1822 readonly typeExpression?: JSDocTypeExpression | JSDocTypeLiteral;
1824 export interface JSDocCallbackTag extends JSDocTag, NamedDeclaration {
1825 readonly kind: SyntaxKind.JSDocCallbackTag;
1826 readonly parent: JSDoc;
1827 readonly fullName?: JSDocNamespaceDeclaration | Identifier;
1828 readonly name?: Identifier;
1829 readonly typeExpression: JSDocSignature;
1831 export interface JSDocSignature extends JSDocType, Declaration {
1832 readonly kind: SyntaxKind.JSDocSignature;
1833 readonly typeParameters?: readonly JSDocTemplateTag[];
1834 readonly parameters: readonly JSDocParameterTag[];
1835 readonly type: JSDocReturnTag | undefined;
1837 export interface JSDocPropertyLikeTag extends JSDocTag, Declaration {
1838 readonly parent: JSDoc;
1839 readonly name: EntityName;
1840 readonly typeExpression?: JSDocTypeExpression;
1841 /** Whether the property name came before the type -- non-standard for JSDoc, but Typescript-like */
1842 readonly isNameFirst: boolean;
1843 readonly isBracketed: boolean;
1845 export interface JSDocPropertyTag extends JSDocPropertyLikeTag {
1846 readonly kind: SyntaxKind.JSDocPropertyTag;
1848 export interface JSDocParameterTag extends JSDocPropertyLikeTag {
1849 readonly kind: SyntaxKind.JSDocParameterTag;
1851 export interface JSDocTypeLiteral extends JSDocType {
1852 readonly kind: SyntaxKind.JSDocTypeLiteral;
1853 readonly jsDocPropertyTags?: readonly JSDocPropertyLikeTag[];
1854 /** If true, then this type literal represents an *array* of its type. */
1855 readonly isArrayType: boolean;
1857 export enum FlowFlags {
1864 FalseCondition = 64,
1866 ArrayMutation = 256,
1874 export type FlowNode = FlowStart | FlowLabel | FlowAssignment | FlowCall | FlowCondition | FlowSwitchClause | FlowArrayMutation | FlowCall | FlowReduceLabel;
1875 export interface FlowNodeBase {
1879 export interface FlowStart extends FlowNodeBase {
1880 node?: FunctionExpression | ArrowFunction | MethodDeclaration;
1882 export interface FlowLabel extends FlowNodeBase {
1883 antecedents: FlowNode[] | undefined;
1885 export interface FlowAssignment extends FlowNodeBase {
1886 node: Expression | VariableDeclaration | BindingElement;
1887 antecedent: FlowNode;
1889 export interface FlowCall extends FlowNodeBase {
1890 node: CallExpression;
1891 antecedent: FlowNode;
1893 export interface FlowCondition extends FlowNodeBase {
1895 antecedent: FlowNode;
1897 export interface FlowSwitchClause extends FlowNodeBase {
1898 switchStatement: SwitchStatement;
1899 clauseStart: number;
1901 antecedent: FlowNode;
1903 export interface FlowArrayMutation extends FlowNodeBase {
1904 node: CallExpression | BinaryExpression;
1905 antecedent: FlowNode;
1907 export interface FlowReduceLabel extends FlowNodeBase {
1909 antecedents: FlowNode[];
1910 antecedent: FlowNode;
1912 export type FlowType = Type | IncompleteType;
1913 export interface IncompleteType {
1917 export interface AmdDependency {
1921 export interface SourceFile extends Declaration {
1922 readonly kind: SyntaxKind.SourceFile;
1923 readonly statements: NodeArray<Statement>;
1924 readonly endOfFileToken: Token<SyntaxKind.EndOfFileToken>;
1927 amdDependencies: readonly AmdDependency[];
1928 moduleName?: string;
1929 referencedFiles: readonly FileReference[];
1930 typeReferenceDirectives: readonly FileReference[];
1931 libReferenceDirectives: readonly FileReference[];
1932 languageVariant: LanguageVariant;
1933 isDeclarationFile: boolean;
1935 * lib.d.ts should have a reference comment like
1937 * /// <reference no-default-lib="true"/>
1939 * If any other file has this comment, it signals not to include lib.d.ts
1940 * because this containing file is intended to act as a default library.
1942 hasNoDefaultLib: boolean;
1943 languageVersion: ScriptTarget;
1945 export interface Bundle extends Node {
1946 readonly kind: SyntaxKind.Bundle;
1947 readonly prepends: readonly (InputFiles | UnparsedSource)[];
1948 readonly sourceFiles: readonly SourceFile[];
1950 export interface InputFiles extends Node {
1951 readonly kind: SyntaxKind.InputFiles;
1952 javascriptPath?: string;
1953 javascriptText: string;
1954 javascriptMapPath?: string;
1955 javascriptMapText?: string;
1956 declarationPath?: string;
1957 declarationText: string;
1958 declarationMapPath?: string;
1959 declarationMapText?: string;
1961 export interface UnparsedSource extends Node {
1962 readonly kind: SyntaxKind.UnparsedSource;
1965 readonly prologues: readonly UnparsedPrologue[];
1966 helpers: readonly UnscopedEmitHelper[] | undefined;
1967 referencedFiles: readonly FileReference[];
1968 typeReferenceDirectives: readonly string[] | undefined;
1969 libReferenceDirectives: readonly FileReference[];
1970 hasNoDefaultLib?: boolean;
1971 sourceMapPath?: string;
1972 sourceMapText?: string;
1973 readonly syntheticReferences?: readonly UnparsedSyntheticReference[];
1974 readonly texts: readonly UnparsedSourceText[];
1976 export type UnparsedSourceText = UnparsedPrepend | UnparsedTextLike;
1977 export type UnparsedNode = UnparsedPrologue | UnparsedSourceText | UnparsedSyntheticReference;
1978 export interface UnparsedSection extends Node {
1979 readonly kind: SyntaxKind;
1980 readonly parent: UnparsedSource;
1981 readonly data?: string;
1983 export interface UnparsedPrologue extends UnparsedSection {
1984 readonly kind: SyntaxKind.UnparsedPrologue;
1985 readonly parent: UnparsedSource;
1986 readonly data: string;
1988 export interface UnparsedPrepend extends UnparsedSection {
1989 readonly kind: SyntaxKind.UnparsedPrepend;
1990 readonly parent: UnparsedSource;
1991 readonly data: string;
1992 readonly texts: readonly UnparsedTextLike[];
1994 export interface UnparsedTextLike extends UnparsedSection {
1995 readonly kind: SyntaxKind.UnparsedText | SyntaxKind.UnparsedInternalText;
1996 readonly parent: UnparsedSource;
1998 export interface UnparsedSyntheticReference extends UnparsedSection {
1999 readonly kind: SyntaxKind.UnparsedSyntheticReference;
2000 readonly parent: UnparsedSource;
2002 export interface JsonSourceFile extends SourceFile {
2003 readonly statements: NodeArray<JsonObjectExpressionStatement>;
2005 export interface TsConfigSourceFile extends JsonSourceFile {
2006 extendedSourceFiles?: string[];
2008 export interface JsonMinusNumericLiteral extends PrefixUnaryExpression {
2009 readonly kind: SyntaxKind.PrefixUnaryExpression;
2010 readonly operator: SyntaxKind.MinusToken;
2011 readonly operand: NumericLiteral;
2013 export type JsonObjectExpression = ObjectLiteralExpression | ArrayLiteralExpression | JsonMinusNumericLiteral | NumericLiteral | StringLiteral | BooleanLiteral | NullLiteral;
2014 export interface JsonObjectExpressionStatement extends ExpressionStatement {
2015 readonly expression: JsonObjectExpression;
2017 export interface ScriptReferenceHost {
2018 getCompilerOptions(): CompilerOptions;
2019 getSourceFile(fileName: string): SourceFile | undefined;
2020 getSourceFileByPath(path: Path): SourceFile | undefined;
2021 getCurrentDirectory(): string;
2023 export interface ParseConfigHost {
2024 useCaseSensitiveFileNames: boolean;
2025 readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number): readonly string[];
2027 * Gets a value indicating whether the specified path exists and is a file.
2028 * @param path The path to test.
2030 fileExists(path: string): boolean;
2031 readFile(path: string): string | undefined;
2032 trace?(s: string): void;
2035 * Branded string for keeping track of when we've turned an ambiguous path
2036 * specified like "./blah" to an absolute path to an actual
2037 * tsconfig file, e.g. "/root/blah/tsconfig.json"
2039 export type ResolvedConfigFileName = string & {
2040 _isResolvedConfigFileName: never;
2042 export type WriteFileCallback = (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[]) => void;
2043 export class OperationCanceledException {
2045 export interface CancellationToken {
2046 isCancellationRequested(): boolean;
2047 /** @throws OperationCanceledException if isCancellationRequested is true */
2048 throwIfCancellationRequested(): void;
2050 export interface Program extends ScriptReferenceHost {
2051 getCurrentDirectory(): string;
2053 * Get a list of root file names that were passed to a 'createProgram'
2055 getRootFileNames(): readonly string[];
2057 * Get a list of files in the program
2059 getSourceFiles(): readonly SourceFile[];
2061 * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then
2062 * the JavaScript and declaration files will be produced for all the files in this program.
2063 * If targetSourceFile is specified, then only the JavaScript and declaration for that
2064 * specific file will be generated.
2066 * If writeFile is not specified then the writeFile callback from the compiler host will be
2067 * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter
2068 * will be invoked when writing the JavaScript and declaration files.
2070 emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult;
2071 getOptionsDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
2072 getGlobalDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
2073 getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[];
2074 /** The first time this is called, it will return global diagnostics (no location). */
2075 getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
2076 getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[];
2077 getConfigFileParsingDiagnostics(): readonly Diagnostic[];
2079 * Gets a type checker that can be used to semantically analyze source files in the program.
2081 getTypeChecker(): TypeChecker;
2082 getTypeCatalog(): readonly Type[];
2083 getNodeCount(): number;
2084 getIdentifierCount(): number;
2085 getSymbolCount(): number;
2086 getTypeCount(): number;
2087 getInstantiationCount(): number;
2088 getRelationCacheSizes(): {
2092 strictSubtype: number;
2094 isSourceFileFromExternalLibrary(file: SourceFile): boolean;
2095 isSourceFileDefaultLibrary(file: SourceFile): boolean;
2096 getProjectReferences(): readonly ProjectReference[] | undefined;
2097 getResolvedProjectReferences(): readonly (ResolvedProjectReference | undefined)[] | undefined;
2099 export interface ResolvedProjectReference {
2100 commandLine: ParsedCommandLine;
2101 sourceFile: SourceFile;
2102 references?: readonly (ResolvedProjectReference | undefined)[];
2104 export type CustomTransformerFactory = (context: TransformationContext) => CustomTransformer;
2105 export interface CustomTransformer {
2106 transformSourceFile(node: SourceFile): SourceFile;
2107 transformBundle(node: Bundle): Bundle;
2109 export interface CustomTransformers {
2110 /** Custom transformers to evaluate before built-in .js transformations. */
2111 before?: (TransformerFactory<SourceFile> | CustomTransformerFactory)[];
2112 /** Custom transformers to evaluate after built-in .js transformations. */
2113 after?: (TransformerFactory<SourceFile> | CustomTransformerFactory)[];
2114 /** Custom transformers to evaluate after built-in .d.ts transformations. */
2115 afterDeclarations?: (TransformerFactory<Bundle | SourceFile> | CustomTransformerFactory)[];
2117 export interface SourceMapSpan {
2118 /** Line number in the .js file. */
2119 emittedLine: number;
2120 /** Column number in the .js file. */
2121 emittedColumn: number;
2122 /** Line number in the .ts file. */
2124 /** Column number in the .ts file. */
2125 sourceColumn: number;
2126 /** Optional name (index into names array) associated with this span. */
2128 /** .ts file (index into sources array) associated with this span */
2129 sourceIndex: number;
2131 /** Return code used by getEmitOutput function to indicate status of the function */
2132 export enum ExitStatus {
2134 DiagnosticsPresent_OutputsSkipped = 1,
2135 DiagnosticsPresent_OutputsGenerated = 2,
2136 InvalidProject_OutputsSkipped = 3,
2137 ProjectReferenceCycle_OutputsSkipped = 4,
2138 /** @deprecated Use ProjectReferenceCycle_OutputsSkipped instead. */
2139 ProjectReferenceCycle_OutputsSkupped = 4
2141 export interface EmitResult {
2142 emitSkipped: boolean;
2143 /** Contains declaration emit diagnostics */
2144 diagnostics: readonly Diagnostic[];
2145 emittedFiles?: string[];
2147 export interface TypeChecker {
2148 getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type;
2149 getDeclaredTypeOfSymbol(symbol: Symbol): Type;
2150 getPropertiesOfType(type: Type): Symbol[];
2151 getPropertyOfType(type: Type, propertyName: string): Symbol | undefined;
2152 getPrivateIdentifierPropertyOfType(leftType: Type, name: string, location: Node): Symbol | undefined;
2153 getIndexInfoOfType(type: Type, kind: IndexKind): IndexInfo | undefined;
2154 getSignaturesOfType(type: Type, kind: SignatureKind): readonly Signature[];
2155 getIndexTypeOfType(type: Type, kind: IndexKind): Type | undefined;
2156 getBaseTypes(type: InterfaceType): BaseType[];
2157 getBaseTypeOfLiteralType(type: Type): Type;
2158 getWidenedType(type: Type): Type;
2159 getReturnTypeOfSignature(signature: Signature): Type;
2160 getNullableType(type: Type, flags: TypeFlags): Type;
2161 getNonNullableType(type: Type): Type;
2162 getTypeArguments(type: TypeReference): readonly Type[];
2163 /** Note that the resulting nodes cannot be checked. */
2164 typeToTypeNode(type: Type, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): TypeNode | undefined;
2165 /** Note that the resulting nodes cannot be checked. */
2166 signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): SignatureDeclaration & {
2167 typeArguments?: NodeArray<TypeNode>;
2169 /** Note that the resulting nodes cannot be checked. */
2170 indexInfoToIndexSignatureDeclaration(indexInfo: IndexInfo, kind: IndexKind, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): IndexSignatureDeclaration | undefined;
2171 /** Note that the resulting nodes cannot be checked. */
2172 symbolToEntityName(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): EntityName | undefined;
2173 /** Note that the resulting nodes cannot be checked. */
2174 symbolToExpression(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): Expression | undefined;
2175 /** Note that the resulting nodes cannot be checked. */
2176 symbolToTypeParameterDeclarations(symbol: Symbol, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): NodeArray<TypeParameterDeclaration> | undefined;
2177 /** Note that the resulting nodes cannot be checked. */
2178 symbolToParameterDeclaration(symbol: Symbol, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): ParameterDeclaration | undefined;
2179 /** Note that the resulting nodes cannot be checked. */
2180 typeParameterToDeclaration(parameter: TypeParameter, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): TypeParameterDeclaration | undefined;
2181 getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[];
2182 getSymbolAtLocation(node: Node): Symbol | undefined;
2183 getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[];
2185 * The function returns the value (local variable) symbol of an identifier in the short-hand property assignment.
2186 * This is necessary as an identifier in short-hand property assignment can contains two meaning: property name and property value.
2188 getShorthandAssignmentValueSymbol(location: Node): Symbol | undefined;
2189 getExportSpecifierLocalTargetSymbol(location: ExportSpecifier | Identifier): Symbol | undefined;
2191 * If a symbol is a local symbol with an associated exported symbol, returns the exported symbol.
2192 * Otherwise returns its input.
2193 * For example, at `export type T = number;`:
2194 * - `getSymbolAtLocation` at the location `T` will return the exported symbol for `T`.
2195 * - But the result of `getSymbolsInScope` will contain the *local* symbol for `T`, not the exported symbol.
2196 * - Calling `getExportSymbolOfSymbol` on that local symbol will return the exported symbol.
2198 getExportSymbolOfSymbol(symbol: Symbol): Symbol;
2199 getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol | undefined;
2200 getTypeOfAssignmentPattern(pattern: AssignmentPattern): Type;
2201 getTypeAtLocation(node: Node): Type;
2202 getTypeFromTypeNode(node: TypeNode): Type;
2203 signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string;
2204 typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string;
2205 symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): string;
2206 typePredicateToString(predicate: TypePredicate, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string;
2207 getFullyQualifiedName(symbol: Symbol): string;
2208 getAugmentedPropertiesOfType(type: Type): Symbol[];
2209 getRootSymbols(symbol: Symbol): readonly Symbol[];
2210 getSymbolOfExpando(node: Node, allowDeclaration: boolean): Symbol | undefined;
2211 getContextualType(node: Expression): Type | undefined;
2213 * returns unknownSignature in the case of an error.
2214 * returns undefined if the node is not valid.
2215 * @param argumentCount Apparent number of arguments, passed in case of a possibly incomplete call. This should come from an ArgumentListInfo. See `signatureHelp.ts`.
2217 getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[], argumentCount?: number): Signature | undefined;
2218 getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature | undefined;
2219 isImplementationOfOverload(node: SignatureDeclaration): boolean | undefined;
2220 isUndefinedSymbol(symbol: Symbol): boolean;
2221 isArgumentsSymbol(symbol: Symbol): boolean;
2222 isUnknownSymbol(symbol: Symbol): boolean;
2223 getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): string | number | undefined;
2224 isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName | ImportTypeNode, propertyName: string): boolean;
2225 /** Follow all aliases to get the original symbol. */
2226 getAliasedSymbol(symbol: Symbol): Symbol;
2227 getExportsOfModule(moduleSymbol: Symbol): Symbol[];
2228 getJsxIntrinsicTagNamesAt(location: Node): Symbol[];
2229 isOptionalParameter(node: ParameterDeclaration): boolean;
2230 getAmbientModules(): Symbol[];
2231 tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined;
2232 getApparentType(type: Type): Type;
2233 getBaseConstraintOfType(type: Type): Type | undefined;
2234 getDefaultFromTypeParameter(type: Type): Type | undefined;
2236 * Depending on the operation performed, it may be appropriate to throw away the checker
2237 * if the cancellation token is triggered. Typically, if it is used for error checking
2238 * and the operation is cancelled, then it should be discarded, otherwise it is safe to keep.
2240 runWithCancellationToken<T>(token: CancellationToken, cb: (checker: TypeChecker) => T): T;
2242 export enum NodeBuilderFlags {
2245 WriteArrayAsGenericType = 2,
2246 GenerateNamesForShadowedTypeParams = 4,
2247 UseStructuralFallback = 8,
2248 ForbidIndexedAccessSymbolReferences = 16,
2249 WriteTypeArgumentsOfSignature = 32,
2250 UseFullyQualifiedType = 64,
2251 UseOnlyExternalAliasing = 128,
2252 SuppressAnyReturnType = 256,
2253 WriteTypeParametersInQualifiedName = 512,
2254 MultilineObjectLiterals = 1024,
2255 WriteClassExpressionAsTypeLiteral = 2048,
2256 UseTypeOfFunction = 4096,
2257 OmitParameterModifiers = 8192,
2258 UseAliasDefinedOutsideCurrentScope = 16384,
2259 UseSingleQuotesForStringLiteralType = 268435456,
2260 NoTypeReduction = 536870912,
2261 NoUndefinedOptionalParameterType = 1073741824,
2262 AllowThisInObjectLiteral = 32768,
2263 AllowQualifedNameInPlaceOfIdentifier = 65536,
2264 AllowAnonymousIdentifier = 131072,
2265 AllowEmptyUnionOrIntersection = 262144,
2266 AllowEmptyTuple = 524288,
2267 AllowUniqueESSymbolType = 1048576,
2268 AllowEmptyIndexInfoType = 2097152,
2269 AllowNodeModulesRelativePaths = 67108864,
2270 IgnoreErrors = 70221824,
2271 InObjectTypeLiteral = 4194304,
2272 InTypeAlias = 8388608,
2273 InInitialEntityName = 16777216,
2274 InReverseMappedType = 33554432
2276 export enum TypeFormatFlags {
2279 WriteArrayAsGenericType = 2,
2280 UseStructuralFallback = 8,
2281 WriteTypeArgumentsOfSignature = 32,
2282 UseFullyQualifiedType = 64,
2283 SuppressAnyReturnType = 256,
2284 MultilineObjectLiterals = 1024,
2285 WriteClassExpressionAsTypeLiteral = 2048,
2286 UseTypeOfFunction = 4096,
2287 OmitParameterModifiers = 8192,
2288 UseAliasDefinedOutsideCurrentScope = 16384,
2289 UseSingleQuotesForStringLiteralType = 268435456,
2290 NoTypeReduction = 536870912,
2291 AllowUniqueESSymbolType = 1048576,
2292 AddUndefined = 131072,
2293 WriteArrowStyleSignature = 262144,
2294 InArrayType = 524288,
2295 InElementType = 2097152,
2296 InFirstTypeArgument = 4194304,
2297 InTypeAlias = 8388608,
2298 /** @deprecated */ WriteOwnNameForAnyLike = 0,
2299 NodeBuilderFlagsMask = 814775659
2301 export enum SymbolFormatFlags {
2303 WriteTypeParametersOrArguments = 1,
2304 UseOnlyExternalAliasing = 2,
2305 AllowAnyNodeKind = 4,
2306 UseAliasDefinedOutsideCurrentScope = 8,
2308 export enum TypePredicateKind {
2312 AssertsIdentifier = 3
2314 export interface TypePredicateBase {
2315 kind: TypePredicateKind;
2316 type: Type | undefined;
2318 export interface ThisTypePredicate extends TypePredicateBase {
2319 kind: TypePredicateKind.This;
2320 parameterName: undefined;
2321 parameterIndex: undefined;
2324 export interface IdentifierTypePredicate extends TypePredicateBase {
2325 kind: TypePredicateKind.Identifier;
2326 parameterName: string;
2327 parameterIndex: number;
2330 export interface AssertsThisTypePredicate extends TypePredicateBase {
2331 kind: TypePredicateKind.AssertsThis;
2332 parameterName: undefined;
2333 parameterIndex: undefined;
2334 type: Type | undefined;
2336 export interface AssertsIdentifierTypePredicate extends TypePredicateBase {
2337 kind: TypePredicateKind.AssertsIdentifier;
2338 parameterName: string;
2339 parameterIndex: number;
2340 type: Type | undefined;
2342 export type TypePredicate = ThisTypePredicate | IdentifierTypePredicate | AssertsThisTypePredicate | AssertsIdentifierTypePredicate;
2343 export enum SymbolFlags {
2345 FunctionScopedVariable = 1,
2346 BlockScopedVariable = 2,
2355 NamespaceModule = 1024,
2357 ObjectLiteral = 4096,
2359 Constructor = 16384,
2360 GetAccessor = 32768,
2361 SetAccessor = 65536,
2363 TypeParameter = 262144,
2365 ExportValue = 1048576,
2367 Prototype = 4194304,
2368 ExportStar = 8388608,
2369 Optional = 16777216,
2370 Transient = 33554432,
2371 Assignment = 67108864,
2372 ModuleExports = 134217728,
2380 FunctionScopedVariableExcludes = 111550,
2381 BlockScopedVariableExcludes = 111551,
2382 ParameterExcludes = 111551,
2383 PropertyExcludes = 0,
2384 EnumMemberExcludes = 900095,
2385 FunctionExcludes = 110991,
2386 ClassExcludes = 899503,
2387 InterfaceExcludes = 788872,
2388 RegularEnumExcludes = 899327,
2389 ConstEnumExcludes = 899967,
2390 ValueModuleExcludes = 110735,
2391 NamespaceModuleExcludes = 0,
2392 MethodExcludes = 103359,
2393 GetAccessorExcludes = 46015,
2394 SetAccessorExcludes = 78783,
2395 TypeParameterExcludes = 526824,
2396 TypeAliasExcludes = 788968,
2397 AliasExcludes = 2097152,
2398 ModuleMember = 2623475,
2399 ExportHasLocal = 944,
2401 PropertyOrAccessor = 98308,
2402 ClassMember = 106500,
2404 export interface Symbol {
2406 escapedName: __String;
2407 declarations: Declaration[];
2408 valueDeclaration: Declaration;
2409 members?: SymbolTable;
2410 exports?: SymbolTable;
2411 globalExports?: SymbolTable;
2413 export enum InternalSymbolName {
2415 Constructor = "__constructor",
2418 ExportStar = "__export",
2419 Global = "__global",
2420 Missing = "__missing",
2422 Object = "__object",
2423 JSXAttributes = "__jsxAttributes",
2425 Function = "__function",
2426 Computed = "__computed",
2427 Resolving = "__resolving__",
2428 ExportEquals = "export=",
2429 Default = "default",
2433 * This represents a string whose leading underscore have been escaped by adding extra leading underscores.
2434 * The shape of this brand is rather unique compared to others we've used.
2435 * Instead of just an intersection of a string and an object, it is that union-ed
2436 * with an intersection of void and an object. This makes it wholly incompatible
2437 * with a normal string (which is good, it cannot be misused on assignment or on usage),
2438 * while still being comparable with a normal string via === (also good) and castable from a string.
2440 export type __String = (string & {
2441 __escapedIdentifier: void;
2443 __escapedIdentifier: void;
2444 }) | InternalSymbolName;
2445 /** ReadonlyMap where keys are `__String`s. */
2446 export interface ReadonlyUnderscoreEscapedMap<T> extends ReadonlyESMap<__String, T> {
2448 /** Map where keys are `__String`s. */
2449 export interface UnderscoreEscapedMap<T> extends ESMap<__String, T>, ReadonlyUnderscoreEscapedMap<T> {
2451 /** SymbolTable based on ES6 Map interface. */
2452 export type SymbolTable = UnderscoreEscapedMap<Symbol>;
2453 export enum TypeFlags {
2461 StringLiteral = 128,
2462 NumberLiteral = 256,
2463 BooleanLiteral = 512,
2465 BigIntLiteral = 2048,
2467 UniqueESSymbol = 8192,
2472 TypeParameter = 262144,
2475 Intersection = 2097152,
2477 IndexedAccess = 8388608,
2478 Conditional = 16777216,
2479 Substitution = 33554432,
2480 NonPrimitive = 67108864,
2481 TemplateLiteral = 134217728,
2482 StringMapping = 268435456,
2485 StringOrNumberLiteral = 384,
2486 PossiblyFalsy = 117724,
2487 StringLike = 402653316,
2492 ESSymbolLike = 12288,
2494 UnionOrIntersection = 3145728,
2495 StructuredType = 3670016,
2496 TypeVariable = 8650752,
2497 InstantiableNonPrimitive = 58982400,
2498 InstantiablePrimitive = 406847488,
2499 Instantiable = 465829888,
2500 StructuredOrInstantiable = 469499904,
2501 Narrowable = 536624127,
2503 export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression;
2504 export interface Type {
2507 pattern?: DestructuringPattern;
2508 aliasSymbol?: Symbol;
2509 aliasTypeArguments?: readonly Type[];
2511 export interface LiteralType extends Type {
2512 value: string | number | PseudoBigInt;
2513 freshType: LiteralType;
2514 regularType: LiteralType;
2516 export interface UniqueESSymbolType extends Type {
2518 escapedName: __String;
2520 export interface StringLiteralType extends LiteralType {
2523 export interface NumberLiteralType extends LiteralType {
2526 export interface BigIntLiteralType extends LiteralType {
2527 value: PseudoBigInt;
2529 export interface EnumType extends Type {
2531 export enum ObjectFlags {
2539 ObjectLiteral = 128,
2540 EvolvingArray = 256,
2541 ObjectLiteralPatternWithComputedProperties = 512,
2542 ContainsSpread = 1024,
2543 ReverseMapped = 2048,
2544 JsxAttributes = 4096,
2547 FreshLiteral = 32768,
2548 ArrayLiteral = 65536,
2549 ObjectRestType = 131072,
2550 ClassOrInterface = 3,
2552 export interface ObjectType extends Type {
2553 objectFlags: ObjectFlags;
2555 /** Class and interface types (ObjectFlags.Class and ObjectFlags.Interface). */
2556 export interface InterfaceType extends ObjectType {
2557 typeParameters: TypeParameter[] | undefined;
2558 outerTypeParameters: TypeParameter[] | undefined;
2559 localTypeParameters: TypeParameter[] | undefined;
2560 thisType: TypeParameter | undefined;
2562 export type BaseType = ObjectType | IntersectionType | TypeVariable;
2563 export interface InterfaceTypeWithDeclaredMembers extends InterfaceType {
2564 declaredProperties: Symbol[];
2565 declaredCallSignatures: Signature[];
2566 declaredConstructSignatures: Signature[];
2567 declaredStringIndexInfo?: IndexInfo;
2568 declaredNumberIndexInfo?: IndexInfo;
2571 * Type references (ObjectFlags.Reference). When a class or interface has type parameters or
2572 * a "this" type, references to the class or interface are made using type references. The
2573 * typeArguments property specifies the types to substitute for the type parameters of the
2574 * class or interface and optionally includes an extra element that specifies the type to
2575 * substitute for "this" in the resulting instantiation. When no extra argument is present,
2576 * the type reference itself is substituted for "this". The typeArguments property is undefined
2577 * if the class or interface has no type parameters and the reference isn't specifying an
2578 * explicit "this" argument.
2580 export interface TypeReference extends ObjectType {
2581 target: GenericType;
2582 node?: TypeReferenceNode | ArrayTypeNode | TupleTypeNode;
2584 export interface DeferredTypeReference extends TypeReference {
2586 export interface GenericType extends InterfaceType, TypeReference {
2588 export enum ElementFlags {
2595 export interface TupleType extends GenericType {
2596 elementFlags: readonly ElementFlags[];
2598 fixedLength: number;
2599 hasRestElement: boolean;
2600 combinedFlags: ElementFlags;
2602 labeledElementDeclarations?: readonly (NamedTupleMember | ParameterDeclaration)[];
2604 export interface TupleTypeReference extends TypeReference {
2607 export interface UnionOrIntersectionType extends Type {
2610 export interface UnionType extends UnionOrIntersectionType {
2612 export interface IntersectionType extends UnionOrIntersectionType {
2614 export type StructuredType = ObjectType | UnionType | IntersectionType;
2615 export interface EvolvingArrayType extends ObjectType {
2617 finalArrayType?: Type;
2619 export interface InstantiableType extends Type {
2621 export interface TypeParameter extends InstantiableType {
2623 export interface IndexedAccessType extends InstantiableType {
2627 simplifiedForReading?: Type;
2628 simplifiedForWriting?: Type;
2630 export type TypeVariable = TypeParameter | IndexedAccessType;
2631 export interface IndexType extends InstantiableType {
2632 type: InstantiableType | UnionOrIntersectionType;
2634 export interface ConditionalRoot {
2635 node: ConditionalTypeNode;
2638 isDistributive: boolean;
2639 inferTypeParameters?: TypeParameter[];
2640 outerTypeParameters?: TypeParameter[];
2641 instantiations?: Map<Type>;
2642 aliasSymbol?: Symbol;
2643 aliasTypeArguments?: Type[];
2645 export interface ConditionalType extends InstantiableType {
2646 root: ConditionalRoot;
2649 resolvedTrueType: Type;
2650 resolvedFalseType: Type;
2652 export interface TemplateLiteralType extends InstantiableType {
2653 texts: readonly string[];
2654 types: readonly Type[];
2656 export interface StringMappingType extends InstantiableType {
2660 export interface SubstitutionType extends InstantiableType {
2664 export enum SignatureKind {
2668 export interface Signature {
2669 declaration?: SignatureDeclaration | JSDocSignature;
2670 typeParameters?: readonly TypeParameter[];
2671 parameters: readonly Symbol[];
2673 export enum IndexKind {
2677 export interface IndexInfo {
2679 isReadonly: boolean;
2680 declaration?: IndexSignatureDeclaration;
2682 export enum InferencePriority {
2683 NakedTypeVariable = 1,
2684 SpeculativeTuple = 2,
2685 HomomorphicMappedType = 4,
2686 PartialHomomorphicMappedType = 8,
2687 MappedTypeConstraint = 16,
2688 ContravariantConditional = 32,
2691 NoConstraints = 256,
2694 PriorityImpliesCombination = 208,
2697 /** @deprecated Use FileExtensionInfo instead. */
2698 export type JsFileExtensionInfo = FileExtensionInfo;
2699 export interface FileExtensionInfo {
2701 isMixedContent: boolean;
2702 scriptKind?: ScriptKind;
2704 export interface DiagnosticMessage {
2706 category: DiagnosticCategory;
2709 reportsUnnecessary?: {};
2710 reportsDeprecated?: {};
2713 * A linked list of formatted diagnostic messages to be used as part of a multiline message.
2714 * It is built from the bottom up, leaving the head to be the "main" diagnostic.
2715 * While it seems that DiagnosticMessageChain is structurally similar to DiagnosticMessage,
2716 * the difference is that messages are all preformatted in DMC.
2718 export interface DiagnosticMessageChain {
2719 messageText: string;
2720 category: DiagnosticCategory;
2722 next?: DiagnosticMessageChain[];
2724 export interface Diagnostic extends DiagnosticRelatedInformation {
2725 /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
2726 reportsUnnecessary?: {};
2727 reportsDeprecated?: {};
2729 relatedInformation?: DiagnosticRelatedInformation[];
2731 export interface DiagnosticRelatedInformation {
2732 category: DiagnosticCategory;
2734 file: SourceFile | undefined;
2735 start: number | undefined;
2736 length: number | undefined;
2737 messageText: string | DiagnosticMessageChain;
2739 export interface DiagnosticWithLocation extends Diagnostic {
2744 export enum DiagnosticCategory {
2750 export enum ModuleResolutionKind {
2754 export interface PluginImport {
2757 export interface ProjectReference {
2758 /** A normalized path on disk */
2760 /** The path as the user originally wrote it */
2761 originalPath?: string;
2762 /** True if the output of this reference should be prepended to the output of this project. Only valid for --outFile compilations */
2764 /** True if it is intended that this reference form a circularity */
2767 export enum WatchFileKind {
2768 FixedPollingInterval = 0,
2769 PriorityPollingInterval = 1,
2770 DynamicPriorityPolling = 2,
2772 UseFsEventsOnParentDirectory = 4
2774 export enum WatchDirectoryKind {
2776 FixedPollingInterval = 1,
2777 DynamicPriorityPolling = 2
2779 export enum PollingWatchKind {
2781 PriorityInterval = 1,
2784 export type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | PluginImport[] | ProjectReference[] | null | undefined;
2785 export interface CompilerOptions {
2787 allowSyntheticDefaultImports?: boolean;
2788 allowUmdGlobalAccess?: boolean;
2789 allowUnreachableCode?: boolean;
2790 allowUnusedLabels?: boolean;
2791 alwaysStrict?: boolean;
2795 declaration?: boolean;
2796 declarationMap?: boolean;
2797 emitDeclarationOnly?: boolean;
2798 declarationDir?: string;
2799 disableSizeLimit?: boolean;
2800 disableSourceOfProjectReferenceRedirect?: boolean;
2801 disableSolutionSearching?: boolean;
2802 disableReferencedProjectLoad?: boolean;
2803 downlevelIteration?: boolean;
2805 emitDecoratorMetadata?: boolean;
2806 experimentalDecorators?: boolean;
2807 forceConsistentCasingInFileNames?: boolean;
2808 importHelpers?: boolean;
2809 importsNotUsedAsValues?: ImportsNotUsedAsValues;
2810 inlineSourceMap?: boolean;
2811 inlineSources?: boolean;
2812 isolatedModules?: boolean;
2814 keyofStringsOnly?: boolean;
2818 maxNodeModuleJsDepth?: number;
2819 module?: ModuleKind;
2820 moduleResolution?: ModuleResolutionKind;
2821 newLine?: NewLineKind;
2823 noEmitHelpers?: boolean;
2824 noEmitOnError?: boolean;
2825 noErrorTruncation?: boolean;
2826 noFallthroughCasesInSwitch?: boolean;
2827 noImplicitAny?: boolean;
2828 noImplicitReturns?: boolean;
2829 noImplicitThis?: boolean;
2830 noStrictGenericChecks?: boolean;
2831 noUnusedLocals?: boolean;
2832 noUnusedParameters?: boolean;
2833 noImplicitUseStrict?: boolean;
2834 assumeChangesOnlyAffectDirectDependencies?: boolean;
2836 noResolve?: boolean;
2837 noUncheckedIndexedAccess?: boolean;
2841 paths?: MapLike<string[]>;
2842 preserveConstEnums?: boolean;
2843 preserveSymlinks?: boolean;
2845 reactNamespace?: string;
2846 jsxFactory?: string;
2847 jsxFragmentFactory?: string;
2848 jsxImportSource?: string;
2849 composite?: boolean;
2850 incremental?: boolean;
2851 tsBuildInfoFile?: string;
2852 removeComments?: boolean;
2854 rootDirs?: string[];
2855 skipLibCheck?: boolean;
2856 skipDefaultLibCheck?: boolean;
2857 sourceMap?: boolean;
2858 sourceRoot?: string;
2860 strictFunctionTypes?: boolean;
2861 strictBindCallApply?: boolean;
2862 strictNullChecks?: boolean;
2863 strictPropertyInitialization?: boolean;
2864 stripInternal?: boolean;
2865 suppressExcessPropertyErrors?: boolean;
2866 suppressImplicitAnyIndexErrors?: boolean;
2867 target?: ScriptTarget;
2868 traceResolution?: boolean;
2869 resolveJsonModule?: boolean;
2871 /** Paths used to compute primary types search locations */
2872 typeRoots?: string[];
2873 esModuleInterop?: boolean;
2874 useDefineForClassFields?: boolean;
2875 [option: string]: CompilerOptionsValue | TsConfigSourceFile | undefined;
2877 export interface WatchOptions {
2878 watchFile?: WatchFileKind;
2879 watchDirectory?: WatchDirectoryKind;
2880 fallbackPolling?: PollingWatchKind;
2881 synchronousWatchDirectory?: boolean;
2882 [option: string]: CompilerOptionsValue | undefined;
2884 export interface TypeAcquisition {
2886 * @deprecated typingOptions.enableAutoDiscovery
2887 * Use typeAcquisition.enable instead.
2889 enableAutoDiscovery?: boolean;
2893 disableFilenameBasedTypeAcquisition?: boolean;
2894 [option: string]: CompilerOptionsValue | undefined;
2896 export enum ModuleKind {
2906 export enum JsxEmit {
2914 export enum ImportsNotUsedAsValues {
2919 export enum NewLineKind {
2920 CarriageReturnLineFeed = 0,
2923 export interface LineAndCharacter {
2928 export enum ScriptKind {
2937 * Used on extensions that doesn't define the ScriptKind but the content defines it.
2938 * Deferred extensions are going to be included in all project contexts.
2942 export enum ScriptTarget {
2955 export enum LanguageVariant {
2959 /** Either a parsed command line or a parsed tsconfig.json */
2960 export interface ParsedCommandLine {
2961 options: CompilerOptions;
2962 typeAcquisition?: TypeAcquisition;
2963 fileNames: string[];
2964 projectReferences?: readonly ProjectReference[];
2965 watchOptions?: WatchOptions;
2967 errors: Diagnostic[];
2968 wildcardDirectories?: MapLike<WatchDirectoryFlags>;
2969 compileOnSave?: boolean;
2971 export enum WatchDirectoryFlags {
2975 export interface ExpandResult {
2976 fileNames: string[];
2977 wildcardDirectories: MapLike<WatchDirectoryFlags>;
2979 export interface CreateProgramOptions {
2980 rootNames: readonly string[];
2981 options: CompilerOptions;
2982 projectReferences?: readonly ProjectReference[];
2983 host?: CompilerHost;
2984 oldProgram?: Program;
2985 configFileParsingDiagnostics?: readonly Diagnostic[];
2987 export interface ModuleResolutionHost {
2988 fileExists(fileName: string): boolean;
2989 readFile(fileName: string): string | undefined;
2990 trace?(s: string): void;
2991 directoryExists?(directoryName: string): boolean;
2993 * Resolve a symbolic link.
2994 * @see https://nodejs.org/api/fs.html#fs_fs_realpathsync_path_options
2996 realpath?(path: string): string;
2997 getCurrentDirectory?(): string;
2998 getDirectories?(path: string): string[];
3001 * Represents the result of module resolution.
3002 * Module resolution will pick up tsx/jsx/js files even if '--jsx' and '--allowJs' are turned off.
3003 * The Program will then filter results based on these flags.
3005 * Prefer to return a `ResolvedModuleFull` so that the file type does not have to be inferred.
3007 export interface ResolvedModule {
3008 /** Path of the file the module was resolved to. */
3009 resolvedFileName: string;
3010 /** True if `resolvedFileName` comes from `node_modules`. */
3011 isExternalLibraryImport?: boolean;
3014 * ResolvedModule with an explicitly provided `extension` property.
3015 * Prefer this over `ResolvedModule`.
3016 * If changing this, remember to change `moduleResolutionIsEqualTo`.
3018 export interface ResolvedModuleFull extends ResolvedModule {
3020 * Extension of resolvedFileName. This must match what's at the end of resolvedFileName.
3021 * This is optional for backwards-compatibility, but will be added if not provided.
3023 extension: Extension;
3024 packageId?: PackageId;
3027 * Unique identifier with a package name and version.
3028 * If changing this, remember to change `packageIdIsEqual`.
3030 export interface PackageId {
3032 * Name of the package.
3033 * Should not include `@types`.
3034 * If accessing a non-index file, this should include its name e.g. "foo/bar".
3038 * Name of a submodule within this package.
3041 subModuleName: string;
3042 /** Version of the package, e.g. "1.2.3" */
3045 export enum Extension {
3052 TsBuildInfo = ".tsbuildinfo"
3054 export interface ResolvedModuleWithFailedLookupLocations {
3055 readonly resolvedModule: ResolvedModuleFull | undefined;
3057 export interface ResolvedTypeReferenceDirective {
3059 resolvedFileName: string | undefined;
3060 packageId?: PackageId;
3061 /** True if `resolvedFileName` comes from `node_modules`. */
3062 isExternalLibraryImport?: boolean;
3064 export interface ResolvedTypeReferenceDirectiveWithFailedLookupLocations {
3065 readonly resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective | undefined;
3066 readonly failedLookupLocations: string[];
3068 export interface CompilerHost extends ModuleResolutionHost {
3069 getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): SourceFile | undefined;
3070 getSourceFileByPath?(fileName: string, path: Path, languageVersion: ScriptTarget, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): SourceFile | undefined;
3071 getCancellationToken?(): CancellationToken;
3072 getDefaultLibFileName(options: CompilerOptions): string;
3073 getDefaultLibLocation?(): string;
3074 writeFile: WriteFileCallback;
3075 getCurrentDirectory(): string;
3076 getCanonicalFileName(fileName: string): string;
3077 useCaseSensitiveFileNames(): boolean;
3078 getNewLine(): string;
3079 readDirectory?(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number): string[];
3080 resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedModule | undefined)[];
3082 * This method is a companion for 'resolveModuleNames' and is used to resolve 'types' references to actual type declaration files
3084 resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
3085 getEnvironmentVariable?(name: string): string | undefined;
3086 createHash?(data: string): string;
3087 getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
3089 export interface SourceMapRange extends TextRange {
3090 source?: SourceMapSource;
3092 export interface SourceMapSource {
3095 skipTrivia?: (pos: number) => number;
3097 export enum EmitFlags {
3100 AdviseOnEmitNode = 2,
3103 NoLeadingSourceMap = 16,
3104 NoTrailingSourceMap = 32,
3106 NoNestedSourceMaps = 64,
3107 NoTokenLeadingSourceMaps = 128,
3108 NoTokenTrailingSourceMaps = 256,
3109 NoTokenSourceMaps = 384,
3110 NoLeadingComments = 512,
3111 NoTrailingComments = 1024,
3113 NoNestedComments = 2048,
3117 InternalName = 32768,
3119 NoIndentation = 131072,
3120 AsyncFunctionBody = 262144,
3121 ReuseTempVariableScope = 524288,
3122 CustomPrologue = 1048576,
3123 NoHoisting = 2097152,
3124 HasEndOfDeclarationMarker = 4194304,
3126 NoAsciiEscaping = 16777216,
3128 export interface EmitHelper {
3129 readonly name: string;
3130 readonly scoped: boolean;
3131 readonly text: string | ((node: EmitHelperUniqueNameCallback) => string);
3132 readonly priority?: number;
3133 readonly dependencies?: EmitHelper[];
3135 export interface UnscopedEmitHelper extends EmitHelper {
3136 readonly scoped: false;
3137 readonly text: string;
3139 export type EmitHelperUniqueNameCallback = (name: string) => string;
3140 export enum EmitHint {
3144 MappedTypeParameter = 3,
3146 EmbeddedStatement = 5,
3147 JsxAttributeValue = 6
3149 export enum OuterExpressionKinds {
3152 NonNullAssertions = 4,
3153 PartiallyEmittedExpressions = 8,
3157 export type TypeOfTag = "undefined" | "number" | "bigint" | "boolean" | "string" | "symbol" | "object" | "function";
3158 export interface NodeFactory {
3159 createNodeArray<T extends Node>(elements?: readonly T[], hasTrailingComma?: boolean): NodeArray<T>;
3160 createNumericLiteral(value: string | number, numericLiteralFlags?: TokenFlags): NumericLiteral;
3161 createBigIntLiteral(value: string | PseudoBigInt): BigIntLiteral;
3162 createStringLiteral(text: string, isSingleQuote?: boolean): StringLiteral;
3163 createStringLiteralFromNode(sourceNode: PropertyNameLiteral, isSingleQuote?: boolean): StringLiteral;
3164 createRegularExpressionLiteral(text: string): RegularExpressionLiteral;
3165 createIdentifier(text: string): Identifier;
3166 /** Create a unique temporary variable. */
3167 createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined): Identifier;
3168 /** Create a unique temporary variable for use in a loop. */
3169 createLoopVariable(): Identifier;
3170 /** Create a unique name based on the supplied text. */
3171 createUniqueName(text: string, flags?: GeneratedIdentifierFlags): Identifier;
3172 /** Create a unique name generated for a node. */
3173 getGeneratedNameForNode(node: Node | undefined): Identifier;
3174 createPrivateIdentifier(text: string): PrivateIdentifier;
3175 createToken(token: SyntaxKind.SuperKeyword): SuperExpression;
3176 createToken(token: SyntaxKind.ThisKeyword): ThisExpression;
3177 createToken(token: SyntaxKind.NullKeyword): NullLiteral;
3178 createToken(token: SyntaxKind.TrueKeyword): TrueLiteral;
3179 createToken(token: SyntaxKind.FalseKeyword): FalseLiteral;
3180 createToken<TKind extends PunctuationSyntaxKind>(token: TKind): PunctuationToken<TKind>;
3181 createToken<TKind extends KeywordTypeSyntaxKind>(token: TKind): KeywordTypeNode<TKind>;
3182 createToken<TKind extends ModifierSyntaxKind>(token: TKind): ModifierToken<TKind>;
3183 createToken<TKind extends KeywordSyntaxKind>(token: TKind): KeywordToken<TKind>;
3184 createToken<TKind extends SyntaxKind.Unknown | SyntaxKind.EndOfFileToken>(token: TKind): Token<TKind>;
3185 createSuper(): SuperExpression;
3186 createThis(): ThisExpression;
3187 createNull(): NullLiteral;
3188 createTrue(): TrueLiteral;
3189 createFalse(): FalseLiteral;
3190 createModifier<T extends ModifierSyntaxKind>(kind: T): ModifierToken<T>;
3191 createModifiersFromModifierFlags(flags: ModifierFlags): Modifier[];
3192 createQualifiedName(left: EntityName, right: string | Identifier): QualifiedName;
3193 updateQualifiedName(node: QualifiedName, left: EntityName, right: Identifier): QualifiedName;
3194 createComputedPropertyName(expression: Expression): ComputedPropertyName;
3195 updateComputedPropertyName(node: ComputedPropertyName, expression: Expression): ComputedPropertyName;
3196 createTypeParameterDeclaration(name: string | Identifier, constraint?: TypeNode, defaultType?: TypeNode): TypeParameterDeclaration;
3197 updateTypeParameterDeclaration(node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration;
3198 createParameterDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken?: QuestionToken, type?: TypeNode, initializer?: Expression): ParameterDeclaration;
3199 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;
3200 createDecorator(expression: Expression): Decorator;
3201 updateDecorator(node: Decorator, expression: Expression): Decorator;
3202 createPropertySignature(modifiers: readonly Modifier[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature;
3203 updatePropertySignature(node: PropertySignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature;
3204 createPropertyDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
3205 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;
3206 createMethodSignature(modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): MethodSignature;
3207 updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): MethodSignature;
3208 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;
3209 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;
3210 createConstructorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
3211 updateConstructorDeclaration(node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
3212 createGetAccessorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
3213 updateGetAccessorDeclaration(node: GetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
3214 createSetAccessorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration;
3215 updateSetAccessorDeclaration(node: SetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration;
3216 createCallSignature(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): CallSignatureDeclaration;
3217 updateCallSignature(node: CallSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): CallSignatureDeclaration;
3218 createConstructSignature(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): ConstructSignatureDeclaration;
3219 updateConstructSignature(node: ConstructSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): ConstructSignatureDeclaration;
3220 createIndexSignature(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration;
3221 updateIndexSignature(node: IndexSignatureDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration;
3222 createTemplateLiteralTypeSpan(type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan;
3223 updateTemplateLiteralTypeSpan(node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan;
3224 createKeywordTypeNode<TKind extends KeywordTypeSyntaxKind>(kind: TKind): KeywordTypeNode<TKind>;
3225 createTypePredicateNode(assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode | string, type: TypeNode | undefined): TypePredicateNode;
3226 updateTypePredicateNode(node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined): TypePredicateNode;
3227 createTypeReferenceNode(typeName: string | EntityName, typeArguments?: readonly TypeNode[]): TypeReferenceNode;
3228 updateTypeReferenceNode(node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray<TypeNode> | undefined): TypeReferenceNode;
3229 createFunctionTypeNode(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): FunctionTypeNode;
3230 updateFunctionTypeNode(node: FunctionTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode): FunctionTypeNode;
3231 createConstructorTypeNode(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode;
3232 updateConstructorTypeNode(node: ConstructorTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode): ConstructorTypeNode;
3233 createTypeQueryNode(exprName: EntityName): TypeQueryNode;
3234 updateTypeQueryNode(node: TypeQueryNode, exprName: EntityName): TypeQueryNode;
3235 createTypeLiteralNode(members: readonly TypeElement[] | undefined): TypeLiteralNode;
3236 updateTypeLiteralNode(node: TypeLiteralNode, members: NodeArray<TypeElement>): TypeLiteralNode;
3237 createArrayTypeNode(elementType: TypeNode): ArrayTypeNode;
3238 updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode;
3239 createTupleTypeNode(elements: readonly (TypeNode | NamedTupleMember)[]): TupleTypeNode;
3240 updateTupleTypeNode(node: TupleTypeNode, elements: readonly (TypeNode | NamedTupleMember)[]): TupleTypeNode;
3241 createNamedTupleMember(dotDotDotToken: DotDotDotToken | undefined, name: Identifier, questionToken: QuestionToken | undefined, type: TypeNode): NamedTupleMember;
3242 updateNamedTupleMember(node: NamedTupleMember, dotDotDotToken: DotDotDotToken | undefined, name: Identifier, questionToken: QuestionToken | undefined, type: TypeNode): NamedTupleMember;
3243 createOptionalTypeNode(type: TypeNode): OptionalTypeNode;
3244 updateOptionalTypeNode(node: OptionalTypeNode, type: TypeNode): OptionalTypeNode;
3245 createRestTypeNode(type: TypeNode): RestTypeNode;
3246 updateRestTypeNode(node: RestTypeNode, type: TypeNode): RestTypeNode;
3247 createUnionTypeNode(types: readonly TypeNode[]): UnionTypeNode;
3248 updateUnionTypeNode(node: UnionTypeNode, types: NodeArray<TypeNode>): UnionTypeNode;
3249 createIntersectionTypeNode(types: readonly TypeNode[]): IntersectionTypeNode;
3250 updateIntersectionTypeNode(node: IntersectionTypeNode, types: NodeArray<TypeNode>): IntersectionTypeNode;
3251 createConditionalTypeNode(checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode;
3252 updateConditionalTypeNode(node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode;
3253 createInferTypeNode(typeParameter: TypeParameterDeclaration): InferTypeNode;
3254 updateInferTypeNode(node: InferTypeNode, typeParameter: TypeParameterDeclaration): InferTypeNode;
3255 createImportTypeNode(argument: TypeNode, qualifier?: EntityName, typeArguments?: readonly TypeNode[], isTypeOf?: boolean): ImportTypeNode;
3256 updateImportTypeNode(node: ImportTypeNode, argument: TypeNode, qualifier: EntityName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf?: boolean): ImportTypeNode;
3257 createParenthesizedType(type: TypeNode): ParenthesizedTypeNode;
3258 updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode;
3259 createThisTypeNode(): ThisTypeNode;
3260 createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode;
3261 updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode;
3262 createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode;
3263 updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode;
3264 createMappedTypeNode(readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode;
3265 updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode;
3266 createLiteralTypeNode(literal: LiteralTypeNode["literal"]): LiteralTypeNode;
3267 updateLiteralTypeNode(node: LiteralTypeNode, literal: LiteralTypeNode["literal"]): LiteralTypeNode;
3268 createTemplateLiteralType(head: TemplateHead, templateSpans: readonly TemplateLiteralTypeSpan[]): TemplateLiteralTypeNode;
3269 updateTemplateLiteralType(node: TemplateLiteralTypeNode, head: TemplateHead, templateSpans: readonly TemplateLiteralTypeSpan[]): TemplateLiteralTypeNode;
3270 createObjectBindingPattern(elements: readonly BindingElement[]): ObjectBindingPattern;
3271 updateObjectBindingPattern(node: ObjectBindingPattern, elements: readonly BindingElement[]): ObjectBindingPattern;
3272 createArrayBindingPattern(elements: readonly ArrayBindingElement[]): ArrayBindingPattern;
3273 updateArrayBindingPattern(node: ArrayBindingPattern, elements: readonly ArrayBindingElement[]): ArrayBindingPattern;
3274 createBindingElement(dotDotDotToken: DotDotDotToken | undefined, propertyName: string | PropertyName | undefined, name: string | BindingName, initializer?: Expression): BindingElement;
3275 updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken | undefined, propertyName: PropertyName | undefined, name: BindingName, initializer: Expression | undefined): BindingElement;
3276 createArrayLiteralExpression(elements?: readonly Expression[], multiLine?: boolean): ArrayLiteralExpression;
3277 updateArrayLiteralExpression(node: ArrayLiteralExpression, elements: readonly Expression[]): ArrayLiteralExpression;
3278 createObjectLiteralExpression(properties?: readonly ObjectLiteralElementLike[], multiLine?: boolean): ObjectLiteralExpression;
3279 updateObjectLiteralExpression(node: ObjectLiteralExpression, properties: readonly ObjectLiteralElementLike[]): ObjectLiteralExpression;
3280 createPropertyAccessExpression(expression: Expression, name: string | Identifier | PrivateIdentifier): PropertyAccessExpression;
3281 updatePropertyAccessExpression(node: PropertyAccessExpression, expression: Expression, name: Identifier | PrivateIdentifier): PropertyAccessExpression;
3282 createPropertyAccessChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, name: string | Identifier | PrivateIdentifier): PropertyAccessChain;
3283 updatePropertyAccessChain(node: PropertyAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, name: Identifier | PrivateIdentifier): PropertyAccessChain;
3284 createElementAccessExpression(expression: Expression, index: number | Expression): ElementAccessExpression;
3285 updateElementAccessExpression(node: ElementAccessExpression, expression: Expression, argumentExpression: Expression): ElementAccessExpression;
3286 createElementAccessChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, index: number | Expression): ElementAccessChain;
3287 updateElementAccessChain(node: ElementAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, argumentExpression: Expression): ElementAccessChain;
3288 createCallExpression(expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): CallExpression;
3289 updateCallExpression(node: CallExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]): CallExpression;
3290 createCallChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): CallChain;
3291 updateCallChain(node: CallChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]): CallChain;
3292 createNewExpression(expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): NewExpression;
3293 updateNewExpression(node: NewExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): NewExpression;
3294 createTaggedTemplateExpression(tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression;
3295 updateTaggedTemplateExpression(node: TaggedTemplateExpression, tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression;
3296 createTypeAssertion(type: TypeNode, expression: Expression): TypeAssertion;
3297 updateTypeAssertion(node: TypeAssertion, type: TypeNode, expression: Expression): TypeAssertion;
3298 createParenthesizedExpression(expression: Expression): ParenthesizedExpression;
3299 updateParenthesizedExpression(node: ParenthesizedExpression, expression: Expression): ParenthesizedExpression;
3300 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;
3301 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;
3302 createArrowFunction(modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction;
3303 updateArrowFunction(node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken, body: ConciseBody): ArrowFunction;
3304 createDeleteExpression(expression: Expression): DeleteExpression;
3305 updateDeleteExpression(node: DeleteExpression, expression: Expression): DeleteExpression;
3306 createTypeOfExpression(expression: Expression): TypeOfExpression;
3307 updateTypeOfExpression(node: TypeOfExpression, expression: Expression): TypeOfExpression;
3308 createVoidExpression(expression: Expression): VoidExpression;
3309 updateVoidExpression(node: VoidExpression, expression: Expression): VoidExpression;
3310 createAwaitExpression(expression: Expression): AwaitExpression;
3311 updateAwaitExpression(node: AwaitExpression, expression: Expression): AwaitExpression;
3312 createPrefixUnaryExpression(operator: PrefixUnaryOperator, operand: Expression): PrefixUnaryExpression;
3313 updatePrefixUnaryExpression(node: PrefixUnaryExpression, operand: Expression): PrefixUnaryExpression;
3314 createPostfixUnaryExpression(operand: Expression, operator: PostfixUnaryOperator): PostfixUnaryExpression;
3315 updatePostfixUnaryExpression(node: PostfixUnaryExpression, operand: Expression): PostfixUnaryExpression;
3316 createBinaryExpression(left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression): BinaryExpression;
3317 updateBinaryExpression(node: BinaryExpression, left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression): BinaryExpression;
3318 createConditionalExpression(condition: Expression, questionToken: QuestionToken | undefined, whenTrue: Expression, colonToken: ColonToken | undefined, whenFalse: Expression): ConditionalExpression;
3319 updateConditionalExpression(node: ConditionalExpression, condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression;
3320 createTemplateExpression(head: TemplateHead, templateSpans: readonly TemplateSpan[]): TemplateExpression;
3321 updateTemplateExpression(node: TemplateExpression, head: TemplateHead, templateSpans: readonly TemplateSpan[]): TemplateExpression;
3322 createTemplateHead(text: string, rawText?: string, templateFlags?: TokenFlags): TemplateHead;
3323 createTemplateHead(text: string | undefined, rawText: string, templateFlags?: TokenFlags): TemplateHead;
3324 createTemplateMiddle(text: string, rawText?: string, templateFlags?: TokenFlags): TemplateMiddle;
3325 createTemplateMiddle(text: string | undefined, rawText: string, templateFlags?: TokenFlags): TemplateMiddle;
3326 createTemplateTail(text: string, rawText?: string, templateFlags?: TokenFlags): TemplateTail;
3327 createTemplateTail(text: string | undefined, rawText: string, templateFlags?: TokenFlags): TemplateTail;
3328 createNoSubstitutionTemplateLiteral(text: string, rawText?: string): NoSubstitutionTemplateLiteral;
3329 createNoSubstitutionTemplateLiteral(text: string | undefined, rawText: string): NoSubstitutionTemplateLiteral;
3330 createYieldExpression(asteriskToken: AsteriskToken, expression: Expression): YieldExpression;
3331 createYieldExpression(asteriskToken: undefined, expression: Expression | undefined): YieldExpression;
3332 updateYieldExpression(node: YieldExpression, asteriskToken: AsteriskToken | undefined, expression: Expression | undefined): YieldExpression;
3333 createSpreadElement(expression: Expression): SpreadElement;
3334 updateSpreadElement(node: SpreadElement, expression: Expression): SpreadElement;
3335 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;
3336 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;
3337 createOmittedExpression(): OmittedExpression;
3338 createExpressionWithTypeArguments(expression: Expression, typeArguments: readonly TypeNode[] | undefined): ExpressionWithTypeArguments;
3339 updateExpressionWithTypeArguments(node: ExpressionWithTypeArguments, expression: Expression, typeArguments: readonly TypeNode[] | undefined): ExpressionWithTypeArguments;
3340 createAsExpression(expression: Expression, type: TypeNode): AsExpression;
3341 updateAsExpression(node: AsExpression, expression: Expression, type: TypeNode): AsExpression;
3342 createNonNullExpression(expression: Expression): NonNullExpression;
3343 updateNonNullExpression(node: NonNullExpression, expression: Expression): NonNullExpression;
3344 createNonNullChain(expression: Expression): NonNullChain;
3345 updateNonNullChain(node: NonNullChain, expression: Expression): NonNullChain;
3346 createMetaProperty(keywordToken: MetaProperty["keywordToken"], name: Identifier): MetaProperty;
3347 updateMetaProperty(node: MetaProperty, name: Identifier): MetaProperty;
3348 createTemplateSpan(expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan;
3349 updateTemplateSpan(node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan;
3350 createSemicolonClassElement(): SemicolonClassElement;
3351 createBlock(statements: readonly Statement[], multiLine?: boolean): Block;
3352 updateBlock(node: Block, statements: readonly Statement[]): Block;
3353 createVariableStatement(modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList | readonly VariableDeclaration[]): VariableStatement;
3354 updateVariableStatement(node: VariableStatement, modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList): VariableStatement;
3355 createEmptyStatement(): EmptyStatement;
3356 createExpressionStatement(expression: Expression): ExpressionStatement;
3357 updateExpressionStatement(node: ExpressionStatement, expression: Expression): ExpressionStatement;
3358 createIfStatement(expression: Expression, thenStatement: Statement, elseStatement?: Statement): IfStatement;
3359 updateIfStatement(node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement | undefined): IfStatement;
3360 createDoStatement(statement: Statement, expression: Expression): DoStatement;
3361 updateDoStatement(node: DoStatement, statement: Statement, expression: Expression): DoStatement;
3362 createWhileStatement(expression: Expression, statement: Statement): WhileStatement;
3363 updateWhileStatement(node: WhileStatement, expression: Expression, statement: Statement): WhileStatement;
3364 createForStatement(initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement;
3365 updateForStatement(node: ForStatement, initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement;
3366 createForInStatement(initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement;
3367 updateForInStatement(node: ForInStatement, initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement;
3368 createForOfStatement(awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement;
3369 updateForOfStatement(node: ForOfStatement, awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement;
3370 createContinueStatement(label?: string | Identifier): ContinueStatement;
3371 updateContinueStatement(node: ContinueStatement, label: Identifier | undefined): ContinueStatement;
3372 createBreakStatement(label?: string | Identifier): BreakStatement;
3373 updateBreakStatement(node: BreakStatement, label: Identifier | undefined): BreakStatement;
3374 createReturnStatement(expression?: Expression): ReturnStatement;
3375 updateReturnStatement(node: ReturnStatement, expression: Expression | undefined): ReturnStatement;
3376 createWithStatement(expression: Expression, statement: Statement): WithStatement;
3377 updateWithStatement(node: WithStatement, expression: Expression, statement: Statement): WithStatement;
3378 createSwitchStatement(expression: Expression, caseBlock: CaseBlock): SwitchStatement;
3379 updateSwitchStatement(node: SwitchStatement, expression: Expression, caseBlock: CaseBlock): SwitchStatement;
3380 createLabeledStatement(label: string | Identifier, statement: Statement): LabeledStatement;
3381 updateLabeledStatement(node: LabeledStatement, label: Identifier, statement: Statement): LabeledStatement;
3382 createThrowStatement(expression: Expression): ThrowStatement;
3383 updateThrowStatement(node: ThrowStatement, expression: Expression): ThrowStatement;
3384 createTryStatement(tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement;
3385 updateTryStatement(node: TryStatement, tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement;
3386 createDebuggerStatement(): DebuggerStatement;
3387 createVariableDeclaration(name: string | BindingName, exclamationToken?: ExclamationToken, type?: TypeNode, initializer?: Expression): VariableDeclaration;
3388 updateVariableDeclaration(node: VariableDeclaration, name: BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration;
3389 createVariableDeclarationList(declarations: readonly VariableDeclaration[], flags?: NodeFlags): VariableDeclarationList;
3390 updateVariableDeclarationList(node: VariableDeclarationList, declarations: readonly VariableDeclaration[]): VariableDeclarationList;
3391 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;
3392 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;
3393 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;
3394 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;
3395 createInterfaceDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
3396 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;
3397 createTypeAliasDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
3398 updateTypeAliasDeclaration(node: TypeAliasDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
3399 createEnumDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration;
3400 updateEnumDeclaration(node: EnumDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration;
3401 createModuleDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration;
3402 updateModuleDeclaration(node: ModuleDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration;
3403 createModuleBlock(statements: readonly Statement[]): ModuleBlock;
3404 updateModuleBlock(node: ModuleBlock, statements: readonly Statement[]): ModuleBlock;
3405 createCaseBlock(clauses: readonly CaseOrDefaultClause[]): CaseBlock;
3406 updateCaseBlock(node: CaseBlock, clauses: readonly CaseOrDefaultClause[]): CaseBlock;
3407 createNamespaceExportDeclaration(name: string | Identifier): NamespaceExportDeclaration;
3408 updateNamespaceExportDeclaration(node: NamespaceExportDeclaration, name: Identifier): NamespaceExportDeclaration;
3409 createImportEqualsDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration;
3410 updateImportEqualsDeclaration(node: ImportEqualsDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration;
3411 createImportDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression): ImportDeclaration;
3412 updateImportDeclaration(node: ImportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression): ImportDeclaration;
3413 createImportClause(isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause;
3414 updateImportClause(node: ImportClause, isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause;
3415 createNamespaceImport(name: Identifier): NamespaceImport;
3416 updateNamespaceImport(node: NamespaceImport, name: Identifier): NamespaceImport;
3417 createNamespaceExport(name: Identifier): NamespaceExport;
3418 updateNamespaceExport(node: NamespaceExport, name: Identifier): NamespaceExport;
3419 createNamedImports(elements: readonly ImportSpecifier[]): NamedImports;
3420 updateNamedImports(node: NamedImports, elements: readonly ImportSpecifier[]): NamedImports;
3421 createImportSpecifier(propertyName: Identifier | undefined, name: Identifier): ImportSpecifier;
3422 updateImportSpecifier(node: ImportSpecifier, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier;
3423 createExportAssignment(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment;
3424 updateExportAssignment(node: ExportAssignment, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, expression: Expression): ExportAssignment;
3425 createExportDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression): ExportDeclaration;
3426 updateExportDeclaration(node: ExportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined): ExportDeclaration;
3427 createNamedExports(elements: readonly ExportSpecifier[]): NamedExports;
3428 updateNamedExports(node: NamedExports, elements: readonly ExportSpecifier[]): NamedExports;
3429 createExportSpecifier(propertyName: string | Identifier | undefined, name: string | Identifier): ExportSpecifier;
3430 updateExportSpecifier(node: ExportSpecifier, propertyName: Identifier | undefined, name: Identifier): ExportSpecifier;
3431 createExternalModuleReference(expression: Expression): ExternalModuleReference;
3432 updateExternalModuleReference(node: ExternalModuleReference, expression: Expression): ExternalModuleReference;
3433 createJSDocAllType(): JSDocAllType;
3434 createJSDocUnknownType(): JSDocUnknownType;
3435 createJSDocNonNullableType(type: TypeNode): JSDocNonNullableType;
3436 updateJSDocNonNullableType(node: JSDocNonNullableType, type: TypeNode): JSDocNonNullableType;
3437 createJSDocNullableType(type: TypeNode): JSDocNullableType;
3438 updateJSDocNullableType(node: JSDocNullableType, type: TypeNode): JSDocNullableType;
3439 createJSDocOptionalType(type: TypeNode): JSDocOptionalType;
3440 updateJSDocOptionalType(node: JSDocOptionalType, type: TypeNode): JSDocOptionalType;
3441 createJSDocFunctionType(parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): JSDocFunctionType;
3442 updateJSDocFunctionType(node: JSDocFunctionType, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): JSDocFunctionType;
3443 createJSDocVariadicType(type: TypeNode): JSDocVariadicType;
3444 updateJSDocVariadicType(node: JSDocVariadicType, type: TypeNode): JSDocVariadicType;
3445 createJSDocNamepathType(type: TypeNode): JSDocNamepathType;
3446 updateJSDocNamepathType(node: JSDocNamepathType, type: TypeNode): JSDocNamepathType;
3447 createJSDocTypeExpression(type: TypeNode): JSDocTypeExpression;
3448 updateJSDocTypeExpression(node: JSDocTypeExpression, type: TypeNode): JSDocTypeExpression;
3449 createJSDocNameReference(name: EntityName): JSDocNameReference;
3450 updateJSDocNameReference(node: JSDocNameReference, name: EntityName): JSDocNameReference;
3451 createJSDocTypeLiteral(jsDocPropertyTags?: readonly JSDocPropertyLikeTag[], isArrayType?: boolean): JSDocTypeLiteral;
3452 updateJSDocTypeLiteral(node: JSDocTypeLiteral, jsDocPropertyTags: readonly JSDocPropertyLikeTag[] | undefined, isArrayType: boolean | undefined): JSDocTypeLiteral;
3453 createJSDocSignature(typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type?: JSDocReturnTag): JSDocSignature;
3454 updateJSDocSignature(node: JSDocSignature, typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type: JSDocReturnTag | undefined): JSDocSignature;
3455 createJSDocTemplateTag(tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment?: string): JSDocTemplateTag;
3456 updateJSDocTemplateTag(node: JSDocTemplateTag, tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment: string | undefined): JSDocTemplateTag;
3457 createJSDocTypedefTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression | JSDocTypeLiteral, fullName?: Identifier | JSDocNamespaceDeclaration, comment?: string): JSDocTypedefTag;
3458 updateJSDocTypedefTag(node: JSDocTypedefTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | JSDocTypeLiteral | undefined, fullName: Identifier | JSDocNamespaceDeclaration | undefined, comment: string | undefined): JSDocTypedefTag;
3459 createJSDocParameterTag(tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression, isNameFirst?: boolean, comment?: string): JSDocParameterTag;
3460 updateJSDocParameterTag(node: JSDocParameterTag, tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression: JSDocTypeExpression | undefined, isNameFirst: boolean, comment: string | undefined): JSDocParameterTag;
3461 createJSDocPropertyTag(tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression, isNameFirst?: boolean, comment?: string): JSDocPropertyTag;
3462 updateJSDocPropertyTag(node: JSDocPropertyTag, tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression: JSDocTypeExpression | undefined, isNameFirst: boolean, comment: string | undefined): JSDocPropertyTag;
3463 createJSDocTypeTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocTypeTag;
3464 updateJSDocTypeTag(node: JSDocTypeTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | undefined): JSDocTypeTag;
3465 createJSDocSeeTag(tagName: Identifier | undefined, nameExpression: JSDocNameReference | undefined, comment?: string): JSDocSeeTag;
3466 updateJSDocSeeTag(node: JSDocSeeTag, tagName: Identifier | undefined, nameExpression: JSDocNameReference | undefined, comment?: string): JSDocSeeTag;
3467 createJSDocReturnTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression, comment?: string): JSDocReturnTag;
3468 updateJSDocReturnTag(node: JSDocReturnTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | undefined): JSDocReturnTag;
3469 createJSDocThisTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocThisTag;
3470 updateJSDocThisTag(node: JSDocThisTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | undefined): JSDocThisTag;
3471 createJSDocEnumTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocEnumTag;
3472 updateJSDocEnumTag(node: JSDocEnumTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | undefined): JSDocEnumTag;
3473 createJSDocCallbackTag(tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName?: Identifier | JSDocNamespaceDeclaration, comment?: string): JSDocCallbackTag;
3474 updateJSDocCallbackTag(node: JSDocCallbackTag, tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName: Identifier | JSDocNamespaceDeclaration | undefined, comment: string | undefined): JSDocCallbackTag;
3475 createJSDocAugmentsTag(tagName: Identifier | undefined, className: JSDocAugmentsTag["class"], comment?: string): JSDocAugmentsTag;
3476 updateJSDocAugmentsTag(node: JSDocAugmentsTag, tagName: Identifier | undefined, className: JSDocAugmentsTag["class"], comment: string | undefined): JSDocAugmentsTag;
3477 createJSDocImplementsTag(tagName: Identifier | undefined, className: JSDocImplementsTag["class"], comment?: string): JSDocImplementsTag;
3478 updateJSDocImplementsTag(node: JSDocImplementsTag, tagName: Identifier | undefined, className: JSDocImplementsTag["class"], comment: string | undefined): JSDocImplementsTag;
3479 createJSDocAuthorTag(tagName: Identifier | undefined, comment?: string): JSDocAuthorTag;
3480 updateJSDocAuthorTag(node: JSDocAuthorTag, tagName: Identifier | undefined, comment: string | undefined): JSDocAuthorTag;
3481 createJSDocClassTag(tagName: Identifier | undefined, comment?: string): JSDocClassTag;
3482 updateJSDocClassTag(node: JSDocClassTag, tagName: Identifier | undefined, comment: string | undefined): JSDocClassTag;
3483 createJSDocPublicTag(tagName: Identifier | undefined, comment?: string): JSDocPublicTag;
3484 updateJSDocPublicTag(node: JSDocPublicTag, tagName: Identifier | undefined, comment: string | undefined): JSDocPublicTag;
3485 createJSDocPrivateTag(tagName: Identifier | undefined, comment?: string): JSDocPrivateTag;
3486 updateJSDocPrivateTag(node: JSDocPrivateTag, tagName: Identifier | undefined, comment: string | undefined): JSDocPrivateTag;
3487 createJSDocProtectedTag(tagName: Identifier | undefined, comment?: string): JSDocProtectedTag;
3488 updateJSDocProtectedTag(node: JSDocProtectedTag, tagName: Identifier | undefined, comment: string | undefined): JSDocProtectedTag;
3489 createJSDocReadonlyTag(tagName: Identifier | undefined, comment?: string): JSDocReadonlyTag;
3490 updateJSDocReadonlyTag(node: JSDocReadonlyTag, tagName: Identifier | undefined, comment: string | undefined): JSDocReadonlyTag;
3491 createJSDocUnknownTag(tagName: Identifier, comment?: string): JSDocUnknownTag;
3492 updateJSDocUnknownTag(node: JSDocUnknownTag, tagName: Identifier, comment: string | undefined): JSDocUnknownTag;
3493 createJSDocDeprecatedTag(tagName: Identifier, comment?: string): JSDocDeprecatedTag;
3494 updateJSDocDeprecatedTag(node: JSDocDeprecatedTag, tagName: Identifier, comment?: string): JSDocDeprecatedTag;
3495 createJSDocComment(comment?: string | undefined, tags?: readonly JSDocTag[] | undefined): JSDoc;
3496 updateJSDocComment(node: JSDoc, comment: string | undefined, tags: readonly JSDocTag[] | undefined): JSDoc;
3497 createJsxElement(openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement): JsxElement;
3498 updateJsxElement(node: JsxElement, openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement): JsxElement;
3499 createJsxSelfClosingElement(tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxSelfClosingElement;
3500 updateJsxSelfClosingElement(node: JsxSelfClosingElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxSelfClosingElement;
3501 createJsxOpeningElement(tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxOpeningElement;
3502 updateJsxOpeningElement(node: JsxOpeningElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxOpeningElement;
3503 createJsxClosingElement(tagName: JsxTagNameExpression): JsxClosingElement;
3504 updateJsxClosingElement(node: JsxClosingElement, tagName: JsxTagNameExpression): JsxClosingElement;
3505 createJsxFragment(openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment): JsxFragment;
3506 createJsxText(text: string, containsOnlyTriviaWhiteSpaces?: boolean): JsxText;
3507 updateJsxText(node: JsxText, text: string, containsOnlyTriviaWhiteSpaces?: boolean): JsxText;
3508 createJsxOpeningFragment(): JsxOpeningFragment;
3509 createJsxJsxClosingFragment(): JsxClosingFragment;
3510 updateJsxFragment(node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment): JsxFragment;
3511 createJsxAttribute(name: Identifier, initializer: StringLiteral | JsxExpression | undefined): JsxAttribute;
3512 updateJsxAttribute(node: JsxAttribute, name: Identifier, initializer: StringLiteral | JsxExpression | undefined): JsxAttribute;
3513 createJsxAttributes(properties: readonly JsxAttributeLike[]): JsxAttributes;
3514 updateJsxAttributes(node: JsxAttributes, properties: readonly JsxAttributeLike[]): JsxAttributes;
3515 createJsxSpreadAttribute(expression: Expression): JsxSpreadAttribute;
3516 updateJsxSpreadAttribute(node: JsxSpreadAttribute, expression: Expression): JsxSpreadAttribute;
3517 createJsxExpression(dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined): JsxExpression;
3518 updateJsxExpression(node: JsxExpression, expression: Expression | undefined): JsxExpression;
3519 createCaseClause(expression: Expression, statements: readonly Statement[]): CaseClause;
3520 updateCaseClause(node: CaseClause, expression: Expression, statements: readonly Statement[]): CaseClause;
3521 createDefaultClause(statements: readonly Statement[]): DefaultClause;
3522 updateDefaultClause(node: DefaultClause, statements: readonly Statement[]): DefaultClause;
3523 createHeritageClause(token: HeritageClause["token"], types: readonly ExpressionWithTypeArguments[]): HeritageClause;
3524 updateHeritageClause(node: HeritageClause, types: readonly ExpressionWithTypeArguments[]): HeritageClause;
3525 createCatchClause(variableDeclaration: string | VariableDeclaration | undefined, block: Block): CatchClause;
3526 updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration | undefined, block: Block): CatchClause;
3527 createPropertyAssignment(name: string | PropertyName, initializer: Expression): PropertyAssignment;
3528 updatePropertyAssignment(node: PropertyAssignment, name: PropertyName, initializer: Expression): PropertyAssignment;
3529 createShorthandPropertyAssignment(name: string | Identifier, objectAssignmentInitializer?: Expression): ShorthandPropertyAssignment;
3530 updateShorthandPropertyAssignment(node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression | undefined): ShorthandPropertyAssignment;
3531 createSpreadAssignment(expression: Expression): SpreadAssignment;
3532 updateSpreadAssignment(node: SpreadAssignment, expression: Expression): SpreadAssignment;
3533 createEnumMember(name: string | PropertyName, initializer?: Expression): EnumMember;
3534 updateEnumMember(node: EnumMember, name: PropertyName, initializer: Expression | undefined): EnumMember;
3535 createSourceFile(statements: readonly Statement[], endOfFileToken: EndOfFileToken, flags: NodeFlags): SourceFile;
3536 updateSourceFile(node: SourceFile, statements: readonly Statement[], isDeclarationFile?: boolean, referencedFiles?: readonly FileReference[], typeReferences?: readonly FileReference[], hasNoDefaultLib?: boolean, libReferences?: readonly FileReference[]): SourceFile;
3537 createNotEmittedStatement(original: Node): NotEmittedStatement;
3538 createPartiallyEmittedExpression(expression: Expression, original?: Node): PartiallyEmittedExpression;
3539 updatePartiallyEmittedExpression(node: PartiallyEmittedExpression, expression: Expression): PartiallyEmittedExpression;
3540 createCommaListExpression(elements: readonly Expression[]): CommaListExpression;
3541 updateCommaListExpression(node: CommaListExpression, elements: readonly Expression[]): CommaListExpression;
3542 createBundle(sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle;
3543 updateBundle(node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle;
3544 createComma(left: Expression, right: Expression): BinaryExpression;
3545 createAssignment(left: ObjectLiteralExpression | ArrayLiteralExpression, right: Expression): DestructuringAssignment;
3546 createAssignment(left: Expression, right: Expression): AssignmentExpression<EqualsToken>;
3547 createLogicalOr(left: Expression, right: Expression): BinaryExpression;
3548 createLogicalAnd(left: Expression, right: Expression): BinaryExpression;
3549 createBitwiseOr(left: Expression, right: Expression): BinaryExpression;
3550 createBitwiseXor(left: Expression, right: Expression): BinaryExpression;
3551 createBitwiseAnd(left: Expression, right: Expression): BinaryExpression;
3552 createStrictEquality(left: Expression, right: Expression): BinaryExpression;
3553 createStrictInequality(left: Expression, right: Expression): BinaryExpression;
3554 createEquality(left: Expression, right: Expression): BinaryExpression;
3555 createInequality(left: Expression, right: Expression): BinaryExpression;
3556 createLessThan(left: Expression, right: Expression): BinaryExpression;
3557 createLessThanEquals(left: Expression, right: Expression): BinaryExpression;
3558 createGreaterThan(left: Expression, right: Expression): BinaryExpression;
3559 createGreaterThanEquals(left: Expression, right: Expression): BinaryExpression;
3560 createLeftShift(left: Expression, right: Expression): BinaryExpression;
3561 createRightShift(left: Expression, right: Expression): BinaryExpression;
3562 createUnsignedRightShift(left: Expression, right: Expression): BinaryExpression;
3563 createAdd(left: Expression, right: Expression): BinaryExpression;
3564 createSubtract(left: Expression, right: Expression): BinaryExpression;
3565 createMultiply(left: Expression, right: Expression): BinaryExpression;
3566 createDivide(left: Expression, right: Expression): BinaryExpression;
3567 createModulo(left: Expression, right: Expression): BinaryExpression;
3568 createExponent(left: Expression, right: Expression): BinaryExpression;
3569 createPrefixPlus(operand: Expression): PrefixUnaryExpression;
3570 createPrefixMinus(operand: Expression): PrefixUnaryExpression;
3571 createPrefixIncrement(operand: Expression): PrefixUnaryExpression;
3572 createPrefixDecrement(operand: Expression): PrefixUnaryExpression;
3573 createBitwiseNot(operand: Expression): PrefixUnaryExpression;
3574 createLogicalNot(operand: Expression): PrefixUnaryExpression;
3575 createPostfixIncrement(operand: Expression): PostfixUnaryExpression;
3576 createPostfixDecrement(operand: Expression): PostfixUnaryExpression;
3577 createImmediatelyInvokedFunctionExpression(statements: readonly Statement[]): CallExpression;
3578 createImmediatelyInvokedFunctionExpression(statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression;
3579 createImmediatelyInvokedArrowFunction(statements: readonly Statement[]): CallExpression;
3580 createImmediatelyInvokedArrowFunction(statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression;
3581 createVoidZero(): VoidExpression;
3582 createExportDefault(expression: Expression): ExportAssignment;
3583 createExternalModuleExport(exportName: Identifier): ExportDeclaration;
3584 restoreOuterExpressions(outerExpression: Expression | undefined, innerExpression: Expression, kinds?: OuterExpressionKinds): Expression;
3586 export interface CoreTransformationContext {
3587 readonly factory: NodeFactory;
3588 /** Gets the compiler options supplied to the transformer. */
3589 getCompilerOptions(): CompilerOptions;
3590 /** Starts a new lexical environment. */
3591 startLexicalEnvironment(): void;
3592 /** Suspends the current lexical environment, usually after visiting a parameter list. */
3593 suspendLexicalEnvironment(): void;
3594 /** Resumes a suspended lexical environment, usually before visiting a function body. */
3595 resumeLexicalEnvironment(): void;
3596 /** Ends a lexical environment, returning any declarations. */
3597 endLexicalEnvironment(): Statement[] | undefined;
3598 /** Hoists a function declaration to the containing scope. */
3599 hoistFunctionDeclaration(node: FunctionDeclaration): void;
3600 /** Hoists a variable declaration to the containing scope. */
3601 hoistVariableDeclaration(node: Identifier): void;
3603 export interface TransformationContext extends CoreTransformationContext {
3604 /** Records a request for a non-scoped emit helper in the current context. */
3605 requestEmitHelper(helper: EmitHelper): void;
3606 /** Gets and resets the requested non-scoped emit helpers. */
3607 readEmitHelpers(): EmitHelper[] | undefined;
3608 /** Enables expression substitutions in the pretty printer for the provided SyntaxKind. */
3609 enableSubstitution(kind: SyntaxKind): void;
3610 /** Determines whether expression substitutions are enabled for the provided node. */
3611 isSubstitutionEnabled(node: Node): boolean;
3613 * Hook used by transformers to substitute expressions just before they
3614 * are emitted by the pretty printer.
3616 * NOTE: Transformation hooks should only be modified during `Transformer` initialization,
3617 * before returning the `NodeTransformer` callback.
3619 onSubstituteNode: (hint: EmitHint, node: Node) => Node;
3621 * Enables before/after emit notifications in the pretty printer for the provided
3624 enableEmitNotification(kind: SyntaxKind): void;
3626 * Determines whether before/after emit notifications should be raised in the pretty
3627 * printer when it emits a node.
3629 isEmitNotificationEnabled(node: Node): boolean;
3631 * Hook used to allow transformers to capture state before or after
3632 * the printer emits a node.
3634 * NOTE: Transformation hooks should only be modified during `Transformer` initialization,
3635 * before returning the `NodeTransformer` callback.
3637 onEmitNode: (hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void) => void;
3639 export interface TransformationResult<T extends Node> {
3640 /** Gets the transformed source files. */
3642 /** Gets diagnostics for the transformation. */
3643 diagnostics?: DiagnosticWithLocation[];
3645 * Gets a substitute for a node, if one is available; otherwise, returns the original node.
3647 * @param hint A hint as to the intended usage of the node.
3648 * @param node The node to substitute.
3650 substituteNode(hint: EmitHint, node: Node): Node;
3652 * Emits a node with possible notification.
3654 * @param hint A hint as to the intended usage of the node.
3655 * @param node The node to emit.
3656 * @param emitCallback A callback used to emit the node.
3658 emitNodeWithNotification(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void;
3660 * Indicates if a given node needs an emit notification
3662 * @param node The node to emit.
3664 isEmitNotificationEnabled?(node: Node): boolean;
3666 * Clean up EmitNode entries on any parse-tree nodes.
3671 * A function that is used to initialize and return a `Transformer` callback, which in turn
3672 * will be used to transform one or more nodes.
3674 export type TransformerFactory<T extends Node> = (context: TransformationContext) => Transformer<T>;
3676 * A function that transforms a node.
3678 export type Transformer<T extends Node> = (node: T) => T;
3680 * A function that accepts and possibly transforms a node.
3682 export type Visitor = (node: Node) => VisitResult<Node>;
3683 export interface NodeVisitor {
3684 <T extends Node>(nodes: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: NodeArray<Node>) => T): T;
3685 <T extends Node>(nodes: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: NodeArray<Node>) => T): T | undefined;
3687 export interface NodesVisitor {
3688 <T extends Node>(nodes: NodeArray<T>, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T>;
3689 <T extends Node>(nodes: NodeArray<T> | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T> | undefined;
3691 export type VisitResult<T extends Node> = T | T[] | undefined;
3692 export interface Printer {
3694 * Print a node and its subtree as-is, without any emit transformations.
3695 * @param hint A value indicating the purpose of a node. This is primarily used to
3696 * distinguish between an `Identifier` used in an expression position, versus an
3697 * `Identifier` used as an `IdentifierName` as part of a declaration. For most nodes you
3698 * should just pass `Unspecified`.
3699 * @param node The node to print. The node and its subtree are printed as-is, without any
3700 * emit transformations.
3701 * @param sourceFile A source file that provides context for the node. The source text of
3702 * the file is used to emit the original source content for literals and identifiers, while
3703 * the identifiers of the source file are used when generating unique names to avoid
3706 printNode(hint: EmitHint, node: Node, sourceFile: SourceFile): string;
3708 * Prints a list of nodes using the given format flags
3710 printList<T extends Node>(format: ListFormat, list: NodeArray<T>, sourceFile: SourceFile): string;
3712 * Prints a source file as-is, without any emit transformations.
3714 printFile(sourceFile: SourceFile): string;
3716 * Prints a bundle of source files as-is, without any emit transformations.
3718 printBundle(bundle: Bundle): string;
3720 export interface PrintHandlers {
3722 * A hook used by the Printer when generating unique names to avoid collisions with
3723 * globally defined names that exist outside of the current source file.
3725 hasGlobalName?(name: string): boolean;
3727 * A hook used by the Printer to provide notifications prior to emitting a node. A
3728 * compatible implementation **must** invoke `emitCallback` with the provided `hint` and
3730 * @param hint A hint indicating the intended purpose of the node.
3731 * @param node The node to emit.
3732 * @param emitCallback A callback that, when invoked, will emit the node.
3735 * var printer = createPrinter(printerOptions, {
3736 * onEmitNode(hint, node, emitCallback) {
3737 * // set up or track state prior to emitting the node...
3738 * emitCallback(hint, node);
3739 * // restore state after emitting the node...
3744 onEmitNode?(hint: EmitHint, node: Node | undefined, emitCallback: (hint: EmitHint, node: Node | undefined) => void): void;
3746 * A hook used to check if an emit notification is required for a node.
3747 * @param node The node to emit.
3749 isEmitNotificationEnabled?(node: Node | undefined): boolean;
3751 * A hook used by the Printer to perform just-in-time substitution of a node. This is
3752 * primarily used by node transformations that need to substitute one node for another,
3753 * such as replacing `myExportedVar` with `exports.myExportedVar`.
3754 * @param hint A hint indicating the intended purpose of the node.
3755 * @param node The node to emit.
3758 * var printer = createPrinter(printerOptions, {
3759 * substituteNode(hint, node) {
3760 * // perform substitution if necessary...
3766 substituteNode?(hint: EmitHint, node: Node): Node;
3768 export interface PrinterOptions {
3769 removeComments?: boolean;
3770 newLine?: NewLineKind;
3771 omitTrailingSemicolon?: boolean;
3772 noEmitHelpers?: boolean;
3774 export interface GetEffectiveTypeRootsHost {
3775 directoryExists?(directoryName: string): boolean;
3776 getCurrentDirectory?(): string;
3778 export interface TextSpan {
3782 export interface TextChangeRange {
3786 export interface SyntaxList extends Node {
3787 kind: SyntaxKind.SyntaxList;
3790 export enum ListFormat {
3798 AmpersandDelimited = 8,
3799 CommaDelimited = 16,
3800 AsteriskDelimited = 32,
3801 DelimitersMask = 60,
3802 AllowTrailingComma = 64,
3804 SpaceBetweenBraces = 256,
3805 SpaceBetweenSiblings = 512,
3808 AngleBrackets = 4096,
3809 SquareBrackets = 8192,
3810 BracketsMask = 15360,
3811 OptionalIfUndefined = 16384,
3812 OptionalIfEmpty = 32768,
3814 PreferNewLine = 65536,
3815 NoTrailingNewLine = 131072,
3816 NoInterveningComments = 262144,
3817 NoSpaceIfEmpty = 524288,
3818 SingleElement = 1048576,
3819 SpaceAfterList = 2097152,
3821 HeritageClauses = 512,
3822 SingleLineTypeLiteralMembers = 768,
3823 MultiLineTypeLiteralMembers = 32897,
3824 SingleLineTupleTypeElements = 528,
3825 MultiLineTupleTypeElements = 657,
3826 UnionTypeConstituents = 516,
3827 IntersectionTypeConstituents = 520,
3828 ObjectBindingPatternElements = 525136,
3829 ArrayBindingPatternElements = 524880,
3830 ObjectLiteralExpressionProperties = 526226,
3831 ArrayLiteralExpressionElements = 8914,
3832 CommaListElements = 528,
3833 CallExpressionArguments = 2576,
3834 NewExpressionArguments = 18960,
3835 TemplateExpressionSpans = 262144,
3836 SingleLineBlockStatements = 768,
3837 MultiLineBlockStatements = 129,
3838 VariableDeclarationList = 528,
3839 SingleLineFunctionBodyStatements = 768,
3840 MultiLineFunctionBodyStatements = 1,
3841 ClassHeritageClauses = 0,
3843 InterfaceMembers = 129,
3845 CaseBlockClauses = 129,
3846 NamedImportsOrExportsElements = 525136,
3847 JsxElementOrFragmentChildren = 262144,
3848 JsxElementAttributes = 262656,
3849 CaseOrDefaultClauseStatements = 163969,
3850 HeritageClauseTypes = 528,
3851 SourceFileStatements = 131073,
3852 Decorators = 2146305,
3853 TypeArguments = 53776,
3854 TypeParameters = 53776,
3856 IndexSignatureParameters = 8848,
3859 export interface UserPreferences {
3860 readonly disableSuggestions?: boolean;
3861 readonly quotePreference?: "auto" | "double" | "single";
3862 readonly includeCompletionsForModuleExports?: boolean;
3863 readonly includeAutomaticOptionalChainCompletions?: boolean;
3864 readonly includeCompletionsWithInsertText?: boolean;
3865 readonly importModuleSpecifierPreference?: "auto" | "relative" | "non-relative";
3866 /** Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js" */
3867 readonly importModuleSpecifierEnding?: "auto" | "minimal" | "index" | "js";
3868 readonly allowTextChangesInNewFiles?: boolean;
3869 readonly providePrefixAndSuffixTextForRename?: boolean;
3870 readonly includePackageJsonAutoImports?: "auto" | "on" | "off";
3871 readonly provideRefactorNotApplicableReason?: boolean;
3873 /** Represents a bigint literal value without requiring bigint support */
3874 export interface PseudoBigInt {
3876 base10Value: string;
3880 declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any;
3881 declare function clearTimeout(handle: any): void;
3882 declare namespace ts {
3883 export enum FileWatcherEventKind {
3888 export type FileWatcherCallback = (fileName: string, eventKind: FileWatcherEventKind) => void;
3889 export type DirectoryWatcherCallback = (fileName: string) => void;
3890 export interface System {
3893 useCaseSensitiveFileNames: boolean;
3894 write(s: string): void;
3895 writeOutputIsTTY?(): boolean;
3896 readFile(path: string, encoding?: string): string | undefined;
3897 getFileSize?(path: string): number;
3898 writeFile(path: string, data: string, writeByteOrderMark?: boolean): void;
3900 * @pollingInterval - this parameter is used in polling-based watchers and ignored in watchers that
3901 * use native OS file watching
3903 watchFile?(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: WatchOptions): FileWatcher;
3904 watchDirectory?(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: WatchOptions): FileWatcher;
3905 resolvePath(path: string): string;
3906 fileExists(path: string): boolean;
3907 directoryExists(path: string): boolean;
3908 createDirectory(path: string): void;
3909 getExecutingFilePath(): string;
3910 getCurrentDirectory(): string;
3911 getDirectories(path: string): string[];
3912 readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
3913 getModifiedTime?(path: string): Date | undefined;
3914 setModifiedTime?(path: string, time: Date): void;
3915 deleteFile?(path: string): void;
3917 * A good implementation is node.js' `crypto.createHash`. (https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm)
3919 createHash?(data: string): string;
3920 /** This must be cryptographically secure. Only implement this method using `crypto.createHash("sha256")`. */
3921 createSHA256Hash?(data: string): string;
3922 getMemoryUsage?(): number;
3923 exit(exitCode?: number): void;
3924 realpath?(path: string): string;
3925 setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
3926 clearTimeout?(timeoutId: any): void;
3927 clearScreen?(): void;
3928 base64decode?(input: string): string;
3929 base64encode?(input: string): string;
3931 export interface FileWatcher {
3934 export function getNodeMajorVersion(): number | undefined;
3935 export let sys: System;
3938 declare namespace ts {
3939 type ErrorCallback = (message: DiagnosticMessage, length: number) => void;
3941 getStartPos(): number;
3942 getToken(): SyntaxKind;
3943 getTextPos(): number;
3944 getTokenPos(): number;
3945 getTokenText(): string;
3946 getTokenValue(): string;
3947 hasUnicodeEscape(): boolean;
3948 hasExtendedUnicodeEscape(): boolean;
3949 hasPrecedingLineBreak(): boolean;
3950 isIdentifier(): boolean;
3951 isReservedWord(): boolean;
3952 isUnterminated(): boolean;
3953 reScanGreaterToken(): SyntaxKind;
3954 reScanSlashToken(): SyntaxKind;
3955 reScanAsteriskEqualsToken(): SyntaxKind;
3956 reScanTemplateToken(isTaggedTemplate: boolean): SyntaxKind;
3957 reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind;
3958 scanJsxIdentifier(): SyntaxKind;
3959 scanJsxAttributeValue(): SyntaxKind;
3960 reScanJsxAttributeValue(): SyntaxKind;
3961 reScanJsxToken(): JsxTokenSyntaxKind;
3962 reScanLessThanToken(): SyntaxKind;
3963 reScanQuestionToken(): SyntaxKind;
3964 scanJsxToken(): JsxTokenSyntaxKind;
3965 scanJsDocToken(): JSDocSyntaxKind;
3968 setText(text: string | undefined, start?: number, length?: number): void;
3969 setOnError(onError: ErrorCallback | undefined): void;
3970 setScriptTarget(scriptTarget: ScriptTarget): void;
3971 setLanguageVariant(variant: LanguageVariant): void;
3972 setTextPos(textPos: number): void;
3973 lookAhead<T>(callback: () => T): T;
3974 scanRange<T>(start: number, length: number, callback: () => T): T;
3975 tryScan<T>(callback: () => T): T;
3977 function tokenToString(t: SyntaxKind): string | undefined;
3978 function getPositionOfLineAndCharacter(sourceFile: SourceFileLike, line: number, character: number): number;
3979 function getLineAndCharacterOfPosition(sourceFile: SourceFileLike, position: number): LineAndCharacter;
3980 function isWhiteSpaceLike(ch: number): boolean;
3981 /** Does not include line breaks. For that, see isWhiteSpaceLike. */
3982 function isWhiteSpaceSingleLine(ch: number): boolean;
3983 function isLineBreak(ch: number): boolean;
3984 function couldStartTrivia(text: string, pos: number): boolean;
3985 function forEachLeadingCommentRange<U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined;
3986 function forEachLeadingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined;
3987 function forEachTrailingCommentRange<U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined;
3988 function forEachTrailingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined;
3989 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;
3990 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;
3991 function getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined;
3992 function getTrailingCommentRanges(text: string, pos: number): CommentRange[] | undefined;
3993 /** Optionally, get the shebang */
3994 function getShebang(text: string): string | undefined;
3995 function isIdentifierStart(ch: number, languageVersion: ScriptTarget | undefined): boolean;
3996 function isIdentifierPart(ch: number, languageVersion: ScriptTarget | undefined, identifierVariant?: LanguageVariant): boolean;
3997 function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, textInitial?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner;
3999 declare namespace ts {
4000 function isExternalModuleNameRelative(moduleName: string): boolean;
4001 function sortAndDeduplicateDiagnostics<T extends Diagnostic>(diagnostics: readonly T[]): SortedReadonlyArray<T>;
4002 function getDefaultLibFileName(options: CompilerOptions): string;
4003 function textSpanEnd(span: TextSpan): number;
4004 function textSpanIsEmpty(span: TextSpan): boolean;
4005 function textSpanContainsPosition(span: TextSpan, position: number): boolean;
4006 function textSpanContainsTextSpan(span: TextSpan, other: TextSpan): boolean;
4007 function textSpanOverlapsWith(span: TextSpan, other: TextSpan): boolean;
4008 function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan | undefined;
4009 function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan): boolean;
4010 function textSpanIntersectsWith(span: TextSpan, start: number, length: number): boolean;
4011 function decodedTextSpanIntersectsWith(start1: number, length1: number, start2: number, length2: number): boolean;
4012 function textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean;
4013 function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan | undefined;
4014 function createTextSpan(start: number, length: number): TextSpan;
4015 function createTextSpanFromBounds(start: number, end: number): TextSpan;
4016 function textChangeRangeNewSpan(range: TextChangeRange): TextSpan;
4017 function textChangeRangeIsUnchanged(range: TextChangeRange): boolean;
4018 function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange;
4019 let unchangedTextChangeRange: TextChangeRange;
4021 * Called to merge all the changes that occurred across several versions of a script snapshot
4022 * into a single change. i.e. if a user keeps making successive edits to a script we will
4023 * have a text change from V1 to V2, V2 to V3, ..., Vn.
4025 * This function will then merge those changes into a single change range valid between V1 and
4028 function collapseTextChangeRangesAcrossMultipleVersions(changes: readonly TextChangeRange[]): TextChangeRange;
4029 function getTypeParameterOwner(d: Declaration): Declaration | undefined;
4030 type ParameterPropertyDeclaration = ParameterDeclaration & {
4031 parent: ConstructorDeclaration;
4034 function isParameterPropertyDeclaration(node: Node, parent: Node): node is ParameterPropertyDeclaration;
4035 function isEmptyBindingPattern(node: BindingName): node is BindingPattern;
4036 function isEmptyBindingElement(node: BindingElement): boolean;
4037 function walkUpBindingElementsAndPatterns(binding: BindingElement): VariableDeclaration | ParameterDeclaration;
4038 function getCombinedModifierFlags(node: Declaration): ModifierFlags;
4039 function getCombinedNodeFlags(node: Node): NodeFlags;
4041 * Checks to see if the locale is in the appropriate format,
4042 * and if it is, attempts to set the appropriate language.
4044 function validateLocaleAndSetLanguage(locale: string, sys: {
4045 getExecutingFilePath(): string;
4046 resolvePath(path: string): string;
4047 fileExists(fileName: string): boolean;
4048 readFile(fileName: string): string | undefined;
4049 }, errors?: Push<Diagnostic>): void;
4050 function getOriginalNode(node: Node): Node;
4051 function getOriginalNode<T extends Node>(node: Node, nodeTest: (node: Node) => node is T): T;
4052 function getOriginalNode(node: Node | undefined): Node | undefined;
4053 function getOriginalNode<T extends Node>(node: Node | undefined, nodeTest: (node: Node | undefined) => node is T): T | undefined;
4055 * Iterates through the parent chain of a node and performs the callback on each parent until the callback
4056 * returns a truthy value, then returns that value.
4057 * If no such value is found, it applies the callback until the parent pointer is undefined or the callback returns "quit"
4058 * At that point findAncestor returns undefined.
4060 function findAncestor<T extends Node>(node: Node | undefined, callback: (element: Node) => element is T): T | undefined;
4061 function findAncestor(node: Node | undefined, callback: (element: Node) => boolean | "quit"): Node | undefined;
4063 * Gets a value indicating whether a node originated in the parse tree.
4065 * @param node The node to test.
4067 function isParseTreeNode(node: Node): boolean;
4069 * Gets the original parse tree node for a node.
4071 * @param node The original node.
4072 * @returns The original parse tree node if found; otherwise, undefined.
4074 function getParseTreeNode(node: Node | undefined): Node | undefined;
4076 * Gets the original parse tree node for a node.
4078 * @param node The original node.
4079 * @param nodeTest A callback used to ensure the correct type of parse tree node is returned.
4080 * @returns The original parse tree node if found; otherwise, undefined.
4082 function getParseTreeNode<T extends Node>(node: T | undefined, nodeTest?: (node: Node) => node is T): T | undefined;
4083 /** Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' */
4084 function escapeLeadingUnderscores(identifier: string): __String;
4086 * Remove extra underscore from escaped identifier text content.
4088 * @param identifier The escaped identifier text.
4089 * @returns The unescaped identifier text.
4091 function unescapeLeadingUnderscores(identifier: __String): string;
4092 function idText(identifierOrPrivateName: Identifier | PrivateIdentifier): string;
4093 function symbolName(symbol: Symbol): string;
4094 function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | PrivateIdentifier | undefined;
4095 function getNameOfDeclaration(declaration: Declaration | Expression): DeclarationName | undefined;
4097 * Gets the JSDoc parameter tags for the node if present.
4099 * @remarks Returns any JSDoc param tag whose name matches the provided
4100 * parameter, whether a param tag on a containing function
4101 * expression, or a param tag on a variable declaration whose
4102 * initializer is the containing function. The tags closest to the
4103 * node are returned first, so in the previous example, the param
4104 * tag on the containing function expression would be first.
4106 * For binding patterns, parameter tags are matched by position.
4108 function getJSDocParameterTags(param: ParameterDeclaration): readonly JSDocParameterTag[];
4110 * Gets the JSDoc type parameter tags for the node if present.
4112 * @remarks Returns any JSDoc template tag whose names match the provided
4113 * parameter, whether a template tag on a containing function
4114 * expression, or a template tag on a variable declaration whose
4115 * initializer is the containing function. The tags closest to the
4116 * node are returned first, so in the previous example, the template
4117 * tag on the containing function expression would be first.
4119 function getJSDocTypeParameterTags(param: TypeParameterDeclaration): readonly JSDocTemplateTag[];
4121 * Return true if the node has JSDoc parameter tags.
4123 * @remarks Includes parameter tags that are not directly on the node,
4124 * for example on a variable declaration whose initializer is a function expression.
4126 function hasJSDocParameterTags(node: FunctionLikeDeclaration | SignatureDeclaration): boolean;
4127 /** Gets the JSDoc augments tag for the node if present */
4128 function getJSDocAugmentsTag(node: Node): JSDocAugmentsTag | undefined;
4129 /** Gets the JSDoc implements tags for the node if present */
4130 function getJSDocImplementsTags(node: Node): readonly JSDocImplementsTag[];
4131 /** Gets the JSDoc class tag for the node if present */
4132 function getJSDocClassTag(node: Node): JSDocClassTag | undefined;
4133 /** Gets the JSDoc public tag for the node if present */
4134 function getJSDocPublicTag(node: Node): JSDocPublicTag | undefined;
4135 /** Gets the JSDoc private tag for the node if present */
4136 function getJSDocPrivateTag(node: Node): JSDocPrivateTag | undefined;
4137 /** Gets the JSDoc protected tag for the node if present */
4138 function getJSDocProtectedTag(node: Node): JSDocProtectedTag | undefined;
4139 /** Gets the JSDoc protected tag for the node if present */
4140 function getJSDocReadonlyTag(node: Node): JSDocReadonlyTag | undefined;
4141 /** Gets the JSDoc deprecated tag for the node if present */
4142 function getJSDocDeprecatedTag(node: Node): JSDocDeprecatedTag | undefined;
4143 /** Gets the JSDoc enum tag for the node if present */
4144 function getJSDocEnumTag(node: Node): JSDocEnumTag | undefined;
4145 /** Gets the JSDoc this tag for the node if present */
4146 function getJSDocThisTag(node: Node): JSDocThisTag | undefined;
4147 /** Gets the JSDoc return tag for the node if present */
4148 function getJSDocReturnTag(node: Node): JSDocReturnTag | undefined;
4149 /** Gets the JSDoc template tag for the node if present */
4150 function getJSDocTemplateTag(node: Node): JSDocTemplateTag | undefined;
4151 /** Gets the JSDoc type tag for the node if present and valid */
4152 function getJSDocTypeTag(node: Node): JSDocTypeTag | undefined;
4154 * Gets the type node for the node if provided via JSDoc.
4156 * @remarks The search includes any JSDoc param tag that relates
4157 * to the provided parameter, for example a type tag on the
4158 * parameter itself, or a param tag on a containing function
4159 * expression, or a param tag on a variable declaration whose
4160 * initializer is the containing function. The tags closest to the
4161 * node are examined first, so in the previous example, the type
4162 * tag directly on the node would be returned.
4164 function getJSDocType(node: Node): TypeNode | undefined;
4166 * Gets the return type node for the node if provided via JSDoc return tag or type tag.
4168 * @remarks `getJSDocReturnTag` just gets the whole JSDoc tag. This function
4169 * gets the type from inside the braces, after the fat arrow, etc.
4171 function getJSDocReturnType(node: Node): TypeNode | undefined;
4172 /** Get all JSDoc tags related to a node, including those on parent nodes. */
4173 function getJSDocTags(node: Node): readonly JSDocTag[];
4174 /** Gets all JSDoc tags that match a specified predicate */
4175 function getAllJSDocTags<T extends JSDocTag>(node: Node, predicate: (tag: JSDocTag) => tag is T): readonly T[];
4176 /** Gets all JSDoc tags of a specified kind */
4177 function getAllJSDocTagsOfKind(node: Node, kind: SyntaxKind): readonly JSDocTag[];
4179 * Gets the effective type parameters. If the node was parsed in a
4180 * JavaScript file, gets the type parameters from the `@template` tag from JSDoc.
4182 function getEffectiveTypeParameterDeclarations(node: DeclarationWithTypeParameters): readonly TypeParameterDeclaration[];
4183 function getEffectiveConstraintOfTypeParameter(node: TypeParameterDeclaration): TypeNode | undefined;
4184 function isIdentifierOrPrivateIdentifier(node: Node): node is Identifier | PrivateIdentifier;
4185 function isPropertyAccessChain(node: Node): node is PropertyAccessChain;
4186 function isElementAccessChain(node: Node): node is ElementAccessChain;
4187 function isCallChain(node: Node): node is CallChain;
4188 function isOptionalChain(node: Node): node is PropertyAccessChain | ElementAccessChain | CallChain | NonNullChain;
4189 function isNullishCoalesce(node: Node): boolean;
4190 function isConstTypeReference(node: Node): boolean;
4191 function skipPartiallyEmittedExpressions(node: Expression): Expression;
4192 function skipPartiallyEmittedExpressions(node: Node): Node;
4193 function isNonNullChain(node: Node): node is NonNullChain;
4194 function isBreakOrContinueStatement(node: Node): node is BreakOrContinueStatement;
4195 function isNamedExportBindings(node: Node): node is NamedExportBindings;
4196 function isUnparsedTextLike(node: Node): node is UnparsedTextLike;
4197 function isUnparsedNode(node: Node): node is UnparsedNode;
4198 function isJSDocPropertyLikeTag(node: Node): node is JSDocPropertyLikeTag;
4200 * True if node is of some token syntax kind.
4201 * For example, this is true for an IfKeyword but not for an IfStatement.
4202 * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail.
4204 function isToken(n: Node): boolean;
4205 function isLiteralExpression(node: Node): node is LiteralExpression;
4206 function isTemplateLiteralToken(node: Node): node is TemplateLiteralToken;
4207 function isTemplateMiddleOrTemplateTail(node: Node): node is TemplateMiddle | TemplateTail;
4208 function isImportOrExportSpecifier(node: Node): node is ImportSpecifier | ExportSpecifier;
4209 function isTypeOnlyImportOrExportDeclaration(node: Node): node is TypeOnlyCompatibleAliasDeclaration;
4210 function isStringTextContainingNode(node: Node): node is StringLiteral | TemplateLiteralToken;
4211 function isModifier(node: Node): node is Modifier;
4212 function isEntityName(node: Node): node is EntityName;
4213 function isPropertyName(node: Node): node is PropertyName;
4214 function isBindingName(node: Node): node is BindingName;
4215 function isFunctionLike(node: Node): node is SignatureDeclaration;
4216 function isClassElement(node: Node): node is ClassElement;
4217 function isClassLike(node: Node): node is ClassLikeDeclaration;
4218 function isAccessor(node: Node): node is AccessorDeclaration;
4219 function isTypeElement(node: Node): node is TypeElement;
4220 function isClassOrTypeElement(node: Node): node is ClassElement | TypeElement;
4221 function isObjectLiteralElementLike(node: Node): node is ObjectLiteralElementLike;
4223 * Node test that determines whether a node is a valid type node.
4224 * This differs from the `isPartOfTypeNode` function which determines whether a node is *part*
4227 function isTypeNode(node: Node): node is TypeNode;
4228 function isFunctionOrConstructorTypeNode(node: Node): node is FunctionTypeNode | ConstructorTypeNode;
4229 function isPropertyAccessOrQualifiedName(node: Node): node is PropertyAccessExpression | QualifiedName;
4230 function isCallLikeExpression(node: Node): node is CallLikeExpression;
4231 function isCallOrNewExpression(node: Node): node is CallExpression | NewExpression;
4232 function isTemplateLiteral(node: Node): node is TemplateLiteral;
4233 function isAssertionExpression(node: Node): node is AssertionExpression;
4234 function isIterationStatement(node: Node, lookInLabeledStatements: false): node is IterationStatement;
4235 function isIterationStatement(node: Node, lookInLabeledStatements: boolean): node is IterationStatement | LabeledStatement;
4236 function isJsxOpeningLikeElement(node: Node): node is JsxOpeningLikeElement;
4237 function isCaseOrDefaultClause(node: Node): node is CaseOrDefaultClause;
4238 /** True if node is of a kind that may contain comment text. */
4239 function isJSDocCommentContainingNode(node: Node): boolean;
4240 function isSetAccessor(node: Node): node is SetAccessorDeclaration;
4241 function isGetAccessor(node: Node): node is GetAccessorDeclaration;
4242 /** True if has initializer node attached to it. */
4243 function hasOnlyExpressionInitializer(node: Node): node is HasExpressionInitializer;
4244 function isObjectLiteralElement(node: Node): node is ObjectLiteralElement;
4245 function isStringLiteralLike(node: Node): node is StringLiteralLike;
4247 declare namespace ts {
4248 const factory: NodeFactory;
4249 function createUnparsedSourceFile(text: string): UnparsedSource;
4250 function createUnparsedSourceFile(inputFile: InputFiles, type: "js" | "dts", stripInternal?: boolean): UnparsedSource;
4251 function createUnparsedSourceFile(text: string, mapPath: string | undefined, map: string | undefined): UnparsedSource;
4252 function createInputFiles(javascriptText: string, declarationText: string): InputFiles;
4253 function createInputFiles(readFileText: (path: string) => string | undefined, javascriptPath: string, javascriptMapPath: string | undefined, declarationPath: string, declarationMapPath: string | undefined, buildInfoPath: string | undefined): InputFiles;
4254 function createInputFiles(javascriptText: string, declarationText: string, javascriptMapPath: string | undefined, javascriptMapText: string | undefined, declarationMapPath: string | undefined, declarationMapText: string | undefined): InputFiles;
4256 * Create an external source map source file reference
4258 function createSourceMapSource(fileName: string, text: string, skipTrivia?: (pos: number) => number): SourceMapSource;
4259 function setOriginalNode<T extends Node>(node: T, original: Node | undefined): T;
4261 declare namespace ts {
4263 * Clears any `EmitNode` entries from parse-tree nodes.
4264 * @param sourceFile A source file.
4266 function disposeEmitNodes(sourceFile: SourceFile | undefined): void;
4268 * Sets flags that control emit behavior of a node.
4270 function setEmitFlags<T extends Node>(node: T, emitFlags: EmitFlags): T;
4272 * Gets a custom text range to use when emitting source maps.
4274 function getSourceMapRange(node: Node): SourceMapRange;
4276 * Sets a custom text range to use when emitting source maps.
4278 function setSourceMapRange<T extends Node>(node: T, range: SourceMapRange | undefined): T;
4280 * Gets the TextRange to use for source maps for a token of a node.
4282 function getTokenSourceMapRange(node: Node, token: SyntaxKind): SourceMapRange | undefined;
4284 * Sets the TextRange to use for source maps for a token of a node.
4286 function setTokenSourceMapRange<T extends Node>(node: T, token: SyntaxKind, range: SourceMapRange | undefined): T;
4288 * Gets a custom text range to use when emitting comments.
4290 function getCommentRange(node: Node): TextRange;
4292 * Sets a custom text range to use when emitting comments.
4294 function setCommentRange<T extends Node>(node: T, range: TextRange): T;
4295 function getSyntheticLeadingComments(node: Node): SynthesizedComment[] | undefined;
4296 function setSyntheticLeadingComments<T extends Node>(node: T, comments: SynthesizedComment[] | undefined): T;
4297 function addSyntheticLeadingComment<T extends Node>(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T;
4298 function getSyntheticTrailingComments(node: Node): SynthesizedComment[] | undefined;
4299 function setSyntheticTrailingComments<T extends Node>(node: T, comments: SynthesizedComment[] | undefined): T;
4300 function addSyntheticTrailingComment<T extends Node>(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T;
4301 function moveSyntheticComments<T extends Node>(node: T, original: Node): T;
4303 * Gets the constant value to emit for an expression representing an enum.
4305 function getConstantValue(node: AccessExpression): string | number | undefined;
4307 * Sets the constant value to emit for an expression.
4309 function setConstantValue(node: AccessExpression, value: string | number): AccessExpression;
4311 * Adds an EmitHelper to a node.
4313 function addEmitHelper<T extends Node>(node: T, helper: EmitHelper): T;
4315 * Add EmitHelpers to a node.
4317 function addEmitHelpers<T extends Node>(node: T, helpers: EmitHelper[] | undefined): T;
4319 * Removes an EmitHelper from a node.
4321 function removeEmitHelper(node: Node, helper: EmitHelper): boolean;
4323 * Gets the EmitHelpers of a node.
4325 function getEmitHelpers(node: Node): EmitHelper[] | undefined;
4327 * Moves matching emit helpers from a source node to a target node.
4329 function moveEmitHelpers(source: Node, target: Node, predicate: (helper: EmitHelper) => boolean): void;
4331 declare namespace ts {
4332 function isNumericLiteral(node: Node): node is NumericLiteral;
4333 function isBigIntLiteral(node: Node): node is BigIntLiteral;
4334 function isStringLiteral(node: Node): node is StringLiteral;
4335 function isJsxText(node: Node): node is JsxText;
4336 function isRegularExpressionLiteral(node: Node): node is RegularExpressionLiteral;
4337 function isNoSubstitutionTemplateLiteral(node: Node): node is NoSubstitutionTemplateLiteral;
4338 function isTemplateHead(node: Node): node is TemplateHead;
4339 function isTemplateMiddle(node: Node): node is TemplateMiddle;
4340 function isTemplateTail(node: Node): node is TemplateTail;
4341 function isIdentifier(node: Node): node is Identifier;
4342 function isQualifiedName(node: Node): node is QualifiedName;
4343 function isComputedPropertyName(node: Node): node is ComputedPropertyName;
4344 function isPrivateIdentifier(node: Node): node is PrivateIdentifier;
4345 function isTypeParameterDeclaration(node: Node): node is TypeParameterDeclaration;
4346 function isParameter(node: Node): node is ParameterDeclaration;
4347 function isDecorator(node: Node): node is Decorator;
4348 function isPropertySignature(node: Node): node is PropertySignature;
4349 function isPropertyDeclaration(node: Node): node is PropertyDeclaration;
4350 function isMethodSignature(node: Node): node is MethodSignature;
4351 function isMethodDeclaration(node: Node): node is MethodDeclaration;
4352 function isConstructorDeclaration(node: Node): node is ConstructorDeclaration;
4353 function isGetAccessorDeclaration(node: Node): node is GetAccessorDeclaration;
4354 function isSetAccessorDeclaration(node: Node): node is SetAccessorDeclaration;
4355 function isCallSignatureDeclaration(node: Node): node is CallSignatureDeclaration;
4356 function isConstructSignatureDeclaration(node: Node): node is ConstructSignatureDeclaration;
4357 function isIndexSignatureDeclaration(node: Node): node is IndexSignatureDeclaration;
4358 function isTypePredicateNode(node: Node): node is TypePredicateNode;
4359 function isTypeReferenceNode(node: Node): node is TypeReferenceNode;
4360 function isFunctionTypeNode(node: Node): node is FunctionTypeNode;
4361 function isConstructorTypeNode(node: Node): node is ConstructorTypeNode;
4362 function isTypeQueryNode(node: Node): node is TypeQueryNode;
4363 function isTypeLiteralNode(node: Node): node is TypeLiteralNode;
4364 function isArrayTypeNode(node: Node): node is ArrayTypeNode;
4365 function isTupleTypeNode(node: Node): node is TupleTypeNode;
4366 function isNamedTupleMember(node: Node): node is NamedTupleMember;
4367 function isOptionalTypeNode(node: Node): node is OptionalTypeNode;
4368 function isRestTypeNode(node: Node): node is RestTypeNode;
4369 function isUnionTypeNode(node: Node): node is UnionTypeNode;
4370 function isIntersectionTypeNode(node: Node): node is IntersectionTypeNode;
4371 function isConditionalTypeNode(node: Node): node is ConditionalTypeNode;
4372 function isInferTypeNode(node: Node): node is InferTypeNode;
4373 function isParenthesizedTypeNode(node: Node): node is ParenthesizedTypeNode;
4374 function isThisTypeNode(node: Node): node is ThisTypeNode;
4375 function isTypeOperatorNode(node: Node): node is TypeOperatorNode;
4376 function isIndexedAccessTypeNode(node: Node): node is IndexedAccessTypeNode;
4377 function isMappedTypeNode(node: Node): node is MappedTypeNode;
4378 function isLiteralTypeNode(node: Node): node is LiteralTypeNode;
4379 function isImportTypeNode(node: Node): node is ImportTypeNode;
4380 function isTemplateLiteralTypeSpan(node: Node): node is TemplateLiteralTypeSpan;
4381 function isTemplateLiteralTypeNode(node: Node): node is TemplateLiteralTypeNode;
4382 function isObjectBindingPattern(node: Node): node is ObjectBindingPattern;
4383 function isArrayBindingPattern(node: Node): node is ArrayBindingPattern;
4384 function isBindingElement(node: Node): node is BindingElement;
4385 function isArrayLiteralExpression(node: Node): node is ArrayLiteralExpression;
4386 function isObjectLiteralExpression(node: Node): node is ObjectLiteralExpression;
4387 function isPropertyAccessExpression(node: Node): node is PropertyAccessExpression;
4388 function isElementAccessExpression(node: Node): node is ElementAccessExpression;
4389 function isCallExpression(node: Node): node is CallExpression;
4390 function isNewExpression(node: Node): node is NewExpression;
4391 function isTaggedTemplateExpression(node: Node): node is TaggedTemplateExpression;
4392 function isTypeAssertionExpression(node: Node): node is TypeAssertion;
4393 function isParenthesizedExpression(node: Node): node is ParenthesizedExpression;
4394 function isFunctionExpression(node: Node): node is FunctionExpression;
4395 function isArrowFunction(node: Node): node is ArrowFunction;
4396 function isDeleteExpression(node: Node): node is DeleteExpression;
4397 function isTypeOfExpression(node: Node): node is TypeOfExpression;
4398 function isVoidExpression(node: Node): node is VoidExpression;
4399 function isAwaitExpression(node: Node): node is AwaitExpression;
4400 function isPrefixUnaryExpression(node: Node): node is PrefixUnaryExpression;
4401 function isPostfixUnaryExpression(node: Node): node is PostfixUnaryExpression;
4402 function isBinaryExpression(node: Node): node is BinaryExpression;
4403 function isConditionalExpression(node: Node): node is ConditionalExpression;
4404 function isTemplateExpression(node: Node): node is TemplateExpression;
4405 function isYieldExpression(node: Node): node is YieldExpression;
4406 function isSpreadElement(node: Node): node is SpreadElement;
4407 function isClassExpression(node: Node): node is ClassExpression;
4408 function isOmittedExpression(node: Node): node is OmittedExpression;
4409 function isExpressionWithTypeArguments(node: Node): node is ExpressionWithTypeArguments;
4410 function isAsExpression(node: Node): node is AsExpression;
4411 function isNonNullExpression(node: Node): node is NonNullExpression;
4412 function isMetaProperty(node: Node): node is MetaProperty;
4413 function isSyntheticExpression(node: Node): node is SyntheticExpression;
4414 function isPartiallyEmittedExpression(node: Node): node is PartiallyEmittedExpression;
4415 function isCommaListExpression(node: Node): node is CommaListExpression;
4416 function isTemplateSpan(node: Node): node is TemplateSpan;
4417 function isSemicolonClassElement(node: Node): node is SemicolonClassElement;
4418 function isBlock(node: Node): node is Block;
4419 function isVariableStatement(node: Node): node is VariableStatement;
4420 function isEmptyStatement(node: Node): node is EmptyStatement;
4421 function isExpressionStatement(node: Node): node is ExpressionStatement;
4422 function isIfStatement(node: Node): node is IfStatement;
4423 function isDoStatement(node: Node): node is DoStatement;
4424 function isWhileStatement(node: Node): node is WhileStatement;
4425 function isForStatement(node: Node): node is ForStatement;
4426 function isForInStatement(node: Node): node is ForInStatement;
4427 function isForOfStatement(node: Node): node is ForOfStatement;
4428 function isContinueStatement(node: Node): node is ContinueStatement;
4429 function isBreakStatement(node: Node): node is BreakStatement;
4430 function isReturnStatement(node: Node): node is ReturnStatement;
4431 function isWithStatement(node: Node): node is WithStatement;
4432 function isSwitchStatement(node: Node): node is SwitchStatement;
4433 function isLabeledStatement(node: Node): node is LabeledStatement;
4434 function isThrowStatement(node: Node): node is ThrowStatement;
4435 function isTryStatement(node: Node): node is TryStatement;
4436 function isDebuggerStatement(node: Node): node is DebuggerStatement;
4437 function isVariableDeclaration(node: Node): node is VariableDeclaration;
4438 function isVariableDeclarationList(node: Node): node is VariableDeclarationList;
4439 function isFunctionDeclaration(node: Node): node is FunctionDeclaration;
4440 function isClassDeclaration(node: Node): node is ClassDeclaration;
4441 function isInterfaceDeclaration(node: Node): node is InterfaceDeclaration;
4442 function isTypeAliasDeclaration(node: Node): node is TypeAliasDeclaration;
4443 function isEnumDeclaration(node: Node): node is EnumDeclaration;
4444 function isModuleDeclaration(node: Node): node is ModuleDeclaration;
4445 function isModuleBlock(node: Node): node is ModuleBlock;
4446 function isCaseBlock(node: Node): node is CaseBlock;
4447 function isNamespaceExportDeclaration(node: Node): node is NamespaceExportDeclaration;
4448 function isImportEqualsDeclaration(node: Node): node is ImportEqualsDeclaration;
4449 function isImportDeclaration(node: Node): node is ImportDeclaration;
4450 function isImportClause(node: Node): node is ImportClause;
4451 function isNamespaceImport(node: Node): node is NamespaceImport;
4452 function isNamespaceExport(node: Node): node is NamespaceExport;
4453 function isNamedImports(node: Node): node is NamedImports;
4454 function isImportSpecifier(node: Node): node is ImportSpecifier;
4455 function isExportAssignment(node: Node): node is ExportAssignment;
4456 function isExportDeclaration(node: Node): node is ExportDeclaration;
4457 function isNamedExports(node: Node): node is NamedExports;
4458 function isExportSpecifier(node: Node): node is ExportSpecifier;
4459 function isMissingDeclaration(node: Node): node is MissingDeclaration;
4460 function isNotEmittedStatement(node: Node): node is NotEmittedStatement;
4461 function isExternalModuleReference(node: Node): node is ExternalModuleReference;
4462 function isJsxElement(node: Node): node is JsxElement;
4463 function isJsxSelfClosingElement(node: Node): node is JsxSelfClosingElement;
4464 function isJsxOpeningElement(node: Node): node is JsxOpeningElement;
4465 function isJsxClosingElement(node: Node): node is JsxClosingElement;
4466 function isJsxFragment(node: Node): node is JsxFragment;
4467 function isJsxOpeningFragment(node: Node): node is JsxOpeningFragment;
4468 function isJsxClosingFragment(node: Node): node is JsxClosingFragment;
4469 function isJsxAttribute(node: Node): node is JsxAttribute;
4470 function isJsxAttributes(node: Node): node is JsxAttributes;
4471 function isJsxSpreadAttribute(node: Node): node is JsxSpreadAttribute;
4472 function isJsxExpression(node: Node): node is JsxExpression;
4473 function isCaseClause(node: Node): node is CaseClause;
4474 function isDefaultClause(node: Node): node is DefaultClause;
4475 function isHeritageClause(node: Node): node is HeritageClause;
4476 function isCatchClause(node: Node): node is CatchClause;
4477 function isPropertyAssignment(node: Node): node is PropertyAssignment;
4478 function isShorthandPropertyAssignment(node: Node): node is ShorthandPropertyAssignment;
4479 function isSpreadAssignment(node: Node): node is SpreadAssignment;
4480 function isEnumMember(node: Node): node is EnumMember;
4481 function isUnparsedPrepend(node: Node): node is UnparsedPrepend;
4482 function isSourceFile(node: Node): node is SourceFile;
4483 function isBundle(node: Node): node is Bundle;
4484 function isUnparsedSource(node: Node): node is UnparsedSource;
4485 function isJSDocTypeExpression(node: Node): node is JSDocTypeExpression;
4486 function isJSDocNameReference(node: Node): node is JSDocNameReference;
4487 function isJSDocAllType(node: Node): node is JSDocAllType;
4488 function isJSDocUnknownType(node: Node): node is JSDocUnknownType;
4489 function isJSDocNullableType(node: Node): node is JSDocNullableType;
4490 function isJSDocNonNullableType(node: Node): node is JSDocNonNullableType;
4491 function isJSDocOptionalType(node: Node): node is JSDocOptionalType;
4492 function isJSDocFunctionType(node: Node): node is JSDocFunctionType;
4493 function isJSDocVariadicType(node: Node): node is JSDocVariadicType;
4494 function isJSDocNamepathType(node: Node): node is JSDocNamepathType;
4495 function isJSDoc(node: Node): node is JSDoc;
4496 function isJSDocTypeLiteral(node: Node): node is JSDocTypeLiteral;
4497 function isJSDocSignature(node: Node): node is JSDocSignature;
4498 function isJSDocAugmentsTag(node: Node): node is JSDocAugmentsTag;
4499 function isJSDocAuthorTag(node: Node): node is JSDocAuthorTag;
4500 function isJSDocClassTag(node: Node): node is JSDocClassTag;
4501 function isJSDocCallbackTag(node: Node): node is JSDocCallbackTag;
4502 function isJSDocPublicTag(node: Node): node is JSDocPublicTag;
4503 function isJSDocPrivateTag(node: Node): node is JSDocPrivateTag;
4504 function isJSDocProtectedTag(node: Node): node is JSDocProtectedTag;
4505 function isJSDocReadonlyTag(node: Node): node is JSDocReadonlyTag;
4506 function isJSDocDeprecatedTag(node: Node): node is JSDocDeprecatedTag;
4507 function isJSDocEnumTag(node: Node): node is JSDocEnumTag;
4508 function isJSDocParameterTag(node: Node): node is JSDocParameterTag;
4509 function isJSDocReturnTag(node: Node): node is JSDocReturnTag;
4510 function isJSDocThisTag(node: Node): node is JSDocThisTag;
4511 function isJSDocTypeTag(node: Node): node is JSDocTypeTag;
4512 function isJSDocTemplateTag(node: Node): node is JSDocTemplateTag;
4513 function isJSDocTypedefTag(node: Node): node is JSDocTypedefTag;
4514 function isJSDocUnknownTag(node: Node): node is JSDocUnknownTag;
4515 function isJSDocPropertyTag(node: Node): node is JSDocPropertyTag;
4516 function isJSDocImplementsTag(node: Node): node is JSDocImplementsTag;
4518 declare namespace ts {
4519 function setTextRange<T extends TextRange>(range: T, location: TextRange | undefined): T;
4521 declare namespace ts {
4523 * Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes
4524 * stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise,
4525 * embedded arrays are flattened and the 'cbNode' callback is invoked for each element. If a callback returns
4526 * a truthy value, iteration stops and that value is returned. Otherwise, undefined is returned.
4528 * @param node a given node to visit its children
4529 * @param cbNode a callback to be invoked for all child nodes
4530 * @param cbNodes a callback to be invoked for embedded array
4532 * @remarks `forEachChild` must visit the children of a node in the order
4533 * that they appear in the source code. The language service depends on this property to locate nodes by position.
4535 export function forEachChild<T>(node: Node, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined;
4536 export function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean, scriptKind?: ScriptKind): SourceFile;
4537 export function parseIsolatedEntityName(text: string, languageVersion: ScriptTarget): EntityName | undefined;
4539 * Parse json text into SyntaxTree and return node and parse errors if any
4543 export function parseJsonText(fileName: string, sourceText: string): JsonSourceFile;
4544 export function isExternalModule(file: SourceFile): boolean;
4545 export function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
4548 declare namespace ts {
4549 export function parseCommandLine(commandLine: readonly string[], readFile?: (path: string) => string | undefined): ParsedCommandLine;
4550 export type DiagnosticReporter = (diagnostic: Diagnostic) => void;
4552 * Reports config file diagnostics
4554 export interface ConfigFileDiagnosticsReporter {
4556 * Reports unrecoverable error when parsing config file
4558 onUnRecoverableConfigFileDiagnostic: DiagnosticReporter;
4561 * Interface extending ParseConfigHost to support ParseConfigFile that reads config file and reports errors
4563 export interface ParseConfigFileHost extends ParseConfigHost, ConfigFileDiagnosticsReporter {
4564 getCurrentDirectory(): string;
4567 * Reads the config file, reports errors if any and exits if the config file cannot be found
4569 export function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions, host: ParseConfigFileHost, extendedConfigCache?: Map<ExtendedConfigCacheEntry>, watchOptionsToExtend?: WatchOptions, extraFileExtensions?: readonly FileExtensionInfo[]): ParsedCommandLine | undefined;
4571 * Read tsconfig.json file
4572 * @param fileName The path to the config file
4574 export function readConfigFile(fileName: string, readFile: (path: string) => string | undefined): {
4579 * Parse the text of the tsconfig.json file
4580 * @param fileName The path to the config file
4581 * @param jsonText The text of the config file
4583 export function parseConfigFileTextToJson(fileName: string, jsonText: string): {
4588 * Read tsconfig.json file
4589 * @param fileName The path to the config file
4591 export function readJsonConfigFile(fileName: string, readFile: (path: string) => string | undefined): TsConfigSourceFile;
4593 * Convert the json syntax tree into the json value
4595 export function convertToObject(sourceFile: JsonSourceFile, errors: Push<Diagnostic>): any;
4597 * Parse the contents of a config file (tsconfig.json).
4598 * @param json The contents of the config file to parse
4599 * @param host Instance of ParseConfigHost used to enumerate files in folder.
4600 * @param basePath A root directory to resolve relative path entries in the config
4601 * file to. e.g. outDir
4603 export function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: readonly FileExtensionInfo[], extendedConfigCache?: Map<ExtendedConfigCacheEntry>, existingWatchOptions?: WatchOptions): ParsedCommandLine;
4605 * Parse the contents of a config file (tsconfig.json).
4606 * @param jsonNode The contents of the config file to parse
4607 * @param host Instance of ParseConfigHost used to enumerate files in folder.
4608 * @param basePath A root directory to resolve relative path entries in the config
4609 * file to. e.g. outDir
4611 export function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: readonly FileExtensionInfo[], extendedConfigCache?: Map<ExtendedConfigCacheEntry>, existingWatchOptions?: WatchOptions): ParsedCommandLine;
4612 export interface ParsedTsconfig {
4614 options?: CompilerOptions;
4615 watchOptions?: WatchOptions;
4616 typeAcquisition?: TypeAcquisition;
4618 * Note that the case of the config path has not yet been normalized, as no files have been imported into the project yet
4620 extendedConfigPath?: string;
4622 export interface ExtendedConfigCacheEntry {
4623 extendedResult: TsConfigSourceFile;
4624 extendedConfig: ParsedTsconfig | undefined;
4626 export function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
4627 options: CompilerOptions;
4628 errors: Diagnostic[];
4630 export function convertTypeAcquisitionFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
4631 options: TypeAcquisition;
4632 errors: Diagnostic[];
4636 declare namespace ts {
4637 function getEffectiveTypeRoots(options: CompilerOptions, host: GetEffectiveTypeRootsHost): string[] | undefined;
4639 * @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown.
4640 * This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups
4641 * is assumed to be the same as root directory of the project.
4643 function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference): ResolvedTypeReferenceDirectiveWithFailedLookupLocations;
4645 * Given a set of options, returns the set of type directive names
4646 * that should be included for this program automatically.
4647 * This list could either come from the config file,
4648 * or from enumerating the types root + initial secondary types lookup location.
4649 * More type directives might appear in the program later as a result of loading actual source files;
4650 * this list is only the set of defaults that are implicitly included.
4652 function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[];
4654 * Cached module resolutions per containing directory.
4655 * This assumes that any module id will have the same resolution for sibling files located in the same folder.
4657 interface ModuleResolutionCache extends NonRelativeModuleNameResolutionCache {
4658 getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference): Map<ResolvedModuleWithFailedLookupLocations>;
4661 * Stored map from non-relative module name to a table: directory -> result of module lookup in this directory
4662 * We support only non-relative module names because resolution of relative module names is usually more deterministic and thus less expensive.
4664 interface NonRelativeModuleNameResolutionCache {
4665 getOrCreateCacheForModuleName(nonRelativeModuleName: string, redirectedReference?: ResolvedProjectReference): PerModuleNameCache;
4667 interface PerModuleNameCache {
4668 get(directory: string): ResolvedModuleWithFailedLookupLocations | undefined;
4669 set(directory: string, result: ResolvedModuleWithFailedLookupLocations): void;
4671 function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions): ModuleResolutionCache;
4672 function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations | undefined;
4673 function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
4674 function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
4675 function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
4677 declare namespace ts {
4679 * Visits a Node using the supplied visitor, possibly returning a new Node in its place.
4681 * @param node The Node to visit.
4682 * @param visitor The callback used to visit the Node.
4683 * @param test A callback to execute to verify the Node is valid.
4684 * @param lift An optional callback to execute to lift a NodeArray into a valid Node.
4686 function visitNode<T extends Node>(node: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: NodeArray<Node>) => T): T;
4688 * Visits a Node using the supplied visitor, possibly returning a new Node in its place.
4690 * @param node The Node to visit.
4691 * @param visitor The callback used to visit the Node.
4692 * @param test A callback to execute to verify the Node is valid.
4693 * @param lift An optional callback to execute to lift a NodeArray into a valid Node.
4695 function visitNode<T extends Node>(node: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: NodeArray<Node>) => T): T | undefined;
4697 * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
4699 * @param nodes The NodeArray to visit.
4700 * @param visitor The callback used to visit a Node.
4701 * @param test A node test to execute for each node.
4702 * @param start An optional value indicating the starting offset at which to start visiting.
4703 * @param count An optional value indicating the maximum number of nodes to visit.
4705 function visitNodes<T extends Node>(nodes: NodeArray<T>, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T>;
4707 * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
4709 * @param nodes The NodeArray to visit.
4710 * @param visitor The callback used to visit a Node.
4711 * @param test A node test to execute for each node.
4712 * @param start An optional value indicating the starting offset at which to start visiting.
4713 * @param count An optional value indicating the maximum number of nodes to visit.
4715 function visitNodes<T extends Node>(nodes: NodeArray<T> | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T> | undefined;
4717 * Starts a new lexical environment and visits a statement list, ending the lexical environment
4718 * and merging hoisted declarations upon completion.
4720 function visitLexicalEnvironment(statements: NodeArray<Statement>, visitor: Visitor, context: TransformationContext, start?: number, ensureUseStrict?: boolean, nodesVisitor?: NodesVisitor): NodeArray<Statement>;
4722 * Starts a new lexical environment and visits a parameter list, suspending the lexical
4723 * environment upon completion.
4725 function visitParameterList(nodes: NodeArray<ParameterDeclaration>, visitor: Visitor, context: TransformationContext, nodesVisitor?: NodesVisitor): NodeArray<ParameterDeclaration>;
4726 function visitParameterList(nodes: NodeArray<ParameterDeclaration> | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: NodesVisitor): NodeArray<ParameterDeclaration> | undefined;
4728 * Resumes a suspended lexical environment and visits a function body, ending the lexical
4729 * environment and merging hoisted declarations upon completion.
4731 function visitFunctionBody(node: FunctionBody, visitor: Visitor, context: TransformationContext): FunctionBody;
4733 * Resumes a suspended lexical environment and visits a function body, ending the lexical
4734 * environment and merging hoisted declarations upon completion.
4736 function visitFunctionBody(node: FunctionBody | undefined, visitor: Visitor, context: TransformationContext): FunctionBody | undefined;
4738 * Resumes a suspended lexical environment and visits a concise body, ending the lexical
4739 * environment and merging hoisted declarations upon completion.
4741 function visitFunctionBody(node: ConciseBody, visitor: Visitor, context: TransformationContext): ConciseBody;
4743 * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.
4745 * @param node The Node whose children will be visited.
4746 * @param visitor The callback used to visit each child.
4747 * @param context A lexical environment context for the visitor.
4749 function visitEachChild<T extends Node>(node: T, visitor: Visitor, context: TransformationContext): T;
4751 * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.
4753 * @param node The Node whose children will be visited.
4754 * @param visitor The callback used to visit each child.
4755 * @param context A lexical environment context for the visitor.
4757 function visitEachChild<T extends Node>(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined;
4759 declare namespace ts {
4760 function getTsBuildInfoEmitOutputFilePath(options: CompilerOptions): string | undefined;
4761 function getOutputFileNames(commandLine: ParsedCommandLine, inputFileName: string, ignoreCase: boolean): readonly string[];
4762 function createPrinter(printerOptions?: PrinterOptions, handlers?: PrintHandlers): Printer;
4764 declare namespace ts {
4765 export function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string | undefined;
4766 export function resolveTripleslashReference(moduleName: string, containingFile: string): string;
4767 export function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
4768 export function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
4769 export interface FormatDiagnosticsHost {
4770 getCurrentDirectory(): string;
4771 getCanonicalFileName(fileName: string): string;
4772 getNewLine(): string;
4774 export function formatDiagnostics(diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost): string;
4775 export function formatDiagnostic(diagnostic: Diagnostic, host: FormatDiagnosticsHost): string;
4776 export function formatDiagnosticsWithColorAndContext(diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost): string;
4777 export function flattenDiagnosticMessageText(diag: string | DiagnosticMessageChain | undefined, newLine: string, indent?: number): string;
4778 export function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): readonly Diagnostic[];
4780 * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions'
4781 * that represent a compilation unit.
4783 * Creating a program proceeds from a set of root files, expanding the set of inputs by following imports and
4784 * triple-slash-reference-path directives transitively. '@types' and triple-slash-reference-types are also pulled in.
4786 * @param createProgramOptions - The options for creating a program.
4787 * @returns A 'Program' object.
4789 export function createProgram(createProgramOptions: CreateProgramOptions): Program;
4791 * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions'
4792 * that represent a compilation unit.
4794 * Creating a program proceeds from a set of root files, expanding the set of inputs by following imports and
4795 * triple-slash-reference-path directives transitively. '@types' and triple-slash-reference-types are also pulled in.
4797 * @param rootNames - A set of root files.
4798 * @param options - The compiler options which should be used.
4799 * @param host - The host interacts with the underlying file system.
4800 * @param oldProgram - Reuses an old program structure.
4801 * @param configFileParsingDiagnostics - error during config file parsing
4802 * @returns A 'Program' object.
4804 export function createProgram(rootNames: readonly string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program, configFileParsingDiagnostics?: readonly Diagnostic[]): Program;
4805 /** @deprecated */ export interface ResolveProjectReferencePathHost {
4806 fileExists(fileName: string): boolean;
4809 * Returns the target config filename of a project reference.
4810 * Note: The file might not exist.
4812 export function resolveProjectReferencePath(ref: ProjectReference): ResolvedConfigFileName;
4813 /** @deprecated */ export function resolveProjectReferencePath(host: ResolveProjectReferencePathHost, ref: ProjectReference): ResolvedConfigFileName;
4816 declare namespace ts {
4817 interface EmitOutput {
4818 outputFiles: OutputFile[];
4819 emitSkipped: boolean;
4821 interface OutputFile {
4823 writeByteOrderMark: boolean;
4827 declare namespace ts {
4828 type AffectedFileResult<T> = {
4830 affected: SourceFile | Program;
4832 interface BuilderProgramHost {
4834 * return true if file names are treated with case sensitivity
4836 useCaseSensitiveFileNames(): boolean;
4838 * If provided this would be used this hash instead of actual file shape text for detecting changes
4840 createHash?: (data: string) => string;
4842 * When emit or emitNextAffectedFile are called without writeFile,
4843 * this callback if present would be used to write files
4845 writeFile?: WriteFileCallback;
4848 * Builder to manage the program state changes
4850 interface BuilderProgram {
4852 * Returns current program
4854 getProgram(): Program;
4856 * Get compiler options of the program
4858 getCompilerOptions(): CompilerOptions;
4860 * Get the source file in the program with file name
4862 getSourceFile(fileName: string): SourceFile | undefined;
4864 * Get a list of files in the program
4866 getSourceFiles(): readonly SourceFile[];
4868 * Get the diagnostics for compiler options
4870 getOptionsDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
4872 * Get the diagnostics that dont belong to any file
4874 getGlobalDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
4876 * Get the diagnostics from config file parsing
4878 getConfigFileParsingDiagnostics(): readonly Diagnostic[];
4880 * Get the syntax diagnostics, for all source files if source file is not supplied
4882 getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
4884 * Get the declaration diagnostics, for all source files if source file is not supplied
4886 getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[];
4888 * Get all the dependencies of the file
4890 getAllDependencies(sourceFile: SourceFile): readonly string[];
4892 * Gets the semantic diagnostics from the program corresponding to this state of file (if provided) or whole program
4893 * The semantic diagnostics are cached and managed here
4894 * Note that it is assumed that when asked about semantic diagnostics through this API,
4895 * the file has been taken out of affected files so it is safe to use cache or get from program and cache the diagnostics
4896 * In case of SemanticDiagnosticsBuilderProgram if the source file is not provided,
4897 * it will iterate through all the affected files, to ensure that cache stays valid and yet provide a way to get all semantic diagnostics
4899 getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
4901 * Emits the JavaScript and declaration files.
4902 * When targetSource file is specified, emits the files corresponding to that source file,
4903 * otherwise for the whole program.
4904 * In case of EmitAndSemanticDiagnosticsBuilderProgram, when targetSourceFile is specified,
4905 * it is assumed that that file is handled from affected file list. If targetSourceFile is not specified,
4906 * it will only emit all the affected files instead of whole program
4908 * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host
4909 * in that order would be used to write the files
4911 emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult;
4913 * Get the current directory of the program
4915 getCurrentDirectory(): string;
4918 * The builder that caches the semantic diagnostics for the program and handles the changed files and affected files
4920 interface SemanticDiagnosticsBuilderProgram extends BuilderProgram {
4922 * Gets the semantic diagnostics from the program for the next affected file and caches it
4923 * Returns undefined if the iteration is complete
4925 getSemanticDiagnosticsOfNextAffectedFile(cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean): AffectedFileResult<readonly Diagnostic[]>;
4928 * The builder that can handle the changes in program and iterate through changed file to emit the files
4929 * The semantic diagnostics are cached per file and managed by clearing for the changed/affected files
4931 interface EmitAndSemanticDiagnosticsBuilderProgram extends SemanticDiagnosticsBuilderProgram {
4933 * Emits the next affected file's emit result (EmitResult and sourceFiles emitted) or returns undefined if iteration is complete
4934 * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host
4935 * in that order would be used to write the files
4937 emitNextAffectedFile(writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): AffectedFileResult<EmitResult>;
4940 * Create the builder to manage semantic diagnostics and cache them
4942 function createSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[]): SemanticDiagnosticsBuilderProgram;
4943 function createSemanticDiagnosticsBuilderProgram(rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]): SemanticDiagnosticsBuilderProgram;
4945 * Create the builder that can handle the changes in program and iterate through changed files
4946 * to emit the those files and manage semantic diagnostics cache as well
4948 function createEmitAndSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[]): EmitAndSemanticDiagnosticsBuilderProgram;
4949 function createEmitAndSemanticDiagnosticsBuilderProgram(rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]): EmitAndSemanticDiagnosticsBuilderProgram;
4951 * Creates a builder thats just abstraction over program and can be used with watch
4953 function createAbstractBuilder(newProgram: Program, host: BuilderProgramHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[]): BuilderProgram;
4954 function createAbstractBuilder(rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]): BuilderProgram;
4956 declare namespace ts {
4957 interface ReadBuildProgramHost {
4958 useCaseSensitiveFileNames(): boolean;
4959 getCurrentDirectory(): string;
4960 readFile(fileName: string): string | undefined;
4962 function readBuilderProgram(compilerOptions: CompilerOptions, host: ReadBuildProgramHost): EmitAndSemanticDiagnosticsBuilderProgram | undefined;
4963 function createIncrementalCompilerHost(options: CompilerOptions, system?: System): CompilerHost;
4964 interface IncrementalProgramOptions<T extends BuilderProgram> {
4965 rootNames: readonly string[];
4966 options: CompilerOptions;
4967 configFileParsingDiagnostics?: readonly Diagnostic[];
4968 projectReferences?: readonly ProjectReference[];
4969 host?: CompilerHost;
4970 createProgram?: CreateProgram<T>;
4972 function createIncrementalProgram<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>({ rootNames, options, configFileParsingDiagnostics, projectReferences, host, createProgram }: IncrementalProgramOptions<T>): T;
4973 type WatchStatusReporter = (diagnostic: Diagnostic, newLine: string, options: CompilerOptions, errorCount?: number) => void;
4974 /** Create the program with rootNames and options, if they are undefined, oldProgram and new configFile diagnostics create new program */
4975 type CreateProgram<T extends BuilderProgram> = (rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: T, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[] | undefined) => T;
4976 /** Host that has watch functionality used in --watch mode */
4977 interface WatchHost {
4978 /** If provided, called with Diagnostic message that informs about change in watch status */
4979 onWatchStatusChange?(diagnostic: Diagnostic, newLine: string, options: CompilerOptions, errorCount?: number): void;
4980 /** Used to watch changes in source files, missing files needed to update the program or config file */
4981 watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: CompilerOptions): FileWatcher;
4982 /** Used to watch resolved module's failed lookup locations, config file specs, type roots where auto type reference directives are added */
4983 watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: CompilerOptions): FileWatcher;
4984 /** If provided, will be used to set delayed compilation, so that multiple changes in short span are compiled together */
4985 setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
4986 /** If provided, will be used to reset existing delayed compilation */
4987 clearTimeout?(timeoutId: any): void;
4989 interface ProgramHost<T extends BuilderProgram> {
4991 * Used to create the program when need for program creation or recreation detected
4993 createProgram: CreateProgram<T>;
4994 useCaseSensitiveFileNames(): boolean;
4995 getNewLine(): string;
4996 getCurrentDirectory(): string;
4997 getDefaultLibFileName(options: CompilerOptions): string;
4998 getDefaultLibLocation?(): string;
4999 createHash?(data: string): string;
5001 * Use to check file presence for source files and
5002 * if resolveModuleNames is not provided (complier is in charge of module resolution) then module files as well
5004 fileExists(path: string): boolean;
5006 * Use to read file text for source files and
5007 * if resolveModuleNames is not provided (complier is in charge of module resolution) then module files as well
5009 readFile(path: string, encoding?: string): string | undefined;
5010 /** If provided, used for module resolution as well as to handle directory structure */
5011 directoryExists?(path: string): boolean;
5012 /** If provided, used in resolutions as well as handling directory structure */
5013 getDirectories?(path: string): string[];
5014 /** If provided, used to cache and handle directory structure modifications */
5015 readDirectory?(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
5016 /** Symbol links resolution */
5017 realpath?(path: string): string;
5018 /** If provided would be used to write log about compilation */
5019 trace?(s: string): void;
5020 /** If provided is used to get the environment variable */
5021 getEnvironmentVariable?(name: string): string | undefined;
5022 /** If provided, used to resolve the module names, otherwise typescript's default module resolution */
5023 resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedModule | undefined)[];
5024 /** If provided, used to resolve type reference directives, otherwise typescript's default resolution */
5025 resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
5027 interface WatchCompilerHost<T extends BuilderProgram> extends ProgramHost<T>, WatchHost {
5028 /** Instead of using output d.ts file from project reference, use its source file */
5029 useSourceOfProjectReferenceRedirect?(): boolean;
5030 /** If provided, callback to invoke after every new program creation */
5031 afterProgramCreate?(program: T): void;
5034 * Host to create watch with root files and options
5036 interface WatchCompilerHostOfFilesAndCompilerOptions<T extends BuilderProgram> extends WatchCompilerHost<T> {
5037 /** root files to use to generate program */
5038 rootFiles: string[];
5039 /** Compiler options */
5040 options: CompilerOptions;
5041 watchOptions?: WatchOptions;
5042 /** Project References */
5043 projectReferences?: readonly ProjectReference[];
5046 * Host to create watch with config file
5048 interface WatchCompilerHostOfConfigFile<T extends BuilderProgram> extends WatchCompilerHost<T>, ConfigFileDiagnosticsReporter {
5049 /** Name of the config file to compile */
5050 configFileName: string;
5051 /** Options to extend */
5052 optionsToExtend?: CompilerOptions;
5053 watchOptionsToExtend?: WatchOptions;
5054 extraFileExtensions?: readonly FileExtensionInfo[];
5056 * Used to generate source file names from the config file and its include, exclude, files rules
5057 * and also to cache the directory stucture
5059 readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
5061 interface Watch<T> {
5062 /** Synchronize with host and get updated program */
5064 /** Closes the watch */
5068 * Creates the watch what generates program using the config file
5070 interface WatchOfConfigFile<T> extends Watch<T> {
5073 * Creates the watch that generates program using the root files and compiler options
5075 interface WatchOfFilesAndCompilerOptions<T> extends Watch<T> {
5076 /** Updates the root files in the program, only if this is not config file compilation */
5077 updateRootFileNames(fileNames: string[]): void;
5080 * Create the watch compiler host for either configFile or fileNames and its options
5082 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>;
5083 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>;
5085 * Creates the watch from the host for root files and compiler options
5087 function createWatchProgram<T extends BuilderProgram>(host: WatchCompilerHostOfFilesAndCompilerOptions<T>): WatchOfFilesAndCompilerOptions<T>;
5089 * Creates the watch from the host for config file
5091 function createWatchProgram<T extends BuilderProgram>(host: WatchCompilerHostOfConfigFile<T>): WatchOfConfigFile<T>;
5093 declare namespace ts {
5094 interface BuildOptions {
5098 incremental?: boolean;
5099 assumeChangesOnlyAffectDirectDependencies?: boolean;
5100 traceResolution?: boolean;
5101 [option: string]: CompilerOptionsValue | undefined;
5103 type ReportEmitErrorSummary = (errorCount: number) => void;
5104 interface SolutionBuilderHostBase<T extends BuilderProgram> extends ProgramHost<T> {
5105 createDirectory?(path: string): void;
5107 * Should provide create directory and writeFile if done of invalidatedProjects is not invoked with
5110 writeFile?(path: string, data: string, writeByteOrderMark?: boolean): void;
5111 getModifiedTime(fileName: string): Date | undefined;
5112 setModifiedTime(fileName: string, date: Date): void;
5113 deleteFile(fileName: string): void;
5114 getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
5115 reportDiagnostic: DiagnosticReporter;
5116 reportSolutionBuilderStatus: DiagnosticReporter;
5117 afterProgramEmitAndDiagnostics?(program: T): void;
5119 interface SolutionBuilderHost<T extends BuilderProgram> extends SolutionBuilderHostBase<T> {
5120 reportErrorSummary?: ReportEmitErrorSummary;
5122 interface SolutionBuilderWithWatchHost<T extends BuilderProgram> extends SolutionBuilderHostBase<T>, WatchHost {
5124 interface SolutionBuilder<T extends BuilderProgram> {
5125 build(project?: string, cancellationToken?: CancellationToken): ExitStatus;
5126 clean(project?: string): ExitStatus;
5127 buildReferences(project: string, cancellationToken?: CancellationToken): ExitStatus;
5128 cleanReferences(project?: string): ExitStatus;
5129 getNextInvalidatedProject(cancellationToken?: CancellationToken): InvalidatedProject<T> | undefined;
5132 * Create a function that reports watch status by writing to the system and handles the formating of the diagnostic
5134 function createBuilderStatusReporter(system: System, pretty?: boolean): DiagnosticReporter;
5135 function createSolutionBuilderHost<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>(system?: System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportSolutionBuilderStatus?: DiagnosticReporter, reportErrorSummary?: ReportEmitErrorSummary): SolutionBuilderHost<T>;
5136 function createSolutionBuilderWithWatchHost<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>(system?: System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportSolutionBuilderStatus?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter): SolutionBuilderWithWatchHost<T>;
5137 function createSolutionBuilder<T extends BuilderProgram>(host: SolutionBuilderHost<T>, rootNames: readonly string[], defaultOptions: BuildOptions): SolutionBuilder<T>;
5138 function createSolutionBuilderWithWatch<T extends BuilderProgram>(host: SolutionBuilderWithWatchHost<T>, rootNames: readonly string[], defaultOptions: BuildOptions, baseWatchOptions?: WatchOptions): SolutionBuilder<T>;
5139 enum InvalidatedProjectKind {
5142 UpdateOutputFileStamps = 2
5144 interface InvalidatedProjectBase {
5145 readonly kind: InvalidatedProjectKind;
5146 readonly project: ResolvedConfigFileName;
5148 * To dispose this project and ensure that all the necessary actions are taken and state is updated accordingly
5150 done(cancellationToken?: CancellationToken, writeFile?: WriteFileCallback, customTransformers?: CustomTransformers): ExitStatus;
5151 getCompilerOptions(): CompilerOptions;
5152 getCurrentDirectory(): string;
5154 interface UpdateOutputFileStampsProject extends InvalidatedProjectBase {
5155 readonly kind: InvalidatedProjectKind.UpdateOutputFileStamps;
5156 updateOutputFileStatmps(): void;
5158 interface BuildInvalidedProject<T extends BuilderProgram> extends InvalidatedProjectBase {
5159 readonly kind: InvalidatedProjectKind.Build;
5160 getBuilderProgram(): T | undefined;
5161 getProgram(): Program | undefined;
5162 getSourceFile(fileName: string): SourceFile | undefined;
5163 getSourceFiles(): readonly SourceFile[];
5164 getOptionsDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
5165 getGlobalDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[];
5166 getConfigFileParsingDiagnostics(): readonly Diagnostic[];
5167 getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
5168 getAllDependencies(sourceFile: SourceFile): readonly string[];
5169 getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
5170 getSemanticDiagnosticsOfNextAffectedFile(cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean): AffectedFileResult<readonly Diagnostic[]>;
5171 emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult | undefined;
5173 interface UpdateBundleProject<T extends BuilderProgram> extends InvalidatedProjectBase {
5174 readonly kind: InvalidatedProjectKind.UpdateBundle;
5175 emit(writeFile?: WriteFileCallback, customTransformers?: CustomTransformers): EmitResult | BuildInvalidedProject<T> | undefined;
5177 type InvalidatedProject<T extends BuilderProgram> = UpdateOutputFileStampsProject | BuildInvalidedProject<T> | UpdateBundleProject<T>;
5179 declare namespace ts.server {
5180 type ActionSet = "action::set";
5181 type ActionInvalidate = "action::invalidate";
5182 type ActionPackageInstalled = "action::packageInstalled";
5183 type EventTypesRegistry = "event::typesRegistry";
5184 type EventBeginInstallTypes = "event::beginInstallTypes";
5185 type EventEndInstallTypes = "event::endInstallTypes";
5186 type EventInitializationFailed = "event::initializationFailed";
5188 declare namespace ts.server {
5189 interface TypingInstallerResponse {
5190 readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed;
5192 interface TypingInstallerRequestWithProjectName {
5193 readonly projectName: string;
5195 interface DiscoverTypings extends TypingInstallerRequestWithProjectName {
5196 readonly fileNames: string[];
5197 readonly projectRootPath: Path;
5198 readonly compilerOptions: CompilerOptions;
5199 readonly watchOptions?: WatchOptions;
5200 readonly typeAcquisition: TypeAcquisition;
5201 readonly unresolvedImports: SortedReadonlyArray<string>;
5202 readonly cachePath?: string;
5203 readonly kind: "discover";
5205 interface CloseProject extends TypingInstallerRequestWithProjectName {
5206 readonly kind: "closeProject";
5208 interface TypesRegistryRequest {
5209 readonly kind: "typesRegistry";
5211 interface InstallPackageRequest extends TypingInstallerRequestWithProjectName {
5212 readonly kind: "installPackage";
5213 readonly fileName: Path;
5214 readonly packageName: string;
5215 readonly projectRootPath: Path;
5217 interface PackageInstalledResponse extends ProjectResponse {
5218 readonly kind: ActionPackageInstalled;
5219 readonly success: boolean;
5220 readonly message: string;
5222 interface InitializationFailedResponse extends TypingInstallerResponse {
5223 readonly kind: EventInitializationFailed;
5224 readonly message: string;
5225 readonly stack?: string;
5227 interface ProjectResponse extends TypingInstallerResponse {
5228 readonly projectName: string;
5230 interface InvalidateCachedTypings extends ProjectResponse {
5231 readonly kind: ActionInvalidate;
5233 interface InstallTypes extends ProjectResponse {
5234 readonly kind: EventBeginInstallTypes | EventEndInstallTypes;
5235 readonly eventId: number;
5236 readonly typingsInstallerVersion: string;
5237 readonly packagesToInstall: readonly string[];
5239 interface BeginInstallTypes extends InstallTypes {
5240 readonly kind: EventBeginInstallTypes;
5242 interface EndInstallTypes extends InstallTypes {
5243 readonly kind: EventEndInstallTypes;
5244 readonly installSuccess: boolean;
5246 interface SetTypings extends ProjectResponse {
5247 readonly typeAcquisition: TypeAcquisition;
5248 readonly compilerOptions: CompilerOptions;
5249 readonly typings: string[];
5250 readonly unresolvedImports: SortedReadonlyArray<string>;
5251 readonly kind: ActionSet;
5254 declare namespace ts {
5256 getSourceFile(): SourceFile;
5257 getChildCount(sourceFile?: SourceFile): number;
5258 getChildAt(index: number, sourceFile?: SourceFile): Node;
5259 getChildren(sourceFile?: SourceFile): Node[];
5260 getStart(sourceFile?: SourceFile, includeJsDocComment?: boolean): number;
5261 getFullStart(): number;
5263 getWidth(sourceFile?: SourceFileLike): number;
5264 getFullWidth(): number;
5265 getLeadingTriviaWidth(sourceFile?: SourceFile): number;
5266 getFullText(sourceFile?: SourceFile): string;
5267 getText(sourceFile?: SourceFile): string;
5268 getFirstToken(sourceFile?: SourceFile): Node | undefined;
5269 getLastToken(sourceFile?: SourceFile): Node | undefined;
5270 forEachChild<T>(cbNode: (node: Node) => T | undefined, cbNodeArray?: (nodes: NodeArray<Node>) => T | undefined): T | undefined;
5272 interface Identifier {
5273 readonly text: string;
5275 interface PrivateIdentifier {
5276 readonly text: string;
5279 readonly name: string;
5280 getFlags(): SymbolFlags;
5281 getEscapedName(): __String;
5283 getDeclarations(): Declaration[] | undefined;
5284 getDocumentationComment(typeChecker: TypeChecker | undefined): SymbolDisplayPart[];
5285 getJsDocTags(): JSDocTagInfo[];
5288 getFlags(): TypeFlags;
5289 getSymbol(): Symbol | undefined;
5290 getProperties(): Symbol[];
5291 getProperty(propertyName: string): Symbol | undefined;
5292 getApparentProperties(): Symbol[];
5293 getCallSignatures(): readonly Signature[];
5294 getConstructSignatures(): readonly Signature[];
5295 getStringIndexType(): Type | undefined;
5296 getNumberIndexType(): Type | undefined;
5297 getBaseTypes(): BaseType[] | undefined;
5298 getNonNullableType(): Type;
5299 getConstraint(): Type | undefined;
5300 getDefault(): Type | undefined;
5301 isUnion(): this is UnionType;
5302 isIntersection(): this is IntersectionType;
5303 isUnionOrIntersection(): this is UnionOrIntersectionType;
5304 isLiteral(): this is LiteralType;
5305 isStringLiteral(): this is StringLiteralType;
5306 isNumberLiteral(): this is NumberLiteralType;
5307 isTypeParameter(): this is TypeParameter;
5308 isClassOrInterface(): this is InterfaceType;
5309 isClass(): this is InterfaceType;
5311 interface TypeReference {
5312 typeArguments?: readonly Type[];
5314 interface Signature {
5315 getDeclaration(): SignatureDeclaration;
5316 getTypeParameters(): TypeParameter[] | undefined;
5317 getParameters(): Symbol[];
5318 getReturnType(): Type;
5319 getDocumentationComment(typeChecker: TypeChecker | undefined): SymbolDisplayPart[];
5320 getJsDocTags(): JSDocTagInfo[];
5322 interface SourceFile {
5323 getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
5324 getLineEndOfPosition(pos: number): number;
5325 getLineStarts(): readonly number[];
5326 getPositionOfLineAndCharacter(line: number, character: number): number;
5327 update(newText: string, textChangeRange: TextChangeRange): SourceFile;
5329 interface SourceFileLike {
5330 getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
5332 interface SourceMapSource {
5333 getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
5336 * Represents an immutable snapshot of a script at a specified time.Once acquired, the
5337 * snapshot is observably immutable. i.e. the same calls with the same parameters will return
5340 interface IScriptSnapshot {
5341 /** Gets a portion of the script snapshot specified by [start, end). */
5342 getText(start: number, end: number): string;
5343 /** Gets the length of this script snapshot. */
5344 getLength(): number;
5346 * Gets the TextChangeRange that describe how the text changed between this text and
5347 * an older version. This information is used by the incremental parser to determine
5348 * what sections of the script need to be re-parsed. 'undefined' can be returned if the
5349 * change range cannot be determined. However, in that case, incremental parsing will
5350 * not happen and the entire document will be re - parsed.
5352 getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange | undefined;
5353 /** Releases all resources held by this script snapshot */
5356 namespace ScriptSnapshot {
5357 function fromString(text: string): IScriptSnapshot;
5359 interface PreProcessedFileInfo {
5360 referencedFiles: FileReference[];
5361 typeReferenceDirectives: FileReference[];
5362 libReferenceDirectives: FileReference[];
5363 importedFiles: FileReference[];
5364 ambientExternalModules?: string[];
5367 interface HostCancellationToken {
5368 isCancellationRequested(): boolean;
5370 interface InstallPackageOptions {
5372 packageName: string;
5374 interface PerformanceEvent {
5375 kind: "UpdateGraph" | "CreatePackageJsonAutoImportProvider";
5378 enum LanguageServiceMode {
5380 PartialSemantic = 1,
5383 interface LanguageServiceHost extends GetEffectiveTypeRootsHost {
5384 getCompilationSettings(): CompilerOptions;
5385 getNewLine?(): string;
5386 getProjectVersion?(): string;
5387 getScriptFileNames(): string[];
5388 getScriptKind?(fileName: string): ScriptKind;
5389 getScriptVersion(fileName: string): string;
5390 getScriptSnapshot(fileName: string): IScriptSnapshot | undefined;
5391 getProjectReferences?(): readonly ProjectReference[] | undefined;
5392 getLocalizedDiagnosticMessages?(): any;
5393 getCancellationToken?(): HostCancellationToken;
5394 getCurrentDirectory(): string;
5395 getDefaultLibFileName(options: CompilerOptions): string;
5396 log?(s: string): void;
5397 trace?(s: string): void;
5398 error?(s: string): void;
5399 useCaseSensitiveFileNames?(): boolean;
5400 readDirectory?(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
5401 readFile?(path: string, encoding?: string): string | undefined;
5402 realpath?(path: string): string;
5403 fileExists?(path: string): boolean;
5404 getTypeRootsVersion?(): number;
5405 resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedModule | undefined)[];
5406 getResolvedModuleWithFailedLookupLocationsFromCache?(modulename: string, containingFile: string): ResolvedModuleWithFailedLookupLocations | undefined;
5407 resolveTypeReferenceDirectives?(typeDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
5408 getDirectories?(directoryName: string): string[];
5410 * Gets a set of custom transformers to use during emit.
5412 getCustomTransformers?(): CustomTransformers | undefined;
5413 isKnownTypesPackageName?(name: string): boolean;
5414 installPackage?(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
5415 writeFile?(fileName: string, content: string): void;
5417 type WithMetadata<T> = T & {
5420 enum SemanticClassificationFormat {
5421 Original = "original",
5422 TwentyTwenty = "2020"
5424 interface LanguageService {
5425 /** This is used as a part of restarting the language service. */
5426 cleanupSemanticCache(): void;
5428 * Gets errors indicating invalid syntax in a file.
5430 * In English, "this cdeo have, erorrs" is syntactically invalid because it has typos,
5431 * grammatical errors, and misplaced punctuation. Likewise, examples of syntax
5432 * errors in TypeScript are missing parentheses in an `if` statement, mismatched
5433 * curly braces, and using a reserved keyword as a variable name.
5435 * These diagnostics are inexpensive to compute and don't require knowledge of
5436 * other files. Note that a non-empty result increases the likelihood of false positives
5437 * from `getSemanticDiagnostics`.
5439 * While these represent the majority of syntax-related diagnostics, there are some
5440 * that require the type system, which will be present in `getSemanticDiagnostics`.
5442 * @param fileName A path to the file you want syntactic diagnostics for
5444 getSyntacticDiagnostics(fileName: string): DiagnosticWithLocation[];
5446 * Gets warnings or errors indicating type system issues in a given file.
5447 * Requesting semantic diagnostics may start up the type system and
5448 * run deferred work, so the first call may take longer than subsequent calls.
5450 * Unlike the other get*Diagnostics functions, these diagnostics can potentially not
5451 * include a reference to a source file. Specifically, the first time this is called,
5452 * it will return global diagnostics with no associated location.
5454 * To contrast the differences between semantic and syntactic diagnostics, consider the
5455 * sentence: "The sun is green." is syntactically correct; those are real English words with
5456 * correct sentence structure. However, it is semantically invalid, because it is not true.
5458 * @param fileName A path to the file you want semantic diagnostics for
5460 getSemanticDiagnostics(fileName: string): Diagnostic[];
5462 * Gets suggestion diagnostics for a specific file. These diagnostics tend to
5463 * proactively suggest refactors, as opposed to diagnostics that indicate
5464 * potentially incorrect runtime behavior.
5466 * @param fileName A path to the file you want semantic diagnostics for
5468 getSuggestionDiagnostics(fileName: string): DiagnosticWithLocation[];
5470 * Gets global diagnostics related to the program configuration and compiler options.
5472 getCompilerOptionsDiagnostics(): Diagnostic[];
5473 /** @deprecated Use getEncodedSyntacticClassifications instead. */
5474 getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[];
5475 getSyntacticClassifications(fileName: string, span: TextSpan, format: SemanticClassificationFormat): ClassifiedSpan[] | ClassifiedSpan2020[];
5476 /** @deprecated Use getEncodedSemanticClassifications instead. */
5477 getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[];
5478 getSemanticClassifications(fileName: string, span: TextSpan, format: SemanticClassificationFormat): ClassifiedSpan[] | ClassifiedSpan2020[];
5479 /** Encoded as triples of [start, length, ClassificationType]. */
5480 getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications;
5482 * Gets semantic highlights information for a particular file. Has two formats, an older
5483 * version used by VS and a format used by VS Code.
5485 * @param fileName The path to the file
5486 * @param position A text span to return results within
5487 * @param format Which format to use, defaults to "original"
5488 * @returns a number array encoded as triples of [start, length, ClassificationType, ...].
5490 getEncodedSemanticClassifications(fileName: string, span: TextSpan, format?: SemanticClassificationFormat): Classifications;
5492 * Gets completion entries at a particular position in a file.
5494 * @param fileName The path to the file
5495 * @param position A zero-based index of the character where you want the entries
5496 * @param options An object describing how the request was triggered and what kinds
5497 * of code actions can be returned with the completions.
5499 getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined): WithMetadata<CompletionInfo> | undefined;
5501 * Gets the extended details for a completion entry retrieved from `getCompletionsAtPosition`.
5503 * @param fileName The path to the file
5504 * @param position A zero based index of the character where you want the entries
5505 * @param entryName The name from an existing completion which came from `getCompletionsAtPosition`
5506 * @param formatOptions How should code samples in the completions be formatted, can be undefined for backwards compatibility
5507 * @param source Source code for the current file, can be undefined for backwards compatibility
5508 * @param preferences User settings, can be undefined for backwards compatibility
5510 getCompletionEntryDetails(fileName: string, position: number, entryName: string, formatOptions: FormatCodeOptions | FormatCodeSettings | undefined, source: string | undefined, preferences: UserPreferences | undefined): CompletionEntryDetails | undefined;
5511 getCompletionEntrySymbol(fileName: string, position: number, name: string, source: string | undefined): Symbol | undefined;
5513 * Gets semantic information about the identifier at a particular position in a
5514 * file. Quick info is what you typically see when you hover in an editor.
5516 * @param fileName The path to the file
5517 * @param position A zero-based index of the character where you want the quick info
5519 getQuickInfoAtPosition(fileName: string, position: number): QuickInfo | undefined;
5520 getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan | undefined;
5521 getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan | undefined;
5522 getSignatureHelpItems(fileName: string, position: number, options: SignatureHelpItemsOptions | undefined): SignatureHelpItems | undefined;
5523 getRenameInfo(fileName: string, position: number, options?: RenameInfoOptions): RenameInfo;
5524 findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename?: boolean): readonly RenameLocation[] | undefined;
5525 getSmartSelectionRange(fileName: string, position: number): SelectionRange;
5526 getDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined;
5527 getDefinitionAndBoundSpan(fileName: string, position: number): DefinitionInfoAndBoundSpan | undefined;
5528 getTypeDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined;
5529 getImplementationAtPosition(fileName: string, position: number): readonly ImplementationLocation[] | undefined;
5530 getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[] | undefined;
5531 findReferences(fileName: string, position: number): ReferencedSymbol[] | undefined;
5532 getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): DocumentHighlights[] | undefined;
5534 getOccurrencesAtPosition(fileName: string, position: number): readonly ReferenceEntry[] | undefined;
5535 getNavigateToItems(searchValue: string, maxResultCount?: number, fileName?: string, excludeDtsFiles?: boolean): NavigateToItem[];
5536 getNavigationBarItems(fileName: string): NavigationBarItem[];
5537 getNavigationTree(fileName: string): NavigationTree;
5538 prepareCallHierarchy(fileName: string, position: number): CallHierarchyItem | CallHierarchyItem[] | undefined;
5539 provideCallHierarchyIncomingCalls(fileName: string, position: number): CallHierarchyIncomingCall[];
5540 provideCallHierarchyOutgoingCalls(fileName: string, position: number): CallHierarchyOutgoingCall[];
5541 getOutliningSpans(fileName: string): OutliningSpan[];
5542 getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[];
5543 getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[];
5544 getIndentationAtPosition(fileName: string, position: number, options: EditorOptions | EditorSettings): number;
5545 getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
5546 getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
5547 getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
5548 getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion | undefined;
5549 isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean;
5551 * 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.
5552 * Editors should call this after `>` is typed.
5554 getJsxClosingTagAtPosition(fileName: string, position: number): JsxClosingTagInfo | undefined;
5555 getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan | undefined;
5556 toLineColumnOffset?(fileName: string, position: number): LineAndCharacter;
5557 getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: readonly number[], formatOptions: FormatCodeSettings, preferences: UserPreferences): readonly CodeFixAction[];
5558 getCombinedCodeFix(scope: CombinedCodeFixScope, fixId: {}, formatOptions: FormatCodeSettings, preferences: UserPreferences): CombinedCodeActions;
5559 applyCodeActionCommand(action: CodeActionCommand, formatSettings?: FormatCodeSettings): Promise<ApplyCodeActionCommandResult>;
5560 applyCodeActionCommand(action: CodeActionCommand[], formatSettings?: FormatCodeSettings): Promise<ApplyCodeActionCommandResult[]>;
5561 applyCodeActionCommand(action: CodeActionCommand | CodeActionCommand[], formatSettings?: FormatCodeSettings): Promise<ApplyCodeActionCommandResult | ApplyCodeActionCommandResult[]>;
5562 /** @deprecated `fileName` will be ignored */
5563 applyCodeActionCommand(fileName: string, action: CodeActionCommand): Promise<ApplyCodeActionCommandResult>;
5564 /** @deprecated `fileName` will be ignored */
5565 applyCodeActionCommand(fileName: string, action: CodeActionCommand[]): Promise<ApplyCodeActionCommandResult[]>;
5566 /** @deprecated `fileName` will be ignored */
5567 applyCodeActionCommand(fileName: string, action: CodeActionCommand | CodeActionCommand[]): Promise<ApplyCodeActionCommandResult | ApplyCodeActionCommandResult[]>;
5568 getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined, triggerReason?: RefactorTriggerReason): ApplicableRefactorInfo[];
5569 getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | undefined): RefactorEditInfo | undefined;
5570 organizeImports(scope: OrganizeImportsScope, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[];
5571 getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[];
5572 getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean, forceDtsEmit?: boolean): EmitOutput;
5573 getProgram(): Program | undefined;
5574 toggleLineComment(fileName: string, textRange: TextRange): TextChange[];
5575 toggleMultilineComment(fileName: string, textRange: TextRange): TextChange[];
5576 commentSelection(fileName: string, textRange: TextRange): TextChange[];
5577 uncommentSelection(fileName: string, textRange: TextRange): TextChange[];
5580 interface JsxClosingTagInfo {
5581 readonly newText: string;
5583 interface CombinedCodeFixScope {
5587 type OrganizeImportsScope = CombinedCodeFixScope;
5588 type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<" | "#";
5589 interface GetCompletionsAtPositionOptions extends UserPreferences {
5591 * If the editor is asking for completions because a certain character was typed
5592 * (as opposed to when the user explicitly requested them) this should be set.
5594 triggerCharacter?: CompletionsTriggerCharacter;
5595 /** @deprecated Use includeCompletionsForModuleExports */
5596 includeExternalModuleExports?: boolean;
5597 /** @deprecated Use includeCompletionsWithInsertText */
5598 includeInsertTextCompletions?: boolean;
5600 type SignatureHelpTriggerCharacter = "," | "(" | "<";
5601 type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")";
5602 interface SignatureHelpItemsOptions {
5603 triggerReason?: SignatureHelpTriggerReason;
5605 type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason;
5607 * Signals that the user manually requested signature help.
5608 * The language service will unconditionally attempt to provide a result.
5610 interface SignatureHelpInvokedReason {
5612 triggerCharacter?: undefined;
5615 * Signals that the signature help request came from a user typing a character.
5616 * Depending on the character and the syntactic context, the request may or may not be served a result.
5618 interface SignatureHelpCharacterTypedReason {
5619 kind: "characterTyped";
5621 * Character that was responsible for triggering signature help.
5623 triggerCharacter: SignatureHelpTriggerCharacter;
5626 * Signals that this signature help request came from typing a character or moving the cursor.
5627 * This should only occur if a signature help session was already active and the editor needs to see if it should adjust.
5628 * The language service will unconditionally attempt to provide a result.
5629 * `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move.
5631 interface SignatureHelpRetriggeredReason {
5634 * Character that was responsible for triggering signature help.
5636 triggerCharacter?: SignatureHelpRetriggerCharacter;
5638 interface ApplyCodeActionCommandResult {
5639 successMessage: string;
5641 interface Classifications {
5643 endOfLineState: EndOfLineState;
5645 interface ClassifiedSpan {
5647 classificationType: ClassificationTypeNames;
5649 interface ClassifiedSpan2020 {
5651 classificationType: number;
5654 * Navigation bar interface designed for visual studio's dual-column layout.
5655 * This does not form a proper tree.
5656 * The navbar is returned as a list of top-level items, each of which has a list of child items.
5657 * Child items always have an empty array for their `childItems`.
5659 interface NavigationBarItem {
5661 kind: ScriptElementKind;
5662 kindModifiers: string;
5664 childItems: NavigationBarItem[];
5670 * Node in a tree of nested declarations in a file.
5671 * The top node is always a script or module node.
5673 interface NavigationTree {
5674 /** Name of the declaration, or a short description, e.g. "<class>". */
5676 kind: ScriptElementKind;
5677 /** ScriptElementKindModifier separated by commas, e.g. "public,abstract" */
5678 kindModifiers: string;
5680 * Spans of the nodes that generated this declaration.
5681 * There will be more than one if this is the result of merging.
5684 nameSpan: TextSpan | undefined;
5685 /** Present if non-empty */
5686 childItems?: NavigationTree[];
5688 interface CallHierarchyItem {
5690 kind: ScriptElementKind;
5691 kindModifiers?: string;
5694 selectionSpan: TextSpan;
5695 containerName?: string;
5697 interface CallHierarchyIncomingCall {
5698 from: CallHierarchyItem;
5699 fromSpans: TextSpan[];
5701 interface CallHierarchyOutgoingCall {
5702 to: CallHierarchyItem;
5703 fromSpans: TextSpan[];
5705 interface TodoCommentDescriptor {
5709 interface TodoComment {
5710 descriptor: TodoCommentDescriptor;
5714 interface TextChange {
5718 interface FileTextChanges {
5720 textChanges: readonly TextChange[];
5721 isNewFile?: boolean;
5723 interface CodeAction {
5724 /** Description of the code action to display in the UI of the editor */
5725 description: string;
5726 /** Text changes to apply to each file as part of the code action */
5727 changes: FileTextChanges[];
5729 * If the user accepts the code fix, the editor should send the action back in a `applyAction` request.
5730 * This allows the language service to have side effects (e.g. installing dependencies) upon a code fix.
5732 commands?: CodeActionCommand[];
5734 interface CodeFixAction extends CodeAction {
5735 /** Short name to identify the fix, for use by telemetry. */
5738 * If present, one may call 'getCombinedCodeFix' with this fixId.
5739 * This may be omitted to indicate that the code fix can't be applied in a group.
5742 fixAllDescription?: string;
5744 interface CombinedCodeActions {
5745 changes: readonly FileTextChanges[];
5746 commands?: readonly CodeActionCommand[];
5748 type CodeActionCommand = InstallPackageAction;
5749 interface InstallPackageAction {
5752 * A set of one or more available refactoring actions, grouped under a parent refactoring.
5754 interface ApplicableRefactorInfo {
5756 * The programmatic name of the refactoring
5760 * A description of this refactoring category to show to the user.
5761 * If the refactoring gets inlined (see below), this text will not be visible.
5763 description: string;
5765 * Inlineable refactorings can have their actions hoisted out to the top level
5766 * of a context menu. Non-inlineanable refactorings should always be shown inside
5767 * their parent grouping.
5769 * If not specified, this value is assumed to be 'true'
5771 inlineable?: boolean;
5772 actions: RefactorActionInfo[];
5775 * Represents a single refactoring action - for example, the "Extract Method..." refactor might
5776 * offer several actions, each corresponding to a surround class or closure to extract into.
5778 interface RefactorActionInfo {
5780 * The programmatic name of the refactoring action
5784 * A description of this refactoring action to show to the user.
5785 * If the parent refactoring is inlined away, this will be the only text shown,
5786 * so this description should make sense by itself if the parent is inlineable=true
5788 description: string;
5790 * A message to show to the user if the refactoring cannot be applied in
5791 * the current context.
5793 notApplicableReason?: string;
5796 * A set of edits to make in response to a refactor action, plus an optional
5797 * location where renaming should be invoked from
5799 interface RefactorEditInfo {
5800 edits: FileTextChanges[];
5801 renameFilename?: string;
5802 renameLocation?: number;
5803 commands?: CodeActionCommand[];
5805 type RefactorTriggerReason = "implicit" | "invoked";
5806 interface TextInsertion {
5808 /** The position in newText the caret should point to after the insertion. */
5809 caretOffset: number;
5811 interface DocumentSpan {
5815 * If the span represents a location that was remapped (e.g. via a .d.ts.map file),
5816 * then the original filename and span will be specified here
5818 originalTextSpan?: TextSpan;
5819 originalFileName?: string;
5821 * If DocumentSpan.textSpan is the span for name of the declaration,
5822 * then this is the span for relevant declaration
5824 contextSpan?: TextSpan;
5825 originalContextSpan?: TextSpan;
5827 interface RenameLocation extends DocumentSpan {
5828 readonly prefixText?: string;
5829 readonly suffixText?: string;
5831 interface ReferenceEntry extends DocumentSpan {
5832 isWriteAccess: boolean;
5833 isDefinition: boolean;
5836 interface ImplementationLocation extends DocumentSpan {
5837 kind: ScriptElementKind;
5838 displayParts: SymbolDisplayPart[];
5840 enum HighlightSpanKind {
5842 definition = "definition",
5843 reference = "reference",
5844 writtenReference = "writtenReference"
5846 interface HighlightSpan {
5850 contextSpan?: TextSpan;
5851 kind: HighlightSpanKind;
5853 interface NavigateToItem {
5855 kind: ScriptElementKind;
5856 kindModifiers: string;
5857 matchKind: "exact" | "prefix" | "substring" | "camelCase";
5858 isCaseSensitive: boolean;
5861 containerName: string;
5862 containerKind: ScriptElementKind;
5869 enum SemicolonPreference {
5874 interface EditorOptions {
5875 BaseIndentSize?: number;
5878 NewLineCharacter: string;
5879 ConvertTabsToSpaces: boolean;
5880 IndentStyle: IndentStyle;
5882 interface EditorSettings {
5883 baseIndentSize?: number;
5884 indentSize?: number;
5886 newLineCharacter?: string;
5887 convertTabsToSpaces?: boolean;
5888 indentStyle?: IndentStyle;
5889 trimTrailingWhitespace?: boolean;
5891 interface FormatCodeOptions extends EditorOptions {
5892 InsertSpaceAfterCommaDelimiter: boolean;
5893 InsertSpaceAfterSemicolonInForStatements: boolean;
5894 InsertSpaceBeforeAndAfterBinaryOperators: boolean;
5895 InsertSpaceAfterConstructor?: boolean;
5896 InsertSpaceAfterKeywordsInControlFlowStatements: boolean;
5897 InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean;
5898 InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean;
5899 InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: boolean;
5900 InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
5901 InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean;
5902 InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
5903 InsertSpaceAfterTypeAssertion?: boolean;
5904 InsertSpaceBeforeFunctionParenthesis?: boolean;
5905 PlaceOpenBraceOnNewLineForFunctions: boolean;
5906 PlaceOpenBraceOnNewLineForControlBlocks: boolean;
5907 insertSpaceBeforeTypeAnnotation?: boolean;
5909 interface FormatCodeSettings extends EditorSettings {
5910 readonly insertSpaceAfterCommaDelimiter?: boolean;
5911 readonly insertSpaceAfterSemicolonInForStatements?: boolean;
5912 readonly insertSpaceBeforeAndAfterBinaryOperators?: boolean;
5913 readonly insertSpaceAfterConstructor?: boolean;
5914 readonly insertSpaceAfterKeywordsInControlFlowStatements?: boolean;
5915 readonly insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean;
5916 readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean;
5917 readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean;
5918 readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
5919 readonly insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean;
5920 readonly insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean;
5921 readonly insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
5922 readonly insertSpaceAfterTypeAssertion?: boolean;
5923 readonly insertSpaceBeforeFunctionParenthesis?: boolean;
5924 readonly placeOpenBraceOnNewLineForFunctions?: boolean;
5925 readonly placeOpenBraceOnNewLineForControlBlocks?: boolean;
5926 readonly insertSpaceBeforeTypeAnnotation?: boolean;
5927 readonly indentMultiLineObjectLiteralBeginningOnBlankLine?: boolean;
5928 readonly semicolons?: SemicolonPreference;
5930 function getDefaultFormatCodeSettings(newLineCharacter?: string): FormatCodeSettings;
5931 interface DefinitionInfo extends DocumentSpan {
5932 kind: ScriptElementKind;
5934 containerKind: ScriptElementKind;
5935 containerName: string;
5937 interface DefinitionInfoAndBoundSpan {
5938 definitions?: readonly DefinitionInfo[];
5941 interface ReferencedSymbolDefinitionInfo extends DefinitionInfo {
5942 displayParts: SymbolDisplayPart[];
5944 interface ReferencedSymbol {
5945 definition: ReferencedSymbolDefinitionInfo;
5946 references: ReferenceEntry[];
5948 enum SymbolDisplayPartKind {
5967 typeParameterName = 18,
5968 enumMemberName = 19,
5970 regularExpressionLiteral = 21
5972 interface SymbolDisplayPart {
5976 interface JSDocTagInfo {
5980 interface QuickInfo {
5981 kind: ScriptElementKind;
5982 kindModifiers: string;
5984 displayParts?: SymbolDisplayPart[];
5985 documentation?: SymbolDisplayPart[];
5986 tags?: JSDocTagInfo[];
5988 type RenameInfo = RenameInfoSuccess | RenameInfoFailure;
5989 interface RenameInfoSuccess {
5992 * File or directory to rename.
5993 * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`.
5995 fileToRename?: string;
5996 displayName: string;
5997 fullDisplayName: string;
5998 kind: ScriptElementKind;
5999 kindModifiers: string;
6000 triggerSpan: TextSpan;
6002 interface RenameInfoFailure {
6004 localizedErrorMessage: string;
6006 interface RenameInfoOptions {
6007 readonly allowRenameOfImportPath?: boolean;
6009 interface SignatureHelpParameter {
6011 documentation: SymbolDisplayPart[];
6012 displayParts: SymbolDisplayPart[];
6013 isOptional: boolean;
6015 interface SelectionRange {
6017 parent?: SelectionRange;
6020 * Represents a single signature to show in signature help.
6021 * The id is used for subsequent calls into the language service to ask questions about the
6022 * signature help item in the context of any documents that have been updated. i.e. after
6023 * an edit has happened, while signature help is still active, the host can ask important
6024 * questions like 'what parameter is the user currently contained within?'.
6026 interface SignatureHelpItem {
6027 isVariadic: boolean;
6028 prefixDisplayParts: SymbolDisplayPart[];
6029 suffixDisplayParts: SymbolDisplayPart[];
6030 separatorDisplayParts: SymbolDisplayPart[];
6031 parameters: SignatureHelpParameter[];
6032 documentation: SymbolDisplayPart[];
6033 tags: JSDocTagInfo[];
6036 * Represents a set of signature help items, and the preferred item that should be selected.
6038 interface SignatureHelpItems {
6039 items: SignatureHelpItem[];
6040 applicableSpan: TextSpan;
6041 selectedItemIndex: number;
6042 argumentIndex: number;
6043 argumentCount: number;
6045 interface CompletionInfo {
6046 /** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */
6047 isGlobalCompletion: boolean;
6048 isMemberCompletion: boolean;
6050 * In the absence of `CompletionEntry["replacementSpan"], the editor may choose whether to use
6051 * this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span
6052 * must be used to commit that completion entry.
6054 optionalReplacementSpan?: TextSpan;
6056 * true when the current location also allows for a new identifier
6058 isNewIdentifierLocation: boolean;
6059 entries: CompletionEntry[];
6061 interface CompletionEntry {
6063 kind: ScriptElementKind;
6064 kindModifiers?: string;
6066 insertText?: string;
6068 * An optional span that indicates the text to be replaced by this completion item.
6069 * If present, this span should be used instead of the default one.
6070 * It will be set if the required span differs from the one generated by the default replacement behavior.
6072 replacementSpan?: TextSpan;
6075 isRecommended?: true;
6076 isFromUncheckedFile?: true;
6077 isPackageJsonImport?: true;
6079 interface CompletionEntryDetails {
6081 kind: ScriptElementKind;
6082 kindModifiers: string;
6083 displayParts: SymbolDisplayPart[];
6084 documentation?: SymbolDisplayPart[];
6085 tags?: JSDocTagInfo[];
6086 codeActions?: CodeAction[];
6087 source?: SymbolDisplayPart[];
6089 interface OutliningSpan {
6090 /** The span of the document to actually collapse. */
6092 /** The span of the document to display when the user hovers over the collapsed span. */
6094 /** The text to display in the editor for the collapsed region. */
6097 * Whether or not this region should be automatically collapsed when
6098 * the 'Collapse to Definitions' command is invoked.
6100 autoCollapse: boolean;
6102 * Classification of the contents of the span
6104 kind: OutliningSpanKind;
6106 enum OutliningSpanKind {
6107 /** Single or multi-line comments */
6108 Comment = "comment",
6109 /** Sections marked by '// #region' and '// #endregion' comments */
6111 /** Declarations and expressions */
6113 /** Contiguous blocks of import declarations */
6116 enum OutputFileType {
6121 enum EndOfLineState {
6123 InMultiLineCommentTrivia = 1,
6124 InSingleQuoteStringLiteral = 2,
6125 InDoubleQuoteStringLiteral = 3,
6126 InTemplateHeadOrNoSubstitutionTemplate = 4,
6127 InTemplateMiddleOrTail = 5,
6128 InTemplateSubstitutionPosition = 6
6142 interface ClassificationResult {
6143 finalLexState: EndOfLineState;
6144 entries: ClassificationInfo[];
6146 interface ClassificationInfo {
6148 classification: TokenClass;
6150 interface Classifier {
6152 * Gives lexical classifications of tokens on a line without any syntactic context.
6153 * For instance, a token consisting of the text 'string' can be either an identifier
6154 * named 'string' or the keyword 'string', however, because this classifier is not aware,
6155 * it relies on certain heuristics to give acceptable results. For classifications where
6156 * speed trumps accuracy, this function is preferable; however, for true accuracy, the
6157 * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the
6158 * lexical, syntactic, and semantic classifiers may issue the best user experience.
6160 * @param text The text of a line to classify.
6161 * @param lexState The state of the lexical classifier at the end of the previous line.
6162 * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier.
6163 * If there is no syntactic classifier (syntacticClassifierAbsent=true),
6164 * certain heuristics may be used in its place; however, if there is a
6165 * syntactic classifier (syntacticClassifierAbsent=false), certain
6166 * classifications which may be incorrectly categorized will be given
6167 * back as Identifiers in order to allow the syntactic classifier to
6168 * subsume the classification.
6169 * @deprecated Use getLexicalClassifications instead.
6171 getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult;
6172 getEncodedLexicalClassifications(text: string, endOfLineState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications;
6174 enum ScriptElementKind {
6176 warning = "warning",
6177 /** predefined type (void) or keyword (class) */
6178 keyword = "keyword",
6179 /** top level script node */
6180 scriptElement = "script",
6181 /** module foo {} */
6182 moduleElement = "module",
6184 classElement = "class",
6185 /** var x = class X {} */
6186 localClassElement = "local class",
6187 /** interface Y {} */
6188 interfaceElement = "interface",
6190 typeElement = "type",
6192 enumElement = "enum",
6193 enumMemberElement = "enum member",
6195 * Inside module and script only
6198 variableElement = "var",
6199 /** Inside function */
6200 localVariableElement = "local var",
6202 * Inside module and script only
6205 functionElement = "function",
6206 /** Inside function */
6207 localFunctionElement = "local function",
6208 /** class X { [public|private]* foo() {} } */
6209 memberFunctionElement = "method",
6210 /** class X { [public|private]* [get|set] foo:number; } */
6211 memberGetAccessorElement = "getter",
6212 memberSetAccessorElement = "setter",
6214 * class X { [public|private]* foo:number; }
6215 * interface Y { foo:number; }
6217 memberVariableElement = "property",
6218 /** class X { constructor() { } } */
6219 constructorImplementationElement = "constructor",
6220 /** interface Y { ():number; } */
6221 callSignatureElement = "call",
6222 /** interface Y { []:number; } */
6223 indexSignatureElement = "index",
6224 /** interface Y { new():Y; } */
6225 constructSignatureElement = "construct",
6226 /** function foo(*Y*: string) */
6227 parameterElement = "parameter",
6228 typeParameterElement = "type parameter",
6229 primitiveType = "primitive type",
6232 constElement = "const",
6234 directory = "directory",
6235 externalModuleName = "external module name",
6237 * <JsxTagName attribute1 attribute2={0} />
6239 jsxAttribute = "JSX attribute",
6240 /** String literal */
6243 enum ScriptElementKindModifier {
6245 publicMemberModifier = "public",
6246 privateMemberModifier = "private",
6247 protectedMemberModifier = "protected",
6248 exportedModifier = "export",
6249 ambientModifier = "declare",
6250 staticModifier = "static",
6251 abstractModifier = "abstract",
6252 optionalModifier = "optional",
6253 deprecatedModifier = "deprecated",
6254 dtsModifier = ".d.ts",
6256 tsxModifier = ".tsx",
6258 jsxModifier = ".jsx",
6259 jsonModifier = ".json"
6261 enum ClassificationTypeNames {
6262 comment = "comment",
6263 identifier = "identifier",
6264 keyword = "keyword",
6265 numericLiteral = "number",
6266 bigintLiteral = "bigint",
6267 operator = "operator",
6268 stringLiteral = "string",
6269 whiteSpace = "whitespace",
6271 punctuation = "punctuation",
6272 className = "class name",
6273 enumName = "enum name",
6274 interfaceName = "interface name",
6275 moduleName = "module name",
6276 typeParameterName = "type parameter name",
6277 typeAliasName = "type alias name",
6278 parameterName = "parameter name",
6279 docCommentTagName = "doc comment tag name",
6280 jsxOpenTagName = "jsx open tag name",
6281 jsxCloseTagName = "jsx close tag name",
6282 jsxSelfClosingTagName = "jsx self closing tag name",
6283 jsxAttribute = "jsx attribute",
6284 jsxText = "jsx text",
6285 jsxAttributeStringLiteralValue = "jsx attribute string literal value"
6287 enum ClassificationType {
6294 regularExpressionLiteral = 7,
6302 typeParameterName = 15,
6305 docCommentTagName = 18,
6306 jsxOpenTagName = 19,
6307 jsxCloseTagName = 20,
6308 jsxSelfClosingTagName = 21,
6311 jsxAttributeStringLiteralValue = 24,
6315 declare namespace ts {
6316 /** The classifier is used for syntactic highlighting in editors via the TSServer */
6317 function createClassifier(): Classifier;
6319 declare namespace ts {
6320 interface DocumentHighlights {
6322 highlightSpans: HighlightSpan[];
6325 declare namespace ts {
6327 * The document registry represents a store of SourceFile objects that can be shared between
6328 * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST)
6329 * of files in the context.
6330 * SourceFile objects account for most of the memory usage by the language service. Sharing
6331 * the same DocumentRegistry instance between different instances of LanguageService allow
6332 * for more efficient memory utilization since all projects will share at least the library
6335 * A more advanced use of the document registry is to serialize sourceFile objects to disk
6336 * and re-hydrate them when needed.
6338 * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it
6339 * to all subsequent createLanguageService calls.
6341 interface DocumentRegistry {
6343 * Request a stored SourceFile with a given fileName and compilationSettings.
6344 * The first call to acquire will call createLanguageServiceSourceFile to generate
6345 * the SourceFile if was not found in the registry.
6347 * @param fileName The name of the file requested
6348 * @param compilationSettings Some compilation settings like target affects the
6349 * shape of a the resulting SourceFile. This allows the DocumentRegistry to store
6350 * multiple copies of the same file for different compilation settings.
6351 * @param scriptSnapshot Text of the file. Only used if the file was not found
6352 * in the registry and a new one was created.
6353 * @param version Current version of the file. Only used if the file was not found
6354 * in the registry and a new one was created.
6356 acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile;
6357 acquireDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile;
6359 * Request an updated version of an already existing SourceFile with a given fileName
6360 * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile
6361 * to get an updated SourceFile.
6363 * @param fileName The name of the file requested
6364 * @param compilationSettings Some compilation settings like target affects the
6365 * shape of a the resulting SourceFile. This allows the DocumentRegistry to store
6366 * multiple copies of the same file for different compilation settings.
6367 * @param scriptSnapshot Text of the file.
6368 * @param version Current version of the file.
6370 updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile;
6371 updateDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile;
6372 getKeyForCompilationSettings(settings: CompilerOptions): DocumentRegistryBucketKey;
6374 * Informs the DocumentRegistry that a file is not needed any longer.
6376 * Note: It is not allowed to call release on a SourceFile that was not acquired from
6377 * this registry originally.
6379 * @param fileName The name of the file to be released
6380 * @param compilationSettings The compilation settings used to acquire the file
6382 releaseDocument(fileName: string, compilationSettings: CompilerOptions): void;
6383 releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey): void;
6384 reportStats(): string;
6386 type DocumentRegistryBucketKey = string & {
6389 function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory?: string): DocumentRegistry;
6391 declare namespace ts {
6392 function preProcessFile(sourceText: string, readImportFiles?: boolean, detectJavaScriptImports?: boolean): PreProcessedFileInfo;
6394 declare namespace ts {
6395 interface TranspileOptions {
6396 compilerOptions?: CompilerOptions;
6398 reportDiagnostics?: boolean;
6399 moduleName?: string;
6400 renamedDependencies?: MapLike<string>;
6401 transformers?: CustomTransformers;
6403 interface TranspileOutput {
6405 diagnostics?: Diagnostic[];
6406 sourceMapText?: string;
6408 function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput;
6409 function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string;
6411 declare namespace ts {
6412 /** The version of the language service API */
6413 const servicesVersion = "0.8";
6414 function toEditorSettings(options: EditorOptions | EditorSettings): EditorSettings;
6415 function displayPartsToString(displayParts: SymbolDisplayPart[] | undefined): string;
6416 function getDefaultCompilerOptions(): CompilerOptions;
6417 function getSupportedCodeFixes(): string[];
6418 function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean, scriptKind?: ScriptKind): SourceFile;
6419 function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange | undefined, aggressiveChecks?: boolean): SourceFile;
6420 function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry, syntaxOnlyOrLanguageServiceMode?: boolean | LanguageServiceMode): LanguageService;
6422 * Get the path of the default library files (lib.d.ts) as distributed with the typescript
6424 * The functionality is not supported if the ts module is consumed outside of a node module.
6426 function getDefaultLibFilePath(options: CompilerOptions): string;
6428 declare namespace ts {
6430 * Transform one or more nodes using the supplied transformers.
6431 * @param source A single `Node` or an array of `Node` objects.
6432 * @param transformers An array of `TransformerFactory` callbacks used to process the transformation.
6433 * @param compilerOptions Optional compiler options.
6435 function transform<T extends Node>(source: T | T[], transformers: TransformerFactory<T>[], compilerOptions?: CompilerOptions): TransformationResult<T>;
6437 declare namespace ts.server {
6438 interface CompressedData {
6440 compressionKind: string;
6443 type RequireResult = {
6453 interface ServerHost extends System {
6454 watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: WatchOptions): FileWatcher;
6455 watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: WatchOptions): FileWatcher;
6456 setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
6457 clearTimeout(timeoutId: any): void;
6458 setImmediate(callback: (...args: any[]) => void, ...args: any[]): any;
6459 clearImmediate(timeoutId: any): void;
6461 trace?(s: string): void;
6462 require?(initialPath: string, moduleName: string): RequireResult;
6465 declare namespace ts.server {
6472 const emptyArray: SortedReadonlyArray<never>;
6475 hasLevel(level: LogLevel): boolean;
6476 loggingEnabled(): boolean;
6477 perftrc(s: string): void;
6478 info(s: string): void;
6481 msg(s: string, type?: Msg): void;
6482 getLogFileName(): string | undefined;
6490 /** @deprecated Only here for backwards-compatibility. Prefer just `Msg`. */
6493 function createInstallTypingsRequest(project: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string>, cachePath?: string): DiscoverTypings;
6495 function ThrowNoProject(): never;
6496 function ThrowProjectLanguageServiceDisabled(): never;
6497 function ThrowProjectDoesNotContainDocument(fileName: string, project: Project): never;
6499 type NormalizedPath = string & {
6500 __normalizedPathTag: any;
6502 function toNormalizedPath(fileName: string): NormalizedPath;
6503 function normalizedPathToPath(normalizedPath: NormalizedPath, currentDirectory: string, getCanonicalFileName: (f: string) => string): Path;
6504 function asNormalizedPath(fileName: string): NormalizedPath;
6505 interface NormalizedPathMap<T> {
6506 get(path: NormalizedPath): T | undefined;
6507 set(path: NormalizedPath, value: T): void;
6508 contains(path: NormalizedPath): boolean;
6509 remove(path: NormalizedPath): void;
6511 function createNormalizedPathMap<T>(): NormalizedPathMap<T>;
6512 function isInferredProjectName(name: string): boolean;
6513 function makeInferredProjectName(counter: number): string;
6514 function createSortedArray<T>(): SortedArray<T>;
6517 * Declaration module describing the TypeScript Server protocol
6519 declare namespace ts.server.protocol {
6521 JsxClosingTag = "jsxClosingTag",
6523 BraceCompletion = "braceCompletion",
6524 GetSpanOfEnclosingComment = "getSpanOfEnclosingComment",
6527 /** @deprecated Prefer CompletionInfo -- see comment on CompletionsResponse */
6528 Completions = "completions",
6529 CompletionInfo = "completionInfo",
6530 CompletionDetails = "completionEntryDetails",
6531 CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList",
6532 CompileOnSaveEmitFile = "compileOnSaveEmitFile",
6533 Configure = "configure",
6534 Definition = "definition",
6535 DefinitionAndBoundSpan = "definitionAndBoundSpan",
6536 Implementation = "implementation",
6539 Formatonkey = "formatonkey",
6541 GeterrForProject = "geterrForProject",
6542 SemanticDiagnosticsSync = "semanticDiagnosticsSync",
6543 SyntacticDiagnosticsSync = "syntacticDiagnosticsSync",
6544 SuggestionDiagnosticsSync = "suggestionDiagnosticsSync",
6547 NavTree = "navtree",
6548 NavTreeFull = "navtree-full",
6550 Occurrences = "occurrences",
6551 DocumentHighlights = "documentHighlights",
6553 Quickinfo = "quickinfo",
6554 References = "references",
6558 SignatureHelp = "signatureHelp",
6560 TypeDefinition = "typeDefinition",
6561 ProjectInfo = "projectInfo",
6562 ReloadProjects = "reloadProjects",
6563 Unknown = "unknown",
6564 OpenExternalProject = "openExternalProject",
6565 OpenExternalProjects = "openExternalProjects",
6566 CloseExternalProject = "closeExternalProject",
6567 UpdateOpen = "updateOpen",
6568 GetOutliningSpans = "getOutliningSpans",
6569 TodoComments = "todoComments",
6570 Indentation = "indentation",
6571 DocCommentTemplate = "docCommentTemplate",
6572 CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects",
6573 GetCodeFixes = "getCodeFixes",
6574 GetCombinedCodeFix = "getCombinedCodeFix",
6575 ApplyCodeActionCommand = "applyCodeActionCommand",
6576 GetSupportedCodeFixes = "getSupportedCodeFixes",
6577 GetApplicableRefactors = "getApplicableRefactors",
6578 GetEditsForRefactor = "getEditsForRefactor",
6579 OrganizeImports = "organizeImports",
6580 GetEditsForFileRename = "getEditsForFileRename",
6581 ConfigurePlugin = "configurePlugin",
6582 SelectionRange = "selectionRange",
6583 ToggleLineComment = "toggleLineComment",
6584 ToggleMultilineComment = "toggleMultilineComment",
6585 CommentSelection = "commentSelection",
6586 UncommentSelection = "uncommentSelection",
6587 PrepareCallHierarchy = "prepareCallHierarchy",
6588 ProvideCallHierarchyIncomingCalls = "provideCallHierarchyIncomingCalls",
6589 ProvideCallHierarchyOutgoingCalls = "provideCallHierarchyOutgoingCalls"
6592 * A TypeScript Server message
6596 * Sequence number of the message
6600 * One of "request", "response", or "event"
6602 type: "request" | "response" | "event";
6605 * Client-initiated request message
6607 interface Request extends Message {
6610 * The command to execute
6614 * Object containing arguments for the command
6619 * Request to reload the project structure for all the opened files
6621 interface ReloadProjectsRequest extends Message {
6622 command: CommandTypes.ReloadProjects;
6625 * Server-initiated event message
6627 interface Event extends Message {
6634 * Event-specific information
6639 * Response by server to client request message.
6641 interface Response extends Message {
6644 * Sequence number of the request message.
6646 request_seq: number;
6648 * Outcome of the request.
6652 * The command requested.
6656 * If success === false, this should always be provided.
6657 * Otherwise, may (or may not) contain a success message.
6661 * Contains message body if success === true.
6665 * Contains extra information that plugin can include to be passed on
6669 * Exposes information about the performance of this request-response pair.
6671 performanceData?: PerformanceData;
6673 interface PerformanceData {
6675 * Time spent updating the program graph, in milliseconds.
6677 updateGraphDurationMs?: number;
6679 * The time spent creating or updating the auto-import program, in milliseconds.
6681 createAutoImportProviderProgramDurationMs?: number;
6684 * Arguments for FileRequest messages.
6686 interface FileRequestArgs {
6688 * The file for the request (absolute pathname required).
6691 projectFileName?: string;
6693 interface StatusRequest extends Request {
6694 command: CommandTypes.Status;
6696 interface StatusResponseBody {
6698 * The TypeScript version (`ts.version`).
6703 * Response to StatusRequest
6705 interface StatusResponse extends Response {
6706 body: StatusResponseBody;
6709 * Requests a JS Doc comment template for a given position
6711 interface DocCommentTemplateRequest extends FileLocationRequest {
6712 command: CommandTypes.DocCommentTemplate;
6715 * Response to DocCommentTemplateRequest
6717 interface DocCommandTemplateResponse extends Response {
6718 body?: TextInsertion;
6721 * A request to get TODO comments from the file
6723 interface TodoCommentRequest extends FileRequest {
6724 command: CommandTypes.TodoComments;
6725 arguments: TodoCommentRequestArgs;
6728 * Arguments for TodoCommentRequest request.
6730 interface TodoCommentRequestArgs extends FileRequestArgs {
6732 * Array of target TodoCommentDescriptors that describes TODO comments to be found
6734 descriptors: TodoCommentDescriptor[];
6737 * Response for TodoCommentRequest request.
6739 interface TodoCommentsResponse extends Response {
6740 body?: TodoComment[];
6743 * A request to determine if the caret is inside a comment.
6745 interface SpanOfEnclosingCommentRequest extends FileLocationRequest {
6746 command: CommandTypes.GetSpanOfEnclosingComment;
6747 arguments: SpanOfEnclosingCommentRequestArgs;
6749 interface SpanOfEnclosingCommentRequestArgs extends FileLocationRequestArgs {
6751 * Requires that the enclosing span be a multi-line comment, or else the request returns undefined.
6753 onlyMultiLine: boolean;
6756 * Request to obtain outlining spans in file.
6758 interface OutliningSpansRequest extends FileRequest {
6759 command: CommandTypes.GetOutliningSpans;
6761 interface OutliningSpan {
6762 /** The span of the document to actually collapse. */
6764 /** The span of the document to display when the user hovers over the collapsed span. */
6766 /** The text to display in the editor for the collapsed region. */
6769 * Whether or not this region should be automatically collapsed when
6770 * the 'Collapse to Definitions' command is invoked.
6772 autoCollapse: boolean;
6774 * Classification of the contents of the span
6776 kind: OutliningSpanKind;
6779 * Response to OutliningSpansRequest request.
6781 interface OutliningSpansResponse extends Response {
6782 body?: OutliningSpan[];
6785 * A request to get indentation for a location in file
6787 interface IndentationRequest extends FileLocationRequest {
6788 command: CommandTypes.Indentation;
6789 arguments: IndentationRequestArgs;
6792 * Response for IndentationRequest request.
6794 interface IndentationResponse extends Response {
6795 body?: IndentationResult;
6798 * Indentation result representing where indentation should be placed
6800 interface IndentationResult {
6802 * The base position in the document that the indent should be relative to
6806 * The number of columns the indent should be at relative to the position's column.
6808 indentation: number;
6811 * Arguments for IndentationRequest request.
6813 interface IndentationRequestArgs extends FileLocationRequestArgs {
6815 * An optional set of settings to be used when computing indentation.
6816 * If argument is omitted - then it will use settings for file that were previously set via 'configure' request or global settings.
6818 options?: EditorSettings;
6821 * Arguments for ProjectInfoRequest request.
6823 interface ProjectInfoRequestArgs extends FileRequestArgs {
6825 * Indicate if the file name list of the project is needed
6827 needFileNameList: boolean;
6830 * A request to get the project information of the current file.
6832 interface ProjectInfoRequest extends Request {
6833 command: CommandTypes.ProjectInfo;
6834 arguments: ProjectInfoRequestArgs;
6837 * A request to retrieve compiler options diagnostics for a project
6839 interface CompilerOptionsDiagnosticsRequest extends Request {
6840 arguments: CompilerOptionsDiagnosticsRequestArgs;
6843 * Arguments for CompilerOptionsDiagnosticsRequest request.
6845 interface CompilerOptionsDiagnosticsRequestArgs {
6847 * Name of the project to retrieve compiler options diagnostics.
6849 projectFileName: string;
6852 * Response message body for "projectInfo" request
6854 interface ProjectInfo {
6856 * For configured project, this is the normalized path of the 'tsconfig.json' file
6857 * For inferred project, this is undefined
6859 configFileName: string;
6861 * The list of normalized file name in the project, including 'lib.d.ts'
6863 fileNames?: string[];
6865 * Indicates if the project has a active language service instance
6867 languageServiceDisabled?: boolean;
6870 * Represents diagnostic info that includes location of diagnostic in two forms
6871 * - start position and length of the error span
6872 * - startLocation and endLocation - a pair of Location objects that store start/end line and offset of the error span.
6874 interface DiagnosticWithLinePosition {
6878 startLocation: Location;
6879 endLocation: Location;
6882 /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
6883 reportsUnnecessary?: {};
6884 reportsDeprecated?: {};
6885 relatedInformation?: DiagnosticRelatedInformation[];
6888 * Response message for "projectInfo" request
6890 interface ProjectInfoResponse extends Response {
6894 * Request whose sole parameter is a file name.
6896 interface FileRequest extends Request {
6897 arguments: FileRequestArgs;
6900 * Instances of this interface specify a location in a source file:
6901 * (file, line, character offset), where line and character offset are 1-based.
6903 interface FileLocationRequestArgs extends FileRequestArgs {
6905 * The line number for the request (1-based).
6909 * The character offset (on the line) for the request (1-based).
6913 type FileLocationOrRangeRequestArgs = FileLocationRequestArgs | FileRangeRequestArgs;
6915 * Request refactorings at a given position or selection area.
6917 interface GetApplicableRefactorsRequest extends Request {
6918 command: CommandTypes.GetApplicableRefactors;
6919 arguments: GetApplicableRefactorsRequestArgs;
6921 type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs & {
6922 triggerReason?: RefactorTriggerReason;
6924 type RefactorTriggerReason = "implicit" | "invoked";
6926 * Response is a list of available refactorings.
6927 * Each refactoring exposes one or more "Actions"; a user selects one action to invoke a refactoring
6929 interface GetApplicableRefactorsResponse extends Response {
6930 body?: ApplicableRefactorInfo[];
6933 * A set of one or more available refactoring actions, grouped under a parent refactoring.
6935 interface ApplicableRefactorInfo {
6937 * The programmatic name of the refactoring
6941 * A description of this refactoring category to show to the user.
6942 * If the refactoring gets inlined (see below), this text will not be visible.
6944 description: string;
6946 * Inlineable refactorings can have their actions hoisted out to the top level
6947 * of a context menu. Non-inlineanable refactorings should always be shown inside
6948 * their parent grouping.
6950 * If not specified, this value is assumed to be 'true'
6952 inlineable?: boolean;
6953 actions: RefactorActionInfo[];
6956 * Represents a single refactoring action - for example, the "Extract Method..." refactor might
6957 * offer several actions, each corresponding to a surround class or closure to extract into.
6959 interface RefactorActionInfo {
6961 * The programmatic name of the refactoring action
6965 * A description of this refactoring action to show to the user.
6966 * If the parent refactoring is inlined away, this will be the only text shown,
6967 * so this description should make sense by itself if the parent is inlineable=true
6969 description: string;
6971 * A message to show to the user if the refactoring cannot be applied in
6972 * the current context.
6974 notApplicableReason?: string;
6976 interface GetEditsForRefactorRequest extends Request {
6977 command: CommandTypes.GetEditsForRefactor;
6978 arguments: GetEditsForRefactorRequestArgs;
6981 * Request the edits that a particular refactoring action produces.
6982 * Callers must specify the name of the refactor and the name of the action.
6984 type GetEditsForRefactorRequestArgs = FileLocationOrRangeRequestArgs & {
6988 interface GetEditsForRefactorResponse extends Response {
6989 body?: RefactorEditInfo;
6991 interface RefactorEditInfo {
6992 edits: FileCodeEdits[];
6994 * An optional location where the editor should start a rename operation once
6995 * the refactoring edits have been applied
6997 renameLocation?: Location;
6998 renameFilename?: string;
7001 * Organize imports by:
7002 * 1) Removing unused imports
7003 * 2) Coalescing imports from the same module
7004 * 3) Sorting imports
7006 interface OrganizeImportsRequest extends Request {
7007 command: CommandTypes.OrganizeImports;
7008 arguments: OrganizeImportsRequestArgs;
7010 type OrganizeImportsScope = GetCombinedCodeFixScope;
7011 interface OrganizeImportsRequestArgs {
7012 scope: OrganizeImportsScope;
7014 interface OrganizeImportsResponse extends Response {
7015 body: readonly FileCodeEdits[];
7017 interface GetEditsForFileRenameRequest extends Request {
7018 command: CommandTypes.GetEditsForFileRename;
7019 arguments: GetEditsForFileRenameRequestArgs;
7021 /** Note: Paths may also be directories. */
7022 interface GetEditsForFileRenameRequestArgs {
7023 readonly oldFilePath: string;
7024 readonly newFilePath: string;
7026 interface GetEditsForFileRenameResponse extends Response {
7027 body: readonly FileCodeEdits[];
7030 * Request for the available codefixes at a specific position.
7032 interface CodeFixRequest extends Request {
7033 command: CommandTypes.GetCodeFixes;
7034 arguments: CodeFixRequestArgs;
7036 interface GetCombinedCodeFixRequest extends Request {
7037 command: CommandTypes.GetCombinedCodeFix;
7038 arguments: GetCombinedCodeFixRequestArgs;
7040 interface GetCombinedCodeFixResponse extends Response {
7041 body: CombinedCodeActions;
7043 interface ApplyCodeActionCommandRequest extends Request {
7044 command: CommandTypes.ApplyCodeActionCommand;
7045 arguments: ApplyCodeActionCommandRequestArgs;
7047 interface ApplyCodeActionCommandResponse extends Response {
7049 interface FileRangeRequestArgs extends FileRequestArgs {
7051 * The line number for the request (1-based).
7055 * The character offset (on the line) for the request (1-based).
7057 startOffset: number;
7059 * The line number for the request (1-based).
7063 * The character offset (on the line) for the request (1-based).
7068 * Instances of this interface specify errorcodes on a specific location in a sourcefile.
7070 interface CodeFixRequestArgs extends FileRangeRequestArgs {
7072 * Errorcodes we want to get the fixes for.
7074 errorCodes: readonly number[];
7076 interface GetCombinedCodeFixRequestArgs {
7077 scope: GetCombinedCodeFixScope;
7080 interface GetCombinedCodeFixScope {
7082 args: FileRequestArgs;
7084 interface ApplyCodeActionCommandRequestArgs {
7085 /** May also be an array of commands. */
7089 * Response for GetCodeFixes request.
7091 interface GetCodeFixesResponse extends Response {
7092 body?: CodeAction[];
7095 * A request whose arguments specify a file location (file, line, col).
7097 interface FileLocationRequest extends FileRequest {
7098 arguments: FileLocationRequestArgs;
7101 * A request to get codes of supported code fixes.
7103 interface GetSupportedCodeFixesRequest extends Request {
7104 command: CommandTypes.GetSupportedCodeFixes;
7107 * A response for GetSupportedCodeFixesRequest request.
7109 interface GetSupportedCodeFixesResponse extends Response {
7111 * List of error codes supported by the server.
7116 * Arguments in document highlight request; include: filesToSearch, file,
7119 interface DocumentHighlightsRequestArgs extends FileLocationRequestArgs {
7121 * List of files to search for document highlights.
7123 filesToSearch: string[];
7126 * Go to definition request; value of command field is
7127 * "definition". Return response giving the file locations that
7128 * define the symbol found in file at location line, col.
7130 interface DefinitionRequest extends FileLocationRequest {
7131 command: CommandTypes.Definition;
7133 interface DefinitionAndBoundSpanRequest extends FileLocationRequest {
7134 readonly command: CommandTypes.DefinitionAndBoundSpan;
7136 interface DefinitionAndBoundSpanResponse extends Response {
7137 readonly body: DefinitionInfoAndBoundSpan;
7140 * Go to type request; value of command field is
7141 * "typeDefinition". Return response giving the file locations that
7142 * define the type for the symbol found in file at location line, col.
7144 interface TypeDefinitionRequest extends FileLocationRequest {
7145 command: CommandTypes.TypeDefinition;
7148 * Go to implementation request; value of command field is
7149 * "implementation". Return response giving the file locations that
7150 * implement the symbol found in file at location line, col.
7152 interface ImplementationRequest extends FileLocationRequest {
7153 command: CommandTypes.Implementation;
7156 * Location in source code expressed as (one-based) line and (one-based) column offset.
7158 interface Location {
7163 * Object found in response messages defining a span of text in source code.
7165 interface TextSpan {
7167 * First character of the definition.
7171 * One character past last character of the definition.
7176 * Object found in response messages defining a span of text in a specific source file.
7178 interface FileSpan extends TextSpan {
7180 * File containing text span.
7184 interface TextSpanWithContext extends TextSpan {
7185 contextStart?: Location;
7186 contextEnd?: Location;
7188 interface FileSpanWithContext extends FileSpan, TextSpanWithContext {
7190 interface DefinitionInfoAndBoundSpan {
7191 definitions: readonly FileSpanWithContext[];
7195 * Definition response message. Gives text range for definition.
7197 interface DefinitionResponse extends Response {
7198 body?: FileSpanWithContext[];
7200 interface DefinitionInfoAndBoundSpanResponse extends Response {
7201 body?: DefinitionInfoAndBoundSpan;
7203 /** @deprecated Use `DefinitionInfoAndBoundSpanResponse` instead. */
7204 type DefinitionInfoAndBoundSpanReponse = DefinitionInfoAndBoundSpanResponse;
7206 * Definition response message. Gives text range for definition.
7208 interface TypeDefinitionResponse extends Response {
7209 body?: FileSpanWithContext[];
7212 * Implementation response message. Gives text range for implementations.
7214 interface ImplementationResponse extends Response {
7215 body?: FileSpanWithContext[];
7218 * Request to get brace completion for a location in the file.
7220 interface BraceCompletionRequest extends FileLocationRequest {
7221 command: CommandTypes.BraceCompletion;
7222 arguments: BraceCompletionRequestArgs;
7225 * Argument for BraceCompletionRequest request.
7227 interface BraceCompletionRequestArgs extends FileLocationRequestArgs {
7229 * Kind of opening brace
7231 openingBrace: string;
7233 interface JsxClosingTagRequest extends FileLocationRequest {
7234 readonly command: CommandTypes.JsxClosingTag;
7235 readonly arguments: JsxClosingTagRequestArgs;
7237 interface JsxClosingTagRequestArgs extends FileLocationRequestArgs {
7239 interface JsxClosingTagResponse extends Response {
7240 readonly body: TextInsertion;
7244 * Get occurrences request; value of command field is
7245 * "occurrences". Return response giving spans that are relevant
7246 * in the file at a given line and column.
7248 interface OccurrencesRequest extends FileLocationRequest {
7249 command: CommandTypes.Occurrences;
7252 interface OccurrencesResponseItem extends FileSpanWithContext {
7254 * True if the occurrence is a write location, false otherwise.
7256 isWriteAccess: boolean;
7258 * True if the occurrence is in a string, undefined otherwise;
7263 interface OccurrencesResponse extends Response {
7264 body?: OccurrencesResponseItem[];
7267 * Get document highlights request; value of command field is
7268 * "documentHighlights". Return response giving spans that are relevant
7269 * in the file at a given line and column.
7271 interface DocumentHighlightsRequest extends FileLocationRequest {
7272 command: CommandTypes.DocumentHighlights;
7273 arguments: DocumentHighlightsRequestArgs;
7276 * Span augmented with extra information that denotes the kind of the highlighting to be used for span.
7278 interface HighlightSpan extends TextSpanWithContext {
7279 kind: HighlightSpanKind;
7282 * Represents a set of highligh spans for a give name
7284 interface DocumentHighlightsItem {
7286 * File containing highlight spans.
7290 * Spans to highlight in file.
7292 highlightSpans: HighlightSpan[];
7295 * Response for a DocumentHighlightsRequest request.
7297 interface DocumentHighlightsResponse extends Response {
7298 body?: DocumentHighlightsItem[];
7301 * Find references request; value of command field is
7302 * "references". Return response giving the file locations that
7303 * reference the symbol found in file at location line, col.
7305 interface ReferencesRequest extends FileLocationRequest {
7306 command: CommandTypes.References;
7308 interface ReferencesResponseItem extends FileSpanWithContext {
7309 /** Text of line containing the reference. Including this
7310 * with the response avoids latency of editor loading files
7311 * to show text of reference line (the server already has
7312 * loaded the referencing files).
7316 * True if reference is a write location, false otherwise.
7318 isWriteAccess: boolean;
7320 * True if reference is a definition, false otherwise.
7322 isDefinition: boolean;
7325 * The body of a "references" response message.
7327 interface ReferencesResponseBody {
7329 * The file locations referencing the symbol.
7331 refs: readonly ReferencesResponseItem[];
7333 * The name of the symbol.
7337 * The start character offset of the symbol (on the line provided by the references request).
7339 symbolStartOffset: number;
7341 * The full display name of the symbol.
7343 symbolDisplayString: string;
7346 * Response to "references" request.
7348 interface ReferencesResponse extends Response {
7349 body?: ReferencesResponseBody;
7352 * Argument for RenameRequest request.
7354 interface RenameRequestArgs extends FileLocationRequestArgs {
7356 * Should text at specified location be found/changed in comments?
7358 findInComments?: boolean;
7360 * Should text at specified location be found/changed in strings?
7362 findInStrings?: boolean;
7365 * Rename request; value of command field is "rename". Return
7366 * response giving the file locations that reference the symbol
7367 * found in file at location line, col. Also return full display
7368 * name of the symbol so that client can print it unambiguously.
7370 interface RenameRequest extends FileLocationRequest {
7371 command: CommandTypes.Rename;
7372 arguments: RenameRequestArgs;
7375 * Information about the item to be renamed.
7377 type RenameInfo = RenameInfoSuccess | RenameInfoFailure;
7378 interface RenameInfoSuccess {
7380 * True if item can be renamed.
7384 * File or directory to rename.
7385 * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`.
7387 fileToRename?: string;
7389 * Display name of the item to be renamed.
7391 displayName: string;
7393 * Full display name of item to be renamed.
7395 fullDisplayName: string;
7397 * The items's kind (such as 'className' or 'parameterName' or plain 'text').
7399 kind: ScriptElementKind;
7401 * Optional modifiers for the kind (such as 'public').
7403 kindModifiers: string;
7404 /** Span of text to rename. */
7405 triggerSpan: TextSpan;
7407 interface RenameInfoFailure {
7410 * Error message if item can not be renamed.
7412 localizedErrorMessage: string;
7415 * A group of text spans, all in 'file'.
7417 interface SpanGroup {
7418 /** The file to which the spans apply */
7420 /** The text spans in this group */
7421 locs: RenameTextSpan[];
7423 interface RenameTextSpan extends TextSpanWithContext {
7424 readonly prefixText?: string;
7425 readonly suffixText?: string;
7427 interface RenameResponseBody {
7429 * Information about the item to be renamed.
7433 * An array of span groups (one per file) that refer to the item to be renamed.
7435 locs: readonly SpanGroup[];
7438 * Rename response message.
7440 interface RenameResponse extends Response {
7441 body?: RenameResponseBody;
7444 * Represents a file in external project.
7445 * External project is project whose set of files, compilation options and open\close state
7446 * is maintained by the client (i.e. if all this data come from .csproj file in Visual Studio).
7447 * External project will exist even if all files in it are closed and should be closed explicitly.
7448 * If external project includes one or more tsconfig.json/jsconfig.json files then tsserver will
7449 * create configured project for every config file but will maintain a link that these projects were created
7450 * as a result of opening external project so they should be removed once external project is closed.
7452 interface ExternalFile {
7458 * Script kind of the file
7460 scriptKind?: ScriptKindName | ts.ScriptKind;
7462 * Whether file has mixed content (i.e. .cshtml file that combines html markup with C#/JavaScript)
7464 hasMixedContent?: boolean;
7466 * Content of the file
7471 * Represent an external project
7473 interface ExternalProject {
7477 projectFileName: string;
7479 * List of root files in project
7481 rootFiles: ExternalFile[];
7483 * Compiler options for the project
7485 options: ExternalProjectCompilerOptions;
7487 * @deprecated typingOptions. Use typeAcquisition instead
7489 typingOptions?: TypeAcquisition;
7491 * Explicitly specified type acquisition for the project
7493 typeAcquisition?: TypeAcquisition;
7495 interface CompileOnSaveMixin {
7497 * If compile on save is enabled for the project
7499 compileOnSave?: boolean;
7502 * For external projects, some of the project settings are sent together with
7503 * compiler settings.
7505 type ExternalProjectCompilerOptions = CompilerOptions & CompileOnSaveMixin & WatchOptions;
7506 interface FileWithProjectReferenceRedirectInfo {
7512 * True if the file is primarily included in a referenced project
7514 isSourceOfProjectReferenceRedirect: boolean;
7517 * Represents a set of changes that happen in project
7519 interface ProjectChanges {
7521 * List of added files
7523 added: string[] | FileWithProjectReferenceRedirectInfo[];
7525 * List of removed files
7527 removed: string[] | FileWithProjectReferenceRedirectInfo[];
7529 * List of updated files
7531 updated: string[] | FileWithProjectReferenceRedirectInfo[];
7533 * List of files that have had their project reference redirect status updated
7534 * Only provided when the synchronizeProjectList request has includeProjectReferenceRedirectInfo set to true
7536 updatedRedirects?: FileWithProjectReferenceRedirectInfo[];
7539 * Information found in a configure request.
7541 interface ConfigureRequestArguments {
7543 * Information about the host, for example 'Emacs 24.4' or
7544 * 'Sublime Text version 3075'
7548 * If present, tab settings apply only to this file.
7552 * The format options to use during formatting and other code editing features.
7554 formatOptions?: FormatCodeSettings;
7555 preferences?: UserPreferences;
7557 * The host's additional supported .js file extensions
7559 extraFileExtensions?: FileExtensionInfo[];
7560 watchOptions?: WatchOptions;
7562 enum WatchFileKind {
7563 FixedPollingInterval = "FixedPollingInterval",
7564 PriorityPollingInterval = "PriorityPollingInterval",
7565 DynamicPriorityPolling = "DynamicPriorityPolling",
7566 UseFsEvents = "UseFsEvents",
7567 UseFsEventsOnParentDirectory = "UseFsEventsOnParentDirectory"
7569 enum WatchDirectoryKind {
7570 UseFsEvents = "UseFsEvents",
7571 FixedPollingInterval = "FixedPollingInterval",
7572 DynamicPriorityPolling = "DynamicPriorityPolling"
7574 enum PollingWatchKind {
7575 FixedInterval = "FixedInterval",
7576 PriorityInterval = "PriorityInterval",
7577 DynamicPriority = "DynamicPriority"
7579 interface WatchOptions {
7580 watchFile?: WatchFileKind | ts.WatchFileKind;
7581 watchDirectory?: WatchDirectoryKind | ts.WatchDirectoryKind;
7582 fallbackPolling?: PollingWatchKind | ts.PollingWatchKind;
7583 synchronousWatchDirectory?: boolean;
7584 [option: string]: CompilerOptionsValue | undefined;
7587 * Configure request; value of command field is "configure". Specifies
7588 * host information, such as host type, tab size, and indent size.
7590 interface ConfigureRequest extends Request {
7591 command: CommandTypes.Configure;
7592 arguments: ConfigureRequestArguments;
7595 * Response to "configure" request. This is just an acknowledgement, so
7596 * no body field is required.
7598 interface ConfigureResponse extends Response {
7600 interface ConfigurePluginRequestArguments {
7604 interface ConfigurePluginRequest extends Request {
7605 command: CommandTypes.ConfigurePlugin;
7606 arguments: ConfigurePluginRequestArguments;
7608 interface ConfigurePluginResponse extends Response {
7610 interface SelectionRangeRequest extends FileRequest {
7611 command: CommandTypes.SelectionRange;
7612 arguments: SelectionRangeRequestArgs;
7614 interface SelectionRangeRequestArgs extends FileRequestArgs {
7615 locations: Location[];
7617 interface SelectionRangeResponse extends Response {
7618 body?: SelectionRange[];
7620 interface SelectionRange {
7622 parent?: SelectionRange;
7624 interface ToggleLineCommentRequest extends FileRequest {
7625 command: CommandTypes.ToggleLineComment;
7626 arguments: FileRangeRequestArgs;
7628 interface ToggleMultilineCommentRequest extends FileRequest {
7629 command: CommandTypes.ToggleMultilineComment;
7630 arguments: FileRangeRequestArgs;
7632 interface CommentSelectionRequest extends FileRequest {
7633 command: CommandTypes.CommentSelection;
7634 arguments: FileRangeRequestArgs;
7636 interface UncommentSelectionRequest extends FileRequest {
7637 command: CommandTypes.UncommentSelection;
7638 arguments: FileRangeRequestArgs;
7641 * Information found in an "open" request.
7643 interface OpenRequestArgs extends FileRequestArgs {
7645 * Used when a version of the file content is known to be more up to date than the one on disk.
7646 * Then the known content will be used upon opening instead of the disk copy
7648 fileContent?: string;
7650 * Used to specify the script kind of the file explicitly. It could be one of the following:
7651 * "TS", "JS", "TSX", "JSX"
7653 scriptKindName?: ScriptKindName;
7655 * Used to limit the searching for project config file. If given the searching will stop at this
7656 * root path; otherwise it will go all the way up to the dist root path.
7658 projectRootPath?: string;
7660 type ScriptKindName = "TS" | "JS" | "TSX" | "JSX";
7662 * Open request; value of command field is "open". Notify the
7663 * server that the client has file open. The server will not
7664 * monitor the filesystem for changes in this file and will assume
7665 * that the client is updating the server (using the change and/or
7666 * reload messages) when the file changes. Server does not currently
7667 * send a response to an open request.
7669 interface OpenRequest extends Request {
7670 command: CommandTypes.Open;
7671 arguments: OpenRequestArgs;
7674 * Request to open or update external project
7676 interface OpenExternalProjectRequest extends Request {
7677 command: CommandTypes.OpenExternalProject;
7678 arguments: OpenExternalProjectArgs;
7681 * Arguments to OpenExternalProjectRequest request
7683 type OpenExternalProjectArgs = ExternalProject;
7685 * Request to open multiple external projects
7687 interface OpenExternalProjectsRequest extends Request {
7688 command: CommandTypes.OpenExternalProjects;
7689 arguments: OpenExternalProjectsArgs;
7692 * Arguments to OpenExternalProjectsRequest
7694 interface OpenExternalProjectsArgs {
7696 * List of external projects to open or update
7698 projects: ExternalProject[];
7701 * Response to OpenExternalProjectRequest request. This is just an acknowledgement, so
7702 * no body field is required.
7704 interface OpenExternalProjectResponse extends Response {
7707 * Response to OpenExternalProjectsRequest request. This is just an acknowledgement, so
7708 * no body field is required.
7710 interface OpenExternalProjectsResponse extends Response {
7713 * Request to close external project.
7715 interface CloseExternalProjectRequest extends Request {
7716 command: CommandTypes.CloseExternalProject;
7717 arguments: CloseExternalProjectRequestArgs;
7720 * Arguments to CloseExternalProjectRequest request
7722 interface CloseExternalProjectRequestArgs {
7724 * Name of the project to close
7726 projectFileName: string;
7729 * Response to CloseExternalProjectRequest request. This is just an acknowledgement, so
7730 * no body field is required.
7732 interface CloseExternalProjectResponse extends Response {
7735 * Request to synchronize list of open files with the client
7737 interface UpdateOpenRequest extends Request {
7738 command: CommandTypes.UpdateOpen;
7739 arguments: UpdateOpenRequestArgs;
7742 * Arguments to UpdateOpenRequest
7744 interface UpdateOpenRequestArgs {
7746 * List of newly open files
7748 openFiles?: OpenRequestArgs[];
7750 * List of open files files that were changes
7752 changedFiles?: FileCodeEdits[];
7754 * List of files that were closed
7756 closedFiles?: string[];
7759 * External projects have a typeAcquisition option so they need to be added separately to compiler options for inferred projects.
7761 type InferredProjectCompilerOptions = ExternalProjectCompilerOptions & TypeAcquisition;
7763 * Request to set compiler options for inferred projects.
7764 * External projects are opened / closed explicitly.
7765 * Configured projects are opened when user opens loose file that has 'tsconfig.json' or 'jsconfig.json' anywhere in one of containing folders.
7766 * This configuration file will be used to obtain a list of files and configuration settings for the project.
7767 * Inferred projects are created when user opens a loose file that is not the part of external project
7768 * or configured project and will contain only open file and transitive closure of referenced files if 'useOneInferredProject' is false,
7769 * or all open loose files and its transitive closure of referenced files if 'useOneInferredProject' is true.
7771 interface SetCompilerOptionsForInferredProjectsRequest extends Request {
7772 command: CommandTypes.CompilerOptionsForInferredProjects;
7773 arguments: SetCompilerOptionsForInferredProjectsArgs;
7776 * Argument for SetCompilerOptionsForInferredProjectsRequest request.
7778 interface SetCompilerOptionsForInferredProjectsArgs {
7780 * Compiler options to be used with inferred projects.
7782 options: InferredProjectCompilerOptions;
7784 * Specifies the project root path used to scope compiler options.
7785 * It is an error to provide this property if the server has not been started with
7786 * `useInferredProjectPerProjectRoot` enabled.
7788 projectRootPath?: string;
7791 * Response to SetCompilerOptionsForInferredProjectsResponse request. This is just an acknowledgement, so
7792 * no body field is required.
7794 interface SetCompilerOptionsForInferredProjectsResponse extends Response {
7797 * Exit request; value of command field is "exit". Ask the server process
7800 interface ExitRequest extends Request {
7801 command: CommandTypes.Exit;
7804 * Close request; value of command field is "close". Notify the
7805 * server that the client has closed a previously open file. If
7806 * file is still referenced by open files, the server will resume
7807 * monitoring the filesystem for changes to file. Server does not
7808 * currently send a response to a close request.
7810 interface CloseRequest extends FileRequest {
7811 command: CommandTypes.Close;
7814 * Request to obtain the list of files that should be regenerated if target file is recompiled.
7815 * NOTE: this us query-only operation and does not generate any output on disk.
7817 interface CompileOnSaveAffectedFileListRequest extends FileRequest {
7818 command: CommandTypes.CompileOnSaveAffectedFileList;
7821 * Contains a list of files that should be regenerated in a project
7823 interface CompileOnSaveAffectedFileListSingleProject {
7827 projectFileName: string;
7829 * List of files names that should be recompiled
7831 fileNames: string[];
7833 * true if project uses outFile or out compiler option
7835 projectUsesOutFile: boolean;
7838 * Response for CompileOnSaveAffectedFileListRequest request;
7840 interface CompileOnSaveAffectedFileListResponse extends Response {
7841 body: CompileOnSaveAffectedFileListSingleProject[];
7844 * Request to recompile the file. All generated outputs (.js, .d.ts or .js.map files) is written on disk.
7846 interface CompileOnSaveEmitFileRequest extends FileRequest {
7847 command: CommandTypes.CompileOnSaveEmitFile;
7848 arguments: CompileOnSaveEmitFileRequestArgs;
7851 * Arguments for CompileOnSaveEmitFileRequest
7853 interface CompileOnSaveEmitFileRequestArgs extends FileRequestArgs {
7855 * if true - then file should be recompiled even if it does not have any changes.
7858 includeLinePosition?: boolean;
7859 /** if true - return response as object with emitSkipped and diagnostics */
7860 richResponse?: boolean;
7862 interface CompileOnSaveEmitFileResponse extends Response {
7863 body: boolean | EmitResult;
7865 interface EmitResult {
7866 emitSkipped: boolean;
7867 diagnostics: Diagnostic[] | DiagnosticWithLinePosition[];
7870 * Quickinfo request; value of command field is
7871 * "quickinfo". Return response giving a quick type and
7872 * documentation string for the symbol found in file at location
7875 interface QuickInfoRequest extends FileLocationRequest {
7876 command: CommandTypes.Quickinfo;
7879 * Body of QuickInfoResponse.
7881 interface QuickInfoResponseBody {
7883 * The symbol's kind (such as 'className' or 'parameterName' or plain 'text').
7885 kind: ScriptElementKind;
7887 * Optional modifiers for the kind (such as 'public').
7889 kindModifiers: string;
7891 * Starting file location of symbol.
7895 * One past last character of symbol.
7899 * Type and kind of symbol.
7901 displayString: string;
7903 * Documentation associated with symbol.
7905 documentation: string;
7907 * JSDoc tags associated with symbol.
7909 tags: JSDocTagInfo[];
7912 * Quickinfo response message.
7914 interface QuickInfoResponse extends Response {
7915 body?: QuickInfoResponseBody;
7918 * Arguments for format messages.
7920 interface FormatRequestArgs extends FileLocationRequestArgs {
7922 * Last line of range for which to format text in file.
7926 * Character offset on last line of range for which to format text in file.
7930 * Format options to be used.
7932 options?: FormatCodeSettings;
7935 * Format request; value of command field is "format". Return
7936 * response giving zero or more edit instructions. The edit
7937 * instructions will be sorted in file order. Applying the edit
7938 * instructions in reverse to file will result in correctly
7941 interface FormatRequest extends FileLocationRequest {
7942 command: CommandTypes.Format;
7943 arguments: FormatRequestArgs;
7946 * Object found in response messages defining an editing
7947 * instruction for a span of text in source code. The effect of
7948 * this instruction is to replace the text starting at start and
7949 * ending one character before end with newText. For an insertion,
7950 * the text span is empty. For a deletion, newText is empty.
7952 interface CodeEdit {
7954 * First character of the text span to edit.
7958 * One character past last character of the text span to edit.
7962 * Replace the span defined above with this string (may be
7963 * the empty string).
7967 interface FileCodeEdits {
7969 textChanges: CodeEdit[];
7971 interface CodeFixResponse extends Response {
7972 /** The code actions that are available */
7973 body?: CodeFixAction[];
7975 interface CodeAction {
7976 /** Description of the code action to display in the UI of the editor */
7977 description: string;
7978 /** Text changes to apply to each file as part of the code action */
7979 changes: FileCodeEdits[];
7980 /** A command is an opaque object that should be passed to `ApplyCodeActionCommandRequestArgs` without modification. */
7983 interface CombinedCodeActions {
7984 changes: readonly FileCodeEdits[];
7985 commands?: readonly {}[];
7987 interface CodeFixAction extends CodeAction {
7988 /** Short name to identify the fix, for use by telemetry. */
7991 * If present, one may call 'getCombinedCodeFix' with this fixId.
7992 * This may be omitted to indicate that the code fix can't be applied in a group.
7995 /** Should be present if and only if 'fixId' is. */
7996 fixAllDescription?: string;
7999 * Format and format on key response message.
8001 interface FormatResponse extends Response {
8005 * Arguments for format on key messages.
8007 interface FormatOnKeyRequestArgs extends FileLocationRequestArgs {
8009 * Key pressed (';', '\n', or '}').
8012 options?: FormatCodeSettings;
8015 * Format on key request; value of command field is
8016 * "formatonkey". Given file location and key typed (as string),
8017 * return response giving zero or more edit instructions. The
8018 * edit instructions will be sorted in file order. Applying the
8019 * edit instructions in reverse to file will result in correctly
8022 interface FormatOnKeyRequest extends FileLocationRequest {
8023 command: CommandTypes.Formatonkey;
8024 arguments: FormatOnKeyRequestArgs;
8026 type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<" | "#";
8028 * Arguments for completions messages.
8030 interface CompletionsRequestArgs extends FileLocationRequestArgs {
8032 * Optional prefix to apply to possible completions.
8036 * Character that was responsible for triggering completion.
8037 * Should be `undefined` if a user manually requested completion.
8039 triggerCharacter?: CompletionsTriggerCharacter;
8041 * @deprecated Use UserPreferences.includeCompletionsForModuleExports
8043 includeExternalModuleExports?: boolean;
8045 * @deprecated Use UserPreferences.includeCompletionsWithInsertText
8047 includeInsertTextCompletions?: boolean;
8050 * Completions request; value of command field is "completions".
8051 * Given a file location (file, line, col) and a prefix (which may
8052 * be the empty string), return the possible completions that
8053 * begin with prefix.
8055 interface CompletionsRequest extends FileLocationRequest {
8056 command: CommandTypes.Completions | CommandTypes.CompletionInfo;
8057 arguments: CompletionsRequestArgs;
8060 * Arguments for completion details request.
8062 interface CompletionDetailsRequestArgs extends FileLocationRequestArgs {
8064 * Names of one or more entries for which to obtain details.
8066 entryNames: (string | CompletionEntryIdentifier)[];
8068 interface CompletionEntryIdentifier {
8073 * Completion entry details request; value of command field is
8074 * "completionEntryDetails". Given a file location (file, line,
8075 * col) and an array of completion entry names return more
8076 * detailed information for each completion entry.
8078 interface CompletionDetailsRequest extends FileLocationRequest {
8079 command: CommandTypes.CompletionDetails;
8080 arguments: CompletionDetailsRequestArgs;
8083 * Part of a symbol description.
8085 interface SymbolDisplayPart {
8087 * Text of an item describing the symbol.
8091 * The symbol's kind (such as 'className' or 'parameterName' or plain 'text').
8096 * An item found in a completion response.
8098 interface CompletionEntry {
8100 * The symbol's name.
8104 * The symbol's kind (such as 'className' or 'parameterName').
8106 kind: ScriptElementKind;
8108 * Optional modifiers for the kind (such as 'public').
8110 kindModifiers?: string;
8112 * A string that is used for comparing completion items so that they can be ordered. This
8113 * is often the same as the name but may be different in certain circumstances.
8117 * Text to insert instead of `name`.
8118 * This is used to support bracketed completions; If `name` might be "a-b" but `insertText` would be `["a-b"]`,
8119 * coupled with `replacementSpan` to replace a dotted access with a bracket access.
8121 insertText?: string;
8123 * An optional span that indicates the text to be replaced by this completion item.
8124 * If present, this span should be used instead of the default one.
8125 * It will be set if the required span differs from the one generated by the default replacement behavior.
8127 replacementSpan?: TextSpan;
8129 * Indicates whether commiting this completion entry will require additional code actions to be
8130 * made to avoid errors. The CompletionEntryDetails will have these actions.
8134 * Identifier (not necessarily human-readable) identifying where this completion came from.
8138 * If true, this completion should be highlighted as recommended. There will only be one of these.
8139 * 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.
8140 * Then either that enum/class or a namespace containing it will be the recommended symbol.
8142 isRecommended?: true;
8144 * If true, this completion was generated from traversing the name table of an unchecked JS file,
8145 * and therefore may not be accurate.
8147 isFromUncheckedFile?: true;
8149 * If true, this completion was for an auto-import of a module not yet in the program, but listed
8150 * in the project package.json.
8152 isPackageJsonImport?: true;
8155 * Additional completion entry details, available on demand
8157 interface CompletionEntryDetails {
8159 * The symbol's name.
8163 * The symbol's kind (such as 'className' or 'parameterName').
8165 kind: ScriptElementKind;
8167 * Optional modifiers for the kind (such as 'public').
8169 kindModifiers: string;
8171 * Display parts of the symbol (similar to quick info).
8173 displayParts: SymbolDisplayPart[];
8175 * Documentation strings for the symbol.
8177 documentation?: SymbolDisplayPart[];
8179 * JSDoc tags for the symbol.
8181 tags?: JSDocTagInfo[];
8183 * The associated code actions for this entry
8185 codeActions?: CodeAction[];
8187 * Human-readable description of the `source` from the CompletionEntry.
8189 source?: SymbolDisplayPart[];
8191 /** @deprecated Prefer CompletionInfoResponse, which supports several top-level fields in addition to the array of entries. */
8192 interface CompletionsResponse extends Response {
8193 body?: CompletionEntry[];
8195 interface CompletionInfoResponse extends Response {
8196 body?: CompletionInfo;
8198 interface CompletionInfo {
8199 readonly isGlobalCompletion: boolean;
8200 readonly isMemberCompletion: boolean;
8201 readonly isNewIdentifierLocation: boolean;
8203 * In the absence of `CompletionEntry["replacementSpan"]`, the editor may choose whether to use
8204 * this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span
8205 * must be used to commit that completion entry.
8207 readonly optionalReplacementSpan?: TextSpan;
8208 readonly entries: readonly CompletionEntry[];
8210 interface CompletionDetailsResponse extends Response {
8211 body?: CompletionEntryDetails[];
8214 * Signature help information for a single parameter
8216 interface SignatureHelpParameter {
8218 * The parameter's name
8222 * Documentation of the parameter.
8224 documentation: SymbolDisplayPart[];
8226 * Display parts of the parameter.
8228 displayParts: SymbolDisplayPart[];
8230 * Whether the parameter is optional or not.
8232 isOptional: boolean;
8235 * Represents a single signature to show in signature help.
8237 interface SignatureHelpItem {
8239 * Whether the signature accepts a variable number of arguments.
8241 isVariadic: boolean;
8243 * The prefix display parts.
8245 prefixDisplayParts: SymbolDisplayPart[];
8247 * The suffix display parts.
8249 suffixDisplayParts: SymbolDisplayPart[];
8251 * The separator display parts.
8253 separatorDisplayParts: SymbolDisplayPart[];
8255 * The signature helps items for the parameters.
8257 parameters: SignatureHelpParameter[];
8259 * The signature's documentation
8261 documentation: SymbolDisplayPart[];
8263 * The signature's JSDoc tags
8265 tags: JSDocTagInfo[];
8268 * Signature help items found in the response of a signature help request.
8270 interface SignatureHelpItems {
8272 * The signature help items.
8274 items: SignatureHelpItem[];
8276 * The span for which signature help should appear on a signature
8278 applicableSpan: TextSpan;
8280 * The item selected in the set of available help items.
8282 selectedItemIndex: number;
8284 * The argument selected in the set of parameters.
8286 argumentIndex: number;
8288 * The argument count
8290 argumentCount: number;
8292 type SignatureHelpTriggerCharacter = "," | "(" | "<";
8293 type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")";
8295 * Arguments of a signature help request.
8297 interface SignatureHelpRequestArgs extends FileLocationRequestArgs {
8299 * Reason why signature help was invoked.
8300 * See each individual possible
8302 triggerReason?: SignatureHelpTriggerReason;
8304 type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason;
8306 * Signals that the user manually requested signature help.
8307 * The language service will unconditionally attempt to provide a result.
8309 interface SignatureHelpInvokedReason {
8311 triggerCharacter?: undefined;
8314 * Signals that the signature help request came from a user typing a character.
8315 * Depending on the character and the syntactic context, the request may or may not be served a result.
8317 interface SignatureHelpCharacterTypedReason {
8318 kind: "characterTyped";
8320 * Character that was responsible for triggering signature help.
8322 triggerCharacter: SignatureHelpTriggerCharacter;
8325 * Signals that this signature help request came from typing a character or moving the cursor.
8326 * This should only occur if a signature help session was already active and the editor needs to see if it should adjust.
8327 * The language service will unconditionally attempt to provide a result.
8328 * `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move.
8330 interface SignatureHelpRetriggeredReason {
8333 * Character that was responsible for triggering signature help.
8335 triggerCharacter?: SignatureHelpRetriggerCharacter;
8338 * Signature help request; value of command field is "signatureHelp".
8339 * Given a file location (file, line, col), return the signature
8342 interface SignatureHelpRequest extends FileLocationRequest {
8343 command: CommandTypes.SignatureHelp;
8344 arguments: SignatureHelpRequestArgs;
8347 * Response object for a SignatureHelpRequest.
8349 interface SignatureHelpResponse extends Response {
8350 body?: SignatureHelpItems;
8353 * Synchronous request for semantic diagnostics of one file.
8355 interface SemanticDiagnosticsSyncRequest extends FileRequest {
8356 command: CommandTypes.SemanticDiagnosticsSync;
8357 arguments: SemanticDiagnosticsSyncRequestArgs;
8359 interface SemanticDiagnosticsSyncRequestArgs extends FileRequestArgs {
8360 includeLinePosition?: boolean;
8363 * Response object for synchronous sematic diagnostics request.
8365 interface SemanticDiagnosticsSyncResponse extends Response {
8366 body?: Diagnostic[] | DiagnosticWithLinePosition[];
8368 interface SuggestionDiagnosticsSyncRequest extends FileRequest {
8369 command: CommandTypes.SuggestionDiagnosticsSync;
8370 arguments: SuggestionDiagnosticsSyncRequestArgs;
8372 type SuggestionDiagnosticsSyncRequestArgs = SemanticDiagnosticsSyncRequestArgs;
8373 type SuggestionDiagnosticsSyncResponse = SemanticDiagnosticsSyncResponse;
8375 * Synchronous request for syntactic diagnostics of one file.
8377 interface SyntacticDiagnosticsSyncRequest extends FileRequest {
8378 command: CommandTypes.SyntacticDiagnosticsSync;
8379 arguments: SyntacticDiagnosticsSyncRequestArgs;
8381 interface SyntacticDiagnosticsSyncRequestArgs extends FileRequestArgs {
8382 includeLinePosition?: boolean;
8385 * Response object for synchronous syntactic diagnostics request.
8387 interface SyntacticDiagnosticsSyncResponse extends Response {
8388 body?: Diagnostic[] | DiagnosticWithLinePosition[];
8391 * Arguments for GeterrForProject request.
8393 interface GeterrForProjectRequestArgs {
8395 * the file requesting project error list
8399 * Delay in milliseconds to wait before starting to compute
8400 * errors for the files in the file list
8405 * GeterrForProjectRequest request; value of command field is
8406 * "geterrForProject". It works similarly with 'Geterr', only
8407 * it request for every file in this project.
8409 interface GeterrForProjectRequest extends Request {
8410 command: CommandTypes.GeterrForProject;
8411 arguments: GeterrForProjectRequestArgs;
8414 * Arguments for geterr messages.
8416 interface GeterrRequestArgs {
8418 * List of file names for which to compute compiler errors.
8419 * The files will be checked in list order.
8423 * Delay in milliseconds to wait before starting to compute
8424 * errors for the files in the file list
8429 * Geterr request; value of command field is "geterr". Wait for
8430 * delay milliseconds and then, if during the wait no change or
8431 * reload messages have arrived for the first file in the files
8432 * list, get the syntactic errors for the file, field requests,
8433 * and then get the semantic errors for the file. Repeat with a
8434 * smaller delay for each subsequent file on the files list. Best
8435 * practice for an editor is to send a file list containing each
8436 * file that is currently visible, in most-recently-used order.
8438 interface GeterrRequest extends Request {
8439 command: CommandTypes.Geterr;
8440 arguments: GeterrRequestArgs;
8442 type RequestCompletedEventName = "requestCompleted";
8444 * Event that is sent when server have finished processing request with specified id.
8446 interface RequestCompletedEvent extends Event {
8447 event: RequestCompletedEventName;
8448 body: RequestCompletedEventBody;
8450 interface RequestCompletedEventBody {
8451 request_seq: number;
8454 * Item of diagnostic information found in a DiagnosticEvent message.
8456 interface Diagnostic {
8458 * Starting file location at which text applies.
8462 * The last file location at which the text applies.
8466 * Text of diagnostic message.
8470 * The category of the diagnostic message, e.g. "error", "warning", or "suggestion".
8473 reportsUnnecessary?: {};
8474 reportsDeprecated?: {};
8476 * Any related spans the diagnostic may have, such as other locations relevant to an error, such as declarartion sites
8478 relatedInformation?: DiagnosticRelatedInformation[];
8480 * The error code of the diagnostic message.
8484 * The name of the plugin reporting the message.
8488 interface DiagnosticWithFileName extends Diagnostic {
8490 * Name of the file the diagnostic is in
8495 * Represents additional spans returned with a diagnostic which are relevant to it
8497 interface DiagnosticRelatedInformation {
8499 * The category of the related information message, e.g. "error", "warning", or "suggestion".
8503 * The code used ot identify the related information
8507 * Text of related or additional information.
8511 * Associated location
8515 interface DiagnosticEventBody {
8517 * The file for which diagnostic information is reported.
8521 * An array of diagnostic information items.
8523 diagnostics: Diagnostic[];
8525 type DiagnosticEventKind = "semanticDiag" | "syntaxDiag" | "suggestionDiag";
8527 * Event message for DiagnosticEventKind event types.
8528 * These events provide syntactic and semantic errors for a file.
8530 interface DiagnosticEvent extends Event {
8531 body?: DiagnosticEventBody;
8532 event: DiagnosticEventKind;
8534 interface ConfigFileDiagnosticEventBody {
8536 * The file which trigged the searching and error-checking of the config file
8538 triggerFile: string;
8540 * The name of the found config file.
8544 * An arry of diagnostic information items for the found config file.
8546 diagnostics: DiagnosticWithFileName[];
8549 * Event message for "configFileDiag" event type.
8550 * This event provides errors for a found config file.
8552 interface ConfigFileDiagnosticEvent extends Event {
8553 body?: ConfigFileDiagnosticEventBody;
8554 event: "configFileDiag";
8556 type ProjectLanguageServiceStateEventName = "projectLanguageServiceState";
8557 interface ProjectLanguageServiceStateEvent extends Event {
8558 event: ProjectLanguageServiceStateEventName;
8559 body?: ProjectLanguageServiceStateEventBody;
8561 interface ProjectLanguageServiceStateEventBody {
8563 * Project name that has changes in the state of language service.
8564 * For configured projects this will be the config file path.
8565 * For external projects this will be the name of the projects specified when project was open.
8566 * For inferred projects this event is not raised.
8568 projectName: string;
8570 * True if language service state switched from disabled to enabled
8571 * and false otherwise.
8573 languageServiceEnabled: boolean;
8575 type ProjectsUpdatedInBackgroundEventName = "projectsUpdatedInBackground";
8576 interface ProjectsUpdatedInBackgroundEvent extends Event {
8577 event: ProjectsUpdatedInBackgroundEventName;
8578 body: ProjectsUpdatedInBackgroundEventBody;
8580 interface ProjectsUpdatedInBackgroundEventBody {
8582 * Current set of open files
8584 openFiles: string[];
8586 type ProjectLoadingStartEventName = "projectLoadingStart";
8587 interface ProjectLoadingStartEvent extends Event {
8588 event: ProjectLoadingStartEventName;
8589 body: ProjectLoadingStartEventBody;
8591 interface ProjectLoadingStartEventBody {
8592 /** name of the project */
8593 projectName: string;
8594 /** reason for loading */
8597 type ProjectLoadingFinishEventName = "projectLoadingFinish";
8598 interface ProjectLoadingFinishEvent extends Event {
8599 event: ProjectLoadingFinishEventName;
8600 body: ProjectLoadingFinishEventBody;
8602 interface ProjectLoadingFinishEventBody {
8603 /** name of the project */
8604 projectName: string;
8606 type SurveyReadyEventName = "surveyReady";
8607 interface SurveyReadyEvent extends Event {
8608 event: SurveyReadyEventName;
8609 body: SurveyReadyEventBody;
8611 interface SurveyReadyEventBody {
8612 /** Name of the survey. This is an internal machine- and programmer-friendly name */
8615 type LargeFileReferencedEventName = "largeFileReferenced";
8616 interface LargeFileReferencedEvent extends Event {
8617 event: LargeFileReferencedEventName;
8618 body: LargeFileReferencedEventBody;
8620 interface LargeFileReferencedEventBody {
8622 * name of the large file being loaded
8630 * max file size allowed on the server
8632 maxFileSize: number;
8635 * Arguments for reload request.
8637 interface ReloadRequestArgs extends FileRequestArgs {
8639 * Name of temporary file from which to reload file
8640 * contents. May be same as file.
8645 * Reload request message; value of command field is "reload".
8646 * Reload contents of file with name given by the 'file' argument
8647 * from temporary file with name given by the 'tmpfile' argument.
8648 * The two names can be identical.
8650 interface ReloadRequest extends FileRequest {
8651 command: CommandTypes.Reload;
8652 arguments: ReloadRequestArgs;
8655 * Response to "reload" request. This is just an acknowledgement, so
8656 * no body field is required.
8658 interface ReloadResponse extends Response {
8661 * Arguments for saveto request.
8663 interface SavetoRequestArgs extends FileRequestArgs {
8665 * Name of temporary file into which to save server's view of
8671 * Saveto request message; value of command field is "saveto".
8672 * For debugging purposes, save to a temporaryfile (named by
8673 * argument 'tmpfile') the contents of file named by argument
8674 * 'file'. The server does not currently send a response to a
8677 interface SavetoRequest extends FileRequest {
8678 command: CommandTypes.Saveto;
8679 arguments: SavetoRequestArgs;
8682 * Arguments for navto request message.
8684 interface NavtoRequestArgs {
8686 * Search term to navigate to from current location; term can
8687 * be '.*' or an identifier prefix.
8689 searchValue: string;
8691 * Optional limit on the number of items to return.
8693 maxResultCount?: number;
8695 * The file for the request (absolute pathname required).
8699 * Optional flag to indicate we want results for just the current file
8700 * or the entire project.
8702 currentFileOnly?: boolean;
8703 projectFileName?: string;
8706 * Navto request message; value of command field is "navto".
8707 * Return list of objects giving file locations and symbols that
8708 * match the search term given in argument 'searchTerm'. The
8709 * context for the search is given by the named file.
8711 interface NavtoRequest extends Request {
8712 command: CommandTypes.Navto;
8713 arguments: NavtoRequestArgs;
8716 * An item found in a navto response.
8718 interface NavtoItem extends FileSpan {
8720 * The symbol's name.
8724 * The symbol's kind (such as 'className' or 'parameterName').
8726 kind: ScriptElementKind;
8728 * exact, substring, or prefix.
8732 * If this was a case sensitive or insensitive match.
8734 isCaseSensitive: boolean;
8736 * Optional modifiers for the kind (such as 'public').
8738 kindModifiers?: string;
8740 * Name of symbol's container symbol (if any); for example,
8741 * the class name if symbol is a class member.
8743 containerName?: string;
8745 * Kind of symbol's container symbol (if any).
8747 containerKind?: ScriptElementKind;
8750 * Navto response message. Body is an array of navto items. Each
8751 * item gives a symbol that matched the search term.
8753 interface NavtoResponse extends Response {
8757 * Arguments for change request message.
8759 interface ChangeRequestArgs extends FormatRequestArgs {
8761 * Optional string to insert at location (file, line, offset).
8763 insertString?: string;
8766 * Change request message; value of command field is "change".
8767 * Update the server's view of the file named by argument 'file'.
8768 * Server does not currently send a response to a change request.
8770 interface ChangeRequest extends FileLocationRequest {
8771 command: CommandTypes.Change;
8772 arguments: ChangeRequestArgs;
8775 * Response to "brace" request.
8777 interface BraceResponse extends Response {
8781 * Brace matching request; value of command field is "brace".
8782 * Return response giving the file locations of matching braces
8783 * found in file at location line, offset.
8785 interface BraceRequest extends FileLocationRequest {
8786 command: CommandTypes.Brace;
8789 * NavBar items request; value of command field is "navbar".
8790 * Return response giving the list of navigation bar entries
8791 * extracted from the requested file.
8793 interface NavBarRequest extends FileRequest {
8794 command: CommandTypes.NavBar;
8797 * NavTree request; value of command field is "navtree".
8798 * Return response giving the navigation tree of the requested file.
8800 interface NavTreeRequest extends FileRequest {
8801 command: CommandTypes.NavTree;
8803 interface NavigationBarItem {
8805 * The item's display text.
8809 * The symbol's kind (such as 'className' or 'parameterName').
8811 kind: ScriptElementKind;
8813 * Optional modifiers for the kind (such as 'public').
8815 kindModifiers?: string;
8817 * The definition locations of the item.
8821 * Optional children.
8823 childItems?: NavigationBarItem[];
8825 * Number of levels deep this item should appear.
8829 /** protocol.NavigationTree is identical to ts.NavigationTree, except using protocol.TextSpan instead of ts.TextSpan */
8830 interface NavigationTree {
8832 kind: ScriptElementKind;
8833 kindModifiers: string;
8835 nameSpan: TextSpan | undefined;
8836 childItems?: NavigationTree[];
8838 type TelemetryEventName = "telemetry";
8839 interface TelemetryEvent extends Event {
8840 event: TelemetryEventName;
8841 body: TelemetryEventBody;
8843 interface TelemetryEventBody {
8844 telemetryEventName: string;
8847 type TypesInstallerInitializationFailedEventName = "typesInstallerInitializationFailed";
8848 interface TypesInstallerInitializationFailedEvent extends Event {
8849 event: TypesInstallerInitializationFailedEventName;
8850 body: TypesInstallerInitializationFailedEventBody;
8852 interface TypesInstallerInitializationFailedEventBody {
8855 type TypingsInstalledTelemetryEventName = "typingsInstalled";
8856 interface TypingsInstalledTelemetryEventBody extends TelemetryEventBody {
8857 telemetryEventName: TypingsInstalledTelemetryEventName;
8858 payload: TypingsInstalledTelemetryEventPayload;
8860 interface TypingsInstalledTelemetryEventPayload {
8862 * Comma separated list of installed typing packages
8864 installedPackages: string;
8866 * true if install request succeeded, otherwise - false
8868 installSuccess: boolean;
8870 * version of typings installer
8872 typingsInstallerVersion: string;
8874 type BeginInstallTypesEventName = "beginInstallTypes";
8875 type EndInstallTypesEventName = "endInstallTypes";
8876 interface BeginInstallTypesEvent extends Event {
8877 event: BeginInstallTypesEventName;
8878 body: BeginInstallTypesEventBody;
8880 interface EndInstallTypesEvent extends Event {
8881 event: EndInstallTypesEventName;
8882 body: EndInstallTypesEventBody;
8884 interface InstallTypesEventBody {
8886 * correlation id to match begin and end events
8890 * list of packages to install
8892 packages: readonly string[];
8894 interface BeginInstallTypesEventBody extends InstallTypesEventBody {
8896 interface EndInstallTypesEventBody extends InstallTypesEventBody {
8898 * true if installation succeeded, otherwise false
8902 interface NavBarResponse extends Response {
8903 body?: NavigationBarItem[];
8905 interface NavTreeResponse extends Response {
8906 body?: NavigationTree;
8908 interface CallHierarchyItem {
8910 kind: ScriptElementKind;
8911 kindModifiers?: string;
8914 selectionSpan: TextSpan;
8915 containerName?: string;
8917 interface CallHierarchyIncomingCall {
8918 from: CallHierarchyItem;
8919 fromSpans: TextSpan[];
8921 interface CallHierarchyOutgoingCall {
8922 to: CallHierarchyItem;
8923 fromSpans: TextSpan[];
8925 interface PrepareCallHierarchyRequest extends FileLocationRequest {
8926 command: CommandTypes.PrepareCallHierarchy;
8928 interface PrepareCallHierarchyResponse extends Response {
8929 readonly body: CallHierarchyItem | CallHierarchyItem[];
8931 interface ProvideCallHierarchyIncomingCallsRequest extends FileLocationRequest {
8932 command: CommandTypes.ProvideCallHierarchyIncomingCalls;
8934 interface ProvideCallHierarchyIncomingCallsResponse extends Response {
8935 readonly body: CallHierarchyIncomingCall[];
8937 interface ProvideCallHierarchyOutgoingCallsRequest extends FileLocationRequest {
8938 command: CommandTypes.ProvideCallHierarchyOutgoingCalls;
8940 interface ProvideCallHierarchyOutgoingCallsResponse extends Response {
8941 readonly body: CallHierarchyOutgoingCall[];
8948 enum SemicolonPreference {
8953 interface EditorSettings {
8954 baseIndentSize?: number;
8955 indentSize?: number;
8957 newLineCharacter?: string;
8958 convertTabsToSpaces?: boolean;
8959 indentStyle?: IndentStyle | ts.IndentStyle;
8960 trimTrailingWhitespace?: boolean;
8962 interface FormatCodeSettings extends EditorSettings {
8963 insertSpaceAfterCommaDelimiter?: boolean;
8964 insertSpaceAfterSemicolonInForStatements?: boolean;
8965 insertSpaceBeforeAndAfterBinaryOperators?: boolean;
8966 insertSpaceAfterConstructor?: boolean;
8967 insertSpaceAfterKeywordsInControlFlowStatements?: boolean;
8968 insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean;
8969 insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean;
8970 insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean;
8971 insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean;
8972 insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
8973 insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean;
8974 insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
8975 insertSpaceAfterTypeAssertion?: boolean;
8976 insertSpaceBeforeFunctionParenthesis?: boolean;
8977 placeOpenBraceOnNewLineForFunctions?: boolean;
8978 placeOpenBraceOnNewLineForControlBlocks?: boolean;
8979 insertSpaceBeforeTypeAnnotation?: boolean;
8980 semicolons?: SemicolonPreference;
8982 interface UserPreferences {
8983 readonly disableSuggestions?: boolean;
8984 readonly quotePreference?: "auto" | "double" | "single";
8986 * If enabled, TypeScript will search through all external modules' exports and add them to the completions list.
8987 * This affects lone identifier completions but not completions on the right hand side of `obj.`.
8989 readonly includeCompletionsForModuleExports?: boolean;
8991 * If enabled, the completion list will include completions with invalid identifier names.
8992 * For those entries, The `insertText` and `replacementSpan` properties will be set to change from `.x` property access to `["x"]`.
8994 readonly includeCompletionsWithInsertText?: boolean;
8996 * Unless this option is `false`, or `includeCompletionsWithInsertText` is not enabled,
8997 * member completion lists triggered with `.` will include entries on potentially-null and potentially-undefined
8998 * values, with insertion text to replace preceding `.` tokens with `?.`.
9000 readonly includeAutomaticOptionalChainCompletions?: boolean;
9001 readonly importModuleSpecifierPreference?: "auto" | "relative" | "non-relative";
9002 /** Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js" */
9003 readonly importModuleSpecifierEnding?: "auto" | "minimal" | "index" | "js";
9004 readonly allowTextChangesInNewFiles?: boolean;
9005 readonly lazyConfiguredProjectsFromExternalProject?: boolean;
9006 readonly providePrefixAndSuffixTextForRename?: boolean;
9007 readonly provideRefactorNotApplicableReason?: boolean;
9008 readonly allowRenameOfImportPath?: boolean;
9009 readonly includePackageJsonAutoImports?: "auto" | "on" | "off";
9011 interface CompilerOptions {
9013 allowSyntheticDefaultImports?: boolean;
9014 allowUnreachableCode?: boolean;
9015 allowUnusedLabels?: boolean;
9016 alwaysStrict?: boolean;
9020 declaration?: boolean;
9021 declarationDir?: string;
9022 disableSizeLimit?: boolean;
9023 downlevelIteration?: boolean;
9025 emitDecoratorMetadata?: boolean;
9026 experimentalDecorators?: boolean;
9027 forceConsistentCasingInFileNames?: boolean;
9028 importHelpers?: boolean;
9029 inlineSourceMap?: boolean;
9030 inlineSources?: boolean;
9031 isolatedModules?: boolean;
9032 jsx?: JsxEmit | ts.JsxEmit;
9036 maxNodeModuleJsDepth?: number;
9037 module?: ModuleKind | ts.ModuleKind;
9038 moduleResolution?: ModuleResolutionKind | ts.ModuleResolutionKind;
9039 newLine?: NewLineKind | ts.NewLineKind;
9041 noEmitHelpers?: boolean;
9042 noEmitOnError?: boolean;
9043 noErrorTruncation?: boolean;
9044 noFallthroughCasesInSwitch?: boolean;
9045 noImplicitAny?: boolean;
9046 noImplicitReturns?: boolean;
9047 noImplicitThis?: boolean;
9048 noUnusedLocals?: boolean;
9049 noUnusedParameters?: boolean;
9050 noImplicitUseStrict?: boolean;
9052 noResolve?: boolean;
9056 paths?: MapLike<string[]>;
9057 plugins?: PluginImport[];
9058 preserveConstEnums?: boolean;
9059 preserveSymlinks?: boolean;
9061 reactNamespace?: string;
9062 removeComments?: boolean;
9063 references?: ProjectReference[];
9065 rootDirs?: string[];
9066 skipLibCheck?: boolean;
9067 skipDefaultLibCheck?: boolean;
9068 sourceMap?: boolean;
9069 sourceRoot?: string;
9071 strictNullChecks?: boolean;
9072 suppressExcessPropertyErrors?: boolean;
9073 suppressImplicitAnyIndexErrors?: boolean;
9074 useDefineForClassFields?: boolean;
9075 target?: ScriptTarget | ts.ScriptTarget;
9076 traceResolution?: boolean;
9077 resolveJsonModule?: boolean;
9079 /** Paths used to used to compute primary types search locations */
9080 typeRoots?: string[];
9081 [option: string]: CompilerOptionsValue | undefined;
9085 Preserve = "Preserve",
9086 ReactNative = "ReactNative",
9088 ReactJSX = "ReactJSX",
9089 ReactJSXDev = "ReactJSXDev"
9093 CommonJS = "CommonJS",
9102 enum ModuleResolutionKind {
9103 Classic = "Classic",
9124 declare namespace ts.server {
9125 interface ScriptInfoVersion {
9129 function isDynamicFileName(fileName: NormalizedPath): boolean;
9131 private readonly host;
9132 readonly fileName: NormalizedPath;
9133 readonly scriptKind: ScriptKind;
9134 readonly hasMixedContent: boolean;
9135 readonly path: Path;
9137 * All projects that include this file
9139 readonly containingProjects: Project[];
9140 private formatSettings;
9141 private preferences;
9142 private textStorage;
9143 constructor(host: ServerHost, fileName: NormalizedPath, scriptKind: ScriptKind, hasMixedContent: boolean, path: Path, initialVersion?: ScriptInfoVersion);
9144 isScriptOpen(): boolean;
9145 open(newText: string): void;
9146 close(fileExists?: boolean): void;
9147 getSnapshot(): IScriptSnapshot;
9148 private ensureRealPath;
9149 getFormatCodeSettings(): FormatCodeSettings | undefined;
9150 getPreferences(): protocol.UserPreferences | undefined;
9151 attachToProject(project: Project): boolean;
9152 isAttached(project: Project): boolean;
9153 detachFromProject(project: Project): void;
9154 detachAllProjects(): void;
9155 getDefaultProject(): Project;
9156 registerFileUpdate(): void;
9157 setOptions(formatSettings: FormatCodeSettings, preferences: protocol.UserPreferences | undefined): void;
9158 getLatestVersion(): string;
9159 saveTo(fileName: string): void;
9160 reloadFromFile(tempFileName?: NormalizedPath): boolean;
9161 editContent(start: number, end: number, newText: string): void;
9162 markContainingProjectsAsDirty(): void;
9163 isOrphan(): boolean;
9165 * @param line 1 based index
9167 lineToTextSpan(line: number): TextSpan;
9169 * @param line 1 based index
9170 * @param offset 1 based index
9172 lineOffsetToPosition(line: number, offset: number): number;
9173 positionToLineOffset(position: number): protocol.Location;
9174 isJavaScript(): boolean;
9177 declare namespace ts.server {
9178 interface InstallPackageOptionsWithProject extends InstallPackageOptions {
9179 projectName: string;
9180 projectRootPath: Path;
9182 interface ITypingsInstaller {
9183 isKnownTypesPackageName(name: string): boolean;
9184 installPackage(options: InstallPackageOptionsWithProject): Promise<ApplyCodeActionCommandResult>;
9185 enqueueInstallTypingsRequest(p: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string> | undefined): void;
9186 attach(projectService: ProjectService): void;
9187 onProjectClosed(p: Project): void;
9188 readonly globalTypingsCacheLocation: string | undefined;
9190 const nullTypingsInstaller: ITypingsInstaller;
9192 declare namespace ts.server {
9197 AutoImportProvider = 3
9199 function allRootFilesAreJsOrDts(project: Project): boolean;
9200 function allFilesAreJsOrDts(project: Project): boolean;
9201 interface PluginCreateInfo {
9203 languageService: LanguageService;
9204 languageServiceHost: LanguageServiceHost;
9205 serverHost: ServerHost;
9208 interface PluginModule {
9209 create(createInfo: PluginCreateInfo): LanguageService;
9210 getExternalFiles?(proj: Project): string[];
9211 onConfigurationChanged?(config: any): void;
9213 interface PluginModuleWithName {
9215 module: PluginModule;
9217 type PluginModuleFactory = (mod: {
9218 typescript: typeof ts;
9220 abstract class Project implements LanguageServiceHost, ModuleResolutionHost {
9221 readonly projectName: string;
9222 readonly projectKind: ProjectKind;
9223 readonly projectService: ProjectService;
9224 private documentRegistry;
9225 private compilerOptions;
9226 compileOnSaveEnabled: boolean;
9227 protected watchOptions: WatchOptions | undefined;
9229 private rootFilesMap;
9231 private externalFiles;
9232 private missingFilesMap;
9233 private generatedFilesMap;
9235 private lastFileExceededProgramSize;
9236 protected languageService: LanguageService;
9237 languageServiceEnabled: boolean;
9238 readonly trace?: (s: string) => void;
9239 readonly realpath?: (path: string) => string;
9240 private builderState;
9242 * Set of files names that were updated since the last call to getChangesSinceVersion.
9244 private updatedFileNames;
9246 * Set of files that was returned from the last call to getChangesSinceVersion.
9248 private lastReportedFileNames;
9250 * Last version that was reported.
9252 private lastReportedVersion;
9254 * Current project's program version. (incremented everytime new program is created that is not complete reuse from the old one)
9255 * This property is changed in 'updateGraph' based on the set of files in program
9257 private projectProgramVersion;
9259 * Current version of the project state. It is changed when:
9260 * - new root file was added/removed
9261 * - edit happen in some file that is currently included in the project.
9262 * This property is different from projectStructureVersion since in most cases edits don't affect set of files in the project
9264 private projectStateVersion;
9265 protected isInitialLoadPending: () => boolean;
9266 private readonly cancellationToken;
9267 isNonTsProject(): boolean;
9268 isJsOnlyProject(): boolean;
9269 static resolveModule(moduleName: string, initialDir: string, host: ServerHost, log: (message: string) => void, logErrors?: (message: string) => void): {} | undefined;
9270 isKnownTypesPackageName(name: string): boolean;
9271 installPackage(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
9272 private get typingsCache();
9273 getCompilationSettings(): CompilerOptions;
9274 getCompilerOptions(): CompilerOptions;
9275 getNewLine(): string;
9276 getProjectVersion(): string;
9277 getProjectReferences(): readonly ProjectReference[] | undefined;
9278 getScriptFileNames(): string[];
9279 private getOrCreateScriptInfoAndAttachToProject;
9280 getScriptKind(fileName: string): ScriptKind;
9281 getScriptVersion(filename: string): string;
9282 getScriptSnapshot(filename: string): IScriptSnapshot | undefined;
9283 getCancellationToken(): HostCancellationToken;
9284 getCurrentDirectory(): string;
9285 getDefaultLibFileName(): string;
9286 useCaseSensitiveFileNames(): boolean;
9287 readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
9288 readFile(fileName: string): string | undefined;
9289 writeFile(fileName: string, content: string): void;
9290 fileExists(file: string): boolean;
9291 resolveModuleNames(moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference): (ResolvedModuleFull | undefined)[];
9292 getResolvedModuleWithFailedLookupLocationsFromCache(moduleName: string, containingFile: string): ResolvedModuleWithFailedLookupLocations | undefined;
9293 resolveTypeReferenceDirectives(typeDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference): (ResolvedTypeReferenceDirective | undefined)[];
9294 directoryExists(path: string): boolean;
9295 getDirectories(path: string): string[];
9296 log(s: string): void;
9297 error(s: string): void;
9298 private setInternalCompilerOptionsForEmittingJsFiles;
9300 * Get the errors that dont have any file name associated
9302 getGlobalProjectErrors(): readonly Diagnostic[];
9303 getAllProjectErrors(): readonly Diagnostic[];
9304 getLanguageService(ensureSynchronized?: boolean): LanguageService;
9305 getCompileOnSaveAffectedFileList(scriptInfo: ScriptInfo): string[];
9307 * Returns true if emit was conducted
9309 emitFile(scriptInfo: ScriptInfo, writeFile: (path: string, data: string, writeByteOrderMark?: boolean) => void): EmitResult;
9310 enableLanguageService(): void;
9311 disableLanguageService(lastFileExceededProgramSize?: string): void;
9312 getProjectName(): string;
9313 protected removeLocalTypingsFromTypeAcquisition(newTypeAcquisition: TypeAcquisition): TypeAcquisition;
9314 getExternalFiles(): SortedReadonlyArray<string>;
9315 getSourceFile(path: Path): SourceFile | undefined;
9317 private detachScriptInfoIfNotRoot;
9318 isClosed(): boolean;
9319 hasRoots(): boolean;
9320 getRootFiles(): NormalizedPath[];
9321 getRootScriptInfos(): ScriptInfo[];
9322 getScriptInfos(): ScriptInfo[];
9323 getExcludedFiles(): readonly NormalizedPath[];
9324 getFileNames(excludeFilesFromExternalLibraries?: boolean, excludeConfigFiles?: boolean): NormalizedPath[];
9325 hasConfigFile(configFilePath: NormalizedPath): boolean;
9326 containsScriptInfo(info: ScriptInfo): boolean;
9327 containsFile(filename: NormalizedPath, requireOpen?: boolean): boolean;
9328 isRoot(info: ScriptInfo): boolean;
9329 addRoot(info: ScriptInfo, fileName?: NormalizedPath): void;
9330 addMissingFileRoot(fileName: NormalizedPath): void;
9331 removeFile(info: ScriptInfo, fileExists: boolean, detachFromProject: boolean): void;
9332 registerFileUpdate(fileName: string): void;
9333 markAsDirty(): void;
9335 * Updates set of files that contribute to this project
9336 * @returns: true if set of files in the project stays the same and false - otherwise.
9338 updateGraph(): boolean;
9339 protected removeExistingTypings(include: string[]): string[];
9340 private updateGraphWorker;
9341 private detachScriptInfoFromProject;
9342 private addMissingFileWatcher;
9343 private isWatchedMissingFile;
9344 private createGeneratedFileWatcher;
9345 private isValidGeneratedFileWatcher;
9346 private clearGeneratedFileWatch;
9347 getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo | undefined;
9348 getScriptInfo(uncheckedFileName: string): ScriptInfo | undefined;
9349 filesToString(writeProjectFileNames: boolean): string;
9350 setCompilerOptions(compilerOptions: CompilerOptions): void;
9351 setTypeAcquisition(newTypeAcquisition: TypeAcquisition | undefined): void;
9352 getTypeAcquisition(): TypeAcquisition;
9353 protected removeRoot(info: ScriptInfo): void;
9354 protected enableGlobalPlugins(options: CompilerOptions, pluginConfigOverrides: Map<any> | undefined): void;
9355 protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[], pluginConfigOverrides: Map<any> | undefined): void;
9356 private enableProxy;
9357 /** Starts a new check for diagnostics. Call this if some file has updated that would cause diagnostics to be changed. */
9358 refreshDiagnostics(): void;
9361 * If a file is opened and no tsconfig (or jsconfig) is found,
9362 * the file and its imports/references are put into an InferredProject.
9364 class InferredProject extends Project {
9365 private static readonly newName;
9366 private _isJsInferredProject;
9367 toggleJsInferredProject(isJsInferredProject: boolean): void;
9368 setCompilerOptions(options?: CompilerOptions): void;
9369 /** this is canonical project root path */
9370 readonly projectRootPath: string | undefined;
9371 addRoot(info: ScriptInfo): void;
9372 removeRoot(info: ScriptInfo): void;
9373 isProjectWithSingleRoot(): boolean;
9375 getTypeAcquisition(): TypeAcquisition;
9377 class AutoImportProviderProject extends Project {
9378 private hostProject;
9379 private static readonly newName;
9380 private rootFileNames;
9381 isOrphan(): boolean;
9382 updateGraph(): boolean;
9383 markAsDirty(): void;
9384 getScriptFileNames(): string[];
9385 getLanguageService(): never;
9386 markAutoImportProviderAsDirty(): never;
9387 getModuleResolutionHostForAutoImportProvider(): never;
9388 getProjectReferences(): readonly ProjectReference[] | undefined;
9389 useSourceOfProjectReferenceRedirect(): boolean;
9390 getTypeAcquisition(): TypeAcquisition;
9393 * If a file is opened, the server will look for a tsconfig (or jsconfig)
9394 * and if successful create a ConfiguredProject for it.
9395 * Otherwise it will create an InferredProject.
9397 class ConfiguredProject extends Project {
9398 private directoriesWatchedForWildcards;
9399 readonly canonicalConfigFilePath: NormalizedPath;
9400 /** Ref count to the project when opened from external project */
9401 private externalProjectRefCount;
9402 private projectErrors;
9403 private projectReferences;
9405 * If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph
9406 * @returns: true if set of files in the project stays the same and false - otherwise.
9408 updateGraph(): boolean;
9409 getConfigFilePath(): NormalizedPath;
9410 getProjectReferences(): readonly ProjectReference[] | undefined;
9411 updateReferences(refs: readonly ProjectReference[] | undefined): void;
9413 * Get the errors that dont have any file name associated
9415 getGlobalProjectErrors(): readonly Diagnostic[];
9417 * Get all the project errors
9419 getAllProjectErrors(): readonly Diagnostic[];
9420 setProjectErrors(projectErrors: Diagnostic[]): void;
9422 getEffectiveTypeRoots(): string[];
9425 * Project whose configuration is handled externally, such as in a '.csproj'.
9426 * These are created only if a host explicitly calls `openExternalProject`.
9428 class ExternalProject extends Project {
9429 externalProjectName: string;
9430 compileOnSaveEnabled: boolean;
9431 excludedFiles: readonly NormalizedPath[];
9432 updateGraph(): boolean;
9433 getExcludedFiles(): readonly NormalizedPath[];
9436 declare namespace ts.server {
9437 export const maxProgramSizeForNonTsFiles: number;
9438 export const ProjectsUpdatedInBackgroundEvent = "projectsUpdatedInBackground";
9439 export const ProjectLoadingStartEvent = "projectLoadingStart";
9440 export const ProjectLoadingFinishEvent = "projectLoadingFinish";
9441 export const LargeFileReferencedEvent = "largeFileReferenced";
9442 export const ConfigFileDiagEvent = "configFileDiag";
9443 export const ProjectLanguageServiceStateEvent = "projectLanguageServiceState";
9444 export const ProjectInfoTelemetryEvent = "projectInfo";
9445 export const OpenFileInfoTelemetryEvent = "openFileInfo";
9446 export interface ProjectsUpdatedInBackgroundEvent {
9447 eventName: typeof ProjectsUpdatedInBackgroundEvent;
9449 openFiles: string[];
9452 export interface ProjectLoadingStartEvent {
9453 eventName: typeof ProjectLoadingStartEvent;
9459 export interface ProjectLoadingFinishEvent {
9460 eventName: typeof ProjectLoadingFinishEvent;
9465 export interface LargeFileReferencedEvent {
9466 eventName: typeof LargeFileReferencedEvent;
9470 maxFileSize: number;
9473 export interface ConfigFileDiagEvent {
9474 eventName: typeof ConfigFileDiagEvent;
9476 triggerFile: string;
9477 configFileName: string;
9478 diagnostics: readonly Diagnostic[];
9481 export interface ProjectLanguageServiceStateEvent {
9482 eventName: typeof ProjectLanguageServiceStateEvent;
9485 languageServiceEnabled: boolean;
9488 /** This will be converted to the payload of a protocol.TelemetryEvent in session.defaultEventHandler. */
9489 export interface ProjectInfoTelemetryEvent {
9490 readonly eventName: typeof ProjectInfoTelemetryEvent;
9491 readonly data: ProjectInfoTelemetryEventData;
9493 export interface ProjectInfoTelemetryEventData {
9494 /** Cryptographically secure hash of project file location. */
9495 readonly projectId: string;
9496 /** Count of file extensions seen in the project. */
9497 readonly fileStats: FileStats;
9499 * Any compiler options that might contain paths will be taken out.
9500 * Enum compiler options will be converted to strings.
9502 readonly compilerOptions: CompilerOptions;
9503 readonly extends: boolean | undefined;
9504 readonly files: boolean | undefined;
9505 readonly include: boolean | undefined;
9506 readonly exclude: boolean | undefined;
9507 readonly compileOnSave: boolean;
9508 readonly typeAcquisition: ProjectInfoTypeAcquisitionData;
9509 readonly configFileName: "tsconfig.json" | "jsconfig.json" | "other";
9510 readonly projectType: "external" | "configured";
9511 readonly languageServiceEnabled: boolean;
9512 /** TypeScript version used by the server. */
9513 readonly version: string;
9516 * Info that we may send about a file that was just opened.
9517 * Info about a file will only be sent once per session, even if the file changes in ways that might affect the info.
9518 * Currently this is only sent for '.js' files.
9520 export interface OpenFileInfoTelemetryEvent {
9521 readonly eventName: typeof OpenFileInfoTelemetryEvent;
9522 readonly data: OpenFileInfoTelemetryEventData;
9524 export interface OpenFileInfoTelemetryEventData {
9525 readonly info: OpenFileInfo;
9527 export interface ProjectInfoTypeAcquisitionData {
9528 readonly enable: boolean | undefined;
9529 readonly include: boolean;
9530 readonly exclude: boolean;
9532 export interface FileStats {
9533 readonly js: number;
9534 readonly jsSize?: number;
9535 readonly jsx: number;
9536 readonly jsxSize?: number;
9537 readonly ts: number;
9538 readonly tsSize?: number;
9539 readonly tsx: number;
9540 readonly tsxSize?: number;
9541 readonly dts: number;
9542 readonly dtsSize?: number;
9543 readonly deferred: number;
9544 readonly deferredSize?: number;
9546 export interface OpenFileInfo {
9547 readonly checkJs: boolean;
9549 export type ProjectServiceEvent = LargeFileReferencedEvent | ProjectsUpdatedInBackgroundEvent | ProjectLoadingStartEvent | ProjectLoadingFinishEvent | ConfigFileDiagEvent | ProjectLanguageServiceStateEvent | ProjectInfoTelemetryEvent | OpenFileInfoTelemetryEvent;
9550 export type ProjectServiceEventHandler = (event: ProjectServiceEvent) => void;
9551 export interface SafeList {
9554 exclude?: (string | number)[][];
9558 export interface TypesMapFile {
9561 [libName: string]: string;
9564 export function convertFormatOptions(protocolOptions: protocol.FormatCodeSettings): FormatCodeSettings;
9565 export function convertCompilerOptions(protocolOptions: protocol.ExternalProjectCompilerOptions): CompilerOptions & protocol.CompileOnSaveMixin;
9566 export function convertWatchOptions(protocolOptions: protocol.ExternalProjectCompilerOptions): WatchOptions | undefined;
9567 export function convertTypeAcquisition(protocolOptions: protocol.InferredProjectCompilerOptions): TypeAcquisition | undefined;
9568 export function tryConvertScriptKindName(scriptKindName: protocol.ScriptKindName | ScriptKind): ScriptKind;
9569 export function convertScriptKindName(scriptKindName: protocol.ScriptKindName): ScriptKind.Unknown | ScriptKind.JS | ScriptKind.JSX | ScriptKind.TS | ScriptKind.TSX;
9570 export interface HostConfiguration {
9571 formatCodeOptions: FormatCodeSettings;
9572 preferences: protocol.UserPreferences;
9574 extraFileExtensions?: FileExtensionInfo[];
9575 watchOptions?: WatchOptions;
9577 export interface OpenConfiguredProjectResult {
9578 configFileName?: NormalizedPath;
9579 configFileErrors?: readonly Diagnostic[];
9581 export interface ProjectServiceOptions {
9584 cancellationToken: HostCancellationToken;
9585 useSingleInferredProject: boolean;
9586 useInferredProjectPerProjectRoot: boolean;
9587 typingsInstaller: ITypingsInstaller;
9588 eventHandler?: ProjectServiceEventHandler;
9589 suppressDiagnosticEvents?: boolean;
9590 throttleWaitMilliseconds?: number;
9591 globalPlugins?: readonly string[];
9592 pluginProbeLocations?: readonly string[];
9593 allowLocalPluginLoads?: boolean;
9594 typesMapLocation?: string;
9595 /** @deprecated use serverMode instead */
9596 syntaxOnly?: boolean;
9597 serverMode?: LanguageServiceMode;
9599 export class ProjectService {
9600 private readonly scriptInfoInNodeModulesWatchers;
9602 * Contains all the deleted script info's version information so that
9603 * it does not reset when creating script info again
9604 * (and could have potentially collided with version where contents mismatch)
9606 private readonly filenameToScriptInfoVersion;
9607 private readonly allJsFilesForOpenFileTelemetry;
9609 * maps external project file name to list of config files that were the part of this project
9611 private readonly externalProjectToConfiguredProjectMap;
9613 * external projects (configuration and list of root files is not controlled by tsserver)
9615 readonly externalProjects: ExternalProject[];
9617 * projects built from openFileRoots
9619 readonly inferredProjects: InferredProject[];
9621 * projects specified by a tsconfig.json file
9623 readonly configuredProjects: Map<ConfiguredProject>;
9625 * Open files: with value being project root path, and key being Path of the file that is open
9627 readonly openFiles: Map<NormalizedPath | undefined>;
9629 * Map of open files that are opened without complete path but have projectRoot as current directory
9631 private readonly openFilesWithNonRootedDiskPath;
9632 private compilerOptionsForInferredProjects;
9633 private compilerOptionsForInferredProjectsPerProjectRoot;
9634 private watchOptionsForInferredProjects;
9635 private watchOptionsForInferredProjectsPerProjectRoot;
9636 private typeAcquisitionForInferredProjects;
9637 private typeAcquisitionForInferredProjectsPerProjectRoot;
9639 * Project size for configured or external projects
9641 private readonly projectToSizeMap;
9643 * This is a map of config file paths existence that doesnt need query to disk
9644 * - The entry can be present because there is inferred project that needs to watch addition of config file to directory
9645 * In this case the exists could be true/false based on config file is present or not
9646 * - Or it is present if we have configured project open with config file at that location
9647 * In this case the exists property is always true
9649 private readonly configFileExistenceInfoCache;
9650 private readonly hostConfiguration;
9652 private readonly legacySafelist;
9653 private pendingProjectUpdates;
9654 readonly currentDirectory: NormalizedPath;
9655 readonly toCanonicalFileName: (f: string) => string;
9656 readonly host: ServerHost;
9657 readonly logger: Logger;
9658 readonly cancellationToken: HostCancellationToken;
9659 readonly useSingleInferredProject: boolean;
9660 readonly useInferredProjectPerProjectRoot: boolean;
9661 readonly typingsInstaller: ITypingsInstaller;
9662 private readonly globalCacheLocationDirectoryPath;
9663 readonly throttleWaitMilliseconds?: number;
9664 private readonly eventHandler?;
9665 private readonly suppressDiagnosticEvents?;
9666 readonly globalPlugins: readonly string[];
9667 readonly pluginProbeLocations: readonly string[];
9668 readonly allowLocalPluginLoads: boolean;
9669 private currentPluginConfigOverrides;
9670 readonly typesMapLocation: string | undefined;
9671 /** @deprecated use serverMode instead */
9672 readonly syntaxOnly: boolean;
9673 readonly serverMode: LanguageServiceMode;
9674 /** Tracks projects that we have already sent telemetry for. */
9675 private readonly seenProjects;
9676 private performanceEventHandler?;
9677 constructor(opts: ProjectServiceOptions);
9678 toPath(fileName: string): Path;
9679 private loadTypesMap;
9680 updateTypingsForProject(response: SetTypings | InvalidateCachedTypings | PackageInstalledResponse): void;
9681 private delayUpdateProjectGraph;
9682 private delayUpdateProjectGraphs;
9683 setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.InferredProjectCompilerOptions, projectRootPath?: string): void;
9684 findProject(projectName: string): Project | undefined;
9685 getDefaultProjectForFile(fileName: NormalizedPath, ensureProject: boolean): Project | undefined;
9686 private doEnsureDefaultProjectForFile;
9687 getScriptInfoEnsuringProjectsUptoDate(uncheckedFileName: string): ScriptInfo | undefined;
9689 * Ensures the project structures are upto date
9691 * - we go through all the projects and update them if they are dirty
9692 * - if updates reflect some change in structure or there was pending request to ensure projects for open files
9693 * ensure that each open script info has project
9695 private ensureProjectStructuresUptoDate;
9696 getFormatCodeOptions(file: NormalizedPath): FormatCodeSettings;
9697 getPreferences(file: NormalizedPath): protocol.UserPreferences;
9698 getHostFormatCodeOptions(): FormatCodeSettings;
9699 getHostPreferences(): protocol.UserPreferences;
9700 private onSourceFileChanged;
9701 private handleSourceMapProjects;
9702 private delayUpdateSourceInfoProjects;
9703 private delayUpdateProjectsOfScriptInfoPath;
9704 private handleDeletedFile;
9706 * This is the callback function for the config file add/remove/change at any location
9707 * that matters to open script info but doesnt have configured project open
9708 * for the config file
9710 private onConfigFileChangeForOpenScriptInfo;
9711 private removeProject;
9712 private assignOrphanScriptInfosToInferredProject;
9714 * Remove this file from the set of open, non-configured files.
9715 * @param info The file that has been closed or newly configured
9717 private closeOpenFile;
9718 private deleteScriptInfo;
9719 private configFileExists;
9720 private setConfigFileExistenceByNewConfiguredProject;
9722 * Returns true if the configFileExistenceInfo is needed/impacted by open files that are root of inferred project
9724 private configFileExistenceImpactsRootOfInferredProject;
9725 private setConfigFileExistenceInfoByClosedConfiguredProject;
9726 private logConfigFileWatchUpdate;
9728 * Create the watcher for the configFileExistenceInfo
9730 private createConfigFileWatcherOfConfigFileExistence;
9732 * Close the config file watcher in the cached ConfigFileExistenceInfo
9733 * if there arent any open files that are root of inferred project
9735 private closeConfigFileWatcherOfConfigFileExistenceInfo;
9737 * This is called on file close, so that we stop watching the config file for this script info
9739 private stopWatchingConfigFilesForClosedScriptInfo;
9741 * This function tries to search for a tsconfig.json for the given file.
9742 * This is different from the method the compiler uses because
9743 * the compiler can assume it will always start searching in the
9744 * current directory (the directory in which tsc was invoked).
9745 * The server must start searching from the directory containing
9746 * the newly opened file.
9748 private forEachConfigFileLocation;
9750 * This function tries to search for a tsconfig.json for the given file.
9751 * This is different from the method the compiler uses because
9752 * the compiler can assume it will always start searching in the
9753 * current directory (the directory in which tsc was invoked).
9754 * The server must start searching from the directory containing
9755 * the newly opened file.
9756 * If script info is passed in, it is asserted to be open script info
9757 * otherwise just file name
9759 private getConfigFileNameForFile;
9760 private printProjects;
9761 private getConfiguredProjectByCanonicalConfigFilePath;
9762 private findExternalProjectByProjectName;
9763 /** Get a filename if the language service exceeds the maximum allowed program size; otherwise returns undefined. */
9764 private getFilenameForExceededTotalSizeLimitForNonTsFiles;
9765 private createExternalProject;
9766 private addFilesToNonInferredProject;
9767 private updateNonInferredProjectFiles;
9768 private updateRootAndOptionsOfNonInferredProject;
9769 private sendConfigFileDiagEvent;
9770 private getOrCreateInferredProjectForProjectRootPathIfEnabled;
9771 private getOrCreateSingleInferredProjectIfEnabled;
9772 private getOrCreateSingleInferredWithoutProjectRoot;
9773 private createInferredProject;
9774 getScriptInfo(uncheckedFileName: string): ScriptInfo | undefined;
9775 private watchClosedScriptInfo;
9776 private watchClosedScriptInfoInNodeModules;
9777 private getModifiedTime;
9778 private refreshScriptInfo;
9779 private refreshScriptInfosInDirectory;
9780 private stopWatchingScriptInfo;
9781 private getOrCreateScriptInfoNotOpenedByClientForNormalizedPath;
9782 private getOrCreateScriptInfoOpenedByClientForNormalizedPath;
9783 getOrCreateScriptInfoForNormalizedPath(fileName: NormalizedPath, openedByClient: boolean, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, hostToQueryFileExistsOn?: {
9784 fileExists(path: string): boolean;
9785 }): ScriptInfo | undefined;
9786 private getOrCreateScriptInfoWorker;
9788 * 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
9790 getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo | undefined;
9791 getScriptInfoForPath(fileName: Path): ScriptInfo | undefined;
9792 private addSourceInfoToSourceMap;
9793 private addMissingSourceMapFile;
9794 setHostConfiguration(args: protocol.ConfigureRequestArguments): void;
9797 * This function rebuilds the project for every file opened by the client
9798 * This does not reload contents of open files from disk. But we could do that if needed
9800 reloadProjects(): void;
9801 private delayReloadConfiguredProjectForFiles;
9803 * This function goes through all the openFiles and tries to file the config file for them.
9804 * If the config file is found and it refers to existing project, it reloads it either immediately
9805 * or schedules it for reload depending on delayReload option
9806 * If the there is no existing project it just opens the configured project for the config file
9807 * reloadForInfo provides a way to filter out files to reload configured project for
9809 private reloadConfiguredProjectForFiles;
9811 * Remove the root of inferred project if script info is part of another project
9813 private removeRootOfInferredProjectIfNowPartOfOtherProject;
9815 * This function is to update the project structure for every inferred project.
9816 * It is called on the premise that all the configured projects are
9818 * This will go through open files and assign them to inferred project if open file is not part of any other project
9819 * After that all the inferred project graphs are updated
9821 private ensureProjectForOpenFiles;
9823 * Open file whose contents is managed by the client
9824 * @param filename is absolute pathname
9825 * @param fileContent is a known version of the file content that is more up to date than the one on disk
9827 openClientFile(fileName: string, fileContent?: string, scriptKind?: ScriptKind, projectRootPath?: string): OpenConfiguredProjectResult;
9828 private findExternalProjectContainingOpenScriptInfo;
9829 private getOrCreateOpenScriptInfo;
9830 private assignProjectToOpenedScriptInfo;
9831 private createAncestorProjects;
9832 private ensureProjectChildren;
9833 private cleanupAfterOpeningFile;
9834 openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult;
9835 private removeOrphanConfiguredProjects;
9836 private removeOrphanScriptInfos;
9837 private telemetryOnOpenFile;
9839 * Close file whose contents is managed by the client
9840 * @param filename is absolute pathname
9842 closeClientFile(uncheckedFileName: string): void;
9843 private collectChanges;
9844 private closeConfiguredProjectReferencedFromExternalProject;
9845 closeExternalProject(uncheckedFileName: string): void;
9846 openExternalProjects(projects: protocol.ExternalProject[]): void;
9847 /** Makes a filename safe to insert in a RegExp */
9848 private static readonly filenameEscapeRegexp;
9849 private static escapeFilenameForRegex;
9850 resetSafeList(): void;
9851 applySafeList(proj: protocol.ExternalProject): NormalizedPath[];
9852 openExternalProject(proj: protocol.ExternalProject): void;
9853 hasDeferredExtension(): boolean;
9854 configurePlugin(args: protocol.ConfigurePluginRequestArguments): void;
9858 declare namespace ts.server {
9859 interface ServerCancellationToken extends HostCancellationToken {
9860 setRequest(requestId: number): void;
9861 resetRequest(requestId: number): void;
9863 const nullCancellationToken: ServerCancellationToken;
9864 interface PendingErrorCheck {
9865 fileName: NormalizedPath;
9868 type CommandNames = protocol.CommandTypes;
9869 const CommandNames: any;
9870 function formatMessage<T extends protocol.Message>(msg: T, logger: Logger, byteLength: (s: string, encoding: string) => number, newLine: string): string;
9871 type Event = <T extends object>(body: T, eventName: string) => void;
9872 interface EventSender {
9875 interface SessionOptions {
9877 cancellationToken: ServerCancellationToken;
9878 useSingleInferredProject: boolean;
9879 useInferredProjectPerProjectRoot: boolean;
9880 typingsInstaller: ITypingsInstaller;
9881 byteLength: (buf: string, encoding?: string) => number;
9882 hrtime: (start?: number[]) => number[];
9885 * If falsy, all events are suppressed.
9887 canUseEvents: boolean;
9888 eventHandler?: ProjectServiceEventHandler;
9889 /** Has no effect if eventHandler is also specified. */
9890 suppressDiagnosticEvents?: boolean;
9891 /** @deprecated use serverMode instead */
9892 syntaxOnly?: boolean;
9893 serverMode?: LanguageServiceMode;
9894 throttleWaitMilliseconds?: number;
9895 noGetErrOnBackgroundUpdate?: boolean;
9896 globalPlugins?: readonly string[];
9897 pluginProbeLocations?: readonly string[];
9898 allowLocalPluginLoads?: boolean;
9899 typesMapLocation?: string;
9901 class Session implements EventSender {
9902 private readonly gcTimer;
9903 protected projectService: ProjectService;
9905 private performanceData;
9906 private currentRequestId;
9908 protected host: ServerHost;
9909 private readonly cancellationToken;
9910 protected readonly typingsInstaller: ITypingsInstaller;
9911 protected byteLength: (buf: string, encoding?: string) => number;
9913 protected logger: Logger;
9914 protected canUseEvents: boolean;
9915 private suppressDiagnosticEvents?;
9916 private eventHandler;
9917 private readonly noGetErrOnBackgroundUpdate?;
9918 constructor(opts: SessionOptions);
9919 private sendRequestCompletedEvent;
9920 private addPerformanceData;
9921 private performanceEventHandler;
9922 private defaultEventHandler;
9923 private projectsUpdatedInBackgroundEvent;
9924 logError(err: Error, cmd: string): void;
9925 private logErrorWorker;
9926 send(msg: protocol.Message): void;
9927 event<T extends object>(body: T, eventName: string): void;
9929 output(info: any, cmdName: string, reqSeq?: number, errorMsg?: string): void;
9931 private semanticCheck;
9932 private syntacticCheck;
9933 private suggestionCheck;
9934 private sendDiagnosticsEvent;
9935 /** It is the caller's responsibility to verify that `!this.suppressDiagnosticEvents`. */
9936 private updateErrorCheck;
9937 private cleanProjects;
9939 private getEncodedSyntacticClassifications;
9940 private getEncodedSemanticClassifications;
9942 private getConfigFileAndProject;
9943 private getConfigFileDiagnostics;
9944 private convertToDiagnosticsWithLinePositionFromDiagnosticFile;
9945 private getCompilerOptionsDiagnostics;
9946 private convertToDiagnosticsWithLinePosition;
9947 private getDiagnosticsWorker;
9948 private getDefinition;
9949 private mapDefinitionInfoLocations;
9950 private getDefinitionAndBoundSpan;
9951 private getEmitOutput;
9952 private mapDefinitionInfo;
9953 private static mapToOriginalLocation;
9955 private toFileSpanWithContext;
9956 private getTypeDefinition;
9957 private mapImplementationLocations;
9958 private getImplementation;
9959 private getOccurrences;
9960 private getSyntacticDiagnosticsSync;
9961 private getSemanticDiagnosticsSync;
9962 private getSuggestionDiagnosticsSync;
9963 private getJsxClosingTag;
9964 private getDocumentHighlights;
9965 private setCompilerOptionsForInferredProjects;
9966 private getProjectInfo;
9967 private getProjectInfoWorker;
9968 private getRenameInfo;
9969 private getProjects;
9970 private getDefaultProject;
9971 private getRenameLocations;
9972 private mapRenameInfo;
9973 private toSpanGroups;
9974 private getReferences;
9976 * @param fileName is the name of the file to be opened
9977 * @param fileContent is a version of the file content that is known to be more up to date than the one on disk
9979 private openClientFile;
9980 private getPosition;
9981 private getPositionInFile;
9982 private getFileAndProject;
9983 private getFileAndLanguageServiceForSyntacticOperation;
9984 private getFileAndProjectWorker;
9985 private getOutliningSpans;
9986 private getTodoComments;
9987 private getDocCommentTemplate;
9988 private getSpanOfEnclosingComment;
9989 private getIndentation;
9990 private getBreakpointStatement;
9991 private getNameOrDottedNameSpan;
9992 private isValidBraceCompletion;
9993 private getQuickInfoWorker;
9994 private getFormattingEditsForRange;
9995 private getFormattingEditsForRangeFull;
9996 private getFormattingEditsForDocumentFull;
9997 private getFormattingEditsAfterKeystrokeFull;
9998 private getFormattingEditsAfterKeystroke;
9999 private getCompletions;
10000 private getCompletionEntryDetails;
10001 private getCompileOnSaveAffectedFileList;
10003 private getSignatureHelpItems;
10004 private toPendingErrorCheck;
10005 private getDiagnostics;
10009 private closeClientFile;
10010 private mapLocationNavigationBarItems;
10011 private getNavigationBarItems;
10012 private toLocationNavigationTree;
10013 private getNavigationTree;
10014 private getNavigateToItems;
10015 private getFullNavigateToItems;
10016 private getSupportedCodeFixes;
10017 private isLocation;
10018 private extractPositionOrRange;
10020 private getApplicableRefactors;
10021 private getEditsForRefactor;
10022 private organizeImports;
10023 private getEditsForFileRename;
10024 private getCodeFixes;
10025 private getCombinedCodeFix;
10026 private applyCodeActionCommand;
10027 private getStartAndEndPosition;
10028 private mapCodeAction;
10029 private mapCodeFixAction;
10030 private mapTextChangesToCodeEdits;
10031 private mapTextChangeToCodeEdit;
10032 private convertTextChangeToCodeEdit;
10033 private getBraceMatching;
10034 private getDiagnosticsForProject;
10035 private configurePlugin;
10036 private getSmartSelectionRange;
10037 private toggleLineComment;
10038 private toggleMultilineComment;
10039 private commentSelection;
10040 private uncommentSelection;
10041 private mapSelectionRange;
10042 private getScriptInfoFromProjectService;
10043 private toProtocolCallHierarchyItem;
10044 private toProtocolCallHierarchyIncomingCall;
10045 private toProtocolCallHierarchyOutgoingCall;
10046 private prepareCallHierarchy;
10047 private provideCallHierarchyIncomingCalls;
10048 private provideCallHierarchyOutgoingCalls;
10049 getCanonicalFileName(fileName: string): string;
10051 private notRequired;
10052 private requiredResponse;
10054 addProtocolHandler(command: string, handler: (request: protocol.Request) => HandlerResponse): void;
10055 private setCurrentRequest;
10056 private resetCurrentRequest;
10057 executeWithRequestId<T>(requestId: number, f: () => T): T;
10058 executeCommand(request: protocol.Request): HandlerResponse;
10059 onMessage(message: string): void;
10060 private getFormatOptions;
10061 private getPreferences;
10062 private getHostFormatOptions;
10063 private getHostPreferences;
10065 interface HandlerResponse {
10067 responseRequired?: boolean;
10070 declare namespace ts {
10071 /** @deprecated Use `factory.createNodeArray` or the factory supplied by your transformation context instead. */
10072 const createNodeArray: <T extends Node>(elements?: readonly T[] | undefined, hasTrailingComma?: boolean | undefined) => NodeArray<T>;
10073 /** @deprecated Use `factory.createNumericLiteral` or the factory supplied by your transformation context instead. */
10074 const createNumericLiteral: (value: string | number, numericLiteralFlags?: TokenFlags | undefined) => NumericLiteral;
10075 /** @deprecated Use `factory.createBigIntLiteral` or the factory supplied by your transformation context instead. */
10076 const createBigIntLiteral: (value: string | PseudoBigInt) => BigIntLiteral;
10077 /** @deprecated Use `factory.createStringLiteral` or the factory supplied by your transformation context instead. */
10078 const createStringLiteral: {
10079 (text: string, isSingleQuote?: boolean | undefined): StringLiteral;
10080 (text: string, isSingleQuote?: boolean | undefined, hasExtendedUnicodeEscape?: boolean | undefined): StringLiteral;
10082 /** @deprecated Use `factory.createStringLiteralFromNode` or the factory supplied by your transformation context instead. */
10083 const createStringLiteralFromNode: (sourceNode: Identifier | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral, isSingleQuote?: boolean | undefined) => StringLiteral;
10084 /** @deprecated Use `factory.createRegularExpressionLiteral` or the factory supplied by your transformation context instead. */
10085 const createRegularExpressionLiteral: (text: string) => RegularExpressionLiteral;
10086 /** @deprecated Use `factory.createLoopVariable` or the factory supplied by your transformation context instead. */
10087 const createLoopVariable: () => Identifier;
10088 /** @deprecated Use `factory.createUniqueName` or the factory supplied by your transformation context instead. */
10089 const createUniqueName: (text: string, flags?: GeneratedIdentifierFlags | undefined) => Identifier;
10090 /** @deprecated Use `factory.createPrivateIdentifier` or the factory supplied by your transformation context instead. */
10091 const createPrivateIdentifier: (text: string) => PrivateIdentifier;
10092 /** @deprecated Use `factory.createSuper` or the factory supplied by your transformation context instead. */
10093 const createSuper: () => SuperExpression;
10094 /** @deprecated Use `factory.createThis` or the factory supplied by your transformation context instead. */
10095 const createThis: () => ThisExpression;
10096 /** @deprecated Use `factory.createNull` or the factory supplied by your transformation context instead. */
10097 const createNull: () => NullLiteral;
10098 /** @deprecated Use `factory.createTrue` or the factory supplied by your transformation context instead. */
10099 const createTrue: () => TrueLiteral;
10100 /** @deprecated Use `factory.createFalse` or the factory supplied by your transformation context instead. */
10101 const createFalse: () => FalseLiteral;
10102 /** @deprecated Use `factory.createModifier` or the factory supplied by your transformation context instead. */
10103 const createModifier: <T extends ModifierSyntaxKind>(kind: T) => ModifierToken<T>;
10104 /** @deprecated Use `factory.createModifiersFromModifierFlags` or the factory supplied by your transformation context instead. */
10105 const createModifiersFromModifierFlags: (flags: ModifierFlags) => Modifier[];
10106 /** @deprecated Use `factory.createQualifiedName` or the factory supplied by your transformation context instead. */
10107 const createQualifiedName: (left: EntityName, right: string | Identifier) => QualifiedName;
10108 /** @deprecated Use `factory.updateQualifiedName` or the factory supplied by your transformation context instead. */
10109 const updateQualifiedName: (node: QualifiedName, left: EntityName, right: Identifier) => QualifiedName;
10110 /** @deprecated Use `factory.createComputedPropertyName` or the factory supplied by your transformation context instead. */
10111 const createComputedPropertyName: (expression: Expression) => ComputedPropertyName;
10112 /** @deprecated Use `factory.updateComputedPropertyName` or the factory supplied by your transformation context instead. */
10113 const updateComputedPropertyName: (node: ComputedPropertyName, expression: Expression) => ComputedPropertyName;
10114 /** @deprecated Use `factory.createTypeParameterDeclaration` or the factory supplied by your transformation context instead. */
10115 const createTypeParameterDeclaration: (name: string | Identifier, constraint?: TypeNode | undefined, defaultType?: TypeNode | undefined) => TypeParameterDeclaration;
10116 /** @deprecated Use `factory.updateTypeParameterDeclaration` or the factory supplied by your transformation context instead. */
10117 const updateTypeParameterDeclaration: (node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined) => TypeParameterDeclaration;
10118 /** @deprecated Use `factory.createParameterDeclaration` or the factory supplied by your transformation context instead. */
10119 const createParameter: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | Identifier | ObjectBindingPattern | ArrayBindingPattern, questionToken?: QuestionToken | undefined, type?: TypeNode | undefined, initializer?: Expression | undefined) => ParameterDeclaration;
10120 /** @deprecated Use `factory.updateParameterDeclaration` or the factory supplied by your transformation context instead. */
10121 const updateParameter: (node: ParameterDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | Identifier | ObjectBindingPattern | ArrayBindingPattern, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined) => ParameterDeclaration;
10122 /** @deprecated Use `factory.createDecorator` or the factory supplied by your transformation context instead. */
10123 const createDecorator: (expression: Expression) => Decorator;
10124 /** @deprecated Use `factory.updateDecorator` or the factory supplied by your transformation context instead. */
10125 const updateDecorator: (node: Decorator, expression: Expression) => Decorator;
10126 /** @deprecated Use `factory.createPropertyDeclaration` or the factory supplied by your transformation context instead. */
10127 const createProperty: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined) => PropertyDeclaration;
10128 /** @deprecated Use `factory.updatePropertyDeclaration` or the factory supplied by your transformation context instead. */
10129 const updateProperty: (node: PropertyDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined) => PropertyDeclaration;
10130 /** @deprecated Use `factory.createMethodDeclaration` or the factory supplied by your transformation context instead. */
10131 const createMethod: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => MethodDeclaration;
10132 /** @deprecated Use `factory.updateMethodDeclaration` or the factory supplied by your transformation context instead. */
10133 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;
10134 /** @deprecated Use `factory.createConstructorDeclaration` or the factory supplied by your transformation context instead. */
10135 const createConstructor: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined) => ConstructorDeclaration;
10136 /** @deprecated Use `factory.updateConstructorDeclaration` or the factory supplied by your transformation context instead. */
10137 const updateConstructor: (node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined) => ConstructorDeclaration;
10138 /** @deprecated Use `factory.createGetAccessorDeclaration` or the factory supplied by your transformation context instead. */
10139 const createGetAccessor: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => GetAccessorDeclaration;
10140 /** @deprecated Use `factory.updateGetAccessorDeclaration` or the factory supplied by your transformation context instead. */
10141 const updateGetAccessor: (node: GetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => GetAccessorDeclaration;
10142 /** @deprecated Use `factory.createSetAccessorDeclaration` or the factory supplied by your transformation context instead. */
10143 const createSetAccessor: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier, parameters: readonly ParameterDeclaration[], body: Block | undefined) => SetAccessorDeclaration;
10144 /** @deprecated Use `factory.updateSetAccessorDeclaration` or the factory supplied by your transformation context instead. */
10145 const updateSetAccessor: (node: SetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined) => SetAccessorDeclaration;
10146 /** @deprecated Use `factory.createCallSignature` or the factory supplied by your transformation context instead. */
10147 const createCallSignature: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined) => CallSignatureDeclaration;
10148 /** @deprecated Use `factory.updateCallSignature` or the factory supplied by your transformation context instead. */
10149 const updateCallSignature: (node: CallSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined) => CallSignatureDeclaration;
10150 /** @deprecated Use `factory.createConstructSignature` or the factory supplied by your transformation context instead. */
10151 const createConstructSignature: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined) => ConstructSignatureDeclaration;
10152 /** @deprecated Use `factory.updateConstructSignature` or the factory supplied by your transformation context instead. */
10153 const updateConstructSignature: (node: ConstructSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined) => ConstructSignatureDeclaration;
10154 /** @deprecated Use `factory.updateIndexSignature` or the factory supplied by your transformation context instead. */
10155 const updateIndexSignature: (node: IndexSignatureDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => IndexSignatureDeclaration;
10156 /** @deprecated Use `factory.createKeywordTypeNode` or the factory supplied by your transformation context instead. */
10157 const createKeywordTypeNode: <TKind extends KeywordTypeSyntaxKind>(kind: TKind) => KeywordTypeNode<TKind>;
10158 /** @deprecated Use `factory.createTypePredicateNode` or the factory supplied by your transformation context instead. */
10159 const createTypePredicateNodeWithModifier: (assertsModifier: AssertsKeyword | undefined, parameterName: string | Identifier | ThisTypeNode, type: TypeNode | undefined) => TypePredicateNode;
10160 /** @deprecated Use `factory.updateTypePredicateNode` or the factory supplied by your transformation context instead. */
10161 const updateTypePredicateNodeWithModifier: (node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined) => TypePredicateNode;
10162 /** @deprecated Use `factory.createTypeReferenceNode` or the factory supplied by your transformation context instead. */
10163 const createTypeReferenceNode: (typeName: string | Identifier | QualifiedName, typeArguments?: readonly TypeNode[] | undefined) => TypeReferenceNode;
10164 /** @deprecated Use `factory.updateTypeReferenceNode` or the factory supplied by your transformation context instead. */
10165 const updateTypeReferenceNode: (node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray<TypeNode> | undefined) => TypeReferenceNode;
10166 /** @deprecated Use `factory.createFunctionTypeNode` or the factory supplied by your transformation context instead. */
10167 const createFunctionTypeNode: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => FunctionTypeNode;
10168 /** @deprecated Use `factory.updateFunctionTypeNode` or the factory supplied by your transformation context instead. */
10169 const updateFunctionTypeNode: (node: FunctionTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode) => FunctionTypeNode;
10170 /** @deprecated Use `factory.createConstructorTypeNode` or the factory supplied by your transformation context instead. */
10171 const createConstructorTypeNode: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => ConstructorTypeNode;
10172 /** @deprecated Use `factory.updateConstructorTypeNode` or the factory supplied by your transformation context instead. */
10173 const updateConstructorTypeNode: (node: ConstructorTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode) => ConstructorTypeNode;
10174 /** @deprecated Use `factory.createTypeQueryNode` or the factory supplied by your transformation context instead. */
10175 const createTypeQueryNode: (exprName: EntityName) => TypeQueryNode;
10176 /** @deprecated Use `factory.updateTypeQueryNode` or the factory supplied by your transformation context instead. */
10177 const updateTypeQueryNode: (node: TypeQueryNode, exprName: EntityName) => TypeQueryNode;
10178 /** @deprecated Use `factory.createTypeLiteralNode` or the factory supplied by your transformation context instead. */
10179 const createTypeLiteralNode: (members: readonly TypeElement[] | undefined) => TypeLiteralNode;
10180 /** @deprecated Use `factory.updateTypeLiteralNode` or the factory supplied by your transformation context instead. */
10181 const updateTypeLiteralNode: (node: TypeLiteralNode, members: NodeArray<TypeElement>) => TypeLiteralNode;
10182 /** @deprecated Use `factory.createArrayTypeNode` or the factory supplied by your transformation context instead. */
10183 const createArrayTypeNode: (elementType: TypeNode) => ArrayTypeNode;
10184 /** @deprecated Use `factory.updateArrayTypeNode` or the factory supplied by your transformation context instead. */
10185 const updateArrayTypeNode: (node: ArrayTypeNode, elementType: TypeNode) => ArrayTypeNode;
10186 /** @deprecated Use `factory.createTupleTypeNode` or the factory supplied by your transformation context instead. */
10187 const createTupleTypeNode: (elements: readonly (TypeNode | NamedTupleMember)[]) => TupleTypeNode;
10188 /** @deprecated Use `factory.updateTupleTypeNode` or the factory supplied by your transformation context instead. */
10189 const updateTupleTypeNode: (node: TupleTypeNode, elements: readonly (TypeNode | NamedTupleMember)[]) => TupleTypeNode;
10190 /** @deprecated Use `factory.createOptionalTypeNode` or the factory supplied by your transformation context instead. */
10191 const createOptionalTypeNode: (type: TypeNode) => OptionalTypeNode;
10192 /** @deprecated Use `factory.updateOptionalTypeNode` or the factory supplied by your transformation context instead. */
10193 const updateOptionalTypeNode: (node: OptionalTypeNode, type: TypeNode) => OptionalTypeNode;
10194 /** @deprecated Use `factory.createRestTypeNode` or the factory supplied by your transformation context instead. */
10195 const createRestTypeNode: (type: TypeNode) => RestTypeNode;
10196 /** @deprecated Use `factory.updateRestTypeNode` or the factory supplied by your transformation context instead. */
10197 const updateRestTypeNode: (node: RestTypeNode, type: TypeNode) => RestTypeNode;
10198 /** @deprecated Use `factory.createUnionTypeNode` or the factory supplied by your transformation context instead. */
10199 const createUnionTypeNode: (types: readonly TypeNode[]) => UnionTypeNode;
10200 /** @deprecated Use `factory.updateUnionTypeNode` or the factory supplied by your transformation context instead. */
10201 const updateUnionTypeNode: (node: UnionTypeNode, types: NodeArray<TypeNode>) => UnionTypeNode;
10202 /** @deprecated Use `factory.createIntersectionTypeNode` or the factory supplied by your transformation context instead. */
10203 const createIntersectionTypeNode: (types: readonly TypeNode[]) => IntersectionTypeNode;
10204 /** @deprecated Use `factory.updateIntersectionTypeNode` or the factory supplied by your transformation context instead. */
10205 const updateIntersectionTypeNode: (node: IntersectionTypeNode, types: NodeArray<TypeNode>) => IntersectionTypeNode;
10206 /** @deprecated Use `factory.createConditionalTypeNode` or the factory supplied by your transformation context instead. */
10207 const createConditionalTypeNode: (checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode) => ConditionalTypeNode;
10208 /** @deprecated Use `factory.updateConditionalTypeNode` or the factory supplied by your transformation context instead. */
10209 const updateConditionalTypeNode: (node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode) => ConditionalTypeNode;
10210 /** @deprecated Use `factory.createInferTypeNode` or the factory supplied by your transformation context instead. */
10211 const createInferTypeNode: (typeParameter: TypeParameterDeclaration) => InferTypeNode;
10212 /** @deprecated Use `factory.updateInferTypeNode` or the factory supplied by your transformation context instead. */
10213 const updateInferTypeNode: (node: InferTypeNode, typeParameter: TypeParameterDeclaration) => InferTypeNode;
10214 /** @deprecated Use `factory.createImportTypeNode` or the factory supplied by your transformation context instead. */
10215 const createImportTypeNode: (argument: TypeNode, qualifier?: Identifier | QualifiedName | undefined, typeArguments?: readonly TypeNode[] | undefined, isTypeOf?: boolean | undefined) => ImportTypeNode;
10216 /** @deprecated Use `factory.updateImportTypeNode` or the factory supplied by your transformation context instead. */
10217 const updateImportTypeNode: (node: ImportTypeNode, argument: TypeNode, qualifier: Identifier | QualifiedName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf?: boolean | undefined) => ImportTypeNode;
10218 /** @deprecated Use `factory.createParenthesizedType` or the factory supplied by your transformation context instead. */
10219 const createParenthesizedType: (type: TypeNode) => ParenthesizedTypeNode;
10220 /** @deprecated Use `factory.updateParenthesizedType` or the factory supplied by your transformation context instead. */
10221 const updateParenthesizedType: (node: ParenthesizedTypeNode, type: TypeNode) => ParenthesizedTypeNode;
10222 /** @deprecated Use `factory.createThisTypeNode` or the factory supplied by your transformation context instead. */
10223 const createThisTypeNode: () => ThisTypeNode;
10224 /** @deprecated Use `factory.updateTypeOperatorNode` or the factory supplied by your transformation context instead. */
10225 const updateTypeOperatorNode: (node: TypeOperatorNode, type: TypeNode) => TypeOperatorNode;
10226 /** @deprecated Use `factory.createIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */
10227 const createIndexedAccessTypeNode: (objectType: TypeNode, indexType: TypeNode) => IndexedAccessTypeNode;
10228 /** @deprecated Use `factory.updateIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */
10229 const updateIndexedAccessTypeNode: (node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode) => IndexedAccessTypeNode;
10230 /** @deprecated Use `factory.createMappedTypeNode` or the factory supplied by your transformation context instead. */
10231 const createMappedTypeNode: (readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined) => MappedTypeNode;
10232 /** @deprecated Use `factory.updateMappedTypeNode` or the factory supplied by your transformation context instead. */
10233 const updateMappedTypeNode: (node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined) => MappedTypeNode;
10234 /** @deprecated Use `factory.createLiteralTypeNode` or the factory supplied by your transformation context instead. */
10235 const createLiteralTypeNode: (literal: LiteralExpression | TrueLiteral | FalseLiteral | PrefixUnaryExpression | NullLiteral) => LiteralTypeNode;
10236 /** @deprecated Use `factory.updateLiteralTypeNode` or the factory supplied by your transformation context instead. */
10237 const updateLiteralTypeNode: (node: LiteralTypeNode, literal: LiteralExpression | TrueLiteral | FalseLiteral | PrefixUnaryExpression | NullLiteral) => LiteralTypeNode;
10238 /** @deprecated Use `factory.createObjectBindingPattern` or the factory supplied by your transformation context instead. */
10239 const createObjectBindingPattern: (elements: readonly BindingElement[]) => ObjectBindingPattern;
10240 /** @deprecated Use `factory.updateObjectBindingPattern` or the factory supplied by your transformation context instead. */
10241 const updateObjectBindingPattern: (node: ObjectBindingPattern, elements: readonly BindingElement[]) => ObjectBindingPattern;
10242 /** @deprecated Use `factory.createArrayBindingPattern` or the factory supplied by your transformation context instead. */
10243 const createArrayBindingPattern: (elements: readonly ArrayBindingElement[]) => ArrayBindingPattern;
10244 /** @deprecated Use `factory.updateArrayBindingPattern` or the factory supplied by your transformation context instead. */
10245 const updateArrayBindingPattern: (node: ArrayBindingPattern, elements: readonly ArrayBindingElement[]) => ArrayBindingPattern;
10246 /** @deprecated Use `factory.createBindingElement` or the factory supplied by your transformation context instead. */
10247 const createBindingElement: (dotDotDotToken: DotDotDotToken | undefined, propertyName: string | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier | undefined, name: string | Identifier | ObjectBindingPattern | ArrayBindingPattern, initializer?: Expression | undefined) => BindingElement;
10248 /** @deprecated Use `factory.updateBindingElement` or the factory supplied by your transformation context instead. */
10249 const updateBindingElement: (node: BindingElement, dotDotDotToken: DotDotDotToken | undefined, propertyName: Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier | undefined, name: BindingName, initializer: Expression | undefined) => BindingElement;
10250 /** @deprecated Use `factory.createArrayLiteral` or the factory supplied by your transformation context instead. */
10251 const createArrayLiteral: (elements?: readonly Expression[] | undefined, multiLine?: boolean | undefined) => ArrayLiteralExpression;
10252 /** @deprecated Use `factory.updateArrayLiteral` or the factory supplied by your transformation context instead. */
10253 const updateArrayLiteral: (node: ArrayLiteralExpression, elements: readonly Expression[]) => ArrayLiteralExpression;
10254 /** @deprecated Use `factory.createObjectLiteral` or the factory supplied by your transformation context instead. */
10255 const createObjectLiteral: (properties?: readonly ObjectLiteralElementLike[] | undefined, multiLine?: boolean | undefined) => ObjectLiteralExpression;
10256 /** @deprecated Use `factory.updateObjectLiteral` or the factory supplied by your transformation context instead. */
10257 const updateObjectLiteral: (node: ObjectLiteralExpression, properties: readonly ObjectLiteralElementLike[]) => ObjectLiteralExpression;
10258 /** @deprecated Use `factory.createPropertyAccess` or the factory supplied by your transformation context instead. */
10259 const createPropertyAccess: (expression: Expression, name: string | Identifier | PrivateIdentifier) => PropertyAccessExpression;
10260 /** @deprecated Use `factory.updatePropertyAccess` or the factory supplied by your transformation context instead. */
10261 const updatePropertyAccess: (node: PropertyAccessExpression, expression: Expression, name: Identifier | PrivateIdentifier) => PropertyAccessExpression;
10262 /** @deprecated Use `factory.createPropertyAccessChain` or the factory supplied by your transformation context instead. */
10263 const createPropertyAccessChain: (expression: Expression, questionDotToken: QuestionDotToken | undefined, name: string | Identifier | PrivateIdentifier) => PropertyAccessChain;
10264 /** @deprecated Use `factory.updatePropertyAccessChain` or the factory supplied by your transformation context instead. */
10265 const updatePropertyAccessChain: (node: PropertyAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, name: Identifier | PrivateIdentifier) => PropertyAccessChain;
10266 /** @deprecated Use `factory.createElementAccess` or the factory supplied by your transformation context instead. */
10267 const createElementAccess: (expression: Expression, index: number | Expression) => ElementAccessExpression;
10268 /** @deprecated Use `factory.updateElementAccess` or the factory supplied by your transformation context instead. */
10269 const updateElementAccess: (node: ElementAccessExpression, expression: Expression, argumentExpression: Expression) => ElementAccessExpression;
10270 /** @deprecated Use `factory.createElementAccessChain` or the factory supplied by your transformation context instead. */
10271 const createElementAccessChain: (expression: Expression, questionDotToken: QuestionDotToken | undefined, index: number | Expression) => ElementAccessChain;
10272 /** @deprecated Use `factory.updateElementAccessChain` or the factory supplied by your transformation context instead. */
10273 const updateElementAccessChain: (node: ElementAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, argumentExpression: Expression) => ElementAccessChain;
10274 /** @deprecated Use `factory.createCall` or the factory supplied by your transformation context instead. */
10275 const createCall: (expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => CallExpression;
10276 /** @deprecated Use `factory.updateCall` or the factory supplied by your transformation context instead. */
10277 const updateCall: (node: CallExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]) => CallExpression;
10278 /** @deprecated Use `factory.createCallChain` or the factory supplied by your transformation context instead. */
10279 const createCallChain: (expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => CallChain;
10280 /** @deprecated Use `factory.updateCallChain` or the factory supplied by your transformation context instead. */
10281 const updateCallChain: (node: CallChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]) => CallChain;
10282 /** @deprecated Use `factory.createNew` or the factory supplied by your transformation context instead. */
10283 const createNew: (expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => NewExpression;
10284 /** @deprecated Use `factory.updateNew` or the factory supplied by your transformation context instead. */
10285 const updateNew: (node: NewExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => NewExpression;
10286 /** @deprecated Use `factory.createTypeAssertion` or the factory supplied by your transformation context instead. */
10287 const createTypeAssertion: (type: TypeNode, expression: Expression) => TypeAssertion;
10288 /** @deprecated Use `factory.updateTypeAssertion` or the factory supplied by your transformation context instead. */
10289 const updateTypeAssertion: (node: TypeAssertion, type: TypeNode, expression: Expression) => TypeAssertion;
10290 /** @deprecated Use `factory.createParen` or the factory supplied by your transformation context instead. */
10291 const createParen: (expression: Expression) => ParenthesizedExpression;
10292 /** @deprecated Use `factory.updateParen` or the factory supplied by your transformation context instead. */
10293 const updateParen: (node: ParenthesizedExpression, expression: Expression) => ParenthesizedExpression;
10294 /** @deprecated Use `factory.createFunctionExpression` or the factory supplied by your transformation context instead. */
10295 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;
10296 /** @deprecated Use `factory.updateFunctionExpression` or the factory supplied by your transformation context instead. */
10297 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;
10298 /** @deprecated Use `factory.createDelete` or the factory supplied by your transformation context instead. */
10299 const createDelete: (expression: Expression) => DeleteExpression;
10300 /** @deprecated Use `factory.updateDelete` or the factory supplied by your transformation context instead. */
10301 const updateDelete: (node: DeleteExpression, expression: Expression) => DeleteExpression;
10302 /** @deprecated Use `factory.createTypeOf` or the factory supplied by your transformation context instead. */
10303 const createTypeOf: (expression: Expression) => TypeOfExpression;
10304 /** @deprecated Use `factory.updateTypeOf` or the factory supplied by your transformation context instead. */
10305 const updateTypeOf: (node: TypeOfExpression, expression: Expression) => TypeOfExpression;
10306 /** @deprecated Use `factory.createVoid` or the factory supplied by your transformation context instead. */
10307 const createVoid: (expression: Expression) => VoidExpression;
10308 /** @deprecated Use `factory.updateVoid` or the factory supplied by your transformation context instead. */
10309 const updateVoid: (node: VoidExpression, expression: Expression) => VoidExpression;
10310 /** @deprecated Use `factory.createAwait` or the factory supplied by your transformation context instead. */
10311 const createAwait: (expression: Expression) => AwaitExpression;
10312 /** @deprecated Use `factory.updateAwait` or the factory supplied by your transformation context instead. */
10313 const updateAwait: (node: AwaitExpression, expression: Expression) => AwaitExpression;
10314 /** @deprecated Use `factory.createPrefix` or the factory supplied by your transformation context instead. */
10315 const createPrefix: (operator: PrefixUnaryOperator, operand: Expression) => PrefixUnaryExpression;
10316 /** @deprecated Use `factory.updatePrefix` or the factory supplied by your transformation context instead. */
10317 const updatePrefix: (node: PrefixUnaryExpression, operand: Expression) => PrefixUnaryExpression;
10318 /** @deprecated Use `factory.createPostfix` or the factory supplied by your transformation context instead. */
10319 const createPostfix: (operand: Expression, operator: PostfixUnaryOperator) => PostfixUnaryExpression;
10320 /** @deprecated Use `factory.updatePostfix` or the factory supplied by your transformation context instead. */
10321 const updatePostfix: (node: PostfixUnaryExpression, operand: Expression) => PostfixUnaryExpression;
10322 /** @deprecated Use `factory.createBinary` or the factory supplied by your transformation context instead. */
10323 const createBinary: (left: Expression, operator: SyntaxKind.CommaToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | 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.BarBarEqualsToken | SyntaxKind.AmpersandAmpersandEqualsToken | SyntaxKind.QuestionQuestionEqualsToken | SyntaxKind.CaretEqualsToken | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | BinaryOperatorToken, right: Expression) => BinaryExpression;
10324 /** @deprecated Use `factory.updateConditional` or the factory supplied by your transformation context instead. */
10325 const updateConditional: (node: ConditionalExpression, condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression) => ConditionalExpression;
10326 /** @deprecated Use `factory.createTemplateExpression` or the factory supplied by your transformation context instead. */
10327 const createTemplateExpression: (head: TemplateHead, templateSpans: readonly TemplateSpan[]) => TemplateExpression;
10328 /** @deprecated Use `factory.updateTemplateExpression` or the factory supplied by your transformation context instead. */
10329 const updateTemplateExpression: (node: TemplateExpression, head: TemplateHead, templateSpans: readonly TemplateSpan[]) => TemplateExpression;
10330 /** @deprecated Use `factory.createTemplateHead` or the factory supplied by your transformation context instead. */
10331 const createTemplateHead: {
10332 (text: string, rawText?: string | undefined, templateFlags?: TokenFlags | undefined): TemplateHead;
10333 (text: string | undefined, rawText: string, templateFlags?: TokenFlags | undefined): TemplateHead;
10335 /** @deprecated Use `factory.createTemplateMiddle` or the factory supplied by your transformation context instead. */
10336 const createTemplateMiddle: {
10337 (text: string, rawText?: string | undefined, templateFlags?: TokenFlags | undefined): TemplateMiddle;
10338 (text: string | undefined, rawText: string, templateFlags?: TokenFlags | undefined): TemplateMiddle;
10340 /** @deprecated Use `factory.createTemplateTail` or the factory supplied by your transformation context instead. */
10341 const createTemplateTail: {
10342 (text: string, rawText?: string | undefined, templateFlags?: TokenFlags | undefined): TemplateTail;
10343 (text: string | undefined, rawText: string, templateFlags?: TokenFlags | undefined): TemplateTail;
10345 /** @deprecated Use `factory.createNoSubstitutionTemplateLiteral` or the factory supplied by your transformation context instead. */
10346 const createNoSubstitutionTemplateLiteral: {
10347 (text: string, rawText?: string | undefined): NoSubstitutionTemplateLiteral;
10348 (text: string | undefined, rawText: string): NoSubstitutionTemplateLiteral;
10350 /** @deprecated Use `factory.updateYield` or the factory supplied by your transformation context instead. */
10351 const updateYield: (node: YieldExpression, asteriskToken: AsteriskToken | undefined, expression: Expression | undefined) => YieldExpression;
10352 /** @deprecated Use `factory.createSpread` or the factory supplied by your transformation context instead. */
10353 const createSpread: (expression: Expression) => SpreadElement;
10354 /** @deprecated Use `factory.updateSpread` or the factory supplied by your transformation context instead. */
10355 const updateSpread: (node: SpreadElement, expression: Expression) => SpreadElement;
10356 /** @deprecated Use `factory.createOmittedExpression` or the factory supplied by your transformation context instead. */
10357 const createOmittedExpression: () => OmittedExpression;
10358 /** @deprecated Use `factory.createAsExpression` or the factory supplied by your transformation context instead. */
10359 const createAsExpression: (expression: Expression, type: TypeNode) => AsExpression;
10360 /** @deprecated Use `factory.updateAsExpression` or the factory supplied by your transformation context instead. */
10361 const updateAsExpression: (node: AsExpression, expression: Expression, type: TypeNode) => AsExpression;
10362 /** @deprecated Use `factory.createNonNullExpression` or the factory supplied by your transformation context instead. */
10363 const createNonNullExpression: (expression: Expression) => NonNullExpression;
10364 /** @deprecated Use `factory.updateNonNullExpression` or the factory supplied by your transformation context instead. */
10365 const updateNonNullExpression: (node: NonNullExpression, expression: Expression) => NonNullExpression;
10366 /** @deprecated Use `factory.createNonNullChain` or the factory supplied by your transformation context instead. */
10367 const createNonNullChain: (expression: Expression) => NonNullChain;
10368 /** @deprecated Use `factory.updateNonNullChain` or the factory supplied by your transformation context instead. */
10369 const updateNonNullChain: (node: NonNullChain, expression: Expression) => NonNullChain;
10370 /** @deprecated Use `factory.createMetaProperty` or the factory supplied by your transformation context instead. */
10371 const createMetaProperty: (keywordToken: SyntaxKind.ImportKeyword | SyntaxKind.NewKeyword, name: Identifier) => MetaProperty;
10372 /** @deprecated Use `factory.updateMetaProperty` or the factory supplied by your transformation context instead. */
10373 const updateMetaProperty: (node: MetaProperty, name: Identifier) => MetaProperty;
10374 /** @deprecated Use `factory.createTemplateSpan` or the factory supplied by your transformation context instead. */
10375 const createTemplateSpan: (expression: Expression, literal: TemplateMiddle | TemplateTail) => TemplateSpan;
10376 /** @deprecated Use `factory.updateTemplateSpan` or the factory supplied by your transformation context instead. */
10377 const updateTemplateSpan: (node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail) => TemplateSpan;
10378 /** @deprecated Use `factory.createSemicolonClassElement` or the factory supplied by your transformation context instead. */
10379 const createSemicolonClassElement: () => SemicolonClassElement;
10380 /** @deprecated Use `factory.createBlock` or the factory supplied by your transformation context instead. */
10381 const createBlock: (statements: readonly Statement[], multiLine?: boolean | undefined) => Block;
10382 /** @deprecated Use `factory.updateBlock` or the factory supplied by your transformation context instead. */
10383 const updateBlock: (node: Block, statements: readonly Statement[]) => Block;
10384 /** @deprecated Use `factory.createVariableStatement` or the factory supplied by your transformation context instead. */
10385 const createVariableStatement: (modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList | readonly VariableDeclaration[]) => VariableStatement;
10386 /** @deprecated Use `factory.updateVariableStatement` or the factory supplied by your transformation context instead. */
10387 const updateVariableStatement: (node: VariableStatement, modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList) => VariableStatement;
10388 /** @deprecated Use `factory.createEmptyStatement` or the factory supplied by your transformation context instead. */
10389 const createEmptyStatement: () => EmptyStatement;
10390 /** @deprecated Use `factory.createExpressionStatement` or the factory supplied by your transformation context instead. */
10391 const createExpressionStatement: (expression: Expression) => ExpressionStatement;
10392 /** @deprecated Use `factory.updateExpressionStatement` or the factory supplied by your transformation context instead. */
10393 const updateExpressionStatement: (node: ExpressionStatement, expression: Expression) => ExpressionStatement;
10394 /** @deprecated Use `factory.createExpressionStatement` or the factory supplied by your transformation context instead. */
10395 const createStatement: (expression: Expression) => ExpressionStatement;
10396 /** @deprecated Use `factory.updateExpressionStatement` or the factory supplied by your transformation context instead. */
10397 const updateStatement: (node: ExpressionStatement, expression: Expression) => ExpressionStatement;
10398 /** @deprecated Use `factory.createIf` or the factory supplied by your transformation context instead. */
10399 const createIf: (expression: Expression, thenStatement: Statement, elseStatement?: Statement | undefined) => IfStatement;
10400 /** @deprecated Use `factory.updateIf` or the factory supplied by your transformation context instead. */
10401 const updateIf: (node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement | undefined) => IfStatement;
10402 /** @deprecated Use `factory.createDo` or the factory supplied by your transformation context instead. */
10403 const createDo: (statement: Statement, expression: Expression) => DoStatement;
10404 /** @deprecated Use `factory.updateDo` or the factory supplied by your transformation context instead. */
10405 const updateDo: (node: DoStatement, statement: Statement, expression: Expression) => DoStatement;
10406 /** @deprecated Use `factory.createWhile` or the factory supplied by your transformation context instead. */
10407 const createWhile: (expression: Expression, statement: Statement) => WhileStatement;
10408 /** @deprecated Use `factory.updateWhile` or the factory supplied by your transformation context instead. */
10409 const updateWhile: (node: WhileStatement, expression: Expression, statement: Statement) => WhileStatement;
10410 /** @deprecated Use `factory.createFor` or the factory supplied by your transformation context instead. */
10411 const createFor: (initializer: Expression | VariableDeclarationList | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement) => ForStatement;
10412 /** @deprecated Use `factory.updateFor` or the factory supplied by your transformation context instead. */
10413 const updateFor: (node: ForStatement, initializer: Expression | VariableDeclarationList | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement) => ForStatement;
10414 /** @deprecated Use `factory.createForIn` or the factory supplied by your transformation context instead. */
10415 const createForIn: (initializer: ForInitializer, expression: Expression, statement: Statement) => ForInStatement;
10416 /** @deprecated Use `factory.updateForIn` or the factory supplied by your transformation context instead. */
10417 const updateForIn: (node: ForInStatement, initializer: ForInitializer, expression: Expression, statement: Statement) => ForInStatement;
10418 /** @deprecated Use `factory.createForOf` or the factory supplied by your transformation context instead. */
10419 const createForOf: (awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement) => ForOfStatement;
10420 /** @deprecated Use `factory.updateForOf` or the factory supplied by your transformation context instead. */
10421 const updateForOf: (node: ForOfStatement, awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement) => ForOfStatement;
10422 /** @deprecated Use `factory.createContinue` or the factory supplied by your transformation context instead. */
10423 const createContinue: (label?: string | Identifier | undefined) => ContinueStatement;
10424 /** @deprecated Use `factory.updateContinue` or the factory supplied by your transformation context instead. */
10425 const updateContinue: (node: ContinueStatement, label: Identifier | undefined) => ContinueStatement;
10426 /** @deprecated Use `factory.createBreak` or the factory supplied by your transformation context instead. */
10427 const createBreak: (label?: string | Identifier | undefined) => BreakStatement;
10428 /** @deprecated Use `factory.updateBreak` or the factory supplied by your transformation context instead. */
10429 const updateBreak: (node: BreakStatement, label: Identifier | undefined) => BreakStatement;
10430 /** @deprecated Use `factory.createReturn` or the factory supplied by your transformation context instead. */
10431 const createReturn: (expression?: Expression | undefined) => ReturnStatement;
10432 /** @deprecated Use `factory.updateReturn` or the factory supplied by your transformation context instead. */
10433 const updateReturn: (node: ReturnStatement, expression: Expression | undefined) => ReturnStatement;
10434 /** @deprecated Use `factory.createWith` or the factory supplied by your transformation context instead. */
10435 const createWith: (expression: Expression, statement: Statement) => WithStatement;
10436 /** @deprecated Use `factory.updateWith` or the factory supplied by your transformation context instead. */
10437 const updateWith: (node: WithStatement, expression: Expression, statement: Statement) => WithStatement;
10438 /** @deprecated Use `factory.createSwitch` or the factory supplied by your transformation context instead. */
10439 const createSwitch: (expression: Expression, caseBlock: CaseBlock) => SwitchStatement;
10440 /** @deprecated Use `factory.updateSwitch` or the factory supplied by your transformation context instead. */
10441 const updateSwitch: (node: SwitchStatement, expression: Expression, caseBlock: CaseBlock) => SwitchStatement;
10442 /** @deprecated Use `factory.createLabel` or the factory supplied by your transformation context instead. */
10443 const createLabel: (label: string | Identifier, statement: Statement) => LabeledStatement;
10444 /** @deprecated Use `factory.updateLabel` or the factory supplied by your transformation context instead. */
10445 const updateLabel: (node: LabeledStatement, label: Identifier, statement: Statement) => LabeledStatement;
10446 /** @deprecated Use `factory.createThrow` or the factory supplied by your transformation context instead. */
10447 const createThrow: (expression: Expression) => ThrowStatement;
10448 /** @deprecated Use `factory.updateThrow` or the factory supplied by your transformation context instead. */
10449 const updateThrow: (node: ThrowStatement, expression: Expression) => ThrowStatement;
10450 /** @deprecated Use `factory.createTry` or the factory supplied by your transformation context instead. */
10451 const createTry: (tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined) => TryStatement;
10452 /** @deprecated Use `factory.updateTry` or the factory supplied by your transformation context instead. */
10453 const updateTry: (node: TryStatement, tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined) => TryStatement;
10454 /** @deprecated Use `factory.createDebuggerStatement` or the factory supplied by your transformation context instead. */
10455 const createDebuggerStatement: () => DebuggerStatement;
10456 /** @deprecated Use `factory.createVariableDeclarationList` or the factory supplied by your transformation context instead. */
10457 const createVariableDeclarationList: (declarations: readonly VariableDeclaration[], flags?: NodeFlags | undefined) => VariableDeclarationList;
10458 /** @deprecated Use `factory.updateVariableDeclarationList` or the factory supplied by your transformation context instead. */
10459 const updateVariableDeclarationList: (node: VariableDeclarationList, declarations: readonly VariableDeclaration[]) => VariableDeclarationList;
10460 /** @deprecated Use `factory.createFunctionDeclaration` or the factory supplied by your transformation context instead. */
10461 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;
10462 /** @deprecated Use `factory.updateFunctionDeclaration` or the factory supplied by your transformation context instead. */
10463 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;
10464 /** @deprecated Use `factory.createClassDeclaration` or the factory supplied by your transformation context instead. */
10465 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;
10466 /** @deprecated Use `factory.updateClassDeclaration` or the factory supplied by your transformation context instead. */
10467 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;
10468 /** @deprecated Use `factory.createInterfaceDeclaration` or the factory supplied by your transformation context instead. */
10469 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;
10470 /** @deprecated Use `factory.updateInterfaceDeclaration` or the factory supplied by your transformation context instead. */
10471 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;
10472 /** @deprecated Use `factory.createTypeAliasDeclaration` or the factory supplied by your transformation context instead. */
10473 const createTypeAliasDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode) => TypeAliasDeclaration;
10474 /** @deprecated Use `factory.updateTypeAliasDeclaration` or the factory supplied by your transformation context instead. */
10475 const updateTypeAliasDeclaration: (node: TypeAliasDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode) => TypeAliasDeclaration;
10476 /** @deprecated Use `factory.createEnumDeclaration` or the factory supplied by your transformation context instead. */
10477 const createEnumDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]) => EnumDeclaration;
10478 /** @deprecated Use `factory.updateEnumDeclaration` or the factory supplied by your transformation context instead. */
10479 const updateEnumDeclaration: (node: EnumDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]) => EnumDeclaration;
10480 /** @deprecated Use `factory.createModuleDeclaration` or the factory supplied by your transformation context instead. */
10481 const createModuleDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: Identifier | ModuleBlock | NamespaceDeclaration | JSDocNamespaceDeclaration | undefined, flags?: NodeFlags | undefined) => ModuleDeclaration;
10482 /** @deprecated Use `factory.updateModuleDeclaration` or the factory supplied by your transformation context instead. */
10483 const updateModuleDeclaration: (node: ModuleDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: Identifier | ModuleBlock | NamespaceDeclaration | JSDocNamespaceDeclaration | undefined) => ModuleDeclaration;
10484 /** @deprecated Use `factory.createModuleBlock` or the factory supplied by your transformation context instead. */
10485 const createModuleBlock: (statements: readonly Statement[]) => ModuleBlock;
10486 /** @deprecated Use `factory.updateModuleBlock` or the factory supplied by your transformation context instead. */
10487 const updateModuleBlock: (node: ModuleBlock, statements: readonly Statement[]) => ModuleBlock;
10488 /** @deprecated Use `factory.createCaseBlock` or the factory supplied by your transformation context instead. */
10489 const createCaseBlock: (clauses: readonly CaseOrDefaultClause[]) => CaseBlock;
10490 /** @deprecated Use `factory.updateCaseBlock` or the factory supplied by your transformation context instead. */
10491 const updateCaseBlock: (node: CaseBlock, clauses: readonly CaseOrDefaultClause[]) => CaseBlock;
10492 /** @deprecated Use `factory.createNamespaceExportDeclaration` or the factory supplied by your transformation context instead. */
10493 const createNamespaceExportDeclaration: (name: string | Identifier) => NamespaceExportDeclaration;
10494 /** @deprecated Use `factory.updateNamespaceExportDeclaration` or the factory supplied by your transformation context instead. */
10495 const updateNamespaceExportDeclaration: (node: NamespaceExportDeclaration, name: Identifier) => NamespaceExportDeclaration;
10496 /** @deprecated Use `factory.createImportEqualsDeclaration` or the factory supplied by your transformation context instead. */
10497 const createImportEqualsDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, moduleReference: ModuleReference) => ImportEqualsDeclaration;
10498 /** @deprecated Use `factory.updateImportEqualsDeclaration` or the factory supplied by your transformation context instead. */
10499 const updateImportEqualsDeclaration: (node: ImportEqualsDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, moduleReference: ModuleReference) => ImportEqualsDeclaration;
10500 /** @deprecated Use `factory.createImportDeclaration` or the factory supplied by your transformation context instead. */
10501 const createImportDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression) => ImportDeclaration;
10502 /** @deprecated Use `factory.updateImportDeclaration` or the factory supplied by your transformation context instead. */
10503 const updateImportDeclaration: (node: ImportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression) => ImportDeclaration;
10504 /** @deprecated Use `factory.createNamespaceImport` or the factory supplied by your transformation context instead. */
10505 const createNamespaceImport: (name: Identifier) => NamespaceImport;
10506 /** @deprecated Use `factory.updateNamespaceImport` or the factory supplied by your transformation context instead. */
10507 const updateNamespaceImport: (node: NamespaceImport, name: Identifier) => NamespaceImport;
10508 /** @deprecated Use `factory.createNamedImports` or the factory supplied by your transformation context instead. */
10509 const createNamedImports: (elements: readonly ImportSpecifier[]) => NamedImports;
10510 /** @deprecated Use `factory.updateNamedImports` or the factory supplied by your transformation context instead. */
10511 const updateNamedImports: (node: NamedImports, elements: readonly ImportSpecifier[]) => NamedImports;
10512 /** @deprecated Use `factory.createImportSpecifier` or the factory supplied by your transformation context instead. */
10513 const createImportSpecifier: (propertyName: Identifier | undefined, name: Identifier) => ImportSpecifier;
10514 /** @deprecated Use `factory.updateImportSpecifier` or the factory supplied by your transformation context instead. */
10515 const updateImportSpecifier: (node: ImportSpecifier, propertyName: Identifier | undefined, name: Identifier) => ImportSpecifier;
10516 /** @deprecated Use `factory.createExportAssignment` or the factory supplied by your transformation context instead. */
10517 const createExportAssignment: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isExportEquals: boolean | undefined, expression: Expression) => ExportAssignment;
10518 /** @deprecated Use `factory.updateExportAssignment` or the factory supplied by your transformation context instead. */
10519 const updateExportAssignment: (node: ExportAssignment, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, expression: Expression) => ExportAssignment;
10520 /** @deprecated Use `factory.createNamedExports` or the factory supplied by your transformation context instead. */
10521 const createNamedExports: (elements: readonly ExportSpecifier[]) => NamedExports;
10522 /** @deprecated Use `factory.updateNamedExports` or the factory supplied by your transformation context instead. */
10523 const updateNamedExports: (node: NamedExports, elements: readonly ExportSpecifier[]) => NamedExports;
10524 /** @deprecated Use `factory.createExportSpecifier` or the factory supplied by your transformation context instead. */
10525 const createExportSpecifier: (propertyName: string | Identifier | undefined, name: string | Identifier) => ExportSpecifier;
10526 /** @deprecated Use `factory.updateExportSpecifier` or the factory supplied by your transformation context instead. */
10527 const updateExportSpecifier: (node: ExportSpecifier, propertyName: Identifier | undefined, name: Identifier) => ExportSpecifier;
10528 /** @deprecated Use `factory.createExternalModuleReference` or the factory supplied by your transformation context instead. */
10529 const createExternalModuleReference: (expression: Expression) => ExternalModuleReference;
10530 /** @deprecated Use `factory.updateExternalModuleReference` or the factory supplied by your transformation context instead. */
10531 const updateExternalModuleReference: (node: ExternalModuleReference, expression: Expression) => ExternalModuleReference;
10532 /** @deprecated Use `factory.createJSDocTypeExpression` or the factory supplied by your transformation context instead. */
10533 const createJSDocTypeExpression: (type: TypeNode) => JSDocTypeExpression;
10534 /** @deprecated Use `factory.createJSDocTypeTag` or the factory supplied by your transformation context instead. */
10535 const createJSDocTypeTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | undefined) => JSDocTypeTag;
10536 /** @deprecated Use `factory.createJSDocReturnTag` or the factory supplied by your transformation context instead. */
10537 const createJSDocReturnTag: (tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression | undefined, comment?: string | undefined) => JSDocReturnTag;
10538 /** @deprecated Use `factory.createJSDocThisTag` or the factory supplied by your transformation context instead. */
10539 const createJSDocThisTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | undefined) => JSDocThisTag;
10540 /** @deprecated Use `factory.createJSDocComment` or the factory supplied by your transformation context instead. */
10541 const createJSDocComment: (comment?: string | undefined, tags?: readonly JSDocTag[] | undefined) => JSDoc;
10542 /** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */
10543 const createJSDocParameterTag: (tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, isNameFirst?: boolean | undefined, comment?: string | undefined) => JSDocParameterTag;
10544 /** @deprecated Use `factory.createJSDocClassTag` or the factory supplied by your transformation context instead. */
10545 const createJSDocClassTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocClassTag;
10546 /** @deprecated Use `factory.createJSDocAugmentsTag` or the factory supplied by your transformation context instead. */
10547 const createJSDocAugmentsTag: (tagName: Identifier | undefined, className: ExpressionWithTypeArguments & {
10548 readonly expression: Identifier | PropertyAccessEntityNameExpression;
10549 }, comment?: string | undefined) => JSDocAugmentsTag;
10550 /** @deprecated Use `factory.createJSDocEnumTag` or the factory supplied by your transformation context instead. */
10551 const createJSDocEnumTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | undefined) => JSDocEnumTag;
10552 /** @deprecated Use `factory.createJSDocTemplateTag` or the factory supplied by your transformation context instead. */
10553 const createJSDocTemplateTag: (tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment?: string | undefined) => JSDocTemplateTag;
10554 /** @deprecated Use `factory.createJSDocTypedefTag` or the factory supplied by your transformation context instead. */
10555 const createJSDocTypedefTag: (tagName: Identifier | undefined, typeExpression?: JSDocTypeLiteral | JSDocTypeExpression | undefined, fullName?: Identifier | JSDocNamespaceDeclaration | undefined, comment?: string | undefined) => JSDocTypedefTag;
10556 /** @deprecated Use `factory.createJSDocCallbackTag` or the factory supplied by your transformation context instead. */
10557 const createJSDocCallbackTag: (tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName?: Identifier | JSDocNamespaceDeclaration | undefined, comment?: string | undefined) => JSDocCallbackTag;
10558 /** @deprecated Use `factory.createJSDocSignature` or the factory supplied by your transformation context instead. */
10559 const createJSDocSignature: (typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type?: JSDocReturnTag | undefined) => JSDocSignature;
10560 /** @deprecated Use `factory.createJSDocPropertyTag` or the factory supplied by your transformation context instead. */
10561 const createJSDocPropertyTag: (tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, isNameFirst?: boolean | undefined, comment?: string | undefined) => JSDocPropertyTag;
10562 /** @deprecated Use `factory.createJSDocTypeLiteral` or the factory supplied by your transformation context instead. */
10563 const createJSDocTypeLiteral: (jsDocPropertyTags?: readonly JSDocPropertyLikeTag[] | undefined, isArrayType?: boolean | undefined) => JSDocTypeLiteral;
10564 /** @deprecated Use `factory.createJSDocImplementsTag` or the factory supplied by your transformation context instead. */
10565 const createJSDocImplementsTag: (tagName: Identifier | undefined, className: ExpressionWithTypeArguments & {
10566 readonly expression: Identifier | PropertyAccessEntityNameExpression;
10567 }, comment?: string | undefined) => JSDocImplementsTag;
10568 /** @deprecated Use `factory.createJSDocAuthorTag` or the factory supplied by your transformation context instead. */
10569 const createJSDocAuthorTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocAuthorTag;
10570 /** @deprecated Use `factory.createJSDocPublicTag` or the factory supplied by your transformation context instead. */
10571 const createJSDocPublicTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocPublicTag;
10572 /** @deprecated Use `factory.createJSDocPrivateTag` or the factory supplied by your transformation context instead. */
10573 const createJSDocPrivateTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocPrivateTag;
10574 /** @deprecated Use `factory.createJSDocProtectedTag` or the factory supplied by your transformation context instead. */
10575 const createJSDocProtectedTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocProtectedTag;
10576 /** @deprecated Use `factory.createJSDocReadonlyTag` or the factory supplied by your transformation context instead. */
10577 const createJSDocReadonlyTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocReadonlyTag;
10578 /** @deprecated Use `factory.createJSDocUnknownTag` or the factory supplied by your transformation context instead. */
10579 const createJSDocTag: (tagName: Identifier, comment?: string | undefined) => JSDocUnknownTag;
10580 /** @deprecated Use `factory.createJsxElement` or the factory supplied by your transformation context instead. */
10581 const createJsxElement: (openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement) => JsxElement;
10582 /** @deprecated Use `factory.updateJsxElement` or the factory supplied by your transformation context instead. */
10583 const updateJsxElement: (node: JsxElement, openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement) => JsxElement;
10584 /** @deprecated Use `factory.createJsxSelfClosingElement` or the factory supplied by your transformation context instead. */
10585 const createJsxSelfClosingElement: (tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxSelfClosingElement;
10586 /** @deprecated Use `factory.updateJsxSelfClosingElement` or the factory supplied by your transformation context instead. */
10587 const updateJsxSelfClosingElement: (node: JsxSelfClosingElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxSelfClosingElement;
10588 /** @deprecated Use `factory.createJsxOpeningElement` or the factory supplied by your transformation context instead. */
10589 const createJsxOpeningElement: (tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxOpeningElement;
10590 /** @deprecated Use `factory.updateJsxOpeningElement` or the factory supplied by your transformation context instead. */
10591 const updateJsxOpeningElement: (node: JsxOpeningElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxOpeningElement;
10592 /** @deprecated Use `factory.createJsxClosingElement` or the factory supplied by your transformation context instead. */
10593 const createJsxClosingElement: (tagName: JsxTagNameExpression) => JsxClosingElement;
10594 /** @deprecated Use `factory.updateJsxClosingElement` or the factory supplied by your transformation context instead. */
10595 const updateJsxClosingElement: (node: JsxClosingElement, tagName: JsxTagNameExpression) => JsxClosingElement;
10596 /** @deprecated Use `factory.createJsxFragment` or the factory supplied by your transformation context instead. */
10597 const createJsxFragment: (openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment) => JsxFragment;
10598 /** @deprecated Use `factory.createJsxText` or the factory supplied by your transformation context instead. */
10599 const createJsxText: (text: string, containsOnlyTriviaWhiteSpaces?: boolean | undefined) => JsxText;
10600 /** @deprecated Use `factory.updateJsxText` or the factory supplied by your transformation context instead. */
10601 const updateJsxText: (node: JsxText, text: string, containsOnlyTriviaWhiteSpaces?: boolean | undefined) => JsxText;
10602 /** @deprecated Use `factory.createJsxOpeningFragment` or the factory supplied by your transformation context instead. */
10603 const createJsxOpeningFragment: () => JsxOpeningFragment;
10604 /** @deprecated Use `factory.createJsxJsxClosingFragment` or the factory supplied by your transformation context instead. */
10605 const createJsxJsxClosingFragment: () => JsxClosingFragment;
10606 /** @deprecated Use `factory.updateJsxFragment` or the factory supplied by your transformation context instead. */
10607 const updateJsxFragment: (node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment) => JsxFragment;
10608 /** @deprecated Use `factory.createJsxAttribute` or the factory supplied by your transformation context instead. */
10609 const createJsxAttribute: (name: Identifier, initializer: StringLiteral | JsxExpression | undefined) => JsxAttribute;
10610 /** @deprecated Use `factory.updateJsxAttribute` or the factory supplied by your transformation context instead. */
10611 const updateJsxAttribute: (node: JsxAttribute, name: Identifier, initializer: StringLiteral | JsxExpression | undefined) => JsxAttribute;
10612 /** @deprecated Use `factory.createJsxAttributes` or the factory supplied by your transformation context instead. */
10613 const createJsxAttributes: (properties: readonly JsxAttributeLike[]) => JsxAttributes;
10614 /** @deprecated Use `factory.updateJsxAttributes` or the factory supplied by your transformation context instead. */
10615 const updateJsxAttributes: (node: JsxAttributes, properties: readonly JsxAttributeLike[]) => JsxAttributes;
10616 /** @deprecated Use `factory.createJsxSpreadAttribute` or the factory supplied by your transformation context instead. */
10617 const createJsxSpreadAttribute: (expression: Expression) => JsxSpreadAttribute;
10618 /** @deprecated Use `factory.updateJsxSpreadAttribute` or the factory supplied by your transformation context instead. */
10619 const updateJsxSpreadAttribute: (node: JsxSpreadAttribute, expression: Expression) => JsxSpreadAttribute;
10620 /** @deprecated Use `factory.createJsxExpression` or the factory supplied by your transformation context instead. */
10621 const createJsxExpression: (dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined) => JsxExpression;
10622 /** @deprecated Use `factory.updateJsxExpression` or the factory supplied by your transformation context instead. */
10623 const updateJsxExpression: (node: JsxExpression, expression: Expression | undefined) => JsxExpression;
10624 /** @deprecated Use `factory.createCaseClause` or the factory supplied by your transformation context instead. */
10625 const createCaseClause: (expression: Expression, statements: readonly Statement[]) => CaseClause;
10626 /** @deprecated Use `factory.updateCaseClause` or the factory supplied by your transformation context instead. */
10627 const updateCaseClause: (node: CaseClause, expression: Expression, statements: readonly Statement[]) => CaseClause;
10628 /** @deprecated Use `factory.createDefaultClause` or the factory supplied by your transformation context instead. */
10629 const createDefaultClause: (statements: readonly Statement[]) => DefaultClause;
10630 /** @deprecated Use `factory.updateDefaultClause` or the factory supplied by your transformation context instead. */
10631 const updateDefaultClause: (node: DefaultClause, statements: readonly Statement[]) => DefaultClause;
10632 /** @deprecated Use `factory.createHeritageClause` or the factory supplied by your transformation context instead. */
10633 const createHeritageClause: (token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword, types: readonly ExpressionWithTypeArguments[]) => HeritageClause;
10634 /** @deprecated Use `factory.updateHeritageClause` or the factory supplied by your transformation context instead. */
10635 const updateHeritageClause: (node: HeritageClause, types: readonly ExpressionWithTypeArguments[]) => HeritageClause;
10636 /** @deprecated Use `factory.createCatchClause` or the factory supplied by your transformation context instead. */
10637 const createCatchClause: (variableDeclaration: string | VariableDeclaration | undefined, block: Block) => CatchClause;
10638 /** @deprecated Use `factory.updateCatchClause` or the factory supplied by your transformation context instead. */
10639 const updateCatchClause: (node: CatchClause, variableDeclaration: VariableDeclaration | undefined, block: Block) => CatchClause;
10640 /** @deprecated Use `factory.createPropertyAssignment` or the factory supplied by your transformation context instead. */
10641 const createPropertyAssignment: (name: string | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier, initializer: Expression) => PropertyAssignment;
10642 /** @deprecated Use `factory.updatePropertyAssignment` or the factory supplied by your transformation context instead. */
10643 const updatePropertyAssignment: (node: PropertyAssignment, name: PropertyName, initializer: Expression) => PropertyAssignment;
10644 /** @deprecated Use `factory.createShorthandPropertyAssignment` or the factory supplied by your transformation context instead. */
10645 const createShorthandPropertyAssignment: (name: string | Identifier, objectAssignmentInitializer?: Expression | undefined) => ShorthandPropertyAssignment;
10646 /** @deprecated Use `factory.updateShorthandPropertyAssignment` or the factory supplied by your transformation context instead. */
10647 const updateShorthandPropertyAssignment: (node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression | undefined) => ShorthandPropertyAssignment;
10648 /** @deprecated Use `factory.createSpreadAssignment` or the factory supplied by your transformation context instead. */
10649 const createSpreadAssignment: (expression: Expression) => SpreadAssignment;
10650 /** @deprecated Use `factory.updateSpreadAssignment` or the factory supplied by your transformation context instead. */
10651 const updateSpreadAssignment: (node: SpreadAssignment, expression: Expression) => SpreadAssignment;
10652 /** @deprecated Use `factory.createEnumMember` or the factory supplied by your transformation context instead. */
10653 const createEnumMember: (name: string | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier, initializer?: Expression | undefined) => EnumMember;
10654 /** @deprecated Use `factory.updateEnumMember` or the factory supplied by your transformation context instead. */
10655 const updateEnumMember: (node: EnumMember, name: PropertyName, initializer: Expression | undefined) => EnumMember;
10656 /** @deprecated Use `factory.updateSourceFile` or the factory supplied by your transformation context instead. */
10657 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;
10658 /** @deprecated Use `factory.createNotEmittedStatement` or the factory supplied by your transformation context instead. */
10659 const createNotEmittedStatement: (original: Node) => NotEmittedStatement;
10660 /** @deprecated Use `factory.createPartiallyEmittedExpression` or the factory supplied by your transformation context instead. */
10661 const createPartiallyEmittedExpression: (expression: Expression, original?: Node | undefined) => PartiallyEmittedExpression;
10662 /** @deprecated Use `factory.updatePartiallyEmittedExpression` or the factory supplied by your transformation context instead. */
10663 const updatePartiallyEmittedExpression: (node: PartiallyEmittedExpression, expression: Expression) => PartiallyEmittedExpression;
10664 /** @deprecated Use `factory.createCommaList` or the factory supplied by your transformation context instead. */
10665 const createCommaList: (elements: readonly Expression[]) => CommaListExpression;
10666 /** @deprecated Use `factory.updateCommaList` or the factory supplied by your transformation context instead. */
10667 const updateCommaList: (node: CommaListExpression, elements: readonly Expression[]) => CommaListExpression;
10668 /** @deprecated Use `factory.createBundle` or the factory supplied by your transformation context instead. */
10669 const createBundle: (sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[] | undefined) => Bundle;
10670 /** @deprecated Use `factory.updateBundle` or the factory supplied by your transformation context instead. */
10671 const updateBundle: (node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[] | undefined) => Bundle;
10672 /** @deprecated Use `factory.createImmediatelyInvokedFunctionExpression` or the factory supplied by your transformation context instead. */
10673 const createImmediatelyInvokedFunctionExpression: {
10674 (statements: readonly Statement[]): CallExpression;
10675 (statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression;
10677 /** @deprecated Use `factory.createImmediatelyInvokedArrowFunction` or the factory supplied by your transformation context instead. */
10678 const createImmediatelyInvokedArrowFunction: {
10679 (statements: readonly Statement[]): CallExpression;
10680 (statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression;
10682 /** @deprecated Use `factory.createVoidZero` or the factory supplied by your transformation context instead. */
10683 const createVoidZero: () => VoidExpression;
10684 /** @deprecated Use `factory.createExportDefault` or the factory supplied by your transformation context instead. */
10685 const createExportDefault: (expression: Expression) => ExportAssignment;
10686 /** @deprecated Use `factory.createExternalModuleExport` or the factory supplied by your transformation context instead. */
10687 const createExternalModuleExport: (exportName: Identifier) => ExportDeclaration;
10688 /** @deprecated Use `factory.createNamespaceExport` or the factory supplied by your transformation context instead. */
10689 const createNamespaceExport: (name: Identifier) => NamespaceExport;
10690 /** @deprecated Use `factory.updateNamespaceExport` or the factory supplied by your transformation context instead. */
10691 const updateNamespaceExport: (node: NamespaceExport, name: Identifier) => NamespaceExport;
10692 /** @deprecated Use `factory.createToken` or the factory supplied by your transformation context instead. */
10693 const createToken: <TKind extends SyntaxKind>(kind: TKind) => Token<TKind>;
10694 /** @deprecated Use `factory.createIdentifier` or the factory supplied by your transformation context instead. */
10695 const createIdentifier: (text: string) => Identifier;
10696 /** @deprecated Use `factory.createTempVariable` or the factory supplied by your transformation context instead. */
10697 const createTempVariable: (recordTempVariable: ((node: Identifier) => void) | undefined) => Identifier;
10698 /** @deprecated Use `factory.getGeneratedNameForNode` or the factory supplied by your transformation context instead. */
10699 const getGeneratedNameForNode: (node: Node | undefined) => Identifier;
10700 /** @deprecated Use `factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic)` or the factory supplied by your transformation context instead. */
10701 const createOptimisticUniqueName: (text: string) => Identifier;
10702 /** @deprecated Use `factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic | GeneratedIdentifierFlags.FileLevel)` or the factory supplied by your transformation context instead. */
10703 const createFileLevelUniqueName: (text: string) => Identifier;
10704 /** @deprecated Use `factory.createIndexSignature` or the factory supplied by your transformation context instead. */
10705 const createIndexSignature: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => IndexSignatureDeclaration;
10706 /** @deprecated Use `factory.createTypePredicateNode` or the factory supplied by your transformation context instead. */
10707 const createTypePredicateNode: (parameterName: Identifier | ThisTypeNode | string, type: TypeNode) => TypePredicateNode;
10708 /** @deprecated Use `factory.updateTypePredicateNode` or the factory supplied by your transformation context instead. */
10709 const updateTypePredicateNode: (node: TypePredicateNode, parameterName: Identifier | ThisTypeNode, type: TypeNode) => TypePredicateNode;
10710 /** @deprecated Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead. */
10711 const createLiteral: {
10712 (value: string | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier): StringLiteral;
10713 (value: number | PseudoBigInt): NumericLiteral;
10714 (value: boolean): BooleanLiteral;
10715 (value: string | number | PseudoBigInt | boolean): PrimaryExpression;
10717 /** @deprecated Use `factory.createMethodSignature` or the factory supplied by your transformation context instead. */
10718 const createMethodSignature: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined) => MethodSignature;
10719 /** @deprecated Use `factory.updateMethodSignature` or the factory supplied by your transformation context instead. */
10720 const updateMethodSignature: (node: MethodSignature, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined, name: PropertyName, questionToken: QuestionToken | undefined) => MethodSignature;
10721 /** @deprecated Use `factory.createTypeOperatorNode` or the factory supplied by your transformation context instead. */
10722 const createTypeOperatorNode: {
10723 (type: TypeNode): TypeOperatorNode;
10724 (operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode;
10726 /** @deprecated Use `factory.createTaggedTemplate` or the factory supplied by your transformation context instead. */
10727 const createTaggedTemplate: {
10728 (tag: Expression, template: TemplateLiteral): TaggedTemplateExpression;
10729 (tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression;
10731 /** @deprecated Use `factory.updateTaggedTemplate` or the factory supplied by your transformation context instead. */
10732 const updateTaggedTemplate: {
10733 (node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression;
10734 (node: TaggedTemplateExpression, tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression;
10736 /** @deprecated Use `factory.updateBinary` or the factory supplied by your transformation context instead. */
10737 const updateBinary: (node: BinaryExpression, left: Expression, right: Expression, operator?: BinaryOperator | BinaryOperatorToken) => BinaryExpression;
10738 /** @deprecated Use `factory.createConditional` or the factory supplied by your transformation context instead. */
10739 const createConditional: {
10740 (condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression;
10741 (condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression;
10743 /** @deprecated Use `factory.createYield` or the factory supplied by your transformation context instead. */
10744 const createYield: {
10745 (expression?: Expression | undefined): YieldExpression;
10746 (asteriskToken: AsteriskToken | undefined, expression: Expression): YieldExpression;
10748 /** @deprecated Use `factory.createClassExpression` or the factory supplied by your transformation context instead. */
10749 const createClassExpression: (modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassExpression;
10750 /** @deprecated Use `factory.updateClassExpression` or the factory supplied by your transformation context instead. */
10751 const updateClassExpression: (node: ClassExpression, modifiers: readonly Modifier[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassExpression;
10752 /** @deprecated Use `factory.createPropertySignature` or the factory supplied by your transformation context instead. */
10753 const createPropertySignature: (modifiers: readonly Modifier[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer?: Expression | undefined) => PropertySignature;
10754 /** @deprecated Use `factory.updatePropertySignature` or the factory supplied by your transformation context instead. */
10755 const updatePropertySignature: (node: PropertySignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined) => PropertySignature;
10756 /** @deprecated Use `factory.createExpressionWithTypeArguments` or the factory supplied by your transformation context instead. */
10757 const createExpressionWithTypeArguments: (typeArguments: readonly TypeNode[] | undefined, expression: Expression) => ExpressionWithTypeArguments;
10758 /** @deprecated Use `factory.updateExpressionWithTypeArguments` or the factory supplied by your transformation context instead. */
10759 const updateExpressionWithTypeArguments: (node: ExpressionWithTypeArguments, typeArguments: readonly TypeNode[] | undefined, expression: Expression) => ExpressionWithTypeArguments;
10760 /** @deprecated Use `factory.createArrowFunction` or the factory supplied by your transformation context instead. */
10761 const createArrowFunction: {
10762 (modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction;
10763 (modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction;
10765 /** @deprecated Use `factory.updateArrowFunction` or the factory supplied by your transformation context instead. */
10766 const updateArrowFunction: {
10767 (node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken, body: ConciseBody): ArrowFunction;
10768 (node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction;
10770 /** @deprecated Use `factory.createVariableDeclaration` or the factory supplied by your transformation context instead. */
10771 const createVariableDeclaration: {
10772 (name: string | BindingName, type?: TypeNode | undefined, initializer?: Expression | undefined): VariableDeclaration;
10773 (name: string | BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration;
10775 /** @deprecated Use `factory.updateVariableDeclaration` or the factory supplied by your transformation context instead. */
10776 const updateVariableDeclaration: {
10777 (node: VariableDeclaration, name: BindingName, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration;
10778 (node: VariableDeclaration, name: BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration;
10780 /** @deprecated Use `factory.createImportClause` or the factory supplied by your transformation context instead. */
10781 const createImportClause: (name: Identifier | undefined, namedBindings: NamedImportBindings | undefined, isTypeOnly?: any) => ImportClause;
10782 /** @deprecated Use `factory.updateImportClause` or the factory supplied by your transformation context instead. */
10783 const updateImportClause: (node: ImportClause, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined, isTypeOnly: boolean) => ImportClause;
10784 /** @deprecated Use `factory.createExportDeclaration` or the factory supplied by your transformation context instead. */
10785 const createExportDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression | undefined, isTypeOnly?: any) => ExportDeclaration;
10786 /** @deprecated Use `factory.updateExportDeclaration` or the factory supplied by your transformation context instead. */
10787 const updateExportDeclaration: (node: ExportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, isTypeOnly: boolean) => ExportDeclaration;
10788 /** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */
10789 const createJSDocParamTag: (name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, comment?: string | undefined) => JSDocParameterTag;
10790 /** @deprecated Use `factory.createComma` or the factory supplied by your transformation context instead. */
10791 const createComma: (left: Expression, right: Expression) => Expression;
10792 /** @deprecated Use `factory.createLessThan` or the factory supplied by your transformation context instead. */
10793 const createLessThan: (left: Expression, right: Expression) => Expression;
10794 /** @deprecated Use `factory.createAssignment` or the factory supplied by your transformation context instead. */
10795 const createAssignment: (left: Expression, right: Expression) => BinaryExpression;
10796 /** @deprecated Use `factory.createStrictEquality` or the factory supplied by your transformation context instead. */
10797 const createStrictEquality: (left: Expression, right: Expression) => BinaryExpression;
10798 /** @deprecated Use `factory.createStrictInequality` or the factory supplied by your transformation context instead. */
10799 const createStrictInequality: (left: Expression, right: Expression) => BinaryExpression;
10800 /** @deprecated Use `factory.createAdd` or the factory supplied by your transformation context instead. */
10801 const createAdd: (left: Expression, right: Expression) => BinaryExpression;
10802 /** @deprecated Use `factory.createSubtract` or the factory supplied by your transformation context instead. */
10803 const createSubtract: (left: Expression, right: Expression) => BinaryExpression;
10804 /** @deprecated Use `factory.createLogicalAnd` or the factory supplied by your transformation context instead. */
10805 const createLogicalAnd: (left: Expression, right: Expression) => BinaryExpression;
10806 /** @deprecated Use `factory.createLogicalOr` or the factory supplied by your transformation context instead. */
10807 const createLogicalOr: (left: Expression, right: Expression) => BinaryExpression;
10808 /** @deprecated Use `factory.createPostfixIncrement` or the factory supplied by your transformation context instead. */
10809 const createPostfixIncrement: (operand: Expression) => PostfixUnaryExpression;
10810 /** @deprecated Use `factory.createLogicalNot` or the factory supplied by your transformation context instead. */
10811 const createLogicalNot: (operand: Expression) => PrefixUnaryExpression;
10812 /** @deprecated Use an appropriate `factory` method instead. */
10813 const createNode: (kind: SyntaxKind, pos?: any, end?: any) => Node;
10815 * Creates a shallow, memberwise clone of a node ~for mutation~ with its `pos`, `end`, and `parent` set.
10817 * NOTE: It is unsafe to change any properties of a `Node` that relate to its AST children, as those changes won't be
10818 * captured with respect to transformations.
10820 * @deprecated Use `factory.cloneNode` instead and use `setCommentRange` or `setSourceMapRange` and avoid setting `parent`.
10822 const getMutableClone: <T extends Node>(node: T) => T;
10823 /** @deprecated Use `isTypeAssertionExpression` instead. */
10824 const isTypeAssertion: (node: Node) => node is TypeAssertion;
10826 * @deprecated Use `ts.ReadonlyESMap<K, V>` instead.
10828 interface ReadonlyMap<T> extends ReadonlyESMap<string, T> {
10831 * @deprecated Use `ts.ESMap<K, V>` instead.
10833 interface Map<T> extends ESMap<string, T> {
10838 export as namespace ts;