typescript
Version:
TypeScript is a language for application scale JavaScript development
1,020 lines (1,017 loc) • 406 kB
TypeScript
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
declare namespace ts {
const versionMajorMinor = "5.2";
/** The version of the TypeScript compiler release */
const version: string;
/**
* Type of objects whose values are all of the same type.
* The `in` and `for-in` operators can *not* be safely used,
* since `Object.prototype` may be modified by outside code.
*/
interface MapLike<T> {
[index: string]: T;
}
interface SortedReadonlyArray<T> extends ReadonlyArray<T> {
" __sortedArrayBrand": any;
}
interface SortedArray<T> extends Array<T> {
" __sortedArrayBrand": any;
}
type Path = string & {
__pathBrand: any;
};
interface TextRange {
pos: number;
end: number;
}
interface ReadonlyTextRange {
readonly pos: number;
readonly end: number;
}
enum SyntaxKind {
Unknown = 0,
EndOfFileToken = 1,
SingleLineCommentTrivia = 2,
MultiLineCommentTrivia = 3,
NewLineTrivia = 4,
WhitespaceTrivia = 5,
ShebangTrivia = 6,
ConflictMarkerTrivia = 7,
NonTextFileMarkerTrivia = 8,
NumericLiteral = 9,
BigIntLiteral = 10,
StringLiteral = 11,
JsxText = 12,
JsxTextAllWhiteSpaces = 13,
RegularExpressionLiteral = 14,
NoSubstitutionTemplateLiteral = 15,
TemplateHead = 16,
TemplateMiddle = 17,
TemplateTail = 18,
OpenBraceToken = 19,
CloseBraceToken = 20,
OpenParenToken = 21,
CloseParenToken = 22,
OpenBracketToken = 23,
CloseBracketToken = 24,
DotToken = 25,
DotDotDotToken = 26,
SemicolonToken = 27,
CommaToken = 28,
QuestionDotToken = 29,
LessThanToken = 30,
LessThanSlashToken = 31,
GreaterThanToken = 32,
LessThanEqualsToken = 33,
GreaterThanEqualsToken = 34,
EqualsEqualsToken = 35,
ExclamationEqualsToken = 36,
EqualsEqualsEqualsToken = 37,
ExclamationEqualsEqualsToken = 38,
EqualsGreaterThanToken = 39,
PlusToken = 40,
MinusToken = 41,
AsteriskToken = 42,
AsteriskAsteriskToken = 43,
SlashToken = 44,
PercentToken = 45,
PlusPlusToken = 46,
MinusMinusToken = 47,
LessThanLessThanToken = 48,
GreaterThanGreaterThanToken = 49,
GreaterThanGreaterThanGreaterThanToken = 50,
AmpersandToken = 51,
BarToken = 52,
CaretToken = 53,
ExclamationToken = 54,
TildeToken = 55,
AmpersandAmpersandToken = 56,
BarBarToken = 57,
QuestionToken = 58,
ColonToken = 59,
AtToken = 60,
QuestionQuestionToken = 61,
/** Only the JSDoc scanner produces BacktickToken. The normal scanner produces NoSubstitutionTemplateLiteral and related kinds. */
BacktickToken = 62,
/** Only the JSDoc scanner produces HashToken. The normal scanner produces PrivateIdentifier. */
HashToken = 63,
EqualsToken = 64,
PlusEqualsToken = 65,
MinusEqualsToken = 66,
AsteriskEqualsToken = 67,
AsteriskAsteriskEqualsToken = 68,
SlashEqualsToken = 69,
PercentEqualsToken = 70,
LessThanLessThanEqualsToken = 71,
GreaterThanGreaterThanEqualsToken = 72,
GreaterThanGreaterThanGreaterThanEqualsToken = 73,
AmpersandEqualsToken = 74,
BarEqualsToken = 75,
BarBarEqualsToken = 76,
AmpersandAmpersandEqualsToken = 77,
QuestionQuestionEqualsToken = 78,
CaretEqualsToken = 79,
Identifier = 80,
PrivateIdentifier = 81,
BreakKeyword = 83,
CaseKeyword = 84,
CatchKeyword = 85,
ClassKeyword = 86,
ConstKeyword = 87,
ContinueKeyword = 88,
DebuggerKeyword = 89,
DefaultKeyword = 90,
DeleteKeyword = 91,
DoKeyword = 92,
ElseKeyword = 93,
EnumKeyword = 94,
ExportKeyword = 95,
ExtendsKeyword = 96,
FalseKeyword = 97,
FinallyKeyword = 98,
ForKeyword = 99,
FunctionKeyword = 100,
IfKeyword = 101,
ImportKeyword = 102,
InKeyword = 103,
InstanceOfKeyword = 104,
NewKeyword = 105,
NullKeyword = 106,
ReturnKeyword = 107,
SuperKeyword = 108,
SwitchKeyword = 109,
ThisKeyword = 110,
ThrowKeyword = 111,
TrueKeyword = 112,
TryKeyword = 113,
TypeOfKeyword = 114,
VarKeyword = 115,
VoidKeyword = 116,
WhileKeyword = 117,
WithKeyword = 118,
ImplementsKeyword = 119,
InterfaceKeyword = 120,
LetKeyword = 121,
PackageKeyword = 122,
PrivateKeyword = 123,
ProtectedKeyword = 124,
PublicKeyword = 125,
StaticKeyword = 126,
YieldKeyword = 127,
AbstractKeyword = 128,
AccessorKeyword = 129,
AsKeyword = 130,
AssertsKeyword = 131,
AssertKeyword = 132,
AnyKeyword = 133,
AsyncKeyword = 134,
AwaitKeyword = 135,
BooleanKeyword = 136,
ConstructorKeyword = 137,
DeclareKeyword = 138,
GetKeyword = 139,
InferKeyword = 140,
IntrinsicKeyword = 141,
IsKeyword = 142,
KeyOfKeyword = 143,
ModuleKeyword = 144,
NamespaceKeyword = 145,
NeverKeyword = 146,
OutKeyword = 147,
ReadonlyKeyword = 148,
RequireKeyword = 149,
NumberKeyword = 150,
ObjectKeyword = 151,
SatisfiesKeyword = 152,
SetKeyword = 153,
StringKeyword = 154,
SymbolKeyword = 155,
TypeKeyword = 156,
UndefinedKeyword = 157,
UniqueKeyword = 158,
UnknownKeyword = 159,
UsingKeyword = 160,
FromKeyword = 161,
GlobalKeyword = 162,
BigIntKeyword = 163,
OverrideKeyword = 164,
OfKeyword = 165,
QualifiedName = 166,
ComputedPropertyName = 167,
TypeParameter = 168,
Parameter = 169,
Decorator = 170,
PropertySignature = 171,
PropertyDeclaration = 172,
MethodSignature = 173,
MethodDeclaration = 174,
ClassStaticBlockDeclaration = 175,
Constructor = 176,
GetAccessor = 177,
SetAccessor = 178,
CallSignature = 179,
ConstructSignature = 180,
IndexSignature = 181,
TypePredicate = 182,
TypeReference = 183,
FunctionType = 184,
ConstructorType = 185,
TypeQuery = 186,
TypeLiteral = 187,
ArrayType = 188,
TupleType = 189,
OptionalType = 190,
RestType = 191,
UnionType = 192,
IntersectionType = 193,
ConditionalType = 194,
InferType = 195,
ParenthesizedType = 196,
ThisType = 197,
TypeOperator = 198,
IndexedAccessType = 199,
MappedType = 200,
LiteralType = 201,
NamedTupleMember = 202,
TemplateLiteralType = 203,
TemplateLiteralTypeSpan = 204,
ImportType = 205,
ObjectBindingPattern = 206,
ArrayBindingPattern = 207,
BindingElement = 208,
ArrayLiteralExpression = 209,
ObjectLiteralExpression = 210,
PropertyAccessExpression = 211,
ElementAccessExpression = 212,
CallExpression = 213,
NewExpression = 214,
TaggedTemplateExpression = 215,
TypeAssertionExpression = 216,
ParenthesizedExpression = 217,
FunctionExpression = 218,
ArrowFunction = 219,
DeleteExpression = 220,
TypeOfExpression = 221,
VoidExpression = 222,
AwaitExpression = 223,
PrefixUnaryExpression = 224,
PostfixUnaryExpression = 225,
BinaryExpression = 226,
ConditionalExpression = 227,
TemplateExpression = 228,
YieldExpression = 229,
SpreadElement = 230,
ClassExpression = 231,
OmittedExpression = 232,
ExpressionWithTypeArguments = 233,
AsExpression = 234,
NonNullExpression = 235,
MetaProperty = 236,
SyntheticExpression = 237,
SatisfiesExpression = 238,
TemplateSpan = 239,
SemicolonClassElement = 240,
Block = 241,
EmptyStatement = 242,
VariableStatement = 243,
ExpressionStatement = 244,
IfStatement = 245,
DoStatement = 246,
WhileStatement = 247,
ForStatement = 248,
ForInStatement = 249,
ForOfStatement = 250,
ContinueStatement = 251,
BreakStatement = 252,
ReturnStatement = 253,
WithStatement = 254,
SwitchStatement = 255,
LabeledStatement = 256,
ThrowStatement = 257,
TryStatement = 258,
DebuggerStatement = 259,
VariableDeclaration = 260,
VariableDeclarationList = 261,
FunctionDeclaration = 262,
ClassDeclaration = 263,
InterfaceDeclaration = 264,
TypeAliasDeclaration = 265,
EnumDeclaration = 266,
ModuleDeclaration = 267,
ModuleBlock = 268,
CaseBlock = 269,
NamespaceExportDeclaration = 270,
ImportEqualsDeclaration = 271,
ImportDeclaration = 272,
ImportClause = 273,
NamespaceImport = 274,
NamedImports = 275,
ImportSpecifier = 276,
ExportAssignment = 277,
ExportDeclaration = 278,
NamedExports = 279,
NamespaceExport = 280,
ExportSpecifier = 281,
MissingDeclaration = 282,
ExternalModuleReference = 283,
JsxElement = 284,
JsxSelfClosingElement = 285,
JsxOpeningElement = 286,
JsxClosingElement = 287,
JsxFragment = 288,
JsxOpeningFragment = 289,
JsxClosingFragment = 290,
JsxAttribute = 291,
JsxAttributes = 292,
JsxSpreadAttribute = 293,
JsxExpression = 294,
JsxNamespacedName = 295,
CaseClause = 296,
DefaultClause = 297,
HeritageClause = 298,
CatchClause = 299,
AssertClause = 300,
AssertEntry = 301,
ImportTypeAssertionContainer = 302,
PropertyAssignment = 303,
ShorthandPropertyAssignment = 304,
SpreadAssignment = 305,
EnumMember = 306,
/** @deprecated */ UnparsedPrologue = 307,
/** @deprecated */ UnparsedPrepend = 308,
/** @deprecated */ UnparsedText = 309,
/** @deprecated */ UnparsedInternalText = 310,
/** @deprecated */ UnparsedSyntheticReference = 311,
SourceFile = 312,
Bundle = 313,
/** @deprecated */ UnparsedSource = 314,
/** @deprecated */ InputFiles = 315,
JSDocTypeExpression = 316,
JSDocNameReference = 317,
JSDocMemberName = 318,
JSDocAllType = 319,
JSDocUnknownType = 320,
JSDocNullableType = 321,
JSDocNonNullableType = 322,
JSDocOptionalType = 323,
JSDocFunctionType = 324,
JSDocVariadicType = 325,
JSDocNamepathType = 326,
JSDoc = 327,
/** @deprecated Use SyntaxKind.JSDoc */
JSDocComment = 327,
JSDocText = 328,
JSDocTypeLiteral = 329,
JSDocSignature = 330,
JSDocLink = 331,
JSDocLinkCode = 332,
JSDocLinkPlain = 333,
JSDocTag = 334,
JSDocAugmentsTag = 335,
JSDocImplementsTag = 336,
JSDocAuthorTag = 337,
JSDocDeprecatedTag = 338,
JSDocClassTag = 339,
JSDocPublicTag = 340,
JSDocPrivateTag = 341,
JSDocProtectedTag = 342,
JSDocReadonlyTag = 343,
JSDocOverrideTag = 344,
JSDocCallbackTag = 345,
JSDocOverloadTag = 346,
JSDocEnumTag = 347,
JSDocParameterTag = 348,
JSDocReturnTag = 349,
JSDocThisTag = 350,
JSDocTypeTag = 351,
JSDocTemplateTag = 352,
JSDocTypedefTag = 353,
JSDocSeeTag = 354,
JSDocPropertyTag = 355,
JSDocThrowsTag = 356,
JSDocSatisfiesTag = 357,
SyntaxList = 358,
NotEmittedStatement = 359,
PartiallyEmittedExpression = 360,
CommaListExpression = 361,
SyntheticReferenceExpression = 362,
Count = 363,
FirstAssignment = 64,
LastAssignment = 79,
FirstCompoundAssignment = 65,
LastCompoundAssignment = 79,
FirstReservedWord = 83,
LastReservedWord = 118,
FirstKeyword = 83,
LastKeyword = 165,
FirstFutureReservedWord = 119,
LastFutureReservedWord = 127,
FirstTypeNode = 182,
LastTypeNode = 205,
FirstPunctuation = 19,
LastPunctuation = 79,
FirstToken = 0,
LastToken = 165,
FirstTriviaToken = 2,
LastTriviaToken = 7,
FirstLiteralToken = 9,
LastLiteralToken = 15,
FirstTemplateToken = 15,
LastTemplateToken = 18,
FirstBinaryOperator = 30,
LastBinaryOperator = 79,
FirstStatement = 243,
LastStatement = 259,
FirstNode = 166,
FirstJSDocNode = 316,
LastJSDocNode = 357,
FirstJSDocTagNode = 334,
LastJSDocTagNode = 357
}
type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia;
type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral;
type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail;
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.AmpersandAmpersandEqualsToken | SyntaxKind.BarBarToken | SyntaxKind.BarBarEqualsToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionQuestionEqualsToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken;
type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AssertKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SatisfiesKeyword | 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.UsingKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword;
type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.InKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.StaticKeyword;
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;
type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind;
type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken;
type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.Unknown | KeywordSyntaxKind;
enum NodeFlags {
None = 0,
Let = 1,
Const = 2,
Using = 4,
AwaitUsing = 6,
NestedNamespace = 8,
Synthesized = 16,
Namespace = 32,
OptionalChain = 64,
ExportContext = 128,
ContainsThis = 256,
HasImplicitReturn = 512,
HasExplicitReturn = 1024,
GlobalAugmentation = 2048,
HasAsyncFunctions = 4096,
DisallowInContext = 8192,
YieldContext = 16384,
DecoratorContext = 32768,
AwaitContext = 65536,
DisallowConditionalTypesContext = 131072,
ThisNodeHasError = 262144,
JavaScriptFile = 524288,
ThisNodeOrAnySubNodesHasError = 1048576,
HasAggregatedChildData = 2097152,
JSDoc = 16777216,
JsonFile = 134217728,
BlockScoped = 7,
Constant = 6,
ReachabilityCheckFlags = 1536,
ReachabilityAndEmitFlags = 5632,
ContextFlags = 101441536,
TypeExcludesFlags = 81920
}
enum ModifierFlags {
None = 0,
Export = 1,
Ambient = 2,
Public = 4,
Private = 8,
Protected = 16,
Static = 32,
Readonly = 64,
Accessor = 128,
Abstract = 256,
Async = 512,
Default = 1024,
Const = 2048,
HasComputedJSDocModifiers = 4096,
Deprecated = 8192,
Override = 16384,
In = 32768,
Out = 65536,
Decorator = 131072,
HasComputedFlags = 536870912,
AccessibilityModifier = 28,
ParameterPropertyModifier = 16476,
NonPublicAccessibilityModifier = 24,
TypeScriptModifier = 117086,
ExportDefault = 1025,
All = 258047,
Modifier = 126975
}
enum JsxFlags {
None = 0,
/** An element from a named property of the JSX.IntrinsicElements interface */
IntrinsicNamedElement = 1,
/** An element inferred from the string index signature of the JSX.IntrinsicElements interface */
IntrinsicIndexedElement = 2,
IntrinsicElement = 3
}
interface Node extends ReadonlyTextRange {
readonly kind: SyntaxKind;
readonly flags: NodeFlags;
readonly parent: Node;
}
interface Node {
getSourceFile(): SourceFile;
getChildCount(sourceFile?: SourceFile): number;
getChildAt(index: number, sourceFile?: SourceFile): Node;
getChildren(sourceFile?: SourceFile): Node[];
getStart(sourceFile?: SourceFile, includeJsDocComment?: boolean): number;
getFullStart(): number;
getEnd(): number;
getWidth(sourceFile?: SourceFileLike): number;
getFullWidth(): number;
getLeadingTriviaWidth(sourceFile?: SourceFile): number;
getFullText(sourceFile?: SourceFile): string;
getText(sourceFile?: SourceFile): string;
getFirstToken(sourceFile?: SourceFile): Node | undefined;
getLastToken(sourceFile?: SourceFile): Node | undefined;
forEachChild<T>(cbNode: (node: Node) => T | undefined, cbNodeArray?: (nodes: NodeArray<Node>) => T | undefined): T | undefined;
}
interface JSDocContainer extends Node {
_jsdocContainerBrand: any;
}
interface LocalsContainer extends Node {
_localsContainerBrand: any;
}
interface FlowContainer extends Node {
_flowContainerBrand: any;
}
type HasJSDoc = AccessorDeclaration | ArrowFunction | BinaryExpression | Block | BreakStatement | CallSignatureDeclaration | CaseClause | ClassLikeDeclaration | ClassStaticBlockDeclaration | ConstructorDeclaration | ConstructorTypeNode | ConstructSignatureDeclaration | ContinueStatement | DebuggerStatement | DoStatement | ElementAccessExpression | EmptyStatement | EndOfFileToken | EnumDeclaration | EnumMember | ExportAssignment | ExportDeclaration | ExportSpecifier | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | FunctionDeclaration | FunctionExpression | FunctionTypeNode | Identifier | IfStatement | ImportDeclaration | ImportEqualsDeclaration | IndexSignatureDeclaration | InterfaceDeclaration | JSDocFunctionType | JSDocSignature | LabeledStatement | MethodDeclaration | MethodSignature | ModuleDeclaration | NamedTupleMember | NamespaceExportDeclaration | ObjectLiteralExpression | ParameterDeclaration | ParenthesizedExpression | PropertyAccessExpression | PropertyAssignment | PropertyDeclaration | PropertySignature | ReturnStatement | SemicolonClassElement | ShorthandPropertyAssignment | SpreadAssignment | SwitchStatement | ThrowStatement | TryStatement | TypeAliasDeclaration | TypeParameterDeclaration | VariableDeclaration | VariableStatement | WhileStatement | WithStatement;
type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType;
type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | PropertyAssignment | EnumMember;
type HasDecorators = ParameterDeclaration | PropertyDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassExpression | ClassDeclaration;
type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration;
interface NodeArray<T extends Node> extends ReadonlyArray<T>, ReadonlyTextRange {
readonly hasTrailingComma: boolean;
}
interface Token<TKind extends SyntaxKind> extends Node {
readonly kind: TKind;
}
type EndOfFileToken = Token<SyntaxKind.EndOfFileToken> & JSDocContainer;
interface PunctuationToken<TKind extends PunctuationSyntaxKind> extends Token<TKind> {
}
type DotToken = PunctuationToken<SyntaxKind.DotToken>;
type DotDotDotToken = PunctuationToken<SyntaxKind.DotDotDotToken>;
type QuestionToken = PunctuationToken<SyntaxKind.QuestionToken>;
type ExclamationToken = PunctuationToken<SyntaxKind.ExclamationToken>;
type ColonToken = PunctuationToken<SyntaxKind.ColonToken>;
type EqualsToken = PunctuationToken<SyntaxKind.EqualsToken>;
type AmpersandAmpersandEqualsToken = PunctuationToken<SyntaxKind.AmpersandAmpersandEqualsToken>;
type BarBarEqualsToken = PunctuationToken<SyntaxKind.BarBarEqualsToken>;
type QuestionQuestionEqualsToken = PunctuationToken<SyntaxKind.QuestionQuestionEqualsToken>;
type AsteriskToken = PunctuationToken<SyntaxKind.AsteriskToken>;
type EqualsGreaterThanToken = PunctuationToken<SyntaxKind.EqualsGreaterThanToken>;
type PlusToken = PunctuationToken<SyntaxKind.PlusToken>;
type MinusToken = PunctuationToken<SyntaxKind.MinusToken>;
type QuestionDotToken = PunctuationToken<SyntaxKind.QuestionDotToken>;
interface KeywordToken<TKind extends KeywordSyntaxKind> extends Token<TKind> {
}
type AssertsKeyword = KeywordToken<SyntaxKind.AssertsKeyword>;
type AssertKeyword = KeywordToken<SyntaxKind.AssertKeyword>;
type AwaitKeyword = KeywordToken<SyntaxKind.AwaitKeyword>;
type CaseKeyword = KeywordToken<SyntaxKind.CaseKeyword>;
interface ModifierToken<TKind extends ModifierSyntaxKind> extends KeywordToken<TKind> {
}
type AbstractKeyword = ModifierToken<SyntaxKind.AbstractKeyword>;
type AccessorKeyword = ModifierToken<SyntaxKind.AccessorKeyword>;
type AsyncKeyword = ModifierToken<SyntaxKind.AsyncKeyword>;
type ConstKeyword = ModifierToken<SyntaxKind.ConstKeyword>;
type DeclareKeyword = ModifierToken<SyntaxKind.DeclareKeyword>;
type DefaultKeyword = ModifierToken<SyntaxKind.DefaultKeyword>;
type ExportKeyword = ModifierToken<SyntaxKind.ExportKeyword>;
type InKeyword = ModifierToken<SyntaxKind.InKeyword>;
type PrivateKeyword = ModifierToken<SyntaxKind.PrivateKeyword>;
type ProtectedKeyword = ModifierToken<SyntaxKind.ProtectedKeyword>;
type PublicKeyword = ModifierToken<SyntaxKind.PublicKeyword>;
type ReadonlyKeyword = ModifierToken<SyntaxKind.ReadonlyKeyword>;
type OutKeyword = ModifierToken<SyntaxKind.OutKeyword>;
type OverrideKeyword = ModifierToken<SyntaxKind.OverrideKeyword>;
type StaticKeyword = ModifierToken<SyntaxKind.StaticKeyword>;
type Modifier = AbstractKeyword | AccessorKeyword | AsyncKeyword | ConstKeyword | DeclareKeyword | DefaultKeyword | ExportKeyword | InKeyword | PrivateKeyword | ProtectedKeyword | PublicKeyword | OutKeyword | OverrideKeyword | ReadonlyKeyword | StaticKeyword;
type ModifierLike = Modifier | Decorator;
type AccessibilityModifier = PublicKeyword | PrivateKeyword | ProtectedKeyword;
type ParameterPropertyModifier = AccessibilityModifier | ReadonlyKeyword;
type ClassMemberModifier = AccessibilityModifier | ReadonlyKeyword | StaticKeyword | AccessorKeyword;
type ModifiersArray = NodeArray<Modifier>;
enum GeneratedIdentifierFlags {
None = 0,
ReservedInNestedScopes = 8,
Optimistic = 16,
FileLevel = 32,
AllowNameSubstitution = 64
}
interface Identifier extends PrimaryExpression, Declaration, JSDocContainer, FlowContainer {
readonly kind: SyntaxKind.Identifier;
/**
* Prefer to use `id.unescapedText`. (Note: This is available only in services, not internally to the TypeScript compiler.)
* Text of identifier, but if the identifier begins with two underscores, this will begin with three.
*/
readonly escapedText: __String;
}
interface Identifier {
readonly text: string;
}
interface Identifier {
/** @deprecated Use `idKeyword(identifier)` instead. */
readonly originalKeywordKind?: SyntaxKind;
/** @deprecated Use `.parent` or the surrounding context to determine this instead. */
readonly isInJSDocNamespace?: boolean;
}
interface TransientIdentifier extends Identifier {
resolvedSymbol: Symbol;
}
interface QualifiedName extends Node, FlowContainer {
readonly kind: SyntaxKind.QualifiedName;
readonly left: EntityName;
readonly right: Identifier;
}
type EntityName = Identifier | QualifiedName;
type PropertyName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier;
type MemberName = Identifier | PrivateIdentifier;
type DeclarationName = PropertyName | JsxAttributeName | StringLiteralLike | ElementAccessExpression | BindingPattern | EntityNameExpression;
interface Declaration extends Node {
_declarationBrand: any;
}
interface NamedDeclaration extends Declaration {
readonly name?: DeclarationName;
}
interface DeclarationStatement extends NamedDeclaration, Statement {
readonly name?: Identifier | StringLiteral | NumericLiteral;
}
interface ComputedPropertyName extends Node {
readonly kind: SyntaxKind.ComputedPropertyName;
readonly parent: Declaration;
readonly expression: Expression;
}
interface PrivateIdentifier extends PrimaryExpression {
readonly kind: SyntaxKind.PrivateIdentifier;
readonly escapedText: __String;
}
interface PrivateIdentifier {
readonly text: string;
}
interface Decorator extends Node {
readonly kind: SyntaxKind.Decorator;
readonly parent: NamedDeclaration;
readonly expression: LeftHandSideExpression;
}
interface TypeParameterDeclaration extends NamedDeclaration, JSDocContainer {
readonly kind: SyntaxKind.TypeParameter;
readonly parent: DeclarationWithTypeParameterChildren | InferTypeNode;
readonly modifiers?: NodeArray<Modifier>;
readonly name: Identifier;
/** Note: Consider calling `getEffectiveConstraintOfTypeParameter` */
readonly constraint?: TypeNode;
readonly default?: TypeNode;
expression?: Expression;
}
interface SignatureDeclarationBase extends NamedDeclaration, JSDocContainer {
readonly kind: SignatureDeclaration["kind"];
readonly name?: PropertyName;
readonly typeParameters?: NodeArray<TypeParameterDeclaration> | undefined;
readonly parameters: NodeArray<ParameterDeclaration>;
readonly type?: TypeNode | undefined;
}
type SignatureDeclaration = CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | AccessorDeclaration | FunctionExpression | ArrowFunction;
interface CallSignatureDeclaration extends SignatureDeclarationBase, TypeElement, LocalsContainer {
readonly kind: SyntaxKind.CallSignature;
}
interface ConstructSignatureDeclaration extends SignatureDeclarationBase, TypeElement, LocalsContainer {
readonly kind: SyntaxKind.ConstructSignature;
}
type BindingName = Identifier | BindingPattern;
interface VariableDeclaration extends NamedDeclaration, JSDocContainer {
readonly kind: SyntaxKind.VariableDeclaration;
readonly parent: VariableDeclarationList | CatchClause;
readonly name: BindingName;
readonly exclamationToken?: ExclamationToken;
readonly type?: TypeNode;
readonly initializer?: Expression;
}
interface VariableDeclarationList extends Node {
readonly kind: SyntaxKind.VariableDeclarationList;
readonly parent: VariableStatement | ForStatement | ForOfStatement | ForInStatement;
readonly declarations: NodeArray<VariableDeclaration>;
}
interface ParameterDeclaration extends NamedDeclaration, JSDocContainer {
readonly kind: SyntaxKind.Parameter;
readonly parent: SignatureDeclaration;
readonly modifiers?: NodeArray<ModifierLike>;
readonly dotDotDotToken?: DotDotDotToken;
readonly name: BindingName;
readonly questionToken?: QuestionToken;
readonly type?: TypeNode;
readonly initializer?: Expression;
}
interface BindingElement extends NamedDeclaration, FlowContainer {
readonly kind: SyntaxKind.BindingElement;
readonly parent: BindingPattern;
readonly propertyName?: PropertyName;
readonly dotDotDotToken?: DotDotDotToken;
readonly name: BindingName;
readonly initializer?: Expression;
}
interface PropertySignature extends TypeElement, JSDocContainer {
readonly kind: SyntaxKind.PropertySignature;
readonly parent: TypeLiteralNode | InterfaceDeclaration;
readonly modifiers?: NodeArray<Modifier>;
readonly name: PropertyName;
readonly questionToken?: QuestionToken;
readonly type?: TypeNode;
}
interface PropertyDeclaration extends ClassElement, JSDocContainer {
readonly kind: SyntaxKind.PropertyDeclaration;
readonly parent: ClassLikeDeclaration;
readonly modifiers?: NodeArray<ModifierLike>;
readonly name: PropertyName;
readonly questionToken?: QuestionToken;
readonly exclamationToken?: ExclamationToken;
readonly type?: TypeNode;
readonly initializer?: Expression;
}
interface AutoAccessorPropertyDeclaration extends PropertyDeclaration {
_autoAccessorBrand: any;
}
interface ObjectLiteralElement extends NamedDeclaration {
_objectLiteralBrand: any;
readonly name?: PropertyName;
}
/** Unlike ObjectLiteralElement, excludes JSXAttribute and JSXSpreadAttribute. */
type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | MethodDeclaration | AccessorDeclaration;
interface PropertyAssignment extends ObjectLiteralElement, JSDocContainer {
readonly kind: SyntaxKind.PropertyAssignment;
readonly parent: ObjectLiteralExpression;
readonly name: PropertyName;
readonly initializer: Expression;
}
interface ShorthandPropertyAssignment extends ObjectLiteralElement, JSDocContainer {
readonly kind: SyntaxKind.ShorthandPropertyAssignment;
readonly parent: ObjectLiteralExpression;
readonly name: Identifier;
readonly equalsToken?: EqualsToken;
readonly objectAssignmentInitializer?: Expression;
}
interface SpreadAssignment extends ObjectLiteralElement, JSDocContainer {
readonly kind: SyntaxKind.SpreadAssignment;
readonly parent: ObjectLiteralExpression;
readonly expression: Expression;
}
type VariableLikeDeclaration = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | PropertyAssignment | PropertySignature | JsxAttribute | ShorthandPropertyAssignment | EnumMember | JSDocPropertyTag | JSDocParameterTag;
interface ObjectBindingPattern extends Node {
readonly kind: SyntaxKind.ObjectBindingPattern;
readonly parent: VariableDeclaration | ParameterDeclaration | BindingElement;
readonly elements: NodeArray<BindingElement>;
}
interface ArrayBindingPattern extends Node {
readonly kind: SyntaxKind.ArrayBindingPattern;
readonly parent: VariableDeclaration | ParameterDeclaration | BindingElement;
readonly elements: NodeArray<ArrayBindingElement>;
}
type BindingPattern = ObjectBindingPattern | ArrayBindingPattern;
type ArrayBindingElement = BindingElement | OmittedExpression;
/**
* Several node kinds share function-like features such as a signature,
* a name, and a body. These nodes should extend FunctionLikeDeclarationBase.
* Examples:
* - FunctionDeclaration
* - MethodDeclaration
* - AccessorDeclaration
*/
interface FunctionLikeDeclarationBase extends SignatureDeclarationBase {
_functionLikeDeclarationBrand: any;
readonly asteriskToken?: AsteriskToken | undefined;
readonly questionToken?: QuestionToken | undefined;
readonly exclamationToken?: ExclamationToken | undefined;
readonly body?: Block | Expression | undefined;
}
type FunctionLikeDeclaration = FunctionDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ConstructorDeclaration | FunctionExpression | ArrowFunction;
/** @deprecated Use SignatureDeclaration */
type FunctionLike = SignatureDeclaration;
interface FunctionDeclaration extends FunctionLikeDeclarationBase, DeclarationStatement, LocalsContainer {
readonly kind: SyntaxKind.FunctionDeclaration;
readonly modifiers?: NodeArray<ModifierLike>;
readonly name?: Identifier;
readonly body?: FunctionBody;
}
interface MethodSignature extends SignatureDeclarationBase, TypeElement, LocalsContainer {
readonly kind: SyntaxKind.MethodSignature;
readonly parent: TypeLiteralNode | InterfaceDeclaration;
readonly modifiers?: NodeArray<Modifier>;
readonly name: PropertyName;
}
interface MethodDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer, LocalsContainer, FlowContainer {
readonly kind: SyntaxKind.MethodDeclaration;
readonly parent: ClassLikeDeclaration | ObjectLiteralExpression;
readonly modifiers?: NodeArray<ModifierLike> | undefined;
readonly name: PropertyName;
readonly body?: FunctionBody | undefined;
}
interface ConstructorDeclaration extends FunctionLikeDeclarationBase, ClassElement, JSDocContainer, LocalsContainer {
readonly kind: SyntaxKind.Constructor;
readonly parent: ClassLikeDeclaration;
readonly modifiers?: NodeArray<ModifierLike> | undefined;
readonly body?: FunctionBody | undefined;
}
/** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */
interface SemicolonClassElement extends ClassElement, JSDocContainer {
readonly kind: SyntaxKind.SemicolonClassElement;
readonly parent: ClassLikeDeclaration;
}
interface GetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, TypeElement, ObjectLiteralElement, JSDocContainer, LocalsContainer, FlowContainer {
readonly kind: SyntaxKind.GetAccessor;
readonly parent: ClassLikeDeclaration | ObjectLiteralExpression | TypeLiteralNode | InterfaceDeclaration;
readonly modifiers?: NodeArray<ModifierLike>;
readonly name: PropertyName;
readonly body?: FunctionBody;
}
interface SetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, TypeElement, ObjectLiteralElement, JSDocContainer, LocalsContainer, FlowContainer {
readonly kind: SyntaxKind.SetAccessor;
readonly parent: ClassLikeDeclaration | ObjectLiteralExpression | TypeLiteralNode | InterfaceDeclaration;
readonly modifiers?: NodeArray<ModifierLike>;
readonly name: PropertyName;
readonly body?: FunctionBody;
}
type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration;
interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement, LocalsContainer {
readonly kind: SyntaxKind.IndexSignature;
readonly parent: ObjectTypeDeclaration;
readonly modifiers?: NodeArray<ModifierLike>;
readonly type: TypeNode;
}
interface ClassStaticBlockDeclaration extends ClassElement, JSDocContainer, LocalsContainer {
readonly kind: SyntaxKind.ClassStaticBlockDeclaration;
readonly parent: ClassDeclaration | ClassExpression;
readonly body: Block;
}
interface TypeNode extends Node {
_typeNodeBrand: any;
}
interface KeywordTypeNode<TKind extends KeywordTypeSyntaxKind = KeywordTypeSyntaxKind> extends KeywordToken<TKind>, TypeNode {
readonly kind: TKind;
}
interface ImportTypeAssertionContainer extends Node {
readonly kind: SyntaxKind.ImportTypeAssertionContainer;
readonly parent: ImportTypeNode;
readonly assertClause: AssertClause;
readonly multiLine?: boolean;
}
interface ImportTypeNode extends NodeWithTypeArguments {
readonly kind: SyntaxKind.ImportType;
readonly isTypeOf: boolean;
readonly argument: TypeNode;
readonly assertions?: ImportTypeAssertionContainer;
readonly qualifier?: EntityName;
}
interface ThisTypeNode extends TypeNode {
readonly kind: SyntaxKind.ThisType;
}
type FunctionOrConstructorTypeNode = FunctionTypeNode | ConstructorTypeNode;
interface FunctionOrConstructorTypeNodeBase extends TypeNode, SignatureDeclarationBase {
readonly kind: SyntaxKind.FunctionType | SyntaxKind.ConstructorType;
readonly type: TypeNode;
}
interface FunctionTypeNode extends FunctionOrConstructorTypeNodeBase, LocalsContainer {
readonly kind: SyntaxKind.FunctionType;
}
interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase, LocalsContainer {
readonly kind: SyntaxKind.ConstructorType;
readonly modifiers?: NodeArray<Modifier>;
}
interface NodeWithTypeArguments extends TypeNode {
readonly typeArguments?: NodeArray<TypeNode>;
}
type TypeReferenceType = TypeReferenceNode | ExpressionWithTypeArguments;
interface TypeReferenceNode extends NodeWithTypeArguments {
readonly kind: SyntaxKind.TypeReference;
readonly typeName: EntityName;
}
interface TypePredicateNode extends TypeNode {
readonly kind: SyntaxKind.TypePredicate;
readonly parent: SignatureDeclaration | JSDocTypeExpression;
readonly assertsModifier?: AssertsKeyword;
readonly parameterName: Identifier | ThisTypeNode;
readonly type?: TypeNode;
}
interface TypeQueryNode extends NodeWithTypeArguments {
readonly kind: SyntaxKind.TypeQuery;
readonly exprName: EntityName;
}
interface TypeLiteralNode extends TypeNode, Declaration {
readonly kind: SyntaxKind.TypeLiteral;
readonly members: NodeArray<TypeElement>;
}
interface ArrayTypeNode extends TypeNode {
readonly kind: SyntaxKind.ArrayType;
readonly elementType: TypeNode;
}
interface TupleTypeNode extends TypeNode {
readonly kind: SyntaxKind.TupleType;
readonly elements: NodeArray<TypeNode | NamedTupleMember>;
}
interface NamedTupleMember extends TypeNode, Declaration, JSDocContainer {
readonly kind: SyntaxKind.NamedTupleMember;
readonly dotDotDotToken?: Token<SyntaxKind.DotDotDotToken>;
readonly name: Identifier;
readonly questionToken?: Token<SyntaxKind.QuestionToken>;
readonly type: TypeNode;
}
interface OptionalTypeNode extends TypeNode {
readonly kind: SyntaxKind.OptionalType;
readonly type: TypeNode;
}
interface RestTypeNode extends TypeNode {
readonly kind: SyntaxKind.RestType;
readonly type: TypeNode;
}
type UnionOrIntersectionTypeNode = UnionTypeNode | IntersectionTypeNode;
interface UnionTypeNode extends TypeNode {
readonly kind: SyntaxKind.UnionType;
readonly types: NodeArray<TypeNode>;
}
interface IntersectionTypeNode extends TypeNode {
readonly kind: SyntaxKind.IntersectionType;
readonly types: NodeArray<TypeNode>;
}
interface ConditionalTypeNode extends TypeNode, LocalsContainer {
readonly kind: SyntaxKind.ConditionalType;
readonly checkType: TypeNode;
readonly extendsType: TypeNode;
readonly trueType: TypeNode;
readonly falseType: TypeNode;
}
interface InferTypeNode extends TypeNode {
readonly kind: SyntaxKind.InferType;
readonly typeParameter: TypeParameterDeclaration;
}
interface ParenthesizedTypeNode extends TypeNode {
readonly kind: SyntaxKind.ParenthesizedType;
readonly type: TypeNode;
}
interface TypeOperatorNode extends TypeNode {
readonly kind: SyntaxKind.TypeOperator;
readonly operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword;
readonly type: TypeNode;
}
interface IndexedAccessTypeNode extends TypeNode {
readonly kind: SyntaxKind.IndexedAccessType;
readonly objectType: TypeNode;
readonly indexType: TypeNode;
}
interface MappedTypeNode extends TypeNode, Declaration, LocalsContainer {
readonly kind: SyntaxKind.MappedType;
readonly readonlyToken?: ReadonlyKeyword | PlusToken | MinusToken;
readonly typeParameter: TypeParameterDeclaration;
readonly nameType?: TypeNode;
readonly questionToken?: QuestionToken | PlusToken | MinusToken;
readonly type?: TypeNode;
/** Used only to produce grammar errors */
readonly members?: NodeArray<TypeElement>;
}
interface LiteralTypeNode extends TypeNode {
readonly kind: SyntaxKind.LiteralType;
readonly literal: NullLiteral | BooleanLiteral | LiteralExpression | PrefixUnaryExpression;
}
interface StringLiteral extends LiteralExpression, Declaration {
readonly kind: SyntaxKind.StringLiteral;
}
type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral;
type PropertyNameLiteral = Identifier | StringLiteralLike | NumericLiteral | JsxNamespacedName;
interface TemplateLiteralTypeNode extends TypeNode {
kind: SyntaxKind.TemplateLiteralType;
readonly head: TemplateHead;
readonly templateSpans: NodeArray<TemplateLiteralTypeSpan>;
}
interface TemplateLiteralTypeSpan extends TypeNode {
readonly kind: SyntaxKind.TemplateLiteralTypeSpan;
readonly parent: TemplateLiteralTypeNode;
readonly type: TypeNode;
readonly literal: TemplateMiddle | TemplateTail;
}
interface Expression extends Node {
_expressionBrand: any;
}
interface OmittedExpression extends Expression {
readonly kind: SyntaxKind.OmittedExpression;
}
interface PartiallyEmittedExpression extends LeftHandSideExpression {
readonly kind: SyntaxKind.PartiallyEmittedExpression;
readonly expression: Expression;
}
interface Un