diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a8a92caf90451..0c0adc60a772e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -26544,6 +26544,8 @@ namespace ts { } case SyntaxKind.NonNullExpression: return getContextualType(parent as NonNullExpression, contextFlags); + case SyntaxKind.SatisfiesExpression: + return getTypeFromTypeNode((parent as SatisfiesExpression).type); case SyntaxKind.JsxExpression: return getContextualTypeForJsxExpression(parent as JsxExpression); case SyntaxKind.JsxAttribute: @@ -31348,6 +31350,20 @@ namespace ts { getNonNullableType(checkExpression(node.expression)); } + function checkSatisfiesExpression(node: SatisfiesExpression) { + checkSourceElement(node.type); + + const targetType = getTypeFromTypeNode(node.type); + if (isErrorType(targetType)) { + return targetType; + } + + const exprType = checkExpression(node.expression); + checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1); + + return exprType; + } + function checkMetaProperty(node: MetaProperty): Type { checkGrammarMetaProperty(node); @@ -34100,6 +34116,8 @@ namespace ts { return checkAssertion(node as AssertionExpression); case SyntaxKind.NonNullExpression: return checkNonNullAssertion(node as NonNullExpression); + case SyntaxKind.SatisfiesExpression: + return checkSatisfiesExpression(node as SatisfiesExpression); case SyntaxKind.MetaProperty: return checkMetaProperty(node as MetaProperty); case SyntaxKind.DeleteExpression: diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 778a9304aa75e..03840c9a57e4c 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1060,6 +1060,10 @@ "category": "Error", "code": 1359 }, + "Type '{0}' does not satisfy the expected type '{1}'.": { + "category": "Error", + "code": 1360 + }, "'{0}' cannot be used as a value because it was imported using 'import type'.": { "category": "Error", "code": 1361 @@ -6173,6 +6177,10 @@ "category": "Error", "code": 8034 }, + "Type satisfaction expressions can only be used in TypeScript files.": { + "category": "Error", + "code": 8035 + }, "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit.": { "category": "Error", "code": 9005 diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 0df29c10ad657..340d1a2169c4f 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1727,6 +1727,8 @@ namespace ts { return emitAsExpression(node as AsExpression); case SyntaxKind.NonNullExpression: return emitNonNullExpression(node as NonNullExpression); + case SyntaxKind.SatisfiesExpression: + return emitSatisfiesExpression(node as SatisfiesExpression); case SyntaxKind.MetaProperty: return emitMetaProperty(node as MetaProperty); case SyntaxKind.SyntheticExpression: @@ -2799,6 +2801,16 @@ namespace ts { writeOperator("!"); } + function emitSatisfiesExpression(node: SatisfiesExpression) { + emitExpression(node.expression, /*parenthesizerRules*/ undefined); + if (node.type) { + writeSpace(); + writeKeyword("satisfies"); + writeSpace(); + emit(node.type); + } + } + function emitMetaProperty(node: MetaProperty) { writeToken(node.keywordToken, node.pos, writePunctuation); writePunctuation("."); diff --git a/src/compiler/factory/nodeFactory.ts b/src/compiler/factory/nodeFactory.ts index 34fd2365365fe..b08614bce9590 100644 --- a/src/compiler/factory/nodeFactory.ts +++ b/src/compiler/factory/nodeFactory.ts @@ -218,6 +218,8 @@ namespace ts { updateAsExpression, createNonNullExpression, updateNonNullExpression, + createSatisfiesExpression, + updateSatisfiesExpression, createNonNullChain, updateNonNullChain, createMetaProperty, @@ -3099,6 +3101,26 @@ namespace ts { : node; } + // @api + function createSatisfiesExpression(expression: Expression, type: TypeNode) { + const node = createBaseExpression(SyntaxKind.SatisfiesExpression); + node.expression = expression; + node.type = type; + node.transformFlags |= + propagateChildFlags(node.expression) | + propagateChildFlags(node.type) | + TransformFlags.ContainsTypeScript; + return node; + } + + // @api + function updateSatisfiesExpression(node: SatisfiesExpression, expression: Expression, type: TypeNode) { + return node.expression !== expression + || node.type !== type + ? update(createSatisfiesExpression(expression, type), node) + : node; + } + // @api function createNonNullChain(expression: Expression) { const node = createBaseExpression(SyntaxKind.NonNullExpression); @@ -5590,6 +5612,7 @@ namespace ts { case SyntaxKind.ParenthesizedExpression: return updateParenthesizedExpression(outerExpression, expression); case SyntaxKind.TypeAssertionExpression: return updateTypeAssertion(outerExpression, outerExpression.type, expression); case SyntaxKind.AsExpression: return updateAsExpression(outerExpression, expression, outerExpression.type); + case SyntaxKind.SatisfiesExpression: return updateSatisfiesExpression(outerExpression, expression, outerExpression.type); case SyntaxKind.NonNullExpression: return updateNonNullExpression(outerExpression, expression); case SyntaxKind.PartiallyEmittedExpression: return updatePartiallyEmittedExpression(outerExpression, expression); } @@ -6320,6 +6343,7 @@ namespace ts { case SyntaxKind.ArrayBindingPattern: return TransformFlags.BindingPatternExcludes; case SyntaxKind.TypeAssertionExpression: + case SyntaxKind.SatisfiesExpression: case SyntaxKind.AsExpression: case SyntaxKind.PartiallyEmittedExpression: case SyntaxKind.ParenthesizedExpression: diff --git a/src/compiler/factory/nodeTests.ts b/src/compiler/factory/nodeTests.ts index 274ade1886dfc..f9e3423ecbd22 100644 --- a/src/compiler/factory/nodeTests.ts +++ b/src/compiler/factory/nodeTests.ts @@ -433,6 +433,10 @@ namespace ts { return node.kind === SyntaxKind.AsExpression; } + export function isSatisfiesExpression(node: Node): node is SatisfiesExpression { + return node.kind === SyntaxKind.SatisfiesExpression; + } + export function isNonNullExpression(node: Node): node is NonNullExpression { return node.kind === SyntaxKind.NonNullExpression; } diff --git a/src/compiler/factory/utilities.ts b/src/compiler/factory/utilities.ts index 7daa31c522732..8645a2aae8d47 100644 --- a/src/compiler/factory/utilities.ts +++ b/src/compiler/factory/utilities.ts @@ -437,6 +437,7 @@ namespace ts { return (kinds & OuterExpressionKinds.Parentheses) !== 0; case SyntaxKind.TypeAssertionExpression: case SyntaxKind.AsExpression: + case SyntaxKind.SatisfiesExpression: return (kinds & OuterExpressionKinds.TypeAssertions) !== 0; case SyntaxKind.NonNullExpression: return (kinds & OuterExpressionKinds.NonNullAssertions) !== 0; diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index a7774937f9dc7..6da106be85f36 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -276,6 +276,9 @@ namespace ts { visitNode(cbNode, (node as AsExpression).type); case SyntaxKind.NonNullExpression: return visitNode(cbNode, (node as NonNullExpression).expression); + case SyntaxKind.SatisfiesExpression: + return visitNode(cbNode, (node as SatisfiesExpression).expression) || + visitNode(cbNode, (node as SatisfiesExpression).type); case SyntaxKind.MetaProperty: return visitNode(cbNode, (node as MetaProperty).name); case SyntaxKind.ConditionalExpression: @@ -4677,7 +4680,7 @@ namespace ts { break; } - if (token() === SyntaxKind.AsKeyword) { + if (token() === SyntaxKind.AsKeyword || token() === SyntaxKind.SatisfiesKeyword) { // Make sure we *do* perform ASI for constructs like this: // var x = foo // as (Bar) @@ -4687,8 +4690,10 @@ namespace ts { break; } else { + const keywordKind = token(); nextToken(); - leftOperand = makeAsExpression(leftOperand, parseType()); + leftOperand = keywordKind === SyntaxKind.SatisfiesKeyword ? makeSatisfiesExpression(leftOperand, parseType()) : + makeAsExpression(leftOperand, parseType()); } } else { @@ -4707,6 +4712,10 @@ namespace ts { return getBinaryOperatorPrecedence(token()) > 0; } + function makeSatisfiesExpression(left: Expression, right: TypeNode): SatisfiesExpression { + return finishNode(factory.createSatisfiesExpression(left, right), left.pos); + } + function makeBinaryExpression(left: Expression, operatorToken: BinaryOperatorToken, right: Expression, pos: number): BinaryExpression { return finishNode(factory.createBinaryExpression(left, operatorToken, right), pos); } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 80115dbd35dab..117bebe96cc29 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -2274,6 +2274,9 @@ namespace ts { case SyntaxKind.AsExpression: diagnostics.push(createDiagnosticForNode((node as AsExpression).type, Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; + case SyntaxKind.SatisfiesExpression: + diagnostics.push(createDiagnosticForNode((node as SatisfiesExpression).type, Diagnostics.Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files)); + return "skip"; case SyntaxKind.TypeAssertionExpression: Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 6cac0cb1936d1..07cfe1cb0407f 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -135,6 +135,7 @@ namespace ts { require: SyntaxKind.RequireKeyword, global: SyntaxKind.GlobalKeyword, return: SyntaxKind.ReturnKeyword, + satisfies: SyntaxKind.SatisfiesKeyword, set: SyntaxKind.SetKeyword, static: SyntaxKind.StaticKeyword, string: SyntaxKind.StringKeyword, diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index 86dedd9d6d2c3..57f38fcb3faba 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -513,6 +513,9 @@ namespace ts { // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node as AssertionExpression); + case SyntaxKind.SatisfiesExpression: + return visitSatisfiesExpression(node as SatisfiesExpression); + case SyntaxKind.CallExpression: return visitCallExpression(node as CallExpression); @@ -2257,6 +2260,11 @@ namespace ts { return factory.createPartiallyEmittedExpression(expression, node); } + function visitSatisfiesExpression(node: SatisfiesExpression): Expression { + const expression = visitNode(node.expression, visitor, isExpression); + return factory.createPartiallyEmittedExpression(expression, node); + } + function visitCallExpression(node: CallExpression) { return factory.updateCallExpression( node, diff --git a/src/compiler/types.ts b/src/compiler/types.ts index e7e60dc025210..e37d5f8ca603a 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -180,6 +180,7 @@ namespace ts { RequireKeyword, NumberKeyword, ObjectKeyword, + SatisfiesKeyword, SetKeyword, StringKeyword, SymbolKeyword, @@ -273,6 +274,7 @@ namespace ts { NonNullExpression, MetaProperty, SyntheticExpression, + SatisfiesExpression, // Misc TemplateSpan, @@ -602,6 +604,7 @@ namespace ts { | SyntaxKind.OverrideKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword + | SyntaxKind.SatisfiesKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword @@ -2485,6 +2488,12 @@ namespace ts { readonly expression: UnaryExpression; } + export interface SatisfiesExpression extends Expression { + readonly kind: SyntaxKind.SatisfiesExpression; + readonly expression: Expression; + readonly type: TypeNode; + } + export type AssertionExpression = | TypeAssertion | AsExpression @@ -7037,6 +7046,7 @@ namespace ts { export type OuterExpression = | ParenthesizedExpression | TypeAssertion + | SatisfiesExpression | AsExpression | NonNullExpression | PartiallyEmittedExpression; @@ -7366,6 +7376,8 @@ namespace ts { updateNonNullChain(node: NonNullChain, expression: Expression): NonNullChain; createMetaProperty(keywordToken: MetaProperty["keywordToken"], name: Identifier): MetaProperty; updateMetaProperty(node: MetaProperty, name: Identifier): MetaProperty; + createSatisfiesExpression(expression: Expression, type: TypeNode): SatisfiesExpression; + updateSatisfiesExpression(node: SatisfiesExpression, expression: Expression, type: TypeNode): SatisfiesExpression; // // Misc diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 72ce071940dcc..19f76ab92a53c 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1921,6 +1921,7 @@ namespace ts { case SyntaxKind.TaggedTemplateExpression: case SyntaxKind.AsExpression: case SyntaxKind.TypeAssertionExpression: + case SyntaxKind.SatisfiesExpression: case SyntaxKind.NonNullExpression: case SyntaxKind.ParenthesizedExpression: case SyntaxKind.FunctionExpression: @@ -2019,6 +2020,8 @@ namespace ts { return (parent as ExpressionWithTypeArguments).expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); case SyntaxKind.ShorthandPropertyAssignment: return (parent as ShorthandPropertyAssignment).objectAssignmentInitializer === node; + case SyntaxKind.SatisfiesExpression: + return node === (parent as SatisfiesExpression).expression; default: return isExpressionNode(parent); } @@ -3707,6 +3710,7 @@ namespace ts { return OperatorPrecedence.Member; case SyntaxKind.AsExpression: + case SyntaxKind.SatisfiesExpression: return OperatorPrecedence.Relational; case SyntaxKind.ThisKeyword: @@ -3765,6 +3769,7 @@ namespace ts { case SyntaxKind.InstanceOfKeyword: case SyntaxKind.InKeyword: case SyntaxKind.AsKeyword: + case SyntaxKind.SatisfiesKeyword: return OperatorPrecedence.Relational; case SyntaxKind.LessThanLessThanToken: case SyntaxKind.GreaterThanGreaterThanToken: @@ -5772,7 +5777,8 @@ namespace ts { case SyntaxKind.PropertyAccessExpression: case SyntaxKind.NonNullExpression: case SyntaxKind.PartiallyEmittedExpression: - node = (node as CallExpression | PropertyAccessExpression | ElementAccessExpression | AsExpression | NonNullExpression | PartiallyEmittedExpression).expression; + case SyntaxKind.SatisfiesExpression: + node = (node as CallExpression | PropertyAccessExpression | ElementAccessExpression | AsExpression | NonNullExpression | PartiallyEmittedExpression | SatisfiesExpression).expression; continue; } diff --git a/src/compiler/utilitiesPublic.ts b/src/compiler/utilitiesPublic.ts index 8f834e5e45971..7a94335d5d1cc 100644 --- a/src/compiler/utilitiesPublic.ts +++ b/src/compiler/utilitiesPublic.ts @@ -1592,6 +1592,7 @@ namespace ts { case SyntaxKind.OmittedExpression: case SyntaxKind.CommaListExpression: case SyntaxKind.PartiallyEmittedExpression: + case SyntaxKind.SatisfiesExpression: return true; default: return isUnaryExpressionKind(kind); diff --git a/src/compiler/visitorPublic.ts b/src/compiler/visitorPublic.ts index 5651ac043d325..f4c358738709f 100644 --- a/src/compiler/visitorPublic.ts +++ b/src/compiler/visitorPublic.ts @@ -851,6 +851,12 @@ namespace ts { nodeVisitor(node.expression, visitor, isExpression), nodeVisitor(node.type, visitor, isTypeNode)); + case SyntaxKind.SatisfiesExpression: + Debug.type(node); + return factory.updateSatisfiesExpression(node, + nodeVisitor(node.expression, visitor, isExpression), + nodeVisitor(node.type, visitor, isTypeNode)); + case SyntaxKind.NonNullExpression: if (node.flags & NodeFlags.OptionalChain) { Debug.type(node); diff --git a/src/harness/fourslashInterfaceImpl.ts b/src/harness/fourslashInterfaceImpl.ts index 8fdd386af1e61..151f3d72b2beb 100644 --- a/src/harness/fourslashInterfaceImpl.ts +++ b/src/harness/fourslashInterfaceImpl.ts @@ -1346,6 +1346,7 @@ namespace FourSlashInterface { "package", "readonly", "return", + "satisfies", "string", "super", "switch", @@ -1461,6 +1462,7 @@ namespace FourSlashInterface { "null", "package", "return", + "satisfies", "super", "switch", "this", @@ -1558,6 +1560,7 @@ namespace FourSlashInterface { "package", "readonly", "return", + "satisfies", "string", "super", "switch", @@ -1612,6 +1615,7 @@ namespace FourSlashInterface { "null", "package", "return", + "satisfies", "super", "switch", "this", diff --git a/src/services/callHierarchy.ts b/src/services/callHierarchy.ts index bfb533b0160b2..57f6d5af275e8 100644 --- a/src/services/callHierarchy.ts +++ b/src/services/callHierarchy.ts @@ -449,6 +449,10 @@ namespace ts.CallHierarchy { recordCallSite(node as AccessExpression); forEachChild(node, collect); break; + case SyntaxKind.SatisfiesExpression: + // do not descend into the type side of an assertion + collect((node as SatisfiesExpression).expression); + return; } if (isPartOfTypeNode(node)) { diff --git a/src/services/classifier.ts b/src/services/classifier.ts index ed8445b8f3987..9565903f556bb 100644 --- a/src/services/classifier.ts +++ b/src/services/classifier.ts @@ -369,6 +369,7 @@ namespace ts { case SyntaxKind.InstanceOfKeyword: case SyntaxKind.InKeyword: case SyntaxKind.AsKeyword: + case SyntaxKind.SatisfiesKeyword: case SyntaxKind.EqualsEqualsToken: case SyntaxKind.ExclamationEqualsToken: case SyntaxKind.EqualsEqualsEqualsToken: diff --git a/src/services/completions.ts b/src/services/completions.ts index ca265f268f035..1a000bd1df8be 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -2360,6 +2360,9 @@ namespace ts.Completions { case SyntaxKind.ExtendsKeyword: return parentKind === SyntaxKind.TypeParameter; + + case SyntaxKind.SatisfiesKeyword: + return parentKind === SyntaxKind.SatisfiesExpression; } } return false; @@ -3522,6 +3525,7 @@ namespace ts.Completions { return kind === SyntaxKind.AsyncKeyword || kind === SyntaxKind.AwaitKeyword || kind === SyntaxKind.AsKeyword + || kind === SyntaxKind.SatisfiesKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); } diff --git a/src/services/formatting/rules.ts b/src/services/formatting/rules.ts index 76a0d34853153..974bc208fbd9e 100644 --- a/src/services/formatting/rules.ts +++ b/src/services/formatting/rules.ts @@ -449,6 +449,7 @@ namespace ts.formatting { case SyntaxKind.TypePredicate: case SyntaxKind.UnionType: case SyntaxKind.IntersectionType: + case SyntaxKind.SatisfiesExpression: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 4df9e6328ecbd..c90b246ada69d 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -253,212 +253,214 @@ declare namespace ts { RequireKeyword = 145, NumberKeyword = 146, ObjectKeyword = 147, - SetKeyword = 148, - StringKeyword = 149, - SymbolKeyword = 150, - TypeKeyword = 151, - UndefinedKeyword = 152, - UniqueKeyword = 153, - UnknownKeyword = 154, - FromKeyword = 155, - GlobalKeyword = 156, - BigIntKeyword = 157, - OverrideKeyword = 158, - OfKeyword = 159, - QualifiedName = 160, - ComputedPropertyName = 161, - TypeParameter = 162, - Parameter = 163, - Decorator = 164, - PropertySignature = 165, - PropertyDeclaration = 166, - MethodSignature = 167, - MethodDeclaration = 168, - ClassStaticBlockDeclaration = 169, - Constructor = 170, - GetAccessor = 171, - SetAccessor = 172, - CallSignature = 173, - ConstructSignature = 174, - IndexSignature = 175, - TypePredicate = 176, - TypeReference = 177, - FunctionType = 178, - ConstructorType = 179, - TypeQuery = 180, - TypeLiteral = 181, - ArrayType = 182, - TupleType = 183, - OptionalType = 184, - RestType = 185, - UnionType = 186, - IntersectionType = 187, - ConditionalType = 188, - InferType = 189, - ParenthesizedType = 190, - ThisType = 191, - TypeOperator = 192, - IndexedAccessType = 193, - MappedType = 194, - LiteralType = 195, - NamedTupleMember = 196, - TemplateLiteralType = 197, - TemplateLiteralTypeSpan = 198, - ImportType = 199, - ObjectBindingPattern = 200, - ArrayBindingPattern = 201, - BindingElement = 202, - ArrayLiteralExpression = 203, - ObjectLiteralExpression = 204, - PropertyAccessExpression = 205, - ElementAccessExpression = 206, - CallExpression = 207, - NewExpression = 208, - TaggedTemplateExpression = 209, - TypeAssertionExpression = 210, - ParenthesizedExpression = 211, - FunctionExpression = 212, - ArrowFunction = 213, - DeleteExpression = 214, - TypeOfExpression = 215, - VoidExpression = 216, - AwaitExpression = 217, - PrefixUnaryExpression = 218, - PostfixUnaryExpression = 219, - BinaryExpression = 220, - ConditionalExpression = 221, - TemplateExpression = 222, - YieldExpression = 223, - SpreadElement = 224, - ClassExpression = 225, - OmittedExpression = 226, - ExpressionWithTypeArguments = 227, - AsExpression = 228, - NonNullExpression = 229, - MetaProperty = 230, - SyntheticExpression = 231, - TemplateSpan = 232, - SemicolonClassElement = 233, - Block = 234, - EmptyStatement = 235, - VariableStatement = 236, - ExpressionStatement = 237, - IfStatement = 238, - DoStatement = 239, - WhileStatement = 240, - ForStatement = 241, - ForInStatement = 242, - ForOfStatement = 243, - ContinueStatement = 244, - BreakStatement = 245, - ReturnStatement = 246, - WithStatement = 247, - SwitchStatement = 248, - LabeledStatement = 249, - ThrowStatement = 250, - TryStatement = 251, - DebuggerStatement = 252, - VariableDeclaration = 253, - VariableDeclarationList = 254, - FunctionDeclaration = 255, - ClassDeclaration = 256, - InterfaceDeclaration = 257, - TypeAliasDeclaration = 258, - EnumDeclaration = 259, - ModuleDeclaration = 260, - ModuleBlock = 261, - CaseBlock = 262, - NamespaceExportDeclaration = 263, - ImportEqualsDeclaration = 264, - ImportDeclaration = 265, - ImportClause = 266, - NamespaceImport = 267, - NamedImports = 268, - ImportSpecifier = 269, - ExportAssignment = 270, - ExportDeclaration = 271, - NamedExports = 272, - NamespaceExport = 273, - ExportSpecifier = 274, - MissingDeclaration = 275, - ExternalModuleReference = 276, - JsxElement = 277, - JsxSelfClosingElement = 278, - JsxOpeningElement = 279, - JsxClosingElement = 280, - JsxFragment = 281, - JsxOpeningFragment = 282, - JsxClosingFragment = 283, - JsxAttribute = 284, - JsxAttributes = 285, - JsxSpreadAttribute = 286, - JsxExpression = 287, - CaseClause = 288, - DefaultClause = 289, - HeritageClause = 290, - CatchClause = 291, - AssertClause = 292, - AssertEntry = 293, - PropertyAssignment = 294, - ShorthandPropertyAssignment = 295, - SpreadAssignment = 296, - EnumMember = 297, - UnparsedPrologue = 298, - UnparsedPrepend = 299, - UnparsedText = 300, - UnparsedInternalText = 301, - UnparsedSyntheticReference = 302, - SourceFile = 303, - Bundle = 304, - UnparsedSource = 305, - InputFiles = 306, - JSDocTypeExpression = 307, - JSDocNameReference = 308, - JSDocMemberName = 309, - JSDocAllType = 310, - JSDocUnknownType = 311, - JSDocNullableType = 312, - JSDocNonNullableType = 313, - JSDocOptionalType = 314, - JSDocFunctionType = 315, - JSDocVariadicType = 316, - JSDocNamepathType = 317, - JSDocComment = 318, - JSDocText = 319, - JSDocTypeLiteral = 320, - JSDocSignature = 321, - JSDocLink = 322, - JSDocLinkCode = 323, - JSDocLinkPlain = 324, - JSDocTag = 325, - JSDocAugmentsTag = 326, - JSDocImplementsTag = 327, - JSDocAuthorTag = 328, - JSDocDeprecatedTag = 329, - JSDocClassTag = 330, - JSDocPublicTag = 331, - JSDocPrivateTag = 332, - JSDocProtectedTag = 333, - JSDocReadonlyTag = 334, - JSDocOverrideTag = 335, - JSDocCallbackTag = 336, - JSDocEnumTag = 337, - JSDocParameterTag = 338, - JSDocReturnTag = 339, - JSDocThisTag = 340, - JSDocTypeTag = 341, - JSDocTemplateTag = 342, - JSDocTypedefTag = 343, - JSDocSeeTag = 344, - JSDocPropertyTag = 345, - SyntaxList = 346, - NotEmittedStatement = 347, - PartiallyEmittedExpression = 348, - CommaListExpression = 349, - MergeDeclarationMarker = 350, - EndOfDeclarationMarker = 351, - SyntheticReferenceExpression = 352, - Count = 353, + SatisfiesKeyword = 148, + SetKeyword = 149, + StringKeyword = 150, + SymbolKeyword = 151, + TypeKeyword = 152, + UndefinedKeyword = 153, + UniqueKeyword = 154, + UnknownKeyword = 155, + FromKeyword = 156, + GlobalKeyword = 157, + BigIntKeyword = 158, + OverrideKeyword = 159, + OfKeyword = 160, + QualifiedName = 161, + ComputedPropertyName = 162, + TypeParameter = 163, + Parameter = 164, + Decorator = 165, + PropertySignature = 166, + PropertyDeclaration = 167, + MethodSignature = 168, + MethodDeclaration = 169, + ClassStaticBlockDeclaration = 170, + Constructor = 171, + GetAccessor = 172, + SetAccessor = 173, + CallSignature = 174, + ConstructSignature = 175, + IndexSignature = 176, + TypePredicate = 177, + TypeReference = 178, + FunctionType = 179, + ConstructorType = 180, + TypeQuery = 181, + TypeLiteral = 182, + ArrayType = 183, + TupleType = 184, + OptionalType = 185, + RestType = 186, + UnionType = 187, + IntersectionType = 188, + ConditionalType = 189, + InferType = 190, + ParenthesizedType = 191, + ThisType = 192, + TypeOperator = 193, + IndexedAccessType = 194, + MappedType = 195, + LiteralType = 196, + NamedTupleMember = 197, + TemplateLiteralType = 198, + TemplateLiteralTypeSpan = 199, + ImportType = 200, + ObjectBindingPattern = 201, + ArrayBindingPattern = 202, + BindingElement = 203, + ArrayLiteralExpression = 204, + ObjectLiteralExpression = 205, + PropertyAccessExpression = 206, + ElementAccessExpression = 207, + CallExpression = 208, + NewExpression = 209, + TaggedTemplateExpression = 210, + TypeAssertionExpression = 211, + ParenthesizedExpression = 212, + FunctionExpression = 213, + ArrowFunction = 214, + DeleteExpression = 215, + TypeOfExpression = 216, + VoidExpression = 217, + AwaitExpression = 218, + PrefixUnaryExpression = 219, + PostfixUnaryExpression = 220, + BinaryExpression = 221, + ConditionalExpression = 222, + TemplateExpression = 223, + YieldExpression = 224, + SpreadElement = 225, + ClassExpression = 226, + OmittedExpression = 227, + ExpressionWithTypeArguments = 228, + AsExpression = 229, + NonNullExpression = 230, + MetaProperty = 231, + SyntheticExpression = 232, + SatisfiesExpression = 233, + TemplateSpan = 234, + SemicolonClassElement = 235, + Block = 236, + EmptyStatement = 237, + VariableStatement = 238, + ExpressionStatement = 239, + IfStatement = 240, + DoStatement = 241, + WhileStatement = 242, + ForStatement = 243, + ForInStatement = 244, + ForOfStatement = 245, + ContinueStatement = 246, + BreakStatement = 247, + ReturnStatement = 248, + WithStatement = 249, + SwitchStatement = 250, + LabeledStatement = 251, + ThrowStatement = 252, + TryStatement = 253, + DebuggerStatement = 254, + VariableDeclaration = 255, + VariableDeclarationList = 256, + FunctionDeclaration = 257, + ClassDeclaration = 258, + InterfaceDeclaration = 259, + TypeAliasDeclaration = 260, + EnumDeclaration = 261, + ModuleDeclaration = 262, + ModuleBlock = 263, + CaseBlock = 264, + NamespaceExportDeclaration = 265, + ImportEqualsDeclaration = 266, + ImportDeclaration = 267, + ImportClause = 268, + NamespaceImport = 269, + NamedImports = 270, + ImportSpecifier = 271, + ExportAssignment = 272, + ExportDeclaration = 273, + NamedExports = 274, + NamespaceExport = 275, + ExportSpecifier = 276, + MissingDeclaration = 277, + ExternalModuleReference = 278, + JsxElement = 279, + JsxSelfClosingElement = 280, + JsxOpeningElement = 281, + JsxClosingElement = 282, + JsxFragment = 283, + JsxOpeningFragment = 284, + JsxClosingFragment = 285, + JsxAttribute = 286, + JsxAttributes = 287, + JsxSpreadAttribute = 288, + JsxExpression = 289, + CaseClause = 290, + DefaultClause = 291, + HeritageClause = 292, + CatchClause = 293, + AssertClause = 294, + AssertEntry = 295, + PropertyAssignment = 296, + ShorthandPropertyAssignment = 297, + SpreadAssignment = 298, + EnumMember = 299, + UnparsedPrologue = 300, + UnparsedPrepend = 301, + UnparsedText = 302, + UnparsedInternalText = 303, + UnparsedSyntheticReference = 304, + SourceFile = 305, + Bundle = 306, + UnparsedSource = 307, + InputFiles = 308, + JSDocTypeExpression = 309, + JSDocNameReference = 310, + JSDocMemberName = 311, + JSDocAllType = 312, + JSDocUnknownType = 313, + JSDocNullableType = 314, + JSDocNonNullableType = 315, + JSDocOptionalType = 316, + JSDocFunctionType = 317, + JSDocVariadicType = 318, + JSDocNamepathType = 319, + JSDocComment = 320, + JSDocText = 321, + JSDocTypeLiteral = 322, + JSDocSignature = 323, + JSDocLink = 324, + JSDocLinkCode = 325, + JSDocLinkPlain = 326, + JSDocTag = 327, + JSDocAugmentsTag = 328, + JSDocImplementsTag = 329, + JSDocAuthorTag = 330, + JSDocDeprecatedTag = 331, + JSDocClassTag = 332, + JSDocPublicTag = 333, + JSDocPrivateTag = 334, + JSDocProtectedTag = 335, + JSDocReadonlyTag = 336, + JSDocOverrideTag = 337, + JSDocCallbackTag = 338, + JSDocEnumTag = 339, + JSDocParameterTag = 340, + JSDocReturnTag = 341, + JSDocThisTag = 342, + JSDocTypeTag = 343, + JSDocTemplateTag = 344, + JSDocTypedefTag = 345, + JSDocSeeTag = 346, + JSDocPropertyTag = 347, + SyntaxList = 348, + NotEmittedStatement = 349, + PartiallyEmittedExpression = 350, + CommaListExpression = 351, + MergeDeclarationMarker = 352, + EndOfDeclarationMarker = 353, + SyntheticReferenceExpression = 354, + Count = 355, FirstAssignment = 63, LastAssignment = 78, FirstCompoundAssignment = 64, @@ -466,15 +468,15 @@ declare namespace ts { FirstReservedWord = 81, LastReservedWord = 116, FirstKeyword = 81, - LastKeyword = 159, + LastKeyword = 160, FirstFutureReservedWord = 117, LastFutureReservedWord = 125, - FirstTypeNode = 176, - LastTypeNode = 199, + FirstTypeNode = 177, + LastTypeNode = 200, FirstPunctuation = 18, LastPunctuation = 78, FirstToken = 0, - LastToken = 159, + LastToken = 160, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -483,19 +485,19 @@ declare namespace ts { LastTemplateToken = 17, FirstBinaryOperator = 29, LastBinaryOperator = 78, - FirstStatement = 236, - LastStatement = 252, - FirstNode = 160, - FirstJSDocNode = 307, - LastJSDocNode = 345, - FirstJSDocTagNode = 325, - LastJSDocTagNode = 345, + FirstStatement = 238, + LastStatement = 254, + FirstNode = 161, + FirstJSDocNode = 309, + LastJSDocNode = 347, + FirstJSDocTagNode = 327, + LastJSDocTagNode = 347, } export type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; export type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral; export type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail; export type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.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; - export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | 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.OverrideKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword; + export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | 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.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; export type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.StaticKeyword; export type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword; export type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind; @@ -1313,6 +1315,11 @@ declare namespace ts { readonly type: TypeNode; readonly expression: UnaryExpression; } + export interface SatisfiesExpression extends Expression { + readonly kind: SyntaxKind.SatisfiesExpression; + readonly expression: Expression; + readonly type: TypeNode; + } export type AssertionExpression = TypeAssertion | AsExpression; export interface NonNullExpression extends LeftHandSideExpression { readonly kind: SyntaxKind.NonNullExpression; @@ -3507,6 +3514,8 @@ declare namespace ts { updateNonNullChain(node: NonNullChain, expression: Expression): NonNullChain; createMetaProperty(keywordToken: MetaProperty["keywordToken"], name: Identifier): MetaProperty; updateMetaProperty(node: MetaProperty, name: Identifier): MetaProperty; + createSatisfiesExpression(expression: Expression, type: TypeNode): SatisfiesExpression; + updateSatisfiesExpression(node: SatisfiesExpression, expression: Expression, type: TypeNode): SatisfiesExpression; createTemplateSpan(expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; updateTemplateSpan(node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; createSemicolonClassElement(): SemicolonClassElement; @@ -4611,6 +4620,7 @@ declare namespace ts { function isOmittedExpression(node: Node): node is OmittedExpression; function isExpressionWithTypeArguments(node: Node): node is ExpressionWithTypeArguments; function isAsExpression(node: Node): node is AsExpression; + function isSatisfiesExpression(node: Node): node is SatisfiesExpression; function isNonNullExpression(node: Node): node is NonNullExpression; function isMetaProperty(node: Node): node is MetaProperty; function isSyntheticExpression(node: Node): node is SyntheticExpression; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index fdd55dab1f2d9..677ad5c0b0ad6 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -253,212 +253,214 @@ declare namespace ts { RequireKeyword = 145, NumberKeyword = 146, ObjectKeyword = 147, - SetKeyword = 148, - StringKeyword = 149, - SymbolKeyword = 150, - TypeKeyword = 151, - UndefinedKeyword = 152, - UniqueKeyword = 153, - UnknownKeyword = 154, - FromKeyword = 155, - GlobalKeyword = 156, - BigIntKeyword = 157, - OverrideKeyword = 158, - OfKeyword = 159, - QualifiedName = 160, - ComputedPropertyName = 161, - TypeParameter = 162, - Parameter = 163, - Decorator = 164, - PropertySignature = 165, - PropertyDeclaration = 166, - MethodSignature = 167, - MethodDeclaration = 168, - ClassStaticBlockDeclaration = 169, - Constructor = 170, - GetAccessor = 171, - SetAccessor = 172, - CallSignature = 173, - ConstructSignature = 174, - IndexSignature = 175, - TypePredicate = 176, - TypeReference = 177, - FunctionType = 178, - ConstructorType = 179, - TypeQuery = 180, - TypeLiteral = 181, - ArrayType = 182, - TupleType = 183, - OptionalType = 184, - RestType = 185, - UnionType = 186, - IntersectionType = 187, - ConditionalType = 188, - InferType = 189, - ParenthesizedType = 190, - ThisType = 191, - TypeOperator = 192, - IndexedAccessType = 193, - MappedType = 194, - LiteralType = 195, - NamedTupleMember = 196, - TemplateLiteralType = 197, - TemplateLiteralTypeSpan = 198, - ImportType = 199, - ObjectBindingPattern = 200, - ArrayBindingPattern = 201, - BindingElement = 202, - ArrayLiteralExpression = 203, - ObjectLiteralExpression = 204, - PropertyAccessExpression = 205, - ElementAccessExpression = 206, - CallExpression = 207, - NewExpression = 208, - TaggedTemplateExpression = 209, - TypeAssertionExpression = 210, - ParenthesizedExpression = 211, - FunctionExpression = 212, - ArrowFunction = 213, - DeleteExpression = 214, - TypeOfExpression = 215, - VoidExpression = 216, - AwaitExpression = 217, - PrefixUnaryExpression = 218, - PostfixUnaryExpression = 219, - BinaryExpression = 220, - ConditionalExpression = 221, - TemplateExpression = 222, - YieldExpression = 223, - SpreadElement = 224, - ClassExpression = 225, - OmittedExpression = 226, - ExpressionWithTypeArguments = 227, - AsExpression = 228, - NonNullExpression = 229, - MetaProperty = 230, - SyntheticExpression = 231, - TemplateSpan = 232, - SemicolonClassElement = 233, - Block = 234, - EmptyStatement = 235, - VariableStatement = 236, - ExpressionStatement = 237, - IfStatement = 238, - DoStatement = 239, - WhileStatement = 240, - ForStatement = 241, - ForInStatement = 242, - ForOfStatement = 243, - ContinueStatement = 244, - BreakStatement = 245, - ReturnStatement = 246, - WithStatement = 247, - SwitchStatement = 248, - LabeledStatement = 249, - ThrowStatement = 250, - TryStatement = 251, - DebuggerStatement = 252, - VariableDeclaration = 253, - VariableDeclarationList = 254, - FunctionDeclaration = 255, - ClassDeclaration = 256, - InterfaceDeclaration = 257, - TypeAliasDeclaration = 258, - EnumDeclaration = 259, - ModuleDeclaration = 260, - ModuleBlock = 261, - CaseBlock = 262, - NamespaceExportDeclaration = 263, - ImportEqualsDeclaration = 264, - ImportDeclaration = 265, - ImportClause = 266, - NamespaceImport = 267, - NamedImports = 268, - ImportSpecifier = 269, - ExportAssignment = 270, - ExportDeclaration = 271, - NamedExports = 272, - NamespaceExport = 273, - ExportSpecifier = 274, - MissingDeclaration = 275, - ExternalModuleReference = 276, - JsxElement = 277, - JsxSelfClosingElement = 278, - JsxOpeningElement = 279, - JsxClosingElement = 280, - JsxFragment = 281, - JsxOpeningFragment = 282, - JsxClosingFragment = 283, - JsxAttribute = 284, - JsxAttributes = 285, - JsxSpreadAttribute = 286, - JsxExpression = 287, - CaseClause = 288, - DefaultClause = 289, - HeritageClause = 290, - CatchClause = 291, - AssertClause = 292, - AssertEntry = 293, - PropertyAssignment = 294, - ShorthandPropertyAssignment = 295, - SpreadAssignment = 296, - EnumMember = 297, - UnparsedPrologue = 298, - UnparsedPrepend = 299, - UnparsedText = 300, - UnparsedInternalText = 301, - UnparsedSyntheticReference = 302, - SourceFile = 303, - Bundle = 304, - UnparsedSource = 305, - InputFiles = 306, - JSDocTypeExpression = 307, - JSDocNameReference = 308, - JSDocMemberName = 309, - JSDocAllType = 310, - JSDocUnknownType = 311, - JSDocNullableType = 312, - JSDocNonNullableType = 313, - JSDocOptionalType = 314, - JSDocFunctionType = 315, - JSDocVariadicType = 316, - JSDocNamepathType = 317, - JSDocComment = 318, - JSDocText = 319, - JSDocTypeLiteral = 320, - JSDocSignature = 321, - JSDocLink = 322, - JSDocLinkCode = 323, - JSDocLinkPlain = 324, - JSDocTag = 325, - JSDocAugmentsTag = 326, - JSDocImplementsTag = 327, - JSDocAuthorTag = 328, - JSDocDeprecatedTag = 329, - JSDocClassTag = 330, - JSDocPublicTag = 331, - JSDocPrivateTag = 332, - JSDocProtectedTag = 333, - JSDocReadonlyTag = 334, - JSDocOverrideTag = 335, - JSDocCallbackTag = 336, - JSDocEnumTag = 337, - JSDocParameterTag = 338, - JSDocReturnTag = 339, - JSDocThisTag = 340, - JSDocTypeTag = 341, - JSDocTemplateTag = 342, - JSDocTypedefTag = 343, - JSDocSeeTag = 344, - JSDocPropertyTag = 345, - SyntaxList = 346, - NotEmittedStatement = 347, - PartiallyEmittedExpression = 348, - CommaListExpression = 349, - MergeDeclarationMarker = 350, - EndOfDeclarationMarker = 351, - SyntheticReferenceExpression = 352, - Count = 353, + SatisfiesKeyword = 148, + SetKeyword = 149, + StringKeyword = 150, + SymbolKeyword = 151, + TypeKeyword = 152, + UndefinedKeyword = 153, + UniqueKeyword = 154, + UnknownKeyword = 155, + FromKeyword = 156, + GlobalKeyword = 157, + BigIntKeyword = 158, + OverrideKeyword = 159, + OfKeyword = 160, + QualifiedName = 161, + ComputedPropertyName = 162, + TypeParameter = 163, + Parameter = 164, + Decorator = 165, + PropertySignature = 166, + PropertyDeclaration = 167, + MethodSignature = 168, + MethodDeclaration = 169, + ClassStaticBlockDeclaration = 170, + Constructor = 171, + GetAccessor = 172, + SetAccessor = 173, + CallSignature = 174, + ConstructSignature = 175, + IndexSignature = 176, + TypePredicate = 177, + TypeReference = 178, + FunctionType = 179, + ConstructorType = 180, + TypeQuery = 181, + TypeLiteral = 182, + ArrayType = 183, + TupleType = 184, + OptionalType = 185, + RestType = 186, + UnionType = 187, + IntersectionType = 188, + ConditionalType = 189, + InferType = 190, + ParenthesizedType = 191, + ThisType = 192, + TypeOperator = 193, + IndexedAccessType = 194, + MappedType = 195, + LiteralType = 196, + NamedTupleMember = 197, + TemplateLiteralType = 198, + TemplateLiteralTypeSpan = 199, + ImportType = 200, + ObjectBindingPattern = 201, + ArrayBindingPattern = 202, + BindingElement = 203, + ArrayLiteralExpression = 204, + ObjectLiteralExpression = 205, + PropertyAccessExpression = 206, + ElementAccessExpression = 207, + CallExpression = 208, + NewExpression = 209, + TaggedTemplateExpression = 210, + TypeAssertionExpression = 211, + ParenthesizedExpression = 212, + FunctionExpression = 213, + ArrowFunction = 214, + DeleteExpression = 215, + TypeOfExpression = 216, + VoidExpression = 217, + AwaitExpression = 218, + PrefixUnaryExpression = 219, + PostfixUnaryExpression = 220, + BinaryExpression = 221, + ConditionalExpression = 222, + TemplateExpression = 223, + YieldExpression = 224, + SpreadElement = 225, + ClassExpression = 226, + OmittedExpression = 227, + ExpressionWithTypeArguments = 228, + AsExpression = 229, + NonNullExpression = 230, + MetaProperty = 231, + SyntheticExpression = 232, + SatisfiesExpression = 233, + TemplateSpan = 234, + SemicolonClassElement = 235, + Block = 236, + EmptyStatement = 237, + VariableStatement = 238, + ExpressionStatement = 239, + IfStatement = 240, + DoStatement = 241, + WhileStatement = 242, + ForStatement = 243, + ForInStatement = 244, + ForOfStatement = 245, + ContinueStatement = 246, + BreakStatement = 247, + ReturnStatement = 248, + WithStatement = 249, + SwitchStatement = 250, + LabeledStatement = 251, + ThrowStatement = 252, + TryStatement = 253, + DebuggerStatement = 254, + VariableDeclaration = 255, + VariableDeclarationList = 256, + FunctionDeclaration = 257, + ClassDeclaration = 258, + InterfaceDeclaration = 259, + TypeAliasDeclaration = 260, + EnumDeclaration = 261, + ModuleDeclaration = 262, + ModuleBlock = 263, + CaseBlock = 264, + NamespaceExportDeclaration = 265, + ImportEqualsDeclaration = 266, + ImportDeclaration = 267, + ImportClause = 268, + NamespaceImport = 269, + NamedImports = 270, + ImportSpecifier = 271, + ExportAssignment = 272, + ExportDeclaration = 273, + NamedExports = 274, + NamespaceExport = 275, + ExportSpecifier = 276, + MissingDeclaration = 277, + ExternalModuleReference = 278, + JsxElement = 279, + JsxSelfClosingElement = 280, + JsxOpeningElement = 281, + JsxClosingElement = 282, + JsxFragment = 283, + JsxOpeningFragment = 284, + JsxClosingFragment = 285, + JsxAttribute = 286, + JsxAttributes = 287, + JsxSpreadAttribute = 288, + JsxExpression = 289, + CaseClause = 290, + DefaultClause = 291, + HeritageClause = 292, + CatchClause = 293, + AssertClause = 294, + AssertEntry = 295, + PropertyAssignment = 296, + ShorthandPropertyAssignment = 297, + SpreadAssignment = 298, + EnumMember = 299, + UnparsedPrologue = 300, + UnparsedPrepend = 301, + UnparsedText = 302, + UnparsedInternalText = 303, + UnparsedSyntheticReference = 304, + SourceFile = 305, + Bundle = 306, + UnparsedSource = 307, + InputFiles = 308, + JSDocTypeExpression = 309, + JSDocNameReference = 310, + JSDocMemberName = 311, + JSDocAllType = 312, + JSDocUnknownType = 313, + JSDocNullableType = 314, + JSDocNonNullableType = 315, + JSDocOptionalType = 316, + JSDocFunctionType = 317, + JSDocVariadicType = 318, + JSDocNamepathType = 319, + JSDocComment = 320, + JSDocText = 321, + JSDocTypeLiteral = 322, + JSDocSignature = 323, + JSDocLink = 324, + JSDocLinkCode = 325, + JSDocLinkPlain = 326, + JSDocTag = 327, + JSDocAugmentsTag = 328, + JSDocImplementsTag = 329, + JSDocAuthorTag = 330, + JSDocDeprecatedTag = 331, + JSDocClassTag = 332, + JSDocPublicTag = 333, + JSDocPrivateTag = 334, + JSDocProtectedTag = 335, + JSDocReadonlyTag = 336, + JSDocOverrideTag = 337, + JSDocCallbackTag = 338, + JSDocEnumTag = 339, + JSDocParameterTag = 340, + JSDocReturnTag = 341, + JSDocThisTag = 342, + JSDocTypeTag = 343, + JSDocTemplateTag = 344, + JSDocTypedefTag = 345, + JSDocSeeTag = 346, + JSDocPropertyTag = 347, + SyntaxList = 348, + NotEmittedStatement = 349, + PartiallyEmittedExpression = 350, + CommaListExpression = 351, + MergeDeclarationMarker = 352, + EndOfDeclarationMarker = 353, + SyntheticReferenceExpression = 354, + Count = 355, FirstAssignment = 63, LastAssignment = 78, FirstCompoundAssignment = 64, @@ -466,15 +468,15 @@ declare namespace ts { FirstReservedWord = 81, LastReservedWord = 116, FirstKeyword = 81, - LastKeyword = 159, + LastKeyword = 160, FirstFutureReservedWord = 117, LastFutureReservedWord = 125, - FirstTypeNode = 176, - LastTypeNode = 199, + FirstTypeNode = 177, + LastTypeNode = 200, FirstPunctuation = 18, LastPunctuation = 78, FirstToken = 0, - LastToken = 159, + LastToken = 160, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -483,19 +485,19 @@ declare namespace ts { LastTemplateToken = 17, FirstBinaryOperator = 29, LastBinaryOperator = 78, - FirstStatement = 236, - LastStatement = 252, - FirstNode = 160, - FirstJSDocNode = 307, - LastJSDocNode = 345, - FirstJSDocTagNode = 325, - LastJSDocTagNode = 345, + FirstStatement = 238, + LastStatement = 254, + FirstNode = 161, + FirstJSDocNode = 309, + LastJSDocNode = 347, + FirstJSDocTagNode = 327, + LastJSDocTagNode = 347, } export type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; export type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral; export type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail; export type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.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; - export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | 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.OverrideKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword; + export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | 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.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; export type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.StaticKeyword; export type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword; export type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind; @@ -1313,6 +1315,11 @@ declare namespace ts { readonly type: TypeNode; readonly expression: UnaryExpression; } + export interface SatisfiesExpression extends Expression { + readonly kind: SyntaxKind.SatisfiesExpression; + readonly expression: Expression; + readonly type: TypeNode; + } export type AssertionExpression = TypeAssertion | AsExpression; export interface NonNullExpression extends LeftHandSideExpression { readonly kind: SyntaxKind.NonNullExpression; @@ -3507,6 +3514,8 @@ declare namespace ts { updateNonNullChain(node: NonNullChain, expression: Expression): NonNullChain; createMetaProperty(keywordToken: MetaProperty["keywordToken"], name: Identifier): MetaProperty; updateMetaProperty(node: MetaProperty, name: Identifier): MetaProperty; + createSatisfiesExpression(expression: Expression, type: TypeNode): SatisfiesExpression; + updateSatisfiesExpression(node: SatisfiesExpression, expression: Expression, type: TypeNode): SatisfiesExpression; createTemplateSpan(expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; updateTemplateSpan(node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; createSemicolonClassElement(): SemicolonClassElement; @@ -4611,6 +4620,7 @@ declare namespace ts { function isOmittedExpression(node: Node): node is OmittedExpression; function isExpressionWithTypeArguments(node: Node): node is ExpressionWithTypeArguments; function isAsExpression(node: Node): node is AsExpression; + function isSatisfiesExpression(node: Node): node is SatisfiesExpression; function isNonNullExpression(node: Node): node is NonNullExpression; function isMetaProperty(node: Node): node is MetaProperty; function isSyntheticExpression(node: Node): node is SyntheticExpression; diff --git a/tests/baselines/reference/completionsCommentsClass.baseline b/tests/baselines/reference/completionsCommentsClass.baseline index b16322debe66b..3b82cc8020c64 100644 --- a/tests/baselines/reference/completionsCommentsClass.baseline +++ b/tests/baselines/reference/completionsCommentsClass.baseline @@ -3114,6 +3114,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "string", "kind": "keyword", diff --git a/tests/baselines/reference/completionsCommentsClassMembers.baseline b/tests/baselines/reference/completionsCommentsClassMembers.baseline index 8a4468b7da93c..d5e0d8af545ae 100644 --- a/tests/baselines/reference/completionsCommentsClassMembers.baseline +++ b/tests/baselines/reference/completionsCommentsClassMembers.baseline @@ -4046,6 +4046,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -11102,6 +11114,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -15914,6 +15938,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -22970,6 +23006,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -27034,6 +27082,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -32253,6 +32313,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -36271,6 +36343,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -41444,6 +41528,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -46663,6 +46759,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -51882,6 +51990,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -57101,6 +57221,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -61160,6 +61292,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -65219,6 +65363,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -69278,6 +69434,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -73337,6 +73505,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -77396,6 +77576,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -81455,6 +81647,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -85950,6 +86154,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "string", "kind": "keyword", @@ -91306,6 +91522,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "string", "kind": "keyword", @@ -95821,6 +96049,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", diff --git a/tests/baselines/reference/completionsCommentsCommentParsing.baseline b/tests/baselines/reference/completionsCommentsCommentParsing.baseline index 66e9516361e36..f88a1c202d4c4 100644 --- a/tests/baselines/reference/completionsCommentsCommentParsing.baseline +++ b/tests/baselines/reference/completionsCommentsCommentParsing.baseline @@ -4881,6 +4881,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -11048,6 +11060,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -16947,6 +16971,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -22587,6 +22623,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "string", "kind": "keyword", @@ -28389,6 +28437,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -34556,6 +34616,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -40472,6 +40544,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "string", "kind": "keyword", diff --git a/tests/baselines/reference/completionsCommentsFunctionDeclaration.baseline b/tests/baselines/reference/completionsCommentsFunctionDeclaration.baseline index 7a58a4e801dfd..3aa2cbb0fb5f7 100644 --- a/tests/baselines/reference/completionsCommentsFunctionDeclaration.baseline +++ b/tests/baselines/reference/completionsCommentsFunctionDeclaration.baseline @@ -3268,6 +3268,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -7020,6 +7032,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -11054,6 +11078,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", diff --git a/tests/baselines/reference/completionsCommentsFunctionExpression.baseline b/tests/baselines/reference/completionsCommentsFunctionExpression.baseline index 6184a312462d5..b71a08561f843 100644 --- a/tests/baselines/reference/completionsCommentsFunctionExpression.baseline +++ b/tests/baselines/reference/completionsCommentsFunctionExpression.baseline @@ -3021,6 +3021,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "string", "kind": "keyword", @@ -7467,6 +7479,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "string", "kind": "keyword", @@ -11469,6 +11493,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", @@ -15687,6 +15723,18 @@ } ] }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, { "name": "String", "kind": "var", diff --git a/tests/baselines/reference/jsFileCompilationTypeSatisfaction.errors.txt b/tests/baselines/reference/jsFileCompilationTypeSatisfaction.errors.txt new file mode 100644 index 0000000000000..f8f9369db84ee --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationTypeSatisfaction.errors.txt @@ -0,0 +1,8 @@ +/src/a.js(1,29): error TS8035: Type satisfaction expressions can only be used in TypeScript files. + + +==== /src/a.js (1 errors) ==== + var v = undefined satisfies 1; + ~ +!!! error TS8035: Type satisfaction expressions can only be used in TypeScript files. + \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationTypeSatisfaction.js b/tests/baselines/reference/jsFileCompilationTypeSatisfaction.js new file mode 100644 index 0000000000000..3d28ea0e2675d --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationTypeSatisfaction.js @@ -0,0 +1,6 @@ +//// [a.js] +var v = undefined satisfies 1; + + +//// [a.js] +var v = undefined; diff --git a/tests/baselines/reference/jsFileCompilationTypeSatisfaction.symbols b/tests/baselines/reference/jsFileCompilationTypeSatisfaction.symbols new file mode 100644 index 0000000000000..e5424113f5b8b --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationTypeSatisfaction.symbols @@ -0,0 +1,5 @@ +=== /src/a.js === +var v = undefined satisfies 1; +>v : Symbol(v, Decl(a.js, 0, 3)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/jsFileCompilationTypeSatisfaction.types b/tests/baselines/reference/jsFileCompilationTypeSatisfaction.types new file mode 100644 index 0000000000000..dde08ce298036 --- /dev/null +++ b/tests/baselines/reference/jsFileCompilationTypeSatisfaction.types @@ -0,0 +1,6 @@ +=== /src/a.js === +var v = undefined satisfies 1; +>v : any +>undefined satisfies 1 : undefined +>undefined : undefined + diff --git a/tests/baselines/reference/typeSatisfaction.errors.txt b/tests/baselines/reference/typeSatisfaction.errors.txt new file mode 100644 index 0000000000000..679d8574e8b8d --- /dev/null +++ b/tests/baselines/reference/typeSatisfaction.errors.txt @@ -0,0 +1,31 @@ +tests/cases/conformance/expressions/typeSatisfaction/typeSatisfaction.ts(12,20): error TS1360: Type '{ a: number; b: number; }' does not satisfy the expected type 'I1'. + Object literal may only specify known properties, and 'b' does not exist in type 'I1'. +tests/cases/conformance/expressions/typeSatisfaction/typeSatisfaction.ts(13,26): error TS1360: Type '{}' does not satisfy the expected type 'I1'. + Property 'a' is missing in type '{}' but required in type 'I1'. + + +==== tests/cases/conformance/expressions/typeSatisfaction/typeSatisfaction.ts (2 errors) ==== + interface I1 { + a: number; + } + + type T1 = { + a: "a" | "b"; + } + + type T2 = (x: string) => void; + + const a1 = { a: 1 } satisfies I1; // Ok + const a2 = { a: 1, b: 1 } satisfies I1; // Error + ~~~~ +!!! error TS1360: Type '{ a: number; b: number; }' does not satisfy the expected type 'I1'. +!!! error TS1360: Object literal may only specify known properties, and 'b' does not exist in type 'I1'. + const a3 = { } satisfies I1; // Error + ~~ +!!! error TS1360: Type '{}' does not satisfy the expected type 'I1'. +!!! error TS1360: Property 'a' is missing in type '{}' but required in type 'I1'. +!!! related TS2728 tests/cases/conformance/expressions/typeSatisfaction/typeSatisfaction.ts:2:5: 'a' is declared here. + + const a4: T1 = { a: "a" } satisfies T1; // Ok + const a5 = (m => m.substring(0)) satisfies T2; // Ok + \ No newline at end of file diff --git a/tests/baselines/reference/typeSatisfaction.js b/tests/baselines/reference/typeSatisfaction.js new file mode 100644 index 0000000000000..3b649039d98ea --- /dev/null +++ b/tests/baselines/reference/typeSatisfaction.js @@ -0,0 +1,25 @@ +//// [typeSatisfaction.ts] +interface I1 { + a: number; +} + +type T1 = { + a: "a" | "b"; +} + +type T2 = (x: string) => void; + +const a1 = { a: 1 } satisfies I1; // Ok +const a2 = { a: 1, b: 1 } satisfies I1; // Error +const a3 = { } satisfies I1; // Error + +const a4: T1 = { a: "a" } satisfies T1; // Ok +const a5 = (m => m.substring(0)) satisfies T2; // Ok + + +//// [typeSatisfaction.js] +var a1 = { a: 1 }; // Ok +var a2 = { a: 1, b: 1 }; // Error +var a3 = {}; // Error +var a4 = { a: "a" }; // Ok +var a5 = (function (m) { return m.substring(0); }); // Ok diff --git a/tests/baselines/reference/typeSatisfaction.symbols b/tests/baselines/reference/typeSatisfaction.symbols new file mode 100644 index 0000000000000..2eae603562b0a --- /dev/null +++ b/tests/baselines/reference/typeSatisfaction.symbols @@ -0,0 +1,48 @@ +=== tests/cases/conformance/expressions/typeSatisfaction/typeSatisfaction.ts === +interface I1 { +>I1 : Symbol(I1, Decl(typeSatisfaction.ts, 0, 0)) + + a: number; +>a : Symbol(I1.a, Decl(typeSatisfaction.ts, 0, 14)) +} + +type T1 = { +>T1 : Symbol(T1, Decl(typeSatisfaction.ts, 2, 1)) + + a: "a" | "b"; +>a : Symbol(a, Decl(typeSatisfaction.ts, 4, 11)) +} + +type T2 = (x: string) => void; +>T2 : Symbol(T2, Decl(typeSatisfaction.ts, 6, 1)) +>x : Symbol(x, Decl(typeSatisfaction.ts, 8, 11)) + +const a1 = { a: 1 } satisfies I1; // Ok +>a1 : Symbol(a1, Decl(typeSatisfaction.ts, 10, 5)) +>a : Symbol(a, Decl(typeSatisfaction.ts, 10, 12)) +>I1 : Symbol(I1, Decl(typeSatisfaction.ts, 0, 0)) + +const a2 = { a: 1, b: 1 } satisfies I1; // Error +>a2 : Symbol(a2, Decl(typeSatisfaction.ts, 11, 5)) +>a : Symbol(a, Decl(typeSatisfaction.ts, 11, 12)) +>b : Symbol(b, Decl(typeSatisfaction.ts, 11, 18)) +>I1 : Symbol(I1, Decl(typeSatisfaction.ts, 0, 0)) + +const a3 = { } satisfies I1; // Error +>a3 : Symbol(a3, Decl(typeSatisfaction.ts, 12, 5)) +>I1 : Symbol(I1, Decl(typeSatisfaction.ts, 0, 0)) + +const a4: T1 = { a: "a" } satisfies T1; // Ok +>a4 : Symbol(a4, Decl(typeSatisfaction.ts, 14, 5)) +>T1 : Symbol(T1, Decl(typeSatisfaction.ts, 2, 1)) +>a : Symbol(a, Decl(typeSatisfaction.ts, 14, 16)) +>T1 : Symbol(T1, Decl(typeSatisfaction.ts, 2, 1)) + +const a5 = (m => m.substring(0)) satisfies T2; // Ok +>a5 : Symbol(a5, Decl(typeSatisfaction.ts, 15, 5)) +>m : Symbol(m, Decl(typeSatisfaction.ts, 15, 12)) +>m.substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) +>m : Symbol(m, Decl(typeSatisfaction.ts, 15, 12)) +>substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) +>T2 : Symbol(T2, Decl(typeSatisfaction.ts, 6, 1)) + diff --git a/tests/baselines/reference/typeSatisfaction.types b/tests/baselines/reference/typeSatisfaction.types new file mode 100644 index 0000000000000..fff207ffa0534 --- /dev/null +++ b/tests/baselines/reference/typeSatisfaction.types @@ -0,0 +1,57 @@ +=== tests/cases/conformance/expressions/typeSatisfaction/typeSatisfaction.ts === +interface I1 { + a: number; +>a : number +} + +type T1 = { +>T1 : T1 + + a: "a" | "b"; +>a : "a" | "b" +} + +type T2 = (x: string) => void; +>T2 : T2 +>x : string + +const a1 = { a: 1 } satisfies I1; // Ok +>a1 : { a: number; } +>{ a: 1 } satisfies I1 : { a: number; } +>{ a: 1 } : { a: number; } +>a : number +>1 : 1 + +const a2 = { a: 1, b: 1 } satisfies I1; // Error +>a2 : { a: number; b: number; } +>{ a: 1, b: 1 } satisfies I1 : { a: number; b: number; } +>{ a: 1, b: 1 } : { a: number; b: number; } +>a : number +>1 : 1 +>b : number +>1 : 1 + +const a3 = { } satisfies I1; // Error +>a3 : {} +>{ } satisfies I1 : {} +>{ } : {} + +const a4: T1 = { a: "a" } satisfies T1; // Ok +>a4 : T1 +>{ a: "a" } satisfies T1 : { a: "a"; } +>{ a: "a" } : { a: "a"; } +>a : "a" +>"a" : "a" + +const a5 = (m => m.substring(0)) satisfies T2; // Ok +>a5 : (m: string) => string +>(m => m.substring(0)) satisfies T2 : (m: string) => string +>(m => m.substring(0)) : (m: string) => string +>m => m.substring(0) : (m: string) => string +>m : string +>m.substring(0) : string +>m.substring : (start: number, end?: number) => string +>m : string +>substring : (start: number, end?: number) => string +>0 : 0 + diff --git a/tests/cases/compiler/jsFileCompilationTypeSatisfaction.ts b/tests/cases/compiler/jsFileCompilationTypeSatisfaction.ts new file mode 100644 index 0000000000000..ba4701687bc08 --- /dev/null +++ b/tests/cases/compiler/jsFileCompilationTypeSatisfaction.ts @@ -0,0 +1,5 @@ +// @allowJs: true +// @filename: /src/a.js +// @out: /lib/a.js + +var v = undefined satisfies 1; diff --git a/tests/cases/conformance/expressions/typeSatisfaction/typeSatisfaction.ts b/tests/cases/conformance/expressions/typeSatisfaction/typeSatisfaction.ts new file mode 100644 index 0000000000000..fa60720e297bb --- /dev/null +++ b/tests/cases/conformance/expressions/typeSatisfaction/typeSatisfaction.ts @@ -0,0 +1,16 @@ +interface I1 { + a: number; +} + +type T1 = { + a: "a" | "b"; +} + +type T2 = (x: string) => void; + +const a1 = { a: 1 } satisfies I1; // Ok +const a2 = { a: 1, b: 1 } satisfies I1; // Error +const a3 = { } satisfies I1; // Error + +const a4: T1 = { a: "a" } satisfies T1; // Ok +const a5 = (m => m.substring(0)) satisfies T2; // Ok diff --git a/tests/cases/fourslash/completionSatisfiesKeyword.ts b/tests/cases/fourslash/completionSatisfiesKeyword.ts new file mode 100644 index 0000000000000..c44ca016c3f6f --- /dev/null +++ b/tests/cases/fourslash/completionSatisfiesKeyword.ts @@ -0,0 +1,11 @@ +/// + +////const x = { a: 1 } /*1*/ +////function foo() { +//// const x = { a: 1 } /*2*/ +////} + +verify.completions({ + marker: ["1", "2"], + includes: [{ name: "satisfies", sortText: completion.SortText.GlobalsOrKeywords }] +}); diff --git a/tests/cases/fourslash/satisfiesOperatorCompletion.ts b/tests/cases/fourslash/satisfiesOperatorCompletion.ts new file mode 100644 index 0000000000000..94b07db40da32 --- /dev/null +++ b/tests/cases/fourslash/satisfiesOperatorCompletion.ts @@ -0,0 +1,7 @@ +/// + +//// type T = number; +//// var x; +//// var y = x satisfies /**/ + +verify.completions({ marker: "", includes: "T" });