diff options
Diffstat (limited to 'cli/tsc/dts/typescript.d.ts')
-rw-r--r-- | cli/tsc/dts/typescript.d.ts | 953 |
1 files changed, 533 insertions, 420 deletions
diff --git a/cli/tsc/dts/typescript.d.ts b/cli/tsc/dts/typescript.d.ts index a7871f0fe..c7a8d7836 100644 --- a/cli/tsc/dts/typescript.d.ts +++ b/cli/tsc/dts/typescript.d.ts @@ -46,7 +46,7 @@ declare namespace ts { subPath: string | undefined; } } - const versionMajorMinor = "5.0"; + const versionMajorMinor = "5.1"; /** The version of the TypeScript compiler release */ const version: string; /** @@ -83,395 +83,395 @@ declare namespace ts { WhitespaceTrivia = 5, ShebangTrivia = 6, ConflictMarkerTrivia = 7, - NumericLiteral = 8, - BigIntLiteral = 9, - StringLiteral = 10, - JsxText = 11, - JsxTextAllWhiteSpaces = 12, - RegularExpressionLiteral = 13, - NoSubstitutionTemplateLiteral = 14, - TemplateHead = 15, - TemplateMiddle = 16, - TemplateTail = 17, - OpenBraceToken = 18, - CloseBraceToken = 19, - OpenParenToken = 20, - CloseParenToken = 21, - OpenBracketToken = 22, - CloseBracketToken = 23, - DotToken = 24, - DotDotDotToken = 25, - SemicolonToken = 26, - CommaToken = 27, - QuestionDotToken = 28, - LessThanToken = 29, - LessThanSlashToken = 30, - GreaterThanToken = 31, - LessThanEqualsToken = 32, - GreaterThanEqualsToken = 33, - EqualsEqualsToken = 34, - ExclamationEqualsToken = 35, - EqualsEqualsEqualsToken = 36, - ExclamationEqualsEqualsToken = 37, - EqualsGreaterThanToken = 38, - PlusToken = 39, - MinusToken = 40, - AsteriskToken = 41, - AsteriskAsteriskToken = 42, - SlashToken = 43, - PercentToken = 44, - PlusPlusToken = 45, - MinusMinusToken = 46, - LessThanLessThanToken = 47, - GreaterThanGreaterThanToken = 48, - GreaterThanGreaterThanGreaterThanToken = 49, - AmpersandToken = 50, - BarToken = 51, - CaretToken = 52, - ExclamationToken = 53, - TildeToken = 54, - AmpersandAmpersandToken = 55, - BarBarToken = 56, - QuestionToken = 57, - ColonToken = 58, - AtToken = 59, - QuestionQuestionToken = 60, + 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 = 61, + BacktickToken = 62, /** Only the JSDoc scanner produces HashToken. The normal scanner produces PrivateIdentifier. */ - HashToken = 62, - EqualsToken = 63, - PlusEqualsToken = 64, - MinusEqualsToken = 65, - AsteriskEqualsToken = 66, - AsteriskAsteriskEqualsToken = 67, - SlashEqualsToken = 68, - PercentEqualsToken = 69, - LessThanLessThanEqualsToken = 70, - GreaterThanGreaterThanEqualsToken = 71, - GreaterThanGreaterThanGreaterThanEqualsToken = 72, - AmpersandEqualsToken = 73, - BarEqualsToken = 74, - BarBarEqualsToken = 75, - AmpersandAmpersandEqualsToken = 76, - QuestionQuestionEqualsToken = 77, - CaretEqualsToken = 78, - Identifier = 79, - PrivateIdentifier = 80, - BreakKeyword = 81, - CaseKeyword = 82, - CatchKeyword = 83, - ClassKeyword = 84, - ConstKeyword = 85, - ContinueKeyword = 86, - DebuggerKeyword = 87, - DefaultKeyword = 88, - DeleteKeyword = 89, - DoKeyword = 90, - ElseKeyword = 91, - EnumKeyword = 92, - ExportKeyword = 93, - ExtendsKeyword = 94, - FalseKeyword = 95, - FinallyKeyword = 96, - ForKeyword = 97, - FunctionKeyword = 98, - IfKeyword = 99, - ImportKeyword = 100, - InKeyword = 101, - InstanceOfKeyword = 102, - NewKeyword = 103, - NullKeyword = 104, - ReturnKeyword = 105, - SuperKeyword = 106, - SwitchKeyword = 107, - ThisKeyword = 108, - ThrowKeyword = 109, - TrueKeyword = 110, - TryKeyword = 111, - TypeOfKeyword = 112, - VarKeyword = 113, - VoidKeyword = 114, - WhileKeyword = 115, - WithKeyword = 116, - ImplementsKeyword = 117, - InterfaceKeyword = 118, - LetKeyword = 119, - PackageKeyword = 120, - PrivateKeyword = 121, - ProtectedKeyword = 122, - PublicKeyword = 123, - StaticKeyword = 124, - YieldKeyword = 125, - AbstractKeyword = 126, - AccessorKeyword = 127, - AsKeyword = 128, - AssertsKeyword = 129, - AssertKeyword = 130, - AnyKeyword = 131, - AsyncKeyword = 132, - AwaitKeyword = 133, - BooleanKeyword = 134, - ConstructorKeyword = 135, - DeclareKeyword = 136, - GetKeyword = 137, - InferKeyword = 138, - IntrinsicKeyword = 139, - IsKeyword = 140, - KeyOfKeyword = 141, - ModuleKeyword = 142, - NamespaceKeyword = 143, - NeverKeyword = 144, - OutKeyword = 145, - ReadonlyKeyword = 146, - RequireKeyword = 147, - NumberKeyword = 148, - ObjectKeyword = 149, - SatisfiesKeyword = 150, - SetKeyword = 151, - StringKeyword = 152, - SymbolKeyword = 153, - TypeKeyword = 154, - UndefinedKeyword = 155, - UniqueKeyword = 156, - UnknownKeyword = 157, - FromKeyword = 158, - GlobalKeyword = 159, - BigIntKeyword = 160, - OverrideKeyword = 161, - OfKeyword = 162, - QualifiedName = 163, - ComputedPropertyName = 164, - TypeParameter = 165, - Parameter = 166, - Decorator = 167, - PropertySignature = 168, - PropertyDeclaration = 169, - MethodSignature = 170, - MethodDeclaration = 171, - ClassStaticBlockDeclaration = 172, - Constructor = 173, - GetAccessor = 174, - SetAccessor = 175, - CallSignature = 176, - ConstructSignature = 177, - IndexSignature = 178, - TypePredicate = 179, - TypeReference = 180, - FunctionType = 181, - ConstructorType = 182, - TypeQuery = 183, - TypeLiteral = 184, - ArrayType = 185, - TupleType = 186, - OptionalType = 187, - RestType = 188, - UnionType = 189, - IntersectionType = 190, - ConditionalType = 191, - InferType = 192, - ParenthesizedType = 193, - ThisType = 194, - TypeOperator = 195, - IndexedAccessType = 196, - MappedType = 197, - LiteralType = 198, - NamedTupleMember = 199, - TemplateLiteralType = 200, - TemplateLiteralTypeSpan = 201, - ImportType = 202, - ObjectBindingPattern = 203, - ArrayBindingPattern = 204, - BindingElement = 205, - ArrayLiteralExpression = 206, - ObjectLiteralExpression = 207, - PropertyAccessExpression = 208, - ElementAccessExpression = 209, - CallExpression = 210, - NewExpression = 211, - TaggedTemplateExpression = 212, - TypeAssertionExpression = 213, - ParenthesizedExpression = 214, - FunctionExpression = 215, - ArrowFunction = 216, - DeleteExpression = 217, - TypeOfExpression = 218, - VoidExpression = 219, - AwaitExpression = 220, - PrefixUnaryExpression = 221, - PostfixUnaryExpression = 222, - BinaryExpression = 223, - ConditionalExpression = 224, - TemplateExpression = 225, - YieldExpression = 226, - SpreadElement = 227, - ClassExpression = 228, - OmittedExpression = 229, - ExpressionWithTypeArguments = 230, - AsExpression = 231, - NonNullExpression = 232, - MetaProperty = 233, - SyntheticExpression = 234, - SatisfiesExpression = 235, - TemplateSpan = 236, - SemicolonClassElement = 237, - Block = 238, - EmptyStatement = 239, - VariableStatement = 240, - ExpressionStatement = 241, - IfStatement = 242, - DoStatement = 243, - WhileStatement = 244, - ForStatement = 245, - ForInStatement = 246, - ForOfStatement = 247, - ContinueStatement = 248, - BreakStatement = 249, - ReturnStatement = 250, - WithStatement = 251, - SwitchStatement = 252, - LabeledStatement = 253, - ThrowStatement = 254, - TryStatement = 255, - DebuggerStatement = 256, - VariableDeclaration = 257, - VariableDeclarationList = 258, - FunctionDeclaration = 259, - ClassDeclaration = 260, - InterfaceDeclaration = 261, - TypeAliasDeclaration = 262, - EnumDeclaration = 263, - ModuleDeclaration = 264, - ModuleBlock = 265, - CaseBlock = 266, - NamespaceExportDeclaration = 267, - ImportEqualsDeclaration = 268, - ImportDeclaration = 269, - ImportClause = 270, - NamespaceImport = 271, - NamedImports = 272, - ImportSpecifier = 273, - ExportAssignment = 274, - ExportDeclaration = 275, - NamedExports = 276, - NamespaceExport = 277, - ExportSpecifier = 278, - MissingDeclaration = 279, - ExternalModuleReference = 280, - JsxElement = 281, - JsxSelfClosingElement = 282, - JsxOpeningElement = 283, - JsxClosingElement = 284, - JsxFragment = 285, - JsxOpeningFragment = 286, - JsxClosingFragment = 287, - JsxAttribute = 288, - JsxAttributes = 289, - JsxSpreadAttribute = 290, - JsxExpression = 291, - CaseClause = 292, - DefaultClause = 293, - HeritageClause = 294, - CatchClause = 295, - AssertClause = 296, - AssertEntry = 297, - ImportTypeAssertionContainer = 298, - PropertyAssignment = 299, - ShorthandPropertyAssignment = 300, - SpreadAssignment = 301, - EnumMember = 302, - /** @deprecated */ UnparsedPrologue = 303, - /** @deprecated */ UnparsedPrepend = 304, - /** @deprecated */ UnparsedText = 305, - /** @deprecated */ UnparsedInternalText = 306, - /** @deprecated */ UnparsedSyntheticReference = 307, - SourceFile = 308, - Bundle = 309, - /** @deprecated */ UnparsedSource = 310, - /** @deprecated */ InputFiles = 311, - JSDocTypeExpression = 312, - JSDocNameReference = 313, - JSDocMemberName = 314, - JSDocAllType = 315, - JSDocUnknownType = 316, - JSDocNullableType = 317, - JSDocNonNullableType = 318, - JSDocOptionalType = 319, - JSDocFunctionType = 320, - JSDocVariadicType = 321, - JSDocNamepathType = 322, - JSDoc = 323, + 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 = 323, - JSDocText = 324, - JSDocTypeLiteral = 325, - JSDocSignature = 326, - JSDocLink = 327, - JSDocLinkCode = 328, - JSDocLinkPlain = 329, - JSDocTag = 330, - JSDocAugmentsTag = 331, - JSDocImplementsTag = 332, - JSDocAuthorTag = 333, - JSDocDeprecatedTag = 334, - JSDocClassTag = 335, - JSDocPublicTag = 336, - JSDocPrivateTag = 337, - JSDocProtectedTag = 338, - JSDocReadonlyTag = 339, - JSDocOverrideTag = 340, - JSDocCallbackTag = 341, - JSDocOverloadTag = 342, - JSDocEnumTag = 343, - JSDocParameterTag = 344, - JSDocReturnTag = 345, - JSDocThisTag = 346, - JSDocTypeTag = 347, - JSDocTemplateTag = 348, - JSDocTypedefTag = 349, - JSDocSeeTag = 350, - JSDocPropertyTag = 351, - JSDocThrowsTag = 352, - JSDocSatisfiesTag = 353, - SyntaxList = 354, - NotEmittedStatement = 355, - PartiallyEmittedExpression = 356, - CommaListExpression = 357, - MergeDeclarationMarker = 358, - EndOfDeclarationMarker = 359, - SyntheticReferenceExpression = 360, - Count = 361, - FirstAssignment = 63, - LastAssignment = 78, - FirstCompoundAssignment = 64, - LastCompoundAssignment = 78, - FirstReservedWord = 81, - LastReservedWord = 116, - FirstKeyword = 81, - LastKeyword = 162, - FirstFutureReservedWord = 117, - LastFutureReservedWord = 125, - FirstTypeNode = 179, - LastTypeNode = 202, - FirstPunctuation = 18, - LastPunctuation = 78, + 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 = 162, + LastToken = 164, FirstTriviaToken = 2, LastTriviaToken = 7, - FirstLiteralToken = 8, - LastLiteralToken = 14, - FirstTemplateToken = 14, - LastTemplateToken = 17, - FirstBinaryOperator = 29, - LastBinaryOperator = 78, - FirstStatement = 240, - LastStatement = 256, - FirstNode = 163, - FirstJSDocNode = 312, - LastJSDocNode = 353, - FirstJSDocTagNode = 330, - LastJSDocTagNode = 353 + 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; @@ -582,7 +582,7 @@ declare namespace ts { 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 | ShorthandPropertyAssignment | SpreadAssignment | SwitchStatement | ThrowStatement | TryStatement | TypeAliasDeclaration | TypeParameterDeclaration | VariableDeclaration | VariableStatement | WhileStatement | WithStatement; + 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; @@ -676,7 +676,7 @@ declare namespace ts { type EntityName = Identifier | QualifiedName; type PropertyName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier; type MemberName = Identifier | PrivateIdentifier; - type DeclarationName = Identifier | PrivateIdentifier | StringLiteralLike | NumericLiteral | ComputedPropertyName | ElementAccessExpression | BindingPattern | EntityNameExpression; + type DeclarationName = PropertyName | JsxAttributeName | StringLiteralLike | ElementAccessExpression | BindingPattern | EntityNameExpression; interface Declaration extends Node { _declarationBrand: any; } @@ -861,7 +861,7 @@ declare namespace ts { readonly body?: FunctionBody | undefined; } /** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */ - interface SemicolonClassElement extends ClassElement { + interface SemicolonClassElement extends ClassElement, JSDocContainer { readonly kind: SyntaxKind.SemicolonClassElement; readonly parent: ClassLikeDeclaration; } @@ -1023,7 +1023,7 @@ declare namespace ts { readonly kind: SyntaxKind.StringLiteral; } type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral; - type PropertyNameLiteral = Identifier | StringLiteralLike | NumericLiteral; + type PropertyNameLiteral = Identifier | StringLiteralLike | NumericLiteral | JsxNamespacedName; interface TemplateLiteralTypeNode extends TypeNode { kind: SyntaxKind.TemplateLiteralType; readonly head: TemplateHead; @@ -1379,14 +1379,21 @@ declare namespace ts { } type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; - type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess; + type JsxAttributeName = Identifier | JsxNamespacedName; + type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess | JsxNamespacedName; interface JsxTagNamePropertyAccess extends PropertyAccessExpression { - readonly expression: JsxTagNameExpression; + readonly expression: Identifier | ThisExpression | JsxTagNamePropertyAccess; } - interface JsxAttributes extends ObjectLiteralExpressionBase<JsxAttributeLike> { + interface JsxAttributes extends PrimaryExpression, Declaration { + readonly properties: NodeArray<JsxAttributeLike>; readonly kind: SyntaxKind.JsxAttributes; readonly parent: JsxOpeningLikeElement; } + interface JsxNamespacedName extends Node { + readonly kind: SyntaxKind.JsxNamespacedName; + readonly name: Identifier; + readonly namespace: Identifier; + } interface JsxOpeningElement extends Expression { readonly kind: SyntaxKind.JsxOpeningElement; readonly parent: JsxElement; @@ -1414,10 +1421,10 @@ declare namespace ts { readonly kind: SyntaxKind.JsxClosingFragment; readonly parent: JsxFragment; } - interface JsxAttribute extends ObjectLiteralElement { + interface JsxAttribute extends Declaration { readonly kind: SyntaxKind.JsxAttribute; readonly parent: JsxAttributes; - readonly name: Identifier; + readonly name: JsxAttributeName; readonly initializer?: JsxAttributeValue; } type JsxAttributeValue = StringLiteral | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment; @@ -2459,6 +2466,40 @@ declare namespace ts { getBaseConstraintOfType(type: Type): Type | undefined; getDefaultFromTypeParameter(type: Type): Type | undefined; /** + * Gets the intrinsic `any` type. There are multiple types that act as `any` used internally in the compiler, + * so the type returned by this function should not be used in equality checks to determine if another type + * is `any`. Instead, use `type.flags & TypeFlags.Any`. + */ + getAnyType(): Type; + getStringType(): Type; + getStringLiteralType(value: string): StringLiteralType; + getNumberType(): Type; + getNumberLiteralType(value: number): NumberLiteralType; + getBigIntType(): Type; + getBooleanType(): Type; + getFalseType(): Type; + getTrueType(): Type; + getVoidType(): Type; + /** + * Gets the intrinsic `undefined` type. There are multiple types that act as `undefined` used internally in the compiler + * depending on compiler options, so the type returned by this function should not be used in equality checks to determine + * if another type is `undefined`. Instead, use `type.flags & TypeFlags.Undefined`. + */ + getUndefinedType(): Type; + /** + * Gets the intrinsic `null` type. There are multiple types that act as `null` used internally in the compiler, + * so the type returned by this function should not be used in equality checks to determine if another type + * is `null`. Instead, use `type.flags & TypeFlags.Null`. + */ + getNullType(): Type; + getESSymbolType(): Type; + /** + * Gets the intrinsic `never` type. There are multiple types that act as `never` used internally in the compiler, + * so the type returned by this function should not be used in equality checks to determine if another type + * is `never`. Instead, use `type.flags & TypeFlags.Never`. + */ + getNeverType(): Type; + /** * True if this type is the `Array` or `ReadonlyArray` type from lib.d.ts. * This function will _not_ return true if passed a type which * extends `Array` (for example, the TypeScript AST's `NodeArray` type). @@ -2693,14 +2734,12 @@ declare namespace ts { }) | (void & { __escapedIdentifier: void; }) | InternalSymbolName; - /** ReadonlyMap where keys are `__String`s. */ - interface ReadonlyUnderscoreEscapedMap<T> extends ReadonlyMap<__String, T> { - } - /** Map where keys are `__String`s. */ - interface UnderscoreEscapedMap<T> extends Map<__String, T> { - } + /** @deprecated Use ReadonlyMap<__String, T> instead. */ + type ReadonlyUnderscoreEscapedMap<T> = ReadonlyMap<__String, T>; + /** @deprecated Use Map<__String, T> instead. */ + type UnderscoreEscapedMap<T> = Map<__String, T>; /** SymbolTable based on ES6 Map interface. */ - type SymbolTable = UnderscoreEscapedMap<Symbol>; + type SymbolTable = Map<__String, Symbol>; enum TypeFlags { Any = 1, Unknown = 2, @@ -3491,9 +3530,8 @@ declare namespace ts { ReuseTempVariableScope = 1048576, CustomPrologue = 2097152, NoHoisting = 4194304, - HasEndOfDeclarationMarker = 8388608, - Iterator = 16777216, - NoAsciiEscaping = 33554432 + Iterator = 8388608, + NoAsciiEscaping = 16777216 } interface EmitHelperBase { readonly name: string; @@ -3927,14 +3965,16 @@ declare namespace ts { createJsxOpeningFragment(): JsxOpeningFragment; createJsxJsxClosingFragment(): JsxClosingFragment; updateJsxFragment(node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment): JsxFragment; - createJsxAttribute(name: Identifier, initializer: JsxAttributeValue | undefined): JsxAttribute; - updateJsxAttribute(node: JsxAttribute, name: Identifier, initializer: JsxAttributeValue | undefined): JsxAttribute; + createJsxAttribute(name: JsxAttributeName, initializer: JsxAttributeValue | undefined): JsxAttribute; + updateJsxAttribute(node: JsxAttribute, name: JsxAttributeName, initializer: JsxAttributeValue | undefined): JsxAttribute; createJsxAttributes(properties: readonly JsxAttributeLike[]): JsxAttributes; updateJsxAttributes(node: JsxAttributes, properties: readonly JsxAttributeLike[]): JsxAttributes; createJsxSpreadAttribute(expression: Expression): JsxSpreadAttribute; updateJsxSpreadAttribute(node: JsxSpreadAttribute, expression: Expression): JsxSpreadAttribute; createJsxExpression(dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined): JsxExpression; updateJsxExpression(node: JsxExpression, expression: Expression | undefined): JsxExpression; + createJsxNamespacedName(namespace: Identifier, name: Identifier): JsxNamespacedName; + updateJsxNamespacedName(node: JsxNamespacedName, namespace: Identifier, name: Identifier): JsxNamespacedName; createCaseClause(expression: Expression, statements: readonly Statement[]): CaseClause; updateCaseClause(node: CaseClause, expression: Expression, statements: readonly Statement[]): CaseClause; createDefaultClause(statements: readonly Statement[]): DefaultClause; @@ -4216,7 +4256,6 @@ declare namespace ts { noEmitHelpers?: boolean; } interface GetEffectiveTypeRootsHost { - directoryExists?(directoryName: string): boolean; getCurrentDirectory?(): string; } interface TextSpan { @@ -4418,11 +4457,17 @@ declare namespace ts { function isIdentifierStart(ch: number, languageVersion: ScriptTarget | undefined): boolean; function isIdentifierPart(ch: number, languageVersion: ScriptTarget | undefined, identifierVariant?: LanguageVariant): boolean; function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, textInitial?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner; - type ErrorCallback = (message: DiagnosticMessage, length: number) => void; + type ErrorCallback = (message: DiagnosticMessage, length: number, arg0?: any) => void; interface Scanner { + /** @deprecated use {@link getTokenFullStart} */ getStartPos(): number; getToken(): SyntaxKind; + getTokenFullStart(): number; + getTokenStart(): number; + getTokenEnd(): number; + /** @deprecated use {@link getTokenEnd} */ getTextPos(): number; + /** @deprecated use {@link getTokenStart} */ getTokenPos(): number; getTokenText(): string; getTokenValue(): string; @@ -4436,6 +4481,7 @@ declare namespace ts { reScanSlashToken(): SyntaxKind; reScanAsteriskEqualsToken(): SyntaxKind; reScanTemplateToken(isTaggedTemplate: boolean): SyntaxKind; + /** @deprecated use {@link reScanTemplateToken}(false) */ reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind; scanJsxIdentifier(): SyntaxKind; scanJsxAttributeValue(): SyntaxKind; @@ -4453,7 +4499,9 @@ declare namespace ts { setOnError(onError: ErrorCallback | undefined): void; setScriptTarget(scriptTarget: ScriptTarget): void; setLanguageVariant(variant: LanguageVariant): void; + /** @deprecated use {@link resetTokenState} */ setTextPos(textPos: number): void; + resetTokenState(pos: number): void; lookAhead<T>(callback: () => T): T; scanRange<T>(start: number, length: number, callback: () => T): T; tryScan<T>(callback: () => T): T; @@ -4754,6 +4802,26 @@ declare namespace ts { parent: ConstructorDeclaration; name: Identifier; }; + /** + * This function checks multiple locations for JSDoc comments that apply to a host node. + * At each location, the whole comment may apply to the node, or only a specific tag in + * the comment. In the first case, location adds the entire {@link JSDoc} object. In the + * second case, it adds the applicable {@link JSDocTag}. + * + * For example, a JSDoc comment before a parameter adds the entire {@link JSDoc}. But a + * `@param` tag on the parent function only adds the {@link JSDocTag} for the `@param`. + * + * ```ts + * /** JSDoc will be returned for `a` *\/ + * const a = 0 + * /** + * * Entire JSDoc will be returned for `b` + * * @param c JSDocTag will be returned for `c` + * *\/ + * function b(/** JSDoc will be returned for `c` *\/ c) {} + * ``` + */ + function getJSDocCommentsAndTags(hostNode: Node): readonly (JSDoc | JSDocTag)[]; /** @deprecated */ function createUnparsedSourceFile(text: string): UnparsedSource; /** @deprecated */ @@ -4997,6 +5065,7 @@ declare namespace ts { function isJsxAttributes(node: Node): node is JsxAttributes; function isJsxSpreadAttribute(node: Node): node is JsxSpreadAttribute; function isJsxExpression(node: Node): node is JsxExpression; + function isJsxNamespacedName(node: Node): node is JsxNamespacedName; function isCaseClause(node: Node): node is CaseClause; function isDefaultClause(node: Node): node is DefaultClause; function isHeritageClause(node: Node): node is HeritageClause; @@ -5201,7 +5270,7 @@ declare namespace ts { * this list is only the set of defaults that are implicitly included. */ function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[]; - function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions): ModuleResolutionCache; + function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions, packageJsonInfoCache?: PackageJsonInfoCache): ModuleResolutionCache; function createTypeReferenceDirectiveResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions, packageJsonInfoCache?: PackageJsonInfoCache): TypeReferenceDirectiveResolutionCache; function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache, mode?: ResolutionMode): ResolvedModuleWithFailedLookupLocations | undefined; function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference, resolutionMode?: ResolutionMode): ResolvedModuleWithFailedLookupLocations; @@ -5390,7 +5459,7 @@ declare namespace ts { * Calculates the resulting resolution mode for some reference in some file - this is generally the explicitly * provided resolution mode in the reference, unless one is not present, in which case it is the mode of the containing file. */ - function getModeForFileReference(ref: FileReference | string, containingFileMode: ResolutionMode): ts.ResolutionMode; + function getModeForFileReference(ref: FileReference | string, containingFileMode: ResolutionMode): ResolutionMode; /** * Calculates the final resolution mode for an import at some index within a file's imports list. This is generally the explicitly * defined mode of the import if provided, or, if not, the mode of the containing file (with some exceptions: import=require is always commonjs, dynamic import is always esm). @@ -5410,7 +5479,7 @@ declare namespace ts { */ function getModeForUsageLocation(file: { impliedNodeFormat?: ResolutionMode; - }, usage: StringLiteralLike): ts.ModuleKind.CommonJS | ts.ModuleKind.ESNext | undefined; + }, usage: StringLiteralLike): ModuleKind.CommonJS | ModuleKind.ESNext | undefined; function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): readonly Diagnostic[]; /** * A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the @@ -5591,8 +5660,8 @@ declare namespace ts { */ emitNextAffectedFile(writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): AffectedFileResult<EmitResult>; } - function readBuilderProgram(compilerOptions: CompilerOptions, host: ReadBuildProgramHost): ts.EmitAndSemanticDiagnosticsBuilderProgram | undefined; - function createIncrementalCompilerHost(options: CompilerOptions, system?: ts.System): CompilerHost; + function readBuilderProgram(compilerOptions: CompilerOptions, host: ReadBuildProgramHost): EmitAndSemanticDiagnosticsBuilderProgram | undefined; + function createIncrementalCompilerHost(options: CompilerOptions, system?: System): CompilerHost; function createIncrementalProgram<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>({ rootNames, options, configFileParsingDiagnostics, projectReferences, host, createProgram }: IncrementalProgramOptions<T>): T; /** * Create the watch compiler host for either configFile or fileNames and its options @@ -5748,8 +5817,8 @@ declare namespace ts { * Create a function that reports watch status by writing to the system and handles the formating of the diagnostic */ function createBuilderStatusReporter(system: System, pretty?: boolean): DiagnosticReporter; - function createSolutionBuilderHost<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>(system?: ts.System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportSolutionBuilderStatus?: DiagnosticReporter, reportErrorSummary?: ReportEmitErrorSummary): ts.SolutionBuilderHost<T>; - function createSolutionBuilderWithWatchHost<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>(system?: ts.System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportSolutionBuilderStatus?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter): ts.SolutionBuilderWithWatchHost<T>; + function createSolutionBuilderHost<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>(system?: System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportSolutionBuilderStatus?: DiagnosticReporter, reportErrorSummary?: ReportEmitErrorSummary): SolutionBuilderHost<T>; + function createSolutionBuilderWithWatchHost<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>(system?: System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportSolutionBuilderStatus?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter): SolutionBuilderWithWatchHost<T>; function createSolutionBuilder<T extends BuilderProgram>(host: SolutionBuilderHost<T>, rootNames: readonly string[], defaultOptions: BuildOptions): SolutionBuilder<T>; function createSolutionBuilderWithWatch<T extends BuilderProgram>(host: SolutionBuilderWithWatchHost<T>, rootNames: readonly string[], defaultOptions: BuildOptions, baseWatchOptions?: WatchOptions): SolutionBuilder<T>; interface BuildOptions { @@ -5839,6 +5908,14 @@ declare namespace ts { emit(writeFile?: WriteFileCallback, customTransformers?: CustomTransformers): EmitResult | BuildInvalidedProject<T> | undefined; } type InvalidatedProject<T extends BuilderProgram> = UpdateOutputFileStampsProject | BuildInvalidedProject<T> | UpdateBundleProject<T>; + namespace JsTyping { + interface TypingResolutionHost { + directoryExists(path: string): boolean; + fileExists(fileName: string): boolean; + readFile(path: string, encoding?: string): string | undefined; + readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[] | undefined, depth?: number): string[]; + } + } namespace server { type ActionSet = "action::set"; type ActionInvalidate = "action::invalidate"; @@ -5847,8 +5924,9 @@ declare namespace ts { type EventBeginInstallTypes = "event::beginInstallTypes"; type EventEndInstallTypes = "event::endInstallTypes"; type EventInitializationFailed = "event::initializationFailed"; + type ActionWatchTypingLocations = "action::watchTypingLocations"; interface TypingInstallerResponse { - readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed; + readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed | ActionWatchTypingLocations; } interface TypingInstallerRequestWithProjectName { readonly projectName: string; @@ -5857,7 +5935,6 @@ declare namespace ts { readonly fileNames: string[]; readonly projectRootPath: Path; readonly compilerOptions: CompilerOptions; - readonly watchOptions?: WatchOptions; readonly typeAcquisition: TypeAcquisition; readonly unresolvedImports: SortedReadonlyArray<string>; readonly cachePath?: string; @@ -5904,6 +5981,12 @@ declare namespace ts { readonly kind: EventEndInstallTypes; readonly installSuccess: boolean; } + interface InstallTypingHost extends JsTyping.TypingResolutionHost { + useCaseSensitiveFileNames: boolean; + writeFile(path: string, content: string): void; + createDirectory(path: string): void; + getCurrentDirectory?(): string; + } interface SetTypings extends ProjectResponse { readonly typeAcquisition: TypeAcquisition; readonly compilerOptions: CompilerOptions; @@ -5911,6 +5994,11 @@ declare namespace ts { readonly unresolvedImports: SortedReadonlyArray<string>; readonly kind: ActionSet; } + interface WatchTypingLocations extends ProjectResponse { + /** if files is undefined, retain same set of watchers */ + readonly files: readonly string[] | undefined; + readonly kind: ActionWatchTypingLocations; + } } function getDefaultFormatCodeSettings(newLineCharacter?: string): FormatCodeSettings; /** @@ -6116,6 +6204,8 @@ declare namespace ts { getRenameInfo(fileName: string, position: number, preferences: UserPreferences): RenameInfo; /** @deprecated Use the signature with `UserPreferences` instead. */ getRenameInfo(fileName: string, position: number, options?: RenameInfoOptions): RenameInfo; + findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, preferences: UserPreferences): readonly RenameLocation[] | undefined; + /** @deprecated Pass `providePrefixAndSuffixTextForRename` as part of a `UserPreferences` parameter. */ findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename?: boolean): readonly RenameLocation[] | undefined; getSmartSelectionRange(fileName: string, position: number): SelectionRange; getDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined; @@ -6126,8 +6216,6 @@ declare namespace ts { findReferences(fileName: string, position: number): ReferencedSymbol[] | undefined; getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): DocumentHighlights[] | undefined; getFileReferences(fileName: string): ReferenceEntry[]; - /** @deprecated */ - getOccurrencesAtPosition(fileName: string, position: number): readonly ReferenceEntry[] | undefined; getNavigateToItems(searchValue: string, maxResultCount?: number, fileName?: string, excludeDtsFiles?: boolean): NavigateToItem[]; getNavigationBarItems(fileName: string): NavigationBarItem[]; getNavigationTree(fileName: string): NavigationTree; @@ -6149,6 +6237,7 @@ declare namespace ts { * Editors should call this after `>` is typed. */ getJsxClosingTagAtPosition(fileName: string, position: number): JsxClosingTagInfo | undefined; + getLinkedEditingRangeAtPosition(fileName: string, position: number): LinkedEditingInfo | undefined; getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan | undefined; toLineColumnOffset?(fileName: string, position: number): LineAndCharacter; getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: readonly number[], formatOptions: FormatCodeSettings, preferences: UserPreferences): readonly CodeFixAction[]; @@ -6162,8 +6251,18 @@ declare namespace ts { applyCodeActionCommand(fileName: string, action: CodeActionCommand[]): Promise<ApplyCodeActionCommandResult[]>; /** @deprecated `fileName` will be ignored */ applyCodeActionCommand(fileName: string, action: CodeActionCommand | CodeActionCommand[]): Promise<ApplyCodeActionCommandResult | ApplyCodeActionCommandResult[]>; - getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined, triggerReason?: RefactorTriggerReason, kind?: string): ApplicableRefactorInfo[]; - getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | undefined): RefactorEditInfo | undefined; + /** + * @param includeInteractiveActions Include refactor actions that require additional arguments to be + * passed when calling `getEditsForRefactor`. When true, clients should inspect the `isInteractive` + * property of each returned `RefactorActionInfo` and ensure they are able to collect the appropriate + * arguments for any interactive action before offering it. + */ + getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined, triggerReason?: RefactorTriggerReason, kind?: string, includeInteractiveActions?: boolean): ApplicableRefactorInfo[]; + getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | undefined, interactiveRefactorArguments?: InteractiveRefactorArguments): RefactorEditInfo | undefined; + getMoveToRefactoringFileSuggestions(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined, triggerReason?: RefactorTriggerReason, kind?: string): { + newFileName: string; + files: string[]; + }; organizeImports(args: OrganizeImportsArgs, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[]; getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[]; getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean, forceDtsEmit?: boolean): EmitOutput; @@ -6178,6 +6277,10 @@ declare namespace ts { interface JsxClosingTagInfo { readonly newText: string; } + interface LinkedEditingInfo { + readonly ranges: TextSpan[]; + wordPattern?: string; + } interface CombinedCodeFixScope { type: "file"; fileName: string; @@ -6430,6 +6533,11 @@ declare namespace ts { * The hierarchical dotted name of the refactor action. */ kind?: string; + /** + * Indicates that the action requires additional arguments to be passed + * when calling `getEditsForRefactor`. + */ + isInteractive?: boolean; } /** * A set of edits to make in response to a refactor action, plus an optional @@ -6440,6 +6548,7 @@ declare namespace ts { renameFilename?: string; renameLocation?: number; commands?: CodeActionCommand[]; + notApplicableReason?: string; } type RefactorTriggerReason = "implicit" | "invoked"; interface TextInsertion { @@ -6566,6 +6675,7 @@ declare namespace ts { readonly insertSpaceBeforeTypeAnnotation?: boolean; readonly indentMultiLineObjectLiteralBeginningOnBlankLine?: boolean; readonly semicolons?: SemicolonPreference; + readonly indentSwitchCase?: boolean; } interface DefinitionInfo extends DocumentSpan { kind: ScriptElementKind; @@ -6661,6 +6771,9 @@ declare namespace ts { interface DocCommentTemplateOptions { readonly generateReturnInDocTemplate?: boolean; } + interface InteractiveRefactorArguments { + targetFile: string; + } interface SignatureHelpParameter { name: string; documentation: SymbolDisplayPart[]; |