frida-compile
Version:
Compile a Frida script comprised of one or more Node.js modules
1,019 lines (1,016 loc) • 333 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.1";
/** 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,
FromKeyword = 160,
GlobalKeyword = 161,
BigIntKeyword = 162,
OverrideKeyword = 163,
OfKeyword = 164,
QualifiedName = 165,
ComputedPropertyName = 166,
TypeParameter = 167,
Parameter = 168,
Decorator = 169,
PropertySignature = 170,
PropertyDeclaration = 171,
MethodSignature = 172,
MethodDeclaration = 173,
ClassStaticBlockDeclaration = 174,
Constructor = 175,
GetAccessor = 176,
SetAccessor = 177,
CallSignature = 178,
ConstructSignature = 179,
IndexSignature = 180,
TypePredicate = 181,
TypeReference = 182,
FunctionType = 183,
ConstructorType = 184,
TypeQuery = 185,
TypeLiteral = 186,
ArrayType = 187,
TupleType = 188,
OptionalType = 189,
RestType = 190,
UnionType = 191,
IntersectionType = 192,
ConditionalType = 193,
InferType = 194,
ParenthesizedType = 195,
ThisType = 196,
TypeOperator = 197,
IndexedAccessType = 198,
MappedType = 199,
LiteralType = 200,
NamedTupleMember = 201,
TemplateLiteralType = 202,
TemplateLiteralTypeSpan = 203,
ImportType = 204,
ObjectBindingPattern = 205,
ArrayBindingPattern = 206,
BindingElement = 207,
ArrayLiteralExpression = 208,
ObjectLiteralExpression = 209,
PropertyAccessExpression = 210,
ElementAccessExpression = 211,
CallExpression = 212,
NewExpression = 213,
TaggedTemplateExpression = 214,
TypeAssertionExpression = 215,
ParenthesizedExpression = 216,
FunctionExpression = 217,
ArrowFunction = 218,
DeleteExpression = 219,
TypeOfExpression = 220,
VoidExpression = 221,
AwaitExpression = 222,
PrefixUnaryExpression = 223,
PostfixUnaryExpression = 224,
BinaryExpression = 225,
ConditionalExpression = 226,
TemplateExpression = 227,
YieldExpression = 228,
SpreadElement = 229,
ClassExpression = 230,
OmittedExpression = 231,
ExpressionWithTypeArguments = 232,
AsExpression = 233,
NonNullExpression = 234,
MetaProperty = 235,
SyntheticExpression = 236,
SatisfiesExpression = 237,
TemplateSpan = 238,
SemicolonClassElement = 239,
Block = 240,
EmptyStatement = 241,
VariableStatement = 242,
ExpressionStatement = 243,
IfStatement = 244,
DoStatement = 245,
WhileStatement = 246,
ForStatement = 247,
ForInStatement = 248,
ForOfStatement = 249,
ContinueStatement = 250,
BreakStatement = 251,
ReturnStatement = 252,
WithStatement = 253,
SwitchStatement = 254,
LabeledStatement = 255,
ThrowStatement = 256,
TryStatement = 257,
DebuggerStatement = 258,
VariableDeclaration = 259,
VariableDeclarationList = 260,
FunctionDeclaration = 261,
ClassDeclaration = 262,
InterfaceDeclaration = 263,
TypeAliasDeclaration = 264,
EnumDeclaration = 265,
ModuleDeclaration = 266,
ModuleBlock = 267,
CaseBlock = 268,
NamespaceExportDeclaration = 269,
ImportEqualsDeclaration = 270,
ImportDeclaration = 271,
ImportClause = 272,
NamespaceImport = 273,
NamedImports = 274,
ImportSpecifier = 275,
ExportAssignment = 276,
ExportDeclaration = 277,
NamedExports = 278,
NamespaceExport = 279,
ExportSpecifier = 280,
MissingDeclaration = 281,
ExternalModuleReference = 282,
JsxElement = 283,
JsxSelfClosingElement = 284,
JsxOpeningElement = 285,
JsxClosingElement = 286,
JsxFragment = 287,
JsxOpeningFragment = 288,
JsxClosingFragment = 289,
JsxAttribute = 290,
JsxAttributes = 291,
JsxSpreadAttribute = 292,
JsxExpression = 293,
JsxNamespacedName = 294,
CaseClause = 295,
DefaultClause = 296,
HeritageClause = 297,
CatchClause = 298,
AssertClause = 299,
AssertEntry = 300,
ImportTypeAssertionContainer = 301,
PropertyAssignment = 302,
ShorthandPropertyAssignment = 303,
SpreadAssignment = 304,
EnumMember = 305,
/** @deprecated */ UnparsedPrologue = 306,
/** @deprecated */ UnparsedPrepend = 307,
/** @deprecated */ UnparsedText = 308,
/** @deprecated */ UnparsedInternalText = 309,
/** @deprecated */ UnparsedSyntheticReference = 310,
SourceFile = 311,
Bundle = 312,
/** @deprecated */ UnparsedSource = 313,
/** @deprecated */ InputFiles = 314,
JSDocTypeExpression = 315,
JSDocNameReference = 316,
JSDocMemberName = 317,
JSDocAllType = 318,
JSDocUnknownType = 319,
JSDocNullableType = 320,
JSDocNonNullableType = 321,
JSDocOptionalType = 322,
JSDocFunctionType = 323,
JSDocVariadicType = 324,
JSDocNamepathType = 325,
JSDoc = 326,
/** @deprecated Use SyntaxKind.JSDoc */
JSDocComment = 326,
JSDocText = 327,
JSDocTypeLiteral = 328,
JSDocSignature = 329,
JSDocLink = 330,
JSDocLinkCode = 331,
JSDocLinkPlain = 332,
JSDocTag = 333,
JSDocAugmentsTag = 334,
JSDocImplementsTag = 335,
JSDocAuthorTag = 336,
JSDocDeprecatedTag = 337,
JSDocClassTag = 338,
JSDocPublicTag = 339,
JSDocPrivateTag = 340,
JSDocProtectedTag = 341,
JSDocReadonlyTag = 342,
JSDocOverrideTag = 343,
JSDocCallbackTag = 344,
JSDocOverloadTag = 345,
JSDocEnumTag = 346,
JSDocParameterTag = 347,
JSDocReturnTag = 348,
JSDocThisTag = 349,
JSDocTypeTag = 350,
JSDocTemplateTag = 351,
JSDocTypedefTag = 352,
JSDocSeeTag = 353,
JSDocPropertyTag = 354,
JSDocThrowsTag = 355,
JSDocSatisfiesTag = 356,
SyntaxList = 357,
NotEmittedStatement = 358,
PartiallyEmittedExpression = 359,
CommaListExpression = 360,
SyntheticReferenceExpression = 361,
Count = 362,
FirstAssignment = 64,
LastAssignment = 79,
FirstCompoundAssignment = 65,
LastCompoundAssignment = 79,
FirstReservedWord = 83,
LastReservedWord = 118,
FirstKeyword = 83,
LastKeyword = 164,
FirstFutureReservedWord = 119,
LastFutureReservedWord = 127,
FirstTypeNode = 181,
LastTypeNode = 204,
FirstPunctuation = 19,
LastPunctuation = 79,
FirstToken = 0,
LastToken = 164,
FirstTriviaToken = 2,
LastTriviaToken = 7,
FirstLiteralToken = 9,
LastLiteralToken = 15,
FirstTemplateToken = 15,
LastTemplateToken = 18,
FirstBinaryOperator = 30,
LastBinaryOperator = 79,
FirstStatement = 242,
LastStatement = 258,
FirstNode = 165,
FirstJSDocNode = 315,
LastJSDocNode = 356,
FirstJSDocTagNode = 333,
LastJSDocTagNode = 356
}
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.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,
NestedNamespace = 4,
Synthesized = 8,
Namespace = 16,
OptionalChain = 32,
ExportContext = 64,
ContainsThis = 128,
HasImplicitReturn = 256,
HasExplicitReturn = 512,
GlobalAugmentation = 1024,
HasAsyncFunctions = 2048,
DisallowInContext = 4096,
YieldContext = 8192,
DecoratorContext = 16384,
AwaitContext = 32768,
DisallowConditionalTypesContext = 65536,
ThisNodeHasError = 131072,
JavaScriptFile = 262144,
ThisNodeOrAnySubNodesHasError = 524288,
HasAggregatedChildData = 1048576,
JSDoc = 8388608,
JsonFile = 67108864,
BlockScoped = 3,
ReachabilityCheckFlags = 768,
ReachabilityAndEmitFlags = 2816,
ContextFlags = 50720768,
TypeExcludesFlags = 40960
}
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 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 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 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 UnaryExpression extends Expression {
_unaryExpressionBrand: any;
}
/** Deprecated, please use UpdateExpression */
type IncrementExpression = UpdateExpression;
interface UpdateExpression extends UnaryExpression {
_updateExpressionBrand: any;
}
type PrefixUnaryOperator = SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.TildeToken | SyntaxKind.ExclamationToken;
interface PrefixUnaryExpression extends UpdateExpression {
readonly kind: SyntaxKind.PrefixUnaryExpression;
readonly operator: PrefixUnaryOperator;
readonly operand: UnaryExpression;
}
type PostfixUnaryOperator = SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken;
interface PostfixUnaryExpression extends UpdateExpression {
readonly kind: SyntaxKind.PostfixUnaryExpression;
readonly operand: LeftHandSideExpression;
readonly operator: PostfixUnaryOperator;
}
interface LeftHandSideExpression extends UpdateExpression {
_leftHandSideExpressionBrand: any;
}
interface MemberExpression extends LeftHandSideExpression {
_memberExpressionBrand: any;
}
interface PrimaryExpression extends MemberExpression {
_primaryExpressionBrand: any;
}
interface NullLiteral extends PrimaryExpression {
readonly kind: SyntaxKind.NullKeyword;
}
interface TrueLiteral exten