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 {
6438 /** @deprecated Use `factory.createNodeArray` or the factory supplied by your transformation context instead. */
6439 const createNodeArray: <T extends Node>(elements?: readonly T[] | undefined, hasTrailingComma?: boolean | undefined) => NodeArray<T>;
6440 /** @deprecated Use `factory.createNumericLiteral` or the factory supplied by your transformation context instead. */
6441 const createNumericLiteral: (value: string | number, numericLiteralFlags?: TokenFlags | undefined) => NumericLiteral;
6442 /** @deprecated Use `factory.createBigIntLiteral` or the factory supplied by your transformation context instead. */
6443 const createBigIntLiteral: (value: string | PseudoBigInt) => BigIntLiteral;
6444 /** @deprecated Use `factory.createStringLiteral` or the factory supplied by your transformation context instead. */
6445 const createStringLiteral: {
6446 (text: string, isSingleQuote?: boolean | undefined): StringLiteral;
6447 (text: string, isSingleQuote?: boolean | undefined, hasExtendedUnicodeEscape?: boolean | undefined): StringLiteral;
6449 /** @deprecated Use `factory.createStringLiteralFromNode` or the factory supplied by your transformation context instead. */
6450 const createStringLiteralFromNode: (sourceNode: Identifier | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral, isSingleQuote?: boolean | undefined) => StringLiteral;
6451 /** @deprecated Use `factory.createRegularExpressionLiteral` or the factory supplied by your transformation context instead. */
6452 const createRegularExpressionLiteral: (text: string) => RegularExpressionLiteral;
6453 /** @deprecated Use `factory.createLoopVariable` or the factory supplied by your transformation context instead. */
6454 const createLoopVariable: () => Identifier;
6455 /** @deprecated Use `factory.createUniqueName` or the factory supplied by your transformation context instead. */
6456 const createUniqueName: (text: string, flags?: GeneratedIdentifierFlags | undefined) => Identifier;
6457 /** @deprecated Use `factory.createPrivateIdentifier` or the factory supplied by your transformation context instead. */
6458 const createPrivateIdentifier: (text: string) => PrivateIdentifier;
6459 /** @deprecated Use `factory.createSuper` or the factory supplied by your transformation context instead. */
6460 const createSuper: () => SuperExpression;
6461 /** @deprecated Use `factory.createThis` or the factory supplied by your transformation context instead. */
6462 const createThis: () => ThisExpression;
6463 /** @deprecated Use `factory.createNull` or the factory supplied by your transformation context instead. */
6464 const createNull: () => NullLiteral;
6465 /** @deprecated Use `factory.createTrue` or the factory supplied by your transformation context instead. */
6466 const createTrue: () => TrueLiteral;
6467 /** @deprecated Use `factory.createFalse` or the factory supplied by your transformation context instead. */
6468 const createFalse: () => FalseLiteral;
6469 /** @deprecated Use `factory.createModifier` or the factory supplied by your transformation context instead. */
6470 const createModifier: <T extends ModifierSyntaxKind>(kind: T) => ModifierToken<T>;
6471 /** @deprecated Use `factory.createModifiersFromModifierFlags` or the factory supplied by your transformation context instead. */
6472 const createModifiersFromModifierFlags: (flags: ModifierFlags) => Modifier[];
6473 /** @deprecated Use `factory.createQualifiedName` or the factory supplied by your transformation context instead. */
6474 const createQualifiedName: (left: EntityName, right: string | Identifier) => QualifiedName;
6475 /** @deprecated Use `factory.updateQualifiedName` or the factory supplied by your transformation context instead. */
6476 const updateQualifiedName: (node: QualifiedName, left: EntityName, right: Identifier) => QualifiedName;
6477 /** @deprecated Use `factory.createComputedPropertyName` or the factory supplied by your transformation context instead. */
6478 const createComputedPropertyName: (expression: Expression) => ComputedPropertyName;
6479 /** @deprecated Use `factory.updateComputedPropertyName` or the factory supplied by your transformation context instead. */
6480 const updateComputedPropertyName: (node: ComputedPropertyName, expression: Expression) => ComputedPropertyName;
6481 /** @deprecated Use `factory.createTypeParameterDeclaration` or the factory supplied by your transformation context instead. */
6482 const createTypeParameterDeclaration: (name: string | Identifier, constraint?: TypeNode | undefined, defaultType?: TypeNode | undefined) => TypeParameterDeclaration;
6483 /** @deprecated Use `factory.updateTypeParameterDeclaration` or the factory supplied by your transformation context instead. */
6484 const updateTypeParameterDeclaration: (node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined) => TypeParameterDeclaration;
6485 /** @deprecated Use `factory.createParameterDeclaration` or the factory supplied by your transformation context instead. */
6486 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;
6487 /** @deprecated Use `factory.updateParameterDeclaration` or the factory supplied by your transformation context instead. */
6488 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;
6489 /** @deprecated Use `factory.createDecorator` or the factory supplied by your transformation context instead. */
6490 const createDecorator: (expression: Expression) => Decorator;
6491 /** @deprecated Use `factory.updateDecorator` or the factory supplied by your transformation context instead. */
6492 const updateDecorator: (node: Decorator, expression: Expression) => Decorator;
6493 /** @deprecated Use `factory.createPropertyDeclaration` or the factory supplied by your transformation context instead. */
6494 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;
6495 /** @deprecated Use `factory.updatePropertyDeclaration` or the factory supplied by your transformation context instead. */
6496 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;
6497 /** @deprecated Use `factory.createMethodDeclaration` or the factory supplied by your transformation context instead. */
6498 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;
6499 /** @deprecated Use `factory.updateMethodDeclaration` or the factory supplied by your transformation context instead. */
6500 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;
6501 /** @deprecated Use `factory.createConstructorDeclaration` or the factory supplied by your transformation context instead. */
6502 const createConstructor: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined) => ConstructorDeclaration;
6503 /** @deprecated Use `factory.updateConstructorDeclaration` or the factory supplied by your transformation context instead. */
6504 const updateConstructor: (node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined) => ConstructorDeclaration;
6505 /** @deprecated Use `factory.createGetAccessorDeclaration` or the factory supplied by your transformation context instead. */
6506 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;
6507 /** @deprecated Use `factory.updateGetAccessorDeclaration` or the factory supplied by your transformation context instead. */
6508 const updateGetAccessor: (node: GetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined) => GetAccessorDeclaration;
6509 /** @deprecated Use `factory.createSetAccessorDeclaration` or the factory supplied by your transformation context instead. */
6510 const createSetAccessor: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier, parameters: readonly ParameterDeclaration[], body: Block | undefined) => SetAccessorDeclaration;
6511 /** @deprecated Use `factory.updateSetAccessorDeclaration` or the factory supplied by your transformation context instead. */
6512 const updateSetAccessor: (node: SetAccessorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined) => SetAccessorDeclaration;
6513 /** @deprecated Use `factory.createCallSignature` or the factory supplied by your transformation context instead. */
6514 const createCallSignature: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined) => CallSignatureDeclaration;
6515 /** @deprecated Use `factory.updateCallSignature` or the factory supplied by your transformation context instead. */
6516 const updateCallSignature: (node: CallSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined) => CallSignatureDeclaration;
6517 /** @deprecated Use `factory.createConstructSignature` or the factory supplied by your transformation context instead. */
6518 const createConstructSignature: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined) => ConstructSignatureDeclaration;
6519 /** @deprecated Use `factory.updateConstructSignature` or the factory supplied by your transformation context instead. */
6520 const updateConstructSignature: (node: ConstructSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined) => ConstructSignatureDeclaration;
6521 /** @deprecated Use `factory.updateIndexSignature` or the factory supplied by your transformation context instead. */
6522 const updateIndexSignature: (node: IndexSignatureDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => IndexSignatureDeclaration;
6523 /** @deprecated Use `factory.createKeywordTypeNode` or the factory supplied by your transformation context instead. */
6524 const createKeywordTypeNode: <TKind extends KeywordTypeSyntaxKind>(kind: TKind) => KeywordTypeNode<TKind>;
6525 /** @deprecated Use `factory.createTypePredicateNode` or the factory supplied by your transformation context instead. */
6526 const createTypePredicateNodeWithModifier: (assertsModifier: AssertsKeyword | undefined, parameterName: string | Identifier | ThisTypeNode, type: TypeNode | undefined) => TypePredicateNode;
6527 /** @deprecated Use `factory.updateTypePredicateNode` or the factory supplied by your transformation context instead. */
6528 const updateTypePredicateNodeWithModifier: (node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined) => TypePredicateNode;
6529 /** @deprecated Use `factory.createTypeReferenceNode` or the factory supplied by your transformation context instead. */
6530 const createTypeReferenceNode: (typeName: string | Identifier | QualifiedName, typeArguments?: readonly TypeNode[] | undefined) => TypeReferenceNode;
6531 /** @deprecated Use `factory.updateTypeReferenceNode` or the factory supplied by your transformation context instead. */
6532 const updateTypeReferenceNode: (node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray<TypeNode> | undefined) => TypeReferenceNode;
6533 /** @deprecated Use `factory.createFunctionTypeNode` or the factory supplied by your transformation context instead. */
6534 const createFunctionTypeNode: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => FunctionTypeNode;
6535 /** @deprecated Use `factory.updateFunctionTypeNode` or the factory supplied by your transformation context instead. */
6536 const updateFunctionTypeNode: (node: FunctionTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode) => FunctionTypeNode;
6537 /** @deprecated Use `factory.createConstructorTypeNode` or the factory supplied by your transformation context instead. */
6538 const createConstructorTypeNode: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => ConstructorTypeNode;
6539 /** @deprecated Use `factory.updateConstructorTypeNode` or the factory supplied by your transformation context instead. */
6540 const updateConstructorTypeNode: (node: ConstructorTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode) => ConstructorTypeNode;
6541 /** @deprecated Use `factory.createTypeQueryNode` or the factory supplied by your transformation context instead. */
6542 const createTypeQueryNode: (exprName: EntityName) => TypeQueryNode;
6543 /** @deprecated Use `factory.updateTypeQueryNode` or the factory supplied by your transformation context instead. */
6544 const updateTypeQueryNode: (node: TypeQueryNode, exprName: EntityName) => TypeQueryNode;
6545 /** @deprecated Use `factory.createTypeLiteralNode` or the factory supplied by your transformation context instead. */
6546 const createTypeLiteralNode: (members: readonly TypeElement[] | undefined) => TypeLiteralNode;
6547 /** @deprecated Use `factory.updateTypeLiteralNode` or the factory supplied by your transformation context instead. */
6548 const updateTypeLiteralNode: (node: TypeLiteralNode, members: NodeArray<TypeElement>) => TypeLiteralNode;
6549 /** @deprecated Use `factory.createArrayTypeNode` or the factory supplied by your transformation context instead. */
6550 const createArrayTypeNode: (elementType: TypeNode) => ArrayTypeNode;
6551 /** @deprecated Use `factory.updateArrayTypeNode` or the factory supplied by your transformation context instead. */
6552 const updateArrayTypeNode: (node: ArrayTypeNode, elementType: TypeNode) => ArrayTypeNode;
6553 /** @deprecated Use `factory.createTupleTypeNode` or the factory supplied by your transformation context instead. */
6554 const createTupleTypeNode: (elements: readonly (TypeNode | NamedTupleMember)[]) => TupleTypeNode;
6555 /** @deprecated Use `factory.updateTupleTypeNode` or the factory supplied by your transformation context instead. */
6556 const updateTupleTypeNode: (node: TupleTypeNode, elements: readonly (TypeNode | NamedTupleMember)[]) => TupleTypeNode;
6557 /** @deprecated Use `factory.createOptionalTypeNode` or the factory supplied by your transformation context instead. */
6558 const createOptionalTypeNode: (type: TypeNode) => OptionalTypeNode;
6559 /** @deprecated Use `factory.updateOptionalTypeNode` or the factory supplied by your transformation context instead. */
6560 const updateOptionalTypeNode: (node: OptionalTypeNode, type: TypeNode) => OptionalTypeNode;
6561 /** @deprecated Use `factory.createRestTypeNode` or the factory supplied by your transformation context instead. */
6562 const createRestTypeNode: (type: TypeNode) => RestTypeNode;
6563 /** @deprecated Use `factory.updateRestTypeNode` or the factory supplied by your transformation context instead. */
6564 const updateRestTypeNode: (node: RestTypeNode, type: TypeNode) => RestTypeNode;
6565 /** @deprecated Use `factory.createUnionTypeNode` or the factory supplied by your transformation context instead. */
6566 const createUnionTypeNode: (types: readonly TypeNode[]) => UnionTypeNode;
6567 /** @deprecated Use `factory.updateUnionTypeNode` or the factory supplied by your transformation context instead. */
6568 const updateUnionTypeNode: (node: UnionTypeNode, types: NodeArray<TypeNode>) => UnionTypeNode;
6569 /** @deprecated Use `factory.createIntersectionTypeNode` or the factory supplied by your transformation context instead. */
6570 const createIntersectionTypeNode: (types: readonly TypeNode[]) => IntersectionTypeNode;
6571 /** @deprecated Use `factory.updateIntersectionTypeNode` or the factory supplied by your transformation context instead. */
6572 const updateIntersectionTypeNode: (node: IntersectionTypeNode, types: NodeArray<TypeNode>) => IntersectionTypeNode;
6573 /** @deprecated Use `factory.createConditionalTypeNode` or the factory supplied by your transformation context instead. */
6574 const createConditionalTypeNode: (checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode) => ConditionalTypeNode;
6575 /** @deprecated Use `factory.updateConditionalTypeNode` or the factory supplied by your transformation context instead. */
6576 const updateConditionalTypeNode: (node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode) => ConditionalTypeNode;
6577 /** @deprecated Use `factory.createInferTypeNode` or the factory supplied by your transformation context instead. */
6578 const createInferTypeNode: (typeParameter: TypeParameterDeclaration) => InferTypeNode;
6579 /** @deprecated Use `factory.updateInferTypeNode` or the factory supplied by your transformation context instead. */
6580 const updateInferTypeNode: (node: InferTypeNode, typeParameter: TypeParameterDeclaration) => InferTypeNode;
6581 /** @deprecated Use `factory.createImportTypeNode` or the factory supplied by your transformation context instead. */
6582 const createImportTypeNode: (argument: TypeNode, qualifier?: Identifier | QualifiedName | undefined, typeArguments?: readonly TypeNode[] | undefined, isTypeOf?: boolean | undefined) => ImportTypeNode;
6583 /** @deprecated Use `factory.updateImportTypeNode` or the factory supplied by your transformation context instead. */
6584 const updateImportTypeNode: (node: ImportTypeNode, argument: TypeNode, qualifier: Identifier | QualifiedName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf?: boolean | undefined) => ImportTypeNode;
6585 /** @deprecated Use `factory.createParenthesizedType` or the factory supplied by your transformation context instead. */
6586 const createParenthesizedType: (type: TypeNode) => ParenthesizedTypeNode;
6587 /** @deprecated Use `factory.updateParenthesizedType` or the factory supplied by your transformation context instead. */
6588 const updateParenthesizedType: (node: ParenthesizedTypeNode, type: TypeNode) => ParenthesizedTypeNode;
6589 /** @deprecated Use `factory.createThisTypeNode` or the factory supplied by your transformation context instead. */
6590 const createThisTypeNode: () => ThisTypeNode;
6591 /** @deprecated Use `factory.updateTypeOperatorNode` or the factory supplied by your transformation context instead. */
6592 const updateTypeOperatorNode: (node: TypeOperatorNode, type: TypeNode) => TypeOperatorNode;
6593 /** @deprecated Use `factory.createIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */
6594 const createIndexedAccessTypeNode: (objectType: TypeNode, indexType: TypeNode) => IndexedAccessTypeNode;
6595 /** @deprecated Use `factory.updateIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */
6596 const updateIndexedAccessTypeNode: (node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode) => IndexedAccessTypeNode;
6597 /** @deprecated Use `factory.createMappedTypeNode` or the factory supplied by your transformation context instead. */
6598 const createMappedTypeNode: (readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined) => MappedTypeNode;
6599 /** @deprecated Use `factory.updateMappedTypeNode` or the factory supplied by your transformation context instead. */
6600 const updateMappedTypeNode: (node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined) => MappedTypeNode;
6601 /** @deprecated Use `factory.createLiteralTypeNode` or the factory supplied by your transformation context instead. */
6602 const createLiteralTypeNode: (literal: LiteralExpression | TrueLiteral | FalseLiteral | PrefixUnaryExpression | NullLiteral) => LiteralTypeNode;
6603 /** @deprecated Use `factory.updateLiteralTypeNode` or the factory supplied by your transformation context instead. */
6604 const updateLiteralTypeNode: (node: LiteralTypeNode, literal: LiteralExpression | TrueLiteral | FalseLiteral | PrefixUnaryExpression | NullLiteral) => LiteralTypeNode;
6605 /** @deprecated Use `factory.createObjectBindingPattern` or the factory supplied by your transformation context instead. */
6606 const createObjectBindingPattern: (elements: readonly BindingElement[]) => ObjectBindingPattern;
6607 /** @deprecated Use `factory.updateObjectBindingPattern` or the factory supplied by your transformation context instead. */
6608 const updateObjectBindingPattern: (node: ObjectBindingPattern, elements: readonly BindingElement[]) => ObjectBindingPattern;
6609 /** @deprecated Use `factory.createArrayBindingPattern` or the factory supplied by your transformation context instead. */
6610 const createArrayBindingPattern: (elements: readonly ArrayBindingElement[]) => ArrayBindingPattern;
6611 /** @deprecated Use `factory.updateArrayBindingPattern` or the factory supplied by your transformation context instead. */
6612 const updateArrayBindingPattern: (node: ArrayBindingPattern, elements: readonly ArrayBindingElement[]) => ArrayBindingPattern;
6613 /** @deprecated Use `factory.createBindingElement` or the factory supplied by your transformation context instead. */
6614 const createBindingElement: (dotDotDotToken: DotDotDotToken | undefined, propertyName: string | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier | undefined, name: string | Identifier | ObjectBindingPattern | ArrayBindingPattern, initializer?: Expression | undefined) => BindingElement;
6615 /** @deprecated Use `factory.updateBindingElement` or the factory supplied by your transformation context instead. */
6616 const updateBindingElement: (node: BindingElement, dotDotDotToken: DotDotDotToken | undefined, propertyName: Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier | undefined, name: BindingName, initializer: Expression | undefined) => BindingElement;
6617 /** @deprecated Use `factory.createArrayLiteral` or the factory supplied by your transformation context instead. */
6618 const createArrayLiteral: (elements?: readonly Expression[] | undefined, multiLine?: boolean | undefined) => ArrayLiteralExpression;
6619 /** @deprecated Use `factory.updateArrayLiteral` or the factory supplied by your transformation context instead. */
6620 const updateArrayLiteral: (node: ArrayLiteralExpression, elements: readonly Expression[]) => ArrayLiteralExpression;
6621 /** @deprecated Use `factory.createObjectLiteral` or the factory supplied by your transformation context instead. */
6622 const createObjectLiteral: (properties?: readonly ObjectLiteralElementLike[] | undefined, multiLine?: boolean | undefined) => ObjectLiteralExpression;
6623 /** @deprecated Use `factory.updateObjectLiteral` or the factory supplied by your transformation context instead. */
6624 const updateObjectLiteral: (node: ObjectLiteralExpression, properties: readonly ObjectLiteralElementLike[]) => ObjectLiteralExpression;
6625 /** @deprecated Use `factory.createPropertyAccess` or the factory supplied by your transformation context instead. */
6626 const createPropertyAccess: (expression: Expression, name: string | Identifier | PrivateIdentifier) => PropertyAccessExpression;
6627 /** @deprecated Use `factory.updatePropertyAccess` or the factory supplied by your transformation context instead. */
6628 const updatePropertyAccess: (node: PropertyAccessExpression, expression: Expression, name: Identifier | PrivateIdentifier) => PropertyAccessExpression;
6629 /** @deprecated Use `factory.createPropertyAccessChain` or the factory supplied by your transformation context instead. */
6630 const createPropertyAccessChain: (expression: Expression, questionDotToken: QuestionDotToken | undefined, name: string | Identifier | PrivateIdentifier) => PropertyAccessChain;
6631 /** @deprecated Use `factory.updatePropertyAccessChain` or the factory supplied by your transformation context instead. */
6632 const updatePropertyAccessChain: (node: PropertyAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, name: Identifier | PrivateIdentifier) => PropertyAccessChain;
6633 /** @deprecated Use `factory.createElementAccess` or the factory supplied by your transformation context instead. */
6634 const createElementAccess: (expression: Expression, index: number | Expression) => ElementAccessExpression;
6635 /** @deprecated Use `factory.updateElementAccess` or the factory supplied by your transformation context instead. */
6636 const updateElementAccess: (node: ElementAccessExpression, expression: Expression, argumentExpression: Expression) => ElementAccessExpression;
6637 /** @deprecated Use `factory.createElementAccessChain` or the factory supplied by your transformation context instead. */
6638 const createElementAccessChain: (expression: Expression, questionDotToken: QuestionDotToken | undefined, index: number | Expression) => ElementAccessChain;
6639 /** @deprecated Use `factory.updateElementAccessChain` or the factory supplied by your transformation context instead. */
6640 const updateElementAccessChain: (node: ElementAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, argumentExpression: Expression) => ElementAccessChain;
6641 /** @deprecated Use `factory.createCall` or the factory supplied by your transformation context instead. */
6642 const createCall: (expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => CallExpression;
6643 /** @deprecated Use `factory.updateCall` or the factory supplied by your transformation context instead. */
6644 const updateCall: (node: CallExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]) => CallExpression;
6645 /** @deprecated Use `factory.createCallChain` or the factory supplied by your transformation context instead. */
6646 const createCallChain: (expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => CallChain;
6647 /** @deprecated Use `factory.updateCallChain` or the factory supplied by your transformation context instead. */
6648 const updateCallChain: (node: CallChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]) => CallChain;
6649 /** @deprecated Use `factory.createNew` or the factory supplied by your transformation context instead. */
6650 const createNew: (expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => NewExpression;
6651 /** @deprecated Use `factory.updateNew` or the factory supplied by your transformation context instead. */
6652 const updateNew: (node: NewExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) => NewExpression;
6653 /** @deprecated Use `factory.createTypeAssertion` or the factory supplied by your transformation context instead. */
6654 const createTypeAssertion: (type: TypeNode, expression: Expression) => TypeAssertion;
6655 /** @deprecated Use `factory.updateTypeAssertion` or the factory supplied by your transformation context instead. */
6656 const updateTypeAssertion: (node: TypeAssertion, type: TypeNode, expression: Expression) => TypeAssertion;
6657 /** @deprecated Use `factory.createParen` or the factory supplied by your transformation context instead. */
6658 const createParen: (expression: Expression) => ParenthesizedExpression;
6659 /** @deprecated Use `factory.updateParen` or the factory supplied by your transformation context instead. */
6660 const updateParen: (node: ParenthesizedExpression, expression: Expression) => ParenthesizedExpression;
6661 /** @deprecated Use `factory.createFunctionExpression` or the factory supplied by your transformation context instead. */
6662 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;
6663 /** @deprecated Use `factory.updateFunctionExpression` or the factory supplied by your transformation context instead. */
6664 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;
6665 /** @deprecated Use `factory.createDelete` or the factory supplied by your transformation context instead. */
6666 const createDelete: (expression: Expression) => DeleteExpression;
6667 /** @deprecated Use `factory.updateDelete` or the factory supplied by your transformation context instead. */
6668 const updateDelete: (node: DeleteExpression, expression: Expression) => DeleteExpression;
6669 /** @deprecated Use `factory.createTypeOf` or the factory supplied by your transformation context instead. */
6670 const createTypeOf: (expression: Expression) => TypeOfExpression;
6671 /** @deprecated Use `factory.updateTypeOf` or the factory supplied by your transformation context instead. */
6672 const updateTypeOf: (node: TypeOfExpression, expression: Expression) => TypeOfExpression;
6673 /** @deprecated Use `factory.createVoid` or the factory supplied by your transformation context instead. */
6674 const createVoid: (expression: Expression) => VoidExpression;
6675 /** @deprecated Use `factory.updateVoid` or the factory supplied by your transformation context instead. */
6676 const updateVoid: (node: VoidExpression, expression: Expression) => VoidExpression;
6677 /** @deprecated Use `factory.createAwait` or the factory supplied by your transformation context instead. */
6678 const createAwait: (expression: Expression) => AwaitExpression;
6679 /** @deprecated Use `factory.updateAwait` or the factory supplied by your transformation context instead. */
6680 const updateAwait: (node: AwaitExpression, expression: Expression) => AwaitExpression;
6681 /** @deprecated Use `factory.createPrefix` or the factory supplied by your transformation context instead. */
6682 const createPrefix: (operator: PrefixUnaryOperator, operand: Expression) => PrefixUnaryExpression;
6683 /** @deprecated Use `factory.updatePrefix` or the factory supplied by your transformation context instead. */
6684 const updatePrefix: (node: PrefixUnaryExpression, operand: Expression) => PrefixUnaryExpression;
6685 /** @deprecated Use `factory.createPostfix` or the factory supplied by your transformation context instead. */
6686 const createPostfix: (operand: Expression, operator: PostfixUnaryOperator) => PostfixUnaryExpression;
6687 /** @deprecated Use `factory.updatePostfix` or the factory supplied by your transformation context instead. */
6688 const updatePostfix: (node: PostfixUnaryExpression, operand: Expression) => PostfixUnaryExpression;
6689 /** @deprecated Use `factory.createBinary` or the factory supplied by your transformation context instead. */
6690 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;
6691 /** @deprecated Use `factory.updateConditional` or the factory supplied by your transformation context instead. */
6692 const updateConditional: (node: ConditionalExpression, condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression) => ConditionalExpression;
6693 /** @deprecated Use `factory.createTemplateExpression` or the factory supplied by your transformation context instead. */
6694 const createTemplateExpression: (head: TemplateHead, templateSpans: readonly TemplateSpan[]) => TemplateExpression;
6695 /** @deprecated Use `factory.updateTemplateExpression` or the factory supplied by your transformation context instead. */
6696 const updateTemplateExpression: (node: TemplateExpression, head: TemplateHead, templateSpans: readonly TemplateSpan[]) => TemplateExpression;
6697 /** @deprecated Use `factory.createTemplateHead` or the factory supplied by your transformation context instead. */
6698 const createTemplateHead: {
6699 (text: string, rawText?: string | undefined, templateFlags?: TokenFlags | undefined): TemplateHead;
6700 (text: string | undefined, rawText: string, templateFlags?: TokenFlags | undefined): TemplateHead;
6702 /** @deprecated Use `factory.createTemplateMiddle` or the factory supplied by your transformation context instead. */
6703 const createTemplateMiddle: {
6704 (text: string, rawText?: string | undefined, templateFlags?: TokenFlags | undefined): TemplateMiddle;
6705 (text: string | undefined, rawText: string, templateFlags?: TokenFlags | undefined): TemplateMiddle;
6707 /** @deprecated Use `factory.createTemplateTail` or the factory supplied by your transformation context instead. */
6708 const createTemplateTail: {
6709 (text: string, rawText?: string | undefined, templateFlags?: TokenFlags | undefined): TemplateTail;
6710 (text: string | undefined, rawText: string, templateFlags?: TokenFlags | undefined): TemplateTail;
6712 /** @deprecated Use `factory.createNoSubstitutionTemplateLiteral` or the factory supplied by your transformation context instead. */
6713 const createNoSubstitutionTemplateLiteral: {
6714 (text: string, rawText?: string | undefined): NoSubstitutionTemplateLiteral;
6715 (text: string | undefined, rawText: string): NoSubstitutionTemplateLiteral;
6717 /** @deprecated Use `factory.updateYield` or the factory supplied by your transformation context instead. */
6718 const updateYield: (node: YieldExpression, asteriskToken: AsteriskToken | undefined, expression: Expression | undefined) => YieldExpression;
6719 /** @deprecated Use `factory.createSpread` or the factory supplied by your transformation context instead. */
6720 const createSpread: (expression: Expression) => SpreadElement;
6721 /** @deprecated Use `factory.updateSpread` or the factory supplied by your transformation context instead. */
6722 const updateSpread: (node: SpreadElement, expression: Expression) => SpreadElement;
6723 /** @deprecated Use `factory.createOmittedExpression` or the factory supplied by your transformation context instead. */
6724 const createOmittedExpression: () => OmittedExpression;
6725 /** @deprecated Use `factory.createAsExpression` or the factory supplied by your transformation context instead. */
6726 const createAsExpression: (expression: Expression, type: TypeNode) => AsExpression;
6727 /** @deprecated Use `factory.updateAsExpression` or the factory supplied by your transformation context instead. */
6728 const updateAsExpression: (node: AsExpression, expression: Expression, type: TypeNode) => AsExpression;
6729 /** @deprecated Use `factory.createNonNullExpression` or the factory supplied by your transformation context instead. */
6730 const createNonNullExpression: (expression: Expression) => NonNullExpression;
6731 /** @deprecated Use `factory.updateNonNullExpression` or the factory supplied by your transformation context instead. */
6732 const updateNonNullExpression: (node: NonNullExpression, expression: Expression) => NonNullExpression;
6733 /** @deprecated Use `factory.createNonNullChain` or the factory supplied by your transformation context instead. */
6734 const createNonNullChain: (expression: Expression) => NonNullChain;
6735 /** @deprecated Use `factory.updateNonNullChain` or the factory supplied by your transformation context instead. */
6736 const updateNonNullChain: (node: NonNullChain, expression: Expression) => NonNullChain;
6737 /** @deprecated Use `factory.createMetaProperty` or the factory supplied by your transformation context instead. */
6738 const createMetaProperty: (keywordToken: SyntaxKind.ImportKeyword | SyntaxKind.NewKeyword, name: Identifier) => MetaProperty;
6739 /** @deprecated Use `factory.updateMetaProperty` or the factory supplied by your transformation context instead. */
6740 const updateMetaProperty: (node: MetaProperty, name: Identifier) => MetaProperty;
6741 /** @deprecated Use `factory.createTemplateSpan` or the factory supplied by your transformation context instead. */
6742 const createTemplateSpan: (expression: Expression, literal: TemplateMiddle | TemplateTail) => TemplateSpan;
6743 /** @deprecated Use `factory.updateTemplateSpan` or the factory supplied by your transformation context instead. */
6744 const updateTemplateSpan: (node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail) => TemplateSpan;
6745 /** @deprecated Use `factory.createSemicolonClassElement` or the factory supplied by your transformation context instead. */
6746 const createSemicolonClassElement: () => SemicolonClassElement;
6747 /** @deprecated Use `factory.createBlock` or the factory supplied by your transformation context instead. */
6748 const createBlock: (statements: readonly Statement[], multiLine?: boolean | undefined) => Block;
6749 /** @deprecated Use `factory.updateBlock` or the factory supplied by your transformation context instead. */
6750 const updateBlock: (node: Block, statements: readonly Statement[]) => Block;
6751 /** @deprecated Use `factory.createVariableStatement` or the factory supplied by your transformation context instead. */
6752 const createVariableStatement: (modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList | readonly VariableDeclaration[]) => VariableStatement;
6753 /** @deprecated Use `factory.updateVariableStatement` or the factory supplied by your transformation context instead. */
6754 const updateVariableStatement: (node: VariableStatement, modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList) => VariableStatement;
6755 /** @deprecated Use `factory.createEmptyStatement` or the factory supplied by your transformation context instead. */
6756 const createEmptyStatement: () => EmptyStatement;
6757 /** @deprecated Use `factory.createExpressionStatement` or the factory supplied by your transformation context instead. */
6758 const createExpressionStatement: (expression: Expression) => ExpressionStatement;
6759 /** @deprecated Use `factory.updateExpressionStatement` or the factory supplied by your transformation context instead. */
6760 const updateExpressionStatement: (node: ExpressionStatement, expression: Expression) => ExpressionStatement;
6761 /** @deprecated Use `factory.createExpressionStatement` or the factory supplied by your transformation context instead. */
6762 const createStatement: (expression: Expression) => ExpressionStatement;
6763 /** @deprecated Use `factory.updateExpressionStatement` or the factory supplied by your transformation context instead. */
6764 const updateStatement: (node: ExpressionStatement, expression: Expression) => ExpressionStatement;
6765 /** @deprecated Use `factory.createIf` or the factory supplied by your transformation context instead. */
6766 const createIf: (expression: Expression, thenStatement: Statement, elseStatement?: Statement | undefined) => IfStatement;
6767 /** @deprecated Use `factory.updateIf` or the factory supplied by your transformation context instead. */
6768 const updateIf: (node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement | undefined) => IfStatement;
6769 /** @deprecated Use `factory.createDo` or the factory supplied by your transformation context instead. */
6770 const createDo: (statement: Statement, expression: Expression) => DoStatement;
6771 /** @deprecated Use `factory.updateDo` or the factory supplied by your transformation context instead. */
6772 const updateDo: (node: DoStatement, statement: Statement, expression: Expression) => DoStatement;
6773 /** @deprecated Use `factory.createWhile` or the factory supplied by your transformation context instead. */
6774 const createWhile: (expression: Expression, statement: Statement) => WhileStatement;
6775 /** @deprecated Use `factory.updateWhile` or the factory supplied by your transformation context instead. */
6776 const updateWhile: (node: WhileStatement, expression: Expression, statement: Statement) => WhileStatement;
6777 /** @deprecated Use `factory.createFor` or the factory supplied by your transformation context instead. */
6778 const createFor: (initializer: Expression | VariableDeclarationList | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement) => ForStatement;
6779 /** @deprecated Use `factory.updateFor` or the factory supplied by your transformation context instead. */
6780 const updateFor: (node: ForStatement, initializer: Expression | VariableDeclarationList | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement) => ForStatement;
6781 /** @deprecated Use `factory.createForIn` or the factory supplied by your transformation context instead. */
6782 const createForIn: (initializer: ForInitializer, expression: Expression, statement: Statement) => ForInStatement;
6783 /** @deprecated Use `factory.updateForIn` or the factory supplied by your transformation context instead. */
6784 const updateForIn: (node: ForInStatement, initializer: ForInitializer, expression: Expression, statement: Statement) => ForInStatement;
6785 /** @deprecated Use `factory.createForOf` or the factory supplied by your transformation context instead. */
6786 const createForOf: (awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement) => ForOfStatement;
6787 /** @deprecated Use `factory.updateForOf` or the factory supplied by your transformation context instead. */
6788 const updateForOf: (node: ForOfStatement, awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement) => ForOfStatement;
6789 /** @deprecated Use `factory.createContinue` or the factory supplied by your transformation context instead. */
6790 const createContinue: (label?: string | Identifier | undefined) => ContinueStatement;
6791 /** @deprecated Use `factory.updateContinue` or the factory supplied by your transformation context instead. */
6792 const updateContinue: (node: ContinueStatement, label: Identifier | undefined) => ContinueStatement;
6793 /** @deprecated Use `factory.createBreak` or the factory supplied by your transformation context instead. */
6794 const createBreak: (label?: string | Identifier | undefined) => BreakStatement;
6795 /** @deprecated Use `factory.updateBreak` or the factory supplied by your transformation context instead. */
6796 const updateBreak: (node: BreakStatement, label: Identifier | undefined) => BreakStatement;
6797 /** @deprecated Use `factory.createReturn` or the factory supplied by your transformation context instead. */
6798 const createReturn: (expression?: Expression | undefined) => ReturnStatement;
6799 /** @deprecated Use `factory.updateReturn` or the factory supplied by your transformation context instead. */
6800 const updateReturn: (node: ReturnStatement, expression: Expression | undefined) => ReturnStatement;
6801 /** @deprecated Use `factory.createWith` or the factory supplied by your transformation context instead. */
6802 const createWith: (expression: Expression, statement: Statement) => WithStatement;
6803 /** @deprecated Use `factory.updateWith` or the factory supplied by your transformation context instead. */
6804 const updateWith: (node: WithStatement, expression: Expression, statement: Statement) => WithStatement;
6805 /** @deprecated Use `factory.createSwitch` or the factory supplied by your transformation context instead. */
6806 const createSwitch: (expression: Expression, caseBlock: CaseBlock) => SwitchStatement;
6807 /** @deprecated Use `factory.updateSwitch` or the factory supplied by your transformation context instead. */
6808 const updateSwitch: (node: SwitchStatement, expression: Expression, caseBlock: CaseBlock) => SwitchStatement;
6809 /** @deprecated Use `factory.createLabel` or the factory supplied by your transformation context instead. */
6810 const createLabel: (label: string | Identifier, statement: Statement) => LabeledStatement;
6811 /** @deprecated Use `factory.updateLabel` or the factory supplied by your transformation context instead. */
6812 const updateLabel: (node: LabeledStatement, label: Identifier, statement: Statement) => LabeledStatement;
6813 /** @deprecated Use `factory.createThrow` or the factory supplied by your transformation context instead. */
6814 const createThrow: (expression: Expression) => ThrowStatement;
6815 /** @deprecated Use `factory.updateThrow` or the factory supplied by your transformation context instead. */
6816 const updateThrow: (node: ThrowStatement, expression: Expression) => ThrowStatement;
6817 /** @deprecated Use `factory.createTry` or the factory supplied by your transformation context instead. */
6818 const createTry: (tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined) => TryStatement;
6819 /** @deprecated Use `factory.updateTry` or the factory supplied by your transformation context instead. */
6820 const updateTry: (node: TryStatement, tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined) => TryStatement;
6821 /** @deprecated Use `factory.createDebuggerStatement` or the factory supplied by your transformation context instead. */
6822 const createDebuggerStatement: () => DebuggerStatement;
6823 /** @deprecated Use `factory.createVariableDeclarationList` or the factory supplied by your transformation context instead. */
6824 const createVariableDeclarationList: (declarations: readonly VariableDeclaration[], flags?: NodeFlags | undefined) => VariableDeclarationList;
6825 /** @deprecated Use `factory.updateVariableDeclarationList` or the factory supplied by your transformation context instead. */
6826 const updateVariableDeclarationList: (node: VariableDeclarationList, declarations: readonly VariableDeclaration[]) => VariableDeclarationList;
6827 /** @deprecated Use `factory.createFunctionDeclaration` or the factory supplied by your transformation context instead. */
6828 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;
6829 /** @deprecated Use `factory.updateFunctionDeclaration` or the factory supplied by your transformation context instead. */
6830 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;
6831 /** @deprecated Use `factory.createClassDeclaration` or the factory supplied by your transformation context instead. */
6832 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;
6833 /** @deprecated Use `factory.updateClassDeclaration` or the factory supplied by your transformation context instead. */
6834 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;
6835 /** @deprecated Use `factory.createInterfaceDeclaration` or the factory supplied by your transformation context instead. */
6836 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;
6837 /** @deprecated Use `factory.updateInterfaceDeclaration` or the factory supplied by your transformation context instead. */
6838 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;
6839 /** @deprecated Use `factory.createTypeAliasDeclaration` or the factory supplied by your transformation context instead. */
6840 const createTypeAliasDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode) => TypeAliasDeclaration;
6841 /** @deprecated Use `factory.updateTypeAliasDeclaration` or the factory supplied by your transformation context instead. */
6842 const updateTypeAliasDeclaration: (node: TypeAliasDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode) => TypeAliasDeclaration;
6843 /** @deprecated Use `factory.createEnumDeclaration` or the factory supplied by your transformation context instead. */
6844 const createEnumDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]) => EnumDeclaration;
6845 /** @deprecated Use `factory.updateEnumDeclaration` or the factory supplied by your transformation context instead. */
6846 const updateEnumDeclaration: (node: EnumDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]) => EnumDeclaration;
6847 /** @deprecated Use `factory.createModuleDeclaration` or the factory supplied by your transformation context instead. */
6848 const createModuleDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: Identifier | ModuleBlock | NamespaceDeclaration | JSDocNamespaceDeclaration | undefined, flags?: NodeFlags | undefined) => ModuleDeclaration;
6849 /** @deprecated Use `factory.updateModuleDeclaration` or the factory supplied by your transformation context instead. */
6850 const updateModuleDeclaration: (node: ModuleDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: Identifier | ModuleBlock | NamespaceDeclaration | JSDocNamespaceDeclaration | undefined) => ModuleDeclaration;
6851 /** @deprecated Use `factory.createModuleBlock` or the factory supplied by your transformation context instead. */
6852 const createModuleBlock: (statements: readonly Statement[]) => ModuleBlock;
6853 /** @deprecated Use `factory.updateModuleBlock` or the factory supplied by your transformation context instead. */
6854 const updateModuleBlock: (node: ModuleBlock, statements: readonly Statement[]) => ModuleBlock;
6855 /** @deprecated Use `factory.createCaseBlock` or the factory supplied by your transformation context instead. */
6856 const createCaseBlock: (clauses: readonly CaseOrDefaultClause[]) => CaseBlock;
6857 /** @deprecated Use `factory.updateCaseBlock` or the factory supplied by your transformation context instead. */
6858 const updateCaseBlock: (node: CaseBlock, clauses: readonly CaseOrDefaultClause[]) => CaseBlock;
6859 /** @deprecated Use `factory.createNamespaceExportDeclaration` or the factory supplied by your transformation context instead. */
6860 const createNamespaceExportDeclaration: (name: string | Identifier) => NamespaceExportDeclaration;
6861 /** @deprecated Use `factory.updateNamespaceExportDeclaration` or the factory supplied by your transformation context instead. */
6862 const updateNamespaceExportDeclaration: (node: NamespaceExportDeclaration, name: Identifier) => NamespaceExportDeclaration;
6863 /** @deprecated Use `factory.createImportEqualsDeclaration` or the factory supplied by your transformation context instead. */
6864 const createImportEqualsDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: string | Identifier, moduleReference: ModuleReference) => ImportEqualsDeclaration;
6865 /** @deprecated Use `factory.updateImportEqualsDeclaration` or the factory supplied by your transformation context instead. */
6866 const updateImportEqualsDeclaration: (node: ImportEqualsDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, name: Identifier, moduleReference: ModuleReference) => ImportEqualsDeclaration;
6867 /** @deprecated Use `factory.createImportDeclaration` or the factory supplied by your transformation context instead. */
6868 const createImportDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression) => ImportDeclaration;
6869 /** @deprecated Use `factory.updateImportDeclaration` or the factory supplied by your transformation context instead. */
6870 const updateImportDeclaration: (node: ImportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression) => ImportDeclaration;
6871 /** @deprecated Use `factory.createNamespaceImport` or the factory supplied by your transformation context instead. */
6872 const createNamespaceImport: (name: Identifier) => NamespaceImport;
6873 /** @deprecated Use `factory.updateNamespaceImport` or the factory supplied by your transformation context instead. */
6874 const updateNamespaceImport: (node: NamespaceImport, name: Identifier) => NamespaceImport;
6875 /** @deprecated Use `factory.createNamedImports` or the factory supplied by your transformation context instead. */
6876 const createNamedImports: (elements: readonly ImportSpecifier[]) => NamedImports;
6877 /** @deprecated Use `factory.updateNamedImports` or the factory supplied by your transformation context instead. */
6878 const updateNamedImports: (node: NamedImports, elements: readonly ImportSpecifier[]) => NamedImports;
6879 /** @deprecated Use `factory.createImportSpecifier` or the factory supplied by your transformation context instead. */
6880 const createImportSpecifier: (propertyName: Identifier | undefined, name: Identifier) => ImportSpecifier;
6881 /** @deprecated Use `factory.updateImportSpecifier` or the factory supplied by your transformation context instead. */
6882 const updateImportSpecifier: (node: ImportSpecifier, propertyName: Identifier | undefined, name: Identifier) => ImportSpecifier;
6883 /** @deprecated Use `factory.createExportAssignment` or the factory supplied by your transformation context instead. */
6884 const createExportAssignment: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, isExportEquals: boolean | undefined, expression: Expression) => ExportAssignment;
6885 /** @deprecated Use `factory.updateExportAssignment` or the factory supplied by your transformation context instead. */
6886 const updateExportAssignment: (node: ExportAssignment, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, expression: Expression) => ExportAssignment;
6887 /** @deprecated Use `factory.createNamedExports` or the factory supplied by your transformation context instead. */
6888 const createNamedExports: (elements: readonly ExportSpecifier[]) => NamedExports;
6889 /** @deprecated Use `factory.updateNamedExports` or the factory supplied by your transformation context instead. */
6890 const updateNamedExports: (node: NamedExports, elements: readonly ExportSpecifier[]) => NamedExports;
6891 /** @deprecated Use `factory.createExportSpecifier` or the factory supplied by your transformation context instead. */
6892 const createExportSpecifier: (propertyName: string | Identifier | undefined, name: string | Identifier) => ExportSpecifier;
6893 /** @deprecated Use `factory.updateExportSpecifier` or the factory supplied by your transformation context instead. */
6894 const updateExportSpecifier: (node: ExportSpecifier, propertyName: Identifier | undefined, name: Identifier) => ExportSpecifier;
6895 /** @deprecated Use `factory.createExternalModuleReference` or the factory supplied by your transformation context instead. */
6896 const createExternalModuleReference: (expression: Expression) => ExternalModuleReference;
6897 /** @deprecated Use `factory.updateExternalModuleReference` or the factory supplied by your transformation context instead. */
6898 const updateExternalModuleReference: (node: ExternalModuleReference, expression: Expression) => ExternalModuleReference;
6899 /** @deprecated Use `factory.createJSDocTypeExpression` or the factory supplied by your transformation context instead. */
6900 const createJSDocTypeExpression: (type: TypeNode) => JSDocTypeExpression;
6901 /** @deprecated Use `factory.createJSDocTypeTag` or the factory supplied by your transformation context instead. */
6902 const createJSDocTypeTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | undefined) => JSDocTypeTag;
6903 /** @deprecated Use `factory.createJSDocReturnTag` or the factory supplied by your transformation context instead. */
6904 const createJSDocReturnTag: (tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression | undefined, comment?: string | undefined) => JSDocReturnTag;
6905 /** @deprecated Use `factory.createJSDocThisTag` or the factory supplied by your transformation context instead. */
6906 const createJSDocThisTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | undefined) => JSDocThisTag;
6907 /** @deprecated Use `factory.createJSDocComment` or the factory supplied by your transformation context instead. */
6908 const createJSDocComment: (comment?: string | undefined, tags?: readonly JSDocTag[] | undefined) => JSDoc;
6909 /** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */
6910 const createJSDocParameterTag: (tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, isNameFirst?: boolean | undefined, comment?: string | undefined) => JSDocParameterTag;
6911 /** @deprecated Use `factory.createJSDocClassTag` or the factory supplied by your transformation context instead. */
6912 const createJSDocClassTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocClassTag;
6913 /** @deprecated Use `factory.createJSDocAugmentsTag` or the factory supplied by your transformation context instead. */
6914 const createJSDocAugmentsTag: (tagName: Identifier | undefined, className: ExpressionWithTypeArguments & {
6915 readonly expression: Identifier | PropertyAccessEntityNameExpression;
6916 }, comment?: string | undefined) => JSDocAugmentsTag;
6917 /** @deprecated Use `factory.createJSDocEnumTag` or the factory supplied by your transformation context instead. */
6918 const createJSDocEnumTag: (tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | undefined) => JSDocEnumTag;
6919 /** @deprecated Use `factory.createJSDocTemplateTag` or the factory supplied by your transformation context instead. */
6920 const createJSDocTemplateTag: (tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment?: string | undefined) => JSDocTemplateTag;
6921 /** @deprecated Use `factory.createJSDocTypedefTag` or the factory supplied by your transformation context instead. */
6922 const createJSDocTypedefTag: (tagName: Identifier | undefined, typeExpression?: JSDocTypeLiteral | JSDocTypeExpression | undefined, fullName?: Identifier | JSDocNamespaceDeclaration | undefined, comment?: string | undefined) => JSDocTypedefTag;
6923 /** @deprecated Use `factory.createJSDocCallbackTag` or the factory supplied by your transformation context instead. */
6924 const createJSDocCallbackTag: (tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName?: Identifier | JSDocNamespaceDeclaration | undefined, comment?: string | undefined) => JSDocCallbackTag;
6925 /** @deprecated Use `factory.createJSDocSignature` or the factory supplied by your transformation context instead. */
6926 const createJSDocSignature: (typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type?: JSDocReturnTag | undefined) => JSDocSignature;
6927 /** @deprecated Use `factory.createJSDocPropertyTag` or the factory supplied by your transformation context instead. */
6928 const createJSDocPropertyTag: (tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, isNameFirst?: boolean | undefined, comment?: string | undefined) => JSDocPropertyTag;
6929 /** @deprecated Use `factory.createJSDocTypeLiteral` or the factory supplied by your transformation context instead. */
6930 const createJSDocTypeLiteral: (jsDocPropertyTags?: readonly JSDocPropertyLikeTag[] | undefined, isArrayType?: boolean | undefined) => JSDocTypeLiteral;
6931 /** @deprecated Use `factory.createJSDocImplementsTag` or the factory supplied by your transformation context instead. */
6932 const createJSDocImplementsTag: (tagName: Identifier | undefined, className: ExpressionWithTypeArguments & {
6933 readonly expression: Identifier | PropertyAccessEntityNameExpression;
6934 }, comment?: string | undefined) => JSDocImplementsTag;
6935 /** @deprecated Use `factory.createJSDocAuthorTag` or the factory supplied by your transformation context instead. */
6936 const createJSDocAuthorTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocAuthorTag;
6937 /** @deprecated Use `factory.createJSDocPublicTag` or the factory supplied by your transformation context instead. */
6938 const createJSDocPublicTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocPublicTag;
6939 /** @deprecated Use `factory.createJSDocPrivateTag` or the factory supplied by your transformation context instead. */
6940 const createJSDocPrivateTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocPrivateTag;
6941 /** @deprecated Use `factory.createJSDocProtectedTag` or the factory supplied by your transformation context instead. */
6942 const createJSDocProtectedTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocProtectedTag;
6943 /** @deprecated Use `factory.createJSDocReadonlyTag` or the factory supplied by your transformation context instead. */
6944 const createJSDocReadonlyTag: (tagName: Identifier | undefined, comment?: string | undefined) => JSDocReadonlyTag;
6945 /** @deprecated Use `factory.createJSDocUnknownTag` or the factory supplied by your transformation context instead. */
6946 const createJSDocTag: (tagName: Identifier, comment?: string | undefined) => JSDocUnknownTag;
6947 /** @deprecated Use `factory.createJsxElement` or the factory supplied by your transformation context instead. */
6948 const createJsxElement: (openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement) => JsxElement;
6949 /** @deprecated Use `factory.updateJsxElement` or the factory supplied by your transformation context instead. */
6950 const updateJsxElement: (node: JsxElement, openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement) => JsxElement;
6951 /** @deprecated Use `factory.createJsxSelfClosingElement` or the factory supplied by your transformation context instead. */
6952 const createJsxSelfClosingElement: (tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxSelfClosingElement;
6953 /** @deprecated Use `factory.updateJsxSelfClosingElement` or the factory supplied by your transformation context instead. */
6954 const updateJsxSelfClosingElement: (node: JsxSelfClosingElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxSelfClosingElement;
6955 /** @deprecated Use `factory.createJsxOpeningElement` or the factory supplied by your transformation context instead. */
6956 const createJsxOpeningElement: (tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxOpeningElement;
6957 /** @deprecated Use `factory.updateJsxOpeningElement` or the factory supplied by your transformation context instead. */
6958 const updateJsxOpeningElement: (node: JsxOpeningElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes) => JsxOpeningElement;
6959 /** @deprecated Use `factory.createJsxClosingElement` or the factory supplied by your transformation context instead. */
6960 const createJsxClosingElement: (tagName: JsxTagNameExpression) => JsxClosingElement;
6961 /** @deprecated Use `factory.updateJsxClosingElement` or the factory supplied by your transformation context instead. */
6962 const updateJsxClosingElement: (node: JsxClosingElement, tagName: JsxTagNameExpression) => JsxClosingElement;
6963 /** @deprecated Use `factory.createJsxFragment` or the factory supplied by your transformation context instead. */
6964 const createJsxFragment: (openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment) => JsxFragment;
6965 /** @deprecated Use `factory.createJsxText` or the factory supplied by your transformation context instead. */
6966 const createJsxText: (text: string, containsOnlyTriviaWhiteSpaces?: boolean | undefined) => JsxText;
6967 /** @deprecated Use `factory.updateJsxText` or the factory supplied by your transformation context instead. */
6968 const updateJsxText: (node: JsxText, text: string, containsOnlyTriviaWhiteSpaces?: boolean | undefined) => JsxText;
6969 /** @deprecated Use `factory.createJsxOpeningFragment` or the factory supplied by your transformation context instead. */
6970 const createJsxOpeningFragment: () => JsxOpeningFragment;
6971 /** @deprecated Use `factory.createJsxJsxClosingFragment` or the factory supplied by your transformation context instead. */
6972 const createJsxJsxClosingFragment: () => JsxClosingFragment;
6973 /** @deprecated Use `factory.updateJsxFragment` or the factory supplied by your transformation context instead. */
6974 const updateJsxFragment: (node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment) => JsxFragment;
6975 /** @deprecated Use `factory.createJsxAttribute` or the factory supplied by your transformation context instead. */
6976 const createJsxAttribute: (name: Identifier, initializer: StringLiteral | JsxExpression | undefined) => JsxAttribute;
6977 /** @deprecated Use `factory.updateJsxAttribute` or the factory supplied by your transformation context instead. */
6978 const updateJsxAttribute: (node: JsxAttribute, name: Identifier, initializer: StringLiteral | JsxExpression | undefined) => JsxAttribute;
6979 /** @deprecated Use `factory.createJsxAttributes` or the factory supplied by your transformation context instead. */
6980 const createJsxAttributes: (properties: readonly JsxAttributeLike[]) => JsxAttributes;
6981 /** @deprecated Use `factory.updateJsxAttributes` or the factory supplied by your transformation context instead. */
6982 const updateJsxAttributes: (node: JsxAttributes, properties: readonly JsxAttributeLike[]) => JsxAttributes;
6983 /** @deprecated Use `factory.createJsxSpreadAttribute` or the factory supplied by your transformation context instead. */
6984 const createJsxSpreadAttribute: (expression: Expression) => JsxSpreadAttribute;
6985 /** @deprecated Use `factory.updateJsxSpreadAttribute` or the factory supplied by your transformation context instead. */
6986 const updateJsxSpreadAttribute: (node: JsxSpreadAttribute, expression: Expression) => JsxSpreadAttribute;
6987 /** @deprecated Use `factory.createJsxExpression` or the factory supplied by your transformation context instead. */
6988 const createJsxExpression: (dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined) => JsxExpression;
6989 /** @deprecated Use `factory.updateJsxExpression` or the factory supplied by your transformation context instead. */
6990 const updateJsxExpression: (node: JsxExpression, expression: Expression | undefined) => JsxExpression;
6991 /** @deprecated Use `factory.createCaseClause` or the factory supplied by your transformation context instead. */
6992 const createCaseClause: (expression: Expression, statements: readonly Statement[]) => CaseClause;
6993 /** @deprecated Use `factory.updateCaseClause` or the factory supplied by your transformation context instead. */
6994 const updateCaseClause: (node: CaseClause, expression: Expression, statements: readonly Statement[]) => CaseClause;
6995 /** @deprecated Use `factory.createDefaultClause` or the factory supplied by your transformation context instead. */
6996 const createDefaultClause: (statements: readonly Statement[]) => DefaultClause;
6997 /** @deprecated Use `factory.updateDefaultClause` or the factory supplied by your transformation context instead. */
6998 const updateDefaultClause: (node: DefaultClause, statements: readonly Statement[]) => DefaultClause;
6999 /** @deprecated Use `factory.createHeritageClause` or the factory supplied by your transformation context instead. */
7000 const createHeritageClause: (token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword, types: readonly ExpressionWithTypeArguments[]) => HeritageClause;
7001 /** @deprecated Use `factory.updateHeritageClause` or the factory supplied by your transformation context instead. */
7002 const updateHeritageClause: (node: HeritageClause, types: readonly ExpressionWithTypeArguments[]) => HeritageClause;
7003 /** @deprecated Use `factory.createCatchClause` or the factory supplied by your transformation context instead. */
7004 const createCatchClause: (variableDeclaration: string | VariableDeclaration | undefined, block: Block) => CatchClause;
7005 /** @deprecated Use `factory.updateCatchClause` or the factory supplied by your transformation context instead. */
7006 const updateCatchClause: (node: CatchClause, variableDeclaration: VariableDeclaration | undefined, block: Block) => CatchClause;
7007 /** @deprecated Use `factory.createPropertyAssignment` or the factory supplied by your transformation context instead. */
7008 const createPropertyAssignment: (name: string | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier, initializer: Expression) => PropertyAssignment;
7009 /** @deprecated Use `factory.updatePropertyAssignment` or the factory supplied by your transformation context instead. */
7010 const updatePropertyAssignment: (node: PropertyAssignment, name: PropertyName, initializer: Expression) => PropertyAssignment;
7011 /** @deprecated Use `factory.createShorthandPropertyAssignment` or the factory supplied by your transformation context instead. */
7012 const createShorthandPropertyAssignment: (name: string | Identifier, objectAssignmentInitializer?: Expression | undefined) => ShorthandPropertyAssignment;
7013 /** @deprecated Use `factory.updateShorthandPropertyAssignment` or the factory supplied by your transformation context instead. */
7014 const updateShorthandPropertyAssignment: (node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression | undefined) => ShorthandPropertyAssignment;
7015 /** @deprecated Use `factory.createSpreadAssignment` or the factory supplied by your transformation context instead. */
7016 const createSpreadAssignment: (expression: Expression) => SpreadAssignment;
7017 /** @deprecated Use `factory.updateSpreadAssignment` or the factory supplied by your transformation context instead. */
7018 const updateSpreadAssignment: (node: SpreadAssignment, expression: Expression) => SpreadAssignment;
7019 /** @deprecated Use `factory.createEnumMember` or the factory supplied by your transformation context instead. */
7020 const createEnumMember: (name: string | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier, initializer?: Expression | undefined) => EnumMember;
7021 /** @deprecated Use `factory.updateEnumMember` or the factory supplied by your transformation context instead. */
7022 const updateEnumMember: (node: EnumMember, name: PropertyName, initializer: Expression | undefined) => EnumMember;
7023 /** @deprecated Use `factory.updateSourceFile` or the factory supplied by your transformation context instead. */
7024 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;
7025 /** @deprecated Use `factory.createNotEmittedStatement` or the factory supplied by your transformation context instead. */
7026 const createNotEmittedStatement: (original: Node) => NotEmittedStatement;
7027 /** @deprecated Use `factory.createPartiallyEmittedExpression` or the factory supplied by your transformation context instead. */
7028 const createPartiallyEmittedExpression: (expression: Expression, original?: Node | undefined) => PartiallyEmittedExpression;
7029 /** @deprecated Use `factory.updatePartiallyEmittedExpression` or the factory supplied by your transformation context instead. */
7030 const updatePartiallyEmittedExpression: (node: PartiallyEmittedExpression, expression: Expression) => PartiallyEmittedExpression;
7031 /** @deprecated Use `factory.createCommaList` or the factory supplied by your transformation context instead. */
7032 const createCommaList: (elements: readonly Expression[]) => CommaListExpression;
7033 /** @deprecated Use `factory.updateCommaList` or the factory supplied by your transformation context instead. */
7034 const updateCommaList: (node: CommaListExpression, elements: readonly Expression[]) => CommaListExpression;
7035 /** @deprecated Use `factory.createBundle` or the factory supplied by your transformation context instead. */
7036 const createBundle: (sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[] | undefined) => Bundle;
7037 /** @deprecated Use `factory.updateBundle` or the factory supplied by your transformation context instead. */
7038 const updateBundle: (node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[] | undefined) => Bundle;
7039 /** @deprecated Use `factory.createImmediatelyInvokedFunctionExpression` or the factory supplied by your transformation context instead. */
7040 const createImmediatelyInvokedFunctionExpression: {
7041 (statements: readonly Statement[]): CallExpression;
7042 (statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression;
7044 /** @deprecated Use `factory.createImmediatelyInvokedArrowFunction` or the factory supplied by your transformation context instead. */
7045 const createImmediatelyInvokedArrowFunction: {
7046 (statements: readonly Statement[]): CallExpression;
7047 (statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression;
7049 /** @deprecated Use `factory.createVoidZero` or the factory supplied by your transformation context instead. */
7050 const createVoidZero: () => VoidExpression;
7051 /** @deprecated Use `factory.createExportDefault` or the factory supplied by your transformation context instead. */
7052 const createExportDefault: (expression: Expression) => ExportAssignment;
7053 /** @deprecated Use `factory.createExternalModuleExport` or the factory supplied by your transformation context instead. */
7054 const createExternalModuleExport: (exportName: Identifier) => ExportDeclaration;
7055 /** @deprecated Use `factory.createNamespaceExport` or the factory supplied by your transformation context instead. */
7056 const createNamespaceExport: (name: Identifier) => NamespaceExport;
7057 /** @deprecated Use `factory.updateNamespaceExport` or the factory supplied by your transformation context instead. */
7058 const updateNamespaceExport: (node: NamespaceExport, name: Identifier) => NamespaceExport;
7059 /** @deprecated Use `factory.createToken` or the factory supplied by your transformation context instead. */
7060 const createToken: <TKind extends SyntaxKind>(kind: TKind) => Token<TKind>;
7061 /** @deprecated Use `factory.createIdentifier` or the factory supplied by your transformation context instead. */
7062 const createIdentifier: (text: string) => Identifier;
7063 /** @deprecated Use `factory.createTempVariable` or the factory supplied by your transformation context instead. */
7064 const createTempVariable: (recordTempVariable: ((node: Identifier) => void) | undefined) => Identifier;
7065 /** @deprecated Use `factory.getGeneratedNameForNode` or the factory supplied by your transformation context instead. */
7066 const getGeneratedNameForNode: (node: Node | undefined) => Identifier;
7067 /** @deprecated Use `factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic)` or the factory supplied by your transformation context instead. */
7068 const createOptimisticUniqueName: (text: string) => Identifier;
7069 /** @deprecated Use `factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic | GeneratedIdentifierFlags.FileLevel)` or the factory supplied by your transformation context instead. */
7070 const createFileLevelUniqueName: (text: string) => Identifier;
7071 /** @deprecated Use `factory.createIndexSignature` or the factory supplied by your transformation context instead. */
7072 const createIndexSignature: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode) => IndexSignatureDeclaration;
7073 /** @deprecated Use `factory.createTypePredicateNode` or the factory supplied by your transformation context instead. */
7074 const createTypePredicateNode: (parameterName: Identifier | ThisTypeNode | string, type: TypeNode) => TypePredicateNode;
7075 /** @deprecated Use `factory.updateTypePredicateNode` or the factory supplied by your transformation context instead. */
7076 const updateTypePredicateNode: (node: TypePredicateNode, parameterName: Identifier | ThisTypeNode, type: TypeNode) => TypePredicateNode;
7077 /** @deprecated Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead. */
7078 const createLiteral: {
7079 (value: string | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier): StringLiteral;
7080 (value: number | PseudoBigInt): NumericLiteral;
7081 (value: boolean): BooleanLiteral;
7082 (value: string | number | PseudoBigInt | boolean): PrimaryExpression;
7084 /** @deprecated Use `factory.createMethodSignature` or the factory supplied by your transformation context instead. */
7085 const createMethodSignature: (typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined) => MethodSignature;
7086 /** @deprecated Use `factory.updateMethodSignature` or the factory supplied by your transformation context instead. */
7087 const updateMethodSignature: (node: MethodSignature, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined, name: PropertyName, questionToken: QuestionToken | undefined) => MethodSignature;
7088 /** @deprecated Use `factory.createTypeOperatorNode` or the factory supplied by your transformation context instead. */
7089 const createTypeOperatorNode: {
7090 (type: TypeNode): TypeOperatorNode;
7091 (operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode;
7093 /** @deprecated Use `factory.createTaggedTemplate` or the factory supplied by your transformation context instead. */
7094 const createTaggedTemplate: {
7095 (tag: Expression, template: TemplateLiteral): TaggedTemplateExpression;
7096 (tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression;
7098 /** @deprecated Use `factory.updateTaggedTemplate` or the factory supplied by your transformation context instead. */
7099 const updateTaggedTemplate: {
7100 (node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression;
7101 (node: TaggedTemplateExpression, tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression;
7103 /** @deprecated Use `factory.updateBinary` or the factory supplied by your transformation context instead. */
7104 const updateBinary: (node: BinaryExpression, left: Expression, right: Expression, operator?: BinaryOperator | BinaryOperatorToken) => BinaryExpression;
7105 /** @deprecated Use `factory.createConditional` or the factory supplied by your transformation context instead. */
7106 const createConditional: {
7107 (condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression;
7108 (condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression;
7110 /** @deprecated Use `factory.createYield` or the factory supplied by your transformation context instead. */
7111 const createYield: {
7112 (expression?: Expression | undefined): YieldExpression;
7113 (asteriskToken: AsteriskToken | undefined, expression: Expression): YieldExpression;
7115 /** @deprecated Use `factory.createClassExpression` or the factory supplied by your transformation context instead. */
7116 const createClassExpression: (modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassExpression;
7117 /** @deprecated Use `factory.updateClassExpression` or the factory supplied by your transformation context instead. */
7118 const updateClassExpression: (node: ClassExpression, modifiers: readonly Modifier[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]) => ClassExpression;
7119 /** @deprecated Use `factory.createPropertySignature` or the factory supplied by your transformation context instead. */
7120 const createPropertySignature: (modifiers: readonly Modifier[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer?: Expression | undefined) => PropertySignature;
7121 /** @deprecated Use `factory.updatePropertySignature` or the factory supplied by your transformation context instead. */
7122 const updatePropertySignature: (node: PropertySignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined) => PropertySignature;
7123 /** @deprecated Use `factory.createExpressionWithTypeArguments` or the factory supplied by your transformation context instead. */
7124 const createExpressionWithTypeArguments: (typeArguments: readonly TypeNode[] | undefined, expression: Expression) => ExpressionWithTypeArguments;
7125 /** @deprecated Use `factory.updateExpressionWithTypeArguments` or the factory supplied by your transformation context instead. */
7126 const updateExpressionWithTypeArguments: (node: ExpressionWithTypeArguments, typeArguments: readonly TypeNode[] | undefined, expression: Expression) => ExpressionWithTypeArguments;
7127 /** @deprecated Use `factory.createArrowFunction` or the factory supplied by your transformation context instead. */
7128 const createArrowFunction: {
7129 (modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction;
7130 (modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction;
7132 /** @deprecated Use `factory.updateArrowFunction` or the factory supplied by your transformation context instead. */
7133 const updateArrowFunction: {
7134 (node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken, body: ConciseBody): ArrowFunction;
7135 (node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction;
7137 /** @deprecated Use `factory.createVariableDeclaration` or the factory supplied by your transformation context instead. */
7138 const createVariableDeclaration: {
7139 (name: string | BindingName, type?: TypeNode | undefined, initializer?: Expression | undefined): VariableDeclaration;
7140 (name: string | BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration;
7142 /** @deprecated Use `factory.updateVariableDeclaration` or the factory supplied by your transformation context instead. */
7143 const updateVariableDeclaration: {
7144 (node: VariableDeclaration, name: BindingName, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration;
7145 (node: VariableDeclaration, name: BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration;
7147 /** @deprecated Use `factory.createImportClause` or the factory supplied by your transformation context instead. */
7148 const createImportClause: (name: Identifier | undefined, namedBindings: NamedImportBindings | undefined, isTypeOnly?: any) => ImportClause;
7149 /** @deprecated Use `factory.updateImportClause` or the factory supplied by your transformation context instead. */
7150 const updateImportClause: (node: ImportClause, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined, isTypeOnly: boolean) => ImportClause;
7151 /** @deprecated Use `factory.createExportDeclaration` or the factory supplied by your transformation context instead. */
7152 const createExportDeclaration: (decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression | undefined, isTypeOnly?: any) => ExportDeclaration;
7153 /** @deprecated Use `factory.updateExportDeclaration` or the factory supplied by your transformation context instead. */
7154 const updateExportDeclaration: (node: ExportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, isTypeOnly: boolean) => ExportDeclaration;
7155 /** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */
7156 const createJSDocParamTag: (name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression | undefined, comment?: string | undefined) => JSDocParameterTag;
7157 /** @deprecated Use `factory.createComma` or the factory supplied by your transformation context instead. */
7158 const createComma: (left: Expression, right: Expression) => Expression;
7159 /** @deprecated Use `factory.createLessThan` or the factory supplied by your transformation context instead. */
7160 const createLessThan: (left: Expression, right: Expression) => Expression;
7161 /** @deprecated Use `factory.createAssignment` or the factory supplied by your transformation context instead. */
7162 const createAssignment: (left: Expression, right: Expression) => BinaryExpression;
7163 /** @deprecated Use `factory.createStrictEquality` or the factory supplied by your transformation context instead. */
7164 const createStrictEquality: (left: Expression, right: Expression) => BinaryExpression;
7165 /** @deprecated Use `factory.createStrictInequality` or the factory supplied by your transformation context instead. */
7166 const createStrictInequality: (left: Expression, right: Expression) => BinaryExpression;
7167 /** @deprecated Use `factory.createAdd` or the factory supplied by your transformation context instead. */
7168 const createAdd: (left: Expression, right: Expression) => BinaryExpression;
7169 /** @deprecated Use `factory.createSubtract` or the factory supplied by your transformation context instead. */
7170 const createSubtract: (left: Expression, right: Expression) => BinaryExpression;
7171 /** @deprecated Use `factory.createLogicalAnd` or the factory supplied by your transformation context instead. */
7172 const createLogicalAnd: (left: Expression, right: Expression) => BinaryExpression;
7173 /** @deprecated Use `factory.createLogicalOr` or the factory supplied by your transformation context instead. */
7174 const createLogicalOr: (left: Expression, right: Expression) => BinaryExpression;
7175 /** @deprecated Use `factory.createPostfixIncrement` or the factory supplied by your transformation context instead. */
7176 const createPostfixIncrement: (operand: Expression) => PostfixUnaryExpression;
7177 /** @deprecated Use `factory.createLogicalNot` or the factory supplied by your transformation context instead. */
7178 const createLogicalNot: (operand: Expression) => PrefixUnaryExpression;
7179 /** @deprecated Use an appropriate `factory` method instead. */
7180 const createNode: (kind: SyntaxKind, pos?: any, end?: any) => Node;
7182 * Creates a shallow, memberwise clone of a node ~for mutation~ with its `pos`, `end`, and `parent` set.
7184 * NOTE: It is unsafe to change any properties of a `Node` that relate to its AST children, as those changes won't be
7185 * captured with respect to transformations.
7187 * @deprecated Use `factory.cloneNode` instead and use `setCommentRange` or `setSourceMapRange` and avoid setting `parent`.
7189 const getMutableClone: <T extends Node>(node: T) => T;
7190 /** @deprecated Use `isTypeAssertionExpression` instead. */
7191 const isTypeAssertion: (node: Node) => node is TypeAssertion;
7193 * @deprecated Use `ts.ReadonlyESMap<K, V>` instead.
7195 interface ReadonlyMap<T> extends ReadonlyESMap<string, T> {
7198 * @deprecated Use `ts.ESMap<K, V>` instead.
7200 interface Map<T> extends ESMap<string, T> {