From 5eb72354430f1313f1973a4874037ef30b9512af Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Sun, 20 Jul 2025 09:13:32 +0200 Subject: [PATCH] build: update to TypeScript 5.9 beta Updates the repo to the TypeScript 5.9 beta and widens the peer dependency ranges. --- WORKSPACE | 6 +- .../angular_devkit/schematics/index.api.md | 8 +- package.json | 26 +- packages/angular/build/package.json | 2 +- .../tests/behavior/rebuild-errors_spec.ts | 26 +- .../tools/esbuild/javascript-transformer.ts | 2 +- .../utilities/schematic-workflow.ts | 10 +- .../architect/testing/test-project-host.ts | 2 +- .../angular_devkit/build_angular/package.json | 2 +- .../core/src/virtual-fs/host/buffer.ts | 2 +- .../schematics/src/sink/dryrun.ts | 4 +- .../schematics/src/sink/host.ts | 10 +- .../schematics_cli/bin/schematics.ts | 10 +- packages/ngtools/webpack/package.json | 2 +- .../Microsoft/TypeScript/BUILD.bazel | 9 +- .../Microsoft/TypeScript/lib/typescript.d.ts | 465 +- .../Microsoft/TypeScript/lib/typescript.js | 17180 ++++++++-------- pnpm-lock.yaml | 423 +- 18 files changed, 9740 insertions(+), 8449 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 6c41ef8b8d56..66aece635c0b 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -204,8 +204,8 @@ http_archive( load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies") rules_ts_dependencies( - # Obtained by: curl --silent https://registry.npmjs.org/typescript/5.8.3 | jq -r '.dist.integrity' - ts_integrity = "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + # Obtained by: curl --silent https://registry.npmjs.org/typescript/5.9.0-beta | jq -r '.dist.integrity' + ts_integrity = "sha512-p91qoTdwWKj9YEBYavmGiBn0DF4OBElzw4pW4oPbK4HeCfr/SDz9+yviVWshZXGvGvFCJ3AVQ+J7F1UZXc23QQ==", ts_version_from = "//:package.json", ) @@ -273,7 +273,7 @@ esbuild_register_toolchains( git_repository( name = "rules_angular", - commit = "88ddcf8cccbfef57f8cc3dda4881f18ec739428e", + commit = "8bf9ae3fa3017ec12877908533001daed9c6ce83", remote = "https://github.com/devversion/rules_angular.git", ) diff --git a/goldens/public-api/angular_devkit/schematics/index.api.md b/goldens/public-api/angular_devkit/schematics/index.api.md index 9da9e7e8d2e1..3e3a0bc97ead 100644 --- a/goldens/public-api/angular_devkit/schematics/index.api.md +++ b/goldens/public-api/angular_devkit/schematics/index.api.md @@ -274,7 +274,7 @@ export interface DirEntry { // @public (undocumented) export interface DryRunCreateEvent { // (undocumented) - content: Buffer; + content: ArrayBufferLike; // (undocumented) kind: 'create'; // (undocumented) @@ -334,7 +334,7 @@ export class DryRunSink extends HostSink { // @public (undocumented) export interface DryRunUpdateEvent { // (undocumented) - content: Buffer; + content: ArrayBufferLike; // (undocumented) kind: 'update'; // (undocumented) @@ -495,13 +495,13 @@ export class HostSink extends SimpleSinkBase { // (undocumented) _done(): Observable; // (undocumented) - protected _filesToCreate: Map>; + protected _filesToCreate: Map; // (undocumented) protected _filesToDelete: Set; // (undocumented) protected _filesToRename: Set<[Path, Path]>; // (undocumented) - protected _filesToUpdate: Map>; + protected _filesToUpdate: Map; // (undocumented) protected _force: boolean; // (undocumented) diff --git a/package.json b/package.json index 94eb4a05c1ab..eedc6ce38345 100644 --- a/package.json +++ b/package.json @@ -46,20 +46,20 @@ }, "homepage": "https://github.com/angular/angular-cli", "devDependencies": { - "@angular/animations": "20.2.0-next.0", + "@angular/animations": "20.2.0-next.1", "@angular/cdk": "20.1.0-rc.0", - "@angular/common": "20.2.0-next.0", - "@angular/compiler": "20.2.0-next.0", - "@angular/compiler-cli": "20.2.0-next.0", - "@angular/core": "20.2.0-next.0", - "@angular/forms": "20.2.0-next.0", - "@angular/localize": "20.2.0-next.0", + "@angular/common": "20.2.0-next.1", + "@angular/compiler": "20.2.0-next.1", + "@angular/compiler-cli": "20.2.0-next.1", + "@angular/core": "20.2.0-next.1", + "@angular/forms": "20.2.0-next.1", + "@angular/localize": "20.2.0-next.1", "@angular/material": "20.1.0-rc.0", "@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#7cdb4cce7349f791492eee3ac1f84e2a0e243287", - "@angular/platform-browser": "20.2.0-next.0", - "@angular/platform-server": "20.2.0-next.0", - "@angular/router": "20.2.0-next.0", - "@angular/service-worker": "20.2.0-next.0", + "@angular/platform-browser": "20.2.0-next.1", + "@angular/platform-server": "20.2.0-next.1", + "@angular/router": "20.2.0-next.1", + "@angular/service-worker": "20.2.0-next.1", "@bazel/bazelisk": "1.26.0", "@bazel/buildifier": "8.2.1", "@eslint/compat": "1.3.1", @@ -140,7 +140,7 @@ "tar": "^7.0.0", "ts-node": "^10.9.1", "tslib": "2.8.1", - "typescript": "5.8.3", + "typescript": "5.9.0-beta", "undici": "7.11.0", "unenv": "^1.10.0", "verdaccio": "6.1.5", @@ -173,6 +173,6 @@ } }, "resolutions": { - "typescript": "5.8.3" + "typescript": "5.9.0-beta" } } diff --git a/packages/angular/build/package.json b/packages/angular/build/package.json index 34fc9640600a..9bbc9ac744f9 100644 --- a/packages/angular/build/package.json +++ b/packages/angular/build/package.json @@ -73,7 +73,7 @@ "postcss": "^8.4.0", "tailwindcss": "^2.0.0 || ^3.0.0 || ^4.0.0", "tslib": "^2.3.0", - "typescript": ">=5.8 <5.9", + "typescript": ">=5.8 <6.0", "vitest": "^3.1.1" }, "peerDependenciesMeta": { diff --git a/packages/angular/build/src/builders/application/tests/behavior/rebuild-errors_spec.ts b/packages/angular/build/src/builders/application/tests/behavior/rebuild-errors_spec.ts index 0dde3b4be58f..e2105fd13de7 100644 --- a/packages/angular/build/src/builders/application/tests/behavior/rebuild-errors_spec.ts +++ b/packages/angular/build/src/builders/application/tests/behavior/rebuild-errors_spec.ts @@ -149,12 +149,12 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { [ async () => { // Add invalid block syntax - await harness.appendToFile('src/app/app.component.html', '@one'); + await harness.appendToFile('src/app/app.component.html', '@if-one'); }, async ({ logs }) => { expect(logs).toContain( jasmine.objectContaining({ - message: jasmine.stringContaining('@one'), + message: jasmine.stringContaining('@if-one'), }), ); @@ -165,42 +165,42 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { async ({ logs }) => { expect(logs).toContain( jasmine.objectContaining({ - message: jasmine.stringContaining('@one'), + message: jasmine.stringContaining('@if-one'), }), ); // Add more invalid block syntax - await harness.appendToFile('src/app/app.component.html', '@two'); + await harness.appendToFile('src/app/app.component.html', '@if-two'); }, async ({ logs }) => { expect(logs).toContain( jasmine.objectContaining({ - message: jasmine.stringContaining('@one'), + message: jasmine.stringContaining('@if-one'), }), ); expect(logs).toContain( jasmine.objectContaining({ - message: jasmine.stringContaining('@two'), + message: jasmine.stringContaining('@if-two'), }), ); // Add more invalid block syntax - await harness.appendToFile('src/app/app.component.html', '@three'); + await harness.appendToFile('src/app/app.component.html', '@if-three'); }, async ({ logs }) => { expect(logs).toContain( jasmine.objectContaining({ - message: jasmine.stringContaining('@one'), + message: jasmine.stringContaining('@if-one'), }), ); expect(logs).toContain( jasmine.objectContaining({ - message: jasmine.stringContaining('@two'), + message: jasmine.stringContaining('@if-two'), }), ); expect(logs).toContain( jasmine.objectContaining({ - message: jasmine.stringContaining('@three'), + message: jasmine.stringContaining('@if-three'), }), ); @@ -211,17 +211,17 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { ({ logs }) => { expect(logs).not.toContain( jasmine.objectContaining({ - message: jasmine.stringContaining('@one'), + message: jasmine.stringContaining('@if-one'), }), ); expect(logs).not.toContain( jasmine.objectContaining({ - message: jasmine.stringContaining('@two'), + message: jasmine.stringContaining('@if-two'), }), ); expect(logs).not.toContain( jasmine.objectContaining({ - message: jasmine.stringContaining('@three'), + message: jasmine.stringContaining('@if-three'), }), ); }, diff --git a/packages/angular/build/src/tools/esbuild/javascript-transformer.ts b/packages/angular/build/src/tools/esbuild/javascript-transformer.ts index b728a0f599e2..b27b8a087b46 100644 --- a/packages/angular/build/src/tools/esbuild/javascript-transformer.ts +++ b/packages/angular/build/src/tools/esbuild/javascript-transformer.ts @@ -125,7 +125,7 @@ export class JavaScriptTransformer { { // The below is disable as with Yarn PNP this causes build failures with the below message // `Unable to deserialize cloned data`. - transferList: process.versions.pnp ? undefined : [data.buffer], + transferList: process.versions.pnp ? undefined : [data.buffer as ArrayBuffer], }, )) as Uint8Array; diff --git a/packages/angular/cli/src/command-builder/utilities/schematic-workflow.ts b/packages/angular/cli/src/command-builder/utilities/schematic-workflow.ts index f5caa0754d88..3dbcfdd25983 100644 --- a/packages/angular/cli/src/command-builder/utilities/schematic-workflow.ts +++ b/packages/angular/cli/src/command-builder/utilities/schematic-workflow.ts @@ -38,11 +38,17 @@ export function subscribeToWorkflow( ); break; case 'update': - logs.push(`${colors.cyan('UPDATE')} ${eventPath} (${event.content.length} bytes)`); + logs.push( + // TODO: `as unknown` was necessary during TS 5.9 update. Figure out a long-term solution. + `${colors.cyan('UPDATE')} ${eventPath} (${(event.content as unknown as Buffer).length} bytes)`, + ); files.add(eventPath); break; case 'create': - logs.push(`${colors.green('CREATE')} ${eventPath} (${event.content.length} bytes)`); + logs.push( + // TODO: `as unknown` was necessary during TS 5.9 update. Figure out a long-term solution. + `${colors.green('CREATE')} ${eventPath} (${(event.content as unknown as Buffer).length} bytes)`, + ); files.add(eventPath); break; case 'delete': diff --git a/packages/angular_devkit/architect/testing/test-project-host.ts b/packages/angular_devkit/architect/testing/test-project-host.ts index 4af99462db08..7b614579f101 100644 --- a/packages/angular_devkit/architect/testing/test-project-host.ts +++ b/packages/angular_devkit/architect/testing/test-project-host.ts @@ -122,7 +122,7 @@ export class TestProjectHost extends NodeJsSyncHost { content = content.buffer.slice(content.byteOffset, content.byteOffset + content.byteLength); } - this.scopedSync().write(normalize(fileName), content); + this.scopedSync().write(normalize(fileName), content as ArrayBufferLike); }); } diff --git a/packages/angular_devkit/build_angular/package.json b/packages/angular_devkit/build_angular/package.json index ce922120f4bc..64b7198d2f6f 100644 --- a/packages/angular_devkit/build_angular/package.json +++ b/packages/angular_devkit/build_angular/package.json @@ -87,7 +87,7 @@ "ng-packagr": "0.0.0-NG-PACKAGR-PEER-DEP", "protractor": "^7.0.0", "tailwindcss": "^2.0.0 || ^3.0.0 || ^4.0.0", - "typescript": ">=5.8 <5.9" + "typescript": ">=5.8 <6.0" }, "peerDependenciesMeta": { "@angular/core": { diff --git a/packages/angular_devkit/core/src/virtual-fs/host/buffer.ts b/packages/angular_devkit/core/src/virtual-fs/host/buffer.ts index 3cb848f6b641..576d7a07a57f 100644 --- a/packages/angular_devkit/core/src/virtual-fs/host/buffer.ts +++ b/packages/angular_devkit/core/src/virtual-fs/host/buffer.ts @@ -10,7 +10,7 @@ import { TextDecoder, TextEncoder } from 'node:util'; import { FileBuffer } from './interface'; export function stringToFileBuffer(str: string): FileBuffer { - return new TextEncoder().encode(str).buffer; + return new TextEncoder().encode(str).buffer as FileBuffer; } export function fileBufferToString(fileBuffer: FileBuffer): string { diff --git a/packages/angular_devkit/schematics/src/sink/dryrun.ts b/packages/angular_devkit/schematics/src/sink/dryrun.ts index 08d516772adf..9afcfe271fe6 100644 --- a/packages/angular_devkit/schematics/src/sink/dryrun.ts +++ b/packages/angular_devkit/schematics/src/sink/dryrun.ts @@ -23,12 +23,12 @@ export interface DryRunDeleteEvent { export interface DryRunCreateEvent { kind: 'create'; path: string; - content: Buffer; + content: ArrayBufferLike; } export interface DryRunUpdateEvent { kind: 'update'; path: string; - content: Buffer; + content: ArrayBufferLike; } export interface DryRunRenameEvent { kind: 'rename'; diff --git a/packages/angular_devkit/schematics/src/sink/host.ts b/packages/angular_devkit/schematics/src/sink/host.ts index db68be260053..26fadda5f67c 100644 --- a/packages/angular_devkit/schematics/src/sink/host.ts +++ b/packages/angular_devkit/schematics/src/sink/host.ts @@ -22,8 +22,8 @@ import { SimpleSinkBase } from './sink'; export class HostSink extends SimpleSinkBase { protected _filesToDelete: Set = new Set(); protected _filesToRename: Set<[Path, Path]> = new Set(); - protected _filesToCreate: Map> = new Map(); - protected _filesToUpdate: Map> = new Map(); + protected _filesToCreate: Map = new Map(); + protected _filesToUpdate: Map = new Map(); constructor( protected _host: virtualFs.Host, @@ -58,13 +58,15 @@ export class HostSink extends SimpleSinkBase { } protected _overwriteFile(path: Path, content: Buffer): Observable { - this._filesToUpdate.set(path, content); + // TODO: `as unknown` was necessary during TS 5.9 update. Figure out a long-term solution. + this._filesToUpdate.set(path, content as unknown as ArrayBufferLike); return EMPTY; } protected _createFile(path: Path, content: Buffer): Observable { - this._filesToCreate.set(path, content); + // TODO: `as unknown` was necessary during TS 5.9 update. Figure out a long-term solution. + this._filesToCreate.set(path, content as unknown as ArrayBufferLike); return EMPTY; } diff --git a/packages/angular_devkit/schematics_cli/bin/schematics.ts b/packages/angular_devkit/schematics_cli/bin/schematics.ts index 93e1ddbf9181..2c71e0698ad4 100644 --- a/packages/angular_devkit/schematics_cli/bin/schematics.ts +++ b/packages/angular_devkit/schematics_cli/bin/schematics.ts @@ -305,10 +305,16 @@ export async function main({ ); break; case 'update': - loggingQueue.push(`${colors.cyan('UPDATE')} ${eventPath} (${event.content.length} bytes)`); + loggingQueue.push( + // TODO: `as unknown` was necessary during TS 5.9 update. Figure out a long-term solution. + `${colors.cyan('UPDATE')} ${eventPath} (${(event.content as unknown as Buffer).length} bytes)`, + ); break; case 'create': - loggingQueue.push(`${colors.green('CREATE')} ${eventPath} (${event.content.length} bytes)`); + loggingQueue.push( + // TODO: `as unknown` was necessary during TS 5.9 update. Figure out a long-term solution. + `${colors.green('CREATE')} ${eventPath} (${(event.content as unknown as Buffer).length} bytes)`, + ); break; case 'delete': loggingQueue.push(`${colors.yellow('DELETE')} ${eventPath}`); diff --git a/packages/ngtools/webpack/package.json b/packages/ngtools/webpack/package.json index 0cf2fa917138..9c91ba976484 100644 --- a/packages/ngtools/webpack/package.json +++ b/packages/ngtools/webpack/package.json @@ -22,7 +22,7 @@ "homepage": "https://github.com/angular/angular-cli/tree/main/packages/ngtools/webpack", "peerDependencies": { "@angular/compiler-cli": "0.0.0-ANGULAR-FW-PEER-DEP", - "typescript": ">=5.8 <5.9", + "typescript": ">=5.8 <6.0", "webpack": "^5.54.0" }, "devDependencies": { diff --git a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/BUILD.bazel b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/BUILD.bazel index 5e4b524bb1cc..70d5114c1696 100644 --- a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/BUILD.bazel +++ b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/BUILD.bazel @@ -1,11 +1,10 @@ load("//tools:defaults.bzl", "ts_project") -# files fetched on 2025-03-03 from -# https://github.com/microsoft/TypeScript/releases/tag/v5.8.2 +# files fetched on 2025-07-18 -# Commands to download: -# curl https://raw.githubusercontent.com/microsoft/TypeScript/v5.8.2/lib/typescript.d.ts -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts -# curl https://raw.githubusercontent.com/microsoft/TypeScript/v5.8.2/lib/typescript.js -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js +# Commands to update from node_modules: +# cp node_modules/typescript/lib/typescript.d.ts packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts +# cp node_modules/typescript/lib/typescript.js packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js licenses(["notice"]) # Apache 2.0 diff --git a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts index 60c1dec27283..87942520f2ab 100644 --- a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts +++ b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts @@ -1486,6 +1486,13 @@ declare namespace ts { command: CommandTypes.Quickinfo; arguments: FileLocationRequestArgs; } + export interface QuickInfoRequestArgs extends FileLocationRequestArgs { + /** + * This controls how many levels of definitions will be expanded in the quick info response. + * The default value is 0. + */ + verbosityLevel?: number; + } /** * Body of QuickInfoResponse. */ @@ -1519,6 +1526,10 @@ declare namespace ts { * JSDoc tags associated with symbol. */ tags: JSDocTagInfo[]; + /** + * Whether the verbosity level can be increased for this quick info response. + */ + canIncreaseVerbosityLevel?: boolean; } /** * Quickinfo response message. @@ -2509,6 +2520,7 @@ declare namespace ts { ESNext = "esnext", Node16 = "node16", Node18 = "node18", + Node20 = "node20", NodeNext = "nodenext", Preserve = "preserve", } @@ -3634,7 +3646,7 @@ declare namespace ts { readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[] | undefined, depth?: number): string[]; } } - const versionMajorMinor = "5.8"; + const versionMajorMinor = "5.9"; /** The version of the TypeScript compiler release */ const version: string; /** @@ -3830,203 +3842,204 @@ declare namespace ts { BigIntKeyword = 163, OverrideKeyword = 164, OfKeyword = 165, - QualifiedName = 166, - ComputedPropertyName = 167, - TypeParameter = 168, - Parameter = 169, - Decorator = 170, - PropertySignature = 171, - PropertyDeclaration = 172, - MethodSignature = 173, - MethodDeclaration = 174, - ClassStaticBlockDeclaration = 175, - Constructor = 176, - GetAccessor = 177, - SetAccessor = 178, - CallSignature = 179, - ConstructSignature = 180, - IndexSignature = 181, - TypePredicate = 182, - TypeReference = 183, - FunctionType = 184, - ConstructorType = 185, - TypeQuery = 186, - TypeLiteral = 187, - ArrayType = 188, - TupleType = 189, - OptionalType = 190, - RestType = 191, - UnionType = 192, - IntersectionType = 193, - ConditionalType = 194, - InferType = 195, - ParenthesizedType = 196, - ThisType = 197, - TypeOperator = 198, - IndexedAccessType = 199, - MappedType = 200, - LiteralType = 201, - NamedTupleMember = 202, - TemplateLiteralType = 203, - TemplateLiteralTypeSpan = 204, - ImportType = 205, - ObjectBindingPattern = 206, - ArrayBindingPattern = 207, - BindingElement = 208, - ArrayLiteralExpression = 209, - ObjectLiteralExpression = 210, - PropertyAccessExpression = 211, - ElementAccessExpression = 212, - CallExpression = 213, - NewExpression = 214, - TaggedTemplateExpression = 215, - TypeAssertionExpression = 216, - ParenthesizedExpression = 217, - FunctionExpression = 218, - ArrowFunction = 219, - DeleteExpression = 220, - TypeOfExpression = 221, - VoidExpression = 222, - AwaitExpression = 223, - PrefixUnaryExpression = 224, - PostfixUnaryExpression = 225, - BinaryExpression = 226, - ConditionalExpression = 227, - TemplateExpression = 228, - YieldExpression = 229, - SpreadElement = 230, - ClassExpression = 231, - OmittedExpression = 232, - ExpressionWithTypeArguments = 233, - AsExpression = 234, - NonNullExpression = 235, - MetaProperty = 236, - SyntheticExpression = 237, - SatisfiesExpression = 238, - TemplateSpan = 239, - SemicolonClassElement = 240, - Block = 241, - EmptyStatement = 242, - VariableStatement = 243, - ExpressionStatement = 244, - IfStatement = 245, - DoStatement = 246, - WhileStatement = 247, - ForStatement = 248, - ForInStatement = 249, - ForOfStatement = 250, - ContinueStatement = 251, - BreakStatement = 252, - ReturnStatement = 253, - WithStatement = 254, - SwitchStatement = 255, - LabeledStatement = 256, - ThrowStatement = 257, - TryStatement = 258, - DebuggerStatement = 259, - VariableDeclaration = 260, - VariableDeclarationList = 261, - FunctionDeclaration = 262, - ClassDeclaration = 263, - InterfaceDeclaration = 264, - TypeAliasDeclaration = 265, - EnumDeclaration = 266, - ModuleDeclaration = 267, - ModuleBlock = 268, - CaseBlock = 269, - NamespaceExportDeclaration = 270, - ImportEqualsDeclaration = 271, - ImportDeclaration = 272, - ImportClause = 273, - NamespaceImport = 274, - NamedImports = 275, - ImportSpecifier = 276, - ExportAssignment = 277, - ExportDeclaration = 278, - NamedExports = 279, - NamespaceExport = 280, - ExportSpecifier = 281, - MissingDeclaration = 282, - ExternalModuleReference = 283, - JsxElement = 284, - JsxSelfClosingElement = 285, - JsxOpeningElement = 286, - JsxClosingElement = 287, - JsxFragment = 288, - JsxOpeningFragment = 289, - JsxClosingFragment = 290, - JsxAttribute = 291, - JsxAttributes = 292, - JsxSpreadAttribute = 293, - JsxExpression = 294, - JsxNamespacedName = 295, - CaseClause = 296, - DefaultClause = 297, - HeritageClause = 298, - CatchClause = 299, - ImportAttributes = 300, - ImportAttribute = 301, - /** @deprecated */ AssertClause = 300, - /** @deprecated */ AssertEntry = 301, - /** @deprecated */ ImportTypeAssertionContainer = 302, - PropertyAssignment = 303, - ShorthandPropertyAssignment = 304, - SpreadAssignment = 305, - EnumMember = 306, - SourceFile = 307, - Bundle = 308, - JSDocTypeExpression = 309, - JSDocNameReference = 310, - JSDocMemberName = 311, - JSDocAllType = 312, - JSDocUnknownType = 313, - JSDocNullableType = 314, - JSDocNonNullableType = 315, - JSDocOptionalType = 316, - JSDocFunctionType = 317, - JSDocVariadicType = 318, - JSDocNamepathType = 319, - JSDoc = 320, + DeferKeyword = 166, + QualifiedName = 167, + ComputedPropertyName = 168, + TypeParameter = 169, + Parameter = 170, + Decorator = 171, + PropertySignature = 172, + PropertyDeclaration = 173, + MethodSignature = 174, + MethodDeclaration = 175, + ClassStaticBlockDeclaration = 176, + Constructor = 177, + GetAccessor = 178, + SetAccessor = 179, + CallSignature = 180, + ConstructSignature = 181, + IndexSignature = 182, + TypePredicate = 183, + TypeReference = 184, + FunctionType = 185, + ConstructorType = 186, + TypeQuery = 187, + TypeLiteral = 188, + ArrayType = 189, + TupleType = 190, + OptionalType = 191, + RestType = 192, + UnionType = 193, + IntersectionType = 194, + ConditionalType = 195, + InferType = 196, + ParenthesizedType = 197, + ThisType = 198, + TypeOperator = 199, + IndexedAccessType = 200, + MappedType = 201, + LiteralType = 202, + NamedTupleMember = 203, + TemplateLiteralType = 204, + TemplateLiteralTypeSpan = 205, + ImportType = 206, + ObjectBindingPattern = 207, + ArrayBindingPattern = 208, + BindingElement = 209, + ArrayLiteralExpression = 210, + ObjectLiteralExpression = 211, + PropertyAccessExpression = 212, + ElementAccessExpression = 213, + CallExpression = 214, + NewExpression = 215, + TaggedTemplateExpression = 216, + TypeAssertionExpression = 217, + ParenthesizedExpression = 218, + FunctionExpression = 219, + ArrowFunction = 220, + DeleteExpression = 221, + TypeOfExpression = 222, + VoidExpression = 223, + AwaitExpression = 224, + PrefixUnaryExpression = 225, + PostfixUnaryExpression = 226, + BinaryExpression = 227, + ConditionalExpression = 228, + TemplateExpression = 229, + YieldExpression = 230, + SpreadElement = 231, + ClassExpression = 232, + OmittedExpression = 233, + ExpressionWithTypeArguments = 234, + AsExpression = 235, + NonNullExpression = 236, + MetaProperty = 237, + SyntheticExpression = 238, + SatisfiesExpression = 239, + TemplateSpan = 240, + SemicolonClassElement = 241, + Block = 242, + EmptyStatement = 243, + VariableStatement = 244, + ExpressionStatement = 245, + IfStatement = 246, + DoStatement = 247, + WhileStatement = 248, + ForStatement = 249, + ForInStatement = 250, + ForOfStatement = 251, + ContinueStatement = 252, + BreakStatement = 253, + ReturnStatement = 254, + WithStatement = 255, + SwitchStatement = 256, + LabeledStatement = 257, + ThrowStatement = 258, + TryStatement = 259, + DebuggerStatement = 260, + VariableDeclaration = 261, + VariableDeclarationList = 262, + FunctionDeclaration = 263, + ClassDeclaration = 264, + InterfaceDeclaration = 265, + TypeAliasDeclaration = 266, + EnumDeclaration = 267, + ModuleDeclaration = 268, + ModuleBlock = 269, + CaseBlock = 270, + NamespaceExportDeclaration = 271, + ImportEqualsDeclaration = 272, + ImportDeclaration = 273, + ImportClause = 274, + NamespaceImport = 275, + NamedImports = 276, + ImportSpecifier = 277, + ExportAssignment = 278, + ExportDeclaration = 279, + NamedExports = 280, + NamespaceExport = 281, + ExportSpecifier = 282, + MissingDeclaration = 283, + ExternalModuleReference = 284, + JsxElement = 285, + JsxSelfClosingElement = 286, + JsxOpeningElement = 287, + JsxClosingElement = 288, + JsxFragment = 289, + JsxOpeningFragment = 290, + JsxClosingFragment = 291, + JsxAttribute = 292, + JsxAttributes = 293, + JsxSpreadAttribute = 294, + JsxExpression = 295, + JsxNamespacedName = 296, + CaseClause = 297, + DefaultClause = 298, + HeritageClause = 299, + CatchClause = 300, + ImportAttributes = 301, + ImportAttribute = 302, + /** @deprecated */ AssertClause = 301, + /** @deprecated */ AssertEntry = 302, + /** @deprecated */ ImportTypeAssertionContainer = 303, + PropertyAssignment = 304, + ShorthandPropertyAssignment = 305, + SpreadAssignment = 306, + EnumMember = 307, + SourceFile = 308, + Bundle = 309, + JSDocTypeExpression = 310, + JSDocNameReference = 311, + JSDocMemberName = 312, + JSDocAllType = 313, + JSDocUnknownType = 314, + JSDocNullableType = 315, + JSDocNonNullableType = 316, + JSDocOptionalType = 317, + JSDocFunctionType = 318, + JSDocVariadicType = 319, + JSDocNamepathType = 320, + JSDoc = 321, /** @deprecated Use SyntaxKind.JSDoc */ - 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, - JSDocOverloadTag = 339, - JSDocEnumTag = 340, - JSDocParameterTag = 341, - JSDocReturnTag = 342, - JSDocThisTag = 343, - JSDocTypeTag = 344, - JSDocTemplateTag = 345, - JSDocTypedefTag = 346, - JSDocSeeTag = 347, - JSDocPropertyTag = 348, - JSDocThrowsTag = 349, - JSDocSatisfiesTag = 350, - JSDocImportTag = 351, - SyntaxList = 352, - NotEmittedStatement = 353, - NotEmittedTypeElement = 354, - PartiallyEmittedExpression = 355, - CommaListExpression = 356, - SyntheticReferenceExpression = 357, - Count = 358, + JSDocComment = 321, + JSDocText = 322, + JSDocTypeLiteral = 323, + JSDocSignature = 324, + JSDocLink = 325, + JSDocLinkCode = 326, + JSDocLinkPlain = 327, + JSDocTag = 328, + JSDocAugmentsTag = 329, + JSDocImplementsTag = 330, + JSDocAuthorTag = 331, + JSDocDeprecatedTag = 332, + JSDocClassTag = 333, + JSDocPublicTag = 334, + JSDocPrivateTag = 335, + JSDocProtectedTag = 336, + JSDocReadonlyTag = 337, + JSDocOverrideTag = 338, + JSDocCallbackTag = 339, + JSDocOverloadTag = 340, + JSDocEnumTag = 341, + JSDocParameterTag = 342, + JSDocReturnTag = 343, + JSDocThisTag = 344, + JSDocTypeTag = 345, + JSDocTemplateTag = 346, + JSDocTypedefTag = 347, + JSDocSeeTag = 348, + JSDocPropertyTag = 349, + JSDocThrowsTag = 350, + JSDocSatisfiesTag = 351, + JSDocImportTag = 352, + SyntaxList = 353, + NotEmittedStatement = 354, + NotEmittedTypeElement = 355, + PartiallyEmittedExpression = 356, + CommaListExpression = 357, + SyntheticReferenceExpression = 358, + Count = 359, FirstAssignment = 64, LastAssignment = 79, FirstCompoundAssignment = 65, @@ -4034,15 +4047,15 @@ declare namespace ts { FirstReservedWord = 83, LastReservedWord = 118, FirstKeyword = 83, - LastKeyword = 165, + LastKeyword = 166, FirstFutureReservedWord = 119, LastFutureReservedWord = 127, - FirstTypeNode = 182, - LastTypeNode = 205, + FirstTypeNode = 183, + LastTypeNode = 206, FirstPunctuation = 19, LastPunctuation = 79, FirstToken = 0, - LastToken = 165, + LastToken = 166, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 9, @@ -4051,13 +4064,13 @@ declare namespace ts { LastTemplateToken = 18, FirstBinaryOperator = 30, LastBinaryOperator = 79, - FirstStatement = 243, - LastStatement = 259, - FirstNode = 166, - FirstJSDocNode = 309, - LastJSDocNode = 351, - FirstJSDocTagNode = 327, - LastJSDocTagNode = 351, + FirstStatement = 244, + LastStatement = 260, + FirstNode = 167, + FirstJSDocNode = 310, + LastJSDocNode = 352, + FirstJSDocTagNode = 328, + LastJSDocTagNode = 352, } 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; @@ -4145,6 +4158,7 @@ declare namespace ts { | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword + | SyntaxKind.DeferKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword @@ -5117,7 +5131,7 @@ declare namespace ts { readonly expression: SuperExpression; } interface ImportCall extends CallExpression { - readonly expression: ImportExpression; + readonly expression: ImportExpression | ImportDeferProperty; } interface ExpressionWithTypeArguments extends MemberExpression, NodeWithTypeArguments { readonly kind: SyntaxKind.ExpressionWithTypeArguments; @@ -5167,6 +5181,12 @@ declare namespace ts { readonly keywordToken: SyntaxKind.NewKeyword | SyntaxKind.ImportKeyword; readonly name: Identifier; } + interface ImportDeferProperty extends MetaProperty { + readonly keywordToken: SyntaxKind.ImportKeyword; + readonly name: Identifier & { + readonly escapedText: __String & "defer"; + }; + } interface JsxElement extends PrimaryExpression { readonly kind: SyntaxKind.JsxElement; readonly openingElement: JsxOpeningElement; @@ -5506,10 +5526,13 @@ declare namespace ts { interface ImportClause extends NamedDeclaration { readonly kind: SyntaxKind.ImportClause; readonly parent: ImportDeclaration | JSDocImportTag; + /** @deprecated Use `phaseModifier` instead */ readonly isTypeOnly: boolean; + readonly phaseModifier: undefined | ImportPhaseModifierSyntaxKind; readonly name?: Identifier; readonly namedBindings?: NamedImportBindings; } + type ImportPhaseModifierSyntaxKind = SyntaxKind.TypeKeyword | SyntaxKind.DeferKeyword; /** @deprecated */ type AssertionKey = ImportAttributeName; /** @deprecated */ @@ -5884,6 +5907,7 @@ declare namespace ts { */ interface SourceFileLike { readonly text: string; + languageVariant?: LanguageVariant; } interface SourceFileLike { getLineAndCharacterOfPosition(pos: number): LineAndCharacter; @@ -6303,6 +6327,10 @@ declare namespace ts { * is `never`. Instead, use `type.flags & TypeFlags.Never`. */ getNeverType(): Type; + /** + * Gets the intrinsic `object` type. + */ + getNonPrimitiveType(): Type; /** * Returns true if the "source" type is assignable to the "target" type. * @@ -6690,11 +6718,11 @@ declare namespace ts { JSLiteral = 4096, FreshLiteral = 8192, ArrayLiteral = 16384, + SingleSignatureType = 134217728, ClassOrInterface = 3, ContainsSpread = 2097152, ObjectRestType = 4194304, InstantiationExpressionType = 8388608, - SingleSignatureType = 134217728, } interface ObjectType extends Type { objectFlags: ObjectFlags; @@ -7133,6 +7161,7 @@ declare namespace ts { ESNext = 99, Node16 = 100, Node18 = 101, + Node20 = 102, NodeNext = 199, Preserve = 200, } @@ -7713,8 +7742,10 @@ declare namespace ts { updateImportEqualsDeclaration(node: ImportEqualsDeclaration, modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; createImportDeclaration(modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, attributes?: ImportAttributes): ImportDeclaration; updateImportDeclaration(node: ImportDeclaration, modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, attributes: ImportAttributes | undefined): ImportDeclaration; - createImportClause(isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; - updateImportClause(node: ImportClause, isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; + createImportClause(phaseModifier: ImportPhaseModifierSyntaxKind | undefined, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; + /** @deprecated */ createImportClause(isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; + updateImportClause(node: ImportClause, phaseModifier: ImportPhaseModifierSyntaxKind | undefined, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; + /** @deprecated */ updateImportClause(node: ImportClause, isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; /** @deprecated */ createAssertClause(elements: NodeArray, multiLine?: boolean): AssertClause; /** @deprecated */ updateAssertClause(node: AssertClause, elements: NodeArray, multiLine?: boolean): AssertClause; /** @deprecated */ createAssertEntry(name: AssertionKey, value: Expression): AssertEntry; @@ -8391,6 +8422,12 @@ declare namespace ts { readonly displayPartsForJSDoc?: boolean; readonly generateReturnInDocTemplate?: boolean; readonly disableLineTextInReferences?: boolean; + /** + * A positive integer indicating the maximum length of a hover text before it is truncated. + * + * Default: `500` + */ + readonly maximumHoverLength?: number; } type OrganizeImportsTypeOrder = "last" | "inline" | "first"; /** Represents a bigint literal value without requiring bigint support */ @@ -10168,8 +10205,9 @@ declare namespace ts { * * @param fileName The path to the file * @param position A zero-based index of the character where you want the quick info + * @param maximumLength Maximum length of a quickinfo text before it is truncated. */ - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo | undefined; + getQuickInfoAtPosition(fileName: string, position: number, maximumLength?: number): QuickInfo | undefined; getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan | undefined; getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan | undefined; getSignatureHelpItems(fileName: string, position: number, options: SignatureHelpItemsOptions | undefined): SignatureHelpItems | undefined; @@ -10757,6 +10795,7 @@ declare namespace ts { displayParts?: SymbolDisplayPart[]; documentation?: SymbolDisplayPart[]; tags?: JSDocTagInfo[]; + canIncreaseVerbosityLevel?: boolean; } type RenameInfo = RenameInfoSuccess | RenameInfoFailure; interface RenameInfoSuccess { diff --git a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js index dc0fe9a56bb4..bc11772a5cab 100644 --- a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js +++ b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js @@ -487,6 +487,7 @@ __export(typescript_exports, { decodeMappings: () => decodeMappings, decodedTextSpanIntersectsWith: () => decodedTextSpanIntersectsWith, deduplicate: () => deduplicate, + defaultHoverMaximumTruncationLength: () => defaultHoverMaximumTruncationLength, defaultInitCompilerOptions: () => defaultInitCompilerOptions, defaultMaximumTruncationLength: () => defaultMaximumTruncationLength, diagnosticCategoryName: () => diagnosticCategoryName, @@ -671,7 +672,6 @@ __export(typescript_exports, { getCommonSourceDirectory: () => getCommonSourceDirectory, getCommonSourceDirectoryOfConfig: () => getCommonSourceDirectoryOfConfig, getCompilerOptionValue: () => getCompilerOptionValue, - getCompilerOptionsDiffValue: () => getCompilerOptionsDiffValue, getConditions: () => getConditions, getConfigFileParsingDiagnostics: () => getConfigFileParsingDiagnostics, getConstantValue: () => getConstantValue, @@ -2284,8 +2284,8 @@ __export(typescript_exports, { module.exports = __toCommonJS(typescript_exports); // src/compiler/corePublic.ts -var versionMajorMinor = "5.8"; -var version = "5.8.2"; +var versionMajorMinor = "5.9"; +var version = "5.9.0-beta"; var Comparison = /* @__PURE__ */ ((Comparison3) => { Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; @@ -5686,202 +5686,203 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => { SyntaxKind5[SyntaxKind5["BigIntKeyword"] = 163] = "BigIntKeyword"; SyntaxKind5[SyntaxKind5["OverrideKeyword"] = 164] = "OverrideKeyword"; SyntaxKind5[SyntaxKind5["OfKeyword"] = 165] = "OfKeyword"; - SyntaxKind5[SyntaxKind5["QualifiedName"] = 166] = "QualifiedName"; - SyntaxKind5[SyntaxKind5["ComputedPropertyName"] = 167] = "ComputedPropertyName"; - SyntaxKind5[SyntaxKind5["TypeParameter"] = 168] = "TypeParameter"; - SyntaxKind5[SyntaxKind5["Parameter"] = 169] = "Parameter"; - SyntaxKind5[SyntaxKind5["Decorator"] = 170] = "Decorator"; - SyntaxKind5[SyntaxKind5["PropertySignature"] = 171] = "PropertySignature"; - SyntaxKind5[SyntaxKind5["PropertyDeclaration"] = 172] = "PropertyDeclaration"; - SyntaxKind5[SyntaxKind5["MethodSignature"] = 173] = "MethodSignature"; - SyntaxKind5[SyntaxKind5["MethodDeclaration"] = 174] = "MethodDeclaration"; - SyntaxKind5[SyntaxKind5["ClassStaticBlockDeclaration"] = 175] = "ClassStaticBlockDeclaration"; - SyntaxKind5[SyntaxKind5["Constructor"] = 176] = "Constructor"; - SyntaxKind5[SyntaxKind5["GetAccessor"] = 177] = "GetAccessor"; - SyntaxKind5[SyntaxKind5["SetAccessor"] = 178] = "SetAccessor"; - SyntaxKind5[SyntaxKind5["CallSignature"] = 179] = "CallSignature"; - SyntaxKind5[SyntaxKind5["ConstructSignature"] = 180] = "ConstructSignature"; - SyntaxKind5[SyntaxKind5["IndexSignature"] = 181] = "IndexSignature"; - SyntaxKind5[SyntaxKind5["TypePredicate"] = 182] = "TypePredicate"; - SyntaxKind5[SyntaxKind5["TypeReference"] = 183] = "TypeReference"; - SyntaxKind5[SyntaxKind5["FunctionType"] = 184] = "FunctionType"; - SyntaxKind5[SyntaxKind5["ConstructorType"] = 185] = "ConstructorType"; - SyntaxKind5[SyntaxKind5["TypeQuery"] = 186] = "TypeQuery"; - SyntaxKind5[SyntaxKind5["TypeLiteral"] = 187] = "TypeLiteral"; - SyntaxKind5[SyntaxKind5["ArrayType"] = 188] = "ArrayType"; - SyntaxKind5[SyntaxKind5["TupleType"] = 189] = "TupleType"; - SyntaxKind5[SyntaxKind5["OptionalType"] = 190] = "OptionalType"; - SyntaxKind5[SyntaxKind5["RestType"] = 191] = "RestType"; - SyntaxKind5[SyntaxKind5["UnionType"] = 192] = "UnionType"; - SyntaxKind5[SyntaxKind5["IntersectionType"] = 193] = "IntersectionType"; - SyntaxKind5[SyntaxKind5["ConditionalType"] = 194] = "ConditionalType"; - SyntaxKind5[SyntaxKind5["InferType"] = 195] = "InferType"; - SyntaxKind5[SyntaxKind5["ParenthesizedType"] = 196] = "ParenthesizedType"; - SyntaxKind5[SyntaxKind5["ThisType"] = 197] = "ThisType"; - SyntaxKind5[SyntaxKind5["TypeOperator"] = 198] = "TypeOperator"; - SyntaxKind5[SyntaxKind5["IndexedAccessType"] = 199] = "IndexedAccessType"; - SyntaxKind5[SyntaxKind5["MappedType"] = 200] = "MappedType"; - SyntaxKind5[SyntaxKind5["LiteralType"] = 201] = "LiteralType"; - SyntaxKind5[SyntaxKind5["NamedTupleMember"] = 202] = "NamedTupleMember"; - SyntaxKind5[SyntaxKind5["TemplateLiteralType"] = 203] = "TemplateLiteralType"; - SyntaxKind5[SyntaxKind5["TemplateLiteralTypeSpan"] = 204] = "TemplateLiteralTypeSpan"; - SyntaxKind5[SyntaxKind5["ImportType"] = 205] = "ImportType"; - SyntaxKind5[SyntaxKind5["ObjectBindingPattern"] = 206] = "ObjectBindingPattern"; - SyntaxKind5[SyntaxKind5["ArrayBindingPattern"] = 207] = "ArrayBindingPattern"; - SyntaxKind5[SyntaxKind5["BindingElement"] = 208] = "BindingElement"; - SyntaxKind5[SyntaxKind5["ArrayLiteralExpression"] = 209] = "ArrayLiteralExpression"; - SyntaxKind5[SyntaxKind5["ObjectLiteralExpression"] = 210] = "ObjectLiteralExpression"; - SyntaxKind5[SyntaxKind5["PropertyAccessExpression"] = 211] = "PropertyAccessExpression"; - SyntaxKind5[SyntaxKind5["ElementAccessExpression"] = 212] = "ElementAccessExpression"; - SyntaxKind5[SyntaxKind5["CallExpression"] = 213] = "CallExpression"; - SyntaxKind5[SyntaxKind5["NewExpression"] = 214] = "NewExpression"; - SyntaxKind5[SyntaxKind5["TaggedTemplateExpression"] = 215] = "TaggedTemplateExpression"; - SyntaxKind5[SyntaxKind5["TypeAssertionExpression"] = 216] = "TypeAssertionExpression"; - SyntaxKind5[SyntaxKind5["ParenthesizedExpression"] = 217] = "ParenthesizedExpression"; - SyntaxKind5[SyntaxKind5["FunctionExpression"] = 218] = "FunctionExpression"; - SyntaxKind5[SyntaxKind5["ArrowFunction"] = 219] = "ArrowFunction"; - SyntaxKind5[SyntaxKind5["DeleteExpression"] = 220] = "DeleteExpression"; - SyntaxKind5[SyntaxKind5["TypeOfExpression"] = 221] = "TypeOfExpression"; - SyntaxKind5[SyntaxKind5["VoidExpression"] = 222] = "VoidExpression"; - SyntaxKind5[SyntaxKind5["AwaitExpression"] = 223] = "AwaitExpression"; - SyntaxKind5[SyntaxKind5["PrefixUnaryExpression"] = 224] = "PrefixUnaryExpression"; - SyntaxKind5[SyntaxKind5["PostfixUnaryExpression"] = 225] = "PostfixUnaryExpression"; - SyntaxKind5[SyntaxKind5["BinaryExpression"] = 226] = "BinaryExpression"; - SyntaxKind5[SyntaxKind5["ConditionalExpression"] = 227] = "ConditionalExpression"; - SyntaxKind5[SyntaxKind5["TemplateExpression"] = 228] = "TemplateExpression"; - SyntaxKind5[SyntaxKind5["YieldExpression"] = 229] = "YieldExpression"; - SyntaxKind5[SyntaxKind5["SpreadElement"] = 230] = "SpreadElement"; - SyntaxKind5[SyntaxKind5["ClassExpression"] = 231] = "ClassExpression"; - SyntaxKind5[SyntaxKind5["OmittedExpression"] = 232] = "OmittedExpression"; - SyntaxKind5[SyntaxKind5["ExpressionWithTypeArguments"] = 233] = "ExpressionWithTypeArguments"; - SyntaxKind5[SyntaxKind5["AsExpression"] = 234] = "AsExpression"; - SyntaxKind5[SyntaxKind5["NonNullExpression"] = 235] = "NonNullExpression"; - SyntaxKind5[SyntaxKind5["MetaProperty"] = 236] = "MetaProperty"; - SyntaxKind5[SyntaxKind5["SyntheticExpression"] = 237] = "SyntheticExpression"; - SyntaxKind5[SyntaxKind5["SatisfiesExpression"] = 238] = "SatisfiesExpression"; - SyntaxKind5[SyntaxKind5["TemplateSpan"] = 239] = "TemplateSpan"; - SyntaxKind5[SyntaxKind5["SemicolonClassElement"] = 240] = "SemicolonClassElement"; - SyntaxKind5[SyntaxKind5["Block"] = 241] = "Block"; - SyntaxKind5[SyntaxKind5["EmptyStatement"] = 242] = "EmptyStatement"; - SyntaxKind5[SyntaxKind5["VariableStatement"] = 243] = "VariableStatement"; - SyntaxKind5[SyntaxKind5["ExpressionStatement"] = 244] = "ExpressionStatement"; - SyntaxKind5[SyntaxKind5["IfStatement"] = 245] = "IfStatement"; - SyntaxKind5[SyntaxKind5["DoStatement"] = 246] = "DoStatement"; - SyntaxKind5[SyntaxKind5["WhileStatement"] = 247] = "WhileStatement"; - SyntaxKind5[SyntaxKind5["ForStatement"] = 248] = "ForStatement"; - SyntaxKind5[SyntaxKind5["ForInStatement"] = 249] = "ForInStatement"; - SyntaxKind5[SyntaxKind5["ForOfStatement"] = 250] = "ForOfStatement"; - SyntaxKind5[SyntaxKind5["ContinueStatement"] = 251] = "ContinueStatement"; - SyntaxKind5[SyntaxKind5["BreakStatement"] = 252] = "BreakStatement"; - SyntaxKind5[SyntaxKind5["ReturnStatement"] = 253] = "ReturnStatement"; - SyntaxKind5[SyntaxKind5["WithStatement"] = 254] = "WithStatement"; - SyntaxKind5[SyntaxKind5["SwitchStatement"] = 255] = "SwitchStatement"; - SyntaxKind5[SyntaxKind5["LabeledStatement"] = 256] = "LabeledStatement"; - SyntaxKind5[SyntaxKind5["ThrowStatement"] = 257] = "ThrowStatement"; - SyntaxKind5[SyntaxKind5["TryStatement"] = 258] = "TryStatement"; - SyntaxKind5[SyntaxKind5["DebuggerStatement"] = 259] = "DebuggerStatement"; - SyntaxKind5[SyntaxKind5["VariableDeclaration"] = 260] = "VariableDeclaration"; - SyntaxKind5[SyntaxKind5["VariableDeclarationList"] = 261] = "VariableDeclarationList"; - SyntaxKind5[SyntaxKind5["FunctionDeclaration"] = 262] = "FunctionDeclaration"; - SyntaxKind5[SyntaxKind5["ClassDeclaration"] = 263] = "ClassDeclaration"; - SyntaxKind5[SyntaxKind5["InterfaceDeclaration"] = 264] = "InterfaceDeclaration"; - SyntaxKind5[SyntaxKind5["TypeAliasDeclaration"] = 265] = "TypeAliasDeclaration"; - SyntaxKind5[SyntaxKind5["EnumDeclaration"] = 266] = "EnumDeclaration"; - SyntaxKind5[SyntaxKind5["ModuleDeclaration"] = 267] = "ModuleDeclaration"; - SyntaxKind5[SyntaxKind5["ModuleBlock"] = 268] = "ModuleBlock"; - SyntaxKind5[SyntaxKind5["CaseBlock"] = 269] = "CaseBlock"; - SyntaxKind5[SyntaxKind5["NamespaceExportDeclaration"] = 270] = "NamespaceExportDeclaration"; - SyntaxKind5[SyntaxKind5["ImportEqualsDeclaration"] = 271] = "ImportEqualsDeclaration"; - SyntaxKind5[SyntaxKind5["ImportDeclaration"] = 272] = "ImportDeclaration"; - SyntaxKind5[SyntaxKind5["ImportClause"] = 273] = "ImportClause"; - SyntaxKind5[SyntaxKind5["NamespaceImport"] = 274] = "NamespaceImport"; - SyntaxKind5[SyntaxKind5["NamedImports"] = 275] = "NamedImports"; - SyntaxKind5[SyntaxKind5["ImportSpecifier"] = 276] = "ImportSpecifier"; - SyntaxKind5[SyntaxKind5["ExportAssignment"] = 277] = "ExportAssignment"; - SyntaxKind5[SyntaxKind5["ExportDeclaration"] = 278] = "ExportDeclaration"; - SyntaxKind5[SyntaxKind5["NamedExports"] = 279] = "NamedExports"; - SyntaxKind5[SyntaxKind5["NamespaceExport"] = 280] = "NamespaceExport"; - SyntaxKind5[SyntaxKind5["ExportSpecifier"] = 281] = "ExportSpecifier"; - SyntaxKind5[SyntaxKind5["MissingDeclaration"] = 282] = "MissingDeclaration"; - SyntaxKind5[SyntaxKind5["ExternalModuleReference"] = 283] = "ExternalModuleReference"; - SyntaxKind5[SyntaxKind5["JsxElement"] = 284] = "JsxElement"; - SyntaxKind5[SyntaxKind5["JsxSelfClosingElement"] = 285] = "JsxSelfClosingElement"; - SyntaxKind5[SyntaxKind5["JsxOpeningElement"] = 286] = "JsxOpeningElement"; - SyntaxKind5[SyntaxKind5["JsxClosingElement"] = 287] = "JsxClosingElement"; - SyntaxKind5[SyntaxKind5["JsxFragment"] = 288] = "JsxFragment"; - SyntaxKind5[SyntaxKind5["JsxOpeningFragment"] = 289] = "JsxOpeningFragment"; - SyntaxKind5[SyntaxKind5["JsxClosingFragment"] = 290] = "JsxClosingFragment"; - SyntaxKind5[SyntaxKind5["JsxAttribute"] = 291] = "JsxAttribute"; - SyntaxKind5[SyntaxKind5["JsxAttributes"] = 292] = "JsxAttributes"; - SyntaxKind5[SyntaxKind5["JsxSpreadAttribute"] = 293] = "JsxSpreadAttribute"; - SyntaxKind5[SyntaxKind5["JsxExpression"] = 294] = "JsxExpression"; - SyntaxKind5[SyntaxKind5["JsxNamespacedName"] = 295] = "JsxNamespacedName"; - SyntaxKind5[SyntaxKind5["CaseClause"] = 296] = "CaseClause"; - SyntaxKind5[SyntaxKind5["DefaultClause"] = 297] = "DefaultClause"; - SyntaxKind5[SyntaxKind5["HeritageClause"] = 298] = "HeritageClause"; - SyntaxKind5[SyntaxKind5["CatchClause"] = 299] = "CatchClause"; - SyntaxKind5[SyntaxKind5["ImportAttributes"] = 300] = "ImportAttributes"; - SyntaxKind5[SyntaxKind5["ImportAttribute"] = 301] = "ImportAttribute"; - SyntaxKind5[SyntaxKind5["AssertClause"] = 300 /* ImportAttributes */] = "AssertClause"; - SyntaxKind5[SyntaxKind5["AssertEntry"] = 301 /* ImportAttribute */] = "AssertEntry"; - SyntaxKind5[SyntaxKind5["ImportTypeAssertionContainer"] = 302] = "ImportTypeAssertionContainer"; - SyntaxKind5[SyntaxKind5["PropertyAssignment"] = 303] = "PropertyAssignment"; - SyntaxKind5[SyntaxKind5["ShorthandPropertyAssignment"] = 304] = "ShorthandPropertyAssignment"; - SyntaxKind5[SyntaxKind5["SpreadAssignment"] = 305] = "SpreadAssignment"; - SyntaxKind5[SyntaxKind5["EnumMember"] = 306] = "EnumMember"; - SyntaxKind5[SyntaxKind5["SourceFile"] = 307] = "SourceFile"; - SyntaxKind5[SyntaxKind5["Bundle"] = 308] = "Bundle"; - SyntaxKind5[SyntaxKind5["JSDocTypeExpression"] = 309] = "JSDocTypeExpression"; - SyntaxKind5[SyntaxKind5["JSDocNameReference"] = 310] = "JSDocNameReference"; - SyntaxKind5[SyntaxKind5["JSDocMemberName"] = 311] = "JSDocMemberName"; - SyntaxKind5[SyntaxKind5["JSDocAllType"] = 312] = "JSDocAllType"; - SyntaxKind5[SyntaxKind5["JSDocUnknownType"] = 313] = "JSDocUnknownType"; - SyntaxKind5[SyntaxKind5["JSDocNullableType"] = 314] = "JSDocNullableType"; - SyntaxKind5[SyntaxKind5["JSDocNonNullableType"] = 315] = "JSDocNonNullableType"; - SyntaxKind5[SyntaxKind5["JSDocOptionalType"] = 316] = "JSDocOptionalType"; - SyntaxKind5[SyntaxKind5["JSDocFunctionType"] = 317] = "JSDocFunctionType"; - SyntaxKind5[SyntaxKind5["JSDocVariadicType"] = 318] = "JSDocVariadicType"; - SyntaxKind5[SyntaxKind5["JSDocNamepathType"] = 319] = "JSDocNamepathType"; - SyntaxKind5[SyntaxKind5["JSDoc"] = 320] = "JSDoc"; - SyntaxKind5[SyntaxKind5["JSDocComment"] = 320 /* JSDoc */] = "JSDocComment"; - SyntaxKind5[SyntaxKind5["JSDocText"] = 321] = "JSDocText"; - SyntaxKind5[SyntaxKind5["JSDocTypeLiteral"] = 322] = "JSDocTypeLiteral"; - SyntaxKind5[SyntaxKind5["JSDocSignature"] = 323] = "JSDocSignature"; - SyntaxKind5[SyntaxKind5["JSDocLink"] = 324] = "JSDocLink"; - SyntaxKind5[SyntaxKind5["JSDocLinkCode"] = 325] = "JSDocLinkCode"; - SyntaxKind5[SyntaxKind5["JSDocLinkPlain"] = 326] = "JSDocLinkPlain"; - SyntaxKind5[SyntaxKind5["JSDocTag"] = 327] = "JSDocTag"; - SyntaxKind5[SyntaxKind5["JSDocAugmentsTag"] = 328] = "JSDocAugmentsTag"; - SyntaxKind5[SyntaxKind5["JSDocImplementsTag"] = 329] = "JSDocImplementsTag"; - SyntaxKind5[SyntaxKind5["JSDocAuthorTag"] = 330] = "JSDocAuthorTag"; - SyntaxKind5[SyntaxKind5["JSDocDeprecatedTag"] = 331] = "JSDocDeprecatedTag"; - SyntaxKind5[SyntaxKind5["JSDocClassTag"] = 332] = "JSDocClassTag"; - SyntaxKind5[SyntaxKind5["JSDocPublicTag"] = 333] = "JSDocPublicTag"; - SyntaxKind5[SyntaxKind5["JSDocPrivateTag"] = 334] = "JSDocPrivateTag"; - SyntaxKind5[SyntaxKind5["JSDocProtectedTag"] = 335] = "JSDocProtectedTag"; - SyntaxKind5[SyntaxKind5["JSDocReadonlyTag"] = 336] = "JSDocReadonlyTag"; - SyntaxKind5[SyntaxKind5["JSDocOverrideTag"] = 337] = "JSDocOverrideTag"; - SyntaxKind5[SyntaxKind5["JSDocCallbackTag"] = 338] = "JSDocCallbackTag"; - SyntaxKind5[SyntaxKind5["JSDocOverloadTag"] = 339] = "JSDocOverloadTag"; - SyntaxKind5[SyntaxKind5["JSDocEnumTag"] = 340] = "JSDocEnumTag"; - SyntaxKind5[SyntaxKind5["JSDocParameterTag"] = 341] = "JSDocParameterTag"; - SyntaxKind5[SyntaxKind5["JSDocReturnTag"] = 342] = "JSDocReturnTag"; - SyntaxKind5[SyntaxKind5["JSDocThisTag"] = 343] = "JSDocThisTag"; - SyntaxKind5[SyntaxKind5["JSDocTypeTag"] = 344] = "JSDocTypeTag"; - SyntaxKind5[SyntaxKind5["JSDocTemplateTag"] = 345] = "JSDocTemplateTag"; - SyntaxKind5[SyntaxKind5["JSDocTypedefTag"] = 346] = "JSDocTypedefTag"; - SyntaxKind5[SyntaxKind5["JSDocSeeTag"] = 347] = "JSDocSeeTag"; - SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 348] = "JSDocPropertyTag"; - SyntaxKind5[SyntaxKind5["JSDocThrowsTag"] = 349] = "JSDocThrowsTag"; - SyntaxKind5[SyntaxKind5["JSDocSatisfiesTag"] = 350] = "JSDocSatisfiesTag"; - SyntaxKind5[SyntaxKind5["JSDocImportTag"] = 351] = "JSDocImportTag"; - SyntaxKind5[SyntaxKind5["SyntaxList"] = 352] = "SyntaxList"; - SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 353] = "NotEmittedStatement"; - SyntaxKind5[SyntaxKind5["NotEmittedTypeElement"] = 354] = "NotEmittedTypeElement"; - SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 355] = "PartiallyEmittedExpression"; - SyntaxKind5[SyntaxKind5["CommaListExpression"] = 356] = "CommaListExpression"; - SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 357] = "SyntheticReferenceExpression"; - SyntaxKind5[SyntaxKind5["Count"] = 358] = "Count"; + SyntaxKind5[SyntaxKind5["DeferKeyword"] = 166] = "DeferKeyword"; + SyntaxKind5[SyntaxKind5["QualifiedName"] = 167] = "QualifiedName"; + SyntaxKind5[SyntaxKind5["ComputedPropertyName"] = 168] = "ComputedPropertyName"; + SyntaxKind5[SyntaxKind5["TypeParameter"] = 169] = "TypeParameter"; + SyntaxKind5[SyntaxKind5["Parameter"] = 170] = "Parameter"; + SyntaxKind5[SyntaxKind5["Decorator"] = 171] = "Decorator"; + SyntaxKind5[SyntaxKind5["PropertySignature"] = 172] = "PropertySignature"; + SyntaxKind5[SyntaxKind5["PropertyDeclaration"] = 173] = "PropertyDeclaration"; + SyntaxKind5[SyntaxKind5["MethodSignature"] = 174] = "MethodSignature"; + SyntaxKind5[SyntaxKind5["MethodDeclaration"] = 175] = "MethodDeclaration"; + SyntaxKind5[SyntaxKind5["ClassStaticBlockDeclaration"] = 176] = "ClassStaticBlockDeclaration"; + SyntaxKind5[SyntaxKind5["Constructor"] = 177] = "Constructor"; + SyntaxKind5[SyntaxKind5["GetAccessor"] = 178] = "GetAccessor"; + SyntaxKind5[SyntaxKind5["SetAccessor"] = 179] = "SetAccessor"; + SyntaxKind5[SyntaxKind5["CallSignature"] = 180] = "CallSignature"; + SyntaxKind5[SyntaxKind5["ConstructSignature"] = 181] = "ConstructSignature"; + SyntaxKind5[SyntaxKind5["IndexSignature"] = 182] = "IndexSignature"; + SyntaxKind5[SyntaxKind5["TypePredicate"] = 183] = "TypePredicate"; + SyntaxKind5[SyntaxKind5["TypeReference"] = 184] = "TypeReference"; + SyntaxKind5[SyntaxKind5["FunctionType"] = 185] = "FunctionType"; + SyntaxKind5[SyntaxKind5["ConstructorType"] = 186] = "ConstructorType"; + SyntaxKind5[SyntaxKind5["TypeQuery"] = 187] = "TypeQuery"; + SyntaxKind5[SyntaxKind5["TypeLiteral"] = 188] = "TypeLiteral"; + SyntaxKind5[SyntaxKind5["ArrayType"] = 189] = "ArrayType"; + SyntaxKind5[SyntaxKind5["TupleType"] = 190] = "TupleType"; + SyntaxKind5[SyntaxKind5["OptionalType"] = 191] = "OptionalType"; + SyntaxKind5[SyntaxKind5["RestType"] = 192] = "RestType"; + SyntaxKind5[SyntaxKind5["UnionType"] = 193] = "UnionType"; + SyntaxKind5[SyntaxKind5["IntersectionType"] = 194] = "IntersectionType"; + SyntaxKind5[SyntaxKind5["ConditionalType"] = 195] = "ConditionalType"; + SyntaxKind5[SyntaxKind5["InferType"] = 196] = "InferType"; + SyntaxKind5[SyntaxKind5["ParenthesizedType"] = 197] = "ParenthesizedType"; + SyntaxKind5[SyntaxKind5["ThisType"] = 198] = "ThisType"; + SyntaxKind5[SyntaxKind5["TypeOperator"] = 199] = "TypeOperator"; + SyntaxKind5[SyntaxKind5["IndexedAccessType"] = 200] = "IndexedAccessType"; + SyntaxKind5[SyntaxKind5["MappedType"] = 201] = "MappedType"; + SyntaxKind5[SyntaxKind5["LiteralType"] = 202] = "LiteralType"; + SyntaxKind5[SyntaxKind5["NamedTupleMember"] = 203] = "NamedTupleMember"; + SyntaxKind5[SyntaxKind5["TemplateLiteralType"] = 204] = "TemplateLiteralType"; + SyntaxKind5[SyntaxKind5["TemplateLiteralTypeSpan"] = 205] = "TemplateLiteralTypeSpan"; + SyntaxKind5[SyntaxKind5["ImportType"] = 206] = "ImportType"; + SyntaxKind5[SyntaxKind5["ObjectBindingPattern"] = 207] = "ObjectBindingPattern"; + SyntaxKind5[SyntaxKind5["ArrayBindingPattern"] = 208] = "ArrayBindingPattern"; + SyntaxKind5[SyntaxKind5["BindingElement"] = 209] = "BindingElement"; + SyntaxKind5[SyntaxKind5["ArrayLiteralExpression"] = 210] = "ArrayLiteralExpression"; + SyntaxKind5[SyntaxKind5["ObjectLiteralExpression"] = 211] = "ObjectLiteralExpression"; + SyntaxKind5[SyntaxKind5["PropertyAccessExpression"] = 212] = "PropertyAccessExpression"; + SyntaxKind5[SyntaxKind5["ElementAccessExpression"] = 213] = "ElementAccessExpression"; + SyntaxKind5[SyntaxKind5["CallExpression"] = 214] = "CallExpression"; + SyntaxKind5[SyntaxKind5["NewExpression"] = 215] = "NewExpression"; + SyntaxKind5[SyntaxKind5["TaggedTemplateExpression"] = 216] = "TaggedTemplateExpression"; + SyntaxKind5[SyntaxKind5["TypeAssertionExpression"] = 217] = "TypeAssertionExpression"; + SyntaxKind5[SyntaxKind5["ParenthesizedExpression"] = 218] = "ParenthesizedExpression"; + SyntaxKind5[SyntaxKind5["FunctionExpression"] = 219] = "FunctionExpression"; + SyntaxKind5[SyntaxKind5["ArrowFunction"] = 220] = "ArrowFunction"; + SyntaxKind5[SyntaxKind5["DeleteExpression"] = 221] = "DeleteExpression"; + SyntaxKind5[SyntaxKind5["TypeOfExpression"] = 222] = "TypeOfExpression"; + SyntaxKind5[SyntaxKind5["VoidExpression"] = 223] = "VoidExpression"; + SyntaxKind5[SyntaxKind5["AwaitExpression"] = 224] = "AwaitExpression"; + SyntaxKind5[SyntaxKind5["PrefixUnaryExpression"] = 225] = "PrefixUnaryExpression"; + SyntaxKind5[SyntaxKind5["PostfixUnaryExpression"] = 226] = "PostfixUnaryExpression"; + SyntaxKind5[SyntaxKind5["BinaryExpression"] = 227] = "BinaryExpression"; + SyntaxKind5[SyntaxKind5["ConditionalExpression"] = 228] = "ConditionalExpression"; + SyntaxKind5[SyntaxKind5["TemplateExpression"] = 229] = "TemplateExpression"; + SyntaxKind5[SyntaxKind5["YieldExpression"] = 230] = "YieldExpression"; + SyntaxKind5[SyntaxKind5["SpreadElement"] = 231] = "SpreadElement"; + SyntaxKind5[SyntaxKind5["ClassExpression"] = 232] = "ClassExpression"; + SyntaxKind5[SyntaxKind5["OmittedExpression"] = 233] = "OmittedExpression"; + SyntaxKind5[SyntaxKind5["ExpressionWithTypeArguments"] = 234] = "ExpressionWithTypeArguments"; + SyntaxKind5[SyntaxKind5["AsExpression"] = 235] = "AsExpression"; + SyntaxKind5[SyntaxKind5["NonNullExpression"] = 236] = "NonNullExpression"; + SyntaxKind5[SyntaxKind5["MetaProperty"] = 237] = "MetaProperty"; + SyntaxKind5[SyntaxKind5["SyntheticExpression"] = 238] = "SyntheticExpression"; + SyntaxKind5[SyntaxKind5["SatisfiesExpression"] = 239] = "SatisfiesExpression"; + SyntaxKind5[SyntaxKind5["TemplateSpan"] = 240] = "TemplateSpan"; + SyntaxKind5[SyntaxKind5["SemicolonClassElement"] = 241] = "SemicolonClassElement"; + SyntaxKind5[SyntaxKind5["Block"] = 242] = "Block"; + SyntaxKind5[SyntaxKind5["EmptyStatement"] = 243] = "EmptyStatement"; + SyntaxKind5[SyntaxKind5["VariableStatement"] = 244] = "VariableStatement"; + SyntaxKind5[SyntaxKind5["ExpressionStatement"] = 245] = "ExpressionStatement"; + SyntaxKind5[SyntaxKind5["IfStatement"] = 246] = "IfStatement"; + SyntaxKind5[SyntaxKind5["DoStatement"] = 247] = "DoStatement"; + SyntaxKind5[SyntaxKind5["WhileStatement"] = 248] = "WhileStatement"; + SyntaxKind5[SyntaxKind5["ForStatement"] = 249] = "ForStatement"; + SyntaxKind5[SyntaxKind5["ForInStatement"] = 250] = "ForInStatement"; + SyntaxKind5[SyntaxKind5["ForOfStatement"] = 251] = "ForOfStatement"; + SyntaxKind5[SyntaxKind5["ContinueStatement"] = 252] = "ContinueStatement"; + SyntaxKind5[SyntaxKind5["BreakStatement"] = 253] = "BreakStatement"; + SyntaxKind5[SyntaxKind5["ReturnStatement"] = 254] = "ReturnStatement"; + SyntaxKind5[SyntaxKind5["WithStatement"] = 255] = "WithStatement"; + SyntaxKind5[SyntaxKind5["SwitchStatement"] = 256] = "SwitchStatement"; + SyntaxKind5[SyntaxKind5["LabeledStatement"] = 257] = "LabeledStatement"; + SyntaxKind5[SyntaxKind5["ThrowStatement"] = 258] = "ThrowStatement"; + SyntaxKind5[SyntaxKind5["TryStatement"] = 259] = "TryStatement"; + SyntaxKind5[SyntaxKind5["DebuggerStatement"] = 260] = "DebuggerStatement"; + SyntaxKind5[SyntaxKind5["VariableDeclaration"] = 261] = "VariableDeclaration"; + SyntaxKind5[SyntaxKind5["VariableDeclarationList"] = 262] = "VariableDeclarationList"; + SyntaxKind5[SyntaxKind5["FunctionDeclaration"] = 263] = "FunctionDeclaration"; + SyntaxKind5[SyntaxKind5["ClassDeclaration"] = 264] = "ClassDeclaration"; + SyntaxKind5[SyntaxKind5["InterfaceDeclaration"] = 265] = "InterfaceDeclaration"; + SyntaxKind5[SyntaxKind5["TypeAliasDeclaration"] = 266] = "TypeAliasDeclaration"; + SyntaxKind5[SyntaxKind5["EnumDeclaration"] = 267] = "EnumDeclaration"; + SyntaxKind5[SyntaxKind5["ModuleDeclaration"] = 268] = "ModuleDeclaration"; + SyntaxKind5[SyntaxKind5["ModuleBlock"] = 269] = "ModuleBlock"; + SyntaxKind5[SyntaxKind5["CaseBlock"] = 270] = "CaseBlock"; + SyntaxKind5[SyntaxKind5["NamespaceExportDeclaration"] = 271] = "NamespaceExportDeclaration"; + SyntaxKind5[SyntaxKind5["ImportEqualsDeclaration"] = 272] = "ImportEqualsDeclaration"; + SyntaxKind5[SyntaxKind5["ImportDeclaration"] = 273] = "ImportDeclaration"; + SyntaxKind5[SyntaxKind5["ImportClause"] = 274] = "ImportClause"; + SyntaxKind5[SyntaxKind5["NamespaceImport"] = 275] = "NamespaceImport"; + SyntaxKind5[SyntaxKind5["NamedImports"] = 276] = "NamedImports"; + SyntaxKind5[SyntaxKind5["ImportSpecifier"] = 277] = "ImportSpecifier"; + SyntaxKind5[SyntaxKind5["ExportAssignment"] = 278] = "ExportAssignment"; + SyntaxKind5[SyntaxKind5["ExportDeclaration"] = 279] = "ExportDeclaration"; + SyntaxKind5[SyntaxKind5["NamedExports"] = 280] = "NamedExports"; + SyntaxKind5[SyntaxKind5["NamespaceExport"] = 281] = "NamespaceExport"; + SyntaxKind5[SyntaxKind5["ExportSpecifier"] = 282] = "ExportSpecifier"; + SyntaxKind5[SyntaxKind5["MissingDeclaration"] = 283] = "MissingDeclaration"; + SyntaxKind5[SyntaxKind5["ExternalModuleReference"] = 284] = "ExternalModuleReference"; + SyntaxKind5[SyntaxKind5["JsxElement"] = 285] = "JsxElement"; + SyntaxKind5[SyntaxKind5["JsxSelfClosingElement"] = 286] = "JsxSelfClosingElement"; + SyntaxKind5[SyntaxKind5["JsxOpeningElement"] = 287] = "JsxOpeningElement"; + SyntaxKind5[SyntaxKind5["JsxClosingElement"] = 288] = "JsxClosingElement"; + SyntaxKind5[SyntaxKind5["JsxFragment"] = 289] = "JsxFragment"; + SyntaxKind5[SyntaxKind5["JsxOpeningFragment"] = 290] = "JsxOpeningFragment"; + SyntaxKind5[SyntaxKind5["JsxClosingFragment"] = 291] = "JsxClosingFragment"; + SyntaxKind5[SyntaxKind5["JsxAttribute"] = 292] = "JsxAttribute"; + SyntaxKind5[SyntaxKind5["JsxAttributes"] = 293] = "JsxAttributes"; + SyntaxKind5[SyntaxKind5["JsxSpreadAttribute"] = 294] = "JsxSpreadAttribute"; + SyntaxKind5[SyntaxKind5["JsxExpression"] = 295] = "JsxExpression"; + SyntaxKind5[SyntaxKind5["JsxNamespacedName"] = 296] = "JsxNamespacedName"; + SyntaxKind5[SyntaxKind5["CaseClause"] = 297] = "CaseClause"; + SyntaxKind5[SyntaxKind5["DefaultClause"] = 298] = "DefaultClause"; + SyntaxKind5[SyntaxKind5["HeritageClause"] = 299] = "HeritageClause"; + SyntaxKind5[SyntaxKind5["CatchClause"] = 300] = "CatchClause"; + SyntaxKind5[SyntaxKind5["ImportAttributes"] = 301] = "ImportAttributes"; + SyntaxKind5[SyntaxKind5["ImportAttribute"] = 302] = "ImportAttribute"; + SyntaxKind5[SyntaxKind5["AssertClause"] = 301 /* ImportAttributes */] = "AssertClause"; + SyntaxKind5[SyntaxKind5["AssertEntry"] = 302 /* ImportAttribute */] = "AssertEntry"; + SyntaxKind5[SyntaxKind5["ImportTypeAssertionContainer"] = 303] = "ImportTypeAssertionContainer"; + SyntaxKind5[SyntaxKind5["PropertyAssignment"] = 304] = "PropertyAssignment"; + SyntaxKind5[SyntaxKind5["ShorthandPropertyAssignment"] = 305] = "ShorthandPropertyAssignment"; + SyntaxKind5[SyntaxKind5["SpreadAssignment"] = 306] = "SpreadAssignment"; + SyntaxKind5[SyntaxKind5["EnumMember"] = 307] = "EnumMember"; + SyntaxKind5[SyntaxKind5["SourceFile"] = 308] = "SourceFile"; + SyntaxKind5[SyntaxKind5["Bundle"] = 309] = "Bundle"; + SyntaxKind5[SyntaxKind5["JSDocTypeExpression"] = 310] = "JSDocTypeExpression"; + SyntaxKind5[SyntaxKind5["JSDocNameReference"] = 311] = "JSDocNameReference"; + SyntaxKind5[SyntaxKind5["JSDocMemberName"] = 312] = "JSDocMemberName"; + SyntaxKind5[SyntaxKind5["JSDocAllType"] = 313] = "JSDocAllType"; + SyntaxKind5[SyntaxKind5["JSDocUnknownType"] = 314] = "JSDocUnknownType"; + SyntaxKind5[SyntaxKind5["JSDocNullableType"] = 315] = "JSDocNullableType"; + SyntaxKind5[SyntaxKind5["JSDocNonNullableType"] = 316] = "JSDocNonNullableType"; + SyntaxKind5[SyntaxKind5["JSDocOptionalType"] = 317] = "JSDocOptionalType"; + SyntaxKind5[SyntaxKind5["JSDocFunctionType"] = 318] = "JSDocFunctionType"; + SyntaxKind5[SyntaxKind5["JSDocVariadicType"] = 319] = "JSDocVariadicType"; + SyntaxKind5[SyntaxKind5["JSDocNamepathType"] = 320] = "JSDocNamepathType"; + SyntaxKind5[SyntaxKind5["JSDoc"] = 321] = "JSDoc"; + SyntaxKind5[SyntaxKind5["JSDocComment"] = 321 /* JSDoc */] = "JSDocComment"; + SyntaxKind5[SyntaxKind5["JSDocText"] = 322] = "JSDocText"; + SyntaxKind5[SyntaxKind5["JSDocTypeLiteral"] = 323] = "JSDocTypeLiteral"; + SyntaxKind5[SyntaxKind5["JSDocSignature"] = 324] = "JSDocSignature"; + SyntaxKind5[SyntaxKind5["JSDocLink"] = 325] = "JSDocLink"; + SyntaxKind5[SyntaxKind5["JSDocLinkCode"] = 326] = "JSDocLinkCode"; + SyntaxKind5[SyntaxKind5["JSDocLinkPlain"] = 327] = "JSDocLinkPlain"; + SyntaxKind5[SyntaxKind5["JSDocTag"] = 328] = "JSDocTag"; + SyntaxKind5[SyntaxKind5["JSDocAugmentsTag"] = 329] = "JSDocAugmentsTag"; + SyntaxKind5[SyntaxKind5["JSDocImplementsTag"] = 330] = "JSDocImplementsTag"; + SyntaxKind5[SyntaxKind5["JSDocAuthorTag"] = 331] = "JSDocAuthorTag"; + SyntaxKind5[SyntaxKind5["JSDocDeprecatedTag"] = 332] = "JSDocDeprecatedTag"; + SyntaxKind5[SyntaxKind5["JSDocClassTag"] = 333] = "JSDocClassTag"; + SyntaxKind5[SyntaxKind5["JSDocPublicTag"] = 334] = "JSDocPublicTag"; + SyntaxKind5[SyntaxKind5["JSDocPrivateTag"] = 335] = "JSDocPrivateTag"; + SyntaxKind5[SyntaxKind5["JSDocProtectedTag"] = 336] = "JSDocProtectedTag"; + SyntaxKind5[SyntaxKind5["JSDocReadonlyTag"] = 337] = "JSDocReadonlyTag"; + SyntaxKind5[SyntaxKind5["JSDocOverrideTag"] = 338] = "JSDocOverrideTag"; + SyntaxKind5[SyntaxKind5["JSDocCallbackTag"] = 339] = "JSDocCallbackTag"; + SyntaxKind5[SyntaxKind5["JSDocOverloadTag"] = 340] = "JSDocOverloadTag"; + SyntaxKind5[SyntaxKind5["JSDocEnumTag"] = 341] = "JSDocEnumTag"; + SyntaxKind5[SyntaxKind5["JSDocParameterTag"] = 342] = "JSDocParameterTag"; + SyntaxKind5[SyntaxKind5["JSDocReturnTag"] = 343] = "JSDocReturnTag"; + SyntaxKind5[SyntaxKind5["JSDocThisTag"] = 344] = "JSDocThisTag"; + SyntaxKind5[SyntaxKind5["JSDocTypeTag"] = 345] = "JSDocTypeTag"; + SyntaxKind5[SyntaxKind5["JSDocTemplateTag"] = 346] = "JSDocTemplateTag"; + SyntaxKind5[SyntaxKind5["JSDocTypedefTag"] = 347] = "JSDocTypedefTag"; + SyntaxKind5[SyntaxKind5["JSDocSeeTag"] = 348] = "JSDocSeeTag"; + SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 349] = "JSDocPropertyTag"; + SyntaxKind5[SyntaxKind5["JSDocThrowsTag"] = 350] = "JSDocThrowsTag"; + SyntaxKind5[SyntaxKind5["JSDocSatisfiesTag"] = 351] = "JSDocSatisfiesTag"; + SyntaxKind5[SyntaxKind5["JSDocImportTag"] = 352] = "JSDocImportTag"; + SyntaxKind5[SyntaxKind5["SyntaxList"] = 353] = "SyntaxList"; + SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 354] = "NotEmittedStatement"; + SyntaxKind5[SyntaxKind5["NotEmittedTypeElement"] = 355] = "NotEmittedTypeElement"; + SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 356] = "PartiallyEmittedExpression"; + SyntaxKind5[SyntaxKind5["CommaListExpression"] = 357] = "CommaListExpression"; + SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 358] = "SyntheticReferenceExpression"; + SyntaxKind5[SyntaxKind5["Count"] = 359] = "Count"; SyntaxKind5[SyntaxKind5["FirstAssignment"] = 64 /* EqualsToken */] = "FirstAssignment"; SyntaxKind5[SyntaxKind5["LastAssignment"] = 79 /* CaretEqualsToken */] = "LastAssignment"; SyntaxKind5[SyntaxKind5["FirstCompoundAssignment"] = 65 /* PlusEqualsToken */] = "FirstCompoundAssignment"; @@ -5889,15 +5890,15 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => { SyntaxKind5[SyntaxKind5["FirstReservedWord"] = 83 /* BreakKeyword */] = "FirstReservedWord"; SyntaxKind5[SyntaxKind5["LastReservedWord"] = 118 /* WithKeyword */] = "LastReservedWord"; SyntaxKind5[SyntaxKind5["FirstKeyword"] = 83 /* BreakKeyword */] = "FirstKeyword"; - SyntaxKind5[SyntaxKind5["LastKeyword"] = 165 /* OfKeyword */] = "LastKeyword"; + SyntaxKind5[SyntaxKind5["LastKeyword"] = 166 /* DeferKeyword */] = "LastKeyword"; SyntaxKind5[SyntaxKind5["FirstFutureReservedWord"] = 119 /* ImplementsKeyword */] = "FirstFutureReservedWord"; SyntaxKind5[SyntaxKind5["LastFutureReservedWord"] = 127 /* YieldKeyword */] = "LastFutureReservedWord"; - SyntaxKind5[SyntaxKind5["FirstTypeNode"] = 182 /* TypePredicate */] = "FirstTypeNode"; - SyntaxKind5[SyntaxKind5["LastTypeNode"] = 205 /* ImportType */] = "LastTypeNode"; + SyntaxKind5[SyntaxKind5["FirstTypeNode"] = 183 /* TypePredicate */] = "FirstTypeNode"; + SyntaxKind5[SyntaxKind5["LastTypeNode"] = 206 /* ImportType */] = "LastTypeNode"; SyntaxKind5[SyntaxKind5["FirstPunctuation"] = 19 /* OpenBraceToken */] = "FirstPunctuation"; SyntaxKind5[SyntaxKind5["LastPunctuation"] = 79 /* CaretEqualsToken */] = "LastPunctuation"; SyntaxKind5[SyntaxKind5["FirstToken"] = 0 /* Unknown */] = "FirstToken"; - SyntaxKind5[SyntaxKind5["LastToken"] = 165 /* LastKeyword */] = "LastToken"; + SyntaxKind5[SyntaxKind5["LastToken"] = 166 /* LastKeyword */] = "LastToken"; SyntaxKind5[SyntaxKind5["FirstTriviaToken"] = 2 /* SingleLineCommentTrivia */] = "FirstTriviaToken"; SyntaxKind5[SyntaxKind5["LastTriviaToken"] = 7 /* ConflictMarkerTrivia */] = "LastTriviaToken"; SyntaxKind5[SyntaxKind5["FirstLiteralToken"] = 9 /* NumericLiteral */] = "FirstLiteralToken"; @@ -5906,15 +5907,15 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => { SyntaxKind5[SyntaxKind5["LastTemplateToken"] = 18 /* TemplateTail */] = "LastTemplateToken"; SyntaxKind5[SyntaxKind5["FirstBinaryOperator"] = 30 /* LessThanToken */] = "FirstBinaryOperator"; SyntaxKind5[SyntaxKind5["LastBinaryOperator"] = 79 /* CaretEqualsToken */] = "LastBinaryOperator"; - SyntaxKind5[SyntaxKind5["FirstStatement"] = 243 /* VariableStatement */] = "FirstStatement"; - SyntaxKind5[SyntaxKind5["LastStatement"] = 259 /* DebuggerStatement */] = "LastStatement"; - SyntaxKind5[SyntaxKind5["FirstNode"] = 166 /* QualifiedName */] = "FirstNode"; - SyntaxKind5[SyntaxKind5["FirstJSDocNode"] = 309 /* JSDocTypeExpression */] = "FirstJSDocNode"; - SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 351 /* JSDocImportTag */] = "LastJSDocNode"; - SyntaxKind5[SyntaxKind5["FirstJSDocTagNode"] = 327 /* JSDocTag */] = "FirstJSDocTagNode"; - SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 351 /* JSDocImportTag */] = "LastJSDocTagNode"; + SyntaxKind5[SyntaxKind5["FirstStatement"] = 244 /* VariableStatement */] = "FirstStatement"; + SyntaxKind5[SyntaxKind5["LastStatement"] = 260 /* DebuggerStatement */] = "LastStatement"; + SyntaxKind5[SyntaxKind5["FirstNode"] = 167 /* QualifiedName */] = "FirstNode"; + SyntaxKind5[SyntaxKind5["FirstJSDocNode"] = 310 /* JSDocTypeExpression */] = "FirstJSDocNode"; + SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 352 /* JSDocImportTag */] = "LastJSDocNode"; + SyntaxKind5[SyntaxKind5["FirstJSDocTagNode"] = 328 /* JSDocTag */] = "FirstJSDocTagNode"; + SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 352 /* JSDocImportTag */] = "LastJSDocTagNode"; SyntaxKind5[SyntaxKind5["FirstContextualKeyword"] = 128 /* AbstractKeyword */] = "FirstContextualKeyword"; - SyntaxKind5[SyntaxKind5["LastContextualKeyword"] = 165 /* OfKeyword */] = "LastContextualKeyword"; + SyntaxKind5[SyntaxKind5["LastContextualKeyword"] = 166 /* LastKeyword */] = "LastContextualKeyword"; return SyntaxKind5; })(SyntaxKind || {}); var NodeFlags = /* @__PURE__ */ ((NodeFlags3) => { @@ -6522,6 +6523,7 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => { ObjectFlags3[ObjectFlags3["NonInferrableType"] = 262144] = "NonInferrableType"; ObjectFlags3[ObjectFlags3["CouldContainTypeVariablesComputed"] = 524288] = "CouldContainTypeVariablesComputed"; ObjectFlags3[ObjectFlags3["CouldContainTypeVariables"] = 1048576] = "CouldContainTypeVariables"; + ObjectFlags3[ObjectFlags3["SingleSignatureType"] = 134217728] = "SingleSignatureType"; ObjectFlags3[ObjectFlags3["ClassOrInterface"] = 3] = "ClassOrInterface"; ObjectFlags3[ObjectFlags3["RequiresWidening"] = 196608] = "RequiresWidening"; ObjectFlags3[ObjectFlags3["PropagatingFlags"] = 458752] = "PropagatingFlags"; @@ -6530,7 +6532,6 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => { ObjectFlags3[ObjectFlags3["ContainsSpread"] = 2097152] = "ContainsSpread"; ObjectFlags3[ObjectFlags3["ObjectRestType"] = 4194304] = "ObjectRestType"; ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] = 8388608] = "InstantiationExpressionType"; - ObjectFlags3[ObjectFlags3["SingleSignatureType"] = 134217728] = "SingleSignatureType"; ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] = 16777216] = "IsClassInstanceClone"; ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] = 33554432] = "IdenticalBaseTypeCalculated"; ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] = 67108864] = "IdenticalBaseTypeExists"; @@ -6735,6 +6736,7 @@ var ModuleKind = /* @__PURE__ */ ((ModuleKind3) => { ModuleKind3[ModuleKind3["ESNext"] = 99] = "ESNext"; ModuleKind3[ModuleKind3["Node16"] = 100] = "Node16"; ModuleKind3[ModuleKind3["Node18"] = 101] = "Node18"; + ModuleKind3[ModuleKind3["Node20"] = 102] = "Node20"; ModuleKind3[ModuleKind3["NodeNext"] = 199] = "NodeNext"; ModuleKind3[ModuleKind3["Preserve"] = 200] = "Preserve"; return ModuleKind3; @@ -6788,10 +6790,10 @@ var ScriptTarget = /* @__PURE__ */ ((ScriptTarget12) => { ScriptTarget12[ScriptTarget12["Latest"] = 99 /* ESNext */] = "Latest"; return ScriptTarget12; })(ScriptTarget || {}); -var LanguageVariant = /* @__PURE__ */ ((LanguageVariant4) => { - LanguageVariant4[LanguageVariant4["Standard"] = 0] = "Standard"; - LanguageVariant4[LanguageVariant4["JSX"] = 1] = "JSX"; - return LanguageVariant4; +var LanguageVariant = /* @__PURE__ */ ((LanguageVariant3) => { + LanguageVariant3[LanguageVariant3["Standard"] = 0] = "Standard"; + LanguageVariant3[LanguageVariant3["JSX"] = 1] = "JSX"; + return LanguageVariant3; })(LanguageVariant || {}); var WatchDirectoryFlags = /* @__PURE__ */ ((WatchDirectoryFlags3) => { WatchDirectoryFlags3[WatchDirectoryFlags3["None"] = 0] = "None"; @@ -9421,8 +9423,8 @@ var Diagnostics = { Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1320, 1 /* Error */, "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."), Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1321, 1 /* Error */, "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."), Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1322, 1 /* Error */, "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."), - Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_or_nodenext: diag(1323, 1 /* Error */, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'."), - Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_nodenext_or_preserve: diag(1324, 1 /* Error */, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'."), + Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_node20_or_nodenext: diag(1323, 1 /* Error */, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'."), + Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_node20_nodenext_or_preserve: diag(1324, 1 /* Error */, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'."), Argument_of_dynamic_import_cannot_be_spread_element: diag(1325, 1 /* Error */, "Argument_of_dynamic_import_cannot_be_spread_element_1325", "Argument of dynamic import cannot be spread element."), This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments: diag(1326, 1 /* Error */, "This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326", "This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."), String_literal_with_double_quotes_expected: diag(1327, 1 /* Error */, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."), @@ -9439,7 +9441,7 @@ var Diagnostics = { Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, 1 /* Error */, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."), Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, 1 /* Error */, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"), Class_constructor_may_not_be_an_accessor: diag(1341, 1 /* Error */, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."), - The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_or_nodenext: diag(1343, 1 /* Error */, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'."), + The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_node20_or_nodenext: diag(1343, 1 /* Error */, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'."), A_label_is_not_allowed_here: diag(1344, 1 /* Error */, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."), An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, 1 /* Error */, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."), This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, 1 /* Error */, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."), @@ -9469,7 +9471,7 @@ var Diagnostics = { await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1375, 1 /* Error */, "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375", "'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."), _0_was_imported_here: diag(1376, 3 /* Message */, "_0_was_imported_here_1376", "'{0}' was imported here."), _0_was_exported_here: diag(1377, 3 /* Message */, "_0_was_exported_here_1377", "'{0}' was exported here."), - Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, 1 /* Error */, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."), + Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, 1 /* Error */, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."), An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379", "An import alias cannot reference a declaration that was exported using 'export type'."), An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."), Unexpected_token_Did_you_mean_or_rbrace: diag(1381, 1 /* Error */, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"), @@ -9520,7 +9522,7 @@ var Diagnostics = { File_redirects_to_file_0: diag(1429, 3 /* Message */, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"), The_file_is_in_the_program_because_Colon: diag(1430, 3 /* Message */, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"), for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1431, 1 /* Error */, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."), - Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, 1 /* Error */, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."), + Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, 1 /* Error */, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."), Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters: diag(1433, 1 /* Error */, "Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433", "Neither decorators nor modifiers may be applied to 'this' parameters."), Unexpected_keyword_or_identifier: diag(1434, 1 /* Error */, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."), Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, 1 /* Error */, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"), @@ -9633,6 +9635,8 @@ var Diagnostics = { Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute: diag(1542, 1 /* Error */, "Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute_1542", "Type import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute."), Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0: diag(1543, 1 /* Error */, "Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_mod_1543", `Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to '{0}'.`), Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0: diag(1544, 1 /* Error */, "Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0_1544", "Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to '{0}'."), + using_declarations_are_not_allowed_in_ambient_contexts: diag(1545, 1 /* Error */, "using_declarations_are_not_allowed_in_ambient_contexts_1545", "'using' declarations are not allowed in ambient contexts."), + await_using_declarations_are_not_allowed_in_ambient_contexts: diag(1546, 1 /* Error */, "await_using_declarations_are_not_allowed_in_ambient_contexts_1546", "'await using' declarations are not allowed in ambient contexts."), The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), Call_signature_return_types_0_and_1_are_incompatible: diag( @@ -9726,6 +9730,7 @@ var Diagnostics = { This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0: diag(2343, 1 /* Error */, "This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343", "This syntax requires an imported helper named '{1}' which does not exist in '{0}'. Consider upgrading your version of '{0}'."), Type_0_does_not_satisfy_the_constraint_1: diag(2344, 1 /* Error */, "Type_0_does_not_satisfy_the_constraint_1_2344", "Type '{0}' does not satisfy the constraint '{1}'."), Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: diag(2345, 1 /* Error */, "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345", "Argument of type '{0}' is not assignable to parameter of type '{1}'."), + Call_target_does_not_contain_any_signatures: diag(2346, 1 /* Error */, "Call_target_does_not_contain_any_signatures_2346", "Call target does not contain any signatures."), Untyped_function_calls_may_not_accept_type_arguments: diag(2347, 1 /* Error */, "Untyped_function_calls_may_not_accept_type_arguments_2347", "Untyped function calls may not accept type arguments."), Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: diag(2348, 1 /* Error */, "Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348", "Value of type '{0}' is not callable. Did you mean to include 'new'?"), This_expression_is_not_callable: diag(2349, 1 /* Error */, "This_expression_is_not_callable_2349", "This expression is not callable."), @@ -10067,7 +10072,7 @@ var Diagnostics = { Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, 1 /* Error */, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."), Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, 1 /* Error */, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."), _0_has_no_exported_member_named_1_Did_you_mean_2: diag(2724, 1 /* Error */, "_0_has_no_exported_member_named_1_Did_you_mean_2_2724", "'{0}' has no exported member named '{1}'. Did you mean '{2}'?"), - Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: diag(2725, 1 /* Error */, "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 with module {0}."), + Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0: diag(2725, 1 /* Error */, "Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 and above with module {0}."), Cannot_find_lib_definition_for_0: diag(2726, 1 /* Error */, "Cannot_find_lib_definition_for_0_2726", "Cannot find lib definition for '{0}'."), Cannot_find_lib_definition_for_0_Did_you_mean_1: diag(2727, 1 /* Error */, "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727", "Cannot find lib definition for '{0}'. Did you mean '{1}'?"), _0_is_declared_here: diag(2728, 3 /* Message */, "_0_is_declared_here_2728", "'{0}' is declared here."), @@ -10156,15 +10161,15 @@ var Diagnostics = { Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom: diag(2812, 1 /* Error */, "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812", "Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."), Class_declaration_cannot_implement_overload_list_for_0: diag(2813, 1 /* Error */, "Class_declaration_cannot_implement_overload_list_for_0_2813", "Class declaration cannot implement overload list for '{0}'."), Function_with_bodies_can_only_merge_with_classes_that_are_ambient: diag(2814, 1 /* Error */, "Function_with_bodies_can_only_merge_with_classes_that_are_ambient_2814", "Function with bodies can only merge with classes that are ambient."), - arguments_cannot_be_referenced_in_property_initializers: diag(2815, 1 /* Error */, "arguments_cannot_be_referenced_in_property_initializers_2815", "'arguments' cannot be referenced in property initializers."), + arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks: diag(2815, 1 /* Error */, "arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks_2815", "'arguments' cannot be referenced in property initializers or class static initialization blocks."), Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class: diag(2816, 1 /* Error */, "Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class_2816", "Cannot use 'this' in a static property initializer of a decorated class."), Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block: diag(2817, 1 /* Error */, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817", "Property '{0}' has no initializer and is not definitely assigned in a class static block."), Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers: diag(2818, 1 /* Error */, "Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818", "Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."), Namespace_name_cannot_be_0: diag(2819, 1 /* Error */, "Namespace_name_cannot_be_0_2819", "Namespace name cannot be '{0}'."), Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"), - Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve: diag(2821, 1 /* Error */, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2821", "Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'."), + Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext_or_preserve: diag(2821, 1 /* Error */, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext__2821", "Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'."), Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, 1 /* Error */, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."), - Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve: diag(2823, 1 /* Error */, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2823", "Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'."), + Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext_or_preserve: diag(2823, 1 /* Error */, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext__2823", "Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'."), Cannot_find_namespace_0_Did_you_mean_1: diag(2833, 1 /* Error */, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"), Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, 1 /* Error */, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."), Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, 1 /* Error */, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"), @@ -10184,7 +10189,7 @@ var Diagnostics = { The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_Symbol_dispose_method_or_be_null_or_undefined: diag(2851, 1 /* Error */, "The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_2851", "The initializer of an 'await using' declaration must be either an object with a '[Symbol.asyncDispose]()' or '[Symbol.dispose]()' method, or be 'null' or 'undefined'."), await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(2852, 1 /* Error */, "await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852", "'await using' statements are only allowed within async functions and at the top levels of modules."), await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(2853, 1 /* Error */, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."), - Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1 /* Error */, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."), + Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1 /* Error */, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."), Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super: diag(2855, 1 /* Error */, "Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super_2855", "Class field '{0}' defined by the parent class is not accessible in the child class via super."), Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls: diag(2856, 1 /* Error */, "Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856", "Import attributes are not allowed on statements that compile to CommonJS 'require' calls."), Import_attributes_cannot_be_used_with_type_only_imports_or_exports: diag(2857, 1 /* Error */, "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857", "Import attributes cannot be used with type-only imports or exports."), @@ -10211,6 +10216,7 @@ var Diagnostics = { This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files: diag(2878, 1 /* Error */, "This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_b_2878", "This import path is unsafe to rewrite because it resolves to another project, and the relative path between the projects' output files is not the same as the relative path between its input files."), Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found: diag(2879, 1 /* Error */, "Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found_2879", "Using JSX fragments requires fragment factory '{0}' to be in scope, but it could not be found."), Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert: diag(2880, 1 /* Error */, "Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880", "Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'."), + This_expression_is_never_nullish: diag(2881, 1 /* Error */, "This_expression_is_never_nullish_2881", "This expression is never nullish."), Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -10678,6 +10684,15 @@ var Diagnostics = { package_json_has_a_peerDependencies_field: diag(6281, 3 /* Message */, "package_json_has_a_peerDependencies_field_6281", "'package.json' has a 'peerDependencies' field."), Found_peerDependency_0_with_1_version: diag(6282, 3 /* Message */, "Found_peerDependency_0_with_1_version_6282", "Found peerDependency '{0}' with '{1}' version."), Failed_to_find_peerDependency_0: diag(6283, 3 /* Message */, "Failed_to_find_peerDependency_0_6283", "Failed to find peerDependency '{0}'."), + File_Layout: diag(6284, 3 /* Message */, "File_Layout_6284", "File Layout"), + Environment_Settings: diag(6285, 3 /* Message */, "Environment_Settings_6285", "Environment Settings"), + See_also_https_Colon_Slash_Slashaka_ms_Slashtsconfig_Slashmodule: diag(6286, 3 /* Message */, "See_also_https_Colon_Slash_Slashaka_ms_Slashtsconfig_Slashmodule_6286", "See also https://aka.ms/tsconfig/module"), + For_nodejs_Colon: diag(6287, 3 /* Message */, "For_nodejs_Colon_6287", "For nodejs:"), + and_npm_install_D_types_Slashnode: diag(6290, 3 /* Message */, "and_npm_install_D_types_Slashnode_6290", "and npm install -D @types/node"), + Other_Outputs: diag(6291, 3 /* Message */, "Other_Outputs_6291", "Other Outputs"), + Stricter_Typechecking_Options: diag(6292, 3 /* Message */, "Stricter_Typechecking_Options_6292", "Stricter Typechecking Options"), + Style_Options: diag(6293, 3 /* Message */, "Style_Options_6293", "Style Options"), + Recommended_Options: diag(6294, 3 /* Message */, "Recommended_Options_6294", "Recommended Options"), Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"), Composite_projects_may_not_disable_declaration_emit: diag(6304, 1 /* Error */, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."), Output_file_0_has_not_been_built_from_source_file_1: diag(6305, 1 /* Error */, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."), @@ -10777,7 +10792,7 @@ var Diagnostics = { File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option: diag(6504, 1 /* Error */, "File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504", "File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"), Print_names_of_files_and_the_reason_they_are_part_of_the_compilation: diag(6505, 3 /* Message */, "Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505", "Print names of files and the reason they are part of the compilation."), Consider_adding_a_declare_modifier_to_this_class: diag(6506, 3 /* Message */, "Consider_adding_a_declare_modifier_to_this_class_6506", "Consider adding a 'declare' modifier to this class."), - Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files: diag(6600, 3 /* Message */, "Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600", "Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files."), + Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these_files: diag(6600, 3 /* Message */, "Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these__6600", "Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files."), Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export: diag(6601, 3 /* Message */, "Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601", "Allow 'import x from y' when a module doesn't have a default export."), Allow_accessing_UMD_globals_from_modules: diag(6602, 3 /* Message */, "Allow_accessing_UMD_globals_from_modules_6602", "Allow accessing UMD globals from modules."), Disable_error_reporting_for_unreachable_code: diag(6603, 3 /* Message */, "Disable_error_reporting_for_unreachable_code_6603", "Disable error reporting for unreachable code."), @@ -11397,7 +11412,11 @@ var Diagnostics = { await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1 /* Error */, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block."), _0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is_enabled: diag(18055, 1 /* Error */, "_0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is__18055", "'{0}' has a string type, but must have syntactically recognizable string syntax when 'isolatedModules' is enabled."), Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled: diag(18056, 1 /* Error */, "Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is__18056", "Enum member following a non-literal numeric member must have an initializer when 'isolatedModules' is enabled."), - String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020: diag(18057, 1 /* Error */, "String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es_18057", "String literal import and export names are not supported when the '--module' flag is set to 'es2015' or 'es2020'.") + String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020: diag(18057, 1 /* Error */, "String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es_18057", "String literal import and export names are not supported when the '--module' flag is set to 'es2015' or 'es2020'."), + Default_imports_are_not_allowed_in_a_deferred_import: diag(18058, 1 /* Error */, "Default_imports_are_not_allowed_in_a_deferred_import_18058", "Default imports are not allowed in a deferred import."), + Named_imports_are_not_allowed_in_a_deferred_import: diag(18059, 1 /* Error */, "Named_imports_are_not_allowed_in_a_deferred_import_18059", "Named imports are not allowed in a deferred import."), + Deferred_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_or_preserve: diag(18060, 1 /* Error */, "Deferred_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_or_preserve_18060", "Deferred imports are only supported when the '--module' flag is set to 'esnext' or 'preserve'."), + _0_is_not_a_valid_meta_property_for_keyword_import_Did_you_mean_meta_or_defer: diag(18061, 1 /* Error */, "_0_is_not_a_valid_meta_property_for_keyword_import_Did_you_mean_meta_or_defer_18061", "'{0}' is not a valid meta-property for keyword 'import'. Did you mean 'meta' or 'defer'?") }; // src/compiler/scanner.ts @@ -11426,6 +11445,7 @@ var textToKeywordObj = { debugger: 89 /* DebuggerKeyword */, declare: 138 /* DeclareKeyword */, default: 90 /* DefaultKeyword */, + defer: 166 /* DeferKeyword */, delete: 91 /* DeleteKeyword */, do: 92 /* DoKeyword */, else: 93 /* ElseKeyword */, @@ -14800,16 +14820,16 @@ function collapseTextChangeRangesAcrossMultipleVersions(changes) { ); } function getTypeParameterOwner(d) { - if (d && d.kind === 168 /* TypeParameter */) { + if (d && d.kind === 169 /* TypeParameter */) { for (let current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 264 /* InterfaceDeclaration */) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 265 /* InterfaceDeclaration */) { return current; } } } } function isParameterPropertyDeclaration(node, parent2) { - return isParameter(node) && hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */) && parent2.kind === 176 /* Constructor */; + return isParameter(node) && hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */) && parent2.kind === 177 /* Constructor */; } function isEmptyBindingPattern(node) { if (isBindingPattern(node)) { @@ -14835,14 +14855,14 @@ function getCombinedFlags(node, getFlags) { node = walkUpBindingElementsAndPatterns(node); } let flags = getFlags(node); - if (node.kind === 260 /* VariableDeclaration */) { + if (node.kind === 261 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 261 /* VariableDeclarationList */) { + if (node && node.kind === 262 /* VariableDeclarationList */) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 243 /* VariableStatement */) { + if (node && node.kind === 244 /* VariableStatement */) { flags |= getFlags(node); } return flags; @@ -14978,30 +14998,30 @@ function nameForNamelessJSDocTypedef(declaration) { return getDeclarationIdentifier(hostNode); } switch (hostNode.kind) { - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: let expr = hostNode.expression; - if (expr.kind === 226 /* BinaryExpression */ && expr.operatorToken.kind === 64 /* EqualsToken */) { + if (expr.kind === 227 /* BinaryExpression */ && expr.operatorToken.kind === 64 /* EqualsToken */) { expr = expr.left; } switch (expr.kind) { - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return expr.name; - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: const arg = expr.argumentExpression; if (isIdentifier(arg)) { return arg; } } break; - case 217 /* ParenthesizedExpression */: { + case 218 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 256 /* LabeledStatement */: { + case 257 /* LabeledStatement */: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -15032,16 +15052,16 @@ function getNonAssignedNameOfDeclaration(declaration) { switch (declaration.kind) { case 80 /* Identifier */: return declaration; - case 348 /* JSDocPropertyTag */: - case 341 /* JSDocParameterTag */: { + case 349 /* JSDocPropertyTag */: + case 342 /* JSDocParameterTag */: { const { name } = declaration; - if (name.kind === 166 /* QualifiedName */) { + if (name.kind === 167 /* QualifiedName */) { return name.right; } break; } - case 213 /* CallExpression */: - case 226 /* BinaryExpression */: { + case 214 /* CallExpression */: + case 227 /* BinaryExpression */: { const expr2 = declaration; switch (getAssignmentDeclarationKind(expr2)) { case 1 /* ExportsProperty */: @@ -15057,15 +15077,15 @@ function getNonAssignedNameOfDeclaration(declaration) { return void 0; } } - case 346 /* JSDocTypedefTag */: + case 347 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 340 /* JSDocEnumTag */: + case 341 /* JSDocEnumTag */: return nameForNamelessJSDocTypedef(declaration); - case 277 /* ExportAssignment */: { + case 278 /* ExportAssignment */: { const { expression } = declaration; return isIdentifier(expression) ? expression : void 0; } - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: const expr = declaration; if (isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -15303,10 +15323,10 @@ function getAllJSDocTagsOfKind(node, kind) { return getJSDocTags(node).filter((doc) => doc.kind === kind); } function getTextOfJSDocComment(comment) { - return typeof comment === "string" ? comment : comment == null ? void 0 : comment.map((c) => c.kind === 321 /* JSDocText */ ? c.text : formatJSDocLink(c)).join(""); + return typeof comment === "string" ? comment : comment == null ? void 0 : comment.map((c) => c.kind === 322 /* JSDocText */ ? c.text : formatJSDocLink(c)).join(""); } function formatJSDocLink(link) { - const kind = link.kind === 324 /* JSDocLink */ ? "link" : link.kind === 325 /* JSDocLinkCode */ ? "linkcode" : "linkplain"; + const kind = link.kind === 325 /* JSDocLink */ ? "link" : link.kind === 326 /* JSDocLinkCode */ ? "linkcode" : "linkplain"; const name = link.name ? entityNameToString(link.name) : ""; const space = link.name && (link.text === "" || link.text.startsWith("://")) ? "" : " "; return `{@${kind} ${name}${space}${link.text}}`; @@ -15322,7 +15342,7 @@ function getEffectiveTypeParameterDeclarations(node) { return emptyArray; } if (isJSDocTypeAlias(node)) { - Debug.assert(node.parent.kind === 320 /* JSDoc */); + Debug.assert(node.parent.kind === 321 /* JSDoc */); return flatMap(node.parent.tags, (tag) => isJSDocTemplateTag(tag) ? tag.typeParameters : void 0); } if (node.typeParameters) { @@ -15350,7 +15370,7 @@ function isMemberName(node) { return node.kind === 80 /* Identifier */ || node.kind === 81 /* PrivateIdentifier */; } function isGetOrSetAccessorDeclaration(node) { - return node.kind === 178 /* SetAccessor */ || node.kind === 177 /* GetAccessor */; + return node.kind === 179 /* SetAccessor */ || node.kind === 178 /* GetAccessor */; } function isPropertyAccessChain(node) { return isPropertyAccessExpression(node) && !!(node.flags & 64 /* OptionalChain */); @@ -15363,7 +15383,7 @@ function isCallChain(node) { } function isOptionalChain(node) { const kind = node.kind; - return !!(node.flags & 64 /* OptionalChain */) && (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */ || kind === 213 /* CallExpression */ || kind === 235 /* NonNullExpression */); + return !!(node.flags & 64 /* OptionalChain */) && (kind === 212 /* PropertyAccessExpression */ || kind === 213 /* ElementAccessExpression */ || kind === 214 /* CallExpression */ || kind === 236 /* NonNullExpression */); } function isOptionalChainRoot(node) { return isOptionalChain(node) && !isNonNullExpression(node) && !!node.questionDotToken; @@ -15375,7 +15395,7 @@ function isOutermostOptionalChain(node) { return !isOptionalChain(node.parent) || isOptionalChainRoot(node.parent) || node !== node.parent.expression; } function isNullishCoalesce(node) { - return node.kind === 226 /* BinaryExpression */ && node.operatorToken.kind === 61 /* QuestionQuestionToken */; + return node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 61 /* QuestionQuestionToken */; } function isConstTypeReference(node) { return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "const" && !node.typeArguments; @@ -15387,19 +15407,19 @@ function isNonNullChain(node) { return isNonNullExpression(node) && !!(node.flags & 64 /* OptionalChain */); } function isBreakOrContinueStatement(node) { - return node.kind === 252 /* BreakStatement */ || node.kind === 251 /* ContinueStatement */; + return node.kind === 253 /* BreakStatement */ || node.kind === 252 /* ContinueStatement */; } function isNamedExportBindings(node) { - return node.kind === 280 /* NamespaceExport */ || node.kind === 279 /* NamedExports */; + return node.kind === 281 /* NamespaceExport */ || node.kind === 280 /* NamedExports */; } function isJSDocPropertyLikeTag(node) { - return node.kind === 348 /* JSDocPropertyTag */ || node.kind === 341 /* JSDocParameterTag */; + return node.kind === 349 /* JSDocPropertyTag */ || node.kind === 342 /* JSDocParameterTag */; } function isNodeKind(kind) { - return kind >= 166 /* FirstNode */; + return kind >= 167 /* FirstNode */; } function isTokenKind(kind) { - return kind >= 0 /* FirstToken */ && kind <= 165 /* LastToken */; + return kind >= 0 /* FirstToken */ && kind <= 166 /* LastToken */; } function isToken(n) { return isTokenKind(n.kind); @@ -15415,11 +15435,11 @@ function isLiteralExpression(node) { } function isLiteralExpressionOfObject(node) { switch (node.kind) { - case 210 /* ObjectLiteralExpression */: - case 209 /* ArrayLiteralExpression */: + case 211 /* ObjectLiteralExpression */: + case 210 /* ArrayLiteralExpression */: case 14 /* RegularExpressionLiteral */: - case 218 /* FunctionExpression */: - case 231 /* ClassExpression */: + case 219 /* FunctionExpression */: + case 232 /* ClassExpression */: return true; } return false; @@ -15439,23 +15459,24 @@ function isImportOrExportSpecifier(node) { } function isTypeOnlyImportDeclaration(node) { switch (node.kind) { - case 276 /* ImportSpecifier */: - return node.isTypeOnly || node.parent.parent.isTypeOnly; - case 274 /* NamespaceImport */: - return node.parent.isTypeOnly; - case 273 /* ImportClause */: - case 271 /* ImportEqualsDeclaration */: + case 277 /* ImportSpecifier */: + return node.isTypeOnly || node.parent.parent.phaseModifier === 156 /* TypeKeyword */; + case 275 /* NamespaceImport */: + return node.parent.phaseModifier === 156 /* TypeKeyword */; + case 274 /* ImportClause */: + return node.phaseModifier === 156 /* TypeKeyword */; + case 272 /* ImportEqualsDeclaration */: return node.isTypeOnly; } return false; } function isTypeOnlyExportDeclaration(node) { switch (node.kind) { - case 281 /* ExportSpecifier */: + case 282 /* ExportSpecifier */: return node.isTypeOnly || node.parent.parent.isTypeOnly; - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: return node.isTypeOnly && !!node.moduleSpecifier && !node.exportClause; - case 280 /* NamespaceExport */: + case 281 /* NamespaceExport */: return node.parent.isTypeOnly; } return false; @@ -15522,15 +15543,15 @@ function isModifier(node) { } function isEntityName(node) { const kind = node.kind; - return kind === 166 /* QualifiedName */ || kind === 80 /* Identifier */; + return kind === 167 /* QualifiedName */ || kind === 80 /* Identifier */; } function isPropertyName(node) { const kind = node.kind; - return kind === 80 /* Identifier */ || kind === 81 /* PrivateIdentifier */ || kind === 11 /* StringLiteral */ || kind === 9 /* NumericLiteral */ || kind === 167 /* ComputedPropertyName */; + return kind === 80 /* Identifier */ || kind === 81 /* PrivateIdentifier */ || kind === 11 /* StringLiteral */ || kind === 9 /* NumericLiteral */ || kind === 168 /* ComputedPropertyName */; } function isBindingName(node) { const kind = node.kind; - return kind === 80 /* Identifier */ || kind === 206 /* ObjectBindingPattern */ || kind === 207 /* ArrayBindingPattern */; + return kind === 80 /* Identifier */ || kind === 207 /* ObjectBindingPattern */ || kind === 208 /* ArrayBindingPattern */; } function isFunctionLike(node) { return !!node && isFunctionLikeKind(node.kind); @@ -15546,13 +15567,13 @@ function isBooleanLiteral(node) { } function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 262 /* FunctionDeclaration */: - case 174 /* MethodDeclaration */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return true; default: return false; @@ -15560,14 +15581,14 @@ function isFunctionLikeDeclarationKind(kind) { } function isFunctionLikeKind(kind) { switch (kind) { - case 173 /* MethodSignature */: - case 179 /* CallSignature */: - case 323 /* JSDocSignature */: - case 180 /* ConstructSignature */: - case 181 /* IndexSignature */: - case 184 /* FunctionType */: - case 317 /* JSDocFunctionType */: - case 185 /* ConstructorType */: + case 174 /* MethodSignature */: + case 180 /* CallSignature */: + case 324 /* JSDocSignature */: + case 181 /* ConstructSignature */: + case 182 /* IndexSignature */: + case 185 /* FunctionType */: + case 318 /* JSDocFunctionType */: + case 186 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -15578,13 +15599,13 @@ function isFunctionOrModuleBlock(node) { } function isClassElement(node) { const kind = node.kind; - return kind === 176 /* Constructor */ || kind === 172 /* PropertyDeclaration */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 181 /* IndexSignature */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 240 /* SemicolonClassElement */; + return kind === 177 /* Constructor */ || kind === 173 /* PropertyDeclaration */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */ || kind === 182 /* IndexSignature */ || kind === 176 /* ClassStaticBlockDeclaration */ || kind === 241 /* SemicolonClassElement */; } function isClassLike(node) { - return node && (node.kind === 263 /* ClassDeclaration */ || node.kind === 231 /* ClassExpression */); + return node && (node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */); } function isAccessor(node) { - return node && (node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */); + return node && (node.kind === 178 /* GetAccessor */ || node.kind === 179 /* SetAccessor */); } function isAutoAccessorPropertyDeclaration(node) { return isPropertyDeclaration(node) && hasAccessorModifier(node); @@ -15601,9 +15622,9 @@ function isClassInstanceProperty(node) { } function isMethodOrAccessor(node) { switch (node.kind) { - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return true; default: return false; @@ -15614,22 +15635,22 @@ function isModifierLike(node) { } function isTypeElement(node) { const kind = node.kind; - return kind === 180 /* ConstructSignature */ || kind === 179 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 173 /* MethodSignature */ || kind === 181 /* IndexSignature */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 354 /* NotEmittedTypeElement */; + return kind === 181 /* ConstructSignature */ || kind === 180 /* CallSignature */ || kind === 172 /* PropertySignature */ || kind === 174 /* MethodSignature */ || kind === 182 /* IndexSignature */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */ || kind === 355 /* NotEmittedTypeElement */; } function isClassOrTypeElement(node) { return isTypeElement(node) || isClassElement(node); } function isObjectLiteralElementLike(node) { const kind = node.kind; - return kind === 303 /* PropertyAssignment */ || kind === 304 /* ShorthandPropertyAssignment */ || kind === 305 /* SpreadAssignment */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */; + return kind === 304 /* PropertyAssignment */ || kind === 305 /* ShorthandPropertyAssignment */ || kind === 306 /* SpreadAssignment */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */; } function isTypeNode(node) { return isTypeNodeKind(node.kind); } function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 184 /* FunctionType */: - case 185 /* ConstructorType */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: return true; } return false; @@ -15637,23 +15658,23 @@ function isFunctionOrConstructorTypeNode(node) { function isBindingPattern(node) { if (node) { const kind = node.kind; - return kind === 207 /* ArrayBindingPattern */ || kind === 206 /* ObjectBindingPattern */; + return kind === 208 /* ArrayBindingPattern */ || kind === 207 /* ObjectBindingPattern */; } return false; } function isAssignmentPattern(node) { const kind = node.kind; - return kind === 209 /* ArrayLiteralExpression */ || kind === 210 /* ObjectLiteralExpression */; + return kind === 210 /* ArrayLiteralExpression */ || kind === 211 /* ObjectLiteralExpression */; } function isArrayBindingElement(node) { const kind = node.kind; - return kind === 208 /* BindingElement */ || kind === 232 /* OmittedExpression */; + return kind === 209 /* BindingElement */ || kind === 233 /* OmittedExpression */; } function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 260 /* VariableDeclaration */: - case 169 /* Parameter */: - case 208 /* BindingElement */: + case 261 /* VariableDeclaration */: + case 170 /* Parameter */: + case 209 /* BindingElement */: return true; } return false; @@ -15666,48 +15687,48 @@ function isBindingOrAssignmentPattern(node) { } function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 206 /* ObjectBindingPattern */: - case 210 /* ObjectLiteralExpression */: + case 207 /* ObjectBindingPattern */: + case 211 /* ObjectLiteralExpression */: return true; } return false; } function isObjectBindingOrAssignmentElement(node) { switch (node.kind) { - case 208 /* BindingElement */: - case 303 /* PropertyAssignment */: + case 209 /* BindingElement */: + case 304 /* PropertyAssignment */: // AssignmentProperty - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: // AssignmentProperty - case 305 /* SpreadAssignment */: + case 306 /* SpreadAssignment */: return true; } return false; } function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 207 /* ArrayBindingPattern */: - case 209 /* ArrayLiteralExpression */: + case 208 /* ArrayBindingPattern */: + case 210 /* ArrayLiteralExpression */: return true; } return false; } function isArrayBindingOrAssignmentElement(node) { switch (node.kind) { - case 208 /* BindingElement */: - case 232 /* OmittedExpression */: + case 209 /* BindingElement */: + case 233 /* OmittedExpression */: // Elision - case 230 /* SpreadElement */: + case 231 /* SpreadElement */: // AssignmentRestElement - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: // ArrayAssignmentPattern - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: // ObjectAssignmentPattern case 80 /* Identifier */: // DestructuringAssignmentTarget - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: // DestructuringAssignmentTarget - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return true; } return isAssignmentExpression( @@ -15718,56 +15739,56 @@ function isArrayBindingOrAssignmentElement(node) { } function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { const kind = node.kind; - return kind === 211 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */ || kind === 205 /* ImportType */; + return kind === 212 /* PropertyAccessExpression */ || kind === 167 /* QualifiedName */ || kind === 206 /* ImportType */; } function isPropertyAccessOrQualifiedName(node) { const kind = node.kind; - return kind === 211 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */; + return kind === 212 /* PropertyAccessExpression */ || kind === 167 /* QualifiedName */; } function isCallLikeOrFunctionLikeExpression(node) { return isCallLikeExpression(node) || isFunctionExpressionOrArrowFunction(node); } function isCallLikeExpression(node) { switch (node.kind) { - case 213 /* CallExpression */: - case 214 /* NewExpression */: - case 215 /* TaggedTemplateExpression */: - case 170 /* Decorator */: - case 286 /* JsxOpeningElement */: - case 285 /* JsxSelfClosingElement */: - case 289 /* JsxOpeningFragment */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: + case 216 /* TaggedTemplateExpression */: + case 171 /* Decorator */: + case 287 /* JsxOpeningElement */: + case 286 /* JsxSelfClosingElement */: + case 290 /* JsxOpeningFragment */: return true; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return node.operatorToken.kind === 104 /* InstanceOfKeyword */; default: return false; } } function isCallOrNewExpression(node) { - return node.kind === 213 /* CallExpression */ || node.kind === 214 /* NewExpression */; + return node.kind === 214 /* CallExpression */ || node.kind === 215 /* NewExpression */; } function isTemplateLiteral(node) { const kind = node.kind; - return kind === 228 /* TemplateExpression */ || kind === 15 /* NoSubstitutionTemplateLiteral */; + return kind === 229 /* TemplateExpression */ || kind === 15 /* NoSubstitutionTemplateLiteral */; } function isLeftHandSideExpression(node) { return isLeftHandSideExpressionKind(skipPartiallyEmittedExpressions(node).kind); } function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: - case 214 /* NewExpression */: - case 213 /* CallExpression */: - case 284 /* JsxElement */: - case 285 /* JsxSelfClosingElement */: - case 288 /* JsxFragment */: - case 215 /* TaggedTemplateExpression */: - case 209 /* ArrayLiteralExpression */: - case 217 /* ParenthesizedExpression */: - case 210 /* ObjectLiteralExpression */: - case 231 /* ClassExpression */: - case 218 /* FunctionExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: + case 215 /* NewExpression */: + case 214 /* CallExpression */: + case 285 /* JsxElement */: + case 286 /* JsxSelfClosingElement */: + case 289 /* JsxFragment */: + case 216 /* TaggedTemplateExpression */: + case 210 /* ArrayLiteralExpression */: + case 218 /* ParenthesizedExpression */: + case 211 /* ObjectLiteralExpression */: + case 232 /* ClassExpression */: + case 219 /* FunctionExpression */: case 80 /* Identifier */: case 81 /* PrivateIdentifier */: // technically this is only an Expression if it's in a `#field in expr` BinaryExpression @@ -15776,18 +15797,18 @@ function isLeftHandSideExpressionKind(kind) { case 10 /* BigIntLiteral */: case 11 /* StringLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: - case 228 /* TemplateExpression */: + case 229 /* TemplateExpression */: case 97 /* FalseKeyword */: case 106 /* NullKeyword */: case 110 /* ThisKeyword */: case 112 /* TrueKeyword */: case 108 /* SuperKeyword */: - case 235 /* NonNullExpression */: - case 233 /* ExpressionWithTypeArguments */: - case 236 /* MetaProperty */: + case 236 /* NonNullExpression */: + case 234 /* ExpressionWithTypeArguments */: + case 237 /* MetaProperty */: case 102 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression - case 282 /* MissingDeclaration */: + case 283 /* MissingDeclaration */: return true; default: return false; @@ -15798,13 +15819,13 @@ function isUnaryExpression(node) { } function isUnaryExpressionKind(kind) { switch (kind) { - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: - case 220 /* DeleteExpression */: - case 221 /* TypeOfExpression */: - case 222 /* VoidExpression */: - case 223 /* AwaitExpression */: - case 216 /* TypeAssertionExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: + case 221 /* DeleteExpression */: + case 222 /* TypeOfExpression */: + case 223 /* VoidExpression */: + case 224 /* AwaitExpression */: + case 217 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -15812,9 +15833,9 @@ function isUnaryExpressionKind(kind) { } function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 225 /* PostfixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return true; - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: return expr.operator === 46 /* PlusPlusToken */ || expr.operator === 47 /* MinusMinusToken */; default: return false; @@ -15825,7 +15846,7 @@ function isLiteralTypeLiteral(node) { case 106 /* NullKeyword */: case 112 /* TrueKeyword */: case 97 /* FalseKeyword */: - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: return true; default: return isLiteralExpression(node); @@ -15836,16 +15857,16 @@ function isExpression(node) { } function isExpressionKind(kind) { switch (kind) { - case 227 /* ConditionalExpression */: - case 229 /* YieldExpression */: - case 219 /* ArrowFunction */: - case 226 /* BinaryExpression */: - case 230 /* SpreadElement */: - case 234 /* AsExpression */: - case 232 /* OmittedExpression */: - case 356 /* CommaListExpression */: - case 355 /* PartiallyEmittedExpression */: - case 238 /* SatisfiesExpression */: + case 228 /* ConditionalExpression */: + case 230 /* YieldExpression */: + case 220 /* ArrowFunction */: + case 227 /* BinaryExpression */: + case 231 /* SpreadElement */: + case 235 /* AsExpression */: + case 233 /* OmittedExpression */: + case 357 /* CommaListExpression */: + case 356 /* PartiallyEmittedExpression */: + case 239 /* SatisfiesExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -15853,17 +15874,17 @@ function isExpressionKind(kind) { } function isAssertionExpression(node) { const kind = node.kind; - return kind === 216 /* TypeAssertionExpression */ || kind === 234 /* AsExpression */; + return kind === 217 /* TypeAssertionExpression */ || kind === 235 /* AsExpression */; } function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: return true; - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -15881,7 +15902,7 @@ function isExternalModuleIndicator(result) { return isAnyImportOrReExport(result) || isExportAssignment(result) || hasSyntacticModifier(result, 32 /* Export */); } function isForInOrOfStatement(node) { - return node.kind === 249 /* ForInStatement */ || node.kind === 250 /* ForOfStatement */; + return node.kind === 250 /* ForInStatement */ || node.kind === 251 /* ForOfStatement */; } function isConciseBody(node) { return isBlock(node) || isExpression(node); @@ -15894,89 +15915,89 @@ function isForInitializer(node) { } function isModuleBody(node) { const kind = node.kind; - return kind === 268 /* ModuleBlock */ || kind === 267 /* ModuleDeclaration */ || kind === 80 /* Identifier */; + return kind === 269 /* ModuleBlock */ || kind === 268 /* ModuleDeclaration */ || kind === 80 /* Identifier */; } function isNamespaceBody(node) { const kind = node.kind; - return kind === 268 /* ModuleBlock */ || kind === 267 /* ModuleDeclaration */; + return kind === 269 /* ModuleBlock */ || kind === 268 /* ModuleDeclaration */; } function isJSDocNamespaceBody(node) { const kind = node.kind; - return kind === 80 /* Identifier */ || kind === 267 /* ModuleDeclaration */; + return kind === 80 /* Identifier */ || kind === 268 /* ModuleDeclaration */; } function isNamedImportBindings(node) { const kind = node.kind; - return kind === 275 /* NamedImports */ || kind === 274 /* NamespaceImport */; + return kind === 276 /* NamedImports */ || kind === 275 /* NamespaceImport */; } function isModuleOrEnumDeclaration(node) { - return node.kind === 267 /* ModuleDeclaration */ || node.kind === 266 /* EnumDeclaration */; + return node.kind === 268 /* ModuleDeclaration */ || node.kind === 267 /* EnumDeclaration */; } function canHaveSymbol(node) { switch (node.kind) { - case 219 /* ArrowFunction */: - case 226 /* BinaryExpression */: - case 208 /* BindingElement */: - case 213 /* CallExpression */: - case 179 /* CallSignature */: - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 175 /* ClassStaticBlockDeclaration */: - case 176 /* Constructor */: - case 185 /* ConstructorType */: - case 180 /* ConstructSignature */: - case 212 /* ElementAccessExpression */: - case 266 /* EnumDeclaration */: - case 306 /* EnumMember */: - case 277 /* ExportAssignment */: - case 278 /* ExportDeclaration */: - case 281 /* ExportSpecifier */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 184 /* FunctionType */: - case 177 /* GetAccessor */: + case 220 /* ArrowFunction */: + case 227 /* BinaryExpression */: + case 209 /* BindingElement */: + case 214 /* CallExpression */: + case 180 /* CallSignature */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 176 /* ClassStaticBlockDeclaration */: + case 177 /* Constructor */: + case 186 /* ConstructorType */: + case 181 /* ConstructSignature */: + case 213 /* ElementAccessExpression */: + case 267 /* EnumDeclaration */: + case 307 /* EnumMember */: + case 278 /* ExportAssignment */: + case 279 /* ExportDeclaration */: + case 282 /* ExportSpecifier */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 185 /* FunctionType */: + case 178 /* GetAccessor */: case 80 /* Identifier */: - case 273 /* ImportClause */: - case 271 /* ImportEqualsDeclaration */: - case 276 /* ImportSpecifier */: - case 181 /* IndexSignature */: - case 264 /* InterfaceDeclaration */: - case 338 /* JSDocCallbackTag */: - case 340 /* JSDocEnumTag */: - case 317 /* JSDocFunctionType */: - case 341 /* JSDocParameterTag */: - case 348 /* JSDocPropertyTag */: - case 323 /* JSDocSignature */: - case 346 /* JSDocTypedefTag */: - case 322 /* JSDocTypeLiteral */: - case 291 /* JsxAttribute */: - case 292 /* JsxAttributes */: - case 293 /* JsxSpreadAttribute */: - case 200 /* MappedType */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 267 /* ModuleDeclaration */: - case 202 /* NamedTupleMember */: - case 280 /* NamespaceExport */: - case 270 /* NamespaceExportDeclaration */: - case 274 /* NamespaceImport */: - case 214 /* NewExpression */: + case 274 /* ImportClause */: + case 272 /* ImportEqualsDeclaration */: + case 277 /* ImportSpecifier */: + case 182 /* IndexSignature */: + case 265 /* InterfaceDeclaration */: + case 339 /* JSDocCallbackTag */: + case 341 /* JSDocEnumTag */: + case 318 /* JSDocFunctionType */: + case 342 /* JSDocParameterTag */: + case 349 /* JSDocPropertyTag */: + case 324 /* JSDocSignature */: + case 347 /* JSDocTypedefTag */: + case 323 /* JSDocTypeLiteral */: + case 292 /* JsxAttribute */: + case 293 /* JsxAttributes */: + case 294 /* JsxSpreadAttribute */: + case 201 /* MappedType */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 268 /* ModuleDeclaration */: + case 203 /* NamedTupleMember */: + case 281 /* NamespaceExport */: + case 271 /* NamespaceExportDeclaration */: + case 275 /* NamespaceImport */: + case 215 /* NewExpression */: case 15 /* NoSubstitutionTemplateLiteral */: case 9 /* NumericLiteral */: - case 210 /* ObjectLiteralExpression */: - case 169 /* Parameter */: - case 211 /* PropertyAccessExpression */: - case 303 /* PropertyAssignment */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 178 /* SetAccessor */: - case 304 /* ShorthandPropertyAssignment */: - case 307 /* SourceFile */: - case 305 /* SpreadAssignment */: + case 211 /* ObjectLiteralExpression */: + case 170 /* Parameter */: + case 212 /* PropertyAccessExpression */: + case 304 /* PropertyAssignment */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 179 /* SetAccessor */: + case 305 /* ShorthandPropertyAssignment */: + case 308 /* SourceFile */: + case 306 /* SpreadAssignment */: case 11 /* StringLiteral */: - case 265 /* TypeAliasDeclaration */: - case 187 /* TypeLiteral */: - case 168 /* TypeParameter */: - case 260 /* VariableDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 188 /* TypeLiteral */: + case 169 /* TypeParameter */: + case 261 /* VariableDeclaration */: return true; default: return false; @@ -15984,53 +16005,53 @@ function canHaveSymbol(node) { } function canHaveLocals(node) { switch (node.kind) { - case 219 /* ArrowFunction */: - case 241 /* Block */: - case 179 /* CallSignature */: - case 269 /* CaseBlock */: - case 299 /* CatchClause */: - case 175 /* ClassStaticBlockDeclaration */: - case 194 /* ConditionalType */: - case 176 /* Constructor */: - case 185 /* ConstructorType */: - case 180 /* ConstructSignature */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 184 /* FunctionType */: - case 177 /* GetAccessor */: - case 181 /* IndexSignature */: - case 338 /* JSDocCallbackTag */: - case 340 /* JSDocEnumTag */: - case 317 /* JSDocFunctionType */: - case 323 /* JSDocSignature */: - case 346 /* JSDocTypedefTag */: - case 200 /* MappedType */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 267 /* ModuleDeclaration */: - case 178 /* SetAccessor */: - case 307 /* SourceFile */: - case 265 /* TypeAliasDeclaration */: + case 220 /* ArrowFunction */: + case 242 /* Block */: + case 180 /* CallSignature */: + case 270 /* CaseBlock */: + case 300 /* CatchClause */: + case 176 /* ClassStaticBlockDeclaration */: + case 195 /* ConditionalType */: + case 177 /* Constructor */: + case 186 /* ConstructorType */: + case 181 /* ConstructSignature */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 185 /* FunctionType */: + case 178 /* GetAccessor */: + case 182 /* IndexSignature */: + case 339 /* JSDocCallbackTag */: + case 341 /* JSDocEnumTag */: + case 318 /* JSDocFunctionType */: + case 324 /* JSDocSignature */: + case 347 /* JSDocTypedefTag */: + case 201 /* MappedType */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 268 /* ModuleDeclaration */: + case 179 /* SetAccessor */: + case 308 /* SourceFile */: + case 266 /* TypeAliasDeclaration */: return true; default: return false; } } function isDeclarationKind(kind) { - return kind === 219 /* ArrowFunction */ || kind === 208 /* BindingElement */ || kind === 263 /* ClassDeclaration */ || kind === 231 /* ClassExpression */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 176 /* Constructor */ || kind === 266 /* EnumDeclaration */ || kind === 306 /* EnumMember */ || kind === 281 /* ExportSpecifier */ || kind === 262 /* FunctionDeclaration */ || kind === 218 /* FunctionExpression */ || kind === 177 /* GetAccessor */ || kind === 273 /* ImportClause */ || kind === 271 /* ImportEqualsDeclaration */ || kind === 276 /* ImportSpecifier */ || kind === 264 /* InterfaceDeclaration */ || kind === 291 /* JsxAttribute */ || kind === 174 /* MethodDeclaration */ || kind === 173 /* MethodSignature */ || kind === 267 /* ModuleDeclaration */ || kind === 270 /* NamespaceExportDeclaration */ || kind === 274 /* NamespaceImport */ || kind === 280 /* NamespaceExport */ || kind === 169 /* Parameter */ || kind === 303 /* PropertyAssignment */ || kind === 172 /* PropertyDeclaration */ || kind === 171 /* PropertySignature */ || kind === 178 /* SetAccessor */ || kind === 304 /* ShorthandPropertyAssignment */ || kind === 265 /* TypeAliasDeclaration */ || kind === 168 /* TypeParameter */ || kind === 260 /* VariableDeclaration */ || kind === 346 /* JSDocTypedefTag */ || kind === 338 /* JSDocCallbackTag */ || kind === 348 /* JSDocPropertyTag */ || kind === 202 /* NamedTupleMember */; + return kind === 220 /* ArrowFunction */ || kind === 209 /* BindingElement */ || kind === 264 /* ClassDeclaration */ || kind === 232 /* ClassExpression */ || kind === 176 /* ClassStaticBlockDeclaration */ || kind === 177 /* Constructor */ || kind === 267 /* EnumDeclaration */ || kind === 307 /* EnumMember */ || kind === 282 /* ExportSpecifier */ || kind === 263 /* FunctionDeclaration */ || kind === 219 /* FunctionExpression */ || kind === 178 /* GetAccessor */ || kind === 274 /* ImportClause */ || kind === 272 /* ImportEqualsDeclaration */ || kind === 277 /* ImportSpecifier */ || kind === 265 /* InterfaceDeclaration */ || kind === 292 /* JsxAttribute */ || kind === 175 /* MethodDeclaration */ || kind === 174 /* MethodSignature */ || kind === 268 /* ModuleDeclaration */ || kind === 271 /* NamespaceExportDeclaration */ || kind === 275 /* NamespaceImport */ || kind === 281 /* NamespaceExport */ || kind === 170 /* Parameter */ || kind === 304 /* PropertyAssignment */ || kind === 173 /* PropertyDeclaration */ || kind === 172 /* PropertySignature */ || kind === 179 /* SetAccessor */ || kind === 305 /* ShorthandPropertyAssignment */ || kind === 266 /* TypeAliasDeclaration */ || kind === 169 /* TypeParameter */ || kind === 261 /* VariableDeclaration */ || kind === 347 /* JSDocTypedefTag */ || kind === 339 /* JSDocCallbackTag */ || kind === 349 /* JSDocPropertyTag */ || kind === 203 /* NamedTupleMember */; } function isDeclarationStatementKind(kind) { - return kind === 262 /* FunctionDeclaration */ || kind === 282 /* MissingDeclaration */ || kind === 263 /* ClassDeclaration */ || kind === 264 /* InterfaceDeclaration */ || kind === 265 /* TypeAliasDeclaration */ || kind === 266 /* EnumDeclaration */ || kind === 267 /* ModuleDeclaration */ || kind === 272 /* ImportDeclaration */ || kind === 271 /* ImportEqualsDeclaration */ || kind === 278 /* ExportDeclaration */ || kind === 277 /* ExportAssignment */ || kind === 270 /* NamespaceExportDeclaration */; + return kind === 263 /* FunctionDeclaration */ || kind === 283 /* MissingDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 265 /* InterfaceDeclaration */ || kind === 266 /* TypeAliasDeclaration */ || kind === 267 /* EnumDeclaration */ || kind === 268 /* ModuleDeclaration */ || kind === 273 /* ImportDeclaration */ || kind === 272 /* ImportEqualsDeclaration */ || kind === 279 /* ExportDeclaration */ || kind === 278 /* ExportAssignment */ || kind === 271 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 252 /* BreakStatement */ || kind === 251 /* ContinueStatement */ || kind === 259 /* DebuggerStatement */ || kind === 246 /* DoStatement */ || kind === 244 /* ExpressionStatement */ || kind === 242 /* EmptyStatement */ || kind === 249 /* ForInStatement */ || kind === 250 /* ForOfStatement */ || kind === 248 /* ForStatement */ || kind === 245 /* IfStatement */ || kind === 256 /* LabeledStatement */ || kind === 253 /* ReturnStatement */ || kind === 255 /* SwitchStatement */ || kind === 257 /* ThrowStatement */ || kind === 258 /* TryStatement */ || kind === 243 /* VariableStatement */ || kind === 247 /* WhileStatement */ || kind === 254 /* WithStatement */ || kind === 353 /* NotEmittedStatement */; + return kind === 253 /* BreakStatement */ || kind === 252 /* ContinueStatement */ || kind === 260 /* DebuggerStatement */ || kind === 247 /* DoStatement */ || kind === 245 /* ExpressionStatement */ || kind === 243 /* EmptyStatement */ || kind === 250 /* ForInStatement */ || kind === 251 /* ForOfStatement */ || kind === 249 /* ForStatement */ || kind === 246 /* IfStatement */ || kind === 257 /* LabeledStatement */ || kind === 254 /* ReturnStatement */ || kind === 256 /* SwitchStatement */ || kind === 258 /* ThrowStatement */ || kind === 259 /* TryStatement */ || kind === 244 /* VariableStatement */ || kind === 248 /* WhileStatement */ || kind === 255 /* WithStatement */ || kind === 354 /* NotEmittedStatement */; } function isDeclaration(node) { - if (node.kind === 168 /* TypeParameter */) { - return node.parent && node.parent.kind !== 345 /* JSDocTemplateTag */ || isInJSFile(node); + if (node.kind === 169 /* TypeParameter */) { + return node.parent && node.parent.kind !== 346 /* JSDocTemplateTag */ || isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -16045,9 +16066,9 @@ function isStatement(node) { return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || isBlockStatement(node); } function isBlockStatement(node) { - if (node.kind !== 241 /* Block */) return false; + if (node.kind !== 242 /* Block */) return false; if (node.parent !== void 0) { - if (node.parent.kind === 258 /* TryStatement */ || node.parent.kind === 299 /* CatchClause */) { + if (node.parent.kind === 259 /* TryStatement */ || node.parent.kind === 300 /* CatchClause */) { return false; } } @@ -16055,54 +16076,54 @@ function isBlockStatement(node) { } function isStatementOrBlock(node) { const kind = node.kind; - return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || kind === 241 /* Block */; + return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || kind === 242 /* Block */; } function isModuleReference(node) { const kind = node.kind; - return kind === 283 /* ExternalModuleReference */ || kind === 166 /* QualifiedName */ || kind === 80 /* Identifier */; + return kind === 284 /* ExternalModuleReference */ || kind === 167 /* QualifiedName */ || kind === 80 /* Identifier */; } function isJsxTagNameExpression(node) { const kind = node.kind; - return kind === 110 /* ThisKeyword */ || kind === 80 /* Identifier */ || kind === 211 /* PropertyAccessExpression */ || kind === 295 /* JsxNamespacedName */; + return kind === 110 /* ThisKeyword */ || kind === 80 /* Identifier */ || kind === 212 /* PropertyAccessExpression */ || kind === 296 /* JsxNamespacedName */; } function isJsxChild(node) { const kind = node.kind; - return kind === 284 /* JsxElement */ || kind === 294 /* JsxExpression */ || kind === 285 /* JsxSelfClosingElement */ || kind === 12 /* JsxText */ || kind === 288 /* JsxFragment */; + return kind === 285 /* JsxElement */ || kind === 295 /* JsxExpression */ || kind === 286 /* JsxSelfClosingElement */ || kind === 12 /* JsxText */ || kind === 289 /* JsxFragment */; } function isJsxAttributeLike(node) { const kind = node.kind; - return kind === 291 /* JsxAttribute */ || kind === 293 /* JsxSpreadAttribute */; + return kind === 292 /* JsxAttribute */ || kind === 294 /* JsxSpreadAttribute */; } function isStringLiteralOrJsxExpression(node) { const kind = node.kind; - return kind === 11 /* StringLiteral */ || kind === 294 /* JsxExpression */; + return kind === 11 /* StringLiteral */ || kind === 295 /* JsxExpression */; } function isJsxOpeningLikeElement(node) { const kind = node.kind; - return kind === 286 /* JsxOpeningElement */ || kind === 285 /* JsxSelfClosingElement */; + return kind === 287 /* JsxOpeningElement */ || kind === 286 /* JsxSelfClosingElement */; } function isJsxCallLike(node) { const kind = node.kind; - return kind === 286 /* JsxOpeningElement */ || kind === 285 /* JsxSelfClosingElement */ || kind === 289 /* JsxOpeningFragment */; + return kind === 287 /* JsxOpeningElement */ || kind === 286 /* JsxSelfClosingElement */ || kind === 290 /* JsxOpeningFragment */; } function isCaseOrDefaultClause(node) { const kind = node.kind; - return kind === 296 /* CaseClause */ || kind === 297 /* DefaultClause */; + return kind === 297 /* CaseClause */ || kind === 298 /* DefaultClause */; } function isJSDocNode(node) { - return node.kind >= 309 /* FirstJSDocNode */ && node.kind <= 351 /* LastJSDocNode */; + return node.kind >= 310 /* FirstJSDocNode */ && node.kind <= 352 /* LastJSDocNode */; } function isJSDocCommentContainingNode(node) { - return node.kind === 320 /* JSDoc */ || node.kind === 319 /* JSDocNamepathType */ || node.kind === 321 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); + return node.kind === 321 /* JSDoc */ || node.kind === 320 /* JSDocNamepathType */ || node.kind === 322 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); } function isJSDocTag(node) { - return node.kind >= 327 /* FirstJSDocTagNode */ && node.kind <= 351 /* LastJSDocTagNode */; + return node.kind >= 328 /* FirstJSDocTagNode */ && node.kind <= 352 /* LastJSDocTagNode */; } function isSetAccessor(node) { - return node.kind === 178 /* SetAccessor */; + return node.kind === 179 /* SetAccessor */; } function isGetAccessor(node) { - return node.kind === 177 /* GetAccessor */; + return node.kind === 178 /* GetAccessor */; } function hasJSDocNodes(node) { if (!canHaveJSDoc(node)) return false; @@ -16117,22 +16138,22 @@ function hasInitializer(node) { } function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 260 /* VariableDeclaration */: - case 169 /* Parameter */: - case 208 /* BindingElement */: - case 172 /* PropertyDeclaration */: - case 303 /* PropertyAssignment */: - case 306 /* EnumMember */: + case 261 /* VariableDeclaration */: + case 170 /* Parameter */: + case 209 /* BindingElement */: + case 173 /* PropertyDeclaration */: + case 304 /* PropertyAssignment */: + case 307 /* EnumMember */: return true; default: return false; } } function isObjectLiteralElement(node) { - return node.kind === 291 /* JsxAttribute */ || node.kind === 293 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); + return node.kind === 292 /* JsxAttribute */ || node.kind === 294 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); } function isTypeReferenceType(node) { - return node.kind === 183 /* TypeReference */ || node.kind === 233 /* ExpressionWithTypeArguments */; + return node.kind === 184 /* TypeReference */ || node.kind === 234 /* ExpressionWithTypeArguments */; } var MAX_SMI_X86 = 1073741823; function guessIndentation(lines) { @@ -16160,7 +16181,7 @@ function isStringLiteralLike(node) { return node.kind === 11 /* StringLiteral */ || node.kind === 15 /* NoSubstitutionTemplateLiteral */; } function isJSDocLinkLike(node) { - return node.kind === 324 /* JSDocLink */ || node.kind === 325 /* JSDocLinkCode */ || node.kind === 326 /* JSDocLinkPlain */; + return node.kind === 325 /* JSDocLink */ || node.kind === 326 /* JSDocLinkCode */ || node.kind === 327 /* JSDocLinkPlain */; } function hasRestParameter(s) { const last2 = lastOrUndefined(s.parameters); @@ -16168,7 +16189,7 @@ function hasRestParameter(s) { } function isRestParameter(node) { const type = isJSDocParameterTag(node) ? node.typeExpression && node.typeExpression.type : node.type; - return node.dotDotDotToken !== void 0 || !!type && type.kind === 318 /* JSDocVariadicType */; + return node.dotDotDotToken !== void 0 || !!type && type.kind === 319 /* JSDocVariadicType */; } function hasInternalAnnotation(range, sourceFile) { const comment = sourceFile.text.substring(range.pos, range.end); @@ -16177,7 +16198,7 @@ function hasInternalAnnotation(range, sourceFile) { function isInternalDeclaration(node, sourceFile) { sourceFile ?? (sourceFile = getSourceFileOfNode(node)); const parseTreeNode = getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) { + if (parseTreeNode && parseTreeNode.kind === 170 /* Parameter */) { const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0; const text = sourceFile.text; @@ -16215,6 +16236,7 @@ var resolvingEmptyArray = []; var externalHelpersModuleNameText = "tslib"; var defaultMaximumTruncationLength = 160; var noTruncationMaximumTruncationLength = 1e6; +var defaultHoverMaximumTruncationLength = 500; function getDeclarationOfKind(symbol, kind) { const declarations = symbol.declarations; if (declarations) { @@ -16450,7 +16472,7 @@ function aggregateChildData(node) { } } function getSourceFileOfNode(node) { - while (node && node.kind !== 307 /* SourceFile */) { + while (node && node.kind !== 308 /* SourceFile */) { node = node.parent; } return node; @@ -16463,11 +16485,11 @@ function isPlainJsFile(file, checkJs) { } function isStatementWithLocals(node) { switch (node.kind) { - case 241 /* Block */: - case 269 /* CaseBlock */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: + case 242 /* Block */: + case 270 /* CaseBlock */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: return true; } return false; @@ -16612,7 +16634,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) { if (includeJsDoc && hasJSDocNodes(node)) { return getTokenPosOfNode(node.jsDoc[0], sourceFile); } - if (node.kind === 352 /* SyntaxList */) { + if (node.kind === 353 /* SyntaxList */) { sourceFile ?? (sourceFile = getSourceFileOfNode(node)); const first2 = firstOrUndefined(getNodeChildren(node, sourceFile)); if (first2) { @@ -16752,6 +16774,9 @@ var getScriptTargetFeatures = /* @__PURE__ */ memoize( ], es2024: [ "waitAsync" + ], + esnext: [ + "pause" ] })), SharedArrayBuffer: new Map(Object.entries({ @@ -17286,7 +17311,7 @@ function isBlockOrCatchScoped(declaration) { } function isCatchClauseVariableDeclarationOrBindingElement(declaration) { const node = getRootDeclaration(declaration); - return node.kind === 260 /* VariableDeclaration */ && node.parent.kind === 299 /* CatchClause */; + return node.kind === 261 /* VariableDeclaration */ && node.parent.kind === 300 /* CatchClause */; } function isAmbientModule(node) { return isModuleDeclaration(node) && (node.name.kind === 11 /* StringLiteral */ || isGlobalScopeAugmentation(node)); @@ -17304,10 +17329,10 @@ function isShorthandAmbientModuleSymbol(moduleSymbol) { return isShorthandAmbientModule(moduleSymbol.valueDeclaration); } function isShorthandAmbientModule(node) { - return !!node && node.kind === 267 /* ModuleDeclaration */ && !node.body; + return !!node && node.kind === 268 /* ModuleDeclaration */ && !node.body; } function isBlockScopedContainerTopLevel(node) { - return node.kind === 307 /* SourceFile */ || node.kind === 267 /* ModuleDeclaration */ || isFunctionLikeOrClassStaticBlockDeclaration(node); + return node.kind === 308 /* SourceFile */ || node.kind === 268 /* ModuleDeclaration */ || isFunctionLikeOrClassStaticBlockDeclaration(node); } function isGlobalScopeAugmentation(module2) { return !!(module2.flags & 2048 /* GlobalAugmentation */); @@ -17317,9 +17342,9 @@ function isExternalModuleAugmentation(node) { } function isModuleAugmentationExternal(node) { switch (node.parent.kind) { - case 307 /* SourceFile */: + case 308 /* SourceFile */: return isExternalModule(node.parent); - case 268 /* ModuleBlock */: + case 269 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && isSourceFile(node.parent.parent.parent) && !isExternalModule(node.parent.parent.parent); } return false; @@ -17363,24 +17388,24 @@ function isAmbientPropertyDeclaration(node) { } function isBlockScope(node, parentNode) { switch (node.kind) { - case 307 /* SourceFile */: - case 269 /* CaseBlock */: - case 299 /* CatchClause */: - case 267 /* ModuleDeclaration */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 176 /* Constructor */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 172 /* PropertyDeclaration */: - case 175 /* ClassStaticBlockDeclaration */: + case 308 /* SourceFile */: + case 270 /* CaseBlock */: + case 300 /* CatchClause */: + case 268 /* ModuleDeclaration */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 177 /* Constructor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 173 /* PropertyDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: return true; - case 241 /* Block */: + case 242 /* Block */: return !isFunctionLikeOrClassStaticBlockDeclaration(parentNode); } return false; @@ -17388,9 +17413,9 @@ function isBlockScope(node, parentNode) { function isDeclarationWithTypeParameters(node) { Debug.type(node); switch (node.kind) { - case 338 /* JSDocCallbackTag */: - case 346 /* JSDocTypedefTag */: - case 323 /* JSDocSignature */: + case 339 /* JSDocCallbackTag */: + case 347 /* JSDocTypedefTag */: + case 324 /* JSDocSignature */: return true; default: assertType(node); @@ -17400,25 +17425,25 @@ function isDeclarationWithTypeParameters(node) { function isDeclarationWithTypeParameterChildren(node) { Debug.type(node); switch (node.kind) { - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 173 /* MethodSignature */: - case 181 /* IndexSignature */: - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 317 /* JSDocFunctionType */: - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 345 /* JSDocTemplateTag */: - case 262 /* FunctionDeclaration */: - case 174 /* MethodDeclaration */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 174 /* MethodSignature */: + case 182 /* IndexSignature */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 318 /* JSDocFunctionType */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 346 /* JSDocTemplateTag */: + case 263 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return true; default: assertType(node); @@ -17427,8 +17452,8 @@ function isDeclarationWithTypeParameterChildren(node) { } function isAnyImportSyntax(node) { switch (node.kind) { - case 272 /* ImportDeclaration */: - case 271 /* ImportEqualsDeclaration */: + case 273 /* ImportDeclaration */: + case 272 /* ImportEqualsDeclaration */: return true; default: return false; @@ -17442,15 +17467,15 @@ function isAnyImportOrRequireStatement(node) { } function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 272 /* ImportDeclaration */: - case 271 /* ImportEqualsDeclaration */: - case 243 /* VariableStatement */: - case 263 /* ClassDeclaration */: - case 262 /* FunctionDeclaration */: - case 267 /* ModuleDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: + case 273 /* ImportDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 244 /* VariableStatement */: + case 264 /* ClassDeclaration */: + case 263 /* FunctionDeclaration */: + case 268 /* ModuleDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: return true; default: return false; @@ -17482,7 +17507,7 @@ function getNameFromIndexInfo(info) { return info.declaration ? declarationNameToString(info.declaration.parameters[0].name) : void 0; } function isComputedNonLiteralName(name) { - return name.kind === 167 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); + return name.kind === 168 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); } function tryGetTextOfPropertyName(name) { var _a; @@ -17495,10 +17520,10 @@ function tryGetTextOfPropertyName(name) { case 10 /* BigIntLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: return escapeLeadingUnderscores(name.text); - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: if (isStringOrNumericLiteralLike(name.expression)) return escapeLeadingUnderscores(name.expression.text); return void 0; - case 295 /* JsxNamespacedName */: + case 296 /* JsxNamespacedName */: return getEscapedTextOfJsxNamespacedName(name); default: return Debug.assertNever(name); @@ -17514,17 +17539,17 @@ function entityNameToString(name) { case 81 /* PrivateIdentifier */: case 80 /* Identifier */: return getFullWidth(name) === 0 ? idText(name) : getTextOfNode(name); - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: if (isIdentifier(name.name) || isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } else { return Debug.assertNever(name.name); } - case 311 /* JSDocMemberName */: + case 312 /* JSDocMemberName */: return entityNameToString(name.left) + "#" + entityNameToString(name.right); - case 295 /* JsxNamespacedName */: + case 296 /* JsxNamespacedName */: return entityNameToString(name.namespace) + ":" + entityNameToString(name.name); default: return Debug.assertNever(name); @@ -17635,7 +17660,7 @@ function scanTokenAtPosition(sourceFile, pos) { } function getErrorSpanForArrowFunction(sourceFile, node) { const pos = skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 241 /* Block */) { + if (node.body && node.body.kind === 242 /* Block */) { const { line: startLine } = getLineAndCharacterOfPosition(sourceFile, node.body.pos); const { line: endLine } = getLineAndCharacterOfPosition(sourceFile, node.body.end); if (startLine < endLine) { @@ -17647,7 +17672,7 @@ function getErrorSpanForArrowFunction(sourceFile, node) { function getErrorSpanForNode(sourceFile, node) { let errorNode = node; switch (node.kind) { - case 307 /* SourceFile */: { + case 308 /* SourceFile */: { const pos2 = skipTrivia( sourceFile.text, 0, @@ -17661,47 +17686,47 @@ function getErrorSpanForNode(sourceFile, node) { } // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 260 /* VariableDeclaration */: - case 208 /* BindingElement */: - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 267 /* ModuleDeclaration */: - case 266 /* EnumDeclaration */: - case 306 /* EnumMember */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 265 /* TypeAliasDeclaration */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 274 /* NamespaceImport */: + case 261 /* VariableDeclaration */: + case 209 /* BindingElement */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 268 /* ModuleDeclaration */: + case 267 /* EnumDeclaration */: + case 307 /* EnumMember */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 266 /* TypeAliasDeclaration */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 275 /* NamespaceImport */: errorNode = node.name; break; - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); - case 296 /* CaseClause */: - case 297 /* DefaultClause */: { + case 297 /* CaseClause */: + case 298 /* DefaultClause */: { const start = skipTrivia(sourceFile.text, node.pos); const end = node.statements.length > 0 ? node.statements[0].pos : node.end; return createTextSpanFromBounds(start, end); } - case 253 /* ReturnStatement */: - case 229 /* YieldExpression */: { + case 254 /* ReturnStatement */: + case 230 /* YieldExpression */: { const pos2 = skipTrivia(sourceFile.text, node.pos); return getSpanOfTokenAtPosition(sourceFile, pos2); } - case 238 /* SatisfiesExpression */: { + case 239 /* SatisfiesExpression */: { const pos2 = skipTrivia(sourceFile.text, node.expression.end); return getSpanOfTokenAtPosition(sourceFile, pos2); } - case 350 /* JSDocSatisfiesTag */: { + case 351 /* JSDocSatisfiesTag */: { const pos2 = skipTrivia(sourceFile.text, node.tagName.pos); return getSpanOfTokenAtPosition(sourceFile, pos2); } - case 176 /* Constructor */: { + case 177 /* Constructor */: { const constructorDeclaration = node; const start = skipTrivia(sourceFile.text, constructorDeclaration.pos); const scanner2 = createScanner( @@ -17738,7 +17763,7 @@ function getErrorSpanForNode(sourceFile, node) { return createTextSpanFromBounds(pos, errorNode.end); } function isGlobalSourceFile(node) { - return node.kind === 307 /* SourceFile */ && !isExternalOrCommonJsModule(node); + return node.kind === 308 /* SourceFile */ && !isExternalOrCommonJsModule(node); } function isExternalOrCommonJsModule(file) { return (file.externalModuleIndicator || file.commonJsModuleIndicator) !== void 0; @@ -17769,10 +17794,12 @@ function isLet(node) { return (getCombinedNodeFlags(node) & 7 /* BlockScoped */) === 1 /* Let */; } function isSuperCall(n) { - return n.kind === 213 /* CallExpression */ && n.expression.kind === 108 /* SuperKeyword */; + return n.kind === 214 /* CallExpression */ && n.expression.kind === 108 /* SuperKeyword */; } function isImportCall(n) { - return n.kind === 213 /* CallExpression */ && n.expression.kind === 102 /* ImportKeyword */; + if (n.kind !== 214 /* CallExpression */) return false; + const e = n.expression; + return e.kind === 102 /* ImportKeyword */ || isMetaProperty(e) && e.keywordToken === 102 /* ImportKeyword */ && e.name.escapedText === "defer"; } function isImportMeta(n) { return isMetaProperty(n) && n.keywordToken === 102 /* ImportKeyword */ && n.name.escapedText === "meta"; @@ -17781,7 +17808,7 @@ function isLiteralImportTypeNode(n) { return isImportTypeNode(n) && isLiteralTypeNode(n.argument) && isStringLiteral(n.argument.literal); } function isPrologueDirective(node) { - return node.kind === 244 /* ExpressionStatement */ && node.expression.kind === 11 /* StringLiteral */; + return node.kind === 245 /* ExpressionStatement */ && node.expression.kind === 11 /* StringLiteral */; } function isCustomPrologue(node) { return !!(getEmitFlags(node) & 2097152 /* CustomPrologue */); @@ -17799,7 +17826,7 @@ function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { return node.kind !== 12 /* JsxText */ ? getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : void 0; } function getJSDocCommentRanges(node, text) { - const commentRanges = node.kind === 169 /* Parameter */ || node.kind === 168 /* TypeParameter */ || node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */ || node.kind === 217 /* ParenthesizedExpression */ || node.kind === 260 /* VariableDeclaration */ || node.kind === 281 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos); + const commentRanges = node.kind === 170 /* Parameter */ || node.kind === 169 /* TypeParameter */ || node.kind === 219 /* FunctionExpression */ || node.kind === 220 /* ArrowFunction */ || node.kind === 218 /* ParenthesizedExpression */ || node.kind === 261 /* VariableDeclaration */ || node.kind === 282 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos); return filter(commentRanges, (comment) => comment.end <= node.end && // Due to parse errors sometime empty parameter may get comments assigned to it that end up not in parameter range text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 3) !== 47 /* slash */); } @@ -17810,7 +17837,7 @@ var fullTripleSlashAMDReferencePathRegEx = /^\/\/\/\s*/; var defaultLibReferenceRegEx = /^\/\/\/\s*/; function isPartOfTypeNode(node) { - if (182 /* FirstTypeNode */ <= node.kind && node.kind <= 205 /* LastTypeNode */) { + if (183 /* FirstTypeNode */ <= node.kind && node.kind <= 206 /* LastTypeNode */) { return true; } switch (node.kind) { @@ -17827,64 +17854,64 @@ function isPartOfTypeNode(node) { case 146 /* NeverKeyword */: return true; case 116 /* VoidKeyword */: - return node.parent.kind !== 222 /* VoidExpression */; - case 233 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 223 /* VoidExpression */; + case 234 /* ExpressionWithTypeArguments */: return isPartOfTypeExpressionWithTypeArguments(node); - case 168 /* TypeParameter */: - return node.parent.kind === 200 /* MappedType */ || node.parent.kind === 195 /* InferType */; + case 169 /* TypeParameter */: + return node.parent.kind === 201 /* MappedType */ || node.parent.kind === 196 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 80 /* Identifier */: - if (node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 167 /* QualifiedName */ && node.parent.right === node) { node = node.parent; - } else if (node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node) { + } else if (node.parent.kind === 212 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } - Debug.assert(node.kind === 80 /* Identifier */ || node.kind === 166 /* QualifiedName */ || node.kind === 211 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + Debug.assert(node.kind === 80 /* Identifier */ || node.kind === 167 /* QualifiedName */ || node.kind === 212 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 166 /* QualifiedName */: - case 211 /* PropertyAccessExpression */: + case 167 /* QualifiedName */: + case 212 /* PropertyAccessExpression */: case 110 /* ThisKeyword */: { const { parent: parent2 } = node; - if (parent2.kind === 186 /* TypeQuery */) { + if (parent2.kind === 187 /* TypeQuery */) { return false; } - if (parent2.kind === 205 /* ImportType */) { + if (parent2.kind === 206 /* ImportType */) { return !parent2.isTypeOf; } - if (182 /* FirstTypeNode */ <= parent2.kind && parent2.kind <= 205 /* LastTypeNode */) { + if (183 /* FirstTypeNode */ <= parent2.kind && parent2.kind <= 206 /* LastTypeNode */) { return true; } switch (parent2.kind) { - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return isPartOfTypeExpressionWithTypeArguments(parent2); - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: return node === parent2.constraint; - case 345 /* JSDocTemplateTag */: + case 346 /* JSDocTemplateTag */: return node === parent2.constraint; - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 169 /* Parameter */: - case 260 /* VariableDeclaration */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 170 /* Parameter */: + case 261 /* VariableDeclaration */: return node === parent2.type; - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 176 /* Constructor */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 177 /* Constructor */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return node === parent2.type; - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 181 /* IndexSignature */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 182 /* IndexSignature */: return node === parent2.type; - case 216 /* TypeAssertionExpression */: + case 217 /* TypeAssertionExpression */: return node === parent2.type; - case 213 /* CallExpression */: - case 214 /* NewExpression */: - case 215 /* TaggedTemplateExpression */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: + case 216 /* TaggedTemplateExpression */: return contains(parent2.typeArguments, node); } } @@ -17898,23 +17925,23 @@ function forEachReturnStatement(body, visitor) { return traverse(body); function traverse(node) { switch (node.kind) { - case 253 /* ReturnStatement */: + case 254 /* ReturnStatement */: return visitor(node); - case 269 /* CaseBlock */: - case 241 /* Block */: - case 245 /* IfStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 254 /* WithStatement */: - case 255 /* SwitchStatement */: - case 296 /* CaseClause */: - case 297 /* DefaultClause */: - case 256 /* LabeledStatement */: - case 258 /* TryStatement */: - case 299 /* CatchClause */: + case 270 /* CaseBlock */: + case 242 /* Block */: + case 246 /* IfStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 255 /* WithStatement */: + case 256 /* SwitchStatement */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: + case 257 /* LabeledStatement */: + case 259 /* TryStatement */: + case 300 /* CatchClause */: return forEachChild(node, traverse); } } @@ -17923,21 +17950,21 @@ function forEachYieldExpression(body, visitor) { return traverse(body); function traverse(node) { switch (node.kind) { - case 229 /* YieldExpression */: + case 230 /* YieldExpression */: visitor(node); const operand = node.expression; if (operand) { traverse(operand); } return; - case 266 /* EnumDeclaration */: - case 264 /* InterfaceDeclaration */: - case 267 /* ModuleDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 267 /* EnumDeclaration */: + case 265 /* InterfaceDeclaration */: + case 268 /* ModuleDeclaration */: + case 266 /* TypeAliasDeclaration */: return; default: if (isFunctionLike(node)) { - if (node.name && node.name.kind === 167 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 168 /* ComputedPropertyName */) { traverse(node.name.expression); return; } @@ -17948,9 +17975,9 @@ function forEachYieldExpression(body, visitor) { } } function getRestParameterElementType(node) { - if (node && node.kind === 188 /* ArrayType */) { + if (node && node.kind === 189 /* ArrayType */) { return node.elementType; - } else if (node && node.kind === 183 /* TypeReference */) { + } else if (node && node.kind === 184 /* TypeReference */) { return singleOrUndefined(node.typeArguments); } else { return void 0; @@ -17958,33 +17985,33 @@ function getRestParameterElementType(node) { } function getMembersOfDeclaration(node) { switch (node.kind) { - case 264 /* InterfaceDeclaration */: - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 187 /* TypeLiteral */: + case 265 /* InterfaceDeclaration */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 188 /* TypeLiteral */: return node.members; - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return node.properties; } } function isVariableLike(node) { if (node) { switch (node.kind) { - case 208 /* BindingElement */: - case 306 /* EnumMember */: - case 169 /* Parameter */: - case 303 /* PropertyAssignment */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 304 /* ShorthandPropertyAssignment */: - case 260 /* VariableDeclaration */: + case 209 /* BindingElement */: + case 307 /* EnumMember */: + case 170 /* Parameter */: + case 304 /* PropertyAssignment */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 305 /* ShorthandPropertyAssignment */: + case 261 /* VariableDeclaration */: return true; } } return false; } function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 261 /* VariableDeclarationList */ && node.parent.parent.kind === 243 /* VariableStatement */; + return node.parent.kind === 262 /* VariableDeclarationList */ && node.parent.parent.kind === 244 /* VariableStatement */; } function isCommonJsExportedExpression(node) { if (!isInJSFile(node)) return false; @@ -17999,13 +18026,13 @@ function isValidESSymbolDeclaration(node) { } function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: return true; } return false; @@ -18015,20 +18042,20 @@ function unwrapInnermostStatementOfLabel(node, beforeUnwrapLabelCallback) { if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 256 /* LabeledStatement */) { + if (node.statement.kind !== 257 /* LabeledStatement */) { return node.statement; } node = node.statement; } } function isFunctionBlock(node) { - return node && node.kind === 241 /* Block */ && isFunctionLike(node.parent); + return node && node.kind === 242 /* Block */ && isFunctionLike(node.parent); } function isObjectLiteralMethod(node) { - return node && node.kind === 174 /* MethodDeclaration */ && node.parent.kind === 210 /* ObjectLiteralExpression */; + return node && node.kind === 175 /* MethodDeclaration */ && node.parent.kind === 211 /* ObjectLiteralExpression */; } function isObjectLiteralOrClassExpressionMethodOrAccessor(node) { - return (node.kind === 174 /* MethodDeclaration */ || node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */) && (node.parent.kind === 210 /* ObjectLiteralExpression */ || node.parent.kind === 231 /* ClassExpression */); + return (node.kind === 175 /* MethodDeclaration */ || node.kind === 178 /* GetAccessor */ || node.kind === 179 /* SetAccessor */) && (node.parent.kind === 211 /* ObjectLiteralExpression */ || node.parent.kind === 232 /* ClassExpression */); } function isIdentifierTypePredicate(predicate) { return predicate && predicate.kind === 1 /* Identifier */; @@ -18080,47 +18107,47 @@ function getContainingClassExcludingClassDecorators(node) { return decorator && isClassLike(decorator.parent) ? getContainingClass(decorator.parent) : getContainingClass(decorator ?? node); } function getThisContainer(node, includeArrowFunctions, includeClassComputedPropertyName) { - Debug.assert(node.kind !== 307 /* SourceFile */); + Debug.assert(node.kind !== 308 /* SourceFile */); while (true) { node = node.parent; if (!node) { return Debug.fail(); } switch (node.kind) { - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: if (includeClassComputedPropertyName && isClassLike(node.parent.parent)) { return node; } node = node.parent.parent; break; - case 170 /* Decorator */: - if (node.parent.kind === 169 /* Parameter */ && isClassElement(node.parent.parent)) { + case 171 /* Decorator */: + if (node.parent.kind === 170 /* Parameter */ && isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (isClassElement(node.parent)) { node = node.parent; } break; - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 267 /* ModuleDeclaration */: - case 175 /* ClassStaticBlockDeclaration */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 181 /* IndexSignature */: - case 266 /* EnumDeclaration */: - case 307 /* SourceFile */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 268 /* ModuleDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 182 /* IndexSignature */: + case 267 /* EnumDeclaration */: + case 308 /* SourceFile */: return node; } } @@ -18129,17 +18156,17 @@ function isThisContainerOrFunctionBlock(node) { switch (node.kind) { // Arrow functions use the same scope, but may do so in a "delayed" manner // For example, `const getThis = () => this` may be before a super() call in a derived constructor - case 219 /* ArrowFunction */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 172 /* PropertyDeclaration */: + case 220 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 173 /* PropertyDeclaration */: return true; - case 241 /* Block */: + case 242 /* Block */: switch (node.parent.kind) { - case 176 /* Constructor */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 177 /* Constructor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return true; default: return false; @@ -18171,9 +18198,9 @@ function getNewTargetContainer(node) { ); if (container) { switch (container.kind) { - case 176 /* Constructor */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 177 /* Constructor */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: return container; } } @@ -18186,27 +18213,27 @@ function getSuperContainer(node, stopOnFunctions) { return void 0; } switch (node.kind) { - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: node = node.parent; break; - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 175 /* ClassStaticBlockDeclaration */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 176 /* ClassStaticBlockDeclaration */: return node; - case 170 /* Decorator */: - if (node.parent.kind === 169 /* Parameter */ && isClassElement(node.parent.parent)) { + case 171 /* Decorator */: + if (node.parent.kind === 170 /* Parameter */ && isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (isClassElement(node.parent)) { node = node.parent; @@ -18216,25 +18243,25 @@ function getSuperContainer(node, stopOnFunctions) { } } function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 218 /* FunctionExpression */ || func.kind === 219 /* ArrowFunction */) { + if (func.kind === 219 /* FunctionExpression */ || func.kind === 220 /* ArrowFunction */) { let prev = func; let parent2 = func.parent; - while (parent2.kind === 217 /* ParenthesizedExpression */) { + while (parent2.kind === 218 /* ParenthesizedExpression */) { prev = parent2; parent2 = parent2.parent; } - if (parent2.kind === 213 /* CallExpression */ && parent2.expression === prev) { + if (parent2.kind === 214 /* CallExpression */ && parent2.expression === prev) { return parent2; } } } function isSuperProperty(node) { const kind = node.kind; - return (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */) && node.expression.kind === 108 /* SuperKeyword */; + return (kind === 212 /* PropertyAccessExpression */ || kind === 213 /* ElementAccessExpression */) && node.expression.kind === 108 /* SuperKeyword */; } function isThisProperty(node) { const kind = node.kind; - return (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */) && node.expression.kind === 110 /* ThisKeyword */; + return (kind === 212 /* PropertyAccessExpression */ || kind === 213 /* ElementAccessExpression */) && node.expression.kind === 110 /* ThisKeyword */; } function isThisInitializedDeclaration(node) { var _a; @@ -18245,27 +18272,27 @@ function isThisInitializedObjectBindingExpression(node) { } function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 183 /* TypeReference */: + case 184 /* TypeReference */: return node.typeName; - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : void 0; // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s. case 80 /* Identifier */: - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: return node; } return void 0; } function getInvokedExpression(node) { switch (node.kind) { - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return node.tag; - case 286 /* JsxOpeningElement */: - case 285 /* JsxSelfClosingElement */: + case 287 /* JsxOpeningElement */: + case 286 /* JsxSelfClosingElement */: return node.tagName; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return node.right; - case 289 /* JsxOpeningFragment */: + case 290 /* JsxOpeningFragment */: return node; default: return node.expression; @@ -18276,19 +18303,19 @@ function nodeCanBeDecorated(useLegacyDecorators, node, parent2, grandparent) { return false; } switch (node.kind) { - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return true; - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return !useLegacyDecorators; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return parent2 !== void 0 && (useLegacyDecorators ? isClassDeclaration(parent2) : isClassLike(parent2) && !hasAbstractModifier(node) && !hasAmbientModifier(node)); - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 174 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 175 /* MethodDeclaration */: return node.body !== void 0 && parent2 !== void 0 && (useLegacyDecorators ? isClassDeclaration(parent2) : isClassLike(parent2)); - case 169 /* Parameter */: + case 170 /* Parameter */: if (!useLegacyDecorators) return false; - return parent2 !== void 0 && parent2.body !== void 0 && (parent2.kind === 176 /* Constructor */ || parent2.kind === 174 /* MethodDeclaration */ || parent2.kind === 178 /* SetAccessor */) && getThisParameter(parent2) !== node && grandparent !== void 0 && grandparent.kind === 263 /* ClassDeclaration */; + return parent2 !== void 0 && parent2.body !== void 0 && (parent2.kind === 177 /* Constructor */ || parent2.kind === 175 /* MethodDeclaration */ || parent2.kind === 179 /* SetAccessor */) && getThisParameter(parent2) !== node && grandparent !== void 0 && grandparent.kind === 264 /* ClassDeclaration */; } return false; } @@ -18300,13 +18327,13 @@ function nodeOrChildIsDecorated(useLegacyDecorators, node, parent2, grandparent) } function childIsDecorated(useLegacyDecorators, node, parent2) { switch (node.kind) { - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return some(node.members, (m) => nodeOrChildIsDecorated(useLegacyDecorators, m, node, parent2)); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return !useLegacyDecorators && some(node.members, (m) => nodeOrChildIsDecorated(useLegacyDecorators, m, node, parent2)); - case 174 /* MethodDeclaration */: - case 178 /* SetAccessor */: - case 176 /* Constructor */: + case 175 /* MethodDeclaration */: + case 179 /* SetAccessor */: + case 177 /* Constructor */: return some(node.parameters, (p) => nodeIsDecorated(useLegacyDecorators, p, node, parent2)); default: return false; @@ -18354,7 +18381,7 @@ function isEmptyStringLiteral(node) { } function isJSXTagName(node) { const { parent: parent2 } = node; - if (parent2.kind === 286 /* JsxOpeningElement */ || parent2.kind === 285 /* JsxSelfClosingElement */ || parent2.kind === 287 /* JsxClosingElement */) { + if (parent2.kind === 287 /* JsxOpeningElement */ || parent2.kind === 286 /* JsxSelfClosingElement */ || parent2.kind === 288 /* JsxClosingElement */) { return parent2.tagName === node; } return false; @@ -18366,54 +18393,55 @@ function isExpressionNode(node) { case 112 /* TrueKeyword */: case 97 /* FalseKeyword */: case 14 /* RegularExpressionLiteral */: - case 209 /* ArrayLiteralExpression */: - case 210 /* ObjectLiteralExpression */: - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: - case 213 /* CallExpression */: - case 214 /* NewExpression */: - case 215 /* TaggedTemplateExpression */: - case 234 /* AsExpression */: - case 216 /* TypeAssertionExpression */: - case 238 /* SatisfiesExpression */: - case 235 /* NonNullExpression */: - case 217 /* ParenthesizedExpression */: - case 218 /* FunctionExpression */: - case 231 /* ClassExpression */: - case 219 /* ArrowFunction */: - case 222 /* VoidExpression */: - case 220 /* DeleteExpression */: - case 221 /* TypeOfExpression */: - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: - case 226 /* BinaryExpression */: - case 227 /* ConditionalExpression */: - case 230 /* SpreadElement */: - case 228 /* TemplateExpression */: - case 232 /* OmittedExpression */: - case 284 /* JsxElement */: - case 285 /* JsxSelfClosingElement */: - case 288 /* JsxFragment */: - case 229 /* YieldExpression */: - case 223 /* AwaitExpression */: - case 236 /* MetaProperty */: + case 210 /* ArrayLiteralExpression */: + case 211 /* ObjectLiteralExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: + case 216 /* TaggedTemplateExpression */: + case 235 /* AsExpression */: + case 217 /* TypeAssertionExpression */: + case 239 /* SatisfiesExpression */: + case 236 /* NonNullExpression */: + case 218 /* ParenthesizedExpression */: + case 219 /* FunctionExpression */: + case 232 /* ClassExpression */: + case 220 /* ArrowFunction */: + case 223 /* VoidExpression */: + case 221 /* DeleteExpression */: + case 222 /* TypeOfExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: + case 227 /* BinaryExpression */: + case 228 /* ConditionalExpression */: + case 231 /* SpreadElement */: + case 229 /* TemplateExpression */: + case 233 /* OmittedExpression */: + case 285 /* JsxElement */: + case 286 /* JsxSelfClosingElement */: + case 289 /* JsxFragment */: + case 230 /* YieldExpression */: + case 224 /* AwaitExpression */: return true; - case 233 /* ExpressionWithTypeArguments */: + case 237 /* MetaProperty */: + return !isImportCall(node.parent) || node.parent.expression !== node; + case 234 /* ExpressionWithTypeArguments */: return !isHeritageClause(node.parent) && !isJSDocAugmentsTag(node.parent); - case 166 /* QualifiedName */: - while (node.parent.kind === 166 /* QualifiedName */) { + case 167 /* QualifiedName */: + while (node.parent.kind === 167 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node); - case 311 /* JSDocMemberName */: + return node.parent.kind === 187 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node); + case 312 /* JSDocMemberName */: while (isJSDocMemberName(node.parent)) { node = node.parent; } - return node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node); + return node.parent.kind === 187 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node); case 81 /* PrivateIdentifier */: return isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 103 /* InKeyword */; case 80 /* Identifier */: - if (node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node)) { + if (node.parent.kind === 187 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node)) { return true; } // falls through @@ -18430,64 +18458,64 @@ function isExpressionNode(node) { function isInExpressionContext(node) { const { parent: parent2 } = node; switch (parent2.kind) { - case 260 /* VariableDeclaration */: - case 169 /* Parameter */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 306 /* EnumMember */: - case 303 /* PropertyAssignment */: - case 208 /* BindingElement */: + case 261 /* VariableDeclaration */: + case 170 /* Parameter */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 307 /* EnumMember */: + case 304 /* PropertyAssignment */: + case 209 /* BindingElement */: return parent2.initializer === node; - case 244 /* ExpressionStatement */: - case 245 /* IfStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: - case 253 /* ReturnStatement */: - case 254 /* WithStatement */: - case 255 /* SwitchStatement */: - case 296 /* CaseClause */: - case 257 /* ThrowStatement */: + case 245 /* ExpressionStatement */: + case 246 /* IfStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: + case 254 /* ReturnStatement */: + case 255 /* WithStatement */: + case 256 /* SwitchStatement */: + case 297 /* CaseClause */: + case 258 /* ThrowStatement */: return parent2.expression === node; - case 248 /* ForStatement */: + case 249 /* ForStatement */: const forStatement = parent2; - return forStatement.initializer === node && forStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node; - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: + return forStatement.initializer === node && forStatement.initializer.kind !== 262 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node; + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: const forInOrOfStatement = parent2; - return forInOrOfStatement.initializer === node && forInOrOfStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInOrOfStatement.expression === node; - case 216 /* TypeAssertionExpression */: - case 234 /* AsExpression */: + return forInOrOfStatement.initializer === node && forInOrOfStatement.initializer.kind !== 262 /* VariableDeclarationList */ || forInOrOfStatement.expression === node; + case 217 /* TypeAssertionExpression */: + case 235 /* AsExpression */: return node === parent2.expression; - case 239 /* TemplateSpan */: + case 240 /* TemplateSpan */: return node === parent2.expression; - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: return node === parent2.expression; - case 170 /* Decorator */: - case 294 /* JsxExpression */: - case 293 /* JsxSpreadAttribute */: - case 305 /* SpreadAssignment */: + case 171 /* Decorator */: + case 295 /* JsxExpression */: + case 294 /* JsxSpreadAttribute */: + case 306 /* SpreadAssignment */: return true; - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return parent2.expression === node && !isPartOfTypeNode(parent2); - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return parent2.objectAssignmentInitializer === node; - case 238 /* SatisfiesExpression */: + case 239 /* SatisfiesExpression */: return node === parent2.expression; default: return isExpressionNode(parent2); } } function isPartOfTypeQuery(node) { - while (node.kind === 166 /* QualifiedName */ || node.kind === 80 /* Identifier */) { + while (node.kind === 167 /* QualifiedName */ || node.kind === 80 /* Identifier */) { node = node.parent; } - return node.kind === 186 /* TypeQuery */; + return node.kind === 187 /* TypeQuery */; } function isNamespaceReexportDeclaration(node) { return isNamespaceExport(node) && !!node.parent.moduleSpecifier; } function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 271 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 283 /* ExternalModuleReference */; + return node.kind === 272 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 284 /* ExternalModuleReference */; } function getExternalModuleImportEqualsDeclarationExpression(node) { Debug.assert(isExternalModuleImportEqualsDeclaration(node)); @@ -18497,10 +18525,10 @@ function getExternalModuleRequireArgument(node) { return isVariableDeclarationInitializedToBareOrAccessedRequire(node) && getLeftmostAccessExpression(node.initializer).arguments[0]; } function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 271 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 283 /* ExternalModuleReference */; + return node.kind === 272 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 284 /* ExternalModuleReference */; } function isFullSourceFile(sourceFile) { - return (sourceFile == null ? void 0 : sourceFile.kind) === 307 /* SourceFile */; + return (sourceFile == null ? void 0 : sourceFile.kind) === 308 /* SourceFile */; } function isSourceFileJS(file) { return isInJSFile(file); @@ -18521,7 +18549,7 @@ function isJSDocIndexSignature(node) { return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && (node.typeArguments[0].kind === 154 /* StringKeyword */ || node.typeArguments[0].kind === 150 /* NumberKeyword */); } function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 213 /* CallExpression */) { + if (callExpression.kind !== 214 /* CallExpression */) { return false; } const { expression, arguments: args } = callExpression; @@ -18598,9 +18626,9 @@ function getAssignedExpandoInitializer(node) { function getExpandoInitializer(initializer, isPrototypeAssignment) { if (isCallExpression(initializer)) { const e = skipParentheses(initializer.expression); - return e.kind === 218 /* FunctionExpression */ || e.kind === 219 /* ArrowFunction */ ? initializer : void 0; + return e.kind === 219 /* FunctionExpression */ || e.kind === 220 /* ArrowFunction */ ? initializer : void 0; } - if (initializer.kind === 218 /* FunctionExpression */ || initializer.kind === 231 /* ClassExpression */ || initializer.kind === 219 /* ArrowFunction */) { + if (initializer.kind === 219 /* FunctionExpression */ || initializer.kind === 232 /* ClassExpression */ || initializer.kind === 220 /* ArrowFunction */) { return initializer; } if (isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -18791,7 +18819,7 @@ function isPrototypePropertyAssignment(node) { return isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 3 /* PrototypeProperty */; } function isSpecialPropertyDeclaration(expr) { - return isInJSFile(expr) && expr.parent && expr.parent.kind === 244 /* ExpressionStatement */ && (!isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!getJSDocTypeTag(expr.parent); + return isInJSFile(expr) && expr.parent && expr.parent.kind === 245 /* ExpressionStatement */ && (!isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!getJSDocTypeTag(expr.parent); } function setValueDeclaration(symbol, node) { const { valueDeclaration } = symbol; @@ -18804,21 +18832,21 @@ function isFunctionSymbol(symbol) { return false; } const decl = symbol.valueDeclaration; - return decl.kind === 262 /* FunctionDeclaration */ || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer); + return decl.kind === 263 /* FunctionDeclaration */ || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer); } function canHaveModuleSpecifier(node) { switch (node == null ? void 0 : node.kind) { - case 260 /* VariableDeclaration */: - case 208 /* BindingElement */: - case 272 /* ImportDeclaration */: - case 278 /* ExportDeclaration */: - case 271 /* ImportEqualsDeclaration */: - case 273 /* ImportClause */: - case 280 /* NamespaceExport */: - case 274 /* NamespaceImport */: - case 281 /* ExportSpecifier */: - case 276 /* ImportSpecifier */: - case 205 /* ImportType */: + case 261 /* VariableDeclaration */: + case 209 /* BindingElement */: + case 273 /* ImportDeclaration */: + case 279 /* ExportDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 274 /* ImportClause */: + case 281 /* NamespaceExport */: + case 275 /* NamespaceImport */: + case 282 /* ExportSpecifier */: + case 277 /* ImportSpecifier */: + case 206 /* ImportType */: return true; } return false; @@ -18826,28 +18854,28 @@ function canHaveModuleSpecifier(node) { function tryGetModuleSpecifierFromDeclaration(node) { var _a, _b; switch (node.kind) { - case 260 /* VariableDeclaration */: - case 208 /* BindingElement */: + case 261 /* VariableDeclaration */: + case 209 /* BindingElement */: return (_a = findAncestor(node.initializer, (node2) => isRequireCall( node2, /*requireStringLiteralLikeArgument*/ true ))) == null ? void 0 : _a.arguments[0]; - case 272 /* ImportDeclaration */: - case 278 /* ExportDeclaration */: - case 351 /* JSDocImportTag */: + case 273 /* ImportDeclaration */: + case 279 /* ExportDeclaration */: + case 352 /* JSDocImportTag */: return tryCast(node.moduleSpecifier, isStringLiteralLike); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike); - case 273 /* ImportClause */: - case 280 /* NamespaceExport */: + case 274 /* ImportClause */: + case 281 /* NamespaceExport */: return tryCast(node.parent.moduleSpecifier, isStringLiteralLike); - case 274 /* NamespaceImport */: - case 281 /* ExportSpecifier */: + case 275 /* NamespaceImport */: + case 282 /* ExportSpecifier */: return tryCast(node.parent.parent.moduleSpecifier, isStringLiteralLike); - case 276 /* ImportSpecifier */: + case 277 /* ImportSpecifier */: return tryCast(node.parent.parent.parent.moduleSpecifier, isStringLiteralLike); - case 205 /* ImportType */: + case 206 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : void 0; default: Debug.assertNever(node); @@ -18858,19 +18886,19 @@ function importFromModuleSpecifier(node) { } function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 272 /* ImportDeclaration */: - case 278 /* ExportDeclaration */: - case 351 /* JSDocImportTag */: + case 273 /* ImportDeclaration */: + case 279 /* ExportDeclaration */: + case 352 /* JSDocImportTag */: return node.parent; - case 283 /* ExternalModuleReference */: + case 284 /* ExternalModuleReference */: return node.parent.parent; - case 213 /* CallExpression */: + case 214 /* CallExpression */: return isImportCall(node.parent) || isRequireCall( node.parent, /*requireStringLiteralLikeArgument*/ false ) ? node.parent : void 0; - case 201 /* LiteralType */: + case 202 /* LiteralType */: if (!isStringLiteral(node)) { break; } @@ -18884,17 +18912,17 @@ function shouldRewriteModuleSpecifier(specifier, compilerOptions) { } function getExternalModuleName(node) { switch (node.kind) { - case 272 /* ImportDeclaration */: - case 278 /* ExportDeclaration */: - case 351 /* JSDocImportTag */: + case 273 /* ImportDeclaration */: + case 279 /* ExportDeclaration */: + case 352 /* JSDocImportTag */: return node.moduleSpecifier; - case 271 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 283 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0; - case 205 /* ImportType */: + case 272 /* ImportEqualsDeclaration */: + return node.moduleReference.kind === 284 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0; + case 206 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : void 0; - case 213 /* CallExpression */: + case 214 /* CallExpression */: return node.arguments[0]; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return node.name.kind === 11 /* StringLiteral */ ? node.name : void 0; default: return Debug.assertNever(node); @@ -18902,18 +18930,18 @@ function getExternalModuleName(node) { } function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return node.importClause && tryCast(node.importClause.namedBindings, isNamespaceImport); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return node; - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: return node.exportClause && tryCast(node.exportClause, isNamespaceExport); default: return Debug.assertNever(node); } } function isDefaultImport(node) { - return (node.kind === 272 /* ImportDeclaration */ || node.kind === 351 /* JSDocImportTag */) && !!node.importClause && !!node.importClause.name; + return (node.kind === 273 /* ImportDeclaration */ || node.kind === 352 /* JSDocImportTag */) && !!node.importClause && !!node.importClause.name; } function forEachImportClauseDeclaration(node, action) { if (node.name) { @@ -18927,13 +18955,13 @@ function forEachImportClauseDeclaration(node, action) { } function hasQuestionToken(node) { switch (node.kind) { - case 169 /* Parameter */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 304 /* ShorthandPropertyAssignment */: - case 303 /* PropertyAssignment */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: + case 170 /* Parameter */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 305 /* ShorthandPropertyAssignment */: + case 304 /* PropertyAssignment */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: return node.questionToken !== void 0; } return false; @@ -18944,7 +18972,7 @@ function isJSDocConstructSignature(node) { return !!name && name.escapedText === "new"; } function isJSDocTypeAlias(node) { - return node.kind === 346 /* JSDocTypedefTag */ || node.kind === 338 /* JSDocCallbackTag */ || node.kind === 340 /* JSDocEnumTag */; + return node.kind === 347 /* JSDocTypedefTag */ || node.kind === 339 /* JSDocCallbackTag */ || node.kind === 341 /* JSDocEnumTag */; } function isTypeAlias(node) { return isJSDocTypeAlias(node) || isTypeAliasDeclaration(node); @@ -18957,12 +18985,12 @@ function getSourceOfDefaultedAssignment(node) { } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: const v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return node.initializer; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return node.initializer; } } @@ -18970,26 +18998,26 @@ function getSingleVariableOfVariableStatement(node) { return isVariableStatement(node) ? firstOrUndefined(node.declarationList.declarations) : void 0; } function getNestedModuleDeclaration(node) { - return isModuleDeclaration(node) && node.body && node.body.kind === 267 /* ModuleDeclaration */ ? node.body : void 0; + return isModuleDeclaration(node) && node.body && node.body.kind === 268 /* ModuleDeclaration */ ? node.body : void 0; } function canHaveFlowNode(node) { - if (node.kind >= 243 /* FirstStatement */ && node.kind <= 259 /* LastStatement */) { + if (node.kind >= 244 /* FirstStatement */ && node.kind <= 260 /* LastStatement */) { return true; } switch (node.kind) { case 80 /* Identifier */: case 110 /* ThisKeyword */: case 108 /* SuperKeyword */: - case 166 /* QualifiedName */: - case 236 /* MetaProperty */: - case 212 /* ElementAccessExpression */: - case 211 /* PropertyAccessExpression */: - case 208 /* BindingElement */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 167 /* QualifiedName */: + case 237 /* MetaProperty */: + case 213 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 209 /* BindingElement */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return true; default: return false; @@ -18997,72 +19025,72 @@ function canHaveFlowNode(node) { } function canHaveJSDoc(node) { switch (node.kind) { - case 219 /* ArrowFunction */: - case 226 /* BinaryExpression */: - case 241 /* Block */: - case 252 /* BreakStatement */: - case 179 /* CallSignature */: - case 296 /* CaseClause */: - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 175 /* ClassStaticBlockDeclaration */: - case 176 /* Constructor */: - case 185 /* ConstructorType */: - case 180 /* ConstructSignature */: - case 251 /* ContinueStatement */: - case 259 /* DebuggerStatement */: - case 246 /* DoStatement */: - case 212 /* ElementAccessExpression */: - case 242 /* EmptyStatement */: + case 220 /* ArrowFunction */: + case 227 /* BinaryExpression */: + case 242 /* Block */: + case 253 /* BreakStatement */: + case 180 /* CallSignature */: + case 297 /* CaseClause */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 176 /* ClassStaticBlockDeclaration */: + case 177 /* Constructor */: + case 186 /* ConstructorType */: + case 181 /* ConstructSignature */: + case 252 /* ContinueStatement */: + case 260 /* DebuggerStatement */: + case 247 /* DoStatement */: + case 213 /* ElementAccessExpression */: + case 243 /* EmptyStatement */: case 1 /* EndOfFileToken */: - case 266 /* EnumDeclaration */: - case 306 /* EnumMember */: - case 277 /* ExportAssignment */: - case 278 /* ExportDeclaration */: - case 281 /* ExportSpecifier */: - case 244 /* ExpressionStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 248 /* ForStatement */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 184 /* FunctionType */: - case 177 /* GetAccessor */: + case 267 /* EnumDeclaration */: + case 307 /* EnumMember */: + case 278 /* ExportAssignment */: + case 279 /* ExportDeclaration */: + case 282 /* ExportSpecifier */: + case 245 /* ExpressionStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 249 /* ForStatement */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 185 /* FunctionType */: + case 178 /* GetAccessor */: case 80 /* Identifier */: - case 245 /* IfStatement */: - case 272 /* ImportDeclaration */: - case 271 /* ImportEqualsDeclaration */: - case 181 /* IndexSignature */: - case 264 /* InterfaceDeclaration */: - case 317 /* JSDocFunctionType */: - case 323 /* JSDocSignature */: - case 256 /* LabeledStatement */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 267 /* ModuleDeclaration */: - case 202 /* NamedTupleMember */: - case 270 /* NamespaceExportDeclaration */: - case 210 /* ObjectLiteralExpression */: - case 169 /* Parameter */: - case 217 /* ParenthesizedExpression */: - case 211 /* PropertyAccessExpression */: - case 303 /* PropertyAssignment */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 253 /* ReturnStatement */: - case 240 /* SemicolonClassElement */: - case 178 /* SetAccessor */: - case 304 /* ShorthandPropertyAssignment */: - case 305 /* SpreadAssignment */: - case 255 /* SwitchStatement */: - case 257 /* ThrowStatement */: - case 258 /* TryStatement */: - case 265 /* TypeAliasDeclaration */: - case 168 /* TypeParameter */: - case 260 /* VariableDeclaration */: - case 243 /* VariableStatement */: - case 247 /* WhileStatement */: - case 254 /* WithStatement */: + case 246 /* IfStatement */: + case 273 /* ImportDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 182 /* IndexSignature */: + case 265 /* InterfaceDeclaration */: + case 318 /* JSDocFunctionType */: + case 324 /* JSDocSignature */: + case 257 /* LabeledStatement */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 268 /* ModuleDeclaration */: + case 203 /* NamedTupleMember */: + case 271 /* NamespaceExportDeclaration */: + case 211 /* ObjectLiteralExpression */: + case 170 /* Parameter */: + case 218 /* ParenthesizedExpression */: + case 212 /* PropertyAccessExpression */: + case 304 /* PropertyAssignment */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 254 /* ReturnStatement */: + case 241 /* SemicolonClassElement */: + case 179 /* SetAccessor */: + case 305 /* ShorthandPropertyAssignment */: + case 306 /* SpreadAssignment */: + case 256 /* SwitchStatement */: + case 258 /* ThrowStatement */: + case 259 /* TryStatement */: + case 266 /* TypeAliasDeclaration */: + case 169 /* TypeParameter */: + case 261 /* VariableDeclaration */: + case 244 /* VariableStatement */: + case 248 /* WhileStatement */: + case 255 /* WithStatement */: return true; default: return false; @@ -19078,11 +19106,11 @@ function getJSDocCommentsAndTags(hostNode, noCache) { if (hasJSDocNodes(node)) { result = addRange(result, filterOwnedJSDocTags(hostNode, node.jsDoc)); } - if (node.kind === 169 /* Parameter */) { + if (node.kind === 170 /* Parameter */) { result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node)); break; } - if (node.kind === 168 /* TypeParameter */) { + if (node.kind === 169 /* TypeParameter */) { result = addRange(result, (noCache ? getJSDocTypeParameterTagsNoCache : getJSDocTypeParameterTags)(node)); break; } @@ -19106,7 +19134,7 @@ function ownsJSDocTag(hostNode, tag) { } function getNextJSDocCommentLocation(node) { const parent2 = node.parent; - if (parent2.kind === 303 /* PropertyAssignment */ || parent2.kind === 277 /* ExportAssignment */ || parent2.kind === 172 /* PropertyDeclaration */ || parent2.kind === 244 /* ExpressionStatement */ && node.kind === 211 /* PropertyAccessExpression */ || parent2.kind === 253 /* ReturnStatement */ || getNestedModuleDeclaration(parent2) || isAssignmentExpression(node)) { + if (parent2.kind === 304 /* PropertyAssignment */ || parent2.kind === 278 /* ExportAssignment */ || parent2.kind === 173 /* PropertyDeclaration */ || parent2.kind === 245 /* ExpressionStatement */ && node.kind === 212 /* PropertyAccessExpression */ || parent2.kind === 254 /* ReturnStatement */ || getNestedModuleDeclaration(parent2) || isAssignmentExpression(node)) { return parent2; } else if (parent2.parent && (getSingleVariableOfVariableStatement(parent2.parent) === node || isAssignmentExpression(parent2))) { return parent2.parent; @@ -19185,35 +19213,35 @@ function getAssignmentTarget(node) { let parent2 = node.parent; while (true) { switch (parent2.kind) { - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: const binaryExpression = parent2; const binaryOperator = binaryExpression.operatorToken.kind; return isAssignmentOperator(binaryOperator) && binaryExpression.left === node ? binaryExpression : void 0; - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: const unaryExpression = parent2; const unaryOperator = unaryExpression.operator; return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? unaryExpression : void 0; - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: const forInOrOfStatement = parent2; return forInOrOfStatement.initializer === node ? forInOrOfStatement : void 0; - case 217 /* ParenthesizedExpression */: - case 209 /* ArrayLiteralExpression */: - case 230 /* SpreadElement */: - case 235 /* NonNullExpression */: + case 218 /* ParenthesizedExpression */: + case 210 /* ArrayLiteralExpression */: + case 231 /* SpreadElement */: + case 236 /* NonNullExpression */: node = parent2; break; - case 305 /* SpreadAssignment */: + case 306 /* SpreadAssignment */: node = parent2.parent; break; - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: if (parent2.name !== node) { return void 0; } node = parent2.parent; break; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: if (parent2.name === node) { return void 0; } @@ -19231,14 +19259,14 @@ function getAssignmentTargetKind(node) { return 0 /* None */; } switch (target.kind) { - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: const binaryOperator = target.operatorToken.kind; return binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */; - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return 2 /* Compound */; - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: return 1 /* Definite */; } } @@ -19247,7 +19275,7 @@ function isAssignmentTarget(node) { } function isCompoundLikeAssignment(assignment) { const right = skipParentheses(assignment.right); - return right.kind === 226 /* BinaryExpression */ && isShiftOperatorOrHigher(right.operatorToken.kind); + return right.kind === 227 /* BinaryExpression */ && isShiftOperatorOrHigher(right.operatorToken.kind); } function isInCompoundLikeAssignment(node) { const target = getAssignmentTarget(node); @@ -19259,22 +19287,22 @@ function isInCompoundLikeAssignment(node) { } function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 241 /* Block */: - case 243 /* VariableStatement */: - case 254 /* WithStatement */: - case 245 /* IfStatement */: - case 255 /* SwitchStatement */: - case 269 /* CaseBlock */: - case 296 /* CaseClause */: - case 297 /* DefaultClause */: - case 256 /* LabeledStatement */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: - case 258 /* TryStatement */: - case 299 /* CatchClause */: + case 242 /* Block */: + case 244 /* VariableStatement */: + case 255 /* WithStatement */: + case 246 /* IfStatement */: + case 256 /* SwitchStatement */: + case 270 /* CaseBlock */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: + case 257 /* LabeledStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: + case 259 /* TryStatement */: + case 300 /* CatchClause */: return true; } return false; @@ -19289,14 +19317,14 @@ function walkUp(node, kind) { return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 196 /* ParenthesizedType */); + return walkUp(node, 197 /* ParenthesizedType */); } function walkUpParenthesizedExpressions(node) { - return walkUp(node, 217 /* ParenthesizedExpression */); + return walkUp(node, 218 /* ParenthesizedExpression */); } function walkUpParenthesizedTypesAndGetParentAndChild(node) { let child; - while (node && node.kind === 196 /* ParenthesizedType */) { + while (node && node.kind === 197 /* ParenthesizedType */) { child = node; node = node.parent; } @@ -19311,11 +19339,11 @@ function skipParentheses(node, excludeJSDocTypeAssertions) { return skipOuterExpressions(node, flags); } function isDeleteTarget(node) { - if (node.kind !== 211 /* PropertyAccessExpression */ && node.kind !== 212 /* ElementAccessExpression */) { + if (node.kind !== 212 /* PropertyAccessExpression */ && node.kind !== 213 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 220 /* DeleteExpression */; + return node && node.kind === 221 /* DeleteExpression */; } function isNodeDescendantOf(node, ancestor) { while (node) { @@ -19352,49 +19380,49 @@ function getDeclarationFromName(name) { } } function isLiteralComputedPropertyDeclarationName(node) { - return isStringOrNumericLiteralLike(node) && node.parent.kind === 167 /* ComputedPropertyName */ && isDeclaration(node.parent.parent); + return isStringOrNumericLiteralLike(node) && node.parent.kind === 168 /* ComputedPropertyName */ && isDeclaration(node.parent.parent); } function isIdentifierName(node) { const parent2 = node.parent; switch (parent2.kind) { - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 306 /* EnumMember */: - case 303 /* PropertyAssignment */: - case 211 /* PropertyAccessExpression */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 307 /* EnumMember */: + case 304 /* PropertyAssignment */: + case 212 /* PropertyAccessExpression */: return parent2.name === node; - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: return parent2.right === node; - case 208 /* BindingElement */: - case 276 /* ImportSpecifier */: + case 209 /* BindingElement */: + case 277 /* ImportSpecifier */: return parent2.propertyName === node; - case 281 /* ExportSpecifier */: - case 291 /* JsxAttribute */: - case 285 /* JsxSelfClosingElement */: - case 286 /* JsxOpeningElement */: - case 287 /* JsxClosingElement */: + case 282 /* ExportSpecifier */: + case 292 /* JsxAttribute */: + case 286 /* JsxSelfClosingElement */: + case 287 /* JsxOpeningElement */: + case 288 /* JsxClosingElement */: return true; } return false; } function getAliasDeclarationFromName(node) { switch (node.parent.kind) { - case 273 /* ImportClause */: - case 276 /* ImportSpecifier */: - case 274 /* NamespaceImport */: - case 281 /* ExportSpecifier */: - case 277 /* ExportAssignment */: - case 271 /* ImportEqualsDeclaration */: - case 280 /* NamespaceExport */: + case 274 /* ImportClause */: + case 277 /* ImportSpecifier */: + case 275 /* NamespaceImport */: + case 282 /* ExportSpecifier */: + case 278 /* ExportAssignment */: + case 272 /* ImportEqualsDeclaration */: + case 281 /* NamespaceExport */: return node.parent; - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: do { node = node.parent; - } while (node.parent.kind === 166 /* QualifiedName */); + } while (node.parent.kind === 167 /* QualifiedName */); return getAliasDeclarationFromName(node); } } @@ -19409,7 +19437,7 @@ function getExportAssignmentExpression(node) { return isExportAssignment(node) ? node.expression : node.right; } function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 304 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 303 /* PropertyAssignment */ ? node.initializer : node.parent.right; + return node.kind === 305 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 304 /* PropertyAssignment */ ? node.initializer : node.parent.right; } function getEffectiveBaseTypeNode(node) { const baseType = getClassExtendsHeritageElement(node); @@ -19460,7 +19488,7 @@ function getAncestor(node, kind) { return void 0; } function isKeyword(token) { - return 83 /* FirstKeyword */ <= token && token <= 165 /* LastKeyword */; + return 83 /* FirstKeyword */ <= token && token <= 166 /* LastKeyword */; } function isPunctuation(token) { return 19 /* FirstPunctuation */ <= token && token <= 79 /* LastPunctuation */; @@ -19469,7 +19497,7 @@ function isKeywordOrPunctuation(token) { return isKeyword(token) || isPunctuation(token); } function isContextualKeyword(token) { - return 128 /* FirstContextualKeyword */ <= token && token <= 165 /* LastContextualKeyword */; + return 128 /* FirstContextualKeyword */ <= token && token <= 166 /* LastContextualKeyword */; } function isNonContextualKeyword(token) { return isKeyword(token) && !isContextualKeyword(token); @@ -19499,14 +19527,14 @@ function getFunctionFlags(node) { } let flags = 0 /* Normal */; switch (node.kind) { - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 174 /* MethodDeclaration */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 175 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: if (hasSyntacticModifier(node, 1024 /* Async */)) { flags |= 2 /* Async */; } @@ -19519,10 +19547,10 @@ function getFunctionFlags(node) { } function isAsyncFunction(node) { switch (node.kind) { - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: return node.body !== void 0 && node.asteriskToken === void 0 && hasSyntacticModifier(node, 1024 /* Async */); } return false; @@ -19538,7 +19566,7 @@ function hasDynamicName(declaration) { return !!name && isDynamicName(name); } function isDynamicName(name) { - if (!(name.kind === 167 /* ComputedPropertyName */ || name.kind === 212 /* ElementAccessExpression */)) { + if (!(name.kind === 168 /* ComputedPropertyName */ || name.kind === 213 /* ElementAccessExpression */)) { return false; } const expr = isElementAccessExpression(name) ? skipParentheses(name.argumentExpression) : name.expression; @@ -19554,7 +19582,7 @@ function getPropertyNameForPropertyNameNode(name) { case 9 /* NumericLiteral */: case 10 /* BigIntLiteral */: return escapeLeadingUnderscores(name.text); - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: const nameExpression = name.expression; if (isStringOrNumericLiteralLike(nameExpression)) { return escapeLeadingUnderscores(nameExpression.text); @@ -19565,7 +19593,7 @@ function getPropertyNameForPropertyNameNode(name) { return nameExpression.operand.text; } return void 0; - case 295 /* JsxNamespacedName */: + case 296 /* JsxNamespacedName */: return getEscapedTextOfJsxNamespacedName(name); default: return Debug.assertNever(name); @@ -19603,17 +19631,17 @@ function isProtoSetter(node) { function isAnonymousFunctionDefinition(node, cb) { node = skipOuterExpressions(node); switch (node.kind) { - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: if (classHasDeclaredOrExplicitlyAssignedName(node)) { return false; } break; - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: if (node.name) { return false; } break; - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: break; default: return false; @@ -19622,19 +19650,19 @@ function isAnonymousFunctionDefinition(node, cb) { } function isNamedEvaluationSource(node) { switch (node.kind) { - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return !isProtoSetter(node.name); - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return !!node.objectAssignmentInitializer; - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return isIdentifier(node.name) && !!node.initializer; - case 169 /* Parameter */: + case 170 /* Parameter */: return isIdentifier(node.name) && !!node.initializer && !node.dotDotDotToken; - case 208 /* BindingElement */: + case 209 /* BindingElement */: return isIdentifier(node.name) && !!node.initializer && !node.dotDotDotToken; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return !!node.initializer; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: switch (node.operatorToken.kind) { case 64 /* EqualsToken */: case 77 /* AmpersandAmpersandEqualsToken */: @@ -19643,7 +19671,7 @@ function isNamedEvaluationSource(node) { return isIdentifier(node.left); } break; - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return true; } return false; @@ -19651,18 +19679,18 @@ function isNamedEvaluationSource(node) { function isNamedEvaluation(node, cb) { if (!isNamedEvaluationSource(node)) return false; switch (node.kind) { - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return isAnonymousFunctionDefinition(node.initializer, cb); - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return isAnonymousFunctionDefinition(node.objectAssignmentInitializer, cb); - case 260 /* VariableDeclaration */: - case 169 /* Parameter */: - case 208 /* BindingElement */: - case 172 /* PropertyDeclaration */: + case 261 /* VariableDeclaration */: + case 170 /* Parameter */: + case 209 /* BindingElement */: + case 173 /* PropertyDeclaration */: return isAnonymousFunctionDefinition(node.initializer, cb); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return isAnonymousFunctionDefinition(node.right, cb); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return isAnonymousFunctionDefinition(node.expression, cb); } } @@ -19671,17 +19699,17 @@ function isPushOrUnshiftIdentifier(node) { } function isPartOfParameterDeclaration(node) { const root = getRootDeclaration(node); - return root.kind === 169 /* Parameter */; + return root.kind === 170 /* Parameter */; } function getRootDeclaration(node) { - while (node.kind === 208 /* BindingElement */) { + while (node.kind === 209 /* BindingElement */) { node = node.parent.parent; } return node; } function nodeStartsNewLexicalEnvironment(node) { const kind = node.kind; - return kind === 176 /* Constructor */ || kind === 218 /* FunctionExpression */ || kind === 262 /* FunctionDeclaration */ || kind === 219 /* ArrowFunction */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 267 /* ModuleDeclaration */ || kind === 307 /* SourceFile */; + return kind === 177 /* Constructor */ || kind === 219 /* FunctionExpression */ || kind === 263 /* FunctionDeclaration */ || kind === 220 /* ArrowFunction */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */ || kind === 268 /* ModuleDeclaration */ || kind === 308 /* SourceFile */; } function nodeIsSynthesized(range) { return positionIsSynthesized(range.pos) || positionIsSynthesized(range.end); @@ -19693,22 +19721,22 @@ var Associativity = /* @__PURE__ */ ((Associativity2) => { })(Associativity || {}); function getExpressionAssociativity(expression) { const operator = getOperator(expression); - const hasArguments = expression.kind === 214 /* NewExpression */ && expression.arguments !== void 0; + const hasArguments = expression.kind === 215 /* NewExpression */ && expression.arguments !== void 0; return getOperatorAssociativity(expression.kind, operator, hasArguments); } function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 214 /* NewExpression */: + case 215 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 224 /* PrefixUnaryExpression */: - case 221 /* TypeOfExpression */: - case 222 /* VoidExpression */: - case 220 /* DeleteExpression */: - case 223 /* AwaitExpression */: - case 227 /* ConditionalExpression */: - case 229 /* YieldExpression */: + case 225 /* PrefixUnaryExpression */: + case 222 /* TypeOfExpression */: + case 223 /* VoidExpression */: + case 221 /* DeleteExpression */: + case 224 /* AwaitExpression */: + case 228 /* ConditionalExpression */: + case 230 /* YieldExpression */: return 1 /* Right */; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: switch (operator) { case 43 /* AsteriskAsteriskToken */: case 64 /* EqualsToken */: @@ -19734,13 +19762,13 @@ function getOperatorAssociativity(kind, operator, hasArguments) { } function getExpressionPrecedence(expression) { const operator = getOperator(expression); - const hasArguments = expression.kind === 214 /* NewExpression */ && expression.arguments !== void 0; + const hasArguments = expression.kind === 215 /* NewExpression */ && expression.arguments !== void 0; return getOperatorPrecedence(expression.kind, operator, hasArguments); } function getOperator(expression) { - if (expression.kind === 226 /* BinaryExpression */) { + if (expression.kind === 227 /* BinaryExpression */) { return expression.operatorToken.kind; - } else if (expression.kind === 224 /* PrefixUnaryExpression */ || expression.kind === 225 /* PostfixUnaryExpression */) { + } else if (expression.kind === 225 /* PrefixUnaryExpression */ || expression.kind === 226 /* PostfixUnaryExpression */) { return expression.operator; } else { return expression.kind; @@ -19752,8 +19780,8 @@ var OperatorPrecedence = /* @__PURE__ */ ((OperatorPrecedence2) => { OperatorPrecedence2[OperatorPrecedence2["Yield"] = 2] = "Yield"; OperatorPrecedence2[OperatorPrecedence2["Assignment"] = 3] = "Assignment"; OperatorPrecedence2[OperatorPrecedence2["Conditional"] = 4] = "Conditional"; - OperatorPrecedence2[OperatorPrecedence2["Coalesce"] = 4 /* Conditional */] = "Coalesce"; OperatorPrecedence2[OperatorPrecedence2["LogicalOR"] = 5] = "LogicalOR"; + OperatorPrecedence2[OperatorPrecedence2["Coalesce"] = 5 /* LogicalOR */] = "Coalesce"; OperatorPrecedence2[OperatorPrecedence2["LogicalAND"] = 6] = "LogicalAND"; OperatorPrecedence2[OperatorPrecedence2["BitwiseOR"] = 7] = "BitwiseOR"; OperatorPrecedence2[OperatorPrecedence2["BitwiseXOR"] = 8] = "BitwiseXOR"; @@ -19776,15 +19804,15 @@ var OperatorPrecedence = /* @__PURE__ */ ((OperatorPrecedence2) => { })(OperatorPrecedence || {}); function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return 0 /* Comma */; - case 230 /* SpreadElement */: + case 231 /* SpreadElement */: return 1 /* Spread */; - case 229 /* YieldExpression */: + case 230 /* YieldExpression */: return 2 /* Yield */; - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return 4 /* Conditional */; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: switch (operatorKind) { case 28 /* CommaToken */: return 0 /* Comma */; @@ -19809,27 +19837,27 @@ function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { return getBinaryOperatorPrecedence(operatorKind); } // TODO: Should prefix `++` and `--` be moved to the `Update` precedence? - case 216 /* TypeAssertionExpression */: - case 235 /* NonNullExpression */: - case 224 /* PrefixUnaryExpression */: - case 221 /* TypeOfExpression */: - case 222 /* VoidExpression */: - case 220 /* DeleteExpression */: - case 223 /* AwaitExpression */: + case 217 /* TypeAssertionExpression */: + case 236 /* NonNullExpression */: + case 225 /* PrefixUnaryExpression */: + case 222 /* TypeOfExpression */: + case 223 /* VoidExpression */: + case 221 /* DeleteExpression */: + case 224 /* AwaitExpression */: return 16 /* Unary */; - case 225 /* PostfixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return 17 /* Update */; - case 213 /* CallExpression */: + case 214 /* CallExpression */: return 18 /* LeftHandSide */; - case 214 /* NewExpression */: + case 215 /* NewExpression */: return hasArguments ? 19 /* Member */ : 18 /* LeftHandSide */; - case 215 /* TaggedTemplateExpression */: - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: - case 236 /* MetaProperty */: + case 216 /* TaggedTemplateExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: + case 237 /* MetaProperty */: return 19 /* Member */; - case 234 /* AsExpression */: - case 238 /* SatisfiesExpression */: + case 235 /* AsExpression */: + case 239 /* SatisfiesExpression */: return 11 /* Relational */; case 110 /* ThisKeyword */: case 108 /* SuperKeyword */: @@ -19841,19 +19869,19 @@ function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { case 9 /* NumericLiteral */: case 10 /* BigIntLiteral */: case 11 /* StringLiteral */: - case 209 /* ArrayLiteralExpression */: - case 210 /* ObjectLiteralExpression */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 231 /* ClassExpression */: + case 210 /* ArrayLiteralExpression */: + case 211 /* ObjectLiteralExpression */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 232 /* ClassExpression */: case 14 /* RegularExpressionLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: - case 228 /* TemplateExpression */: - case 217 /* ParenthesizedExpression */: - case 232 /* OmittedExpression */: - case 284 /* JsxElement */: - case 285 /* JsxSelfClosingElement */: - case 288 /* JsxFragment */: + case 229 /* TemplateExpression */: + case 218 /* ParenthesizedExpression */: + case 233 /* OmittedExpression */: + case 285 /* JsxElement */: + case 286 /* JsxSelfClosingElement */: + case 289 /* JsxFragment */: return 20 /* Primary */; default: return -1 /* Invalid */; @@ -19862,7 +19890,7 @@ function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { function getBinaryOperatorPrecedence(kind) { switch (kind) { case 61 /* QuestionQuestionToken */: - return 4 /* Coalesce */; + return 5 /* Coalesce */; case 57 /* BarBarToken */: return 5 /* LogicalOR */; case 56 /* AmpersandAmpersandToken */: @@ -19906,7 +19934,7 @@ function getBinaryOperatorPrecedence(kind) { function getSemanticJsxChildren(children) { return filter(children, (i) => { switch (i.kind) { - case 294 /* JsxExpression */: + case 295 /* JsxExpression */: return !!i.expression; case 12 /* JsxText */: return !i.containsOnlyTriviaWhiteSpaces; @@ -20347,7 +20375,7 @@ function sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) { if (forceDtsEmit) return true; if (host.isSourceOfProjectReferenceRedirect(sourceFile.fileName)) return false; if (!isJsonSourceFile(sourceFile)) return true; - if (host.getResolvedProjectReferenceToRedirect(sourceFile.fileName)) return false; + if (host.getRedirectFromSourceFile(sourceFile.fileName)) return false; if (options.outFile) return true; if (!options.outDir) return false; if (options.rootDir || options.composite && options.configFilePath) { @@ -20430,7 +20458,7 @@ function isThisIdentifier(node) { function isInTypeQuery(node) { return !!findAncestor( node, - (n) => n.kind === 186 /* TypeQuery */ ? true : n.kind === 80 /* Identifier */ || n.kind === 166 /* QualifiedName */ ? false : "quit" + (n) => n.kind === 187 /* TypeQuery */ ? true : n.kind === 80 /* Identifier */ || n.kind === 167 /* QualifiedName */ ? false : "quit" ); } function isThisInTypeQuery(node) { @@ -20440,7 +20468,7 @@ function isThisInTypeQuery(node) { while (isQualifiedName(node.parent) && node.parent.left === node) { node = node.parent; } - return node.parent.kind === 186 /* TypeQuery */; + return node.parent.kind === 187 /* TypeQuery */; } function identifierIsThisKeyword(id) { return id.escapedText === "this"; @@ -20452,9 +20480,9 @@ function getAllAccessorDeclarations(declarations, accessor) { let setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 177 /* GetAccessor */) { + if (accessor.kind === 178 /* GetAccessor */) { getAccessor = accessor; - } else if (accessor.kind === 178 /* SetAccessor */) { + } else if (accessor.kind === 179 /* SetAccessor */) { setAccessor = accessor; } else { Debug.fail("Accessor has wrong kind"); @@ -20470,10 +20498,10 @@ function getAllAccessorDeclarations(declarations, accessor) { } else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 177 /* GetAccessor */ && !getAccessor) { + if (member.kind === 178 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 178 /* SetAccessor */ && !setAccessor) { + if (member.kind === 179 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -20504,7 +20532,7 @@ function getJSDocTypeParameterDeclarations(node) { return flatMap(getJSDocTags(node), (tag) => isNonTypeAliasTemplate(tag) ? tag.typeParameters : void 0); } function isNonTypeAliasTemplate(tag) { - return isJSDocTemplateTag(tag) && !(tag.parent.kind === 320 /* JSDoc */ && (tag.parent.tags.some(isJSDocTypeAlias) || tag.parent.tags.some(isJSDocOverloadTag))); + return isJSDocTemplateTag(tag) && !(tag.parent.kind === 321 /* JSDoc */ && (tag.parent.tags.some(isJSDocTypeAlias) || tag.parent.tags.some(isJSDocOverloadTag))); } function getEffectiveSetAccessorTypeAnnotationNode(node) { const parameter = getSetAccessorValueParameter(node); @@ -20694,7 +20722,7 @@ function getSelectedSyntacticModifierFlags(node, flags) { return getSyntacticModifierFlags(node) & flags; } function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) { - if (node.kind >= 0 /* FirstToken */ && node.kind <= 165 /* LastToken */) { + if (node.kind >= 0 /* FirstToken */ && node.kind <= 166 /* LastToken */) { return 0 /* None */; } if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) { @@ -20805,7 +20833,7 @@ function modifierToFlag(token) { return 8192 /* In */; case 147 /* OutKeyword */: return 16384 /* Out */; - case 170 /* Decorator */: + case 171 /* Decorator */: return 32768 /* Decorator */; } return 0 /* None */; @@ -20859,7 +20887,7 @@ function isDestructuringAssignment(node) { true )) { const kind = node.left.kind; - return kind === 210 /* ObjectLiteralExpression */ || kind === 209 /* ArrayLiteralExpression */; + return kind === 211 /* ObjectLiteralExpression */ || kind === 210 /* ArrayLiteralExpression */; } return false; } @@ -20873,12 +20901,12 @@ function getFirstIdentifier(node) { switch (node.kind) { case 80 /* Identifier */: return node; - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: do { node = node.left; } while (node.kind !== 80 /* Identifier */); return node; - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 80 /* Identifier */); @@ -20886,7 +20914,7 @@ function getFirstIdentifier(node) { } } function isDottedName(node) { - return node.kind === 80 /* Identifier */ || node.kind === 110 /* ThisKeyword */ || node.kind === 108 /* SuperKeyword */ || node.kind === 236 /* MetaProperty */ || node.kind === 211 /* PropertyAccessExpression */ && isDottedName(node.expression) || node.kind === 217 /* ParenthesizedExpression */ && isDottedName(node.expression); + return node.kind === 80 /* Identifier */ || node.kind === 110 /* ThisKeyword */ || node.kind === 108 /* SuperKeyword */ || node.kind === 237 /* MetaProperty */ || node.kind === 212 /* PropertyAccessExpression */ && isDottedName(node.expression) || node.kind === 218 /* ParenthesizedExpression */ && isDottedName(node.expression); } function isPropertyAccessEntityNameExpression(node) { return isPropertyAccessExpression(node) && isIdentifier(node.name) && isEntityNameExpression(node.expression); @@ -20913,7 +20941,7 @@ function isPrototypeAccess(node) { return isBindableStaticAccessExpression(node) && getElementOrPropertyAccessName(node) === "prototype"; } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node || node.parent.kind === 236 /* MetaProperty */ && node.parent.name === node; + return node.parent.kind === 167 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 212 /* PropertyAccessExpression */ && node.parent.name === node || node.parent.kind === 237 /* MetaProperty */ && node.parent.name === node; } function isRightSideOfAccessExpression(node) { return !!node.parent && (isPropertyAccessExpression(node.parent) && node.parent.name === node || isElementAccessExpression(node.parent) && node.parent.argumentExpression === node); @@ -20928,10 +20956,10 @@ function isRightSideOfInstanceofExpression(node) { return isInstanceOfExpression(node.parent) && node === node.parent.right; } function isEmptyObjectLiteral(expression) { - return expression.kind === 210 /* ObjectLiteralExpression */ && expression.properties.length === 0; + return expression.kind === 211 /* ObjectLiteralExpression */ && expression.properties.length === 0; } function isEmptyArrayLiteral(expression) { - return expression.kind === 209 /* ArrayLiteralExpression */ && expression.elements.length === 0; + return expression.kind === 210 /* ArrayLiteralExpression */ && expression.elements.length === 0; } function getLocalSymbolForExportDefault(symbol) { if (!isExportDefaultSymbol(symbol) || !symbol.declarations) return void 0; @@ -21057,8 +21085,14 @@ function base64decode(host, input) { function readJsonOrUndefined(path, hostOrText) { const jsonText = isString(hostOrText) ? hostOrText : hostOrText.readFile(path); if (!jsonText) return void 0; - const result = parseConfigFileTextToJson(path, jsonText); - return !result.error ? result.config : void 0; + let result = tryParseJson(jsonText); + if (result === void 0) { + const looseResult = parseConfigFileTextToJson(path, jsonText); + if (!looseResult.error) { + result = looseResult.config; + } + } + return result; } function readJson(path, host) { return readJsonOrUndefined(path, host) || {}; @@ -21207,8 +21241,8 @@ function isDeclarationNameOfEnumOrNamespace(node) { const parseNode = getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 266 /* EnumDeclaration */: - case 267 /* ModuleDeclaration */: + case 267 /* EnumDeclaration */: + case 268 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -21261,27 +21295,27 @@ function isWriteAccess(node) { function accessKind(node) { const { parent: parent2 } = node; switch (parent2 == null ? void 0 : parent2.kind) { - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return accessKind(parent2); - case 225 /* PostfixUnaryExpression */: - case 224 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: const { operator } = parent2; return operator === 46 /* PlusPlusToken */ || operator === 47 /* MinusMinusToken */ ? 2 /* ReadWrite */ : 0 /* Read */; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: const { left, operatorToken } = parent2; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 64 /* EqualsToken */ ? 1 /* Write */ : 2 /* ReadWrite */ : 0 /* Read */; - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return parent2.name !== node ? 0 /* Read */ : accessKind(parent2); - case 303 /* PropertyAssignment */: { + case 304 /* PropertyAssignment */: { const parentAccess = accessKind(parent2.parent); return node === parent2.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return node === parent2.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent2.parent); - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return accessKind(parent2); - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: return node === parent2.initializer ? 1 /* Write */ : 0 /* Read */; default: return 0 /* Read */; @@ -21386,20 +21420,20 @@ function isObjectTypeDeclaration(node) { return isClassLike(node) || isInterfaceDeclaration(node) || isTypeLiteralNode(node); } function isTypeNodeKind(kind) { - return kind >= 182 /* FirstTypeNode */ && kind <= 205 /* LastTypeNode */ || kind === 133 /* AnyKeyword */ || kind === 159 /* UnknownKeyword */ || kind === 150 /* NumberKeyword */ || kind === 163 /* BigIntKeyword */ || kind === 151 /* ObjectKeyword */ || kind === 136 /* BooleanKeyword */ || kind === 154 /* StringKeyword */ || kind === 155 /* SymbolKeyword */ || kind === 116 /* VoidKeyword */ || kind === 157 /* UndefinedKeyword */ || kind === 146 /* NeverKeyword */ || kind === 141 /* IntrinsicKeyword */ || kind === 233 /* ExpressionWithTypeArguments */ || kind === 312 /* JSDocAllType */ || kind === 313 /* JSDocUnknownType */ || kind === 314 /* JSDocNullableType */ || kind === 315 /* JSDocNonNullableType */ || kind === 316 /* JSDocOptionalType */ || kind === 317 /* JSDocFunctionType */ || kind === 318 /* JSDocVariadicType */; + return kind >= 183 /* FirstTypeNode */ && kind <= 206 /* LastTypeNode */ || kind === 133 /* AnyKeyword */ || kind === 159 /* UnknownKeyword */ || kind === 150 /* NumberKeyword */ || kind === 163 /* BigIntKeyword */ || kind === 151 /* ObjectKeyword */ || kind === 136 /* BooleanKeyword */ || kind === 154 /* StringKeyword */ || kind === 155 /* SymbolKeyword */ || kind === 116 /* VoidKeyword */ || kind === 157 /* UndefinedKeyword */ || kind === 146 /* NeverKeyword */ || kind === 141 /* IntrinsicKeyword */ || kind === 234 /* ExpressionWithTypeArguments */ || kind === 313 /* JSDocAllType */ || kind === 314 /* JSDocUnknownType */ || kind === 315 /* JSDocNullableType */ || kind === 316 /* JSDocNonNullableType */ || kind === 317 /* JSDocOptionalType */ || kind === 318 /* JSDocFunctionType */ || kind === 319 /* JSDocVariadicType */; } function isAccessExpression(node) { - return node.kind === 211 /* PropertyAccessExpression */ || node.kind === 212 /* ElementAccessExpression */; + return node.kind === 212 /* PropertyAccessExpression */ || node.kind === 213 /* ElementAccessExpression */; } function getNameOfAccessExpression(node) { - if (node.kind === 211 /* PropertyAccessExpression */) { + if (node.kind === 212 /* PropertyAccessExpression */) { return node.name; } - Debug.assert(node.kind === 212 /* ElementAccessExpression */); + Debug.assert(node.kind === 213 /* ElementAccessExpression */); return node.argumentExpression; } function isNamedImportsOrExports(node) { - return node.kind === 275 /* NamedImports */ || node.kind === 279 /* NamedExports */; + return node.kind === 276 /* NamedImports */ || node.kind === 280 /* NamedExports */; } function getLeftmostAccessExpression(expr) { while (isAccessExpression(expr)) { @@ -21412,12 +21446,12 @@ function forEachNameInAccessChainWalkingLeft(name, action) { return walkAccessExpression(name.parent); } function walkAccessExpression(access) { - if (access.kind === 211 /* PropertyAccessExpression */) { + if (access.kind === 212 /* PropertyAccessExpression */) { const res = action(access.name); if (res !== void 0) { return res; } - } else if (access.kind === 212 /* ElementAccessExpression */) { + } else if (access.kind === 213 /* ElementAccessExpression */) { if (isIdentifier(access.argumentExpression) || isStringLiteralLike(access.argumentExpression)) { const res = action(access.argumentExpression); if (res !== void 0) { @@ -21439,29 +21473,29 @@ function forEachNameInAccessChainWalkingLeft(name, action) { function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 225 /* PostfixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: node = node.operand; continue; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: node = node.left; continue; - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: node = node.condition; continue; - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: node = node.tag; continue; - case 213 /* CallExpression */: + case 214 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 234 /* AsExpression */: - case 212 /* ElementAccessExpression */: - case 211 /* PropertyAccessExpression */: - case 235 /* NonNullExpression */: - case 355 /* PartiallyEmittedExpression */: - case 238 /* SatisfiesExpression */: + case 235 /* AsExpression */: + case 213 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 236 /* NonNullExpression */: + case 356 /* PartiallyEmittedExpression */: + case 239 /* SatisfiesExpression */: node = node.expression; continue; } @@ -21871,7 +21905,7 @@ var _computedOptions = createComputedCompilerOptions({ dependencies: ["module"], computeValue: (compilerOptions) => { const target = compilerOptions.target === 0 /* ES3 */ ? void 0 : compilerOptions.target; - return target ?? (compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 101 /* Node18 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */); + return target ?? (compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 101 /* Node18 */ && 9 /* ES2022 */ || compilerOptions.module === 102 /* Node20 */ && 10 /* ES2023 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */); } }, module: { @@ -21891,6 +21925,7 @@ var _computedOptions = createComputedCompilerOptions({ break; case 100 /* Node16 */: case 101 /* Node18 */: + case 102 /* Node20 */: moduleResolution = 3 /* Node16 */; break; case 199 /* NodeNext */: @@ -21932,6 +21967,7 @@ var _computedOptions = createComputedCompilerOptions({ switch (_computedOptions.module.computeValue(compilerOptions)) { case 100 /* Node16 */: case 101 /* Node18 */: + case 102 /* Node20 */: case 199 /* NodeNext */: case 200 /* Preserve */: return true; @@ -21974,8 +22010,8 @@ var _computedOptions = createComputedCompilerOptions({ if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { return false; } - if (compilerOptions.resolvePackageJsonExports !== void 0) { - return compilerOptions.resolvePackageJsonExports; + if (compilerOptions.resolvePackageJsonImports !== void 0) { + return compilerOptions.resolvePackageJsonImports; } switch (moduleResolution) { case 3 /* Node16 */: @@ -21992,6 +22028,14 @@ var _computedOptions = createComputedCompilerOptions({ if (compilerOptions.resolveJsonModule !== void 0) { return compilerOptions.resolveJsonModule; } + switch (_computedOptions.module.computeValue(compilerOptions)) { + // TODO in 6.0: uncomment + // case ModuleKind.Node16: + // case ModuleKind.Node18: + case 102 /* Node20 */: + case 199 /* NodeNext */: + return true; + } return _computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */; } }, @@ -22261,7 +22305,7 @@ function escapeRegExpCharacter(match) { } var wildcardCharCodes = [42 /* asterisk */, 63 /* question */]; var commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"]; -var implicitExcludePathRegexPattern = `(?!(${commonPackageFolders.join("|")})(/|$))`; +var implicitExcludePathRegexPattern = `(?!(?:${commonPackageFolders.join("|")})(?:/|$))`; var filesMatcher = { /** * Matches any single directory segment unless it is the last segment and a .min.js file @@ -22269,12 +22313,12 @@ var filesMatcher = { * [^./] # matches everything up to the first . character (excluding directory separators) * (\\.(?!min\\.js$))? # matches . characters but not if they are part of the .min.js file extension */ - singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*", + singleAsteriskRegexFragment: "(?:[^./]|(?:\\.(?!min\\.js$))?)*", /** * Regex for the ** wildcard. Matches any number of subdirectories. When used for including * files or directories, does not match subdirectories that start with a . character */ - doubleAsteriskRegexFragment: `(/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`, + doubleAsteriskRegexFragment: `(?:/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`, replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment) }; var directoriesMatcher = { @@ -22283,12 +22327,12 @@ var directoriesMatcher = { * Regex for the ** wildcard. Matches any number of subdirectories. When used for including * files or directories, does not match subdirectories that start with a . character */ - doubleAsteriskRegexFragment: `(/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`, + doubleAsteriskRegexFragment: `(?:/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`, replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment) }; var excludeMatcher = { singleAsteriskRegexFragment: "[^/]*", - doubleAsteriskRegexFragment: "(/.+?)?", + doubleAsteriskRegexFragment: "(?:/.+?)?", replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment) }; var wildcardMatchers = { @@ -22301,9 +22345,9 @@ function getRegularExpressionForWildcard(specs, basePath, usage) { if (!patterns || !patterns.length) { return void 0; } - const pattern = patterns.map((pattern2) => `(${pattern2})`).join("|"); - const terminator = usage === "exclude" ? "($|/)" : "$"; - return `^(${pattern})${terminator}`; + const pattern = patterns.map((pattern2) => `(?:${pattern2})`).join("|"); + const terminator = usage === "exclude" ? "(?:$|/)" : "$"; + return `^(?:${pattern})${terminator}`; } function getRegularExpressionsForWildcards(specs, basePath, usage) { if (specs === void 0 || specs.length === 0) { @@ -22316,7 +22360,7 @@ function isImplicitGlob(lastPathComponent) { } function getPatternFromSpec(spec, basePath, usage) { const pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]); - return pattern && `^(${pattern})${usage === "exclude" ? "($|/)" : "$"}`; + return pattern && `^(?:${pattern})${usage === "exclude" ? "(?:$|/)" : "$"}`; } function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter: replaceWildcardCharacter2 } = wildcardMatchers[usage]) { let subpattern = ""; @@ -22336,7 +22380,7 @@ function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragm subpattern += doubleAsteriskRegexFragment; } else { if (usage === "directories") { - subpattern += "("; + subpattern += "(?:"; optionalCount++; } if (hasWrittenComponent) { @@ -22345,7 +22389,7 @@ function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragm if (usage !== "exclude") { let componentPattern = ""; if (component.charCodeAt(0) === 42 /* asterisk */) { - componentPattern += "([^./]" + singleAsteriskRegexFragment + ")?"; + componentPattern += "(?:[^./]" + singleAsteriskRegexFragment + ")?"; component = component.substr(1); } else if (component.charCodeAt(0) === 63 /* question */) { componentPattern += "[^./]"; @@ -22884,32 +22928,32 @@ function isShorthandPropertyNameUseSite(useSite) { return isIdentifier(useSite) && isShorthandPropertyAssignment(useSite.parent) && useSite.parent.name === useSite; } function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 80 /* Identifier */ || node.kind === 211 /* PropertyAccessExpression */) { + while (node.kind === 80 /* Identifier */ || node.kind === 212 /* PropertyAccessExpression */) { node = node.parent; } - if (node.kind !== 167 /* ComputedPropertyName */) { + if (node.kind !== 168 /* ComputedPropertyName */) { return false; } if (hasSyntacticModifier(node.parent, 64 /* Abstract */)) { return true; } const containerKind = node.parent.parent.kind; - return containerKind === 264 /* InterfaceDeclaration */ || containerKind === 187 /* TypeLiteral */; + return containerKind === 265 /* InterfaceDeclaration */ || containerKind === 188 /* TypeLiteral */; } function isIdentifierInNonEmittingHeritageClause(node) { if (node.kind !== 80 /* Identifier */) return false; const heritageClause = findAncestor(node.parent, (parent2) => { switch (parent2.kind) { - case 298 /* HeritageClause */: + case 299 /* HeritageClause */: return true; - case 211 /* PropertyAccessExpression */: - case 233 /* ExpressionWithTypeArguments */: + case 212 /* PropertyAccessExpression */: + case 234 /* ExpressionWithTypeArguments */: return false; default: return "quit"; } }); - return (heritageClause == null ? void 0 : heritageClause.token) === 119 /* ImplementsKeyword */ || (heritageClause == null ? void 0 : heritageClause.parent.kind) === 264 /* InterfaceDeclaration */; + return (heritageClause == null ? void 0 : heritageClause.token) === 119 /* ImplementsKeyword */ || (heritageClause == null ? void 0 : heritageClause.parent.kind) === 265 /* InterfaceDeclaration */; } function isIdentifierTypeReference(node) { return isTypeReferenceNode(node) && isIdentifier(node.typeName); @@ -23007,20 +23051,20 @@ function containsIgnoredPath(path) { function getContainingNodeArray(node) { if (!node.parent) return void 0; switch (node.kind) { - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: const { parent: parent3 } = node; - return parent3.kind === 195 /* InferType */ ? void 0 : parent3.typeParameters; - case 169 /* Parameter */: + return parent3.kind === 196 /* InferType */ ? void 0 : parent3.typeParameters; + case 170 /* Parameter */: return node.parent.parameters; - case 204 /* TemplateLiteralTypeSpan */: + case 205 /* TemplateLiteralTypeSpan */: return node.parent.templateSpans; - case 239 /* TemplateSpan */: + case 240 /* TemplateSpan */: return node.parent.templateSpans; - case 170 /* Decorator */: { + case 171 /* Decorator */: { const { parent: parent4 } = node; return canHaveDecorators(parent4) ? parent4.modifiers : void 0; } - case 298 /* HeritageClause */: + case 299 /* HeritageClause */: return node.parent.heritageClauses; } const { parent: parent2 } = node; @@ -23028,43 +23072,43 @@ function getContainingNodeArray(node) { return isJSDocTypeLiteral(node.parent) ? void 0 : node.parent.tags; } switch (parent2.kind) { - case 187 /* TypeLiteral */: - case 264 /* InterfaceDeclaration */: + case 188 /* TypeLiteral */: + case 265 /* InterfaceDeclaration */: return isTypeElement(node) ? parent2.members : void 0; - case 192 /* UnionType */: - case 193 /* IntersectionType */: + case 193 /* UnionType */: + case 194 /* IntersectionType */: return parent2.types; - case 189 /* TupleType */: - case 209 /* ArrayLiteralExpression */: - case 356 /* CommaListExpression */: - case 275 /* NamedImports */: - case 279 /* NamedExports */: + case 190 /* TupleType */: + case 210 /* ArrayLiteralExpression */: + case 357 /* CommaListExpression */: + case 276 /* NamedImports */: + case 280 /* NamedExports */: return parent2.elements; - case 210 /* ObjectLiteralExpression */: - case 292 /* JsxAttributes */: + case 211 /* ObjectLiteralExpression */: + case 293 /* JsxAttributes */: return parent2.properties; - case 213 /* CallExpression */: - case 214 /* NewExpression */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: return isTypeNode(node) ? parent2.typeArguments : parent2.expression === node ? void 0 : parent2.arguments; - case 284 /* JsxElement */: - case 288 /* JsxFragment */: + case 285 /* JsxElement */: + case 289 /* JsxFragment */: return isJsxChild(node) ? parent2.children : void 0; - case 286 /* JsxOpeningElement */: - case 285 /* JsxSelfClosingElement */: + case 287 /* JsxOpeningElement */: + case 286 /* JsxSelfClosingElement */: return isTypeNode(node) ? parent2.typeArguments : void 0; - case 241 /* Block */: - case 296 /* CaseClause */: - case 297 /* DefaultClause */: - case 268 /* ModuleBlock */: + case 242 /* Block */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: + case 269 /* ModuleBlock */: return parent2.statements; - case 269 /* CaseBlock */: + case 270 /* CaseBlock */: return parent2.clauses; - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: return isClassElement(node) ? parent2.members : void 0; - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: return isEnumMember(node) ? parent2.members : void 0; - case 307 /* SourceFile */: + case 308 /* SourceFile */: return parent2.statements; } } @@ -23073,7 +23117,7 @@ function hasContextSensitiveParameters(node) { if (some(node.parameters, (p) => !getEffectiveTypeAnnotationNode(p))) { return true; } - if (node.kind !== 219 /* ArrowFunction */) { + if (node.kind !== 220 /* ArrowFunction */) { const parameter = firstOrUndefined(node.parameters); if (!(parameter && parameterIsThisKeyword(parameter))) { return true; @@ -23086,10 +23130,10 @@ function isInfinityOrNaNString(name) { return name === "Infinity" || name === "-Infinity" || name === "NaN"; } function isCatchClauseVariableDeclaration(node) { - return node.kind === 260 /* VariableDeclaration */ && node.parent.kind === 299 /* CatchClause */; + return node.kind === 261 /* VariableDeclaration */ && node.parent.kind === 300 /* CatchClause */; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */; + return node.kind === 219 /* FunctionExpression */ || node.kind === 220 /* ArrowFunction */; } function escapeSnippetText(text) { return text.replace(/\$/g, () => "\\$"); @@ -23153,19 +23197,20 @@ function getNodeModulePathParts(fullPath) { } function isTypeDeclaration(node) { switch (node.kind) { - case 168 /* TypeParameter */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 266 /* EnumDeclaration */: - case 346 /* JSDocTypedefTag */: - case 338 /* JSDocCallbackTag */: - case 340 /* JSDocEnumTag */: + case 169 /* TypeParameter */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 267 /* EnumDeclaration */: + case 347 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: + case 341 /* JSDocEnumTag */: return true; - case 273 /* ImportClause */: - return node.isTypeOnly; - case 276 /* ImportSpecifier */: - case 281 /* ExportSpecifier */: + case 274 /* ImportClause */: + return node.phaseModifier === 156 /* TypeKeyword */; + case 277 /* ImportSpecifier */: + return node.parent.parent.phaseModifier === 156 /* TypeKeyword */; + case 282 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; default: return false; @@ -23179,7 +23224,7 @@ function isOptionalJSDocPropertyLikeTag(node) { return false; } const { isBracketed, typeExpression } = node; - return isBracketed || !!typeExpression && typeExpression.type.kind === 316 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 317 /* JSDocOptionalType */; } function canUsePropertyAccess(name, languageVersion) { if (name.length === 0) { @@ -23194,17 +23239,17 @@ function hasTabstop(node) { } function isJSDocOptionalParameter(node) { return isInJSFile(node) && // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType - (node.type && node.type.kind === 316 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(isOptionalJSDocPropertyLikeTag)); + (node.type && node.type.kind === 317 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(isOptionalJSDocPropertyLikeTag)); } function isOptionalDeclaration(declaration) { switch (declaration.kind) { - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: return !!declaration.questionToken; - case 169 /* Parameter */: + case 170 /* Parameter */: return !!declaration.questionToken || isJSDocOptionalParameter(declaration); - case 348 /* JSDocPropertyTag */: - case 341 /* JSDocParameterTag */: + case 349 /* JSDocPropertyTag */: + case 342 /* JSDocParameterTag */: return isOptionalJSDocPropertyLikeTag(declaration); default: return false; @@ -23212,7 +23257,7 @@ function isOptionalDeclaration(declaration) { } function isNonNullAccess(node) { const kind = node.kind; - return (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */) && isNonNullExpression(node.expression); + return (kind === 212 /* PropertyAccessExpression */ || kind === 213 /* ElementAccessExpression */) && isNonNullExpression(node.expression); } function isJSDocSatisfiesExpression(node) { return isInJSFile(node) && isParenthesizedExpression(node) && hasJSDocNodes(node) && !!getJSDocSatisfiesTag(node); @@ -23232,7 +23277,7 @@ function getTextOfJsxAttributeName(node) { } function isJsxAttributeName(node) { const kind = node.kind; - return kind === 80 /* Identifier */ || kind === 295 /* JsxNamespacedName */; + return kind === 80 /* Identifier */ || kind === 296 /* JsxNamespacedName */; } function getEscapedTextOfJsxNamespacedName(node) { return `${node.namespace.escapedText}:${idText(node.name)}`; @@ -23273,99 +23318,99 @@ function getNameFromImportAttribute(node) { } function isSourceElement(node) { switch (node.kind) { - case 168 /* TypeParameter */: - case 169 /* Parameter */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 185 /* ConstructorType */: - case 184 /* FunctionType */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 181 /* IndexSignature */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 175 /* ClassStaticBlockDeclaration */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 183 /* TypeReference */: - case 182 /* TypePredicate */: - case 186 /* TypeQuery */: - case 187 /* TypeLiteral */: - case 188 /* ArrayType */: - case 189 /* TupleType */: - case 192 /* UnionType */: - case 193 /* IntersectionType */: - case 196 /* ParenthesizedType */: - case 190 /* OptionalType */: - case 191 /* RestType */: - case 197 /* ThisType */: - case 198 /* TypeOperator */: - case 194 /* ConditionalType */: - case 195 /* InferType */: - case 203 /* TemplateLiteralType */: - case 205 /* ImportType */: - case 202 /* NamedTupleMember */: - case 328 /* JSDocAugmentsTag */: - case 329 /* JSDocImplementsTag */: - case 346 /* JSDocTypedefTag */: - case 338 /* JSDocCallbackTag */: - case 340 /* JSDocEnumTag */: - case 345 /* JSDocTemplateTag */: - case 344 /* JSDocTypeTag */: - case 324 /* JSDocLink */: - case 325 /* JSDocLinkCode */: - case 326 /* JSDocLinkPlain */: - case 341 /* JSDocParameterTag */: - case 348 /* JSDocPropertyTag */: - case 317 /* JSDocFunctionType */: - case 315 /* JSDocNonNullableType */: - case 314 /* JSDocNullableType */: - case 312 /* JSDocAllType */: - case 313 /* JSDocUnknownType */: - case 322 /* JSDocTypeLiteral */: - case 318 /* JSDocVariadicType */: - case 309 /* JSDocTypeExpression */: - case 333 /* JSDocPublicTag */: - case 335 /* JSDocProtectedTag */: - case 334 /* JSDocPrivateTag */: - case 350 /* JSDocSatisfiesTag */: - case 343 /* JSDocThisTag */: - case 199 /* IndexedAccessType */: - case 200 /* MappedType */: - case 262 /* FunctionDeclaration */: - case 241 /* Block */: - case 268 /* ModuleBlock */: - case 243 /* VariableStatement */: - case 244 /* ExpressionStatement */: - case 245 /* IfStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 251 /* ContinueStatement */: - case 252 /* BreakStatement */: - case 253 /* ReturnStatement */: - case 254 /* WithStatement */: - case 255 /* SwitchStatement */: - case 256 /* LabeledStatement */: - case 257 /* ThrowStatement */: - case 258 /* TryStatement */: - case 260 /* VariableDeclaration */: - case 208 /* BindingElement */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 266 /* EnumDeclaration */: - case 267 /* ModuleDeclaration */: - case 272 /* ImportDeclaration */: - case 271 /* ImportEqualsDeclaration */: - case 278 /* ExportDeclaration */: - case 277 /* ExportAssignment */: - case 242 /* EmptyStatement */: - case 259 /* DebuggerStatement */: - case 282 /* MissingDeclaration */: + case 169 /* TypeParameter */: + case 170 /* Parameter */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 186 /* ConstructorType */: + case 185 /* FunctionType */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 182 /* IndexSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 176 /* ClassStaticBlockDeclaration */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 184 /* TypeReference */: + case 183 /* TypePredicate */: + case 187 /* TypeQuery */: + case 188 /* TypeLiteral */: + case 189 /* ArrayType */: + case 190 /* TupleType */: + case 193 /* UnionType */: + case 194 /* IntersectionType */: + case 197 /* ParenthesizedType */: + case 191 /* OptionalType */: + case 192 /* RestType */: + case 198 /* ThisType */: + case 199 /* TypeOperator */: + case 195 /* ConditionalType */: + case 196 /* InferType */: + case 204 /* TemplateLiteralType */: + case 206 /* ImportType */: + case 203 /* NamedTupleMember */: + case 329 /* JSDocAugmentsTag */: + case 330 /* JSDocImplementsTag */: + case 347 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: + case 341 /* JSDocEnumTag */: + case 346 /* JSDocTemplateTag */: + case 345 /* JSDocTypeTag */: + case 325 /* JSDocLink */: + case 326 /* JSDocLinkCode */: + case 327 /* JSDocLinkPlain */: + case 342 /* JSDocParameterTag */: + case 349 /* JSDocPropertyTag */: + case 318 /* JSDocFunctionType */: + case 316 /* JSDocNonNullableType */: + case 315 /* JSDocNullableType */: + case 313 /* JSDocAllType */: + case 314 /* JSDocUnknownType */: + case 323 /* JSDocTypeLiteral */: + case 319 /* JSDocVariadicType */: + case 310 /* JSDocTypeExpression */: + case 334 /* JSDocPublicTag */: + case 336 /* JSDocProtectedTag */: + case 335 /* JSDocPrivateTag */: + case 351 /* JSDocSatisfiesTag */: + case 344 /* JSDocThisTag */: + case 200 /* IndexedAccessType */: + case 201 /* MappedType */: + case 263 /* FunctionDeclaration */: + case 242 /* Block */: + case 269 /* ModuleBlock */: + case 244 /* VariableStatement */: + case 245 /* ExpressionStatement */: + case 246 /* IfStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 252 /* ContinueStatement */: + case 253 /* BreakStatement */: + case 254 /* ReturnStatement */: + case 255 /* WithStatement */: + case 256 /* SwitchStatement */: + case 257 /* LabeledStatement */: + case 258 /* ThrowStatement */: + case 259 /* TryStatement */: + case 261 /* VariableDeclaration */: + case 209 /* BindingElement */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 267 /* EnumDeclaration */: + case 268 /* ModuleDeclaration */: + case 273 /* ImportDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 279 /* ExportDeclaration */: + case 278 /* ExportAssignment */: + case 243 /* EmptyStatement */: + case 260 /* DebuggerStatement */: + case 283 /* MissingDeclaration */: return true; } return false; @@ -23380,7 +23425,7 @@ function createEvaluator({ evaluateElementAccessExpression, evaluateEntityNameEx let hasExternalReferences = false; expr = skipParentheses(expr); switch (expr.kind) { - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: const result = evaluate(expr.operand, location); resolvedOtherFiles = result.resolvedOtherFiles; hasExternalReferences = result.hasExternalReferences; @@ -23395,7 +23440,7 @@ function createEvaluator({ evaluateElementAccessExpression, evaluateEntityNameEx } } break; - case 226 /* BinaryExpression */: { + case 227 /* BinaryExpression */: { const left = evaluate(expr.left, location); const right = evaluate(expr.right, location); isSyntacticallyString = (left.isSyntacticallyString || right.isSyntacticallyString) && expr.operatorToken.kind === 40 /* PlusToken */; @@ -23445,18 +23490,18 @@ function createEvaluator({ evaluateElementAccessExpression, evaluateEntityNameEx /*isSyntacticallyString*/ true ); - case 228 /* TemplateExpression */: + case 229 /* TemplateExpression */: return evaluateTemplateExpression(expr, location); case 9 /* NumericLiteral */: return evaluatorResult(+expr.text); case 80 /* Identifier */: return evaluateEntityNameExpression(expr, location); - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: if (isEntityNameExpression(expr)) { return evaluateEntityNameExpression(expr, location); } break; - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return evaluateElementAccessExpression(expr, location); } return evaluatorResult( @@ -23502,7 +23547,7 @@ function isConstAssertion(location) { function findConstructorDeclaration(node) { const members = node.members; for (const member of members) { - if (member.kind === 176 /* Constructor */ && nodeIsPresent(member.body)) { + if (member.kind === 177 /* Constructor */ && nodeIsPresent(member.body)) { return member; } } @@ -23549,19 +23594,19 @@ function createNameResolver({ if (result = lookup(location.locals, name, meaning)) { let useResult = true; if (isFunctionLike(location) && lastLocation && lastLocation !== location.body) { - if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 320 /* JSDoc */) { + if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 321 /* JSDoc */) { useResult = result.flags & 262144 /* TypeParameter */ ? !!(lastLocation.flags & 16 /* Synthesized */) || // Synthetic fake scopes are added for signatures so type parameters are accessible from them - lastLocation === location.type || lastLocation.kind === 169 /* Parameter */ || lastLocation.kind === 341 /* JSDocParameterTag */ || lastLocation.kind === 342 /* JSDocReturnTag */ || lastLocation.kind === 168 /* TypeParameter */ : false; + lastLocation === location.type || lastLocation.kind === 170 /* Parameter */ || lastLocation.kind === 342 /* JSDocParameterTag */ || lastLocation.kind === 343 /* JSDocReturnTag */ || lastLocation.kind === 169 /* TypeParameter */ : false; } if (meaning & result.flags & 3 /* Variable */) { if (useOuterVariableScopeInParameter(result, location, lastLocation)) { useResult = false; } else if (result.flags & 1 /* FunctionScopedVariable */) { - useResult = lastLocation.kind === 169 /* Parameter */ || !!(lastLocation.flags & 16 /* Synthesized */) || // Synthetic fake scopes are added for signatures so parameters are accessible from them + useResult = lastLocation.kind === 170 /* Parameter */ || !!(lastLocation.flags & 16 /* Synthesized */) || // Synthetic fake scopes are added for signatures so parameters are accessible from them lastLocation === location.type && !!findAncestor(result.valueDeclaration, isParameter); } } - } else if (location.kind === 194 /* ConditionalType */) { + } else if (location.kind === 195 /* ConditionalType */) { useResult = lastLocation === location.trueType; } if (useResult) { @@ -23573,12 +23618,12 @@ function createNameResolver({ } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 307 /* SourceFile */: + case 308 /* SourceFile */: if (!isExternalOrCommonJsModule(location)) break; // falls through - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: const moduleExports = ((_a = getSymbolOfDeclaration(location)) == null ? void 0 : _a.exports) || emptySymbols; - if (location.kind === 307 /* SourceFile */ || isModuleDeclaration(location) && location.flags & 33554432 /* Ambient */ && !isGlobalScopeAugmentation(location)) { + if (location.kind === 308 /* SourceFile */ || isModuleDeclaration(location) && location.flags & 33554432 /* Ambient */ && !isGlobalScopeAugmentation(location)) { if (result = moduleExports.get("default" /* Default */)) { const localSymbol = getLocalSymbolForExportDefault(result); if (localSymbol && result.flags & meaning && localSymbol.escapedName === name) { @@ -23587,7 +23632,7 @@ function createNameResolver({ result = void 0; } const moduleExport = moduleExports.get(name); - if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && (getDeclarationOfKind(moduleExport, 281 /* ExportSpecifier */) || getDeclarationOfKind(moduleExport, 280 /* NamespaceExport */))) { + if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && (getDeclarationOfKind(moduleExport, 282 /* ExportSpecifier */) || getDeclarationOfKind(moduleExport, 281 /* NamespaceExport */))) { break; } } @@ -23599,7 +23644,7 @@ function createNameResolver({ } } break; - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: if (result = lookup(((_c = getSymbolOfDeclaration(location)) == null ? void 0 : _c.exports) || emptySymbols, name, meaning & 8 /* EnumMember */)) { if (nameNotFoundMessage && getIsolatedModules(compilerOptions) && !(location.flags & 33554432 /* Ambient */) && getSourceFileOfNode(location) !== getSourceFileOfNode(result.valueDeclaration)) { error2( @@ -23613,7 +23658,7 @@ function createNameResolver({ break loop; } break; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: if (!isStatic(location)) { const ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { @@ -23624,9 +23669,9 @@ function createNameResolver({ } } break; - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: if (result = lookup(getSymbolOfDeclaration(location).members || emptySymbols, name, meaning & 788968 /* Type */)) { if (!isTypeParameterSymbolDeclaredInContainer(result, location)) { result = void 0; @@ -23648,7 +23693,7 @@ function createNameResolver({ } } break; - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: if (lastLocation === location.expression && location.parent.token === 96 /* ExtendsKeyword */) { const container = location.parent.parent; if (isClassLike(container) && (result = lookup(getSymbolOfDeclaration(container).members, name, meaning & 788968 /* Type */))) { @@ -23667,9 +23712,9 @@ function createNameResolver({ // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (isClassLike(grandparent) || grandparent.kind === 264 /* InterfaceDeclaration */) { + if (isClassLike(grandparent) || grandparent.kind === 265 /* InterfaceDeclaration */) { if (result = lookup(getSymbolOfDeclaration(grandparent).members, name, meaning & 788968 /* Type */)) { if (nameNotFoundMessage) { error2(originalLocation, Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -23678,22 +23723,22 @@ function createNameResolver({ } } break; - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: if (getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */) { break; } // falls through - case 174 /* MethodDeclaration */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 262 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 263 /* FunctionDeclaration */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -23706,38 +23751,38 @@ function createNameResolver({ } } break; - case 170 /* Decorator */: - if (location.parent && location.parent.kind === 169 /* Parameter */) { + case 171 /* Decorator */: + if (location.parent && location.parent.kind === 170 /* Parameter */) { location = location.parent; } - if (location.parent && (isClassElement(location.parent) || location.parent.kind === 263 /* ClassDeclaration */)) { + if (location.parent && (isClassElement(location.parent) || location.parent.kind === 264 /* ClassDeclaration */)) { location = location.parent; } break; - case 346 /* JSDocTypedefTag */: - case 338 /* JSDocCallbackTag */: - case 340 /* JSDocEnumTag */: - case 351 /* JSDocImportTag */: + case 347 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: + case 341 /* JSDocEnumTag */: + case 352 /* JSDocImportTag */: const root = getJSDocRoot(location); if (root) { location = root.parent; } break; - case 169 /* Parameter */: + case 170 /* Parameter */: if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && isBindingPattern(lastLocation))) { if (!associatedDeclarationForContainingInitializerOrBindingName) { associatedDeclarationForContainingInitializerOrBindingName = location; } } break; - case 208 /* BindingElement */: + case 209 /* BindingElement */: if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && isBindingPattern(lastLocation))) { if (isPartOfParameterDeclaration(location) && !associatedDeclarationForContainingInitializerOrBindingName) { associatedDeclarationForContainingInitializerOrBindingName = location; } } break; - case 195 /* InferType */: + case 196 /* InferType */: if (meaning & 262144 /* TypeParameter */) { const parameterName = location.typeParameter.name; if (parameterName && name === parameterName.escapedText) { @@ -23746,7 +23791,7 @@ function createNameResolver({ } } break; - case 281 /* ExportSpecifier */: + case 282 /* ExportSpecifier */: if (lastLocation && lastLocation === location.propertyName && location.parent.parent.moduleSpecifier) { location = location.parent.parent.parent; } @@ -23814,17 +23859,17 @@ function createNameResolver({ } function requiresScopeChangeWorker(node) { switch (node.kind) { - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: - case 176 /* Constructor */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 177 /* Constructor */: return false; - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 303 /* PropertyAssignment */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 304 /* PropertyAssignment */: return requiresScopeChangeWorker(node.name); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: if (hasStaticModifier(node)) { return !emitStandardClassFields; } @@ -23842,8 +23887,8 @@ function createNameResolver({ } } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 219 /* ArrowFunction */ && location.kind !== 218 /* FunctionExpression */) { - return isTypeQueryNode(location) || (isFunctionLikeDeclaration(location) || location.kind === 172 /* PropertyDeclaration */ && !isStatic(location)) && (!lastLocation || lastLocation !== location.name); + if (location.kind !== 220 /* ArrowFunction */ && location.kind !== 219 /* FunctionExpression */) { + return isTypeQueryNode(location) || (isFunctionLikeDeclaration(location) || location.kind === 173 /* PropertyDeclaration */ && !isStatic(location)) && (!lastLocation || lastLocation !== location.name); } if (lastLocation && lastLocation === location.name) { return false; @@ -23855,14 +23900,14 @@ function createNameResolver({ } function isSelfReferenceLocation(node, lastLocation) { switch (node.kind) { - case 169 /* Parameter */: + case 170 /* Parameter */: return !!lastLocation && lastLocation === node.name; - case 262 /* FunctionDeclaration */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 267 /* ModuleDeclaration */: + case 263 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 268 /* ModuleDeclaration */: return true; default: return false; @@ -23871,7 +23916,7 @@ function createNameResolver({ function isTypeParameterSymbolDeclaredInContainer(symbol, container) { if (symbol.declarations) { for (const decl of symbol.declarations) { - if (decl.kind === 168 /* TypeParameter */) { + if (decl.kind === 169 /* TypeParameter */) { const parent2 = isJSDocTemplateTag(decl.parent) ? getJSDocHost(decl.parent) : decl.parent; if (parent2 === container) { return !(isJSDocTemplateTag(decl.parent) && find(decl.parent.parent.tags, isJSDocTypeAlias)); @@ -23893,7 +23938,7 @@ function isPrimitiveLiteralValue(node, includeBigInt = true) { return true; case 10 /* BigIntLiteral */: return includeBigInt; - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: if (node.operator === 41 /* MinusToken */) { return isNumericLiteral(node.operand) || includeBigInt && isBigIntLiteral(node.operand); } @@ -23907,7 +23952,7 @@ function isPrimitiveLiteralValue(node, includeBigInt = true) { } } function unwrapParenthesizedExpression(o) { - while (o.kind === 217 /* ParenthesizedExpression */) { + while (o.kind === 218 /* ParenthesizedExpression */) { o = o.expression; } return o; @@ -23915,19 +23960,19 @@ function unwrapParenthesizedExpression(o) { function hasInferredType(node) { Debug.type(node); switch (node.kind) { - case 169 /* Parameter */: - case 171 /* PropertySignature */: - case 172 /* PropertyDeclaration */: - case 208 /* BindingElement */: - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: - case 226 /* BinaryExpression */: - case 260 /* VariableDeclaration */: - case 277 /* ExportAssignment */: - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: - case 341 /* JSDocParameterTag */: - case 348 /* JSDocPropertyTag */: + case 170 /* Parameter */: + case 172 /* PropertySignature */: + case 173 /* PropertyDeclaration */: + case 209 /* BindingElement */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: + case 227 /* BinaryExpression */: + case 261 /* VariableDeclaration */: + case 278 /* ExportAssignment */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: + case 342 /* JSDocParameterTag */: + case 349 /* JSDocPropertyTag */: return true; default: assertType(node); @@ -24041,7 +24086,7 @@ function getNodeAtPosition(sourceFile, position, includeJSDoc) { }; while (true) { const child = isJavaScriptFile && includeJSDoc && hasJSDocNodes(current) && forEach(current.jsDoc, getContainingChild) || forEachChild(current, getContainingChild); - if (!child) { + if (!child || isMetaProperty(child)) { return current; } current = child; @@ -24062,7 +24107,7 @@ function forEachResolvedProjectReference(resolvedProjectReferences, cb) { /*projectReferences*/ void 0, resolvedProjectReferences, - (resolvedRef, parent2) => resolvedRef && cb(resolvedRef, parent2) + (resolvedRef) => resolvedRef && cb(resolvedRef) ); } function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) { @@ -24108,6 +24153,82 @@ function getOptionsSyntaxByValue(optionsObject, name, value) { function forEachOptionsSyntaxByName(optionsObject, name, callback) { return forEachPropertyAssignment(optionsObject, name, callback); } +function getSynthesizedDeepClone(node, includeTrivia = true) { + const clone2 = node && getSynthesizedDeepCloneWorker(node); + if (clone2 && !includeTrivia) suppressLeadingAndTrailingTrivia(clone2); + return setParentRecursive( + clone2, + /*incremental*/ + false + ); +} +function getSynthesizedDeepCloneWithReplacements(node, includeTrivia, replaceNode) { + let clone2 = replaceNode(node); + if (clone2) { + setOriginalNode(clone2, node); + } else { + clone2 = getSynthesizedDeepCloneWorker(node, replaceNode); + } + if (clone2 && !includeTrivia) suppressLeadingAndTrailingTrivia(clone2); + return clone2; +} +function getSynthesizedDeepCloneWorker(node, replaceNode) { + const nodeClone = replaceNode ? (n) => getSynthesizedDeepCloneWithReplacements( + n, + /*includeTrivia*/ + true, + replaceNode + ) : getSynthesizedDeepClone; + const nodesClone = replaceNode ? (ns) => ns && getSynthesizedDeepClonesWithReplacements( + ns, + /*includeTrivia*/ + true, + replaceNode + ) : (ns) => ns && getSynthesizedDeepClones(ns); + const visited = visitEachChild( + node, + nodeClone, + /*context*/ + void 0, + nodesClone, + nodeClone + ); + if (visited === node) { + const clone2 = isStringLiteral(node) ? setOriginalNode(factory.createStringLiteralFromNode(node), node) : isNumericLiteral(node) ? setOriginalNode(factory.createNumericLiteral(node.text, node.numericLiteralFlags), node) : factory.cloneNode(node); + return setTextRange(clone2, node); + } + visited.parent = void 0; + return visited; +} +function getSynthesizedDeepClones(nodes, includeTrivia = true) { + if (nodes) { + const cloned = factory.createNodeArray(nodes.map((n) => getSynthesizedDeepClone(n, includeTrivia)), nodes.hasTrailingComma); + setTextRange(cloned, nodes); + return cloned; + } + return nodes; +} +function getSynthesizedDeepClonesWithReplacements(nodes, includeTrivia, replaceNode) { + return factory.createNodeArray(nodes.map((n) => getSynthesizedDeepCloneWithReplacements(n, includeTrivia, replaceNode)), nodes.hasTrailingComma); +} +function suppressLeadingAndTrailingTrivia(node) { + suppressLeadingTrivia(node); + suppressTrailingTrivia(node); +} +function suppressLeadingTrivia(node) { + addEmitFlagsRecursively(node, 1024 /* NoLeadingComments */, getFirstChild); +} +function suppressTrailingTrivia(node) { + addEmitFlagsRecursively(node, 2048 /* NoTrailingComments */, getLastChild); +} +function addEmitFlagsRecursively(node, flag, getChild) { + addEmitFlags(node, flag); + const child = getChild(node); + if (child) addEmitFlagsRecursively(child, flag, getChild); +} +function getFirstChild(node) { + return forEachChild(node, (child) => child); +} // src/compiler/factory/baseNodeFactory.ts function createBaseNodeFactory() { @@ -24230,16 +24351,16 @@ function createParenthesizerRules(factory2) { return parenthesizerRule; } function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { - const binaryOperatorPrecedence = getOperatorPrecedence(226 /* BinaryExpression */, binaryOperator); - const binaryOperatorAssociativity = getOperatorAssociativity(226 /* BinaryExpression */, binaryOperator); + const binaryOperatorPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, binaryOperator); + const binaryOperatorAssociativity = getOperatorAssociativity(227 /* BinaryExpression */, binaryOperator); const emittedOperand = skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 219 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) { + if (!isLeftSideOfBinary && operand.kind === 220 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) { return true; } const operandPrecedence = getExpressionPrecedence(emittedOperand); switch (compareValues(operandPrecedence, binaryOperatorPrecedence)) { case -1 /* LessThan */: - if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ && operand.kind === 229 /* YieldExpression */) { + if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ && operand.kind === 230 /* YieldExpression */) { return false; } return true; @@ -24273,7 +24394,7 @@ function createParenthesizerRules(factory2) { if (isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 226 /* BinaryExpression */ && node.operatorToken.kind === 40 /* PlusToken */) { + if (node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 40 /* PlusToken */) { if (node.cachedLiteralKind !== void 0) { return node.cachedLiteralKind; } @@ -24286,7 +24407,7 @@ function createParenthesizerRules(factory2) { } function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { const skipped = skipPartiallyEmittedExpressions(operand); - if (skipped.kind === 217 /* ParenthesizedExpression */) { + if (skipped.kind === 218 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) ? factory2.createParenthesizedExpression(operand) : operand; @@ -24312,7 +24433,7 @@ function createParenthesizerRules(factory2) { return isCommaSequence(expression) ? factory2.createParenthesizedExpression(expression) : expression; } function parenthesizeConditionOfConditionalExpression(condition) { - const conditionalPrecedence = getOperatorPrecedence(227 /* ConditionalExpression */, 58 /* QuestionToken */); + const conditionalPrecedence = getOperatorPrecedence(228 /* ConditionalExpression */, 58 /* QuestionToken */); const emittedCondition = skipPartiallyEmittedExpressions(condition); const conditionPrecedence = getExpressionPrecedence(emittedCondition); if (compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) { @@ -24333,8 +24454,8 @@ function createParenthesizerRules(factory2) { /*stopAtCallExpressions*/ false ).kind) { - case 231 /* ClassExpression */: - case 218 /* FunctionExpression */: + case 232 /* ClassExpression */: + case 219 /* FunctionExpression */: needsParens = true; } } @@ -24347,16 +24468,16 @@ function createParenthesizerRules(factory2) { true ); switch (leftmostExpr.kind) { - case 213 /* CallExpression */: + case 214 /* CallExpression */: return factory2.createParenthesizedExpression(expression); - case 214 /* NewExpression */: + case 215 /* NewExpression */: return !leftmostExpr.arguments ? factory2.createParenthesizedExpression(expression) : expression; } return parenthesizeLeftSideOfAccess(expression); } function parenthesizeLeftSideOfAccess(expression, optionalChain) { const emittedExpression = skipPartiallyEmittedExpressions(expression); - if (isLeftHandSideExpression(emittedExpression) && (emittedExpression.kind !== 214 /* NewExpression */ || emittedExpression.arguments) && (optionalChain || !isOptionalChain(emittedExpression))) { + if (isLeftHandSideExpression(emittedExpression) && (emittedExpression.kind !== 215 /* NewExpression */ || emittedExpression.arguments) && (optionalChain || !isOptionalChain(emittedExpression))) { return expression; } return setTextRange(factory2.createParenthesizedExpression(expression), expression); @@ -24374,7 +24495,7 @@ function createParenthesizerRules(factory2) { function parenthesizeExpressionForDisallowedComma(expression) { const emittedExpression = skipPartiallyEmittedExpressions(expression); const expressionPrecedence = getExpressionPrecedence(emittedExpression); - const commaPrecedence = getOperatorPrecedence(226 /* BinaryExpression */, 28 /* CommaToken */); + const commaPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, 28 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression : setTextRange(factory2.createParenthesizedExpression(expression), expression); } function parenthesizeExpressionOfExpressionStatement(expression) { @@ -24382,7 +24503,7 @@ function createParenthesizerRules(factory2) { if (isCallExpression(emittedExpression)) { const callee = emittedExpression.expression; const kind = skipPartiallyEmittedExpressions(callee).kind; - if (kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */) { + if (kind === 219 /* FunctionExpression */ || kind === 220 /* ArrowFunction */) { const updated = factory2.updateCallExpression( emittedExpression, setTextRange(factory2.createParenthesizedExpression(callee), callee), @@ -24397,7 +24518,7 @@ function createParenthesizerRules(factory2) { /*stopAtCallExpressions*/ false ).kind; - if (leftmostExpressionKind === 210 /* ObjectLiteralExpression */ || leftmostExpressionKind === 218 /* FunctionExpression */) { + if (leftmostExpressionKind === 211 /* ObjectLiteralExpression */ || leftmostExpressionKind === 219 /* FunctionExpression */) { return setTextRange(factory2.createParenthesizedExpression(expression), expression); } return expression; @@ -24407,32 +24528,32 @@ function createParenthesizerRules(factory2) { body, /*stopAtCallExpressions*/ false - ).kind === 210 /* ObjectLiteralExpression */)) { + ).kind === 211 /* ObjectLiteralExpression */)) { return setTextRange(factory2.createParenthesizedExpression(body), body); } return body; } function parenthesizeCheckTypeOfConditionalType(checkType) { switch (checkType.kind) { - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 194 /* ConditionalType */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 195 /* ConditionalType */: return factory2.createParenthesizedType(checkType); } return checkType; } function parenthesizeExtendsTypeOfConditionalType(extendsType) { switch (extendsType.kind) { - case 194 /* ConditionalType */: + case 195 /* ConditionalType */: return factory2.createParenthesizedType(extendsType); } return extendsType; } function parenthesizeConstituentTypeOfUnionType(type) { switch (type.kind) { - case 192 /* UnionType */: + case 193 /* UnionType */: // Not strictly necessary, but a union containing a union should have been flattened - case 193 /* IntersectionType */: + case 194 /* IntersectionType */: return factory2.createParenthesizedType(type); } return parenthesizeCheckTypeOfConditionalType(type); @@ -24442,8 +24563,8 @@ function createParenthesizerRules(factory2) { } function parenthesizeConstituentTypeOfIntersectionType(type) { switch (type.kind) { - case 192 /* UnionType */: - case 193 /* IntersectionType */: + case 193 /* UnionType */: + case 194 /* IntersectionType */: return factory2.createParenthesizedType(type); } return parenthesizeConstituentTypeOfUnionType(type); @@ -24453,23 +24574,23 @@ function createParenthesizerRules(factory2) { } function parenthesizeOperandOfTypeOperator(type) { switch (type.kind) { - case 193 /* IntersectionType */: + case 194 /* IntersectionType */: return factory2.createParenthesizedType(type); } return parenthesizeConstituentTypeOfIntersectionType(type); } function parenthesizeOperandOfReadonlyTypeOperator(type) { switch (type.kind) { - case 198 /* TypeOperator */: + case 199 /* TypeOperator */: return factory2.createParenthesizedType(type); } return parenthesizeOperandOfTypeOperator(type); } function parenthesizeNonArrayTypeOfPostfixType(type) { switch (type.kind) { - case 195 /* InferType */: - case 198 /* TypeOperator */: - case 186 /* TypeQuery */: + case 196 /* InferType */: + case 199 /* TypeOperator */: + case 187 /* TypeQuery */: return factory2.createParenthesizedType(type); } return parenthesizeOperandOfTypeOperator(type); @@ -24638,11 +24759,11 @@ function createNodeConverters(factory2) { } function convertToAssignmentPattern(node) { switch (node.kind) { - case 207 /* ArrayBindingPattern */: - case 209 /* ArrayLiteralExpression */: + case 208 /* ArrayBindingPattern */: + case 210 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 206 /* ObjectBindingPattern */: - case 210 /* ObjectLiteralExpression */: + case 207 /* ObjectBindingPattern */: + case 211 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -25005,40 +25126,40 @@ function createNodeFactory(flags, baseFactory2) { updateExternalModuleReference, // lazily load factory members for JSDoc types with similar structure get createJSDocAllType() { - return getJSDocPrimaryTypeCreateFunction(312 /* JSDocAllType */); + return getJSDocPrimaryTypeCreateFunction(313 /* JSDocAllType */); }, get createJSDocUnknownType() { - return getJSDocPrimaryTypeCreateFunction(313 /* JSDocUnknownType */); + return getJSDocPrimaryTypeCreateFunction(314 /* JSDocUnknownType */); }, get createJSDocNonNullableType() { - return getJSDocPrePostfixUnaryTypeCreateFunction(315 /* JSDocNonNullableType */); + return getJSDocPrePostfixUnaryTypeCreateFunction(316 /* JSDocNonNullableType */); }, get updateJSDocNonNullableType() { - return getJSDocPrePostfixUnaryTypeUpdateFunction(315 /* JSDocNonNullableType */); + return getJSDocPrePostfixUnaryTypeUpdateFunction(316 /* JSDocNonNullableType */); }, get createJSDocNullableType() { - return getJSDocPrePostfixUnaryTypeCreateFunction(314 /* JSDocNullableType */); + return getJSDocPrePostfixUnaryTypeCreateFunction(315 /* JSDocNullableType */); }, get updateJSDocNullableType() { - return getJSDocPrePostfixUnaryTypeUpdateFunction(314 /* JSDocNullableType */); + return getJSDocPrePostfixUnaryTypeUpdateFunction(315 /* JSDocNullableType */); }, get createJSDocOptionalType() { - return getJSDocUnaryTypeCreateFunction(316 /* JSDocOptionalType */); + return getJSDocUnaryTypeCreateFunction(317 /* JSDocOptionalType */); }, get updateJSDocOptionalType() { - return getJSDocUnaryTypeUpdateFunction(316 /* JSDocOptionalType */); + return getJSDocUnaryTypeUpdateFunction(317 /* JSDocOptionalType */); }, get createJSDocVariadicType() { - return getJSDocUnaryTypeCreateFunction(318 /* JSDocVariadicType */); + return getJSDocUnaryTypeCreateFunction(319 /* JSDocVariadicType */); }, get updateJSDocVariadicType() { - return getJSDocUnaryTypeUpdateFunction(318 /* JSDocVariadicType */); + return getJSDocUnaryTypeUpdateFunction(319 /* JSDocVariadicType */); }, get createJSDocNamepathType() { - return getJSDocUnaryTypeCreateFunction(319 /* JSDocNamepathType */); + return getJSDocUnaryTypeCreateFunction(320 /* JSDocNamepathType */); }, get updateJSDocNamepathType() { - return getJSDocUnaryTypeUpdateFunction(319 /* JSDocNamepathType */); + return getJSDocUnaryTypeUpdateFunction(320 /* JSDocNamepathType */); }, createJSDocFunctionType, updateJSDocFunctionType, @@ -25080,82 +25201,82 @@ function createNodeFactory(flags, baseFactory2) { updateJSDocLinkPlain, // lazily load factory members for JSDoc tags with similar structure get createJSDocTypeTag() { - return getJSDocTypeLikeTagCreateFunction(344 /* JSDocTypeTag */); + return getJSDocTypeLikeTagCreateFunction(345 /* JSDocTypeTag */); }, get updateJSDocTypeTag() { - return getJSDocTypeLikeTagUpdateFunction(344 /* JSDocTypeTag */); + return getJSDocTypeLikeTagUpdateFunction(345 /* JSDocTypeTag */); }, get createJSDocReturnTag() { - return getJSDocTypeLikeTagCreateFunction(342 /* JSDocReturnTag */); + return getJSDocTypeLikeTagCreateFunction(343 /* JSDocReturnTag */); }, get updateJSDocReturnTag() { - return getJSDocTypeLikeTagUpdateFunction(342 /* JSDocReturnTag */); + return getJSDocTypeLikeTagUpdateFunction(343 /* JSDocReturnTag */); }, get createJSDocThisTag() { - return getJSDocTypeLikeTagCreateFunction(343 /* JSDocThisTag */); + return getJSDocTypeLikeTagCreateFunction(344 /* JSDocThisTag */); }, get updateJSDocThisTag() { - return getJSDocTypeLikeTagUpdateFunction(343 /* JSDocThisTag */); + return getJSDocTypeLikeTagUpdateFunction(344 /* JSDocThisTag */); }, get createJSDocAuthorTag() { - return getJSDocSimpleTagCreateFunction(330 /* JSDocAuthorTag */); + return getJSDocSimpleTagCreateFunction(331 /* JSDocAuthorTag */); }, get updateJSDocAuthorTag() { - return getJSDocSimpleTagUpdateFunction(330 /* JSDocAuthorTag */); + return getJSDocSimpleTagUpdateFunction(331 /* JSDocAuthorTag */); }, get createJSDocClassTag() { - return getJSDocSimpleTagCreateFunction(332 /* JSDocClassTag */); + return getJSDocSimpleTagCreateFunction(333 /* JSDocClassTag */); }, get updateJSDocClassTag() { - return getJSDocSimpleTagUpdateFunction(332 /* JSDocClassTag */); + return getJSDocSimpleTagUpdateFunction(333 /* JSDocClassTag */); }, get createJSDocPublicTag() { - return getJSDocSimpleTagCreateFunction(333 /* JSDocPublicTag */); + return getJSDocSimpleTagCreateFunction(334 /* JSDocPublicTag */); }, get updateJSDocPublicTag() { - return getJSDocSimpleTagUpdateFunction(333 /* JSDocPublicTag */); + return getJSDocSimpleTagUpdateFunction(334 /* JSDocPublicTag */); }, get createJSDocPrivateTag() { - return getJSDocSimpleTagCreateFunction(334 /* JSDocPrivateTag */); + return getJSDocSimpleTagCreateFunction(335 /* JSDocPrivateTag */); }, get updateJSDocPrivateTag() { - return getJSDocSimpleTagUpdateFunction(334 /* JSDocPrivateTag */); + return getJSDocSimpleTagUpdateFunction(335 /* JSDocPrivateTag */); }, get createJSDocProtectedTag() { - return getJSDocSimpleTagCreateFunction(335 /* JSDocProtectedTag */); + return getJSDocSimpleTagCreateFunction(336 /* JSDocProtectedTag */); }, get updateJSDocProtectedTag() { - return getJSDocSimpleTagUpdateFunction(335 /* JSDocProtectedTag */); + return getJSDocSimpleTagUpdateFunction(336 /* JSDocProtectedTag */); }, get createJSDocReadonlyTag() { - return getJSDocSimpleTagCreateFunction(336 /* JSDocReadonlyTag */); + return getJSDocSimpleTagCreateFunction(337 /* JSDocReadonlyTag */); }, get updateJSDocReadonlyTag() { - return getJSDocSimpleTagUpdateFunction(336 /* JSDocReadonlyTag */); + return getJSDocSimpleTagUpdateFunction(337 /* JSDocReadonlyTag */); }, get createJSDocOverrideTag() { - return getJSDocSimpleTagCreateFunction(337 /* JSDocOverrideTag */); + return getJSDocSimpleTagCreateFunction(338 /* JSDocOverrideTag */); }, get updateJSDocOverrideTag() { - return getJSDocSimpleTagUpdateFunction(337 /* JSDocOverrideTag */); + return getJSDocSimpleTagUpdateFunction(338 /* JSDocOverrideTag */); }, get createJSDocDeprecatedTag() { - return getJSDocSimpleTagCreateFunction(331 /* JSDocDeprecatedTag */); + return getJSDocSimpleTagCreateFunction(332 /* JSDocDeprecatedTag */); }, get updateJSDocDeprecatedTag() { - return getJSDocSimpleTagUpdateFunction(331 /* JSDocDeprecatedTag */); + return getJSDocSimpleTagUpdateFunction(332 /* JSDocDeprecatedTag */); }, get createJSDocThrowsTag() { - return getJSDocTypeLikeTagCreateFunction(349 /* JSDocThrowsTag */); + return getJSDocTypeLikeTagCreateFunction(350 /* JSDocThrowsTag */); }, get updateJSDocThrowsTag() { - return getJSDocTypeLikeTagUpdateFunction(349 /* JSDocThrowsTag */); + return getJSDocTypeLikeTagUpdateFunction(350 /* JSDocThrowsTag */); }, get createJSDocSatisfiesTag() { - return getJSDocTypeLikeTagCreateFunction(350 /* JSDocSatisfiesTag */); + return getJSDocTypeLikeTagCreateFunction(351 /* JSDocSatisfiesTag */); }, get updateJSDocSatisfiesTag() { - return getJSDocTypeLikeTagUpdateFunction(350 /* JSDocSatisfiesTag */); + return getJSDocTypeLikeTagUpdateFunction(351 /* JSDocSatisfiesTag */); }, createJSDocEnumTag, updateJSDocEnumTag, @@ -25610,7 +25731,7 @@ function createNodeFactory(flags, baseFactory2) { return baseFactory2.createBaseTokenNode(kind); } function createToken(token) { - Debug.assert(token >= 0 /* FirstToken */ && token <= 165 /* LastToken */, "Invalid token"); + Debug.assert(token >= 0 /* FirstToken */ && token <= 166 /* LastToken */, "Invalid token"); Debug.assert(token <= 15 /* FirstTemplateToken */ || token >= 18 /* LastTemplateToken */, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."); Debug.assert(token <= 9 /* FirstLiteralToken */ || token >= 15 /* LastLiteralToken */, "Invalid token. Use 'createLiteralLikeNode' to create literals."); Debug.assert(token !== 80 /* Identifier */, "Invalid token. Use 'createIdentifier' to create identifiers"); @@ -25704,7 +25825,7 @@ function createNodeFactory(flags, baseFactory2) { return result.length ? result : void 0; } function createQualifiedName(left, right) { - const node = createBaseNode(166 /* QualifiedName */); + const node = createBaseNode(167 /* QualifiedName */); node.left = left; node.right = asName(right); node.transformFlags |= propagateChildFlags(node.left) | propagateIdentifierNameFlags(node.right); @@ -25715,7 +25836,7 @@ function createNodeFactory(flags, baseFactory2) { return node.left !== left || node.right !== right ? update(createQualifiedName(left, right), node) : node; } function createComputedPropertyName(expression) { - const node = createBaseNode(167 /* ComputedPropertyName */); + const node = createBaseNode(168 /* ComputedPropertyName */); node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression); node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 131072 /* ContainsComputedPropertyName */; return node; @@ -25724,7 +25845,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createComputedPropertyName(expression), node) : node; } function createTypeParameterDeclaration(modifiers, name, constraint, defaultType) { - const node = createBaseDeclaration(168 /* TypeParameter */); + const node = createBaseDeclaration(169 /* TypeParameter */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.constraint = constraint; @@ -25738,7 +25859,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.name !== name || node.constraint !== constraint || node.default !== defaultType ? update(createTypeParameterDeclaration(modifiers, name, constraint, defaultType), node) : node; } function createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer) { - const node = createBaseDeclaration(169 /* Parameter */); + const node = createBaseDeclaration(170 /* Parameter */); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; node.name = asName(name); @@ -25757,7 +25878,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type || node.initializer !== initializer ? update(createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer), node) : node; } function createDecorator(expression) { - const node = createBaseNode(170 /* Decorator */); + const node = createBaseNode(171 /* Decorator */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, /*optionalChain*/ @@ -25770,7 +25891,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createDecorator(expression), node) : node; } function createPropertySignature(modifiers, name, questionToken, type) { - const node = createBaseDeclaration(171 /* PropertySignature */); + const node = createBaseDeclaration(172 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.type = type; @@ -25790,7 +25911,7 @@ function createNodeFactory(flags, baseFactory2) { return update(updated, original); } function createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer) { - const node = createBaseDeclaration(172 /* PropertyDeclaration */); + const node = createBaseDeclaration(173 /* PropertyDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionOrExclamationToken && isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0; @@ -25806,7 +25927,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.name !== name || node.questionToken !== (questionOrExclamationToken !== void 0 && isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.exclamationToken !== (questionOrExclamationToken !== void 0 && isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.type !== type || node.initializer !== initializer ? update(createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer), node) : node; } function createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type) { - const node = createBaseDeclaration(173 /* MethodSignature */); + const node = createBaseDeclaration(174 /* MethodSignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -25824,7 +25945,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type), node) : node; } function createMethodDeclaration(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - const node = createBaseDeclaration(174 /* MethodDeclaration */); + const node = createBaseDeclaration(175 /* MethodDeclaration */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -25861,7 +25982,7 @@ function createNodeFactory(flags, baseFactory2) { return update(updated, original); } function createClassStaticBlockDeclaration(body) { - const node = createBaseDeclaration(175 /* ClassStaticBlockDeclaration */); + const node = createBaseDeclaration(176 /* ClassStaticBlockDeclaration */); node.body = body; node.transformFlags = propagateChildFlags(body) | 16777216 /* ContainsClassFields */; node.modifiers = void 0; @@ -25882,7 +26003,7 @@ function createNodeFactory(flags, baseFactory2) { return update(updated, original); } function createConstructorDeclaration(modifiers, parameters, body) { - const node = createBaseDeclaration(176 /* Constructor */); + const node = createBaseDeclaration(177 /* Constructor */); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); node.body = body; @@ -25912,7 +26033,7 @@ function createNodeFactory(flags, baseFactory2) { return finishUpdateBaseSignatureDeclaration(updated, original); } function createGetAccessorDeclaration(modifiers, name, parameters, type, body) { - const node = createBaseDeclaration(177 /* GetAccessor */); + const node = createBaseDeclaration(178 /* GetAccessor */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.parameters = createNodeArray(parameters); @@ -25943,7 +26064,7 @@ function createNodeFactory(flags, baseFactory2) { return finishUpdateBaseSignatureDeclaration(updated, original); } function createSetAccessorDeclaration(modifiers, name, parameters, body) { - const node = createBaseDeclaration(178 /* SetAccessor */); + const node = createBaseDeclaration(179 /* SetAccessor */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.parameters = createNodeArray(parameters); @@ -25975,7 +26096,7 @@ function createNodeFactory(flags, baseFactory2) { return finishUpdateBaseSignatureDeclaration(updated, original); } function createCallSignature(typeParameters, parameters, type) { - const node = createBaseDeclaration(179 /* CallSignature */); + const node = createBaseDeclaration(180 /* CallSignature */); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); node.type = type; @@ -25990,7 +26111,7 @@ function createNodeFactory(flags, baseFactory2) { return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createCallSignature(typeParameters, parameters, type), node) : node; } function createConstructSignature(typeParameters, parameters, type) { - const node = createBaseDeclaration(180 /* ConstructSignature */); + const node = createBaseDeclaration(181 /* ConstructSignature */); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); node.type = type; @@ -26005,7 +26126,7 @@ function createNodeFactory(flags, baseFactory2) { return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructSignature(typeParameters, parameters, type), node) : node; } function createIndexSignature(modifiers, parameters, type) { - const node = createBaseDeclaration(181 /* IndexSignature */); + const node = createBaseDeclaration(182 /* IndexSignature */); node.modifiers = asNodeArray(modifiers); node.parameters = asNodeArray(parameters); node.type = type; @@ -26020,7 +26141,7 @@ function createNodeFactory(flags, baseFactory2) { return node.parameters !== parameters || node.type !== type || node.modifiers !== modifiers ? finishUpdateBaseSignatureDeclaration(createIndexSignature(modifiers, parameters, type), node) : node; } function createTemplateLiteralTypeSpan(type, literal) { - const node = createBaseNode(204 /* TemplateLiteralTypeSpan */); + const node = createBaseNode(205 /* TemplateLiteralTypeSpan */); node.type = type; node.literal = literal; node.transformFlags = 1 /* ContainsTypeScript */; @@ -26033,7 +26154,7 @@ function createNodeFactory(flags, baseFactory2) { return createToken(kind); } function createTypePredicateNode(assertsModifier, parameterName, type) { - const node = createBaseNode(182 /* TypePredicate */); + const node = createBaseNode(183 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -26044,7 +26165,7 @@ function createNodeFactory(flags, baseFactory2) { return node.assertsModifier !== assertsModifier || node.parameterName !== parameterName || node.type !== type ? update(createTypePredicateNode(assertsModifier, parameterName, type), node) : node; } function createTypeReferenceNode(typeName, typeArguments) { - const node = createBaseNode(183 /* TypeReference */); + const node = createBaseNode(184 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray(typeArguments)); node.transformFlags = 1 /* ContainsTypeScript */; @@ -26054,7 +26175,7 @@ function createNodeFactory(flags, baseFactory2) { return node.typeName !== typeName || node.typeArguments !== typeArguments ? update(createTypeReferenceNode(typeName, typeArguments), node) : node; } function createFunctionTypeNode(typeParameters, parameters, type) { - const node = createBaseDeclaration(184 /* FunctionType */); + const node = createBaseDeclaration(185 /* FunctionType */); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); node.type = type; @@ -26079,7 +26200,7 @@ function createNodeFactory(flags, baseFactory2) { return args.length === 4 ? createConstructorTypeNode1(...args) : args.length === 3 ? createConstructorTypeNode2(...args) : Debug.fail("Incorrect number of arguments specified."); } function createConstructorTypeNode1(modifiers, typeParameters, parameters, type) { - const node = createBaseDeclaration(185 /* ConstructorType */); + const node = createBaseDeclaration(186 /* ConstructorType */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); @@ -26110,7 +26231,7 @@ function createNodeFactory(flags, baseFactory2) { return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type); } function createTypeQueryNode(exprName, typeArguments) { - const node = createBaseNode(186 /* TypeQuery */); + const node = createBaseNode(187 /* TypeQuery */); node.exprName = exprName; node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); node.transformFlags = 1 /* ContainsTypeScript */; @@ -26120,7 +26241,7 @@ function createNodeFactory(flags, baseFactory2) { return node.exprName !== exprName || node.typeArguments !== typeArguments ? update(createTypeQueryNode(exprName, typeArguments), node) : node; } function createTypeLiteralNode(members) { - const node = createBaseDeclaration(187 /* TypeLiteral */); + const node = createBaseDeclaration(188 /* TypeLiteral */); node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -26129,7 +26250,7 @@ function createNodeFactory(flags, baseFactory2) { return node.members !== members ? update(createTypeLiteralNode(members), node) : node; } function createArrayTypeNode(elementType) { - const node = createBaseNode(188 /* ArrayType */); + const node = createBaseNode(189 /* ArrayType */); node.elementType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(elementType); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -26138,7 +26259,7 @@ function createNodeFactory(flags, baseFactory2) { return node.elementType !== elementType ? update(createArrayTypeNode(elementType), node) : node; } function createTupleTypeNode(elements) { - const node = createBaseNode(189 /* TupleType */); + const node = createBaseNode(190 /* TupleType */); node.elements = createNodeArray(parenthesizerRules().parenthesizeElementTypesOfTupleType(elements)); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -26147,7 +26268,7 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements ? update(createTupleTypeNode(elements), node) : node; } function createNamedTupleMember(dotDotDotToken, name, questionToken, type) { - const node = createBaseDeclaration(202 /* NamedTupleMember */); + const node = createBaseDeclaration(203 /* NamedTupleMember */); node.dotDotDotToken = dotDotDotToken; node.name = name; node.questionToken = questionToken; @@ -26160,7 +26281,7 @@ function createNodeFactory(flags, baseFactory2) { return node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type ? update(createNamedTupleMember(dotDotDotToken, name, questionToken, type), node) : node; } function createOptionalTypeNode(type) { - const node = createBaseNode(190 /* OptionalType */); + const node = createBaseNode(191 /* OptionalType */); node.type = parenthesizerRules().parenthesizeTypeOfOptionalType(type); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -26169,7 +26290,7 @@ function createNodeFactory(flags, baseFactory2) { return node.type !== type ? update(createOptionalTypeNode(type), node) : node; } function createRestTypeNode(type) { - const node = createBaseNode(191 /* RestType */); + const node = createBaseNode(192 /* RestType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -26187,19 +26308,19 @@ function createNodeFactory(flags, baseFactory2) { return node.types !== types ? update(createUnionOrIntersectionTypeNode(node.kind, types, parenthesize), node) : node; } function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(192 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); + return createUnionOrIntersectionTypeNode(193 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); } function updateUnionTypeNode(node, types) { return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); } function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(193 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); + return createUnionOrIntersectionTypeNode(194 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); } function updateIntersectionTypeNode(node, types) { return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); } function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - const node = createBaseNode(194 /* ConditionalType */); + const node = createBaseNode(195 /* ConditionalType */); node.checkType = parenthesizerRules().parenthesizeCheckTypeOfConditionalType(checkType); node.extendsType = parenthesizerRules().parenthesizeExtendsTypeOfConditionalType(extendsType); node.trueType = trueType; @@ -26213,7 +26334,7 @@ function createNodeFactory(flags, baseFactory2) { return node.checkType !== checkType || node.extendsType !== extendsType || node.trueType !== trueType || node.falseType !== falseType ? update(createConditionalTypeNode(checkType, extendsType, trueType, falseType), node) : node; } function createInferTypeNode(typeParameter) { - const node = createBaseNode(195 /* InferType */); + const node = createBaseNode(196 /* InferType */); node.typeParameter = typeParameter; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -26222,7 +26343,7 @@ function createNodeFactory(flags, baseFactory2) { return node.typeParameter !== typeParameter ? update(createInferTypeNode(typeParameter), node) : node; } function createTemplateLiteralType(head, templateSpans) { - const node = createBaseNode(203 /* TemplateLiteralType */); + const node = createBaseNode(204 /* TemplateLiteralType */); node.head = head; node.templateSpans = createNodeArray(templateSpans); node.transformFlags = 1 /* ContainsTypeScript */; @@ -26232,7 +26353,7 @@ function createNodeFactory(flags, baseFactory2) { return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node; } function createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf = false) { - const node = createBaseNode(205 /* ImportType */); + const node = createBaseNode(206 /* ImportType */); node.argument = argument; node.attributes = attributes; if (node.assertions && node.assertions.assertClause && node.attributes) { @@ -26248,7 +26369,7 @@ function createNodeFactory(flags, baseFactory2) { return node.argument !== argument || node.attributes !== attributes || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf), node) : node; } function createParenthesizedType(type) { - const node = createBaseNode(196 /* ParenthesizedType */); + const node = createBaseNode(197 /* ParenthesizedType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -26257,12 +26378,12 @@ function createNodeFactory(flags, baseFactory2) { return node.type !== type ? update(createParenthesizedType(type), node) : node; } function createThisTypeNode() { - const node = createBaseNode(197 /* ThisType */); + const node = createBaseNode(198 /* ThisType */); node.transformFlags = 1 /* ContainsTypeScript */; return node; } function createTypeOperatorNode(operator, type) { - const node = createBaseNode(198 /* TypeOperator */); + const node = createBaseNode(199 /* TypeOperator */); node.operator = operator; node.type = operator === 148 /* ReadonlyKeyword */ ? parenthesizerRules().parenthesizeOperandOfReadonlyTypeOperator(type) : parenthesizerRules().parenthesizeOperandOfTypeOperator(type); node.transformFlags = 1 /* ContainsTypeScript */; @@ -26272,7 +26393,7 @@ function createNodeFactory(flags, baseFactory2) { return node.type !== type ? update(createTypeOperatorNode(node.operator, type), node) : node; } function createIndexedAccessTypeNode(objectType, indexType) { - const node = createBaseNode(199 /* IndexedAccessType */); + const node = createBaseNode(200 /* IndexedAccessType */); node.objectType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(objectType); node.indexType = indexType; node.transformFlags = 1 /* ContainsTypeScript */; @@ -26282,7 +26403,7 @@ function createNodeFactory(flags, baseFactory2) { return node.objectType !== objectType || node.indexType !== indexType ? update(createIndexedAccessTypeNode(objectType, indexType), node) : node; } function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members) { - const node = createBaseDeclaration(200 /* MappedType */); + const node = createBaseDeclaration(201 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.nameType = nameType; @@ -26298,7 +26419,7 @@ function createNodeFactory(flags, baseFactory2) { return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type || node.members !== members ? update(createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members), node) : node; } function createLiteralTypeNode(literal) { - const node = createBaseNode(201 /* LiteralType */); + const node = createBaseNode(202 /* LiteralType */); node.literal = literal; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -26307,7 +26428,7 @@ function createNodeFactory(flags, baseFactory2) { return node.literal !== literal ? update(createLiteralTypeNode(literal), node) : node; } function createObjectBindingPattern(elements) { - const node = createBaseNode(206 /* ObjectBindingPattern */); + const node = createBaseNode(207 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */; if (node.transformFlags & 32768 /* ContainsRestOrSpread */) { @@ -26319,7 +26440,7 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements ? update(createObjectBindingPattern(elements), node) : node; } function createArrayBindingPattern(elements) { - const node = createBaseNode(207 /* ArrayBindingPattern */); + const node = createBaseNode(208 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */; return node; @@ -26328,7 +26449,7 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements ? update(createArrayBindingPattern(elements), node) : node; } function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - const node = createBaseDeclaration(208 /* BindingElement */); + const node = createBaseDeclaration(209 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -26341,7 +26462,7 @@ function createNodeFactory(flags, baseFactory2) { return node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.initializer !== initializer ? update(createBindingElement(dotDotDotToken, propertyName, name, initializer), node) : node; } function createArrayLiteralExpression(elements, multiLine) { - const node = createBaseNode(209 /* ArrayLiteralExpression */); + const node = createBaseNode(210 /* ArrayLiteralExpression */); const lastElement = elements && lastOrUndefined(elements); const elementsArray = createNodeArray(elements, lastElement && isOmittedExpression(lastElement) ? true : void 0); node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(elementsArray); @@ -26353,7 +26474,7 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements ? update(createArrayLiteralExpression(elements, node.multiLine), node) : node; } function createObjectLiteralExpression(properties, multiLine) { - const node = createBaseDeclaration(210 /* ObjectLiteralExpression */); + const node = createBaseDeclaration(211 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.properties); @@ -26364,7 +26485,7 @@ function createNodeFactory(flags, baseFactory2) { return node.properties !== properties ? update(createObjectLiteralExpression(properties, node.multiLine), node) : node; } function createBasePropertyAccessExpression(expression, questionDotToken, name) { - const node = createBaseDeclaration(211 /* PropertyAccessExpression */); + const node = createBaseDeclaration(212 /* PropertyAccessExpression */); node.expression = expression; node.questionDotToken = questionDotToken; node.name = name; @@ -26414,7 +26535,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name ? update(createPropertyAccessChain(expression, questionDotToken, name), node) : node; } function createBaseElementAccessExpression(expression, questionDotToken, argumentExpression) { - const node = createBaseDeclaration(212 /* ElementAccessExpression */); + const node = createBaseDeclaration(213 /* ElementAccessExpression */); node.expression = expression; node.questionDotToken = questionDotToken; node.argumentExpression = argumentExpression; @@ -26464,7 +26585,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? update(createElementAccessChain(expression, questionDotToken, argumentExpression), node) : node; } function createBaseCallExpression(expression, questionDotToken, typeArguments, argumentsArray) { - const node = createBaseDeclaration(213 /* CallExpression */); + const node = createBaseDeclaration(214 /* CallExpression */); node.expression = expression; node.questionDotToken = questionDotToken; node.typeArguments = typeArguments; @@ -26521,7 +26642,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallChain(expression, questionDotToken, typeArguments, argumentsArray), node) : node; } function createNewExpression(expression, typeArguments, argumentsArray) { - const node = createBaseDeclaration(214 /* NewExpression */); + const node = createBaseDeclaration(215 /* NewExpression */); node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : void 0; @@ -26535,7 +26656,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createNewExpression(expression, typeArguments, argumentsArray), node) : node; } function createTaggedTemplateExpression(tag, typeArguments, template) { - const node = createBaseNode(215 /* TaggedTemplateExpression */); + const node = createBaseNode(216 /* TaggedTemplateExpression */); node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess( tag, /*optionalChain*/ @@ -26556,7 +26677,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tag !== tag || node.typeArguments !== typeArguments || node.template !== template ? update(createTaggedTemplateExpression(tag, typeArguments, template), node) : node; } function createTypeAssertion(type, expression) { - const node = createBaseNode(216 /* TypeAssertionExpression */); + const node = createBaseNode(217 /* TypeAssertionExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.type = type; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; @@ -26566,7 +26687,7 @@ function createNodeFactory(flags, baseFactory2) { return node.type !== type || node.expression !== expression ? update(createTypeAssertion(type, expression), node) : node; } function createParenthesizedExpression(expression) { - const node = createBaseNode(217 /* ParenthesizedExpression */); + const node = createBaseNode(218 /* ParenthesizedExpression */); node.expression = expression; node.transformFlags = propagateChildFlags(node.expression); node.jsDoc = void 0; @@ -26576,7 +26697,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createParenthesizedExpression(expression), node) : node; } function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - const node = createBaseDeclaration(218 /* FunctionExpression */); + const node = createBaseDeclaration(219 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -26601,7 +26722,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name || node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateBaseSignatureDeclaration(createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node; } function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - const node = createBaseDeclaration(219 /* ArrowFunction */); + const node = createBaseDeclaration(220 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -26623,7 +26744,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.equalsGreaterThanToken !== equalsGreaterThanToken || node.body !== body ? finishUpdateBaseSignatureDeclaration(createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body), node) : node; } function createDeleteExpression(expression) { - const node = createBaseNode(220 /* DeleteExpression */); + const node = createBaseNode(221 /* DeleteExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -26632,7 +26753,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createDeleteExpression(expression), node) : node; } function createTypeOfExpression(expression) { - const node = createBaseNode(221 /* TypeOfExpression */); + const node = createBaseNode(222 /* TypeOfExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -26641,7 +26762,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createTypeOfExpression(expression), node) : node; } function createVoidExpression(expression) { - const node = createBaseNode(222 /* VoidExpression */); + const node = createBaseNode(223 /* VoidExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -26650,7 +26771,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createVoidExpression(expression), node) : node; } function createAwaitExpression(expression) { - const node = createBaseNode(223 /* AwaitExpression */); + const node = createBaseNode(224 /* AwaitExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression) | 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */ | 2097152 /* ContainsAwait */; return node; @@ -26659,7 +26780,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createAwaitExpression(expression), node) : node; } function createPrefixUnaryExpression(operator, operand) { - const node = createBaseNode(224 /* PrefixUnaryExpression */); + const node = createBaseNode(225 /* PrefixUnaryExpression */); node.operator = operator; node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand); node.transformFlags |= propagateChildFlags(node.operand); @@ -26672,7 +26793,7 @@ function createNodeFactory(flags, baseFactory2) { return node.operand !== operand ? update(createPrefixUnaryExpression(node.operator, operand), node) : node; } function createPostfixUnaryExpression(operand, operator) { - const node = createBaseNode(225 /* PostfixUnaryExpression */); + const node = createBaseNode(226 /* PostfixUnaryExpression */); node.operator = operator; node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand); node.transformFlags |= propagateChildFlags(node.operand); @@ -26685,7 +26806,7 @@ function createNodeFactory(flags, baseFactory2) { return node.operand !== operand ? update(createPostfixUnaryExpression(operand, node.operator), node) : node; } function createBinaryExpression(left, operator, right) { - const node = createBaseDeclaration(226 /* BinaryExpression */); + const node = createBaseDeclaration(227 /* BinaryExpression */); const operatorToken = asToken(operator); const operatorKind = operatorToken.kind; node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left); @@ -26718,7 +26839,7 @@ function createNodeFactory(flags, baseFactory2) { return node.left !== left || node.operatorToken !== operator || node.right !== right ? update(createBinaryExpression(left, operator, right), node) : node; } function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) { - const node = createBaseNode(227 /* ConditionalExpression */); + const node = createBaseNode(228 /* ConditionalExpression */); node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition); node.questionToken = questionToken ?? createToken(58 /* QuestionToken */); node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue); @@ -26733,7 +26854,7 @@ function createNodeFactory(flags, baseFactory2) { return node.condition !== condition || node.questionToken !== questionToken || node.whenTrue !== whenTrue || node.colonToken !== colonToken || node.whenFalse !== whenFalse ? update(createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse), node) : node; } function createTemplateExpression(head, templateSpans) { - const node = createBaseNode(228 /* TemplateExpression */); + const node = createBaseNode(229 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); node.transformFlags |= propagateChildFlags(node.head) | propagateChildrenFlags(node.templateSpans) | 1024 /* ContainsES2015 */; @@ -26808,7 +26929,7 @@ function createNodeFactory(flags, baseFactory2) { } function createYieldExpression(asteriskToken, expression) { Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression."); - const node = createBaseNode(229 /* YieldExpression */); + const node = createBaseNode(230 /* YieldExpression */); node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.asteriskToken = asteriskToken; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.asteriskToken) | 1024 /* ContainsES2015 */ | 128 /* ContainsES2018 */ | 1048576 /* ContainsYield */; @@ -26818,7 +26939,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.asteriskToken !== asteriskToken ? update(createYieldExpression(asteriskToken, expression), node) : node; } function createSpreadElement(expression) { - const node = createBaseNode(230 /* SpreadElement */); + const node = createBaseNode(231 /* SpreadElement */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 32768 /* ContainsRestOrSpread */; return node; @@ -26827,7 +26948,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createSpreadElement(expression), node) : node; } function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - const node = createBaseDeclaration(231 /* ClassExpression */); + const node = createBaseDeclaration(232 /* ClassExpression */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); @@ -26841,10 +26962,10 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassExpression(modifiers, name, typeParameters, heritageClauses, members), node) : node; } function createOmittedExpression() { - return createBaseNode(232 /* OmittedExpression */); + return createBaseNode(233 /* OmittedExpression */); } function createExpressionWithTypeArguments(expression, typeArguments) { - const node = createBaseNode(233 /* ExpressionWithTypeArguments */); + const node = createBaseNode(234 /* ExpressionWithTypeArguments */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, /*optionalChain*/ @@ -26858,7 +26979,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.typeArguments !== typeArguments ? update(createExpressionWithTypeArguments(expression, typeArguments), node) : node; } function createAsExpression(expression, type) { - const node = createBaseNode(234 /* AsExpression */); + const node = createBaseNode(235 /* AsExpression */); node.expression = expression; node.type = type; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; @@ -26868,7 +26989,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.type !== type ? update(createAsExpression(expression, type), node) : node; } function createNonNullExpression(expression) { - const node = createBaseNode(235 /* NonNullExpression */); + const node = createBaseNode(236 /* NonNullExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, /*optionalChain*/ @@ -26884,7 +27005,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createNonNullExpression(expression), node) : node; } function createSatisfiesExpression(expression, type) { - const node = createBaseNode(238 /* SatisfiesExpression */); + const node = createBaseNode(239 /* SatisfiesExpression */); node.expression = expression; node.type = type; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; @@ -26894,7 +27015,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.type !== type ? update(createSatisfiesExpression(expression, type), node) : node; } function createNonNullChain(expression) { - const node = createBaseNode(235 /* NonNullExpression */); + const node = createBaseNode(236 /* NonNullExpression */); node.flags |= 64 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, @@ -26909,7 +27030,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createNonNullChain(expression), node) : node; } function createMetaProperty(keywordToken, name) { - const node = createBaseNode(236 /* MetaProperty */); + const node = createBaseNode(237 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; node.transformFlags |= propagateChildFlags(node.name); @@ -26930,7 +27051,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name ? update(createMetaProperty(node.keywordToken, name), node) : node; } function createTemplateSpan(expression, literal) { - const node = createBaseNode(239 /* TemplateSpan */); + const node = createBaseNode(240 /* TemplateSpan */); node.expression = expression; node.literal = literal; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.literal) | 1024 /* ContainsES2015 */; @@ -26940,12 +27061,12 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.literal !== literal ? update(createTemplateSpan(expression, literal), node) : node; } function createSemicolonClassElement() { - const node = createBaseNode(240 /* SemicolonClassElement */); + const node = createBaseNode(241 /* SemicolonClassElement */); node.transformFlags |= 1024 /* ContainsES2015 */; return node; } function createBlock(statements, multiLine) { - const node = createBaseNode(241 /* Block */); + const node = createBaseNode(242 /* Block */); node.statements = createNodeArray(statements); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.statements); @@ -26958,7 +27079,7 @@ function createNodeFactory(flags, baseFactory2) { return node.statements !== statements ? update(createBlock(statements, node.multiLine), node) : node; } function createVariableStatement(modifiers, declarationList) { - const node = createBaseNode(243 /* VariableStatement */); + const node = createBaseNode(244 /* VariableStatement */); node.modifiers = asNodeArray(modifiers); node.declarationList = isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList); @@ -26973,12 +27094,12 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.declarationList !== declarationList ? update(createVariableStatement(modifiers, declarationList), node) : node; } function createEmptyStatement() { - const node = createBaseNode(242 /* EmptyStatement */); + const node = createBaseNode(243 /* EmptyStatement */); node.jsDoc = void 0; return node; } function createExpressionStatement(expression) { - const node = createBaseNode(244 /* ExpressionStatement */); + const node = createBaseNode(245 /* ExpressionStatement */); node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression); node.transformFlags |= propagateChildFlags(node.expression); node.jsDoc = void 0; @@ -26989,7 +27110,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createExpressionStatement(expression), node) : node; } function createIfStatement(expression, thenStatement, elseStatement) { - const node = createBaseNode(245 /* IfStatement */); + const node = createBaseNode(246 /* IfStatement */); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -27002,7 +27123,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.thenStatement !== thenStatement || node.elseStatement !== elseStatement ? update(createIfStatement(expression, thenStatement, elseStatement), node) : node; } function createDoStatement(statement, expression) { - const node = createBaseNode(246 /* DoStatement */); + const node = createBaseNode(247 /* DoStatement */); node.statement = asEmbeddedStatement(statement); node.expression = expression; node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression); @@ -27014,7 +27135,7 @@ function createNodeFactory(flags, baseFactory2) { return node.statement !== statement || node.expression !== expression ? update(createDoStatement(statement, expression), node) : node; } function createWhileStatement(expression, statement) { - const node = createBaseNode(247 /* WhileStatement */); + const node = createBaseNode(248 /* WhileStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); @@ -27026,7 +27147,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.statement !== statement ? update(createWhileStatement(expression, statement), node) : node; } function createForStatement(initializer, condition, incrementor, statement) { - const node = createBaseNode(248 /* ForStatement */); + const node = createBaseNode(249 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -27042,7 +27163,7 @@ function createNodeFactory(flags, baseFactory2) { return node.initializer !== initializer || node.condition !== condition || node.incrementor !== incrementor || node.statement !== statement ? update(createForStatement(initializer, condition, incrementor, statement), node) : node; } function createForInStatement(initializer, expression, statement) { - const node = createBaseNode(249 /* ForInStatement */); + const node = createBaseNode(250 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -27057,7 +27178,7 @@ function createNodeFactory(flags, baseFactory2) { return node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update(createForInStatement(initializer, expression, statement), node) : node; } function createForOfStatement(awaitModifier, initializer, expression, statement) { - const node = createBaseNode(250 /* ForOfStatement */); + const node = createBaseNode(251 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); @@ -27074,7 +27195,7 @@ function createNodeFactory(flags, baseFactory2) { return node.awaitModifier !== awaitModifier || node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update(createForOfStatement(awaitModifier, initializer, expression, statement), node) : node; } function createContinueStatement(label) { - const node = createBaseNode(251 /* ContinueStatement */); + const node = createBaseNode(252 /* ContinueStatement */); node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; @@ -27085,7 +27206,7 @@ function createNodeFactory(flags, baseFactory2) { return node.label !== label ? update(createContinueStatement(label), node) : node; } function createBreakStatement(label) { - const node = createBaseNode(252 /* BreakStatement */); + const node = createBaseNode(253 /* BreakStatement */); node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; @@ -27096,7 +27217,7 @@ function createNodeFactory(flags, baseFactory2) { return node.label !== label ? update(createBreakStatement(label), node) : node; } function createReturnStatement(expression) { - const node = createBaseNode(253 /* ReturnStatement */); + const node = createBaseNode(254 /* ReturnStatement */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; @@ -27107,7 +27228,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createReturnStatement(expression), node) : node; } function createWithStatement(expression, statement) { - const node = createBaseNode(254 /* WithStatement */); + const node = createBaseNode(255 /* WithStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); @@ -27119,7 +27240,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.statement !== statement ? update(createWithStatement(expression, statement), node) : node; } function createSwitchStatement(expression, caseBlock) { - const node = createBaseNode(255 /* SwitchStatement */); + const node = createBaseNode(256 /* SwitchStatement */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.caseBlock = caseBlock; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock); @@ -27132,7 +27253,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.caseBlock !== caseBlock ? update(createSwitchStatement(expression, caseBlock), node) : node; } function createLabeledStatement(label, statement) { - const node = createBaseNode(256 /* LabeledStatement */); + const node = createBaseNode(257 /* LabeledStatement */); node.label = asName(label); node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement); @@ -27144,7 +27265,7 @@ function createNodeFactory(flags, baseFactory2) { return node.label !== label || node.statement !== statement ? update(createLabeledStatement(label, statement), node) : node; } function createThrowStatement(expression) { - const node = createBaseNode(257 /* ThrowStatement */); + const node = createBaseNode(258 /* ThrowStatement */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); node.jsDoc = void 0; @@ -27155,7 +27276,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createThrowStatement(expression), node) : node; } function createTryStatement(tryBlock, catchClause, finallyBlock) { - const node = createBaseNode(258 /* TryStatement */); + const node = createBaseNode(259 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -27168,13 +27289,13 @@ function createNodeFactory(flags, baseFactory2) { return node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock ? update(createTryStatement(tryBlock, catchClause, finallyBlock), node) : node; } function createDebuggerStatement() { - const node = createBaseNode(259 /* DebuggerStatement */); + const node = createBaseNode(260 /* DebuggerStatement */); node.jsDoc = void 0; node.flowNode = void 0; return node; } function createVariableDeclaration(name, exclamationToken, type, initializer) { - const node = createBaseDeclaration(260 /* VariableDeclaration */); + const node = createBaseDeclaration(261 /* VariableDeclaration */); node.name = asName(name); node.exclamationToken = exclamationToken; node.type = type; @@ -27187,7 +27308,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name || node.type !== type || node.exclamationToken !== exclamationToken || node.initializer !== initializer ? update(createVariableDeclaration(name, exclamationToken, type, initializer), node) : node; } function createVariableDeclarationList(declarations, flags2 = 0 /* None */) { - const node = createBaseNode(261 /* VariableDeclarationList */); + const node = createBaseNode(262 /* VariableDeclarationList */); node.flags |= flags2 & 7 /* BlockScoped */; node.declarations = createNodeArray(declarations); node.transformFlags |= propagateChildrenFlags(node.declarations) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; @@ -27203,7 +27324,7 @@ function createNodeFactory(flags, baseFactory2) { return node.declarations !== declarations ? update(createVariableDeclarationList(declarations, node.flags), node) : node; } function createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - const node = createBaseDeclaration(262 /* FunctionDeclaration */); + const node = createBaseDeclaration(263 /* FunctionDeclaration */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -27239,7 +27360,7 @@ function createNodeFactory(flags, baseFactory2) { return finishUpdateBaseSignatureDeclaration(updated, original); } function createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) { - const node = createBaseDeclaration(263 /* ClassDeclaration */); + const node = createBaseDeclaration(264 /* ClassDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); @@ -27260,7 +27381,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node; } function createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members) { - const node = createBaseDeclaration(264 /* InterfaceDeclaration */); + const node = createBaseDeclaration(265 /* InterfaceDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); @@ -27274,7 +27395,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node; } function createTypeAliasDeclaration(modifiers, name, typeParameters, type) { - const node = createBaseDeclaration(265 /* TypeAliasDeclaration */); + const node = createBaseDeclaration(266 /* TypeAliasDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); @@ -27289,7 +27410,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.type !== type ? update(createTypeAliasDeclaration(modifiers, name, typeParameters, type), node) : node; } function createEnumDeclaration(modifiers, name, members) { - const node = createBaseDeclaration(266 /* EnumDeclaration */); + const node = createBaseDeclaration(267 /* EnumDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.members = createNodeArray(members); @@ -27302,7 +27423,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.name !== name || node.members !== members ? update(createEnumDeclaration(modifiers, name, members), node) : node; } function createModuleDeclaration(modifiers, name, body, flags2 = 0 /* None */) { - const node = createBaseDeclaration(267 /* ModuleDeclaration */); + const node = createBaseDeclaration(268 /* ModuleDeclaration */); node.modifiers = asNodeArray(modifiers); node.flags |= flags2 & (32 /* Namespace */ | 8 /* NestedNamespace */ | 2048 /* GlobalAugmentation */); node.name = name; @@ -27322,7 +27443,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.name !== name || node.body !== body ? update(createModuleDeclaration(modifiers, name, body, node.flags), node) : node; } function createModuleBlock(statements) { - const node = createBaseNode(268 /* ModuleBlock */); + const node = createBaseNode(269 /* ModuleBlock */); node.statements = createNodeArray(statements); node.transformFlags |= propagateChildrenFlags(node.statements); node.jsDoc = void 0; @@ -27332,7 +27453,7 @@ function createNodeFactory(flags, baseFactory2) { return node.statements !== statements ? update(createModuleBlock(statements), node) : node; } function createCaseBlock(clauses) { - const node = createBaseNode(269 /* CaseBlock */); + const node = createBaseNode(270 /* CaseBlock */); node.clauses = createNodeArray(clauses); node.transformFlags |= propagateChildrenFlags(node.clauses); node.locals = void 0; @@ -27343,7 +27464,7 @@ function createNodeFactory(flags, baseFactory2) { return node.clauses !== clauses ? update(createCaseBlock(clauses), node) : node; } function createNamespaceExportDeclaration(name) { - const node = createBaseDeclaration(270 /* NamespaceExportDeclaration */); + const node = createBaseDeclaration(271 /* NamespaceExportDeclaration */); node.name = asName(name); node.transformFlags |= propagateIdentifierNameFlags(node.name) | 1 /* ContainsTypeScript */; node.modifiers = void 0; @@ -27360,7 +27481,7 @@ function createNodeFactory(flags, baseFactory2) { return update(updated, original); } function createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference) { - const node = createBaseDeclaration(271 /* ImportEqualsDeclaration */); + const node = createBaseDeclaration(272 /* ImportEqualsDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.isTypeOnly = isTypeOnly; @@ -27377,7 +27498,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? update(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node; } function createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes) { - const node = createBaseNode(272 /* ImportDeclaration */); + const node = createBaseNode(273 /* ImportDeclaration */); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; node.moduleSpecifier = moduleSpecifier; @@ -27390,23 +27511,30 @@ function createNodeFactory(flags, baseFactory2) { function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, attributes) { return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes), node) : node; } - function createImportClause2(isTypeOnly, name, namedBindings) { - const node = createBaseDeclaration(273 /* ImportClause */); - node.isTypeOnly = isTypeOnly; + function createImportClause2(phaseModifier, name, namedBindings) { + const node = createBaseDeclaration(274 /* ImportClause */); + if (typeof phaseModifier === "boolean") { + phaseModifier = phaseModifier ? 156 /* TypeKeyword */ : void 0; + } + node.isTypeOnly = phaseModifier === 156 /* TypeKeyword */; + node.phaseModifier = phaseModifier; node.name = name; node.namedBindings = namedBindings; node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.namedBindings); - if (isTypeOnly) { + if (phaseModifier === 156 /* TypeKeyword */) { node.transformFlags |= 1 /* ContainsTypeScript */; } node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateImportClause(node, isTypeOnly, name, namedBindings) { - return node.isTypeOnly !== isTypeOnly || node.name !== name || node.namedBindings !== namedBindings ? update(createImportClause2(isTypeOnly, name, namedBindings), node) : node; + function updateImportClause(node, phaseModifier, name, namedBindings) { + if (typeof phaseModifier === "boolean") { + phaseModifier = phaseModifier ? 156 /* TypeKeyword */ : void 0; + } + return node.phaseModifier !== phaseModifier || node.name !== name || node.namedBindings !== namedBindings ? update(createImportClause2(phaseModifier, name, namedBindings), node) : node; } function createAssertClause(elements, multiLine) { - const node = createBaseNode(300 /* AssertClause */); + const node = createBaseNode(301 /* AssertClause */); node.elements = createNodeArray(elements); node.multiLine = multiLine; node.token = 132 /* AssertKeyword */; @@ -27417,7 +27545,7 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements || node.multiLine !== multiLine ? update(createAssertClause(elements, multiLine), node) : node; } function createAssertEntry(name, value) { - const node = createBaseNode(301 /* AssertEntry */); + const node = createBaseNode(302 /* AssertEntry */); node.name = name; node.value = value; node.transformFlags |= 4 /* ContainsESNext */; @@ -27427,7 +27555,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name || node.value !== value ? update(createAssertEntry(name, value), node) : node; } function createImportTypeAssertionContainer(clause, multiLine) { - const node = createBaseNode(302 /* ImportTypeAssertionContainer */); + const node = createBaseNode(303 /* ImportTypeAssertionContainer */); node.assertClause = clause; node.multiLine = multiLine; return node; @@ -27436,7 +27564,7 @@ function createNodeFactory(flags, baseFactory2) { return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node; } function createImportAttributes(elements, multiLine, token) { - const node = createBaseNode(300 /* ImportAttributes */); + const node = createBaseNode(301 /* ImportAttributes */); node.token = token ?? 118 /* WithKeyword */; node.elements = createNodeArray(elements); node.multiLine = multiLine; @@ -27447,7 +27575,7 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements || node.multiLine !== multiLine ? update(createImportAttributes(elements, multiLine, node.token), node) : node; } function createImportAttribute(name, value) { - const node = createBaseNode(301 /* ImportAttribute */); + const node = createBaseNode(302 /* ImportAttribute */); node.name = name; node.value = value; node.transformFlags |= 4 /* ContainsESNext */; @@ -27457,7 +27585,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name || node.value !== value ? update(createImportAttribute(name, value), node) : node; } function createNamespaceImport(name) { - const node = createBaseDeclaration(274 /* NamespaceImport */); + const node = createBaseDeclaration(275 /* NamespaceImport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; @@ -27467,7 +27595,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name ? update(createNamespaceImport(name), node) : node; } function createNamespaceExport(name) { - const node = createBaseDeclaration(280 /* NamespaceExport */); + const node = createBaseDeclaration(281 /* NamespaceExport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name) | 32 /* ContainsES2020 */; node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; @@ -27477,7 +27605,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name ? update(createNamespaceExport(name), node) : node; } function createNamedImports(elements) { - const node = createBaseNode(275 /* NamedImports */); + const node = createBaseNode(276 /* NamedImports */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; @@ -27487,7 +27615,7 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements ? update(createNamedImports(elements), node) : node; } function createImportSpecifier(isTypeOnly, propertyName, name) { - const node = createBaseDeclaration(276 /* ImportSpecifier */); + const node = createBaseDeclaration(277 /* ImportSpecifier */); node.isTypeOnly = isTypeOnly; node.propertyName = propertyName; node.name = name; @@ -27499,7 +27627,7 @@ function createNodeFactory(flags, baseFactory2) { return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createImportSpecifier(isTypeOnly, propertyName, name), node) : node; } function createExportAssignment2(modifiers, isExportEquals, expression) { - const node = createBaseDeclaration(277 /* ExportAssignment */); + const node = createBaseDeclaration(278 /* ExportAssignment */); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; node.expression = isExportEquals ? parenthesizerRules().parenthesizeRightSideOfBinary( @@ -27517,7 +27645,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.expression !== expression ? update(createExportAssignment2(modifiers, node.isExportEquals, expression), node) : node; } function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) { - const node = createBaseDeclaration(278 /* ExportDeclaration */); + const node = createBaseDeclaration(279 /* ExportDeclaration */); node.modifiers = asNodeArray(modifiers); node.isTypeOnly = isTypeOnly; node.exportClause = exportClause; @@ -27540,7 +27668,7 @@ function createNodeFactory(flags, baseFactory2) { return update(updated, original); } function createNamedExports(elements) { - const node = createBaseNode(279 /* NamedExports */); + const node = createBaseNode(280 /* NamedExports */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; @@ -27550,7 +27678,7 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements ? update(createNamedExports(elements), node) : node; } function createExportSpecifier(isTypeOnly, propertyName, name) { - const node = createBaseNode(281 /* ExportSpecifier */); + const node = createBaseNode(282 /* ExportSpecifier */); node.isTypeOnly = isTypeOnly; node.propertyName = asName(propertyName); node.name = asName(name); @@ -27563,12 +27691,12 @@ function createNodeFactory(flags, baseFactory2) { return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createExportSpecifier(isTypeOnly, propertyName, name), node) : node; } function createMissingDeclaration() { - const node = createBaseDeclaration(282 /* MissingDeclaration */); + const node = createBaseDeclaration(283 /* MissingDeclaration */); node.jsDoc = void 0; return node; } function createExternalModuleReference(expression) { - const node = createBaseNode(283 /* ExternalModuleReference */); + const node = createBaseNode(284 /* ExternalModuleReference */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; @@ -27600,7 +27728,7 @@ function createNodeFactory(flags, baseFactory2) { return node.type !== type ? update(createJSDocUnaryTypeWorker(kind, type), node) : node; } function createJSDocFunctionType(parameters, type) { - const node = createBaseDeclaration(317 /* JSDocFunctionType */); + const node = createBaseDeclaration(318 /* JSDocFunctionType */); node.parameters = asNodeArray(parameters); node.type = type; node.transformFlags = propagateChildrenFlags(node.parameters) | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */); @@ -27614,7 +27742,7 @@ function createNodeFactory(flags, baseFactory2) { return node.parameters !== parameters || node.type !== type ? update(createJSDocFunctionType(parameters, type), node) : node; } function createJSDocTypeLiteral(propertyTags, isArrayType = false) { - const node = createBaseDeclaration(322 /* JSDocTypeLiteral */); + const node = createBaseDeclaration(323 /* JSDocTypeLiteral */); node.jsDocPropertyTags = asNodeArray(propertyTags); node.isArrayType = isArrayType; return node; @@ -27623,7 +27751,7 @@ function createNodeFactory(flags, baseFactory2) { return node.jsDocPropertyTags !== propertyTags || node.isArrayType !== isArrayType ? update(createJSDocTypeLiteral(propertyTags, isArrayType), node) : node; } function createJSDocTypeExpression(type) { - const node = createBaseNode(309 /* JSDocTypeExpression */); + const node = createBaseNode(310 /* JSDocTypeExpression */); node.type = type; return node; } @@ -27631,7 +27759,7 @@ function createNodeFactory(flags, baseFactory2) { return node.type !== type ? update(createJSDocTypeExpression(type), node) : node; } function createJSDocSignature(typeParameters, parameters, type) { - const node = createBaseDeclaration(323 /* JSDocSignature */); + const node = createBaseDeclaration(324 /* JSDocSignature */); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; @@ -27660,7 +27788,7 @@ function createNodeFactory(flags, baseFactory2) { return node; } function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) { - const node = createBaseJSDocTag(345 /* JSDocTemplateTag */, tagName ?? createIdentifier("template"), comment); + const node = createBaseJSDocTag(346 /* JSDocTemplateTag */, tagName ?? createIdentifier("template"), comment); node.constraint = constraint; node.typeParameters = createNodeArray(typeParameters); return node; @@ -27669,7 +27797,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? update(createJSDocTemplateTag(tagName, constraint, typeParameters, comment), node) : node; } function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) { - const node = createBaseJSDocTagDeclaration(346 /* JSDocTypedefTag */, tagName ?? createIdentifier("typedef"), comment); + const node = createBaseJSDocTagDeclaration(347 /* JSDocTypedefTag */, tagName ?? createIdentifier("typedef"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = getJSDocTypeAliasName(fullName); @@ -27681,7 +27809,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocTypedefTag(tagName, typeExpression, fullName, comment), node) : node; } function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - const node = createBaseJSDocTagDeclaration(341 /* JSDocParameterTag */, tagName ?? createIdentifier("param"), comment); + const node = createBaseJSDocTagDeclaration(342 /* JSDocParameterTag */, tagName ?? createIdentifier("param"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -27692,7 +27820,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node; } function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - const node = createBaseJSDocTagDeclaration(348 /* JSDocPropertyTag */, tagName ?? createIdentifier("prop"), comment); + const node = createBaseJSDocTagDeclaration(349 /* JSDocPropertyTag */, tagName ?? createIdentifier("prop"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -27703,7 +27831,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node; } function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) { - const node = createBaseJSDocTagDeclaration(338 /* JSDocCallbackTag */, tagName ?? createIdentifier("callback"), comment); + const node = createBaseJSDocTagDeclaration(339 /* JSDocCallbackTag */, tagName ?? createIdentifier("callback"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = getJSDocTypeAliasName(fullName); @@ -27715,7 +27843,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocCallbackTag(tagName, typeExpression, fullName, comment), node) : node; } function createJSDocOverloadTag(tagName, typeExpression, comment) { - const node = createBaseJSDocTag(339 /* JSDocOverloadTag */, tagName ?? createIdentifier("overload"), comment); + const node = createBaseJSDocTag(340 /* JSDocOverloadTag */, tagName ?? createIdentifier("overload"), comment); node.typeExpression = typeExpression; return node; } @@ -27723,7 +27851,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocOverloadTag(tagName, typeExpression, comment), node) : node; } function createJSDocAugmentsTag(tagName, className, comment) { - const node = createBaseJSDocTag(328 /* JSDocAugmentsTag */, tagName ?? createIdentifier("augments"), comment); + const node = createBaseJSDocTag(329 /* JSDocAugmentsTag */, tagName ?? createIdentifier("augments"), comment); node.class = className; return node; } @@ -27731,12 +27859,12 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocAugmentsTag(tagName, className, comment), node) : node; } function createJSDocImplementsTag(tagName, className, comment) { - const node = createBaseJSDocTag(329 /* JSDocImplementsTag */, tagName ?? createIdentifier("implements"), comment); + const node = createBaseJSDocTag(330 /* JSDocImplementsTag */, tagName ?? createIdentifier("implements"), comment); node.class = className; return node; } function createJSDocSeeTag(tagName, name, comment) { - const node = createBaseJSDocTag(347 /* JSDocSeeTag */, tagName ?? createIdentifier("see"), comment); + const node = createBaseJSDocTag(348 /* JSDocSeeTag */, tagName ?? createIdentifier("see"), comment); node.name = name; return node; } @@ -27744,7 +27872,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.name !== name || node.comment !== comment ? update(createJSDocSeeTag(tagName, name, comment), node) : node; } function createJSDocNameReference(name) { - const node = createBaseNode(310 /* JSDocNameReference */); + const node = createBaseNode(311 /* JSDocNameReference */); node.name = name; return node; } @@ -27752,7 +27880,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name ? update(createJSDocNameReference(name), node) : node; } function createJSDocMemberName(left, right) { - const node = createBaseNode(311 /* JSDocMemberName */); + const node = createBaseNode(312 /* JSDocMemberName */); node.left = left; node.right = right; node.transformFlags |= propagateChildFlags(node.left) | propagateChildFlags(node.right); @@ -27762,7 +27890,7 @@ function createNodeFactory(flags, baseFactory2) { return node.left !== left || node.right !== right ? update(createJSDocMemberName(left, right), node) : node; } function createJSDocLink(name, text) { - const node = createBaseNode(324 /* JSDocLink */); + const node = createBaseNode(325 /* JSDocLink */); node.name = name; node.text = text; return node; @@ -27771,7 +27899,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name ? update(createJSDocLink(name, text), node) : node; } function createJSDocLinkCode(name, text) { - const node = createBaseNode(325 /* JSDocLinkCode */); + const node = createBaseNode(326 /* JSDocLinkCode */); node.name = name; node.text = text; return node; @@ -27780,7 +27908,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name ? update(createJSDocLinkCode(name, text), node) : node; } function createJSDocLinkPlain(name, text) { - const node = createBaseNode(326 /* JSDocLinkPlain */); + const node = createBaseNode(327 /* JSDocLinkPlain */); node.name = name; node.text = text; return node; @@ -27807,14 +27935,14 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment), node) : node; } function createJSDocUnknownTag(tagName, comment) { - const node = createBaseJSDocTag(327 /* JSDocTag */, tagName, comment); + const node = createBaseJSDocTag(328 /* JSDocTag */, tagName, comment); return node; } function updateJSDocUnknownTag(node, tagName, comment) { return node.tagName !== tagName || node.comment !== comment ? update(createJSDocUnknownTag(tagName, comment), node) : node; } function createJSDocEnumTag(tagName, typeExpression, comment) { - const node = createBaseJSDocTagDeclaration(340 /* JSDocEnumTag */, tagName ?? createIdentifier(getDefaultTagNameForKind(340 /* JSDocEnumTag */)), comment); + const node = createBaseJSDocTagDeclaration(341 /* JSDocEnumTag */, tagName ?? createIdentifier(getDefaultTagNameForKind(341 /* JSDocEnumTag */)), comment); node.typeExpression = typeExpression; node.locals = void 0; node.nextContainer = void 0; @@ -27824,7 +27952,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocEnumTag(tagName, typeExpression, comment), node) : node; } function createJSDocImportTag(tagName, importClause, moduleSpecifier, attributes, comment) { - const node = createBaseJSDocTag(351 /* JSDocImportTag */, tagName ?? createIdentifier("import"), comment); + const node = createBaseJSDocTag(352 /* JSDocImportTag */, tagName ?? createIdentifier("import"), comment); node.importClause = importClause; node.moduleSpecifier = moduleSpecifier; node.attributes = attributes; @@ -27835,7 +27963,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.comment !== comment || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? update(createJSDocImportTag(tagName, importClause, moduleSpecifier, attributes, comment), node) : node; } function createJSDocText(text) { - const node = createBaseNode(321 /* JSDocText */); + const node = createBaseNode(322 /* JSDocText */); node.text = text; return node; } @@ -27843,7 +27971,7 @@ function createNodeFactory(flags, baseFactory2) { return node.text !== text ? update(createJSDocText(text), node) : node; } function createJSDocComment(comment, tags) { - const node = createBaseNode(320 /* JSDoc */); + const node = createBaseNode(321 /* JSDoc */); node.comment = comment; node.tags = asNodeArray(tags); return node; @@ -27852,7 +27980,7 @@ function createNodeFactory(flags, baseFactory2) { return node.comment !== comment || node.tags !== tags ? update(createJSDocComment(comment, tags), node) : node; } function createJsxElement(openingElement, children, closingElement) { - const node = createBaseNode(284 /* JsxElement */); + const node = createBaseNode(285 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -27863,7 +27991,7 @@ function createNodeFactory(flags, baseFactory2) { return node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement ? update(createJsxElement(openingElement, children, closingElement), node) : node; } function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - const node = createBaseNode(285 /* JsxSelfClosingElement */); + const node = createBaseNode(286 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -27877,7 +28005,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxSelfClosingElement(tagName, typeArguments, attributes), node) : node; } function createJsxOpeningElement(tagName, typeArguments, attributes) { - const node = createBaseNode(286 /* JsxOpeningElement */); + const node = createBaseNode(287 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -27891,7 +28019,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxOpeningElement(tagName, typeArguments, attributes), node) : node; } function createJsxClosingElement(tagName) { - const node = createBaseNode(287 /* JsxClosingElement */); + const node = createBaseNode(288 /* JsxClosingElement */); node.tagName = tagName; node.transformFlags |= propagateChildFlags(node.tagName) | 2 /* ContainsJsx */; return node; @@ -27900,7 +28028,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName ? update(createJsxClosingElement(tagName), node) : node; } function createJsxFragment(openingFragment, children, closingFragment) { - const node = createBaseNode(288 /* JsxFragment */); + const node = createBaseNode(289 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -27921,17 +28049,17 @@ function createNodeFactory(flags, baseFactory2) { return node.text !== text || node.containsOnlyTriviaWhiteSpaces !== containsOnlyTriviaWhiteSpaces ? update(createJsxText(text, containsOnlyTriviaWhiteSpaces), node) : node; } function createJsxOpeningFragment() { - const node = createBaseNode(289 /* JsxOpeningFragment */); + const node = createBaseNode(290 /* JsxOpeningFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } function createJsxJsxClosingFragment() { - const node = createBaseNode(290 /* JsxClosingFragment */); + const node = createBaseNode(291 /* JsxClosingFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } function createJsxAttribute(name, initializer) { - const node = createBaseDeclaration(291 /* JsxAttribute */); + const node = createBaseDeclaration(292 /* JsxAttribute */); node.name = name; node.initializer = initializer; node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 2 /* ContainsJsx */; @@ -27941,7 +28069,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name || node.initializer !== initializer ? update(createJsxAttribute(name, initializer), node) : node; } function createJsxAttributes(properties) { - const node = createBaseDeclaration(292 /* JsxAttributes */); + const node = createBaseDeclaration(293 /* JsxAttributes */); node.properties = createNodeArray(properties); node.transformFlags |= propagateChildrenFlags(node.properties) | 2 /* ContainsJsx */; return node; @@ -27950,7 +28078,7 @@ function createNodeFactory(flags, baseFactory2) { return node.properties !== properties ? update(createJsxAttributes(properties), node) : node; } function createJsxSpreadAttribute(expression) { - const node = createBaseNode(293 /* JsxSpreadAttribute */); + const node = createBaseNode(294 /* JsxSpreadAttribute */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | 2 /* ContainsJsx */; return node; @@ -27959,7 +28087,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createJsxSpreadAttribute(expression), node) : node; } function createJsxExpression(dotDotDotToken, expression) { - const node = createBaseNode(294 /* JsxExpression */); + const node = createBaseNode(295 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateChildFlags(node.expression) | 2 /* ContainsJsx */; @@ -27969,7 +28097,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createJsxExpression(node.dotDotDotToken, expression), node) : node; } function createJsxNamespacedName(namespace, name) { - const node = createBaseNode(295 /* JsxNamespacedName */); + const node = createBaseNode(296 /* JsxNamespacedName */); node.namespace = namespace; node.name = name; node.transformFlags |= propagateChildFlags(node.namespace) | propagateChildFlags(node.name) | 2 /* ContainsJsx */; @@ -27979,7 +28107,7 @@ function createNodeFactory(flags, baseFactory2) { return node.namespace !== namespace || node.name !== name ? update(createJsxNamespacedName(namespace, name), node) : node; } function createCaseClause(expression, statements) { - const node = createBaseNode(296 /* CaseClause */); + const node = createBaseNode(297 /* CaseClause */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.statements = createNodeArray(statements); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements); @@ -27990,7 +28118,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.statements !== statements ? update(createCaseClause(expression, statements), node) : node; } function createDefaultClause(statements) { - const node = createBaseNode(297 /* DefaultClause */); + const node = createBaseNode(298 /* DefaultClause */); node.statements = createNodeArray(statements); node.transformFlags = propagateChildrenFlags(node.statements); return node; @@ -27999,7 +28127,7 @@ function createNodeFactory(flags, baseFactory2) { return node.statements !== statements ? update(createDefaultClause(statements), node) : node; } function createHeritageClause(token, types) { - const node = createBaseNode(298 /* HeritageClause */); + const node = createBaseNode(299 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); node.transformFlags |= propagateChildrenFlags(node.types); @@ -28019,7 +28147,7 @@ function createNodeFactory(flags, baseFactory2) { return node.types !== types ? update(createHeritageClause(node.token, types), node) : node; } function createCatchClause(variableDeclaration, block) { - const node = createBaseNode(299 /* CatchClause */); + const node = createBaseNode(300 /* CatchClause */); node.variableDeclaration = asVariableDeclaration(variableDeclaration); node.block = block; node.transformFlags |= propagateChildFlags(node.variableDeclaration) | propagateChildFlags(node.block) | (!variableDeclaration ? 64 /* ContainsES2019 */ : 0 /* None */); @@ -28031,7 +28159,7 @@ function createNodeFactory(flags, baseFactory2) { return node.variableDeclaration !== variableDeclaration || node.block !== block ? update(createCatchClause(variableDeclaration, block), node) : node; } function createPropertyAssignment(name, initializer) { - const node = createBaseDeclaration(303 /* PropertyAssignment */); + const node = createBaseDeclaration(304 /* PropertyAssignment */); node.name = asName(name); node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer); @@ -28053,7 +28181,7 @@ function createNodeFactory(flags, baseFactory2) { return update(updated, original); } function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - const node = createBaseDeclaration(304 /* ShorthandPropertyAssignment */); + const node = createBaseDeclaration(305 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer); node.transformFlags |= propagateIdentifierNameFlags(node.name) | propagateChildFlags(node.objectAssignmentInitializer) | 1024 /* ContainsES2015 */; @@ -28077,7 +28205,7 @@ function createNodeFactory(flags, baseFactory2) { return update(updated, original); } function createSpreadAssignment(expression) { - const node = createBaseDeclaration(305 /* SpreadAssignment */); + const node = createBaseDeclaration(306 /* SpreadAssignment */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */; node.jsDoc = void 0; @@ -28087,7 +28215,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createSpreadAssignment(expression), node) : node; } function createEnumMember(name, initializer) { - const node = createBaseDeclaration(306 /* EnumMember */); + const node = createBaseDeclaration(307 /* EnumMember */); node.name = asName(name); node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */; @@ -28098,7 +28226,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name || node.initializer !== initializer ? update(createEnumMember(name, initializer), node) : node; } function createSourceFile2(statements, endOfFileToken, flags2) { - const node = baseFactory2.createBaseSourceFileNode(307 /* SourceFile */); + const node = baseFactory2.createBaseSourceFileNode(308 /* SourceFile */); node.statements = createNodeArray(statements); node.endOfFileToken = endOfFileToken; node.flags |= flags2; @@ -28178,7 +28306,7 @@ function createNodeFactory(flags, baseFactory2) { return node; } function cloneSourceFileWorker(source) { - const node = baseFactory2.createBaseSourceFileNode(307 /* SourceFile */); + const node = baseFactory2.createBaseSourceFileNode(308 /* SourceFile */); node.flags |= source.flags & ~16 /* Synthesized */; for (const p in source) { if (hasProperty(node, p) || !hasProperty(source, p)) { @@ -28212,7 +28340,7 @@ function createNodeFactory(flags, baseFactory2) { return node.statements !== statements || node.isDeclarationFile !== isDeclarationFile || node.referencedFiles !== referencedFiles || node.typeReferenceDirectives !== typeReferenceDirectives || node.hasNoDefaultLib !== hasNoDefaultLib || node.libReferenceDirectives !== libReferenceDirectives ? update(cloneSourceFileWithChanges(node, statements, isDeclarationFile, referencedFiles, typeReferenceDirectives, hasNoDefaultLib, libReferenceDirectives), node) : node; } function createBundle(sourceFiles) { - const node = createBaseNode(308 /* Bundle */); + const node = createBaseNode(309 /* Bundle */); node.sourceFiles = sourceFiles; node.syntheticFileReferences = void 0; node.syntheticTypeReferences = void 0; @@ -28224,25 +28352,25 @@ function createNodeFactory(flags, baseFactory2) { return node.sourceFiles !== sourceFiles ? update(createBundle(sourceFiles), node) : node; } function createSyntheticExpression(type, isSpread = false, tupleNameSource) { - const node = createBaseNode(237 /* SyntheticExpression */); + const node = createBaseNode(238 /* SyntheticExpression */); node.type = type; node.isSpread = isSpread; node.tupleNameSource = tupleNameSource; return node; } function createSyntaxList3(children) { - const node = createBaseNode(352 /* SyntaxList */); + const node = createBaseNode(353 /* SyntaxList */); node._children = children; return node; } function createNotEmittedStatement(original) { - const node = createBaseNode(353 /* NotEmittedStatement */); + const node = createBaseNode(354 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; } function createPartiallyEmittedExpression(expression, original) { - const node = createBaseNode(355 /* PartiallyEmittedExpression */); + const node = createBaseNode(356 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */; @@ -28253,7 +28381,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createPartiallyEmittedExpression(expression, node.original), node) : node; } function createNotEmittedTypeElement() { - return createBaseNode(354 /* NotEmittedTypeElement */); + return createBaseNode(355 /* NotEmittedTypeElement */); } function flattenCommaElements(node) { if (nodeIsSynthesized(node) && !isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { @@ -28267,7 +28395,7 @@ function createNodeFactory(flags, baseFactory2) { return node; } function createCommaListExpression(elements) { - const node = createBaseNode(356 /* CommaListExpression */); + const node = createBaseNode(357 /* CommaListExpression */); node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements)); node.transformFlags |= propagateChildrenFlags(node.elements); return node; @@ -28276,7 +28404,7 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements ? update(createCommaListExpression(elements), node) : node; } function createSyntheticReferenceExpression(expression, thisArg) { - const node = createBaseNode(357 /* SyntheticReferenceExpression */); + const node = createBaseNode(358 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg); @@ -28511,19 +28639,19 @@ function createNodeFactory(flags, baseFactory2) { } function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return updateParenthesizedExpression(outerExpression, expression); - case 216 /* TypeAssertionExpression */: + case 217 /* TypeAssertionExpression */: return updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 234 /* AsExpression */: + case 235 /* AsExpression */: return updateAsExpression(outerExpression, expression, outerExpression.type); - case 238 /* SatisfiesExpression */: + case 239 /* SatisfiesExpression */: return updateSatisfiesExpression(outerExpression, expression, outerExpression.type); - case 235 /* NonNullExpression */: + case 236 /* NonNullExpression */: return updateNonNullExpression(outerExpression, expression); - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return updateExpressionWithTypeArguments(outerExpression, expression, outerExpression.typeArguments); - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return updatePartiallyEmittedExpression(outerExpression, expression); } } @@ -28563,13 +28691,13 @@ function createNodeFactory(flags, baseFactory2) { case 10 /* BigIntLiteral */: case 11 /* StringLiteral */: return false; - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: const elements = target.elements; if (elements.length === 0) { return false; } return true; - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -28831,19 +28959,19 @@ function createNodeFactory(flags, baseFactory2) { } function replacePropertyName(node, name) { switch (node.kind) { - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return updateGetAccessorDeclaration(node, node.modifiers, name, node.parameters, node.type, node.body); - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return updateSetAccessorDeclaration(node, node.modifiers, name, node.parameters, node.body); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return updateMethodDeclaration(node, node.modifiers, node.asteriskToken, name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body); - case 173 /* MethodSignature */: + case 174 /* MethodSignature */: return updateMethodSignature(node, node.modifiers, name, node.questionToken, node.typeParameters, node.parameters, node.type); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return updatePropertyDeclaration2(node, node.modifiers, name, node.questionToken ?? node.exclamationToken, node.type, node.initializer); - case 171 /* PropertySignature */: + case 172 /* PropertySignature */: return updatePropertySignature(node, node.modifiers, name, node.questionToken, node.type); - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return updatePropertyAssignment(node, name, node.initializer); } } @@ -28889,45 +29017,45 @@ function createNodeFactory(flags, baseFactory2) { } function getDefaultTagNameForKind(kind) { switch (kind) { - case 344 /* JSDocTypeTag */: + case 345 /* JSDocTypeTag */: return "type"; - case 342 /* JSDocReturnTag */: + case 343 /* JSDocReturnTag */: return "returns"; - case 343 /* JSDocThisTag */: + case 344 /* JSDocThisTag */: return "this"; - case 340 /* JSDocEnumTag */: + case 341 /* JSDocEnumTag */: return "enum"; - case 330 /* JSDocAuthorTag */: + case 331 /* JSDocAuthorTag */: return "author"; - case 332 /* JSDocClassTag */: + case 333 /* JSDocClassTag */: return "class"; - case 333 /* JSDocPublicTag */: + case 334 /* JSDocPublicTag */: return "public"; - case 334 /* JSDocPrivateTag */: + case 335 /* JSDocPrivateTag */: return "private"; - case 335 /* JSDocProtectedTag */: + case 336 /* JSDocProtectedTag */: return "protected"; - case 336 /* JSDocReadonlyTag */: + case 337 /* JSDocReadonlyTag */: return "readonly"; - case 337 /* JSDocOverrideTag */: + case 338 /* JSDocOverrideTag */: return "override"; - case 345 /* JSDocTemplateTag */: + case 346 /* JSDocTemplateTag */: return "template"; - case 346 /* JSDocTypedefTag */: + case 347 /* JSDocTypedefTag */: return "typedef"; - case 341 /* JSDocParameterTag */: + case 342 /* JSDocParameterTag */: return "param"; - case 348 /* JSDocPropertyTag */: + case 349 /* JSDocPropertyTag */: return "prop"; - case 338 /* JSDocCallbackTag */: + case 339 /* JSDocCallbackTag */: return "callback"; - case 339 /* JSDocOverloadTag */: + case 340 /* JSDocOverloadTag */: return "overload"; - case 328 /* JSDocAugmentsTag */: + case 329 /* JSDocAugmentsTag */: return "augments"; - case 329 /* JSDocImplementsTag */: + case 330 /* JSDocImplementsTag */: return "implements"; - case 351 /* JSDocImportTag */: + case 352 /* JSDocImportTag */: return "import"; default: return Debug.fail(`Unsupported kind: ${Debug.formatSyntaxKind(kind)}`); @@ -29010,35 +29138,35 @@ function aggregateChildrenFlags(children) { children.transformFlags = subtreeFlags; } function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 182 /* FirstTypeNode */ && kind <= 205 /* LastTypeNode */) { + if (kind >= 183 /* FirstTypeNode */ && kind <= 206 /* LastTypeNode */) { return -2 /* TypeExcludes */; } switch (kind) { - case 213 /* CallExpression */: - case 214 /* NewExpression */: - case 209 /* ArrayLiteralExpression */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: + case 210 /* ArrayLiteralExpression */: return -2147450880 /* ArrayLiteralOrCallOrNewExcludes */; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return -1941676032 /* ModuleExcludes */; - case 169 /* Parameter */: + case 170 /* Parameter */: return -2147483648 /* ParameterExcludes */; - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return -2072174592 /* ArrowFunctionExcludes */; - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: return -1937940480 /* FunctionExcludes */; - case 261 /* VariableDeclarationList */: + case 262 /* VariableDeclarationList */: return -2146893824 /* VariableDeclarationListExcludes */; - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: return -2147344384 /* ClassExcludes */; - case 176 /* Constructor */: + case 177 /* Constructor */: return -1937948672 /* ConstructorExcludes */; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return -2013249536 /* PropertyExcludes */; - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return -2005057536 /* MethodOrAccessorExcludes */; case 133 /* AnyKeyword */: case 150 /* NumberKeyword */: @@ -29049,31 +29177,31 @@ function getTransformFlagsSubtreeExclusions(kind) { case 136 /* BooleanKeyword */: case 155 /* SymbolKeyword */: case 116 /* VoidKeyword */: - case 168 /* TypeParameter */: - case 171 /* PropertySignature */: - case 173 /* MethodSignature */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 181 /* IndexSignature */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 169 /* TypeParameter */: + case 172 /* PropertySignature */: + case 174 /* MethodSignature */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 182 /* IndexSignature */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: return -2 /* TypeExcludes */; - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return -2147278848 /* ObjectLiteralExcludes */; - case 299 /* CatchClause */: + case 300 /* CatchClause */: return -2147418112 /* CatchClauseExcludes */; - case 206 /* ObjectBindingPattern */: - case 207 /* ArrayBindingPattern */: + case 207 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: return -2147450880 /* BindingPatternExcludes */; - case 216 /* TypeAssertionExpression */: - case 238 /* SatisfiesExpression */: - case 234 /* AsExpression */: - case 355 /* PartiallyEmittedExpression */: - case 217 /* ParenthesizedExpression */: + case 217 /* TypeAssertionExpression */: + case 239 /* SatisfiesExpression */: + case 235 /* AsExpression */: + case 356 /* PartiallyEmittedExpression */: + case 218 /* ParenthesizedExpression */: case 108 /* SuperKeyword */: return -2147483648 /* OuterExpressionExcludes */; - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: return -2147483648 /* PropertyAccessExcludes */; default: return -2147483648 /* NodeExcludes */; @@ -29178,7 +29306,7 @@ function mergeTokenSourceMapRanges(sourceRanges, destRanges) { function getOrCreateEmitNode(node) { if (!node.emitNode) { if (isParseTreeNode(node)) { - if (node.kind === 307 /* SourceFile */) { + if (node.kind === 308 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } const sourceFile = getSourceFileOfNode(getParseTreeNode(getSourceFileOfNode(node))) ?? Debug.fail("Could not determine parsed source file."); @@ -30593,583 +30721,583 @@ function isCaseKeyword(node) { return node.kind === 84 /* CaseKeyword */; } function isQualifiedName(node) { - return node.kind === 166 /* QualifiedName */; + return node.kind === 167 /* QualifiedName */; } function isComputedPropertyName(node) { - return node.kind === 167 /* ComputedPropertyName */; + return node.kind === 168 /* ComputedPropertyName */; } function isTypeParameterDeclaration(node) { - return node.kind === 168 /* TypeParameter */; + return node.kind === 169 /* TypeParameter */; } function isParameter(node) { - return node.kind === 169 /* Parameter */; + return node.kind === 170 /* Parameter */; } function isDecorator(node) { - return node.kind === 170 /* Decorator */; + return node.kind === 171 /* Decorator */; } function isPropertySignature(node) { - return node.kind === 171 /* PropertySignature */; + return node.kind === 172 /* PropertySignature */; } function isPropertyDeclaration(node) { - return node.kind === 172 /* PropertyDeclaration */; + return node.kind === 173 /* PropertyDeclaration */; } function isMethodSignature(node) { - return node.kind === 173 /* MethodSignature */; + return node.kind === 174 /* MethodSignature */; } function isMethodDeclaration(node) { - return node.kind === 174 /* MethodDeclaration */; + return node.kind === 175 /* MethodDeclaration */; } function isClassStaticBlockDeclaration(node) { - return node.kind === 175 /* ClassStaticBlockDeclaration */; + return node.kind === 176 /* ClassStaticBlockDeclaration */; } function isConstructorDeclaration(node) { - return node.kind === 176 /* Constructor */; + return node.kind === 177 /* Constructor */; } function isGetAccessorDeclaration(node) { - return node.kind === 177 /* GetAccessor */; + return node.kind === 178 /* GetAccessor */; } function isSetAccessorDeclaration(node) { - return node.kind === 178 /* SetAccessor */; + return node.kind === 179 /* SetAccessor */; } function isCallSignatureDeclaration(node) { - return node.kind === 179 /* CallSignature */; + return node.kind === 180 /* CallSignature */; } function isConstructSignatureDeclaration(node) { - return node.kind === 180 /* ConstructSignature */; + return node.kind === 181 /* ConstructSignature */; } function isIndexSignatureDeclaration(node) { - return node.kind === 181 /* IndexSignature */; + return node.kind === 182 /* IndexSignature */; } function isTypePredicateNode(node) { - return node.kind === 182 /* TypePredicate */; + return node.kind === 183 /* TypePredicate */; } function isTypeReferenceNode(node) { - return node.kind === 183 /* TypeReference */; + return node.kind === 184 /* TypeReference */; } function isFunctionTypeNode(node) { - return node.kind === 184 /* FunctionType */; + return node.kind === 185 /* FunctionType */; } function isConstructorTypeNode(node) { - return node.kind === 185 /* ConstructorType */; + return node.kind === 186 /* ConstructorType */; } function isTypeQueryNode(node) { - return node.kind === 186 /* TypeQuery */; + return node.kind === 187 /* TypeQuery */; } function isTypeLiteralNode(node) { - return node.kind === 187 /* TypeLiteral */; + return node.kind === 188 /* TypeLiteral */; } function isArrayTypeNode(node) { - return node.kind === 188 /* ArrayType */; + return node.kind === 189 /* ArrayType */; } function isTupleTypeNode(node) { - return node.kind === 189 /* TupleType */; + return node.kind === 190 /* TupleType */; } function isNamedTupleMember(node) { - return node.kind === 202 /* NamedTupleMember */; + return node.kind === 203 /* NamedTupleMember */; } function isOptionalTypeNode(node) { - return node.kind === 190 /* OptionalType */; + return node.kind === 191 /* OptionalType */; } function isRestTypeNode(node) { - return node.kind === 191 /* RestType */; + return node.kind === 192 /* RestType */; } function isUnionTypeNode(node) { - return node.kind === 192 /* UnionType */; + return node.kind === 193 /* UnionType */; } function isIntersectionTypeNode(node) { - return node.kind === 193 /* IntersectionType */; + return node.kind === 194 /* IntersectionType */; } function isConditionalTypeNode(node) { - return node.kind === 194 /* ConditionalType */; + return node.kind === 195 /* ConditionalType */; } function isInferTypeNode(node) { - return node.kind === 195 /* InferType */; + return node.kind === 196 /* InferType */; } function isParenthesizedTypeNode(node) { - return node.kind === 196 /* ParenthesizedType */; + return node.kind === 197 /* ParenthesizedType */; } function isThisTypeNode(node) { - return node.kind === 197 /* ThisType */; + return node.kind === 198 /* ThisType */; } function isTypeOperatorNode(node) { - return node.kind === 198 /* TypeOperator */; + return node.kind === 199 /* TypeOperator */; } function isIndexedAccessTypeNode(node) { - return node.kind === 199 /* IndexedAccessType */; + return node.kind === 200 /* IndexedAccessType */; } function isMappedTypeNode(node) { - return node.kind === 200 /* MappedType */; + return node.kind === 201 /* MappedType */; } function isLiteralTypeNode(node) { - return node.kind === 201 /* LiteralType */; + return node.kind === 202 /* LiteralType */; } function isImportTypeNode(node) { - return node.kind === 205 /* ImportType */; + return node.kind === 206 /* ImportType */; } function isTemplateLiteralTypeSpan(node) { - return node.kind === 204 /* TemplateLiteralTypeSpan */; + return node.kind === 205 /* TemplateLiteralTypeSpan */; } function isTemplateLiteralTypeNode(node) { - return node.kind === 203 /* TemplateLiteralType */; + return node.kind === 204 /* TemplateLiteralType */; } function isObjectBindingPattern(node) { - return node.kind === 206 /* ObjectBindingPattern */; + return node.kind === 207 /* ObjectBindingPattern */; } function isArrayBindingPattern(node) { - return node.kind === 207 /* ArrayBindingPattern */; + return node.kind === 208 /* ArrayBindingPattern */; } function isBindingElement(node) { - return node.kind === 208 /* BindingElement */; + return node.kind === 209 /* BindingElement */; } function isArrayLiteralExpression(node) { - return node.kind === 209 /* ArrayLiteralExpression */; + return node.kind === 210 /* ArrayLiteralExpression */; } function isObjectLiteralExpression(node) { - return node.kind === 210 /* ObjectLiteralExpression */; + return node.kind === 211 /* ObjectLiteralExpression */; } function isPropertyAccessExpression(node) { - return node.kind === 211 /* PropertyAccessExpression */; + return node.kind === 212 /* PropertyAccessExpression */; } function isElementAccessExpression(node) { - return node.kind === 212 /* ElementAccessExpression */; + return node.kind === 213 /* ElementAccessExpression */; } function isCallExpression(node) { - return node.kind === 213 /* CallExpression */; + return node.kind === 214 /* CallExpression */; } function isNewExpression(node) { - return node.kind === 214 /* NewExpression */; + return node.kind === 215 /* NewExpression */; } function isTaggedTemplateExpression(node) { - return node.kind === 215 /* TaggedTemplateExpression */; + return node.kind === 216 /* TaggedTemplateExpression */; } function isTypeAssertionExpression(node) { - return node.kind === 216 /* TypeAssertionExpression */; + return node.kind === 217 /* TypeAssertionExpression */; } function isParenthesizedExpression(node) { - return node.kind === 217 /* ParenthesizedExpression */; + return node.kind === 218 /* ParenthesizedExpression */; } function isFunctionExpression(node) { - return node.kind === 218 /* FunctionExpression */; + return node.kind === 219 /* FunctionExpression */; } function isArrowFunction(node) { - return node.kind === 219 /* ArrowFunction */; + return node.kind === 220 /* ArrowFunction */; } function isDeleteExpression(node) { - return node.kind === 220 /* DeleteExpression */; + return node.kind === 221 /* DeleteExpression */; } function isTypeOfExpression(node) { - return node.kind === 221 /* TypeOfExpression */; + return node.kind === 222 /* TypeOfExpression */; } function isVoidExpression(node) { - return node.kind === 222 /* VoidExpression */; + return node.kind === 223 /* VoidExpression */; } function isAwaitExpression(node) { - return node.kind === 223 /* AwaitExpression */; + return node.kind === 224 /* AwaitExpression */; } function isPrefixUnaryExpression(node) { - return node.kind === 224 /* PrefixUnaryExpression */; + return node.kind === 225 /* PrefixUnaryExpression */; } function isPostfixUnaryExpression(node) { - return node.kind === 225 /* PostfixUnaryExpression */; + return node.kind === 226 /* PostfixUnaryExpression */; } function isBinaryExpression(node) { - return node.kind === 226 /* BinaryExpression */; + return node.kind === 227 /* BinaryExpression */; } function isConditionalExpression(node) { - return node.kind === 227 /* ConditionalExpression */; + return node.kind === 228 /* ConditionalExpression */; } function isTemplateExpression(node) { - return node.kind === 228 /* TemplateExpression */; + return node.kind === 229 /* TemplateExpression */; } function isYieldExpression(node) { - return node.kind === 229 /* YieldExpression */; + return node.kind === 230 /* YieldExpression */; } function isSpreadElement(node) { - return node.kind === 230 /* SpreadElement */; + return node.kind === 231 /* SpreadElement */; } function isClassExpression(node) { - return node.kind === 231 /* ClassExpression */; + return node.kind === 232 /* ClassExpression */; } function isOmittedExpression(node) { - return node.kind === 232 /* OmittedExpression */; + return node.kind === 233 /* OmittedExpression */; } function isExpressionWithTypeArguments(node) { - return node.kind === 233 /* ExpressionWithTypeArguments */; + return node.kind === 234 /* ExpressionWithTypeArguments */; } function isAsExpression(node) { - return node.kind === 234 /* AsExpression */; + return node.kind === 235 /* AsExpression */; } function isSatisfiesExpression(node) { - return node.kind === 238 /* SatisfiesExpression */; + return node.kind === 239 /* SatisfiesExpression */; } function isNonNullExpression(node) { - return node.kind === 235 /* NonNullExpression */; + return node.kind === 236 /* NonNullExpression */; } function isMetaProperty(node) { - return node.kind === 236 /* MetaProperty */; + return node.kind === 237 /* MetaProperty */; } function isSyntheticExpression(node) { - return node.kind === 237 /* SyntheticExpression */; + return node.kind === 238 /* SyntheticExpression */; } function isPartiallyEmittedExpression(node) { - return node.kind === 355 /* PartiallyEmittedExpression */; + return node.kind === 356 /* PartiallyEmittedExpression */; } function isCommaListExpression(node) { - return node.kind === 356 /* CommaListExpression */; + return node.kind === 357 /* CommaListExpression */; } function isTemplateSpan(node) { - return node.kind === 239 /* TemplateSpan */; + return node.kind === 240 /* TemplateSpan */; } function isSemicolonClassElement(node) { - return node.kind === 240 /* SemicolonClassElement */; + return node.kind === 241 /* SemicolonClassElement */; } function isBlock(node) { - return node.kind === 241 /* Block */; + return node.kind === 242 /* Block */; } function isVariableStatement(node) { - return node.kind === 243 /* VariableStatement */; + return node.kind === 244 /* VariableStatement */; } function isEmptyStatement(node) { - return node.kind === 242 /* EmptyStatement */; + return node.kind === 243 /* EmptyStatement */; } function isExpressionStatement(node) { - return node.kind === 244 /* ExpressionStatement */; + return node.kind === 245 /* ExpressionStatement */; } function isIfStatement(node) { - return node.kind === 245 /* IfStatement */; + return node.kind === 246 /* IfStatement */; } function isDoStatement(node) { - return node.kind === 246 /* DoStatement */; + return node.kind === 247 /* DoStatement */; } function isWhileStatement(node) { - return node.kind === 247 /* WhileStatement */; + return node.kind === 248 /* WhileStatement */; } function isForStatement(node) { - return node.kind === 248 /* ForStatement */; + return node.kind === 249 /* ForStatement */; } function isForInStatement(node) { - return node.kind === 249 /* ForInStatement */; + return node.kind === 250 /* ForInStatement */; } function isForOfStatement(node) { - return node.kind === 250 /* ForOfStatement */; + return node.kind === 251 /* ForOfStatement */; } function isContinueStatement(node) { - return node.kind === 251 /* ContinueStatement */; + return node.kind === 252 /* ContinueStatement */; } function isBreakStatement(node) { - return node.kind === 252 /* BreakStatement */; + return node.kind === 253 /* BreakStatement */; } function isReturnStatement(node) { - return node.kind === 253 /* ReturnStatement */; + return node.kind === 254 /* ReturnStatement */; } function isWithStatement(node) { - return node.kind === 254 /* WithStatement */; + return node.kind === 255 /* WithStatement */; } function isSwitchStatement(node) { - return node.kind === 255 /* SwitchStatement */; + return node.kind === 256 /* SwitchStatement */; } function isLabeledStatement(node) { - return node.kind === 256 /* LabeledStatement */; + return node.kind === 257 /* LabeledStatement */; } function isThrowStatement(node) { - return node.kind === 257 /* ThrowStatement */; + return node.kind === 258 /* ThrowStatement */; } function isTryStatement(node) { - return node.kind === 258 /* TryStatement */; + return node.kind === 259 /* TryStatement */; } function isDebuggerStatement(node) { - return node.kind === 259 /* DebuggerStatement */; + return node.kind === 260 /* DebuggerStatement */; } function isVariableDeclaration(node) { - return node.kind === 260 /* VariableDeclaration */; + return node.kind === 261 /* VariableDeclaration */; } function isVariableDeclarationList(node) { - return node.kind === 261 /* VariableDeclarationList */; + return node.kind === 262 /* VariableDeclarationList */; } function isFunctionDeclaration(node) { - return node.kind === 262 /* FunctionDeclaration */; + return node.kind === 263 /* FunctionDeclaration */; } function isClassDeclaration(node) { - return node.kind === 263 /* ClassDeclaration */; + return node.kind === 264 /* ClassDeclaration */; } function isInterfaceDeclaration(node) { - return node.kind === 264 /* InterfaceDeclaration */; + return node.kind === 265 /* InterfaceDeclaration */; } function isTypeAliasDeclaration(node) { - return node.kind === 265 /* TypeAliasDeclaration */; + return node.kind === 266 /* TypeAliasDeclaration */; } function isEnumDeclaration(node) { - return node.kind === 266 /* EnumDeclaration */; + return node.kind === 267 /* EnumDeclaration */; } function isModuleDeclaration(node) { - return node.kind === 267 /* ModuleDeclaration */; + return node.kind === 268 /* ModuleDeclaration */; } function isModuleBlock(node) { - return node.kind === 268 /* ModuleBlock */; + return node.kind === 269 /* ModuleBlock */; } function isCaseBlock(node) { - return node.kind === 269 /* CaseBlock */; + return node.kind === 270 /* CaseBlock */; } function isNamespaceExportDeclaration(node) { - return node.kind === 270 /* NamespaceExportDeclaration */; + return node.kind === 271 /* NamespaceExportDeclaration */; } function isImportEqualsDeclaration(node) { - return node.kind === 271 /* ImportEqualsDeclaration */; + return node.kind === 272 /* ImportEqualsDeclaration */; } function isImportDeclaration(node) { - return node.kind === 272 /* ImportDeclaration */; + return node.kind === 273 /* ImportDeclaration */; } function isImportClause(node) { - return node.kind === 273 /* ImportClause */; + return node.kind === 274 /* ImportClause */; } function isImportTypeAssertionContainer(node) { - return node.kind === 302 /* ImportTypeAssertionContainer */; + return node.kind === 303 /* ImportTypeAssertionContainer */; } function isAssertClause(node) { - return node.kind === 300 /* AssertClause */; + return node.kind === 301 /* AssertClause */; } function isAssertEntry(node) { - return node.kind === 301 /* AssertEntry */; + return node.kind === 302 /* AssertEntry */; } function isImportAttributes(node) { - return node.kind === 300 /* ImportAttributes */; + return node.kind === 301 /* ImportAttributes */; } function isImportAttribute(node) { - return node.kind === 301 /* ImportAttribute */; + return node.kind === 302 /* ImportAttribute */; } function isNamespaceImport(node) { - return node.kind === 274 /* NamespaceImport */; + return node.kind === 275 /* NamespaceImport */; } function isNamespaceExport(node) { - return node.kind === 280 /* NamespaceExport */; + return node.kind === 281 /* NamespaceExport */; } function isNamedImports(node) { - return node.kind === 275 /* NamedImports */; + return node.kind === 276 /* NamedImports */; } function isImportSpecifier(node) { - return node.kind === 276 /* ImportSpecifier */; + return node.kind === 277 /* ImportSpecifier */; } function isExportAssignment(node) { - return node.kind === 277 /* ExportAssignment */; + return node.kind === 278 /* ExportAssignment */; } function isExportDeclaration(node) { - return node.kind === 278 /* ExportDeclaration */; + return node.kind === 279 /* ExportDeclaration */; } function isNamedExports(node) { - return node.kind === 279 /* NamedExports */; + return node.kind === 280 /* NamedExports */; } function isExportSpecifier(node) { - return node.kind === 281 /* ExportSpecifier */; + return node.kind === 282 /* ExportSpecifier */; } function isModuleExportName(node) { return node.kind === 80 /* Identifier */ || node.kind === 11 /* StringLiteral */; } function isMissingDeclaration(node) { - return node.kind === 282 /* MissingDeclaration */; + return node.kind === 283 /* MissingDeclaration */; } function isNotEmittedStatement(node) { - return node.kind === 353 /* NotEmittedStatement */; + return node.kind === 354 /* NotEmittedStatement */; } function isSyntheticReference(node) { - return node.kind === 357 /* SyntheticReferenceExpression */; + return node.kind === 358 /* SyntheticReferenceExpression */; } function isExternalModuleReference(node) { - return node.kind === 283 /* ExternalModuleReference */; + return node.kind === 284 /* ExternalModuleReference */; } function isJsxElement(node) { - return node.kind === 284 /* JsxElement */; + return node.kind === 285 /* JsxElement */; } function isJsxSelfClosingElement(node) { - return node.kind === 285 /* JsxSelfClosingElement */; + return node.kind === 286 /* JsxSelfClosingElement */; } function isJsxOpeningElement(node) { - return node.kind === 286 /* JsxOpeningElement */; + return node.kind === 287 /* JsxOpeningElement */; } function isJsxClosingElement(node) { - return node.kind === 287 /* JsxClosingElement */; + return node.kind === 288 /* JsxClosingElement */; } function isJsxFragment(node) { - return node.kind === 288 /* JsxFragment */; + return node.kind === 289 /* JsxFragment */; } function isJsxOpeningFragment(node) { - return node.kind === 289 /* JsxOpeningFragment */; + return node.kind === 290 /* JsxOpeningFragment */; } function isJsxClosingFragment(node) { - return node.kind === 290 /* JsxClosingFragment */; + return node.kind === 291 /* JsxClosingFragment */; } function isJsxAttribute(node) { - return node.kind === 291 /* JsxAttribute */; + return node.kind === 292 /* JsxAttribute */; } function isJsxAttributes(node) { - return node.kind === 292 /* JsxAttributes */; + return node.kind === 293 /* JsxAttributes */; } function isJsxSpreadAttribute(node) { - return node.kind === 293 /* JsxSpreadAttribute */; + return node.kind === 294 /* JsxSpreadAttribute */; } function isJsxExpression(node) { - return node.kind === 294 /* JsxExpression */; + return node.kind === 295 /* JsxExpression */; } function isJsxNamespacedName(node) { - return node.kind === 295 /* JsxNamespacedName */; + return node.kind === 296 /* JsxNamespacedName */; } function isCaseClause(node) { - return node.kind === 296 /* CaseClause */; + return node.kind === 297 /* CaseClause */; } function isDefaultClause(node) { - return node.kind === 297 /* DefaultClause */; + return node.kind === 298 /* DefaultClause */; } function isHeritageClause(node) { - return node.kind === 298 /* HeritageClause */; + return node.kind === 299 /* HeritageClause */; } function isCatchClause(node) { - return node.kind === 299 /* CatchClause */; + return node.kind === 300 /* CatchClause */; } function isPropertyAssignment(node) { - return node.kind === 303 /* PropertyAssignment */; + return node.kind === 304 /* PropertyAssignment */; } function isShorthandPropertyAssignment(node) { - return node.kind === 304 /* ShorthandPropertyAssignment */; + return node.kind === 305 /* ShorthandPropertyAssignment */; } function isSpreadAssignment(node) { - return node.kind === 305 /* SpreadAssignment */; + return node.kind === 306 /* SpreadAssignment */; } function isEnumMember(node) { - return node.kind === 306 /* EnumMember */; + return node.kind === 307 /* EnumMember */; } function isSourceFile(node) { - return node.kind === 307 /* SourceFile */; + return node.kind === 308 /* SourceFile */; } function isBundle(node) { - return node.kind === 308 /* Bundle */; + return node.kind === 309 /* Bundle */; } function isJSDocTypeExpression(node) { - return node.kind === 309 /* JSDocTypeExpression */; + return node.kind === 310 /* JSDocTypeExpression */; } function isJSDocNameReference(node) { - return node.kind === 310 /* JSDocNameReference */; + return node.kind === 311 /* JSDocNameReference */; } function isJSDocMemberName(node) { - return node.kind === 311 /* JSDocMemberName */; + return node.kind === 312 /* JSDocMemberName */; } function isJSDocLink(node) { - return node.kind === 324 /* JSDocLink */; + return node.kind === 325 /* JSDocLink */; } function isJSDocLinkCode(node) { - return node.kind === 325 /* JSDocLinkCode */; + return node.kind === 326 /* JSDocLinkCode */; } function isJSDocLinkPlain(node) { - return node.kind === 326 /* JSDocLinkPlain */; + return node.kind === 327 /* JSDocLinkPlain */; } function isJSDocAllType(node) { - return node.kind === 312 /* JSDocAllType */; + return node.kind === 313 /* JSDocAllType */; } function isJSDocUnknownType(node) { - return node.kind === 313 /* JSDocUnknownType */; + return node.kind === 314 /* JSDocUnknownType */; } function isJSDocNullableType(node) { - return node.kind === 314 /* JSDocNullableType */; + return node.kind === 315 /* JSDocNullableType */; } function isJSDocNonNullableType(node) { - return node.kind === 315 /* JSDocNonNullableType */; + return node.kind === 316 /* JSDocNonNullableType */; } function isJSDocOptionalType(node) { - return node.kind === 316 /* JSDocOptionalType */; + return node.kind === 317 /* JSDocOptionalType */; } function isJSDocFunctionType(node) { - return node.kind === 317 /* JSDocFunctionType */; + return node.kind === 318 /* JSDocFunctionType */; } function isJSDocVariadicType(node) { - return node.kind === 318 /* JSDocVariadicType */; + return node.kind === 319 /* JSDocVariadicType */; } function isJSDocNamepathType(node) { - return node.kind === 319 /* JSDocNamepathType */; + return node.kind === 320 /* JSDocNamepathType */; } function isJSDoc(node) { - return node.kind === 320 /* JSDoc */; + return node.kind === 321 /* JSDoc */; } function isJSDocTypeLiteral(node) { - return node.kind === 322 /* JSDocTypeLiteral */; + return node.kind === 323 /* JSDocTypeLiteral */; } function isJSDocSignature(node) { - return node.kind === 323 /* JSDocSignature */; + return node.kind === 324 /* JSDocSignature */; } function isJSDocAugmentsTag(node) { - return node.kind === 328 /* JSDocAugmentsTag */; + return node.kind === 329 /* JSDocAugmentsTag */; } function isJSDocAuthorTag(node) { - return node.kind === 330 /* JSDocAuthorTag */; + return node.kind === 331 /* JSDocAuthorTag */; } function isJSDocClassTag(node) { - return node.kind === 332 /* JSDocClassTag */; + return node.kind === 333 /* JSDocClassTag */; } function isJSDocCallbackTag(node) { - return node.kind === 338 /* JSDocCallbackTag */; + return node.kind === 339 /* JSDocCallbackTag */; } function isJSDocPublicTag(node) { - return node.kind === 333 /* JSDocPublicTag */; + return node.kind === 334 /* JSDocPublicTag */; } function isJSDocPrivateTag(node) { - return node.kind === 334 /* JSDocPrivateTag */; + return node.kind === 335 /* JSDocPrivateTag */; } function isJSDocProtectedTag(node) { - return node.kind === 335 /* JSDocProtectedTag */; + return node.kind === 336 /* JSDocProtectedTag */; } function isJSDocReadonlyTag(node) { - return node.kind === 336 /* JSDocReadonlyTag */; + return node.kind === 337 /* JSDocReadonlyTag */; } function isJSDocOverrideTag(node) { - return node.kind === 337 /* JSDocOverrideTag */; + return node.kind === 338 /* JSDocOverrideTag */; } function isJSDocOverloadTag(node) { - return node.kind === 339 /* JSDocOverloadTag */; + return node.kind === 340 /* JSDocOverloadTag */; } function isJSDocDeprecatedTag(node) { - return node.kind === 331 /* JSDocDeprecatedTag */; + return node.kind === 332 /* JSDocDeprecatedTag */; } function isJSDocSeeTag(node) { - return node.kind === 347 /* JSDocSeeTag */; + return node.kind === 348 /* JSDocSeeTag */; } function isJSDocEnumTag(node) { - return node.kind === 340 /* JSDocEnumTag */; + return node.kind === 341 /* JSDocEnumTag */; } function isJSDocParameterTag(node) { - return node.kind === 341 /* JSDocParameterTag */; + return node.kind === 342 /* JSDocParameterTag */; } function isJSDocReturnTag(node) { - return node.kind === 342 /* JSDocReturnTag */; + return node.kind === 343 /* JSDocReturnTag */; } function isJSDocThisTag(node) { - return node.kind === 343 /* JSDocThisTag */; + return node.kind === 344 /* JSDocThisTag */; } function isJSDocTypeTag(node) { - return node.kind === 344 /* JSDocTypeTag */; + return node.kind === 345 /* JSDocTypeTag */; } function isJSDocTemplateTag(node) { - return node.kind === 345 /* JSDocTemplateTag */; + return node.kind === 346 /* JSDocTemplateTag */; } function isJSDocTypedefTag(node) { - return node.kind === 346 /* JSDocTypedefTag */; + return node.kind === 347 /* JSDocTypedefTag */; } function isJSDocUnknownTag(node) { - return node.kind === 327 /* JSDocTag */; + return node.kind === 328 /* JSDocTag */; } function isJSDocPropertyTag(node) { - return node.kind === 348 /* JSDocPropertyTag */; + return node.kind === 349 /* JSDocPropertyTag */; } function isJSDocImplementsTag(node) { - return node.kind === 329 /* JSDocImplementsTag */; + return node.kind === 330 /* JSDocImplementsTag */; } function isJSDocSatisfiesTag(node) { - return node.kind === 350 /* JSDocSatisfiesTag */; + return node.kind === 351 /* JSDocSatisfiesTag */; } function isJSDocThrowsTag(node) { - return node.kind === 349 /* JSDocThrowsTag */; + return node.kind === 350 /* JSDocThrowsTag */; } function isJSDocImportTag(node) { - return node.kind === 351 /* JSDocImportTag */; + return node.kind === 352 /* JSDocImportTag */; } function isSyntaxList(n) { - return n.kind === 352 /* SyntaxList */; + return n.kind === 353 /* SyntaxList */; } // src/compiler/factory/nodeChildren.ts @@ -31180,13 +31308,13 @@ function getNodeChildren(node, sourceFile) { if (!isNodeKind(kind)) { return emptyArray; } - if (kind === 352 /* SyntaxList */) { + if (kind === 353 /* SyntaxList */) { return node._children; } return (_a = sourceFileToNodeChildren.get(sourceFile)) == null ? void 0 : _a.get(node); } function setNodeChildren(node, sourceFile, children) { - if (node.kind === 352 /* SyntaxList */) { + if (node.kind === 353 /* SyntaxList */) { Debug.fail("Should not need to re-set the children of a SyntaxList."); } let map2 = sourceFileToNodeChildren.get(sourceFile); @@ -31199,7 +31327,7 @@ function setNodeChildren(node, sourceFile, children) { } function unsetNodeChildren(node, origSourceFile) { var _a; - if (node.kind === 352 /* SyntaxList */) { + if (node.kind === 353 /* SyntaxList */) { Debug.fail("Did not expect to unset the children of a SyntaxList."); } (_a = sourceFileToNodeChildren.get(origSourceFile)) == null ? void 0 : _a.delete(node); @@ -31506,14 +31634,14 @@ function createExpressionForObjectLiteralElementLike(factory2, node, property, r Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return createExpressionForAccessorDeclaration(factory2, node.properties, property, receiver, !!node.multiLine); - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return createExpressionForPropertyAssignment(factory2, property, receiver); - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(factory2, property, receiver); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return createExpressionForMethodDeclaration(factory2, property, receiver); } } @@ -31566,7 +31694,7 @@ function startsWithUseStrict(statements) { return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement); } function isCommaExpression(node) { - return node.kind === 226 /* BinaryExpression */ && node.operatorToken.kind === 28 /* CommaToken */; + return node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 28 /* CommaToken */; } function isCommaSequence(node) { return isCommaExpression(node) || isCommaListExpression(node); @@ -31581,21 +31709,21 @@ function getJSDocTypeAssertionType(node) { } function isOuterExpression(node, kinds = 63 /* All */) { switch (node.kind) { - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: if (kinds & -2147483648 /* ExcludeJSDocTypeAssertion */ && isJSDocTypeAssertion(node)) { return false; } return (kinds & 1 /* Parentheses */) !== 0; - case 216 /* TypeAssertionExpression */: - case 234 /* AsExpression */: + case 217 /* TypeAssertionExpression */: + case 235 /* AsExpression */: return (kinds & 2 /* TypeAssertions */) !== 0; - case 238 /* SatisfiesExpression */: + case 239 /* SatisfiesExpression */: return (kinds & (2 /* TypeAssertions */ | 32 /* Satisfies */)) !== 0; - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return (kinds & 16 /* ExpressionsWithTypeArguments */) !== 0; - case 235 /* NonNullExpression */: + case 236 /* NonNullExpression */: return (kinds & 4 /* NonNullAssertions */) !== 0; - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -31636,7 +31764,7 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto const moduleKind = getEmitModuleKind(compilerOptions); const impliedModuleKind = getImpliedNodeFormatForEmitWorker(sourceFile, compilerOptions); const helpers = getImportedHelpers(sourceFile); - if (moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */ || impliedModuleKind === 99 /* ESNext */ || impliedModuleKind === void 0 && moduleKind === 200 /* Preserve */) { + if (impliedModuleKind !== 1 /* CommonJS */ && (moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */ || impliedModuleKind === 99 /* ESNext */ || impliedModuleKind === void 0 && moduleKind === 200 /* Preserve */)) { if (helpers) { const helperNames = []; for (const helper of helpers) { @@ -31668,8 +31796,8 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto /*modifiers*/ void 0, nodeFactory.createImportClause( - /*isTypeOnly*/ - false, + /*phaseModifier*/ + void 0, /*name*/ void 0, namedBindings @@ -31723,10 +31851,10 @@ function getLocalNameForExternalImport(factory2, node, sourceFile) { } return isGeneratedIdentifier(name) ? name : factory2.createIdentifier(getSourceTextOfNodeFromSourceFile(sourceFile, name) || idText(name)); } - if (node.kind === 272 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 273 /* ImportDeclaration */ && node.importClause) { return factory2.getGeneratedNameForNode(node); } - if (node.kind === 278 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 279 /* ExportDeclaration */ && node.moduleSpecifier) { return factory2.getGeneratedNameForNode(node); } return void 0; @@ -31789,11 +31917,11 @@ function getTargetOfBindingOrAssignmentElement(bindingElement) { } if (isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return bindingElement.name; - case 305 /* SpreadAssignment */: + case 306 /* SpreadAssignment */: return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } return void 0; @@ -31812,11 +31940,11 @@ function getTargetOfBindingOrAssignmentElement(bindingElement) { } function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 169 /* Parameter */: - case 208 /* BindingElement */: + case 170 /* Parameter */: + case 209 /* BindingElement */: return bindingElement.dotDotDotToken; - case 230 /* SpreadElement */: - case 305 /* SpreadAssignment */: + case 231 /* SpreadElement */: + case 306 /* SpreadAssignment */: return bindingElement; } return void 0; @@ -31828,7 +31956,7 @@ function getPropertyNameOfBindingOrAssignmentElement(bindingElement) { } function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 208 /* BindingElement */: + case 209 /* BindingElement */: if (bindingElement.propertyName) { const propertyName = bindingElement.propertyName; if (isPrivateIdentifier(propertyName)) { @@ -31837,7 +31965,7 @@ function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { return isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName; } break; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: if (bindingElement.name) { const propertyName = bindingElement.name; if (isPrivateIdentifier(propertyName)) { @@ -31846,7 +31974,7 @@ function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { return isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName; } break; - case 305 /* SpreadAssignment */: + case 306 /* SpreadAssignment */: if (bindingElement.name && isPrivateIdentifier(bindingElement.name)) { return Debug.failBadSyntaxKind(bindingElement.name); } @@ -31863,11 +31991,11 @@ function isStringOrNumericLiteral(node) { } function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 206 /* ObjectBindingPattern */: - case 207 /* ArrayBindingPattern */: - case 209 /* ArrayLiteralExpression */: + case 207 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: + case 210 /* ArrayLiteralExpression */: return name.elements; - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return name.properties; } } @@ -31884,19 +32012,19 @@ function getJSDocTypeAliasName(fullName) { } function canHaveIllegalType(node) { const kind = node.kind; - return kind === 176 /* Constructor */ || kind === 178 /* SetAccessor */; + return kind === 177 /* Constructor */ || kind === 179 /* SetAccessor */; } function canHaveIllegalTypeParameters(node) { const kind = node.kind; - return kind === 176 /* Constructor */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */; + return kind === 177 /* Constructor */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */; } function canHaveIllegalDecorators(node) { const kind = node.kind; - return kind === 303 /* PropertyAssignment */ || kind === 304 /* ShorthandPropertyAssignment */ || kind === 262 /* FunctionDeclaration */ || kind === 176 /* Constructor */ || kind === 181 /* IndexSignature */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 282 /* MissingDeclaration */ || kind === 243 /* VariableStatement */ || kind === 264 /* InterfaceDeclaration */ || kind === 265 /* TypeAliasDeclaration */ || kind === 266 /* EnumDeclaration */ || kind === 267 /* ModuleDeclaration */ || kind === 271 /* ImportEqualsDeclaration */ || kind === 272 /* ImportDeclaration */ || kind === 270 /* NamespaceExportDeclaration */ || kind === 278 /* ExportDeclaration */ || kind === 277 /* ExportAssignment */; + return kind === 304 /* PropertyAssignment */ || kind === 305 /* ShorthandPropertyAssignment */ || kind === 263 /* FunctionDeclaration */ || kind === 177 /* Constructor */ || kind === 182 /* IndexSignature */ || kind === 176 /* ClassStaticBlockDeclaration */ || kind === 283 /* MissingDeclaration */ || kind === 244 /* VariableStatement */ || kind === 265 /* InterfaceDeclaration */ || kind === 266 /* TypeAliasDeclaration */ || kind === 267 /* EnumDeclaration */ || kind === 268 /* ModuleDeclaration */ || kind === 272 /* ImportEqualsDeclaration */ || kind === 273 /* ImportDeclaration */ || kind === 271 /* NamespaceExportDeclaration */ || kind === 279 /* ExportDeclaration */ || kind === 278 /* ExportAssignment */; } function canHaveIllegalModifiers(node) { const kind = node.kind; - return kind === 175 /* ClassStaticBlockDeclaration */ || kind === 303 /* PropertyAssignment */ || kind === 304 /* ShorthandPropertyAssignment */ || kind === 282 /* MissingDeclaration */ || kind === 270 /* NamespaceExportDeclaration */; + return kind === 176 /* ClassStaticBlockDeclaration */ || kind === 304 /* PropertyAssignment */ || kind === 305 /* ShorthandPropertyAssignment */ || kind === 283 /* MissingDeclaration */ || kind === 271 /* NamespaceExportDeclaration */; } function isQuestionOrExclamationToken(node) { return isQuestionToken(node) || isExclamationToken(node); @@ -32283,11 +32411,11 @@ function setTextRange(range, location) { } function canHaveModifiers(node) { const kind = node.kind; - return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 173 /* MethodSignature */ || kind === 174 /* MethodDeclaration */ || kind === 176 /* Constructor */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 181 /* IndexSignature */ || kind === 185 /* ConstructorType */ || kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */ || kind === 231 /* ClassExpression */ || kind === 243 /* VariableStatement */ || kind === 262 /* FunctionDeclaration */ || kind === 263 /* ClassDeclaration */ || kind === 264 /* InterfaceDeclaration */ || kind === 265 /* TypeAliasDeclaration */ || kind === 266 /* EnumDeclaration */ || kind === 267 /* ModuleDeclaration */ || kind === 271 /* ImportEqualsDeclaration */ || kind === 272 /* ImportDeclaration */ || kind === 277 /* ExportAssignment */ || kind === 278 /* ExportDeclaration */; + return kind === 169 /* TypeParameter */ || kind === 170 /* Parameter */ || kind === 172 /* PropertySignature */ || kind === 173 /* PropertyDeclaration */ || kind === 174 /* MethodSignature */ || kind === 175 /* MethodDeclaration */ || kind === 177 /* Constructor */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */ || kind === 182 /* IndexSignature */ || kind === 186 /* ConstructorType */ || kind === 219 /* FunctionExpression */ || kind === 220 /* ArrowFunction */ || kind === 232 /* ClassExpression */ || kind === 244 /* VariableStatement */ || kind === 263 /* FunctionDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 265 /* InterfaceDeclaration */ || kind === 266 /* TypeAliasDeclaration */ || kind === 267 /* EnumDeclaration */ || kind === 268 /* ModuleDeclaration */ || kind === 272 /* ImportEqualsDeclaration */ || kind === 273 /* ImportDeclaration */ || kind === 278 /* ExportAssignment */ || kind === 279 /* ExportDeclaration */; } function canHaveDecorators(node) { const kind = node.kind; - return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 231 /* ClassExpression */ || kind === 263 /* ClassDeclaration */; + return kind === 170 /* Parameter */ || kind === 173 /* PropertyDeclaration */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */ || kind === 232 /* ClassExpression */ || kind === 264 /* ClassDeclaration */; } // src/compiler/parser.ts @@ -32342,429 +32470,429 @@ function isImportMeta2(node) { return isMetaProperty(node) && node.keywordToken === 102 /* ImportKeyword */ && node.name.escapedText === "meta"; } var forEachChildTable = { - [166 /* QualifiedName */]: function forEachChildInQualifiedName(node, cbNode, _cbNodes) { + [167 /* QualifiedName */]: function forEachChildInQualifiedName(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right); }, - [168 /* TypeParameter */]: function forEachChildInTypeParameter(node, cbNode, cbNodes) { + [169 /* TypeParameter */]: function forEachChildInTypeParameter(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.constraint) || visitNode2(cbNode, node.default) || visitNode2(cbNode, node.expression); }, - [304 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) { + [305 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.equalsToken) || visitNode2(cbNode, node.objectAssignmentInitializer); }, - [305 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) { + [306 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [169 /* Parameter */]: function forEachChildInParameter(node, cbNode, cbNodes) { + [170 /* Parameter */]: function forEachChildInParameter(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); }, - [172 /* PropertyDeclaration */]: function forEachChildInPropertyDeclaration(node, cbNode, cbNodes) { + [173 /* PropertyDeclaration */]: function forEachChildInPropertyDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); }, - [171 /* PropertySignature */]: function forEachChildInPropertySignature(node, cbNode, cbNodes) { + [172 /* PropertySignature */]: function forEachChildInPropertySignature(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); }, - [303 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) { + [304 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.initializer); }, - [260 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) { + [261 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); }, - [208 /* BindingElement */]: function forEachChildInBindingElement(node, cbNode, _cbNodes) { + [209 /* BindingElement */]: function forEachChildInBindingElement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.propertyName) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); }, - [181 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) { + [182 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, - [185 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) { + [186 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, - [184 /* FunctionType */]: function forEachChildInFunctionType(node, cbNode, cbNodes) { + [185 /* FunctionType */]: function forEachChildInFunctionType(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, - [179 /* CallSignature */]: forEachChildInCallOrConstructSignature, - [180 /* ConstructSignature */]: forEachChildInCallOrConstructSignature, - [174 /* MethodDeclaration */]: function forEachChildInMethodDeclaration(node, cbNode, cbNodes) { + [180 /* CallSignature */]: forEachChildInCallOrConstructSignature, + [181 /* ConstructSignature */]: forEachChildInCallOrConstructSignature, + [175 /* MethodDeclaration */]: function forEachChildInMethodDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, - [173 /* MethodSignature */]: function forEachChildInMethodSignature(node, cbNode, cbNodes) { + [174 /* MethodSignature */]: function forEachChildInMethodSignature(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, - [176 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) { + [177 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, - [177 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) { + [178 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, - [178 /* SetAccessor */]: function forEachChildInSetAccessor(node, cbNode, cbNodes) { + [179 /* SetAccessor */]: function forEachChildInSetAccessor(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, - [262 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) { + [263 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, - [218 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) { + [219 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, - [219 /* ArrowFunction */]: function forEachChildInArrowFunction(node, cbNode, cbNodes) { + [220 /* ArrowFunction */]: function forEachChildInArrowFunction(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.equalsGreaterThanToken) || visitNode2(cbNode, node.body); }, - [175 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) { + [176 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body); }, - [183 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) { + [184 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) { return visitNode2(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); }, - [182 /* TypePredicate */]: function forEachChildInTypePredicate(node, cbNode, _cbNodes) { + [183 /* TypePredicate */]: function forEachChildInTypePredicate(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.assertsModifier) || visitNode2(cbNode, node.parameterName) || visitNode2(cbNode, node.type); }, - [186 /* TypeQuery */]: function forEachChildInTypeQuery(node, cbNode, cbNodes) { + [187 /* TypeQuery */]: function forEachChildInTypeQuery(node, cbNode, cbNodes) { return visitNode2(cbNode, node.exprName) || visitNodes(cbNode, cbNodes, node.typeArguments); }, - [187 /* TypeLiteral */]: function forEachChildInTypeLiteral(node, cbNode, cbNodes) { + [188 /* TypeLiteral */]: function forEachChildInTypeLiteral(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.members); }, - [188 /* ArrayType */]: function forEachChildInArrayType(node, cbNode, _cbNodes) { + [189 /* ArrayType */]: function forEachChildInArrayType(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.elementType); }, - [189 /* TupleType */]: function forEachChildInTupleType(node, cbNode, cbNodes) { + [190 /* TupleType */]: function forEachChildInTupleType(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.elements); }, - [192 /* UnionType */]: forEachChildInUnionOrIntersectionType, - [193 /* IntersectionType */]: forEachChildInUnionOrIntersectionType, - [194 /* ConditionalType */]: function forEachChildInConditionalType(node, cbNode, _cbNodes) { + [193 /* UnionType */]: forEachChildInUnionOrIntersectionType, + [194 /* IntersectionType */]: forEachChildInUnionOrIntersectionType, + [195 /* ConditionalType */]: function forEachChildInConditionalType(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.checkType) || visitNode2(cbNode, node.extendsType) || visitNode2(cbNode, node.trueType) || visitNode2(cbNode, node.falseType); }, - [195 /* InferType */]: function forEachChildInInferType(node, cbNode, _cbNodes) { + [196 /* InferType */]: function forEachChildInInferType(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.typeParameter); }, - [205 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) { + [206 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) { return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.attributes) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); }, - [302 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) { + [303 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.assertClause); }, - [196 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator, - [198 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator, - [199 /* IndexedAccessType */]: function forEachChildInIndexedAccessType(node, cbNode, _cbNodes) { + [197 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator, + [199 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator, + [200 /* IndexedAccessType */]: function forEachChildInIndexedAccessType(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.objectType) || visitNode2(cbNode, node.indexType); }, - [200 /* MappedType */]: function forEachChildInMappedType(node, cbNode, cbNodes) { + [201 /* MappedType */]: function forEachChildInMappedType(node, cbNode, cbNodes) { return visitNode2(cbNode, node.readonlyToken) || visitNode2(cbNode, node.typeParameter) || visitNode2(cbNode, node.nameType) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNodes(cbNode, cbNodes, node.members); }, - [201 /* LiteralType */]: function forEachChildInLiteralType(node, cbNode, _cbNodes) { + [202 /* LiteralType */]: function forEachChildInLiteralType(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.literal); }, - [202 /* NamedTupleMember */]: function forEachChildInNamedTupleMember(node, cbNode, _cbNodes) { + [203 /* NamedTupleMember */]: function forEachChildInNamedTupleMember(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type); }, - [206 /* ObjectBindingPattern */]: forEachChildInObjectOrArrayBindingPattern, - [207 /* ArrayBindingPattern */]: forEachChildInObjectOrArrayBindingPattern, - [209 /* ArrayLiteralExpression */]: function forEachChildInArrayLiteralExpression(node, cbNode, cbNodes) { + [207 /* ObjectBindingPattern */]: forEachChildInObjectOrArrayBindingPattern, + [208 /* ArrayBindingPattern */]: forEachChildInObjectOrArrayBindingPattern, + [210 /* ArrayLiteralExpression */]: function forEachChildInArrayLiteralExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.elements); }, - [210 /* ObjectLiteralExpression */]: function forEachChildInObjectLiteralExpression(node, cbNode, cbNodes) { + [211 /* ObjectLiteralExpression */]: function forEachChildInObjectLiteralExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.properties); }, - [211 /* PropertyAccessExpression */]: function forEachChildInPropertyAccessExpression(node, cbNode, _cbNodes) { + [212 /* PropertyAccessExpression */]: function forEachChildInPropertyAccessExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.name); }, - [212 /* ElementAccessExpression */]: function forEachChildInElementAccessExpression(node, cbNode, _cbNodes) { + [213 /* ElementAccessExpression */]: function forEachChildInElementAccessExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.argumentExpression); }, - [213 /* CallExpression */]: forEachChildInCallOrNewExpression, - [214 /* NewExpression */]: forEachChildInCallOrNewExpression, - [215 /* TaggedTemplateExpression */]: function forEachChildInTaggedTemplateExpression(node, cbNode, cbNodes) { + [214 /* CallExpression */]: forEachChildInCallOrNewExpression, + [215 /* NewExpression */]: forEachChildInCallOrNewExpression, + [216 /* TaggedTemplateExpression */]: function forEachChildInTaggedTemplateExpression(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tag) || visitNode2(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode2(cbNode, node.template); }, - [216 /* TypeAssertionExpression */]: function forEachChildInTypeAssertionExpression(node, cbNode, _cbNodes) { + [217 /* TypeAssertionExpression */]: function forEachChildInTypeAssertionExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.expression); }, - [217 /* ParenthesizedExpression */]: function forEachChildInParenthesizedExpression(node, cbNode, _cbNodes) { + [218 /* ParenthesizedExpression */]: function forEachChildInParenthesizedExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [220 /* DeleteExpression */]: function forEachChildInDeleteExpression(node, cbNode, _cbNodes) { + [221 /* DeleteExpression */]: function forEachChildInDeleteExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [221 /* TypeOfExpression */]: function forEachChildInTypeOfExpression(node, cbNode, _cbNodes) { + [222 /* TypeOfExpression */]: function forEachChildInTypeOfExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [222 /* VoidExpression */]: function forEachChildInVoidExpression(node, cbNode, _cbNodes) { + [223 /* VoidExpression */]: function forEachChildInVoidExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [224 /* PrefixUnaryExpression */]: function forEachChildInPrefixUnaryExpression(node, cbNode, _cbNodes) { + [225 /* PrefixUnaryExpression */]: function forEachChildInPrefixUnaryExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.operand); }, - [229 /* YieldExpression */]: function forEachChildInYieldExpression(node, cbNode, _cbNodes) { + [230 /* YieldExpression */]: function forEachChildInYieldExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.expression); }, - [223 /* AwaitExpression */]: function forEachChildInAwaitExpression(node, cbNode, _cbNodes) { + [224 /* AwaitExpression */]: function forEachChildInAwaitExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [225 /* PostfixUnaryExpression */]: function forEachChildInPostfixUnaryExpression(node, cbNode, _cbNodes) { + [226 /* PostfixUnaryExpression */]: function forEachChildInPostfixUnaryExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.operand); }, - [226 /* BinaryExpression */]: function forEachChildInBinaryExpression(node, cbNode, _cbNodes) { + [227 /* BinaryExpression */]: function forEachChildInBinaryExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.operatorToken) || visitNode2(cbNode, node.right); }, - [234 /* AsExpression */]: function forEachChildInAsExpression(node, cbNode, _cbNodes) { + [235 /* AsExpression */]: function forEachChildInAsExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type); }, - [235 /* NonNullExpression */]: function forEachChildInNonNullExpression(node, cbNode, _cbNodes) { + [236 /* NonNullExpression */]: function forEachChildInNonNullExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [238 /* SatisfiesExpression */]: function forEachChildInSatisfiesExpression(node, cbNode, _cbNodes) { + [239 /* SatisfiesExpression */]: function forEachChildInSatisfiesExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type); }, - [236 /* MetaProperty */]: function forEachChildInMetaProperty(node, cbNode, _cbNodes) { + [237 /* MetaProperty */]: function forEachChildInMetaProperty(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name); }, - [227 /* ConditionalExpression */]: function forEachChildInConditionalExpression(node, cbNode, _cbNodes) { + [228 /* ConditionalExpression */]: function forEachChildInConditionalExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.whenTrue) || visitNode2(cbNode, node.colonToken) || visitNode2(cbNode, node.whenFalse); }, - [230 /* SpreadElement */]: function forEachChildInSpreadElement(node, cbNode, _cbNodes) { + [231 /* SpreadElement */]: function forEachChildInSpreadElement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [241 /* Block */]: forEachChildInBlock, - [268 /* ModuleBlock */]: forEachChildInBlock, - [307 /* SourceFile */]: function forEachChildInSourceFile(node, cbNode, cbNodes) { + [242 /* Block */]: forEachChildInBlock, + [269 /* ModuleBlock */]: forEachChildInBlock, + [308 /* SourceFile */]: function forEachChildInSourceFile(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.statements) || visitNode2(cbNode, node.endOfFileToken); }, - [243 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) { + [244 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList); }, - [261 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) { + [262 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.declarations); }, - [244 /* ExpressionStatement */]: function forEachChildInExpressionStatement(node, cbNode, _cbNodes) { + [245 /* ExpressionStatement */]: function forEachChildInExpressionStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [245 /* IfStatement */]: function forEachChildInIfStatement(node, cbNode, _cbNodes) { + [246 /* IfStatement */]: function forEachChildInIfStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.thenStatement) || visitNode2(cbNode, node.elseStatement); }, - [246 /* DoStatement */]: function forEachChildInDoStatement(node, cbNode, _cbNodes) { + [247 /* DoStatement */]: function forEachChildInDoStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.statement) || visitNode2(cbNode, node.expression); }, - [247 /* WhileStatement */]: function forEachChildInWhileStatement(node, cbNode, _cbNodes) { + [248 /* WhileStatement */]: function forEachChildInWhileStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); }, - [248 /* ForStatement */]: function forEachChildInForStatement(node, cbNode, _cbNodes) { + [249 /* ForStatement */]: function forEachChildInForStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.incrementor) || visitNode2(cbNode, node.statement); }, - [249 /* ForInStatement */]: function forEachChildInForInStatement(node, cbNode, _cbNodes) { + [250 /* ForInStatement */]: function forEachChildInForInStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); }, - [250 /* ForOfStatement */]: function forEachChildInForOfStatement(node, cbNode, _cbNodes) { + [251 /* ForOfStatement */]: function forEachChildInForOfStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.awaitModifier) || visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); }, - [251 /* ContinueStatement */]: forEachChildInContinueOrBreakStatement, - [252 /* BreakStatement */]: forEachChildInContinueOrBreakStatement, - [253 /* ReturnStatement */]: function forEachChildInReturnStatement(node, cbNode, _cbNodes) { + [252 /* ContinueStatement */]: forEachChildInContinueOrBreakStatement, + [253 /* BreakStatement */]: forEachChildInContinueOrBreakStatement, + [254 /* ReturnStatement */]: function forEachChildInReturnStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [254 /* WithStatement */]: function forEachChildInWithStatement(node, cbNode, _cbNodes) { + [255 /* WithStatement */]: function forEachChildInWithStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); }, - [255 /* SwitchStatement */]: function forEachChildInSwitchStatement(node, cbNode, _cbNodes) { + [256 /* SwitchStatement */]: function forEachChildInSwitchStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.caseBlock); }, - [269 /* CaseBlock */]: function forEachChildInCaseBlock(node, cbNode, cbNodes) { + [270 /* CaseBlock */]: function forEachChildInCaseBlock(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.clauses); }, - [296 /* CaseClause */]: function forEachChildInCaseClause(node, cbNode, cbNodes) { + [297 /* CaseClause */]: function forEachChildInCaseClause(node, cbNode, cbNodes) { return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); }, - [297 /* DefaultClause */]: function forEachChildInDefaultClause(node, cbNode, cbNodes) { + [298 /* DefaultClause */]: function forEachChildInDefaultClause(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.statements); }, - [256 /* LabeledStatement */]: function forEachChildInLabeledStatement(node, cbNode, _cbNodes) { + [257 /* LabeledStatement */]: function forEachChildInLabeledStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.label) || visitNode2(cbNode, node.statement); }, - [257 /* ThrowStatement */]: function forEachChildInThrowStatement(node, cbNode, _cbNodes) { + [258 /* ThrowStatement */]: function forEachChildInThrowStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [258 /* TryStatement */]: function forEachChildInTryStatement(node, cbNode, _cbNodes) { + [259 /* TryStatement */]: function forEachChildInTryStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.tryBlock) || visitNode2(cbNode, node.catchClause) || visitNode2(cbNode, node.finallyBlock); }, - [299 /* CatchClause */]: function forEachChildInCatchClause(node, cbNode, _cbNodes) { + [300 /* CatchClause */]: function forEachChildInCatchClause(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.variableDeclaration) || visitNode2(cbNode, node.block); }, - [170 /* Decorator */]: function forEachChildInDecorator(node, cbNode, _cbNodes) { + [171 /* Decorator */]: function forEachChildInDecorator(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [263 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression, - [231 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression, - [264 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) { + [264 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression, + [232 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression, + [265 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); }, - [265 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) { + [266 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode2(cbNode, node.type); }, - [266 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) { + [267 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); }, - [306 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) { + [307 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); }, - [267 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) { + [268 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body); }, - [271 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) { + [272 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference); }, - [272 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) { + [273 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes); }, - [273 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) { + [274 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings); }, - [300 /* ImportAttributes */]: function forEachChildInImportAttributes(node, cbNode, cbNodes) { + [301 /* ImportAttributes */]: function forEachChildInImportAttributes(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.elements); }, - [301 /* ImportAttribute */]: function forEachChildInImportAttribute(node, cbNode, _cbNodes) { + [302 /* ImportAttribute */]: function forEachChildInImportAttribute(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value); }, - [270 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) { + [271 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name); }, - [274 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) { + [275 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name); }, - [280 /* NamespaceExport */]: function forEachChildInNamespaceExport(node, cbNode, _cbNodes) { + [281 /* NamespaceExport */]: function forEachChildInNamespaceExport(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name); }, - [275 /* NamedImports */]: forEachChildInNamedImportsOrExports, - [279 /* NamedExports */]: forEachChildInNamedImportsOrExports, - [278 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) { + [276 /* NamedImports */]: forEachChildInNamedImportsOrExports, + [280 /* NamedExports */]: forEachChildInNamedImportsOrExports, + [279 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes); }, - [276 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier, - [281 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier, - [277 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) { + [277 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier, + [282 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier, + [278 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression); }, - [228 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) { + [229 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) { return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); }, - [239 /* TemplateSpan */]: function forEachChildInTemplateSpan(node, cbNode, _cbNodes) { + [240 /* TemplateSpan */]: function forEachChildInTemplateSpan(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.literal); }, - [203 /* TemplateLiteralType */]: function forEachChildInTemplateLiteralType(node, cbNode, cbNodes) { + [204 /* TemplateLiteralType */]: function forEachChildInTemplateLiteralType(node, cbNode, cbNodes) { return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); }, - [204 /* TemplateLiteralTypeSpan */]: function forEachChildInTemplateLiteralTypeSpan(node, cbNode, _cbNodes) { + [205 /* TemplateLiteralTypeSpan */]: function forEachChildInTemplateLiteralTypeSpan(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.literal); }, - [167 /* ComputedPropertyName */]: function forEachChildInComputedPropertyName(node, cbNode, _cbNodes) { + [168 /* ComputedPropertyName */]: function forEachChildInComputedPropertyName(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [298 /* HeritageClause */]: function forEachChildInHeritageClause(node, cbNode, cbNodes) { + [299 /* HeritageClause */]: function forEachChildInHeritageClause(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.types); }, - [233 /* ExpressionWithTypeArguments */]: function forEachChildInExpressionWithTypeArguments(node, cbNode, cbNodes) { + [234 /* ExpressionWithTypeArguments */]: function forEachChildInExpressionWithTypeArguments(node, cbNode, cbNodes) { return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); }, - [283 /* ExternalModuleReference */]: function forEachChildInExternalModuleReference(node, cbNode, _cbNodes) { + [284 /* ExternalModuleReference */]: function forEachChildInExternalModuleReference(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [282 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) { + [283 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers); }, - [356 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) { + [357 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.elements); }, - [284 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) { + [285 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) { return visitNode2(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingElement); }, - [288 /* JsxFragment */]: function forEachChildInJsxFragment(node, cbNode, cbNodes) { + [289 /* JsxFragment */]: function forEachChildInJsxFragment(node, cbNode, cbNodes) { return visitNode2(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingFragment); }, - [285 /* JsxSelfClosingElement */]: forEachChildInJsxOpeningOrSelfClosingElement, - [286 /* JsxOpeningElement */]: forEachChildInJsxOpeningOrSelfClosingElement, - [292 /* JsxAttributes */]: function forEachChildInJsxAttributes(node, cbNode, cbNodes) { + [286 /* JsxSelfClosingElement */]: forEachChildInJsxOpeningOrSelfClosingElement, + [287 /* JsxOpeningElement */]: forEachChildInJsxOpeningOrSelfClosingElement, + [293 /* JsxAttributes */]: function forEachChildInJsxAttributes(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.properties); }, - [291 /* JsxAttribute */]: function forEachChildInJsxAttribute(node, cbNode, _cbNodes) { + [292 /* JsxAttribute */]: function forEachChildInJsxAttribute(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); }, - [293 /* JsxSpreadAttribute */]: function forEachChildInJsxSpreadAttribute(node, cbNode, _cbNodes) { + [294 /* JsxSpreadAttribute */]: function forEachChildInJsxSpreadAttribute(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [294 /* JsxExpression */]: function forEachChildInJsxExpression(node, cbNode, _cbNodes) { + [295 /* JsxExpression */]: function forEachChildInJsxExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.expression); }, - [287 /* JsxClosingElement */]: function forEachChildInJsxClosingElement(node, cbNode, _cbNodes) { + [288 /* JsxClosingElement */]: function forEachChildInJsxClosingElement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.tagName); }, - [295 /* JsxNamespacedName */]: function forEachChildInJsxNamespacedName(node, cbNode, _cbNodes) { + [296 /* JsxNamespacedName */]: function forEachChildInJsxNamespacedName(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.namespace) || visitNode2(cbNode, node.name); }, - [190 /* OptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [191 /* RestType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [309 /* JSDocTypeExpression */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [315 /* JSDocNonNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [314 /* JSDocNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [316 /* JSDocOptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [318 /* JSDocVariadicType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [317 /* JSDocFunctionType */]: function forEachChildInJSDocFunctionType(node, cbNode, cbNodes) { + [191 /* OptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [192 /* RestType */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [310 /* JSDocTypeExpression */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [316 /* JSDocNonNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [315 /* JSDocNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [317 /* JSDocOptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [319 /* JSDocVariadicType */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [318 /* JSDocFunctionType */]: function forEachChildInJSDocFunctionType(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, - [320 /* JSDoc */]: function forEachChildInJSDoc(node, cbNode, cbNodes) { + [321 /* JSDoc */]: function forEachChildInJSDoc(node, cbNode, cbNodes) { return (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) || visitNodes(cbNode, cbNodes, node.tags); }, - [347 /* JSDocSeeTag */]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) { + [348 /* JSDocSeeTag */]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.name) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); }, - [310 /* JSDocNameReference */]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) { + [311 /* JSDocNameReference */]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name); }, - [311 /* JSDocMemberName */]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) { + [312 /* JSDocMemberName */]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right); }, - [341 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag, - [348 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag, - [330 /* JSDocAuthorTag */]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) { + [342 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag, + [349 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag, + [331 /* JSDocAuthorTag */]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); }, - [329 /* JSDocImplementsTag */]: function forEachChildInJSDocImplementsTag(node, cbNode, cbNodes) { + [330 /* JSDocImplementsTag */]: function forEachChildInJSDocImplementsTag(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); }, - [328 /* JSDocAugmentsTag */]: function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) { + [329 /* JSDocAugmentsTag */]: function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); }, - [345 /* JSDocTemplateTag */]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) { + [346 /* JSDocTemplateTag */]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); }, - [346 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 309 /* JSDocTypeExpression */ ? visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.fullName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) : visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment))); + [347 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 310 /* JSDocTypeExpression */ ? visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.fullName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) : visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment))); }, - [338 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) { + [339 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); }, - [342 /* JSDocReturnTag */]: forEachChildInJSDocTypeLikeTag, - [344 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag, - [343 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag, - [340 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag, - [350 /* JSDocSatisfiesTag */]: forEachChildInJSDocTypeLikeTag, - [349 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag, - [339 /* JSDocOverloadTag */]: forEachChildInJSDocTypeLikeTag, - [323 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) { + [343 /* JSDocReturnTag */]: forEachChildInJSDocTypeLikeTag, + [345 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag, + [344 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag, + [341 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag, + [351 /* JSDocSatisfiesTag */]: forEachChildInJSDocTypeLikeTag, + [350 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag, + [340 /* JSDocOverloadTag */]: forEachChildInJSDocTypeLikeTag, + [324 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) { return forEach(node.typeParameters, cbNode) || forEach(node.parameters, cbNode) || visitNode2(cbNode, node.type); }, - [324 /* JSDocLink */]: forEachChildInJSDocLinkCodeOrPlain, - [325 /* JSDocLinkCode */]: forEachChildInJSDocLinkCodeOrPlain, - [326 /* JSDocLinkPlain */]: forEachChildInJSDocLinkCodeOrPlain, - [322 /* JSDocTypeLiteral */]: function forEachChildInJSDocTypeLiteral(node, cbNode, _cbNodes) { + [325 /* JSDocLink */]: forEachChildInJSDocLinkCodeOrPlain, + [326 /* JSDocLinkCode */]: forEachChildInJSDocLinkCodeOrPlain, + [327 /* JSDocLinkPlain */]: forEachChildInJSDocLinkCodeOrPlain, + [323 /* JSDocTypeLiteral */]: function forEachChildInJSDocTypeLiteral(node, cbNode, _cbNodes) { return forEach(node.jsDocPropertyTags, cbNode); }, - [327 /* JSDocTag */]: forEachChildInJSDocTag, - [332 /* JSDocClassTag */]: forEachChildInJSDocTag, - [333 /* JSDocPublicTag */]: forEachChildInJSDocTag, - [334 /* JSDocPrivateTag */]: forEachChildInJSDocTag, - [335 /* JSDocProtectedTag */]: forEachChildInJSDocTag, - [336 /* JSDocReadonlyTag */]: forEachChildInJSDocTag, - [331 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag, - [337 /* JSDocOverrideTag */]: forEachChildInJSDocTag, - [351 /* JSDocImportTag */]: forEachChildInJSDocImportTag, - [355 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression + [328 /* JSDocTag */]: forEachChildInJSDocTag, + [333 /* JSDocClassTag */]: forEachChildInJSDocTag, + [334 /* JSDocPublicTag */]: forEachChildInJSDocTag, + [335 /* JSDocPrivateTag */]: forEachChildInJSDocTag, + [336 /* JSDocProtectedTag */]: forEachChildInJSDocTag, + [337 /* JSDocReadonlyTag */]: forEachChildInJSDocTag, + [332 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag, + [338 /* JSDocOverrideTag */]: forEachChildInJSDocTag, + [352 /* JSDocImportTag */]: forEachChildInJSDocImportTag, + [356 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression }; function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); @@ -32822,7 +32950,7 @@ function forEachChildInPartiallyEmittedExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); } function forEachChild(node, cbNode, cbNodes) { - if (node === void 0 || node.kind <= 165 /* LastToken */) { + if (node === void 0 || node.kind <= 166 /* LastToken */) { return; } const fn = forEachChildTable[node.kind]; @@ -32855,7 +32983,7 @@ function forEachChildRecursively(rootNode, cbNode, cbNodes) { if (res === "skip") continue; return res; } - if (current.kind >= 166 /* FirstNode */) { + if (current.kind >= 167 /* FirstNode */) { for (const child of gatherPossibleChildren(current)) { queue.push(child); parents.push(current); @@ -33851,7 +33979,7 @@ var Parser; "", /*isSingleQuote*/ void 0 - ) : kind === 282 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factoryCreateToken(kind); + ) : kind === 283 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factoryCreateToken(kind); return finishNode(result, pos); } function internIdentifier(text) { @@ -34301,14 +34429,14 @@ var Parser; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 176 /* Constructor */: - case 181 /* IndexSignature */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 172 /* PropertyDeclaration */: - case 240 /* SemicolonClassElement */: + case 177 /* Constructor */: + case 182 /* IndexSignature */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 173 /* PropertyDeclaration */: + case 241 /* SemicolonClassElement */: return true; - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: const methodDeclaration = node; const nameIsConstructor = methodDeclaration.name.kind === 80 /* Identifier */ && methodDeclaration.name.escapedText === "constructor"; return !nameIsConstructor; @@ -34319,8 +34447,8 @@ var Parser; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 296 /* CaseClause */: - case 297 /* DefaultClause */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: return true; } } @@ -34329,65 +34457,65 @@ var Parser; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 262 /* FunctionDeclaration */: - case 243 /* VariableStatement */: - case 241 /* Block */: - case 245 /* IfStatement */: - case 244 /* ExpressionStatement */: - case 257 /* ThrowStatement */: - case 253 /* ReturnStatement */: - case 255 /* SwitchStatement */: - case 252 /* BreakStatement */: - case 251 /* ContinueStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 248 /* ForStatement */: - case 247 /* WhileStatement */: - case 254 /* WithStatement */: - case 242 /* EmptyStatement */: - case 258 /* TryStatement */: - case 256 /* LabeledStatement */: - case 246 /* DoStatement */: - case 259 /* DebuggerStatement */: - case 272 /* ImportDeclaration */: - case 271 /* ImportEqualsDeclaration */: - case 278 /* ExportDeclaration */: - case 277 /* ExportAssignment */: - case 267 /* ModuleDeclaration */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 263 /* FunctionDeclaration */: + case 244 /* VariableStatement */: + case 242 /* Block */: + case 246 /* IfStatement */: + case 245 /* ExpressionStatement */: + case 258 /* ThrowStatement */: + case 254 /* ReturnStatement */: + case 256 /* SwitchStatement */: + case 253 /* BreakStatement */: + case 252 /* ContinueStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 249 /* ForStatement */: + case 248 /* WhileStatement */: + case 255 /* WithStatement */: + case 243 /* EmptyStatement */: + case 259 /* TryStatement */: + case 257 /* LabeledStatement */: + case 247 /* DoStatement */: + case 260 /* DebuggerStatement */: + case 273 /* ImportDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 279 /* ExportDeclaration */: + case 278 /* ExportAssignment */: + case 268 /* ModuleDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: + case 266 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 306 /* EnumMember */; + return node.kind === 307 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 180 /* ConstructSignature */: - case 173 /* MethodSignature */: - case 181 /* IndexSignature */: - case 171 /* PropertySignature */: - case 179 /* CallSignature */: + case 181 /* ConstructSignature */: + case 174 /* MethodSignature */: + case 182 /* IndexSignature */: + case 172 /* PropertySignature */: + case 180 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 260 /* VariableDeclaration */) { + if (node.kind !== 261 /* VariableDeclaration */) { return false; } const variableDeclarator = node; return variableDeclarator.initializer === void 0; } function isReusableParameter(node) { - if (node.kind !== 169 /* Parameter */) { + if (node.kind !== 170 /* Parameter */) { return false; } const parameter = node; @@ -34734,14 +34862,14 @@ var Parser; } function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 183 /* TypeReference */: + case 184 /* TypeReference */: return nodeIsMissing(node.typeName); - case 184 /* FunctionType */: - case 185 /* ConstructorType */: { + case 185 /* FunctionType */: + case 186 /* ConstructorType */: { const { parameters, type } = node; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 196 /* ParenthesizedType */: + case 197 /* ParenthesizedType */: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -35032,7 +35160,7 @@ var Parser; function parseSignatureMember(kind) { const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - if (kind === 180 /* ConstructSignature */) { + if (kind === 181 /* ConstructSignature */) { parseExpected(105 /* NewKeyword */); } const typeParameters = parseTypeParameters(); @@ -35043,7 +35171,7 @@ var Parser; true ); parseTypeMemberSemicolon(); - const node = kind === 179 /* CallSignature */ ? factory2.createCallSignature(typeParameters, parameters, type) : factory2.createConstructSignature(typeParameters, parameters, type); + const node = kind === 180 /* CallSignature */ ? factory2.createCallSignature(typeParameters, parameters, type) : factory2.createConstructSignature(typeParameters, parameters, type); return withJSDoc(finishNode(node, pos), hasJSDoc); } function isIndexSignature() { @@ -35127,10 +35255,10 @@ var Parser; } function parseTypeMember() { if (token() === 21 /* OpenParenToken */ || token() === 30 /* LessThanToken */) { - return parseSignatureMember(179 /* CallSignature */); + return parseSignatureMember(180 /* CallSignature */); } if (token() === 105 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(180 /* ConstructSignature */); + return parseSignatureMember(181 /* ConstructSignature */); } const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); @@ -35139,10 +35267,10 @@ var Parser; false ); if (parseContextualModifier(139 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 177 /* GetAccessor */, 4 /* Type */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 178 /* GetAccessor */, 4 /* Type */); } if (parseContextualModifier(153 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 178 /* SetAccessor */, 4 /* Type */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 179 /* SetAccessor */, 4 /* Type */); } if (isIndexSignature()) { return parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers); @@ -35351,6 +35479,7 @@ var Parser; /*skipKeyword*/ true ); + parseOptional(28 /* CommaToken */); if (!parseExpected(20 /* CloseBraceToken */)) { const lastError = lastOrUndefined(parseDiagnostics); if (lastError && lastError.code === Diagnostics._0_expected.code) { @@ -36083,7 +36212,7 @@ var Parser; return void 0; } let unwrappedType = type; - while ((unwrappedType == null ? void 0 : unwrappedType.kind) === 196 /* ParenthesizedType */) { + while ((unwrappedType == null ? void 0 : unwrappedType.kind) === 197 /* ParenthesizedType */) { unwrappedType = unwrappedType.type; } const hasJSDocFunctionType = unwrappedType && isJSDocFunctionType(unwrappedType); @@ -36108,10 +36237,13 @@ var Parser; if (token() !== 27 /* SemicolonToken */ && token() !== 100 /* FunctionKeyword */ && token() !== 86 /* ClassKeyword */ && isStartOfStatement() && !isStartOfExpressionStatement()) { return parseFunctionBlock(16 /* IgnoreMissingOpenBrace */ | (isAsync ? 2 /* Await */ : 0 /* None */)); } + const savedYieldContext = inYieldContext(); + setYieldContext(false); const savedTopLevel = topLevel; topLevel = false; const node = isAsync ? doInAwaitContext(() => parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction)) : doOutsideOfAwaitContext(() => parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction)); topLevel = savedTopLevel; + setYieldContext(savedYieldContext); return node; } function parseConditionalExpressionRest(leftOperand, pos, allowReturnTypeInArrowFunction) { @@ -36228,7 +36360,7 @@ var Parser; if (token() === 43 /* AsteriskAsteriskToken */) { const pos = skipTrivia(sourceText, simpleUnaryExpression.pos); const { end } = simpleUnaryExpression; - if (simpleUnaryExpression.kind === 216 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 217 /* TypeAssertionExpression */) { parseErrorAt(pos, end, Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { Debug.assert(isKeywordOrPunctuation(unaryOperator)); @@ -36324,7 +36456,13 @@ var Parser; nextToken(); nextToken(); expression = finishNode(factory2.createMetaProperty(102 /* ImportKeyword */, parseIdentifierName()), pos); - sourceFlags |= 8388608 /* PossiblyContainsImportMeta */; + if (expression.name.escapedText === "defer") { + if (token() === 21 /* OpenParenToken */ || token() === 30 /* LessThanToken */) { + sourceFlags |= 4194304 /* PossiblyContainsDynamicImport */; + } + } else { + sourceFlags |= 8388608 /* PossiblyContainsImportMeta */; + } } else { expression = parseMemberExpressionOrHigher(); } @@ -36373,11 +36511,11 @@ var Parser; const pos = getNodePos(); const opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); let result; - if (opening.kind === 286 /* JsxOpeningElement */) { + if (opening.kind === 287 /* JsxOpeningElement */) { let children = parseJsxChildren(opening); let closingElement; const lastChild = children[children.length - 1]; - if ((lastChild == null ? void 0 : lastChild.kind) === 284 /* JsxElement */ && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName) && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) { + if ((lastChild == null ? void 0 : lastChild.kind) === 285 /* JsxElement */ && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName) && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) { const end = lastChild.children.end; const newLast = finishNode( factory2.createJsxElement( @@ -36401,10 +36539,10 @@ var Parser; } } result = finishNode(factory2.createJsxElement(opening, children, closingElement), pos); - } else if (opening.kind === 289 /* JsxOpeningFragment */) { + } else if (opening.kind === 290 /* JsxOpeningFragment */) { result = finishNode(factory2.createJsxFragment(opening, parseJsxChildren(opening), parseJsxClosingFragment(inExpressionContext)), pos); } else { - Debug.assert(opening.kind === 285 /* JsxSelfClosingElement */); + Debug.assert(opening.kind === 286 /* JsxSelfClosingElement */); result = opening; } if (!mustBeUnary && inExpressionContext && token() === 30 /* LessThanToken */) { @@ -36476,7 +36614,7 @@ var Parser; const child = parseJsxChild(openingTag, currentToken = scanner2.reScanJsxToken()); if (!child) break; list.push(child); - if (isJsxOpeningElement(openingTag) && (child == null ? void 0 : child.kind) === 284 /* JsxElement */ && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName) && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) { + if (isJsxOpeningElement(openingTag) && (child == null ? void 0 : child.kind) === 285 /* JsxElement */ && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName) && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) { break; } } @@ -36755,7 +36893,7 @@ var Parser; continue; } if (isTemplateStartOfTaggedTemplate()) { - expression = !questionDotToken && expression.kind === 233 /* ExpressionWithTypeArguments */ ? parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) : parseTaggedTemplateRest( + expression = !questionDotToken && expression.kind === 234 /* ExpressionWithTypeArguments */ ? parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) : parseTaggedTemplateRest( pos, expression, questionDotToken, @@ -36818,7 +36956,7 @@ var Parser; } } if (typeArguments || token() === 21 /* OpenParenToken */) { - if (!questionDotToken && expression.kind === 233 /* ExpressionWithTypeArguments */) { + if (!questionDotToken && expression.kind === 234 /* ExpressionWithTypeArguments */) { typeArguments = expression.typeArguments; expression = expression.expression; } @@ -36986,10 +37124,10 @@ var Parser; true ); if (parseContextualModifier(139 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 177 /* GetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 178 /* GetAccessor */, 0 /* None */); } if (parseContextualModifier(153 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 178 /* SetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 179 /* SetAccessor */, 0 /* None */); } const asteriskToken = parseOptionalToken(42 /* AsteriskToken */); const tokenIsIdentifier = isIdentifier2(); @@ -37083,7 +37221,7 @@ var Parser; false ); let typeArguments; - if (expression.kind === 233 /* ExpressionWithTypeArguments */) { + if (expression.kind === 234 /* ExpressionWithTypeArguments */) { typeArguments = expression.typeArguments; expression = expression.expression; } @@ -37228,10 +37366,10 @@ var Parser; function parseBreakOrContinueStatement(kind) { const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - parseExpected(kind === 252 /* BreakStatement */ ? 83 /* BreakKeyword */ : 88 /* ContinueKeyword */); + parseExpected(kind === 253 /* BreakStatement */ ? 83 /* BreakKeyword */ : 88 /* ContinueKeyword */); const label = canParseSemicolon() ? void 0 : parseIdentifier(); parseSemicolon(); - const node = kind === 252 /* BreakStatement */ ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label); + const node = kind === 253 /* BreakStatement */ ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseReturnStatement() { @@ -37417,6 +37555,7 @@ var Parser; // could be legal, it would add complexity for very little gain. case 120 /* InterfaceKeyword */: case 156 /* TypeKeyword */: + case 166 /* DeferKeyword */: return nextTokenIsIdentifierOnSameLine(); case 144 /* ModuleKeyword */: case 145 /* NamespaceKeyword */: @@ -37443,7 +37582,7 @@ var Parser; return token() === 19 /* OpenBraceToken */ || token() === 80 /* Identifier */ || token() === 95 /* ExportKeyword */; case 102 /* ImportKeyword */: nextToken(); - return token() === 11 /* StringLiteral */ || token() === 42 /* AsteriskToken */ || token() === 19 /* OpenBraceToken */ || tokenIsIdentifierOrKeyword(token()); + return token() === 166 /* DeferKeyword */ || token() === 11 /* StringLiteral */ || token() === 42 /* AsteriskToken */ || token() === 19 /* OpenBraceToken */ || tokenIsIdentifierOrKeyword(token()); case 95 /* ExportKeyword */: let currentToken2 = nextToken(); if (currentToken2 === 156 /* TypeKeyword */) { @@ -37505,6 +37644,7 @@ var Parser; case 145 /* NamespaceKeyword */: case 156 /* TypeKeyword */: case 162 /* GlobalKeyword */: + case 166 /* DeferKeyword */: return true; case 129 /* AccessorKeyword */: case 125 /* PublicKeyword */: @@ -37530,9 +37670,15 @@ var Parser; true ); } + function nextTokenIsEqualsOrSemicolonOrColonToken() { + nextToken(); + return token() === 64 /* EqualsToken */ || token() === 27 /* SemicolonToken */ || token() === 59 /* ColonToken */; + } function nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLine(disallowOf) { nextToken(); - if (disallowOf && token() === 165 /* OfKeyword */) return false; + if (disallowOf && token() === 165 /* OfKeyword */) { + return lookAhead(nextTokenIsEqualsOrSemicolonOrColonToken); + } return (isBindingIdentifier() || token() === 19 /* OpenBraceToken */) && !scanner2.hasPrecedingLineBreak(); } function isUsingDeclaration() { @@ -37616,9 +37762,9 @@ var Parser; case 99 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 88 /* ContinueKeyword */: - return parseBreakOrContinueStatement(251 /* ContinueStatement */); + return parseBreakOrContinueStatement(252 /* ContinueStatement */); case 83 /* BreakKeyword */: - return parseBreakOrContinueStatement(252 /* BreakStatement */); + return parseBreakOrContinueStatement(253 /* BreakStatement */); case 107 /* ReturnKeyword */: return parseReturnStatement(); case 118 /* WithKeyword */: @@ -37732,7 +37878,7 @@ var Parser; default: if (modifiersIn) { const missing = createMissingNode( - 282 /* MissingDeclaration */, + 283 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, Diagnostics.Declaration_expected @@ -38015,7 +38161,7 @@ var Parser; false ); const body = parseFunctionBlockOrSemicolon(flags); - const node = kind === 177 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(modifiers, name, parameters, type, body) : factory2.createSetAccessorDeclaration(modifiers, name, parameters, body); + const node = kind === 178 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(modifiers, name, parameters, type, body) : factory2.createSetAccessorDeclaration(modifiers, name, parameters, body); node.typeParameters = typeParameters; if (isSetAccessorDeclaration(node)) node.type = type; return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -38183,10 +38329,10 @@ var Parser; return parseClassStaticBlockDeclaration(pos, hasJSDoc, modifiers); } if (parseContextualModifier(139 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 177 /* GetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 178 /* GetAccessor */, 0 /* None */); } if (parseContextualModifier(153 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 178 /* SetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 179 /* SetAccessor */, 0 /* None */); } if (token() === 137 /* ConstructorKeyword */ || token() === 11 /* StringLiteral */) { const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, modifiers); @@ -38234,10 +38380,10 @@ var Parser; true ); if (token() === 86 /* ClassKeyword */) { - return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 231 /* ClassExpression */); + return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 232 /* ClassExpression */); } const missing = createMissingNode( - 282 /* MissingDeclaration */, + 283 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, Diagnostics.Expression_expected @@ -38252,11 +38398,11 @@ var Parser; hasPrecedingJSDocComment(), /*modifiers*/ void 0, - 231 /* ClassExpression */ + 232 /* ClassExpression */ ); } function parseClassDeclaration(pos, hasJSDoc, modifiers) { - return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 263 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 264 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, kind) { const savedAwaitContext = inAwaitContext(); @@ -38276,7 +38422,7 @@ var Parser; members = createMissingList(); } setAwaitContext(savedAwaitContext); - const node = kind === 263 /* ClassDeclaration */ ? factory2.createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) : factory2.createClassExpression(modifiers, name, typeParameters, heritageClauses, members); + const node = kind === 264 /* ClassDeclaration */ ? factory2.createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) : factory2.createClassExpression(modifiers, name, typeParameters, heritageClauses, members); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseNameOfClassDeclarationOrExpression() { @@ -38302,7 +38448,7 @@ var Parser; function parseExpressionWithTypeArguments() { const pos = getNodePos(); const expression = parseLeftHandSideExpressionOrHigher(); - if (expression.kind === 233 /* ExpressionWithTypeArguments */) { + if (expression.kind === 234 /* ExpressionWithTypeArguments */) { return expression; } const typeArguments = tryParseTypeArguments(); @@ -38445,27 +38591,36 @@ var Parser; if (isIdentifier2()) { identifier = parseIdentifier(); } - let isTypeOnly = false; + let phaseModifier; if ((identifier == null ? void 0 : identifier.escapedText) === "type" && (token() !== 161 /* FromKeyword */ || isIdentifier2() && lookAhead(nextTokenIsFromKeywordOrEqualsToken)) && (isIdentifier2() || tokenAfterImportDefinitelyProducesImportDeclaration())) { - isTypeOnly = true; + phaseModifier = 156 /* TypeKeyword */; + identifier = isIdentifier2() ? parseIdentifier() : void 0; + } else if ((identifier == null ? void 0 : identifier.escapedText) === "defer" && (token() === 161 /* FromKeyword */ ? !lookAhead(nextTokenIsStringLiteral) : token() !== 28 /* CommaToken */ && token() !== 64 /* EqualsToken */)) { + phaseModifier = 166 /* DeferKeyword */; identifier = isIdentifier2() ? parseIdentifier() : void 0; } - if (identifier && !tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration()) { - return parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, isTypeOnly); + if (identifier && !tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() && phaseModifier !== 166 /* DeferKeyword */) { + return parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, phaseModifier === 156 /* TypeKeyword */); } - const importClause = tryParseImportClause(identifier, afterImportPos, isTypeOnly); + const importClause = tryParseImportClause( + identifier, + afterImportPos, + phaseModifier, + /*skipJsDocLeadingAsterisks*/ + void 0 + ); const moduleSpecifier = parseModuleSpecifier(); const attributes = tryParseImportAttributes(); parseSemicolon(); const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes); return withJSDoc(finishNode(node, pos), hasJSDoc); } - function tryParseImportClause(identifier, pos, isTypeOnly, skipJsDocLeadingAsterisks = false) { + function tryParseImportClause(identifier, pos, phaseModifier, skipJsDocLeadingAsterisks = false) { let importClause; if (identifier || // import id token() === 42 /* AsteriskToken */ || // import * token() === 19 /* OpenBraceToken */) { - importClause = parseImportClause(identifier, pos, isTypeOnly, skipJsDocLeadingAsterisks); + importClause = parseImportClause(identifier, pos, phaseModifier, skipJsDocLeadingAsterisks); parseExpected(161 /* FromKeyword */); } return importClause; @@ -38541,14 +38696,18 @@ var Parser; const finished = withJSDoc(finishNode(node, pos), hasJSDoc); return finished; } - function parseImportClause(identifier, pos, isTypeOnly, skipJsDocLeadingAsterisks) { + function parseImportClause(identifier, pos, phaseModifier, skipJsDocLeadingAsterisks) { let namedBindings; if (!identifier || parseOptional(28 /* CommaToken */)) { if (skipJsDocLeadingAsterisks) scanner2.setSkipJsDocLeadingAsterisks(true); - namedBindings = token() === 42 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(275 /* NamedImports */); + if (token() === 42 /* AsteriskToken */) { + namedBindings = parseNamespaceImport(); + } else { + namedBindings = parseNamedImportsOrExports(276 /* NamedImports */); + } if (skipJsDocLeadingAsterisks) scanner2.setSkipJsDocLeadingAsterisks(false); } - return finishNode(factory2.createImportClause(isTypeOnly, identifier, namedBindings), pos); + return finishNode(factory2.createImportClause(phaseModifier, identifier, namedBindings), pos); } function parseModuleReference() { return isExternalModuleReference2() ? parseExternalModuleReference() : parseEntityName( @@ -38588,15 +38747,15 @@ var Parser; } function parseNamedImportsOrExports(kind) { const pos = getNodePos(); - const node = kind === 275 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseImportSpecifier, 19 /* OpenBraceToken */, 20 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseExportSpecifier, 19 /* OpenBraceToken */, 20 /* CloseBraceToken */)); + const node = kind === 276 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseImportSpecifier, 19 /* OpenBraceToken */, 20 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseExportSpecifier, 19 /* OpenBraceToken */, 20 /* CloseBraceToken */)); return finishNode(node, pos); } function parseExportSpecifier() { const hasJSDoc = hasPrecedingJSDocComment(); - return withJSDoc(parseImportOrExportSpecifier(281 /* ExportSpecifier */), hasJSDoc); + return withJSDoc(parseImportOrExportSpecifier(282 /* ExportSpecifier */), hasJSDoc); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(276 /* ImportSpecifier */); + return parseImportOrExportSpecifier(277 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { const pos = getNodePos(); @@ -38640,7 +38799,7 @@ var Parser; parseExpected(130 /* AsKeyword */); name = parseModuleExportName(parseNameWithKeywordCheck); } - if (kind === 276 /* ImportSpecifier */) { + if (kind === 277 /* ImportSpecifier */) { if (name.kind !== 80 /* Identifier */) { parseErrorAt(skipTrivia(sourceText, name.pos), name.end, Diagnostics.Identifier_expected); name = setTextRangePosEnd(createMissingNode( @@ -38652,7 +38811,7 @@ var Parser; parseErrorAt(checkIdentifierStart, checkIdentifierEnd, Diagnostics.Identifier_expected); } } - const node = kind === 276 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name); + const node = kind === 277 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name); return finishNode(node, pos); function parseNameWithKeywordCheck() { checkIdentifierIsKeyword = isKeyword(token()) && !isIdentifier2(); @@ -38682,7 +38841,7 @@ var Parser; parseExpected(161 /* FromKeyword */); moduleSpecifier = parseModuleSpecifier(); } else { - exportClause = parseNamedImportsOrExports(279 /* NamedExports */); + exportClause = parseNamedImportsOrExports(280 /* NamedExports */); if (token() === 161 /* FromKeyword */ || token() === 11 /* StringLiteral */ && !scanner2.hasPrecedingLineBreak()) { parseExpected(161 /* FromKeyword */); moduleSpecifier = parseModuleSpecifier(); @@ -39336,7 +39495,7 @@ var Parser; switch (node.kind) { case 151 /* ObjectKeyword */: return true; - case 188 /* ArrayType */: + case 189 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; @@ -39366,14 +39525,14 @@ var Parser; let child; let children; while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent3, name))) { - if (child.kind === 341 /* JSDocParameterTag */ || child.kind === 348 /* JSDocPropertyTag */) { + if (child.kind === 342 /* JSDocParameterTag */ || child.kind === 349 /* JSDocPropertyTag */) { children = append(children, child); - } else if (child.kind === 345 /* JSDocTemplateTag */) { + } else if (child.kind === 346 /* JSDocTemplateTag */) { parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag); } } if (children) { - const literal = finishNode(factory2.createJSDocTypeLiteral(children, typeExpression.type.kind === 188 /* ArrayType */), pos); + const literal = finishNode(factory2.createJSDocTypeLiteral(children, typeExpression.type.kind === 189 /* ArrayType */), pos); return finishNode(factory2.createJSDocTypeExpression(literal), pos); } } @@ -39462,8 +39621,7 @@ var Parser; const importClause = tryParseImportClause( identifier, afterImportTagPos, - /*isTypeOnly*/ - true, + 156 /* TypeKeyword */, /*skipJsDocLeadingAsterisks*/ true ); @@ -39528,11 +39686,11 @@ var Parser; let jsDocPropertyTags; let hasChildren = false; while (child = tryParse(() => parseChildPropertyTag(indent3))) { - if (child.kind === 345 /* JSDocTemplateTag */) { + if (child.kind === 346 /* JSDocTemplateTag */) { break; } hasChildren = true; - if (child.kind === 344 /* JSDocTypeTag */) { + if (child.kind === 345 /* JSDocTypeTag */) { if (childTypeTag) { const lastError = parseErrorAtCurrentToken(Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags); if (lastError) { @@ -39547,7 +39705,7 @@ var Parser; } } if (hasChildren) { - const isArrayType = typeExpression && typeExpression.type.kind === 188 /* ArrayType */; + const isArrayType = typeExpression && typeExpression.type.kind === 189 /* ArrayType */; const jsdocTypeLiteral = factory2.createJSDocTypeLiteral(jsDocPropertyTags, isArrayType); typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? childTypeTag.typeExpression : finishNode(jsdocTypeLiteral, start2); end2 = typeExpression.end; @@ -39590,7 +39748,7 @@ var Parser; let child; let parameters; while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent3))) { - if (child.kind === 345 /* JSDocTemplateTag */) { + if (child.kind === 346 /* JSDocTemplateTag */) { parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag); break; } @@ -39603,7 +39761,7 @@ var Parser; const returnTag = tryParse(() => { if (parseOptionalJsdoc(60 /* AtToken */)) { const tag = parseTag(indent3); - if (tag && tag.kind === 342 /* JSDocReturnTag */) { + if (tag && tag.kind === 343 /* JSDocReturnTag */) { return tag; } } @@ -39658,7 +39816,7 @@ var Parser; case 60 /* AtToken */: if (canParseTag) { const child = tryParseChildTag(target, indent3); - if (child && (child.kind === 341 /* JSDocParameterTag */ || child.kind === 348 /* JSDocPropertyTag */) && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { + if (child && (child.kind === 342 /* JSDocParameterTag */ || child.kind === 349 /* JSDocPropertyTag */) && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; } return child; @@ -40410,7 +40568,7 @@ function tagNamesAreEquivalent(lhs, rhs) { if (lhs.kind === 110 /* ThisKeyword */) { return true; } - if (lhs.kind === 295 /* JsxNamespacedName */) { + if (lhs.kind === 296 /* JsxNamespacedName */) { return lhs.namespace.escapedText === rhs.namespace.escapedText && lhs.name.escapedText === rhs.name.escapedText; } return lhs.name.escapedText === rhs.name.escapedText && tagNamesAreEquivalent(lhs.expression, rhs.expression); @@ -40425,9 +40583,9 @@ var compileOnSaveCommandLineOption = { var jsxOptionMap = new Map(Object.entries({ "preserve": 1 /* Preserve */, "react-native": 3 /* ReactNative */, - "react": 2 /* React */, "react-jsx": 4 /* ReactJSX */, - "react-jsxdev": 5 /* ReactJSXDev */ + "react-jsxdev": 5 /* ReactJSXDev */, + "react": 2 /* React */ })); var inverseJsxOptionMap = new Map(mapIterator(jsxOptionMap.entries(), ([key, value]) => ["" + value, key])); var libEntries = [ @@ -40530,6 +40688,8 @@ var libEntries = [ ["esnext.iterator", "lib.esnext.iterator.d.ts"], ["esnext.promise", "lib.esnext.promise.d.ts"], ["esnext.float16", "lib.esnext.float16.d.ts"], + ["esnext.error", "lib.esnext.error.d.ts"], + ["esnext.sharedmemory", "lib.esnext.sharedmemory.d.ts"], ["decorators", "lib.decorators.d.ts"], ["decorators.legacy", "lib.decorators.legacy.d.ts"] ]; @@ -40857,6 +41017,7 @@ var moduleOptionDeclaration = { esnext: 99 /* ESNext */, node16: 100 /* Node16 */, node18: 101 /* Node18 */, + node20: 102 /* Node20 */, nodenext: 199 /* NodeNext */, preserve: 200 /* Preserve */ })), @@ -40948,7 +41109,7 @@ var commandOptionsWithoutBuild = [ affectsBuildInfo: true, showInSimplifiedHelpView: true, category: Diagnostics.JavaScript_Support, - description: Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files, + description: Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these_files, defaultValueDescription: false }, { @@ -42459,7 +42620,7 @@ function getTsconfigRootOptionsMap() { function convertConfigFileToObject(sourceFile, errors, jsonConversionNotifier) { var _a; const rootExpression = (_a = sourceFile.statements[0]) == null ? void 0 : _a.expression; - if (rootExpression && rootExpression.kind !== 210 /* ObjectLiteralExpression */) { + if (rootExpression && rootExpression.kind !== 211 /* ObjectLiteralExpression */) { errors.push(createDiagnosticForNodeInSourceFile( sourceFile, rootExpression, @@ -42511,7 +42672,7 @@ function convertToJson(sourceFile, rootExpression, errors, returnValue, jsonConv var _a; const result = returnValue ? {} : void 0; for (const element of node.properties) { - if (element.kind !== 303 /* PropertyAssignment */) { + if (element.kind !== 304 /* PropertyAssignment */) { errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element, Diagnostics.Property_assignment_expected)); continue; } @@ -42557,15 +42718,15 @@ function convertToJson(sourceFile, rootExpression, errors, returnValue, jsonConv return valueExpression.text; case 9 /* NumericLiteral */: return Number(valueExpression.text); - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: if (valueExpression.operator !== 41 /* MinusToken */ || valueExpression.operand.kind !== 9 /* NumericLiteral */) { break; } return -Number(valueExpression.operand.text); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: const objectLiteralExpression = valueExpression; return convertObjectLiteralExpressionToJson(objectLiteralExpression, option); - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return convertArrayLiteralExpressionToJson( valueExpression.elements, option && option.element @@ -42750,106 +42911,178 @@ function serializeOptionBaseObject(options, { optionsNameMap }, pathOptions) { } return result; } -function getCompilerOptionsDiffValue(options, newLine) { - const compilerOptionsMap = getSerializedCompilerOption(options); - return getOverwrittenDefaultOptions(); - function makePadding(paddingLength) { - return Array(paddingLength + 1).join(" "); +function generateTSConfig(options, newLine) { + const tab = " "; + const result = []; + const allSetOptions = Object.keys(options).filter((k) => k !== "init" && k !== "help" && k !== "watch"); + result.push(`{`); + result.push(`${tab}// ${getLocaleSpecificMessage(Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file)}`); + result.push(`${tab}"compilerOptions": {`); + emitHeader(Diagnostics.File_Layout); + emitOption("rootDir", "./src", "optional"); + emitOption("outDir", "./dist", "optional"); + newline(); + emitHeader(Diagnostics.Environment_Settings); + emitHeader(Diagnostics.See_also_https_Colon_Slash_Slashaka_ms_Slashtsconfig_Slashmodule); + emitOption("module", 199 /* NodeNext */); + emitOption("target", 99 /* ESNext */); + emitOption("types", []); + if (options.lib) { + emitOption("lib", options.lib); + } + emitHeader(Diagnostics.For_nodejs_Colon); + result.push(`${tab}${tab}// "lib": ["esnext"],`); + result.push(`${tab}${tab}// "types": ["node"],`); + emitHeader(Diagnostics.and_npm_install_D_types_Slashnode); + newline(); + emitHeader(Diagnostics.Other_Outputs); + emitOption( + "sourceMap", + /*defaultValue*/ + true + ); + emitOption( + "declaration", + /*defaultValue*/ + true + ); + emitOption( + "declarationMap", + /*defaultValue*/ + true + ); + newline(); + emitHeader(Diagnostics.Stricter_Typechecking_Options); + emitOption( + "noUncheckedIndexedAccess", + /*defaultValue*/ + true + ); + emitOption( + "exactOptionalPropertyTypes", + /*defaultValue*/ + true + ); + newline(); + emitHeader(Diagnostics.Style_Options); + emitOption( + "noImplicitReturns", + /*defaultValue*/ + true, + "optional" + ); + emitOption( + "noImplicitOverride", + /*defaultValue*/ + true, + "optional" + ); + emitOption( + "noUnusedLocals", + /*defaultValue*/ + true, + "optional" + ); + emitOption( + "noUnusedParameters", + /*defaultValue*/ + true, + "optional" + ); + emitOption( + "noFallthroughCasesInSwitch", + /*defaultValue*/ + true, + "optional" + ); + emitOption( + "noPropertyAccessFromIndexSignature", + /*defaultValue*/ + true, + "optional" + ); + newline(); + emitHeader(Diagnostics.Recommended_Options); + emitOption( + "strict", + /*defaultValue*/ + true + ); + emitOption("jsx", 4 /* ReactJSX */); + emitOption( + "verbatimModuleSyntax", + /*defaultValue*/ + true + ); + emitOption( + "isolatedModules", + /*defaultValue*/ + true + ); + emitOption( + "noUncheckedSideEffectImports", + /*defaultValue*/ + true + ); + emitOption("moduleDetection", 3 /* Force */); + emitOption( + "skipLibCheck", + /*defaultValue*/ + true + ); + if (allSetOptions.length > 0) { + newline(); + while (allSetOptions.length > 0) { + emitOption(allSetOptions[0], options[allSetOptions[0]]); + } } - function getOverwrittenDefaultOptions() { - const result = []; - const tab = makePadding(2); - commandOptionsWithoutBuild.forEach((cmd) => { - if (!compilerOptionsMap.has(cmd.name)) { - return; - } - const newValue = compilerOptionsMap.get(cmd.name); - const defaultValue = getDefaultValueForOption(cmd); - if (newValue !== defaultValue) { - result.push(`${tab}${cmd.name}: ${newValue}`); - } else if (hasProperty(defaultInitCompilerOptions, cmd.name)) { - result.push(`${tab}${cmd.name}: ${defaultValue}`); - } - }); - return result.join(newLine) + newLine; - } -} -function getSerializedCompilerOption(options) { - const compilerOptions = extend(options, defaultInitCompilerOptions); - return serializeCompilerOptions(compilerOptions); -} -function generateTSConfig(options, fileNames, newLine) { - const compilerOptionsMap = getSerializedCompilerOption(options); - return writeConfigurations(); - function makePadding(paddingLength) { - return Array(paddingLength + 1).join(" "); - } - function isAllowedOptionForOutput({ category, name, isCommandLineOnly }) { - const categoriesToSkip = [Diagnostics.Command_line_Options, Diagnostics.Editor_Support, Diagnostics.Compiler_Diagnostics, Diagnostics.Backwards_Compatibility, Diagnostics.Watch_and_Build_Modes, Diagnostics.Output_Formatting]; - return !isCommandLineOnly && category !== void 0 && (!categoriesToSkip.includes(category) || compilerOptionsMap.has(name)); - } - function writeConfigurations() { - const categorizedOptions = /* @__PURE__ */ new Map(); - categorizedOptions.set(Diagnostics.Projects, []); - categorizedOptions.set(Diagnostics.Language_and_Environment, []); - categorizedOptions.set(Diagnostics.Modules, []); - categorizedOptions.set(Diagnostics.JavaScript_Support, []); - categorizedOptions.set(Diagnostics.Emit, []); - categorizedOptions.set(Diagnostics.Interop_Constraints, []); - categorizedOptions.set(Diagnostics.Type_Checking, []); - categorizedOptions.set(Diagnostics.Completeness, []); - for (const option of optionDeclarations) { - if (isAllowedOptionForOutput(option)) { - let listForCategory = categorizedOptions.get(option.category); - if (!listForCategory) categorizedOptions.set(option.category, listForCategory = []); - listForCategory.push(option); - } - } - let marginLength = 0; - let seenKnownKeys = 0; - const entries = []; - categorizedOptions.forEach((options2, category) => { - if (entries.length !== 0) { - entries.push({ value: "" }); - } - entries.push({ value: `/* ${getLocaleSpecificMessage(category)} */` }); - for (const option of options2) { - let optionName; - if (compilerOptionsMap.has(option.name)) { - optionName = `"${option.name}": ${JSON.stringify(compilerOptionsMap.get(option.name))}${(seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ","}`; - } else { - optionName = `// "${option.name}": ${JSON.stringify(getDefaultValueForOption(option))},`; - } - entries.push({ - value: optionName, - description: `/* ${option.description && getLocaleSpecificMessage(option.description) || option.name} */` - }); - marginLength = Math.max(optionName.length, marginLength); - } - }); - const tab = makePadding(2); - const result = []; - result.push(`{`); - result.push(`${tab}"compilerOptions": {`); - result.push(`${tab}${tab}/* ${getLocaleSpecificMessage(Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file)} */`); + function newline() { result.push(""); - for (const entry of entries) { - const { value, description: description3 = "" } = entry; - result.push(value && `${tab}${tab}${value}${description3 && makePadding(marginLength - value.length + 2) + description3}`); + } + function emitHeader(header) { + result.push(`${tab}${tab}// ${getLocaleSpecificMessage(header)}`); + } + function emitOption(setting, defaultValue, commented = "never") { + const existingOptionIndex = allSetOptions.indexOf(setting); + if (existingOptionIndex >= 0) { + allSetOptions.splice(existingOptionIndex, 1); } - if (fileNames.length) { - result.push(`${tab}},`); - result.push(`${tab}"files": [`); - for (let i = 0; i < fileNames.length; i++) { - result.push(`${tab}${tab}${JSON.stringify(fileNames[i])}${i === fileNames.length - 1 ? "" : ","}`); - } - result.push(`${tab}]`); + let comment; + if (commented === "always") { + comment = true; + } else if (commented === "never") { + comment = false; } else { - result.push(`${tab}}`); + comment = !hasProperty(options, setting); + } + const value = options[setting] ?? defaultValue; + if (comment) { + result.push(`${tab}${tab}// "${setting}": ${formatValueOrArray(setting, value)},`); + } else { + result.push(`${tab}${tab}"${setting}": ${formatValueOrArray(setting, value)},`); } - result.push(`}`); - return result.join(newLine) + newLine; } + function formatValueOrArray(settingName, value) { + const option = optionDeclarations.filter((c) => c.name === settingName)[0]; + if (!option) Debug.fail(`No option named ${settingName}?`); + const map2 = option.type instanceof Map ? option.type : void 0; + if (isArray(value)) { + const map3 = "element" in option && option.element.type instanceof Map ? option.element.type : void 0; + return `[${value.map((v) => formatSingleValue(v, map3)).join(", ")}]`; + } else { + return formatSingleValue(value, map2); + } + } + function formatSingleValue(value, map2) { + if (map2) { + value = getNameOfCompilerOptionValue(value, map2) ?? Debug.fail(`No matching value of ${value}`); + } + return JSON.stringify(value); + } + result.push(`${tab}}`); + result.push(`}`); + result.push(``); + return result.join(newLine); } function convertToOptionsWithAbsolutePaths(options, toAbsolutePath) { const result = {}; @@ -43787,27 +44020,6 @@ function getOptionValueWithEmptyStrings(value, option) { }); } } -function getDefaultValueForOption(option) { - switch (option.type) { - case "number": - return 1; - case "boolean": - return true; - case "string": - const defaultValue = option.defaultValueDescription; - return option.isFilePath ? `./${defaultValue && typeof defaultValue === "string" ? defaultValue : ""}` : ""; - case "list": - return []; - case "listOrElement": - return getDefaultValueForOption(option.element); - case "object": - return {}; - default: - const value = firstOrUndefinedIterator(option.type.keys()); - if (value !== void 0) return value; - return Debug.fail("Expected 'option.type' to have entries."); - } -} // src/compiler/moduleNameResolver.ts function trace(host, message, ...args) { @@ -46461,26 +46673,26 @@ function getModuleInstanceStateCached(node, visited = /* @__PURE__ */ new Map()) function getModuleInstanceStateWorker(node, visited) { switch (node.kind) { // 1. interface declarations, type alias declarations - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: if (isEnumConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 272 /* ImportDeclaration */: - case 271 /* ImportEqualsDeclaration */: + case 273 /* ImportDeclaration */: + case 272 /* ImportEqualsDeclaration */: if (!hasSyntacticModifier(node, 32 /* Export */)) { return 0 /* NonInstantiated */; } break; // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: const exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 279 /* NamedExports */) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 280 /* NamedExports */) { let state = 0 /* NonInstantiated */; for (const specifier of exportDeclaration.exportClause.elements) { const specifierState = getModuleInstanceStateForAliasTarget(specifier, visited); @@ -46495,7 +46707,7 @@ function getModuleInstanceStateWorker(node, visited) { } break; // 5. other uninstantiated module declarations. - case 268 /* ModuleBlock */: { + case 269 /* ModuleBlock */: { let state = 0 /* NonInstantiated */; forEachChild(node, (n) => { const childState = getModuleInstanceStateCached(n, visited); @@ -46514,7 +46726,7 @@ function getModuleInstanceStateWorker(node, visited) { }); return state; } - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 80 /* Identifier */: if (node.flags & 4096 /* IdentifierIsInJSDocNamespace */) { @@ -46550,7 +46762,7 @@ function getModuleInstanceStateForAliasTarget(specifier, visited) { if (found === 1 /* Instantiated */) { return found; } - if (statement.kind === 271 /* ImportEqualsDeclaration */) { + if (statement.kind === 272 /* ImportEqualsDeclaration */) { found = 1 /* Instantiated */; } } @@ -46714,7 +46926,7 @@ function createBinder() { } } function getDeclarationName(node) { - if (node.kind === 277 /* ExportAssignment */) { + if (node.kind === 278 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } const name = getNameOfDeclaration(node); @@ -46723,7 +46935,7 @@ function createBinder() { const moduleName = getTextOfIdentifierOrLiteral(name); return isGlobalScopeAugmentation(node) ? "__global" : `"${moduleName}"`; } - if (name.kind === 167 /* ComputedPropertyName */) { + if (name.kind === 168 /* ComputedPropertyName */) { const nameExpression = name.expression; if (isStringOrNumericLiteralLike(nameExpression)) { return escapeLeadingUnderscores(nameExpression.text); @@ -46748,31 +46960,31 @@ function createBinder() { return isPropertyNameLiteral(name) ? getEscapedTextOfIdentifierOrLiteral(name) : void 0; } switch (node.kind) { - case 176 /* Constructor */: + case 177 /* Constructor */: return "__constructor" /* Constructor */; - case 184 /* FunctionType */: - case 179 /* CallSignature */: - case 323 /* JSDocSignature */: + case 185 /* FunctionType */: + case 180 /* CallSignature */: + case 324 /* JSDocSignature */: return "__call" /* Call */; - case 185 /* ConstructorType */: - case 180 /* ConstructSignature */: + case 186 /* ConstructorType */: + case 181 /* ConstructSignature */: return "__new" /* New */; - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: return "__index" /* Index */; - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 307 /* SourceFile */: + case 308 /* SourceFile */: return "export=" /* ExportEquals */; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: if (getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { return "export=" /* ExportEquals */; } Debug.fail("Unknown binary declaration kind"); break; - case 317 /* JSDocFunctionType */: + case 318 /* JSDocFunctionType */: return isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */; - case 169 /* Parameter */: - Debug.assert(node.parent.kind === 317 /* JSDocFunctionType */, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`); + case 170 /* Parameter */: + Debug.assert(node.parent.kind === 318 /* JSDocFunctionType */, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`); const functionType = node.parent; const index = functionType.parameters.indexOf(node); return "arg" + index; @@ -46818,7 +47030,7 @@ function createBinder() { messageNeedsName = false; multipleDefaultExports = true; } else { - if (symbol.declarations && symbol.declarations.length && (node.kind === 277 /* ExportAssignment */ && !node.isExportEquals)) { + if (symbol.declarations && symbol.declarations.length && (node.kind === 278 /* ExportAssignment */ && !node.isExportEquals)) { message = Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName = false; multipleDefaultExports = true; @@ -46857,7 +47069,7 @@ function createBinder() { function declareModuleMember(node, symbolFlags, symbolExcludes) { const hasExportModifier = !!(getCombinedModifierFlags(node) & 32 /* Export */) || jsdocTreatAsExported(node); if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 281 /* ExportSpecifier */ || node.kind === 271 /* ImportEqualsDeclaration */ && hasExportModifier) { + if (node.kind === 282 /* ExportSpecifier */ || node.kind === 272 /* ImportEqualsDeclaration */ && hasExportModifier) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { Debug.assertNode(container, canHaveLocals); @@ -46918,9 +47130,9 @@ function createBinder() { const saveThisParentContainer = thisParentContainer; const savedBlockScopeContainer = blockScopeContainer; const savedInReturnPosition = inReturnPosition; - if (node.kind === 219 /* ArrowFunction */ && node.body.kind !== 241 /* Block */) inReturnPosition = true; + if (node.kind === 220 /* ArrowFunction */ && node.body.kind !== 242 /* Block */) inReturnPosition = true; if (containerFlags & 1 /* IsContainer */) { - if (node.kind !== 219 /* ArrowFunction */) { + if (node.kind !== 220 /* ArrowFunction */) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -46942,7 +47154,7 @@ function createBinder() { const saveExceptionTarget = currentExceptionTarget; const saveActiveLabelList = activeLabelList; const saveHasExplicitReturn = hasExplicitReturn; - const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 175 /* ClassStaticBlockDeclaration */; + const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 176 /* ClassStaticBlockDeclaration */; if (!isImmediatelyInvoked) { currentFlow = createFlowNode( 2 /* Start */, @@ -46955,7 +47167,7 @@ function createBinder() { currentFlow.node = node; } } - currentReturnTarget = isImmediatelyInvoked || node.kind === 176 /* Constructor */ || isInJSFile(node) && (node.kind === 262 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */) ? createBranchLabel() : void 0; + currentReturnTarget = isImmediatelyInvoked || node.kind === 177 /* Constructor */ || isInJSFile(node) && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 219 /* FunctionExpression */) ? createBranchLabel() : void 0; currentExceptionTarget = void 0; currentBreakTarget = void 0; currentContinueTarget = void 0; @@ -46968,14 +47180,14 @@ function createBinder() { if (hasExplicitReturn) node.flags |= 1024 /* HasExplicitReturn */; node.endFlowNode = currentFlow; } - if (node.kind === 307 /* SourceFile */) { + if (node.kind === 308 /* SourceFile */) { node.flags |= emitFlags; node.endFlowNode = currentFlow; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 176 /* Constructor */ || node.kind === 175 /* ClassStaticBlockDeclaration */ || isInJSFile(node) && (node.kind === 262 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */)) { + if (node.kind === 177 /* Constructor */ || node.kind === 176 /* ClassStaticBlockDeclaration */ || isInJSFile(node) && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 219 /* FunctionExpression */)) { node.returnFlowNode = currentFlow; } } @@ -47002,8 +47214,8 @@ function createBinder() { blockScopeContainer = savedBlockScopeContainer; } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, (n) => n.kind === 262 /* FunctionDeclaration */ ? bind(n) : void 0); - bindEach(nodes, (n) => n.kind !== 262 /* FunctionDeclaration */ ? bind(n) : void 0); + bindEach(nodes, (n) => n.kind === 263 /* FunctionDeclaration */ ? bind(n) : void 0); + bindEach(nodes, (n) => n.kind !== 263 /* FunctionDeclaration */ ? bind(n) : void 0); } function bindEach(nodes, bindFunction = bind) { if (nodes === void 0) { @@ -47026,59 +47238,59 @@ function createBinder() { inAssignmentPattern = saveInAssignmentPattern; return; } - if (node.kind >= 243 /* FirstStatement */ && node.kind <= 259 /* LastStatement */ && (!options.allowUnreachableCode || node.kind === 253 /* ReturnStatement */)) { + if (node.kind >= 244 /* FirstStatement */ && node.kind <= 260 /* LastStatement */ && (!options.allowUnreachableCode || node.kind === 254 /* ReturnStatement */)) { node.flowNode = currentFlow; } switch (node.kind) { - case 247 /* WhileStatement */: + case 248 /* WhileStatement */: bindWhileStatement(node); break; - case 246 /* DoStatement */: + case 247 /* DoStatement */: bindDoStatement(node); break; - case 248 /* ForStatement */: + case 249 /* ForStatement */: bindForStatement(node); break; - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 245 /* IfStatement */: + case 246 /* IfStatement */: bindIfStatement(node); break; - case 253 /* ReturnStatement */: - case 257 /* ThrowStatement */: + case 254 /* ReturnStatement */: + case 258 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 252 /* BreakStatement */: - case 251 /* ContinueStatement */: + case 253 /* BreakStatement */: + case 252 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 258 /* TryStatement */: + case 259 /* TryStatement */: bindTryStatement(node); break; - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: bindSwitchStatement(node); break; - case 269 /* CaseBlock */: + case 270 /* CaseBlock */: bindCaseBlock(node); break; - case 296 /* CaseClause */: + case 297 /* CaseClause */: bindCaseClause(node); break; - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: bindExpressionStatement(node); break; - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: bindLabeledStatement(node); break; - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 225 /* PostfixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: if (isDestructuringAssignment(node)) { inAssignmentPattern = saveInAssignmentPattern; bindDestructuringAssignmentFlow(node); @@ -47086,53 +47298,53 @@ function createBinder() { } bindBinaryExpressionFlow(node); break; - case 220 /* DeleteExpression */: + case 221 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: bindAccessExpressionFlow(node); break; - case 213 /* CallExpression */: + case 214 /* CallExpression */: bindCallExpressionFlow(node); break; - case 235 /* NonNullExpression */: + case 236 /* NonNullExpression */: bindNonNullExpressionFlow(node); break; - case 346 /* JSDocTypedefTag */: - case 338 /* JSDocCallbackTag */: - case 340 /* JSDocEnumTag */: + case 347 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: + case 341 /* JSDocEnumTag */: bindJSDocTypeAlias(node); break; - case 351 /* JSDocImportTag */: + case 352 /* JSDocImportTag */: bindJSDocImportTag(node); break; // In source files and blocks, bind functions first to match hoisting that occurs at runtime - case 307 /* SourceFile */: { + case 308 /* SourceFile */: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 241 /* Block */: - case 268 /* ModuleBlock */: + case 242 /* Block */: + case 269 /* ModuleBlock */: bindEachFunctionsFirst(node.statements); break; - case 208 /* BindingElement */: + case 209 /* BindingElement */: bindBindingElementFlow(node); break; - case 169 /* Parameter */: + case 170 /* Parameter */: bindParameterFlow(node); break; - case 210 /* ObjectLiteralExpression */: - case 209 /* ArrayLiteralExpression */: - case 303 /* PropertyAssignment */: - case 230 /* SpreadElement */: + case 211 /* ObjectLiteralExpression */: + case 210 /* ArrayLiteralExpression */: + case 304 /* PropertyAssignment */: + case 231 /* SpreadElement */: inAssignmentPattern = saveInAssignmentPattern; // falls through default: @@ -47147,23 +47359,23 @@ function createBinder() { case 80 /* Identifier */: case 110 /* ThisKeyword */: return true; - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: return containsNarrowableReference(expr); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return hasNarrowableArgument(expr); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: if (isJSDocTypeAssertion(expr)) { return false; } // fallthrough - case 235 /* NonNullExpression */: + case 236 /* NonNullExpression */: return isNarrowingExpression(expr.expression); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: return expr.operator === 54 /* ExclamationToken */ && isNarrowingExpression(expr.operand); - case 221 /* TypeOfExpression */: + case 222 /* TypeOfExpression */: return isNarrowingExpression(expr.expression); } return false; @@ -47173,15 +47385,15 @@ function createBinder() { case 80 /* Identifier */: case 110 /* ThisKeyword */: case 108 /* SuperKeyword */: - case 236 /* MetaProperty */: + case 237 /* MetaProperty */: return true; - case 211 /* PropertyAccessExpression */: - case 217 /* ParenthesizedExpression */: - case 235 /* NonNullExpression */: + case 212 /* PropertyAccessExpression */: + case 218 /* ParenthesizedExpression */: + case 236 /* NonNullExpression */: return isNarrowableReference(expr.expression); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return (isStringOrNumericLiteralLike(expr.argumentExpression) || isEntityNameExpression(expr.argumentExpression)) && isNarrowableReference(expr.expression); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return expr.operatorToken.kind === 28 /* CommaToken */ && isNarrowableReference(expr.right) || isAssignmentOperator(expr.operatorToken.kind) && isLeftHandSideExpression(expr.left); } return false; @@ -47197,7 +47409,7 @@ function createBinder() { } } } - if (expr.expression.kind === 211 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { + if (expr.expression.kind === 212 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { return true; } return false; @@ -47230,9 +47442,9 @@ function createBinder() { } function isNarrowableOperand(expr) { switch (expr.kind) { - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 64 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -47319,21 +47531,21 @@ function createBinder() { function isStatementCondition(node) { const parent3 = node.parent; switch (parent3.kind) { - case 245 /* IfStatement */: - case 247 /* WhileStatement */: - case 246 /* DoStatement */: + case 246 /* IfStatement */: + case 248 /* WhileStatement */: + case 247 /* DoStatement */: return parent3.expression === node; - case 248 /* ForStatement */: - case 227 /* ConditionalExpression */: + case 249 /* ForStatement */: + case 228 /* ConditionalExpression */: return parent3.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 217 /* ParenthesizedExpression */) { + if (node.kind === 218 /* ParenthesizedExpression */) { node = node.expression; - } else if (node.kind === 224 /* PrefixUnaryExpression */ && node.operator === 54 /* ExclamationToken */) { + } else if (node.kind === 225 /* PrefixUnaryExpression */ && node.operator === 54 /* ExclamationToken */) { node = node.operand; } else { return isLogicalOrCoalescingBinaryExpression(node); @@ -47376,7 +47588,7 @@ function createBinder() { } function setContinueTarget(node, target) { let label = activeLabelList; - while (label && node.parent.kind === 256 /* LabeledStatement */) { + while (label && node.parent.kind === 257 /* LabeledStatement */) { label.continueTarget = target; label = label.next; node = node.parent; @@ -47430,12 +47642,12 @@ function createBinder() { bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 250 /* ForOfStatement */) { + if (node.kind === 251 /* ForOfStatement */) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 261 /* VariableDeclarationList */) { + if (node.initializer.kind !== 262 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -47460,7 +47672,7 @@ function createBinder() { inReturnPosition = true; bind(node.expression); inReturnPosition = savedInReturnPosition; - if (node.kind === 253 /* ReturnStatement */) { + if (node.kind === 254 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -47478,7 +47690,7 @@ function createBinder() { return void 0; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - const flowLabel = node.kind === 252 /* BreakStatement */ ? breakTarget : continueTarget; + const flowLabel = node.kind === 253 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -47549,7 +47761,7 @@ function createBinder() { preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - const hasDefault = forEach(node.caseBlock.clauses, (c) => c.kind === 297 /* DefaultClause */); + const hasDefault = forEach(node.caseBlock.clauses, (c) => c.kind === 298 /* DefaultClause */); node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedent; if (!hasDefault) { addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0)); @@ -47595,7 +47807,7 @@ function createBinder() { maybeBindExpressionFlowIfCall(node.expression); } function maybeBindExpressionFlowIfCall(node) { - if (node.kind === 213 /* CallExpression */) { + if (node.kind === 214 /* CallExpression */) { const call = node; if (call.expression.kind !== 108 /* SuperKeyword */ && isDottedName(call.expression)) { currentFlow = createFlowCall(currentFlow, call); @@ -47621,7 +47833,7 @@ function createBinder() { currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 226 /* BinaryExpression */ && node.operatorToken.kind === 64 /* EqualsToken */) { + if (node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 64 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { bindAssignmentTargetFlow(node); @@ -47630,21 +47842,21 @@ function createBinder() { function bindAssignmentTargetFlow(node) { if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); - } else if (node.kind === 209 /* ArrayLiteralExpression */) { + } else if (node.kind === 210 /* ArrayLiteralExpression */) { for (const e of node.elements) { - if (e.kind === 230 /* SpreadElement */) { + if (e.kind === 231 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { bindDestructuringTargetFlow(e); } } - } else if (node.kind === 210 /* ObjectLiteralExpression */) { + } else if (node.kind === 211 /* ObjectLiteralExpression */) { for (const p of node.properties) { - if (p.kind === 303 /* PropertyAssignment */) { + if (p.kind === 304 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); - } else if (p.kind === 304 /* ShorthandPropertyAssignment */) { + } else if (p.kind === 305 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); - } else if (p.kind === 305 /* SpreadAssignment */) { + } else if (p.kind === 306 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -47779,7 +47991,7 @@ function createBinder() { const operator = node.operatorToken.kind; if (isAssignmentOperator(operator) && !isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 64 /* EqualsToken */ && node.left.kind === 212 /* ElementAccessExpression */) { + if (operator === 64 /* EqualsToken */ && node.left.kind === 213 /* ElementAccessExpression */) { const elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -47807,7 +48019,7 @@ function createBinder() { } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 211 /* PropertyAccessExpression */) { + if (node.expression.kind === 212 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -47882,7 +48094,7 @@ function createBinder() { } function bindJSDocTypeAlias(node) { bind(node.tagName); - if (node.kind !== 340 /* JSDocEnumTag */ && node.fullName) { + if (node.kind !== 341 /* JSDocEnumTag */ && node.fullName) { setParent(node.fullName, node); setParentRecursive( node.fullName, @@ -47897,7 +48109,7 @@ function createBinder() { function bindJSDocClassTag(node) { bindEachChild(node); const host = getHostSignatureFromJSDoc(node); - if (host && host.kind !== 174 /* MethodDeclaration */) { + if (host && host.kind !== 175 /* MethodDeclaration */) { addDeclarationToSymbol(host.symbol, host, 32 /* Class */); } } @@ -47918,15 +48130,15 @@ function createBinder() { } function bindOptionalChainRest(node) { switch (node.kind) { - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: bind(node.questionDotToken); bind(node.name); break; - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: bind(node.questionDotToken); bind(node.argumentExpression); break; - case 213 /* CallExpression */: + case 214 /* CallExpression */: bind(node.questionDotToken); bindEach(node.typeArguments); bindEach(node.arguments); @@ -47976,7 +48188,7 @@ function createBinder() { bindOptionalChainFlow(node); } else { const expr = skipParentheses(node.expression); - if (expr.kind === 218 /* FunctionExpression */ || expr.kind === 219 /* ArrowFunction */) { + if (expr.kind === 219 /* FunctionExpression */ || expr.kind === 220 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -47987,7 +48199,7 @@ function createBinder() { } } } - if (node.expression.kind === 211 /* PropertyAccessExpression */) { + if (node.expression.kind === 212 /* PropertyAccessExpression */) { const propertyAccess = node.expression; if (isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -48006,39 +48218,39 @@ function createBinder() { // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 307 /* SourceFile */: + case 308 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 231 /* ClassExpression */: - case 263 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 264 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 187 /* TypeLiteral */: - case 322 /* JSDocTypeLiteral */: - case 210 /* ObjectLiteralExpression */: - case 264 /* InterfaceDeclaration */: - case 292 /* JsxAttributes */: + case 188 /* TypeLiteral */: + case 323 /* JSDocTypeLiteral */: + case 211 /* ObjectLiteralExpression */: + case 265 /* InterfaceDeclaration */: + case 293 /* JsxAttributes */: return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 323 /* JSDocSignature */: - case 181 /* IndexSignature */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 317 /* JSDocFunctionType */: - case 175 /* ClassStaticBlockDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 200 /* MappedType */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 324 /* JSDocSignature */: + case 182 /* IndexSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 318 /* JSDocFunctionType */: + case 176 /* ClassStaticBlockDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 201 /* MappedType */: if (container.locals) Debug.assertNode(container, canHaveLocals); return declareSymbol( container.locals, @@ -48139,10 +48351,10 @@ function createBinder() { } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 307 /* SourceFile */: + case 308 /* SourceFile */: if (isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -48357,7 +48569,7 @@ function createBinder() { } function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { - if (blockScopeContainer.kind !== 307 /* SourceFile */ && blockScopeContainer.kind !== 267 /* ModuleDeclaration */ && !isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) { + if (blockScopeContainer.kind !== 308 /* SourceFile */ && blockScopeContainer.kind !== 268 /* ModuleDeclaration */ && !isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) { const errorSpan = getErrorSpanForNode(file, node); file.bindDiagnostics.push(createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node))); } @@ -48413,7 +48625,7 @@ function createBinder() { if (tracing) node.tracingPath = file.path; const saveInStrictMode = inStrictMode; bindWorker(node); - if (node.kind > 165 /* LastToken */) { + if (node.kind > 166 /* LastToken */) { const saveParent = parent2; parent2 = node; const containerFlags = getContainerFlags(node); @@ -48480,23 +48692,23 @@ function createBinder() { } // falls through case 110 /* ThisKeyword */: - if (currentFlow && (isExpression(node) || parent2.kind === 304 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (isExpression(node) || parent2.kind === 305 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkContextualIdentifier(node); - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: if (currentFlow && isPartOfTypeQuery(node)) { node.flowNode = currentFlow; } break; - case 236 /* MetaProperty */: + case 237 /* MetaProperty */: case 108 /* SuperKeyword */: node.flowNode = currentFlow; break; case 81 /* PrivateIdentifier */: return checkPrivateIdentifier(node); - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: const expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -48515,7 +48727,7 @@ function createBinder() { ); } break; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: const specialKind = getAssignmentDeclarationKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -48550,78 +48762,78 @@ function createBinder() { Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 299 /* CatchClause */: + case 300 /* CatchClause */: return checkStrictModeCatchClause(node); - case 220 /* DeleteExpression */: + case 221 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); - case 225 /* PostfixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 254 /* WithStatement */: + case 255 /* WithStatement */: return checkStrictModeWithStatement(node); - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return checkStrictModeLabeledStatement(node); - case 197 /* ThisType */: + case 198 /* ThisType */: seenThisKeyword = true; return; - case 182 /* TypePredicate */: + case 183 /* TypePredicate */: break; // Binding the children will handle everything - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: return bindTypeParameter(node); - case 169 /* Parameter */: + case 170 /* Parameter */: return bindParameter(node); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 208 /* BindingElement */: + case 209 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: return bindPropertyWorker(node); - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 306 /* EnumMember */: + case 307 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 181 /* IndexSignature */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 182 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */); - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 176 /* Constructor */: + case 177 /* Constructor */: return declareSymbolAndAddToSymbolTable( node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */ ); - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */); - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */); - case 184 /* FunctionType */: - case 317 /* JSDocFunctionType */: - case 323 /* JSDocSignature */: - case 185 /* ConstructorType */: + case 185 /* FunctionType */: + case 318 /* JSDocFunctionType */: + case 324 /* JSDocSignature */: + case 186 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 187 /* TypeLiteral */: - case 322 /* JSDocTypeLiteral */: - case 200 /* MappedType */: + case 188 /* TypeLiteral */: + case 323 /* JSDocTypeLiteral */: + case 201 /* MappedType */: return bindAnonymousTypeWorker(node); - case 332 /* JSDocClassTag */: + case 333 /* JSDocClassTag */: return bindJSDocClassTag(node); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return bindFunctionExpression(node); - case 213 /* CallExpression */: + case 214 /* CallExpression */: const assignmentKind = getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7 /* ObjectDefinePropertyValue */: @@ -48641,66 +48853,66 @@ function createBinder() { } break; // Members of classes, interfaces, and modules - case 231 /* ClassExpression */: - case 263 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 264 /* ClassDeclaration */: inStrictMode = true; return bindClassLikeDeclaration(node); - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */); - case 265 /* TypeAliasDeclaration */: + case 266 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 292 /* JsxAttributes */: + case 293 /* JsxAttributes */: return bindJsxAttributes(node); - case 291 /* JsxAttribute */: + case 292 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 271 /* ImportEqualsDeclaration */: - case 274 /* NamespaceImport */: - case 276 /* ImportSpecifier */: - case 281 /* ExportSpecifier */: + case 272 /* ImportEqualsDeclaration */: + case 275 /* NamespaceImport */: + case 277 /* ImportSpecifier */: + case 282 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 270 /* NamespaceExportDeclaration */: + case 271 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 273 /* ImportClause */: + case 274 /* ImportClause */: return bindImportClause(node); - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: return bindExportDeclaration(node); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return bindExportAssignment(node); - case 307 /* SourceFile */: + case 308 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 241 /* Block */: + case 242 /* Block */: if (!isFunctionLikeOrClassStaticBlockDeclaration(node.parent)) { return; } // falls through - case 268 /* ModuleBlock */: + case 269 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 341 /* JSDocParameterTag */: - if (node.parent.kind === 323 /* JSDocSignature */) { + case 342 /* JSDocParameterTag */: + if (node.parent.kind === 324 /* JSDocSignature */) { return bindParameter(node); } - if (node.parent.kind !== 322 /* JSDocTypeLiteral */) { + if (node.parent.kind !== 323 /* JSDocTypeLiteral */) { break; } // falls through - case 348 /* JSDocPropertyTag */: + case 349 /* JSDocPropertyTag */: const propTag = node; - const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 316 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; + const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 317 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 346 /* JSDocTypedefTag */: - case 338 /* JSDocCallbackTag */: - case 340 /* JSDocEnumTag */: + case 347 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: + case 341 /* JSDocEnumTag */: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); - case 339 /* JSDocOverloadTag */: + case 340 /* JSDocOverloadTag */: return bind(node.typeExpression); - case 351 /* JSDocImportTag */: + case 352 /* JSDocImportTag */: return (jsDocImports || (jsDocImports = [])).push(node); } } @@ -48852,8 +49064,8 @@ function createBinder() { false ); switch (thisContainer.kind) { - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: let constructorSymbol = thisContainer.symbol; if (isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 64 /* EqualsToken */) { const l = thisContainer.parent.left; @@ -48871,12 +49083,12 @@ function createBinder() { addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */); } break; - case 176 /* Constructor */: - case 172 /* PropertyDeclaration */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 175 /* ClassStaticBlockDeclaration */: + case 177 /* Constructor */: + case 173 /* PropertyDeclaration */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 176 /* ClassStaticBlockDeclaration */: const containingClass = thisContainer.parent; const symbolTable = isStatic(thisContainer) ? containingClass.symbol.exports : containingClass.symbol.members; if (hasDynamicName(node)) { @@ -48893,7 +49105,7 @@ function createBinder() { ); } break; - case 307 /* SourceFile */: + case 308 /* SourceFile */: if (hasDynamicName(node)) { break; } else if (thisContainer.commonJsModuleIndicator) { @@ -48903,7 +49115,7 @@ function createBinder() { } break; // Namespaces are not allowed in javascript files, so do nothing here - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: break; default: Debug.failBadSyntaxKind(thisContainer); @@ -48931,7 +49143,7 @@ function createBinder() { function bindSpecialPropertyDeclaration(node) { if (node.expression.kind === 110 /* ThisKeyword */) { bindThisPropertyAssignment(node); - } else if (isBindableStaticAccessExpression(node) && node.parent.parent.kind === 307 /* SourceFile */) { + } else if (isBindableStaticAccessExpression(node) && node.parent.parent.kind === 308 /* SourceFile */) { if (isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } else { @@ -48980,7 +49192,7 @@ function createBinder() { } function bindObjectDefinePropertyAssignment(node) { let namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - const isToplevel = node.parent.parent.kind === 307 /* SourceFile */; + const isToplevel = node.parent.parent.kind === 308 /* SourceFile */; namespaceSymbol = bindPotentiallyMissingNamespaces( namespaceSymbol, node.arguments[0], @@ -49094,7 +49306,7 @@ function createBinder() { declareSymbol(symbolTable, namespaceSymbol, declaration, includes | 67108864 /* Assignment */, excludes & ~67108864 /* Assignment */); } function isTopLevelNamespaceAssignment(propertyAccess) { - return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 307 /* SourceFile */ : propertyAccess.parent.parent.kind === 307 /* SourceFile */; + return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 308 /* SourceFile */ : propertyAccess.parent.parent.kind === 308 /* SourceFile */; } function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { let namespaceSymbol = lookupSymbolForPropertyAccess(name, blockScopeContainer) || lookupSymbolForPropertyAccess(name, container); @@ -49156,7 +49368,7 @@ function createBinder() { } } function bindClassLikeDeclaration(node) { - if (node.kind === 263 /* ClassDeclaration */) { + if (node.kind === 264 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */); } else { const bindingName = node.name ? node.name.escapedText : "__class" /* Class */; @@ -49185,7 +49397,7 @@ function createBinder() { checkStrictModeEvalOrArguments(node, node.name); } if (!isBindingPattern(node.name)) { - const possibleVariableDecl = node.kind === 260 /* VariableDeclaration */ ? node : node.parent.parent; + const possibleVariableDecl = node.kind === 261 /* VariableDeclaration */ ? node : node.parent.parent; if (isInJSFile(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 32 /* Export */)) { declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); } else if (isBlockOrCatchScoped(node)) { @@ -49198,7 +49410,7 @@ function createBinder() { } } function bindParameter(node) { - if (node.kind === 341 /* JSDocParameterTag */ && container.kind !== 323 /* JSDocSignature */) { + if (node.kind === 342 /* JSDocParameterTag */ && container.kind !== 324 /* JSDocSignature */) { return; } if (inStrictMode && !(node.flags & 33554432 /* Ambient */)) { @@ -49271,7 +49483,7 @@ function createBinder() { } else { declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); } - } else if (node.parent.kind === 195 /* InferType */) { + } else if (node.parent.kind === 196 /* InferType */) { const container2 = getInferTypeContainer(node.parent); if (container2) { Debug.assertNode(container2, canHaveLocals); @@ -49302,10 +49514,10 @@ function createBinder() { if (currentFlow === unreachableFlow) { const reportError = ( // report error on all statements except empty ones - isStatementButNotDeclaration(node) && node.kind !== 242 /* EmptyStatement */ || // report error on class declarations - node.kind === 263 /* ClassDeclaration */ || // report errors on enums with preserved emit + isStatementButNotDeclaration(node) && node.kind !== 243 /* EmptyStatement */ || // report error on class declarations + node.kind === 264 /* ClassDeclaration */ || // report errors on enums with preserved emit isEnumDeclarationWithPreservedEmit(node, options) || // report error on instantiated modules - node.kind === 267 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node) + node.kind === 268 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node) ); if (reportError) { currentFlow = reportedUnreachableFlow; @@ -49319,7 +49531,7 @@ function createBinder() { } } function isEnumDeclarationWithPreservedEmit(node, options) { - return node.kind === 266 /* EnumDeclaration */ && (!isEnumConst(node) || shouldPreserveConstEnums(options)); + return node.kind === 267 /* EnumDeclaration */ && (!isEnumConst(node) || shouldPreserveConstEnums(options)); } function eachUnreachableRange(node, options, cb) { if (isStatement(node) && isExecutableStatement(node) && isBlock(node.parent)) { @@ -49335,12 +49547,12 @@ function eachUnreachableRange(node, options, cb) { } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: return true; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return getModuleInstanceState(s) !== 1 /* Instantiated */; - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: return !isEnumDeclarationWithPreservedEmit(s, options); default: return false; @@ -49376,55 +49588,57 @@ function isExportsOrModuleExportsOrAlias(sourceFile, node) { } function getContainerFlags(node) { switch (node.kind) { - case 231 /* ClassExpression */: - case 263 /* ClassDeclaration */: - case 266 /* EnumDeclaration */: - case 210 /* ObjectLiteralExpression */: - case 187 /* TypeLiteral */: - case 322 /* JSDocTypeLiteral */: - case 292 /* JsxAttributes */: + case 232 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 267 /* EnumDeclaration */: + case 211 /* ObjectLiteralExpression */: + case 188 /* TypeLiteral */: + case 323 /* JSDocTypeLiteral */: + case 293 /* JsxAttributes */: return 1 /* IsContainer */; - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 267 /* ModuleDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 200 /* MappedType */: - case 181 /* IndexSignature */: + case 268 /* ModuleDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 201 /* MappedType */: + case 182 /* IndexSignature */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 307 /* SourceFile */: + case 308 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 174 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 175 /* MethodDeclaration */: if (isObjectLiteralOrClassExpressionMethodOrAccessor(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */; } // falls through - case 176 /* Constructor */: - case 262 /* FunctionDeclaration */: - case 173 /* MethodSignature */: - case 179 /* CallSignature */: - case 323 /* JSDocSignature */: - case 317 /* JSDocFunctionType */: - case 184 /* FunctionType */: - case 180 /* ConstructSignature */: - case 185 /* ConstructorType */: - case 175 /* ClassStaticBlockDeclaration */: + case 177 /* Constructor */: + case 263 /* FunctionDeclaration */: + case 174 /* MethodSignature */: + case 180 /* CallSignature */: + case 324 /* JSDocSignature */: + case 318 /* JSDocFunctionType */: + case 185 /* FunctionType */: + case 181 /* ConstructSignature */: + case 186 /* ConstructorType */: + case 176 /* ClassStaticBlockDeclaration */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 352 /* JSDocImportTag */: + return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 268 /* ModuleBlock */: + case 269 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 299 /* CatchClause */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 269 /* CaseBlock */: + case 300 /* CatchClause */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 270 /* CaseBlock */: return 2 /* IsBlockScopedContainer */ | 32 /* HasLocals */; - case 241 /* Block */: + case 242 /* Block */: return isFunctionLike(node.parent) || isClassStaticBlockDeclaration(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */ | 32 /* HasLocals */; } return 0 /* None */; @@ -49584,7 +49798,7 @@ function createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignatu symbol.exports.forEach(visitSymbol); } forEach(symbol.declarations, (d) => { - if (d.type && d.type.kind === 186 /* TypeQuery */) { + if (d.type && d.type.kind === 187 /* TypeQuery */) { const query = d.type; const entity = getResolvedSymbol(getFirstIdentifier2(query.exprName)); visitSymbol(entity); @@ -49978,10 +50192,10 @@ function getNearestAncestorDirectoryWithPackageJson(host, fileName) { ); } function forEachFileNameOfModule(importingFileName, importedFileName, host, preferSymlinks, cb) { - var _a; + var _a, _b; const getCanonicalFileName = hostGetCanonicalFileName(host); const cwd = host.getCurrentDirectory(); - const referenceRedirect = host.isSourceOfProjectReferenceRedirect(importedFileName) ? host.getProjectReferenceRedirect(importedFileName) : void 0; + const referenceRedirect = host.isSourceOfProjectReferenceRedirect(importedFileName) ? (_a = host.getRedirectFromSourceFile(importedFileName)) == null ? void 0 : _a.outputDts : void 0; const importedPath = toPath(importedFileName, cwd, getCanonicalFileName); const redirects = host.redirectTargetsMap.get(importedPath) || emptyArray; const importedFileNames = [...referenceRedirect ? [referenceRedirect] : emptyArray, importedFileName, ...redirects]; @@ -49991,7 +50205,7 @@ function forEachFileNameOfModule(importingFileName, importedFileName, host, pref const result2 = forEach(targets, (p) => !(shouldFilterIgnoredPaths && containsIgnoredPath(p)) && cb(p, referenceRedirect === p)); if (result2) return result2; } - const symlinkedDirectories = (_a = host.getSymlinkCache) == null ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath(); + const symlinkedDirectories = (_b = host.getSymlinkCache) == null ? void 0 : _b.call(host).getSymlinkedDirectoriesByRealpath(); const fullImportedFileName = getNormalizedAbsolutePath(importedFileName, cwd); const result = symlinkedDirectories && forEachAncestorDirectoryStoppingAtGlobalCache( host, @@ -50983,11 +51197,11 @@ function createTypeChecker(host) { typePredicateToString: (predicate, enclosingDeclaration, flags) => { return typePredicateToString(predicate, getParseTreeNode(enclosingDeclaration), flags); }, - writeSignature: (signature, enclosingDeclaration, flags, kind, writer) => { - return signatureToString(signature, getParseTreeNode(enclosingDeclaration), flags, kind, writer); + writeSignature: (signature, enclosingDeclaration, flags, kind, writer, maximumLength, verbosityLevel, out) => { + return signatureToString(signature, getParseTreeNode(enclosingDeclaration), flags, kind, writer, maximumLength, verbosityLevel, out); }, - writeType: (type, enclosingDeclaration, flags, writer) => { - return typeToString(type, getParseTreeNode(enclosingDeclaration), flags, writer); + writeType: (type, enclosingDeclaration, flags, writer, maximumLength, verbosityLevel, out) => { + return typeToString(type, getParseTreeNode(enclosingDeclaration), flags, writer, maximumLength, verbosityLevel, out); }, writeSymbol: (symbol, enclosingDeclaration, meaning, flags, writer) => { return symbolToString(symbol, getParseTreeNode(enclosingDeclaration), meaning, flags, writer); @@ -51115,6 +51329,7 @@ function createTypeChecker(host) { getNullType: () => nullType, getESSymbolType: () => esSymbolType, getNeverType: () => neverType, + getNonPrimitiveType: () => nonPrimitiveType, getOptionalType: () => optionalType, getPromiseType: () => getGlobalPromiseType( /*reportErrors*/ @@ -51221,7 +51436,8 @@ function createTypeChecker(host) { isTypeParameterPossiblyReferenced, typeHasCallOrConstructSignatures, getSymbolFlags, - getTypeArgumentsForResolvedSignature + getTypeArgumentsForResolvedSignature, + isLibType }; function getTypeArgumentsForResolvedSignature(signature) { if (signature.mapper === void 0) return void 0; @@ -51622,6 +51838,7 @@ function createTypeChecker(host) { } }; var anyIterationTypes = createIterationTypes(anyType, anyType, anyType); + var silentNeverIterationTypes = createIterationTypes(silentNeverType, silentNeverType, silentNeverType); var asyncIterationTypesResolver = { iterableCacheKey: "iterationTypesOfAsyncIterable", iteratorCacheKey: "iterationTypesOfAsyncIterator", @@ -51733,6 +51950,9 @@ function createTypeChecker(host) { var inferenceContextNodes = []; var inferenceContexts = []; var inferenceContextCount = 0; + var activeTypeMappers = []; + var activeTypeMappersCaches = []; + var activeTypeMappersCount = 0; var emptyStringType = getStringLiteralType(""); var zeroType = getNumberLiteralType(0); var zeroBigIntType = getBigIntLiteralType({ negative: false, base10Value: "0" }); @@ -52255,13 +52475,13 @@ function createTypeChecker(host) { return true; } if (declaration.pos <= usage.pos && !(isPropertyDeclaration(declaration) && isThisProperty(usage.parent) && !declaration.initializer && !declaration.exclamationToken)) { - if (declaration.kind === 208 /* BindingElement */) { - const errorBindingElement = getAncestor(usage, 208 /* BindingElement */); + if (declaration.kind === 209 /* BindingElement */) { + const errorBindingElement = getAncestor(usage, 209 /* BindingElement */); if (errorBindingElement) { return findAncestor(errorBindingElement, isBindingElement) !== findAncestor(declaration, isBindingElement) || declaration.pos < errorBindingElement.pos; } - return isBlockScopedNameDeclaredBeforeUse(getAncestor(declaration, 260 /* VariableDeclaration */), usage); - } else if (declaration.kind === 260 /* VariableDeclaration */) { + return isBlockScopedNameDeclaredBeforeUse(getAncestor(declaration, 261 /* VariableDeclaration */), usage); + } else if (declaration.kind === 261 /* VariableDeclaration */) { return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } else if (isClassLike(declaration)) { const container = findAncestor(usage, (n) => n === declaration ? "quit" : isComputedPropertyName(n) ? n.parent.parent === declaration : !legacyDecorators && isDecorator(n) && (n.parent === declaration || isMethodDeclaration(n.parent) && n.parent.parent === declaration || isGetOrSetAccessorDeclaration(n.parent) && n.parent.parent === declaration || isPropertyDeclaration(n.parent) && n.parent.parent === declaration || isParameter(n.parent) && n.parent.parent.parent === declaration)); @@ -52284,10 +52504,10 @@ function createTypeChecker(host) { } return true; } - if (usage.parent.kind === 281 /* ExportSpecifier */ || usage.parent.kind === 277 /* ExportAssignment */ && usage.parent.isExportEquals) { + if (usage.parent.kind === 282 /* ExportSpecifier */ || usage.parent.kind === 278 /* ExportAssignment */ && usage.parent.isExportEquals) { return true; } - if (usage.kind === 277 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 278 /* ExportAssignment */ && usage.isExportEquals) { return true; } if (isUsedInFunctionOrInstanceProperty(usage, declaration)) { @@ -52305,9 +52525,9 @@ function createTypeChecker(host) { return false; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration2, usage2) { switch (declaration2.parent.parent.kind) { - case 243 /* VariableStatement */: - case 248 /* ForStatement */: - case 250 /* ForOfStatement */: + case 244 /* VariableStatement */: + case 249 /* ForStatement */: + case 251 /* ForOfStatement */: if (isSameScopeDescendentOf(usage2, declaration2, declContainer)) { return true; } @@ -52317,12 +52537,15 @@ function createTypeChecker(host) { return isForInOrOfStatement(grandparent) && isSameScopeDescendentOf(usage2, grandparent.expression, declContainer); } function isUsedInFunctionOrInstanceProperty(usage2, declaration2) { + return isUsedInFunctionOrInstancePropertyWorker(usage2, declaration2); + } + function isUsedInFunctionOrInstancePropertyWorker(usage2, declaration2) { return !!findAncestor(usage2, (current) => { if (current === declContainer) { return "quit"; } if (isFunctionLike(current)) { - return true; + return !getImmediatelyInvokedFunctionExpression(current); } if (isClassStaticBlockDeclaration(current)) { return declaration2.pos < usage2.pos; @@ -52332,7 +52555,7 @@ function createTypeChecker(host) { const initializerOfProperty = propertyDeclaration.initializer === current; if (initializerOfProperty) { if (isStatic(current.parent)) { - if (declaration2.kind === 174 /* MethodDeclaration */) { + if (declaration2.kind === 175 /* MethodDeclaration */) { return true; } if (isPropertyDeclaration(declaration2) && getContainingClass(usage2) === getContainingClass(declaration2)) { @@ -52346,13 +52569,22 @@ function createTypeChecker(host) { } } } else { - const isDeclarationInstanceProperty = declaration2.kind === 172 /* PropertyDeclaration */ && !isStatic(declaration2); + const isDeclarationInstanceProperty = declaration2.kind === 173 /* PropertyDeclaration */ && !isStatic(declaration2); if (!isDeclarationInstanceProperty || getContainingClass(usage2) !== getContainingClass(declaration2)) { return true; } } } } + const decorator = tryCast(current.parent, isDecorator); + if (decorator && decorator.expression === current) { + if (isParameter(decorator.parent)) { + return isUsedInFunctionOrInstancePropertyWorker(decorator.parent.parent.parent, declaration2) ? true : "quit"; + } + if (isMethodDeclaration(decorator.parent)) { + return isUsedInFunctionOrInstancePropertyWorker(decorator.parent.parent, declaration2) ? true : "quit"; + } + } return false; }); } @@ -52365,15 +52597,15 @@ function createTypeChecker(host) { return "quit"; } switch (node.kind) { - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return true; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return stopAtAnyPropertyDeclaration && (isPropertyDeclaration(declaration2) && node.parent === declaration2.parent || isParameterPropertyDeclaration(declaration2, declaration2.parent) && node.parent === declaration2.parent.parent) ? "quit" : true; - case 241 /* Block */: + case 242 /* Block */: switch (node.parent.kind) { - case 177 /* GetAccessor */: - case 174 /* MethodDeclaration */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 175 /* MethodDeclaration */: + case 179 /* SetAccessor */: return true; default: return false; @@ -52409,7 +52641,7 @@ function createTypeChecker(host) { function onFailedToResolveSymbol(errorLocation, nameArg, meaning, nameNotFoundMessage) { const name = isString(nameArg) ? nameArg : nameArg.escapedText; addLazyDiagnostic(() => { - if (!errorLocation || errorLocation.parent.kind !== 324 /* JSDocLink */ && !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && !checkAndReportErrorForExtendingInterface(errorLocation) && !checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) && !checkAndReportErrorForExportingPrimitiveType(errorLocation, name) && !checkAndReportErrorForUsingNamespaceAsTypeOrValue(errorLocation, name, meaning) && !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) && !checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) { + if (!errorLocation || errorLocation.parent.kind !== 325 /* JSDocLink */ && !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && !checkAndReportErrorForExtendingInterface(errorLocation) && !checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) && !checkAndReportErrorForExportingPrimitiveType(errorLocation, name) && !checkAndReportErrorForUsingNamespaceAsTypeOrValue(errorLocation, name, meaning) && !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) && !checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) { let suggestion; let suggestedLib; if (nameArg) { @@ -52480,7 +52712,7 @@ function createTypeChecker(host) { if (errorLocation && meaning & 111551 /* Value */ && result.flags & 2097152 /* Alias */ && !(result.flags & 111551 /* Value */) && !isValidTypeOnlyAliasUseSite(errorLocation)) { const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result, 111551 /* Value */); if (typeOnlyDeclaration) { - const message = typeOnlyDeclaration.kind === 281 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 280 /* NamespaceExport */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type; + const message = typeOnlyDeclaration.kind === 282 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 279 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 281 /* NamespaceExport */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type; const unescapedName = unescapeLeadingUnderscores(name); addTypeOnlyDeclarationRelatedInfo( error2(errorLocation, message, unescapedName), @@ -52493,7 +52725,7 @@ function createTypeChecker(host) { const isGlobal = getSymbol2(globals, name, meaning) === result; const nonValueSymbol = isGlobal && isSourceFile(lastLocation) && lastLocation.locals && getSymbol2(lastLocation.locals, name, ~111551 /* Value */); if (nonValueSymbol) { - const importDecl = (_a = nonValueSymbol.declarations) == null ? void 0 : _a.find((d) => d.kind === 276 /* ImportSpecifier */ || d.kind === 273 /* ImportClause */ || d.kind === 274 /* NamespaceImport */ || d.kind === 271 /* ImportEqualsDeclaration */); + const importDecl = (_a = nonValueSymbol.declarations) == null ? void 0 : _a.find((d) => d.kind === 277 /* ImportSpecifier */ || d.kind === 274 /* ImportClause */ || d.kind === 275 /* NamespaceImport */ || d.kind === 272 /* ImportEqualsDeclaration */); if (importDecl && !isTypeOnlyImportDeclaration(importDecl)) { error2(importDecl, Diagnostics.Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled, unescapeLeadingUnderscores(name)); } @@ -52507,7 +52739,7 @@ function createTypeChecker(host) { diagnostic, createDiagnosticForNode( typeOnlyDeclaration, - typeOnlyDeclaration.kind === 281 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 280 /* NamespaceExport */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here, + typeOnlyDeclaration.kind === 282 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 279 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 281 /* NamespaceExport */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here, unescapedName ) ); @@ -52566,9 +52798,9 @@ function createTypeChecker(host) { function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 80 /* Identifier */: - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : void 0; - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: if (isEntityNameExpression(node.expression)) { return node.expression; } @@ -52633,7 +52865,7 @@ function createTypeChecker(host) { return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 281 /* ExportSpecifier */) { + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 282 /* ExportSpecifier */) { error2(errorLocation, Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } @@ -52646,7 +52878,7 @@ function createTypeChecker(host) { if (grandparent && grandparent.parent && isHeritageClause(grandparent)) { const heritageKind = grandparent.token; const containerKind = grandparent.parent.kind; - if (containerKind === 264 /* InterfaceDeclaration */ && heritageKind === 96 /* ExtendsKeyword */) { + if (containerKind === 265 /* InterfaceDeclaration */ && heritageKind === 96 /* ExtendsKeyword */) { error2(errorLocation, Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types, unescapeLeadingUnderscores(name)); } else if (isClassLike(grandparent.parent) && heritageKind === 96 /* ExtendsKeyword */) { error2(errorLocation, Diagnostics.A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values, unescapeLeadingUnderscores(name)); @@ -52750,7 +52982,7 @@ function createTypeChecker(host) { return; } const declaration = (_a = result.declarations) == null ? void 0 : _a.find( - (d) => isBlockOrCatchScoped(d) || isClassLike(d) || d.kind === 266 /* EnumDeclaration */ + (d) => isBlockOrCatchScoped(d) || isClassLike(d) || d.kind === 267 /* EnumDeclaration */ ); if (declaration === void 0) return Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); if (!(declaration.flags & 33554432 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -52778,13 +53010,13 @@ function createTypeChecker(host) { } function getAnyImportSyntax(node) { switch (node.kind) { - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return node; - case 273 /* ImportClause */: + case 274 /* ImportClause */: return node.parent; - case 274 /* NamespaceImport */: + case 275 /* NamespaceImport */: return node.parent.parent; - case 276 /* ImportSpecifier */: + case 277 /* ImportSpecifier */: return node.parent.parent.parent; default: return void 0; @@ -52794,7 +53026,7 @@ function createTypeChecker(host) { return symbol.declarations && findLast(symbol.declarations, isAliasSymbolDeclaration); } function isAliasSymbolDeclaration(node) { - return node.kind === 271 /* ImportEqualsDeclaration */ || node.kind === 270 /* NamespaceExportDeclaration */ || node.kind === 273 /* ImportClause */ && !!node.name || node.kind === 274 /* NamespaceImport */ || node.kind === 280 /* NamespaceExport */ || node.kind === 276 /* ImportSpecifier */ || node.kind === 281 /* ExportSpecifier */ || node.kind === 277 /* ExportAssignment */ && exportAssignmentIsAlias(node) || isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || isAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 64 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || node.kind === 304 /* ShorthandPropertyAssignment */ || node.kind === 303 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer) || node.kind === 260 /* VariableDeclaration */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node) || node.kind === 208 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent); + return node.kind === 272 /* ImportEqualsDeclaration */ || node.kind === 271 /* NamespaceExportDeclaration */ || node.kind === 274 /* ImportClause */ && !!node.name || node.kind === 275 /* NamespaceImport */ || node.kind === 281 /* NamespaceExport */ || node.kind === 277 /* ImportSpecifier */ || node.kind === 282 /* ExportSpecifier */ || node.kind === 278 /* ExportAssignment */ && exportAssignmentIsAlias(node) || isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || isAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 64 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || node.kind === 305 /* ShorthandPropertyAssignment */ || node.kind === 304 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer) || node.kind === 261 /* VariableDeclaration */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node) || node.kind === 209 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent); } function isAliasableOrJsExpression(e) { return isAliasableExpression(e) || isFunctionExpression(e) && isJSConstructor(e); @@ -52805,12 +53037,18 @@ function createTypeChecker(host) { const name = getLeftmostAccessExpression(commonJSPropertyAccess.expression).arguments[0]; return isIdentifier(commonJSPropertyAccess.name) ? resolveSymbol(getPropertyOfType(resolveExternalModuleTypeByLiteral(name), commonJSPropertyAccess.name.escapedText)) : void 0; } - if (isVariableDeclaration(node) || node.moduleReference.kind === 283 /* ExternalModuleReference */) { + if (isVariableDeclaration(node) || node.moduleReference.kind === 284 /* ExternalModuleReference */) { const immediate = resolveExternalModuleName( node, getExternalModuleRequireArgument(node) || getExternalModuleImportEqualsDeclarationExpression(node) ); const resolved2 = resolveExternalModuleSymbol(immediate); + if (resolved2 && 102 /* Node20 */ <= moduleKind && moduleKind <= 199 /* NodeNext */) { + const moduleExports = getExportOfModule(resolved2, "module.exports", node, dontResolveAlias); + if (moduleExports) { + return moduleExports; + } + } markSymbolOfAliasDeclarationIfTypeOnly( node, immediate, @@ -52834,10 +53072,10 @@ function createTypeChecker(host) { false ) && !node.isTypeOnly) { const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfDeclaration(node)); - const isExport = typeOnlyDeclaration.kind === 281 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 278 /* ExportDeclaration */; + const isExport = typeOnlyDeclaration.kind === 282 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 279 /* ExportDeclaration */; const message = isExport ? Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type : Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type; const relatedMessage = isExport ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here; - const name = typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ ? "*" : moduleExportNameTextUnescaped(typeOnlyDeclaration.name); + const name = typeOnlyDeclaration.kind === 279 /* ExportDeclaration */ ? "*" : moduleExportNameTextUnescaped(typeOnlyDeclaration.name); addRelatedInfo(error2(node.moduleReference, message), createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name)); } } @@ -52940,14 +53178,29 @@ function createTypeChecker(host) { } function getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias) { var _a; + const file = (_a = moduleSymbol.declarations) == null ? void 0 : _a.find(isSourceFile); + const specifier = getModuleSpecifierForImportOrExport(node); let exportDefaultSymbol; + let exportModuleDotExportsSymbol; if (isShorthandAmbientModuleSymbol(moduleSymbol)) { exportDefaultSymbol = moduleSymbol; + } else if (file && specifier && 102 /* Node20 */ <= moduleKind && moduleKind <= 199 /* NodeNext */ && getEmitSyntaxForModuleSpecifierExpression(specifier) === 1 /* CommonJS */ && host.getImpliedNodeFormatForEmit(file) === 99 /* ESNext */ && (exportModuleDotExportsSymbol = resolveExportByName(moduleSymbol, "module.exports", node, dontResolveAlias))) { + if (!getESModuleInterop(compilerOptions)) { + error2(node.name, Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString(moduleSymbol), "esModuleInterop"); + return void 0; + } + markSymbolOfAliasDeclarationIfTypeOnly( + node, + exportModuleDotExportsSymbol, + /*finalTarget*/ + void 0, + /*overwriteEmpty*/ + false + ); + return exportModuleDotExportsSymbol; } else { exportDefaultSymbol = resolveExportByName(moduleSymbol, "default" /* Default */, node, dontResolveAlias); } - const file = (_a = moduleSymbol.declarations) == null ? void 0 : _a.find(isSourceFile); - const specifier = getModuleSpecifierForImportOrExport(node); if (!specifier) { return exportDefaultSymbol; } @@ -52997,15 +53250,15 @@ function createTypeChecker(host) { } function getModuleSpecifierForImportOrExport(node) { switch (node.kind) { - case 273 /* ImportClause */: + case 274 /* ImportClause */: return node.parent.moduleSpecifier; - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return isExternalModuleReference(node.moduleReference) ? node.moduleReference.expression : void 0; - case 274 /* NamespaceImport */: + case 275 /* NamespaceImport */: return node.parent.parent.moduleSpecifier; - case 276 /* ImportSpecifier */: + case 277 /* ImportSpecifier */: return node.parent.parent.parent.moduleSpecifier; - case 281 /* ExportSpecifier */: + case 282 /* ExportSpecifier */: return node.parent.parent.moduleSpecifier; default: return Debug.assertNever(node); @@ -53338,26 +53591,26 @@ function createTypeChecker(host) { } function getTargetOfAliasDeclaration(node, dontRecursivelyResolve = false) { switch (node.kind) { - case 271 /* ImportEqualsDeclaration */: - case 260 /* VariableDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 261 /* VariableDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 273 /* ImportClause */: + case 274 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 274 /* NamespaceImport */: + case 275 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 280 /* NamespaceExport */: + case 281 /* NamespaceExport */: return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 276 /* ImportSpecifier */: - case 208 /* BindingElement */: + case 277 /* ImportSpecifier */: + case 209 /* BindingElement */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 281 /* ExportSpecifier */: + case 282 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 277 /* ExportAssignment */: - case 226 /* BinaryExpression */: + case 278 /* ExportAssignment */: + case 227 /* BinaryExpression */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 270 /* NamespaceExportDeclaration */: + case 271 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return resolveEntityName( node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, @@ -53365,10 +53618,10 @@ function createTypeChecker(host) { true, dontRecursivelyResolve ); - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return getTargetOfAliasLikeExpression(node.initializer, dontRecursivelyResolve); - case 212 /* ElementAccessExpression */: - case 211 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: return getTargetOfAccessExpression(node, dontRecursivelyResolve); default: return Debug.fail(); @@ -53490,7 +53743,7 @@ function createTypeChecker(host) { return links.typeOnlyDeclaration || void 0; } if (links.typeOnlyDeclaration) { - const resolved = links.typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ ? resolveSymbol(getExportsOfModule(links.typeOnlyDeclaration.symbol.parent).get(links.typeOnlyExportStarName || symbol.escapedName)) : resolveAlias(links.typeOnlyDeclaration.symbol); + const resolved = links.typeOnlyDeclaration.kind === 279 /* ExportDeclaration */ ? resolveSymbol(getExportsOfModule(links.typeOnlyDeclaration.symbol.parent).get(links.typeOnlyExportStarName || symbol.escapedName)) : resolveAlias(links.typeOnlyDeclaration.symbol); return getSymbolFlags(resolved) & include ? links.typeOnlyDeclaration : void 0; } return void 0; @@ -53499,7 +53752,7 @@ function createTypeChecker(host) { if (entityName.kind === 80 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 80 /* Identifier */ || entityName.parent.kind === 166 /* QualifiedName */) { + if (entityName.kind === 80 /* Identifier */ || entityName.parent.kind === 167 /* QualifiedName */) { return resolveEntityName( entityName, 1920 /* Namespace */, @@ -53508,7 +53761,7 @@ function createTypeChecker(host) { dontResolveAlias ); } else { - Debug.assert(entityName.parent.kind === 271 /* ImportEqualsDeclaration */); + Debug.assert(entityName.parent.kind === 272 /* ImportEqualsDeclaration */); return resolveEntityName( entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, @@ -53579,9 +53832,9 @@ function createTypeChecker(host) { if (!symbol) { return getMergedSymbol(symbolFromJSPrototype); } - } else if (name.kind === 166 /* QualifiedName */ || name.kind === 211 /* PropertyAccessExpression */) { - const left = name.kind === 166 /* QualifiedName */ ? name.left : name.expression; - const right = name.kind === 166 /* QualifiedName */ ? name.right : name.name; + } else if (name.kind === 167 /* QualifiedName */ || name.kind === 212 /* PropertyAccessExpression */) { + const left = name.kind === 167 /* QualifiedName */ ? name.left : name.expression; + const right = name.kind === 167 /* QualifiedName */ ? name.right : name.name; let namespace = resolveEntityName( left, namespaceMeaning, @@ -53647,7 +53900,7 @@ function createTypeChecker(host) { } else { Debug.assertNever(name, "Unknown entity name kind."); } - if (!nodeIsSynthesized(name) && isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 277 /* ExportAssignment */)) { + if (!nodeIsSynthesized(name) && isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 278 /* ExportAssignment */)) { markSymbolOfAliasDeclarationIfTypeOnly( getAliasDeclarationFromName(name), symbol, @@ -53739,7 +53992,7 @@ function createTypeChecker(host) { return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, !ignoreErrors ? moduleReferenceExpression : void 0, isForAugmentation) : void 0; } function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) { - var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k; + var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l; if (errorNode && startsWith(moduleReference, "@types/")) { const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1; const withoutAtTypePrefix = removePrefix(moduleReference, "@types/"); @@ -53798,7 +54051,7 @@ function createTypeChecker(host) { getAnyExtensionFromPath(moduleReference) ); } else if (resolvedModule.resolvedUsingTsExtension && shouldRewrite) { - const redirect = host.getResolvedProjectReferenceToRedirect(sourceFile.path); + const redirect = (_i = host.getRedirectFromSourceFile(sourceFile.path)) == null ? void 0 : _i.resolvedRef; if (redirect) { const ignoreCase = !host.useCaseSensitiveFileNames(); const ownRootDir = host.getCommonSourceDirectory(); @@ -53838,7 +54091,7 @@ function createTypeChecker(host) { if (ext === ".ts" /* Ts */ || ext === ".js" /* Js */ || ext === ".tsx" /* Tsx */ || ext === ".jsx" /* Jsx */) { diagnosticDetails = createModeMismatchDetails(currentSourceFile); } - const message = (overrideHost == null ? void 0 : overrideHost.kind) === 272 /* ImportDeclaration */ && ((_i = overrideHost.importClause) == null ? void 0 : _i.isTypeOnly) ? Diagnostics.Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute : (overrideHost == null ? void 0 : overrideHost.kind) === 205 /* ImportType */ ? Diagnostics.Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute : Diagnostics.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead; + const message = (overrideHost == null ? void 0 : overrideHost.kind) === 273 /* ImportDeclaration */ && ((_j = overrideHost.importClause) == null ? void 0 : _j.isTypeOnly) ? Diagnostics.Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute : (overrideHost == null ? void 0 : overrideHost.kind) === 206 /* ImportType */ ? Diagnostics.Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute : Diagnostics.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead; diagnostics.add(createDiagnosticForNodeFromMessageChain( getSourceFileOfNode(errorNode), errorNode, @@ -53886,9 +54139,9 @@ function createTypeChecker(host) { } if (moduleNotFoundError) { if (resolvedModule) { - const redirect = host.getProjectReferenceRedirect(resolvedModule.resolvedFileName); - if (redirect) { - error2(errorNode, Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect, resolvedModule.resolvedFileName); + const redirect = host.getRedirectFromSourceFile(resolvedModule.resolvedFileName); + if (redirect == null ? void 0 : redirect.outputDts) { + error2(errorNode, Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect.outputDts, resolvedModule.resolvedFileName); return void 0; } } @@ -53901,14 +54154,14 @@ function createTypeChecker(host) { error2(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference); } else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) { const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path)); - const suggestedExt = (_j = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _j[1]; + const suggestedExt = (_k = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _k[1]; if (suggestedExt) { error2(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt); } else { error2(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path); } } else { - if ((_k = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _k.alternateResult) { + if ((_l = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _l.alternateResult) { const errorInfo = createModuleNotFoundChain(currentSourceFile, host, moduleReference, mode, moduleReference); errorOrSuggestion( /*isError*/ @@ -53988,13 +54241,14 @@ function createTypeChecker(host) { var _a; const symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !getDeclarationOfKind(symbol, 307 /* SourceFile */)) { + if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !getDeclarationOfKind(symbol, 308 /* SourceFile */)) { const compilerOptionName = moduleKind >= 5 /* ES2015 */ ? "allowSyntheticDefaultImports" : "esModuleInterop"; error2(referencingLocation, Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, compilerOptionName); return symbol; } const referenceParent = referencingLocation.parent; - if (isImportDeclaration(referenceParent) && getNamespaceDeclarationNode(referenceParent) || isImportCall(referenceParent)) { + const namespaceImport = isImportDeclaration(referenceParent) && getNamespaceDeclarationNode(referenceParent); + if (namespaceImport || isImportCall(referenceParent)) { const reference = isImportCall(referenceParent) ? referenceParent.arguments[0] : referenceParent.moduleSpecifier; const type = getTypeOfSymbol(symbol); const defaultOnlyType = getTypeWithSyntheticDefaultOnly(type, symbol, moduleSymbol, reference); @@ -54002,13 +54256,20 @@ function createTypeChecker(host) { return cloneTypeAsModuleType(symbol, defaultOnlyType, referenceParent); } const targetFile = (_a = moduleSymbol == null ? void 0 : moduleSymbol.declarations) == null ? void 0 : _a.find(isSourceFile); - const isEsmCjsRef = targetFile && isESMFormatImportImportingCommonjsFormatFile(getEmitSyntaxForModuleSpecifierExpression(reference), host.getImpliedNodeFormatForEmit(targetFile)); - if (getESModuleInterop(compilerOptions) || isEsmCjsRef) { - let sigs = getSignaturesOfStructuredType(type, 0 /* Call */); - if (!sigs || !sigs.length) { - sigs = getSignaturesOfStructuredType(type, 1 /* Construct */); + const usageMode = getEmitSyntaxForModuleSpecifierExpression(reference); + let exportModuleDotExportsSymbol; + if (namespaceImport && targetFile && 102 /* Node20 */ <= moduleKind && moduleKind <= 199 /* NodeNext */ && usageMode === 1 /* CommonJS */ && host.getImpliedNodeFormatForEmit(targetFile) === 99 /* ESNext */ && (exportModuleDotExportsSymbol = resolveExportByName(symbol, "module.exports", namespaceImport, dontResolveAlias))) { + if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */))) { + error2(referencingLocation, Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, "esModuleInterop"); + } + if (getESModuleInterop(compilerOptions) && hasSignatures(type)) { + return cloneTypeAsModuleType(exportModuleDotExportsSymbol, type, referenceParent); } - if (sigs && sigs.length || getPropertyOfType( + return exportModuleDotExportsSymbol; + } + const isEsmCjsRef = targetFile && isESMFormatImportImportingCommonjsFormatFile(usageMode, host.getImpliedNodeFormatForEmit(targetFile)); + if (getESModuleInterop(compilerOptions) || isEsmCjsRef) { + if (hasSignatures(type) || getPropertyOfType( type, "default" /* Default */, /*skipObjectFunctionPropertyAugment*/ @@ -54022,6 +54283,9 @@ function createTypeChecker(host) { } return symbol; } + function hasSignatures(type) { + return some(getSignaturesOfStructuredType(type, 0 /* Call */)) || some(getSignaturesOfStructuredType(type, 1 /* Construct */)); + } function cloneTypeAsModuleType(symbol, moduleType, referenceParent) { const result = createSymbol(symbol.flags, symbol.escapedName); result.declarations = symbol.declarations ? symbol.declarations.slice() : []; @@ -54205,7 +54469,7 @@ function createTypeChecker(host) { } function getFunctionExpressionParentSymbolOrSymbol(symbol) { var _a, _b; - return ((_a = symbol.valueDeclaration) == null ? void 0 : _a.kind) === 219 /* ArrowFunction */ || ((_b = symbol.valueDeclaration) == null ? void 0 : _b.kind) === 218 /* FunctionExpression */ ? getSymbolOfNode(symbol.valueDeclaration.parent) || symbol : symbol; + return ((_a = symbol.valueDeclaration) == null ? void 0 : _a.kind) === 220 /* ArrowFunction */ || ((_b = symbol.valueDeclaration) == null ? void 0 : _b.kind) === 219 /* FunctionExpression */ ? getSymbolOfNode(symbol.valueDeclaration.parent) || symbol : symbol; } function getAlternativeContainingModules(symbol, enclosingDeclaration) { const containingFile = getSourceFileOfNode(enclosingDeclaration); @@ -54465,12 +54729,12 @@ function createTypeChecker(host) { } } switch (location.kind) { - case 307 /* SourceFile */: + case 308 /* SourceFile */: if (!isExternalOrCommonJsModule(location)) { break; } // falls through - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: const sym = getSymbolOfDeclaration(location); if (result = callback( (sym == null ? void 0 : sym.exports) || emptySymbols, @@ -54483,9 +54747,9 @@ function createTypeChecker(host) { return result; } break; - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: let table; (getSymbolOfDeclaration(location).members || emptySymbols).forEach((memberSymbol, key) => { if (memberSymbol.flags & (788968 /* Type */ & ~67108864 /* Assignment */)) { @@ -54563,7 +54827,7 @@ function createTypeChecker(host) { return [symbol]; } const result2 = forEachEntry(symbols, (symbolFromSymbolTable) => { - if (symbolFromSymbolTable.flags & 2097152 /* Alias */ && symbolFromSymbolTable.escapedName !== "export=" /* ExportEquals */ && symbolFromSymbolTable.escapedName !== "default" /* Default */ && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && isExternalModule(getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || some(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) && (isLocalNameLookup ? !some(symbolFromSymbolTable.declarations, isNamespaceReexportDeclaration) : true) && (ignoreQualification || !getDeclarationOfKind(symbolFromSymbolTable, 281 /* ExportSpecifier */))) { + if (symbolFromSymbolTable.flags & 2097152 /* Alias */ && symbolFromSymbolTable.escapedName !== "export=" /* ExportEquals */ && symbolFromSymbolTable.escapedName !== "default" /* Default */ && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && isExternalModule(getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || some(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) && (isLocalNameLookup ? !some(symbolFromSymbolTable.declarations, isNamespaceReexportDeclaration) : true) && (ignoreQualification || !getDeclarationOfKind(symbolFromSymbolTable, 282 /* ExportSpecifier */))) { const resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); const candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -54608,7 +54872,7 @@ function createTypeChecker(host) { if (symbolFromSymbolTable === symbol) { return true; } - const shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 /* Alias */ && !getDeclarationOfKind(symbolFromSymbolTable, 281 /* ExportSpecifier */); + const shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 /* Alias */ && !getDeclarationOfKind(symbolFromSymbolTable, 282 /* ExportSpecifier */); symbolFromSymbolTable = shouldResolveAlias ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; const flags = shouldResolveAlias ? getSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags; if (flags & meaning) { @@ -54623,10 +54887,10 @@ function createTypeChecker(host) { if (symbol.declarations && symbol.declarations.length) { for (const declaration of symbol.declarations) { switch (declaration.kind) { - case 172 /* PropertyDeclaration */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 173 /* PropertyDeclaration */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: continue; default: return false; @@ -54761,10 +55025,10 @@ function createTypeChecker(host) { return node && getSymbolOfDeclaration(node); } function hasExternalModuleSymbol(declaration) { - return isAmbientModule(declaration) || declaration.kind === 307 /* SourceFile */ && isExternalOrCommonJsModule(declaration); + return isAmbientModule(declaration) || declaration.kind === 308 /* SourceFile */ && isExternalOrCommonJsModule(declaration); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return isModuleWithStringLiteralName(declaration) || declaration.kind === 307 /* SourceFile */ && isExternalOrCommonJsModule(declaration); + return isModuleWithStringLiteralName(declaration) || declaration.kind === 308 /* SourceFile */ && isExternalOrCommonJsModule(declaration); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { let aliasesToMakeVisible; @@ -54788,7 +55052,14 @@ function createTypeChecker(host) { if (symbol.flags & 2097152 /* Alias */ && isInJSFile(declaration) && ((_a = declaration.parent) == null ? void 0 : _a.parent) && isVariableDeclaration(declaration.parent.parent) && ((_b = declaration.parent.parent.parent) == null ? void 0 : _b.parent) && isVariableStatement(declaration.parent.parent.parent.parent) && !hasSyntacticModifier(declaration.parent.parent.parent.parent, 32 /* Export */) && declaration.parent.parent.parent.parent.parent && isDeclarationVisible(declaration.parent.parent.parent.parent.parent)) { return addVisibleAlias(declaration, declaration.parent.parent.parent.parent); } else if (symbol.flags & 2 /* BlockScopedVariable */) { - const variableStatement = findAncestor(declaration, isVariableStatement); + const rootDeclaration = walkUpBindingElementsAndPatterns(declaration); + if (rootDeclaration.kind === 170 /* Parameter */) { + return false; + } + const variableStatement = rootDeclaration.parent.parent; + if (variableStatement.kind !== 244 /* VariableStatement */) { + return false; + } if (hasSyntacticModifier(variableStatement, 32 /* Export */)) { return true; } @@ -54812,9 +55083,9 @@ function createTypeChecker(host) { } function getMeaningOfEntityNameReference(entityName) { let meaning; - if (entityName.parent.kind === 186 /* TypeQuery */ || entityName.parent.kind === 233 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 167 /* ComputedPropertyName */ || entityName.parent.kind === 182 /* TypePredicate */ && entityName.parent.parameterName === entityName) { + if (entityName.parent.kind === 187 /* TypeQuery */ || entityName.parent.kind === 234 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 168 /* ComputedPropertyName */ || entityName.parent.kind === 183 /* TypePredicate */ && entityName.parent.parameterName === entityName) { meaning = 111551 /* Value */ | 1048576 /* ExportValue */; - } else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 271 /* ImportEqualsDeclaration */ || entityName.parent.kind === 166 /* QualifiedName */ && entityName.parent.left === entityName || entityName.parent.kind === 211 /* PropertyAccessExpression */ && entityName.parent.expression === entityName || entityName.parent.kind === 212 /* ElementAccessExpression */ && entityName.parent.expression === entityName) { + } else if (entityName.kind === 167 /* QualifiedName */ || entityName.kind === 212 /* PropertyAccessExpression */ || entityName.parent.kind === 272 /* ImportEqualsDeclaration */ || entityName.parent.kind === 167 /* QualifiedName */ && entityName.parent.left === entityName || entityName.parent.kind === 212 /* PropertyAccessExpression */ && entityName.parent.expression === entityName || entityName.parent.kind === 213 /* ElementAccessExpression */ && entityName.parent.expression === entityName) { meaning = 1920 /* Namespace */; } else { meaning = 788968 /* Type */; @@ -54886,7 +55157,7 @@ function createTypeChecker(host) { return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker); function symbolToStringWorker(writer2) { const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags, internalNodeFlags); - const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 307 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments(); + const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( 4 /* Unspecified */, @@ -54898,16 +55169,28 @@ function createTypeChecker(host) { return writer2; } } - function signatureToString(signature, enclosingDeclaration, flags = 0 /* None */, kind, writer) { + function signatureToString(signature, enclosingDeclaration, flags = 0 /* None */, kind, writer, maximumLength, verbosityLevel, out) { return writer ? signatureToStringWorker(writer).getText() : usingSingleLineStringWriter(signatureToStringWorker); function signatureToStringWorker(writer2) { let sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 185 /* ConstructorType */ : 184 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 186 /* ConstructorType */ : 185 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 180 /* ConstructSignature */ : 179 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 181 /* ConstructSignature */ : 180 /* CallSignature */; } - const sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); + const sig = nodeBuilder.signatureToSignatureDeclaration( + signature, + sigOutput, + enclosingDeclaration, + toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */, + /*internalFlags*/ + void 0, + /*tracker*/ + void 0, + maximumLength, + verbosityLevel, + out + ); const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( @@ -54920,14 +55203,19 @@ function createTypeChecker(host) { return writer2; } } - function typeToString(type, enclosingDeclaration, flags = 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer = createTextWriter("")) { + function typeToString(type, enclosingDeclaration, flags = 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer = createTextWriter(""), maximumLength, verbosityLevel, out) { const noTruncation = compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */; const typeNode = nodeBuilder.typeToTypeNode( type, enclosingDeclaration, - toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0 /* None */), + toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0), /*internalFlags*/ - void 0 + void 0, + /*tracker*/ + void 0, + maximumLength, + verbosityLevel, + out ); if (typeNode === void 0) return Debug.fail("should always get typenode"); const printer = type !== unresolvedType ? createPrinterWithRemoveComments() : createPrinterWithDefaults(); @@ -54940,7 +55228,7 @@ function createTypeChecker(host) { writer ); const result = writer.getText(); - const maxLength2 = noTruncation ? noTruncationMaximumTruncationLength * 2 : defaultMaximumTruncationLength * 2; + const maxLength2 = maximumLength || (noTruncation ? noTruncationMaximumTruncationLength * 2 : defaultMaximumTruncationLength * 2); if (maxLength2 && result && result.length >= maxLength2) { return result.substr(0, maxLength2 - "...".length) + "..."; } @@ -54991,14 +55279,14 @@ function createTypeChecker(host) { requiresAddingImplicitUndefined(declaration, symbol, enclosingDeclaration) { var _a; switch (declaration.kind) { - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 348 /* JSDocPropertyTag */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 349 /* JSDocPropertyTag */: symbol ?? (symbol = getSymbolOfDeclaration(declaration)); const type = getTypeOfSymbol(symbol); return !!(symbol.flags & 4 /* Property */ && symbol.flags & 16777216 /* Optional */ && isOptionalDeclaration(declaration) && ((_a = symbol.links) == null ? void 0 : _a.mappedType) && containsNonMissingUndefinedType(type)); - case 169 /* Parameter */: - case 341 /* JSDocParameterTag */: + case 170 /* Parameter */: + case 342 /* JSDocParameterTag */: return requiresAddingImplicitUndefined(declaration, enclosingDeclaration); default: Debug.assertNever(declaration); @@ -55006,7 +55294,6 @@ function createTypeChecker(host) { }, isOptionalParameter, isUndefinedIdentifierExpression(node) { - Debug.assert(isExpressionNode(node)); return getSymbolAtLocation(node) === undefinedSymbol; }, isEntityNameVisible(context, entityName, shouldComputeAliasToMakeVisible) { @@ -55015,10 +55302,11 @@ function createTypeChecker(host) { serializeExistingTypeNode(context, typeNode, addUndefined) { return serializeExistingTypeNode(context, typeNode, !!addUndefined); }, - serializeReturnTypeForSignature(syntacticContext, signatureDeclaration) { + serializeReturnTypeForSignature(syntacticContext, signatureDeclaration, symbol) { const context = syntacticContext; const signature = getSignatureFromDeclaration(signatureDeclaration); - const returnType = context.enclosingSymbolTypes.get(getSymbolId(getSymbolOfDeclaration(signatureDeclaration))) ?? instantiateType(getReturnTypeOfSignature(signature), context.mapper); + symbol ?? (symbol = getSymbolOfDeclaration(signatureDeclaration)); + const returnType = context.enclosingSymbolTypes.get(getSymbolId(symbol)) ?? instantiateType(getReturnTypeOfSignature(signature), context.mapper); return serializeInferredReturnTypeForSignature(context, signature, returnType); }, serializeTypeOfExpression(syntacticContext, expr) { @@ -55032,7 +55320,7 @@ function createTypeChecker(host) { symbol ?? (symbol = getSymbolOfDeclaration(declaration)); let type = (_a = context.enclosingSymbolTypes) == null ? void 0 : _a.get(getSymbolId(symbol)); if (type === void 0) { - type = symbol && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* Signature */)) ? instantiateType(getWidenedLiteralType(getTypeOfSymbol(symbol)), context.mapper) : errorType; + type = symbol.flags & 98304 /* Accessor */ && declaration.kind === 179 /* SetAccessor */ ? instantiateType(getWriteTypeOfSymbol(symbol), context.mapper) : symbol && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* Signature */)) ? instantiateType(getWidenedLiteralType(getTypeOfSymbol(symbol)), context.mapper) : errorType; } const addUndefinedForParameter = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration, context.enclosingDeclaration); if (addUndefinedForParameter) { @@ -55092,6 +55380,7 @@ function createTypeChecker(host) { const context = syntacticContext; if (context.bundled || context.enclosingFile !== getSourceFileOfNode(lit)) { let name = lit.text; + const originalName = name; const nodeSymbol = getNodeLinks(parent2).resolvedSymbol; const meaning = parent2.isTypeOf ? 111551 /* Value */ : 788968 /* Type */; const parentSymbol = nodeSymbol && isSymbolAccessible( @@ -55121,7 +55410,9 @@ function createTypeChecker(host) { context.tracker.reportLikelyUnsafeImportRequiredError(name); } } - return name; + if (name !== originalName) { + return name; + } } }, canReuseTypeNode(context, typeNode) { @@ -55135,7 +55426,7 @@ function createTypeChecker(host) { let type = (_a = context.enclosingSymbolTypes) == null ? void 0 : _a.get(getSymbolId(symbol)); if (type === void 0) { if (symbol.flags & 98304 /* Accessor */) { - type = node.kind === 178 /* SetAccessor */ ? getWriteTypeOfSymbol(symbol) : getTypeOfAccessors(symbol); + type = node.kind === 179 /* SetAccessor */ ? getWriteTypeOfSymbol(symbol) : getTypeOfAccessors(symbol); } else if (isValueSignatureDeclaration(node)) { type = getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } else { @@ -55154,31 +55445,142 @@ function createTypeChecker(host) { }; return { syntacticBuilderResolver, - typeToTypeNode: (type, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => typeToTypeNodeHelper(type, context)), - typePredicateToTypePredicateNode: (typePredicate, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => typePredicateToTypePredicateNodeHelper(typePredicate, context)), - serializeTypeForExpression: (expr, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => syntacticNodeBuilder.serializeTypeOfExpression(expr, context)), - serializeTypeForDeclaration: (declaration, symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => syntacticNodeBuilder.serializeTypeOfDeclaration(declaration, symbol, context)), - serializeReturnTypeForSignature: (signature, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => syntacticNodeBuilder.serializeReturnTypeForSignature(signature, getSymbolOfDeclaration(signature), context)), - indexInfoToIndexSignatureDeclaration: (indexInfo, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => indexInfoToIndexSignatureDeclarationHelper( - indexInfo, - context, - /*typeNode*/ - void 0 - )), - signatureToSignatureDeclaration: (signature, kind, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => signatureToSignatureDeclarationHelper(signature, kind, context)), - symbolToEntityName: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolToName( - symbol, - context, - meaning, - /*expectsIdentifier*/ - false - )), - symbolToExpression: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolToExpression(symbol, context, meaning)), - symbolToTypeParameterDeclarations: (symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => typeParametersToTypeParameterDeclarations(symbol, context)), - symbolToParameterDeclaration: (symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolToParameterDeclaration(symbol, context)), - typeParameterToDeclaration: (parameter, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => typeParameterToDeclaration(parameter, context)), - symbolTableToDeclarationStatements: (symbolTable, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolTableToDeclarationStatements(symbolTable, context)), - symbolToNode: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolToNode(symbol, context, meaning)) + typeToTypeNode: (type, enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, out) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, (context) => typeToTypeNodeHelper(type, context), out), + typePredicateToTypePredicateNode: (typePredicate, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => typePredicateToTypePredicateNodeHelper(typePredicate, context) + ), + serializeTypeForDeclaration: (declaration, symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => syntacticNodeBuilder.serializeTypeOfDeclaration(declaration, symbol, context) + ), + serializeReturnTypeForSignature: (signature, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => syntacticNodeBuilder.serializeReturnTypeForSignature(signature, getSymbolOfDeclaration(signature), context) + ), + serializeTypeForExpression: (expr, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => syntacticNodeBuilder.serializeTypeOfExpression(expr, context) + ), + indexInfoToIndexSignatureDeclaration: (indexInfo, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => indexInfoToIndexSignatureDeclarationHelper( + indexInfo, + context, + /*typeNode*/ + void 0 + ) + ), + signatureToSignatureDeclaration: (signature, kind, enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, out) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, (context) => signatureToSignatureDeclarationHelper(signature, kind, context), out), + symbolToEntityName: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => symbolToName( + symbol, + context, + meaning, + /*expectsIdentifier*/ + false + ) + ), + symbolToExpression: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => symbolToExpression(symbol, context, meaning) + ), + symbolToTypeParameterDeclarations: (symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => typeParametersToTypeParameterDeclarations(symbol, context) + ), + symbolToParameterDeclaration: (symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => symbolToParameterDeclaration(symbol, context) + ), + typeParameterToDeclaration: (parameter, enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, out) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, (context) => typeParameterToDeclaration(parameter, context), out), + symbolTableToDeclarationStatements: (symbolTable, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => symbolTableToDeclarationStatements(symbolTable, context) + ), + symbolToNode: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => symbolToNode(symbol, context, meaning) + ), + symbolToDeclarations }; function getTypeFromTypeNode2(context, node, noMappedTypes) { const type = getTypeFromTypeNodeWithoutContext(node); @@ -55220,14 +55622,87 @@ function createTypeChecker(host) { } return symbolToExpression(symbol, context, meaning); } - function withContext2(enclosingDeclaration, flags, internalFlags, tracker, cb) { + function symbolToDeclarations(symbol, meaning, flags, maximumLength, verbosityLevel, out) { + const nodes = withContext2( + /*enclosingDeclaration*/ + void 0, + flags, + /*internalFlags*/ + void 0, + /*tracker*/ + void 0, + maximumLength, + verbosityLevel, + (context) => symbolToDeclarationsWorker(symbol, context), + out + ); + return mapDefined(nodes, (node) => { + switch (node.kind) { + case 264 /* ClassDeclaration */: + return simplifyClassDeclaration(node, symbol); + case 267 /* EnumDeclaration */: + return simplifyModifiers(node, isEnumDeclaration, symbol); + case 265 /* InterfaceDeclaration */: + return simplifyInterfaceDeclaration(node, symbol, meaning); + case 268 /* ModuleDeclaration */: + return simplifyModifiers(node, isModuleDeclaration, symbol); + default: + return void 0; + } + }); + } + function simplifyClassDeclaration(classDecl, symbol) { + const classDeclarations = filter(symbol.declarations, isClassLike); + const originalClassDecl = classDeclarations && classDeclarations.length > 0 ? classDeclarations[0] : classDecl; + const modifiers = getEffectiveModifierFlags(originalClassDecl) & ~(32 /* Export */ | 128 /* Ambient */); + const isAnonymous = isClassExpression(originalClassDecl); + if (isAnonymous) { + classDecl = factory.updateClassDeclaration( + classDecl, + classDecl.modifiers, + /*name*/ + void 0, + classDecl.typeParameters, + classDecl.heritageClauses, + classDecl.members + ); + } + return factory.replaceModifiers(classDecl, modifiers); + } + function simplifyModifiers(newDecl, isDeclKind, symbol) { + const decls = filter(symbol.declarations, isDeclKind); + const declWithModifiers = decls && decls.length > 0 ? decls[0] : newDecl; + const modifiers = getEffectiveModifierFlags(declWithModifiers) & ~(32 /* Export */ | 128 /* Ambient */); + return factory.replaceModifiers(newDecl, modifiers); + } + function simplifyInterfaceDeclaration(interfaceDecl, symbol, meaning) { + if (!(meaning & 64 /* Interface */)) { + return void 0; + } + return simplifyModifiers(interfaceDecl, isInterfaceDeclaration, symbol); + } + function symbolToDeclarationsWorker(symbol, context) { + const type = getDeclaredTypeOfSymbol(symbol); + context.typeStack.push(type.id); + context.typeStack.push(-1); + const table = createSymbolTable([symbol]); + const statements = symbolTableToDeclarationStatements(table, context); + context.typeStack.pop(); + context.typeStack.pop(); + return statements; + } + function withContext2(enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, cb, out) { const moduleResolverHost = (tracker == null ? void 0 : tracker.trackSymbol) ? tracker.moduleResolverHost : (internalFlags || 0 /* None */) & 4 /* DoNotIncludeSymbolChain */ ? createBasicNodeBuilderModuleSpecifierResolutionHost(host) : void 0; + flags = flags || 0 /* None */; + const maxTruncationLength = maximumLength || (flags & 1 /* NoTruncation */ ? noTruncationMaximumTruncationLength : defaultMaximumTruncationLength); const context = { enclosingDeclaration, enclosingFile: enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration), - flags: flags || 0 /* None */, + flags, internalFlags: internalFlags || 0 /* None */, tracker: void 0, + maxTruncationLength, + maxExpansionDepth: verbosityLevel ?? -1, encounteredError: false, suppressReportInferenceFallback: false, reportedDiagnostic: false, @@ -55249,13 +55724,23 @@ function createTypeChecker(host) { typeParameterNamesByText: void 0, typeParameterNamesByTextNextNameCount: void 0, enclosingSymbolTypes: /* @__PURE__ */ new Map(), - mapper: void 0 + mapper: void 0, + depth: 0, + typeStack: [], + out: { + canIncreaseExpansionDepth: false, + truncated: false + } }; context.tracker = new SymbolTrackerImpl(context, tracker, moduleResolverHost); const resultingNode = cb(context); if (context.truncating && context.flags & 1 /* NoTruncation */) { context.tracker.reportTruncationError(); } + if (out) { + out.canIncreaseExpansionDepth = context.out.canIncreaseExpansionDepth; + out.truncated = context.out.truncated; + } return context.encounteredError ? void 0 : resultingNode; } function addSymbolTypeToContext(context, symbol, type) { @@ -55274,19 +55759,49 @@ function createTypeChecker(host) { function saveRestoreFlags(context) { const flags = context.flags; const internalFlags = context.internalFlags; + const depth = context.depth; return restore; function restore() { context.flags = flags; context.internalFlags = internalFlags; + context.depth = depth; } } + function checkTruncationLengthIfExpanding(context) { + return context.maxExpansionDepth >= 0 && checkTruncationLength(context); + } function checkTruncationLength(context) { if (context.truncating) return context.truncating; - return context.truncating = context.approximateLength > (context.flags & 1 /* NoTruncation */ ? noTruncationMaximumTruncationLength : defaultMaximumTruncationLength); + return context.truncating = context.approximateLength > context.maxTruncationLength; + } + function canPossiblyExpandType(type, context) { + for (let i = 0; i < context.typeStack.length - 1; i++) { + if (context.typeStack[i] === type.id) { + return false; + } + } + return context.depth < context.maxExpansionDepth || context.depth === context.maxExpansionDepth && !context.out.canIncreaseExpansionDepth; + } + function shouldExpandType(type, context, isAlias = false) { + if (!isAlias && isLibType(type)) { + return false; + } + for (let i = 0; i < context.typeStack.length - 1; i++) { + if (context.typeStack[i] === type.id) { + return false; + } + } + const result = context.depth < context.maxExpansionDepth; + if (!result) { + context.out.canIncreaseExpansionDepth = true; + } + return result; } function typeToTypeNodeHelper(type, context) { const restoreFlags = saveRestoreFlags(context); + if (type) context.typeStack.push(type.id); const typeNode = typeToTypeNodeWorker(type, context); + if (type) context.typeStack.pop(); restoreFlags(); return typeNode; } @@ -55297,6 +55812,7 @@ function createTypeChecker(host) { } const inTypeAlias = context.flags & 8388608 /* InTypeAlias */; context.flags &= ~8388608 /* InTypeAlias */; + let expandingEnum = false; if (!type) { if (!(context.flags & 262144 /* AllowEmptyUnionOrIntersection */)) { context.encounteredError = true; @@ -55364,7 +55880,11 @@ function createTypeChecker(host) { return Debug.fail("Unhandled type node kind returned from `symbolToTypeNode`."); } } - return symbolToTypeNode(type.symbol, context, 788968 /* Type */); + if (!shouldExpandType(type, context)) { + return symbolToTypeNode(type.symbol, context, 788968 /* Type */); + } else { + expandingEnum = true; + } } if (type.flags & 128 /* StringLiteral */) { context.approximateLength += type.value.length + 2; @@ -55431,16 +55951,34 @@ function createTypeChecker(host) { return factory.createThisTypeNode(); } if (!inTypeAlias && type.aliasSymbol && (context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */ || isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration))) { - const typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context); - if (isReservedMemberName(type.aliasSymbol.escapedName) && !(type.aliasSymbol.flags & 32 /* Class */)) return factory.createTypeReferenceNode(factory.createIdentifier(""), typeArgumentNodes); - if (length(typeArgumentNodes) === 1 && type.aliasSymbol === globalArrayType.symbol) { - return factory.createArrayTypeNode(typeArgumentNodes[0]); + if (!shouldExpandType( + type, + context, + /*isAlias*/ + true + )) { + const typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context); + if (isReservedMemberName(type.aliasSymbol.escapedName) && !(type.aliasSymbol.flags & 32 /* Class */)) return factory.createTypeReferenceNode(factory.createIdentifier(""), typeArgumentNodes); + if (length(typeArgumentNodes) === 1 && type.aliasSymbol === globalArrayType.symbol) { + return factory.createArrayTypeNode(typeArgumentNodes[0]); + } + return symbolToTypeNode(type.aliasSymbol, context, 788968 /* Type */, typeArgumentNodes); } - return symbolToTypeNode(type.aliasSymbol, context, 788968 /* Type */, typeArgumentNodes); + context.depth += 1; } const objectFlags = getObjectFlags(type); if (objectFlags & 4 /* Reference */) { Debug.assert(!!(type.flags & 524288 /* Object */)); + if (shouldExpandType(type, context)) { + context.depth += 1; + return createAnonymousTypeNode( + type, + /*forceClassExpansion*/ + true, + /*forceExpansion*/ + true + ); + } return type.node ? visitAndTransformType(type, typeReferenceToTypeNode) : typeReferenceToTypeNode(type); } if (type.flags & 262144 /* TypeParameter */ || objectFlags & 3 /* ClassOrInterface */) { @@ -55470,6 +56008,16 @@ function createTypeChecker(host) { void 0 ); } + if (objectFlags & 3 /* ClassOrInterface */ && shouldExpandType(type, context)) { + context.depth += 1; + return createAnonymousTypeNode( + type, + /*forceClassExpansion*/ + true, + /*forceExpansion*/ + true + ); + } if (type.symbol) { return symbolToTypeNode(type.symbol, context, 788968 /* Type */); } @@ -55484,7 +56032,7 @@ function createTypeChecker(host) { type = type.origin; } if (type.flags & (1048576 /* Union */ | 2097152 /* Intersection */)) { - const types = type.flags & 1048576 /* Union */ ? formatUnionTypes(type.types) : type.types; + const types = type.flags & 1048576 /* Union */ ? formatUnionTypes(type.types, expandingEnum) : type.types; if (length(types) === 1) { return typeToTypeNodeHelper(types[0], context); } @@ -55615,12 +56163,19 @@ function createTypeChecker(host) { const questionToken = type2.declaration.questionToken ? factory.createToken(type2.declaration.questionToken.kind) : void 0; let appropriateConstraintTypeNode; let newTypeVariable; + let templateType = getTemplateTypeFromMappedType(type2); + const typeParameter = getTypeParameterFromMappedType(type2); const needsModifierPreservingWrapper = !isMappedTypeWithKeyofConstraintDeclaration(type2) && !(getModifiersTypeFromMappedType(type2).flags & 2 /* Unknown */) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && !(getConstraintTypeFromMappedType(type2).flags & 262144 /* TypeParameter */ && ((_a2 = getConstraintOfTypeParameter(getConstraintTypeFromMappedType(type2))) == null ? void 0 : _a2.flags) & 4194304 /* Index */); if (isMappedTypeWithKeyofConstraintDeclaration(type2)) { if (isHomomorphicMappedTypeWithNonHomomorphicInstantiation(type2) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */) { - const newParam = createTypeParameter(createSymbol(262144 /* TypeParameter */, "T")); - const name = typeParameterToName(newParam, context); + const newConstraintParam = createTypeParameter(createSymbol(262144 /* TypeParameter */, "T")); + const name = typeParameterToName(newConstraintParam, context); + const target = type2.target; newTypeVariable = factory.createTypeReferenceNode(name); + templateType = instantiateType( + getTemplateTypeFromMappedType(target), + makeArrayTypeMapper([getTypeParameterFromMappedType(target), getModifiersTypeFromMappedType(target)], [typeParameter, newConstraintParam]) + ); } appropriateConstraintTypeNode = factory.createTypeOperatorNode(143 /* KeyOfKeyword */, newTypeVariable || typeToTypeNodeHelper(getModifiersTypeFromMappedType(type2), context)); } else if (needsModifierPreservingWrapper) { @@ -55631,9 +56186,17 @@ function createTypeChecker(host) { } else { appropriateConstraintTypeNode = typeToTypeNodeHelper(getConstraintTypeFromMappedType(type2), context); } - const typeParameterNode = typeParameterToDeclarationWithConstraint(getTypeParameterFromMappedType(type2), context, appropriateConstraintTypeNode); + const typeParameterNode = typeParameterToDeclarationWithConstraint(typeParameter, context, appropriateConstraintTypeNode); + const cleanup = enterNewScope( + context, + type2.declaration, + /*expandedParams*/ + void 0, + [getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(type2.declaration.typeParameter))] + ); const nameTypeNode = type2.declaration.nameType ? typeToTypeNodeHelper(getNameTypeFromMappedType(type2), context) : void 0; - const templateTypeNode = typeToTypeNodeHelper(removeMissingType(getTemplateTypeFromMappedType(type2), !!(getMappedTypeModifiers(type2) & 4 /* IncludeOptional */)), context); + const templateTypeNode = typeToTypeNodeHelper(removeMissingType(templateType, !!(getMappedTypeModifiers(type2) & 4 /* IncludeOptional */)), context); + cleanup(); const mappedTypeNode = factory.createMappedTypeNode( readonlyToken, typeParameterNode, @@ -55673,7 +56236,7 @@ function createTypeChecker(host) { } return result; } - function createAnonymousTypeNode(type2) { + function createAnonymousTypeNode(type2, forceClassExpansion = false, forceExpansion = false) { var _a2, _b2; const typeId = type2.id; const symbol = type2.symbol; @@ -55696,15 +56259,20 @@ function createTypeChecker(host) { const isInstanceType = isClassInstanceSide(type2) ? 788968 /* Type */ : 111551 /* Value */; if (isJSConstructor(symbol.valueDeclaration)) { return symbolToTypeNode(symbol, context, isInstanceType); - } else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration && isClassLike(symbol.valueDeclaration) && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ && (!isClassDeclaration(symbol.valueDeclaration) || isSymbolAccessible( + } else if (!forceExpansion && (symbol.flags & 32 /* Class */ && !forceClassExpansion && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration && isClassLike(symbol.valueDeclaration) && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ && (!isClassDeclaration(symbol.valueDeclaration) || isSymbolAccessible( symbol, context.enclosingDeclaration, isInstanceType, /*shouldComputeAliasesToMakeVisible*/ false - ).accessibility !== 0 /* Accessible */)) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { - return symbolToTypeNode(symbol, context, isInstanceType); - } else if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) { + ).accessibility !== 0 /* Accessible */)) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol())) { + if (shouldExpandType(type2, context)) { + context.depth += 1; + } else { + return symbolToTypeNode(symbol, context, isInstanceType); + } + } + if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) { const typeAlias = getTypeAliasForTypeLiteral(type2); if (typeAlias) { return symbolToTypeNode(typeAlias, context, 788968 /* Type */); @@ -55722,7 +56290,7 @@ function createTypeChecker(host) { const isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method some(symbol.declarations, (declaration) => isStatic(declaration) && !isLateBindableIndexSignature(getNameOfDeclaration(declaration))); const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol - forEach(symbol.declarations, (declaration) => declaration.parent.kind === 307 /* SourceFile */ || declaration.parent.kind === 268 /* ModuleBlock */)); + forEach(symbol.declarations, (declaration) => declaration.parent.kind === 308 /* SourceFile */ || declaration.parent.kind === 269 /* ModuleBlock */)); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((_a3 = context.visitedTypes) == null ? void 0 : _a3.has(typeId))) && // it is type of the symbol uses itself recursively (!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration)); @@ -55740,7 +56308,7 @@ function createTypeChecker(host) { if (id && !context.symbolDepth) { context.symbolDepth = /* @__PURE__ */ new Map(); } - const links = context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration); + const links = context.maxExpansionDepth >= 0 ? void 0 : context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration); const key = `${getTypeId(type2)}|${context.flags}|${context.internalFlags}`; if (links) { links.serializedTypes || (links.serializedTypes = /* @__PURE__ */ new Map()); @@ -55827,18 +56395,18 @@ function createTypeChecker(host) { } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { const signature = resolved.callSignatures[0]; - const signatureNode = signatureToSignatureDeclarationHelper(signature, 184 /* FunctionType */, context); + const signatureNode = signatureToSignatureDeclarationHelper(signature, 185 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { const signature = resolved.constructSignatures[0]; - const signatureNode = signatureToSignatureDeclarationHelper(signature, 185 /* ConstructorType */, context); + const signatureNode = signatureToSignatureDeclarationHelper(signature, 186 /* ConstructorType */, context); return signatureNode; } } const abstractSignatures = filter(resolved.constructSignatures, (signature) => !!(signature.flags & 4 /* Abstract */)); if (some(abstractSignatures)) { - const types = map(abstractSignatures, (s) => getOrCreateTypeFromSignature(s)); + const types = map(abstractSignatures, getOrCreateTypeFromSignature); const typeElementCount = resolved.callSignatures.length + (resolved.constructSignatures.length - abstractSignatures.length) + resolved.indexInfos.length + // exclude `prototype` when writing a class expression as a type literal, as per // the logic in `createTypeNodesFromResolvedType`. (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ ? countWhere(resolved.properties, (p) => !(p.flags & 4194304 /* Prototype */)) : length(resolved.properties)); @@ -56057,6 +56625,7 @@ function createTypeChecker(host) { } function createTypeNodesFromResolvedType(resolvedType) { if (checkTruncationLength(context)) { + context.out.truncated = true; if (context.flags & 1 /* NoTruncation */) { return [addSyntheticTrailingComment(factory.createNotEmittedTypeElement(), 3 /* MultiLineCommentTrivia */, "elided")]; } @@ -56070,23 +56639,28 @@ function createTypeChecker(host) { void 0 )]; } + context.typeStack.push(-1); const typeElements = []; for (const signature of resolvedType.callSignatures) { - typeElements.push(signatureToSignatureDeclarationHelper(signature, 179 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* CallSignature */, context)); } for (const signature of resolvedType.constructSignatures) { if (signature.flags & 4 /* Abstract */) continue; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 181 /* ConstructSignature */, context)); } for (const info of resolvedType.indexInfos) { typeElements.push(...indexInfoToObjectComputedNamesOrSignatureDeclaration(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0)); } const properties = resolvedType.properties; if (!properties) { + context.typeStack.pop(); return typeElements; } let i = 0; for (const propertySymbol of properties) { + if (isExpanding(context) && propertySymbol.flags & 4194304 /* Prototype */) { + continue; + } i++; if (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) { if (propertySymbol.flags & 4194304 /* Prototype */) { @@ -56097,6 +56671,7 @@ function createTypeChecker(host) { } } if (checkTruncationLength(context) && i + 2 < properties.length - 1) { + context.out.truncated = true; if (context.flags & 1 /* NoTruncation */) { const typeElement = typeElements.pop(); typeElements.push(addSyntheticTrailingComment(typeElement, 3 /* MultiLineCommentTrivia */, `... ${properties.length - i} more elided ...`)); @@ -56116,6 +56691,7 @@ function createTypeChecker(host) { } addPropertyToElementList(propertySymbol, context, typeElements); } + context.typeStack.pop(); return typeElements.length ? typeElements : void 0; } } @@ -56177,33 +56753,84 @@ function createTypeChecker(host) { context.approximateLength += symbolName(propertySymbol).length + 1; if (propertySymbol.flags & 98304 /* Accessor */) { const writeType = getWriteTypeOfSymbol(propertySymbol); - if (propertyType !== writeType && !isErrorType(propertyType) && !isErrorType(writeType)) { - const getterDeclaration = getDeclarationOfKind(propertySymbol, 177 /* GetAccessor */); - const getterSignature = getSignatureFromDeclaration(getterDeclaration); - typeElements.push( - setCommentRange2( - context, - signatureToSignatureDeclarationHelper(getterSignature, 177 /* GetAccessor */, context, { name: propertyName }), - getterDeclaration - ) - ); - const setterDeclaration = getDeclarationOfKind(propertySymbol, 178 /* SetAccessor */); - const setterSignature = getSignatureFromDeclaration(setterDeclaration); - typeElements.push( - setCommentRange2( - context, - signatureToSignatureDeclarationHelper(setterSignature, 178 /* SetAccessor */, context, { name: propertyName }), - setterDeclaration - ) - ); - return; + if (!isErrorType(propertyType) && !isErrorType(writeType)) { + const symbolMapper = getSymbolLinks(propertySymbol).mapper; + const propDeclaration = getDeclarationOfKind(propertySymbol, 173 /* PropertyDeclaration */); + if (propertyType !== writeType || propertySymbol.parent.flags & 32 /* Class */ && !propDeclaration) { + const getterDeclaration = getDeclarationOfKind(propertySymbol, 178 /* GetAccessor */); + if (getterDeclaration) { + const getterSignature = getSignatureFromDeclaration(getterDeclaration); + typeElements.push( + setCommentRange2( + context, + signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(getterSignature, symbolMapper) : getterSignature, 178 /* GetAccessor */, context, { name: propertyName }), + getterDeclaration + ) + ); + } + const setterDeclaration = getDeclarationOfKind(propertySymbol, 179 /* SetAccessor */); + if (setterDeclaration) { + const setterSignature = getSignatureFromDeclaration(setterDeclaration); + typeElements.push( + setCommentRange2( + context, + signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(setterSignature, symbolMapper) : setterSignature, 179 /* SetAccessor */, context, { name: propertyName }), + setterDeclaration + ) + ); + } + return; + } + if (propertySymbol.parent.flags & 32 /* Class */ && propDeclaration && find(propDeclaration.modifiers, isAccessorModifier)) { + const fakeGetterSignature = createSignature( + /*declaration*/ + void 0, + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + emptyArray, + propertyType, + /*resolvedTypePredicate*/ + void 0, + 0, + 0 /* None */ + ); + typeElements.push( + setCommentRange2( + context, + signatureToSignatureDeclarationHelper(fakeGetterSignature, 178 /* GetAccessor */, context, { name: propertyName }), + propDeclaration + ) + ); + const setterParam = createSymbol(1 /* FunctionScopedVariable */, "arg"); + setterParam.links.type = writeType; + const fakeSetterSignature = createSignature( + /*declaration*/ + void 0, + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [setterParam], + voidType, + /*resolvedTypePredicate*/ + void 0, + 0, + 0 /* None */ + ); + typeElements.push( + signatureToSignatureDeclarationHelper(fakeSetterSignature, 179 /* SetAccessor */, context, { name: propertyName }) + ); + return; + } } } const optionalToken = propertySymbol.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0; if (propertySymbol.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(propertyType).length && !isReadonlySymbol(propertySymbol)) { const signatures = getSignaturesOfType(filterType(propertyType, (t) => !(t.flags & 32768 /* Undefined */)), 0 /* Call */); for (const signature of signatures) { - const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 173 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken }); + const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 174 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken }); typeElements.push(preserveCommentsOn(methodDeclaration, signature.declaration || propertySymbol.valueDeclaration)); } if (signatures.length || !optionalToken) { @@ -56242,7 +56869,7 @@ function createTypeChecker(host) { typeElements.push(preserveCommentsOn(propertySignature, propertySymbol.valueDeclaration)); function preserveCommentsOn(node, range) { var _a2; - const jsdocPropertyTag = (_a2 = propertySymbol.declarations) == null ? void 0 : _a2.find((d) => d.kind === 348 /* JSDocPropertyTag */); + const jsdocPropertyTag = (_a2 = propertySymbol.declarations) == null ? void 0 : _a2.find((d) => d.kind === 349 /* JSDocPropertyTag */); if (jsdocPropertyTag) { const commentText = getTextOfJSDocComment(jsdocPropertyTag.comment); if (commentText) { @@ -56263,6 +56890,7 @@ function createTypeChecker(host) { function mapToTypeNodes(types, context, isBareList) { if (some(types)) { if (checkTruncationLength(context)) { + context.out.truncated = true; if (!isBareList) { return [ context.flags & 1 /* NoTruncation */ ? addSyntheticLeadingComment(factory.createKeywordTypeNode(133 /* AnyKeyword */), 3 /* MultiLineCommentTrivia */, "elided") : factory.createTypeReferenceNode( @@ -56290,6 +56918,7 @@ function createTypeChecker(host) { for (const type of types) { i++; if (checkTruncationLength(context) && i + 2 < types.length - 1) { + context.out.truncated = true; result.push( context.flags & 1 /* NoTruncation */ ? addSyntheticLeadingComment(factory.createKeywordTypeNode(133 /* AnyKeyword */), 3 /* MultiLineCommentTrivia */, `... ${types.length - i} more elided ...`) : factory.createTypeReferenceNode( `... ${types.length - i} more ...`, @@ -56376,7 +57005,7 @@ function createTypeChecker(host) { } const restoreFlags = saveRestoreFlags(context); context.flags &= ~256 /* SuppressAnyReturnType */; - const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 176 /* Constructor */)); + const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 177 /* Constructor */)); const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context); if (thisParameter) { parameters.unshift(thisParameter); @@ -56384,11 +57013,11 @@ function createTypeChecker(host) { restoreFlags(); const returnTypeNode = serializeReturnTypeForSignature(context, signature); let modifiers = options == null ? void 0 : options.modifiers; - if (kind === 185 /* ConstructorType */ && signature.flags & 4 /* Abstract */) { + if (kind === 186 /* ConstructorType */ && signature.flags & 4 /* Abstract */) { const flags = modifiersToFlags(modifiers); modifiers = factory.createModifiersFromModifierFlags(flags | 64 /* Abstract */); } - const node = kind === 179 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 180 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 173 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 174 /* MethodDeclaration */ ? factory.createMethodDeclaration( + const node = kind === 180 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 181 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 174 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodDeclaration */ ? factory.createMethodDeclaration( modifiers, /*asteriskToken*/ void 0, @@ -56400,25 +57029,25 @@ function createTypeChecker(host) { returnTypeNode, /*body*/ void 0 - ) : kind === 176 /* Constructor */ ? factory.createConstructorDeclaration( + ) : kind === 177 /* Constructor */ ? factory.createConstructorDeclaration( modifiers, parameters, /*body*/ void 0 - ) : kind === 177 /* GetAccessor */ ? factory.createGetAccessorDeclaration( + ) : kind === 178 /* GetAccessor */ ? factory.createGetAccessorDeclaration( modifiers, (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ void 0 - ) : kind === 178 /* SetAccessor */ ? factory.createSetAccessorDeclaration( + ) : kind === 179 /* SetAccessor */ ? factory.createSetAccessorDeclaration( modifiers, (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), parameters, /*body*/ void 0 - ) : kind === 181 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 317 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 184 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode ?? factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 185 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode ?? factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 262 /* FunctionDeclaration */ ? factory.createFunctionDeclaration( + ) : kind === 182 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 318 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 185 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode ?? factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 186 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode ?? factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 263 /* FunctionDeclaration */ ? factory.createFunctionDeclaration( modifiers, /*asteriskToken*/ void 0, @@ -56428,7 +57057,7 @@ function createTypeChecker(host) { returnTypeNode, /*body*/ void 0 - ) : kind === 218 /* FunctionExpression */ ? factory.createFunctionExpression( + ) : kind === 219 /* FunctionExpression */ ? factory.createFunctionExpression( modifiers, /*asteriskToken*/ void 0, @@ -56437,7 +57066,7 @@ function createTypeChecker(host) { parameters, returnTypeNode, factory.createBlock([]) - ) : kind === 219 /* ArrowFunction */ ? factory.createArrowFunction( + ) : kind === 220 /* ArrowFunction */ ? factory.createArrowFunction( modifiers, typeParameters, parameters, @@ -56449,7 +57078,7 @@ function createTypeChecker(host) { if (typeArguments) { node.typeArguments = factory.createNodeArray(typeArguments); } - if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 323 /* JSDocSignature */ && signature.declaration.parent.kind === 339 /* JSDocOverloadTag */) { + if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 324 /* JSDocSignature */ && signature.declaration.parent.kind === 340 /* JSDocOverloadTag */) { const comment = getTextOfNode( signature.declaration.parent.parent, /*includeTrivia*/ @@ -56614,9 +57243,9 @@ function createTypeChecker(host) { function bindPattern(p) { forEach(p.elements, (e) => { switch (e.kind) { - case 232 /* OmittedExpression */: + case 233 /* OmittedExpression */: return; - case 208 /* BindingElement */: + case 209 /* BindingElement */: return bindElement(e); default: return Debug.assertNever(e); @@ -56687,7 +57316,7 @@ function createTypeChecker(host) { return factory.createTypeParameterDeclaration(modifiers, name, constraintNode, defaultParameterNode); } function typeToTypeNodeHelperWithPossibleReusableTypeNode(type, typeNode, context) { - return typeNode && getTypeFromTypeNode2(context, typeNode) === type && syntacticNodeBuilder.tryReuseExistingTypeNode(context, typeNode) || typeToTypeNodeHelper(type, context); + return !canPossiblyExpandType(type, context) && typeNode && getTypeFromTypeNode2(context, typeNode) === type && syntacticNodeBuilder.tryReuseExistingTypeNode(context, typeNode) || typeToTypeNodeHelper(type, context); } function typeParameterToDeclaration(type, context, constraint = getConstraintOfTypeParameter(type)) { const constraintNode = constraint && typeToTypeNodeHelperWithPossibleReusableTypeNode(constraint, getConstraintDeclaration(type), context); @@ -56700,12 +57329,12 @@ function createTypeChecker(host) { return factory.createTypePredicateNode(assertsModifier, parameterName, typeNode); } function getEffectiveParameterDeclaration(parameterSymbol) { - const parameterDeclaration = getDeclarationOfKind(parameterSymbol, 169 /* Parameter */); + const parameterDeclaration = getDeclarationOfKind(parameterSymbol, 170 /* Parameter */); if (parameterDeclaration) { return parameterDeclaration; } if (!isTransientSymbol(parameterSymbol)) { - return getDeclarationOfKind(parameterSymbol, 341 /* JSDocParameterTag */); + return getDeclarationOfKind(parameterSymbol, 342 /* JSDocParameterTag */); } } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags) { @@ -56731,7 +57360,7 @@ function createTypeChecker(host) { return parameterNode; } function parameterToParameterDeclarationName(parameterSymbol, parameterDeclaration, context) { - return parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 80 /* Identifier */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : parameterDeclaration.name.kind === 166 /* QualifiedName */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : symbolName(parameterSymbol) : symbolName(parameterSymbol); + return parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 80 /* Identifier */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : parameterDeclaration.name.kind === 167 /* QualifiedName */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : symbolName(parameterSymbol) : symbolName(parameterSymbol); function cloneBindingName(node) { return elideInitializerAndSetEmitFlags(node); function elideInitializerAndSetEmitFlags(node2) { @@ -56915,11 +57544,11 @@ function createTypeChecker(host) { return top; } function getSpecifierForModuleSymbol(symbol, context, overrideImportMode) { - let file = getDeclarationOfKind(symbol, 307 /* SourceFile */); + let file = getDeclarationOfKind(symbol, 308 /* SourceFile */); if (!file) { const equivalentFileSymbol = firstDefined(symbol.declarations, (d) => getFileSymbolIfFileSymbolExportEqualsContainer(d, symbol)); if (equivalentFileSymbol) { - file = getDeclarationOfKind(equivalentFileSymbol, 307 /* SourceFile */); + file = getDeclarationOfKind(equivalentFileSymbol, 308 /* SourceFile */); } } if (file && file.moduleName !== void 0) { @@ -57206,12 +57835,15 @@ function createTypeChecker(host) { } let firstChar = symbolName2.charCodeAt(0); if (isSingleOrDoubleQuote(firstChar) && some(symbol2.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) { - return factory.createStringLiteral(getSpecifierForModuleSymbol(symbol2, context)); + const specifier = getSpecifierForModuleSymbol(symbol2, context); + context.approximateLength += 2 + specifier.length; + return factory.createStringLiteral(specifier); } if (index === 0 || canUsePropertyAccess(symbolName2, languageVersion)) { const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 16777216 /* NoAsciiEscaping */); if (typeParameterNodes) setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); identifier.symbol = symbol2; + context.approximateLength += 1 + symbolName2.length; return index > 0 ? factory.createPropertyAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), identifier) : identifier; } else { if (firstChar === 91 /* openBracket */) { @@ -57220,16 +57852,21 @@ function createTypeChecker(host) { } let expression; if (isSingleOrDoubleQuote(firstChar) && !(symbol2.flags & 8 /* EnumMember */)) { - expression = factory.createStringLiteral(stripQuotes(symbolName2).replace(/\\./g, (s) => s.substring(1)), firstChar === 39 /* singleQuote */); + const literalText = stripQuotes(symbolName2).replace(/\\./g, (s) => s.substring(1)); + context.approximateLength += literalText.length + 2; + expression = factory.createStringLiteral(literalText, firstChar === 39 /* singleQuote */); } else if ("" + +symbolName2 === symbolName2) { + context.approximateLength += symbolName2.length; expression = factory.createNumericLiteral(+symbolName2); } if (!expression) { const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 16777216 /* NoAsciiEscaping */); if (typeParameterNodes) setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); identifier.symbol = symbol2; + context.approximateLength += symbolName2.length; expression = identifier; } + context.approximateLength += 2; return factory.createElementAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), expression); } } @@ -57258,6 +57895,10 @@ function createTypeChecker(host) { ), "'"))); } function getPropertyNameNodeForSymbol(symbol, context) { + const hashPrivateName = getClonedHashPrivateName(symbol); + if (hashPrivateName) { + return hashPrivateName; + } const stringNamed = !!length(symbol.declarations) && every(symbol.declarations, isStringNamed); const singleQuote = !!length(symbol.declarations) && every(symbol.declarations, isSingleQuotedStringNamed); const isMethod = !!(symbol.flags & 8192 /* Method */); @@ -57334,14 +57975,14 @@ function createTypeChecker(host) { let result; const addUndefinedForParameter = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration, context.enclosingDeclaration); const decl = declaration ?? symbol.valueDeclaration ?? getDeclarationWithTypeAnnotation(symbol) ?? ((_a = symbol.declarations) == null ? void 0 : _a[0]); - if (decl) { + if (!canPossiblyExpandType(type, context) && decl) { + const restore = addSymbolTypeToContext(context, symbol, type); if (isAccessor(decl)) { result = syntacticNodeBuilder.serializeTypeOfAccessor(decl, symbol, context); } else if (hasInferredType(decl) && !nodeIsSynthesized(decl) && !(getObjectFlags(type) & 196608 /* RequiresWidening */)) { - const restore = addSymbolTypeToContext(context, symbol, type); result = syntacticNodeBuilder.serializeTypeOfDeclaration(decl, symbol, context); - restore(); } + restore(); } if (!result) { if (addUndefinedForParameter) { @@ -57373,7 +58014,7 @@ function createTypeChecker(host) { let returnTypeNode; const returnType = getReturnTypeOfSignature(signature); if (!(suppressAny && isTypeAny(returnType))) { - if (signature.declaration && !nodeIsSynthesized(signature.declaration)) { + if (signature.declaration && !nodeIsSynthesized(signature.declaration) && !canPossiblyExpandType(returnType, context)) { const declarationSymbol = getSymbolOfDeclaration(signature.declaration); const restore = addSymbolTypeToContext(context, declarationSymbol, returnType); returnTypeNode = syntacticNodeBuilder.serializeReturnTypeForSignature(signature.declaration, declarationSymbol, context); @@ -57495,10 +58136,7 @@ function createTypeChecker(host) { /*context*/ void 0 ); - if (updated !== node2) { - setTextRange2(context, updated, node2); - } - return updated; + return setTextRange2(context, updated, node2); } } function serializeTypeName(context, node, isTypeOf, typeArguments) { @@ -57571,13 +58209,13 @@ function createTypeChecker(host) { var _a; const serializePropertySymbolForClass = makeSerializePropertySymbol( factory.createPropertyDeclaration, - 174 /* MethodDeclaration */, + 175 /* MethodDeclaration */, /*useAccessors*/ true ); const serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol( (mods, name, question, type) => factory.createPropertySignature(mods, name, question, type), - 173 /* MethodSignature */, + 174 /* MethodSignature */, /*useAccessors*/ false ); @@ -57787,14 +58425,28 @@ function createTypeChecker(host) { if (!suppressNewPrivateContext) { deferredPrivatesStack.push(/* @__PURE__ */ new Map()); } - symbolTable2.forEach((symbol) => { + let i = 0; + const symbols = Array.from(symbolTable2.values()); + for (const symbol of symbols) { + i++; + if (checkTruncationLengthIfExpanding(context) && i + 2 < symbolTable2.size - 1) { + context.out.truncated = true; + results.push(createTruncationStatement(`... (${symbolTable2.size - i} more ...)`)); + serializeSymbol( + symbols[symbols.length - 1], + /*isPrivate*/ + false, + !!propertyAsAlias + ); + break; + } serializeSymbol( symbol, /*isPrivate*/ false, !!propertyAsAlias ); - }); + } if (!suppressNewPrivateContext) { deferredPrivatesStack[deferredPrivatesStack.length - 1].forEach((symbol) => { serializeSymbol( @@ -57824,7 +58476,7 @@ function createTypeChecker(host) { } } function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias, escapedSymbolName = symbol.escapedName) { - var _a2, _b, _c, _d, _e, _f; + var _a2, _b, _c, _d, _e, _f, _g; const symbolName2 = unescapeLeadingUnderscores(escapedSymbolName); const isDefault = escapedSymbolName === "default" /* Default */; if (isPrivate && !(context.flags & 131072 /* AllowAnonymousIdentifier */) && isStringANonContextualKeyword(symbolName2) && !isDefault) { @@ -57874,6 +58526,7 @@ function createTypeChecker(host) { const propertyAccessRequire = (_e = symbol.declarations) == null ? void 0 : _e.find(isPropertyAccessExpression); if (propertyAccessRequire && isBinaryExpression(propertyAccessRequire.parent) && isIdentifier(propertyAccessRequire.parent.right) && ((_f = type.symbol) == null ? void 0 : _f.valueDeclaration) && isSourceFile(type.symbol.valueDeclaration)) { const alias = localName === propertyAccessRequire.parent.right.escapedText ? void 0 : propertyAccessRequire.parent.right; + context.approximateLength += 12 + (((_g = alias == null ? void 0 : alias.escapedText) == null ? void 0 : _g.length) ?? 0); addResult( factory.createExportDeclaration( /*modifiers*/ @@ -57913,8 +58566,10 @@ function createTypeChecker(host) { ), textRange ); + context.approximateLength += 7 + name.length; addResult(statement, name !== localName ? modifierFlags & ~32 /* Export */ : modifierFlags); if (name !== localName && !isPrivate) { + context.approximateLength += 16 + name.length + localName.length; addResult( factory.createExportDeclaration( /*modifiers*/ @@ -57964,27 +58619,33 @@ function createTypeChecker(host) { for (const node of symbol.declarations) { const resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); if (!resolvedModule) continue; + const isTypeOnly = node.isTypeOnly; + const specifier = getSpecifierForModuleSymbol(resolvedModule, context); + context.approximateLength += 17 + specifier.length; addResult(factory.createExportDeclaration( /*modifiers*/ void 0, - /*isTypeOnly*/ - node.isTypeOnly, + isTypeOnly, /*exportClause*/ void 0, - factory.createStringLiteral(getSpecifierForModuleSymbol(resolvedModule, context)) + factory.createStringLiteral(specifier) ), 0 /* None */); } } } if (needsPostExportDefault) { + const internalSymbolName = getInternalSymbolName(symbol, symbolName2); + context.approximateLength += 16 + internalSymbolName.length; addResult(factory.createExportAssignment( /*modifiers*/ void 0, /*isExportEquals*/ false, - factory.createIdentifier(getInternalSymbolName(symbol, symbolName2)) + factory.createIdentifier(internalSymbolName) ), 0 /* None */); } else if (needsExportDeclaration) { + const internalSymbolName = getInternalSymbolName(symbol, symbolName2); + context.approximateLength += 22 + symbolName2.length + internalSymbolName.length; addResult( factory.createExportDeclaration( /*modifiers*/ @@ -57994,7 +58655,7 @@ function createTypeChecker(host) { factory.createNamedExports([factory.createExportSpecifier( /*isTypeOnly*/ false, - getInternalSymbolName(symbol, symbolName2), + internalSymbolName, symbolName2 )]) ), @@ -58014,6 +58675,7 @@ function createTypeChecker(host) { } function addResult(node, additionalModifierFlags) { if (canHaveModifiers(node)) { + const oldModifierFlags = getEffectiveModifierFlags(node); let newModifierFlags = 0 /* None */; const enclosingDeclaration2 = context.enclosingDeclaration && (isJSDocTypeAlias(context.enclosingDeclaration) ? getSourceFileOfNode(context.enclosingDeclaration) : context.enclosingDeclaration); if (additionalModifierFlags & 32 /* Export */ && enclosingDeclaration2 && (isExportingScope(enclosingDeclaration2) || isModuleDeclaration(enclosingDeclaration2)) && canHaveExportModifier(node)) { @@ -58026,8 +58688,9 @@ function createTypeChecker(host) { newModifierFlags |= 2048 /* Default */; } if (newModifierFlags) { - node = factory.replaceModifiers(node, newModifierFlags | getEffectiveModifierFlags(node)); + node = factory.replaceModifiers(node, newModifierFlags | oldModifierFlags); } + context.approximateLength += modifiersLength(newModifierFlags | oldModifierFlags); } results.push(node); } @@ -58043,12 +58706,14 @@ function createTypeChecker(host) { const oldEnclosingDecl = context.enclosingDeclaration; context.enclosingDeclaration = jsdocAliasDecl; const typeNode = jsdocAliasDecl && jsdocAliasDecl.typeExpression && isJSDocTypeExpression(jsdocAliasDecl.typeExpression) && syntacticNodeBuilder.tryReuseExistingTypeNode(context, jsdocAliasDecl.typeExpression.type) || typeToTypeNodeHelper(aliasType, context); + const internalSymbolName = getInternalSymbolName(symbol, symbolName2); + context.approximateLength += 8 + ((commentText == null ? void 0 : commentText.length) ?? 0) + internalSymbolName.length; addResult( setSyntheticLeadingComments( factory.createTypeAliasDeclaration( /*modifiers*/ void 0, - getInternalSymbolName(symbol, symbolName2), + internalSymbolName, typeParamDecls, typeNode ), @@ -58060,21 +58725,28 @@ function createTypeChecker(host) { context.enclosingDeclaration = oldEnclosingDecl; } function serializeInterface(symbol, symbolName2, modifierFlags) { + const internalSymbolName = getInternalSymbolName(symbol, symbolName2); + context.approximateLength += 14 + internalSymbolName.length; const interfaceType = getDeclaredTypeOfClassOrInterface(symbol); const localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); const typeParamDecls = map(localParams, (p) => typeParameterToDeclaration(p, context)); const baseTypes = getBaseTypes(interfaceType); const baseType = length(baseTypes) ? getIntersectionType(baseTypes) : void 0; - const members = flatMap(getPropertiesOfType(interfaceType), (p) => serializePropertySymbolForInterface(p, baseType)); - const callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 179 /* CallSignature */); - const constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 180 /* ConstructSignature */); + const members = serializePropertySymbolsForClassOrInterface( + getPropertiesOfType(interfaceType), + /*isClass*/ + false, + baseType + ); + const callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 180 /* CallSignature */); + const constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 181 /* ConstructSignature */); const indexSignatures = serializeIndexSignatures(interfaceType, baseType); const heritageClauses = !length(baseTypes) ? void 0 : [factory.createHeritageClause(96 /* ExtendsKeyword */, mapDefined(baseTypes, (b) => trySerializeAsTypeReference(b, 111551 /* Value */)))]; addResult( factory.createInterfaceDeclaration( /*modifiers*/ void 0, - getInternalSymbolName(symbol, symbolName2), + internalSymbolName, typeParamDecls, heritageClauses, [...indexSignatures, ...constructSignatures, ...callSignatures, ...members] @@ -58082,6 +58754,57 @@ function createTypeChecker(host) { modifierFlags ); } + function serializePropertySymbolsForClassOrInterface(props, isClass, baseType, isStatic2) { + const elements = []; + let i = 0; + for (const prop of props) { + i++; + if (checkTruncationLengthIfExpanding(context) && i + 2 < props.length - 1) { + context.out.truncated = true; + const placeholder = createTruncationProperty(`... ${props.length - i} more ... `, isClass); + elements.push(placeholder); + const result2 = isClass ? serializePropertySymbolForClass(props[props.length - 1], isStatic2, baseType) : serializePropertySymbolForInterface(props[props.length - 1], baseType); + if (isArray(result2)) { + elements.push(...result2); + } else { + elements.push(result2); + } + break; + } + context.approximateLength += 1; + const result = isClass ? serializePropertySymbolForClass(prop, isStatic2, baseType) : serializePropertySymbolForInterface(prop, baseType); + if (isArray(result)) { + elements.push(...result); + } else { + elements.push(result); + } + } + return elements; + } + function createTruncationProperty(dotDotDotText, isClass) { + if (context.flags & 1 /* NoTruncation */) { + return addSyntheticLeadingComment(factory.createNotEmittedTypeElement(), 3 /* MultiLineCommentTrivia */, dotDotDotText); + } + return isClass ? factory.createPropertyDeclaration( + /*modifiers*/ + void 0, + dotDotDotText, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ) : factory.createPropertySignature( + /*modifiers*/ + void 0, + dotDotDotText, + /*questionToken*/ + void 0, + /*type*/ + void 0 + ); + } function getNamespaceMembersForSerialization(symbol) { let exports2 = arrayFrom(getExportsOfSymbol(symbol).values()); const merged = getMergedSymbol(symbol); @@ -58101,11 +58824,27 @@ function createTypeChecker(host) { } function serializeModule(symbol, symbolName2, modifierFlags) { const members = getNamespaceMembersForSerialization(symbol); - const locationMap = arrayToMultiMap(members, (m) => m.parent && m.parent === symbol ? "real" : "merged"); + const expanding = isExpanding(context); + const locationMap = arrayToMultiMap(members, (m) => m.parent && m.parent === symbol || expanding ? "real" : "merged"); const realMembers = locationMap.get("real") || emptyArray; const mergedMembers = locationMap.get("merged") || emptyArray; - if (length(realMembers)) { - const localName = getInternalSymbolName(symbol, symbolName2); + if (length(realMembers) || expanding) { + let localName; + if (expanding) { + const oldFlags = context.flags; + context.flags |= 512 /* WriteTypeParametersInQualifiedName */ | 2 /* UseOnlyExternalAliasing */; + localName = symbolToNode( + symbol, + context, + /*meaning*/ + -1 /* All */ + ); + context.flags = oldFlags; + } else { + const localText = getInternalSymbolName(symbol, symbolName2); + localName = factory.createIdentifier(localText); + context.approximateLength += localText.length; + } serializeAsNamespaceDeclaration(realMembers, localName, modifierFlags, !!(symbol.flags & (16 /* Function */ | 67108864 /* Assignment */))); } if (length(mergedMembers)) { @@ -58153,17 +58892,51 @@ function createTypeChecker(host) { } } function serializeEnum(symbol, symbolName2, modifierFlags) { + const internalSymbolName = getInternalSymbolName(symbol, symbolName2); + context.approximateLength += 9 + internalSymbolName.length; + const members = []; + const memberProps = filter(getPropertiesOfType(getTypeOfSymbol(symbol)), (p) => !!(p.flags & 8 /* EnumMember */)); + let i = 0; + for (const p of memberProps) { + i++; + if (checkTruncationLengthIfExpanding(context) && i + 2 < memberProps.length - 1) { + context.out.truncated = true; + members.push(factory.createEnumMember(` ... ${memberProps.length - i} more ... `)); + const last2 = memberProps[memberProps.length - 1]; + const initializedValue = last2.declarations && last2.declarations[0] && isEnumMember(last2.declarations[0]) ? getConstantValue2(last2.declarations[0]) : void 0; + const initializer2 = initializedValue === void 0 ? void 0 : typeof initializedValue === "string" ? factory.createStringLiteral(initializedValue) : factory.createNumericLiteral(initializedValue); + const memberName2 = unescapeLeadingUnderscores(last2.escapedName); + const member2 = factory.createEnumMember( + memberName2, + initializer2 + ); + members.push(member2); + break; + } + const memberDecl = p.declarations && p.declarations[0] && isEnumMember(p.declarations[0]) ? p.declarations[0] : void 0; + let initializer; + let initializerLength; + if (isExpanding(context) && memberDecl && memberDecl.initializer) { + initializer = getSynthesizedDeepClone(memberDecl.initializer); + initializerLength = memberDecl.initializer.end - memberDecl.initializer.pos; + } else { + const initializedValue = memberDecl && getConstantValue2(memberDecl); + initializer = initializedValue === void 0 ? void 0 : typeof initializedValue === "string" ? factory.createStringLiteral(initializedValue) : factory.createNumericLiteral(initializedValue); + initializerLength = (initializer == null ? void 0 : initializer.text.length) ?? 0; + } + const memberName = unescapeLeadingUnderscores(p.escapedName); + context.approximateLength += 4 + memberName.length + initializerLength; + const member = factory.createEnumMember( + memberName, + initializer + ); + members.push(member); + } addResult( factory.createEnumDeclaration( factory.createModifiersFromModifierFlags(isConstEnumSymbol(symbol) ? 4096 /* Const */ : 0), - getInternalSymbolName(symbol, symbolName2), - map(filter(getPropertiesOfType(getTypeOfSymbol(symbol)), (p) => !!(p.flags & 8 /* EnumMember */)), (p) => { - const initializedValue = p.declarations && p.declarations[0] && isEnumMember(p.declarations[0]) ? getConstantValue2(p.declarations[0]) : void 0; - return factory.createEnumMember( - unescapeLeadingUnderscores(p.escapedName), - initializedValue === void 0 ? void 0 : typeof initializedValue === "string" ? factory.createStringLiteral(initializedValue) : factory.createNumericLiteral(initializedValue) - ); - }) + internalSymbolName, + members ), modifierFlags ); @@ -58171,20 +58944,28 @@ function createTypeChecker(host) { function serializeAsFunctionNamespaceMerge(type, symbol, localName, modifierFlags) { const signatures = getSignaturesOfType(type, 0 /* Call */); for (const sig of signatures) { - const decl = signatureToSignatureDeclarationHelper(sig, 262 /* FunctionDeclaration */, context, { name: factory.createIdentifier(localName) }); + context.approximateLength += 1; + const decl = signatureToSignatureDeclarationHelper(sig, 263 /* FunctionDeclaration */, context, { name: factory.createIdentifier(localName) }); addResult(setTextRange2(context, decl, getSignatureTextRangeLocation(sig)), modifierFlags); } if (!(symbol.flags & (512 /* ValueModule */ | 1024 /* NamespaceModule */) && !!symbol.exports && !!symbol.exports.size)) { const props = filter(getPropertiesOfType(type), isNamespaceMember); + context.approximateLength += localName.length; serializeAsNamespaceDeclaration( props, - localName, + factory.createIdentifier(localName), modifierFlags, /*suppressNewPrivateContext*/ true ); } } + function createTruncationStatement(dotDotDotText) { + if (context.flags & 1 /* NoTruncation */) { + return addSyntheticLeadingComment(factory.createEmptyStatement(), 3 /* MultiLineCommentTrivia */, dotDotDotText); + } + return factory.createExpressionStatement(factory.createIdentifier(dotDotDotText)); + } function getSignatureTextRangeLocation(signature) { if (signature.declaration && signature.declaration.parent) { if (isBinaryExpression(signature.declaration.parent) && getAssignmentDeclarationKind(signature.declaration.parent) === 5 /* Property */) { @@ -58197,15 +58978,18 @@ function createTypeChecker(host) { return signature.declaration; } function serializeAsNamespaceDeclaration(props, localName, modifierFlags, suppressNewPrivateContext) { + const nodeFlags = isIdentifier(localName) ? 32 /* Namespace */ : 0 /* None */; + const expanding = isExpanding(context); if (length(props)) { - const localVsRemoteMap = arrayToMultiMap(props, (p) => !length(p.declarations) || some(p.declarations, (d) => getSourceFileOfNode(d) === getSourceFileOfNode(context.enclosingDeclaration)) ? "local" : "remote"); + context.approximateLength += 14; + const localVsRemoteMap = arrayToMultiMap(props, (p) => !length(p.declarations) || some(p.declarations, (d) => getSourceFileOfNode(d) === getSourceFileOfNode(context.enclosingDeclaration)) || expanding ? "local" : "remote"); const localProps = localVsRemoteMap.get("local") || emptyArray; let fakespace = parseNodeFactory.createModuleDeclaration( /*modifiers*/ void 0, - factory.createIdentifier(localName), + localName, factory.createModuleBlock([]), - 32 /* Namespace */ + nodeFlags ); setParent(fakespace, enclosingDeclaration); fakespace.locals = createSymbolTable(props); @@ -58247,6 +59031,18 @@ function createTypeChecker(host) { factory.createModuleBlock(exportModifierStripped) ); addResult(fakespace, modifierFlags); + } else if (expanding) { + context.approximateLength += 14; + addResult( + factory.createModuleDeclaration( + /*modifiers*/ + void 0, + localName, + factory.createModuleBlock([]), + nodeFlags + ), + modifierFlags + ); } } function isNamespaceMember(p) { @@ -58289,11 +59085,13 @@ function createTypeChecker(host) { } function serializeAsClass(symbol, localName, modifierFlags) { var _a2, _b; + context.approximateLength += 9 + localName.length; const originalDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2.find(isClassLike); const oldEnclosing = context.enclosingDeclaration; context.enclosingDeclaration = originalDecl || oldEnclosing; const localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); const typeParamDecls = map(localParams, (p) => typeParameterToDeclaration(p, context)); + forEach(localParams, (p) => context.approximateLength += symbolName(p.symbol).length); const classType = getTypeWithThisArgument(getDeclaredTypeOfClassOrInterface(symbol)); const baseTypes = getBaseTypes(classType); const originalImplements = originalDecl && getEffectiveImplementsTypeNodes(originalDecl); @@ -58301,20 +59099,22 @@ function createTypeChecker(host) { const staticType = getTypeOfSymbol(symbol); const isClass = !!((_b = staticType.symbol) == null ? void 0 : _b.valueDeclaration) && isClassLike(staticType.symbol.valueDeclaration); const staticBaseType = isClass ? getBaseConstructorTypeOfClass(staticType) : anyType; + context.approximateLength += (length(baseTypes) ? 8 : 0) + (length(implementsExpressions) ? 11 : 0); const heritageClauses = [ ...!length(baseTypes) ? [] : [factory.createHeritageClause(96 /* ExtendsKeyword */, map(baseTypes, (b) => serializeBaseType(b, staticBaseType, localName)))], ...!length(implementsExpressions) ? [] : [factory.createHeritageClause(119 /* ImplementsKeyword */, implementsExpressions)] ]; const symbolProps = getNonInheritedProperties(classType, baseTypes, getPropertiesOfType(classType)); - const publicSymbolProps = filter(symbolProps, (s) => { - const valueDecl = s.valueDeclaration; - return !!valueDecl && !(isNamedDeclaration(valueDecl) && isPrivateIdentifier(valueDecl.name)); - }); - const hasPrivateIdentifier = some(symbolProps, (s) => { - const valueDecl = s.valueDeclaration; - return !!valueDecl && isNamedDeclaration(valueDecl) && isPrivateIdentifier(valueDecl.name); - }); - const privateProperties = hasPrivateIdentifier ? [factory.createPropertyDeclaration( + const publicSymbolProps = filter(symbolProps, (s) => !isHashPrivate(s)); + const hasPrivateIdentifier = some(symbolProps, isHashPrivate); + const privateProperties = hasPrivateIdentifier ? isExpanding(context) ? serializePropertySymbolsForClassOrInterface( + filter(symbolProps, isHashPrivate), + /*isClass*/ + true, + baseTypes[0], + /*isStatic*/ + false + ) : [factory.createPropertyDeclaration( /*modifiers*/ void 0, factory.createPrivateIdentifier("#private"), @@ -58325,28 +59125,33 @@ function createTypeChecker(host) { /*initializer*/ void 0 )] : emptyArray; - const publicProperties = flatMap(publicSymbolProps, (p) => serializePropertySymbolForClass( - p, + if (hasPrivateIdentifier && !isExpanding(context)) { + context.approximateLength += 9; + } + const publicProperties = serializePropertySymbolsForClassOrInterface( + publicSymbolProps, + /*isClass*/ + true, + baseTypes[0], /*isStatic*/ - false, - baseTypes[0] - )); - const staticMembers = flatMap( + false + ); + const staticMembers = serializePropertySymbolsForClassOrInterface( filter(getPropertiesOfType(staticType), (p) => !(p.flags & 4194304 /* Prototype */) && p.escapedName !== "prototype" && !isNamespaceMember(p)), - (p) => serializePropertySymbolForClass( - p, - /*isStatic*/ - true, - staticBaseType - ) + /*isClass*/ + true, + staticBaseType, + /*isStatic*/ + true ); const isNonConstructableClassLikeInJsFile = !isClass && !!symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && !some(getSignaturesOfType(staticType, 1 /* Construct */)); + if (isNonConstructableClassLikeInJsFile) context.approximateLength += 21; const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration( factory.createModifiersFromModifierFlags(2 /* Private */), [], /*body*/ void 0 - )] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 176 /* Constructor */); + )] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 177 /* Constructor */); const indexSignatures = serializeIndexSignatures(classType, baseTypes[0]); context.enclosingDeclaration = oldEnclosing; addResult( @@ -58404,23 +59209,25 @@ function createTypeChecker(host) { const targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); switch (node.kind) { - case 208 /* BindingElement */: - if (((_b = (_a2 = node.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 260 /* VariableDeclaration */) { + case 209 /* BindingElement */: + if (((_b = (_a2 = node.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 261 /* VariableDeclaration */) { const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context); const { propertyName } = node; + const propertyNameText = propertyName && isIdentifier(propertyName) ? idText(propertyName) : void 0; + context.approximateLength += 24 + localName.length + specifier2.length + ((propertyNameText == null ? void 0 : propertyNameText.length) ?? 0); addResult( factory.createImportDeclaration( /*modifiers*/ void 0, factory.createImportClause( - /*isTypeOnly*/ - false, + /*phaseModifier*/ + void 0, /*name*/ void 0, factory.createNamedImports([factory.createImportSpecifier( /*isTypeOnly*/ false, - propertyName && isIdentifier(propertyName) ? factory.createIdentifier(idText(propertyName)) : void 0, + propertyNameText ? factory.createIdentifier(propertyNameText) : void 0, factory.createIdentifier(localName) )]) ), @@ -58434,19 +59241,20 @@ function createTypeChecker(host) { } Debug.failBadSyntaxKind(((_c = node.parent) == null ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization"); break; - case 304 /* ShorthandPropertyAssignment */: - if (((_e = (_d = node.parent) == null ? void 0 : _d.parent) == null ? void 0 : _e.kind) === 226 /* BinaryExpression */) { + case 305 /* ShorthandPropertyAssignment */: + if (((_e = (_d = node.parent) == null ? void 0 : _d.parent) == null ? void 0 : _e.kind) === 227 /* BinaryExpression */) { serializeExportSpecifier( unescapeLeadingUnderscores(symbol.escapedName), targetName ); } break; - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: if (isPropertyAccessExpression(node.initializer)) { const initializer = node.initializer; const uniqueName = factory.createUniqueName(localName); const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context); + context.approximateLength += 22 + specifier2.length + idText(uniqueName).length; addResult( factory.createImportEqualsDeclaration( /*modifiers*/ @@ -58458,6 +59266,7 @@ function createTypeChecker(host) { ), 0 /* None */ ); + context.approximateLength += 12 + localName.length + idText(uniqueName).length + idText(initializer.name).length; addResult( factory.createImportEqualsDeclaration( /*modifiers*/ @@ -58472,12 +59281,13 @@ function createTypeChecker(host) { break; } // else fall through and treat commonjs require just like import= - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: if (target.escapedName === "export=" /* ExportEquals */ && some(target.declarations, (d) => isSourceFile(d) && isJsonSourceFile(d))) { serializeMaybeAliasAssignment(symbol); break; } const isLocalImport = !(target.flags & 512 /* ValueModule */) && !isVariableDeclaration(node); + context.approximateLength += 11 + localName.length + unescapeLeadingUnderscores(target.escapedName).length; addResult( factory.createImportEqualsDeclaration( /*modifiers*/ @@ -58496,20 +59306,22 @@ function createTypeChecker(host) { isLocalImport ? modifierFlags : 0 /* None */ ); break; - case 270 /* NamespaceExportDeclaration */: + case 271 /* NamespaceExportDeclaration */: addResult(factory.createNamespaceExportDeclaration(idText(node.name)), 0 /* None */); break; - case 273 /* ImportClause */: { + case 274 /* ImportClause */: { const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context); const specifier2 = context.bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.moduleSpecifier; const attributes = isImportDeclaration(node.parent) ? node.parent.attributes : void 0; const isTypeOnly = isJSDocImportTag(node.parent); + context.approximateLength += 14 + localName.length + 3 + (isTypeOnly ? 4 : 0); addResult( factory.createImportDeclaration( /*modifiers*/ void 0, factory.createImportClause( - isTypeOnly, + /* phaseModifier */ + isTypeOnly ? 156 /* TypeKeyword */ : void 0, factory.createIdentifier(localName), /*namedBindings*/ void 0 @@ -58521,16 +59333,18 @@ function createTypeChecker(host) { ); break; } - case 274 /* NamespaceImport */: { + case 275 /* NamespaceImport */: { const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context); const specifier2 = context.bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.moduleSpecifier; const isTypeOnly = isJSDocImportTag(node.parent.parent); + context.approximateLength += 19 + localName.length + 3 + (isTypeOnly ? 4 : 0); addResult( factory.createImportDeclaration( /*modifiers*/ void 0, factory.createImportClause( - isTypeOnly, + /* phaseModifier */ + isTypeOnly ? 156 /* TypeKeyword */ : void 0, /*name*/ void 0, factory.createNamespaceImport(factory.createIdentifier(localName)) @@ -58542,7 +59356,8 @@ function createTypeChecker(host) { ); break; } - case 280 /* NamespaceExport */: + case 281 /* NamespaceExport */: + context.approximateLength += 19 + localName.length + 3; addResult( factory.createExportDeclaration( /*modifiers*/ @@ -58555,16 +59370,18 @@ function createTypeChecker(host) { 0 /* None */ ); break; - case 276 /* ImportSpecifier */: { + case 277 /* ImportSpecifier */: { const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context); const specifier2 = context.bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.parent.moduleSpecifier; const isTypeOnly = isJSDocImportTag(node.parent.parent.parent); + context.approximateLength += 19 + localName.length + 3 + (isTypeOnly ? 4 : 0); addResult( factory.createImportDeclaration( /*modifiers*/ void 0, factory.createImportClause( - isTypeOnly, + /* phaseModifier */ + isTypeOnly ? 156 /* TypeKeyword */ : void 0, /*name*/ void 0, factory.createNamedImports([ @@ -58583,7 +59400,7 @@ function createTypeChecker(host) { ); break; } - case 281 /* ExportSpecifier */: + case 282 /* ExportSpecifier */: const specifier = node.parent.parent.moduleSpecifier; if (specifier) { const propertyName = node.propertyName; @@ -58597,12 +59414,12 @@ function createTypeChecker(host) { specifier && isStringLiteralLike(specifier) ? factory.createStringLiteral(specifier.text) : void 0 ); break; - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: serializeMaybeAliasAssignment(symbol); break; - case 226 /* BinaryExpression */: - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 227 /* BinaryExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: if (symbol.escapedName === "default" /* Default */ || symbol.escapedName === "export=" /* ExportEquals */) { serializeMaybeAliasAssignment(symbol); } else { @@ -58614,6 +59431,7 @@ function createTypeChecker(host) { } } function serializeExportSpecifier(localName, targetName, specifier) { + context.approximateLength += 16 + localName.length + (localName !== targetName ? targetName.length : 0); addResult( factory.createExportDeclaration( /*modifiers*/ @@ -58664,6 +59482,7 @@ function createTypeChecker(host) { const prevDisableTrackSymbol = context.tracker.disableTrackSymbol; context.tracker.disableTrackSymbol = true; if (isExportAssignmentCompatibleSymbolName) { + context.approximateLength += 10; results.push(factory.createExportAssignment( /*modifiers*/ void 0, @@ -58677,6 +59496,7 @@ function createTypeChecker(host) { serializeExportSpecifier(name, getInternalSymbolName(target, symbolName(target))); } else { const varName = getUnusedName(name, symbol); + context.approximateLength += varName.length + 10; addResult( factory.createImportEqualsDeclaration( /*modifiers*/ @@ -58705,7 +59525,8 @@ function createTypeChecker(host) { if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) { serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ : 32 /* Export */); } else { - const flags = ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 267 /* ModuleDeclaration */ && (!(symbol.flags & 98304 /* Accessor */) || symbol.flags & 65536 /* SetAccessor */) ? 1 /* Let */ : 2 /* Const */; + const flags = ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 268 /* ModuleDeclaration */ && (!(symbol.flags & 98304 /* Accessor */) || symbol.flags & 65536 /* SetAccessor */) ? 1 /* Let */ : 2 /* Const */; + context.approximateLength += varName.length + 5; const statement = factory.createVariableStatement( /*modifiers*/ void 0, @@ -58730,6 +59551,7 @@ function createTypeChecker(host) { ); } if (isExportAssignmentCompatibleSymbolName) { + context.approximateLength += varName.length + 10; results.push(factory.createExportAssignment( /*modifiers*/ void 0, @@ -58764,7 +59586,7 @@ function createTypeChecker(host) { return function serializePropertySymbol(p, isStatic2, baseType) { var _a2, _b, _c, _d, _e, _f; const modifierFlags = getDeclarationModifierFlagsFromSymbol(p); - const isPrivate = !!(modifierFlags & 2 /* Private */); + const omitType = !!(modifierFlags & 2 /* Private */) && !isExpanding(context); if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) { return []; } @@ -58778,7 +59600,7 @@ function createTypeChecker(host) { const result = []; if (p.flags & 65536 /* SetAccessor */) { const setter = p.declarations && forEach(p.declarations, (d) => { - if (d.kind === 178 /* SetAccessor */) { + if (d.kind === 179 /* SetAccessor */) { return d; } if (isCallExpression(d) && isBindableObjectDefinePropertyCall(d)) { @@ -58793,6 +59615,7 @@ function createTypeChecker(host) { Debug.assert(!!setter); const paramSymbol = isFunctionLikeDeclaration(setter) ? getSignatureFromDeclaration(setter).parameters[0] : void 0; const setterDeclaration = (_b = p.declarations) == null ? void 0 : _b.find(isSetAccessor); + context.approximateLength += modifiersLength(flag) + 7 + (paramSymbol ? symbolName(paramSymbol).length : 5) + (omitType ? 0 : 2); result.push(setTextRange2( context, factory.createSetAccessorDeclaration( @@ -58806,7 +59629,7 @@ function createTypeChecker(host) { paramSymbol ? parameterToParameterDeclarationName(paramSymbol, getEffectiveParameterDeclaration(paramSymbol), context) : "value", /*questionToken*/ void 0, - isPrivate ? void 0 : serializeTypeForDeclaration(context, setterDeclaration, getWriteTypeOfSymbol(p), p) + omitType ? void 0 : serializeTypeForDeclaration(context, setterDeclaration, getWriteTypeOfSymbol(p), p) )], /*body*/ void 0 @@ -58815,15 +59638,15 @@ function createTypeChecker(host) { )); } if (p.flags & 32768 /* GetAccessor */) { - const isPrivate2 = modifierFlags & 2 /* Private */; const getterDeclaration = (_c = p.declarations) == null ? void 0 : _c.find(isGetAccessor); + context.approximateLength += modifiersLength(flag) + 8 + (omitType ? 0 : 2); result.push(setTextRange2( context, factory.createGetAccessorDeclaration( factory.createModifiersFromModifierFlags(flag), name, [], - isPrivate2 ? void 0 : serializeTypeForDeclaration(context, getterDeclaration, getTypeOfSymbol(p), p), + omitType ? void 0 : serializeTypeForDeclaration(context, getterDeclaration, getTypeOfSymbol(p), p), /*body*/ void 0 ), @@ -58832,13 +59655,15 @@ function createTypeChecker(host) { } return result; } else if (p.flags & (4 /* Property */ | 3 /* Variable */ | 98304 /* Accessor */)) { + const modifierFlags2 = (isReadonlySymbol(p) ? 8 /* Readonly */ : 0) | flag; + context.approximateLength += 2 + (omitType ? 0 : 2) + modifiersLength(modifierFlags2); return setTextRange2( context, createProperty2( - factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 8 /* Readonly */ : 0) | flag), + factory.createModifiersFromModifierFlags(modifierFlags2), name, p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0, - isPrivate ? void 0 : serializeTypeForDeclaration(context, (_d = p.declarations) == null ? void 0 : _d.find(isSetAccessorDeclaration), getWriteTypeOfSymbol(p), p), + omitType ? void 0 : serializeTypeForDeclaration(context, (_d = p.declarations) == null ? void 0 : _d.find(isSetAccessorDeclaration), getWriteTypeOfSymbol(p), p), // TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357 // interface members can't have initializers, however class members _can_ /*initializer*/ @@ -58850,11 +59675,13 @@ function createTypeChecker(host) { if (p.flags & (8192 /* Method */ | 16 /* Function */)) { const type = getTypeOfSymbol(p); const signatures = getSignaturesOfType(type, 0 /* Call */); - if (flag & 2 /* Private */) { + if (omitType) { + const modifierFlags2 = (isReadonlySymbol(p) ? 8 /* Readonly */ : 0) | flag; + context.approximateLength += 1 + modifiersLength(modifierFlags2); return setTextRange2( context, createProperty2( - factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 8 /* Readonly */ : 0) | flag), + factory.createModifiersFromModifierFlags(modifierFlags2), name, p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0, /*type*/ @@ -58867,6 +59694,7 @@ function createTypeChecker(host) { } const results2 = []; for (const sig of signatures) { + context.approximateLength += 1; const decl = signatureToSignatureDeclarationHelper( sig, methodKind, @@ -58885,6 +59713,25 @@ function createTypeChecker(host) { return Debug.fail(`Unhandled class member kind! ${p.__debugFlags || p.flags}`); }; } + function modifiersLength(flags) { + let result = 0; + if (flags & 32 /* Export */) result += 7; + if (flags & 128 /* Ambient */) result += 8; + if (flags & 2048 /* Default */) result += 8; + if (flags & 4096 /* Const */) result += 6; + if (flags & 1 /* Public */) result += 7; + if (flags & 2 /* Private */) result += 8; + if (flags & 4 /* Protected */) result += 10; + if (flags & 64 /* Abstract */) result += 9; + if (flags & 256 /* Static */) result += 7; + if (flags & 16 /* Override */) result += 9; + if (flags & 8 /* Readonly */) result += 9; + if (flags & 512 /* Accessor */) result += 9; + if (flags & 1024 /* Async */) result += 6; + if (flags & 8192 /* In */) result += 3; + if (flags & 16384 /* Out */) result += 4; + return result; + } function serializePropertySymbolForInterface(p, baseType) { return serializePropertySymbolForInterfaceWorker( p, @@ -58949,6 +59796,7 @@ function createTypeChecker(host) { } const results2 = []; for (const sig of signatures) { + context.approximateLength += 1; const decl = signatureToSignatureDeclarationHelper(sig, outputKind, context); results2.push(setTextRange2(context, decl, sig.declaration)); } @@ -59074,6 +59922,23 @@ function createTypeChecker(host) { return localName; } } + function isExpanding(context) { + return context.maxExpansionDepth !== -1; + } + function isHashPrivate(s) { + return !!s.valueDeclaration && isNamedDeclaration(s.valueDeclaration) && isPrivateIdentifier(s.valueDeclaration.name); + } + function getClonedHashPrivateName(s) { + if (s.valueDeclaration && isNamedDeclaration(s.valueDeclaration) && isPrivateIdentifier(s.valueDeclaration.name)) { + return factory.cloneNode(s.valueDeclaration.name); + } + return void 0; + } + } + function isLibType(type) { + var _a; + const symbol = (getObjectFlags(type) & 4 /* Reference */) !== 0 ? type.target.symbol : type.symbol; + return isTupleType(type) || !!((_a = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _a.some((decl) => host.isSourceFileDefaultLibrary(getSourceFileOfNode(decl)))); } function typePredicateToString(typePredicate, enclosingDeclaration, flags = 16384 /* UseAliasDefinedOutsideCurrentScope */, writer) { return writer ? typePredicateToStringWorker(writer).getText() : usingSingleLineStringWriter(typePredicateToStringWorker); @@ -59092,14 +59957,14 @@ function createTypeChecker(host) { return writer2; } } - function formatUnionTypes(types) { + function formatUnionTypes(types, expandingEnum) { const result = []; let flags = 0; for (let i = 0; i < types.length; i++) { const t = types[i]; flags |= t.flags; if (!(t.flags & 98304 /* Nullable */)) { - if (t.flags & (512 /* BooleanLiteral */ | 1056 /* EnumLike */)) { + if (t.flags & 512 /* BooleanLiteral */ || !expandingEnum && t.flags | 1056 /* EnumLike */) { const baseType = t.flags & 512 /* BooleanLiteral */ ? booleanType : getBaseTypeOfEnumLikeType(t); if (baseType.flags & 1048576 /* Union */) { const count = baseType.types.length; @@ -59136,10 +60001,10 @@ function createTypeChecker(host) { return void 0; } function isTopLevelInExternalModuleAugmentation(node) { - return node && node.parent && node.parent.kind === 268 /* ModuleBlock */ && isExternalModuleAugmentation(node.parent.parent); + return node && node.parent && node.parent.kind === 269 /* ModuleBlock */ && isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 307 /* SourceFile */ || isAmbientModule(location); + return location.kind === 308 /* SourceFile */ || isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { const nameType = getSymbolLinks(symbol).nameType; @@ -59191,17 +60056,17 @@ function createTypeChecker(host) { if (!declaration) { declaration = symbol.declarations[0]; } - if (declaration.parent && declaration.parent.kind === 260 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 261 /* VariableDeclaration */) { return declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 231 /* ClassExpression */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 232 /* ClassExpression */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } - return declaration.kind === 231 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 232 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } const name = getNameOfSymbolFromNameType(symbol, context); @@ -59218,75 +60083,75 @@ function createTypeChecker(host) { return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 338 /* JSDocCallbackTag */: - case 346 /* JSDocTypedefTag */: - case 340 /* JSDocEnumTag */: + case 339 /* JSDocCallbackTag */: + case 347 /* JSDocTypedefTag */: + case 341 /* JSDocEnumTag */: return !!(node.parent && node.parent.parent && node.parent.parent.parent && isSourceFile(node.parent.parent.parent)); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: if (isBindingPattern(node.name) && !node.name.elements.length) { return false; } // falls through - case 267 /* ModuleDeclaration */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 262 /* FunctionDeclaration */: - case 266 /* EnumDeclaration */: - case 271 /* ImportEqualsDeclaration */: + case 268 /* ModuleDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 263 /* FunctionDeclaration */: + case 267 /* EnumDeclaration */: + case 272 /* ImportEqualsDeclaration */: if (isExternalModuleAugmentation(node)) { return true; } const parent2 = getDeclarationContainer(node); - if (!(getCombinedModifierFlagsCached(node) & 32 /* Export */) && !(node.kind !== 271 /* ImportEqualsDeclaration */ && parent2.kind !== 307 /* SourceFile */ && parent2.flags & 33554432 /* Ambient */)) { + if (!(getCombinedModifierFlagsCached(node) & 32 /* Export */) && !(node.kind !== 272 /* ImportEqualsDeclaration */ && parent2.kind !== 308 /* SourceFile */ && parent2.flags & 33554432 /* Ambient */)) { return isGlobalSourceFile(parent2); } return isDeclarationVisible(parent2); - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: if (hasEffectiveModifier(node, 2 /* Private */ | 4 /* Protected */)) { return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 176 /* Constructor */: - case 180 /* ConstructSignature */: - case 179 /* CallSignature */: - case 181 /* IndexSignature */: - case 169 /* Parameter */: - case 268 /* ModuleBlock */: - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 187 /* TypeLiteral */: - case 183 /* TypeReference */: - case 188 /* ArrayType */: - case 189 /* TupleType */: - case 192 /* UnionType */: - case 193 /* IntersectionType */: - case 196 /* ParenthesizedType */: - case 202 /* NamedTupleMember */: + case 177 /* Constructor */: + case 181 /* ConstructSignature */: + case 180 /* CallSignature */: + case 182 /* IndexSignature */: + case 170 /* Parameter */: + case 269 /* ModuleBlock */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 188 /* TypeLiteral */: + case 184 /* TypeReference */: + case 189 /* ArrayType */: + case 190 /* TupleType */: + case 193 /* UnionType */: + case 194 /* IntersectionType */: + case 197 /* ParenthesizedType */: + case 203 /* NamedTupleMember */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 273 /* ImportClause */: - case 274 /* NamespaceImport */: - case 276 /* ImportSpecifier */: + case 274 /* ImportClause */: + case 275 /* NamespaceImport */: + case 277 /* ImportSpecifier */: return false; // Type parameters are always visible - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: // Source file and namespace export are always visible // falls through - case 307 /* SourceFile */: - case 270 /* NamespaceExportDeclaration */: + case 308 /* SourceFile */: + case 271 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return false; default: return false; @@ -59295,7 +60160,7 @@ function createTypeChecker(host) { } function collectLinkedAliases(node, setVisibility) { let exportSymbol; - if (node.kind !== 11 /* StringLiteral */ && node.parent && node.parent.kind === 277 /* ExportAssignment */) { + if (node.kind !== 11 /* StringLiteral */ && node.parent && node.parent.kind === 278 /* ExportAssignment */) { exportSymbol = resolveName( node, node, @@ -59305,7 +60170,7 @@ function createTypeChecker(host) { /*isUse*/ false ); - } else if (node.parent.kind === 281 /* ExportSpecifier */) { + } else if (node.parent.kind === 282 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } let result; @@ -59405,12 +60270,12 @@ function createTypeChecker(host) { function getDeclarationContainer(node) { return findAncestor(getRootDeclaration(node), (node2) => { switch (node2.kind) { - case 260 /* VariableDeclaration */: - case 261 /* VariableDeclarationList */: - case 276 /* ImportSpecifier */: - case 275 /* NamedImports */: - case 274 /* NamespaceImport */: - case 273 /* ImportClause */: + case 261 /* VariableDeclaration */: + case 262 /* VariableDeclarationList */: + case 277 /* ImportSpecifier */: + case 276 /* NamedImports */: + case 275 /* NamespaceImport */: + case 274 /* ImportClause */: return false; default: return true; @@ -59535,23 +60400,23 @@ function createTypeChecker(host) { function getParentElementAccess(node) { const ancestor = node.parent.parent; switch (ancestor.kind) { - case 208 /* BindingElement */: - case 303 /* PropertyAssignment */: + case 209 /* BindingElement */: + case 304 /* PropertyAssignment */: return getSyntheticElementAccess(ancestor); - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return getSyntheticElementAccess(node.parent); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return ancestor.initializer; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return ancestor.right; } } function getDestructuringPropertyName(node) { const parent2 = node.parent; - if (node.kind === 208 /* BindingElement */ && parent2.kind === 206 /* ObjectBindingPattern */) { + if (node.kind === 209 /* BindingElement */ && parent2.kind === 207 /* ObjectBindingPattern */) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 303 /* PropertyAssignment */ || node.kind === 304 /* ShorthandPropertyAssignment */) { + if (node.kind === 304 /* PropertyAssignment */ || node.kind === 305 /* ShorthandPropertyAssignment */) { return getLiteralPropertyNameText(node.name); } return "" + parent2.elements.indexOf(node); @@ -59582,7 +60447,7 @@ function createTypeChecker(host) { } const accessFlags = 32 /* ExpressionPosition */ | (noTupleBoundsCheck || hasDefaultValue(declaration) ? 16 /* AllowMissing */ : 0); let type; - if (pattern.kind === 206 /* ObjectBindingPattern */) { + if (pattern.kind === 207 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) { @@ -59645,13 +60510,13 @@ function createTypeChecker(host) { /*excludeJSDocTypeAssertions*/ true ); - return expr.kind === 209 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 210 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, isProperty = false, isOptional = true) { return strictNullChecks && isOptional ? getOptionalType(type, isProperty) : type; } function getTypeForVariableLikeDeclaration(declaration, includeOptionality, checkMode) { - if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 249 /* ForInStatement */) { + if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 250 /* ForInStatement */) { const indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression( declaration.parent.parent.expression, /*checkMode*/ @@ -59659,7 +60524,7 @@ function createTypeChecker(host) { ))); return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType; } - if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 250 /* ForOfStatement */) { + if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 251 /* ForOfStatement */) { const forOfStatement = declaration.parent.parent; return checkRightHandSideOfForOf(forOfStatement) || anyType; } @@ -59691,8 +60556,8 @@ function createTypeChecker(host) { return; } const func = declaration.parent; - if (func.kind === 178 /* SetAccessor */ && hasBindableName(func)) { - const getter = getDeclarationOfKind(getSymbolOfDeclaration(declaration.parent), 177 /* GetAccessor */); + if (func.kind === 179 /* SetAccessor */ && hasBindableName(func)) { + const getter = getDeclarationOfKind(getSymbolOfDeclaration(declaration.parent), 178 /* GetAccessor */); if (getter) { const getterSignature = getSignatureFromDeclaration(getter); const thisParameter = getAccessorThisParameter(func); @@ -59765,7 +60630,7 @@ function createTypeChecker(host) { const links = getSymbolLinks(symbol); if (links.isConstructorDeclaredProperty === void 0) { links.isConstructorDeclaredProperty = false; - links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && every(symbol.declarations, (declaration) => isBinaryExpression(declaration) && isPossiblyAliasedThisProperty(declaration) && (declaration.left.kind !== 212 /* ElementAccessExpression */ || isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration( + links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && every(symbol.declarations, (declaration) => isBinaryExpression(declaration) && isPossiblyAliasedThisProperty(declaration) && (declaration.left.kind !== 213 /* ElementAccessExpression */ || isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration( /*declaredType*/ void 0, declaration, @@ -59793,7 +60658,7 @@ function createTypeChecker(host) { /*includeClassComputedPropertyName*/ false ); - if (container && (container.kind === 176 /* Constructor */ || isJSConstructor(container))) { + if (container && (container.kind === 177 /* Constructor */ || isJSConstructor(container))) { return container; } } @@ -60076,7 +60941,7 @@ function createTypeChecker(host) { /*includeClassComputedPropertyName*/ false ); - return thisContainer.kind === 176 /* Constructor */ || thisContainer.kind === 262 /* FunctionDeclaration */ || thisContainer.kind === 218 /* FunctionExpression */ && !isPrototypePropertyAssignment(thisContainer.parent); + return thisContainer.kind === 177 /* Constructor */ || thisContainer.kind === 263 /* FunctionDeclaration */ || thisContainer.kind === 219 /* FunctionExpression */ && !isPrototypePropertyAssignment(thisContainer.parent); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { Debug.assert(types.length === declarations.length); @@ -60149,7 +61014,7 @@ function createTypeChecker(host) { function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2) { const elements = pattern.elements; const lastElement = lastOrUndefined(elements); - const restElement = lastElement && lastElement.kind === 208 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : void 0; + const restElement = lastElement && lastElement.kind === 209 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : void 0; if (elements.length === 0 || elements.length === 1 && restElement) { return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType; } @@ -60166,7 +61031,7 @@ function createTypeChecker(host) { } function getTypeFromBindingPattern(pattern, includePatternInType = false, reportErrors2 = false) { if (includePatternInType) contextualBindingPatterns.push(pattern); - const result = pattern.kind === 206 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2); + const result = pattern.kind === 207 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2); if (includePatternInType) contextualBindingPatterns.pop(); return result; } @@ -60212,7 +61077,7 @@ function createTypeChecker(host) { if (reportErrors2) { reportErrorsFromWidening(declaration, type); } - if (type.flags & 8192 /* UniqueESSymbol */ && (isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfDeclaration(declaration)) { + if (type.flags & 8192 /* UniqueESSymbol */ && (isBindingElement(declaration) || !tryGetTypeFromEffectiveTypeNode(declaration)) && type.symbol !== getSymbolOfDeclaration(declaration)) { type = esSymbolType; } return getWidenedType(type); @@ -60227,7 +61092,7 @@ function createTypeChecker(host) { } function declarationBelongsToPrivateAmbientMember(declaration) { const root = getRootDeclaration(declaration); - const memberDeclaration = root.kind === 169 /* Parameter */ ? root.parent : root; + const memberDeclaration = root.kind === 170 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(node) { @@ -60298,7 +61163,7 @@ function createTypeChecker(host) { return reportCircularityError(symbol); } let type; - if (declaration.kind === 277 /* ExportAssignment */) { + if (declaration.kind === 278 /* ExportAssignment */) { type = widenTypeForVariableLikeDeclaration(tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionCached(declaration.expression), declaration); } else if (isBinaryExpression(declaration) || isInJSFile(declaration) && (isCallExpression(declaration) || (isPropertyAccessExpression(declaration) || isBindableStaticElementAccessExpression(declaration)) && isBinaryExpression(declaration.parent))) { type = getWidenedTypeForAssignmentDeclaration(symbol); @@ -60339,13 +61204,13 @@ function createTypeChecker(host) { function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { switch (accessor.kind) { - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: const getterTypeAnnotation = getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: const setterTypeAnnotation = getEffectiveSetAccessorTypeAnnotationNode(accessor); return setterTypeAnnotation; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: Debug.assert(hasAccessorModifier(accessor)); const accessorTypeAnnotation = getEffectiveTypeAnnotationNode(accessor); return accessorTypeAnnotation; @@ -60370,9 +61235,9 @@ function createTypeChecker(host) { if (!pushTypeResolution(symbol, 0 /* Type */)) { return errorType; } - const getter = getDeclarationOfKind(symbol, 177 /* GetAccessor */); - const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */); - const accessor = tryCast(getDeclarationOfKind(symbol, 172 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration); + const getter = getDeclarationOfKind(symbol, 178 /* GetAccessor */); + const setter = getDeclarationOfKind(symbol, 179 /* SetAccessor */); + const accessor = tryCast(getDeclarationOfKind(symbol, 173 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration); let type = getter && isInJSFile(getter) && getTypeForDeclarationFromJSDocComment(getter) || getAnnotatedAccessorType(getter) || getAnnotatedAccessorType(setter) || getAnnotatedAccessorType(accessor) || getter && getter.body && getReturnTypeFromBody(getter) || accessor && getWidenedTypeForVariableLikeDeclaration( accessor, /*reportErrors*/ @@ -60410,7 +61275,7 @@ function createTypeChecker(host) { if (!pushTypeResolution(symbol, 7 /* WriteType */)) { return errorType; } - const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */) ?? tryCast(getDeclarationOfKind(symbol, 172 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration); + const setter = getDeclarationOfKind(symbol, 179 /* SetAccessor */) ?? tryCast(getDeclarationOfKind(symbol, 173 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration); let writeType = getAnnotatedAccessorType(setter); if (!popTypeResolution()) { if (getAnnotatedAccessorTypeNode(setter)) { @@ -60450,7 +61315,7 @@ function createTypeChecker(host) { const declaration = symbol.valueDeclaration; if (symbol.flags & 1536 /* Module */ && isShorthandAmbientModuleSymbol(symbol)) { return anyType; - } else if (declaration && (declaration.kind === 226 /* BinaryExpression */ || isAccessExpression(declaration) && declaration.parent.kind === 226 /* BinaryExpression */)) { + } else if (declaration && (declaration.kind === 227 /* BinaryExpression */ || isAccessExpression(declaration) && declaration.parent.kind === 227 /* BinaryExpression */)) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 /* ValueModule */ && declaration && isSourceFile(declaration) && declaration.commonJsModuleIndicator) { const resolvedModule = resolveExternalModuleSymbol(symbol); @@ -60518,7 +61383,7 @@ function createTypeChecker(host) { error2(symbol.valueDeclaration, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); return errorType; } - if (noImplicitAny && (declaration.kind !== 169 /* Parameter */ || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 170 /* Parameter */ || declaration.initializer)) { error2(symbol.valueDeclaration, Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } } else if (symbol.flags & 2097152 /* Alias */) { @@ -60549,11 +61414,14 @@ function createTypeChecker(host) { } function getWriteTypeOfSymbol(symbol) { const checkFlags = getCheckFlags(symbol); - if (symbol.flags & 4 /* Property */) { - return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : ( + if (checkFlags & 2 /* SyntheticProperty */) { + return checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : ( // NOTE: cast to TransientSymbol should be safe because only TransientSymbols can have CheckFlags.SyntheticProperty symbol.links.writeType || symbol.links.type - ) : removeMissingType(getTypeOfSymbol(symbol), !!(symbol.flags & 16777216 /* Optional */)); + ); + } + if (symbol.flags & 4 /* Property */) { + return removeMissingType(getTypeOfSymbol(symbol), !!(symbol.flags & 16777216 /* Optional */)); } if (symbol.flags & 98304 /* Accessor */) { return checkFlags & 1 /* Instantiated */ ? getWriteTypeOfInstantiatedSymbol(symbol) : getWriteTypeOfAccessors(symbol); @@ -60646,49 +61514,49 @@ function createTypeChecker(host) { } const kind = node.kind; switch (kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 173 /* MethodSignature */: - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 317 /* JSDocFunctionType */: - case 262 /* FunctionDeclaration */: - case 174 /* MethodDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 265 /* TypeAliasDeclaration */: - case 345 /* JSDocTemplateTag */: - case 346 /* JSDocTypedefTag */: - case 340 /* JSDocEnumTag */: - case 338 /* JSDocCallbackTag */: - case 200 /* MappedType */: - case 194 /* ConditionalType */: { + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 174 /* MethodSignature */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 318 /* JSDocFunctionType */: + case 263 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 266 /* TypeAliasDeclaration */: + case 346 /* JSDocTemplateTag */: + case 347 /* JSDocTypedefTag */: + case 341 /* JSDocEnumTag */: + case 339 /* JSDocCallbackTag */: + case 201 /* MappedType */: + case 195 /* ConditionalType */: { const outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if ((kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */ || isObjectLiteralMethod(node)) && isContextSensitive(node)) { + if ((kind === 219 /* FunctionExpression */ || kind === 220 /* ArrowFunction */ || isObjectLiteralMethod(node)) && isContextSensitive(node)) { const signature = firstOrUndefined(getSignaturesOfType(getTypeOfSymbol(getSymbolOfDeclaration(node)), 0 /* Call */)); if (signature && signature.typeParameters) { return [...outerTypeParameters || emptyArray, ...signature.typeParameters]; } } - if (kind === 200 /* MappedType */) { + if (kind === 201 /* MappedType */) { return append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node.typeParameter))); - } else if (kind === 194 /* ConditionalType */) { + } else if (kind === 195 /* ConditionalType */) { return concatenate(outerTypeParameters, getInferTypeParameters(node)); } const outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, getEffectiveTypeParameterDeclarations(node)); - const thisType = includeThisTypes && (kind === 263 /* ClassDeclaration */ || kind === 231 /* ClassExpression */ || kind === 264 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node)).thisType; + const thisType = includeThisTypes && (kind === 264 /* ClassDeclaration */ || kind === 232 /* ClassExpression */ || kind === 265 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node)).thisType; return thisType ? append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } - case 341 /* JSDocParameterTag */: + case 342 /* JSDocParameterTag */: const paramSymbol = getParameterSymbolFromJSDoc(node); if (paramSymbol) { node = paramSymbol.valueDeclaration; } break; - case 320 /* JSDoc */: { + case 321 /* JSDoc */: { const outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); return node.tags ? appendTypeParameters(outerTypeParameters, flatMap(node.tags, (t) => isJSDocTemplateTag(t) ? t.typeParameters : void 0)) : outerTypeParameters; } @@ -60698,14 +61566,14 @@ function createTypeChecker(host) { function getOuterTypeParametersOfClassOrInterface(symbol) { var _a; const declaration = symbol.flags & 32 /* Class */ || symbol.flags & 16 /* Function */ ? symbol.valueDeclaration : (_a = symbol.declarations) == null ? void 0 : _a.find((decl) => { - if (decl.kind === 264 /* InterfaceDeclaration */) { + if (decl.kind === 265 /* InterfaceDeclaration */) { return true; } - if (decl.kind !== 260 /* VariableDeclaration */) { + if (decl.kind !== 261 /* VariableDeclaration */) { return false; } const initializer = decl.initializer; - return !!initializer && (initializer.kind === 218 /* FunctionExpression */ || initializer.kind === 219 /* ArrowFunction */); + return !!initializer && (initializer.kind === 219 /* FunctionExpression */ || initializer.kind === 220 /* ArrowFunction */); }); Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); @@ -60716,7 +61584,7 @@ function createTypeChecker(host) { } let result; for (const node of symbol.declarations) { - if (node.kind === 264 /* InterfaceDeclaration */ || node.kind === 263 /* ClassDeclaration */ || node.kind === 231 /* ClassExpression */ || isJSConstructor(node) || isTypeAlias(node)) { + if (node.kind === 265 /* InterfaceDeclaration */ || node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */ || isJSConstructor(node) || isTypeAlias(node)) { const declaration = node; result = appendTypeParameters(result, getEffectiveTypeParameterDeclarations(declaration)); } @@ -60850,7 +61718,7 @@ function createTypeChecker(host) { } if (!popTypeResolution() && type.symbol.declarations) { for (const declaration of type.symbol.declarations) { - if (declaration.kind === 263 /* ClassDeclaration */ || declaration.kind === 264 /* InterfaceDeclaration */) { + if (declaration.kind === 264 /* ClassDeclaration */ || declaration.kind === 265 /* InterfaceDeclaration */) { reportCircularBaseType(declaration, type); } } @@ -60935,7 +61803,7 @@ function createTypeChecker(host) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; if (type.symbol.declarations) { for (const declaration of type.symbol.declarations) { - if (declaration.kind === 264 /* InterfaceDeclaration */ && getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 265 /* InterfaceDeclaration */ && getInterfaceBaseTypeNodes(declaration)) { for (const node of getInterfaceBaseTypeNodes(declaration)) { const baseType = getReducedType(getTypeFromTypeNode(node)); if (!isErrorType(baseType)) { @@ -60963,7 +61831,7 @@ function createTypeChecker(host) { return true; } for (const declaration of symbol.declarations) { - if (declaration.kind === 264 /* InterfaceDeclaration */) { + if (declaration.kind === 265 /* InterfaceDeclaration */) { if (declaration.flags & 256 /* ContainsThis */) { return false; } @@ -61038,7 +61906,7 @@ function createTypeChecker(host) { } } else { type = errorType; - if (declaration.kind === 340 /* JSDocEnumTag */) { + if (declaration.kind === 341 /* JSDocEnumTag */) { error2(declaration.typeExpression.type, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); } else { error2(isNamedDeclaration(declaration) ? declaration.name || declaration : declaration, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); @@ -61057,7 +61925,7 @@ function createTypeChecker(host) { const memberTypeList = []; if (symbol.declarations) { for (const declaration of symbol.declarations) { - if (declaration.kind === 266 /* EnumDeclaration */) { + if (declaration.kind === 267 /* EnumDeclaration */) { for (const member of declaration.members) { if (hasBindableName(member)) { const memberSymbol = getSymbolOfDeclaration(member); @@ -61151,11 +62019,11 @@ function createTypeChecker(host) { case 116 /* VoidKeyword */: case 157 /* UndefinedKeyword */: case 146 /* NeverKeyword */: - case 201 /* LiteralType */: + case 202 /* LiteralType */: return true; - case 188 /* ArrayType */: + case 189 /* ArrayType */: return isThislessType(node.elementType); - case 183 /* TypeReference */: + case 184 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -61171,21 +62039,21 @@ function createTypeChecker(host) { function isThislessFunctionLikeDeclaration(node) { const returnType = getEffectiveReturnTypeNode(node); const typeParameters = getEffectiveTypeParameterDeclarations(node); - return (node.kind === 176 /* Constructor */ || !!returnType && isThislessType(returnType)) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); + return (node.kind === 177 /* Constructor */ || !!returnType && isThislessType(returnType)) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } function isThisless(symbol) { if (symbol.declarations && symbol.declarations.length === 1) { const declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -61271,9 +62139,7 @@ function createTypeChecker(host) { symbol.declarations.push(member); } if (symbolFlags & 111551 /* Value */) { - if (!symbol.valueDeclaration || symbol.valueDeclaration.kind !== member.kind) { - symbol.valueDeclaration = member; - } + setValueDeclaration(symbol, member); } } function lateBindMember(parent2, earlySymbols, lateSymbols, decl) { @@ -62237,7 +63103,7 @@ function createTypeChecker(host) { } function isMappedTypeWithKeyofConstraintDeclaration(type) { const constraintDeclaration = getConstraintDeclarationForMappedType(type); - return constraintDeclaration.kind === 198 /* TypeOperator */ && constraintDeclaration.operator === 143 /* KeyOfKeyword */; + return constraintDeclaration.kind === 199 /* TypeOperator */ && constraintDeclaration.operator === 143 /* KeyOfKeyword */; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -62711,6 +63577,7 @@ function createTypeChecker(host) { } function createUnionOrIntersectionProperty(containingType, name, skipObjectFunctionPropertyAugment) { var _a, _b, _c; + let propFlags = 0 /* None */; let singleProp; let propSet; let indexTypes; @@ -62735,6 +63602,7 @@ function createTypeChecker(host) { } if (!singleProp) { singleProp = prop; + propFlags = prop.flags & 98304 /* Accessor */ || 4 /* Property */; } else if (prop !== singleProp) { const isInstantiation = (getTargetSymbol(prop) || prop) === (getTargetSymbol(singleProp) || singleProp); if (isInstantiation && compareProperties2(singleProp, prop, (a, b) => a === b ? -1 /* True */ : 0 /* False */) === -1 /* True */) { @@ -62749,6 +63617,9 @@ function createTypeChecker(host) { propSet.set(id, prop); } } + if (propFlags & 98304 /* Accessor */ && (prop.flags & 98304 /* Accessor */) !== (propFlags & 98304 /* Accessor */)) { + propFlags = propFlags & ~98304 /* Accessor */ | 4 /* Property */; + } } if (isUnion && isReadonlySymbol(prop)) { checkFlags |= 8 /* Readonly */; @@ -62762,6 +63633,7 @@ function createTypeChecker(host) { } else if (isUnion) { const indexInfo = !isLateBoundName(name) && getApplicableIndexInfoForName(type, name); if (indexInfo) { + propFlags = propFlags & ~98304 /* Accessor */ | 4 /* Property */; checkFlags |= 32 /* WritePartial */ | (indexInfo.isReadonly ? 8 /* Readonly */ : 0); indexTypes = append(indexTypes, isTupleType(type) ? getRestTypeOfTupleType(type) || undefinedType : indexInfo.type); } else if (isObjectLiteralType2(type) && !(getObjectFlags(type) & 2097152 /* ContainsSpread */)) { @@ -62825,7 +63697,7 @@ function createTypeChecker(host) { propTypes.push(type); } addRange(propTypes, indexTypes); - const result = createSymbol(4 /* Property */ | (optionalFlag ?? 0), name, syntheticFlag | checkFlags); + const result = createSymbol(propFlags | (optionalFlag ?? 0), name, syntheticFlag | checkFlags); result.links.containingType = containingType; if (!hasNonUniformValueDeclaration && firstValueDeclaration) { result.valueDeclaration = firstValueDeclaration; @@ -63182,7 +64054,7 @@ function createTypeChecker(host) { let hasThisParameter2 = false; const iife = getImmediatelyInvokedFunctionExpression(declaration); const isJSConstructSignature = isJSDocConstructSignature(declaration); - const isUntypedSignatureInJSFile = !iife && isInJSFile(declaration) && isValueSignatureDeclaration(declaration) && !hasJSDocParameterTags(declaration) && !getJSDocType(declaration); + const isUntypedSignatureInJSFile = !iife && isInJSFile(declaration) && isValueSignatureDeclaration(declaration) && !hasJSDocParameterTags(declaration) && !some(declaration.parameters, (p) => !!getJSDocType(p)) && !getJSDocType(declaration) && !getContextualSignatureForFunctionLikeDeclaration(declaration); if (isUntypedSignatureInJSFile) { flags |= 32 /* IsUntypedSignatureInJSFile */; } @@ -63212,7 +64084,7 @@ function createTypeChecker(host) { } else { parameters.push(paramSymbol); } - if (type && type.kind === 201 /* LiteralType */) { + if (type && type.kind === 202 /* LiteralType */) { flags |= 2 /* HasLiteralTypes */; } const isOptionalParameter2 = hasEffectiveQuestionToken(param) || isParameter(param) && param.initializer || isRestParameter(param) || iife && parameters.length > iife.arguments.length && !type; @@ -63220,8 +64092,8 @@ function createTypeChecker(host) { minArgumentCount = parameters.length; } } - if ((declaration.kind === 177 /* GetAccessor */ || declaration.kind === 178 /* SetAccessor */) && hasBindableName(declaration) && (!hasThisParameter2 || !thisParameter)) { - const otherKind = declaration.kind === 177 /* GetAccessor */ ? 178 /* SetAccessor */ : 177 /* GetAccessor */; + if ((declaration.kind === 178 /* GetAccessor */ || declaration.kind === 179 /* SetAccessor */) && hasBindableName(declaration) && (!hasThisParameter2 || !thisParameter)) { + const otherKind = declaration.kind === 178 /* GetAccessor */ ? 179 /* SetAccessor */ : 178 /* GetAccessor */; const other = getDeclarationOfKind(getSymbolOfDeclaration(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); @@ -63306,15 +64178,15 @@ function createTypeChecker(host) { switch (node.kind) { case 80 /* Identifier */: return node.escapedText === argumentsSymbol.escapedName && getReferencedValueSymbol(node) === argumentsSymbol; - case 172 /* PropertyDeclaration */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - return node.name.kind === 167 /* ComputedPropertyName */ && traverse(node.name); - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 173 /* PropertyDeclaration */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + return node.name.kind === 168 /* ComputedPropertyName */ && traverse(node.name); + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: return traverse(node.expression); - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return traverse(node.initializer); default: return !nodeStartsNewLexicalEnvironment(node) && !isPartOfTypeNode(node) && !!forEachChild(node, traverse); @@ -63400,7 +64272,7 @@ function createTypeChecker(host) { function createTypePredicateFromTypePredicateNode(node, signature) { const parameterName = node.parameterName; const type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 197 /* ThisType */ ? createTypePredicate( + return parameterName.kind === 198 /* ThisType */ ? createTypePredicate( node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, /*parameterName*/ void 0, @@ -63445,7 +64317,7 @@ function createTypeChecker(host) { return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 176 /* Constructor */) { + if (declaration.kind === 177 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } const typeNode = getEffectiveReturnTypeNode(declaration); @@ -63461,12 +64333,12 @@ function createTypeChecker(host) { if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 177 /* GetAccessor */ && hasBindableName(declaration)) { + if (declaration.kind === 178 /* GetAccessor */ && hasBindableName(declaration)) { const jsDocType = isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - const setter = getDeclarationOfKind(getSymbolOfDeclaration(declaration), 178 /* SetAccessor */); + const setter = getDeclarationOfKind(getSymbolOfDeclaration(declaration), 179 /* SetAccessor */); const setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -63495,8 +64367,10 @@ function createTypeChecker(host) { if (returnSignature) { const newReturnSignature = cloneSignature(returnSignature); newReturnSignature.typeParameters = inferredTypeParameters; + const newReturnType = getOrCreateTypeFromSignature(newReturnSignature); + newReturnType.mapper = instantiatedSignature.mapper; const newInstantiatedSignature = cloneSignature(instantiatedSignature); - newInstantiatedSignature.resolvedReturnType = getOrCreateTypeFromSignature(newReturnSignature); + newInstantiatedSignature.resolvedReturnType = newReturnType; return newInstantiatedSignature; } } @@ -63546,12 +64420,6 @@ function createTypeChecker(host) { isInJSFile(signature.declaration) ); } - function getImplementationSignature(signature) { - return signature.typeParameters ? signature.implementationSignatureCache || (signature.implementationSignatureCache = createImplementationSignature(signature)) : signature; - } - function createImplementationSignature(signature) { - return signature.typeParameters ? instantiateSignature(signature, createTypeMapper([], [])) : signature; - } function getBaseSignature(signature) { const typeParameters = signature.typeParameters; if (typeParameters) { @@ -63574,22 +64442,12 @@ function createTypeChecker(host) { } return signature; } - function getOrCreateTypeFromSignature(signature, outerTypeParameters) { - var _a; + function getOrCreateTypeFromSignature(signature) { + var _a, _b; if (!signature.isolatedSignatureType) { const kind = (_a = signature.declaration) == null ? void 0 : _a.kind; - const isConstructor = kind === void 0 || kind === 176 /* Constructor */ || kind === 180 /* ConstructSignature */ || kind === 185 /* ConstructorType */; - const type = createObjectType(16 /* Anonymous */ | 134217728 /* SingleSignatureType */, createSymbol(16 /* Function */, "__function" /* Function */)); - if (signature.declaration && !nodeIsSynthesized(signature.declaration)) { - type.symbol.declarations = [signature.declaration]; - type.symbol.valueDeclaration = signature.declaration; - } - outerTypeParameters || (outerTypeParameters = signature.declaration && getOuterTypeParameters( - signature.declaration, - /*includeThisTypes*/ - true - )); - type.outerTypeParameters = outerTypeParameters; + const isConstructor = kind === void 0 || kind === 177 /* Constructor */ || kind === 181 /* ConstructSignature */ || kind === 186 /* ConstructorType */; + const type = createObjectType(16 /* Anonymous */ | 134217728 /* SingleSignatureType */, (_b = signature.declaration) == null ? void 0 : _b.symbol); type.members = emptySymbols; type.properties = emptyArray; type.callSignatures = !isConstructor ? [signature] : emptyArray; @@ -63680,9 +64538,9 @@ function createTypeChecker(host) { let inferences; if ((_a = typeParameter.symbol) == null ? void 0 : _a.declarations) { for (const declaration of typeParameter.symbol.declarations) { - if (declaration.parent.kind === 195 /* InferType */) { + if (declaration.parent.kind === 196 /* InferType */) { const [childTypeParameter = declaration.parent, grandParent] = walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent); - if (grandParent.kind === 183 /* TypeReference */ && !omitTypeReferences) { + if (grandParent.kind === 184 /* TypeReference */ && !omitTypeReferences) { const typeReference = grandParent; const typeParameters = getTypeParametersForTypeReferenceOrImport(typeReference); if (typeParameters) { @@ -63703,13 +64561,13 @@ function createTypeChecker(host) { } } } - } else if (grandParent.kind === 169 /* Parameter */ && grandParent.dotDotDotToken || grandParent.kind === 191 /* RestType */ || grandParent.kind === 202 /* NamedTupleMember */ && grandParent.dotDotDotToken) { + } else if (grandParent.kind === 170 /* Parameter */ && grandParent.dotDotDotToken || grandParent.kind === 192 /* RestType */ || grandParent.kind === 203 /* NamedTupleMember */ && grandParent.dotDotDotToken) { inferences = append(inferences, createArrayType(unknownType)); - } else if (grandParent.kind === 204 /* TemplateLiteralTypeSpan */) { + } else if (grandParent.kind === 205 /* TemplateLiteralTypeSpan */) { inferences = append(inferences, stringType); - } else if (grandParent.kind === 168 /* TypeParameter */ && grandParent.parent.kind === 200 /* MappedType */) { + } else if (grandParent.kind === 169 /* TypeParameter */ && grandParent.parent.kind === 201 /* MappedType */) { inferences = append(inferences, stringNumberSymbolType); - } else if (grandParent.kind === 200 /* MappedType */ && grandParent.type && skipParentheses(grandParent.type) === declaration.parent && grandParent.parent.kind === 194 /* ConditionalType */ && grandParent.parent.extendsType === grandParent && grandParent.parent.checkType.kind === 200 /* MappedType */ && grandParent.parent.checkType.type) { + } else if (grandParent.kind === 201 /* MappedType */ && grandParent.type && skipParentheses(grandParent.type) === declaration.parent && grandParent.parent.kind === 195 /* ConditionalType */ && grandParent.parent.extendsType === grandParent && grandParent.parent.checkType.kind === 201 /* MappedType */ && grandParent.parent.checkType.type) { const checkMappedType2 = grandParent.parent.checkType; const nodeType = getTypeFromTypeNode(checkMappedType2.type); inferences = append(inferences, instantiateType(nodeType, makeUnaryTypeMapper(getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(checkMappedType2.typeParameter)), checkMappedType2.typeParameter.constraint ? getTypeFromTypeNode(checkMappedType2.typeParameter.constraint) : stringNumberSymbolType))); @@ -63731,7 +64589,7 @@ function createTypeChecker(host) { } else { let type = getTypeFromTypeNode(constraintDeclaration); if (type.flags & 1 /* Any */ && !isErrorType(type)) { - type = constraintDeclaration.parent.parent.kind === 200 /* MappedType */ ? stringNumberSymbolType : unknownType; + type = constraintDeclaration.parent.parent.kind === 201 /* MappedType */ ? stringNumberSymbolType : unknownType; } typeParameter.constraint = type; } @@ -63740,7 +64598,7 @@ function createTypeChecker(host) { return typeParameter.constraint === noConstraintType ? void 0 : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - const tp = getDeclarationOfKind(typeParameter.symbol, 168 /* TypeParameter */); + const tp = getDeclarationOfKind(typeParameter.symbol, 169 /* TypeParameter */); const host2 = isJSDocTemplateTag(tp.parent) ? getEffectiveContainerForJSDocTemplateTag(tp.parent) : tp.parent; return host2 && getSymbolOfNode(host2); } @@ -63825,7 +64683,7 @@ function createTypeChecker(host) { return concatenate(type.target.outerTypeParameters, (_a = type.target.localTypeParameters) == null ? void 0 : _a.map(() => errorType)) || emptyArray; } const node = type.node; - const typeArguments = !node ? emptyArray : node.kind === 183 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode); + const typeArguments = !node ? emptyArray : node.kind === 184 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 189 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments ?? (type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments); } else { @@ -63864,7 +64722,7 @@ function createTypeChecker(host) { return errorType; } } - if (node.kind === 183 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 184 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference( type, node, @@ -63959,9 +64817,9 @@ function createTypeChecker(host) { } function getTypeReferenceName(node) { switch (node.kind) { - case 183 /* TypeReference */: + case 184 /* TypeReference */: return node.typeName; - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: const expr = node.expression; if (isEntityNameExpression(expr)) { return expr; @@ -63973,10 +64831,10 @@ function createTypeChecker(host) { return symbol.parent ? `${getSymbolPath(symbol.parent)}.${symbol.escapedName}` : symbol.escapedName; } function getUnresolvedSymbolForEntityName(name) { - const identifier = name.kind === 166 /* QualifiedName */ ? name.right : name.kind === 211 /* PropertyAccessExpression */ ? name.name : name; + const identifier = name.kind === 167 /* QualifiedName */ ? name.right : name.kind === 212 /* PropertyAccessExpression */ ? name.name : name; const text = identifier.escapedText; if (text) { - const parentSymbol = name.kind === 166 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) : name.kind === 211 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) : void 0; + const parentSymbol = name.kind === 167 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) : name.kind === 212 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) : void 0; const path = parentSymbol ? `${getSymbolPath(parentSymbol)}.${text}` : text; let result = unresolvedSymbols.get(path); if (!result) { @@ -64028,7 +64886,7 @@ function createTypeChecker(host) { const valueType = getTypeOfSymbol(symbol); let typeType = valueType; if (symbol.valueDeclaration) { - const isImportTypeWithQualifier = node.kind === 205 /* ImportType */ && node.qualifier; + const isImportTypeWithQualifier = node.kind === 206 /* ImportType */ && node.qualifier; if (valueType.symbol && valueType.symbol !== symbol && isImportTypeWithQualifier) { typeType = getTypeReferenceType(node, valueType.symbol); } @@ -64065,7 +64923,7 @@ function createTypeChecker(host) { return isNoInferType(substitutionType) ? substitutionType.baseType : getIntersectionType([substitutionType.constraint, substitutionType.baseType]); } function isUnaryTupleTypeNode(node) { - return node.kind === 189 /* TupleType */ && node.elements.length === 1; + return node.kind === 190 /* TupleType */ && node.elements.length === 1; } function getImpliedConstraint(type, checkNode, extendsNode) { return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elements[0], extendsNode.elements[0]) : getActualTypeVariable(getTypeFromTypeNode(checkNode)) === getActualTypeVariable(type) ? getTypeFromTypeNode(extendsNode) : void 0; @@ -64073,17 +64931,17 @@ function createTypeChecker(host) { function getConditionalFlowTypeOfType(type, node) { let constraints; let covariant = true; - while (node && !isStatement(node) && node.kind !== 320 /* JSDoc */) { + while (node && !isStatement(node) && node.kind !== 321 /* JSDoc */) { const parent2 = node.parent; - if (parent2.kind === 169 /* Parameter */) { + if (parent2.kind === 170 /* Parameter */) { covariant = !covariant; } - if ((covariant || type.flags & 8650752 /* TypeVariable */) && parent2.kind === 194 /* ConditionalType */ && node === parent2.trueType) { + if ((covariant || type.flags & 8650752 /* TypeVariable */) && parent2.kind === 195 /* ConditionalType */ && node === parent2.trueType) { const constraint = getImpliedConstraint(type, parent2.checkType, parent2.extendsType); if (constraint) { constraints = append(constraints, constraint); } - } else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 200 /* MappedType */ && !parent2.nameType && node === parent2.type) { + } else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 201 /* MappedType */ && !parent2.nameType && node === parent2.type) { const mappedType = getTypeFromTypeNode(parent2); if (getTypeParameterFromMappedType(mappedType) === getActualTypeVariable(type)) { const typeParameter = getHomomorphicTypeVariable(mappedType); @@ -64100,7 +64958,7 @@ function createTypeChecker(host) { return constraints ? getSubstitutionType(type, getIntersectionType(constraints)) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 16777216 /* JSDoc */) && (node.kind === 183 /* TypeReference */ || node.kind === 205 /* ImportType */); + return !!(node.flags & 16777216 /* JSDoc */) && (node.kind === 184 /* TypeReference */ || node.kind === 206 /* ImportType */); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -64226,9 +65084,9 @@ function createTypeChecker(host) { if (declarations) { for (const declaration of declarations) { switch (declaration.kind) { - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: return declaration; } } @@ -64659,11 +65517,11 @@ function createTypeChecker(host) { } function getTupleElementFlags(node) { switch (node.kind) { - case 190 /* OptionalType */: + case 191 /* OptionalType */: return 2 /* Optional */; - case 191 /* RestType */: + case 192 /* RestType */: return getRestTypeElementFlags(node); - case 202 /* NamedTupleMember */: + case 203 /* NamedTupleMember */: return node.questionToken ? 2 /* Optional */ : node.dotDotDotToken ? getRestTypeElementFlags(node) : 1 /* Required */; default: return 1 /* Required */; @@ -64685,51 +65543,51 @@ function createTypeChecker(host) { return isNamedTupleMember(member) || isParameter(member) ? member : void 0; } function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 188 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 189 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias)); + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 189 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 190 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias)); } function isResolvedByTypeAlias(node) { const parent2 = node.parent; switch (parent2.kind) { - case 196 /* ParenthesizedType */: - case 202 /* NamedTupleMember */: - case 183 /* TypeReference */: - case 192 /* UnionType */: - case 193 /* IntersectionType */: - case 199 /* IndexedAccessType */: - case 194 /* ConditionalType */: - case 198 /* TypeOperator */: - case 188 /* ArrayType */: - case 189 /* TupleType */: + case 197 /* ParenthesizedType */: + case 203 /* NamedTupleMember */: + case 184 /* TypeReference */: + case 193 /* UnionType */: + case 194 /* IntersectionType */: + case 200 /* IndexedAccessType */: + case 195 /* ConditionalType */: + case 199 /* TypeOperator */: + case 189 /* ArrayType */: + case 190 /* TupleType */: return isResolvedByTypeAlias(parent2); - case 265 /* TypeAliasDeclaration */: + case 266 /* TypeAliasDeclaration */: return true; } return false; } function mayResolveTypeAlias(node) { switch (node.kind) { - case 183 /* TypeReference */: + case 184 /* TypeReference */: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node, 788968 /* Type */).flags & 524288 /* TypeAlias */); - case 186 /* TypeQuery */: + case 187 /* TypeQuery */: return true; - case 198 /* TypeOperator */: + case 199 /* TypeOperator */: return node.operator !== 158 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); - case 196 /* ParenthesizedType */: - case 190 /* OptionalType */: - case 202 /* NamedTupleMember */: - case 316 /* JSDocOptionalType */: - case 314 /* JSDocNullableType */: - case 315 /* JSDocNonNullableType */: - case 309 /* JSDocTypeExpression */: + case 197 /* ParenthesizedType */: + case 191 /* OptionalType */: + case 203 /* NamedTupleMember */: + case 317 /* JSDocOptionalType */: + case 315 /* JSDocNullableType */: + case 316 /* JSDocNonNullableType */: + case 310 /* JSDocTypeExpression */: return mayResolveTypeAlias(node.type); - case 191 /* RestType */: - return node.type.kind !== 188 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); - case 192 /* UnionType */: - case 193 /* IntersectionType */: + case 192 /* RestType */: + return node.type.kind !== 189 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); + case 193 /* UnionType */: + case 194 /* IntersectionType */: return some(node.types, mayResolveTypeAlias); - case 199 /* IndexedAccessType */: + case 200 /* IndexedAccessType */: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 194 /* ConditionalType */: + case 195 /* ConditionalType */: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } return false; @@ -64740,15 +65598,15 @@ function createTypeChecker(host) { const target = getArrayOrTupleTargetType(node); if (target === emptyGenericType) { links.resolvedType = emptyObjectType; - } else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 189 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference( + } else if (!(node.kind === 190 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) { + links.resolvedType = node.kind === 190 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference( target, node, /*mapper*/ void 0 ); } else { - const elementTypes = node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode); + const elementTypes = node.kind === 189 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode); links.resolvedType = createNormalizedTypeReference(target, elementTypes); } } @@ -65835,7 +66693,7 @@ function createTypeChecker(host) { return true; } function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, accessNode, accessFlags) { - const accessExpression = accessNode && accessNode.kind === 212 /* ElementAccessExpression */ ? accessNode : void 0; + const accessExpression = accessNode && accessNode.kind === 213 /* ElementAccessExpression */ ? accessNode : void 0; const propName = accessNode && isPrivateIdentifier(accessNode) ? void 0 : getPropertyNameFromIndex(indexType, accessNode); if (propName !== void 0) { if (accessFlags & 256 /* Contextual */) { @@ -66032,7 +66890,7 @@ function createTypeChecker(host) { } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 212 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.kind === 199 /* IndexedAccessType */ ? accessNode.indexType : accessNode.kind === 167 /* ComputedPropertyName */ ? accessNode.expression : accessNode; + return accessNode.kind === 213 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.kind === 200 /* IndexedAccessType */ ? accessNode.indexType : accessNode.kind === 168 /* ComputedPropertyName */ ? accessNode.expression : accessNode; } function isPatternLiteralPlaceholderType(type) { if (type.flags & 2097152 /* Intersection */) { @@ -66193,7 +67051,7 @@ function createTypeChecker(host) { indexType = stringType; } if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */) accessFlags |= 1 /* IncludeUndefined */; - if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 199 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, getTotalFixedElementCount(objectType.target)) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, getTotalFixedElementCount(objectType.target))) || isGenericReducibleType(objectType))) { + if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 200 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, getTotalFixedElementCount(objectType.target)) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, getTotalFixedElementCount(objectType.target))) || isGenericReducibleType(objectType))) { if (objectType.flags & 3 /* AnyOrUnknown */) { return objectType; } @@ -66759,7 +67617,7 @@ function createTypeChecker(host) { false ); const parent2 = container && container.parent; - if (parent2 && (isClassLike(parent2) || parent2.kind === 264 /* InterfaceDeclaration */)) { + if (parent2 && (isClassLike(parent2) || parent2.kind === 265 /* InterfaceDeclaration */)) { if (!isStatic(container) && (!isConstructorDeclaration(container) || isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(parent2)).thisType; } @@ -66789,17 +67647,17 @@ function createTypeChecker(host) { } function getArrayElementTypeNode(node) { switch (node.kind) { - case 196 /* ParenthesizedType */: + case 197 /* ParenthesizedType */: return getArrayElementTypeNode(node.type); - case 189 /* TupleType */: + case 190 /* TupleType */: if (node.elements.length === 1) { node = node.elements[0]; - if (node.kind === 191 /* RestType */ || node.kind === 202 /* NamedTupleMember */ && node.dotDotDotToken) { + if (node.kind === 192 /* RestType */ || node.kind === 203 /* NamedTupleMember */ && node.dotDotDotToken) { return getArrayElementTypeNode(node.type); } } break; - case 188 /* ArrayType */: + case 189 /* ArrayType */: return node.elementType; } return void 0; @@ -66819,8 +67677,8 @@ function createTypeChecker(host) { function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 133 /* AnyKeyword */: - case 312 /* JSDocAllType */: - case 313 /* JSDocUnknownType */: + case 313 /* JSDocAllType */: + case 314 /* JSDocUnknownType */: return anyType; case 159 /* UnknownKeyword */: return unknownType; @@ -66846,69 +67704,69 @@ function createTypeChecker(host) { return node.flags & 524288 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType; case 141 /* IntrinsicKeyword */: return intrinsicMarkerType; - case 197 /* ThisType */: + case 198 /* ThisType */: case 110 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 201 /* LiteralType */: + case 202 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 183 /* TypeReference */: + case 184 /* TypeReference */: return getTypeFromTypeReference(node); - case 182 /* TypePredicate */: + case 183 /* TypePredicate */: return node.assertsModifier ? voidType : booleanType; - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 186 /* TypeQuery */: + case 187 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 188 /* ArrayType */: - case 189 /* TupleType */: + case 189 /* ArrayType */: + case 190 /* TupleType */: return getTypeFromArrayOrTupleTypeNode(node); - case 190 /* OptionalType */: + case 191 /* OptionalType */: return getTypeFromOptionalTypeNode(node); - case 192 /* UnionType */: + case 193 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 193 /* IntersectionType */: + case 194 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 314 /* JSDocNullableType */: + case 315 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 316 /* JSDocOptionalType */: + case 317 /* JSDocOptionalType */: return addOptionality(getTypeFromTypeNode(node.type)); - case 202 /* NamedTupleMember */: + case 203 /* NamedTupleMember */: return getTypeFromNamedTupleTypeNode(node); - case 196 /* ParenthesizedType */: - case 315 /* JSDocNonNullableType */: - case 309 /* JSDocTypeExpression */: + case 197 /* ParenthesizedType */: + case 316 /* JSDocNonNullableType */: + case 310 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 191 /* RestType */: + case 192 /* RestType */: return getTypeFromRestTypeNode(node); - case 318 /* JSDocVariadicType */: + case 319 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 187 /* TypeLiteral */: - case 322 /* JSDocTypeLiteral */: - case 317 /* JSDocFunctionType */: - case 323 /* JSDocSignature */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 188 /* TypeLiteral */: + case 323 /* JSDocTypeLiteral */: + case 318 /* JSDocFunctionType */: + case 324 /* JSDocSignature */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 198 /* TypeOperator */: + case 199 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 199 /* IndexedAccessType */: + case 200 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 200 /* MappedType */: + case 201 /* MappedType */: return getTypeFromMappedTypeNode(node); - case 194 /* ConditionalType */: + case 195 /* ConditionalType */: return getTypeFromConditionalTypeNode(node); - case 195 /* InferType */: + case 196 /* InferType */: return getTypeFromInferTypeNode(node); - case 203 /* TemplateLiteralType */: + case 204 /* TemplateLiteralType */: return getTypeFromTemplateTypeNode(node); - case 205 /* ImportType */: + case 206 /* ImportType */: return getTypeFromImportTypeNode(node); // This function assumes that an identifier, qualified name, or property access expression is a type expression // Callers should first ensure this by calling `isPartOfTypeNode` // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s. case 80 /* Identifier */: - case 166 /* QualifiedName */: - case 211 /* PropertyAccessExpression */: + case 167 /* QualifiedName */: + case 212 /* PropertyAccessExpression */: const symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -67002,6 +67860,9 @@ function createTypeChecker(host) { const forwardInferences = context.inferences.slice(index); return createTypeMapper(map(forwardInferences, (i) => i.typeParameter), map(forwardInferences, () => unknownType)); } + function createOuterReturnMapper(context) { + return context.outerReturnMapper ?? (context.outerReturnMapper = mergeTypeMappers(context.returnMapper, cloneInferenceContext(context).mapper)); + } function combineTypeMappers(mapper1, mapper2) { return mapper1 ? makeCompositeTypeMapper(4 /* Composite */, mapper1, mapper2) : mapper2; } @@ -67081,7 +67942,7 @@ function createTypeChecker(host) { const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags & 8388608 /* InstantiationExpressionType */ ? type.node : type.symbol.declarations[0]; const links = getNodeLinks(declaration); const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags & 64 /* Instantiated */ ? type.target : type; - let typeParameters = type.objectFlags & 134217728 /* SingleSignatureType */ ? type.outerTypeParameters : links.outerTypeParameters; + let typeParameters = links.outerTypeParameters; if (!typeParameters) { let outerTypeParameters = getOuterTypeParameters( declaration, @@ -67102,19 +67963,17 @@ function createTypeChecker(host) { const typeArguments = map(typeParameters, (t) => getMappedType(t, combinedMapper)); const newAliasSymbol = aliasSymbol || type.aliasSymbol; const newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper); - const id = (type.objectFlags & 134217728 /* SingleSignatureType */ ? "S" : "") + getTypeListId(typeArguments) + getAliasId(newAliasSymbol, newAliasTypeArguments); + const id = getTypeListId(typeArguments) + getAliasId(newAliasSymbol, newAliasTypeArguments); if (!target.instantiations) { target.instantiations = /* @__PURE__ */ new Map(); target.instantiations.set(getTypeListId(typeParameters) + getAliasId(target.aliasSymbol, target.aliasTypeArguments), target); } let result = target.instantiations.get(id); if (!result) { - if (type.objectFlags & 134217728 /* SingleSignatureType */) { - result = instantiateAnonymousType(type, mapper); - target.instantiations.set(id, result); - return result; + let newMapper = createTypeMapper(typeParameters, typeArguments); + if (target.objectFlags & 134217728 /* SingleSignatureType */ && mapper) { + newMapper = combineTypeMappers(newMapper, mapper); } - const newMapper = createTypeMapper(typeParameters, typeArguments); result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments); target.instantiations.set(id, result); const resultObjectFlags = getObjectFlags(result); @@ -67134,13 +67993,13 @@ function createTypeChecker(host) { return type; } function maybeTypeParameterReference(node) { - return !(node.parent.kind === 183 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || node.parent.kind === 205 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.parent.kind === 184 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || node.parent.kind === 206 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { const container = tp.symbol.declarations[0].parent; for (let n = node; n !== container; n = n.parent) { - if (!n || n.kind === 241 /* Block */ || n.kind === 194 /* ConditionalType */ && forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 242 /* Block */ || n.kind === 195 /* ConditionalType */ && forEachChild(n.extendsType, containsReference)) { return true; } } @@ -67149,18 +68008,18 @@ function createTypeChecker(host) { return true; function containsReference(node2) { switch (node2.kind) { - case 197 /* ThisType */: + case 198 /* ThisType */: return !!tp.isThisType; case 80 /* Identifier */: return !tp.isThisType && isPartOfTypeNode(node2) && maybeTypeParameterReference(node2) && getTypeFromTypeNodeWorker(node2) === tp; // use worker because we're looking for === equality - case 186 /* TypeQuery */: + case 187 /* TypeQuery */: const entityName = node2.exprName; const firstIdentifier = getFirstIdentifier(entityName); if (!isThisIdentifier(firstIdentifier)) { const firstIdentifierSymbol = getResolvedSymbol(firstIdentifier); const tpDeclaration = tp.symbol.declarations[0]; - const tpScope = tpDeclaration.kind === 168 /* TypeParameter */ ? tpDeclaration.parent : ( + const tpScope = tpDeclaration.kind === 169 /* TypeParameter */ ? tpDeclaration.parent : ( // Type parameter is a regular type parameter, e.g. foo tp.isThisType ? tpDeclaration : ( // Type parameter is the this type, and its declaration is the class declaration. @@ -67172,8 +68031,8 @@ function createTypeChecker(host) { } } return true; - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: return !node2.type && !!node2.body || some(node2.typeParameters, containsReference) || some(node2.parameters, containsReference) || !!node2.type && containsReference(node2.type); } return !!forEachChild(node2, containsReference); @@ -67267,9 +68126,6 @@ function createTypeChecker(host) { if (type.objectFlags & 8388608 /* InstantiationExpressionType */) { result.node = type.node; } - if (type.objectFlags & 134217728 /* SingleSignatureType */) { - result.outerTypeParameters = type.outerTypeParameters; - } result.target = type; result.mapper = mapper; result.aliasSymbol = aliasSymbol || type.aliasSymbol; @@ -67314,10 +68170,25 @@ function createTypeChecker(host) { error2(currentNode, Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); return errorType; } + const index = findActiveMapper(mapper); + if (index === -1) { + pushActiveMapper(mapper); + } + const key = type.id + getAliasId(aliasSymbol, aliasTypeArguments); + const mapperCache = activeTypeMappersCaches[index !== -1 ? index : activeTypeMappersCount - 1]; + const cached = mapperCache.get(key); + if (cached) { + return cached; + } totalInstantiationCount++; instantiationCount++; instantiationDepth++; const result = instantiateTypeWorker(type, mapper, aliasSymbol, aliasTypeArguments); + if (index === -1) { + popActiveMapper(); + } else { + mapperCache.set(key, result); + } instantiationDepth--; return result; } @@ -67437,32 +68308,32 @@ function createTypeChecker(host) { return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration, info.components); } function isContextSensitive(node) { - Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node)); + Debug.assert(node.kind !== 175 /* MethodDeclaration */ || isObjectLiteralMethod(node)); switch (node.kind) { - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: - case 262 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: + case 263 /* FunctionDeclaration */: return isContextSensitiveFunctionLikeDeclaration(node); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return some(node.properties, isContextSensitive); - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return some(node.elements, isContextSensitive); - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return (node.operatorToken.kind === 57 /* BarBarToken */ || node.operatorToken.kind === 61 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 292 /* JsxAttributes */: + case 293 /* JsxAttributes */: return some(node.properties, isContextSensitive) || isJsxOpeningElement(node.parent) && some(node.parent.parent.children, isContextSensitive); - case 291 /* JsxAttribute */: { + case 292 /* JsxAttribute */: { const { initializer } = node; return !!initializer && isContextSensitive(initializer); } - case 294 /* JsxExpression */: { + case 295 /* JsxExpression */: { const { expression } = node; return !!expression && isContextSensitive(expression); } @@ -67476,7 +68347,7 @@ function createTypeChecker(host) { if (node.typeParameters || getEffectiveReturnTypeNode(node) || !node.body) { return false; } - if (node.body.kind !== 241 /* Block */) { + if (node.body.kind !== 242 /* Block */) { return isContextSensitive(node.body); } return !!forEachReturnStatement(node.body, (statement) => !!statement.expression && isContextSensitive(statement.expression)); @@ -67569,28 +68440,28 @@ function createTypeChecker(host) { return true; } switch (node.kind) { - case 234 /* AsExpression */: + case 235 /* AsExpression */: if (!isConstAssertion(node)) { break; } // fallthrough - case 294 /* JsxExpression */: - case 217 /* ParenthesizedExpression */: + case 295 /* JsxExpression */: + case 218 /* ParenthesizedExpression */: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: switch (node.operatorToken.kind) { case 64 /* EqualsToken */: case 28 /* CommaToken */: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 292 /* JsxAttributes */: + case 293 /* JsxAttributes */: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -67895,16 +68766,16 @@ function createTypeChecker(host) { } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 294 /* JsxExpression */: + case 295 /* JsxExpression */: return { errorNode: child, innerExpression: child.expression, nameType }; case 12 /* JsxText */: if (child.containsOnlyTriviaWhiteSpaces) { break; } return { errorNode: child, innerExpression: void 0, nameType, errorMessage: getInvalidTextDiagnostic() }; - case 284 /* JsxElement */: - case 285 /* JsxSelfClosingElement */: - case 288 /* JsxFragment */: + case 285 /* JsxElement */: + case 286 /* JsxSelfClosingElement */: + case 289 /* JsxFragment */: return { errorNode: child, innerExpression: child, nameType }; default: return Debug.assertNever(child, "Found invalid jsx child"); @@ -68042,13 +68913,13 @@ function createTypeChecker(host) { continue; } switch (prop.kind) { - case 178 /* SetAccessor */: - case 177 /* GetAccessor */: - case 174 /* MethodDeclaration */: - case 304 /* ShorthandPropertyAssignment */: + case 179 /* SetAccessor */: + case 178 /* GetAccessor */: + case 175 /* MethodDeclaration */: + case 305 /* ShorthandPropertyAssignment */: yield { errorNode: prop.name, innerExpression: void 0, nameType: type }; break; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: yield { errorNode: prop.name, innerExpression: prop.initializer, nameType: type, errorMessage: isComputedNonLiteralName(prop.name) ? Diagnostics.Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1 : void 0 }; break; default: @@ -68122,7 +68993,7 @@ function createTypeChecker(host) { void instantiateType(sourceRestType || targetRestType, reportUnreliableMarkers); } const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - const strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 174 /* MethodDeclaration */ && kind !== 173 /* MethodSignature */ && kind !== 176 /* Constructor */; + const strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 175 /* MethodDeclaration */ && kind !== 174 /* MethodSignature */ && kind !== 177 /* Constructor */; let result = -1 /* True */; const sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -68303,8 +69174,8 @@ function createTypeChecker(host) { enumRelation.set(id, 2 /* Failed */); return false; } - const sourceValue = getEnumMemberValue(getDeclarationOfKind(sourceProperty, 306 /* EnumMember */)).value; - const targetValue = getEnumMemberValue(getDeclarationOfKind(targetProperty, 306 /* EnumMember */)).value; + const sourceValue = getEnumMemberValue(getDeclarationOfKind(sourceProperty, 307 /* EnumMember */)).value; + const targetValue = getEnumMemberValue(getDeclarationOfKind(targetProperty, 307 /* EnumMember */)).value; if (sourceValue !== targetValue) { const sourceIsString = typeof sourceValue === "string"; const targetIsString = typeof targetValue === "string"; @@ -69635,6 +70506,36 @@ function createTypeChecker(host) { } } } + if (sourceFlags & 134217728 /* TemplateLiteral */) { + if (arrayIsEqualTo(source2.texts, target2.texts)) { + const sourceTypes = source2.types; + const targetTypes = target2.types; + result2 = -1 /* True */; + for (let i = 0; i < sourceTypes.length; i++) { + if (!(result2 &= isRelatedTo( + sourceTypes[i], + targetTypes[i], + 3 /* Both */, + /*reportErrors*/ + false + ))) { + break; + } + } + return result2; + } + } + if (sourceFlags & 268435456 /* StringMapping */) { + if (source2.symbol === target2.symbol) { + return isRelatedTo( + source2.type, + target2.type, + 3 /* Both */, + /*reportErrors*/ + false + ); + } + } if (!(sourceFlags & 524288 /* Object */)) { return 0 /* False */; } @@ -70214,6 +71115,9 @@ function createTypeChecker(host) { false, targetIsOptional ); + if (effectiveTarget.flags & (relation === strictSubtypeRelation ? 1 /* Any */ : 3 /* AnyOrUnknown */)) { + return -1 /* True */; + } const effectiveSource = getTypeOfSourceProperty(sourceProp); return isRelatedTo( effectiveSource, @@ -70556,7 +71460,7 @@ function createTypeChecker(host) { const sourceSignature = first(sourceSignatures); const targetSignature = first(targetSignatures); result2 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, intersectionState, incompatibleReporter(sourceSignature, targetSignature)); - if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a2 = targetSignature.declaration) == null ? void 0 : _a2.kind) === 176 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 176 /* Constructor */)) { + if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a2 = targetSignature.declaration) == null ? void 0 : _a2.kind) === 177 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 177 /* Constructor */)) { const constructSignatureToString = (signature) => signatureToString( signature, /*enclosingDeclaration*/ @@ -70829,10 +71733,12 @@ function createTypeChecker(host) { for (let i = 0; i < types.length; i++) { if (include[i]) { const targetType = getTypeOfPropertyOrIndexSignatureOfType(types[i], propertyName); - if (targetType && someType(getDiscriminatingType(), (t) => !!related(t, targetType))) { - matched = true; - } else { - include[i] = 3 /* Maybe */; + if (targetType) { + if (someType(getDiscriminatingType(), (t) => !!related(t, targetType))) { + matched = true; + } else { + include[i] = 3 /* Maybe */; + } } } } @@ -71215,9 +72121,13 @@ function createTypeChecker(host) { return types[0]; } const primaryTypes = strictNullChecks ? sameMap(types, (t) => filterType(t, (u) => !(u.flags & 98304 /* Nullable */))) : types; - const superTypeOrUnion = literalTypesWithSameBaseType(primaryTypes) ? getUnionType(primaryTypes) : reduceLeft(primaryTypes, (s, t) => isTypeSubtypeOf(s, t) ? t : s); + const superTypeOrUnion = literalTypesWithSameBaseType(primaryTypes) ? getUnionType(primaryTypes) : getSingleCommonSupertype(primaryTypes); return primaryTypes === types ? superTypeOrUnion : getNullableType(superTypeOrUnion, getCombinedTypeFlags(types) & 98304 /* Nullable */); } + function getSingleCommonSupertype(types) { + const candidate = reduceLeft(types, (s, t) => isTypeStrictSubtypeOf(s, t) ? t : s); + return every(types, (t) => t === candidate || isTypeStrictSubtypeOf(t, candidate)) ? candidate : reduceLeft(types, (s, t) => isTypeSubtypeOf(s, t) ? t : s); + } function getCommonSubtype(types) { return reduceLeft(types, (s, t) => isTypeSubtypeOf(t, s) ? t : s); } @@ -71253,7 +72163,7 @@ function createTypeChecker(host) { const target = type.target; if (getObjectFlags(target) & 1 /* Class */) { const baseTypeNode = getBaseTypeNodeOfClass(target); - if (baseTypeNode && baseTypeNode.expression.kind !== 80 /* Identifier */ && baseTypeNode.expression.kind !== 211 /* PropertyAccessExpression */) { + if (baseTypeNode && baseTypeNode.expression.kind !== 80 /* Identifier */ && baseTypeNode.expression.kind !== 212 /* PropertyAccessExpression */) { return void 0; } } @@ -71652,12 +72562,12 @@ function createTypeChecker(host) { } let diagnostic; switch (declaration.kind) { - case 226 /* BinaryExpression */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: + case 227 /* BinaryExpression */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: diagnostic = noImplicitAny ? Diagnostics.Member_0_implicitly_has_an_1_type : Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 169 /* Parameter */: + case 170 /* Parameter */: const param = declaration; if (isIdentifier(param.name)) { const originalKeywordKind = identifierToKeywordKind(param.name); @@ -71678,27 +72588,27 @@ function createTypeChecker(host) { } diagnostic = declaration.dotDotDotToken ? noImplicitAny ? Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? Diagnostics.Parameter_0_implicitly_has_an_1_type : Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 208 /* BindingElement */: + case 209 /* BindingElement */: diagnostic = Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { return; } break; - case 317 /* JSDocFunctionType */: + case 318 /* JSDocFunctionType */: error2(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 323 /* JSDocSignature */: + case 324 /* JSDocSignature */: if (noImplicitAny && isJSDocOverloadTag(declaration.parent)) { error2(declaration.parent.tagName, Diagnostics.This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation, typeAsString); } return; - case 262 /* FunctionDeclaration */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: if (noImplicitAny && !declaration.name) { if (wideningKind === 3 /* GeneratorYield */) { error2(declaration, Diagnostics.Generator_implicitly_has_yield_type_0_Consider_supplying_a_return_type_annotation, typeAsString); @@ -71709,7 +72619,7 @@ function createTypeChecker(host) { } diagnostic = !noImplicitAny ? Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage : wideningKind === 3 /* GeneratorYield */ ? Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 200 /* MappedType */: + case 201 /* MappedType */: if (noImplicitAny) { error2(declaration, Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -71848,7 +72758,7 @@ function createTypeChecker(host) { function inferFromIntraExpressionSites(context) { if (context.intraExpressionInferenceSites) { for (const { node, type } of context.intraExpressionInferenceSites) { - const contextualType = node.kind === 174 /* MethodDeclaration */ ? getContextualTypeForObjectLiteralMethod(node, 2 /* NoConstraints */) : getContextualType2(node, 2 /* NoConstraints */); + const contextualType = node.kind === 175 /* MethodDeclaration */ ? getContextualTypeForObjectLiteralMethod(node, 2 /* NoConstraints */) : getContextualType2(node, 2 /* NoConstraints */); if (contextualType) { inferTypes(context.inferences, type, contextualType); } @@ -71892,7 +72802,7 @@ function createTypeChecker(host) { if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) { return !!(objectFlags & 1048576 /* CouldContainTypeVariables */); } - const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 134217728 /* SingleSignatureType */ && !!length(type.outerTypeParameters) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables)); + const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables)); if (type.flags & 3899393 /* ObjectFlagsType */) { type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0); } @@ -71900,8 +72810,8 @@ function createTypeChecker(host) { } function isNonGenericTopLevelType(type) { if (type.aliasSymbol && !type.aliasTypeArguments) { - const declaration = getDeclarationOfKind(type.aliasSymbol, 265 /* TypeAliasDeclaration */); - return !!(declaration && findAncestor(declaration.parent, (n) => n.kind === 307 /* SourceFile */ ? true : n.kind === 267 /* ModuleDeclaration */ ? false : "quit")); + const declaration = getDeclarationOfKind(type.aliasSymbol, 266 /* TypeAliasDeclaration */); + return !!(declaration && findAncestor(declaration.parent, (n) => n.kind === 308 /* SourceFile */ ? true : n.kind === 268 /* ModuleDeclaration */ ? false : "quit")); } return false; } @@ -72123,7 +73033,7 @@ function createTypeChecker(host) { value, /*roundTripOnly*/ false - ) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target)); + ) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(source, target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target)); } if (source.flags & 134217728 /* TemplateLiteral */) { const texts = source.texts; @@ -72193,9 +73103,6 @@ function createTypeChecker(host) { pos = p; } } - function isTupleOfSelf(typeParameter, type) { - return isTupleType(type) && getTupleElementType(type, 0) === getIndexedAccessType(typeParameter, getNumberLiteralType(0)) && !getTypeOfPropertyOfType(type, "1"); - } function inferTypes(inferences, originalSource, originalTarget, priority = 0 /* None */, contravariant = false) { let bivariant = false; let propagationType; @@ -72281,9 +73188,6 @@ function createTypeChecker(host) { inference.priority = priority; } if (priority === inference.priority) { - if (isTupleOfSelf(inference.typeParameter, candidate)) { - return; - } if (contravariant && !bivariant) { if (!contains(inference.contraCandidates, candidate)) { inference.contraCandidates = append(inference.contraCandidates, candidate); @@ -72760,7 +73664,7 @@ function createTypeChecker(host) { if (!(source.flags & 64 /* IsNonInferrable */)) { const saveBivariant = bivariant; const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - bivariant = bivariant || kind === 174 /* MethodDeclaration */ || kind === 173 /* MethodSignature */ || kind === 176 /* Constructor */; + bivariant = bivariant || kind === 175 /* MethodDeclaration */ || kind === 174 /* MethodSignature */ || kind === 177 /* Constructor */; applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes); bivariant = saveBivariant; } @@ -72864,6 +73768,7 @@ function createTypeChecker(host) { inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint; } } + clearActiveMapperCaches(); } return inference.inferredType; } @@ -72921,7 +73826,7 @@ function createTypeChecker(host) { } // falls through default: - if (node.parent.kind === 304 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 305 /* ShorthandPropertyAssignment */) { return Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { return Diagnostics.Cannot_find_name_0; @@ -72956,14 +73861,14 @@ function createTypeChecker(host) { // falls through case 110 /* ThisKeyword */: return `0|${flowContainer ? getNodeId(flowContainer) : "-1"}|${getTypeId(declaredType)}|${getTypeId(initialType)}`; - case 235 /* NonNullExpression */: - case 217 /* ParenthesizedExpression */: + case 236 /* NonNullExpression */: + case 218 /* ParenthesizedExpression */: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: const left = getFlowCacheKey(node.left, declaredType, initialType, flowContainer); return left && `${left}.${node.right.escapedText}`; - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: const propName = getAccessedPropertyName(node); if (propName !== void 0) { const key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); @@ -72977,27 +73882,27 @@ function createTypeChecker(host) { } } break; - case 206 /* ObjectBindingPattern */: - case 207 /* ArrayBindingPattern */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: + case 207 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: return `${getNodeId(node)}#${getTypeId(declaredType)}`; } return void 0; } function isMatchingReference(source, target) { switch (target.kind) { - case 217 /* ParenthesizedExpression */: - case 235 /* NonNullExpression */: + case 218 /* ParenthesizedExpression */: + case 236 /* NonNullExpression */: return isMatchingReference(source, target.expression); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return isAssignmentExpression(target) && isMatchingReference(source, target.left) || isBinaryExpression(target) && target.operatorToken.kind === 28 /* CommaToken */ && isMatchingReference(source, target.right); } switch (source.kind) { - case 236 /* MetaProperty */: - return target.kind === 236 /* MetaProperty */ && source.keywordToken === target.keywordToken && source.name.escapedText === target.name.escapedText; + case 237 /* MetaProperty */: + return target.kind === 237 /* MetaProperty */ && source.keywordToken === target.keywordToken && source.name.escapedText === target.name.escapedText; case 80 /* Identifier */: case 81 /* PrivateIdentifier */: return isThisInTypeQuery(source) ? target.kind === 110 /* ThisKeyword */ : target.kind === 80 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || (isVariableDeclaration(target) || isBindingElement(target)) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfDeclaration(target); @@ -73005,12 +73910,12 @@ function createTypeChecker(host) { return target.kind === 110 /* ThisKeyword */; case 108 /* SuperKeyword */: return target.kind === 108 /* SuperKeyword */; - case 235 /* NonNullExpression */: - case 217 /* ParenthesizedExpression */: - case 238 /* SatisfiesExpression */: + case 236 /* NonNullExpression */: + case 218 /* ParenthesizedExpression */: + case 239 /* SatisfiesExpression */: return isMatchingReference(source.expression, target); - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: const sourcePropertyName = getAccessedPropertyName(source); if (sourcePropertyName !== void 0) { const targetPropertyName = isAccessExpression(target) ? getAccessedPropertyName(target) : void 0; @@ -73025,9 +73930,9 @@ function createTypeChecker(host) { } } break; - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: return isAccessExpression(target) && source.right.escapedText === getAccessedPropertyName(target) && isMatchingReference(source.left, target.expression); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return isBinaryExpression(source) && source.operatorToken.kind === 28 /* CommaToken */ && isMatchingReference(source.right, target); } return false; @@ -73178,7 +74083,7 @@ function createTypeChecker(host) { } function getMatchingUnionConstituentForObjectLiteral(unionType, node) { const keyPropertyName = getKeyPropertyName(unionType); - const propNode = keyPropertyName && find(node.properties, (p) => p.symbol && p.kind === 303 /* PropertyAssignment */ && p.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p.initializer)); + const propNode = keyPropertyName && find(node.properties, (p) => p.symbol && p.kind === 304 /* PropertyAssignment */ && p.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p.initializer)); const propType = propNode && getContextFreeTypeOfExpression(propNode.initializer); return propType && getConstituentTypeForKeyType(unionType, propType); } @@ -73193,7 +74098,7 @@ function createTypeChecker(host) { } } } - if (expression.expression.kind === 211 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, expression.expression.expression)) { + if (expression.expression.kind === 212 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, expression.expression.expression)) { return true; } return false; @@ -73384,11 +74289,11 @@ function createTypeChecker(host) { ) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - const isDestructuringDefaultAssignment = node.parent.kind === 209 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || node.parent.kind === 303 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + const isDestructuringDefaultAssignment = node.parent.kind === 210 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || node.parent.kind === 304 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent2) { - return parent2.parent.kind === 226 /* BinaryExpression */ && parent2.parent.left === parent2 || parent2.parent.kind === 250 /* ForOfStatement */ && parent2.parent.initializer === parent2; + return parent2.parent.kind === 227 /* BinaryExpression */ && parent2.parent.left === parent2 || parent2.parent.kind === 251 /* ForOfStatement */ && parent2.parent.initializer === parent2; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -73405,21 +74310,21 @@ function createTypeChecker(host) { function getAssignedType(node) { const { parent: parent2 } = node; switch (parent2.kind) { - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return stringType; - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return checkRightHandSideOfForOf(parent2) || errorType; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent2); - case 220 /* DeleteExpression */: + case 221 /* DeleteExpression */: return undefinedType; - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent2, node); - case 230 /* SpreadElement */: + case 231 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent2); - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent2); - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent2); } return errorType; @@ -73427,7 +74332,7 @@ function createTypeChecker(host) { function getInitialTypeOfBindingElement(node) { const pattern = node.parent; const parentType = getInitialType(pattern.parent); - const type = pattern.kind === 206 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType); + const type = pattern.kind === 207 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType); return getTypeWithDefault(type, node.initializer); } function getTypeOfInitializer(node) { @@ -73438,25 +74343,25 @@ function createTypeChecker(host) { if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 249 /* ForInStatement */) { + if (node.parent.parent.kind === 250 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 250 /* ForOfStatement */) { + if (node.parent.parent.kind === 251 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 260 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); + return node.kind === 261 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 260 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral2(node.initializer) || node.kind !== 208 /* BindingElement */ && node.parent.kind === 226 /* BinaryExpression */ && isEmptyArrayLiteral2(node.parent.right); + return node.kind === 261 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral2(node.initializer) || node.kind !== 209 /* BindingElement */ && node.parent.kind === 227 /* BinaryExpression */ && isEmptyArrayLiteral2(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: switch (node.operatorToken.kind) { case 64 /* EqualsToken */: case 76 /* BarBarEqualsToken */: @@ -73471,10 +74376,10 @@ function createTypeChecker(host) { } function getReferenceRoot(node) { const { parent: parent2 } = node; - return parent2.kind === 217 /* ParenthesizedExpression */ || parent2.kind === 226 /* BinaryExpression */ && parent2.operatorToken.kind === 64 /* EqualsToken */ && parent2.left === node || parent2.kind === 226 /* BinaryExpression */ && parent2.operatorToken.kind === 28 /* CommaToken */ && parent2.right === node ? getReferenceRoot(parent2) : node; + return parent2.kind === 218 /* ParenthesizedExpression */ || parent2.kind === 227 /* BinaryExpression */ && parent2.operatorToken.kind === 64 /* EqualsToken */ && parent2.left === node || parent2.kind === 227 /* BinaryExpression */ && parent2.operatorToken.kind === 28 /* CommaToken */ && parent2.right === node ? getReferenceRoot(parent2) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 296 /* CaseClause */) { + if (clause.kind === 297 /* CaseClause */) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -73490,12 +74395,12 @@ function createTypeChecker(host) { return links.switchTypes; } function getSwitchClauseTypeOfWitnesses(switchStatement) { - if (some(switchStatement.caseBlock.clauses, (clause) => clause.kind === 296 /* CaseClause */ && !isStringLiteralLike(clause.expression))) { + if (some(switchStatement.caseBlock.clauses, (clause) => clause.kind === 297 /* CaseClause */ && !isStringLiteralLike(clause.expression))) { return void 0; } const witnesses = []; for (const clause of switchStatement.caseBlock.clauses) { - const text = clause.kind === 296 /* CaseClause */ ? clause.expression.text : void 0; + const text = clause.kind === 297 /* CaseClause */ ? clause.expression.text : void 0; witnesses.push(text && !contains(witnesses, text) ? text : void 0); } return witnesses; @@ -73655,8 +74560,8 @@ function createTypeChecker(host) { function isEvolvingArrayOperationTarget(node) { const root = getReferenceRoot(node); const parent2 = root.parent; - const isLengthPushOrUnshift = isPropertyAccessExpression(parent2) && (parent2.name.escapedText === "length" || parent2.parent.kind === 213 /* CallExpression */ && isIdentifier(parent2.name) && isPushOrUnshiftIdentifier(parent2.name)); - const isElementAssignment = parent2.kind === 212 /* ElementAccessExpression */ && parent2.expression === root && parent2.parent.kind === 226 /* BinaryExpression */ && parent2.parent.operatorToken.kind === 64 /* EqualsToken */ && parent2.parent.left === parent2 && !isAssignmentTarget(parent2.parent) && isTypeAssignableToKind(getTypeOfExpression(parent2.argumentExpression), 296 /* NumberLike */); + const isLengthPushOrUnshift = isPropertyAccessExpression(parent2) && (parent2.name.escapedText === "length" || parent2.parent.kind === 214 /* CallExpression */ && isIdentifier(parent2.name) && isPushOrUnshiftIdentifier(parent2.name)); + const isElementAssignment = parent2.kind === 213 /* ElementAccessExpression */ && parent2.expression === root && parent2.parent.kind === 227 /* BinaryExpression */ && parent2.parent.operatorToken.kind === 64 /* EqualsToken */ && parent2.parent.left === parent2 && !isAssignmentTarget(parent2.parent) && isTypeAssignableToKind(getTypeOfExpression(parent2.argumentExpression), 296 /* NumberLike */); return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(node) { @@ -73679,7 +74584,7 @@ function createTypeChecker(host) { if (isDeclarationWithExplicitTypeAnnotation(declaration)) { return getTypeOfSymbol(symbol); } - if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 250 /* ForOfStatement */) { + if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 251 /* ForOfStatement */) { const statement = declaration.parent.parent; const expressionType = getTypeOfDottedName( statement.expression, @@ -73713,7 +74618,7 @@ function createTypeChecker(host) { return getExplicitThisType(node); case 108 /* SuperKeyword */: return checkSuperExpression(node); - case 211 /* PropertyAccessExpression */: { + case 212 /* PropertyAccessExpression */: { const type = getTypeOfDottedName(node.expression, diagnostic); if (type) { const name = node.name; @@ -73730,7 +74635,7 @@ function createTypeChecker(host) { } return void 0; } - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -73743,7 +74648,7 @@ function createTypeChecker(host) { if (isBinaryExpression(node)) { const rightType = checkNonNullExpression(node.right); funcType = getSymbolHasInstanceMethodOfObjectType(rightType); - } else if (node.parent.kind === 244 /* ExpressionStatement */) { + } else if (node.parent.kind === 245 /* ExpressionStatement */) { funcType = getTypeOfDottedName( node.expression, /*diagnostic*/ @@ -73797,7 +74702,7 @@ function createTypeChecker(host) { /*excludeJSDocTypeAssertions*/ true ); - return node.kind === 97 /* FalseKeyword */ || node.kind === 226 /* BinaryExpression */ && (node.operatorToken.kind === 56 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 57 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); + return node.kind === 97 /* FalseKeyword */ || node.kind === 227 /* BinaryExpression */ && (node.operatorToken.kind === 56 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 57 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { while (true) { @@ -73925,11 +74830,11 @@ function createTypeChecker(host) { return isConstantVariable(symbol) || isParameterOrMutableLocalVariable(symbol) && !isSymbolAssigned(symbol) || !!symbol.valueDeclaration && isFunctionExpression(symbol.valueDeclaration); } break; - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol); - case 206 /* ObjectBindingPattern */: - case 207 /* ArrayBindingPattern */: + case 207 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: const rootDeclaration = getRootDeclaration(node.parent); return isParameter(rootDeclaration) || isCatchClauseVariableDeclaration(rootDeclaration) ? !isSomeSymbolAssigned(rootDeclaration) : isVariableDeclaration(rootDeclaration) && isVarConstLike2(rootDeclaration); } @@ -73950,7 +74855,7 @@ function createTypeChecker(host) { const evolvedType = getTypeFromFlowType(getTypeAtFlowNode(flowNode)); sharedFlowCount = sharedFlowStart; const resultType = getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 235 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 236 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { return declaredType; } return resultType; @@ -74019,7 +74924,7 @@ function createTypeChecker(host) { target.antecedent = saveAntecedents; } else if (flags & 2 /* Start */) { const container = flow.node; - if (container && container !== flowContainer && reference.kind !== 211 /* PropertyAccessExpression */ && reference.kind !== 212 /* ElementAccessExpression */ && !(reference.kind === 110 /* ThisKeyword */ && container.kind !== 219 /* ArrowFunction */)) { + if (container && container !== flowContainer && reference.kind !== 212 /* PropertyAccessExpression */ && reference.kind !== 213 /* ElementAccessExpression */ && !(reference.kind === 110 /* ThisKeyword */ && container.kind !== 220 /* ArrowFunction */)) { flow = container.flowNode; continue; } @@ -74039,7 +74944,7 @@ function createTypeChecker(host) { function getInitialOrAssignedType(flow) { const node = flow.node; return getNarrowableTypeForReference( - node.kind === 260 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), + node.kind === 261 /* VariableDeclaration */ || node.kind === 209 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference ); } @@ -74072,13 +74977,13 @@ function createTypeChecker(host) { } if (isVariableDeclaration(node) && (isInJSFile(node) || isVarConstLike2(node))) { const init = getDeclaredExpandoInitializer(node); - if (init && (init.kind === 218 /* FunctionExpression */ || init.kind === 219 /* ArrowFunction */)) { + if (init && (init.kind === 219 /* FunctionExpression */ || init.kind === 220 /* ArrowFunction */)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } - if (isVariableDeclaration(node) && node.parent.parent.kind === 249 /* ForInStatement */ && (isMatchingReference(reference, node.parent.parent.expression) || optionalChainContainsReference(node.parent.parent.expression, reference))) { + if (isVariableDeclaration(node) && node.parent.parent.kind === 250 /* ForInStatement */ && (isMatchingReference(reference, node.parent.parent.expression) || optionalChainContainsReference(node.parent.parent.expression, reference))) { return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent)))); } return void 0; @@ -74092,7 +74997,7 @@ function createTypeChecker(host) { if (node.kind === 97 /* FalseKeyword */) { return unreachableNeverType; } - if (node.kind === 226 /* BinaryExpression */) { + if (node.kind === 227 /* BinaryExpression */) { if (node.operatorToken.kind === 56 /* AmpersandAmpersandToken */) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -74132,13 +75037,13 @@ function createTypeChecker(host) { function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { const node = flow.node; - const expr = node.kind === 213 /* CallExpression */ ? node.expression.expression : node.left.expression; + const expr = node.kind === 214 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { const flowType = getTypeAtFlowNode(flow.antecedent); const type = getTypeFromFlowType(flowType); if (getObjectFlags(type) & 256 /* EvolvingArray */) { let evolvedType2 = type; - if (node.kind === 213 /* CallExpression */) { + if (node.kind === 214 /* CallExpression */) { for (const arg of node.arguments) { evolvedType2 = addEvolvingArrayElementType(evolvedType2, arg); } @@ -74175,7 +75080,7 @@ function createTypeChecker(host) { let type = getTypeFromFlowType(flowType); if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.node); - } else if (expr.kind === 221 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { + } else if (expr.kind === 222 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowTypeBySwitchOnTypeOf(type, flow.node); } else if (expr.kind === 112 /* TrueKeyword */) { type = narrowTypeBySwitchOnTrue(type, flow.node); @@ -74183,7 +75088,7 @@ function createTypeChecker(host) { if (strictNullChecks) { if (optionalChainContainsReference(expr, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.node, (t) => !(t.flags & (32768 /* Undefined */ | 131072 /* Never */))); - } else if (expr.kind === 221 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { + } else if (expr.kind === 222 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.node, (t) => !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined")); } } @@ -74311,7 +75216,7 @@ function createTypeChecker(host) { if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) { if (isIdentifier(expr)) { const symbol = getResolvedSymbol(expr); - const declaration = symbol.valueDeclaration; + const declaration = getExportSymbolOfValueSymbolIfExported(symbol).valueDeclaration; if (declaration && (isBindingElement(declaration) || isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) { return declaration; } @@ -74446,10 +75351,10 @@ function createTypeChecker(host) { const operator = expr.operatorToken.kind; const left = getReferenceCandidate(expr.left); const right = getReferenceCandidate(expr.right); - if (left.kind === 221 /* TypeOfExpression */ && isStringLiteralLike(right)) { + if (left.kind === 222 /* TypeOfExpression */ && isStringLiteralLike(right)) { return narrowTypeByTypeof(type, left, operator, right, assumeTrue); } - if (right.kind === 221 /* TypeOfExpression */ && isStringLiteralLike(left)) { + if (right.kind === 222 /* TypeOfExpression */ && isStringLiteralLike(left)) { return narrowTypeByTypeof(type, right, operator, left, assumeTrue); } if (isMatchingReference(reference, left)) { @@ -74720,7 +75625,7 @@ function createTypeChecker(host) { if (!witnesses) { return type; } - const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 297 /* DefaultClause */); + const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 298 /* DefaultClause */); const hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd; if (hasDefaultClause) { const notEqualFacts = getNotEqualFactsFromTypeofSwitch(clauseStart, clauseEnd, witnesses); @@ -74730,11 +75635,11 @@ function createTypeChecker(host) { return getUnionType(map(clauseWitnesses, (text) => text ? narrowTypeByTypeName(type, text) : neverType)); } function narrowTypeBySwitchOnTrue(type, { switchStatement, clauseStart, clauseEnd }) { - const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 297 /* DefaultClause */); + const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 298 /* DefaultClause */); const hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd; for (let i = 0; i < clauseStart; i++) { const clause = switchStatement.caseBlock.clauses[i]; - if (clause.kind === 296 /* CaseClause */) { + if (clause.kind === 297 /* CaseClause */) { type = narrowType( type, clause.expression, @@ -74746,7 +75651,7 @@ function createTypeChecker(host) { if (hasDefaultClause) { for (let i = clauseEnd; i < switchStatement.caseBlock.clauses.length; i++) { const clause = switchStatement.caseBlock.clauses[i]; - if (clause.kind === 296 /* CaseClause */) { + if (clause.kind === 297 /* CaseClause */) { type = narrowType( type, clause.expression, @@ -74758,7 +75663,7 @@ function createTypeChecker(host) { return type; } const clauses = switchStatement.caseBlock.clauses.slice(clauseStart, clauseEnd); - return getUnionType(map(clauses, (clause) => clause.kind === 296 /* CaseClause */ ? narrowType( + return getUnionType(map(clauses, (clause) => clause.kind === 297 /* CaseClause */ ? narrowType( type, clause.expression, /*assumeTrue*/ @@ -74958,18 +75863,18 @@ function createTypeChecker(host) { // falls through case 110 /* ThisKeyword */: case 108 /* SuperKeyword */: - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 217 /* ParenthesizedExpression */: - case 235 /* NonNullExpression */: - case 238 /* SatisfiesExpression */: + case 218 /* ParenthesizedExpression */: + case 236 /* NonNullExpression */: + case 239 /* SatisfiesExpression */: return narrowType(type, expr.expression, assumeTrue); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: if (expr.operator === 54 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -74996,7 +75901,7 @@ function createTypeChecker(host) { } if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) { const type = removeOptionalTypeMarker( - isWriteAccess(location) && location.kind === 211 /* PropertyAccessExpression */ ? checkPropertyAccessExpression( + isWriteAccess(location) && location.kind === 212 /* PropertyAccessExpression */ ? checkPropertyAccessExpression( location, /*checkMode*/ void 0, @@ -75015,7 +75920,7 @@ function createTypeChecker(host) { return isRightSideOfAccessExpression(location) && isWriteAccess(location.parent) ? getWriteTypeOfSymbol(symbol) : getNonMissingTypeOfSymbol(symbol); } function getControlFlowContainer(node) { - return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 268 /* ModuleBlock */ || node2.kind === 307 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */); + return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 269 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 173 /* PropertyDeclaration */); } function isSymbolAssignedDefinitely(symbol) { if (symbol.lastAssignmentPos !== void 0) { @@ -75052,7 +75957,7 @@ function createTypeChecker(host) { if (node.kind === 80 /* Identifier */) { return isSymbolAssigned(getSymbolOfDeclaration(node.parent)); } - return some(node.elements, (e) => e.kind !== 232 /* OmittedExpression */ && isSomeSymbolAssignedWorker(e.name)); + return some(node.elements, (e) => e.kind !== 233 /* OmittedExpression */ && isSomeSymbolAssignedWorker(e.name)); } function hasParentWithAssignmentsMarked(node) { return !!findAncestor(node.parent, (node2) => isFunctionOrSourceFile(node2) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */)); @@ -75079,7 +75984,7 @@ function createTypeChecker(host) { } } return; - case 281 /* ExportSpecifier */: + case 282 /* ExportSpecifier */: const exportDeclaration = node.parent.parent; const name = node.propertyName || node.name; if (!node.isTypeOnly && !exportDeclaration.isTypeOnly && !exportDeclaration.moduleSpecifier && name.kind !== 11 /* StringLiteral */) { @@ -75097,9 +76002,9 @@ function createTypeChecker(host) { } } return; - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 266 /* EnumDeclaration */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 267 /* EnumDeclaration */: return; } if (isTypeNode(node)) { @@ -75111,18 +76016,18 @@ function createTypeChecker(host) { let pos = node.pos; while (node && node.pos > declaration.pos) { switch (node.kind) { - case 243 /* VariableStatement */: - case 244 /* ExpressionStatement */: - case 245 /* IfStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 254 /* WithStatement */: - case 255 /* SwitchStatement */: - case 258 /* TryStatement */: - case 263 /* ClassDeclaration */: + case 244 /* VariableStatement */: + case 245 /* ExpressionStatement */: + case 246 /* IfStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 255 /* WithStatement */: + case 256 /* SwitchStatement */: + case 259 /* TryStatement */: + case 264 /* ClassDeclaration */: pos = node.end; } node = node.parent; @@ -75137,7 +76042,7 @@ function createTypeChecker(host) { return !!declaration && (isParameter(declaration) || isVariableDeclaration(declaration) && (isCatchClause(declaration.parent) || isMutableLocalVariableDeclaration(declaration))); } function isMutableLocalVariableDeclaration(declaration) { - return !!(declaration.parent.flags & 1 /* Let */) && !(getCombinedModifierFlags(declaration) & 32 /* Export */ || declaration.parent.parent.kind === 243 /* VariableStatement */ && isGlobalSourceFile(declaration.parent.parent.parent)); + return !!(declaration.parent.flags & 1 /* Let */) && !(getCombinedModifierFlags(declaration) & 32 /* Export */ || declaration.parent.parent.kind === 244 /* VariableStatement */ && isGlobalSourceFile(declaration.parent.parent.parent)); } function parameterInitializerContainsUndefined(declaration) { const links = getNodeLinks(declaration); @@ -75156,12 +76061,12 @@ function createTypeChecker(host) { return links.parameterInitializerContainsUndefined; } function removeOptionalityFromDeclaredType(declaredType, declaration) { - const removeUndefined = strictNullChecks && declaration.kind === 169 /* Parameter */ && declaration.initializer && hasTypeFacts(declaredType, 16777216 /* IsUndefined */) && !parameterInitializerContainsUndefined(declaration); + const removeUndefined = strictNullChecks && declaration.kind === 170 /* Parameter */ && declaration.initializer && hasTypeFacts(declaredType, 16777216 /* IsUndefined */) && !parameterInitializerContainsUndefined(declaration); return removeUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType; } function isConstraintPosition(type, node) { const parent2 = node.parent; - return parent2.kind === 211 /* PropertyAccessExpression */ || parent2.kind === 166 /* QualifiedName */ || parent2.kind === 213 /* CallExpression */ && parent2.expression === node || parent2.kind === 214 /* NewExpression */ && parent2.expression === node || parent2.kind === 212 /* ElementAccessExpression */ && parent2.expression === node && !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent2.argumentExpression))); + return parent2.kind === 212 /* PropertyAccessExpression */ || parent2.kind === 167 /* QualifiedName */ || parent2.kind === 214 /* CallExpression */ && parent2.expression === node || parent2.kind === 215 /* NewExpression */ && parent2.expression === node || parent2.kind === 213 /* ElementAccessExpression */ && parent2.expression === node && !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent2.argumentExpression))); } function isGenericTypeWithUnionConstraint(type) { return type.flags & 2097152 /* Intersection */ ? some(type.types, isGenericTypeWithUnionConstraint) : !!(type.flags & 465829888 /* Instantiable */ && getBaseConstraintOrType(type).flags & (98304 /* Nullable */ | 1048576 /* Union */)); @@ -75302,7 +76207,7 @@ function createTypeChecker(host) { const apparentType = getApparentType(assignmentKind !== 0 /* None */ || isMethodAccessForCall(location) ? getWidenedType(leftType) : leftType); prop = isPrivateIdentifier(right) ? lexicallyScopedSymbol && getPrivateIdentifierPropertyOfType(apparentType, lexicallyScopedSymbol) || void 0 : getPropertyOfType(apparentType, right.escapedText); } - if (!(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && location.parent.kind === 306 /* EnumMember */))) { + if (!(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && location.parent.kind === 307 /* EnumMember */))) { markAliasReferenced(parentSymbol, location); } return; @@ -75412,7 +76317,7 @@ function createTypeChecker(host) { } checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); switch (node.kind) { - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: const constructor = getFirstConstructorWithBody(node); if (constructor) { for (const parameter of constructor.parameters) { @@ -75420,22 +76325,22 @@ function createTypeChecker(host) { } } break; - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - const otherKind = node.kind === 177 /* GetAccessor */ ? 178 /* SetAccessor */ : 177 /* GetAccessor */; + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + const otherKind = node.kind === 178 /* GetAccessor */ ? 179 /* SetAccessor */ : 178 /* GetAccessor */; const otherAccessor = getDeclarationOfKind(getSymbolOfDeclaration(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: for (const parameter of node.parameters) { markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveReturnTypeNode(node)); break; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveTypeAnnotationNode(node)); break; - case 169 /* Parameter */: + case 170 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); const containingSignature = node.parent; for (const parameter of containingSignature.parameters) { @@ -75546,14 +76451,14 @@ function createTypeChecker(host) { if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) { const parent2 = declaration.parent.parent; const rootDeclaration = getRootDeclaration(parent2); - if (rootDeclaration.kind === 260 /* VariableDeclaration */ && getCombinedNodeFlagsCached(rootDeclaration) & 6 /* Constant */ || rootDeclaration.kind === 169 /* Parameter */) { + if (rootDeclaration.kind === 261 /* VariableDeclaration */ && getCombinedNodeFlagsCached(rootDeclaration) & 6 /* Constant */ || rootDeclaration.kind === 170 /* Parameter */) { const links = getNodeLinks(parent2); if (!(links.flags & 4194304 /* InCheckIdentifier */)) { links.flags |= 4194304 /* InCheckIdentifier */; const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */); const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType); links.flags &= ~4194304 /* InCheckIdentifier */; - if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 169 /* Parameter */ && isSomeSymbolAssigned(rootDeclaration))) { + if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 170 /* Parameter */ && isSomeSymbolAssigned(rootDeclaration))) { const pattern = declaration.parent; const narrowedType = getFlowTypeOfReference( pattern, @@ -75603,14 +76508,18 @@ function createTypeChecker(host) { function checkIdentifierCalculateNodeCheckFlags(node, symbol) { if (isThisInTypeQuery(node)) return; if (symbol === argumentsSymbol) { - if (isInPropertyInitializerOrClassStaticBlock(node)) { - error2(node, Diagnostics.arguments_cannot_be_referenced_in_property_initializers); + if (isInPropertyInitializerOrClassStaticBlock( + node, + /*ignoreArrowFunctions*/ + true + )) { + error2(node, Diagnostics.arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks); return; } let container = getContainingFunction(node); if (container) { if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 219 /* ArrowFunction */) { + if (container.kind === 220 /* ArrowFunction */) { error2(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES5_Consider_using_a_standard_function_expression); } else if (hasSyntacticModifier(container, 1024 /* Async */)) { error2(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES5_Consider_using_a_standard_function_or_method); @@ -75641,7 +76550,7 @@ function createTypeChecker(host) { /*includeClassComputedPropertyName*/ false ); - while (container.kind !== 307 /* SourceFile */ && container.parent !== declaration) { + while (container.kind !== 308 /* SourceFile */ && container.parent !== declaration) { container = getThisContainer( container, /*includeArrowFunctions*/ @@ -75650,7 +76559,7 @@ function createTypeChecker(host) { false ); } - if (container.kind !== 307 /* SourceFile */) { + if (container.kind !== 308 /* SourceFile */) { getNodeLinks(declaration).flags |= 262144 /* ContainsConstructorReference */; getNodeLinks(container).flags |= 262144 /* ContainsConstructorReference */; getNodeLinks(node).flags |= 536870912 /* ConstructorReference */; @@ -75680,7 +76589,7 @@ function createTypeChecker(host) { const localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); let declaration = localOrExportSymbol.valueDeclaration; const immediateDeclaration = declaration; - if (declaration && declaration.kind === 208 /* BindingElement */ && contains(contextualBindingPatterns, declaration.parent) && findAncestor(node, (parent2) => parent2 === declaration.parent)) { + if (declaration && declaration.kind === 209 /* BindingElement */ && contains(contextualBindingPatterns, declaration.parent) && findAncestor(node, (parent2) => parent2 === declaration.parent)) { return nonInferrableAnyType; } let type = getNarrowedTypeOfSymbol(localOrExportSymbol, node); @@ -75714,19 +76623,19 @@ function createTypeChecker(host) { return type; } type = getNarrowableTypeForReference(type, node, checkMode); - const isParameter2 = getRootDeclaration(declaration).kind === 169 /* Parameter */; + const isParameter2 = getRootDeclaration(declaration).kind === 170 /* Parameter */; const declarationContainer = getControlFlowContainer(declaration); let flowContainer = getControlFlowContainer(node); const isOuterVariable = flowContainer !== declarationContainer; const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); const isModuleExports = symbol.flags & 134217728 /* ModuleExports */; const typeIsAutomatic = type === autoType || type === autoArrayType; - const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 235 /* NonNullExpression */; - while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameterOrMutableLocalVariable(localOrExportSymbol) && isPastLastAssignment(localOrExportSymbol, node))) { + const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 236 /* NonNullExpression */; + while (flowContainer !== declarationContainer && (flowContainer.kind === 219 /* FunctionExpression */ || flowContainer.kind === 220 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameterOrMutableLocalVariable(localOrExportSymbol) && isPastLastAssignment(localOrExportSymbol, node))) { flowContainer = getControlFlowContainer(flowContainer); } const isNeverInitialized = immediateDeclaration && isVariableDeclaration(immediateDeclaration) && !immediateDeclaration.initializer && !immediateDeclaration.exclamationToken && isMutableLocalVariableDeclaration(immediateDeclaration) && !isSymbolAssignedDefinitely(symbol); - const assumeInitialized = isParameter2 || isAlias || isOuterVariable && !isNeverInitialized || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 281 /* ExportSpecifier */) || node.parent.kind === 235 /* NonNullExpression */ || declaration.kind === 260 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 33554432 /* Ambient */; + const assumeInitialized = isParameter2 || isAlias || isOuterVariable && !isNeverInitialized || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 282 /* ExportSpecifier */) || node.parent.kind === 236 /* NonNullExpression */ || declaration.kind === 261 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 33554432 /* Ambient */; const initialType = isAutomaticTypeInNonNull ? undefinedType : assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : typeIsAutomatic ? undefinedType : getOptionalType(type); const flowType = isAutomaticTypeInNonNull ? getNonNullableType(getFlowTypeOfReference(node, type, initialType, flowContainer)) : getFlowTypeOfReference(node, type, initialType, flowContainer); if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) { @@ -75780,7 +76689,7 @@ function createTypeChecker(host) { )); } function checkNestedBlockScopedBinding(node, symbol) { - if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || !symbol.valueDeclaration || isSourceFile(symbol.valueDeclaration) || symbol.valueDeclaration.parent.kind === 299 /* CatchClause */) { + if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || !symbol.valueDeclaration || isSourceFile(symbol.valueDeclaration) || symbol.valueDeclaration.parent.kind === 300 /* CatchClause */) { return; } const container = getEnclosingBlockScopeContainer(symbol.valueDeclaration); @@ -75790,7 +76699,7 @@ function createTypeChecker(host) { if (isCaptured) { let capturesBlockScopeBindingInLoopBody = true; if (isForStatement(container)) { - const varDeclList = getAncestor(symbol.valueDeclaration, 261 /* VariableDeclarationList */); + const varDeclList = getAncestor(symbol.valueDeclaration, 262 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container) { const part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -75809,7 +76718,7 @@ function createTypeChecker(host) { } } if (isForStatement(container)) { - const varDeclList = getAncestor(symbol.valueDeclaration, 261 /* VariableDeclarationList */); + const varDeclList = getAncestor(symbol.valueDeclaration, 262 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 65536 /* NeedsLoopOutParameter */; } @@ -75826,13 +76735,13 @@ function createTypeChecker(host) { } function isAssignedInBodyOfForStatement(node, container) { let current = node; - while (current.parent.kind === 217 /* ParenthesizedExpression */) { + while (current.parent.kind === 218 /* ParenthesizedExpression */) { current = current.parent; } let isAssigned = false; if (isAssignmentTarget(current)) { isAssigned = true; - } else if (current.parent.kind === 224 /* PrefixUnaryExpression */ || current.parent.kind === 225 /* PostfixUnaryExpression */) { + } else if (current.parent.kind === 225 /* PrefixUnaryExpression */ || current.parent.kind === 226 /* PostfixUnaryExpression */) { const expr = current.parent; isAssigned = expr.operator === 46 /* PlusPlusToken */ || expr.operator === 47 /* MinusMinusToken */; } @@ -75843,7 +76752,7 @@ function createTypeChecker(host) { } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 172 /* PropertyDeclaration */ || container.kind === 176 /* Constructor */) { + if (container.kind === 173 /* PropertyDeclaration */ || container.kind === 177 /* Constructor */) { const classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } else { @@ -75888,11 +76797,11 @@ function createTypeChecker(host) { ); let capturedByArrowFunction = false; let thisInComputedPropertyName = false; - if (container.kind === 176 /* Constructor */) { + if (container.kind === 177 /* Constructor */) { checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } while (true) { - if (container.kind === 219 /* ArrowFunction */) { + if (container.kind === 220 /* ArrowFunction */) { container = getThisContainer( container, /*includeArrowFunctions*/ @@ -75901,7 +76810,7 @@ function createTypeChecker(host) { ); capturedByArrowFunction = true; } - if (container.kind === 167 /* ComputedPropertyName */) { + if (container.kind === 168 /* ComputedPropertyName */) { container = getThisContainer( container, !capturedByArrowFunction, @@ -75918,10 +76827,10 @@ function createTypeChecker(host) { error2(node, Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); } else { switch (container.kind) { - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: error2(node, Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); break; - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: error2(node, Diagnostics.this_cannot_be_referenced_in_current_location); break; } @@ -76013,13 +76922,13 @@ function createTypeChecker(host) { } } function getClassNameFromPrototypeMethod(container) { - if (container.kind === 218 /* FunctionExpression */ && isBinaryExpression(container.parent) && getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { + if (container.kind === 219 /* FunctionExpression */ && isBinaryExpression(container.parent) && getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { return container.parent.left.expression.expression; - } else if (container.kind === 174 /* MethodDeclaration */ && container.parent.kind === 210 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent) && getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { + } else if (container.kind === 175 /* MethodDeclaration */ && container.parent.kind === 211 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent) && getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { return container.parent.parent.left.expression; - } else if (container.kind === 218 /* FunctionExpression */ && container.parent.kind === 303 /* PropertyAssignment */ && container.parent.parent.kind === 210 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent.parent) && getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { + } else if (container.kind === 219 /* FunctionExpression */ && container.parent.kind === 304 /* PropertyAssignment */ && container.parent.parent.kind === 211 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent.parent) && getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { return container.parent.parent.parent.left.expression; - } else if (container.kind === 218 /* FunctionExpression */ && isPropertyAssignment(container.parent) && isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && isObjectLiteralExpression(container.parent.parent) && isCallExpression(container.parent.parent.parent) && container.parent.parent.parent.arguments[2] === container.parent.parent && getAssignmentDeclarationKind(container.parent.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) { + } else if (container.kind === 219 /* FunctionExpression */ && isPropertyAssignment(container.parent) && isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && isObjectLiteralExpression(container.parent.parent) && isCallExpression(container.parent.parent.parent) && container.parent.parent.parent.arguments[2] === container.parent.parent && getAssignmentDeclarationKind(container.parent.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) { return container.parent.parent.parent.arguments[0].expression; } else if (isMethodDeclaration(container) && isIdentifier(container.name) && (container.name.escapedText === "value" || container.name.escapedText === "get" || container.name.escapedText === "set") && isObjectLiteralExpression(container.parent) && isCallExpression(container.parent.parent) && container.parent.parent.arguments[2] === container.parent && getAssignmentDeclarationKind(container.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) { return container.parent.parent.arguments[0].expression; @@ -76036,10 +76945,10 @@ function createTypeChecker(host) { } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!findAncestor(node, (n) => isFunctionLikeDeclaration(n) ? "quit" : n.kind === 169 /* Parameter */ && n.parent === constructorDecl); + return !!findAncestor(node, (n) => isFunctionLikeDeclaration(n) ? "quit" : n.kind === 170 /* Parameter */ && n.parent === constructorDecl); } function checkSuperExpression(node) { - const isCallExpression2 = node.parent.kind === 213 /* CallExpression */ && node.parent.expression === node; + const isCallExpression2 = node.parent.kind === 214 /* CallExpression */ && node.parent.expression === node; const immediateContainer = getSuperContainer( node, /*stopOnFunctions*/ @@ -76049,7 +76958,7 @@ function createTypeChecker(host) { let needToCaptureLexicalThis = false; let inAsyncFunction = false; if (!isCallExpression2) { - while (container && container.kind === 219 /* ArrowFunction */) { + while (container && container.kind === 220 /* ArrowFunction */) { if (hasSyntacticModifier(container, 1024 /* Async */)) inAsyncFunction = true; container = getSuperContainer( container, @@ -76062,19 +76971,19 @@ function createTypeChecker(host) { } let nodeCheckFlag = 0; if (!container || !isLegalUsageOfSuperExpression(container)) { - const current = findAncestor(node, (n) => n === container ? "quit" : n.kind === 167 /* ComputedPropertyName */); - if (current && current.kind === 167 /* ComputedPropertyName */) { + const current = findAncestor(node, (n) => n === container ? "quit" : n.kind === 168 /* ComputedPropertyName */); + if (current && current.kind === 168 /* ComputedPropertyName */) { error2(node, Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression2) { error2(node, Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); - } else if (!container || !container.parent || !(isClassLike(container.parent) || container.parent.kind === 210 /* ObjectLiteralExpression */)) { + } else if (!container || !container.parent || !(isClassLike(container.parent) || container.parent.kind === 211 /* ObjectLiteralExpression */)) { error2(node, Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { error2(node, Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class); } return errorType; } - if (!isCallExpression2 && immediateContainer.kind === 176 /* Constructor */) { + if (!isCallExpression2 && immediateContainer.kind === 177 /* Constructor */) { checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (isStatic(container) || isCallExpression2) { @@ -76090,7 +76999,7 @@ function createTypeChecker(host) { nodeCheckFlag = 16 /* SuperInstance */; } getNodeLinks(node).flags |= nodeCheckFlag; - if (container.kind === 174 /* MethodDeclaration */ && inAsyncFunction) { + if (container.kind === 175 /* MethodDeclaration */ && inAsyncFunction) { if (isSuperProperty(node.parent) && isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 256 /* MethodWithSuperPropertyAssignmentInAsync */; } else { @@ -76100,7 +77009,7 @@ function createTypeChecker(host) { if (needToCaptureLexicalThis) { captureLexicalThis(node.parent, container); } - if (container.parent.kind === 210 /* ObjectLiteralExpression */) { + if (container.parent.kind === 211 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error2(node, Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return errorType; @@ -76121,20 +77030,20 @@ function createTypeChecker(host) { if (!baseClassType) { return errorType; } - if (container.kind === 176 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 177 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { error2(node, Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; } return nodeCheckFlag === 32 /* SuperStatic */ ? getBaseConstructorTypeOfClass(classType) : getTypeWithThisArgument(baseClassType, classType.thisType); function isLegalUsageOfSuperExpression(container2) { if (isCallExpression2) { - return container2.kind === 176 /* Constructor */; + return container2.kind === 177 /* Constructor */; } else { - if (isClassLike(container2.parent) || container2.parent.kind === 210 /* ObjectLiteralExpression */) { + if (isClassLike(container2.parent) || container2.parent.kind === 211 /* ObjectLiteralExpression */) { if (isStatic(container2)) { - return container2.kind === 174 /* MethodDeclaration */ || container2.kind === 173 /* MethodSignature */ || container2.kind === 177 /* GetAccessor */ || container2.kind === 178 /* SetAccessor */ || container2.kind === 172 /* PropertyDeclaration */ || container2.kind === 175 /* ClassStaticBlockDeclaration */; + return container2.kind === 175 /* MethodDeclaration */ || container2.kind === 174 /* MethodSignature */ || container2.kind === 178 /* GetAccessor */ || container2.kind === 179 /* SetAccessor */ || container2.kind === 173 /* PropertyDeclaration */ || container2.kind === 176 /* ClassStaticBlockDeclaration */; } else { - return container2.kind === 174 /* MethodDeclaration */ || container2.kind === 173 /* MethodSignature */ || container2.kind === 177 /* GetAccessor */ || container2.kind === 178 /* SetAccessor */ || container2.kind === 172 /* PropertyDeclaration */ || container2.kind === 171 /* PropertySignature */ || container2.kind === 176 /* Constructor */; + return container2.kind === 175 /* MethodDeclaration */ || container2.kind === 174 /* MethodSignature */ || container2.kind === 178 /* GetAccessor */ || container2.kind === 179 /* SetAccessor */ || container2.kind === 173 /* PropertyDeclaration */ || container2.kind === 172 /* PropertySignature */ || container2.kind === 177 /* Constructor */; } } } @@ -76142,7 +77051,7 @@ function createTypeChecker(host) { } } function getContainingObjectLiteral(func) { - return (func.kind === 174 /* MethodDeclaration */ || func.kind === 177 /* GetAccessor */ || func.kind === 178 /* SetAccessor */) && func.parent.kind === 210 /* ObjectLiteralExpression */ ? func.parent : func.kind === 218 /* FunctionExpression */ && func.parent.kind === 303 /* PropertyAssignment */ ? func.parent.parent : void 0; + return (func.kind === 175 /* MethodDeclaration */ || func.kind === 178 /* GetAccessor */ || func.kind === 179 /* SetAccessor */) && func.parent.kind === 211 /* ObjectLiteralExpression */ ? func.parent : func.kind === 219 /* FunctionExpression */ && func.parent.kind === 304 /* PropertyAssignment */ ? func.parent.parent : void 0; } function getThisTypeArgument(type) { return getObjectFlags(type) & 4 /* Reference */ && type.target === globalThisType ? getTypeArguments(type)[0] : void 0; @@ -76160,7 +77069,7 @@ function createTypeChecker(host) { if (thisType) { return thisType; } - if (literal.parent.kind !== 303 /* PropertyAssignment */) { + if (literal.parent.kind !== 304 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -76172,7 +77081,7 @@ function createTypeChecker(host) { } } function getContextualThisParameterType(func) { - if (func.kind === 219 /* ArrowFunction */) { + if (func.kind === 220 /* ArrowFunction */) { return void 0; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -76255,11 +77164,11 @@ function createTypeChecker(host) { return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 169 /* Parameter */: + case 170 /* Parameter */: return getContextuallyTypedParameterType(declaration); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return getContextualTypeForBindingElement(declaration, contextFlags); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: if (isStatic(declaration)) { return getContextualTypeForStaticPropertyDeclaration(declaration, contextFlags); } @@ -76268,9 +77177,9 @@ function createTypeChecker(host) { function getContextualTypeForBindingElement(declaration, contextFlags) { const parent2 = declaration.parent.parent; const name = declaration.propertyName || declaration.name; - const parentType = getContextualTypeForVariableLikeDeclaration(parent2, contextFlags) || parent2.kind !== 208 /* BindingElement */ && parent2.initializer && checkDeclarationInitializer(parent2, declaration.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */); + const parentType = getContextualTypeForVariableLikeDeclaration(parent2, contextFlags) || parent2.kind !== 209 /* BindingElement */ && parent2.initializer && checkDeclarationInitializer(parent2, declaration.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */); if (!parentType || isBindingPattern(name) || isComputedNonLiteralName(name)) return void 0; - if (parent2.name.kind === 207 /* ArrayBindingPattern */) { + if (parent2.name.kind === 208 /* ArrayBindingPattern */) { const index = indexOfNode(declaration.parent.elements, declaration); if (index < 0) return void 0; return getContextualTypeForElementExpression(parentType, index); @@ -76459,7 +77368,7 @@ function createTypeChecker(host) { return signature ? getOrCreateTypeFromSignature(signature) : void 0; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 215 /* TaggedTemplateExpression */) { + if (template.parent.kind === 216 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return void 0; @@ -76871,17 +77780,17 @@ function createTypeChecker(host) { case 9 /* NumericLiteral */: case 10 /* BigIntLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: - case 228 /* TemplateExpression */: + case 229 /* TemplateExpression */: case 112 /* TrueKeyword */: case 97 /* FalseKeyword */: case 106 /* NullKeyword */: case 80 /* Identifier */: case 157 /* UndefinedKeyword */: return true; - case 211 /* PropertyAccessExpression */: - case 217 /* ParenthesizedExpression */: + case 212 /* PropertyAccessExpression */: + case 218 /* ParenthesizedExpression */: return isPossiblyDiscriminantValue(node.expression); - case 294 /* JsxExpression */: + case 295 /* JsxExpression */: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; @@ -76898,15 +77807,15 @@ function createTypeChecker(host) { if (!p.symbol) { return false; } - if (p.kind === 303 /* PropertyAssignment */) { + if (p.kind === 304 /* PropertyAssignment */) { return isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); } - if (p.kind === 304 /* ShorthandPropertyAssignment */) { + if (p.kind === 305 /* ShorthandPropertyAssignment */) { return isDiscriminantProperty(contextualType, p.symbol.escapedName); } return false; }), - (prop) => [() => getContextFreeTypeOfExpression(prop.kind === 303 /* PropertyAssignment */ ? prop.initializer : prop.name), prop.symbol.escapedName] + (prop) => [() => getContextFreeTypeOfExpression(prop.kind === 304 /* PropertyAssignment */ ? prop.initializer : prop.name), prop.symbol.escapedName] ), map( filter(getPropertiesOfType(contextualType), (s) => { @@ -76931,7 +77840,7 @@ function createTypeChecker(host) { contextualType, concatenate( map( - filter(node.properties, (p) => !!p.symbol && p.kind === 291 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer))), + filter(node.properties, (p) => !!p.symbol && p.kind === 292 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer))), (prop) => [!prop.initializer ? () => trueType : () => getContextFreeTypeOfExpression(prop.initializer), prop.symbol.escapedName] ), map( @@ -77010,47 +77919,47 @@ function createTypeChecker(host) { } const { parent: parent2 } = node; switch (parent2.kind) { - case 260 /* VariableDeclaration */: - case 169 /* Parameter */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 208 /* BindingElement */: + case 261 /* VariableDeclaration */: + case 170 /* Parameter */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 209 /* BindingElement */: return getContextualTypeForInitializerExpression(node, contextFlags); - case 219 /* ArrowFunction */: - case 253 /* ReturnStatement */: + case 220 /* ArrowFunction */: + case 254 /* ReturnStatement */: return getContextualTypeForReturnExpression(node, contextFlags); - case 229 /* YieldExpression */: + case 230 /* YieldExpression */: return getContextualTypeForYieldOperand(parent2, contextFlags); - case 223 /* AwaitExpression */: + case 224 /* AwaitExpression */: return getContextualTypeForAwaitOperand(parent2, contextFlags); - case 213 /* CallExpression */: - case 214 /* NewExpression */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: return getContextualTypeForArgument(parent2, node); - case 170 /* Decorator */: + case 171 /* Decorator */: return getContextualTypeForDecorator(parent2); - case 216 /* TypeAssertionExpression */: - case 234 /* AsExpression */: + case 217 /* TypeAssertionExpression */: + case 235 /* AsExpression */: return isConstTypeReference(parent2.type) ? getContextualType2(parent2, contextFlags) : getTypeFromTypeNode(parent2.type); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node, contextFlags); - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent2, contextFlags); - case 305 /* SpreadAssignment */: + case 306 /* SpreadAssignment */: return getContextualType2(parent2.parent, contextFlags); - case 209 /* ArrayLiteralExpression */: { + case 210 /* ArrayLiteralExpression */: { const arrayLiteral = parent2; const type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); const elementIndex = indexOfNode(arrayLiteral.elements, node); const spreadIndices = (_a = getNodeLinks(arrayLiteral)).spreadIndices ?? (_a.spreadIndices = getSpreadIndices(arrayLiteral.elements)); return getContextualTypeForElementExpression(type, elementIndex, arrayLiteral.elements.length, spreadIndices.first, spreadIndices.last); } - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); - case 239 /* TemplateSpan */: - Debug.assert(parent2.parent.kind === 228 /* TemplateExpression */); + case 240 /* TemplateSpan */: + Debug.assert(parent2.parent.kind === 229 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent2.parent, node); - case 217 /* ParenthesizedExpression */: { + case 218 /* ParenthesizedExpression */: { if (isInJSFile(parent2)) { if (isJSDocSatisfiesExpression(parent2)) { return getTypeFromTypeNode(getJSDocSatisfiesExpressionType(parent2)); @@ -77062,21 +77971,21 @@ function createTypeChecker(host) { } return getContextualType2(parent2, contextFlags); } - case 235 /* NonNullExpression */: + case 236 /* NonNullExpression */: return getContextualType2(parent2, contextFlags); - case 238 /* SatisfiesExpression */: + case 239 /* SatisfiesExpression */: return getTypeFromTypeNode(parent2.type); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return tryGetTypeFromEffectiveTypeNode(parent2); - case 294 /* JsxExpression */: + case 295 /* JsxExpression */: return getContextualTypeForJsxExpression(parent2, contextFlags); - case 291 /* JsxAttribute */: - case 293 /* JsxSpreadAttribute */: + case 292 /* JsxAttribute */: + case 294 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent2, contextFlags); - case 286 /* JsxOpeningElement */: - case 285 /* JsxSelfClosingElement */: + case 287 /* JsxOpeningElement */: + case 286 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent2, contextFlags); - case 301 /* ImportAttribute */: + case 302 /* ImportAttribute */: return getContextualImportAttributeType(parent2); } return void 0; @@ -77125,6 +78034,27 @@ function createTypeChecker(host) { } } } + function pushActiveMapper(mapper) { + activeTypeMappers[activeTypeMappersCount] = mapper; + activeTypeMappersCaches[activeTypeMappersCount] = /* @__PURE__ */ new Map(); + activeTypeMappersCount++; + } + function popActiveMapper() { + activeTypeMappersCount--; + } + function findActiveMapper(mapper) { + for (let i = activeTypeMappersCount - 1; i >= 0; i--) { + if (mapper === activeTypeMappers[i]) { + return i; + } + } + return -1; + } + function clearActiveMapperCaches() { + for (let i = activeTypeMappersCount - 1; i >= 0; i--) { + activeTypeMappersCaches[i].clear(); + } + } function getContextualImportAttributeType(node) { return getTypeOfPropertyOfContextualType(getGlobalImportAttributesType( /*reportErrors*/ @@ -77348,7 +78278,7 @@ function createTypeChecker(host) { return isFunctionExpressionOrArrowFunction(node) || isObjectLiteralMethod(node) ? getContextualSignature(node) : void 0; } function getContextualSignature(node) { - Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node)); + Debug.assert(node.kind !== 175 /* MethodDeclaration */ || isObjectLiteralMethod(node)); const typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -77446,7 +78376,7 @@ function createTypeChecker(host) { return node.isSpread ? getIndexedAccessType(node.type, numberType) : node.type; } function hasDefaultValue(node) { - return node.kind === 208 /* BindingElement */ && !!node.initializer || node.kind === 303 /* PropertyAssignment */ && hasDefaultValue(node.initializer) || node.kind === 304 /* ShorthandPropertyAssignment */ && !!node.objectAssignmentInitializer || node.kind === 226 /* BinaryExpression */ && node.operatorToken.kind === 64 /* EqualsToken */; + return node.kind === 209 /* BindingElement */ && !!node.initializer || node.kind === 304 /* PropertyAssignment */ && hasDefaultValue(node.initializer) || node.kind === 305 /* ShorthandPropertyAssignment */ && !!node.objectAssignmentInitializer || node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 64 /* EqualsToken */; } function isSpreadIntoCallOrNew(node) { const parent2 = walkUpParenthesizedExpressions(node.parent); @@ -77469,7 +78399,7 @@ function createTypeChecker(host) { let hasOmittedExpression = false; for (let i = 0; i < elementCount; i++) { const e = elements[i]; - if (e.kind === 230 /* SpreadElement */) { + if (e.kind === 231 /* SpreadElement */) { if (languageVersion < LanguageFeatureMinimumTarget.SpreadElements) { checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */); } @@ -77493,7 +78423,7 @@ function createTypeChecker(host) { elementTypes.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, e.expression)); elementFlags.push(4 /* Rest */); } - } else if (exactOptionalPropertyTypes && e.kind === 232 /* OmittedExpression */) { + } else if (exactOptionalPropertyTypes && e.kind === 233 /* OmittedExpression */) { hasOmittedExpression = true; elementTypes.push(undefinedOrMissingType); elementFlags.push(2 /* Optional */); @@ -77543,7 +78473,7 @@ function createTypeChecker(host) { } function isNumericName(name) { switch (name.kind) { - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: return isNumericComputedName(name); case 80 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -77560,7 +78490,7 @@ function createTypeChecker(host) { function checkComputedPropertyName(node) { const links = getNodeLinks(node.expression); if (!links.resolvedType) { - if ((isTypeLiteralNode(node.parent.parent) || isClassLike(node.parent.parent) || isInterfaceDeclaration(node.parent.parent)) && isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 103 /* InKeyword */ && node.parent.kind !== 177 /* GetAccessor */ && node.parent.kind !== 178 /* SetAccessor */) { + if ((isTypeLiteralNode(node.parent.parent) || isClassLike(node.parent.parent) || isInterfaceDeclaration(node.parent.parent)) && isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 103 /* InKeyword */ && node.parent.kind !== 178 /* GetAccessor */ && node.parent.kind !== 179 /* SetAccessor */) { return links.resolvedType = errorType; } links.resolvedType = checkExpression(node.expression); @@ -77644,7 +78574,7 @@ function createTypeChecker(host) { /*contextFlags*/ void 0 ); - const contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 206 /* ObjectBindingPattern */ || contextualType.pattern.kind === 210 /* ObjectLiteralExpression */); + const contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 207 /* ObjectBindingPattern */ || contextualType.pattern.kind === 211 /* ObjectLiteralExpression */); const inConstContext = isConstContext(node); const checkFlags = inConstContext ? 8 /* Readonly */ : 0; const isInJavascript = isInJSFile(node) && !isInJsonFile(node); @@ -77663,13 +78593,13 @@ function createTypeChecker(host) { let offset = 0; for (const memberDecl of node.properties) { let member = getSymbolOfDeclaration(memberDecl); - const computedNameType = memberDecl.name && memberDecl.name.kind === 167 /* ComputedPropertyName */ ? checkComputedPropertyName(memberDecl.name) : void 0; - if (memberDecl.kind === 303 /* PropertyAssignment */ || memberDecl.kind === 304 /* ShorthandPropertyAssignment */ || isObjectLiteralMethod(memberDecl)) { - let type = memberDecl.kind === 303 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : ( + const computedNameType = memberDecl.name && memberDecl.name.kind === 168 /* ComputedPropertyName */ ? checkComputedPropertyName(memberDecl.name) : void 0; + if (memberDecl.kind === 304 /* PropertyAssignment */ || memberDecl.kind === 305 /* ShorthandPropertyAssignment */ || isObjectLiteralMethod(memberDecl)) { + let type = memberDecl.kind === 304 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : ( // avoid resolving the left side of the ShorthandPropertyAssignment outside of the destructuring // for error recovery purposes. For example, if a user wrote `{ a = 100 }` instead of `{ a: 100 }`. // we don't want to say "could not find 'a'". - memberDecl.kind === 304 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode) + memberDecl.kind === 305 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode) ); if (isInJavascript) { const jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -77705,13 +78635,13 @@ function createTypeChecker(host) { prop.links.target = member; member = prop; allPropertiesTable == null ? void 0 : allPropertiesTable.set(prop.escapedName, prop); - if (contextualType && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 303 /* PropertyAssignment */ || memberDecl.kind === 174 /* MethodDeclaration */) && isContextSensitive(memberDecl)) { + if (contextualType && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 304 /* PropertyAssignment */ || memberDecl.kind === 175 /* MethodDeclaration */) && isContextSensitive(memberDecl)) { const inferenceContext = getInferenceContext(node); Debug.assert(inferenceContext); - const inferenceNode = memberDecl.kind === 303 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl; + const inferenceNode = memberDecl.kind === 304 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl; addIntraExpressionInferenceSite(inferenceContext, inferenceNode, type); } - } else if (memberDecl.kind === 305 /* SpreadAssignment */) { + } else if (memberDecl.kind === 306 /* SpreadAssignment */) { if (languageVersion < LanguageFeatureMinimumTarget.ObjectAssign) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } @@ -77740,7 +78670,7 @@ function createTypeChecker(host) { } continue; } else { - Debug.assert(memberDecl.kind === 177 /* GetAccessor */ || memberDecl.kind === 178 /* SetAccessor */); + Debug.assert(memberDecl.kind === 178 /* GetAccessor */ || memberDecl.kind === 179 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) { @@ -77890,7 +78820,7 @@ function createTypeChecker(host) { addIntraExpressionInferenceSite(inferenceContext, inferenceNode, exprType); } } else { - Debug.assert(attributeDecl.kind === 293 /* JsxSpreadAttribute */); + Debug.assert(attributeDecl.kind === 294 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { spread = getSpreadType( spread, @@ -77999,7 +78929,7 @@ function createTypeChecker(host) { if (!child.containsOnlyTriviaWhiteSpaces) { childrenTypes.push(stringType); } - } else if (child.kind === 294 /* JsxExpression */ && !child.expression) { + } else if (child.kind === 295 /* JsxExpression */ && !child.expression) { continue; } else { childrenTypes.push(checkExpressionForMutableLocation(child, checkMode)); @@ -78368,7 +79298,7 @@ function createTypeChecker(host) { } } function checkPropertyAccessibility(node, isSuper, writing, type, prop, reportError = true) { - const errorNode = !reportError ? void 0 : node.kind === 166 /* QualifiedName */ ? node.right : node.kind === 205 /* ImportType */ ? node : node.kind === 208 /* BindingElement */ && node.propertyName ? node.propertyName : node.name; + const errorNode = !reportError ? void 0 : node.kind === 167 /* QualifiedName */ ? node.right : node.kind === 206 /* ImportType */ ? node : node.kind === 209 /* BindingElement */ && node.propertyName ? node.propertyName : node.name; return checkPropertyAccessibilityAtLocation(node, isSuper, writing, type, prop, errorNode); } function checkPropertyAccessibilityAtLocation(location, isSuper, writing, containingType, prop, errorNode) { @@ -78578,7 +79508,7 @@ function createTypeChecker(host) { return checkPropertyAccessExpressionOrQualifiedName(node, node.left, leftType, node.right, checkMode); } function isMethodAccessForCall(node) { - while (node.parent.kind === 217 /* ParenthesizedExpression */) { + while (node.parent.kind === 218 /* ParenthesizedExpression */) { node = node.parent; } return isCallOrNewExpression(node.parent) && node.parent.expression === node; @@ -78759,7 +79689,7 @@ function createTypeChecker(host) { /*skipObjectFunctionPropertyAugment*/ isConstEnumObjectType(apparentType), /*includeTypeOnlyMembers*/ - node.kind === 166 /* QualifiedName */ + node.kind === 167 /* QualifiedName */ ); } markLinkedReferences(node, 2 /* Property */, prop, leftType); @@ -78853,7 +79783,7 @@ function createTypeChecker(host) { if (declaration && isPropertyWithoutInitializer(declaration)) { if (!isStatic(declaration)) { const flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 176 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 33554432 /* Ambient */)) { + if (flowContainer.kind === 177 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 33554432 /* Ambient */)) { assumeUninitialized = true; } } @@ -78877,38 +79807,28 @@ function createTypeChecker(host) { const declarationName = idText(right); if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) & 256 /* Static */) && (useDefineForClassFields || !isPropertyDeclaredInAncestorClass(prop))) { diagnosticMessage = error2(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName); - } else if (valueDeclaration.kind === 263 /* ClassDeclaration */ && node.parent.kind !== 183 /* TypeReference */ && !(valueDeclaration.flags & 33554432 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { + } else if (valueDeclaration.kind === 264 /* ClassDeclaration */ && node.parent.kind !== 184 /* TypeReference */ && !(valueDeclaration.flags & 33554432 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error2(right, Diagnostics.Class_0_used_before_its_declaration, declarationName); } if (diagnosticMessage) { addRelatedInfo(diagnosticMessage, createDiagnosticForNode(valueDeclaration, Diagnostics._0_is_declared_here, declarationName)); } } - function isInPropertyInitializerOrClassStaticBlock(node) { + function isInPropertyInitializerOrClassStaticBlock(node, ignoreArrowFunctions) { return !!findAncestor(node, (node2) => { switch (node2.kind) { - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: return true; - case 303 /* PropertyAssignment */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 305 /* SpreadAssignment */: - case 167 /* ComputedPropertyName */: - case 239 /* TemplateSpan */: - case 294 /* JsxExpression */: - case 291 /* JsxAttribute */: - case 292 /* JsxAttributes */: - case 293 /* JsxSpreadAttribute */: - case 286 /* JsxOpeningElement */: - case 233 /* ExpressionWithTypeArguments */: - case 298 /* HeritageClause */: - return false; - case 219 /* ArrowFunction */: - case 244 /* ExpressionStatement */: - return isBlock(node2.parent) && isClassStaticBlockDeclaration(node2.parent.parent) ? true : "quit"; + case 187 /* TypeQuery */: + case 288 /* JsxClosingElement */: + return "quit"; + case 220 /* ArrowFunction */: + return ignoreArrowFunctions ? false : "quit"; + case 242 /* Block */: + return isFunctionLikeDeclaration(node2.parent) && node2.parent.kind !== 220 /* ArrowFunction */ ? "quit" : false; default: - return isExpressionNode(node2) ? false : "quit"; + return false; } }); } @@ -78989,7 +79909,7 @@ function createTypeChecker(host) { addErrorOrSuggestion(!isUncheckedJS || errorInfo.code !== Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code, resultDiagnostic); } function containerSeemsToBeEmptyDomElement(containingType) { - return compilerOptions.lib && !compilerOptions.lib.includes("dom") && everyContainedType(containingType, (type) => type.symbol && /^(?:EventTarget|Node|(?:HTML[a-zA-Z]*)?Element)$/.test(unescapeLeadingUnderscores(type.symbol.escapedName))) && isEmptyObjectType(containingType); + return compilerOptions.lib && !compilerOptions.lib.includes("lib.dom.d.ts") && everyContainedType(containingType, (type) => type.symbol && /^(?:EventTarget|Node|(?:HTML[a-zA-Z]*)?Element)$/.test(unescapeLeadingUnderscores(type.symbol.escapedName))) && isEmptyObjectType(containingType); } function typeHasStaticProperty(propName, containingType) { const prop = containingType.symbol && getPropertyOfType(getTypeOfSymbol(containingType.symbol), propName); @@ -79144,9 +80064,9 @@ function createTypeChecker(host) { } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return isValidPropertyAccessWithType(node, node.expression.kind === 108 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: return isValidPropertyAccessWithType( node, /*isSuper*/ @@ -79154,7 +80074,7 @@ function createTypeChecker(host) { propertyName, getWidenedType(checkExpression(node.left)) ); - case 205 /* ImportType */: + case 206 /* ImportType */: return isValidPropertyAccessWithType( node, /*isSuper*/ @@ -79167,7 +80087,7 @@ function createTypeChecker(host) { function isValidPropertyAccessForCompletions(node, type, property) { return isPropertyAccessible( node, - node.kind === 211 /* PropertyAccessExpression */ && node.expression.kind === 108 /* SuperKeyword */, + node.kind === 212 /* PropertyAccessExpression */ && node.expression.kind === 108 /* SuperKeyword */, /*isWrite*/ false, type, @@ -79200,7 +80120,7 @@ function createTypeChecker(host) { } function getForInVariableSymbol(node) { const initializer = node.initializer; - if (initializer.kind === 261 /* VariableDeclarationList */) { + if (initializer.kind === 262 /* VariableDeclarationList */) { const variable = initializer.declarations[0]; if (variable && !isBindingPattern(variable.name)) { return getSymbolOfDeclaration(variable); @@ -79221,7 +80141,7 @@ function createTypeChecker(host) { let child = expr; let node = expr.parent; while (node) { - if (node.kind === 249 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { + if (node.kind === 250 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { return true; } child = node; @@ -79271,7 +80191,7 @@ function createTypeChecker(host) { if (callLikeExpressionMayHaveTypeArguments(node)) { forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 215 /* TaggedTemplateExpression */) { + if (node.kind === 216 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); @@ -79322,7 +80242,7 @@ function createTypeChecker(host) { } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 230 /* SpreadElement */ || arg.kind === 237 /* SyntheticExpression */ && arg.isSpread); + return !!arg && (arg.kind === 231 /* SpreadElement */ || arg.kind === 238 /* SyntheticExpression */ && arg.isSpread); } function getSpreadArgumentIndex(args) { return findIndex(args, isSpreadArgument); @@ -79339,9 +80259,9 @@ function createTypeChecker(host) { let callIsIncomplete = false; let effectiveParameterCount = getParameterCount(signature); let effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 215 /* TaggedTemplateExpression */) { + if (node.kind === 216 /* TaggedTemplateExpression */) { argCount = args.length; - if (node.template.kind === 228 /* TemplateExpression */) { + if (node.template.kind === 229 /* TemplateExpression */) { const lastSpan = last(node.template.templateSpans); callIsIncomplete = nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } else { @@ -79349,9 +80269,9 @@ function createTypeChecker(host) { Debug.assert(templateLiteral.kind === 15 /* NoSubstitutionTemplateLiteral */); callIsIncomplete = !!templateLiteral.isUnterminated; } - } else if (node.kind === 170 /* Decorator */) { + } else if (node.kind === 171 /* Decorator */) { argCount = getDecoratorArgumentCount(node, signature); - } else if (node.kind === 226 /* BinaryExpression */) { + } else if (node.kind === 227 /* BinaryExpression */) { argCount = 1; } else if (isJsxOpeningLikeElement(node)) { callIsIncomplete = node.attributes.end === node.end; @@ -79362,7 +80282,7 @@ function createTypeChecker(host) { effectiveParameterCount = args.length === 0 ? effectiveParameterCount : 1; effectiveMinimumArguments = Math.min(effectiveMinimumArguments, 1); } else if (!node.arguments) { - Debug.assert(node.kind === 214 /* NewExpression */); + Debug.assert(node.kind === 215 /* NewExpression */); return getMinArgumentCount(signature) === 0; } else { argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; @@ -79462,7 +80382,7 @@ function createTypeChecker(host) { if (isJsxOpeningLikeElement(node)) { return inferJsxTypeArguments(node, signature, checkMode, context); } - if (node.kind !== 170 /* Decorator */ && node.kind !== 226 /* BinaryExpression */) { + if (node.kind !== 171 /* Decorator */ && node.kind !== 227 /* BinaryExpression */) { const skipBindingPatterns = every(signature.typeParameters, (p) => !!getDefaultFromTypeParameter(p)); const contextualType = getContextualType2(node, skipBindingPatterns ? 8 /* SkipBindingPatterns */ : 0 /* None */); if (contextualType) { @@ -79478,7 +80398,7 @@ function createTypeChecker(host) { inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 128 /* ReturnType */); } const returnContext = createInferenceContext(signature.typeParameters, signature, context.flags); - const returnSourceType = instantiateType(contextualType, outerContext && outerContext.returnMapper); + const returnSourceType = instantiateType(contextualType, outerContext && createOuterReturnMapper(outerContext)); inferTypes(returnContext.inferences, returnSourceType, inferenceTargetType); context.returnMapper = some(returnContext.inferences, hasInferenceCandidates) ? getMapperFromContext(cloneInferredPartOfContext(returnContext)) : void 0; } @@ -79499,7 +80419,7 @@ function createTypeChecker(host) { } for (let i = 0; i < argCount; i++) { const arg = args[i]; - if (arg.kind !== 232 /* OmittedExpression */) { + if (arg.kind !== 233 /* OmittedExpression */) { const paramType = getTypeAtPosition(signature, i); if (couldContainTypeVariables(paramType)) { const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); @@ -79527,11 +80447,11 @@ function createTypeChecker(host) { if (index >= argCount - 1) { const arg = args[argCount - 1]; if (isSpreadArgument(arg)) { - const spreadType = arg.kind === 237 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode); + const spreadType = arg.kind === 238 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode); if (isArrayLikeType(spreadType)) { return getMutableArrayOrTupleType(spreadType); } - return createArrayType(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 230 /* SpreadElement */ ? arg.expression : arg), inConstContext); + return createArrayType(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 231 /* SpreadElement */ ? arg.expression : arg), inConstContext); } } const types = []; @@ -79540,12 +80460,12 @@ function createTypeChecker(host) { for (let i = index; i < argCount; i++) { const arg = args[i]; if (isSpreadArgument(arg)) { - const spreadType = arg.kind === 237 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression); + const spreadType = arg.kind === 238 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression); if (isArrayLikeType(spreadType)) { types.push(spreadType); flags.push(8 /* Variadic */); } else { - types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 230 /* SpreadElement */ ? arg.expression : arg)); + types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 231 /* SpreadElement */ ? arg.expression : arg)); flags.push(4 /* Rest */); } } else { @@ -79555,7 +80475,7 @@ function createTypeChecker(host) { types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType)); flags.push(1 /* Required */); } - if (arg.kind === 237 /* SyntheticExpression */ && arg.tupleNameSource) { + if (arg.kind === 238 /* SyntheticExpression */ && arg.tupleNameSource) { names.push(arg.tupleNameSource); } else { names.push(void 0); @@ -79714,7 +80634,7 @@ function createTypeChecker(host) { const flags = isInJSFile(argument) ? 1 /* Parentheses */ | 32 /* Satisfies */ | -2147483648 /* ExcludeJSDocTypeAssertion */ : 1 /* Parentheses */ | 32 /* Satisfies */; return skipOuterExpressions(argument, flags); } - function getSignatureApplicabilityError(node, args, signature, relation, checkMode, reportErrors2, containingMessageChain, inferenceContext) { + function getSignatureApplicabilityError(node, args, signature, relation, checkMode, reportErrors2, containingMessageChain) { const errorOutputContainer = { errors: void 0, skipLogging: true }; if (isJsxCallLike(node)) { if (!checkApplicableSignatureForJsxCallLikeElement(node, signature, relation, checkMode, reportErrors2, containingMessageChain, errorOutputContainer)) { @@ -79739,7 +80659,7 @@ function createTypeChecker(host) { const argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (let i = 0; i < argCount; i++) { const arg = args[i]; - if (arg.kind !== 232 /* OmittedExpression */) { + if (arg.kind !== 233 /* OmittedExpression */) { const paramType = getTypeAtPosition(signature, i); const argType = checkExpressionWithContextualType( arg, @@ -79748,8 +80668,7 @@ function createTypeChecker(host) { void 0, checkMode ); - const regularArgType = checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType; - const checkArgType = inferenceContext ? instantiateType(regularArgType, inferenceContext.nonFixingMapper) : regularArgType; + const checkArgType = checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType; const effectiveCheckArgumentNode = getEffectiveCheckNode(arg); if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors2 ? effectiveCheckArgumentNode : void 0, effectiveCheckArgumentNode, headMessage, containingMessageChain, errorOutputContainer)) { Debug.assert(!reportErrors2 || !!errorOutputContainer.errors, "parameter should have errors when reporting errors"); @@ -79799,10 +80718,10 @@ function createTypeChecker(host) { } } function getThisArgumentOfCall(node) { - if (node.kind === 226 /* BinaryExpression */) { + if (node.kind === 227 /* BinaryExpression */) { return node.right; } - const expression = node.kind === 213 /* CallExpression */ ? node.expression : node.kind === 215 /* TaggedTemplateExpression */ ? node.tag : node.kind === 170 /* Decorator */ && !legacyDecorators ? node.expression : void 0; + const expression = node.kind === 214 /* CallExpression */ ? node.expression : node.kind === 216 /* TaggedTemplateExpression */ ? node.tag : node.kind === 171 /* Decorator */ && !legacyDecorators ? node.expression : void 0; if (expression) { const callee = skipOuterExpressions(expression); if (isAccessExpression(callee)) { @@ -79820,20 +80739,20 @@ function createTypeChecker(host) { if (isJsxOpeningFragment(node)) { return [createSyntheticExpression(node, emptyFreshJsxObjectType)]; } - if (node.kind === 215 /* TaggedTemplateExpression */) { + if (node.kind === 216 /* TaggedTemplateExpression */) { const template = node.template; const args2 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 228 /* TemplateExpression */) { + if (template.kind === 229 /* TemplateExpression */) { forEach(template.templateSpans, (span) => { args2.push(span.expression); }); } return args2; } - if (node.kind === 170 /* Decorator */) { + if (node.kind === 171 /* Decorator */) { return getEffectiveDecoratorArguments(node); } - if (node.kind === 226 /* BinaryExpression */) { + if (node.kind === 227 /* BinaryExpression */) { return [node.left]; } if (isJsxOpeningLikeElement(node)) { @@ -79845,7 +80764,7 @@ function createTypeChecker(host) { const effectiveArgs = args.slice(0, spreadIndex); for (let i = spreadIndex; i < args.length; i++) { const arg = args[i]; - const spreadType = arg.kind === 230 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression)); + const spreadType = arg.kind === 231 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression)); if (spreadType && isTupleType(spreadType)) { forEach(getElementTypes(spreadType), (t, i2) => { var _a; @@ -79882,16 +80801,16 @@ function createTypeChecker(host) { } function getLegacyDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: return 1; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return hasAccessorModifier(node.parent) ? 3 : 2; - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return signature.parameters.length <= 2 ? 2 : 3; - case 169 /* Parameter */: + case 170 /* Parameter */: return 3; default: return Debug.fail(); @@ -80101,11 +81020,11 @@ function createTypeChecker(host) { return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, headMessage) { - const isTaggedTemplate = node.kind === 215 /* TaggedTemplateExpression */; - const isDecorator2 = node.kind === 170 /* Decorator */; + const isTaggedTemplate = node.kind === 216 /* TaggedTemplateExpression */; + const isDecorator2 = node.kind === 171 /* Decorator */; const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node); const isJsxOpenFragment = isJsxOpeningFragment(node); - const isInstanceof = node.kind === 226 /* BinaryExpression */; + const isInstanceof = node.kind === 227 /* BinaryExpression */; const reportErrors2 = !isInferencePartiallyBlocked && !candidatesOutArray; let candidatesForArgumentError; let candidateForArgumentArityError; @@ -80123,14 +81042,19 @@ function createTypeChecker(host) { candidates = candidatesOutArray || []; reorderCandidates(signatures, candidates, callChainFlags); if (!isJsxOpenFragment) { - Debug.assert(candidates.length, "Revert #54442 and add a testcase with whatever triggered this"); + if (!candidates.length) { + if (reportErrors2) { + diagnostics.add(getDiagnosticForCallNode(node, Diagnostics.Call_target_does_not_contain_any_signatures)); + } + return resolveErrorCall(node); + } } const args = getEffectiveCallArguments(node); const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters; if (!isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive)) { argCheckMode = 4 /* SkipContextSensitive */; } - const signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 213 /* CallExpression */ && node.arguments.hasTrailingComma; + const signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 214 /* CallExpression */ && node.arguments.hasTrailingComma; if (candidates.length > 1) { result = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); } @@ -80170,9 +81094,7 @@ function createTypeChecker(host) { 0 /* Normal */, /*reportErrors*/ true, - () => chain, - /*inferenceContext*/ - void 0 + () => chain ); if (diags) { for (const d of diags) { @@ -80208,9 +81130,7 @@ function createTypeChecker(host) { 0 /* Normal */, /*reportErrors*/ true, - chain2, - /*inferenceContext*/ - void 0 + chain2 ); if (diags2) { if (diags2.length <= min2) { @@ -80284,7 +81204,6 @@ function createTypeChecker(host) { candidateForTypeArgumentError = oldCandidateForTypeArgumentError; } function chooseOverload(candidates2, relation, isSingleNonGenericCandidate2, signatureHelpTrailingComma2 = false) { - var _a, _b; candidatesForArgumentError = void 0; candidateForArgumentArityError = void 0; candidateForTypeArgumentError = void 0; @@ -80302,8 +81221,6 @@ function createTypeChecker(host) { /*reportErrors*/ false, /*containingMessageChain*/ - void 0, - /*inferenceContext*/ void 0 )) { candidatesForArgumentError = [candidate]; @@ -80312,18 +81229,13 @@ function createTypeChecker(host) { return candidate; } for (let candidateIndex = 0; candidateIndex < candidates2.length; candidateIndex++) { - let candidate = candidates2[candidateIndex]; + const candidate = candidates2[candidateIndex]; if (!hasCorrectTypeArgumentArity(candidate, typeArguments) || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma2)) { continue; } let checkCandidate; let inferenceContext; if (candidate.typeParameters) { - const paramLocation = (_b = (_a = candidate.typeParameters[0].symbol.declarations) == null ? void 0 : _a[0]) == null ? void 0 : _b.parent; - const candidateParameterContext = paramLocation || (candidate.declaration && isConstructorDeclaration(candidate.declaration) ? candidate.declaration.parent : candidate.declaration); - if (candidateParameterContext && findAncestor(node, (a) => a === candidateParameterContext)) { - candidate = getImplementationSignature(candidate); - } let typeArgumentTypes; if (some(typeArguments)) { typeArgumentTypes = checkTypeArguments( @@ -80343,7 +81255,7 @@ function createTypeChecker(host) { /*flags*/ isInJSFile(node) ? 2 /* AnyDefault */ : 0 /* None */ ); - typeArgumentTypes = instantiateTypes(inferTypeArguments(node, candidate, args, argCheckMode | 8 /* SkipGenericFunctions */, inferenceContext), inferenceContext.nonFixingMapper); + typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode | 8 /* SkipGenericFunctions */, inferenceContext); argCheckMode |= inferenceContext.flags & 4 /* SkippedGenericFunction */ ? 8 /* SkipGenericFunctions */ : 0 /* Normal */; } checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext && inferenceContext.inferredTypeParameters); @@ -80363,8 +81275,7 @@ function createTypeChecker(host) { /*reportErrors*/ false, /*containingMessageChain*/ - void 0, - inferenceContext + void 0 )) { (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); continue; @@ -80372,7 +81283,7 @@ function createTypeChecker(host) { if (argCheckMode) { argCheckMode = 0 /* Normal */; if (inferenceContext) { - const typeArgumentTypes = instantiateTypes(inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext), inferenceContext.mapper); + const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext); checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters); if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma2)) { candidateForArgumentArityError = checkCandidate; @@ -80388,8 +81299,7 @@ function createTypeChecker(host) { /*reportErrors*/ false, /*containingMessageChain*/ - void 0, - inferenceContext + void 0 )) { (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); continue; @@ -80674,7 +81584,7 @@ function createTypeChecker(host) { } const declaration = signature.declaration; const modifiers = getSelectedEffectiveModifierFlags(declaration, 6 /* NonPublicAccessibilityModifier */); - if (!modifiers || declaration.kind !== 176 /* Constructor */) { + if (!modifiers || declaration.kind !== 177 /* Constructor */) { return true; } const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -80704,11 +81614,11 @@ function createTypeChecker(host) { const maybeMissingAwait = awaitedType && getSignaturesOfType(awaitedType, kind).length > 0; if (apparentType.flags & 1048576 /* Union */) { const types = apparentType.types; - let hasSignatures = false; + let hasSignatures2 = false; for (const constituent of types) { const signatures = getSignaturesOfType(constituent, kind); if (signatures.length !== 0) { - hasSignatures = true; + hasSignatures2 = true; if (errorInfo) { break; } @@ -80725,12 +81635,12 @@ function createTypeChecker(host) { typeToString(apparentType) ); } - if (hasSignatures) { + if (hasSignatures2) { break; } } } - if (!hasSignatures) { + if (!hasSignatures2) { errorInfo = chainDiagnosticMessages( /*details*/ void 0, @@ -80813,16 +81723,16 @@ function createTypeChecker(host) { } function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: return Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 169 /* Parameter */: + case 170 /* Parameter */: return Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return Debug.fail(); @@ -81004,19 +81914,19 @@ function createTypeChecker(host) { } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 213 /* CallExpression */: + case 214 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 214 /* NewExpression */: + case 215 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 170 /* Decorator */: + case 171 /* Decorator */: return resolveDecorator(node, candidatesOutArray, checkMode); - case 289 /* JsxOpeningFragment */: - case 286 /* JsxOpeningElement */: - case 285 /* JsxSelfClosingElement */: + case 290 /* JsxOpeningFragment */: + case 287 /* JsxOpeningElement */: + case 286 /* JsxSelfClosingElement */: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return resolveInstanceofExpression(node, candidatesOutArray, checkMode); } Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -81129,7 +82039,7 @@ function createTypeChecker(host) { return false; } let parent2 = node.parent; - while (parent2 && parent2.kind === 211 /* PropertyAccessExpression */) { + while (parent2 && parent2.kind === 212 /* PropertyAccessExpression */) { parent2 = parent2.parent; } if (parent2 && isBinaryExpression(parent2) && isPrototypeAccess(parent2.left) && parent2.operatorToken.kind === 64 /* EqualsToken */) { @@ -81153,9 +82063,9 @@ function createTypeChecker(host) { if (node.expression.kind === 108 /* SuperKeyword */) { return voidType; } - if (node.kind === 214 /* NewExpression */) { + if (node.kind === 215 /* NewExpression */) { const declaration = signature.declaration; - if (declaration && declaration.kind !== 176 /* Constructor */ && declaration.kind !== 180 /* ConstructSignature */ && declaration.kind !== 185 /* ConstructorType */ && !(isJSDocSignature(declaration) && ((_b = (_a = getJSDocRoot(declaration)) == null ? void 0 : _a.parent) == null ? void 0 : _b.kind) === 176 /* Constructor */) && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { + if (declaration && declaration.kind !== 177 /* Constructor */ && declaration.kind !== 181 /* ConstructSignature */ && declaration.kind !== 186 /* ConstructorType */ && !(isJSDocSignature(declaration) && ((_b = (_a = getJSDocRoot(declaration)) == null ? void 0 : _a.parent) == null ? void 0 : _b.kind) === 177 /* Constructor */) && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { if (noImplicitAny) { error2(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -81169,7 +82079,7 @@ function createTypeChecker(host) { if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 213 /* CallExpression */ && !node.questionDotToken && node.parent.kind === 244 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { + if (node.kind === 214 /* CallExpression */ && !node.questionDotToken && node.parent.kind === 245 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { if (!isDottedName(node.expression)) { error2(node.expression, Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); } else if (!getEffectsSignature(node)) { @@ -81202,20 +82112,20 @@ function createTypeChecker(host) { function getDeprecatedSuggestionNode(node) { node = skipParentheses(node); switch (node.kind) { - case 213 /* CallExpression */: - case 170 /* Decorator */: - case 214 /* NewExpression */: + case 214 /* CallExpression */: + case 171 /* Decorator */: + case 215 /* NewExpression */: return getDeprecatedSuggestionNode(node.expression); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return getDeprecatedSuggestionNode(node.tag); - case 286 /* JsxOpeningElement */: - case 285 /* JsxSelfClosingElement */: + case 287 /* JsxOpeningElement */: + case 286 /* JsxSelfClosingElement */: return getDeprecatedSuggestionNode(node.tagName); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return node.argumentExpression; - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return node.name; - case 183 /* TypeReference */: + case 184 /* TypeReference */: const typeReference = node; return isQualifiedName(typeReference.typeName) ? typeReference.typeName.right : typeReference; default: @@ -81369,7 +82279,7 @@ function createTypeChecker(host) { if (resolvedRequire.flags & 2097152 /* Alias */) { return false; } - const targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ ? 262 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ ? 260 /* VariableDeclaration */ : 0 /* Unknown */; + const targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ ? 263 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ ? 261 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { const decl = getDeclarationOfKind(resolvedRequire, targetDeclarationKind); return !!decl && !!(decl.flags & 33554432 /* Ambient */); @@ -81386,11 +82296,16 @@ function createTypeChecker(host) { return getReturnTypeOfSignature(signature); } function checkAssertion(node, checkMode) { - if (node.kind === 216 /* TypeAssertionExpression */) { + if (node.kind === 217 /* TypeAssertionExpression */) { const file = getSourceFileOfNode(node); if (file && fileExtensionIsOneOf(file.fileName, [".cts" /* Cts */, ".mts" /* Mts */])) { grammarErrorOnNode(node, Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead); } + if (compilerOptions.erasableSyntaxOnly) { + const start = skipTrivia(file.text, node.pos); + const end = node.expression.pos; + diagnostics.add(createFileDiagnostic(file, start, end - start, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled)); + } } return checkAssertionWorker(node, checkMode); } @@ -81402,18 +82317,18 @@ function createTypeChecker(host) { case 10 /* BigIntLiteral */: case 112 /* TrueKeyword */: case 97 /* FalseKeyword */: - case 209 /* ArrayLiteralExpression */: - case 210 /* ObjectLiteralExpression */: - case 228 /* TemplateExpression */: + case 210 /* ArrayLiteralExpression */: + case 211 /* ObjectLiteralExpression */: + case 229 /* TemplateExpression */: return true; - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return isValidConstAssertionArgument(node.expression); - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: const op = node.operator; const arg = node.operand; return op === 41 /* MinusToken */ && (arg.kind === 9 /* NumericLiteral */ || arg.kind === 10 /* BigIntLiteral */) || op === 40 /* PlusToken */ && arg.kind === 9 /* NumericLiteral */; - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: const expr = skipParentheses(node.expression); const symbol = isEntityNameExpression(expr) ? resolveEntityName( expr, @@ -81444,12 +82359,12 @@ function createTypeChecker(host) { let type; let expression; switch (node.kind) { - case 234 /* AsExpression */: - case 216 /* TypeAssertionExpression */: + case 235 /* AsExpression */: + case 217 /* TypeAssertionExpression */: type = node.type; expression = node.expression; break; - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: type = getJSDocTypeAssertionType(node); expression = node.expression; break; @@ -81483,13 +82398,13 @@ function createTypeChecker(host) { function checkExpressionWithTypeArguments(node) { checkGrammarExpressionWithTypeArguments(node); forEach(node.typeArguments, checkSourceElement); - if (node.kind === 233 /* ExpressionWithTypeArguments */) { + if (node.kind === 234 /* ExpressionWithTypeArguments */) { const parent2 = walkUpParenthesizedExpressions(node.parent); - if (parent2.kind === 226 /* BinaryExpression */ && parent2.operatorToken.kind === 104 /* InstanceOfKeyword */ && isNodeDescendantOf(node, parent2.right)) { + if (parent2.kind === 227 /* BinaryExpression */ && parent2.operatorToken.kind === 104 /* InstanceOfKeyword */ && isNodeDescendantOf(node, parent2.right)) { error2(node, Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression); } } - const exprType = node.kind === 233 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName); + const exprType = node.kind === 234 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName); return getInstantiationExpressionType(exprType, node); } function getInstantiationExpressionType(exprType, node) { @@ -81514,11 +82429,11 @@ function createTypeChecker(host) { } return result; function getInstantiatedType(type) { - let hasSignatures = false; + let hasSignatures2 = false; let hasApplicableSignature = false; const result2 = getInstantiatedTypePart(type); hasSomeApplicableSignature || (hasSomeApplicableSignature = hasApplicableSignature); - if (hasSignatures && !hasApplicableSignature) { + if (hasSignatures2 && !hasApplicableSignature) { nonApplicableType ?? (nonApplicableType = type); } return result2; @@ -81527,7 +82442,7 @@ function createTypeChecker(host) { const resolved = resolveStructuredTypeMembers(type2); const callSignatures = getInstantiatedSignatures(resolved.callSignatures); const constructSignatures = getInstantiatedSignatures(resolved.constructSignatures); - hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0); + hasSignatures2 || (hasSignatures2 = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0); hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0); if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) { const result3 = createAnonymousType(createSymbol(0 /* None */, "__instantiationExpression" /* InstantiationExpression */), resolved.members, callSignatures, constructSignatures, resolved.indexInfos); @@ -81574,7 +82489,7 @@ function createTypeChecker(host) { if (isErrorType(targetType)) { return targetType; } - const errorNode = findAncestor(target.parent, (n) => n.kind === 238 /* SatisfiesExpression */ || n.kind === 350 /* JSDocSatisfiesTag */); + const errorNode = findAncestor(target.parent, (n) => n.kind === 239 /* SatisfiesExpression */ || n.kind === 351 /* JSDocSatisfiesTag */); checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, errorNode, expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1); return exprType; } @@ -81584,6 +82499,10 @@ function createTypeChecker(host) { return checkNewTargetMetaProperty(node); } if (node.keywordToken === 102 /* ImportKeyword */) { + if (node.name.escapedText === "defer") { + Debug.assert(!isCallExpression(node.parent) || node.parent.expression !== node, "Trying to get the type of `import.defer` in `import.defer(...)`"); + return errorType; + } return checkImportMetaProperty(node); } return Debug.assertNever(node.keywordToken); @@ -81604,7 +82523,7 @@ function createTypeChecker(host) { if (!container) { error2(node, Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; - } else if (container.kind === 176 /* Constructor */) { + } else if (container.kind === 177 /* Constructor */) { const symbol = getSymbolOfDeclaration(container.parent); return getTypeOfSymbol(symbol); } else { @@ -81618,7 +82537,7 @@ function createTypeChecker(host) { error2(node, Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output); } } else if (moduleKind < 6 /* ES2020 */ && moduleKind !== 4 /* System */) { - error2(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_or_nodenext); + error2(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_node20_or_nodenext); } const file = getSourceFileOfNode(node); Debug.assert(!!(file.flags & 8388608 /* PossiblyContainsImportMeta */), "Containing file is missing import meta node flag."); @@ -81644,7 +82563,7 @@ function createTypeChecker(host) { return elementFlags & 3 /* Fixed */ ? name : `${name}_n`; } } - case 207 /* ArrayBindingPattern */: { + case 208 /* ArrayBindingPattern */: { if (node.dotDotDotToken) { const elements = node.name.elements; const lastElement = tryCast(lastOrUndefined(elements), isBindingElement); @@ -81690,7 +82609,7 @@ function createTypeChecker(host) { } function getParameterIdentifierInfoAtPosition(signature, pos) { var _a; - if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 317 /* JSDocFunctionType */) { + if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 318 /* JSDocFunctionType */) { return void 0; } const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); @@ -81729,7 +82648,7 @@ function createTypeChecker(host) { return symbol.valueDeclaration && isParameter(symbol.valueDeclaration) && isIdentifier(symbol.valueDeclaration.name) && symbol.valueDeclaration.name; } function isValidDeclarationForTupleLabel(d) { - return d.kind === 202 /* NamedTupleMember */ || isParameter(d) && d.name && isIdentifier(d.name); + return d.kind === 203 /* NamedTupleMember */ || isParameter(d) && d.name && isIdentifier(d.name); } function getNameableDeclarationAtPosition(signature, pos) { const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); @@ -81864,14 +82783,14 @@ function createTypeChecker(host) { function getTypeOfFirstParameterOfSignatureWithFallback(signature, fallbackType) { return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : fallbackType; } - function inferFromAnnotatedParameters(signature, context, inferenceContext) { + function inferFromAnnotatedParametersAndReturn(signature, context, inferenceContext) { const len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); for (let i = 0; i < len; i++) { const declaration = signature.parameters[i].valueDeclaration; - const typeNode = getEffectiveTypeAnnotationNode(declaration); - if (typeNode) { + const typeNode2 = getEffectiveTypeAnnotationNode(declaration); + if (typeNode2) { const source = addOptionality( - getTypeFromTypeNode(typeNode), + getTypeFromTypeNode(typeNode2), /*isProperty*/ false, isOptionalDeclaration(declaration) @@ -81880,6 +82799,12 @@ function createTypeChecker(host) { inferTypes(inferenceContext.inferences, source, target); } } + const typeNode = signature.declaration && getEffectiveReturnTypeNode(signature.declaration); + if (typeNode) { + const source = getTypeFromTypeNode(typeNode); + const target = getReturnTypeOfSignature(context); + inferTypes(inferenceContext.inferences, source, target); + } } function assignContextualParameterTypes(signature, context) { if (context.typeParameters) { @@ -82084,17 +83009,17 @@ function createTypeChecker(host) { if (!links.decoratorSignature) { links.decoratorSignature = anySignature; switch (parent2.kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: { + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: { const node = parent2; const targetType = getTypeOfSymbol(getSymbolOfDeclaration(node)); const contextType = createClassDecoratorContextType(targetType); links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, targetType); break; } - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: { + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: { const node = parent2; if (!isClassLike(node.parent)) break; const valueType = isMethodDeclaration(node) ? getOrCreateTypeFromSignature(getSignatureFromDeclaration(node)) : getTypeOfNode(node); @@ -82105,7 +83030,7 @@ function createTypeChecker(host) { links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, returnType); break; } - case 172 /* PropertyDeclaration */: { + case 173 /* PropertyDeclaration */: { const node = parent2; if (!isClassLike(node.parent)) break; const valueType = getTypeOfNode(node); @@ -82126,8 +83051,8 @@ function createTypeChecker(host) { if (!links.decoratorSignature) { links.decoratorSignature = anySignature; switch (parent2.kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: { + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: { const node = parent2; const targetType = getTypeOfSymbol(getSymbolOfDeclaration(node)); const targetParam = createParameter2("target", targetType); @@ -82141,7 +83066,7 @@ function createTypeChecker(host) { ); break; } - case 169 /* Parameter */: { + case 170 /* Parameter */: { const node = parent2; if (!isConstructorDeclaration(node.parent) && !(isMethodDeclaration(node.parent) || isSetAccessorDeclaration(node.parent) && isClassLike(node.parent.parent))) { break; @@ -82167,10 +83092,10 @@ function createTypeChecker(host) { ); break; } - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 172 /* PropertyDeclaration */: { + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 173 /* PropertyDeclaration */: { const node = parent2; if (!isClassLike(node.parent)) break; const targetType = getParentTypeOfClassElement(node); @@ -82270,7 +83195,7 @@ function createTypeChecker(host) { let yieldType; let nextType; let fallbackReturnType = voidType; - if (func.body.kind !== 241 /* Block */) { + if (func.body.kind !== 242 /* Block */) { returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */); if (isAsync) { returnType = unwrapAwaitedType(checkAwaitedType( @@ -82405,6 +83330,9 @@ function createTypeChecker(host) { return { yieldTypes, nextTypes }; } function getYieldedTypeOfYieldExpression(node, expressionType, sentType, isAsync) { + if (expressionType === silentNeverType) { + return silentNeverType; + } const errorNode = node.expression || node; const yieldedType = node.asteriskToken ? checkIteratedTypeOrElementType(isAsync ? 19 /* AsyncYieldStar */ : 17 /* YieldStar */, expressionType, sentType, errorNode) : expressionType; return !isAsync ? yieldedType : getAwaitedType( @@ -82435,7 +83363,7 @@ function createTypeChecker(host) { return links.isExhaustive; } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 221 /* TypeOfExpression */) { + if (node.expression.kind === 222 /* TypeOfExpression */) { const witnesses = getSwitchClauseTypeOfWitnesses(node); if (!witnesses) { return false; @@ -82473,14 +83401,14 @@ function createTypeChecker(host) { /*excludeJSDocTypeAssertions*/ true ); - if (functionFlags & 2 /* Async */ && expr.kind === 223 /* AwaitExpression */) { + if (functionFlags & 2 /* Async */ && expr.kind === 224 /* AwaitExpression */) { expr = skipParentheses( expr.expression, /*excludeJSDocTypeAssertions*/ true ); } - if (expr.kind === 213 /* CallExpression */ && expr.expression.kind === 80 /* Identifier */ && checkExpressionCached(expr.expression).symbol === getMergedSymbol(func.symbol) && (!isFunctionExpressionOrArrowFunction(func.symbol.valueDeclaration) || isConstantReference(expr.expression))) { + if (expr.kind === 214 /* CallExpression */ && expr.expression.kind === 80 /* Identifier */ && checkExpressionCached(expr.expression).symbol === getMergedSymbol(func.symbol) && (!isFunctionExpressionOrArrowFunction(func.symbol.valueDeclaration) || isConstantReference(expr.expression))) { hasReturnOfTypeNever = true; return; } @@ -82512,26 +83440,26 @@ function createTypeChecker(host) { } function mayReturnNever(func) { switch (func.kind) { - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return true; - case 174 /* MethodDeclaration */: - return func.parent.kind === 210 /* ObjectLiteralExpression */; + case 175 /* MethodDeclaration */: + return func.parent.kind === 211 /* ObjectLiteralExpression */; default: return false; } } function getTypePredicateFromBody(func) { switch (func.kind) { - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return void 0; } const functionFlags = getFunctionFlags(func); if (functionFlags !== 0 /* Normal */) return void 0; let singleReturn; - if (func.body && func.body.kind !== 241 /* Block */) { + if (func.body && func.body.kind !== 242 /* Block */) { singleReturn = func.body; } else { const bailedEarly = forEachReturnStatement(func.body, (returnStatement) => { @@ -82562,7 +83490,7 @@ function createTypeChecker(host) { }); } function checkIfExpressionRefinesParameter(func, expr, param, initType) { - const antecedent = canHaveFlowNode(expr) && expr.flowNode || expr.parent.kind === 253 /* ReturnStatement */ && expr.parent.flowNode || createFlowNode( + const antecedent = canHaveFlowNode(expr) && expr.flowNode || expr.parent.kind === 254 /* ReturnStatement */ && expr.parent.flowNode || createFlowNode( 2 /* Start */, /*node*/ void 0, @@ -82573,7 +83501,7 @@ function createTypeChecker(host) { const trueType2 = getFlowTypeOfReference(param.name, initType, initType, func, trueCondition); if (trueType2 === initType) return void 0; const falseCondition = createFlowNode(64 /* FalseCondition */, expr, antecedent); - const falseSubtype = getFlowTypeOfReference(param.name, initType, trueType2, func, falseCondition); + const falseSubtype = getReducedType(getFlowTypeOfReference(param.name, initType, trueType2, func, falseCondition)); return falseSubtype.flags & 131072 /* Never */ ? trueType2 : void 0; } function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) { @@ -82585,7 +83513,7 @@ function createTypeChecker(host) { if (type && (maybeTypeOfKind(type, 16384 /* Void */) || type.flags & (1 /* Any */ | 32768 /* Undefined */))) { return; } - if (func.kind === 173 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 241 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 174 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 242 /* Block */ || !functionHasImplicitReturn(func)) { return; } const hasExplicitReturn = func.flags & 1024 /* HasExplicitReturn */; @@ -82611,7 +83539,7 @@ function createTypeChecker(host) { } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node)); + Debug.assert(node.kind !== 175 /* MethodDeclaration */ || isObjectLiteralMethod(node)); checkNodeDeferred(node); if (isFunctionExpression(node)) { checkCollisionsForDeclarationName(node, node.name); @@ -82647,7 +83575,7 @@ function createTypeChecker(host) { return anyFunctionType; } const hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 218 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 219 /* FunctionExpression */) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -82668,7 +83596,7 @@ function createTypeChecker(host) { const inferenceContext = getInferenceContext(node); let instantiatedContextualSignature; if (checkMode && checkMode & 2 /* Inferential */) { - inferFromAnnotatedParameters(signature, contextualSignature, inferenceContext); + inferFromAnnotatedParametersAndReturn(signature, contextualSignature, inferenceContext); const restType = getEffectiveRestType(contextualSignature); if (restType && restType.flags & 262144 /* TypeParameter */) { instantiatedContextualSignature = instantiateSignature(contextualSignature, inferenceContext.nonFixingMapper); @@ -82682,7 +83610,7 @@ function createTypeChecker(host) { } else if (contextualSignature && !node.typeParameters && contextualSignature.parameters.length > node.parameters.length) { const inferenceContext = getInferenceContext(node); if (checkMode && checkMode & 2 /* Inferential */) { - inferFromAnnotatedParameters(signature, contextualSignature, inferenceContext); + inferFromAnnotatedParametersAndReturn(signature, contextualSignature, inferenceContext); } } if (contextualSignature && !getReturnTypeFromAnnotation(node) && !signature.resolvedReturnType) { @@ -82696,7 +83624,7 @@ function createTypeChecker(host) { } } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node)); + Debug.assert(node.kind !== 175 /* MethodDeclaration */ || isObjectLiteralMethod(node)); const functionFlags = getFunctionFlags(node); const returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -82704,7 +83632,7 @@ function createTypeChecker(host) { if (!getEffectiveReturnTypeNode(node)) { getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 241 /* Block */) { + if (node.body.kind === 242 /* Block */) { checkSourceElement(node.body); } else { const exprType = checkExpression(node.body); @@ -82765,7 +83693,7 @@ function createTypeChecker(host) { if (isReadonlySymbol(symbol)) { if (symbol.flags & 4 /* Property */ && isAccessExpression(expr) && expr.expression.kind === 110 /* ThisKeyword */) { const ctor = getControlFlowContainer(expr); - if (!(ctor && (ctor.kind === 176 /* Constructor */ || isJSConstructor(ctor)))) { + if (!(ctor && (ctor.kind === 177 /* Constructor */ || isJSConstructor(ctor)))) { return true; } if (symbol.valueDeclaration) { @@ -82786,7 +83714,7 @@ function createTypeChecker(host) { const symbol2 = getNodeLinks(node).resolvedSymbol; if (symbol2.flags & 2097152 /* Alias */) { const declaration = getDeclarationOfAliasSymbol(symbol2); - return !!declaration && declaration.kind === 274 /* NamespaceImport */; + return !!declaration && declaration.kind === 275 /* NamespaceImport */; } } } @@ -82861,6 +83789,7 @@ function createTypeChecker(host) { switch (moduleKind) { case 100 /* Node16 */: case 101 /* Node18 */: + case 102 /* Node20 */: case 199 /* NodeNext */: if (sourceFile.impliedNodeFormat === 1 /* CommonJS */) { span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos)); @@ -82881,7 +83810,7 @@ function createTypeChecker(host) { // fallthrough default: span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos)); - const message = isAwaitExpression(node) ? Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher : Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher; + const message = isAwaitExpression(node) ? Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher : Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher; diagnostics.add(createFileDiagnostic(sourceFile, span.start, span.length, message)); hasError = true; break; @@ -82893,7 +83822,7 @@ function createTypeChecker(host) { const span = getSpanOfTokenAtPosition(sourceFile, node.pos); const message = isAwaitExpression(node) ? Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules : Diagnostics.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules; const diagnostic = createFileDiagnostic(sourceFile, span.start, span.length, message); - if (container && container.kind !== 176 /* Constructor */ && (getFunctionFlags(container) & 2 /* Async */) === 0) { + if (container && container.kind !== 177 /* Constructor */ && (getFunctionFlags(container) & 2 /* Async */) === 0) { const relatedInfo = createDiagnosticForNode(container, Diagnostics.Did_you_mean_to_mark_this_function_as_async); addRelatedInfo(diagnostic, relatedInfo); } @@ -83122,7 +84051,7 @@ function createTypeChecker(host) { function checkObjectLiteralDestructuringPropertyAssignment(node, objectLiteralType, propertyIndex, allProperties, rightIsThis = false) { const properties = node.properties; const property = properties[propertyIndex]; - if (property.kind === 303 /* PropertyAssignment */ || property.kind === 304 /* ShorthandPropertyAssignment */) { + if (property.kind === 304 /* PropertyAssignment */ || property.kind === 305 /* ShorthandPropertyAssignment */) { const name = property.name; const exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -83143,8 +84072,8 @@ function createTypeChecker(host) { } const elementType = getIndexedAccessType(objectLiteralType, exprType, 32 /* ExpressionPosition */ | (hasDefaultValue(property) ? 16 /* AllowMissing */ : 0), name); const type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 304 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); - } else if (property.kind === 305 /* SpreadAssignment */) { + return checkDestructuringAssignment(property.kind === 305 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); + } else if (property.kind === 306 /* SpreadAssignment */) { if (propertyIndex < properties.length - 1) { error2(property, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } else { @@ -83176,7 +84105,7 @@ function createTypeChecker(host) { let inBoundsType = compilerOptions.noUncheckedIndexedAccess ? void 0 : possiblyOutOfBoundsType; for (let i = 0; i < elements.length; i++) { let type = possiblyOutOfBoundsType; - if (node.elements[i].kind === 230 /* SpreadElement */) { + if (node.elements[i].kind === 231 /* SpreadElement */) { type = inBoundsType = inBoundsType ?? (checkIteratedTypeOrElementType(65 /* Destructuring */, sourceType, undefinedType, node) || errorType); } checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, type, checkMode); @@ -83186,8 +84115,8 @@ function createTypeChecker(host) { function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { const elements = node.elements; const element = elements[elementIndex]; - if (element.kind !== 232 /* OmittedExpression */) { - if (element.kind !== 230 /* SpreadElement */) { + if (element.kind !== 233 /* OmittedExpression */) { + if (element.kind !== 231 /* SpreadElement */) { const indexType = getNumberLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { const accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(element) ? 16 /* AllowMissing */ : 0); @@ -83202,7 +84131,7 @@ function createTypeChecker(host) { error2(element, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } else { const restExpression = element.expression; - if (restExpression.kind === 226 /* BinaryExpression */ && restExpression.operatorToken.kind === 64 /* EqualsToken */) { + if (restExpression.kind === 227 /* BinaryExpression */ && restExpression.operatorToken.kind === 64 /* EqualsToken */) { error2(restExpression.operatorToken, Diagnostics.A_rest_element_cannot_have_an_initializer); } else { checkGrammarForDisallowedTrailingComma(node.elements, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); @@ -83215,7 +84144,7 @@ function createTypeChecker(host) { } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { let target; - if (exprOrAssignment.kind === 304 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 305 /* ShorthandPropertyAssignment */) { const prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { if (strictNullChecks && !hasTypeFacts(checkExpression(prop.objectAssignmentInitializer), 16777216 /* IsUndefined */)) { @@ -83227,25 +84156,25 @@ function createTypeChecker(host) { } else { target = exprOrAssignment; } - if (target.kind === 226 /* BinaryExpression */ && target.operatorToken.kind === 64 /* EqualsToken */) { + if (target.kind === 227 /* BinaryExpression */ && target.operatorToken.kind === 64 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; if (strictNullChecks) { sourceType = getTypeWithFacts(sourceType, 524288 /* NEUndefined */); } } - if (target.kind === 210 /* ObjectLiteralExpression */) { + if (target.kind === 211 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 209 /* ArrayLiteralExpression */) { + if (target.kind === 210 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { const targetType = checkExpression(target, checkMode); - const error3 = target.parent.kind === 305 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - const optionalError = target.parent.kind === 305 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; + const error3 = target.parent.kind === 306 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; + const optionalError = target.parent.kind === 306 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; if (checkReferenceExpression(target, error3, optionalError)) { checkTypeAssignableToAndOptionallyElaborate(sourceType, targetType, target, target); } @@ -83260,8 +84189,8 @@ function createTypeChecker(host) { case 80 /* Identifier */: case 11 /* StringLiteral */: case 14 /* RegularExpressionLiteral */: - case 215 /* TaggedTemplateExpression */: - case 228 /* TemplateExpression */: + case 216 /* TaggedTemplateExpression */: + case 229 /* TemplateExpression */: case 15 /* NoSubstitutionTemplateLiteral */: case 9 /* NumericLiteral */: case 10 /* BigIntLiteral */: @@ -83269,25 +84198,25 @@ function createTypeChecker(host) { case 97 /* FalseKeyword */: case 106 /* NullKeyword */: case 157 /* UndefinedKeyword */: - case 218 /* FunctionExpression */: - case 231 /* ClassExpression */: - case 219 /* ArrowFunction */: - case 209 /* ArrayLiteralExpression */: - case 210 /* ObjectLiteralExpression */: - case 221 /* TypeOfExpression */: - case 235 /* NonNullExpression */: - case 285 /* JsxSelfClosingElement */: - case 284 /* JsxElement */: + case 219 /* FunctionExpression */: + case 232 /* ClassExpression */: + case 220 /* ArrowFunction */: + case 210 /* ArrayLiteralExpression */: + case 211 /* ObjectLiteralExpression */: + case 222 /* TypeOfExpression */: + case 236 /* NonNullExpression */: + case 286 /* JsxSelfClosingElement */: + case 285 /* JsxElement */: return true; - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: if (isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: switch (node.operator) { case 54 /* ExclamationToken */: case 40 /* PlusToken */: @@ -83297,11 +84226,11 @@ function createTypeChecker(host) { } return false; // Some forms listed here for clarity - case 222 /* VoidExpression */: + case 223 /* VoidExpression */: // Explicit opt-out - case 216 /* TypeAssertionExpression */: + case 217 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 234 /* AsExpression */: + case 235 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; @@ -83346,7 +84275,7 @@ function createTypeChecker(host) { } checkNullishCoalesceOperands(node); const operator = node.operatorToken.kind; - if (operator === 64 /* EqualsToken */ && (node.left.kind === 210 /* ObjectLiteralExpression */ || node.left.kind === 209 /* ArrayLiteralExpression */)) { + if (operator === 64 /* EqualsToken */ && (node.left.kind === 211 /* ObjectLiteralExpression */ || node.left.kind === 210 /* ArrayLiteralExpression */)) { state.skip = true; setLastResult(state, checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 110 /* ThisKeyword */)); return state; @@ -83371,7 +84300,7 @@ function createTypeChecker(host) { const operator = operatorToken.kind; if (isLogicalOrCoalescingBinaryOperator(operator)) { let parent2 = node.parent; - while (parent2.kind === 217 /* ParenthesizedExpression */ || isLogicalOrCoalescingBinaryExpression(parent2)) { + while (parent2.kind === 218 /* ParenthesizedExpression */ || isLogicalOrCoalescingBinaryExpression(parent2)) { parent2 = parent2.parent; } if (operator === 56 /* AmpersandAmpersandToken */ || isIfStatement(parent2)) { @@ -83437,43 +84366,68 @@ function createTypeChecker(host) { } } function checkNullishCoalesceOperands(node) { - const { left, operatorToken, right } = node; - if (operatorToken.kind === 61 /* QuestionQuestionToken */) { - if (isBinaryExpression(left) && (left.operatorToken.kind === 57 /* BarBarToken */ || left.operatorToken.kind === 56 /* AmpersandAmpersandToken */)) { - grammarErrorOnNode(left, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(left.operatorToken.kind), tokenToString(operatorToken.kind)); - } - if (isBinaryExpression(right) && (right.operatorToken.kind === 57 /* BarBarToken */ || right.operatorToken.kind === 56 /* AmpersandAmpersandToken */)) { - grammarErrorOnNode(right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(right.operatorToken.kind), tokenToString(operatorToken.kind)); - } - const leftTarget = skipOuterExpressions(left, 63 /* All */); - const nullishSemantics = getSyntacticNullishnessSemantics(leftTarget); - if (nullishSemantics !== 3 /* Sometimes */) { - if (node.parent.kind === 226 /* BinaryExpression */) { - error2(leftTarget, Diagnostics.This_binary_expression_is_never_nullish_Are_you_missing_parentheses); - } else { - if (nullishSemantics === 1 /* Always */) { - error2(leftTarget, Diagnostics.This_expression_is_always_nullish); - } else { - error2(leftTarget, Diagnostics.Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish); - } - } + if (node.operatorToken.kind !== 61 /* QuestionQuestionToken */) { + return; + } + if (isBinaryExpression(node.parent)) { + const { left, operatorToken } = node.parent; + if (isBinaryExpression(left) && operatorToken.kind === 57 /* BarBarToken */) { + grammarErrorOnNode(left, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(61 /* QuestionQuestionToken */), tokenToString(operatorToken.kind)); + } + } else if (isBinaryExpression(node.left)) { + const { operatorToken } = node.left; + if (operatorToken.kind === 57 /* BarBarToken */ || operatorToken.kind === 56 /* AmpersandAmpersandToken */) { + grammarErrorOnNode(node.left, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(operatorToken.kind), tokenToString(61 /* QuestionQuestionToken */)); + } + } else if (isBinaryExpression(node.right)) { + const { operatorToken } = node.right; + if (operatorToken.kind === 56 /* AmpersandAmpersandToken */) { + grammarErrorOnNode(node.right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(61 /* QuestionQuestionToken */), tokenToString(operatorToken.kind)); + } + } + checkNullishCoalesceOperandLeft(node); + checkNullishCoalesceOperandRight(node); + } + function checkNullishCoalesceOperandLeft(node) { + const leftTarget = skipOuterExpressions(node.left, 63 /* All */); + const nullishSemantics = getSyntacticNullishnessSemantics(leftTarget); + if (nullishSemantics !== 3 /* Sometimes */) { + if (nullishSemantics === 1 /* Always */) { + error2(leftTarget, Diagnostics.This_expression_is_always_nullish); + } else { + error2(leftTarget, Diagnostics.Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish); } } } + function checkNullishCoalesceOperandRight(node) { + const rightTarget = skipOuterExpressions(node.right, 63 /* All */); + const nullishSemantics = getSyntacticNullishnessSemantics(rightTarget); + if (isNotWithinNullishCoalesceExpression(node)) { + return; + } + if (nullishSemantics === 1 /* Always */) { + error2(rightTarget, Diagnostics.This_expression_is_always_nullish); + } else if (nullishSemantics === 2 /* Never */) { + error2(rightTarget, Diagnostics.This_expression_is_never_nullish); + } + } + function isNotWithinNullishCoalesceExpression(node) { + return !isBinaryExpression(node.parent) || node.parent.operatorToken.kind !== 61 /* QuestionQuestionToken */; + } function getSyntacticNullishnessSemantics(node) { node = skipOuterExpressions(node); switch (node.kind) { - case 223 /* AwaitExpression */: - case 213 /* CallExpression */: - case 215 /* TaggedTemplateExpression */: - case 212 /* ElementAccessExpression */: - case 236 /* MetaProperty */: - case 214 /* NewExpression */: - case 211 /* PropertyAccessExpression */: - case 229 /* YieldExpression */: + case 224 /* AwaitExpression */: + case 214 /* CallExpression */: + case 216 /* TaggedTemplateExpression */: + case 213 /* ElementAccessExpression */: + case 237 /* MetaProperty */: + case 215 /* NewExpression */: + case 212 /* PropertyAccessExpression */: + case 230 /* YieldExpression */: case 110 /* ThisKeyword */: return 3 /* Sometimes */; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: switch (node.operatorToken.kind) { case 64 /* EqualsToken */: case 61 /* QuestionQuestionToken */: @@ -83487,7 +84441,7 @@ function createTypeChecker(host) { return getSyntacticNullishnessSemantics(node.right); } return 2 /* Never */; - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return getSyntacticNullishnessSemantics(node.whenTrue) | getSyntacticNullishnessSemantics(node.whenFalse); case 106 /* NullKeyword */: return 1 /* Always */; @@ -83501,7 +84455,7 @@ function createTypeChecker(host) { } function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { const operator = operatorToken.kind; - if (operator === 64 /* EqualsToken */ && (left.kind === 210 /* ObjectLiteralExpression */ || left.kind === 209 /* ArrayLiteralExpression */)) { + if (operator === 64 /* EqualsToken */ && (left.kind === 211 /* ObjectLiteralExpression */ || left.kind === 210 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 110 /* ThisKeyword */); } let leftType; @@ -83787,7 +84741,7 @@ function createTypeChecker(host) { } } function isIndirectCall(node) { - return node.parent.kind === 217 /* ParenthesizedExpression */ && isNumericLiteral(node.left) && node.left.text === "0" && (isCallExpression(node.parent.parent) && node.parent.parent.expression === node.parent || node.parent.parent.kind === 215 /* TaggedTemplateExpression */) && // special-case for "eval" because it's the only non-access case where an indirect call actually affects behavior. + return node.parent.kind === 218 /* ParenthesizedExpression */ && isNumericLiteral(node.left) && node.left.text === "0" && (isCallExpression(node.parent.parent) && node.parent.parent.expression === node.parent || node.parent.parent.kind === 216 /* TaggedTemplateExpression */) && // special-case for "eval" because it's the only non-access case where an indirect call actually affects behavior. (isAccessExpression(node.right) || isIdentifier(node.right) && node.right.escapedText === "eval"); } function checkForDisallowedESSymbolOperand(operator2) { @@ -83819,7 +84773,7 @@ function createTypeChecker(host) { } function checkAssignmentOperatorWorker() { let assigneeType = leftType; - if (isCompoundAssignment(operatorToken.kind) && left.kind === 211 /* PropertyAccessExpression */) { + if (isCompoundAssignment(operatorToken.kind) && left.kind === 212 /* PropertyAccessExpression */) { assigneeType = checkPropertyAccessExpression( left, /*checkMode*/ @@ -84025,7 +84979,7 @@ function createTypeChecker(host) { texts.push(span.literal.text); types.push(isTypeAssignableTo(type, templateConstraintType) ? type : stringType); } - const evaluated = node.parent.kind !== 215 /* TaggedTemplateExpression */ && evaluate(node).value; + const evaluated = node.parent.kind !== 216 /* TaggedTemplateExpression */ && evaluate(node).value; if (evaluated) { return getFreshTypeOfLiteralType(getStringLiteralType(evaluated)); } @@ -84092,7 +85046,7 @@ function createTypeChecker(host) { /*excludeJSDocTypeAssertions*/ true ); - return node.kind === 216 /* TypeAssertionExpression */ || node.kind === 234 /* AsExpression */ || isJSDocTypeAssertion(node); + return node.kind === 217 /* TypeAssertionExpression */ || node.kind === 235 /* AsExpression */ || isJSDocTypeAssertion(node); } function checkDeclarationInitializer(declaration, checkMode, contextualType) { const initializer = getEffectiveInitializer(declaration); @@ -84110,10 +85064,10 @@ function createTypeChecker(host) { checkMode || 0 /* Normal */ ) : checkExpressionCached(initializer, checkMode)); if (isParameter(isBindingElement(declaration) ? walkUpBindingElementsAndPatterns(declaration) : declaration)) { - if (declaration.name.kind === 206 /* ObjectBindingPattern */ && isObjectLiteralType2(type)) { + if (declaration.name.kind === 207 /* ObjectBindingPattern */ && isObjectLiteralType2(type)) { return padObjectLiteralType(type, declaration.name); } - if (declaration.name.kind === 207 /* ArrayBindingPattern */ && isTupleType(type)) { + if (declaration.name.kind === 208 /* ArrayBindingPattern */ && isTupleType(type)) { return padTupleType(type, declaration.name); } } @@ -84164,7 +85118,7 @@ function createTypeChecker(host) { const elementFlags = type.target.elementFlags.slice(); for (let i = getTypeReferenceArity(type); i < patternElements.length; i++) { const e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 208 /* BindingElement */ && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 209 /* BindingElement */ && e.dotDotDotToken)) { elementTypes.push(!isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement( e, /*includePatternInType*/ @@ -84228,14 +85182,14 @@ function createTypeChecker(host) { )); } function checkPropertyAssignment(node, checkMode) { - if (node.name.kind === 167 /* ComputedPropertyName */) { + if (node.name.kind === 168 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); } function checkObjectLiteralMethod(node, checkMode) { checkGrammarMethod(node); - if (node.name.kind === 167 /* ComputedPropertyName */) { + if (node.name.kind === 168 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } const uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -84299,7 +85253,7 @@ function createTypeChecker(host) { } } } - return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context), flatMap(inferenceContexts, (c) => c && map(c.inferences, (i) => i.typeParameter)).slice()); + return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context)); } } } @@ -84426,7 +85380,7 @@ function createTypeChecker(host) { expr, /*requireStringLiteralLikeArgument*/ true - ) && !isSymbolOrSymbolForCall(expr)) { + ) && !isSymbolOrSymbolForCall(expr) && !isImportCall(expr)) { return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression)); } else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) { return getTypeFromTypeNode(expr.type); @@ -84466,7 +85420,8 @@ function createTypeChecker(host) { return type; } function checkConstEnumAccess(node, type) { - const ok = node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.expression === node || node.parent.kind === 212 /* ElementAccessExpression */ && node.parent.expression === node || ((node.kind === 80 /* Identifier */ || node.kind === 166 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || node.parent.kind === 186 /* TypeQuery */ && node.parent.exprName === node) || node.parent.kind === 281 /* ExportSpecifier */; + var _a; + const ok = node.parent.kind === 212 /* PropertyAccessExpression */ && node.parent.expression === node || node.parent.kind === 213 /* ElementAccessExpression */ && node.parent.expression === node || ((node.kind === 80 /* Identifier */ || node.kind === 167 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || node.parent.kind === 187 /* TypeQuery */ && node.parent.exprName === node) || node.parent.kind === 282 /* ExportSpecifier */; if (!ok) { error2(node, Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } @@ -84483,7 +85438,7 @@ function createTypeChecker(host) { )) { Debug.assert(!!(type.symbol.flags & 128 /* ConstEnum */)); const constEnumDeclaration = type.symbol.valueDeclaration; - const redirect = host.getRedirectReferenceForResolutionFromSourceOfProject(getSourceFileOfNode(constEnumDeclaration).resolvedPath); + const redirect = (_a = host.getRedirectFromOutput(getSourceFileOfNode(constEnumDeclaration).resolvedPath)) == null ? void 0 : _a.resolvedRef; if (constEnumDeclaration.flags & 33554432 /* Ambient */ && !isValidTypeOnlyAliasUseSite(node) && (!redirect || !shouldPreserveConstEnums(redirect.commandLine.options))) { error2(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName); } @@ -84504,9 +85459,9 @@ function createTypeChecker(host) { const kind = node.kind; if (cancellationToken) { switch (kind) { - case 231 /* ClassExpression */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 232 /* ClassExpression */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -84537,82 +85492,82 @@ function createTypeChecker(host) { return trueType; case 97 /* FalseKeyword */: return falseType; - case 228 /* TemplateExpression */: + case 229 /* TemplateExpression */: return checkTemplateExpression(node); case 14 /* RegularExpressionLiteral */: return checkRegularExpressionLiteral(node); - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode, forceTuple); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node, checkMode); - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: return checkQualifiedName(node, checkMode); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return checkIndexedAccess(node, checkMode); - case 213 /* CallExpression */: - if (node.expression.kind === 102 /* ImportKeyword */) { + case 214 /* CallExpression */: + if (isImportCall(node)) { return checkImportCallExpression(node); } // falls through - case 214 /* NewExpression */: + case 215 /* NewExpression */: return checkCallExpression(node, checkMode); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return checkClassExpression(node); - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 221 /* TypeOfExpression */: + case 222 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 216 /* TypeAssertionExpression */: - case 234 /* AsExpression */: + case 217 /* TypeAssertionExpression */: + case 235 /* AsExpression */: return checkAssertion(node, checkMode); - case 235 /* NonNullExpression */: + case 236 /* NonNullExpression */: return checkNonNullAssertion(node); - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return checkExpressionWithTypeArguments(node); - case 238 /* SatisfiesExpression */: + case 239 /* SatisfiesExpression */: return checkSatisfiesExpression(node); - case 236 /* MetaProperty */: + case 237 /* MetaProperty */: return checkMetaProperty(node); - case 220 /* DeleteExpression */: + case 221 /* DeleteExpression */: return checkDeleteExpression(node); - case 222 /* VoidExpression */: + case 223 /* VoidExpression */: return checkVoidExpression(node); - case 223 /* AwaitExpression */: + case 224 /* AwaitExpression */: return checkAwaitExpression(node); - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 225 /* PostfixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 230 /* SpreadElement */: + case 231 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 232 /* OmittedExpression */: + case 233 /* OmittedExpression */: return undefinedWideningType; - case 229 /* YieldExpression */: + case 230 /* YieldExpression */: return checkYieldExpression(node); - case 237 /* SyntheticExpression */: + case 238 /* SyntheticExpression */: return checkSyntheticExpression(node); - case 294 /* JsxExpression */: + case 295 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 284 /* JsxElement */: + case 285 /* JsxElement */: return checkJsxElement(node, checkMode); - case 285 /* JsxSelfClosingElement */: + case 286 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 288 /* JsxFragment */: + case 289 /* JsxFragment */: return checkJsxFragment(node); - case 292 /* JsxAttributes */: + case 293 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 286 /* JsxOpeningElement */: + case 287 /* JsxOpeningElement */: Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -84667,10 +85622,10 @@ function createTypeChecker(host) { if (compilerOptions.erasableSyntaxOnly) { error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled); } - if (!(func.kind === 176 /* Constructor */ && nodeIsPresent(func.body))) { + if (!(func.kind === 177 /* Constructor */ && nodeIsPresent(func.body))) { error2(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } - if (func.kind === 176 /* Constructor */ && isIdentifier(node.name) && node.name.escapedText === "constructor") { + if (func.kind === 177 /* Constructor */ && isIdentifier(node.name) && node.name.escapedText === "constructor") { error2(node.name, Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); } } @@ -84681,13 +85636,13 @@ function createTypeChecker(host) { if (func.parameters.indexOf(node) !== 0) { error2(node, Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 176 /* Constructor */ || func.kind === 180 /* ConstructSignature */ || func.kind === 185 /* ConstructorType */) { + if (func.kind === 177 /* Constructor */ || func.kind === 181 /* ConstructSignature */ || func.kind === 186 /* ConstructorType */) { error2(node, Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 219 /* ArrowFunction */) { + if (func.kind === 220 /* ArrowFunction */) { error2(node, Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } - if (func.kind === 177 /* GetAccessor */ || func.kind === 178 /* SetAccessor */) { + if (func.kind === 178 /* GetAccessor */ || func.kind === 179 /* SetAccessor */) { error2(node, Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); } } @@ -84745,13 +85700,13 @@ function createTypeChecker(host) { } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 219 /* ArrowFunction */: - case 179 /* CallSignature */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 184 /* FunctionType */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 220 /* ArrowFunction */: + case 180 /* CallSignature */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 185 /* FunctionType */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: const parent2 = node.parent; if (node === parent2.type) { return parent2; @@ -84767,7 +85722,7 @@ function createTypeChecker(host) { if (name.kind === 80 /* Identifier */ && name.escapedText === predicateVariableName) { error2(predicateVariableNode, Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; - } else if (name.kind === 207 /* ArrayBindingPattern */ || name.kind === 206 /* ObjectBindingPattern */) { + } else if (name.kind === 208 /* ArrayBindingPattern */ || name.kind === 207 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern( name, predicateVariableNode, @@ -84779,9 +85734,9 @@ function createTypeChecker(host) { } } function checkSignatureDeclaration(node) { - if (node.kind === 181 /* IndexSignature */) { + if (node.kind === 182 /* IndexSignature */) { checkGrammarIndexSignature(node); - } else if (node.kind === 184 /* FunctionType */ || node.kind === 262 /* FunctionDeclaration */ || node.kind === 185 /* ConstructorType */ || node.kind === 179 /* CallSignature */ || node.kind === 176 /* Constructor */ || node.kind === 180 /* ConstructSignature */) { + } else if (node.kind === 185 /* FunctionType */ || node.kind === 263 /* FunctionDeclaration */ || node.kind === 186 /* ConstructorType */ || node.kind === 180 /* CallSignature */ || node.kind === 177 /* Constructor */ || node.kind === 181 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } const functionFlags = getFunctionFlags(node); @@ -84819,10 +85774,10 @@ function createTypeChecker(host) { } if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 180 /* ConstructSignature */: + case 181 /* ConstructSignature */: error2(node, Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 179 /* CallSignature */: + case 180 /* CallSignature */: error2(node, Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -84840,7 +85795,7 @@ function createTypeChecker(host) { checkAsyncFunctionReturnType(node, returnTypeNode, returnTypeErrorLocation); } } - if (node.kind !== 181 /* IndexSignature */ && node.kind !== 317 /* JSDocFunctionType */) { + if (node.kind !== 182 /* IndexSignature */ && node.kind !== 318 /* JSDocFunctionType */) { registerForUnusedIdentifiersCheck(node); } } @@ -84857,7 +85812,7 @@ function createTypeChecker(host) { const staticNames = /* @__PURE__ */ new Map(); const privateIdentifiers = /* @__PURE__ */ new Map(); for (const member of node.members) { - if (member.kind === 176 /* Constructor */) { + if (member.kind === 177 /* Constructor */) { for (const param of member.parameters) { if (isParameterPropertyDeclaration(param, member) && !isBindingPattern(param.name)) { addName(instanceNames, param.name, param.name.escapedText, 3 /* GetOrSetAccessor */); @@ -84875,16 +85830,16 @@ function createTypeChecker(host) { const memberName = name && getEffectivePropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: addName(names, name, memberName, 1 /* GetAccessor */ | privateStaticFlags); break; - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: addName(names, name, memberName, 2 /* SetAccessor */ | privateStaticFlags); break; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: addName(names, name, memberName, 3 /* GetOrSetAccessor */ | privateStaticFlags); break; - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: addName(names, name, memberName, 8 /* Method */ | privateStaticFlags); break; } @@ -84941,7 +85896,7 @@ function createTypeChecker(host) { function checkObjectTypeForDuplicateDeclarations(node) { const names = /* @__PURE__ */ new Map(); for (const member of node.members) { - if (member.kind === 171 /* PropertySignature */) { + if (member.kind === 172 /* PropertySignature */) { let memberName; const name = member.name; switch (name.kind) { @@ -84965,7 +85920,7 @@ function createTypeChecker(host) { } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 264 /* InterfaceDeclaration */) { + if (node.kind === 265 /* InterfaceDeclaration */) { const nodeSymbol = getSymbolOfDeclaration(node); if (nodeSymbol.declarations && nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -85001,7 +85956,7 @@ function createTypeChecker(host) { if (!checkGrammarModifiers(node) && !checkGrammarProperty(node)) checkGrammarComputedPropertyName(node.name); checkVariableLikeDeclaration(node); setNodeLinksForPrivateIdentifierScope(node); - if (hasSyntacticModifier(node, 64 /* Abstract */) && node.kind === 172 /* PropertyDeclaration */ && node.initializer) { + if (hasSyntacticModifier(node, 64 /* Abstract */) && node.kind === 173 /* PropertyDeclaration */ && node.initializer) { error2(node, Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract, declarationNameToString(node.name)); } } @@ -85017,7 +85972,7 @@ function createTypeChecker(host) { error2(node.name, Diagnostics.Class_constructor_may_not_be_a_generator); } checkFunctionOrMethodDeclaration(node); - if (hasSyntacticModifier(node, 64 /* Abstract */) && node.kind === 174 /* MethodDeclaration */ && node.body) { + if (hasSyntacticModifier(node, 64 /* Abstract */) && node.kind === 175 /* MethodDeclaration */ && node.body) { error2(node, Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, declarationNameToString(node.name)); } if (isPrivateIdentifier(node.name) && !getContainingClass(node)) { @@ -85063,7 +86018,7 @@ function createTypeChecker(host) { if (isPrivateIdentifierClassElementDeclaration(n)) { return true; } - return n.kind === 172 /* PropertyDeclaration */ && !isStatic(n) && !!n.initializer; + return n.kind === 173 /* PropertyDeclaration */ && !isStatic(n) && !!n.initializer; } function checkConstructorDeclarationDiagnostics() { const containingClassDecl = node.parent; @@ -85125,20 +86080,20 @@ function createTypeChecker(host) { if (!checkGrammarFunctionLikeDeclaration(node) && !checkGrammarAccessor(node)) checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 177 /* GetAccessor */) { + if (node.kind === 178 /* GetAccessor */) { if (!(node.flags & 33554432 /* Ambient */) && nodeIsPresent(node.body) && node.flags & 512 /* HasImplicitReturn */) { if (!(node.flags & 1024 /* HasExplicitReturn */)) { error2(node.name, Diagnostics.A_get_accessor_must_return_a_value); } } } - if (node.name.kind === 167 /* ComputedPropertyName */) { + if (node.name.kind === 168 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (hasBindableName(node)) { const symbol = getSymbolOfDeclaration(node); - const getter = getDeclarationOfKind(symbol, 177 /* GetAccessor */); - const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */); + const getter = getDeclarationOfKind(symbol, 178 /* GetAccessor */); + const setter = getDeclarationOfKind(symbol, 179 /* SetAccessor */); if (getter && setter && !(getNodeCheckFlags(getter) & 1 /* TypeChecked */)) { getNodeLinks(getter).flags |= 1 /* TypeChecked */; const getterFlags = getEffectiveModifierFlags(getter); @@ -85154,7 +86109,7 @@ function createTypeChecker(host) { } } const returnType = getTypeOfAccessors(getSymbolOfDeclaration(node)); - if (node.kind === 177 /* GetAccessor */) { + if (node.kind === 178 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -85210,7 +86165,7 @@ function createTypeChecker(host) { } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 183 /* TypeReference */ && !isInJSFile(node) && !isInJSDoc(node) && node.typeArguments && node.typeName.end !== node.typeArguments.pos) { + if (node.kind === 184 /* TypeReference */ && !isInJSFile(node) && !isInJSDoc(node) && node.typeArguments && node.typeName.end !== node.typeArguments.pos) { const sourceFile = getSourceFileOfNode(node); if (scanTokenAtPosition(sourceFile, node.typeName.end) === 25 /* DotToken */) { grammarErrorAtPos(node, skipTrivia(sourceFile.text, node.typeName.end), 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); @@ -85314,7 +86269,7 @@ function createTypeChecker(host) { const objectIndexType = isGenericMappedType(objectType) && getMappedTypeNameTypeKind(objectType) === 2 /* Remapping */ ? getIndexTypeForMappedType(objectType, 0 /* None */) : getIndexType(objectType, 0 /* None */); const hasNumberIndexInfo = !!getIndexInfoOfType(objectType, numberType); if (everyType(indexType, (t) => isTypeAssignableTo(t, objectIndexType) || hasNumberIndexInfo && isApplicableIndexType(t, numberType))) { - if (accessNode.kind === 212 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { + if (accessNode.kind === 213 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error2(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } return type; @@ -85371,7 +86326,7 @@ function createTypeChecker(host) { forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!findAncestor(node, (n) => n.parent && n.parent.kind === 194 /* ConditionalType */ && n.parent.extendsType === n)) { + if (!findAncestor(node, (n) => n.parent && n.parent.kind === 195 /* ConditionalType */ && n.parent.extendsType === n)) { grammarErrorOnNode(node, Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); @@ -85381,7 +86336,7 @@ function createTypeChecker(host) { if (!links.typeParametersChecked) { links.typeParametersChecked = true; const typeParameter = getDeclaredTypeOfTypeParameter(symbol); - const declarations = getDeclarationsOfKind(symbol, 168 /* TypeParameter */); + const declarations = getDeclarationsOfKind(symbol, 169 /* TypeParameter */); if (!areTypeParametersIdentical(declarations, [typeParameter], (decl) => [decl])) { const name = symbolToString(symbol); for (const declaration of declarations) { @@ -85411,10 +86366,10 @@ function createTypeChecker(host) { if (node.dotDotDotToken && node.questionToken) { grammarErrorOnNode(node, Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest); } - if (node.type.kind === 190 /* OptionalType */) { + if (node.type.kind === 191 /* OptionalType */) { grammarErrorOnNode(node.type, Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type); } - if (node.type.kind === 191 /* RestType */) { + if (node.type.kind === 192 /* RestType */) { grammarErrorOnNode(node.type, Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type); } checkSourceElement(node.type); @@ -85425,7 +86380,7 @@ function createTypeChecker(host) { } function getEffectiveDeclarationFlags(n, flagsToCheck) { let flags = getCombinedModifierFlagsCached(n); - if (n.parent.kind !== 264 /* InterfaceDeclaration */ && n.parent.kind !== 263 /* ClassDeclaration */ && n.parent.kind !== 231 /* ClassExpression */ && n.flags & 33554432 /* Ambient */) { + if (n.parent.kind !== 265 /* InterfaceDeclaration */ && n.parent.kind !== 264 /* ClassDeclaration */ && n.parent.kind !== 232 /* ClassExpression */ && n.flags & 33554432 /* Ambient */) { const container = getEnclosingContainer(n); if (container && container.flags & 128 /* ExportContext */ && !(flags & 128 /* Ambient */) && !(isModuleBlock(n.parent) && isModuleDeclaration(n.parent.parent) && isGlobalScopeAugmentation(n.parent.parent))) { flags |= 32 /* Export */; @@ -85506,7 +86461,7 @@ function createTypeChecker(host) { (isPrivateIdentifier(node.name) && isPrivateIdentifier(subsequentName) && node.name.escapedText === subsequentName.escapedText || // Both are computed property names isComputedPropertyName(node.name) && isComputedPropertyName(subsequentName) && isTypeIdenticalTo(checkComputedPropertyName(node.name), checkComputedPropertyName(subsequentName)) || // Both are literal property names that are the same. isPropertyNameLiteral(node.name) && isPropertyNameLiteral(subsequentName) && getEscapedTextOfIdentifierOrLiteral(node.name) === getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - const reportError = (node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */) && isStatic(node) !== isStatic(subsequentNode); + const reportError = (node.kind === 175 /* MethodDeclaration */ || node.kind === 174 /* MethodSignature */) && isStatic(node) !== isStatic(subsequentNode); if (reportError) { const diagnostic = isStatic(node) ? Diagnostics.Function_overload_must_be_static : Diagnostics.Function_overload_must_not_be_static; error2(errorNode2, diagnostic); @@ -85538,14 +86493,14 @@ function createTypeChecker(host) { for (const current of declarations) { const node = current; const inAmbientContext = node.flags & 33554432 /* Ambient */; - const inAmbientContextOrInterface = node.parent && (node.parent.kind === 264 /* InterfaceDeclaration */ || node.parent.kind === 187 /* TypeLiteral */) || inAmbientContext; + const inAmbientContextOrInterface = node.parent && (node.parent.kind === 265 /* InterfaceDeclaration */ || node.parent.kind === 188 /* TypeLiteral */) || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = void 0; } - if ((node.kind === 263 /* ClassDeclaration */ || node.kind === 231 /* ClassExpression */) && !inAmbientContext) { + if ((node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 262 /* FunctionDeclaration */ || node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */ || node.kind === 176 /* Constructor */) { + if (node.kind === 263 /* FunctionDeclaration */ || node.kind === 175 /* MethodDeclaration */ || node.kind === 174 /* MethodSignature */ || node.kind === 177 /* Constructor */) { functionDeclarations.push(node); const currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; @@ -85590,9 +86545,9 @@ function createTypeChecker(host) { }); } if (hasNonAmbientClass && !isConstructor && symbol.flags & 16 /* Function */ && declarations) { - const relatedDiagnostics = filter(declarations, (d) => d.kind === 263 /* ClassDeclaration */).map((d) => createDiagnosticForNode(d, Diagnostics.Consider_adding_a_declare_modifier_to_this_class)); + const relatedDiagnostics = filter(declarations, (d) => d.kind === 264 /* ClassDeclaration */).map((d) => createDiagnosticForNode(d, Diagnostics.Consider_adding_a_declare_modifier_to_this_class)); forEach(declarations, (declaration) => { - const diagnostic = declaration.kind === 263 /* ClassDeclaration */ ? Diagnostics.Class_declaration_cannot_implement_overload_list_for_0 : declaration.kind === 262 /* FunctionDeclaration */ ? Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient : void 0; + const diagnostic = declaration.kind === 264 /* ClassDeclaration */ ? Diagnostics.Class_declaration_cannot_implement_overload_list_for_0 : declaration.kind === 263 /* FunctionDeclaration */ ? Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient : void 0; if (diagnostic) { addRelatedInfo( error2(getNameOfDeclaration(declaration) || declaration, diagnostic, symbolName(symbol)), @@ -85672,24 +86627,24 @@ function createTypeChecker(host) { function getDeclarationSpaces(decl) { let d = decl; switch (d.kind) { - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: // A jsdoc typedef and callback are, by definition, type aliases. // falls through - case 346 /* JSDocTypedefTag */: - case 338 /* JSDocCallbackTag */: - case 340 /* JSDocEnumTag */: + case 347 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: + case 341 /* JSDocEnumTag */: return 2 /* ExportType */; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return isAmbientModule(d) || getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 263 /* ClassDeclaration */: - case 266 /* EnumDeclaration */: - case 306 /* EnumMember */: + case 264 /* ClassDeclaration */: + case 267 /* EnumDeclaration */: + case 307 /* EnumMember */: return 2 /* ExportType */ | 1 /* ExportValue */; - case 307 /* SourceFile */: + case 308 /* SourceFile */: return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; - case 277 /* ExportAssignment */: - case 226 /* BinaryExpression */: + case 278 /* ExportAssignment */: + case 227 /* BinaryExpression */: const node2 = d; const expression = isExportAssignment(node2) ? node2.expression : node2.right; if (!isEntityNameExpression(expression)) { @@ -85698,24 +86653,24 @@ function createTypeChecker(host) { d = expression; // The below options all declare an Alias, which is allowed to merge with other values within the importing module. // falls through - case 271 /* ImportEqualsDeclaration */: - case 274 /* NamespaceImport */: - case 273 /* ImportClause */: + case 272 /* ImportEqualsDeclaration */: + case 275 /* NamespaceImport */: + case 274 /* ImportClause */: let result = 0 /* None */; const target = resolveAlias(getSymbolOfDeclaration(d)); forEach(target.declarations, (d2) => { result |= getDeclarationSpaces(d2); }); return result; - case 260 /* VariableDeclaration */: - case 208 /* BindingElement */: - case 262 /* FunctionDeclaration */: - case 276 /* ImportSpecifier */: + case 261 /* VariableDeclaration */: + case 209 /* BindingElement */: + case 263 /* FunctionDeclaration */: + case 277 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 case 80 /* Identifier */: return 1 /* ExportValue */; - case 173 /* MethodSignature */: - case 171 /* PropertySignature */: + case 174 /* MethodSignature */: + case 172 /* PropertySignature */: return 2 /* ExportType */; default: return Debug.failBadSyntaxKind(d); @@ -86051,22 +87006,22 @@ function createTypeChecker(host) { let headMessage; const expectedReturnType = decoratorSignature.resolvedReturnType; switch (node.parent.kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; break; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: if (!legacyDecorators) { headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; break; } // falls through - case 169 /* Parameter */: + case 170 /* Parameter */: headMessage = Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any; break; - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; break; default: @@ -86111,15 +87066,15 @@ function createTypeChecker(host) { function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 193 /* IntersectionType */: - case 192 /* UnionType */: + case 194 /* IntersectionType */: + case 193 /* UnionType */: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 194 /* ConditionalType */: + case 195 /* ConditionalType */: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 196 /* ParenthesizedType */: - case 202 /* NamedTupleMember */: + case 197 /* ParenthesizedType */: + case 203 /* NamedTupleMember */: return getEntityNameForDecoratorMetadata(node.type); - case 183 /* TypeReference */: + case 184 /* TypeReference */: return node.typeName; } } @@ -86127,13 +87082,13 @@ function createTypeChecker(host) { function getEntityNameForDecoratorMetadataFromTypeList(types) { let commonEntityName; for (let typeNode of types) { - while (typeNode.kind === 196 /* ParenthesizedType */ || typeNode.kind === 202 /* NamedTupleMember */) { + while (typeNode.kind === 197 /* ParenthesizedType */ || typeNode.kind === 203 /* NamedTupleMember */) { typeNode = typeNode.type; } if (typeNode.kind === 146 /* NeverKeyword */) { continue; } - if (!strictNullChecks && (typeNode.kind === 201 /* LiteralType */ && typeNode.literal.kind === 106 /* NullKeyword */ || typeNode.kind === 157 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 202 /* LiteralType */ && typeNode.literal.kind === 106 /* NullKeyword */ || typeNode.kind === 157 /* UndefinedKeyword */)) { continue; } const individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -86164,7 +87119,7 @@ function createTypeChecker(host) { } if (legacyDecorators) { checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 169 /* Parameter */) { + if (node.kind === 170 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } } else if (languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators) { @@ -86303,7 +87258,7 @@ function createTypeChecker(host) { switch (node.kind) { case 80 /* Identifier */: return node; - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return node.name; default: return void 0; @@ -86314,7 +87269,7 @@ function createTypeChecker(host) { checkDecorators(node); checkSignatureDeclaration(node); const functionFlags = getFunctionFlags(node); - if (node.name && node.name.kind === 167 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 168 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (hasBindableName(node)) { @@ -86331,7 +87286,7 @@ function createTypeChecker(host) { checkFunctionOrConstructorSymbol(symbol); } } - const body = node.kind === 173 /* MethodSignature */ ? void 0 : node.body; + const body = node.kind === 174 /* MethodSignature */ ? void 0 : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); addLazyDiagnostic(checkFunctionOrMethodDeclarationDiagnostics); @@ -86367,42 +87322,42 @@ function createTypeChecker(host) { function checkUnusedIdentifiers(potentiallyUnusedIdentifiers, addDiagnostic) { for (const node of potentiallyUnusedIdentifiers) { switch (node.kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 307 /* SourceFile */: - case 267 /* ModuleDeclaration */: - case 241 /* Block */: - case 269 /* CaseBlock */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: + case 308 /* SourceFile */: + case 268 /* ModuleDeclaration */: + case 242 /* Block */: + case 270 /* CaseBlock */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 176 /* Constructor */: - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 177 /* Constructor */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: if (node.body) { checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 173 /* MethodSignature */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 265 /* TypeAliasDeclaration */: - case 264 /* InterfaceDeclaration */: + case 174 /* MethodSignature */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 266 /* TypeAliasDeclaration */: + case 265 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; - case 195 /* InferType */: + case 196 /* InferType */: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -86421,11 +87376,11 @@ function createTypeChecker(host) { function checkUnusedClassMembers(node, addDiagnostic) { for (const member of node.members) { switch (member.kind) { - case 174 /* MethodDeclaration */: - case 172 /* PropertyDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - if (member.kind === 178 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 175 /* MethodDeclaration */: + case 173 /* PropertyDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + if (member.kind === 179 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { break; } const symbol = getSymbolOfDeclaration(member); @@ -86433,16 +87388,16 @@ function createTypeChecker(host) { addDiagnostic(member, 0 /* Local */, createDiagnosticForNode(member.name, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 176 /* Constructor */: + case 177 /* Constructor */: for (const parameter of member.parameters) { if (!parameter.symbol.isReferenced && hasSyntacticModifier(parameter, 2 /* Private */)) { addDiagnostic(parameter, 0 /* Local */, createDiagnosticForNode(parameter.name, Diagnostics.Property_0_is_declared_but_its_value_is_never_read, symbolName(parameter.symbol))); } } break; - case 181 /* IndexSignature */: - case 240 /* SemicolonClassElement */: - case 175 /* ClassStaticBlockDeclaration */: + case 182 /* IndexSignature */: + case 241 /* SemicolonClassElement */: + case 176 /* ClassStaticBlockDeclaration */: break; default: Debug.fail("Unexpected class member"); @@ -86464,7 +87419,7 @@ function createTypeChecker(host) { if (!isTypeParameterUnused(typeParameter)) continue; const name = idText(typeParameter.name); const { parent: parent2 } = typeParameter; - if (parent2.kind !== 195 /* InferType */ && parent2.typeParameters.every(isTypeParameterUnused)) { + if (parent2.kind !== 196 /* InferType */ && parent2.typeParameters.every(isTypeParameterUnused)) { if (tryAddToSet(seenParentsWithEveryUnused, parent2)) { const sourceFile = getSourceFileOfNode(parent2); const range = isJSDocTemplateTag(parent2) ? rangeOfNode(parent2) : rangeOfTypeParameters(sourceFile, parent2.typeParameters); @@ -86547,7 +87502,7 @@ function createTypeChecker(host) { }); unusedImports.forEach(([importClause, unuseds]) => { const importDecl = importClause.parent; - const nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? importClause.namedBindings.kind === 274 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length : 0); + const nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? importClause.namedBindings.kind === 275 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length : 0); if (nDeclarations === unuseds.length) { addDiagnostic( importDecl, @@ -86561,7 +87516,7 @@ function createTypeChecker(host) { unusedDestructures.forEach(([bindingPattern, bindingElements]) => { const kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 260 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 261 /* VariableDeclarationList */) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 261 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 262 /* VariableDeclarationList */) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { addDiagnostic( @@ -86581,7 +87536,7 @@ function createTypeChecker(host) { addDiagnostic( declarationList, 0 /* Local */, - declarations.length === 1 ? createDiagnosticForNode(first(declarations).name, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(declarations).name)) : createDiagnosticForNode(declarationList.parent.kind === 243 /* VariableStatement */ ? declarationList.parent : declarationList, Diagnostics.All_variables_are_unused) + declarations.length === 1 ? createDiagnosticForNode(first(declarations).name, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(declarations).name)) : createDiagnosticForNode(declarationList.parent.kind === 244 /* VariableStatement */ ? declarationList.parent : declarationList, Diagnostics.All_variables_are_unused) ); } else { for (const decl of declarations) { @@ -86611,21 +87566,21 @@ function createTypeChecker(host) { switch (name.kind) { case 80 /* Identifier */: return idText(name); - case 207 /* ArrayBindingPattern */: - case 206 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: + case 207 /* ObjectBindingPattern */: return bindingNameText(cast(first(name.elements), isBindingElement).name); default: return Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 273 /* ImportClause */ || node.kind === 276 /* ImportSpecifier */ || node.kind === 274 /* NamespaceImport */; + return node.kind === 274 /* ImportClause */ || node.kind === 277 /* ImportSpecifier */ || node.kind === 275 /* NamespaceImport */; } function importClauseFromImported(decl) { - return decl.kind === 273 /* ImportClause */ ? decl : decl.kind === 274 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + return decl.kind === 274 /* ImportClause */ ? decl : decl.kind === 275 /* NamespaceImport */ ? decl.parent : decl.parent.parent; } function checkBlock(node) { - if (node.kind === 241 /* Block */) { + if (node.kind === 242 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (isFunctionOrModuleBlock(node)) { @@ -86653,7 +87608,7 @@ function createTypeChecker(host) { if ((identifier == null ? void 0 : identifier.escapedText) !== name) { return false; } - if (node.kind === 172 /* PropertyDeclaration */ || node.kind === 171 /* PropertySignature */ || node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */ || node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */ || node.kind === 303 /* PropertyAssignment */) { + if (node.kind === 173 /* PropertyDeclaration */ || node.kind === 172 /* PropertySignature */ || node.kind === 175 /* MethodDeclaration */ || node.kind === 174 /* MethodSignature */ || node.kind === 178 /* GetAccessor */ || node.kind === 179 /* SetAccessor */ || node.kind === 304 /* PropertyAssignment */) { return false; } if (node.flags & 33554432 /* Ambient */) { @@ -86709,7 +87664,7 @@ function createTypeChecker(host) { return; } const parent2 = getDeclarationContainer(node); - if (parent2.kind === 307 /* SourceFile */ && isExternalOrCommonJsModule(parent2)) { + if (parent2.kind === 308 /* SourceFile */ && isExternalOrCommonJsModule(parent2)) { errorSkippedOn("noEmit", name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, declarationNameToString(name), declarationNameToString(name)); } } @@ -86721,7 +87676,7 @@ function createTypeChecker(host) { return; } const parent2 = getDeclarationContainer(node); - if (parent2.kind === 307 /* SourceFile */ && isExternalOrCommonJsModule(parent2) && parent2.flags & 4096 /* HasAsyncFunctions */) { + if (parent2.kind === 308 /* SourceFile */ && isExternalOrCommonJsModule(parent2) && parent2.flags & 4096 /* HasAsyncFunctions */) { errorSkippedOn("noEmit", name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, declarationNameToString(name), declarationNameToString(name)); } } @@ -86799,9 +87754,9 @@ function createTypeChecker(host) { ); if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 7 /* BlockScoped */) { - const varDeclList = getAncestor(localDeclarationSymbol.valueDeclaration, 261 /* VariableDeclarationList */); - const container = varDeclList.parent.kind === 243 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : void 0; - const namesShareScope = container && (container.kind === 241 /* Block */ && isFunctionLike(container.parent) || container.kind === 268 /* ModuleBlock */ || container.kind === 267 /* ModuleDeclaration */ || container.kind === 307 /* SourceFile */); + const varDeclList = getAncestor(localDeclarationSymbol.valueDeclaration, 262 /* VariableDeclarationList */); + const container = varDeclList.parent.kind === 244 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : void 0; + const namesShareScope = container && (container.kind === 242 /* Block */ && isFunctionLike(container.parent) || container.kind === 269 /* ModuleBlock */ || container.kind === 268 /* ModuleDeclaration */ || container.kind === 308 /* SourceFile */); if (!namesShareScope) { const name = symbolToString(localDeclarationSymbol); error2(node, Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name); @@ -86822,7 +87777,7 @@ function createTypeChecker(host) { if (!node.name) { return; } - if (node.name.kind === 167 /* ComputedPropertyName */) { + if (node.name.kind === 168 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (hasOnlyExpressionInitializer(node) && node.initializer) { checkExpressionCached(node.initializer); @@ -86836,7 +87791,7 @@ function createTypeChecker(host) { if (isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < LanguageFeatureMinimumTarget.ObjectSpreadRest) { checkExternalEmitHelpers(node, 4 /* Rest */); } - if (node.propertyName && node.propertyName.kind === 167 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 168 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } const parent2 = node.parent.parent; @@ -86869,7 +87824,7 @@ function createTypeChecker(host) { } } if (isBindingPattern(node.name)) { - if (node.name.kind === 207 /* ArrayBindingPattern */ && languageVersion < LanguageFeatureMinimumTarget.BindingPatterns && compilerOptions.downlevelIteration) { + if (node.name.kind === 208 /* ArrayBindingPattern */ && languageVersion < LanguageFeatureMinimumTarget.BindingPatterns && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } forEach(node.name.elements, checkSourceElement); @@ -86882,7 +87837,7 @@ function createTypeChecker(host) { if (isInAmbientOrTypeNode(node)) { return; } - const needCheckInitializer = hasOnlyExpressionInitializer(node) && node.initializer && node.parent.parent.kind !== 249 /* ForInStatement */; + const needCheckInitializer = hasOnlyExpressionInitializer(node) && node.initializer && node.parent.parent.kind !== 250 /* ForInStatement */; const needCheckWidenedType = !some(node.name.elements, not(isOmittedExpression)); if (needCheckInitializer || needCheckWidenedType) { const widenedType = getWidenedTypeForVariableLikeDeclaration(node); @@ -86917,7 +87872,7 @@ function createTypeChecker(host) { const initializer = hasOnlyExpressionInitializer(node) && getEffectiveInitializer(node); if (initializer) { const isJSObjectLiteralInitializer = isInJSFile(node) && isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAccess(node.name)) && !!((_a = symbol.exports) == null ? void 0 : _a.size); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 249 /* ForInStatement */) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 250 /* ForInStatement */) { const initializerType = checkExpressionCached(initializer); checkTypeAssignableToAndOptionallyElaborate( initializerType, @@ -86977,9 +87932,9 @@ function createTypeChecker(host) { error2(node.name, Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name)); } } - if (node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 171 /* PropertySignature */) { + if (node.kind !== 173 /* PropertyDeclaration */ && node.kind !== 172 /* PropertySignature */) { checkExportsOnMergedDeclarations(node); - if (node.kind === 260 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) { + if (node.kind === 261 /* VariableDeclaration */ || node.kind === 209 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionsForDeclarationName(node, node.name); @@ -86987,7 +87942,7 @@ function createTypeChecker(host) { } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { const nextDeclarationName = getNameOfDeclaration(nextDeclaration); - const message = nextDeclaration.kind === 172 /* PropertyDeclaration */ || nextDeclaration.kind === 171 /* PropertySignature */ ? Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; + const message = nextDeclaration.kind === 173 /* PropertyDeclaration */ || nextDeclaration.kind === 172 /* PropertySignature */ ? Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; const declName = declarationNameToString(nextDeclarationName); const err = error2( nextDeclarationName, @@ -87001,7 +87956,7 @@ function createTypeChecker(host) { } } function areDeclarationFlagsIdentical(left, right) { - if (left.kind === 169 /* Parameter */ && right.kind === 260 /* VariableDeclaration */ || left.kind === 260 /* VariableDeclaration */ && right.kind === 169 /* Parameter */) { + if (left.kind === 170 /* Parameter */ && right.kind === 261 /* VariableDeclaration */ || left.kind === 261 /* VariableDeclaration */ && right.kind === 170 /* Parameter */) { return true; } if (hasQuestionToken(left) !== hasQuestionToken(right)) { @@ -87041,7 +87996,7 @@ function createTypeChecker(host) { const type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableOrAwaitableOrEnumMemberType(node.expression, type, node.thenStatement); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 242 /* EmptyStatement */) { + if (node.thenStatement.kind === 243 /* EmptyStatement */) { error2(node.thenStatement, Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -87180,23 +88135,23 @@ function createTypeChecker(host) { return 3 /* Sometimes */; } return 1 /* Always */; - case 209 /* ArrayLiteralExpression */: - case 219 /* ArrowFunction */: + case 210 /* ArrayLiteralExpression */: + case 220 /* ArrowFunction */: case 10 /* BigIntLiteral */: - case 231 /* ClassExpression */: - case 218 /* FunctionExpression */: - case 284 /* JsxElement */: - case 285 /* JsxSelfClosingElement */: - case 210 /* ObjectLiteralExpression */: + case 232 /* ClassExpression */: + case 219 /* FunctionExpression */: + case 285 /* JsxElement */: + case 286 /* JsxSelfClosingElement */: + case 211 /* ObjectLiteralExpression */: case 14 /* RegularExpressionLiteral */: return 1 /* Always */; - case 222 /* VoidExpression */: + case 223 /* VoidExpression */: case 106 /* NullKeyword */: return 2 /* Never */; case 15 /* NoSubstitutionTemplateLiteral */: case 11 /* StringLiteral */: return !!node.text ? 1 /* Always */ : 2 /* Never */; - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return getSyntacticTruthySemantics(node.whenTrue) | getSyntacticTruthySemantics(node.whenFalse); case 80 /* Identifier */: if (getResolvedSymbol(node) === undefinedSymbol) { @@ -87211,12 +88166,12 @@ function createTypeChecker(host) { } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 261 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 262 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 261 /* VariableDeclarationList */) { + if (node.initializer.kind === 262 /* VariableDeclarationList */) { checkVariableDeclarationList(node.initializer); } else { checkExpression(node.initializer); @@ -87244,12 +88199,12 @@ function createTypeChecker(host) { } else if (compilerOptions.downlevelIteration && languageVersion < LanguageFeatureMinimumTarget.ForOf) { checkExternalEmitHelpers(node, 256 /* ForOfIncludes */); } - if (node.initializer.kind === 261 /* VariableDeclarationList */) { + if (node.initializer.kind === 262 /* VariableDeclarationList */) { checkVariableDeclarationList(node.initializer); } else { const varExpr = node.initializer; const iteratedType = checkRightHandSideOfForOf(node); - if (varExpr.kind === 209 /* ArrayLiteralExpression */ || varExpr.kind === 210 /* ObjectLiteralExpression */) { + if (varExpr.kind === 210 /* ArrayLiteralExpression */ || varExpr.kind === 211 /* ObjectLiteralExpression */) { checkDestructuringAssignment(varExpr, iteratedType || errorType); } else { const leftType = checkExpression(varExpr); @@ -87271,7 +88226,7 @@ function createTypeChecker(host) { function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); const rightType = getNonNullableTypeIfNeeded(checkExpression(node.expression)); - if (node.initializer.kind === 261 /* VariableDeclarationList */) { + if (node.initializer.kind === 262 /* VariableDeclarationList */) { const variable = node.initializer.declarations[0]; if (variable && isBindingPattern(variable.name)) { error2(variable.name, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -87280,7 +88235,7 @@ function createTypeChecker(host) { } else { const varExpr = node.initializer; const leftType = checkExpression(varExpr); - if (varExpr.kind === 209 /* ArrayLiteralExpression */ || varExpr.kind === 210 /* ObjectLiteralExpression */) { + if (varExpr.kind === 210 /* ArrayLiteralExpression */ || varExpr.kind === 211 /* ObjectLiteralExpression */) { error2(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { error2(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any); @@ -87470,6 +88425,9 @@ function createTypeChecker(host) { } function getIterationTypesOfIterable(type, use, errorNode) { var _a, _b; + if (type === silentNeverType) { + return silentNeverIterationTypes; + } if (isTypeAny(type)) { return anyIterationTypes; } @@ -87942,11 +88900,11 @@ function createTypeChecker(host) { const returnType = getReturnTypeOfSignature(signature); if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) { const exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (container.kind === 178 /* SetAccessor */) { + if (container.kind === 179 /* SetAccessor */) { if (node.expression) { error2(node, Diagnostics.Setters_cannot_return_a_value); } - } else if (container.kind === 176 /* Constructor */) { + } else if (container.kind === 177 /* Constructor */) { const exprType2 = node.expression ? checkExpressionCached(node.expression) : undefinedType; if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType2, returnType, node, node.expression)) { error2(node, Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); @@ -87955,7 +88913,7 @@ function createTypeChecker(host) { const unwrappedReturnType = unwrapReturnType(returnType, getFunctionFlags(container)) ?? returnType; checkReturnExpression(container, unwrappedReturnType, node, node.expression, exprType); } - } else if (container.kind !== 176 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeUndefinedVoidOrAny(container, returnType)) { + } else if (container.kind !== 177 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeUndefinedVoidOrAny(container, returnType)) { error2(node, Diagnostics.Not_all_code_paths_return_a_value); } } @@ -87986,7 +88944,7 @@ function createTypeChecker(host) { return; } } - const inReturnStatement = node.kind === 253 /* ReturnStatement */; + const inReturnStatement = node.kind === 254 /* ReturnStatement */; const unwrappedExprType = functionFlags & 2 /* Async */ ? checkAwaitedType( exprType, /*withAlias*/ @@ -88018,7 +88976,7 @@ function createTypeChecker(host) { let hasDuplicateDefaultClause = false; const expressionType = checkExpression(node.expression); forEach(node.caseBlock.clauses, (clause) => { - if (clause.kind === 297 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 298 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === void 0) { firstDefaultClause = clause; } else { @@ -88026,7 +88984,7 @@ function createTypeChecker(host) { hasDuplicateDefaultClause = true; } } - if (clause.kind === 296 /* CaseClause */) { + if (clause.kind === 297 /* CaseClause */) { addLazyDiagnostic(createLazyCaseClauseDiagnostics(clause)); } forEach(clause.statements, checkSourceElement); @@ -88058,7 +89016,7 @@ function createTypeChecker(host) { if (isFunctionLike(current)) { return "quit"; } - if (current.kind === 256 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 257 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, Diagnostics.Duplicate_label_0, getTextOfNode(node.label)); return true; } @@ -88148,8 +89106,8 @@ function createTypeChecker(host) { return; } const indexInfos = getApplicableIndexInfos(type, propNameType); - const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 264 /* InterfaceDeclaration */) : void 0; - const propDeclaration = declaration && declaration.kind === 226 /* BinaryExpression */ || name && name.kind === 167 /* ComputedPropertyName */ ? declaration : void 0; + const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 265 /* InterfaceDeclaration */) : void 0; + const propDeclaration = declaration && declaration.kind === 227 /* BinaryExpression */ || name && name.kind === 168 /* ComputedPropertyName */ ? declaration : void 0; const localPropDeclaration = getParentOfSymbol(prop) === type.symbol ? declaration : void 0; for (const info of indexInfos) { const localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfDeclaration(info.declaration)) === type.symbol ? info.declaration : void 0; @@ -88166,7 +89124,7 @@ function createTypeChecker(host) { function checkIndexConstraintForIndexSignature(type, checkInfo) { const declaration = checkInfo.declaration; const indexInfos = getApplicableIndexInfos(type, checkInfo.keyType); - const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 264 /* InterfaceDeclaration */) : void 0; + const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 265 /* InterfaceDeclaration */) : void 0; const localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfDeclaration(declaration)) === type.symbol ? declaration : void 0; for (const info of indexInfos) { if (info === checkInfo) continue; @@ -88195,7 +89153,7 @@ function createTypeChecker(host) { } function checkClassNameCollisionWithObject(name) { if (languageVersion >= 1 /* ES5 */ && name.escapedText === "Object" && host.getEmitModuleFormatOfFile(getSourceFileOfNode(name)) < 5 /* ES2015 */) { - error2(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ModuleKind[moduleKind]); + error2(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0, ModuleKind[moduleKind]); } } function checkUnmatchedJSDocParameters(node) { @@ -88264,7 +89222,7 @@ function createTypeChecker(host) { function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 183 /* TypeReference */) { + if (node.kind === 184 /* TypeReference */) { const type = getTypeFromTypeReference(node); if (type.flags & 262144 /* TypeParameter */) { for (let i = index; i < typeParameters.length; i++) { @@ -88719,7 +89677,7 @@ function createTypeChecker(host) { return getCheckFlags(s) & 1 /* Instantiated */ ? s.links.target : s; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { - return filter(symbol.declarations, (d) => d.kind === 263 /* ClassDeclaration */ || d.kind === 264 /* InterfaceDeclaration */); + return filter(symbol.declarations, (d) => d.kind === 264 /* ClassDeclaration */ || d.kind === 265 /* InterfaceDeclaration */); } function checkKindsOfPropertyMemberOverrides(type, baseType) { var _a, _b, _c, _d, _e; @@ -88772,7 +89730,7 @@ function createTypeChecker(host) { const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor; error2(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type)); } else if (useDefineForClassFields) { - const uninitialized = (_d = derived.declarations) == null ? void 0 : _d.find((d) => d.kind === 172 /* PropertyDeclaration */ && !d.initializer); + const uninitialized = (_d = derived.declarations) == null ? void 0 : _d.find((d) => d.kind === 173 /* PropertyDeclaration */ && !d.initializer); if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 64 /* Abstract */) && !(derivedDeclarationFlags & 64 /* Abstract */) && !((_e = derived.declarations) == null ? void 0 : _e.some((d) => !!(d.flags & 33554432 /* Ambient */)))) { const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol)); const propName = uninitialized.name; @@ -88906,7 +89864,7 @@ function createTypeChecker(host) { } } function isPropertyWithoutInitializer(node) { - return node.kind === 172 /* PropertyDeclaration */ && !hasAbstractModifier(node) && !node.exclamationToken && !node.initializer; + return node.kind === 173 /* PropertyDeclaration */ && !hasAbstractModifier(node) && !node.exclamationToken && !node.initializer; } function isPropertyInitializedInStaticBlocks(propName, propType, staticBlocks, startPos, endPos) { for (const staticBlock of staticBlocks) { @@ -88942,7 +89900,7 @@ function createTypeChecker(host) { checkExportsOnMergedDeclarations(node); const symbol = getSymbolOfDeclaration(node); checkTypeParameterListsIdentical(symbol); - const firstInterfaceDecl = getDeclarationOfKind(symbol, 264 /* InterfaceDeclaration */); + const firstInterfaceDecl = getDeclarationOfKind(symbol, 265 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { const type = getDeclaredTypeOfSymbol(symbol); const typeWithThis = getTypeWithThisArgument(type); @@ -89003,6 +89961,8 @@ function createTypeChecker(host) { function computeEnumMemberValue(member, autoValue, previous) { if (isComputedNonLiteralName(member.name)) { error2(member.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums); + } else if (isBigIntLiteral(member.name)) { + error2(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name); } else { const text = getTextOfPropertyName(member.name); if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) { @@ -89178,7 +90138,7 @@ function createTypeChecker(host) { checkGrammarModifiers(node); checkCollisionsForDeclarationName(node, node.name); checkExportsOnMergedDeclarations(node); - node.members.forEach(checkEnumMember); + node.members.forEach(checkSourceElement); if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432 /* Ambient */)) { error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled); } @@ -89196,7 +90156,7 @@ function createTypeChecker(host) { } let seenEnumMissingInitialInitializer = false; forEach(enumSymbol.declarations, (declaration) => { - if (declaration.kind !== 266 /* EnumDeclaration */) { + if (declaration.kind !== 267 /* EnumDeclaration */) { return false; } const enumDeclaration = declaration; @@ -89226,7 +90186,7 @@ function createTypeChecker(host) { const declarations = symbol.declarations; if (declarations) { for (const declaration of declarations) { - if ((declaration.kind === 263 /* ClassDeclaration */ || declaration.kind === 262 /* FunctionDeclaration */ && nodeIsPresent(declaration.body)) && !(declaration.flags & 33554432 /* Ambient */)) { + if ((declaration.kind === 264 /* ClassDeclaration */ || declaration.kind === 263 /* FunctionDeclaration */ && nodeIsPresent(declaration.body)) && !(declaration.flags & 33554432 /* Ambient */)) { return declaration; } } @@ -89298,12 +90258,12 @@ function createTypeChecker(host) { error2(node.name, Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } - const mergedClass = getDeclarationOfKind(symbol, 263 /* ClassDeclaration */); + const mergedClass = getDeclarationOfKind(symbol, 264 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; } } - if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 307 /* SourceFile */ && host.getEmitModuleFormatOfFile(node.parent) === 1 /* CommonJS */) { + if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 308 /* SourceFile */ && host.getEmitModuleFormatOfFile(node.parent) === 1 /* CommonJS */) { const exportModifier = (_b = node.modifiers) == null ? void 0 : _b.find((m) => m.kind === 95 /* ExportKeyword */); if (exportModifier) { error2(exportModifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); @@ -89336,23 +90296,23 @@ function createTypeChecker(host) { } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: for (const decl of node.declarationList.declarations) { checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 277 /* ExportAssignment */: - case 278 /* ExportDeclaration */: + case 278 /* ExportAssignment */: + case 279 /* ExportDeclaration */: grammarErrorOnFirstToken(node, Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: if (isInternalModuleImportEqualsDeclaration(node)) break; // falls through - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: grammarErrorOnFirstToken(node, Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 208 /* BindingElement */: - case 260 /* VariableDeclaration */: + case 209 /* BindingElement */: + case 261 /* VariableDeclaration */: const name = node.name; if (isBindingPattern(name)) { for (const el of name.elements) { @@ -89361,12 +90321,12 @@ function createTypeChecker(host) { break; } // falls through - case 263 /* ClassDeclaration */: - case 266 /* EnumDeclaration */: - case 262 /* FunctionDeclaration */: - case 264 /* InterfaceDeclaration */: - case 267 /* ModuleDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 264 /* ClassDeclaration */: + case 267 /* EnumDeclaration */: + case 263 /* FunctionDeclaration */: + case 265 /* InterfaceDeclaration */: + case 268 /* ModuleDeclaration */: + case 266 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -89377,12 +90337,12 @@ function createTypeChecker(host) { switch (node.kind) { case 80 /* Identifier */: return node; - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: do { node = node.left; } while (node.kind !== 80 /* Identifier */); return node; - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: do { if (isModuleExportsAccessExpression(node.expression) && !isPrivateIdentifier(node.name)) { return node.name; @@ -89401,11 +90361,11 @@ function createTypeChecker(host) { error2(moduleName, Diagnostics.String_literal_expected); return false; } - const inAmbientExternalModule = node.parent.kind === 268 /* ModuleBlock */ && isAmbientModule(node.parent.parent); - if (node.parent.kind !== 307 /* SourceFile */ && !inAmbientExternalModule) { + const inAmbientExternalModule = node.parent.kind === 269 /* ModuleBlock */ && isAmbientModule(node.parent.parent); + if (node.parent.kind !== 308 /* SourceFile */ && !inAmbientExternalModule) { error2( moduleName, - node.kind === 278 /* ExportDeclaration */ ? Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module + node.kind === 279 /* ExportDeclaration */ ? Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module ); return false; } @@ -89439,15 +90399,15 @@ function createTypeChecker(host) { } } function checkAliasSymbol(node) { - var _a, _b, _c, _d; + var _a, _b, _c, _d, _e; let symbol = getSymbolOfDeclaration(node); const target = resolveAlias(symbol); if (target !== unknownSymbol) { symbol = getMergedSymbol(symbol.exportSymbol || symbol); if (isInJSFile(node) && !(target.flags & 111551 /* Value */) && !isTypeOnlyImportOrExportDeclaration(node)) { const errorNode = isImportOrExportSpecifier(node) ? node.propertyName || node.name : isNamedDeclaration(node) ? node.name : node; - Debug.assert(node.kind !== 280 /* NamespaceExport */); - if (node.kind === 281 /* ExportSpecifier */) { + Debug.assert(node.kind !== 281 /* NamespaceExport */); + if (node.kind === 282 /* ExportSpecifier */) { const diag2 = error2(errorNode, Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files); const alreadyExportedSymbol = (_b = (_a = getSourceFileOfNode(node).symbol) == null ? void 0 : _a.exports) == null ? void 0 : _b.get(moduleExportNameTextEscaped(node.propertyName || node.name)); if (alreadyExportedSymbol === target) { @@ -89464,7 +90424,7 @@ function createTypeChecker(host) { } } } else { - Debug.assert(node.kind !== 260 /* VariableDeclaration */); + Debug.assert(node.kind !== 261 /* VariableDeclaration */); const importDeclaration = findAncestor(node, or(isImportDeclaration, isImportEqualsDeclaration)); const moduleSpecifier = (importDeclaration && ((_d = tryGetModuleSpecifierFromDeclaration(importDeclaration)) == null ? void 0 : _d.text)) ?? "..."; const importedIdentifier = unescapeLeadingUnderscores(isIdentifier(errorNode) ? errorNode.escapedText : symbol.escapedName); @@ -89480,9 +90440,9 @@ function createTypeChecker(host) { const targetFlags = getSymbolFlags(target); const excludedMeanings = (symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */) ? 111551 /* Value */ : 0) | (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (targetFlags & excludedMeanings) { - const message = node.kind === 281 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; + const message = node.kind === 282 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error2(node, message, symbolToString(symbol)); - } else if (node.kind !== 281 /* ExportSpecifier */) { + } else if (node.kind !== 282 /* ExportSpecifier */) { const appearsValueyToTranspiler = compilerOptions.isolatedModules && !findAncestor(node, isTypeOnlyImportOrExportDeclaration); if (appearsValueyToTranspiler && symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */)) { error2( @@ -89498,25 +90458,25 @@ function createTypeChecker(host) { const isType = !(targetFlags & 111551 /* Value */); if (isType || typeOnlyAlias) { switch (node.kind) { - case 273 /* ImportClause */: - case 276 /* ImportSpecifier */: - case 271 /* ImportEqualsDeclaration */: { + case 274 /* ImportClause */: + case 277 /* ImportSpecifier */: + case 272 /* ImportEqualsDeclaration */: { if (compilerOptions.verbatimModuleSyntax) { Debug.assertIsDefined(node.name, "An ImportClause with a symbol should have a name"); const message = compilerOptions.verbatimModuleSyntax && isInternalModuleImportEqualsDeclaration(node) ? Diagnostics.An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled : isType ? Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled; - const name = moduleExportNameTextUnescaped(node.kind === 276 /* ImportSpecifier */ ? node.propertyName || node.name : node.name); + const name = moduleExportNameTextUnescaped(node.kind === 277 /* ImportSpecifier */ ? node.propertyName || node.name : node.name); addTypeOnlyDeclarationRelatedInfo( error2(node, message, name), isType ? void 0 : typeOnlyAlias, name ); } - if (isType && node.kind === 271 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 32 /* Export */)) { + if (isType && node.kind === 272 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 32 /* Export */)) { error2(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled, isolatedModulesLikeFlagName); } break; } - case 281 /* ExportSpecifier */: { + case 282 /* ExportSpecifier */: { if (compilerOptions.verbatimModuleSyntax || getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) { const name = moduleExportNameTextUnescaped(node.propertyName || node.name); const diagnostic = isType ? error2(node, Diagnostics.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type, isolatedModulesLikeFlagName) : error2(node, Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled, name, isolatedModulesLikeFlagName); @@ -89526,14 +90486,14 @@ function createTypeChecker(host) { } } } - if (compilerOptions.verbatimModuleSyntax && node.kind !== 271 /* ImportEqualsDeclaration */ && !isInJSFile(node) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */) { + if (compilerOptions.verbatimModuleSyntax && node.kind !== 272 /* ImportEqualsDeclaration */ && !isInJSFile(node) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */) { error2(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); - } else if (moduleKind === 200 /* Preserve */ && node.kind !== 271 /* ImportEqualsDeclaration */ && node.kind !== 260 /* VariableDeclaration */ && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */) { + } else if (moduleKind === 200 /* Preserve */ && node.kind !== 272 /* ImportEqualsDeclaration */ && node.kind !== 261 /* VariableDeclaration */ && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */) { error2(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve); } if (compilerOptions.verbatimModuleSyntax && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 33554432 /* Ambient */) && targetFlags & 128 /* ConstEnum */) { const constEnumDeclaration = target.valueDeclaration; - const redirect = host.getRedirectReferenceForResolutionFromSourceOfProject(getSourceFileOfNode(constEnumDeclaration).resolvedPath); + const redirect = (_e = host.getRedirectFromOutput(getSourceFileOfNode(constEnumDeclaration).resolvedPath)) == null ? void 0 : _e.resolvedRef; if (constEnumDeclaration.flags & 33554432 /* Ambient */ && (!redirect || !shouldPreserveConstEnums(redirect.commandLine.options))) { error2(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName); } @@ -89575,7 +90535,7 @@ function createTypeChecker(host) { function checkImportBinding(node) { checkCollisionsForDeclarationName(node, node.name); checkAliasSymbol(node); - if (node.kind === 276 /* ImportSpecifier */) { + if (node.kind === 277 /* ImportSpecifier */) { checkModuleExportName(node.propertyName); if (moduleExportNameIsDefault(node.propertyName || node.name) && getESModuleInterop(compilerOptions) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */) { checkExternalEmitHelpers(node, 131072 /* ImportDefault */); @@ -89602,10 +90562,10 @@ function createTypeChecker(host) { if (!moduleSupportsImportAttributes(moduleKind)) { return grammarErrorOnNode( node, - isImportAttributes2 ? Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve + isImportAttributes2 ? Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext_or_preserve : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext_or_preserve ); } - if (moduleKind === 199 /* NodeNext */ && !isImportAttributes2) { + if (102 /* Node20 */ <= moduleKind && moduleKind <= 199 /* NodeNext */ && !isImportAttributes2) { return grammarErrorOnFirstToken(node, Diagnostics.Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert); } if (declaration.moduleSpecifier && getEmitSyntaxForModuleSpecifierExpression(declaration.moduleSpecifier) === 1 /* CommonJS */) { @@ -89641,7 +90601,7 @@ function createTypeChecker(host) { checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 274 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 275 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); if (host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */ && getESModuleInterop(compilerOptions)) { checkExternalEmitHelpers(node, 65536 /* ImportStar */); @@ -89679,7 +90639,7 @@ function createTypeChecker(host) { if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); markLinkedReferences(node, 6 /* ExportImportEquals */); - if (node.moduleReference.kind !== 283 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 284 /* ExternalModuleReference */) { const target = resolveAlias(getSymbolOfDeclaration(node)); if (target !== unknownSymbol) { const targetFlags = getSymbolFlags(target); @@ -89714,9 +90674,9 @@ function createTypeChecker(host) { if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { if (node.exportClause && !isNamespaceExport(node.exportClause)) { forEach(node.exportClause.elements, checkExportSpecifier); - const inAmbientExternalModule = node.parent.kind === 268 /* ModuleBlock */ && isAmbientModule(node.parent.parent); - const inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 268 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 33554432 /* Ambient */; - if (node.parent.kind !== 307 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + const inAmbientExternalModule = node.parent.kind === 269 /* ModuleBlock */ && isAmbientModule(node.parent.parent); + const inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 269 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 33554432 /* Ambient */; + if (node.parent.kind !== 308 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error2(node, Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } else { @@ -89742,13 +90702,13 @@ function createTypeChecker(host) { } function checkGrammarExportDeclaration(node) { var _a; - if (node.isTypeOnly && ((_a = node.exportClause) == null ? void 0 : _a.kind) === 279 /* NamedExports */) { + if (node.isTypeOnly && ((_a = node.exportClause) == null ? void 0 : _a.kind) === 280 /* NamedExports */) { return checkGrammarNamedImportsOrExports(node.exportClause); } return false; } function checkGrammarModuleElementContext(node, errorMessage) { - const isInAppropriateContext = node.parent.kind === 307 /* SourceFile */ || node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 267 /* ModuleDeclaration */; + const isInAppropriateContext = node.parent.kind === 308 /* SourceFile */ || node.parent.kind === 269 /* ModuleBlock */ || node.parent.kind === 268 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -89799,8 +90759,8 @@ function createTypeChecker(host) { if (compilerOptions.erasableSyntaxOnly && node.isExportEquals && !(node.flags & 33554432 /* Ambient */)) { error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled); } - const container = node.parent.kind === 307 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 267 /* ModuleDeclaration */ && !isAmbientModule(container)) { + const container = node.parent.kind === 308 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 268 /* ModuleDeclaration */ && !isAmbientModule(container)) { if (node.isExportEquals) { error2(node, Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } else { @@ -89973,187 +90933,189 @@ function createTypeChecker(host) { const kind = node.kind; if (cancellationToken) { switch (kind) { - case 267 /* ModuleDeclaration */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 262 /* FunctionDeclaration */: + case 268 /* ModuleDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 263 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 243 /* FirstStatement */ && kind <= 259 /* LastStatement */ && canHaveFlowNode(node) && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 244 /* FirstStatement */ && kind <= 260 /* LastStatement */ && canHaveFlowNode(node) && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, Diagnostics.Unreachable_code_detected); } switch (kind) { - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: return checkTypeParameter(node); - case 169 /* Parameter */: + case 170 /* Parameter */: return checkParameter(node); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return checkPropertyDeclaration(node); - case 171 /* PropertySignature */: + case 172 /* PropertySignature */: return checkPropertySignature(node); - case 185 /* ConstructorType */: - case 184 /* FunctionType */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 181 /* IndexSignature */: + case 186 /* ConstructorType */: + case 185 /* FunctionType */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 182 /* IndexSignature */: return checkSignatureDeclaration(node); - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: return checkMethodDeclaration(node); - case 175 /* ClassStaticBlockDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: return checkClassStaticBlockDeclaration(node); - case 176 /* Constructor */: + case 177 /* Constructor */: return checkConstructorDeclaration(node); - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return checkAccessorDeclaration(node); - case 183 /* TypeReference */: + case 184 /* TypeReference */: return checkTypeReferenceNode(node); - case 182 /* TypePredicate */: + case 183 /* TypePredicate */: return checkTypePredicate(node); - case 186 /* TypeQuery */: + case 187 /* TypeQuery */: return checkTypeQuery(node); - case 187 /* TypeLiteral */: + case 188 /* TypeLiteral */: return checkTypeLiteral(node); - case 188 /* ArrayType */: + case 189 /* ArrayType */: return checkArrayType(node); - case 189 /* TupleType */: + case 190 /* TupleType */: return checkTupleType(node); - case 192 /* UnionType */: - case 193 /* IntersectionType */: + case 193 /* UnionType */: + case 194 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 196 /* ParenthesizedType */: - case 190 /* OptionalType */: - case 191 /* RestType */: + case 197 /* ParenthesizedType */: + case 191 /* OptionalType */: + case 192 /* RestType */: return checkSourceElement(node.type); - case 197 /* ThisType */: + case 198 /* ThisType */: return checkThisType(node); - case 198 /* TypeOperator */: + case 199 /* TypeOperator */: return checkTypeOperator(node); - case 194 /* ConditionalType */: + case 195 /* ConditionalType */: return checkConditionalType(node); - case 195 /* InferType */: + case 196 /* InferType */: return checkInferType(node); - case 203 /* TemplateLiteralType */: + case 204 /* TemplateLiteralType */: return checkTemplateLiteralType(node); - case 205 /* ImportType */: + case 206 /* ImportType */: return checkImportType(node); - case 202 /* NamedTupleMember */: + case 203 /* NamedTupleMember */: return checkNamedTupleMember(node); - case 328 /* JSDocAugmentsTag */: + case 329 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 329 /* JSDocImplementsTag */: + case 330 /* JSDocImplementsTag */: return checkJSDocImplementsTag(node); - case 346 /* JSDocTypedefTag */: - case 338 /* JSDocCallbackTag */: - case 340 /* JSDocEnumTag */: + case 347 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: + case 341 /* JSDocEnumTag */: return checkJSDocTypeAliasTag(node); - case 345 /* JSDocTemplateTag */: + case 346 /* JSDocTemplateTag */: return checkJSDocTemplateTag(node); - case 344 /* JSDocTypeTag */: + case 345 /* JSDocTypeTag */: return checkJSDocTypeTag(node); - case 324 /* JSDocLink */: - case 325 /* JSDocLinkCode */: - case 326 /* JSDocLinkPlain */: + case 325 /* JSDocLink */: + case 326 /* JSDocLinkCode */: + case 327 /* JSDocLinkPlain */: return checkJSDocLinkLikeTag(node); - case 341 /* JSDocParameterTag */: + case 342 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 348 /* JSDocPropertyTag */: + case 349 /* JSDocPropertyTag */: return checkJSDocPropertyTag(node); - case 317 /* JSDocFunctionType */: + case 318 /* JSDocFunctionType */: checkJSDocFunctionType(node); // falls through - case 315 /* JSDocNonNullableType */: - case 314 /* JSDocNullableType */: - case 312 /* JSDocAllType */: - case 313 /* JSDocUnknownType */: - case 322 /* JSDocTypeLiteral */: + case 316 /* JSDocNonNullableType */: + case 315 /* JSDocNullableType */: + case 313 /* JSDocAllType */: + case 314 /* JSDocUnknownType */: + case 323 /* JSDocTypeLiteral */: checkJSDocTypeIsInJsFile(node); forEachChild(node, checkSourceElement); return; - case 318 /* JSDocVariadicType */: + case 319 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 309 /* JSDocTypeExpression */: + case 310 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 333 /* JSDocPublicTag */: - case 335 /* JSDocProtectedTag */: - case 334 /* JSDocPrivateTag */: + case 334 /* JSDocPublicTag */: + case 336 /* JSDocProtectedTag */: + case 335 /* JSDocPrivateTag */: return checkJSDocAccessibilityModifiers(node); - case 350 /* JSDocSatisfiesTag */: + case 351 /* JSDocSatisfiesTag */: return checkJSDocSatisfiesTag(node); - case 343 /* JSDocThisTag */: + case 344 /* JSDocThisTag */: return checkJSDocThisTag(node); - case 351 /* JSDocImportTag */: + case 352 /* JSDocImportTag */: return checkJSDocImportTag(node); - case 199 /* IndexedAccessType */: + case 200 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 200 /* MappedType */: + case 201 /* MappedType */: return checkMappedType(node); - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 241 /* Block */: - case 268 /* ModuleBlock */: + case 242 /* Block */: + case 269 /* ModuleBlock */: return checkBlock(node); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return checkVariableStatement(node); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return checkExpressionStatement(node); - case 245 /* IfStatement */: + case 246 /* IfStatement */: return checkIfStatement(node); - case 246 /* DoStatement */: + case 247 /* DoStatement */: return checkDoStatement(node); - case 247 /* WhileStatement */: + case 248 /* WhileStatement */: return checkWhileStatement(node); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return checkForStatement(node); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return checkForInStatement(node); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return checkForOfStatement(node); - case 251 /* ContinueStatement */: - case 252 /* BreakStatement */: + case 252 /* ContinueStatement */: + case 253 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 253 /* ReturnStatement */: + case 254 /* ReturnStatement */: return checkReturnStatement(node); - case 254 /* WithStatement */: + case 255 /* WithStatement */: return checkWithStatement(node); - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return checkSwitchStatement(node); - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return checkLabeledStatement(node); - case 257 /* ThrowStatement */: + case 258 /* ThrowStatement */: return checkThrowStatement(node); - case 258 /* TryStatement */: + case 259 /* TryStatement */: return checkTryStatement(node); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return checkBindingElement(node); - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return checkClassDeclaration(node); - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 265 /* TypeAliasDeclaration */: + case 266 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 267 /* ModuleDeclaration */: + case 307 /* EnumMember */: + return checkEnumMember(node); + case 268 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return checkImportDeclaration(node); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: return checkExportDeclaration(node); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return checkExportAssignment(node); - case 242 /* EmptyStatement */: - case 259 /* DebuggerStatement */: + case 243 /* EmptyStatement */: + case 260 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 282 /* MissingDeclaration */: + case 283 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -90257,44 +91219,44 @@ function createTypeChecker(host) { currentNode = node; instantiationCount = 0; switch (node.kind) { - case 213 /* CallExpression */: - case 214 /* NewExpression */: - case 215 /* TaggedTemplateExpression */: - case 170 /* Decorator */: - case 286 /* JsxOpeningElement */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: + case 216 /* TaggedTemplateExpression */: + case 171 /* Decorator */: + case 287 /* JsxOpeningElement */: resolveUntypedCall(node); break; - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: checkClassExpressionDeferred(node); break; - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: checkTypeParameterDeferred(node); break; - case 285 /* JsxSelfClosingElement */: + case 286 /* JsxSelfClosingElement */: checkJsxSelfClosingElementDeferred(node); break; - case 284 /* JsxElement */: + case 285 /* JsxElement */: checkJsxElementDeferred(node); break; - case 216 /* TypeAssertionExpression */: - case 234 /* AsExpression */: - case 217 /* ParenthesizedExpression */: + case 217 /* TypeAssertionExpression */: + case 235 /* AsExpression */: + case 218 /* ParenthesizedExpression */: checkAssertionDeferred(node); break; - case 222 /* VoidExpression */: + case 223 /* VoidExpression */: checkExpression(node.expression); break; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: if (isInstanceOfExpression(node)) { resolveUntypedCall(node); } @@ -90485,16 +91447,16 @@ function createTypeChecker(host) { copySymbols(location.locals, meaning); } switch (location.kind) { - case 307 /* SourceFile */: + case 308 /* SourceFile */: if (!isExternalModule(location)) break; // falls through - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: copyLocallyVisibleExportSymbols(getSymbolOfDeclaration(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: copySymbols(getSymbolOfDeclaration(location).exports, meaning & 8 /* EnumMember */); break; - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: const className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -90502,13 +91464,13 @@ function createTypeChecker(host) { // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration. // falls through - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: if (!isStaticSymbol) { copySymbols(getMembersOfSymbol(getSymbolOfDeclaration(location)), meaning & 788968 /* Type */); } break; - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: const funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -90541,7 +91503,7 @@ function createTypeChecker(host) { function copyLocallyVisibleExportSymbols(source, meaning2) { if (meaning2) { source.forEach((symbol) => { - if (!getDeclarationOfKind(symbol, 281 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 280 /* NamespaceExport */) && symbol.escapedName !== "default" /* Default */) { + if (!getDeclarationOfKind(symbol, 282 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 281 /* NamespaceExport */) && symbol.escapedName !== "default" /* Default */) { copySymbol(symbol, meaning2); } }); @@ -90552,16 +91514,16 @@ function createTypeChecker(host) { return name.kind === 80 /* Identifier */ && isTypeDeclaration(name.parent) && getNameOfDeclaration(name.parent) === name; } function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 166 /* QualifiedName */) { + while (node.parent.kind === 167 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 183 /* TypeReference */; + return node.parent.kind === 184 /* TypeReference */; } function isInNameOfExpressionWithTypeArguments(node) { - while (node.parent.kind === 211 /* PropertyAccessExpression */) { + while (node.parent.kind === 212 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent.kind === 233 /* ExpressionWithTypeArguments */; + return node.parent.kind === 234 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { let result; @@ -90586,13 +91548,13 @@ function createTypeChecker(host) { return !!forEachEnclosingClass(node, (n) => n === classDeclaration); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 166 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 167 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 271 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 272 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : void 0; } - if (nodeOnRightSide.parent.kind === 277 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 278 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : void 0; } return void 0; @@ -90622,7 +91584,7 @@ function createTypeChecker(host) { node = parent2; parent2 = parent2.parent; } - if (parent2 && parent2.kind === 205 /* ImportType */ && parent2.qualifier === node) { + if (parent2 && parent2.kind === 206 /* ImportType */ && parent2.qualifier === node) { return parent2; } return void 0; @@ -90654,7 +91616,7 @@ function createTypeChecker(host) { if (isDeclarationName(name)) { return getSymbolOfNode(name.parent); } - if (isInJSFile(name) && name.parent.kind === 211 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { + if (isInJSFile(name) && name.parent.kind === 212 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { if (!isPrivateIdentifier(name) && !isJSDocMemberName(name) && !isThisPropertyAndThisTyped(name.parent)) { const specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(name); if (specialPropertyAssignmentSymbol) { @@ -90662,7 +91624,7 @@ function createTypeChecker(host) { } } } - if (name.parent.kind === 277 /* ExportAssignment */ && isEntityNameExpression(name)) { + if (name.parent.kind === 278 /* ExportAssignment */ && isEntityNameExpression(name)) { const success = resolveEntityName( name, /*all meanings*/ @@ -90674,7 +91636,7 @@ function createTypeChecker(host) { return success; } } else if (isEntityName(name) && isInRightSideOfImportOrExportAssignment(name)) { - const importEqualsDeclaration = getAncestor(name, 271 /* ImportEqualsDeclaration */); + const importEqualsDeclaration = getAncestor(name, 272 /* ImportEqualsDeclaration */); Debug.assert(importEqualsDeclaration !== void 0); return getSymbolOfPartOfRightHandSideOfImportEquals( name, @@ -90695,7 +91657,7 @@ function createTypeChecker(host) { } if (isInNameOfExpressionWithTypeArguments(name)) { let meaning = 0 /* None */; - if (name.parent.kind === 233 /* ExpressionWithTypeArguments */) { + if (name.parent.kind === 234 /* ExpressionWithTypeArguments */) { meaning = isPartOfTypeNode(name) ? 788968 /* Type */ : 111551 /* Value */; if (isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { meaning |= 111551 /* Value */; @@ -90714,10 +91676,10 @@ function createTypeChecker(host) { return entityNameSymbol; } } - if (name.parent.kind === 341 /* JSDocParameterTag */) { + if (name.parent.kind === 342 /* JSDocParameterTag */) { return getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 168 /* TypeParameter */ && name.parent.parent.kind === 345 /* JSDocTemplateTag */) { + if (name.parent.kind === 169 /* TypeParameter */ && name.parent.parent.kind === 346 /* JSDocTemplateTag */) { Debug.assert(!isInJSFile(name)); const typeParameter = getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -90770,12 +91732,12 @@ function createTypeChecker(host) { return result; } else if (isPrivateIdentifier(name)) { return getSymbolForPrivateIdentifierExpression(name); - } else if (name.kind === 211 /* PropertyAccessExpression */ || name.kind === 166 /* QualifiedName */) { + } else if (name.kind === 212 /* PropertyAccessExpression */ || name.kind === 167 /* QualifiedName */) { const links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 211 /* PropertyAccessExpression */) { + if (name.kind === 212 /* PropertyAccessExpression */) { checkPropertyAccessExpression(name, 0 /* Normal */); if (!links.resolvedSymbol) { links.resolvedSymbol = getApplicableIndexSymbol(checkExpressionCached(name.expression), getLiteralTypeFromPropertyName(name.name)); @@ -90791,7 +91753,7 @@ function createTypeChecker(host) { return resolveJSDocMemberName(name); } } else if (isEntityName(name) && isTypeReferenceIdentifier(name)) { - const meaning = name.parent.kind === 183 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; + const meaning = name.parent.kind === 184 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; const symbol = resolveEntityName( name, meaning, @@ -90802,7 +91764,7 @@ function createTypeChecker(host) { ); return symbol && symbol !== unknownSymbol ? symbol : getUnresolvedSymbolForEntityName(name); } - if (name.parent.kind === 182 /* TypePredicate */) { + if (name.parent.kind === 183 /* TypePredicate */) { return resolveEntityName( name, /*meaning*/ @@ -90882,7 +91844,7 @@ function createTypeChecker(host) { if (node.kind === 80 /* Identifier */) { if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); - } else if (parent2.kind === 208 /* BindingElement */ && grandParent.kind === 206 /* ObjectBindingPattern */ && node === parent2.propertyName) { + } else if (parent2.kind === 209 /* BindingElement */ && grandParent.kind === 207 /* ObjectBindingPattern */ && node === parent2.propertyName) { const typeOfPattern = getTypeOfNode(grandParent); const propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); if (propertyDeclaration) { @@ -90901,8 +91863,8 @@ function createTypeChecker(host) { switch (node.kind) { case 80 /* Identifier */: case 81 /* PrivateIdentifier */: - case 211 /* PropertyAccessExpression */: - case 166 /* QualifiedName */: + case 212 /* PropertyAccessExpression */: + case 167 /* QualifiedName */: if (!isThisInTypeQuery(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } @@ -90925,19 +91887,19 @@ function createTypeChecker(host) { return checkExpression(node).symbol; } // falls through - case 197 /* ThisType */: + case 198 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 108 /* SuperKeyword */: return checkExpression(node).symbol; case 137 /* ConstructorKeyword */: const constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 176 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 177 /* Constructor */) { return constructorDeclaration.parent.symbol; } return void 0; case 11 /* StringLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: - if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 272 /* ImportDeclaration */ || node.parent.kind === 278 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || isInJSFile(node) && isJSDocImportTag(node.parent) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall( + if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 273 /* ImportDeclaration */ || node.parent.kind === 279 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || isInJSFile(node) && isJSDocImportTag(node.parent) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall( node.parent, /*requireStringLiteralLikeArgument*/ false @@ -90956,11 +91918,15 @@ function createTypeChecker(host) { case 39 /* EqualsGreaterThanToken */: case 86 /* ClassKeyword */: return getSymbolOfNode(node.parent); - case 205 /* ImportType */: + case 206 /* ImportType */: return isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : void 0; case 95 /* ExportKeyword */: return isExportAssignment(node.parent) ? Debug.checkDefined(node.parent.symbol) : void 0; case 102 /* ImportKeyword */: + if (isMetaProperty(node.parent) && node.parent.name.escapedText === "defer") { + return void 0; + } + // falls through case 105 /* NewKeyword */: return isMetaProperty(node.parent) ? checkMetaPropertyKeyword(node.parent).symbol : void 0; case 104 /* InstanceOfKeyword */: @@ -90970,9 +91936,9 @@ function createTypeChecker(host) { return (hasInstanceMethodType == null ? void 0 : hasInstanceMethodType.symbol) ?? type.symbol; } return void 0; - case 236 /* MetaProperty */: + case 237 /* MetaProperty */: return checkExpression(node).symbol; - case 295 /* JsxNamespacedName */: + case 296 /* JsxNamespacedName */: if (isJSXTagName(node) && isJsxIntrinsicTagName(node)) { const symbol = getIntrinsicTagSymbol(node.parent); return symbol === unknownSymbol ? void 0 : symbol; @@ -90992,7 +91958,7 @@ function createTypeChecker(host) { return void 0; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 304 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 305 /* ShorthandPropertyAssignment */) { return resolveEntityName( location.name, 111551 /* Value */ | 2097152 /* Alias */, @@ -91097,16 +92063,16 @@ function createTypeChecker(host) { return errorType; } function getTypeOfAssignmentPattern(expr) { - Debug.assert(expr.kind === 210 /* ObjectLiteralExpression */ || expr.kind === 209 /* ArrayLiteralExpression */); - if (expr.parent.kind === 250 /* ForOfStatement */) { + Debug.assert(expr.kind === 211 /* ObjectLiteralExpression */ || expr.kind === 210 /* ArrayLiteralExpression */); + if (expr.parent.kind === 251 /* ForOfStatement */) { const iteratedType = checkRightHandSideOfForOf(expr.parent); return checkDestructuringAssignment(expr, iteratedType || errorType); } - if (expr.parent.kind === 226 /* BinaryExpression */) { + if (expr.parent.kind === 227 /* BinaryExpression */) { const iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } - if (expr.parent.kind === 303 /* PropertyAssignment */) { + if (expr.parent.kind === 304 /* PropertyAssignment */) { const node2 = cast(expr.parent.parent, isObjectLiteralExpression); const typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node2) || errorType; const propertyIndex = indexOfNode(node2.properties, expr.parent); @@ -91139,7 +92105,7 @@ function createTypeChecker(host) { case 9 /* NumericLiteral */: case 11 /* StringLiteral */: return getStringLiteralType(name.text); - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: const nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType; default: @@ -91214,7 +92180,7 @@ function createTypeChecker(host) { } const parentSymbol = getParentOfSymbol(symbol); if (parentSymbol) { - if (parentSymbol.flags & 512 /* ValueModule */ && ((_a = parentSymbol.valueDeclaration) == null ? void 0 : _a.kind) === 307 /* SourceFile */) { + if (parentSymbol.flags & 512 /* ValueModule */ && ((_a = parentSymbol.valueDeclaration) == null ? void 0 : _a.kind) === 308 /* SourceFile */) { const symbolFile = parentSymbol.valueDeclaration; const referenceFile = getSourceFileOfNode(node); const symbolIsUmdExport = symbolFile !== referenceFile; @@ -91244,7 +92210,7 @@ function createTypeChecker(host) { return void 0; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { - return symbol.valueDeclaration && isBindingElement(symbol.valueDeclaration) && walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 299 /* CatchClause */; + return symbol.valueDeclaration && isBindingElement(symbol.valueDeclaration) && walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 300 /* CatchClause */; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 /* BlockScoped */ && symbol.valueDeclaration && !isSourceFile(symbol.valueDeclaration)) { @@ -91269,7 +92235,7 @@ function createTypeChecker(host) { /*lookInLabeledStatements*/ false ); - const inLoopBodyBlock = container.kind === 241 /* Block */ && isIterationStatement( + const inLoopBodyBlock = container.kind === 242 /* Block */ && isIterationStatement( container.parent, /*lookInLabeledStatements*/ false @@ -91309,22 +92275,22 @@ function createTypeChecker(host) { function isValueAliasDeclaration(node) { Debug.assert(canCollectSymbolAliasAccessabilityData); switch (node.kind) { - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfDeclaration(node)); - case 273 /* ImportClause */: - case 274 /* NamespaceImport */: - case 276 /* ImportSpecifier */: - case 281 /* ExportSpecifier */: + case 274 /* ImportClause */: + case 275 /* NamespaceImport */: + case 277 /* ImportSpecifier */: + case 282 /* ExportSpecifier */: const symbol = getSymbolOfDeclaration(node); return !!symbol && isAliasResolvedToValue( symbol, /*excludeTypeOnlyValues*/ true ); - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: const exportClause = node.exportClause; return !!exportClause && (isNamespaceExport(exportClause) || some(exportClause.elements, isValueAliasDeclaration)); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return node.expression && node.expression.kind === 80 /* Identifier */ ? isAliasResolvedToValue( getSymbolOfDeclaration(node), /*excludeTypeOnlyValues*/ @@ -91335,7 +92301,7 @@ function createTypeChecker(host) { } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { const node = getParseTreeNode(nodeIn, isImportEqualsDeclaration); - if (node === void 0 || node.parent.kind !== 307 /* SourceFile */ || !isInternalModuleImportEqualsDeclaration(node)) { + if (node === void 0 || node.parent.kind !== 308 /* SourceFile */ || !isInternalModuleImportEqualsDeclaration(node)) { return false; } const isValue = isAliasResolvedToValue(getSymbolOfDeclaration(node)); @@ -91565,15 +92531,15 @@ function createTypeChecker(host) { } function canHaveConstantValue(node) { switch (node.kind) { - case 306 /* EnumMember */: - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 307 /* EnumMember */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: return true; } return false; } function getConstantValue2(node) { - if (node.kind === 306 /* EnumMember */) { + if (node.kind === 307 /* EnumMember */) { return getEnumMemberValue(node).value; } if (!getNodeLinks(node).resolvedSymbol) { @@ -91694,12 +92660,12 @@ function createTypeChecker(host) { } function getAllAccessorDeclarationsForDeclaration(accessor) { accessor = getParseTreeNode(accessor, isGetOrSetAccessorDeclaration); - const otherKind = accessor.kind === 178 /* SetAccessor */ ? 177 /* GetAccessor */ : 178 /* SetAccessor */; + const otherKind = accessor.kind === 179 /* SetAccessor */ ? 178 /* GetAccessor */ : 179 /* SetAccessor */; const otherAccessor = getDeclarationOfKind(getSymbolOfDeclaration(accessor), otherKind); const firstAccessor = otherAccessor && otherAccessor.pos < accessor.pos ? otherAccessor : accessor; const secondAccessor = otherAccessor && otherAccessor.pos < accessor.pos ? accessor : otherAccessor; - const setAccessor = accessor.kind === 178 /* SetAccessor */ ? accessor : otherAccessor; - const getAccessor = accessor.kind === 177 /* GetAccessor */ ? accessor : otherAccessor; + const setAccessor = accessor.kind === 179 /* SetAccessor */ ? accessor : otherAccessor; + const getAccessor = accessor.kind === 178 /* GetAccessor */ ? accessor : otherAccessor; return { firstAccessor, secondAccessor, @@ -91783,24 +92749,24 @@ function createTypeChecker(host) { if (symbol) { return filter(getExportSymbolOfValueSymbolIfExported(symbol).declarations, (declaration) => { switch (declaration.kind) { - case 260 /* VariableDeclaration */: - case 169 /* Parameter */: - case 208 /* BindingElement */: - case 172 /* PropertyDeclaration */: - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: - case 306 /* EnumMember */: - case 210 /* ObjectLiteralExpression */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 266 /* EnumDeclaration */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 267 /* ModuleDeclaration */: + case 261 /* VariableDeclaration */: + case 170 /* Parameter */: + case 209 /* BindingElement */: + case 173 /* PropertyDeclaration */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: + case 307 /* EnumMember */: + case 211 /* ObjectLiteralExpression */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 267 /* EnumDeclaration */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 268 /* ModuleDeclaration */: return true; } return false; @@ -91862,7 +92828,7 @@ function createTypeChecker(host) { if (direct) { return direct; } - if (node.kind === 169 /* Parameter */ && node.parent.kind === 178 /* SetAccessor */) { + if (node.kind === 170 /* Parameter */ && node.parent.kind === 179 /* SetAccessor */) { const other = getAllAccessorDeclarationsForDeclaration(node.parent).getAccessor; if (other) { return getEffectiveReturnTypeNode(other); @@ -91939,7 +92905,7 @@ function createTypeChecker(host) { }, getDeclarationStatementsForSourceFile: (node, flags, internalFlags, tracker) => { const n = getParseTreeNode(node); - Debug.assert(n && n.kind === 307 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + Debug.assert(n && n.kind === 308 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); const sym = getSymbolOfDeclaration(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, internalFlags, tracker); @@ -92016,6 +92982,9 @@ function createTypeChecker(host) { tracker.trackSymbol(name, enclosing, 111551 /* Value */); } } + }, + symbolToDeclarations: (symbol, meaning, flags, maximumLength, verbosityLevel, out) => { + return nodeBuilder.symbolToDeclarations(symbol, meaning, flags, maximumLength, verbosityLevel, out); } }; function isImportRequiredByAugmentation(node) { @@ -92042,7 +93011,7 @@ function createTypeChecker(host) { } } function getExternalModuleFileFromDeclaration(declaration) { - const specifier = declaration.kind === 267 /* ModuleDeclaration */ ? tryCast(declaration.name, isStringLiteral) : getExternalModuleName(declaration); + const specifier = declaration.kind === 268 /* ModuleDeclaration */ ? tryCast(declaration.name, isStringLiteral) : getExternalModuleName(declaration); const moduleSymbol = resolveExternalModuleNameWorker( specifier, specifier, @@ -92052,7 +93021,7 @@ function createTypeChecker(host) { if (!moduleSymbol) { return void 0; } - return getDeclarationOfKind(moduleSymbol, 307 /* SourceFile */); + return getDeclarationOfKind(moduleSymbol, 308 /* SourceFile */); } function initializeTypeChecker() { for (const file of host.getSourceFiles()) { @@ -92349,12 +93318,12 @@ function createTypeChecker(host) { for (const modifier of node.modifiers) { if (isDecorator(modifier)) { if (!nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) { - if (node.kind === 174 /* MethodDeclaration */ && !nodeIsPresent(node.body)) { + if (node.kind === 175 /* MethodDeclaration */ && !nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_not_valid_here); } - } else if (legacyDecorators && (node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */)) { + } else if (legacyDecorators && (node.kind === 178 /* GetAccessor */ || node.kind === 179 /* SetAccessor */)) { const accessors = getAllAccessorDeclarationsForDeclaration(node); if (hasDecorators(accessors.firstAccessor) && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -92384,25 +93353,25 @@ function createTypeChecker(host) { firstDecorator ?? (firstDecorator = modifier); } else { if (modifier.kind !== 148 /* ReadonlyKeyword */) { - if (node.kind === 171 /* PropertySignature */ || node.kind === 173 /* MethodSignature */) { + if (node.kind === 172 /* PropertySignature */ || node.kind === 174 /* MethodSignature */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind)); } - if (node.kind === 181 /* IndexSignature */ && (modifier.kind !== 126 /* StaticKeyword */ || !isClassLike(node.parent))) { + if (node.kind === 182 /* IndexSignature */ && (modifier.kind !== 126 /* StaticKeyword */ || !isClassLike(node.parent))) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_index_signature, tokenToString(modifier.kind)); } } if (modifier.kind !== 103 /* InKeyword */ && modifier.kind !== 147 /* OutKeyword */ && modifier.kind !== 87 /* ConstKeyword */) { - if (node.kind === 168 /* TypeParameter */) { + if (node.kind === 169 /* TypeParameter */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_parameter, tokenToString(modifier.kind)); } } switch (modifier.kind) { case 87 /* ConstKeyword */: { - if (node.kind !== 266 /* EnumDeclaration */ && node.kind !== 168 /* TypeParameter */) { + if (node.kind !== 267 /* EnumDeclaration */ && node.kind !== 169 /* TypeParameter */) { return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString(87 /* ConstKeyword */)); } const parent2 = isJSDocTemplateTag(node.parent) && getEffectiveJSDocHost(node.parent) || node.parent; - if (node.kind === 168 /* TypeParameter */ && !(isFunctionLikeDeclaration(parent2) || isClassLike(parent2) || isFunctionTypeNode(parent2) || isConstructorTypeNode(parent2) || isCallSignatureDeclaration(parent2) || isConstructSignatureDeclaration(parent2) || isMethodSignature(parent2))) { + if (node.kind === 169 /* TypeParameter */ && !(isFunctionLikeDeclaration(parent2) || isClassLike(parent2) || isFunctionTypeNode(parent2) || isConstructorTypeNode(parent2) || isCallSignatureDeclaration(parent2) || isConstructSignatureDeclaration(parent2) || isMethodSignature(parent2))) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class, tokenToString(modifier.kind)); } break; @@ -92438,7 +93407,7 @@ function createTypeChecker(host) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly"); } else if (flags & 1024 /* Async */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); - } else if (node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 307 /* SourceFile */) { + } else if (node.parent.kind === 269 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 64 /* Abstract */) { if (modifier.kind === 123 /* PrivateKeyword */) { @@ -92460,9 +93429,9 @@ function createTypeChecker(host) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } else if (flags & 512 /* Accessor */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor"); - } else if (node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 307 /* SourceFile */) { + } else if (node.parent.kind === 269 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); - } else if (node.kind === 169 /* Parameter */) { + } else if (node.kind === 170 /* Parameter */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 64 /* Abstract */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); @@ -92479,7 +93448,7 @@ function createTypeChecker(host) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly"); } else if (flags & 128 /* Ambient */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare"); - } else if (node.kind !== 172 /* PropertyDeclaration */) { + } else if (node.kind !== 173 /* PropertyDeclaration */) { return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration); } flags |= 512 /* Accessor */; @@ -92487,7 +93456,7 @@ function createTypeChecker(host) { case 148 /* ReadonlyKeyword */: if (flags & 8 /* Readonly */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly"); - } else if (node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 171 /* PropertySignature */ && node.kind !== 181 /* IndexSignature */ && node.kind !== 169 /* Parameter */) { + } else if (node.kind !== 173 /* PropertyDeclaration */ && node.kind !== 172 /* PropertySignature */ && node.kind !== 182 /* IndexSignature */ && node.kind !== 170 /* Parameter */) { return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } else if (flags & 512 /* Accessor */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor"); @@ -92495,8 +93464,8 @@ function createTypeChecker(host) { flags |= 8 /* Readonly */; break; case 95 /* ExportKeyword */: - if (compilerOptions.verbatimModuleSyntax && !(node.flags & 33554432 /* Ambient */) && node.kind !== 265 /* TypeAliasDeclaration */ && node.kind !== 264 /* InterfaceDeclaration */ && // ModuleDeclaration needs to be checked that it is uninstantiated later - node.kind !== 267 /* ModuleDeclaration */ && node.parent.kind === 307 /* SourceFile */ && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */) { + if (compilerOptions.verbatimModuleSyntax && !(node.flags & 33554432 /* Ambient */) && node.kind !== 266 /* TypeAliasDeclaration */ && node.kind !== 265 /* InterfaceDeclaration */ && // ModuleDeclaration needs to be checked that it is uninstantiated later + node.kind !== 268 /* ModuleDeclaration */ && node.parent.kind === 308 /* SourceFile */ && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */) { return grammarErrorOnNode(modifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); } if (flags & 32 /* Export */) { @@ -92509,7 +93478,7 @@ function createTypeChecker(host) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } else if (isClassLike(node.parent)) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export"); - } else if (node.kind === 169 /* Parameter */) { + } else if (node.kind === 170 /* Parameter */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } else if (blockScopeKind === 4 /* Using */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_using_declaration, "export"); @@ -92519,8 +93488,8 @@ function createTypeChecker(host) { flags |= 32 /* Export */; break; case 90 /* DefaultKeyword */: - const container = node.parent.kind === 307 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 267 /* ModuleDeclaration */ && !isAmbientModule(container)) { + const container = node.parent.kind === 308 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 268 /* ModuleDeclaration */ && !isAmbientModule(container)) { return grammarErrorOnNode(modifier, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } else if (blockScopeKind === 4 /* Using */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_using_declaration, "default"); @@ -92542,13 +93511,13 @@ function createTypeChecker(host) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override"); } else if (isClassLike(node.parent) && !isPropertyDeclaration(node)) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare"); - } else if (node.kind === 169 /* Parameter */) { + } else if (node.kind === 170 /* Parameter */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } else if (blockScopeKind === 4 /* Using */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_using_declaration, "declare"); } else if (blockScopeKind === 6 /* AwaitUsing */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_await_using_declaration, "declare"); - } else if (node.parent.flags & 33554432 /* Ambient */ && node.parent.kind === 268 /* ModuleBlock */) { + } else if (node.parent.flags & 33554432 /* Ambient */ && node.parent.kind === 269 /* ModuleBlock */) { return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (isPrivateIdentifierClassElementDeclaration(node)) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare"); @@ -92562,12 +93531,12 @@ function createTypeChecker(host) { if (flags & 64 /* Abstract */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 263 /* ClassDeclaration */ && node.kind !== 185 /* ConstructorType */) { - if (node.kind !== 174 /* MethodDeclaration */ && node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 177 /* GetAccessor */ && node.kind !== 178 /* SetAccessor */) { + if (node.kind !== 264 /* ClassDeclaration */ && node.kind !== 186 /* ConstructorType */) { + if (node.kind !== 175 /* MethodDeclaration */ && node.kind !== 173 /* PropertyDeclaration */ && node.kind !== 178 /* GetAccessor */ && node.kind !== 179 /* SetAccessor */) { return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 263 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 64 /* Abstract */))) { - const message = node.kind === 172 /* PropertyDeclaration */ ? Diagnostics.Abstract_properties_can_only_appear_within_an_abstract_class : Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class; + if (!(node.parent.kind === 264 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 64 /* Abstract */))) { + const message = node.kind === 173 /* PropertyDeclaration */ ? Diagnostics.Abstract_properties_can_only_appear_within_an_abstract_class : Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class; return grammarErrorOnNode(modifier, message); } if (flags & 256 /* Static */) { @@ -92596,7 +93565,7 @@ function createTypeChecker(host) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async"); } else if (flags & 128 /* Ambient */ || node.parent.flags & 33554432 /* Ambient */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); - } else if (node.kind === 169 /* Parameter */) { + } else if (node.kind === 170 /* Parameter */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } if (flags & 64 /* Abstract */) { @@ -92610,7 +93579,7 @@ function createTypeChecker(host) { const inOutFlag = modifier.kind === 103 /* InKeyword */ ? 8192 /* In */ : 16384 /* Out */; const inOutText = modifier.kind === 103 /* InKeyword */ ? "in" : "out"; const parent2 = isJSDocTemplateTag(node.parent) && (getEffectiveJSDocHost(node.parent) || find((_a = getJSDocRoot(node.parent)) == null ? void 0 : _a.tags, isJSDocTypedefTag)) || node.parent; - if (node.kind !== 168 /* TypeParameter */ || parent2 && !(isInterfaceDeclaration(parent2) || isClassLike(parent2) || isTypeAliasDeclaration(parent2) || isJSDocTypedefTag(parent2))) { + if (node.kind !== 169 /* TypeParameter */ || parent2 && !(isInterfaceDeclaration(parent2) || isClassLike(parent2) || isTypeAliasDeclaration(parent2) || isJSDocTypedefTag(parent2))) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText); } if (flags & inOutFlag) { @@ -92625,7 +93594,7 @@ function createTypeChecker(host) { } } } - if (node.kind === 176 /* Constructor */) { + if (node.kind === 177 /* Constructor */) { if (flags & 256 /* Static */) { return grammarErrorOnNode(lastStatic, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -92636,11 +93605,11 @@ function createTypeChecker(host) { return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "async"); } return false; - } else if ((node.kind === 272 /* ImportDeclaration */ || node.kind === 271 /* ImportEqualsDeclaration */) && flags & 128 /* Ambient */) { + } else if ((node.kind === 273 /* ImportDeclaration */ || node.kind === 272 /* ImportEqualsDeclaration */) && flags & 128 /* Ambient */) { return grammarErrorOnNode(lastDeclare, Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); - } else if (node.kind === 169 /* Parameter */ && flags & 31 /* ParameterPropertyModifier */ && isBindingPattern(node.name)) { + } else if (node.kind === 170 /* Parameter */ && flags & 31 /* ParameterPropertyModifier */ && isBindingPattern(node.name)) { return grammarErrorOnNode(node, Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); - } else if (node.kind === 169 /* Parameter */ && flags & 31 /* ParameterPropertyModifier */ && node.dotDotDotToken) { + } else if (node.kind === 170 /* Parameter */ && flags & 31 /* ParameterPropertyModifier */ && node.dotDotDotToken) { return grammarErrorOnNode(node, Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 1024 /* Async */) { @@ -92659,47 +93628,47 @@ function createTypeChecker(host) { } function findFirstIllegalModifier(node) { switch (node.kind) { - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 176 /* Constructor */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 181 /* IndexSignature */: - case 267 /* ModuleDeclaration */: - case 272 /* ImportDeclaration */: - case 271 /* ImportEqualsDeclaration */: - case 278 /* ExportDeclaration */: - case 277 /* ExportAssignment */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 169 /* Parameter */: - case 168 /* TypeParameter */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 177 /* Constructor */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 182 /* IndexSignature */: + case 268 /* ModuleDeclaration */: + case 273 /* ImportDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 279 /* ExportDeclaration */: + case 278 /* ExportAssignment */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 170 /* Parameter */: + case 169 /* TypeParameter */: return void 0; - case 175 /* ClassStaticBlockDeclaration */: - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: - case 270 /* NamespaceExportDeclaration */: - case 282 /* MissingDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: + case 271 /* NamespaceExportDeclaration */: + case 283 /* MissingDeclaration */: return find(node.modifiers, isModifier); default: - if (node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 307 /* SourceFile */) { + if (node.parent.kind === 269 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { return void 0; } switch (node.kind) { - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return findFirstModifierExcept(node, 134 /* AsyncKeyword */); - case 263 /* ClassDeclaration */: - case 185 /* ConstructorType */: + case 264 /* ClassDeclaration */: + case 186 /* ConstructorType */: return findFirstModifierExcept(node, 128 /* AbstractKeyword */); - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: return find(node.modifiers, isModifier); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return node.declarationList.flags & 4 /* Using */ ? findFirstModifierExcept(node, 135 /* AwaitKeyword */) : find(node.modifiers, isModifier); - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: return findFirstModifierExcept(node, 87 /* ConstKeyword */); default: Debug.assertNever(node); @@ -92715,10 +93684,10 @@ function createTypeChecker(host) { } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 174 /* MethodDeclaration */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 175 /* MethodDeclaration */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -92931,11 +93900,11 @@ function createTypeChecker(host) { return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 167 /* ComputedPropertyName */) { + if (node.kind !== 168 /* ComputedPropertyName */) { return false; } const computedPropertyName = node; - if (computedPropertyName.expression.kind === 226 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 28 /* CommaToken */) { + if (computedPropertyName.expression.kind === 227 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 28 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; @@ -92943,7 +93912,7 @@ function createTypeChecker(host) { function checkGrammarForGenerator(node) { if (node.asteriskToken) { Debug.assert( - node.kind === 262 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */ || node.kind === 174 /* MethodDeclaration */ + node.kind === 263 /* FunctionDeclaration */ || node.kind === 219 /* FunctionExpression */ || node.kind === 175 /* MethodDeclaration */ ); if (node.flags & 33554432 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, Diagnostics.Generators_are_not_allowed_in_an_ambient_context); @@ -92962,7 +93931,7 @@ function createTypeChecker(host) { function checkGrammarObjectLiteralExpression(node, inDestructuring) { const seen = /* @__PURE__ */ new Map(); for (const prop of node.properties) { - if (prop.kind === 305 /* SpreadAssignment */) { + if (prop.kind === 306 /* SpreadAssignment */) { if (inDestructuring) { const expression = skipParentheses(prop.expression); if (isArrayLiteralExpression(expression) || isObjectLiteralExpression(expression)) { @@ -92972,10 +93941,10 @@ function createTypeChecker(host) { continue; } const name = prop.name; - if (name.kind === 167 /* ComputedPropertyName */) { + if (name.kind === 168 /* ComputedPropertyName */) { checkGrammarComputedPropertyName(name); } - if (prop.kind === 304 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 305 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { grammarErrorOnNode(prop.equalsToken, Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern); } if (name.kind === 81 /* PrivateIdentifier */) { @@ -92983,7 +93952,7 @@ function createTypeChecker(host) { } if (canHaveModifiers(prop) && prop.modifiers) { for (const mod of prop.modifiers) { - if (isModifier(mod) && (mod.kind !== 134 /* AsyncKeyword */ || prop.kind !== 174 /* MethodDeclaration */)) { + if (isModifier(mod) && (mod.kind !== 134 /* AsyncKeyword */ || prop.kind !== 175 /* MethodDeclaration */)) { grammarErrorOnNode(mod, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod)); } } @@ -92996,8 +93965,8 @@ function createTypeChecker(host) { } let currentKind; switch (prop.kind) { - case 304 /* ShorthandPropertyAssignment */: - case 303 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: + case 304 /* PropertyAssignment */: checkGrammarForInvalidExclamationToken(prop.exclamationToken, Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); checkGrammarForInvalidQuestionMark(prop.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 9 /* NumericLiteral */) { @@ -93012,13 +93981,13 @@ function createTypeChecker(host) { } currentKind = 4 /* PropertyAssignment */; break; - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: currentKind = 8 /* Method */; break; - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: currentKind = 1 /* GetAccessor */; break; - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: currentKind = 2 /* SetAccessor */; break; default: @@ -93055,7 +94024,7 @@ function createTypeChecker(host) { checkGrammarTypeArguments(node, node.typeArguments); const seen = /* @__PURE__ */ new Map(); for (const attr of node.attributes.properties) { - if (attr.kind === 293 /* JsxSpreadAttribute */) { + if (attr.kind === 294 /* JsxSpreadAttribute */) { continue; } const { name, initializer } = attr; @@ -93065,7 +94034,7 @@ function createTypeChecker(host) { } else { return grammarErrorOnNode(name, Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 294 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 295 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(initializer, Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -93087,7 +94056,7 @@ function createTypeChecker(host) { if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 250 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 251 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if (!(forInOrOfStatement.flags & 65536 /* AwaitContext */)) { const sourceFile = getSourceFileOfNode(forInOrOfStatement); if (isInTopLevelContext(forInOrOfStatement)) { @@ -93098,6 +94067,7 @@ function createTypeChecker(host) { switch (moduleKind) { case 100 /* Node16 */: case 101 /* Node18 */: + case 102 /* Node20 */: case 199 /* NodeNext */: if (sourceFile.impliedNodeFormat === 1 /* CommonJS */) { diagnostics.add( @@ -93116,7 +94086,7 @@ function createTypeChecker(host) { // fallthrough default: diagnostics.add( - createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher) + createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher) ); break; } @@ -93125,7 +94095,7 @@ function createTypeChecker(host) { if (!hasParseDiagnostics(sourceFile)) { const diagnostic = createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); const func = getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 176 /* Constructor */) { + if (func && func.kind !== 177 /* Constructor */) { Debug.assert((getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function."); const relatedInfo = createDiagnosticForNode(func, Diagnostics.Did_you_mean_to_mark_this_function_as_async); addRelatedInfo(diagnostic, relatedInfo); @@ -93140,7 +94110,7 @@ function createTypeChecker(host) { grammarErrorOnNode(forInOrOfStatement.initializer, Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async); return false; } - if (forInOrOfStatement.initializer.kind === 261 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 262 /* VariableDeclarationList */) { const variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { const declarations = variableList.declarations; @@ -93148,16 +94118,16 @@ function createTypeChecker(host) { return false; } if (declarations.length > 1) { - const diagnostic = forInOrOfStatement.kind === 249 /* ForInStatement */ ? Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; + const diagnostic = forInOrOfStatement.kind === 250 /* ForInStatement */ ? Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } const firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - const diagnostic = forInOrOfStatement.kind === 249 /* ForInStatement */ ? Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; + const diagnostic = forInOrOfStatement.kind === 250 /* ForInStatement */ ? Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - const diagnostic = forInOrOfStatement.kind === 249 /* ForInStatement */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; + const diagnostic = forInOrOfStatement.kind === 250 /* ForInStatement */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); } } @@ -93165,7 +94135,7 @@ function createTypeChecker(host) { return false; } function checkGrammarAccessor(accessor) { - if (!(accessor.flags & 33554432 /* Ambient */) && accessor.parent.kind !== 187 /* TypeLiteral */ && accessor.parent.kind !== 264 /* InterfaceDeclaration */) { + if (!(accessor.flags & 33554432 /* Ambient */) && accessor.parent.kind !== 188 /* TypeLiteral */ && accessor.parent.kind !== 265 /* InterfaceDeclaration */) { if (languageVersion < 2 /* ES2015 */ && isPrivateIdentifier(accessor.name)) { return grammarErrorOnNode(accessor.name, Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } @@ -93177,7 +94147,7 @@ function createTypeChecker(host) { if (hasSyntacticModifier(accessor, 64 /* Abstract */)) { return grammarErrorOnNode(accessor, Diagnostics.An_abstract_accessor_cannot_have_an_implementation); } - if (accessor.parent.kind === 187 /* TypeLiteral */ || accessor.parent.kind === 264 /* InterfaceDeclaration */) { + if (accessor.parent.kind === 188 /* TypeLiteral */ || accessor.parent.kind === 265 /* InterfaceDeclaration */) { return grammarErrorOnNode(accessor.body, Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } } @@ -93187,10 +94157,10 @@ function createTypeChecker(host) { if (!doesAccessorHaveCorrectParameterCount(accessor)) { return grammarErrorOnNode( accessor.name, - accessor.kind === 177 /* GetAccessor */ ? Diagnostics.A_get_accessor_cannot_have_parameters : Diagnostics.A_set_accessor_must_have_exactly_one_parameter + accessor.kind === 178 /* GetAccessor */ ? Diagnostics.A_get_accessor_cannot_have_parameters : Diagnostics.A_set_accessor_must_have_exactly_one_parameter ); } - if (accessor.kind === 178 /* SetAccessor */) { + if (accessor.kind === 179 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -93208,10 +94178,10 @@ function createTypeChecker(host) { return false; } function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 177 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 178 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 177 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 178 /* GetAccessor */ ? 1 : 2)) { return getThisParameter(accessor); } } @@ -93228,7 +94198,7 @@ function createTypeChecker(host) { } } switch (parent2.kind) { - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: const decl = parent2; if (decl.name.kind !== 80 /* Identifier */) { return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -93240,12 +94210,12 @@ function createTypeChecker(host) { return grammarErrorOnNode(parent2.name, Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: if (!isStatic(parent2) || !hasEffectiveReadonlyModifier(parent2)) { return grammarErrorOnNode(parent2.name, Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 171 /* PropertySignature */: + case 172 /* PropertySignature */: if (!hasSyntacticModifier(parent2, 8 /* Readonly */)) { return grammarErrorOnNode(parent2.name, Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -93254,7 +94224,7 @@ function createTypeChecker(host) { return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_are_not_allowed_here); } } else if (node.operator === 148 /* ReadonlyKeyword */) { - if (node.type.kind !== 188 /* ArrayType */ && node.type.kind !== 189 /* TupleType */) { + if (node.type.kind !== 189 /* ArrayType */ && node.type.kind !== 190 /* TupleType */) { return grammarErrorOnFirstToken(node, Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, tokenToString(155 /* SymbolKeyword */)); } } @@ -93268,8 +94238,8 @@ function createTypeChecker(host) { if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 174 /* MethodDeclaration */) { - if (node.parent.kind === 210 /* ObjectLiteralExpression */) { + if (node.kind === 175 /* MethodDeclaration */) { + if (node.parent.kind === 211 /* ObjectLiteralExpression */) { if (node.modifiers && !(node.modifiers.length === 1 && first(node.modifiers).kind === 134 /* AsyncKeyword */)) { return grammarErrorOnFirstToken(node, Diagnostics.Modifiers_cannot_appear_here); } else if (checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional)) { @@ -93290,12 +94260,12 @@ function createTypeChecker(host) { } if (node.flags & 33554432 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); - } else if (node.kind === 174 /* MethodDeclaration */ && !node.body) { + } else if (node.kind === 175 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - } else if (node.parent.kind === 264 /* InterfaceDeclaration */) { + } else if (node.parent.kind === 265 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); - } else if (node.parent.kind === 187 /* TypeLiteral */) { + } else if (node.parent.kind === 188 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -93306,9 +94276,9 @@ function createTypeChecker(host) { return grammarErrorOnNode(node, Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { - const isMisplacedContinueLabel = node.kind === 251 /* ContinueStatement */ && !isIterationStatement( + const isMisplacedContinueLabel = node.kind === 252 /* ContinueStatement */ && !isIterationStatement( current.statement, /*lookInLabeledStatements*/ true @@ -93319,8 +94289,8 @@ function createTypeChecker(host) { return false; } break; - case 255 /* SwitchStatement */: - if (node.kind === 252 /* BreakStatement */ && !node.label) { + case 256 /* SwitchStatement */: + if (node.kind === 253 /* BreakStatement */ && !node.label) { return false; } break; @@ -93337,10 +94307,10 @@ function createTypeChecker(host) { current = current.parent; } if (node.label) { - const message = node.kind === 252 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; + const message = node.kind === 253 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - const message = node.kind === 252 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; + const message = node.kind === 253 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } } @@ -93360,10 +94330,10 @@ function createTypeChecker(host) { } } function isStringOrNumberLiteralExpression(expr) { - return isStringOrNumericLiteralLike(expr) || expr.kind === 224 /* PrefixUnaryExpression */ && expr.operator === 41 /* MinusToken */ && expr.operand.kind === 9 /* NumericLiteral */; + return isStringOrNumericLiteralLike(expr) || expr.kind === 225 /* PrefixUnaryExpression */ && expr.operator === 41 /* MinusToken */ && expr.operand.kind === 9 /* NumericLiteral */; } function isBigIntLiteralExpression(expr) { - return expr.kind === 10 /* BigIntLiteral */ || expr.kind === 224 /* PrefixUnaryExpression */ && expr.operator === 41 /* MinusToken */ && expr.operand.kind === 10 /* BigIntLiteral */; + return expr.kind === 10 /* BigIntLiteral */ || expr.kind === 225 /* PrefixUnaryExpression */ && expr.operator === 41 /* MinusToken */ && expr.operand.kind === 10 /* BigIntLiteral */; } function isSimpleLiteralEnumReference(expr) { if ((isPropertyAccessExpression(expr) || isElementAccessExpression(expr) && isStringOrNumberLiteralExpression(expr.argumentExpression)) && isEntityNameExpression(expr.expression)) { @@ -93395,7 +94365,7 @@ function createTypeChecker(host) { return grammarErrorOnNode(node, Diagnostics._0_declarations_may_not_have_binding_patterns, "using"); } } - if (node.parent.parent.kind !== 249 /* ForInStatement */ && node.parent.parent.kind !== 250 /* ForOfStatement */) { + if (node.parent.parent.kind !== 250 /* ForInStatement */ && node.parent.parent.kind !== 251 /* ForOfStatement */) { if (nodeFlags & 33554432 /* Ambient */) { checkAmbientInitializer(node); } else if (!node.initializer) { @@ -93412,7 +94382,7 @@ function createTypeChecker(host) { } } } - if (node.exclamationToken && (node.parent.parent.kind !== 243 /* VariableStatement */ || !node.type || node.initializer || nodeFlags & 33554432 /* Ambient */)) { + if (node.exclamationToken && (node.parent.parent.kind !== 244 /* VariableStatement */ || !node.type || node.initializer || nodeFlags & 33554432 /* Ambient */)) { const message = node.initializer ? Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions : !node.type ? Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations : Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context; return grammarErrorOnNode(node.exclamationToken, message); } @@ -93460,28 +94430,36 @@ function createTypeChecker(host) { return grammarErrorAtPos(declarationList, declarations.pos, declarations.end - declarations.pos, Diagnostics.Variable_declaration_list_cannot_be_empty); } const blockScopeFlags = declarationList.flags & 7 /* BlockScoped */; - if ((blockScopeFlags === 4 /* Using */ || blockScopeFlags === 6 /* AwaitUsing */) && isForInStatement(declarationList.parent)) { - return grammarErrorOnNode( - declarationList, - blockScopeFlags === 4 /* Using */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration : Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration - ); - } - if (blockScopeFlags === 6 /* AwaitUsing */) { - return checkAwaitGrammar(declarationList); + if (blockScopeFlags === 4 /* Using */ || blockScopeFlags === 6 /* AwaitUsing */) { + if (isForInStatement(declarationList.parent)) { + return grammarErrorOnNode( + declarationList, + blockScopeFlags === 4 /* Using */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration : Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration + ); + } + if (declarationList.flags & 33554432 /* Ambient */) { + return grammarErrorOnNode( + declarationList, + blockScopeFlags === 4 /* Using */ ? Diagnostics.using_declarations_are_not_allowed_in_ambient_contexts : Diagnostics.await_using_declarations_are_not_allowed_in_ambient_contexts + ); + } + if (blockScopeFlags === 6 /* AwaitUsing */) { + return checkAwaitGrammar(declarationList); + } } return false; } function allowBlockDeclarations(parent2) { switch (parent2.kind) { - case 245 /* IfStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: - case 254 /* WithStatement */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: + case 246 /* IfStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: + case 255 /* WithStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: return false; - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return allowBlockDeclarations(parent2.parent); } return true; @@ -93491,7 +94469,7 @@ function createTypeChecker(host) { const blockScopeKind = getCombinedNodeFlagsCached(node.declarationList) & 7 /* BlockScoped */; if (blockScopeKind) { const keyword = blockScopeKind === 1 /* Let */ ? "let" : blockScopeKind === 2 /* Const */ ? "const" : blockScopeKind === 4 /* Using */ ? "using" : blockScopeKind === 6 /* AwaitUsing */ ? "await using" : Debug.fail("Unknown BlockScope flag"); - return grammarErrorOnNode(node, Diagnostics._0_declarations_can_only_be_declared_inside_a_block, keyword); + error2(node, Diagnostics._0_declarations_can_only_be_declared_inside_a_block, keyword); } } } @@ -93505,7 +94483,17 @@ function createTypeChecker(host) { break; case 102 /* ImportKeyword */: if (escapedText !== "meta") { - return grammarErrorOnNode(node.name, Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, unescapeLeadingUnderscores(node.name.escapedText), tokenToString(node.keywordToken), "meta"); + const isCallee = isCallExpression(node.parent) && node.parent.expression === node; + if (escapedText === "defer") { + if (!isCallee) { + return grammarErrorAtPos(node, node.end, 0, Diagnostics._0_expected, "("); + } + } else { + if (isCallee) { + return grammarErrorOnNode(node.name, Diagnostics._0_is_not_a_valid_meta_property_for_keyword_import_Did_you_mean_meta_or_defer, unescapeLeadingUnderscores(node.name.escapedText)); + } + return grammarErrorOnNode(node.name, Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, unescapeLeadingUnderscores(node.name.escapedText), tokenToString(node.keywordToken), "meta"); + } } break; } @@ -93541,7 +94529,7 @@ function createTypeChecker(host) { function grammarErrorOnNode(node, message, ...args) { const sourceFile = getSourceFileOfNode(node); if (!hasParseDiagnostics(sourceFile)) { - diagnostics.add(createDiagnosticForNode(node, message, ...args)); + error2(node, message, ...args); return true; } return false; @@ -93574,13 +94562,13 @@ function createTypeChecker(host) { if (languageVersion < 2 /* ES2015 */ && isPrivateIdentifier(node.name)) { return grammarErrorOnNode(node.name, Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } - if (languageVersion < 2 /* ES2015 */ && isAutoAccessorPropertyDeclaration(node)) { + if (languageVersion < 2 /* ES2015 */ && isAutoAccessorPropertyDeclaration(node) && !(node.flags & 33554432 /* Ambient */)) { return grammarErrorOnNode(node.name, Diagnostics.Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher); } if (isAutoAccessorPropertyDeclaration(node) && checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_accessor_property_cannot_be_declared_optional)) { return true; } - } else if (node.parent.kind === 264 /* InterfaceDeclaration */) { + } else if (node.parent.kind === 265 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -93606,14 +94594,14 @@ function createTypeChecker(host) { } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 264 /* InterfaceDeclaration */ || node.kind === 265 /* TypeAliasDeclaration */ || node.kind === 272 /* ImportDeclaration */ || node.kind === 271 /* ImportEqualsDeclaration */ || node.kind === 278 /* ExportDeclaration */ || node.kind === 277 /* ExportAssignment */ || node.kind === 270 /* NamespaceExportDeclaration */ || hasSyntacticModifier(node, 128 /* Ambient */ | 32 /* Export */ | 2048 /* Default */)) { + if (node.kind === 265 /* InterfaceDeclaration */ || node.kind === 266 /* TypeAliasDeclaration */ || node.kind === 273 /* ImportDeclaration */ || node.kind === 272 /* ImportEqualsDeclaration */ || node.kind === 279 /* ExportDeclaration */ || node.kind === 278 /* ExportAssignment */ || node.kind === 271 /* NamespaceExportDeclaration */ || hasSyntacticModifier(node, 128 /* Ambient */ | 32 /* Export */ | 2048 /* Default */)) { return false; } return grammarErrorOnFirstToken(node, Diagnostics.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier); } function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (const decl of file.statements) { - if (isDeclaration(decl) || decl.kind === 243 /* VariableStatement */) { + if (isDeclaration(decl) || decl.kind === 244 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -93630,7 +94618,7 @@ function createTypeChecker(host) { if (!links.hasReportedStatementInAmbientContext && (isFunctionLike(node.parent) || isAccessor(node.parent))) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 241 /* Block */ || node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 307 /* SourceFile */) { + if (node.parent.kind === 242 /* Block */ || node.parent.kind === 269 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { const links2 = getNodeLinks(node.parent); if (!links2.hasReportedStatementInAmbientContext) { return links2.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, Diagnostics.Statements_are_not_allowed_in_ambient_contexts); @@ -93659,7 +94647,7 @@ function createTypeChecker(host) { function checkGrammarBigIntLiteral(node) { const literalType = isLiteralTypeNode(node.parent) || isPrefixUnaryExpression(node.parent) && isLiteralTypeNode(node.parent.parent); if (!literalType) { - if (languageVersion < 7 /* ES2020 */) { + if (!(node.flags & 33554432 /* Ambient */) && languageVersion < 7 /* ES2020 */) { if (grammarErrorOnNode(node, Diagnostics.BigInt_literals_are_not_available_when_targeting_lower_than_ES2020)) { return true; } @@ -93695,12 +94683,24 @@ function createTypeChecker(host) { return ambientModulesCache; } function checkGrammarImportClause(node) { - var _a; - if (node.isTypeOnly && node.name && node.namedBindings) { - return grammarErrorOnNode(node, Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both); - } - if (node.isTypeOnly && ((_a = node.namedBindings) == null ? void 0 : _a.kind) === 275 /* NamedImports */) { - return checkGrammarNamedImportsOrExports(node.namedBindings); + var _a, _b; + if (node.phaseModifier === 156 /* TypeKeyword */) { + if (node.name && node.namedBindings) { + return grammarErrorOnNode(node, Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both); + } + if (((_a = node.namedBindings) == null ? void 0 : _a.kind) === 276 /* NamedImports */) { + return checkGrammarNamedImportsOrExports(node.namedBindings); + } + } else if (node.phaseModifier === 166 /* DeferKeyword */) { + if (node.name) { + return grammarErrorOnNode(node, Diagnostics.Default_imports_are_not_allowed_in_a_deferred_import); + } + if (((_b = node.namedBindings) == null ? void 0 : _b.kind) === 276 /* NamedImports */) { + return grammarErrorOnNode(node, Diagnostics.Named_imports_are_not_allowed_in_a_deferred_import); + } + if (moduleKind !== 99 /* ESNext */ && moduleKind !== 200 /* Preserve */) { + return grammarErrorOnNode(node, Diagnostics.Deferred_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_or_preserve); + } } return false; } @@ -93709,7 +94709,7 @@ function createTypeChecker(host) { if (specifier.isTypeOnly) { return grammarErrorOnFirstToken( specifier, - specifier.kind === 276 /* ImportSpecifier */ ? Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement : Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement + specifier.kind === 277 /* ImportSpecifier */ ? Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement : Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement ); } }); @@ -93718,8 +94718,12 @@ function createTypeChecker(host) { if (compilerOptions.verbatimModuleSyntax && moduleKind === 1 /* CommonJS */) { return grammarErrorOnNode(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); } - if (moduleKind === 5 /* ES2015 */) { - return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_or_nodenext); + if (node.expression.kind === 237 /* MetaProperty */) { + if (moduleKind !== 99 /* ESNext */ && moduleKind !== 200 /* Preserve */) { + return grammarErrorOnNode(node, Diagnostics.Deferred_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_or_preserve); + } + } else if (moduleKind === 5 /* ES2015 */) { + return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_node20_or_nodenext); } if (node.typeArguments) { return grammarErrorOnNode(node, Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments); @@ -93729,7 +94733,7 @@ function createTypeChecker(host) { checkGrammarForDisallowedTrailingComma(nodeArguments); if (nodeArguments.length > 1) { const importAttributesArgument = nodeArguments[1]; - return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_nodenext_or_preserve); + return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_node20_nodenext_or_preserve); } } if (nodeArguments.length === 0 || nodeArguments.length > 2) { @@ -93765,8 +94769,8 @@ function createTypeChecker(host) { } function findBestTypeForInvokable(source, unionTarget) { let signatureKind = 0 /* Call */; - const hasSignatures = getSignaturesOfType(source, signatureKind).length > 0 || (signatureKind = 1 /* Construct */, getSignaturesOfType(source, signatureKind).length > 0); - if (hasSignatures) { + const hasSignatures2 = getSignaturesOfType(source, signatureKind).length > 0 || (signatureKind = 1 /* Construct */, getSignaturesOfType(source, signatureKind).length > 0); + if (hasSignatures2) { return find(unionTarget.types, (t) => getSignaturesOfType(t, signatureKind).length > 0); } } @@ -93862,12 +94866,12 @@ function isNotAccessor(declaration) { return !isAccessor(declaration); } function isNotOverload(declaration) { - return declaration.kind !== 262 /* FunctionDeclaration */ && declaration.kind !== 174 /* MethodDeclaration */ || !!declaration.body; + return declaration.kind !== 263 /* FunctionDeclaration */ && declaration.kind !== 175 /* MethodDeclaration */ || !!declaration.body; } function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 276 /* ImportSpecifier */: - case 281 /* ExportSpecifier */: + case 277 /* ImportSpecifier */: + case 282 /* ExportSpecifier */: return isIdentifier(name) || name.kind === 11 /* StringLiteral */; default: return isDeclarationName(name); @@ -93917,7 +94921,7 @@ function createBasicNodeBuilderModuleSpecifierResolutionHost(host) { }, useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(), redirectTargetsMap: host.redirectTargetsMap, - getProjectReferenceRedirect: (fileName) => host.getProjectReferenceRedirect(fileName), + getRedirectFromSourceFile: (fileName) => host.getRedirectFromSourceFile(fileName), isSourceOfProjectReferenceRedirect: (fileName) => host.isSourceOfProjectReferenceRedirect(fileName), fileExists: (fileName) => host.fileExists(fileName), getFileIncludeReasons: () => host.getFileIncludeReasons(), @@ -94284,21 +95288,21 @@ function visitEachChild(node, visitor, context = nullTransformationContext, node return fn === void 0 ? node : fn(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor); } var visitEachChildTable = { - [166 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [167 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateQualifiedName( node, Debug.checkDefined(nodeVisitor(node.left, visitor, isEntityName)), Debug.checkDefined(nodeVisitor(node.right, visitor, isIdentifier)) ); }, - [167 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [168 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateComputedPropertyName( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Signature elements - [168 /* TypeParameter */]: function visitEachChildOfTypeParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [169 /* TypeParameter */]: function visitEachChildOfTypeParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeParameterDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -94307,7 +95311,7 @@ var visitEachChildTable = { nodeVisitor(node.default, visitor, isTypeNode) ); }, - [169 /* Parameter */]: function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [170 /* Parameter */]: function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateParameterDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -94318,14 +95322,14 @@ var visitEachChildTable = { nodeVisitor(node.initializer, visitor, isExpression) ); }, - [170 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [171 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateDecorator( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Type elements - [171 /* PropertySignature */]: function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [172 /* PropertySignature */]: function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updatePropertySignature( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -94334,7 +95338,7 @@ var visitEachChildTable = { nodeVisitor(node.type, visitor, isTypeNode) ); }, - [172 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [173 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updatePropertyDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -94345,7 +95349,7 @@ var visitEachChildTable = { nodeVisitor(node.initializer, visitor, isExpression) ); }, - [173 /* MethodSignature */]: function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [174 /* MethodSignature */]: function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateMethodSignature( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -94356,7 +95360,7 @@ var visitEachChildTable = { nodeVisitor(node.type, visitor, isTypeNode) ); }, - [174 /* MethodDeclaration */]: function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [175 /* MethodDeclaration */]: function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateMethodDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -94369,7 +95373,7 @@ var visitEachChildTable = { visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [176 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [177 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConstructorDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -94377,7 +95381,7 @@ var visitEachChildTable = { visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [177 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [178 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateGetAccessorDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -94387,7 +95391,7 @@ var visitEachChildTable = { visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [178 /* SetAccessor */]: function visitEachChildOfSetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [179 /* SetAccessor */]: function visitEachChildOfSetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSetAccessorDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -94396,7 +95400,7 @@ var visitEachChildTable = { visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [175 /* ClassStaticBlockDeclaration */]: function visitEachChildOfClassStaticBlockDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [176 /* ClassStaticBlockDeclaration */]: function visitEachChildOfClassStaticBlockDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { context.startLexicalEnvironment(); context.suspendLexicalEnvironment(); return context.factory.updateClassStaticBlockDeclaration( @@ -94404,7 +95408,7 @@ var visitEachChildTable = { visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [179 /* CallSignature */]: function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [180 /* CallSignature */]: function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateCallSignature( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), @@ -94412,7 +95416,7 @@ var visitEachChildTable = { nodeVisitor(node.type, visitor, isTypeNode) ); }, - [180 /* ConstructSignature */]: function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [181 /* ConstructSignature */]: function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConstructSignature( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), @@ -94420,7 +95424,7 @@ var visitEachChildTable = { nodeVisitor(node.type, visitor, isTypeNode) ); }, - [181 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [182 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIndexSignature( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -94429,7 +95433,7 @@ var visitEachChildTable = { ); }, // Types - [182 /* TypePredicate */]: function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [183 /* TypePredicate */]: function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypePredicateNode( node, nodeVisitor(node.assertsModifier, visitor, isAssertsKeyword), @@ -94437,14 +95441,14 @@ var visitEachChildTable = { nodeVisitor(node.type, visitor, isTypeNode) ); }, - [183 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [184 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeReferenceNode( node, Debug.checkDefined(nodeVisitor(node.typeName, visitor, isEntityName)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, - [184 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [185 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateFunctionTypeNode( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), @@ -94452,7 +95456,7 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [185 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [186 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConstructorTypeNode( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -94461,56 +95465,56 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [186 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [187 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeQueryNode( node, Debug.checkDefined(nodeVisitor(node.exprName, visitor, isEntityName)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, - [187 /* TypeLiteral */]: function visitEachChildOfTypeLiteralNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [188 /* TypeLiteral */]: function visitEachChildOfTypeLiteralNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateTypeLiteralNode( node, nodesVisitor(node.members, visitor, isTypeElement) ); }, - [188 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [189 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateArrayTypeNode( node, Debug.checkDefined(nodeVisitor(node.elementType, visitor, isTypeNode)) ); }, - [189 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [190 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateTupleTypeNode( node, nodesVisitor(node.elements, visitor, isTypeNode) ); }, - [190 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [191 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateOptionalTypeNode( node, Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [191 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [192 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateRestTypeNode( node, Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [192 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [193 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateUnionTypeNode( node, nodesVisitor(node.types, visitor, isTypeNode) ); }, - [193 /* IntersectionType */]: function visitEachChildOfIntersectionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [194 /* IntersectionType */]: function visitEachChildOfIntersectionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateIntersectionTypeNode( node, nodesVisitor(node.types, visitor, isTypeNode) ); }, - [194 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [195 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConditionalTypeNode( node, Debug.checkDefined(nodeVisitor(node.checkType, visitor, isTypeNode)), @@ -94519,13 +95523,13 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.falseType, visitor, isTypeNode)) ); }, - [195 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [196 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateInferTypeNode( node, Debug.checkDefined(nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)) ); }, - [205 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [206 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportTypeNode( node, Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)), @@ -94535,14 +95539,14 @@ var visitEachChildTable = { node.isTypeOf ); }, - [302 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [303 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportTypeAssertionContainer( node, Debug.checkDefined(nodeVisitor(node.assertClause, visitor, isAssertClause)), node.multiLine ); }, - [202 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [203 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateNamedTupleMember( node, tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, @@ -94551,26 +95555,26 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [196 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [197 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateParenthesizedType( node, Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [198 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [199 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeOperatorNode( node, Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [199 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [200 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIndexedAccessTypeNode( node, Debug.checkDefined(nodeVisitor(node.objectType, visitor, isTypeNode)), Debug.checkDefined(nodeVisitor(node.indexType, visitor, isTypeNode)) ); }, - [200 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [201 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateMappedTypeNode( node, tokenVisitor ? nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken) : node.readonlyToken, @@ -94581,20 +95585,20 @@ var visitEachChildTable = { nodesVisitor(node.members, visitor, isTypeElement) ); }, - [201 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [202 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateLiteralTypeNode( node, Debug.checkDefined(nodeVisitor(node.literal, visitor, isLiteralTypeLiteral)) ); }, - [203 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [204 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateLiteralType( node, Debug.checkDefined(nodeVisitor(node.head, visitor, isTemplateHead)), nodesVisitor(node.templateSpans, visitor, isTemplateLiteralTypeSpan) ); }, - [204 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [205 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateLiteralTypeSpan( node, Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)), @@ -94602,19 +95606,19 @@ var visitEachChildTable = { ); }, // Binding patterns - [206 /* ObjectBindingPattern */]: function visitEachChildOfObjectBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [207 /* ObjectBindingPattern */]: function visitEachChildOfObjectBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateObjectBindingPattern( node, nodesVisitor(node.elements, visitor, isBindingElement) ); }, - [207 /* ArrayBindingPattern */]: function visitEachChildOfArrayBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [208 /* ArrayBindingPattern */]: function visitEachChildOfArrayBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateArrayBindingPattern( node, nodesVisitor(node.elements, visitor, isArrayBindingElement) ); }, - [208 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [209 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateBindingElement( node, tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, @@ -94624,19 +95628,19 @@ var visitEachChildTable = { ); }, // Expression - [209 /* ArrayLiteralExpression */]: function visitEachChildOfArrayLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [210 /* ArrayLiteralExpression */]: function visitEachChildOfArrayLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateArrayLiteralExpression( node, nodesVisitor(node.elements, visitor, isExpression) ); }, - [210 /* ObjectLiteralExpression */]: function visitEachChildOfObjectLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [211 /* ObjectLiteralExpression */]: function visitEachChildOfObjectLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateObjectLiteralExpression( node, nodesVisitor(node.properties, visitor, isObjectLiteralElementLike) ); }, - [211 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [212 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return isPropertyAccessChain(node) ? context.factory.updatePropertyAccessChain( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), @@ -94648,7 +95652,7 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.name, visitor, isMemberName)) ); }, - [212 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [213 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return isElementAccessChain(node) ? context.factory.updateElementAccessChain( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), @@ -94660,7 +95664,7 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.argumentExpression, visitor, isExpression)) ); }, - [213 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [214 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return isCallChain(node) ? context.factory.updateCallChain( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), @@ -94674,7 +95678,7 @@ var visitEachChildTable = { nodesVisitor(node.arguments, visitor, isExpression) ); }, - [214 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [215 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNewExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), @@ -94682,7 +95686,7 @@ var visitEachChildTable = { nodesVisitor(node.arguments, visitor, isExpression) ); }, - [215 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [216 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTaggedTemplateExpression( node, Debug.checkDefined(nodeVisitor(node.tag, visitor, isExpression)), @@ -94690,20 +95694,20 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.template, visitor, isTemplateLiteral)) ); }, - [216 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [217 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeAssertion( node, Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)), Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [217 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [218 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateParenthesizedExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [218 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [219 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateFunctionExpression( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -94715,7 +95719,7 @@ var visitEachChildTable = { visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [219 /* ArrowFunction */]: function visitEachChildOfArrowFunction(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [220 /* ArrowFunction */]: function visitEachChildOfArrowFunction(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateArrowFunction( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -94726,43 +95730,43 @@ var visitEachChildTable = { visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [220 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [221 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateDeleteExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [221 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [222 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeOfExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [222 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [223 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateVoidExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [223 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [224 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAwaitExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [224 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [225 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePrefixUnaryExpression( node, Debug.checkDefined(nodeVisitor(node.operand, visitor, isExpression)) ); }, - [225 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [226 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePostfixUnaryExpression( node, Debug.checkDefined(nodeVisitor(node.operand, visitor, isExpression)) ); }, - [226 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [227 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateBinaryExpression( node, Debug.checkDefined(nodeVisitor(node.left, visitor, isExpression)), @@ -94770,7 +95774,7 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.right, visitor, isExpression)) ); }, - [227 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [228 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateConditionalExpression( node, Debug.checkDefined(nodeVisitor(node.condition, visitor, isExpression)), @@ -94780,27 +95784,27 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.whenFalse, visitor, isExpression)) ); }, - [228 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [229 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateExpression( node, Debug.checkDefined(nodeVisitor(node.head, visitor, isTemplateHead)), nodesVisitor(node.templateSpans, visitor, isTemplateSpan) ); }, - [229 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [230 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateYieldExpression( node, tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, nodeVisitor(node.expression, visitor, isExpression) ); }, - [230 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [231 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSpreadElement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [231 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [232 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateClassExpression( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -94810,28 +95814,28 @@ var visitEachChildTable = { nodesVisitor(node.members, visitor, isClassElement) ); }, - [233 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [234 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExpressionWithTypeArguments( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, - [234 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [235 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAsExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [238 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [239 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSatisfiesExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [235 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [236 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return isOptionalChain(node) ? context.factory.updateNonNullChain( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) @@ -94840,14 +95844,14 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [236 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [237 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateMetaProperty( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, // Misc - [239 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [240 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateSpan( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), @@ -94855,26 +95859,26 @@ var visitEachChildTable = { ); }, // Element - [241 /* Block */]: function visitEachChildOfBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [242 /* Block */]: function visitEachChildOfBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateBlock( node, nodesVisitor(node.statements, visitor, isStatement) ); }, - [243 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [244 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateVariableStatement( node, nodesVisitor(node.modifiers, visitor, isModifierLike), Debug.checkDefined(nodeVisitor(node.declarationList, visitor, isVariableDeclarationList)) ); }, - [244 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [245 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExpressionStatement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [245 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [246 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIfStatement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), @@ -94882,21 +95886,21 @@ var visitEachChildTable = { nodeVisitor(node.elseStatement, visitor, isStatement, context.factory.liftToBlock) ); }, - [246 /* DoStatement */]: function visitEachChildOfDoStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [247 /* DoStatement */]: function visitEachChildOfDoStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateDoStatement( node, visitIterationBody(node.statement, visitor, context, nodeVisitor), Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [247 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [248 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateWhileStatement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, - [248 /* ForStatement */]: function visitEachChildOfForStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [249 /* ForStatement */]: function visitEachChildOfForStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateForStatement( node, nodeVisitor(node.initializer, visitor, isForInitializer), @@ -94905,7 +95909,7 @@ var visitEachChildTable = { visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, - [249 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [250 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateForInStatement( node, Debug.checkDefined(nodeVisitor(node.initializer, visitor, isForInitializer)), @@ -94913,7 +95917,7 @@ var visitEachChildTable = { visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, - [250 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [251 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateForOfStatement( node, tokenVisitor ? nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword) : node.awaitModifier, @@ -94922,52 +95926,52 @@ var visitEachChildTable = { visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, - [251 /* ContinueStatement */]: function visitEachChildOfContinueStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [252 /* ContinueStatement */]: function visitEachChildOfContinueStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateContinueStatement( node, nodeVisitor(node.label, visitor, isIdentifier) ); }, - [252 /* BreakStatement */]: function visitEachChildOfBreakStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [253 /* BreakStatement */]: function visitEachChildOfBreakStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateBreakStatement( node, nodeVisitor(node.label, visitor, isIdentifier) ); }, - [253 /* ReturnStatement */]: function visitEachChildOfReturnStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [254 /* ReturnStatement */]: function visitEachChildOfReturnStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateReturnStatement( node, nodeVisitor(node.expression, visitor, isExpression) ); }, - [254 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [255 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateWithStatement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), Debug.checkDefined(nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)) ); }, - [255 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [256 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSwitchStatement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), Debug.checkDefined(nodeVisitor(node.caseBlock, visitor, isCaseBlock)) ); }, - [256 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [257 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateLabeledStatement( node, Debug.checkDefined(nodeVisitor(node.label, visitor, isIdentifier)), Debug.checkDefined(nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)) ); }, - [257 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [258 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateThrowStatement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [258 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [259 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTryStatement( node, Debug.checkDefined(nodeVisitor(node.tryBlock, visitor, isBlock)), @@ -94975,7 +95979,7 @@ var visitEachChildTable = { nodeVisitor(node.finallyBlock, visitor, isBlock) ); }, - [260 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [261 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateVariableDeclaration( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), @@ -94984,13 +95988,13 @@ var visitEachChildTable = { nodeVisitor(node.initializer, visitor, isExpression) ); }, - [261 /* VariableDeclarationList */]: function visitEachChildOfVariableDeclarationList(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [262 /* VariableDeclarationList */]: function visitEachChildOfVariableDeclarationList(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateVariableDeclarationList( node, nodesVisitor(node.declarations, visitor, isVariableDeclaration) ); }, - [262 /* FunctionDeclaration */]: function visitEachChildOfFunctionDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [263 /* FunctionDeclaration */]: function visitEachChildOfFunctionDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateFunctionDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -95002,7 +96006,7 @@ var visitEachChildTable = { visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [263 /* ClassDeclaration */]: function visitEachChildOfClassDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [264 /* ClassDeclaration */]: function visitEachChildOfClassDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateClassDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -95012,7 +96016,7 @@ var visitEachChildTable = { nodesVisitor(node.members, visitor, isClassElement) ); }, - [264 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [265 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateInterfaceDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -95022,7 +96026,7 @@ var visitEachChildTable = { nodesVisitor(node.members, visitor, isTypeElement) ); }, - [265 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [266 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeAliasDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -95031,7 +96035,7 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [266 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [267 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateEnumDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -95039,7 +96043,7 @@ var visitEachChildTable = { nodesVisitor(node.members, visitor, isEnumMember) ); }, - [267 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [268 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateModuleDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -95047,25 +96051,25 @@ var visitEachChildTable = { nodeVisitor(node.body, visitor, isModuleBody) ); }, - [268 /* ModuleBlock */]: function visitEachChildOfModuleBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [269 /* ModuleBlock */]: function visitEachChildOfModuleBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateModuleBlock( node, nodesVisitor(node.statements, visitor, isStatement) ); }, - [269 /* CaseBlock */]: function visitEachChildOfCaseBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [270 /* CaseBlock */]: function visitEachChildOfCaseBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateCaseBlock( node, nodesVisitor(node.clauses, visitor, isCaseOrDefaultClause) ); }, - [270 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [271 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceExportDeclaration( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, - [271 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [272 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportEqualsDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -95074,7 +96078,7 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.moduleReference, visitor, isModuleReference)) ); }, - [272 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [273 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -95083,47 +96087,47 @@ var visitEachChildTable = { nodeVisitor(node.attributes, visitor, isImportAttributes) ); }, - [300 /* ImportAttributes */]: function visitEachChildOfImportAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [301 /* ImportAttributes */]: function visitEachChildOfImportAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateImportAttributes( node, nodesVisitor(node.elements, visitor, isImportAttribute), node.multiLine ); }, - [301 /* ImportAttribute */]: function visitEachChildOfImportAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [302 /* ImportAttribute */]: function visitEachChildOfImportAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportAttribute( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isImportAttributeName)), Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression)) ); }, - [273 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [274 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportClause( node, - node.isTypeOnly, + node.phaseModifier, nodeVisitor(node.name, visitor, isIdentifier), nodeVisitor(node.namedBindings, visitor, isNamedImportBindings) ); }, - [274 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [275 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceImport( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, - [280 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [281 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceExport( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, - [275 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [276 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateNamedImports( node, nodesVisitor(node.elements, visitor, isImportSpecifier) ); }, - [276 /* ImportSpecifier */]: function visitEachChildOfImportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [277 /* ImportSpecifier */]: function visitEachChildOfImportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportSpecifier( node, node.isTypeOnly, @@ -95131,14 +96135,14 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, - [277 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [278 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExportAssignment( node, nodesVisitor(node.modifiers, visitor, isModifierLike), Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [278 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [279 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExportDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -95148,13 +96152,13 @@ var visitEachChildTable = { nodeVisitor(node.attributes, visitor, isImportAttributes) ); }, - [279 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [280 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateNamedExports( node, nodesVisitor(node.elements, visitor, isExportSpecifier) ); }, - [281 /* ExportSpecifier */]: function visitEachChildOfExportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [282 /* ExportSpecifier */]: function visitEachChildOfExportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExportSpecifier( node, node.isTypeOnly, @@ -95163,14 +96167,14 @@ var visitEachChildTable = { ); }, // Module references - [283 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [284 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExternalModuleReference( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // JSX - [284 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [285 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxElement( node, Debug.checkDefined(nodeVisitor(node.openingElement, visitor, isJsxOpeningElement)), @@ -95178,7 +96182,7 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.closingElement, visitor, isJsxClosingElement)) ); }, - [285 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [286 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxSelfClosingElement( node, Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)), @@ -95186,7 +96190,7 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.attributes, visitor, isJsxAttributes)) ); }, - [286 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [287 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxOpeningElement( node, Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)), @@ -95194,20 +96198,20 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.attributes, visitor, isJsxAttributes)) ); }, - [287 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [288 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxClosingElement( node, Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)) ); }, - [295 /* JsxNamespacedName */]: function forEachChildInJsxNamespacedName2(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [296 /* JsxNamespacedName */]: function forEachChildInJsxNamespacedName2(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxNamespacedName( node, Debug.checkDefined(nodeVisitor(node.namespace, visitor, isIdentifier)), Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, - [288 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [289 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxFragment( node, Debug.checkDefined(nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment)), @@ -95215,52 +96219,52 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment)) ); }, - [291 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [292 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxAttribute( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isJsxAttributeName)), nodeVisitor(node.initializer, visitor, isStringLiteralOrJsxExpression) ); }, - [292 /* JsxAttributes */]: function visitEachChildOfJsxAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [293 /* JsxAttributes */]: function visitEachChildOfJsxAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateJsxAttributes( node, nodesVisitor(node.properties, visitor, isJsxAttributeLike) ); }, - [293 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [294 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxSpreadAttribute( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [294 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [295 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxExpression( node, nodeVisitor(node.expression, visitor, isExpression) ); }, // Clauses - [296 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [297 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateCaseClause( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.statements, visitor, isStatement) ); }, - [297 /* DefaultClause */]: function visitEachChildOfDefaultClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [298 /* DefaultClause */]: function visitEachChildOfDefaultClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateDefaultClause( node, nodesVisitor(node.statements, visitor, isStatement) ); }, - [298 /* HeritageClause */]: function visitEachChildOfHeritageClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [299 /* HeritageClause */]: function visitEachChildOfHeritageClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateHeritageClause( node, nodesVisitor(node.types, visitor, isExpressionWithTypeArguments) ); }, - [299 /* CatchClause */]: function visitEachChildOfCatchClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [300 /* CatchClause */]: function visitEachChildOfCatchClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateCatchClause( node, nodeVisitor(node.variableDeclaration, visitor, isVariableDeclaration), @@ -95268,28 +96272,28 @@ var visitEachChildTable = { ); }, // Property assignments - [303 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [304 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePropertyAssignment( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), Debug.checkDefined(nodeVisitor(node.initializer, visitor, isExpression)) ); }, - [304 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [305 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateShorthandPropertyAssignment( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodeVisitor(node.objectAssignmentInitializer, visitor, isExpression) ); }, - [305 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [306 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSpreadAssignment( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Enum - [306 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [307 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateEnumMember( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), @@ -95297,20 +96301,20 @@ var visitEachChildTable = { ); }, // Top-level nodes - [307 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) { + [308 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateSourceFile( node, visitLexicalEnvironment(node.statements, visitor, context) ); }, // Transformation nodes - [355 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [356 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePartiallyEmittedExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [356 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [357 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateCommaListExpression( node, nodesVisitor(node.elements, visitor, isExpression) @@ -95880,7 +96884,7 @@ function isNamedDefaultReference(e) { function chainBundle(context, transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 307 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 308 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return context.factory.createBundle(map(node.sourceFiles, transformSourceFile)); @@ -95925,7 +96929,7 @@ function collectExternalModuleInfo(context, sourceFile) { let hasImportDefault = false; for (const node of sourceFile.statements) { switch (node.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: externalImports.push(node); if (!hasImportStar && getImportNeedsImportStarHelper(node)) { hasImportStar = true; @@ -95934,12 +96938,12 @@ function collectExternalModuleInfo(context, sourceFile) { hasImportDefault = true; } break; - case 271 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 283 /* ExternalModuleReference */) { + case 272 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 284 /* ExternalModuleReference */) { externalImports.push(node); } break; - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { externalImports.push(node); @@ -95964,19 +96968,19 @@ function collectExternalModuleInfo(context, sourceFile) { addExportedNamesForExportDeclaration(node); } break; - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { exportEquals = node; } break; - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: if (hasSyntacticModifier(node, 32 /* Export */)) { for (const decl of node.declarationList.declarations) { exportedNames = collectExportedVariableInfo(decl, uniqueExports, exportedNames, exportedBindings); } } break; - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: if (hasSyntacticModifier(node, 32 /* Export */)) { addExportedFunctionDeclaration( node, @@ -95986,7 +96990,7 @@ function collectExternalModuleInfo(context, sourceFile) { ); } break; - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: if (hasSyntacticModifier(node, 32 /* Export */)) { if (hasSyntacticModifier(node, 2048 /* Default */)) { if (!hasExportDefault) { @@ -96021,7 +97025,7 @@ function collectExternalModuleInfo(context, sourceFile) { } const decl = resolver.getReferencedImportDeclaration(name) || resolver.getReferencedValueDeclaration(name); if (decl) { - if (decl.kind === 262 /* FunctionDeclaration */) { + if (decl.kind === 263 /* FunctionDeclaration */) { addExportedFunctionDeclaration(decl, specifier.name, moduleExportNameIsDefault(specifier.name)); continue; } @@ -96241,7 +97245,7 @@ function isStaticPropertyDeclaration(member) { return isPropertyDeclaration(member) && hasStaticModifier(member); } function isInitializedProperty(member) { - return member.kind === 172 /* PropertyDeclaration */ && member.initializer !== void 0; + return member.kind === 173 /* PropertyDeclaration */ && member.initializer !== void 0; } function isNonStaticMethodOrAccessorWithPrivateName(member) { return !isStatic(member) && (isMethodOrAccessor(member) || isAutoAccessorPropertyDeclaration(member)) && isPrivateIdentifier(member.name); @@ -96278,8 +97282,8 @@ function getAllDecoratorsOfClass(node, useLegacyDecorators) { } function getAllDecoratorsOfClassElement(member, parent2, useLegacyDecorators) { switch (member.kind) { - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: if (!useLegacyDecorators) { return getAllDecoratorsOfMethod( member, @@ -96293,9 +97297,9 @@ function getAllDecoratorsOfClassElement(member, parent2, useLegacyDecorators) { /*useLegacyDecorators*/ true ); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member, useLegacyDecorators); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return void 0; @@ -97087,21 +98091,21 @@ function transformNamedEvaluationOfExportAssignment(context, node, ignoreEmptySt } function transformNamedEvaluation(context, node, ignoreEmptyStringLiteral, assignedName) { switch (node.kind) { - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return transformNamedEvaluationOfPropertyAssignment(context, node, ignoreEmptyStringLiteral, assignedName); - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return transformNamedEvaluationOfShorthandAssignmentProperty(context, node, ignoreEmptyStringLiteral, assignedName); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return transformNamedEvaluationOfVariableDeclaration(context, node, ignoreEmptyStringLiteral, assignedName); - case 169 /* Parameter */: + case 170 /* Parameter */: return transformNamedEvaluationOfParameterDeclaration(context, node, ignoreEmptyStringLiteral, assignedName); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return transformNamedEvaluationOfBindingElement(context, node, ignoreEmptyStringLiteral, assignedName); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return transformNamedEvaluationOfPropertyDeclaration(context, node, ignoreEmptyStringLiteral, assignedName); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return transformNamedEvaluationOfAssignmentExpression(context, node, ignoreEmptyStringLiteral, assignedName); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return transformNamedEvaluationOfExportAssignment(context, node, ignoreEmptyStringLiteral, assignedName); } } @@ -97195,8 +98199,8 @@ function transformTypeScript(context) { const previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(211 /* PropertyAccessExpression */); - context.enableSubstitution(212 /* ElementAccessExpression */); + context.enableSubstitution(212 /* PropertyAccessExpression */); + context.enableSubstitution(213 /* ElementAccessExpression */); let currentSourceFile; let currentNamespace; let currentNamespaceContainerName; @@ -97206,7 +98210,7 @@ function transformTypeScript(context) { let applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 308 /* Bundle */) { + if (node.kind === 309 /* Bundle */) { return transformBundle(node); } return transformSourceFile(node); @@ -97239,22 +98243,22 @@ function transformTypeScript(context) { } function onBeforeVisitNode(node) { switch (node.kind) { - case 307 /* SourceFile */: - case 269 /* CaseBlock */: - case 268 /* ModuleBlock */: - case 241 /* Block */: + case 308 /* SourceFile */: + case 270 /* CaseBlock */: + case 269 /* ModuleBlock */: + case 242 /* Block */: currentLexicalScope = node; currentScopeFirstDeclarationsOfName = void 0; break; - case 263 /* ClassDeclaration */: - case 262 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: + case 263 /* FunctionDeclaration */: if (hasSyntacticModifier(node, 128 /* Ambient */)) { break; } if (node.name) { recordEmittedDeclarationInScope(node); } else { - Debug.assert(node.kind === 263 /* ClassDeclaration */ || hasSyntacticModifier(node, 2048 /* Default */)); + Debug.assert(node.kind === 264 /* ClassDeclaration */ || hasSyntacticModifier(node, 2048 /* Default */)); } break; } @@ -97273,10 +98277,10 @@ function transformTypeScript(context) { } function sourceElementVisitorWorker(node) { switch (node.kind) { - case 272 /* ImportDeclaration */: - case 271 /* ImportEqualsDeclaration */: - case 277 /* ExportAssignment */: - case 278 /* ExportDeclaration */: + case 273 /* ImportDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 278 /* ExportAssignment */: + case 279 /* ExportDeclaration */: return visitElidableStatement(node); default: return visitorWorker(node); @@ -97291,7 +98295,7 @@ function transformTypeScript(context) { return true; } switch (node.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: Debug.assertNode(parsed, isImportDeclaration); if (node.importClause !== parsed.importClause) { return true; @@ -97300,7 +98304,7 @@ function transformTypeScript(context) { return true; } break; - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: Debug.assertNode(parsed, isImportEqualsDeclaration); if (node.name !== parsed.name) { return true; @@ -97312,7 +98316,7 @@ function transformTypeScript(context) { return true; } break; - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: Debug.assertNode(parsed, isExportDeclaration); if (node.exportClause !== parsed.exportClause) { return true; @@ -97332,13 +98336,13 @@ function transformTypeScript(context) { return node; } switch (node.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return visitImportDeclaration(node); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return visitExportAssignment(node); - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: return visitExportDeclaration(node); default: Debug.fail("Unhandled ellided statement"); @@ -97348,7 +98352,7 @@ function transformTypeScript(context) { return saveStateAndInvoke(node, namespaceElementVisitorWorker); } function namespaceElementVisitorWorker(node) { - if (node.kind === 278 /* ExportDeclaration */ || node.kind === 272 /* ImportDeclaration */ || node.kind === 273 /* ImportClause */ || node.kind === 271 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 283 /* ExternalModuleReference */) { + if (node.kind === 279 /* ExportDeclaration */ || node.kind === 273 /* ImportDeclaration */ || node.kind === 274 /* ImportClause */ || node.kind === 272 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 284 /* ExternalModuleReference */) { return void 0; } else if (node.transformFlags & 1 /* ContainsTypeScript */ || hasSyntacticModifier(node, 32 /* Export */)) { return visitTypeScript(node); @@ -97360,21 +98364,21 @@ function transformTypeScript(context) { } function classElementVisitorWorker(node, parent2) { switch (node.kind) { - case 176 /* Constructor */: + case 177 /* Constructor */: return visitConstructor(node); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return visitPropertyDeclaration(node, parent2); - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return visitGetAccessor(node, parent2); - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return visitSetAccessor(node, parent2); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return visitMethodDeclaration(node, parent2); - case 175 /* ClassStaticBlockDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: return visitEachChild(node, visitor, context); - case 240 /* SemicolonClassElement */: + case 241 /* SemicolonClassElement */: return node; - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: return; default: return Debug.failBadSyntaxKind(node); @@ -97385,15 +98389,15 @@ function transformTypeScript(context) { } function objectLiteralElementVisitorWorker(node, parent2) { switch (node.kind) { - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: - case 305 /* SpreadAssignment */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: + case 306 /* SpreadAssignment */: return visitor(node); - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return visitGetAccessor(node, parent2); - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return visitSetAccessor(node, parent2); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return visitMethodDeclaration(node, parent2); default: return Debug.failBadSyntaxKind(node); @@ -97434,13 +98438,13 @@ function transformTypeScript(context) { case 147 /* OutKeyword */: // TypeScript accessibility and readonly modifiers are elided // falls through - case 188 /* ArrayType */: - case 189 /* TupleType */: - case 190 /* OptionalType */: - case 191 /* RestType */: - case 187 /* TypeLiteral */: - case 182 /* TypePredicate */: - case 168 /* TypeParameter */: + case 189 /* ArrayType */: + case 190 /* TupleType */: + case 191 /* OptionalType */: + case 192 /* RestType */: + case 188 /* TypeLiteral */: + case 183 /* TypePredicate */: + case 169 /* TypeParameter */: case 133 /* AnyKeyword */: case 159 /* UnknownKeyword */: case 136 /* BooleanKeyword */: @@ -97449,82 +98453,82 @@ function transformTypeScript(context) { case 146 /* NeverKeyword */: case 116 /* VoidKeyword */: case 155 /* SymbolKeyword */: - case 185 /* ConstructorType */: - case 184 /* FunctionType */: - case 186 /* TypeQuery */: - case 183 /* TypeReference */: - case 192 /* UnionType */: - case 193 /* IntersectionType */: - case 194 /* ConditionalType */: - case 196 /* ParenthesizedType */: - case 197 /* ThisType */: - case 198 /* TypeOperator */: - case 199 /* IndexedAccessType */: - case 200 /* MappedType */: - case 201 /* LiteralType */: + case 186 /* ConstructorType */: + case 185 /* FunctionType */: + case 187 /* TypeQuery */: + case 184 /* TypeReference */: + case 193 /* UnionType */: + case 194 /* IntersectionType */: + case 195 /* ConditionalType */: + case 197 /* ParenthesizedType */: + case 198 /* ThisType */: + case 199 /* TypeOperator */: + case 200 /* IndexedAccessType */: + case 201 /* MappedType */: + case 202 /* LiteralType */: // TypeScript type nodes are elided. // falls through - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: return void 0; - case 265 /* TypeAliasDeclaration */: + case 266 /* TypeAliasDeclaration */: return factory2.createNotEmittedStatement(node); - case 270 /* NamespaceExportDeclaration */: + case 271 /* NamespaceExportDeclaration */: return void 0; - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: return factory2.createNotEmittedStatement(node); - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return visitClassDeclaration(node); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return visitClassExpression(node); - case 298 /* HeritageClause */: + case 299 /* HeritageClause */: return visitHeritageClause(node); - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return visitExpressionWithTypeArguments(node); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 176 /* Constructor */: - case 172 /* PropertyDeclaration */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 175 /* ClassStaticBlockDeclaration */: + case 177 /* Constructor */: + case 173 /* PropertyDeclaration */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 176 /* ClassStaticBlockDeclaration */: return Debug.fail("Class and object literal elements must be visited with their respective visitors"); - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: return visitFunctionExpression(node); - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return visitArrowFunction(node); - case 169 /* Parameter */: + case 170 /* Parameter */: return visitParameter(node); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return visitParenthesizedExpression(node); - case 216 /* TypeAssertionExpression */: - case 234 /* AsExpression */: + case 217 /* TypeAssertionExpression */: + case 235 /* AsExpression */: return visitAssertionExpression(node); - case 238 /* SatisfiesExpression */: + case 239 /* SatisfiesExpression */: return visitSatisfiesExpression(node); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return visitCallExpression(node); - case 214 /* NewExpression */: + case 215 /* NewExpression */: return visitNewExpression(node); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 235 /* NonNullExpression */: + case 236 /* NonNullExpression */: return visitNonNullExpression(node); - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: return visitEnumDeclaration(node); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return visitVariableStatement(node); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return visitModuleDeclaration(node); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 285 /* JsxSelfClosingElement */: + case 286 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node); - case 286 /* JsxOpeningElement */: + case 287 /* JsxOpeningElement */: return visitJsxJsxOpeningElement(node); default: return visitEachChild(node, visitor, context); @@ -97840,19 +98844,19 @@ function transformTypeScript(context) { } function shouldAddTypeMetadata(node) { const kind = node.kind; - return kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 172 /* PropertyDeclaration */; + return kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */ || kind === 173 /* PropertyDeclaration */; } function shouldAddReturnTypeMetadata(node) { - return node.kind === 174 /* MethodDeclaration */; + return node.kind === 175 /* MethodDeclaration */; } function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: return getFirstConstructorWithBody(node) !== void 0; - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return true; } return false; @@ -98497,7 +99501,7 @@ function transformTypeScript(context) { /*allowSourceMaps*/ true )); - const varFlags = currentLexicalScope.kind === 307 /* SourceFile */ ? 0 /* None */ : 1 /* Let */; + const varFlags = currentLexicalScope.kind === 308 /* SourceFile */ ? 0 /* None */ : 1 /* Let */; const statement = factory2.createVariableStatement( visitNodes2(node.modifiers, modifierVisitor, isModifier), factory2.createVariableDeclarationList([varDecl], varFlags) @@ -98508,7 +99512,7 @@ function transformTypeScript(context) { setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { - if (node.kind === 266 /* EnumDeclaration */) { + if (node.kind === 267 /* EnumDeclaration */) { setSourceMapRange(statement.declarationList, node); } else { setSourceMapRange(statement, node); @@ -98616,7 +99620,7 @@ function transformTypeScript(context) { let statementsLocation; let blockLocation; if (node.body) { - if (node.body.kind === 268 /* ModuleBlock */) { + if (node.body.kind === 269 /* ModuleBlock */) { saveStateAndInvoke(node.body, (body) => addRange(statements, visitNodes2(body.statements, namespaceElementVisitor, isStatement))); statementsLocation = node.body.statements; blockLocation = node.body; @@ -98647,13 +99651,13 @@ function transformTypeScript(context) { true ); setTextRange(block, blockLocation); - if (!node.body || node.body.kind !== 268 /* ModuleBlock */) { + if (!node.body || node.body.kind !== 269 /* ModuleBlock */) { setEmitFlags(block, getEmitFlags(block) | 3072 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 267 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 268 /* ModuleDeclaration */) { const recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -98676,19 +99680,13 @@ function transformTypeScript(context) { ) : void 0; } function visitImportClause(node) { - Debug.assert(!node.isTypeOnly); + Debug.assert(node.phaseModifier !== 156 /* TypeKeyword */); const name = shouldEmitAliasDeclaration(node) ? node.name : void 0; const namedBindings = visitNode(node.namedBindings, visitNamedImportBindings, isNamedImportBindings); - return name || namedBindings ? factory2.updateImportClause( - node, - /*isTypeOnly*/ - false, - name, - namedBindings - ) : void 0; + return name || namedBindings ? factory2.updateImportClause(node, node.phaseModifier, name, namedBindings) : void 0; } function visitNamedImportBindings(node) { - if (node.kind === 274 /* NamespaceImport */) { + if (node.kind === 275 /* NamespaceImport */) { return shouldEmitAliasDeclaration(node) ? node : void 0; } else { const allowEmpty = compilerOptions.verbatimModuleSyntax; @@ -98878,15 +99876,15 @@ function transformTypeScript(context) { if ((enabledSubstitutions & 2 /* NamespaceExports */) === 0) { enabledSubstitutions |= 2 /* NamespaceExports */; context.enableSubstitution(80 /* Identifier */); - context.enableSubstitution(304 /* ShorthandPropertyAssignment */); - context.enableEmitNotification(267 /* ModuleDeclaration */); + context.enableSubstitution(305 /* ShorthandPropertyAssignment */); + context.enableEmitNotification(268 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return getOriginalNode(node).kind === 267 /* ModuleDeclaration */; + return getOriginalNode(node).kind === 268 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return getOriginalNode(node).kind === 266 /* EnumDeclaration */; + return getOriginalNode(node).kind === 267 /* EnumDeclaration */; } function onEmitNode(hint, node, emitCallback) { const savedApplicableSubstitutions = applicableSubstitutions; @@ -98931,9 +99929,9 @@ function transformTypeScript(context) { switch (node.kind) { case 80 /* Identifier */: return substituteExpressionIdentifier(node); - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -98948,8 +99946,8 @@ function transformTypeScript(context) { /*prefixLocals*/ false ); - if (container && container.kind !== 307 /* SourceFile */) { - const substitute = applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 267 /* ModuleDeclaration */ || applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 266 /* EnumDeclaration */; + if (container && container.kind !== 308 /* SourceFile */) { + const substitute = applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 268 /* ModuleDeclaration */ || applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 267 /* EnumDeclaration */; if (substitute) { return setTextRange( factory2.createPropertyAccessExpression(factory2.getGeneratedNameForNode(container), node), @@ -99061,72 +100059,72 @@ function transformClassFields(context) { return node; } switch (node.kind) { - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return visitClassDeclaration(node); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return visitClassExpression(node); - case 175 /* ClassStaticBlockDeclaration */: - case 172 /* PropertyDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: + case 173 /* PropertyDeclaration */: return Debug.fail("Use `classElementVisitor` instead."); - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return visitPropertyAssignment(node); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return visitVariableStatement(node); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 169 /* Parameter */: + case 170 /* Parameter */: return visitParameterDeclaration(node); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return visitBindingElement(node); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return visitExportAssignment(node); case 81 /* PrivateIdentifier */: return visitPrivateIdentifier(node); - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression( node, /*discarded*/ false ); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return visitBinaryExpression( node, /*discarded*/ false ); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return visitParenthesizedExpression( node, /*discarded*/ false ); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return visitCallExpression(node); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return visitExpressionStatement(node); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatement(node); case 110 /* ThisKeyword */: return visitThisExpression(node); - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: return setCurrentClassElementAnd( /*classElement*/ void 0, fallbackVisitor, node ); - case 176 /* Constructor */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: { + case 177 /* Constructor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: { return setCurrentClassElementAnd( node, fallbackVisitor, @@ -99142,26 +100140,26 @@ function transformClassFields(context) { } function discardedValueVisitor(node) { switch (node.kind) { - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression( node, /*discarded*/ true ); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return visitBinaryExpression( node, /*discarded*/ true ); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression( node, /*discarded*/ true ); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return visitParenthesizedExpression( node, /*discarded*/ @@ -99173,9 +100171,9 @@ function transformClassFields(context) { } function heritageClauseVisitor(node) { switch (node.kind) { - case 298 /* HeritageClause */: + case 299 /* HeritageClause */: return visitEachChild(node, heritageClauseVisitor, context); - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return visitExpressionWithTypeArgumentsInHeritageClause(node); default: return visitor(node); @@ -99183,8 +100181,8 @@ function transformClassFields(context) { } function assignmentTargetVisitor(node) { switch (node.kind) { - case 210 /* ObjectLiteralExpression */: - case 209 /* ArrayLiteralExpression */: + case 211 /* ObjectLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return visitAssignmentPattern(node); default: return visitor(node); @@ -99192,35 +100190,35 @@ function transformClassFields(context) { } function classElementVisitor(node) { switch (node.kind) { - case 176 /* Constructor */: + case 177 /* Constructor */: return setCurrentClassElementAnd( node, visitConstructorDeclaration, node ); - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 174 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 175 /* MethodDeclaration */: return setCurrentClassElementAnd( node, visitMethodOrAccessorDeclaration, node ); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return setCurrentClassElementAnd( node, visitPropertyDeclaration, node ); - case 175 /* ClassStaticBlockDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: return setCurrentClassElementAnd( node, visitClassStaticBlockDeclaration, node ); - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 240 /* SemicolonClassElement */: + case 241 /* SemicolonClassElement */: return node; default: return isModifierLike(node) ? modifierVisitor(node) : visitor(node); @@ -99228,7 +100226,7 @@ function transformClassFields(context) { } function propertyNameVisitor(node) { switch (node.kind) { - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: return visitComputedPropertyName(node); default: return visitor(node); @@ -99236,10 +100234,10 @@ function transformClassFields(context) { } function accessorFieldResultVisitor(node) { switch (node.kind) { - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return transformFieldInitializer(node); - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return classElementVisitor(node); default: Debug.assertMissingNode(node, "Expected node to either be a PropertyDeclaration, GetAccessorDeclaration, or SetAccessorDeclaration"); @@ -100730,14 +101728,14 @@ function transformClassFields(context) { if ((enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */) === 0) { enabledSubstitutions |= 2 /* ClassStaticThisOrSuperReference */; context.enableSubstitution(110 /* ThisKeyword */); - context.enableEmitNotification(262 /* FunctionDeclaration */); - context.enableEmitNotification(218 /* FunctionExpression */); - context.enableEmitNotification(176 /* Constructor */); - context.enableEmitNotification(177 /* GetAccessor */); - context.enableEmitNotification(178 /* SetAccessor */); - context.enableEmitNotification(174 /* MethodDeclaration */); - context.enableEmitNotification(172 /* PropertyDeclaration */); - context.enableEmitNotification(167 /* ComputedPropertyName */); + context.enableEmitNotification(263 /* FunctionDeclaration */); + context.enableEmitNotification(219 /* FunctionExpression */); + context.enableEmitNotification(177 /* Constructor */); + context.enableEmitNotification(178 /* GetAccessor */); + context.enableEmitNotification(179 /* SetAccessor */); + context.enableEmitNotification(175 /* MethodDeclaration */); + context.enableEmitNotification(173 /* PropertyDeclaration */); + context.enableEmitNotification(168 /* ComputedPropertyName */); } } function addInstanceMethodStatements(statements, methods, receiver) { @@ -101091,17 +102089,17 @@ function transformClassFields(context) { return; } switch (node.kind) { - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: if (isArrowFunction(original) || getEmitFlags(node) & 524288 /* AsyncFunctionBody */) { break; } // falls through - case 262 /* FunctionDeclaration */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 174 /* MethodDeclaration */: - case 172 /* PropertyDeclaration */: { + case 263 /* FunctionDeclaration */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 173 /* PropertyDeclaration */: { const savedLexicalEnvironment = lexicalEnvironment; const savedPreviousShouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; lexicalEnvironment = void 0; @@ -101113,7 +102111,7 @@ function transformClassFields(context) { lexicalEnvironment = savedLexicalEnvironment; return; } - case 167 /* ComputedPropertyName */: { + case 168 /* ComputedPropertyName */: { const savedLexicalEnvironment = lexicalEnvironment; const savedShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; lexicalEnvironment = lexicalEnvironment == null ? void 0 : lexicalEnvironment.previous; @@ -101253,15 +102251,15 @@ function createRuntimeTypeSerializer(context) { } function serializeTypeOfNode(node, container) { switch (node.kind) { - case 172 /* PropertyDeclaration */: - case 169 /* Parameter */: + case 173 /* PropertyDeclaration */: + case 170 /* Parameter */: return serializeTypeNode(node.type); - case 178 /* SetAccessor */: - case 177 /* GetAccessor */: + case 179 /* SetAccessor */: + case 178 /* GetAccessor */: return serializeTypeNode(getAccessorTypeNode(node, container)); - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 174 /* MethodDeclaration */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 175 /* MethodDeclaration */: return factory2.createIdentifier("Function"); default: return factory2.createVoidZero(); @@ -101288,7 +102286,7 @@ function createRuntimeTypeSerializer(context) { return factory2.createArrayLiteralExpression(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 177 /* GetAccessor */) { + if (container && node.kind === 178 /* GetAccessor */) { const { setAccessor } = getAllAccessorDeclarations(container.members, node); if (setAccessor) { return setAccessor.parameters; @@ -101314,22 +102312,22 @@ function createRuntimeTypeSerializer(context) { case 157 /* UndefinedKeyword */: case 146 /* NeverKeyword */: return factory2.createVoidZero(); - case 184 /* FunctionType */: - case 185 /* ConstructorType */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: return factory2.createIdentifier("Function"); - case 188 /* ArrayType */: - case 189 /* TupleType */: + case 189 /* ArrayType */: + case 190 /* TupleType */: return factory2.createIdentifier("Array"); - case 182 /* TypePredicate */: + case 183 /* TypePredicate */: return node.assertsModifier ? factory2.createVoidZero() : factory2.createIdentifier("Boolean"); case 136 /* BooleanKeyword */: return factory2.createIdentifier("Boolean"); - case 203 /* TemplateLiteralType */: + case 204 /* TemplateLiteralType */: case 154 /* StringKeyword */: return factory2.createIdentifier("String"); case 151 /* ObjectKeyword */: return factory2.createIdentifier("Object"); - case 201 /* LiteralType */: + case 202 /* LiteralType */: return serializeLiteralOfLiteralTypeNode(node.literal); case 150 /* NumberKeyword */: return factory2.createIdentifier("Number"); @@ -101337,50 +102335,50 @@ function createRuntimeTypeSerializer(context) { return getGlobalConstructor("BigInt", 7 /* ES2020 */); case 155 /* SymbolKeyword */: return getGlobalConstructor("Symbol", 2 /* ES2015 */); - case 183 /* TypeReference */: + case 184 /* TypeReference */: return serializeTypeReferenceNode(node); - case 193 /* IntersectionType */: + case 194 /* IntersectionType */: return serializeUnionOrIntersectionConstituents( node.types, /*isIntersection*/ true ); - case 192 /* UnionType */: + case 193 /* UnionType */: return serializeUnionOrIntersectionConstituents( node.types, /*isIntersection*/ false ); - case 194 /* ConditionalType */: + case 195 /* ConditionalType */: return serializeUnionOrIntersectionConstituents( [node.trueType, node.falseType], /*isIntersection*/ false ); - case 198 /* TypeOperator */: + case 199 /* TypeOperator */: if (node.operator === 148 /* ReadonlyKeyword */) { return serializeTypeNode(node.type); } break; - case 186 /* TypeQuery */: - case 199 /* IndexedAccessType */: - case 200 /* MappedType */: - case 187 /* TypeLiteral */: + case 187 /* TypeQuery */: + case 200 /* IndexedAccessType */: + case 201 /* MappedType */: + case 188 /* TypeLiteral */: case 133 /* AnyKeyword */: case 159 /* UnknownKeyword */: - case 197 /* ThisType */: - case 205 /* ImportType */: + case 198 /* ThisType */: + case 206 /* ImportType */: break; // handle JSDoc types from an invalid parse - case 312 /* JSDocAllType */: - case 313 /* JSDocUnknownType */: - case 317 /* JSDocFunctionType */: - case 318 /* JSDocVariadicType */: - case 319 /* JSDocNamepathType */: + case 313 /* JSDocAllType */: + case 314 /* JSDocUnknownType */: + case 318 /* JSDocFunctionType */: + case 319 /* JSDocVariadicType */: + case 320 /* JSDocNamepathType */: break; - case 314 /* JSDocNullableType */: - case 315 /* JSDocNonNullableType */: - case 316 /* JSDocOptionalType */: + case 315 /* JSDocNullableType */: + case 316 /* JSDocNonNullableType */: + case 317 /* JSDocOptionalType */: return serializeTypeNode(node.type); default: return Debug.failBadSyntaxKind(node); @@ -101392,7 +102390,7 @@ function createRuntimeTypeSerializer(context) { case 11 /* StringLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: return factory2.createIdentifier("String"); - case 224 /* PrefixUnaryExpression */: { + case 225 /* PrefixUnaryExpression */: { const operand = node.operand; switch (operand.kind) { case 9 /* NumericLiteral */: @@ -101549,7 +102547,7 @@ function createRuntimeTypeSerializer(context) { name.original = void 0; setParent(name, getParseTreeNode(currentLexicalScope)); return name; - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: return serializeQualifiedNameAsExpression(node); } } @@ -101599,23 +102597,23 @@ function transformLegacyDecorators(context) { return node; } switch (node.kind) { - case 170 /* Decorator */: + case 171 /* Decorator */: return void 0; - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return visitClassDeclaration(node); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return visitClassExpression(node); - case 176 /* Constructor */: + case 177 /* Constructor */: return visitConstructorDeclaration(node); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return visitSetAccessorDeclaration(node); - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return visitGetAccessorDeclaration(node); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 169 /* Parameter */: + case 170 /* Parameter */: return visitParameterDeclaration(node); default: return visitEachChild(node, visitor, context); @@ -102209,80 +103207,80 @@ function transformESDecorators(context) { return node; } switch (node.kind) { - case 170 /* Decorator */: + case 171 /* Decorator */: return Debug.fail("Use `modifierVisitor` instead."); - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return visitClassDeclaration(node); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return visitClassExpression(node); - case 176 /* Constructor */: - case 172 /* PropertyDeclaration */: - case 175 /* ClassStaticBlockDeclaration */: + case 177 /* Constructor */: + case 173 /* PropertyDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: return Debug.fail("Not supported outside of a class. Use 'classElementVisitor' instead."); - case 169 /* Parameter */: + case 170 /* Parameter */: return visitParameterDeclaration(node); // Support NamedEvaluation to ensure the correct class name for class expressions. - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return visitBinaryExpression( node, /*discarded*/ false ); - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return visitPropertyAssignment(node); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return visitBindingElement(node); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return visitExportAssignment(node); case 110 /* ThisKeyword */: return visitThisExpression(node); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatement(node); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return visitExpressionStatement(node); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression( node, /*discarded*/ false ); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return visitParenthesizedExpression( node, /*discarded*/ false ); - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return visitPartiallyEmittedExpression( node, /*discarded*/ false ); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return visitCallExpression(node); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression( node, /*discarded*/ false ); - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: // object literal methods and accessors - case 178 /* SetAccessor */: - case 177 /* GetAccessor */: - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: { + case 179 /* SetAccessor */: + case 178 /* GetAccessor */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: { enterOther(); const result = visitEachChild(node, fallbackVisitor, context); exitOther(); @@ -102294,7 +103292,7 @@ function transformESDecorators(context) { } function fallbackVisitor(node) { switch (node.kind) { - case 170 /* Decorator */: + case 171 /* Decorator */: return void 0; default: return visitor(node); @@ -102302,7 +103300,7 @@ function transformESDecorators(context) { } function modifierVisitor(node) { switch (node.kind) { - case 170 /* Decorator */: + case 171 /* Decorator */: return void 0; default: return node; @@ -102310,17 +103308,17 @@ function transformESDecorators(context) { } function classElementVisitor(node) { switch (node.kind) { - case 176 /* Constructor */: + case 177 /* Constructor */: return visitConstructorDeclaration(node); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return visitGetAccessorDeclaration(node); - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return visitSetAccessorDeclaration(node); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 175 /* ClassStaticBlockDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: return visitClassStaticBlockDeclaration(node); default: return visitor(node); @@ -102328,26 +103326,26 @@ function transformESDecorators(context) { } function discardedValueVisitor(node) { switch (node.kind) { - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression( node, /*discarded*/ true ); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return visitBinaryExpression( node, /*discarded*/ true ); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression( node, /*discarded*/ true ); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return visitParenthesizedExpression( node, /*discarded*/ @@ -104022,16 +105020,16 @@ function transformES2017(context) { } function argumentsVisitor(node) { switch (node.kind) { - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 176 /* Constructor */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 177 /* Constructor */: return node; - case 169 /* Parameter */: - case 208 /* BindingElement */: - case 260 /* VariableDeclaration */: + case 170 /* Parameter */: + case 209 /* BindingElement */: + case 261 /* VariableDeclaration */: break; case 80 /* Identifier */: if (lexicalArgumentsBinding && resolver.isArgumentsLocalBinding(node)) { @@ -104048,34 +105046,34 @@ function transformES2017(context) { switch (node.kind) { case 134 /* AsyncKeyword */: return void 0; - case 223 /* AwaitExpression */: + case 224 /* AwaitExpression */: return visitAwaitExpression(node); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node); - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node); - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node); - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node); - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: if (capturedSuperProperties && isPropertyAccessExpression(node) && node.expression.kind === 108 /* SuperKeyword */) { capturedSuperProperties.add(node.name.escapedText); } return visitEachChild(node, visitor, context); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 108 /* SuperKeyword */) { hasSuperElementAccess = true; } return visitEachChild(node, visitor, context); - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitGetAccessorDeclaration, node); - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitSetAccessorDeclaration, node); - case 176 /* Constructor */: + case 177 /* Constructor */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitConstructorDeclaration, node); - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node); default: return visitEachChild(node, visitor, context); @@ -104084,27 +105082,27 @@ function transformES2017(context) { function asyncBodyVisitor(node) { if (isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 299 /* CatchClause */: + case 300 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 241 /* Block */: - case 255 /* SwitchStatement */: - case 269 /* CaseBlock */: - case 296 /* CaseClause */: - case 297 /* DefaultClause */: - case 258 /* TryStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: - case 245 /* IfStatement */: - case 254 /* WithStatement */: - case 256 /* LabeledStatement */: + case 242 /* Block */: + case 256 /* SwitchStatement */: + case 270 /* CaseBlock */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: + case 259 /* TryStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: + case 246 /* IfStatement */: + case 255 /* WithStatement */: + case 257 /* LabeledStatement */: return visitEachChild(node, asyncBodyVisitor, context); default: return Debug.assertNever(node, "Unhandled node."); @@ -104434,7 +105432,7 @@ function transformES2017(context) { const newParameters = []; for (const parameter of node.parameters) { if (parameter.initializer || parameter.dotDotDotToken) { - if (node.kind === 219 /* ArrowFunction */) { + if (node.kind === 220 /* ArrowFunction */) { const restParameter = factory2.createParameterDeclaration( /*modifiers*/ void 0, @@ -104464,7 +105462,7 @@ function transformES2017(context) { const original = getOriginalNode(node, isFunctionLike); const nodeType = original.type; const promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : void 0; - const isArrowFunction2 = node.kind === 219 /* ArrowFunction */; + const isArrowFunction2 = node.kind === 220 /* ArrowFunction */; const savedLexicalArgumentsBinding = lexicalArgumentsBinding; const hasLexicalArguments = resolver.hasNodeCheckFlag(node, 512 /* CaptureArguments */); const captureLexicalArguments = hasLexicalArguments && !lexicalArgumentsBinding; @@ -104588,15 +105586,15 @@ function transformES2017(context) { function enableSubstitutionForAsyncMethodsWithSuper() { if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) { enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; - context.enableSubstitution(213 /* CallExpression */); - context.enableSubstitution(211 /* PropertyAccessExpression */); - context.enableSubstitution(212 /* ElementAccessExpression */); - context.enableEmitNotification(263 /* ClassDeclaration */); - context.enableEmitNotification(174 /* MethodDeclaration */); - context.enableEmitNotification(177 /* GetAccessor */); - context.enableEmitNotification(178 /* SetAccessor */); - context.enableEmitNotification(176 /* Constructor */); - context.enableEmitNotification(243 /* VariableStatement */); + context.enableSubstitution(214 /* CallExpression */); + context.enableSubstitution(212 /* PropertyAccessExpression */); + context.enableSubstitution(213 /* ElementAccessExpression */); + context.enableEmitNotification(264 /* ClassDeclaration */); + context.enableEmitNotification(175 /* MethodDeclaration */); + context.enableEmitNotification(178 /* GetAccessor */); + context.enableEmitNotification(179 /* SetAccessor */); + context.enableEmitNotification(177 /* Constructor */); + context.enableEmitNotification(244 /* VariableStatement */); } } function onEmitNode(hint, node, emitCallback) { @@ -104627,11 +105625,11 @@ function transformES2017(context) { } function substituteExpression(node) { switch (node.kind) { - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -104675,7 +105673,7 @@ function transformES2017(context) { } function isSuperContainer(node) { const kind = node.kind; - return kind === 263 /* ClassDeclaration */ || kind === 176 /* Constructor */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */; + return kind === 264 /* ClassDeclaration */ || kind === 177 /* Constructor */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 256 /* MethodWithSuperPropertyAssignmentInAsync */) { @@ -104915,119 +105913,119 @@ function transformES2018(context) { return node; } switch (node.kind) { - case 223 /* AwaitExpression */: + case 224 /* AwaitExpression */: return visitAwaitExpression(node); - case 229 /* YieldExpression */: + case 230 /* YieldExpression */: return visitYieldExpression(node); - case 253 /* ReturnStatement */: + case 254 /* ReturnStatement */: return visitReturnStatement(node); - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return visitLabeledStatement(node); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return visitBinaryExpression(node, expressionResultIsUnused2); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression(node, expressionResultIsUnused2); - case 299 /* CatchClause */: + case 300 /* CatchClause */: return visitCatchClause(node); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return visitVariableStatement(node); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 246 /* DoStatement */: - case 247 /* WhileStatement */: - case 249 /* ForInStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: + case 250 /* ForInStatement */: return doWithHierarchyFacts( visitDefault, node, 0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */ ); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return visitForOfStatement( node, /*outermostLabeledStatement*/ void 0 ); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return doWithHierarchyFacts( visitForStatement, node, 0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */ ); - case 222 /* VoidExpression */: + case 223 /* VoidExpression */: return visitVoidExpression(node); - case 176 /* Constructor */: + case 177 /* Constructor */: return doWithHierarchyFacts( visitConstructorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */ ); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return doWithHierarchyFacts( visitMethodDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */ ); - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return doWithHierarchyFacts( visitGetAccessorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */ ); - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return doWithHierarchyFacts( visitSetAccessorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */ ); - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return doWithHierarchyFacts( visitFunctionDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */ ); - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: return doWithHierarchyFacts( visitFunctionExpression, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */ ); - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return doWithHierarchyFacts( visitArrowFunction, node, 2 /* ArrowFunctionExcludes */, 0 /* ArrowFunctionIncludes */ ); - case 169 /* Parameter */: + case 170 /* Parameter */: return visitParameter(node); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return visitExpressionStatement(node); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, expressionResultIsUnused2); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: if (capturedSuperProperties && isPropertyAccessExpression(node) && node.expression.kind === 108 /* SuperKeyword */) { capturedSuperProperties.add(node.name.escapedText); } return visitEachChild(node, visitor, context); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 108 /* SuperKeyword */) { hasSuperElementAccess = true; } return visitEachChild(node, visitor, context); - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: return doWithHierarchyFacts( visitDefault, node, @@ -105115,7 +106113,7 @@ function transformES2018(context) { function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { const statement = unwrapInnermostStatementOfLabel(node); - if (statement.kind === 250 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 251 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return factory2.restoreEnclosingLabel(visitNode(statement, visitor, isStatement, factory2.liftToBlock), node); @@ -105126,7 +106124,7 @@ function transformES2018(context) { let chunkObject; const objects = []; for (const e of elements) { - if (e.kind === 305 /* SpreadAssignment */) { + if (e.kind === 306 /* SpreadAssignment */) { if (chunkObject) { objects.push(factory2.createObjectLiteralExpression(chunkObject)); chunkObject = void 0; @@ -105136,7 +106134,7 @@ function transformES2018(context) { } else { chunkObject = append( chunkObject, - e.kind === 303 /* PropertyAssignment */ ? factory2.createPropertyAssignment(e.name, visitNode(e.initializer, visitor, isExpression)) : visitNode(e, visitor, isObjectLiteralElementLike) + e.kind === 304 /* PropertyAssignment */ ? factory2.createPropertyAssignment(e.name, visitNode(e.initializer, visitor, isExpression)) : visitNode(e, visitor, isObjectLiteralElementLike) ); } } @@ -105148,7 +106146,7 @@ function transformES2018(context) { function visitObjectLiteralExpression(node) { if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { const objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 210 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 211 /* ObjectLiteralExpression */) { objects.unshift(factory2.createObjectLiteralExpression()); } let expression = objects[0]; @@ -105932,15 +106930,15 @@ function transformES2018(context) { function enableSubstitutionForAsyncMethodsWithSuper() { if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) { enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; - context.enableSubstitution(213 /* CallExpression */); - context.enableSubstitution(211 /* PropertyAccessExpression */); - context.enableSubstitution(212 /* ElementAccessExpression */); - context.enableEmitNotification(263 /* ClassDeclaration */); - context.enableEmitNotification(174 /* MethodDeclaration */); - context.enableEmitNotification(177 /* GetAccessor */); - context.enableEmitNotification(178 /* SetAccessor */); - context.enableEmitNotification(176 /* Constructor */); - context.enableEmitNotification(243 /* VariableStatement */); + context.enableSubstitution(214 /* CallExpression */); + context.enableSubstitution(212 /* PropertyAccessExpression */); + context.enableSubstitution(213 /* ElementAccessExpression */); + context.enableEmitNotification(264 /* ClassDeclaration */); + context.enableEmitNotification(175 /* MethodDeclaration */); + context.enableEmitNotification(178 /* GetAccessor */); + context.enableEmitNotification(179 /* SetAccessor */); + context.enableEmitNotification(177 /* Constructor */); + context.enableEmitNotification(244 /* VariableStatement */); } } function onEmitNode(hint, node, emitCallback) { @@ -105971,11 +106969,11 @@ function transformES2018(context) { } function substituteExpression(node) { switch (node.kind) { - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -106019,7 +107017,7 @@ function transformES2018(context) { } function isSuperContainer(node) { const kind = node.kind; - return kind === 263 /* ClassDeclaration */ || kind === 176 /* Constructor */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */; + return kind === 264 /* ClassDeclaration */ || kind === 177 /* Constructor */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 256 /* MethodWithSuperPropertyAssignmentInAsync */) { @@ -106064,7 +107062,7 @@ function transformES2019(context) { return node; } switch (node.kind) { - case 299 /* CatchClause */: + case 300 /* CatchClause */: return visitCatchClause(node); default: return visitEachChild(node, visitor, context); @@ -106103,7 +107101,7 @@ function transformES2020(context) { return node; } switch (node.kind) { - case 213 /* CallExpression */: { + case 214 /* CallExpression */: { const updated = visitNonOptionalCallExpression( node, /*captureThisArg*/ @@ -106112,8 +107110,8 @@ function transformES2020(context) { Debug.assertNotNode(updated, isSyntheticReference); return updated; } - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: if (isOptionalChain(node)) { const updated = visitOptionalExpression( node, @@ -106126,12 +107124,12 @@ function transformES2020(context) { return updated; } return visitEachChild(node, visitor, context); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: if (node.operatorToken.kind === 61 /* QuestionQuestionToken */) { return transformNullishCoalescingExpression(node); } return visitEachChild(node, visitor, context); - case 220 /* DeleteExpression */: + case 221 /* DeleteExpression */: return visitDeleteExpression(node); default: return visitEachChild(node, visitor, context); @@ -106169,7 +107167,7 @@ function transformES2020(context) { thisArg = expression; } } - expression = node.kind === 211 /* PropertyAccessExpression */ ? factory2.updatePropertyAccessExpression(node, expression, visitNode(node.name, visitor, isIdentifier)) : factory2.updateElementAccessExpression(node, expression, visitNode(node.argumentExpression, visitor, isExpression)); + expression = node.kind === 212 /* PropertyAccessExpression */ ? factory2.updatePropertyAccessExpression(node, expression, visitNode(node.name, visitor, isIdentifier)) : factory2.updateElementAccessExpression(node, expression, visitNode(node.argumentExpression, visitor, isExpression)); return thisArg ? factory2.createSyntheticReferenceExpression(expression, thisArg) : expression; } function visitNonOptionalCallExpression(node, captureThisArg) { @@ -106205,12 +107203,12 @@ function transformES2020(context) { } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); default: return visitNode(node, visitor, isExpression); @@ -106236,8 +107234,8 @@ function transformES2020(context) { for (let i = 0; i < chain.length; i++) { const segment = chain[i]; switch (segment.kind) { - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: if (i === chain.length - 1 && captureThisArg) { if (!isSimpleCopiableExpression(rightExpression)) { thisArg = factory2.createTempVariable(hoistVariableDeclaration); @@ -106246,9 +107244,9 @@ function transformES2020(context) { thisArg = rightExpression; } } - rightExpression = segment.kind === 211 /* PropertyAccessExpression */ ? factory2.createPropertyAccessExpression(rightExpression, visitNode(segment.name, visitor, isIdentifier)) : factory2.createElementAccessExpression(rightExpression, visitNode(segment.argumentExpression, visitor, isExpression)); + rightExpression = segment.kind === 212 /* PropertyAccessExpression */ ? factory2.createPropertyAccessExpression(rightExpression, visitNode(segment.name, visitor, isIdentifier)) : factory2.createElementAccessExpression(rightExpression, visitNode(segment.argumentExpression, visitor, isExpression)); break; - case 213 /* CallExpression */: + case 214 /* CallExpression */: if (i === 0 && leftThisArg) { if (!isGeneratedIdentifier(leftThisArg)) { leftThisArg = factory2.cloneNode(leftThisArg); @@ -106450,15 +107448,15 @@ function transformESNext(context) { return node; } switch (node.kind) { - case 307 /* SourceFile */: + case 308 /* SourceFile */: return visitSourceFile(node); - case 241 /* Block */: + case 242 /* Block */: return visitBlock(node); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatement(node); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return visitForOfStatement(node); - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return visitSwitchStatement(node); default: return visitEachChild(node, visitor, context); @@ -106736,16 +107734,16 @@ function transformESNext(context) { function hoist(node) { if (!topLevelStatements) return node; switch (node.kind) { - case 272 /* ImportDeclaration */: - case 271 /* ImportEqualsDeclaration */: - case 278 /* ExportDeclaration */: - case 262 /* FunctionDeclaration */: + case 273 /* ImportDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 279 /* ExportDeclaration */: + case 263 /* FunctionDeclaration */: return hoistImportOrExportOrHoistedDeclaration(node, topLevelStatements); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return hoistExportAssignment(node); - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return hoistClassDeclaration(node); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return hoistVariableStatement(node); } return node; @@ -107137,8 +108135,8 @@ function transformJsx(context) { /*modifiers*/ void 0, factory2.createImportClause( - /*isTypeOnly*/ - false, + /*phaseModifier*/ + void 0, /*name*/ void 0, factory2.createNamedImports(arrayFrom(importSpecifiersMap.values())) @@ -107203,25 +108201,25 @@ function transformJsx(context) { } function visitorWorker(node) { switch (node.kind) { - case 284 /* JsxElement */: + case 285 /* JsxElement */: return visitJsxElement( node, /*isChild*/ false ); - case 285 /* JsxSelfClosingElement */: + case 286 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement( node, /*isChild*/ false ); - case 288 /* JsxFragment */: + case 289 /* JsxFragment */: return visitJsxFragment( node, /*isChild*/ false ); - case 294 /* JsxExpression */: + case 295 /* JsxExpression */: return visitJsxExpression(node); default: return visitEachChild(node, visitor, context); @@ -107231,21 +108229,21 @@ function transformJsx(context) { switch (node.kind) { case 12 /* JsxText */: return visitJsxText(node); - case 294 /* JsxExpression */: + case 295 /* JsxExpression */: return visitJsxExpression(node); - case 284 /* JsxElement */: + case 285 /* JsxElement */: return visitJsxElement( node, /*isChild*/ true ); - case 285 /* JsxSelfClosingElement */: + case 286 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement( node, /*isChild*/ true ); - case 288 /* JsxFragment */: + case 289 /* JsxFragment */: return visitJsxFragment( node, /*isChild*/ @@ -107497,7 +108495,7 @@ function transformJsx(context) { const literal = factory2.createStringLiteral(tryDecodeEntities(node.text) || node.text, singleQuote); return setTextRange(literal, node); } - if (node.kind === 294 /* JsxExpression */) { + if (node.kind === 295 /* JsxExpression */) { if (node.expression === void 0) { return factory2.createTrue(); } @@ -107571,7 +108569,7 @@ function transformJsx(context) { return decoded === text ? void 0 : decoded; } function getTagName(node) { - if (node.kind === 284 /* JsxElement */) { + if (node.kind === 285 /* JsxElement */) { return getTagName(node.openingElement); } else { const tagName = node.tagName; @@ -107871,7 +108869,7 @@ function transformES2016(context) { return node; } switch (node.kind) { - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return visitBinaryExpression(node); default: return visitEachChild(node, visitor, context); @@ -107999,7 +108997,7 @@ function transformES2015(context) { hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -32768 /* SubtreeFactsMask */ | ancestorFacts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { - return (hierarchyFacts & 8192 /* ConstructorWithSuperCall */) !== 0 && node.kind === 253 /* ReturnStatement */ && !node.expression; + return (hierarchyFacts & 8192 /* ConstructorWithSuperCall */) !== 0 && node.kind === 254 /* ReturnStatement */ && !node.expression; } function isOrMayContainReturnCompletion(node) { return node.transformFlags & 4194304 /* ContainsHoistedDeclarationOrCompletion */ && (isReturnStatement(node) || isIfStatement(node) || isWithStatement(node) || isSwitchStatement(node) || isCaseBlock(node) || isCaseClause(node) || isDefaultClause(node) || isTryStatement(node) || isCatchClause(node) || isLabeledStatement(node) || isIterationStatement( @@ -108068,85 +109066,85 @@ function transformES2015(context) { case 126 /* StaticKeyword */: return void 0; // elide static keyword - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return visitClassDeclaration(node); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return visitClassExpression(node); - case 169 /* Parameter */: + case 170 /* Parameter */: return visitParameter(node); - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return visitArrowFunction(node); - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: return visitFunctionExpression(node); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return visitVariableDeclaration(node); case 80 /* Identifier */: return visitIdentifier(node); - case 261 /* VariableDeclarationList */: + case 262 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return visitSwitchStatement(node); - case 269 /* CaseBlock */: + case 270 /* CaseBlock */: return visitCaseBlock(node); - case 241 /* Block */: + case 242 /* Block */: return visitBlock( node, /*isFunctionBody*/ false ); - case 252 /* BreakStatement */: - case 251 /* ContinueStatement */: + case 253 /* BreakStatement */: + case 252 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return visitLabeledStatement(node); - case 246 /* DoStatement */: - case 247 /* WhileStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: return visitDoOrWhileStatement( node, /*outermostLabeledStatement*/ void 0 ); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatement( node, /*outermostLabeledStatement*/ void 0 ); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return visitForInStatement( node, /*outermostLabeledStatement*/ void 0 ); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return visitForOfStatement( node, /*outermostLabeledStatement*/ void 0 ); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return visitExpressionStatement(node); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 299 /* CatchClause */: + case 300 /* CatchClause */: return visitCatchClause(node); - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return visitCallExpression(node); - case 214 /* NewExpression */: + case 215 /* NewExpression */: return visitNewExpression(node); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, expressionResultIsUnused2); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return visitBinaryExpression(node, expressionResultIsUnused2); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression(node, expressionResultIsUnused2); case 15 /* NoSubstitutionTemplateLiteral */: case 16 /* TemplateHead */: @@ -108157,13 +109155,13 @@ function transformES2015(context) { return visitStringLiteral(node); case 9 /* NumericLiteral */: return visitNumericLiteral(node); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 228 /* TemplateExpression */: + case 229 /* TemplateExpression */: return visitTemplateExpression(node); - case 229 /* YieldExpression */: + case 230 /* YieldExpression */: return visitYieldExpression(node); - case 230 /* SpreadElement */: + case 231 /* SpreadElement */: return visitSpreadElement(node); case 108 /* SuperKeyword */: return visitSuperKeyword( @@ -108173,18 +109171,18 @@ function transformES2015(context) { ); case 110 /* ThisKeyword */: return visitThisKeyword(node); - case 236 /* MetaProperty */: + case 237 /* MetaProperty */: return visitMetaProperty(node); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return visitAccessorDeclaration(node); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return visitVariableStatement(node); - case 253 /* ReturnStatement */: + case 254 /* ReturnStatement */: return visitReturnStatement(node); - case 222 /* VoidExpression */: + case 223 /* VoidExpression */: return visitVoidExpression(node); default: return visitEachChild(node, visitor, context); @@ -108299,13 +109297,13 @@ function transformES2015(context) { } function visitBreakOrContinueStatement(node) { if (convertedLoopState) { - const jump = node.kind === 252 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + const jump = node.kind === 253 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; const canUseBreakOrContinue = node.label && convertedLoopState.labels && convertedLoopState.labels.get(idText(node.label)) || !node.label && convertedLoopState.allowedNonLabeledJumps & jump; if (!canUseBreakOrContinue) { let labelMarker; const label = node.label; if (!label) { - if (node.kind === 252 /* BreakStatement */) { + if (node.kind === 253 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } else { @@ -108313,7 +109311,7 @@ function transformES2015(context) { labelMarker = "continue"; } } else { - if (node.kind === 252 /* BreakStatement */) { + if (node.kind === 253 /* BreakStatement */) { labelMarker = `break-${label.escapedText}`; setLabeledJump( convertedLoopState, @@ -108531,17 +109529,17 @@ function transformES2015(context) { } switch (node.kind) { // stop at function boundaries - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: - case 176 /* Constructor */: - case 175 /* ClassStaticBlockDeclaration */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 177 /* Constructor */: + case 176 /* ClassStaticBlockDeclaration */: return false; // only step into computed property names for class and object literal elements - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 174 /* MethodDeclaration */: - case 172 /* PropertyDeclaration */: { + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 173 /* PropertyDeclaration */: { const named = node; if (isComputedPropertyName(named.name)) { return !!forEachChild(named.name, containsSuperCall); @@ -108747,17 +109745,17 @@ function transformES2015(context) { } switch (node.kind) { // stop at function boundaries - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: - case 176 /* Constructor */: - case 175 /* ClassStaticBlockDeclaration */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 177 /* Constructor */: + case 176 /* ClassStaticBlockDeclaration */: return node; // only step into computed property names for class and object literal elements - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 174 /* MethodDeclaration */: - case 172 /* PropertyDeclaration */: { + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 173 /* PropertyDeclaration */: { const named = node; if (isComputedPropertyName(named.name)) { return factory2.replacePropertyName(named, visitEachChild( @@ -108800,17 +109798,17 @@ function transformES2015(context) { } switch (node.kind) { // stop at function boundaries - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: - case 176 /* Constructor */: - case 175 /* ClassStaticBlockDeclaration */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 177 /* Constructor */: + case 176 /* ClassStaticBlockDeclaration */: return node; // only step into computed property names for class and object literal elements - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 174 /* MethodDeclaration */: - case 172 /* PropertyDeclaration */: { + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 173 /* PropertyDeclaration */: { const named = node; if (isComputedPropertyName(named.name)) { return factory2.replacePropertyName(named, visitEachChild( @@ -108846,14 +109844,14 @@ function transformES2015(context) { return body; } function isSufficientlyCoveredByReturnStatements(statement) { - if (statement.kind === 253 /* ReturnStatement */) { + if (statement.kind === 254 /* ReturnStatement */) { return true; - } else if (statement.kind === 245 /* IfStatement */) { + } else if (statement.kind === 246 /* IfStatement */) { const ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); } - } else if (statement.kind === 241 /* Block */) { + } else if (statement.kind === 242 /* Block */) { const lastStatement = lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -109127,7 +110125,7 @@ function transformES2015(context) { return true; } function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 131072 /* CapturedLexicalThis */ && node.kind !== 219 /* ArrowFunction */) { + if (hierarchyFacts & 131072 /* CapturedLexicalThis */ && node.kind !== 220 /* ArrowFunction */) { insertCaptureThisForNode(statements, node, factory2.createThis()); return true; } @@ -109157,21 +110155,21 @@ function transformES2015(context) { if (hierarchyFacts & 32768 /* NewTarget */) { let newTarget; switch (node.kind) { - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return statements; - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: newTarget = factory2.createVoidZero(); break; - case 176 /* Constructor */: + case 177 /* Constructor */: newTarget = factory2.createPropertyAccessExpression( setEmitFlags(factory2.createThis(), 8 /* NoSubstitution */), "constructor" ); break; - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: newTarget = factory2.createConditionalExpression( factory2.createLogicalAnd( setEmitFlags(factory2.createThis(), 8 /* NoSubstitution */), @@ -109217,21 +110215,21 @@ function transformES2015(context) { function addClassMembers(statements, node) { for (const member of node.members) { switch (member.kind) { - case 240 /* SemicolonClassElement */: + case 241 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: const accessors = getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 176 /* Constructor */: - case 175 /* ClassStaticBlockDeclaration */: + case 177 /* Constructor */: + case 176 /* ClassStaticBlockDeclaration */: break; default: Debug.failBadSyntaxKind(member, currentSourceFile && currentSourceFile.fileName); @@ -109438,7 +110436,7 @@ function transformES2015(context) { const ancestorFacts = container && isClassLike(container) && !isStatic(node) ? enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */ | 8 /* NonStaticClassElement */) : enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */); const parameters = visitParameterList(node.parameters, visitor, context); const body = transformFunctionBody2(node); - if (hierarchyFacts & 32768 /* NewTarget */ && !name && (node.kind === 262 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */)) { + if (hierarchyFacts & 32768 /* NewTarget */ && !name && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 219 /* FunctionExpression */)) { name = factory2.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 229376 /* FunctionSubtreeExcludes */, 0 /* None */); @@ -109499,7 +110497,7 @@ function transformES2015(context) { multiLine = true; } } else { - Debug.assert(node.kind === 219 /* ArrowFunction */); + Debug.assert(node.kind === 220 /* ArrowFunction */); statementsLocation = moveRangeEnd(body, -1); const equalsGreaterThanToken = node.equalsGreaterThanToken; if (!nodeIsSynthesized(equalsGreaterThanToken) && !nodeIsSynthesized(body)) { @@ -109723,14 +110721,14 @@ function transformES2015(context) { } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 246 /* DoStatement */: - case 247 /* WhileStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -110080,7 +111078,7 @@ function transformES2015(context) { let numInitialProperties = -1, hasComputed = false; for (let i = 0; i < properties.length; i++) { const property = properties[i]; - if (property.transformFlags & 1048576 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */ || (hasComputed = Debug.checkDefined(property.name).kind === 167 /* ComputedPropertyName */)) { + if (property.transformFlags & 1048576 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */ || (hasComputed = Debug.checkDefined(property.name).kind === 168 /* ComputedPropertyName */)) { numInitialProperties = i; break; } @@ -110200,15 +111198,15 @@ function transformES2015(context) { } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 248 /* ForStatement */: + case 249 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); - case 246 /* DoStatement */: + case 247 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); - case 247 /* WhileStatement */: + case 248 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); default: return Debug.failBadSyntaxKind(node, "IterationStatement expected"); @@ -110260,11 +111258,11 @@ function transformES2015(context) { function createConvertedLoopState(node) { let loopInitializer; switch (node.kind) { - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: const initializer = node.initializer; - if (initializer && initializer.kind === 261 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 262 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -110698,20 +111696,20 @@ function transformES2015(context) { for (let i = start; i < numProperties; i++) { const property = properties[i]; switch (property.kind) { - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: const accessors = getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -110837,7 +111835,7 @@ function transformES2015(context) { let updated; const parameters = visitParameterList(node.parameters, visitor, context); const body = transformFunctionBody2(node); - if (node.kind === 177 /* GetAccessor */) { + if (node.kind === 178 /* GetAccessor */) { updated = factory2.updateGetAccessorDeclaration(node, node.modifiers, node.name, parameters, node.type, body); } else { updated = factory2.updateSetAccessorDeclaration(node, node.modifiers, node.name, parameters, body); @@ -111200,13 +112198,13 @@ function transformES2015(context) { if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(110 /* ThisKeyword */); - context.enableEmitNotification(176 /* Constructor */); - context.enableEmitNotification(174 /* MethodDeclaration */); - context.enableEmitNotification(177 /* GetAccessor */); - context.enableEmitNotification(178 /* SetAccessor */); - context.enableEmitNotification(219 /* ArrowFunction */); - context.enableEmitNotification(218 /* FunctionExpression */); - context.enableEmitNotification(262 /* FunctionDeclaration */); + context.enableEmitNotification(177 /* Constructor */); + context.enableEmitNotification(175 /* MethodDeclaration */); + context.enableEmitNotification(178 /* GetAccessor */); + context.enableEmitNotification(179 /* SetAccessor */); + context.enableEmitNotification(220 /* ArrowFunction */); + context.enableEmitNotification(219 /* FunctionExpression */); + context.enableEmitNotification(263 /* FunctionDeclaration */); } } function onSubstituteNode(hint, node) { @@ -111230,10 +112228,10 @@ function transformES2015(context) { } function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 208 /* BindingElement */: - case 263 /* ClassDeclaration */: - case 266 /* EnumDeclaration */: - case 260 /* VariableDeclaration */: + case 209 /* BindingElement */: + case 264 /* ClassDeclaration */: + case 267 /* EnumDeclaration */: + case 261 /* VariableDeclaration */: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } return false; @@ -111290,11 +112288,11 @@ function transformES2015(context) { return false; } const statement = firstOrUndefined(constructor.body.statements); - if (!statement || !nodeIsSynthesized(statement) || statement.kind !== 244 /* ExpressionStatement */) { + if (!statement || !nodeIsSynthesized(statement) || statement.kind !== 245 /* ExpressionStatement */) { return false; } const statementExpression = statement.expression; - if (!nodeIsSynthesized(statementExpression) || statementExpression.kind !== 213 /* CallExpression */) { + if (!nodeIsSynthesized(statementExpression) || statementExpression.kind !== 214 /* CallExpression */) { return false; } const callTarget = statementExpression.expression; @@ -111302,7 +112300,7 @@ function transformES2015(context) { return false; } const callArgument = singleOrUndefined(statementExpression.arguments); - if (!callArgument || !nodeIsSynthesized(callArgument) || callArgument.kind !== 230 /* SpreadElement */) { + if (!callArgument || !nodeIsSynthesized(callArgument) || callArgument.kind !== 231 /* SpreadElement */) { return false; } const expression = callArgument.expression; @@ -111391,13 +112389,13 @@ function transformGenerators(context) { } function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 246 /* DoStatement */: + case 247 /* DoStatement */: return visitDoStatement(node); - case 247 /* WhileStatement */: + case 248 /* WhileStatement */: return visitWhileStatement(node); - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return visitSwitchStatement(node); - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -111405,24 +112403,24 @@ function transformGenerators(context) { } function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: return visitFunctionExpression(node); - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return visitAccessorDeclaration(node); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return visitVariableStatement(node); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatement(node); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return visitForInStatement(node); - case 252 /* BreakStatement */: + case 253 /* BreakStatement */: return visitBreakStatement(node); - case 251 /* ContinueStatement */: + case 252 /* ContinueStatement */: return visitContinueStatement(node); - case 253 /* ReturnStatement */: + case 254 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 1048576 /* ContainsYield */) { @@ -111436,23 +112434,23 @@ function transformGenerators(context) { } function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return visitBinaryExpression(node); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression(node); - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return visitConditionalExpression(node); - case 229 /* YieldExpression */: + case 230 /* YieldExpression */: return visitYieldExpression(node); - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return visitCallExpression(node); - case 214 /* NewExpression */: + case 215 /* NewExpression */: return visitNewExpression(node); default: return visitEachChild(node, visitor, context); @@ -111460,9 +112458,9 @@ function transformGenerators(context) { } function visitGenerator(node) { switch (node.kind) { - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: return visitFunctionExpression(node); default: return Debug.failBadSyntaxKind(node); @@ -111647,14 +112645,14 @@ function transformGenerators(context) { if (containsYield(right)) { let target; switch (left.kind) { - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: target = factory2.updatePropertyAccessExpression( left, cacheExpression(Debug.checkDefined(visitNode(left.expression, visitor, isLeftHandSideExpression))), left.name ); break; - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: target = factory2.updateElementAccessExpression(left, cacheExpression(Debug.checkDefined(visitNode(left.expression, visitor, isLeftHandSideExpression))), cacheExpression(Debug.checkDefined(visitNode(left.argumentExpression, visitor, isExpression)))); break; default: @@ -111974,35 +112972,35 @@ function transformGenerators(context) { } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 241 /* Block */: + case 242 /* Block */: return transformAndEmitBlock(node); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 245 /* IfStatement */: + case 246 /* IfStatement */: return transformAndEmitIfStatement(node); - case 246 /* DoStatement */: + case 247 /* DoStatement */: return transformAndEmitDoStatement(node); - case 247 /* WhileStatement */: + case 248 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return transformAndEmitForStatement(node); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 251 /* ContinueStatement */: + case 252 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 252 /* BreakStatement */: + case 253 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 253 /* ReturnStatement */: + case 254 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 254 /* WithStatement */: + case 255 /* WithStatement */: return transformAndEmitWithStatement(node); - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 257 /* ThrowStatement */: + case 258 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 258 /* TryStatement */: + case 259 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(visitNode(node, visitor, isStatement)); @@ -112349,7 +113347,7 @@ function transformGenerators(context) { for (let i = 0; i < numClauses; i++) { const clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 297 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 298 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -112359,7 +113357,7 @@ function transformGenerators(context) { let defaultClausesSkipped = 0; for (let i = clausesWritten; i < numClauses; i++) { const clause = caseBlock.clauses[i]; - if (clause.kind === 296 /* CaseClause */) { + if (clause.kind === 297 /* CaseClause */) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -113325,12 +114323,12 @@ function transformModule(context) { const previousOnEmitNode = context.onEmitNode; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; - context.enableSubstitution(213 /* CallExpression */); - context.enableSubstitution(215 /* TaggedTemplateExpression */); + context.enableSubstitution(214 /* CallExpression */); + context.enableSubstitution(216 /* TaggedTemplateExpression */); context.enableSubstitution(80 /* Identifier */); - context.enableSubstitution(226 /* BinaryExpression */); - context.enableSubstitution(304 /* ShorthandPropertyAssignment */); - context.enableEmitNotification(307 /* SourceFile */); + context.enableSubstitution(227 /* BinaryExpression */); + context.enableSubstitution(305 /* ShorthandPropertyAssignment */); + context.enableEmitNotification(308 /* SourceFile */); const moduleInfoMap = []; let currentSourceFile; let currentModuleInfo; @@ -113771,13 +114769,13 @@ function transformModule(context) { } function topLevelVisitor(node) { switch (node.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return visitTopLevelImportDeclaration(node); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return visitTopLevelImportEqualsDeclaration(node); - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: return visitTopLevelExportDeclaration(node); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return visitTopLevelExportAssignment(node); default: return topLevelNestedVisitor(node); @@ -113785,45 +114783,45 @@ function transformModule(context) { } function topLevelNestedVisitor(node) { switch (node.kind) { - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return visitVariableStatement(node); - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return visitClassDeclaration(node); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatement( node, /*isTopLevel*/ true ); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return visitForInStatement(node); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return visitForOfStatement(node); - case 246 /* DoStatement */: + case 247 /* DoStatement */: return visitDoStatement(node); - case 247 /* WhileStatement */: + case 248 /* WhileStatement */: return visitWhileStatement(node); - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return visitLabeledStatement(node); - case 254 /* WithStatement */: + case 255 /* WithStatement */: return visitWithStatement(node); - case 245 /* IfStatement */: + case 246 /* IfStatement */: return visitIfStatement(node); - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return visitSwitchStatement(node); - case 269 /* CaseBlock */: + case 270 /* CaseBlock */: return visitCaseBlock(node); - case 296 /* CaseClause */: + case 297 /* CaseClause */: return visitCaseClause(node); - case 297 /* DefaultClause */: + case 298 /* DefaultClause */: return visitDefaultClause(node); - case 258 /* TryStatement */: + case 259 /* TryStatement */: return visitTryStatement(node); - case 299 /* CatchClause */: + case 300 /* CatchClause */: return visitCatchClause(node); - case 241 /* Block */: + case 242 /* Block */: return visitBlock(node); default: return visitor(node); @@ -113834,19 +114832,19 @@ function transformModule(context) { return node; } switch (node.kind) { - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatement( node, /*isTopLevel*/ false ); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return visitExpressionStatement(node); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, valueIsDiscarded); - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return visitPartiallyEmittedExpression(node, valueIsDiscarded); - case 213 /* CallExpression */: + case 214 /* CallExpression */: const needsRewrite = node === firstOrUndefined(importsAndRequiresToRewriteOrShim); if (needsRewrite) { importsAndRequiresToRewriteOrShim.shift(); @@ -113857,13 +114855,13 @@ function transformModule(context) { return shimOrRewriteImportOrRequireCall(node); } break; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: if (isDestructuringAssignment(node)) { return visitDestructuringAssignment(node, valueIsDiscarded); } break; - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression(node, valueIsDiscarded); } return visitEachChild(node, visitor, context); @@ -113886,24 +114884,24 @@ function transformModule(context) { if (isObjectLiteralExpression(node)) { for (const elem of node.properties) { switch (elem.kind) { - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 305 /* SpreadAssignment */: + case 306 /* SpreadAssignment */: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return false; default: Debug.assertNever(elem, "Unhandled object member kind"); @@ -114874,10 +115872,10 @@ function transformModule(context) { const namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 274 /* NamespaceImport */: + case 275 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, seen, namedBindings); break; - case 275 /* NamedImports */: + case 276 /* NamedImports */: for (const importBinding of namedBindings.elements) { statements = appendExportsOfDeclaration( statements, @@ -115069,7 +116067,7 @@ function transformModule(context) { return node; } function onEmitNode(hint, node, emitCallback) { - if (node.kind === 307 /* SourceFile */) { + if (node.kind === 308 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[getOriginalNodeId(currentSourceFile)]; previousOnEmitNode(hint, node, emitCallback); @@ -115107,11 +116105,11 @@ function transformModule(context) { switch (node.kind) { case 80 /* Identifier */: return substituteExpressionIdentifier(node); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return substituteCallExpression(node); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return substituteTaggedTemplateExpression(node); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return substituteBinaryExpression(node); } return node; @@ -115164,7 +116162,7 @@ function transformModule(context) { return node; } else if (!(isGeneratedIdentifier(node) && !(node.emitNode.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) { const exportContainer = resolver.getReferencedExportContainer(node, isExportName(node)); - if (exportContainer && exportContainer.kind === 307 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 308 /* SourceFile */) { return setTextRange( factory2.createPropertyAccessExpression( factory2.createIdentifier("exports"), @@ -115273,10 +116271,10 @@ function transformSystemModule(context) { context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(80 /* Identifier */); - context.enableSubstitution(304 /* ShorthandPropertyAssignment */); - context.enableSubstitution(226 /* BinaryExpression */); - context.enableSubstitution(236 /* MetaProperty */); - context.enableEmitNotification(307 /* SourceFile */); + context.enableSubstitution(305 /* ShorthandPropertyAssignment */); + context.enableSubstitution(227 /* BinaryExpression */); + context.enableSubstitution(237 /* MetaProperty */); + context.enableEmitNotification(308 /* SourceFile */); const moduleInfoMap = []; const exportFunctionsMap = []; const noSubstitutionMap = []; @@ -115460,7 +116458,7 @@ function transformSystemModule(context) { if (!some(moduleInfo.exportedNames) && moduleInfo.exportedFunctions.size === 0 && moduleInfo.exportSpecifiers.size === 0) { let hasExportDeclarationWithExportClause = false; for (const externalImport of moduleInfo.externalImports) { - if (externalImport.kind === 278 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 279 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -115620,12 +116618,12 @@ function transformSystemModule(context) { for (const entry of group2.externalImports) { const importVariableName = getLocalNameForExternalImport(factory2, entry, currentSourceFile); switch (entry.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: if (!entry.importClause) { break; } // falls through - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: Debug.assert(importVariableName !== void 0); statements.push( factory2.createExpressionStatement( @@ -115648,7 +116646,7 @@ function transformSystemModule(context) { ); } break; - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: Debug.assert(importVariableName !== void 0); if (entry.exportClause) { if (isNamedExports(entry.exportClause)) { @@ -115743,13 +116741,13 @@ function transformSystemModule(context) { } function topLevelVisitor(node) { switch (node.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return visitImportDeclaration(node); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: return visitExportDeclaration(node); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return visitExportAssignment(node); default: return topLevelNestedVisitor(node); @@ -115904,7 +116902,7 @@ function transformSystemModule(context) { } } function shouldHoistVariableDeclarationList(node) { - return (getEmitFlags(node) & 4194304 /* NoHoisting */) === 0 && (enclosingBlockScopedContainer.kind === 307 /* SourceFile */ || (getOriginalNode(node).flags & 7 /* BlockScoped */) === 0); + return (getEmitFlags(node) & 4194304 /* NoHoisting */) === 0 && (enclosingBlockScopedContainer.kind === 308 /* SourceFile */ || (getOriginalNode(node).flags & 7 /* BlockScoped */) === 0); } function transformInitializedVariable(node, isExportedDeclaration) { const createAssignment = isExportedDeclaration ? createExportedVariableAssignment : createNonExportedVariableAssignment; @@ -115954,10 +116952,10 @@ function transformSystemModule(context) { const namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 274 /* NamespaceImport */: + case 275 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 275 /* NamedImports */: + case 276 /* NamedImports */: for (const importBinding of namedBindings.elements) { statements = appendExportsOfDeclaration(statements, importBinding); } @@ -116057,45 +117055,45 @@ function transformSystemModule(context) { } function topLevelNestedVisitor(node) { switch (node.kind) { - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return visitVariableStatement(node); - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return visitClassDeclaration(node); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatement( node, /*isTopLevel*/ true ); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return visitForInStatement(node); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return visitForOfStatement(node); - case 246 /* DoStatement */: + case 247 /* DoStatement */: return visitDoStatement(node); - case 247 /* WhileStatement */: + case 248 /* WhileStatement */: return visitWhileStatement(node); - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return visitLabeledStatement(node); - case 254 /* WithStatement */: + case 255 /* WithStatement */: return visitWithStatement(node); - case 245 /* IfStatement */: + case 246 /* IfStatement */: return visitIfStatement(node); - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return visitSwitchStatement(node); - case 269 /* CaseBlock */: + case 270 /* CaseBlock */: return visitCaseBlock(node); - case 296 /* CaseClause */: + case 297 /* CaseClause */: return visitCaseClause(node); - case 297 /* DefaultClause */: + case 298 /* DefaultClause */: return visitDefaultClause(node); - case 258 /* TryStatement */: + case 259 /* TryStatement */: return visitTryStatement(node); - case 299 /* CatchClause */: + case 300 /* CatchClause */: return visitCatchClause(node); - case 241 /* Block */: + case 242 /* Block */: return visitBlock(node); default: return visitor(node); @@ -116249,30 +117247,30 @@ function transformSystemModule(context) { return node; } switch (node.kind) { - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatement( node, /*isTopLevel*/ false ); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return visitExpressionStatement(node); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, valueIsDiscarded); - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return visitPartiallyEmittedExpression(node, valueIsDiscarded); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: if (isDestructuringAssignment(node)) { return visitDestructuringAssignment(node, valueIsDiscarded); } break; - case 213 /* CallExpression */: + case 214 /* CallExpression */: if (isImportCall(node)) { return visitImportCallExpression(node); } break; - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return visitPrefixOrPostfixUnaryExpression(node, valueIsDiscarded); } return visitEachChild(node, visitor, context); @@ -116345,7 +117343,7 @@ function transformSystemModule(context) { return hasExportedReferenceInDestructuringTarget(node.initializer); } else if (isIdentifier(node)) { const container = resolver.getReferencedExportContainer(node); - return container !== void 0 && container.kind === 307 /* SourceFile */; + return container !== void 0 && container.kind === 308 /* SourceFile */; } else { return false; } @@ -116389,7 +117387,7 @@ function transformSystemModule(context) { return node; } function onEmitNode(hint, node, emitCallback) { - if (node.kind === 307 /* SourceFile */) { + if (node.kind === 308 /* SourceFile */) { const id = getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -116423,7 +117421,7 @@ function transformSystemModule(context) { } function substituteUnspecified(node) { switch (node.kind) { - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -116466,9 +117464,9 @@ function transformSystemModule(context) { switch (node.kind) { case 80 /* Identifier */: return substituteExpressionIdentifier(node); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return substituteBinaryExpression(node); - case 236 /* MetaProperty */: + case 237 /* MetaProperty */: return substituteMetaProperty(node); } return node; @@ -116535,7 +117533,7 @@ function transformSystemModule(context) { /*prefixLocals*/ false ); - if (exportContainer && exportContainer.kind === 307 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 308 /* SourceFile */) { exportedNames = append(exportedNames, factory2.getDeclarationName(valueDeclaration)); } exportedNames = addRange(exportedNames, moduleInfo == null ? void 0 : moduleInfo.exportedBindings[getOriginalNodeId(valueDeclaration)]); @@ -116590,7 +117588,7 @@ function transformECMAScriptModule(context) { const previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(307 /* SourceFile */); + context.enableEmitNotification(308 /* SourceFile */); context.enableSubstitution(80 /* Identifier */); const noSubstitution = /* @__PURE__ */ new Set(); let importsAndRequiresToRewriteOrShim; @@ -116655,16 +117653,16 @@ function transformECMAScriptModule(context) { } function visitor(node) { switch (node.kind) { - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return getEmitModuleKind(compilerOptions) >= 100 /* Node16 */ ? visitImportEqualsDeclaration(node) : void 0; - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return visitExportAssignment(node); - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: const exportDecl = node; return visitExportDeclaration(exportDecl); - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return visitImportDeclaration(node); - case 213 /* CallExpression */: + case 214 /* CallExpression */: if (node === (importsAndRequiresToRewriteOrShim == null ? void 0 : importsAndRequiresToRewriteOrShim[0])) { return visitImportOrRequireCall(importsAndRequiresToRewriteOrShim.shift()); } @@ -116723,8 +117721,8 @@ function transformECMAScriptModule(context) { /*modifiers*/ void 0, factory2.createImportClause( - /*isTypeOnly*/ - false, + /*phaseModifier*/ + void 0, /*name*/ void 0, factory2.createNamedImports([ @@ -116869,8 +117867,8 @@ function transformECMAScriptModule(context) { /*modifiers*/ void 0, factory2.createImportClause( - /*isTypeOnly*/ - false, + /*phaseModifier*/ + void 0, /*name*/ void 0, factory2.createNamespaceImport( @@ -116952,8 +117950,8 @@ function transformImpliedNodeFormatDependentModule(context) { const getEmitModuleFormatOfFile2 = (file) => context.getEmitHost().getEmitModuleFormatOfFile(file); context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; - context.enableSubstitution(307 /* SourceFile */); - context.enableEmitNotification(307 /* SourceFile */); + context.enableSubstitution(308 /* SourceFile */); + context.enableEmitNotification(308 /* SourceFile */); let currentSourceFile; return transformSourceFileOrBundle; function onSubstituteNode(hint, node) { @@ -116996,7 +117994,7 @@ function transformImpliedNodeFormatDependentModule(context) { return result; } function transformSourceFileOrBundle(node) { - return node.kind === 307 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 308 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return context.factory.createBundle(map(node.sourceFiles, transformSourceFile)); @@ -117026,7 +118024,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) { function getAccessorNameVisibilityDiagnosticMessage(symbolAccessibilityResult) { if (isStatic(node)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; - } else if (node.parent.kind === 263 /* ClassDeclaration */) { + } else if (node.parent.kind === 264 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; } else { return symbolAccessibilityResult.errorModuleName ? Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; @@ -117043,7 +118041,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) { function getMethodNameVisibilityDiagnosticMessage(symbolAccessibilityResult) { if (isStatic(node)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; - } else if (node.parent.kind === 263 /* ClassDeclaration */) { + } else if (node.parent.kind === 264 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_method_0_of_exported_class_has_or_is_using_private_name_1; } else { return symbolAccessibilityResult.errorModuleName ? Diagnostics.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Method_0_of_exported_interface_has_or_is_using_private_name_1; @@ -117074,12 +118072,12 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) { return Debug.assertNever(node, `Attempted to set a declaration diagnostic context for unhandled node kind: ${Debug.formatSyntaxKind(node.kind)}`); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 260 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) { + if (node.kind === 261 /* VariableDeclaration */ || node.kind === 209 /* BindingElement */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; - } else if (node.kind === 172 /* PropertyDeclaration */ || node.kind === 211 /* PropertyAccessExpression */ || node.kind === 212 /* ElementAccessExpression */ || node.kind === 226 /* BinaryExpression */ || node.kind === 171 /* PropertySignature */ || node.kind === 169 /* Parameter */ && hasSyntacticModifier(node.parent, 2 /* Private */)) { + } else if (node.kind === 173 /* PropertyDeclaration */ || node.kind === 212 /* PropertyAccessExpression */ || node.kind === 213 /* ElementAccessExpression */ || node.kind === 227 /* BinaryExpression */ || node.kind === 172 /* PropertySignature */ || node.kind === 170 /* Parameter */ && hasSyntacticModifier(node.parent, 2 /* Private */)) { if (isStatic(node)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; - } else if (node.parent.kind === 263 /* ClassDeclaration */ || node.kind === 169 /* Parameter */) { + } else if (node.parent.kind === 264 /* ClassDeclaration */ || node.kind === 170 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; } else { return symbolAccessibilityResult.errorModuleName ? Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; @@ -117096,7 +118094,7 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) { } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { let diagnosticMessage; - if (node.kind === 178 /* SetAccessor */) { + if (node.kind === 179 /* SetAccessor */) { if (isStatic(node)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1; } else { @@ -117118,26 +118116,26 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) { function getReturnTypeVisibilityError(symbolAccessibilityResult) { let diagnosticMessage; switch (node.kind) { - case 180 /* ConstructSignature */: + case 181 /* ConstructSignature */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 179 /* CallSignature */: + case 180 /* CallSignature */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: if (isStatic(node)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; - } else if (node.parent.kind === 263 /* ClassDeclaration */) { + } else if (node.parent.kind === 264 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; } else { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; break; default: @@ -117158,29 +118156,29 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) { } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 176 /* Constructor */: + case 177 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 180 /* ConstructSignature */: - case 185 /* ConstructorType */: + case 181 /* ConstructSignature */: + case 186 /* ConstructorType */: return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 179 /* CallSignature */: + case 180 /* CallSignature */: return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: if (isStatic(node.parent)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; - } else if (node.parent.parent.kind === 263 /* ClassDeclaration */) { + } else if (node.parent.parent.kind === 264 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 262 /* FunctionDeclaration */: - case 184 /* FunctionType */: + case 263 /* FunctionDeclaration */: + case 185 /* FunctionType */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - case 178 /* SetAccessor */: - case 177 /* GetAccessor */: + case 179 /* SetAccessor */: + case 178 /* GetAccessor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1; default: return Debug.fail(`Unknown parent for parameter: ${Debug.formatSyntaxKind(node.parent.kind)}`); @@ -117189,40 +118187,40 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) { function getTypeParameterConstraintVisibilityError() { let diagnosticMessage; switch (node.parent.kind) { - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 200 /* MappedType */: + case 201 /* MappedType */: diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 185 /* ConstructorType */: - case 180 /* ConstructSignature */: + case 186 /* ConstructorType */: + case 181 /* ConstructSignature */: diagnosticMessage = Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 179 /* CallSignature */: + case 180 /* CallSignature */: diagnosticMessage = Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: if (isStatic(node.parent)) { diagnosticMessage = Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; - } else if (node.parent.parent.kind === 263 /* ClassDeclaration */) { + } else if (node.parent.parent.kind === 264 /* ClassDeclaration */) { diagnosticMessage = Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 184 /* FunctionType */: - case 262 /* FunctionDeclaration */: + case 185 /* FunctionType */: + case 263 /* FunctionDeclaration */: diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 195 /* InferType */: + case 196 /* InferType */: diagnosticMessage = Diagnostics.Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1; break; - case 265 /* TypeAliasDeclaration */: + case 266 /* TypeAliasDeclaration */: diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -117264,37 +118262,37 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) { } function createGetIsolatedDeclarationErrors(resolver) { const relatedSuggestionByDeclarationKind = { - [219 /* ArrowFunction */]: Diagnostics.Add_a_return_type_to_the_function_expression, - [218 /* FunctionExpression */]: Diagnostics.Add_a_return_type_to_the_function_expression, - [174 /* MethodDeclaration */]: Diagnostics.Add_a_return_type_to_the_method, - [177 /* GetAccessor */]: Diagnostics.Add_a_return_type_to_the_get_accessor_declaration, - [178 /* SetAccessor */]: Diagnostics.Add_a_type_to_parameter_of_the_set_accessor_declaration, - [262 /* FunctionDeclaration */]: Diagnostics.Add_a_return_type_to_the_function_declaration, - [180 /* ConstructSignature */]: Diagnostics.Add_a_return_type_to_the_function_declaration, - [169 /* Parameter */]: Diagnostics.Add_a_type_annotation_to_the_parameter_0, - [260 /* VariableDeclaration */]: Diagnostics.Add_a_type_annotation_to_the_variable_0, - [172 /* PropertyDeclaration */]: Diagnostics.Add_a_type_annotation_to_the_property_0, - [171 /* PropertySignature */]: Diagnostics.Add_a_type_annotation_to_the_property_0, - [277 /* ExportAssignment */]: Diagnostics.Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it + [220 /* ArrowFunction */]: Diagnostics.Add_a_return_type_to_the_function_expression, + [219 /* FunctionExpression */]: Diagnostics.Add_a_return_type_to_the_function_expression, + [175 /* MethodDeclaration */]: Diagnostics.Add_a_return_type_to_the_method, + [178 /* GetAccessor */]: Diagnostics.Add_a_return_type_to_the_get_accessor_declaration, + [179 /* SetAccessor */]: Diagnostics.Add_a_type_to_parameter_of_the_set_accessor_declaration, + [263 /* FunctionDeclaration */]: Diagnostics.Add_a_return_type_to_the_function_declaration, + [181 /* ConstructSignature */]: Diagnostics.Add_a_return_type_to_the_function_declaration, + [170 /* Parameter */]: Diagnostics.Add_a_type_annotation_to_the_parameter_0, + [261 /* VariableDeclaration */]: Diagnostics.Add_a_type_annotation_to_the_variable_0, + [173 /* PropertyDeclaration */]: Diagnostics.Add_a_type_annotation_to_the_property_0, + [172 /* PropertySignature */]: Diagnostics.Add_a_type_annotation_to_the_property_0, + [278 /* ExportAssignment */]: Diagnostics.Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it }; const errorByDeclarationKind = { - [218 /* FunctionExpression */]: Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, - [262 /* FunctionDeclaration */]: Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, - [219 /* ArrowFunction */]: Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, - [174 /* MethodDeclaration */]: Diagnostics.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, - [180 /* ConstructSignature */]: Diagnostics.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, - [177 /* GetAccessor */]: Diagnostics.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations, - [178 /* SetAccessor */]: Diagnostics.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations, - [169 /* Parameter */]: Diagnostics.Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations, - [260 /* VariableDeclaration */]: Diagnostics.Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations, - [172 /* PropertyDeclaration */]: Diagnostics.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations, - [171 /* PropertySignature */]: Diagnostics.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations, - [167 /* ComputedPropertyName */]: Diagnostics.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations, - [305 /* SpreadAssignment */]: Diagnostics.Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations, - [304 /* ShorthandPropertyAssignment */]: Diagnostics.Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations, - [209 /* ArrayLiteralExpression */]: Diagnostics.Only_const_arrays_can_be_inferred_with_isolatedDeclarations, - [277 /* ExportAssignment */]: Diagnostics.Default_exports_can_t_be_inferred_with_isolatedDeclarations, - [230 /* SpreadElement */]: Diagnostics.Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations + [219 /* FunctionExpression */]: Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, + [263 /* FunctionDeclaration */]: Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, + [220 /* ArrowFunction */]: Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, + [175 /* MethodDeclaration */]: Diagnostics.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, + [181 /* ConstructSignature */]: Diagnostics.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, + [178 /* GetAccessor */]: Diagnostics.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations, + [179 /* SetAccessor */]: Diagnostics.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations, + [170 /* Parameter */]: Diagnostics.Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations, + [261 /* VariableDeclaration */]: Diagnostics.Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations, + [173 /* PropertyDeclaration */]: Diagnostics.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations, + [172 /* PropertySignature */]: Diagnostics.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations, + [168 /* ComputedPropertyName */]: Diagnostics.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations, + [306 /* SpreadAssignment */]: Diagnostics.Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations, + [305 /* ShorthandPropertyAssignment */]: Diagnostics.Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations, + [210 /* ArrayLiteralExpression */]: Diagnostics.Only_const_arrays_can_be_inferred_with_isolatedDeclarations, + [278 /* ExportAssignment */]: Diagnostics.Default_exports_can_t_be_inferred_with_isolatedDeclarations, + [231 /* SpreadElement */]: Diagnostics.Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations }; return getDiagnostic2; function getDiagnostic2(node) { @@ -117307,32 +118305,32 @@ function createGetIsolatedDeclarationErrors(resolver) { } Debug.type(node); switch (node.kind) { - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return createAccessorTypeError(node); - case 167 /* ComputedPropertyName */: - case 304 /* ShorthandPropertyAssignment */: - case 305 /* SpreadAssignment */: + case 168 /* ComputedPropertyName */: + case 305 /* ShorthandPropertyAssignment */: + case 306 /* SpreadAssignment */: return createObjectLiteralError(node); - case 209 /* ArrayLiteralExpression */: - case 230 /* SpreadElement */: + case 210 /* ArrayLiteralExpression */: + case 231 /* SpreadElement */: return createArrayLiteralError(node); - case 174 /* MethodDeclaration */: - case 180 /* ConstructSignature */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 262 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 181 /* ConstructSignature */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: return createReturnTypeError(node); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return createBindingElementError(node); - case 172 /* PropertyDeclaration */: - case 260 /* VariableDeclaration */: + case 173 /* PropertyDeclaration */: + case 261 /* VariableDeclaration */: return createVariableOrPropertyError(node); - case 169 /* Parameter */: + case 170 /* Parameter */: return createParameterError(node); - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return createExpressionError(node.initializer); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return createClassExpressionError(node); default: assertType(node); @@ -117646,10 +118644,10 @@ function transformDeclarations(context) { return result; } function transformRoot(node) { - if (node.kind === 307 /* SourceFile */ && node.isDeclarationFile) { + if (node.kind === 308 /* SourceFile */ && node.isDeclarationFile) { return node; } - if (node.kind === 308 /* Bundle */) { + if (node.kind === 309 /* Bundle */) { isBundledEmit = true; rawReferencedFiles = []; rawTypeReferenceDirectives = []; @@ -117825,14 +118823,14 @@ function transformDeclarations(context) { if (name.kind === 80 /* Identifier */) { return name; } else { - if (name.kind === 207 /* ArrayBindingPattern */) { + if (name.kind === 208 /* ArrayBindingPattern */) { return factory2.updateArrayBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isArrayBindingElement)); } else { return factory2.updateObjectBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isBindingElement)); } } function visitBindingElement(elem) { - if (elem.kind === 232 /* OmittedExpression */) { + if (elem.kind === 233 /* OmittedExpression */) { return elem; } if (elem.propertyName && isComputedPropertyName(elem.propertyName) && isEntityNameExpression(elem.propertyName.expression)) { @@ -117922,22 +118920,22 @@ function transformDeclarations(context) { function isDeclarationAndNotVisible(node) { node = getParseTreeNode(node); switch (node.kind) { - case 262 /* FunctionDeclaration */: - case 267 /* ModuleDeclaration */: - case 264 /* InterfaceDeclaration */: - case 263 /* ClassDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 266 /* EnumDeclaration */: + case 263 /* FunctionDeclaration */: + case 268 /* ModuleDeclaration */: + case 265 /* InterfaceDeclaration */: + case 264 /* ClassDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 267 /* EnumDeclaration */: return !resolver.isDeclarationVisible(node); // The following should be doing their own visibility checks based on filtering their members - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return !getBindingNameVisible(node); - case 271 /* ImportEqualsDeclaration */: - case 272 /* ImportDeclaration */: - case 278 /* ExportDeclaration */: - case 277 /* ExportAssignment */: + case 272 /* ImportEqualsDeclaration */: + case 273 /* ImportDeclaration */: + case 279 /* ExportDeclaration */: + case 278 /* ExportAssignment */: return false; - case 175 /* ClassStaticBlockDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: return true; } return false; @@ -118017,7 +119015,7 @@ function transformDeclarations(context) { } function rewriteModuleSpecifier2(parent2, input) { if (!input) return void 0; - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent2.kind !== 267 /* ModuleDeclaration */ && parent2.kind !== 205 /* ImportType */; + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent2.kind !== 268 /* ModuleDeclaration */ && parent2.kind !== 206 /* ImportType */; if (isStringLiteralLike(input)) { if (isBundledEmit) { const newName = getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent2); @@ -118030,7 +119028,7 @@ function transformDeclarations(context) { } function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 283 /* ExternalModuleReference */) { + if (decl.moduleReference.kind === 284 /* ExternalModuleReference */) { const specifier = getExternalModuleImportEqualsDeclarationExpression(decl); return factory2.updateImportEqualsDeclaration( decl, @@ -118057,6 +119055,7 @@ function transformDeclarations(context) { tryGetResolutionModeOverride(decl.attributes) ); } + const phaseModifier = decl.importClause.phaseModifier === 166 /* DeferKeyword */ ? void 0 : decl.importClause.phaseModifier; const visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : void 0; if (!decl.importClause.namedBindings) { return visibleDefaultBinding && factory2.updateImportDeclaration( @@ -118064,7 +119063,7 @@ function transformDeclarations(context) { decl.modifiers, factory2.updateImportClause( decl.importClause, - decl.importClause.isTypeOnly, + phaseModifier, visibleDefaultBinding, /*namedBindings*/ void 0 @@ -118073,7 +119072,7 @@ function transformDeclarations(context) { tryGetResolutionModeOverride(decl.attributes) ); } - if (decl.importClause.namedBindings.kind === 274 /* NamespaceImport */) { + if (decl.importClause.namedBindings.kind === 275 /* NamespaceImport */) { const namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : ( /*namedBindings*/ void 0 @@ -118083,7 +119082,7 @@ function transformDeclarations(context) { decl.modifiers, factory2.updateImportClause( decl.importClause, - decl.importClause.isTypeOnly, + phaseModifier, visibleDefaultBinding, namedBindings ), @@ -118098,7 +119097,7 @@ function transformDeclarations(context) { decl.modifiers, factory2.updateImportClause( decl.importClause, - decl.importClause.isTypeOnly, + phaseModifier, visibleDefaultBinding, bindingList && bindingList.length ? factory2.updateNamedImports(decl.importClause.namedBindings, bindingList) : void 0 ), @@ -118190,7 +119189,7 @@ function transformDeclarations(context) { const oldDiag = getSymbolAccessibilityDiagnostic; const canProduceDiagnostic = canProduceDiagnostics(input); const oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - let shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 187 /* TypeLiteral */ || input.kind === 200 /* MappedType */) && input.parent.kind !== 265 /* TypeAliasDeclaration */; + let shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 188 /* TypeLiteral */ || input.kind === 201 /* MappedType */) && input.parent.kind !== 266 /* TypeAliasDeclaration */; if (isMethodDeclaration(input) || isMethodSignature(input)) { if (hasEffectiveModifier(input, 2 /* Private */)) { if (input.symbol && input.symbol.declarations && input.symbol.declarations[0] !== input) return; @@ -118217,26 +119216,26 @@ function transformDeclarations(context) { } if (isProcessedComponent(input)) { switch (input.kind) { - case 233 /* ExpressionWithTypeArguments */: { + case 234 /* ExpressionWithTypeArguments */: { if (isEntityName(input.expression) || isEntityNameExpression(input.expression)) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } const node = visitEachChild(input, visitDeclarationSubtree, context); return cleanup(factory2.updateExpressionWithTypeArguments(node, node.expression, node.typeArguments)); } - case 183 /* TypeReference */: { + case 184 /* TypeReference */: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); const node = visitEachChild(input, visitDeclarationSubtree, context); return cleanup(factory2.updateTypeReferenceNode(node, node.typeName, node.typeArguments)); } - case 180 /* ConstructSignature */: + case 181 /* ConstructSignature */: return cleanup(factory2.updateConstructSignature( input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input) )); - case 176 /* Constructor */: { + case 177 /* Constructor */: { const ctor = factory2.createConstructorDeclaration( /*modifiers*/ ensureModifiers(input), @@ -118246,7 +119245,7 @@ function transformDeclarations(context) { ); return cleanup(ctor); } - case 174 /* MethodDeclaration */: { + case 175 /* MethodDeclaration */: { if (isPrivateIdentifier(input.name)) { return cleanup( /*returnValue*/ @@ -118267,7 +119266,7 @@ function transformDeclarations(context) { ); return cleanup(sig); } - case 177 /* GetAccessor */: { + case 178 /* GetAccessor */: { if (isPrivateIdentifier(input.name)) { return cleanup( /*returnValue*/ @@ -118284,7 +119283,7 @@ function transformDeclarations(context) { void 0 )); } - case 178 /* SetAccessor */: { + case 179 /* SetAccessor */: { if (isPrivateIdentifier(input.name)) { return cleanup( /*returnValue*/ @@ -118300,7 +119299,7 @@ function transformDeclarations(context) { void 0 )); } - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: if (isPrivateIdentifier(input.name)) { return cleanup( /*returnValue*/ @@ -118315,7 +119314,7 @@ function transformDeclarations(context) { ensureType(input), ensureNoInitializer(input) )); - case 171 /* PropertySignature */: + case 172 /* PropertySignature */: if (isPrivateIdentifier(input.name)) { return cleanup( /*returnValue*/ @@ -118329,7 +119328,7 @@ function transformDeclarations(context) { input.questionToken, ensureType(input) )); - case 173 /* MethodSignature */: { + case 174 /* MethodSignature */: { if (isPrivateIdentifier(input.name)) { return cleanup( /*returnValue*/ @@ -118346,7 +119345,7 @@ function transformDeclarations(context) { ensureType(input) )); } - case 179 /* CallSignature */: { + case 180 /* CallSignature */: { return cleanup( factory2.updateCallSignature( input, @@ -118356,7 +119355,7 @@ function transformDeclarations(context) { ) ); } - case 181 /* IndexSignature */: { + case 182 /* IndexSignature */: { return cleanup(factory2.updateIndexSignature( input, ensureModifiers(input), @@ -118364,7 +119363,7 @@ function transformDeclarations(context) { visitNode(input.type, visitDeclarationSubtree, isTypeNode) || factory2.createKeywordTypeNode(133 /* AnyKeyword */) )); } - case 260 /* VariableDeclaration */: { + case 261 /* VariableDeclaration */: { if (isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -118379,7 +119378,7 @@ function transformDeclarations(context) { ensureNoInitializer(input) )); } - case 168 /* TypeParameter */: { + case 169 /* TypeParameter */: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(factory2.updateTypeParameterDeclaration( input, @@ -118393,7 +119392,7 @@ function transformDeclarations(context) { } return cleanup(visitEachChild(input, visitDeclarationSubtree, context)); } - case 194 /* ConditionalType */: { + case 195 /* ConditionalType */: { const checkType = visitNode(input.checkType, visitDeclarationSubtree, isTypeNode); const extendsType = visitNode(input.extendsType, visitDeclarationSubtree, isTypeNode); const oldEnclosingDecl = enclosingDeclaration; @@ -118407,7 +119406,7 @@ function transformDeclarations(context) { Debug.assert(falseType); return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 184 /* FunctionType */: { + case 185 /* FunctionType */: { return cleanup(factory2.updateFunctionTypeNode( input, visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), @@ -118415,7 +119414,7 @@ function transformDeclarations(context) { Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)) )); } - case 185 /* ConstructorType */: { + case 186 /* ConstructorType */: { return cleanup(factory2.updateConstructorTypeNode( input, ensureModifiers(input), @@ -118424,7 +119423,7 @@ function transformDeclarations(context) { Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)) )); } - case 205 /* ImportType */: { + case 206 /* ImportType */: { if (!isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(factory2.updateImportTypeNode( input, @@ -118463,7 +119462,7 @@ function transformDeclarations(context) { } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 174 /* MethodDeclaration */ && hasEffectiveModifier(node.parent, 2 /* Private */); + return node.parent.kind === 175 /* MethodDeclaration */ && hasEffectiveModifier(node.parent, 2 /* Private */); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -118471,7 +119470,7 @@ function transformDeclarations(context) { } if (shouldStripInternal(input)) return; switch (input.kind) { - case 278 /* ExportDeclaration */: { + case 279 /* ExportDeclaration */: { if (isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -118485,7 +119484,7 @@ function transformDeclarations(context) { tryGetResolutionModeOverride(input.attributes) ); } - case 277 /* ExportAssignment */: { + case 278 /* ExportAssignment */: { if (isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -118548,10 +119547,10 @@ function transformDeclarations(context) { } if (shouldStripInternal(input)) return; switch (input.kind) { - case 271 /* ImportEqualsDeclaration */: { + case 272 /* ImportEqualsDeclaration */: { return transformImportEqualsDeclaration(input); } - case 272 /* ImportDeclaration */: { + case 273 /* ImportDeclaration */: { return transformImportDeclaration(input); } } @@ -118570,7 +119569,7 @@ function transformDeclarations(context) { } const previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 265 /* TypeAliasDeclaration */: { + case 266 /* TypeAliasDeclaration */: { needsDeclare = false; const clean2 = cleanup(factory2.updateTypeAliasDeclaration( input, @@ -118582,7 +119581,7 @@ function transformDeclarations(context) { needsDeclare = previousNeedsDeclare; return clean2; } - case 264 /* InterfaceDeclaration */: { + case 265 /* InterfaceDeclaration */: { return cleanup(factory2.updateInterfaceDeclaration( input, ensureModifiers(input), @@ -118592,7 +119591,7 @@ function transformDeclarations(context) { visitNodes2(input.members, visitDeclarationSubtree, isTypeElement) )); } - case 262 /* FunctionDeclaration */: { + case 263 /* FunctionDeclaration */: { const clean2 = cleanup(factory2.updateFunctionDeclaration( input, ensureModifiers(input), @@ -118704,10 +119703,10 @@ function transformDeclarations(context) { return clean2; } } - case 267 /* ModuleDeclaration */: { + case 268 /* ModuleDeclaration */: { needsDeclare = false; const inner = input.body; - if (inner && inner.kind === 268 /* ModuleBlock */) { + if (inner && inner.kind === 269 /* ModuleBlock */) { const oldNeedsScopeFix = needsScopeFixMarker; const oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; @@ -118751,7 +119750,7 @@ function transformDeclarations(context) { )); } } - case 263 /* ClassDeclaration */: { + case 264 /* ClassDeclaration */: { errorNameNode = input.name; errorFallbackNode = input; const modifiers = factory2.createNodeArray(ensureModifiers(input)); @@ -118868,10 +119867,10 @@ function transformDeclarations(context) { )); } } - case 243 /* VariableStatement */: { + case 244 /* VariableStatement */: { return cleanup(transformVariableStatement(input)); } - case 266 /* EnumDeclaration */: { + case 267 /* EnumDeclaration */: { return cleanup(factory2.updateEnumDeclaration( input, factory2.createNodeArray(ensureModifiers(input)), @@ -118898,7 +119897,7 @@ function transformDeclarations(context) { if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 267 /* ModuleDeclaration */) { + if (input.kind === 268 /* ModuleDeclaration */) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -118929,7 +119928,7 @@ function transformDeclarations(context) { return flatten(mapDefined(d.elements, (e) => recreateBindingElement(e))); } function recreateBindingElement(e) { - if (e.kind === 232 /* OmittedExpression */) { + if (e.kind === 233 /* OmittedExpression */) { return; } if (e.name) { @@ -118984,7 +119983,7 @@ function transformDeclarations(context) { function ensureModifierFlags(node) { let mask2 = 131071 /* All */ ^ (1 /* Public */ | 1024 /* Async */ | 16 /* Override */); let additions = needsDeclare && !isAlwaysType(node) ? 128 /* Ambient */ : 0 /* None */; - const parentIsFile = node.parent.kind === 307 /* SourceFile */; + const parentIsFile = node.parent.kind === 308 /* SourceFile */; if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent)) { mask2 ^= 128 /* Ambient */; additions = 0 /* None */; @@ -119008,7 +120007,7 @@ function transformDeclarations(context) { } } function isAlwaysType(node) { - if (node.kind === 264 /* InterfaceDeclaration */) { + if (node.kind === 265 /* InterfaceDeclaration */) { return true; } return false; @@ -119028,52 +120027,52 @@ function maskModifierFlags(node, modifierMask = 131071 /* All */ ^ 1 /* Public * } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: return !hasEffectiveModifier(node, 2 /* Private */); - case 169 /* Parameter */: - case 260 /* VariableDeclaration */: + case 170 /* Parameter */: + case 261 /* VariableDeclaration */: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 262 /* FunctionDeclaration */: - case 267 /* ModuleDeclaration */: - case 271 /* ImportEqualsDeclaration */: - case 264 /* InterfaceDeclaration */: - case 263 /* ClassDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 266 /* EnumDeclaration */: - case 243 /* VariableStatement */: - case 272 /* ImportDeclaration */: - case 278 /* ExportDeclaration */: - case 277 /* ExportAssignment */: + case 263 /* FunctionDeclaration */: + case 268 /* ModuleDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 265 /* InterfaceDeclaration */: + case 264 /* ClassDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 267 /* EnumDeclaration */: + case 244 /* VariableStatement */: + case 273 /* ImportDeclaration */: + case 279 /* ExportDeclaration */: + case 278 /* ExportAssignment */: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 180 /* ConstructSignature */: - case 176 /* Constructor */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 173 /* MethodSignature */: - case 179 /* CallSignature */: - case 181 /* IndexSignature */: - case 260 /* VariableDeclaration */: - case 168 /* TypeParameter */: - case 233 /* ExpressionWithTypeArguments */: - case 183 /* TypeReference */: - case 194 /* ConditionalType */: - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 205 /* ImportType */: + case 181 /* ConstructSignature */: + case 177 /* Constructor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 174 /* MethodSignature */: + case 180 /* CallSignature */: + case 182 /* IndexSignature */: + case 261 /* VariableDeclaration */: + case 169 /* TypeParameter */: + case 234 /* ExpressionWithTypeArguments */: + case 184 /* TypeReference */: + case 195 /* ConditionalType */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 206 /* ImportType */: return true; } return false; @@ -119090,6 +120089,7 @@ function getModuleTransformer(moduleKind) { case 5 /* ES2015 */: case 100 /* Node16 */: case 101 /* Node18 */: + case 102 /* Node20 */: case 199 /* NodeNext */: case 1 /* CommonJS */: return transformImpliedNodeFormatDependentModule; @@ -119182,7 +120182,7 @@ function noEmitNotification(hint, node, callback) { } function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) { var _a, _b; - const enabledSyntaxKindFeatures = new Array(358 /* Count */); + const enabledSyntaxKindFeatures = new Array(359 /* Count */); let lexicalEnvironmentVariableDeclarations; let lexicalEnvironmentFunctionDeclarations; let lexicalEnvironmentStatements; @@ -119261,7 +120261,7 @@ function transformNodes(resolver, host, factory2, options, nodes, transformers, state = 1 /* Initialized */; const transformed = []; for (const node of nodes) { - (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Emit, "transformNodes", node.kind === 307 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end }); + (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Emit, "transformNodes", node.kind === 308 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end }); transformed.push((allowDtsFiles ? transformation : transformRoot)(node)); (_b = tracing) == null ? void 0 : _b.pop(); } @@ -119578,7 +120578,7 @@ function getOutputPathsForBundle(options, forceDtsPaths) { } function getOutputPathsFor(sourceFile, host, forceDtsPaths) { const options = host.getCompilerOptions(); - if (sourceFile.kind === 308 /* Bundle */) { + if (sourceFile.kind === 309 /* Bundle */) { return getOutputPathsForBundle(options, forceDtsPaths); } else { const ownOutputFilePath = getOwnEmitOutputFilePath(sourceFile.fileName, host, getOutputExtension(sourceFile.fileName, options)); @@ -119953,8 +120953,8 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform2, printer, mapOptions) { const sourceFileOrBundle = transform2.transformed[0]; - const bundle = sourceFileOrBundle.kind === 308 /* Bundle */ ? sourceFileOrBundle : void 0; - const sourceFile = sourceFileOrBundle.kind === 307 /* SourceFile */ ? sourceFileOrBundle : void 0; + const bundle = sourceFileOrBundle.kind === 309 /* Bundle */ ? sourceFileOrBundle : void 0; + const sourceFile = sourceFileOrBundle.kind === 308 /* SourceFile */ ? sourceFileOrBundle : void 0; const sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; let sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -120013,7 +121013,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla return !data.skippedDtsWrite; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { - return (mapOptions.sourceMap || mapOptions.inlineSourceMap) && (sourceFileOrBundle.kind !== 307 /* SourceFile */ || !fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); + return (mapOptions.sourceMap || mapOptions.inlineSourceMap) && (sourceFileOrBundle.kind !== 308 /* SourceFile */ || !fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); } function getSourceRoot(mapOptions) { const sourceRoot = normalizeSlashes(mapOptions.sourceRoot || ""); @@ -120112,7 +121112,8 @@ var notImplementedResolver = { getDeclarationStatementsForSourceFile: notImplemented, isImportRequiredByAugmentation: notImplemented, isDefinitelyReferenceToGlobalSymbolObject: notImplemented, - createLateBoundIndexSignatures: notImplemented + createLateBoundIndexSignatures: notImplemented, + symbolToDeclarations: notImplemented }; var createPrinterWithDefaults = /* @__PURE__ */ memoize(() => createPrinter({})); var createPrinterWithRemoveComments = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true })); @@ -120204,9 +121205,9 @@ function createPrinter(printerOptions = {}, handlers = {}) { break; } switch (node.kind) { - case 307 /* SourceFile */: + case 308 /* SourceFile */: return printFile(node); - case 308 /* Bundle */: + case 309 /* Bundle */: return printBundle(node); } writeNode(hint, node, sourceFile, beginPrint()); @@ -120484,311 +121485,311 @@ function createPrinter(printerOptions = {}, handlers = {}) { return emitPrivateIdentifier(node); // Parse tree nodes // Names - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: return emitQualifiedName(node); - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: return emitTypeParameter(node); - case 169 /* Parameter */: + case 170 /* Parameter */: return emitParameter(node); - case 170 /* Decorator */: + case 171 /* Decorator */: return emitDecorator(node); // Type members - case 171 /* PropertySignature */: + case 172 /* PropertySignature */: return emitPropertySignature(node); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 173 /* MethodSignature */: + case 174 /* MethodSignature */: return emitMethodSignature(node); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 175 /* ClassStaticBlockDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: return emitClassStaticBlockDeclaration(node); - case 176 /* Constructor */: + case 177 /* Constructor */: return emitConstructor(node); - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return emitAccessorDeclaration(node); - case 179 /* CallSignature */: + case 180 /* CallSignature */: return emitCallSignature(node); - case 180 /* ConstructSignature */: + case 181 /* ConstructSignature */: return emitConstructSignature(node); - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: return emitIndexSignature(node); // Types - case 182 /* TypePredicate */: + case 183 /* TypePredicate */: return emitTypePredicate(node); - case 183 /* TypeReference */: + case 184 /* TypeReference */: return emitTypeReference(node); - case 184 /* FunctionType */: + case 185 /* FunctionType */: return emitFunctionType(node); - case 185 /* ConstructorType */: + case 186 /* ConstructorType */: return emitConstructorType(node); - case 186 /* TypeQuery */: + case 187 /* TypeQuery */: return emitTypeQuery(node); - case 187 /* TypeLiteral */: + case 188 /* TypeLiteral */: return emitTypeLiteral(node); - case 188 /* ArrayType */: + case 189 /* ArrayType */: return emitArrayType(node); - case 189 /* TupleType */: + case 190 /* TupleType */: return emitTupleType(node); - case 190 /* OptionalType */: + case 191 /* OptionalType */: return emitOptionalType(node); // SyntaxKind.RestType is handled below - case 192 /* UnionType */: + case 193 /* UnionType */: return emitUnionType(node); - case 193 /* IntersectionType */: + case 194 /* IntersectionType */: return emitIntersectionType(node); - case 194 /* ConditionalType */: + case 195 /* ConditionalType */: return emitConditionalType(node); - case 195 /* InferType */: + case 196 /* InferType */: return emitInferType(node); - case 196 /* ParenthesizedType */: + case 197 /* ParenthesizedType */: return emitParenthesizedType(node); - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 197 /* ThisType */: + case 198 /* ThisType */: return emitThisType(); - case 198 /* TypeOperator */: + case 199 /* TypeOperator */: return emitTypeOperator(node); - case 199 /* IndexedAccessType */: + case 200 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 200 /* MappedType */: + case 201 /* MappedType */: return emitMappedType(node); - case 201 /* LiteralType */: + case 202 /* LiteralType */: return emitLiteralType(node); - case 202 /* NamedTupleMember */: + case 203 /* NamedTupleMember */: return emitNamedTupleMember(node); - case 203 /* TemplateLiteralType */: + case 204 /* TemplateLiteralType */: return emitTemplateType(node); - case 204 /* TemplateLiteralTypeSpan */: + case 205 /* TemplateLiteralTypeSpan */: return emitTemplateTypeSpan(node); - case 205 /* ImportType */: + case 206 /* ImportType */: return emitImportTypeNode(node); // Binding patterns - case 206 /* ObjectBindingPattern */: + case 207 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 207 /* ArrayBindingPattern */: + case 208 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return emitBindingElement(node); // Misc - case 239 /* TemplateSpan */: + case 240 /* TemplateSpan */: return emitTemplateSpan(node); - case 240 /* SemicolonClassElement */: + case 241 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 241 /* Block */: + case 242 /* Block */: return emitBlock(node); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return emitVariableStatement(node); - case 242 /* EmptyStatement */: + case 243 /* EmptyStatement */: return emitEmptyStatement( /*isEmbeddedStatement*/ false ); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return emitExpressionStatement(node); - case 245 /* IfStatement */: + case 246 /* IfStatement */: return emitIfStatement(node); - case 246 /* DoStatement */: + case 247 /* DoStatement */: return emitDoStatement(node); - case 247 /* WhileStatement */: + case 248 /* WhileStatement */: return emitWhileStatement(node); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return emitForStatement(node); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return emitForInStatement(node); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return emitForOfStatement(node); - case 251 /* ContinueStatement */: + case 252 /* ContinueStatement */: return emitContinueStatement(node); - case 252 /* BreakStatement */: + case 253 /* BreakStatement */: return emitBreakStatement(node); - case 253 /* ReturnStatement */: + case 254 /* ReturnStatement */: return emitReturnStatement(node); - case 254 /* WithStatement */: + case 255 /* WithStatement */: return emitWithStatement(node); - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return emitSwitchStatement(node); - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return emitLabeledStatement(node); - case 257 /* ThrowStatement */: + case 258 /* ThrowStatement */: return emitThrowStatement(node); - case 258 /* TryStatement */: + case 259 /* TryStatement */: return emitTryStatement(node); - case 259 /* DebuggerStatement */: + case 260 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 261 /* VariableDeclarationList */: + case 262 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return emitClassDeclaration(node); - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 265 /* TypeAliasDeclaration */: + case 266 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 268 /* ModuleBlock */: + case 269 /* ModuleBlock */: return emitModuleBlock(node); - case 269 /* CaseBlock */: + case 270 /* CaseBlock */: return emitCaseBlock(node); - case 270 /* NamespaceExportDeclaration */: + case 271 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return emitImportDeclaration(node); - case 273 /* ImportClause */: + case 274 /* ImportClause */: return emitImportClause(node); - case 274 /* NamespaceImport */: + case 275 /* NamespaceImport */: return emitNamespaceImport(node); - case 280 /* NamespaceExport */: + case 281 /* NamespaceExport */: return emitNamespaceExport(node); - case 275 /* NamedImports */: + case 276 /* NamedImports */: return emitNamedImports(node); - case 276 /* ImportSpecifier */: + case 277 /* ImportSpecifier */: return emitImportSpecifier(node); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return emitExportAssignment(node); - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: return emitExportDeclaration(node); - case 279 /* NamedExports */: + case 280 /* NamedExports */: return emitNamedExports(node); - case 281 /* ExportSpecifier */: + case 282 /* ExportSpecifier */: return emitExportSpecifier(node); - case 300 /* ImportAttributes */: + case 301 /* ImportAttributes */: return emitImportAttributes(node); - case 301 /* ImportAttribute */: + case 302 /* ImportAttribute */: return emitImportAttribute(node); - case 282 /* MissingDeclaration */: + case 283 /* MissingDeclaration */: return; // Module references - case 283 /* ExternalModuleReference */: + case 284 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 12 /* JsxText */: return emitJsxText(node); - case 286 /* JsxOpeningElement */: - case 289 /* JsxOpeningFragment */: + case 287 /* JsxOpeningElement */: + case 290 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 287 /* JsxClosingElement */: - case 290 /* JsxClosingFragment */: + case 288 /* JsxClosingElement */: + case 291 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 291 /* JsxAttribute */: + case 292 /* JsxAttribute */: return emitJsxAttribute(node); - case 292 /* JsxAttributes */: + case 293 /* JsxAttributes */: return emitJsxAttributes(node); - case 293 /* JsxSpreadAttribute */: + case 294 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 294 /* JsxExpression */: + case 295 /* JsxExpression */: return emitJsxExpression(node); - case 295 /* JsxNamespacedName */: + case 296 /* JsxNamespacedName */: return emitJsxNamespacedName(node); // Clauses - case 296 /* CaseClause */: + case 297 /* CaseClause */: return emitCaseClause(node); - case 297 /* DefaultClause */: + case 298 /* DefaultClause */: return emitDefaultClause(node); - case 298 /* HeritageClause */: + case 299 /* HeritageClause */: return emitHeritageClause(node); - case 299 /* CatchClause */: + case 300 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 305 /* SpreadAssignment */: + case 306 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 306 /* EnumMember */: + case 307 /* EnumMember */: return emitEnumMember(node); // Top-level nodes - case 307 /* SourceFile */: + case 308 /* SourceFile */: return emitSourceFile(node); - case 308 /* Bundle */: + case 309 /* Bundle */: return Debug.fail("Bundles should be printed using printBundle"); // JSDoc nodes (only used in codefixes currently) - case 309 /* JSDocTypeExpression */: + case 310 /* JSDocTypeExpression */: return emitJSDocTypeExpression(node); - case 310 /* JSDocNameReference */: + case 311 /* JSDocNameReference */: return emitJSDocNameReference(node); - case 312 /* JSDocAllType */: + case 313 /* JSDocAllType */: return writePunctuation("*"); - case 313 /* JSDocUnknownType */: + case 314 /* JSDocUnknownType */: return writePunctuation("?"); - case 314 /* JSDocNullableType */: + case 315 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 315 /* JSDocNonNullableType */: + case 316 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 316 /* JSDocOptionalType */: + case 317 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 317 /* JSDocFunctionType */: + case 318 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 191 /* RestType */: - case 318 /* JSDocVariadicType */: + case 192 /* RestType */: + case 319 /* JSDocVariadicType */: return emitRestOrJSDocVariadicType(node); - case 319 /* JSDocNamepathType */: + case 320 /* JSDocNamepathType */: return; - case 320 /* JSDoc */: + case 321 /* JSDoc */: return emitJSDoc(node); - case 322 /* JSDocTypeLiteral */: + case 323 /* JSDocTypeLiteral */: return emitJSDocTypeLiteral(node); - case 323 /* JSDocSignature */: + case 324 /* JSDocSignature */: return emitJSDocSignature(node); - case 327 /* JSDocTag */: - case 332 /* JSDocClassTag */: - case 337 /* JSDocOverrideTag */: + case 328 /* JSDocTag */: + case 333 /* JSDocClassTag */: + case 338 /* JSDocOverrideTag */: return emitJSDocSimpleTag(node); - case 328 /* JSDocAugmentsTag */: - case 329 /* JSDocImplementsTag */: + case 329 /* JSDocAugmentsTag */: + case 330 /* JSDocImplementsTag */: return emitJSDocHeritageTag(node); - case 330 /* JSDocAuthorTag */: - case 331 /* JSDocDeprecatedTag */: + case 331 /* JSDocAuthorTag */: + case 332 /* JSDocDeprecatedTag */: return; // SyntaxKind.JSDocClassTag (see JSDocTag, above) - case 333 /* JSDocPublicTag */: - case 334 /* JSDocPrivateTag */: - case 335 /* JSDocProtectedTag */: - case 336 /* JSDocReadonlyTag */: + case 334 /* JSDocPublicTag */: + case 335 /* JSDocPrivateTag */: + case 336 /* JSDocProtectedTag */: + case 337 /* JSDocReadonlyTag */: return; - case 338 /* JSDocCallbackTag */: + case 339 /* JSDocCallbackTag */: return emitJSDocCallbackTag(node); - case 339 /* JSDocOverloadTag */: + case 340 /* JSDocOverloadTag */: return emitJSDocOverloadTag(node); // SyntaxKind.JSDocEnumTag (see below) - case 341 /* JSDocParameterTag */: - case 348 /* JSDocPropertyTag */: + case 342 /* JSDocParameterTag */: + case 349 /* JSDocPropertyTag */: return emitJSDocPropertyLikeTag(node); - case 340 /* JSDocEnumTag */: - case 342 /* JSDocReturnTag */: - case 343 /* JSDocThisTag */: - case 344 /* JSDocTypeTag */: - case 349 /* JSDocThrowsTag */: - case 350 /* JSDocSatisfiesTag */: + case 341 /* JSDocEnumTag */: + case 343 /* JSDocReturnTag */: + case 344 /* JSDocThisTag */: + case 345 /* JSDocTypeTag */: + case 350 /* JSDocThrowsTag */: + case 351 /* JSDocSatisfiesTag */: return emitJSDocSimpleTypedTag(node); - case 345 /* JSDocTemplateTag */: + case 346 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); - case 346 /* JSDocTypedefTag */: + case 347 /* JSDocTypedefTag */: return emitJSDocTypedefTag(node); - case 347 /* JSDocSeeTag */: + case 348 /* JSDocSeeTag */: return emitJSDocSeeTag(node); - case 351 /* JSDocImportTag */: + case 352 /* JSDocImportTag */: return emitJSDocImportTag(node); // SyntaxKind.JSDocPropertyTag (see JSDocParameterTag, above) // Transformation nodes - case 353 /* NotEmittedStatement */: - case 354 /* NotEmittedTypeElement */: + case 354 /* NotEmittedStatement */: + case 355 /* NotEmittedTypeElement */: return; } if (isExpression(node)) { @@ -120824,86 +121825,86 @@ function createPrinter(printerOptions = {}, handlers = {}) { case 81 /* PrivateIdentifier */: return emitPrivateIdentifier(node); // Expressions - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return emitCallExpression(node); - case 214 /* NewExpression */: + case 215 /* NewExpression */: return emitNewExpression(node); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 216 /* TypeAssertionExpression */: + case 217 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: return emitFunctionExpression(node); - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return emitArrowFunction(node); - case 220 /* DeleteExpression */: + case 221 /* DeleteExpression */: return emitDeleteExpression(node); - case 221 /* TypeOfExpression */: + case 222 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 222 /* VoidExpression */: + case 223 /* VoidExpression */: return emitVoidExpression(node); - case 223 /* AwaitExpression */: + case 224 /* AwaitExpression */: return emitAwaitExpression(node); - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 225 /* PostfixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return emitBinaryExpression(node); - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return emitConditionalExpression(node); - case 228 /* TemplateExpression */: + case 229 /* TemplateExpression */: return emitTemplateExpression(node); - case 229 /* YieldExpression */: + case 230 /* YieldExpression */: return emitYieldExpression(node); - case 230 /* SpreadElement */: + case 231 /* SpreadElement */: return emitSpreadElement(node); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return emitClassExpression(node); - case 232 /* OmittedExpression */: + case 233 /* OmittedExpression */: return; - case 234 /* AsExpression */: + case 235 /* AsExpression */: return emitAsExpression(node); - case 235 /* NonNullExpression */: + case 236 /* NonNullExpression */: return emitNonNullExpression(node); - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 238 /* SatisfiesExpression */: + case 239 /* SatisfiesExpression */: return emitSatisfiesExpression(node); - case 236 /* MetaProperty */: + case 237 /* MetaProperty */: return emitMetaProperty(node); - case 237 /* SyntheticExpression */: + case 238 /* SyntheticExpression */: return Debug.fail("SyntheticExpression should never be printed."); - case 282 /* MissingDeclaration */: + case 283 /* MissingDeclaration */: return; // JSX - case 284 /* JsxElement */: + case 285 /* JsxElement */: return emitJsxElement(node); - case 285 /* JsxSelfClosingElement */: + case 286 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 288 /* JsxFragment */: + case 289 /* JsxFragment */: return emitJsxFragment(node); // Synthesized list - case 352 /* SyntaxList */: + case 353 /* SyntaxList */: return Debug.fail("SyntaxList should not be printed"); // Transformation nodes - case 353 /* NotEmittedStatement */: + case 354 /* NotEmittedStatement */: return; - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return emitCommaList(node); - case 357 /* SyntheticReferenceExpression */: + case 358 /* SyntheticReferenceExpression */: return Debug.fail("SyntheticReferenceExpression should not be printed"); } } @@ -120927,7 +121928,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } function emitHelpers(node) { let helpersEmitted = false; - const bundle = node.kind === 308 /* Bundle */ ? node : void 0; + const bundle = node.kind === 309 /* Bundle */ ? node : void 0; if (bundle && moduleKind === 0 /* None */) { return; } @@ -121008,7 +122009,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { nonEscapingWrite(`}`); } function emitTabStop(hint, node, snippet) { - Debug.assert(node.kind === 242 /* EmptyStatement */, `A tab stop cannot be attached to a node of kind ${Debug.formatSyntaxKind(node.kind)}.`); + Debug.assert(node.kind === 243 /* EmptyStatement */, `A tab stop cannot be attached to a node of kind ${Debug.formatSyntaxKind(node.kind)}.`); Debug.assert(hint !== 5 /* EmbeddedStatement */, `A tab stop cannot be attached to an embedded statement.`); nonEscapingWrite(`$${snippet.order}`); } @@ -121071,7 +122072,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 317 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 318 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { emitTypeAnnotation(node.type); @@ -121144,7 +122145,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { /*allowDecorators*/ true ); - const token = node.kind === 177 /* GetAccessor */ ? 139 /* GetKeyword */ : 153 /* SetKeyword */; + const token = node.kind === 178 /* GetAccessor */ ? 139 /* GetKeyword */ : 153 /* SetKeyword */; emitTokenWithComment(token, pos, writeKeyword, node); writeSpace(); emit(node.name); @@ -121590,7 +122591,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } function shouldEmitWhitespaceBeforeOperand(node) { const operand = node.operand; - return operand.kind === 224 /* PrefixUnaryExpression */ && (node.operator === 40 /* PlusToken */ && (operand.operator === 40 /* PlusToken */ || operand.operator === 46 /* PlusPlusToken */) || node.operator === 41 /* MinusToken */ && (operand.operator === 41 /* MinusToken */ || operand.operator === 47 /* MinusMinusToken */)); + return operand.kind === 225 /* PrefixUnaryExpression */ && (node.operator === 40 /* PlusToken */ && (operand.operator === 40 /* PlusToken */ || operand.operator === 46 /* PlusPlusToken */) || node.operator === 41 /* MinusToken */ && (operand.operator === 41 /* MinusToken */ || operand.operator === 47 /* MinusMinusToken */)); } function emitPostfixUnaryExpression(node) { emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPostfixUnary); @@ -121845,7 +122846,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { if (node.elseStatement) { writeLineOrSpace(node, node.thenStatement, node.elseStatement); emitTokenWithComment(93 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 245 /* IfStatement */) { + if (node.elseStatement.kind === 246 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } else { @@ -121920,7 +122921,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } function emitForBinding(node) { if (node !== void 0) { - if (node.kind === 261 /* VariableDeclarationList */) { + if (node.kind === 262 /* VariableDeclarationList */) { emit(node); } else { emitExpression(node); @@ -121960,7 +122961,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { pos = writeTokenText(token, writer2, pos); } if (isSimilarNode && contextNode.end !== pos) { - const isJsxExprContext = contextNode.kind === 294 /* JsxExpression */; + const isJsxExprContext = contextNode.kind === 295 /* JsxExpression */; emitTrailingCommentsOfPosition( pos, /*prefixSpace*/ @@ -121996,7 +122997,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { function parenthesizeExpressionForNoAsi(node) { if (!commentsDisabled) { switch (node.kind) { - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: if (willEmitLeadingNewLine(node)) { const parseNode = getParseTreeNode(node); if (parseNode && isParenthesizedExpression(parseNode)) { @@ -122011,45 +123012,45 @@ function createPrinter(printerOptions = {}, handlers = {}) { node, parenthesizeExpressionForNoAsi(node.expression) ); - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return factory.updatePropertyAccessExpression( node, parenthesizeExpressionForNoAsi(node.expression), node.name ); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return factory.updateElementAccessExpression( node, parenthesizeExpressionForNoAsi(node.expression), node.argumentExpression ); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return factory.updateCallExpression( node, parenthesizeExpressionForNoAsi(node.expression), node.typeArguments, node.arguments ); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return factory.updateTaggedTemplateExpression( node, parenthesizeExpressionForNoAsi(node.tag), node.typeArguments, node.template ); - case 225 /* PostfixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return factory.updatePostfixUnaryExpression( node, parenthesizeExpressionForNoAsi(node.operand) ); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return factory.updateBinaryExpression( node, parenthesizeExpressionForNoAsi(node.left), node.operatorToken, node.right ); - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return factory.updateConditionalExpression( node, parenthesizeExpressionForNoAsi(node.condition), @@ -122058,19 +123059,19 @@ function createPrinter(printerOptions = {}, handlers = {}) { node.colonToken, node.whenFalse ); - case 234 /* AsExpression */: + case 235 /* AsExpression */: return factory.updateAsExpression( node, parenthesizeExpressionForNoAsi(node.expression), node.type ); - case 238 /* SatisfiesExpression */: + case 239 /* SatisfiesExpression */: return factory.updateSatisfiesExpression( node, parenthesizeExpressionForNoAsi(node.expression), node.type ); - case 235 /* NonNullExpression */: + case 236 /* NonNullExpression */: return factory.updateNonNullExpression( node, parenthesizeExpressionForNoAsi(node.expression) @@ -122442,8 +123443,8 @@ function createPrinter(printerOptions = {}, handlers = {}) { writeTrailingSemicolon(); } function emitImportClause(node) { - if (node.isTypeOnly) { - emitTokenWithComment(156 /* TypeKeyword */, node.pos, writeKeyword, node); + if (node.phaseModifier !== void 0) { + emitTokenWithComment(node.phaseModifier, node.pos, writeKeyword, node); writeSpace(); } emit(node.name); @@ -122768,7 +123769,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 344 /* JSDocTypeTag */ && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 345 /* JSDocTypeTag */ && !node.comment) { writeSpace(); emit(node.tags[0]); } else { @@ -122827,7 +123828,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 309 /* JSDocTypeExpression */) { + if (tag.typeExpression.kind === 310 /* JSDocTypeExpression */) { emitJSDocTypeExpression(tag.typeExpression); } else { writeSpace(); @@ -122845,7 +123846,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 322 /* JSDocTypeLiteral */) { + if (tag.typeExpression && tag.typeExpression.kind === 323 /* JSDocTypeLiteral */) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -123647,7 +124648,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { return block.statements.length === 0 && (!currentSourceFile || rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile)); } function skipSynthesizedParentheses(node) { - while (node.kind === 217 /* ParenthesizedExpression */ && nodeIsSynthesized(node)) { + while (node.kind === 218 /* ParenthesizedExpression */ && nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -123728,84 +124729,84 @@ function createPrinter(printerOptions = {}, handlers = {}) { function generateNames(node) { if (!node) return; switch (node.kind) { - case 241 /* Block */: + case 242 /* Block */: forEach(node.statements, generateNames); break; - case 256 /* LabeledStatement */: - case 254 /* WithStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: + case 257 /* LabeledStatement */: + case 255 /* WithStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: generateNames(node.statement); break; - case 245 /* IfStatement */: + case 246 /* IfStatement */: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 248 /* ForStatement */: - case 250 /* ForOfStatement */: - case 249 /* ForInStatement */: + case 249 /* ForStatement */: + case 251 /* ForOfStatement */: + case 250 /* ForInStatement */: generateNames(node.initializer); generateNames(node.statement); break; - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: generateNames(node.caseBlock); break; - case 269 /* CaseBlock */: + case 270 /* CaseBlock */: forEach(node.clauses, generateNames); break; - case 296 /* CaseClause */: - case 297 /* DefaultClause */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: forEach(node.statements, generateNames); break; - case 258 /* TryStatement */: + case 259 /* TryStatement */: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 299 /* CatchClause */: + case 300 /* CatchClause */: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: generateNames(node.declarationList); break; - case 261 /* VariableDeclarationList */: + case 262 /* VariableDeclarationList */: forEach(node.declarations, generateNames); break; - case 260 /* VariableDeclaration */: - case 169 /* Parameter */: - case 208 /* BindingElement */: - case 263 /* ClassDeclaration */: + case 261 /* VariableDeclaration */: + case 170 /* Parameter */: + case 209 /* BindingElement */: + case 264 /* ClassDeclaration */: generateNameIfNeeded(node.name); break; - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: generateNameIfNeeded(node.name); if (getEmitFlags(node) & 1048576 /* ReuseTempVariableScope */) { forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 206 /* ObjectBindingPattern */: - case 207 /* ArrayBindingPattern */: + case 207 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: forEach(node.elements, generateNames); break; - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: generateNames(node.importClause); break; - case 273 /* ImportClause */: + case 274 /* ImportClause */: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 274 /* NamespaceImport */: + case 275 /* NamespaceImport */: generateNameIfNeeded(node.name); break; - case 280 /* NamespaceExport */: + case 281 /* NamespaceExport */: generateNameIfNeeded(node.name); break; - case 275 /* NamedImports */: + case 276 /* NamedImports */: forEach(node.elements, generateNames); break; - case 276 /* ImportSpecifier */: + case 277 /* ImportSpecifier */: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -123813,14 +124814,14 @@ function createPrinter(printerOptions = {}, handlers = {}) { function generateMemberNames(node) { if (!node) return; switch (node.kind) { - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: generateNameIfNeeded(node.name); break; } @@ -124099,16 +125100,16 @@ function createPrinter(printerOptions = {}, handlers = {}) { prefix, suffix ); - case 267 /* ModuleDeclaration */: - case 266 /* EnumDeclaration */: + case 268 /* ModuleDeclaration */: + case 267 /* EnumDeclaration */: Debug.assert(!prefix && !suffix && !privateName); return generateNameForModuleOrEnum(node); - case 272 /* ImportDeclaration */: - case 278 /* ExportDeclaration */: + case 273 /* ImportDeclaration */: + case 279 /* ExportDeclaration */: Debug.assert(!prefix && !suffix && !privateName); return generateNameForImportOrExportDeclaration(node); - case 262 /* FunctionDeclaration */: - case 263 /* ClassDeclaration */: { + case 263 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: { Debug.assert(!prefix && !suffix && !privateName); const name = node.name; if (name && !isGeneratedIdentifier(name)) { @@ -124123,17 +125124,17 @@ function createPrinter(printerOptions = {}, handlers = {}) { } return generateNameForExportDefault(); } - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: Debug.assert(!prefix && !suffix && !privateName); return generateNameForExportDefault(); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: Debug.assert(!prefix && !suffix && !privateName); return generateNameForClassExpression(); - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return generateNameForMethodOrAccessor(node, privateName, prefix, suffix); - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: return makeTempVariableName( 0 /* Auto */, /*reservedInNestedScopes*/ @@ -124227,7 +125228,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { emitLeadingComments( pos, /*isEmittedNode*/ - node.kind !== 353 /* NotEmittedStatement */ + node.kind !== 354 /* NotEmittedStatement */ ); } if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) { @@ -124235,7 +125236,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } if (!skipTrailingComments || end >= 0 && (emitFlags & 2048 /* NoTrailingComments */) !== 0) { containerEnd = end; - if (node.kind === 261 /* VariableDeclarationList */) { + if (node.kind === 262 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -124251,7 +125252,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { containerPos = savedContainerPos; containerEnd = savedContainerEnd; declarationListContainerEnd = savedDeclarationListContainerEnd; - if (!skipTrailingComments && node.kind !== 353 /* NotEmittedStatement */) { + if (!skipTrailingComments && node.kind !== 354 /* NotEmittedStatement */) { emitTrailingComments(end); } } @@ -124497,7 +125498,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { const emitFlags = getEmitFlags(node); const sourceMapRange = getSourceMapRange(node); const source = sourceMapRange.source || sourceMapSource; - if (node.kind !== 353 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) { + if (node.kind !== 354 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) { emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos)); } if (emitFlags & 128 /* NoNestedSourceMaps */) { @@ -124510,7 +125511,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { if (emitFlags & 128 /* NoNestedSourceMaps */) { sourceMapsDisabled = false; } - if (node.kind !== 353 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) { + if (node.kind !== 354 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) { emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end); } } @@ -126021,8 +127022,8 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi const filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? /* @__PURE__ */ new Map() : void 0; let resolvedProjectReferences; let projectReferenceRedirects; - let mapFromFileToProjectReferenceRedirects; - let mapFromToProjectReferenceRedirectSource; + let mapSourceFileToResolvedRef; + let mapOutputFileToResolvedRef; const useSourceOfProjectReferenceRedirect = !!((_d = host.useSourceOfProjectReferenceRedirect) == null ? void 0 : _d.call(host)) && !options.disableSourceOfProjectReferenceRedirect; const { onProgramCreateComplete, fileExists, directoryExists } = updateHostForUseSourceOfProjectReferenceRedirect({ compilerHost: host, @@ -126030,7 +127031,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi useSourceOfProjectReferenceRedirect, toPath: toPath3, getResolvedProjectReferences, - getSourceOfProjectReferenceRedirect, + getRedirectFromOutput, forEachResolvedProjectReference: forEachResolvedProjectReference2 }); const readFile = host.readFile.bind(host); @@ -126240,12 +127241,11 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi getConfigFileParsingDiagnostics: getConfigFileParsingDiagnostics2, getProjectReferences, getResolvedProjectReferences, - getProjectReferenceRedirect, - getResolvedProjectReferenceToRedirect, + getRedirectFromSourceFile, getResolvedProjectReferenceByPath, forEachResolvedProjectReference: forEachResolvedProjectReference2, isSourceOfProjectReferenceRedirect, - getRedirectReferenceForResolutionFromSourceOfProject, + getRedirectFromOutput, getCompilerOptionsForFile, getDefaultResolutionModeForFile: getDefaultResolutionModeForFile2, getEmitModuleFormatOfFile: getEmitModuleFormatOfFile2, @@ -126374,23 +127374,14 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi return result; } function getRedirectReferenceForResolution(file) { - const redirect = getResolvedProjectReferenceToRedirect(file.originalFileName); - if (redirect || !isDeclarationFileName(file.originalFileName)) return redirect; - const resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.path); + var _a2, _b2; + const redirect = getRedirectFromSourceFile(file.originalFileName); + if (redirect || !isDeclarationFileName(file.originalFileName)) return redirect == null ? void 0 : redirect.resolvedRef; + const resultFromDts = (_a2 = getRedirectFromOutput(file.path)) == null ? void 0 : _a2.resolvedRef; if (resultFromDts) return resultFromDts; if (!host.realpath || !options.preserveSymlinks || !file.originalFileName.includes(nodeModulesPathPart)) return void 0; const realDeclarationPath = toPath3(host.realpath(file.originalFileName)); - return realDeclarationPath === file.path ? void 0 : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationPath); - } - function getRedirectReferenceForResolutionFromSourceOfProject(filePath) { - const source = getSourceOfProjectReferenceRedirect(filePath); - if (isString(source)) return getResolvedProjectReferenceToRedirect(source); - if (!source) return void 0; - return forEachResolvedProjectReference2((resolvedRef) => { - const out = resolvedRef.commandLine.options.outFile; - if (!out) return void 0; - return toPath3(out) === filePath ? resolvedRef : void 0; - }); + return realDeclarationPath === file.path ? void 0 : (_b2 = getRedirectFromOutput(realDeclarationPath)) == null ? void 0 : _b2.resolvedRef; } function compareDefaultLibFiles(a, b) { return compareValues(getDefaultLibFilePriority(a), getDefaultLibFilePriority(b)); @@ -126762,8 +127753,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi getSourceFileByPath: program.getSourceFileByPath, getSourceFiles: program.getSourceFiles, isSourceFileFromExternalLibrary, - getResolvedProjectReferenceToRedirect, - getProjectReferenceRedirect, + getRedirectFromSourceFile, isSourceOfProjectReferenceRedirect, getSymlinkCache, writeFile: writeFileCallback || writeFile2, @@ -127081,98 +128071,98 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi return diagnostics; function walk(node, parent2) { switch (parent2.kind) { - case 169 /* Parameter */: - case 172 /* PropertyDeclaration */: - case 174 /* MethodDeclaration */: + case 170 /* Parameter */: + case 173 /* PropertyDeclaration */: + case 175 /* MethodDeclaration */: if (parent2.questionToken === node) { diagnostics.push(createDiagnosticForNode2(node, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } // falls through - case 173 /* MethodSignature */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: - case 219 /* ArrowFunction */: - case 260 /* VariableDeclaration */: + case 174 /* MethodSignature */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 220 /* ArrowFunction */: + case 261 /* VariableDeclaration */: if (parent2.type === node) { diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); return "skip"; } } switch (node.kind) { - case 273 /* ImportClause */: + case 274 /* ImportClause */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode2(parent2, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 276 /* ImportSpecifier */: - case 281 /* ExportSpecifier */: + case 277 /* ImportSpecifier */: + case 282 /* ExportSpecifier */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, isImportSpecifier(node) ? "import...type" : "export...type")); return "skip"; } break; - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode2(node, Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode2(node, Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 298 /* HeritageClause */: + case 299 /* HeritageClause */: const heritageClause = node; if (heritageClause.token === 119 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode2(node, Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: const interfaceKeyword = tokenToString(120 /* InterfaceKeyword */); Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: const moduleKeyword = node.flags & 32 /* Namespace */ ? tokenToString(145 /* NamespaceKeyword */) : tokenToString(144 /* ModuleKeyword */); Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 265 /* TypeAliasDeclaration */: + case 266 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 176 /* Constructor */: - case 174 /* MethodDeclaration */: - case 262 /* FunctionDeclaration */: + case 177 /* Constructor */: + case 175 /* MethodDeclaration */: + case 263 /* FunctionDeclaration */: if (!node.body) { diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Signature_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } return; - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: const enumKeyword = Debug.checkDefined(tokenToString(94 /* EnumKeyword */)); diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 235 /* NonNullExpression */: + case 236 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 234 /* AsExpression */: + case 235 /* AsExpression */: diagnostics.push(createDiagnosticForNode2(node.type, Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 238 /* SatisfiesExpression */: + case 239 /* SatisfiesExpression */: diagnostics.push(createDiagnosticForNode2(node.type, Diagnostics.Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 216 /* TypeAssertionExpression */: + case 217 /* TypeAssertionExpression */: Debug.fail(); } } @@ -127207,27 +128197,27 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi } } switch (parent2.kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 174 /* MethodDeclaration */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: - case 219 /* ArrowFunction */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 175 /* MethodDeclaration */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 220 /* ArrowFunction */: if (nodes === parent2.typeParameters) { diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } // falls through - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: if (nodes === parent2.modifiers) { - checkModifiers(parent2.modifiers, parent2.kind === 243 /* VariableStatement */); + checkModifiers(parent2.modifiers, parent2.kind === 244 /* VariableStatement */); return "skip"; } break; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: if (nodes === parent2.modifiers) { for (const modifier of nodes) { if (isModifier(modifier) && modifier.kind !== 126 /* StaticKeyword */ && modifier.kind !== 129 /* AccessorKeyword */) { @@ -127237,18 +128227,18 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi return "skip"; } break; - case 169 /* Parameter */: + case 170 /* Parameter */: if (nodes === parent2.modifiers && some(nodes, isModifier)) { diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 213 /* CallExpression */: - case 214 /* NewExpression */: - case 233 /* ExpressionWithTypeArguments */: - case 285 /* JsxSelfClosingElement */: - case 286 /* JsxOpeningElement */: - case 215 /* TaggedTemplateExpression */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: + case 234 /* ExpressionWithTypeArguments */: + case 286 /* JsxSelfClosingElement */: + case 287 /* JsxOpeningElement */: + case 216 /* TaggedTemplateExpression */: if (nodes === parent2.typeArguments) { diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); return "skip"; @@ -127478,9 +128468,9 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi const sourceFile = getSourceFile2(fileName); if (fail) { if (!sourceFile) { - const redirect = getProjectReferenceRedirect(fileName); - if (redirect) { - fail(Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect, fileName); + const redirect = getRedirectFromSourceFile(fileName); + if (redirect == null ? void 0 : redirect.outputDts) { + fail(Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect.outputDts, fileName); } else { fail(Diagnostics.File_0_not_found, fileName); } @@ -127566,16 +128556,16 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode }; } function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) { - var _a2; + var _a2, _b2; const path = toPath3(fileName); if (useSourceOfProjectReferenceRedirect) { - let source = getSourceOfProjectReferenceRedirect(path); + let source = getRedirectFromOutput(path); if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && fileName.includes(nodeModulesPathPart)) { const realPath2 = toPath3(host.realpath(fileName)); - if (realPath2 !== path) source = getSourceOfProjectReferenceRedirect(realPath2); + if (realPath2 !== path) source = getRedirectFromOutput(realPath2); } - if (source) { - const file2 = isString(source) ? findSourceFile(source, isDefaultLib, ignoreNoDefaultLib, reason, packageId) : void 0; + if (source == null ? void 0 : source.source) { + const file2 = findSourceFile(source.source, isDefaultLib, ignoreNoDefaultLib, reason, packageId); if (file2) addFileToFilesByName( file2, path, @@ -127599,7 +128589,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi const checkedName = file2.fileName; const isRedirect = toPath3(checkedName) !== toPath3(fileName); if (isRedirect) { - fileName = getProjectReferenceRedirect(fileName) || fileName; + fileName = ((_a2 = getRedirectFromSourceFile(fileName)) == null ? void 0 : _a2.outputDts) || fileName; } const checkedAbsolutePath = getNormalizedAbsolutePathWithoutRoot(checkedName, currentDirectory); const inputAbsolutePath = getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory); @@ -127628,14 +128618,13 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi } let redirectedPath; if (!useSourceOfProjectReferenceRedirect) { - const redirectProject = getProjectReferenceRedirectProject(fileName); - if (redirectProject) { - if (redirectProject.commandLine.options.outFile) { + const redirectProject = getRedirectFromSourceFile(fileName); + if (redirectProject == null ? void 0 : redirectProject.outputDts) { + if (redirectProject.resolvedRef.commandLine.options.outFile) { return void 0; } - const redirect = getProjectReferenceOutputName(redirectProject, fileName); - fileName = redirect; - redirectedPath = toPath3(redirect); + fileName = redirectProject.outputDts; + redirectedPath = toPath3(redirectProject.outputDts); } } const sourceFileOptions = getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options); @@ -127679,7 +128668,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi file.path = path; file.resolvedPath = toPath3(fileName); file.originalFileName = originalFileName; - file.packageJsonLocations = ((_a2 = sourceFileOptions.packageJsonLocations) == null ? void 0 : _a2.length) ? sourceFileOptions.packageJsonLocations : void 0; + file.packageJsonLocations = ((_b2 = sourceFileOptions.packageJsonLocations) == null ? void 0 : _b2.length) ? sourceFileOptions.packageJsonLocations : void 0; file.packageJsonScope = sourceFileOptions.packageJsonScope; addFileIncludeReason( file, @@ -127734,59 +128723,17 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi if (file !== void 0) missingFileNames.delete(path); else missingFileNames.set(path, fileName); } - function getProjectReferenceRedirect(fileName) { - const referencedProject = getProjectReferenceRedirectProject(fileName); - return referencedProject && getProjectReferenceOutputName(referencedProject, fileName); - } - function getProjectReferenceRedirectProject(fileName) { - if (!resolvedProjectReferences || !resolvedProjectReferences.length || isDeclarationFileName(fileName) || fileExtensionIs(fileName, ".json" /* Json */)) { - return void 0; - } - return getResolvedProjectReferenceToRedirect(fileName); - } - function getProjectReferenceOutputName(referencedProject, fileName) { - const out = referencedProject.commandLine.options.outFile; - return out ? changeExtension(out, ".d.ts" /* Dts */) : getOutputDeclarationFileName(fileName, referencedProject.commandLine, !host.useCaseSensitiveFileNames()); - } - function getResolvedProjectReferenceToRedirect(fileName) { - if (mapFromFileToProjectReferenceRedirects === void 0) { - mapFromFileToProjectReferenceRedirects = /* @__PURE__ */ new Map(); - forEachResolvedProjectReference2((referencedProject) => { - if (toPath3(options.configFilePath) !== referencedProject.sourceFile.path) { - referencedProject.commandLine.fileNames.forEach((f) => mapFromFileToProjectReferenceRedirects.set(toPath3(f), referencedProject.sourceFile.path)); - } - }); - } - const referencedProjectPath = mapFromFileToProjectReferenceRedirects.get(toPath3(fileName)); - return referencedProjectPath && getResolvedProjectReferenceByPath(referencedProjectPath); + function getRedirectFromSourceFile(fileName) { + return mapSourceFileToResolvedRef == null ? void 0 : mapSourceFileToResolvedRef.get(toPath3(fileName)); } function forEachResolvedProjectReference2(cb) { return forEachResolvedProjectReference(resolvedProjectReferences, cb); } - function getSourceOfProjectReferenceRedirect(path) { - if (!isDeclarationFileName(path)) return void 0; - if (mapFromToProjectReferenceRedirectSource === void 0) { - mapFromToProjectReferenceRedirectSource = /* @__PURE__ */ new Map(); - forEachResolvedProjectReference2((resolvedRef) => { - const out = resolvedRef.commandLine.options.outFile; - if (out) { - const outputDts = changeExtension(out, ".d.ts" /* Dts */); - mapFromToProjectReferenceRedirectSource.set(toPath3(outputDts), true); - } else { - const getCommonSourceDirectory3 = memoize(() => getCommonSourceDirectoryOfConfig(resolvedRef.commandLine, !host.useCaseSensitiveFileNames())); - forEach(resolvedRef.commandLine.fileNames, (fileName) => { - if (!isDeclarationFileName(fileName) && !fileExtensionIs(fileName, ".json" /* Json */)) { - const outputDts = getOutputDeclarationFileName(fileName, resolvedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory3); - mapFromToProjectReferenceRedirectSource.set(toPath3(outputDts), fileName); - } - }); - } - }); - } - return mapFromToProjectReferenceRedirectSource.get(path); + function getRedirectFromOutput(path) { + return mapOutputFileToResolvedRef == null ? void 0 : mapOutputFileToResolvedRef.get(path); } function isSourceOfProjectReferenceRedirect(fileName) { - return useSourceOfProjectReferenceRedirect && !!getResolvedProjectReferenceToRedirect(fileName); + return useSourceOfProjectReferenceRedirect && !!getRedirectFromSourceFile(fileName); } function getResolvedProjectReferenceByPath(projectReferencePath) { if (!projectReferenceRedirects) { @@ -127954,7 +128901,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi continue; } const isFromNodeModulesSearch = resolution.isExternalLibraryImport; - const isJsFile = !resolutionExtensionIsTSOrJson(resolution.extension) && !getProjectReferenceRedirectProject(resolution.resolvedFileName); + const isJsFile = !resolutionExtensionIsTSOrJson(resolution.extension) && !getRedirectFromSourceFile(resolution.resolvedFileName); const isJsFileFromNodeModules = isFromNodeModulesSearch && isJsFile && (!resolution.originalPath || pathContainsNodeModules(resolution.resolvedFileName)); const resolvedFileName = resolution.resolvedFileName; if (isFromNodeModulesSearch) { @@ -128064,6 +129011,30 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi sourceFile.originalFileName = refPath; const resolvedRef = { commandLine, sourceFile }; projectReferenceRedirects.set(sourceFilePath, resolvedRef); + if (options.configFile !== sourceFile) { + mapSourceFileToResolvedRef ?? (mapSourceFileToResolvedRef = /* @__PURE__ */ new Map()); + mapOutputFileToResolvedRef ?? (mapOutputFileToResolvedRef = /* @__PURE__ */ new Map()); + let outDts; + if (commandLine.options.outFile) { + outDts = changeExtension(commandLine.options.outFile, ".d.ts" /* Dts */); + mapOutputFileToResolvedRef == null ? void 0 : mapOutputFileToResolvedRef.set(toPath3(outDts), { resolvedRef }); + } + const getCommonSourceDirectory3 = memoize(() => getCommonSourceDirectoryOfConfig(resolvedRef.commandLine, !host.useCaseSensitiveFileNames())); + commandLine.fileNames.forEach((fileName) => { + if (isDeclarationFileName(fileName)) return; + const path = toPath3(fileName); + let outputDts; + if (!fileExtensionIs(fileName, ".json" /* Json */)) { + if (!commandLine.options.outFile) { + outputDts = getOutputDeclarationFileName(fileName, resolvedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory3); + mapOutputFileToResolvedRef.set(toPath3(outputDts), { resolvedRef, source: fileName }); + } else { + outputDts = outDts; + } + } + mapSourceFileToResolvedRef.set(path, { resolvedRef, outputDts }); + }); + } if (commandLine.projectReferences) { resolvedRef.references = commandLine.projectReferences.map(parseProjectReferenceConfigFile); } @@ -128784,8 +129755,8 @@ function updateHostForUseSourceOfProjectReferenceRedirect(host) { ); } function fileExistsIfProjectReferenceDts(file) { - const source = host.getSourceOfProjectReferenceRedirect(host.toPath(file)); - return source !== void 0 ? isString(source) ? originalFileExists.call(host.compilerHost, source) : true : void 0; + const source = host.getRedirectFromOutput(host.toPath(file)); + return source !== void 0 ? isString(source.source) ? originalFileExists.call(host.compilerHost, source.source) : true : void 0; } function directoryExistsIfProjectReferenceDeclDir(dir) { const dirPath = host.toPath(dir); @@ -128817,7 +129788,7 @@ function updateHostForUseSourceOfProjectReferenceRedirect(host) { } function fileOrDirectoryExistsUsingSource(fileOrDirectory, isFile) { var _a; - const fileOrDirectoryExistsUsingSource2 = isFile ? (file) => fileExistsIfProjectReferenceDts(file) : (dir) => directoryExistsIfProjectReferenceDeclDir(dir); + const fileOrDirectoryExistsUsingSource2 = isFile ? fileExistsIfProjectReferenceDts : directoryExistsIfProjectReferenceDeclDir; const result = fileOrDirectoryExistsUsingSource2(fileOrDirectory); if (result !== void 0) return result; const symlinkCache = host.getSymlinkCache(); @@ -129328,7 +130299,8 @@ var BuilderState; return symbol && getReferencedFilesFromImportedModuleSymbol(symbol); } function getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName) { - return toPath(program.getProjectReferenceRedirect(fileName) || fileName, sourceFileDirectory, getCanonicalFileName); + var _a; + return toPath(((_a = program.getRedirectFromSourceFile(fileName)) == null ? void 0 : _a.outputDts) || fileName, sourceFileDirectory, getCanonicalFileName); } function getReferencedFiles(program, sourceFile, getCanonicalFileName) { let referencedFiles; @@ -131244,7 +132216,7 @@ function canWatchAtTypes(atTypes) { return canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(getDirectoryPath(atTypes)); } function isInDirectoryPath(dirComponents, fileOrDirComponents) { - if (fileOrDirComponents.length < fileOrDirComponents.length) return false; + if (fileOrDirComponents.length < dirComponents.length) return false; for (let i = 0; i < dirComponents.length; i++) { if (fileOrDirComponents[i] !== dirComponents[i]) return false; } @@ -131650,12 +132622,13 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW shouldRetryResolution, logChanges }) { + var _a; const path = resolutionHost.toPath(containingFile); const resolutionsInFile = perFileCache.get(path) || perFileCache.set(path, createModeAwareCache()).get(path); const resolvedModules = []; const hasInvalidatedNonRelativeUnresolvedImport = logChanges && isFileWithInvalidatedNonRelativeUnresolvedImports(path); const program = resolutionHost.getCurrentProgram(); - const oldRedirect = program && program.getResolvedProjectReferenceToRedirect(containingFile); + const oldRedirect = program && ((_a = program.getRedirectFromSourceFile(containingFile)) == null ? void 0 : _a.resolvedRef); const unmatchedRedirects = oldRedirect ? !redirectedReference || redirectedReference.sourceFile.path !== oldRedirect.sourceFile.path : !!redirectedReference; const seenNamesInFile = createModeAwareCache(); for (const entry of entries) { @@ -132553,7 +133526,7 @@ function getMatchedIncludeSpec(program, fileName) { const index = findIndex((_b = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _b.validatedIncludeSpecs, (includeSpec) => { if (isJsonFile && !endsWith(includeSpec, ".json" /* Json */)) return false; const pattern = getPatternFromSpec(includeSpec, basePath, "files"); - return !!pattern && getRegexFromPattern(`(${pattern})$`, useCaseSensitiveFileNames2).test(fileName); + return !!pattern && getRegexFromPattern(`(?:${pattern})$`, useCaseSensitiveFileNames2).test(fileName); }); return index !== -1 ? configFile.configFileSpecs.validatedIncludeSpecsBeforeSubstitution[index] : void 0; } @@ -135901,7 +136874,7 @@ function executeCommandLineWorker(sys2, cb, commandLine) { return sys2.exit(1 /* DiagnosticsPresent_OutputsSkipped */); } if (commandLine.options.init) { - writeConfigFile(sys2, reportDiagnostic, commandLine.options, commandLine.fileNames); + writeConfigFile(sys2, reportDiagnostic, commandLine.options); return sys2.exit(0 /* Success */); } if (commandLine.options.version) { @@ -136540,15 +137513,14 @@ function statisticValue(s) { Debug.assertNever(s.type); } } -function writeConfigFile(sys2, reportDiagnostic, options, fileNames) { +function writeConfigFile(sys2, reportDiagnostic, options) { const currentDirectory = sys2.getCurrentDirectory(); const file = normalizePath(combinePaths(currentDirectory, "tsconfig.json")); if (sys2.fileExists(file)) { reportDiagnostic(createCompilerDiagnostic(Diagnostics.A_tsconfig_json_file_is_already_defined_at_Colon_0, file)); } else { - sys2.writeFile(file, generateTSConfig(options, fileNames, sys2.newLine)); - const output = [sys2.newLine, ...getHeader(sys2, "Created a new tsconfig.json with:")]; - output.push(getCompilerOptionsDiffValue(options, sys2.newLine) + sys2.newLine + sys2.newLine); + sys2.writeFile(file, generateTSConfig(options, sys2.newLine)); + const output = [sys2.newLine, ...getHeader(sys2, "Created a new tsconfig.json")]; output.push(`You can learn more at https://aka.ms/tsconfig` + sys2.newLine); for (const line of output) { sys2.write(line); @@ -136622,13 +137594,13 @@ function createSyntacticTypeNodeBuilder(options, resolver) { function tryVisitSimpleTypeNode(node) { const innerNode = skipTypeParentheses(node); switch (innerNode.kind) { - case 183 /* TypeReference */: + case 184 /* TypeReference */: return tryVisitTypeReference(innerNode); - case 186 /* TypeQuery */: + case 187 /* TypeQuery */: return tryVisitTypeQuery(innerNode); - case 199 /* IndexedAccessType */: + case 200 /* IndexedAccessType */: return tryVisitIndexedAccess(innerNode); - case 198 /* TypeOperator */: + case 199 /* TypeOperator */: const typeOperatorNode = innerNode; if (typeOperatorNode.operator === 143 /* KeyOfKeyword */) { return tryVisitKeyOf(typeOperatorNode); @@ -136700,7 +137672,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { if (isJSDocTypeExpression(node)) { return visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode); } - if (isJSDocAllType(node) || node.kind === 319 /* JSDocNamepathType */) { + if (isJSDocAllType(node) || node.kind === 320 /* JSDocNamepathType */) { return factory.createKeywordTypeNode(133 /* AnyKeyword */); } if (isJSDocUnknownType(node)) { @@ -136829,16 +137801,18 @@ function createSyntacticTypeNodeBuilder(options, resolver) { if (!resolver.canReuseTypeNode(context, node)) { return resolver.serializeExistingTypeNode(context, node); } + const specifier = rewriteModuleSpecifier2(node, node.argument.literal); + const literal = specifier === node.argument.literal ? reuseNode(context, node.argument.literal) : specifier; return factory.updateImportTypeNode( node, - factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier2(node, node.argument.literal)), + literal === node.argument.literal ? reuseNode(context, node.argument) : factory.createLiteralTypeNode(literal), visitNode(node.attributes, visitExistingNodeTreeSymbols, isImportAttributes), visitNode(node.qualifier, visitExistingNodeTreeSymbols, isEntityName), visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode), node.isTypeOf ); } - if (isNamedDeclaration(node) && node.name.kind === 167 /* ComputedPropertyName */ && !resolver.hasLateBindableName(node)) { + if (isNamedDeclaration(node) && node.name.kind === 168 /* ComputedPropertyName */ && !resolver.hasLateBindableName(node)) { if (!hasDynamicName(node)) { return visitEachChild2(node, visitExistingNodeTreeSymbols); } @@ -136986,10 +137960,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { } function rewriteModuleSpecifier2(parent2, lit) { const newName = resolver.getModuleSpecifierOverride(context, parent2, lit); - if (newName) { - return setOriginalNode(factory.createStringLiteral(newName), lit); - } - return visitNode(lit, visitExistingNodeTreeSymbols, isStringLiteral); + return newName ? setOriginalNode(factory.createStringLiteral(newName), lit) : lit; } } } @@ -137059,18 +138030,18 @@ function createSyntacticTypeNodeBuilder(options, resolver) { } function serializeTypeOfDeclaration(node, symbol, context) { switch (node.kind) { - case 169 /* Parameter */: - case 341 /* JSDocParameterTag */: + case 170 /* Parameter */: + case 342 /* JSDocParameterTag */: return typeFromParameter(node, symbol, context); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return typeFromVariable(node, symbol, context); - case 171 /* PropertySignature */: - case 348 /* JSDocPropertyTag */: - case 172 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 349 /* JSDocPropertyTag */: + case 173 /* PropertyDeclaration */: return typeFromProperty(node, symbol, context); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return inferTypeOfDeclaration(node, symbol, context); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return serializeTypeOfExpression( node.expression, context, @@ -137079,12 +138050,12 @@ function createSyntacticTypeNodeBuilder(options, resolver) { /*preserveLiterals*/ true ); - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: - case 226 /* BinaryExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: + case 227 /* BinaryExpression */: return typeFromExpandoProperty(node, symbol, context); - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return typeFromPropertyAssignment(node, symbol, context); default: Debug.assertNever(node, `Node needs to be an inferrable node, found ${Debug.formatSyntaxKind(node.kind)}`); @@ -137096,9 +138067,9 @@ function createSyntacticTypeNodeBuilder(options, resolver) { if (typeAnnotation && resolver.canReuseTypeNodeAnnotation(context, node, typeAnnotation, symbol)) { result = serializeExistingTypeNode(typeAnnotation, context); } - if (!result && node.kind === 303 /* PropertyAssignment */) { + if (!result && node.kind === 304 /* PropertyAssignment */) { const initializer = node.initializer; - const assertionNode = isJSDocTypeAssertion(initializer) ? getJSDocTypeAssertionType(initializer) : initializer.kind === 234 /* AsExpression */ || initializer.kind === 216 /* TypeAssertionExpression */ ? initializer.type : void 0; + const assertionNode = isJSDocTypeAssertion(initializer) ? getJSDocTypeAssertionType(initializer) : initializer.kind === 235 /* AsExpression */ || initializer.kind === 217 /* TypeAssertionExpression */ ? initializer.type : void 0; if (assertionNode && !isConstTypeReference(assertionNode) && resolver.canReuseTypeNodeAnnotation(context, node, assertionNode, symbol)) { result = serializeExistingTypeNode(assertionNode, context); } @@ -137113,22 +138084,22 @@ function createSyntacticTypeNodeBuilder(options, resolver) { } function serializeReturnTypeForSignature(node, symbol, context) { switch (node.kind) { - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return serializeTypeOfAccessor(node, symbol, context); - case 174 /* MethodDeclaration */: - case 262 /* FunctionDeclaration */: - case 180 /* ConstructSignature */: - case 173 /* MethodSignature */: - case 179 /* CallSignature */: - case 176 /* Constructor */: - case 178 /* SetAccessor */: - case 181 /* IndexSignature */: - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 317 /* JSDocFunctionType */: - case 323 /* JSDocSignature */: + case 175 /* MethodDeclaration */: + case 263 /* FunctionDeclaration */: + case 181 /* ConstructSignature */: + case 174 /* MethodSignature */: + case 180 /* CallSignature */: + case 177 /* Constructor */: + case 179 /* SetAccessor */: + case 182 /* IndexSignature */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 318 /* JSDocFunctionType */: + case 324 /* JSDocSignature */: return createReturnFromSignature(node, symbol, context); default: Debug.assertNever(node, `Node needs to be an inferrable node, found ${Debug.formatSyntaxKind(node.kind)}`); @@ -137136,7 +138107,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 177 /* GetAccessor */ ? isInJSFile(accessor) && getJSDocType(accessor) || getEffectiveReturnTypeNode(accessor) : getEffectiveSetAccessorTypeAnnotationNode(accessor); + return accessor.kind === 178 /* GetAccessor */ ? isInJSFile(accessor) && getJSDocType(accessor) || getEffectiveReturnTypeNode(accessor) : getEffectiveSetAccessorTypeAnnotationNode(accessor); } } function getTypeAnnotationFromAllAccessorDeclarations(node, accessors) { @@ -137156,12 +138127,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { return withNewScope(context, node, () => serializeTypeAnnotationOfDeclaration(accessorType, context, node, symbol) ?? inferTypeOfDeclaration(node, symbol, context)); } if (accessorDeclarations.getAccessor) { - return withNewScope(context, accessorDeclarations.getAccessor, () => createReturnFromSignature( - accessorDeclarations.getAccessor, - /*symbol*/ - void 0, - context - )); + return withNewScope(context, accessorDeclarations.getAccessor, () => createReturnFromSignature(accessorDeclarations.getAccessor, symbol, context)); } return void 0; } @@ -137188,7 +138154,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { } function typeFromParameter(node, symbol, context) { const parent2 = node.parent; - if (parent2.kind === 178 /* SetAccessor */) { + if (parent2.kind === 179 /* SetAccessor */) { return serializeTypeOfAccessor( parent2, /*symbol*/ @@ -137271,17 +138237,17 @@ function createSyntacticTypeNodeBuilder(options, resolver) { } return resolver.serializeTypeOfExpression(context, node) ?? factory.createKeywordTypeNode(133 /* AnyKeyword */); } - function inferReturnTypeOfSignatureSignature(node, context, reportFallback) { + function inferReturnTypeOfSignatureSignature(node, context, symbol, reportFallback) { if (reportFallback) { context.tracker.reportInferenceFallback(node); } if (context.noInferenceFallback === true) { return factory.createKeywordTypeNode(133 /* AnyKeyword */); } - return resolver.serializeReturnTypeForSignature(context, node) ?? factory.createKeywordTypeNode(133 /* AnyKeyword */); + return resolver.serializeReturnTypeForSignature(context, node, symbol) ?? factory.createKeywordTypeNode(133 /* AnyKeyword */); } function inferAccessorType(node, allAccessors, context, symbol, reportFallback = true) { - if (node.kind === 177 /* GetAccessor */) { + if (node.kind === 178 /* GetAccessor */) { return createReturnFromSignature(node, symbol, context, reportFallback); } else { if (reportFallback) { @@ -137311,7 +138277,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { } function typeFromExpression(node, context, isConstContext = false, requiresAddingUndefined = false, preserveLiterals = false) { switch (node.kind) { - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: if (isJSDocTypeAssertion(node)) { return typeFromTypeAssertion(node.expression, getJSDocTypeAssertionType(node), context, requiresAddingUndefined); } @@ -137327,15 +138293,15 @@ function createSyntacticTypeNodeBuilder(options, resolver) { } else { return syntacticResult(factory.createKeywordTypeNode(133 /* AnyKeyword */)); } - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: Debug.type(node); return withNewScope(context, node, () => typeFromFunctionLikeExpression(node, context)); - case 216 /* TypeAssertionExpression */: - case 234 /* AsExpression */: + case 217 /* TypeAssertionExpression */: + case 235 /* AsExpression */: const asExpression = node; return typeFromTypeAssertion(asExpression.expression, asExpression.type, context, requiresAddingUndefined); - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: const unaryExpression = node; if (isPrimitiveLiteralValue(unaryExpression)) { return typeFromPrimitiveLiteral( @@ -137347,11 +138313,11 @@ function createSyntacticTypeNodeBuilder(options, resolver) { ); } break; - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return typeFromArrayLiteral(node, context, isConstContext, requiresAddingUndefined); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return typeFromObjectLiteral(node, context, isConstContext, requiresAddingUndefined); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return syntacticResult(inferExpressionType( node, context, @@ -137359,7 +138325,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { true, requiresAddingUndefined )); - case 228 /* TemplateExpression */: + case 229 /* TemplateExpression */: if (!isConstContext && !preserveLiterals) { return syntacticResult(factory.createKeywordTypeNode(154 /* StringKeyword */)); } @@ -137415,7 +138381,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { return false; } for (const element of arrayLiteral.elements) { - if (element.kind === 230 /* SpreadElement */) { + if (element.kind === 231 /* SpreadElement */) { context.tracker.reportInferenceFallback(element); return false; } @@ -137439,8 +138405,8 @@ function createSyntacticTypeNodeBuilder(options, resolver) { context.noInferenceFallback = true; const elementTypesInfo = []; for (const element of arrayLiteral.elements) { - Debug.assert(element.kind !== 230 /* SpreadElement */); - if (element.kind === 232 /* OmittedExpression */) { + Debug.assert(element.kind !== 231 /* SpreadElement */); + if (element.kind === 233 /* OmittedExpression */) { elementTypesInfo.push( createUndefinedTypeNode() ); @@ -137462,7 +138428,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { result = false; break; } - if (prop.kind === 304 /* ShorthandPropertyAssignment */ || prop.kind === 305 /* SpreadAssignment */) { + if (prop.kind === 305 /* ShorthandPropertyAssignment */ || prop.kind === 306 /* SpreadAssignment */) { context.tracker.reportInferenceFallback(prop); result = false; } else if (prop.name.flags & 262144 /* ThisNodeHasError */) { @@ -137470,7 +138436,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { break; } else if (prop.name.kind === 81 /* PrivateIdentifier */) { result = false; - } else if (prop.name.kind === 167 /* ComputedPropertyName */) { + } else if (prop.name.kind === 168 /* ComputedPropertyName */) { const expression = prop.name.expression; if (!isPrimitiveLiteralValue( expression, @@ -137507,14 +138473,14 @@ function createSyntacticTypeNodeBuilder(options, resolver) { const name = prop.name; let newProp; switch (prop.kind) { - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: newProp = withNewScope(context, prop, () => typeFromObjectLiteralMethod(prop, name, context, isConstContext)); break; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: newProp = typeFromObjectLiteralPropertyAssignment(prop, name, context, isConstContext); break; - case 178 /* SetAccessor */: - case 177 /* GetAccessor */: + case 179 /* SetAccessor */: + case 178 /* GetAccessor */: newProp = typeFromObjectLiteralAccessor(prop, name, context); break; } @@ -137552,7 +138518,8 @@ function createSyntacticTypeNodeBuilder(options, resolver) { function ensureParameter(p, context) { return factory.updateParameterDeclaration( p, - [], + /*modifiers*/ + void 0, reuseNode(context, p.dotDotDotToken), resolver.serializeNameOfParameter(context, p), resolver.isOptionalParameter(p) ? factory.createToken(58 /* QuestionToken */) : void 0, @@ -137568,18 +138535,17 @@ function createSyntacticTypeNodeBuilder(options, resolver) { ); } function reuseTypeParameters(typeParameters, context) { - return typeParameters == null ? void 0 : typeParameters.map( - (tp) => { - var _a; - return factory.updateTypeParameterDeclaration( - tp, - (_a = tp.modifiers) == null ? void 0 : _a.map((m) => reuseNode(context, m)), - reuseNode(context, tp.name), - serializeExistingTypeNodeWithFallback(tp.constraint, context), - serializeExistingTypeNodeWithFallback(tp.default, context) - ); - } - ); + return typeParameters == null ? void 0 : typeParameters.map((tp) => { + var _a; + const { node: tpName } = resolver.trackExistingEntityName(context, tp.name); + return factory.updateTypeParameterDeclaration( + tp, + (_a = tp.modifiers) == null ? void 0 : _a.map((m) => reuseNode(context, m)), + tpName, + serializeExistingTypeNodeWithFallback(tp.constraint, context), + serializeExistingTypeNodeWithFallback(tp.default, context) + ); + }); } function typeFromObjectLiteralMethod(method, name, context, isConstContext) { const returnType = createReturnFromSignature( @@ -137672,7 +138638,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { function typeFromPrimitiveLiteral(node, baseType, context, preserveLiterals, requiresAddingUndefined) { let result; if (preserveLiterals) { - if (node.kind === 224 /* PrefixUnaryExpression */ && node.operator === 40 /* PlusToken */) { + if (node.kind === 225 /* PrefixUnaryExpression */ && node.operator === 40 /* PlusToken */) { result = factory.createLiteralTypeNode(reuseNode(context, node.operand)); } result = factory.createLiteralTypeNode(reuseNode(context, node)); @@ -137695,13 +138661,13 @@ function createSyntacticTypeNodeBuilder(options, resolver) { } function canAddUndefined(node) { if (!strictNullChecks) return true; - if (isKeyword(node.kind) || node.kind === 201 /* LiteralType */ || node.kind === 184 /* FunctionType */ || node.kind === 185 /* ConstructorType */ || node.kind === 188 /* ArrayType */ || node.kind === 189 /* TupleType */ || node.kind === 187 /* TypeLiteral */ || node.kind === 203 /* TemplateLiteralType */ || node.kind === 197 /* ThisType */) { + if (isKeyword(node.kind) || node.kind === 202 /* LiteralType */ || node.kind === 185 /* FunctionType */ || node.kind === 186 /* ConstructorType */ || node.kind === 189 /* ArrayType */ || node.kind === 190 /* TupleType */ || node.kind === 188 /* TypeLiteral */ || node.kind === 204 /* TemplateLiteralType */ || node.kind === 198 /* ThisType */) { return true; } - if (node.kind === 196 /* ParenthesizedType */) { + if (node.kind === 197 /* ParenthesizedType */) { return canAddUndefined(node.type); } - if (node.kind === 192 /* UnionType */ || node.kind === 193 /* IntersectionType */) { + if (node.kind === 193 /* UnionType */ || node.kind === 194 /* IntersectionType */) { return node.types.every(canAddUndefined); } return false; @@ -137714,7 +138680,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { } else if (isValueSignatureDeclaration(fn)) { returnType = typeFromSingleReturnExpression(fn, context); } - return returnType.type !== void 0 ? returnType.type : inferReturnTypeOfSignatureSignature(fn, context, reportFallback && returnType.reportFallback && !returnTypeNode); + return returnType.type !== void 0 ? returnType.type : inferReturnTypeOfSignatureSignature(fn, context, symbol, reportFallback && returnType.reportFallback && !returnTypeNode); } function typeFromSingleReturnExpression(declaration, context) { let candidateExpr; @@ -138380,36 +139346,36 @@ var SemanticMeaning = /* @__PURE__ */ ((SemanticMeaning2) => { })(SemanticMeaning || {}); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return isInJSFile(node) && getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */; - case 169 /* Parameter */: - case 208 /* BindingElement */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 299 /* CatchClause */: - case 291 /* JsxAttribute */: + case 170 /* Parameter */: + case 209 /* BindingElement */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 300 /* CatchClause */: + case 292 /* JsxAttribute */: return 1 /* Value */; - case 168 /* TypeParameter */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 187 /* TypeLiteral */: + case 169 /* TypeParameter */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 188 /* TypeLiteral */: return 2 /* Type */; - case 346 /* JSDocTypedefTag */: + case 347 /* JSDocTypedefTag */: return node.name === void 0 ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 306 /* EnumMember */: - case 263 /* ClassDeclaration */: + case 307 /* EnumMember */: + case 264 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: if (isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } else if (getModuleInstanceState(node) === 1 /* Instantiated */) { @@ -138417,16 +139383,16 @@ function getMeaningFromDeclaration(node) { } else { return 4 /* Namespace */; } - case 266 /* EnumDeclaration */: - case 275 /* NamedImports */: - case 276 /* ImportSpecifier */: - case 271 /* ImportEqualsDeclaration */: - case 272 /* ImportDeclaration */: - case 277 /* ExportAssignment */: - case 278 /* ExportDeclaration */: + case 267 /* EnumDeclaration */: + case 276 /* NamedImports */: + case 277 /* ImportSpecifier */: + case 272 /* ImportEqualsDeclaration */: + case 273 /* ImportDeclaration */: + case 278 /* ExportAssignment */: + case 279 /* ExportDeclaration */: return 7 /* All */; // An external module can be a Value - case 307 /* SourceFile */: + case 308 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; @@ -138434,7 +139400,7 @@ function getMeaningFromDeclaration(node) { function getMeaningFromLocation(node) { node = getAdjustedReferenceLocation(node); const parent2 = node.parent; - if (node.kind === 307 /* SourceFile */) { + if (node.kind === 308 /* SourceFile */) { return 1 /* Value */; } else if (isExportAssignment(parent2) || isExportSpecifier(parent2) || isExternalModuleReference(parent2) || isImportSpecifier(parent2) || isImportClause(parent2) || isImportEqualsDeclaration(parent2) && node === parent2.name) { return 7 /* All */; @@ -138458,11 +139424,14 @@ function getMeaningFromLocation(node) { } } function getMeaningFromRightHandSideOfImportEquals(node) { - const name = node.kind === 166 /* QualifiedName */ ? node : isQualifiedName(node.parent) && node.parent.right === node ? node.parent : void 0; - return name && name.parent.kind === 271 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; + const name = node.kind === 167 /* QualifiedName */ ? node : isQualifiedName(node.parent) && node.parent.right === node ? node.parent : void 0; + return name && name.parent.kind === 272 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 166 /* QualifiedName */) { + if (!node.parent) { + return false; + } + while (node.parent.kind === 167 /* QualifiedName */) { node = node.parent; } return isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -138473,26 +139442,26 @@ function isNamespaceReference(node) { function isQualifiedNameNamespaceReference(node) { let root = node; let isLastClause = true; - if (root.parent.kind === 166 /* QualifiedName */) { - while (root.parent && root.parent.kind === 166 /* QualifiedName */) { + if (root.parent.kind === 167 /* QualifiedName */) { + while (root.parent && root.parent.kind === 167 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 183 /* TypeReference */ && !isLastClause; + return root.parent.kind === 184 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { let root = node; let isLastClause = true; - if (root.parent.kind === 211 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 211 /* PropertyAccessExpression */) { + if (root.parent.kind === 212 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 212 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 233 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 298 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 234 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 299 /* HeritageClause */) { const decl = root.parent.parent.parent; - return decl.kind === 263 /* ClassDeclaration */ && root.parent.parent.token === 119 /* ImplementsKeyword */ || decl.kind === 264 /* InterfaceDeclaration */ && root.parent.parent.token === 96 /* ExtendsKeyword */; + return decl.kind === 264 /* ClassDeclaration */ && root.parent.parent.token === 119 /* ImplementsKeyword */ || decl.kind === 265 /* InterfaceDeclaration */ && root.parent.parent.token === 96 /* ExtendsKeyword */; } return false; } @@ -138503,15 +139472,15 @@ function isTypeReference(node) { switch (node.kind) { case 110 /* ThisKeyword */: return !isExpressionNode(node); - case 197 /* ThisType */: + case 198 /* ThisType */: return true; } switch (node.parent.kind) { - case 183 /* TypeReference */: + case 184 /* TypeReference */: return true; - case 205 /* ImportType */: + case 206 /* ImportType */: return !node.parent.isTypeOf; - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return isPartOfTypeNode(node.parent); } return false; @@ -138558,7 +139527,7 @@ function climbPastPropertyOrElementAccess(node) { } function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 256 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 257 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -138608,22 +139577,22 @@ function isNameOfFunctionDeclaration(node) { } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 303 /* PropertyAssignment */: - case 306 /* EnumMember */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 267 /* ModuleDeclaration */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 304 /* PropertyAssignment */: + case 307 /* EnumMember */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 268 /* ModuleDeclaration */: return getNameOfDeclaration(node.parent) === node; - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: return true; - case 201 /* LiteralType */: - return node.parent.parent.kind === 199 /* IndexedAccessType */; + case 202 /* LiteralType */: + return node.parent.parent.kind === 200 /* IndexedAccessType */; default: return false; } @@ -138641,83 +139610,83 @@ function getContainerNode(node) { return void 0; } switch (node.kind) { - case 307 /* SourceFile */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: - case 267 /* ModuleDeclaration */: + case 308 /* SourceFile */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: + case 268 /* ModuleDeclaration */: return node; } } } function getNodeKind(node) { switch (node.kind) { - case 307 /* SourceFile */: + case 308 /* SourceFile */: return isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: return "class" /* classElement */; - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 265 /* TypeAliasDeclaration */: - case 338 /* JSDocCallbackTag */: - case 346 /* JSDocTypedefTag */: + case 266 /* TypeAliasDeclaration */: + case 339 /* JSDocCallbackTag */: + case 347 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: return "enum" /* enumElement */; - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return getKindOfVariableDeclaration(getRootDeclaration(node)); - case 219 /* ArrowFunction */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: return "function" /* functionElement */; - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: const { initializer } = node; return isFunctionLike(initializer) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */; - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 304 /* ShorthandPropertyAssignment */: - case 305 /* SpreadAssignment */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 305 /* ShorthandPropertyAssignment */: + case 306 /* SpreadAssignment */: return "property" /* memberVariableElement */; - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 180 /* ConstructSignature */: + case 181 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 179 /* CallSignature */: + case 180 /* CallSignature */: return "call" /* callSignatureElement */; - case 176 /* Constructor */: - case 175 /* ClassStaticBlockDeclaration */: + case 177 /* Constructor */: + case 176 /* ClassStaticBlockDeclaration */: return "constructor" /* constructorImplementationElement */; - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 306 /* EnumMember */: + case 307 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 169 /* Parameter */: + case 170 /* Parameter */: return hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 271 /* ImportEqualsDeclaration */: - case 276 /* ImportSpecifier */: - case 281 /* ExportSpecifier */: - case 274 /* NamespaceImport */: - case 280 /* NamespaceExport */: + case 272 /* ImportEqualsDeclaration */: + case 277 /* ImportSpecifier */: + case 282 /* ExportSpecifier */: + case 275 /* NamespaceImport */: + case 281 /* NamespaceExport */: return "alias" /* alias */; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: const kind = getAssignmentDeclarationKind(node); const { right } = node; switch (kind) { @@ -138746,7 +139715,7 @@ function getNodeKind(node) { } case 80 /* Identifier */: return isImportClause(node.parent) ? "alias" /* alias */ : "" /* unknown */; - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: const scriptKind = getNodeKind(node.expression); return scriptKind === "" /* unknown */ ? "const" /* constElement */ : scriptKind; default: @@ -138761,7 +139730,7 @@ function isThis(node) { case 110 /* ThisKeyword */: return true; case 80 /* Identifier */: - return identifierIsThisKeyword(node) && node.parent.kind === 169 /* Parameter */; + return identifierIsThisKeyword(node) && node.parent.kind === 170 /* Parameter */; default: return false; } @@ -138804,42 +139773,42 @@ function isCompletedNode(n, sourceFile) { return false; } switch (n.kind) { - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: - case 210 /* ObjectLiteralExpression */: - case 206 /* ObjectBindingPattern */: - case 187 /* TypeLiteral */: - case 241 /* Block */: - case 268 /* ModuleBlock */: - case 269 /* CaseBlock */: - case 275 /* NamedImports */: - case 279 /* NamedExports */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: + case 211 /* ObjectLiteralExpression */: + case 207 /* ObjectBindingPattern */: + case 188 /* TypeLiteral */: + case 242 /* Block */: + case 269 /* ModuleBlock */: + case 270 /* CaseBlock */: + case 276 /* NamedImports */: + case 280 /* NamedExports */: return nodeEndsWith(n, 20 /* CloseBraceToken */, sourceFile); - case 299 /* CatchClause */: + case 300 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 214 /* NewExpression */: + case 215 /* NewExpression */: if (!n.arguments) { return true; } // falls through - case 213 /* CallExpression */: - case 217 /* ParenthesizedExpression */: - case 196 /* ParenthesizedType */: + case 214 /* CallExpression */: + case 218 /* ParenthesizedExpression */: + case 197 /* ParenthesizedType */: return nodeEndsWith(n, 22 /* CloseParenToken */, sourceFile); - case 184 /* FunctionType */: - case 185 /* ConstructorType */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 180 /* ConstructSignature */: - case 179 /* CallSignature */: - case 219 /* ArrowFunction */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 181 /* ConstructSignature */: + case 180 /* CallSignature */: + case 220 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -138847,60 +139816,60 @@ function isCompletedNode(n, sourceFile) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 22 /* CloseParenToken */, sourceFile); - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return !!n.body && isCompletedNode(n.body, sourceFile); - case 245 /* IfStatement */: + case 246 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 27 /* SemicolonToken */, sourceFile); - case 209 /* ArrayLiteralExpression */: - case 207 /* ArrayBindingPattern */: - case 212 /* ElementAccessExpression */: - case 167 /* ComputedPropertyName */: - case 189 /* TupleType */: + case 210 /* ArrayLiteralExpression */: + case 208 /* ArrayBindingPattern */: + case 213 /* ElementAccessExpression */: + case 168 /* ComputedPropertyName */: + case 190 /* TupleType */: return nodeEndsWith(n, 24 /* CloseBracketToken */, sourceFile); - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 24 /* CloseBracketToken */, sourceFile); - case 296 /* CaseClause */: - case 297 /* DefaultClause */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: return false; - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 247 /* WhileStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 248 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 246 /* DoStatement */: + case 247 /* DoStatement */: return hasChildOfKind(n, 117 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 22 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile); - case 186 /* TypeQuery */: + case 187 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 221 /* TypeOfExpression */: - case 220 /* DeleteExpression */: - case 222 /* VoidExpression */: - case 229 /* YieldExpression */: - case 230 /* SpreadElement */: + case 222 /* TypeOfExpression */: + case 221 /* DeleteExpression */: + case 223 /* VoidExpression */: + case 230 /* YieldExpression */: + case 231 /* SpreadElement */: const unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 228 /* TemplateExpression */: + case 229 /* TemplateExpression */: const lastSpan = lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 239 /* TemplateSpan */: + case 240 /* TemplateSpan */: return nodeIsPresent(n.literal); - case 278 /* ExportDeclaration */: - case 272 /* ImportDeclaration */: + case 279 /* ExportDeclaration */: + case 273 /* ImportDeclaration */: return nodeIsPresent(n.moduleSpecifier); - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -138996,13 +139965,13 @@ function getContextualTypeFromParentOrAncestorTypeNode(node, checker) { function getAdjustedLocationForDeclaration(node, forRename) { if (!forRename) { switch (node.kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: return getAdjustedLocationForClass(node); - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: return getAdjustedLocationForFunction(node); - case 176 /* Constructor */: + case 177 /* Constructor */: return node; } } @@ -139344,7 +140313,7 @@ function findPrecedingToken(position, sourceFile, startNode2, excludeJsdoc) { } } } - Debug.assert(startNode2 !== void 0 || n.kind === 307 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || isJSDocCommentContainingNode(n)); + Debug.assert(startNode2 !== void 0 || n.kind === 308 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || isJSDocCommentContainingNode(n)); const candidate = findRightmostChildNodeWithTokens( children, /*exclusiveStartPosition*/ @@ -139379,7 +140348,7 @@ function findRightmostChildNodeWithTokens(children, exclusiveStartPosition, sour for (let i = exclusiveStartPosition - 1; i >= 0; i--) { const child = children[i]; if (isWhiteSpaceOnlyJsxText(child)) { - if (i === 0 && (parentKind === 12 /* JsxText */ || parentKind === 285 /* JsxSelfClosingElement */)) { + if (i === 0 && (parentKind === 12 /* JsxText */ || parentKind === 286 /* JsxSelfClosingElement */)) { Debug.fail("`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); } } else if (nodeHasTokens(children[i], sourceFile)) { @@ -139411,13 +140380,13 @@ function isInsideJsxElementOrAttribute(sourceFile, position) { if (token.kind === 30 /* LessThanToken */ && token.parent.kind === 12 /* JsxText */) { return true; } - if (token.kind === 30 /* LessThanToken */ && token.parent.kind === 294 /* JsxExpression */) { + if (token.kind === 30 /* LessThanToken */ && token.parent.kind === 295 /* JsxExpression */) { return true; } - if (token && token.kind === 20 /* CloseBraceToken */ && token.parent.kind === 294 /* JsxExpression */) { + if (token && token.kind === 20 /* CloseBraceToken */ && token.parent.kind === 295 /* JsxExpression */) { return true; } - if (token.kind === 30 /* LessThanToken */ && token.parent.kind === 287 /* JsxClosingElement */) { + if (token.kind === 31 /* LessThanSlashToken */ && token.parent.kind === 288 /* JsxClosingElement */) { return true; } return false; @@ -139445,9 +140414,9 @@ function isInJSXText(sourceFile, position) { function isInsideJsxElement(sourceFile, position) { function isInsideJsxElementTraversal(node) { while (node) { - if (node.kind >= 285 /* JsxSelfClosingElement */ && node.kind <= 294 /* JsxExpression */ || node.kind === 12 /* JsxText */ || node.kind === 30 /* LessThanToken */ || node.kind === 32 /* GreaterThanToken */ || node.kind === 80 /* Identifier */ || node.kind === 20 /* CloseBraceToken */ || node.kind === 19 /* OpenBraceToken */ || node.kind === 44 /* SlashToken */) { + if (node.kind >= 286 /* JsxSelfClosingElement */ && node.kind <= 295 /* JsxExpression */ || node.kind === 12 /* JsxText */ || node.kind === 30 /* LessThanToken */ || node.kind === 32 /* GreaterThanToken */ || node.kind === 80 /* Identifier */ || node.kind === 20 /* CloseBraceToken */ || node.kind === 19 /* OpenBraceToken */ || node.kind === 44 /* SlashToken */ || node.kind === 31 /* LessThanSlashToken */) { node = node.parent; - } else if (node.kind === 284 /* JsxElement */) { + } else if (node.kind === 285 /* JsxElement */) { if (position > node.getStart(sourceFile)) return true; node = node.parent; } else { @@ -139609,14 +140578,14 @@ function getNodeModifiers(node, excludeFlags = 0 /* None */) { if (flags & 32 /* Export */) result.push("export" /* exportedModifier */); if (flags & 65536 /* Deprecated */) result.push("deprecated" /* deprecatedModifier */); if (node.flags & 33554432 /* Ambient */) result.push("declare" /* ambientModifier */); - if (node.kind === 277 /* ExportAssignment */) result.push("export" /* exportedModifier */); + if (node.kind === 278 /* ExportAssignment */) result.push("export" /* exportedModifier */); return result.length > 0 ? result.join(",") : "" /* none */; } function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 183 /* TypeReference */ || node.kind === 213 /* CallExpression */) { + if (node.kind === 184 /* TypeReference */ || node.kind === 214 /* CallExpression */) { return node.typeArguments; } - if (isFunctionLike(node) || node.kind === 263 /* ClassDeclaration */ || node.kind === 264 /* InterfaceDeclaration */) { + if (isFunctionLike(node) || node.kind === 264 /* ClassDeclaration */ || node.kind === 265 /* InterfaceDeclaration */) { return node.typeParameters; } return void 0; @@ -139658,14 +140627,14 @@ function cloneCompilerOptions(options) { return result; } function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 209 /* ArrayLiteralExpression */ || node.kind === 210 /* ObjectLiteralExpression */) { - if (node.parent.kind === 226 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 64 /* EqualsToken */) { + if (node.kind === 210 /* ArrayLiteralExpression */ || node.kind === 211 /* ObjectLiteralExpression */) { + if (node.parent.kind === 227 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 64 /* EqualsToken */) { return true; } - if (node.parent.kind === 250 /* ForOfStatement */ && node.parent.initializer === node) { + if (node.parent.kind === 251 /* ForOfStatement */ && node.parent.initializer === node) { return true; } - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 303 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 304 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -139784,7 +140753,7 @@ function skipConstraint(type) { return type.isTypeParameter() ? type.getConstraint() || type : type; } function getNameFromPropertyName(name) { - return name.kind === 167 /* ComputedPropertyName */ ? isStringOrNumericLiteralLike(name.expression) ? name.expression.text : void 0 : isPrivateIdentifier(name) ? idText(name) : getTextOfIdentifierOrLiteral(name); + return name.kind === 168 /* ComputedPropertyName */ ? isStringOrNumericLiteralLike(name.expression) ? name.expression.text : void 0 : isPrivateIdentifier(name) ? idText(name) : getTextOfIdentifierOrLiteral(name); } function programContainsModules(program) { return program.getSourceFiles().some((s) => !s.isDeclarationFile && !program.isSourceFileFromExternalLibrary(s) && !!(s.externalModuleIndicator || s.commonJsModuleIndicator)); @@ -139809,7 +140778,7 @@ function createModuleSpecifierResolutionHost(program, host) { }, getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation), redirectTargetsMap: program.redirectTargetsMap, - getProjectReferenceRedirect: (fileName) => program.getProjectReferenceRedirect(fileName), + getRedirectFromSourceFile: (fileName) => program.getRedirectFromSourceFile(fileName), isSourceOfProjectReferenceRedirect: (fileName) => program.isSourceOfProjectReferenceRedirect(fileName), getNearestAncestorDirectoryWithPackageJson: maybeBind(host, host.getNearestAncestorDirectoryWithPackageJson), getFileIncludeReasons: () => program.getFileIncludeReasons(), @@ -139831,7 +140800,7 @@ function makeImport(defaultImport, namedImports, moduleSpecifier, quotePreferenc return factory.createImportDeclaration( /*modifiers*/ void 0, - defaultImport || namedImports ? factory.createImportClause(!!isTypeOnly, defaultImport, namedImports && namedImports.length ? factory.createNamedImports(namedImports) : void 0) : void 0, + defaultImport || namedImports ? factory.createImportClause(isTypeOnly ? 156 /* TypeKeyword */ : void 0, defaultImport, namedImports && namedImports.length ? factory.createNamedImports(namedImports) : void 0) : void 0, typeof moduleSpecifier === "string" ? makeStringLiteral(moduleSpecifier, quotePreference) : moduleSpecifier, /*attributes*/ void 0 @@ -139911,7 +140880,7 @@ function findModifier(node, kind) { function insertImports(changes, sourceFile, imports, blankLineBetween, preferences) { var _a; const decl = isArray(imports) ? imports[0] : imports; - const importKindPredicate = decl.kind === 243 /* VariableStatement */ ? isRequireVariableStatement : isAnyImportSyntax; + const importKindPredicate = decl.kind === 244 /* VariableStatement */ ? isRequireVariableStatement : isAnyImportSyntax; const existingImportStatements = filter(sourceFile.statements, importKindPredicate); const { comparer, isSorted } = ts_OrganizeImports_exports.getOrganizeImportsStringComparerWithDetection(existingImportStatements, preferences); const sortedNewImports = isArray(imports) ? toSorted(imports, (a, b) => ts_OrganizeImports_exports.compareImportsOrRequireStatements(a, b, comparer)) : [imports]; @@ -140026,9 +140995,16 @@ function isFirstDeclarationOfSymbolParameter(symbol) { const declaration = symbol.declarations ? firstOrUndefined(symbol.declarations) : void 0; return !!findAncestor(declaration, (n) => isParameter(n) ? true : isBindingElement(n) || isObjectBindingPattern(n) || isArrayBindingPattern(n) ? false : "quit"); } -var displayPartWriter = getDisplayPartWriter(); -function getDisplayPartWriter() { - const absoluteMaximumLength = defaultMaximumTruncationLength * 10; +var displayPartWriterCache = /* @__PURE__ */ new Map(); +function getDisplayPartWriter(maximumLength) { + maximumLength = maximumLength || defaultMaximumTruncationLength; + if (!displayPartWriterCache.has(maximumLength)) { + displayPartWriterCache.set(maximumLength, getDisplayPartWriterWorker(maximumLength)); + } + return displayPartWriterCache.get(maximumLength); +} +function getDisplayPartWriterWorker(maximumLength) { + const absoluteMaximumLength = maximumLength * 10; let displayParts; let lineStart; let indent3; @@ -140246,7 +141222,8 @@ function getNewLineOrDefaultFromHost(host, formatSettings) { function lineBreakPart() { return displayPart("\n", 6 /* lineBreak */); } -function mapToDisplayParts(writeDisplayParts) { +function mapToDisplayParts(writeDisplayParts, maximumLength) { + const displayPartWriter = getDisplayPartWriter(maximumLength); try { writeDisplayParts(displayPartWriter); return displayPartWriter.displayParts(); @@ -140254,17 +141231,17 @@ function mapToDisplayParts(writeDisplayParts) { displayPartWriter.clear(); } } -function typeToDisplayParts(typechecker, type, enclosingDeclaration, flags = 0 /* None */) { +function typeToDisplayParts(typechecker, type, enclosingDeclaration, flags = 0 /* None */, maximumLength, verbosityLevel, out) { return mapToDisplayParts((writer) => { - typechecker.writeType(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer); - }); + typechecker.writeType(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer, maximumLength, verbosityLevel, out); + }, maximumLength); } function symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration, meaning, flags = 0 /* None */) { return mapToDisplayParts((writer) => { typeChecker.writeSymbol(symbol, enclosingDeclaration, meaning, flags | 8 /* UseAliasDefinedOutsideCurrentScope */, writer); }); } -function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, flags = 0 /* None */) { +function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, flags = 0 /* None */, maximumLength, verbosityLevel, out) { flags |= 16384 /* UseAliasDefinedOutsideCurrentScope */ | 1024 /* MultilineObjectLiterals */ | 32 /* WriteTypeArgumentsOfSignature */ | 8192 /* OmitParameterModifiers */; return mapToDisplayParts((writer) => { typechecker.writeSignature( @@ -140273,9 +141250,12 @@ function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, f flags, /*kind*/ void 0, - writer + writer, + maximumLength, + verbosityLevel, + out ); - }); + }, maximumLength); } function isImportOrExportSpecifierName(location) { return !!location.parent && isImportOrExportSpecifier(location.parent) && location.parent.propertyName === location; @@ -140312,74 +141292,6 @@ function getPrecedingNonSpaceCharacterPosition(text, position) { } return position + 1; } -function getSynthesizedDeepClone(node, includeTrivia = true) { - const clone2 = node && getSynthesizedDeepCloneWorker(node); - if (clone2 && !includeTrivia) suppressLeadingAndTrailingTrivia(clone2); - return setParentRecursive( - clone2, - /*incremental*/ - false - ); -} -function getSynthesizedDeepCloneWithReplacements(node, includeTrivia, replaceNode) { - let clone2 = replaceNode(node); - if (clone2) { - setOriginalNode(clone2, node); - } else { - clone2 = getSynthesizedDeepCloneWorker(node, replaceNode); - } - if (clone2 && !includeTrivia) suppressLeadingAndTrailingTrivia(clone2); - return clone2; -} -function getSynthesizedDeepCloneWorker(node, replaceNode) { - const nodeClone = replaceNode ? (n) => getSynthesizedDeepCloneWithReplacements( - n, - /*includeTrivia*/ - true, - replaceNode - ) : getSynthesizedDeepClone; - const nodesClone = replaceNode ? (ns) => ns && getSynthesizedDeepClonesWithReplacements( - ns, - /*includeTrivia*/ - true, - replaceNode - ) : (ns) => ns && getSynthesizedDeepClones(ns); - const visited = visitEachChild( - node, - nodeClone, - /*context*/ - void 0, - nodesClone, - nodeClone - ); - if (visited === node) { - const clone2 = isStringLiteral(node) ? setOriginalNode(factory.createStringLiteralFromNode(node), node) : isNumericLiteral(node) ? setOriginalNode(factory.createNumericLiteral(node.text, node.numericLiteralFlags), node) : factory.cloneNode(node); - return setTextRange(clone2, node); - } - visited.parent = void 0; - return visited; -} -function getSynthesizedDeepClones(nodes, includeTrivia = true) { - if (nodes) { - const cloned = factory.createNodeArray(nodes.map((n) => getSynthesizedDeepClone(n, includeTrivia)), nodes.hasTrailingComma); - setTextRange(cloned, nodes); - return cloned; - } - return nodes; -} -function getSynthesizedDeepClonesWithReplacements(nodes, includeTrivia, replaceNode) { - return factory.createNodeArray(nodes.map((n) => getSynthesizedDeepCloneWithReplacements(n, includeTrivia, replaceNode)), nodes.hasTrailingComma); -} -function suppressLeadingAndTrailingTrivia(node) { - suppressLeadingTrivia(node); - suppressTrailingTrivia(node); -} -function suppressLeadingTrivia(node) { - addEmitFlagsRecursively(node, 1024 /* NoLeadingComments */, getFirstChild); -} -function suppressTrailingTrivia(node) { - addEmitFlagsRecursively(node, 2048 /* NoTrailingComments */, getLastChild); -} function copyComments(sourceNode, targetNode) { const sourceFile = sourceNode.getSourceFile(); const text = sourceFile.text; @@ -140398,14 +141310,6 @@ function hasLeadingLineBreak(node, text) { } return false; } -function addEmitFlagsRecursively(node, flag, getChild) { - addEmitFlags(node, flag); - const child = getChild(node); - if (child) addEmitFlagsRecursively(child, flag, getChild); -} -function getFirstChild(node) { - return node.forEachChild((child) => child); -} function getUniqueName(baseName, sourceFile) { let nameText = baseName; for (let i = 1; !isFileLevelUniqueName(sourceFile, nameText); i++) { @@ -140467,13 +141371,13 @@ function needsParentheses(expression) { function getContextualTypeFromParent(node, checker, contextFlags) { const parent2 = walkUpParenthesizedExpressions(node.parent); switch (parent2.kind) { - case 214 /* NewExpression */: + case 215 /* NewExpression */: return checker.getContextualType(parent2, contextFlags); - case 226 /* BinaryExpression */: { + case 227 /* BinaryExpression */: { const { left, operatorToken, right } = parent2; return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node, contextFlags); } - case 296 /* CaseClause */: + case 297 /* CaseClause */: return getSwitchedType(parent2, checker); default: return checker.getContextualType(node, contextFlags); @@ -140499,8 +141403,8 @@ function isStringLiteralOrTemplate(node) { switch (node.kind) { case 11 /* StringLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: - case 228 /* TemplateExpression */: - case 215 /* TaggedTemplateExpression */: + case 229 /* TemplateExpression */: + case 216 /* TaggedTemplateExpression */: return true; default: return false; @@ -140536,16 +141440,16 @@ function getTypeNodeIfAccessible(type, enclosingScope, program, host) { return typeIsAccessible ? res : void 0; } function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) { - return kind === 179 /* CallSignature */ || kind === 180 /* ConstructSignature */ || kind === 181 /* IndexSignature */ || kind === 171 /* PropertySignature */ || kind === 173 /* MethodSignature */; + return kind === 180 /* CallSignature */ || kind === 181 /* ConstructSignature */ || kind === 182 /* IndexSignature */ || kind === 172 /* PropertySignature */ || kind === 174 /* MethodSignature */; } function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) { - return kind === 262 /* FunctionDeclaration */ || kind === 176 /* Constructor */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */; + return kind === 263 /* FunctionDeclaration */ || kind === 177 /* Constructor */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */; } function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) { - return kind === 267 /* ModuleDeclaration */; + return kind === 268 /* ModuleDeclaration */; } function syntaxRequiresTrailingSemicolonOrASI(kind) { - return kind === 243 /* VariableStatement */ || kind === 244 /* ExpressionStatement */ || kind === 246 /* DoStatement */ || kind === 251 /* ContinueStatement */ || kind === 252 /* BreakStatement */ || kind === 253 /* ReturnStatement */ || kind === 257 /* ThrowStatement */ || kind === 259 /* DebuggerStatement */ || kind === 172 /* PropertyDeclaration */ || kind === 265 /* TypeAliasDeclaration */ || kind === 272 /* ImportDeclaration */ || kind === 271 /* ImportEqualsDeclaration */ || kind === 278 /* ExportDeclaration */ || kind === 270 /* NamespaceExportDeclaration */ || kind === 277 /* ExportAssignment */; + return kind === 244 /* VariableStatement */ || kind === 245 /* ExpressionStatement */ || kind === 247 /* DoStatement */ || kind === 252 /* ContinueStatement */ || kind === 253 /* BreakStatement */ || kind === 254 /* ReturnStatement */ || kind === 258 /* ThrowStatement */ || kind === 260 /* DebuggerStatement */ || kind === 173 /* PropertyDeclaration */ || kind === 266 /* TypeAliasDeclaration */ || kind === 273 /* ImportDeclaration */ || kind === 272 /* ImportEqualsDeclaration */ || kind === 279 /* ExportDeclaration */ || kind === 271 /* NamespaceExportDeclaration */ || kind === 278 /* ExportAssignment */; } var syntaxMayBeASICandidate = or( syntaxRequiresTrailingCommaOrSemicolonOrASI, @@ -140575,7 +141479,7 @@ function nodeIsASICandidate(node, sourceFile) { } else if (!syntaxRequiresTrailingSemicolonOrASI(node.kind)) { return false; } - if (node.kind === 246 /* DoStatement */) { + if (node.kind === 247 /* DoStatement */) { return true; } const topNode = findAncestor(node, (ancestor) => !ancestor.parent); @@ -141133,10 +142037,10 @@ function fileShouldUseJavaScriptRequire(file, program, host, preferRequire) { } function isBlockLike(node) { switch (node.kind) { - case 241 /* Block */: - case 307 /* SourceFile */: - case 268 /* ModuleBlock */: - case 296 /* CaseClause */: + case 242 /* Block */: + case 308 /* SourceFile */: + case 269 /* ModuleBlock */: + case 297 /* CaseClause */: return true; default: return false; @@ -141995,13 +142899,13 @@ function getSemanticClassifications(typeChecker, cancellationToken, sourceFile, } function checkForClassificationCancellation(cancellationToken, kind) { switch (kind) { - case 267 /* ModuleDeclaration */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 262 /* FunctionDeclaration */: - case 231 /* ClassExpression */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 268 /* ModuleDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 263 /* FunctionDeclaration */: + case 232 /* ClassExpression */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -142217,49 +143121,49 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span) pos = tag.tagName.end; let commentStart = tag.tagName.end; switch (tag.kind) { - case 341 /* JSDocParameterTag */: + case 342 /* JSDocParameterTag */: const param = tag; processJSDocParameterTag(param); commentStart = param.isNameFirst && ((_a = param.typeExpression) == null ? void 0 : _a.end) || param.name.end; break; - case 348 /* JSDocPropertyTag */: + case 349 /* JSDocPropertyTag */: const prop = tag; commentStart = prop.isNameFirst && ((_b = prop.typeExpression) == null ? void 0 : _b.end) || prop.name.end; break; - case 345 /* JSDocTemplateTag */: + case 346 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); pos = tag.end; commentStart = tag.typeParameters.end; break; - case 346 /* JSDocTypedefTag */: + case 347 /* JSDocTypedefTag */: const type = tag; - commentStart = ((_c = type.typeExpression) == null ? void 0 : _c.kind) === 309 /* JSDocTypeExpression */ && ((_d = type.fullName) == null ? void 0 : _d.end) || ((_e = type.typeExpression) == null ? void 0 : _e.end) || commentStart; + commentStart = ((_c = type.typeExpression) == null ? void 0 : _c.kind) === 310 /* JSDocTypeExpression */ && ((_d = type.fullName) == null ? void 0 : _d.end) || ((_e = type.typeExpression) == null ? void 0 : _e.end) || commentStart; break; - case 338 /* JSDocCallbackTag */: + case 339 /* JSDocCallbackTag */: commentStart = tag.typeExpression.end; break; - case 344 /* JSDocTypeTag */: + case 345 /* JSDocTypeTag */: processElement(tag.typeExpression); pos = tag.end; commentStart = tag.typeExpression.end; break; - case 343 /* JSDocThisTag */: - case 340 /* JSDocEnumTag */: + case 344 /* JSDocThisTag */: + case 341 /* JSDocEnumTag */: commentStart = tag.typeExpression.end; break; - case 342 /* JSDocReturnTag */: + case 343 /* JSDocReturnTag */: processElement(tag.typeExpression); pos = tag.end; commentStart = ((_f = tag.typeExpression) == null ? void 0 : _f.end) || commentStart; break; - case 347 /* JSDocSeeTag */: + case 348 /* JSDocSeeTag */: commentStart = ((_g = tag.name) == null ? void 0 : _g.end) || commentStart; break; - case 328 /* JSDocAugmentsTag */: - case 329 /* JSDocImplementsTag */: + case 329 /* JSDocAugmentsTag */: + case 330 /* JSDocImplementsTag */: commentStart = tag.class.end; break; - case 349 /* JSDocThrowsTag */: + case 350 /* JSDocThrowsTag */: processElement(tag.typeExpression); pos = tag.end; commentStart = ((_h = tag.typeExpression) == null ? void 0 : _h.end) || commentStart; @@ -142404,22 +143308,22 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span) } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 286 /* JsxOpeningElement */: + case 287 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 287 /* JsxClosingElement */: + case 288 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 285 /* JsxSelfClosingElement */: + case 286 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 291 /* JsxAttribute */: + case 292 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -142440,11 +143344,11 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span) if (token) { const parent2 = token.parent; if (tokenKind === 64 /* EqualsToken */) { - if (parent2.kind === 260 /* VariableDeclaration */ || parent2.kind === 172 /* PropertyDeclaration */ || parent2.kind === 169 /* Parameter */ || parent2.kind === 291 /* JsxAttribute */) { + if (parent2.kind === 261 /* VariableDeclaration */ || parent2.kind === 173 /* PropertyDeclaration */ || parent2.kind === 170 /* Parameter */ || parent2.kind === 292 /* JsxAttribute */) { return 5 /* operator */; } } - if (parent2.kind === 226 /* BinaryExpression */ || parent2.kind === 224 /* PrefixUnaryExpression */ || parent2.kind === 225 /* PostfixUnaryExpression */ || parent2.kind === 227 /* ConditionalExpression */) { + if (parent2.kind === 227 /* BinaryExpression */ || parent2.kind === 225 /* PrefixUnaryExpression */ || parent2.kind === 226 /* PostfixUnaryExpression */ || parent2.kind === 228 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -142454,7 +143358,7 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span) } else if (tokenKind === 10 /* BigIntLiteral */) { return 25 /* bigintLiteral */; } else if (tokenKind === 11 /* StringLiteral */) { - return token && token.parent.kind === 291 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token && token.parent.kind === 292 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 14 /* RegularExpressionLiteral */) { return 6 /* stringLiteral */; } else if (isTemplateLiteralKind(tokenKind)) { @@ -142464,32 +143368,32 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span) } else if (tokenKind === 80 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 169 /* Parameter */: + case 170 /* Parameter */: if (token.parent.name === token) { return isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -142648,7 +143552,7 @@ var DocumentHighlights; let child = throwStatement; while (child.parent) { const parent2 = child.parent; - if (isFunctionBlock(parent2) || parent2.kind === 307 /* SourceFile */) { + if (isFunctionBlock(parent2) || parent2.kind === 308 /* SourceFile */) { return parent2; } if (isTryStatement(parent2) && parent2.tryBlock === child && parent2.catchClause) { @@ -142678,16 +143582,16 @@ var DocumentHighlights; function getBreakOrContinueOwner(statement) { return findAncestor(statement, (node) => { switch (node.kind) { - case 255 /* SwitchStatement */: - if (statement.kind === 251 /* ContinueStatement */) { + case 256 /* SwitchStatement */: + if (statement.kind === 252 /* ContinueStatement */) { return false; } // falls through - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 247 /* WhileStatement */: - case 246 /* DoStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 248 /* WhileStatement */: + case 247 /* DoStatement */: return !statement.label || isLabeledBy(node, statement.label.escapedText); default: return isFunctionLike(node) && "quit"; @@ -142700,24 +143604,24 @@ var DocumentHighlights; function getNodesToSearchForModifier(declaration, modifierFlag) { const container = declaration.parent; switch (container.kind) { - case 268 /* ModuleBlock */: - case 307 /* SourceFile */: - case 241 /* Block */: - case 296 /* CaseClause */: - case 297 /* DefaultClause */: + case 269 /* ModuleBlock */: + case 308 /* SourceFile */: + case 242 /* Block */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: if (modifierFlag & 64 /* Abstract */ && isClassDeclaration(declaration)) { return [...declaration.members, declaration]; } else { return container.statements; } - case 176 /* Constructor */: - case 174 /* MethodDeclaration */: - case 262 /* FunctionDeclaration */: + case 177 /* Constructor */: + case 175 /* MethodDeclaration */: + case 263 /* FunctionDeclaration */: return [...container.parameters, ...isClassLike(container.parent) ? container.parent.members : []]; - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 187 /* TypeLiteral */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 188 /* TypeLiteral */: const nodes = container.members; if (modifierFlag & (7 /* AccessibilityModifier */ | 8 /* Readonly */)) { const constructor = find(container.members, isConstructorDeclaration); @@ -142743,7 +143647,7 @@ var DocumentHighlights; function getLoopBreakContinueOccurrences(loopNode) { const keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 99 /* ForKeyword */, 117 /* WhileKeyword */, 92 /* DoKeyword */)) { - if (loopNode.kind === 246 /* DoStatement */) { + if (loopNode.kind === 247 /* DoStatement */) { const loopTokens = loopNode.getChildren(); for (let i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 117 /* WhileKeyword */)) { @@ -142763,13 +143667,13 @@ var DocumentHighlights; const owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -144165,6 +145069,7 @@ function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) { if (getAllowSyntheticDefaultImports(program.getCompilerOptions())) { for (const moduleSpecifier of sourceFile.imports) { const importNode = importFromModuleSpecifier(moduleSpecifier); + if (isImportEqualsDeclaration(importNode) && hasSyntacticModifier(importNode, 32 /* Export */)) continue; const name = importNameForConvertToDefaultImport(importNode); if (!name) continue; const module2 = (_a = program.getResolvedModuleFromModuleSpecifier(moduleSpecifier, sourceFile)) == null ? void 0 : _a.resolvedModule; @@ -144211,13 +145116,13 @@ function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) { function containsTopLevelCommonjs(sourceFile) { return sourceFile.statements.some((statement) => { switch (statement.kind) { - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return statement.declarationList.declarations.some((decl) => !!decl.initializer && isRequireCall( propertyAccessLeftHandSide(decl.initializer), /*requireStringLiteralLikeArgument*/ true )); - case 244 /* ExpressionStatement */: { + case 245 /* ExpressionStatement */: { const { expression } = statement; if (!isBinaryExpression(expression)) return isRequireCall( expression, @@ -144237,10 +145142,10 @@ function propertyAccessLeftHandSide(node) { } function importNameForConvertToDefaultImport(node) { switch (node.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: const { importClause, moduleSpecifier } = node; - return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 274 /* NamespaceImport */ && isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : void 0; - case 271 /* ImportEqualsDeclaration */: + return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 275 /* NamespaceImport */ && isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : void 0; + case 272 /* ImportEqualsDeclaration */: return node.name; default: return void 0; @@ -144302,20 +145207,20 @@ function hasSupportedNumberOfArguments(node) { } function isFixablePromiseArgument(arg, checker) { switch (arg.kind) { - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: const functionFlags = getFunctionFlags(arg); if (functionFlags & 1 /* Generator */) { return false; } // falls through - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); // falls through case 106 /* NullKeyword */: return true; case 80 /* Identifier */: - case 211 /* PropertyAccessExpression */: { + case 212 /* PropertyAccessExpression */: { const symbol = checker.getSymbolAtLocation(arg); if (!symbol) { return false; @@ -144349,10 +145254,10 @@ function canBeConvertedToClass(node, checker) { } function canBeConvertedToAsync(node) { switch (node.kind) { - case 262 /* FunctionDeclaration */: - case 174 /* MethodDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return true; default: return false; @@ -144587,9 +145492,9 @@ function getItemsFromNamedDeclaration(patternMatcher, name, declarations, checke function shouldKeepItem(declaration, checker, excludeLibFiles, singleCurrentFile) { var _a; switch (declaration.kind) { - case 273 /* ImportClause */: - case 276 /* ImportSpecifier */: - case 271 /* ImportEqualsDeclaration */: + case 274 /* ImportClause */: + case 277 /* ImportSpecifier */: + case 272 /* ImportEqualsDeclaration */: const importer = checker.getSymbolAtLocation(declaration.name); const imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName && !((_a = imported.declarations) == null ? void 0 : _a.every((d) => shouldExcludeFile(d.getSourceFile(), excludeLibFiles, singleCurrentFile))); @@ -144599,7 +145504,7 @@ function shouldKeepItem(declaration, checker, excludeLibFiles, singleCurrentFile } function tryAddSingleDeclarationName(declaration, containers) { const name = getNameOfDeclaration(declaration); - return !!name && (pushLiteral(name, containers) || name.kind === 167 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); + return !!name && (pushLiteral(name, containers) || name.kind === 168 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); } function tryAddComputedPropertyName(expression, containers) { return pushLiteral(expression, containers) || isPropertyAccessExpression(expression) && (containers.push(expression.name.text), true) && tryAddComputedPropertyName(expression.expression, containers); @@ -144610,7 +145515,7 @@ function pushLiteral(node, containers) { function getContainers(declaration) { const containers = []; const name = getNameOfDeclaration(declaration); - if (name && name.kind === 167 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { + if (name && name.kind === 168 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { return emptyArray; } containers.shift(); @@ -144794,7 +145699,7 @@ function addChildrenRecursively(node) { return; } switch (node.kind) { - case 176 /* Constructor */: + case 177 /* Constructor */: const ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); for (const param of ctr.parameters) { @@ -144803,32 +145708,32 @@ function addChildrenRecursively(node) { } } break; - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 173 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 174 /* MethodSignature */: if (hasNavigationBarName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: if (hasNavigationBarName(node)) { addNodeWithRecursiveInitializer(node); } break; - case 171 /* PropertySignature */: + case 172 /* PropertySignature */: if (hasNavigationBarName(node)) { addLeafNode(node); } break; - case 273 /* ImportClause */: + case 274 /* ImportClause */: const importClause = node; if (importClause.name) { addLeafNode(importClause.name); } const { namedBindings } = importClause; if (namedBindings) { - if (namedBindings.kind === 274 /* NamespaceImport */) { + if (namedBindings.kind === 275 /* NamespaceImport */) { addLeafNode(namedBindings); } else { for (const element of namedBindings.elements) { @@ -144837,16 +145742,16 @@ function addChildrenRecursively(node) { } } break; - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: addNodeWithRecursiveChild(node, node.name); break; - case 305 /* SpreadAssignment */: + case 306 /* SpreadAssignment */: const { expression } = node; isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node); break; - case 208 /* BindingElement */: - case 303 /* PropertyAssignment */: - case 260 /* VariableDeclaration */: { + case 209 /* BindingElement */: + case 304 /* PropertyAssignment */: + case 261 /* VariableDeclaration */: { const child = node; if (isBindingPattern(child.name)) { addChildrenRecursively(child.name); @@ -144855,18 +145760,18 @@ function addChildrenRecursively(node) { } break; } - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: const nameNode = node.name; if (nameNode && isIdentifier(nameNode)) { addTrackedEs5Class(nameNode.text); } addNodeWithRecursiveChild(node, node.body); break; - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: startNode(node); for (const member of node.members) { if (!isComputedProperty(member)) { @@ -144875,19 +145780,19 @@ function addChildrenRecursively(node) { } endNode(); break; - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: startNode(node); for (const member of node.members) { addChildrenRecursively(member); } endNode(); break; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 277 /* ExportAssignment */: { + case 278 /* ExportAssignment */: { const expression2 = node.expression; const child = isObjectLiteralExpression(expression2) || isCallExpression(expression2) ? expression2 : isArrowFunction(expression2) || isFunctionExpression(expression2) ? expression2.body : void 0; if (child) { @@ -144899,16 +145804,16 @@ function addChildrenRecursively(node) { } break; } - case 281 /* ExportSpecifier */: - case 271 /* ImportEqualsDeclaration */: - case 181 /* IndexSignature */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 265 /* TypeAliasDeclaration */: + case 282 /* ExportSpecifier */: + case 272 /* ImportEqualsDeclaration */: + case 182 /* IndexSignature */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 266 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 213 /* CallExpression */: - case 226 /* BinaryExpression */: { + case 214 /* CallExpression */: + case 227 /* BinaryExpression */: { const special = getAssignmentDeclarationKind(node); switch (special) { case 1 /* ExportsProperty */: @@ -145132,12 +146037,12 @@ function shouldReallyMerge(a, b, parent2) { return false; } switch (a.kind) { - case 172 /* PropertyDeclaration */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 173 /* PropertyDeclaration */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return isStatic(a) === isStatic(b); - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return areSameModule(a, b) && getFullyQualifiedModuleName(a) === getFullyQualifiedModuleName(b); default: return true; @@ -145155,7 +146060,7 @@ function areSameModule(a, b) { if (!a.body || !b.body) { return a.body === b.body; } - return a.body.kind === b.body.kind && (a.body.kind !== 267 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 268 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } function merge(target, source) { target.additionalNodes = target.additionalNodes || []; @@ -145176,7 +146081,7 @@ function compareChildren(child1, child2) { return compareStringsCaseSensitiveUI(tryGetName(child1.node), tryGetName(child2.node)) || compareValues(navigationBarNodeKind(child1), navigationBarNodeKind(child2)); } function tryGetName(node) { - if (node.kind === 267 /* ModuleDeclaration */) { + if (node.kind === 268 /* ModuleDeclaration */) { return getModuleName(node); } const declName = getNameOfDeclaration(node); @@ -145185,16 +146090,16 @@ function tryGetName(node) { return propertyName && unescapeLeadingUnderscores(propertyName); } switch (node.kind) { - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 231 /* ClassExpression */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 232 /* ClassExpression */: return getFunctionOrClassName(node); default: return void 0; } } function getItemName(node, name) { - if (node.kind === 267 /* ModuleDeclaration */) { + if (node.kind === 268 /* ModuleDeclaration */) { return cleanText(getModuleName(node)); } if (name) { @@ -145204,27 +146109,27 @@ function getItemName(node, name) { } } switch (node.kind) { - case 307 /* SourceFile */: + case 308 /* SourceFile */: const sourceFile = node; return isExternalModule(sourceFile) ? `"${escapeString(getBaseFileName(removeFileExtension(normalizePath(sourceFile.fileName))))}"` : ""; - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; - case 219 /* ArrowFunction */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 220 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: if (getSyntacticModifierFlags(node) & 2048 /* Default */) { return "default"; } return getFunctionOrClassName(node); - case 176 /* Constructor */: + case 177 /* Constructor */: return "constructor"; - case 180 /* ConstructSignature */: + case 181 /* ConstructSignature */: return "new()"; - case 179 /* CallSignature */: + case 180 /* CallSignature */: return "()"; - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: return "[]"; default: return ""; @@ -145249,19 +146154,19 @@ function primaryNavBarMenuItems(root) { return true; } switch (navigationBarNodeKind(item)) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 266 /* EnumDeclaration */: - case 264 /* InterfaceDeclaration */: - case 267 /* ModuleDeclaration */: - case 307 /* SourceFile */: - case 265 /* TypeAliasDeclaration */: - case 346 /* JSDocTypedefTag */: - case 338 /* JSDocCallbackTag */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 267 /* EnumDeclaration */: + case 265 /* InterfaceDeclaration */: + case 268 /* ModuleDeclaration */: + case 308 /* SourceFile */: + case 266 /* TypeAliasDeclaration */: + case 347 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: return true; - case 219 /* ArrowFunction */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -145271,10 +146176,10 @@ function primaryNavBarMenuItems(root) { return false; } switch (navigationBarNodeKind(item2.parent)) { - case 268 /* ModuleBlock */: - case 307 /* SourceFile */: - case 174 /* MethodDeclaration */: - case 176 /* Constructor */: + case 269 /* ModuleBlock */: + case 308 /* SourceFile */: + case 175 /* MethodDeclaration */: + case 177 /* Constructor */: return true; default: return false; @@ -145333,7 +146238,7 @@ function getModuleName(moduleDeclaration) { } function getFullyQualifiedModuleName(moduleDeclaration) { const result = [getTextOfIdentifierOrLiteral(moduleDeclaration.name)]; - while (moduleDeclaration.body && moduleDeclaration.body.kind === 267 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 268 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -145343,13 +146248,13 @@ function getInteriorModule(decl) { return decl.body && isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 167 /* ComputedPropertyName */; + return !member.name || member.name.kind === 168 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 307 /* SourceFile */ ? createTextSpanFromRange(node) : createTextSpanFromNode(node, curSourceFile); + return node.kind === 308 /* SourceFile */ ? createTextSpanFromRange(node) : createTextSpanFromNode(node, curSourceFile); } function getModifiers2(node) { - if (node.parent && node.parent.kind === 260 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 261 /* VariableDeclaration */) { node = node.parent; } return getNodeModifiers(node); @@ -145394,9 +146299,9 @@ function getCalledExpressionName(expr) { } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: - case 231 /* ClassExpression */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 232 /* ClassExpression */: return true; default: return false; @@ -145517,17 +146422,17 @@ function getInfo2(context, considerPartialSpans = true) { } const noSymbolError = (id) => isIdentifier(id) && checker.getSymbolAtLocation(id) ? void 0 : { error: getLocaleSpecificMessage(Diagnostics.Can_only_convert_named_export) }; switch (exportNode.kind) { - case 262 /* FunctionDeclaration */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 267 /* ModuleDeclaration */: { + case 263 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 268 /* ModuleDeclaration */: { const node = exportNode; if (!node.name) return void 0; return noSymbolError(node.name) || { exportNode: node, exportName: node.name, wasDefault, exportingModuleSymbol }; } - case 243 /* VariableStatement */: { + case 244 /* VariableStatement */: { const vs = exportNode; if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) { return void 0; @@ -145537,7 +146442,7 @@ function getInfo2(context, considerPartialSpans = true) { Debug.assert(!wasDefault, "Can't have a default flag here"); return noSymbolError(decl.name) || { exportNode: vs, exportName: decl.name, wasDefault, exportingModuleSymbol }; } - case 277 /* ExportAssignment */: { + case 278 /* ExportAssignment */: { const node = exportNode; if (node.isExportEquals) return void 0; return noSymbolError(node.expression) || { exportNode: node, exportName: node.expression, wasDefault, exportingModuleSymbol }; @@ -145568,21 +146473,21 @@ function changeExport(exportingSourceFile, { wasDefault, exportNode, exportName } else { const exportKeyword = Debug.checkDefined(findModifier(exportNode, 95 /* ExportKeyword */), "Should find an export keyword in modifier list"); switch (exportNode.kind) { - case 262 /* FunctionDeclaration */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: + case 263 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: changes.insertNodeAfter(exportingSourceFile, exportKeyword, factory.createToken(90 /* DefaultKeyword */)); break; - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: const decl = first(exportNode.declarationList.declarations); if (!ts_FindAllReferences_exports.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile) && !decl.type) { changes.replaceNode(exportingSourceFile, exportNode, factory.createExportDefault(Debug.checkDefined(decl.initializer, "Initializer was previously known to be present"))); break; } // falls through - case 266 /* EnumDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 267 /* ModuleDeclaration */: + case 267 /* EnumDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 268 /* ModuleDeclaration */: changes.deleteModifier(exportingSourceFile, exportKeyword); changes.insertNodeAfter(exportingSourceFile, exportNode, factory.createExportDefault(factory.createIdentifier(exportName.text))); break; @@ -145607,23 +146512,23 @@ function changeImports(program, { wasDefault, exportName, exportingModuleSymbol function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) { const { parent: parent2 } = ref; switch (parent2.kind) { - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: changes.replaceNode(importingSourceFile, ref, factory.createIdentifier(exportName)); break; - case 276 /* ImportSpecifier */: - case 281 /* ExportSpecifier */: { + case 277 /* ImportSpecifier */: + case 282 /* ExportSpecifier */: { const spec = parent2; changes.replaceNode(importingSourceFile, spec, makeImportSpecifier(exportName, spec.name.text)); break; } - case 273 /* ImportClause */: { + case 274 /* ImportClause */: { const clause = parent2; Debug.assert(clause.name === ref, "Import clause name should match provided ref"); const spec = makeImportSpecifier(exportName, ref.text); const { namedBindings } = clause; if (!namedBindings) { changes.replaceNode(importingSourceFile, ref, factory.createNamedImports([spec])); - } else if (namedBindings.kind === 274 /* NamespaceImport */) { + } else if (namedBindings.kind === 275 /* NamespaceImport */) { changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) }); const quotePreference = isStringLiteral(clause.parent.moduleSpecifier) ? quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1 /* Double */; const newImport = makeImport( @@ -145640,7 +146545,7 @@ function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportNam } break; } - case 205 /* ImportType */: + case 206 /* ImportType */: const importTypeNode = parent2; changes.replaceNode(importingSourceFile, parent2, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.attributes, factory.createIdentifier(exportName), importTypeNode.typeArguments, importTypeNode.isTypeOf)); break; @@ -145651,10 +146556,10 @@ function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportNam function changeNamedToDefaultImport(importingSourceFile, ref, changes) { const parent2 = ref.parent; switch (parent2.kind) { - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: changes.replaceNode(importingSourceFile, ref, factory.createIdentifier("default")); break; - case 276 /* ImportSpecifier */: { + case 277 /* ImportSpecifier */: { const defaultImport = factory.createIdentifier(parent2.name.text); if (parent2.parent.elements.length === 1) { changes.replaceNode(importingSourceFile, parent2.parent, defaultImport); @@ -145664,7 +146569,7 @@ function changeNamedToDefaultImport(importingSourceFile, ref, changes) { } break; } - case 281 /* ExportSpecifier */: { + case 282 /* ExportSpecifier */: { changes.replaceNode(importingSourceFile, parent2, makeExportSpecifier("default", parent2.name.text)); break; } @@ -145760,7 +146665,7 @@ function getImportConversionInfo(context, considerPartialSpans = true) { if (!importClause.namedBindings) { return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_namespace_import_or_named_imports) }; } - if (importClause.namedBindings.kind === 274 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 275 /* NamespaceImport */) { return { convertTo: 0 /* Named */, import: importClause.namedBindings }; } const shouldUseDefault = getShouldUseDefault(context.program, importClause); @@ -145915,8 +146820,8 @@ function createImport(node, defaultImportName, elements) { } function createImportClause(defaultImportName, elements) { return factory.createImportClause( - /*isTypeOnly*/ - false, + /*phaseModifier*/ + void 0, defaultImportName, elements && elements.length ? factory.createNamedImports(elements) : void 0 ); @@ -146450,11 +147355,11 @@ function updateImportsInOtherFiles(changes, program, host, oldFile, movedSymbols } function getNamespaceLikeImport(node) { switch (node.kind) { - case 272 /* ImportDeclaration */: - return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 274 /* NamespaceImport */ ? node.importClause.namedBindings.name : void 0; - case 271 /* ImportEqualsDeclaration */: + case 273 /* ImportDeclaration */: + return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 275 /* NamespaceImport */ ? node.importClause.namedBindings.name : void 0; + case 272 /* ImportEqualsDeclaration */: return node.name; - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return tryCast(node.name, isIdentifier); default: return Debug.assertNever(node, `Unexpected node kind ${node.kind}`); @@ -146489,13 +147394,13 @@ function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifie const newNamespaceId = factory.createIdentifier(newNamespaceName); const newModuleString = makeStringLiteral(newModuleSpecifier, quotePreference); switch (node.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return factory.createImportDeclaration( /*modifiers*/ void 0, factory.createImportClause( - /*isTypeOnly*/ - false, + /*phaseModifier*/ + void 0, /*name*/ void 0, factory.createNamespaceImport(newNamespaceId) @@ -146504,7 +147409,7 @@ function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifie /*attributes*/ void 0 ); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return factory.createImportEqualsDeclaration( /*modifiers*/ void 0, @@ -146513,7 +147418,7 @@ function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifie newNamespaceId, factory.createExternalModuleReference(newModuleString) ); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return factory.createVariableDeclaration( newNamespaceId, /*exclamationToken*/ @@ -146535,7 +147440,7 @@ function createRequireCall(moduleSpecifier) { ); } function moduleSpecifierFromImport(i) { - return i.kind === 272 /* ImportDeclaration */ ? i.moduleSpecifier : i.kind === 271 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0]; + return i.kind === 273 /* ImportDeclaration */ ? i.moduleSpecifier : i.kind === 272 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0]; } function forEachImportInStatement(statement, cb) { if (isImportDeclaration(statement)) { @@ -146558,24 +147463,24 @@ function forEachImportInStatement(statement, cb) { } function forEachAliasDeclarationInImportOrRequire(importOrRequire, cb) { var _a, _b, _c, _d, _e; - if (importOrRequire.kind === 272 /* ImportDeclaration */) { + if (importOrRequire.kind === 273 /* ImportDeclaration */) { if ((_a = importOrRequire.importClause) == null ? void 0 : _a.name) { cb(importOrRequire.importClause); } - if (((_c = (_b = importOrRequire.importClause) == null ? void 0 : _b.namedBindings) == null ? void 0 : _c.kind) === 274 /* NamespaceImport */) { + if (((_c = (_b = importOrRequire.importClause) == null ? void 0 : _b.namedBindings) == null ? void 0 : _c.kind) === 275 /* NamespaceImport */) { cb(importOrRequire.importClause.namedBindings); } - if (((_e = (_d = importOrRequire.importClause) == null ? void 0 : _d.namedBindings) == null ? void 0 : _e.kind) === 275 /* NamedImports */) { + if (((_e = (_d = importOrRequire.importClause) == null ? void 0 : _d.namedBindings) == null ? void 0 : _e.kind) === 276 /* NamedImports */) { for (const element of importOrRequire.importClause.namedBindings.elements) { cb(element); } } - } else if (importOrRequire.kind === 271 /* ImportEqualsDeclaration */) { + } else if (importOrRequire.kind === 272 /* ImportEqualsDeclaration */) { cb(importOrRequire); - } else if (importOrRequire.kind === 260 /* VariableDeclaration */) { + } else if (importOrRequire.kind === 261 /* VariableDeclaration */) { if (importOrRequire.name.kind === 80 /* Identifier */) { cb(importOrRequire); - } else if (importOrRequire.name.kind === 206 /* ObjectBindingPattern */) { + } else if (importOrRequire.name.kind === 207 /* ObjectBindingPattern */) { for (const element of importOrRequire.name.elements) { if (isIdentifier(element.name)) { cb(element); @@ -146624,9 +147529,9 @@ function isExported(sourceFile, decl, useEs6Exports, name) { return !!sourceFile.symbol && !!sourceFile.symbol.exports && getNamesToExportInCommonJS(decl).some((name2) => sourceFile.symbol.exports.has(escapeLeadingUnderscores(name2))); } function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) { - if (importDecl.kind === 272 /* ImportDeclaration */ && importDecl.importClause) { + if (importDecl.kind === 273 /* ImportDeclaration */ && importDecl.importClause) { const { name, namedBindings } = importDecl.importClause; - if ((!name || isUnused(name)) && (!namedBindings || namedBindings.kind === 275 /* NamedImports */ && namedBindings.elements.length !== 0 && namedBindings.elements.every((e) => isUnused(e.name)))) { + if ((!name || isUnused(name)) && (!namedBindings || namedBindings.kind === 276 /* NamedImports */ && namedBindings.elements.length !== 0 && namedBindings.elements.every((e) => isUnused(e.name)))) { return changes.delete(sourceFile, importDecl); } } @@ -146646,24 +147551,24 @@ function addExport(decl, useEs6Exports) { function addEs6Export(d) { const modifiers = canHaveModifiers(d) ? concatenate([factory.createModifier(95 /* ExportKeyword */)], getModifiers(d)) : void 0; switch (d.kind) { - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return factory.updateFunctionDeclaration(d, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body); - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: const decorators = canHaveDecorators(d) ? getDecorators(d) : void 0; return factory.updateClassDeclaration(d, concatenate(decorators, modifiers), d.name, d.typeParameters, d.heritageClauses, d.members); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return factory.updateVariableStatement(d, modifiers, d.declarationList); - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return factory.updateModuleDeclaration(d, modifiers, d.name, d.body); - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: return factory.updateEnumDeclaration(d, modifiers, d.name, d.members); - case 265 /* TypeAliasDeclaration */: + case 266 /* TypeAliasDeclaration */: return factory.updateTypeAliasDeclaration(d, modifiers, d.name, d.typeParameters, d.type); - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: return factory.updateInterfaceDeclaration(d, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return factory.updateImportEqualsDeclaration(d, modifiers, d.isTypeOnly, d.name, d.moduleReference); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return Debug.fail(); default: return Debug.assertNever(d, `Unexpected declaration kind ${d.kind}`); @@ -146683,19 +147588,19 @@ function createExportAssignment(name) { } function getNamesToExportInCommonJS(decl) { switch (decl.kind) { - case 262 /* FunctionDeclaration */: - case 263 /* ClassDeclaration */: + case 263 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: return [decl.name.text]; // TODO: GH#18217 - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return mapDefined(decl.declarationList.declarations, (d) => isIdentifier(d.name) ? d.name.text : void 0); - case 267 /* ModuleDeclaration */: - case 266 /* EnumDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 264 /* InterfaceDeclaration */: - case 271 /* ImportEqualsDeclaration */: + case 268 /* ModuleDeclaration */: + case 267 /* EnumDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 265 /* InterfaceDeclaration */: + case 272 /* ImportEqualsDeclaration */: return emptyArray; - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return Debug.fail("Can't export an ExpressionStatement"); default: return Debug.assertNever(decl, `Unexpected decl kind ${decl.kind}`); @@ -146703,7 +147608,7 @@ function getNamesToExportInCommonJS(decl) { } function filterImport(i, moduleSpecifier, keep) { switch (i.kind) { - case 272 /* ImportDeclaration */: { + case 273 /* ImportDeclaration */: { const clause = i.importClause; if (!clause) return void 0; const defaultImport = clause.name && keep(clause.name) ? clause.name : void 0; @@ -146711,15 +147616,15 @@ function filterImport(i, moduleSpecifier, keep) { return defaultImport || namedBindings ? factory.createImportDeclaration( /*modifiers*/ void 0, - factory.createImportClause(clause.isTypeOnly, defaultImport, namedBindings), + factory.createImportClause(clause.phaseModifier, defaultImport, namedBindings), getSynthesizedDeepClone(moduleSpecifier), /*attributes*/ void 0 ) : void 0; } - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return keep(i.name) ? i : void 0; - case 260 /* VariableDeclaration */: { + case 261 /* VariableDeclaration */: { const name = filterBindingName(i.name, keep); return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : void 0; } @@ -146728,7 +147633,7 @@ function filterImport(i, moduleSpecifier, keep) { } } function filterNamedBindings(namedBindings, keep) { - if (namedBindings.kind === 274 /* NamespaceImport */) { + if (namedBindings.kind === 275 /* NamespaceImport */) { return keep(namedBindings.name) ? namedBindings : void 0; } else { const newElements = namedBindings.elements.filter((e) => keep(e.name)); @@ -146739,9 +147644,9 @@ function filterBindingName(name, keep) { switch (name.kind) { case 80 /* Identifier */: return keep(name) ? name : void 0; - case 207 /* ArrayBindingPattern */: + case 208 /* ArrayBindingPattern */: return name; - case 206 /* ObjectBindingPattern */: { + case 207 /* ObjectBindingPattern */: { const newElements = name.elements.filter((prop) => prop.propertyName || !isIdentifier(prop.name) || keep(prop.name)); return newElements.length ? factory.createObjectBindingPattern(newElements) : void 0; } @@ -146752,9 +147657,9 @@ function nameOfTopLevelDeclaration(d) { } function getTopLevelDeclarationStatement(d) { switch (d.kind) { - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return d.parent.parent; - case 208 /* BindingElement */: + case 209 /* BindingElement */: return getTopLevelDeclarationStatement( cast(d.parent.parent, (p) => isVariableDeclaration(p) || isBindingElement(p)) ); @@ -146837,11 +147742,11 @@ function isAllowedStatementToMove(statement) { } function isPureImport(node) { switch (node.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return true; - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return !hasSyntacticModifier(node, 32 /* Export */); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return node.declarationList.declarations.every((d) => !!d.initializer && isRequireCall( d.initializer, /*requireStringLiteralLikeArgument*/ @@ -146943,17 +147848,17 @@ function forEachReference(node, checker, enclosingRange, onReference) { } function forEachTopLevelDeclaration(statement, cb) { switch (statement.kind) { - case 262 /* FunctionDeclaration */: - case 263 /* ClassDeclaration */: - case 267 /* ModuleDeclaration */: - case 266 /* EnumDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 264 /* InterfaceDeclaration */: - case 271 /* ImportEqualsDeclaration */: + case 263 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: + case 268 /* ModuleDeclaration */: + case 267 /* EnumDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 265 /* InterfaceDeclaration */: + case 272 /* ImportEqualsDeclaration */: return cb(statement); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return firstDefined(statement.declarationList.declarations, (decl) => forEachTopLevelDeclarationInBindingName(decl.name, cb)); - case 244 /* ExpressionStatement */: { + case 245 /* ExpressionStatement */: { const { expression } = statement; return isBinaryExpression(expression) && getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */ ? cb(statement) : void 0; } @@ -146961,14 +147866,14 @@ function forEachTopLevelDeclaration(statement, cb) { } function isInImport(decl) { switch (decl.kind) { - case 271 /* ImportEqualsDeclaration */: - case 276 /* ImportSpecifier */: - case 273 /* ImportClause */: - case 274 /* NamespaceImport */: + case 272 /* ImportEqualsDeclaration */: + case 277 /* ImportSpecifier */: + case 274 /* ImportClause */: + case 275 /* NamespaceImport */: return true; - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return isVariableDeclarationInImport(decl); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent); default: return false; @@ -146991,8 +147896,8 @@ function forEachTopLevelDeclarationInBindingName(name, cb) { switch (name.kind) { case 80 /* Identifier */: return cb(cast(name.parent, (x) => isVariableDeclaration(x) || isBindingElement(x))); - case 207 /* ArrayBindingPattern */: - case 206 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: + case 207 /* ObjectBindingPattern */: return firstDefined(name.elements, (em) => isOmittedExpression(em) ? void 0 : forEachTopLevelDeclarationInBindingName(em.name, cb)); default: return Debug.assertNever(name, `Unexpected name kind ${name.kind}`); @@ -147000,13 +147905,13 @@ function forEachTopLevelDeclarationInBindingName(name, cb) { } function isNonVariableTopLevelDeclaration(node) { switch (node.kind) { - case 262 /* FunctionDeclaration */: - case 263 /* ClassDeclaration */: - case 267 /* ModuleDeclaration */: - case 266 /* EnumDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 264 /* InterfaceDeclaration */: - case 271 /* ImportEqualsDeclaration */: + case 263 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: + case 268 /* ModuleDeclaration */: + case 267 /* EnumDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 265 /* InterfaceDeclaration */: + case 272 /* ImportEqualsDeclaration */: return true; default: return false; @@ -147395,7 +148300,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) { const lastDeclaration = signatureDecls[signatureDecls.length - 1]; let updated = lastDeclaration; switch (lastDeclaration.kind) { - case 173 /* MethodSignature */: { + case 174 /* MethodSignature */: { updated = factory.updateMethodSignature( lastDeclaration, lastDeclaration.modifiers, @@ -147407,7 +148312,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) { ); break; } - case 174 /* MethodDeclaration */: { + case 175 /* MethodDeclaration */: { updated = factory.updateMethodDeclaration( lastDeclaration, lastDeclaration.modifiers, @@ -147421,7 +148326,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) { ); break; } - case 179 /* CallSignature */: { + case 180 /* CallSignature */: { updated = factory.updateCallSignature( lastDeclaration, lastDeclaration.typeParameters, @@ -147430,7 +148335,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) { ); break; } - case 176 /* Constructor */: { + case 177 /* Constructor */: { updated = factory.updateConstructorDeclaration( lastDeclaration, lastDeclaration.modifiers, @@ -147439,7 +148344,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) { ); break; } - case 180 /* ConstructSignature */: { + case 181 /* ConstructSignature */: { updated = factory.updateConstructSignature( lastDeclaration, lastDeclaration.typeParameters, @@ -147448,7 +148353,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) { ); break; } - case 262 /* FunctionDeclaration */: { + case 263 /* FunctionDeclaration */: { updated = factory.updateFunctionDeclaration( lastDeclaration, lastDeclaration.modifiers, @@ -147524,12 +148429,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function isConvertableSignatureDeclaration(d) { switch (d.kind) { - case 173 /* MethodSignature */: - case 174 /* MethodDeclaration */: - case 179 /* CallSignature */: - case 176 /* Constructor */: - case 180 /* ConstructSignature */: - case 262 /* FunctionDeclaration */: + case 174 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 180 /* CallSignature */: + case 177 /* Constructor */: + case 181 /* ConstructSignature */: + case 263 /* FunctionDeclaration */: return true; } return false; @@ -148142,15 +149047,15 @@ function entryToFunctionCall(entry) { const parent2 = functionReference.parent; switch (parent2.kind) { // foo(...) or super(...) or new Foo(...) - case 213 /* CallExpression */: - case 214 /* NewExpression */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: const callOrNewExpression = tryCast(parent2, isCallOrNewExpression); if (callOrNewExpression && callOrNewExpression.expression === functionReference) { return callOrNewExpression; } break; // x.foo(...) - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: const propertyAccessExpression = tryCast(parent2, isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) { const callOrNewExpression2 = tryCast(propertyAccessExpression.parent, isCallOrNewExpression); @@ -148160,7 +149065,7 @@ function entryToFunctionCall(entry) { } break; // x["foo"](...) - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: const elementAccessExpression = tryCast(parent2, isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) { const callOrNewExpression2 = tryCast(elementAccessExpression.parent, isCallOrNewExpression); @@ -148179,14 +149084,14 @@ function entryToAccessExpression(entry) { const parent2 = reference.parent; switch (parent2.kind) { // `C.foo` - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: const propertyAccessExpression = tryCast(parent2, isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.expression === reference) { return propertyAccessExpression; } break; // `C["foo"]` - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: const elementAccessExpression = tryCast(parent2, isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.expression === reference) { return elementAccessExpression; @@ -148225,22 +149130,22 @@ function isValidFunctionDeclaration(functionDeclaration, checker) { var _a; if (!isValidParameterNodeArray(functionDeclaration.parameters, checker)) return false; switch (functionDeclaration.kind) { - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: if (isObjectLiteralExpression(functionDeclaration.parent)) { const contextualSymbol = getSymbolForContextualType(functionDeclaration.name, checker); return ((_a = contextualSymbol == null ? void 0 : contextualSymbol.declarations) == null ? void 0 : _a.length) === 1 && isSingleImplementation(functionDeclaration, checker); } return isSingleImplementation(functionDeclaration, checker); - case 176 /* Constructor */: + case 177 /* Constructor */: if (isClassDeclaration(functionDeclaration.parent)) { return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker); } else { return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker); } - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return isValidVariableDeclaration(functionDeclaration.parent); } return false; @@ -148415,7 +149320,7 @@ function getParameterName(paramDeclaration) { } function getClassNames(constructorDeclaration) { switch (constructorDeclaration.parent.kind) { - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: const classDeclaration = constructorDeclaration.parent; if (classDeclaration.name) return [classDeclaration.name]; const defaultModifier = Debug.checkDefined( @@ -148423,7 +149328,7 @@ function getClassNames(constructorDeclaration) { "Nameless class declaration should be a default export" ); return [defaultModifier]; - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: const classExpression = constructorDeclaration.parent; const variableDeclaration = constructorDeclaration.parent.parent; const className = classExpression.name; @@ -148433,28 +149338,28 @@ function getClassNames(constructorDeclaration) { } function getFunctionNames(functionDeclaration) { switch (functionDeclaration.kind) { - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: if (functionDeclaration.name) return [functionDeclaration.name]; const defaultModifier = Debug.checkDefined( findModifier(functionDeclaration, 90 /* DefaultKeyword */), "Nameless function declaration should be a default export" ); return [defaultModifier]; - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return [functionDeclaration.name]; - case 176 /* Constructor */: + case 177 /* Constructor */: const ctrKeyword = Debug.checkDefined( findChildOfKind(functionDeclaration, 137 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword" ); - if (functionDeclaration.parent.kind === 231 /* ClassExpression */) { + if (functionDeclaration.parent.kind === 232 /* ClassExpression */) { const variableDeclaration = functionDeclaration.parent.parent; return [variableDeclaration.name, ctrKeyword]; } return [ctrKeyword]; - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return [functionDeclaration.parent.name]; - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: if (functionDeclaration.name) return [functionDeclaration.name, functionDeclaration.parent.name]; return [functionDeclaration.parent.name]; default: @@ -148537,11 +149442,11 @@ function isNotEqualsOperator(node) { function getParentBinaryExpression(expr) { const container = findAncestor(expr.parent, (n) => { switch (n.kind) { - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: return false; - case 228 /* TemplateExpression */: - case 226 /* BinaryExpression */: + case 229 /* TemplateExpression */: + case 227 /* BinaryExpression */: return !(isBinaryExpression(n.parent) && isNotEqualsOperator(n.parent)); default: return "quit"; @@ -149181,18 +150086,18 @@ function getRangeToExtract2(sourceFile, span, invoked = true) { function checkForStaticContext(nodeToCheck, containingClass) { let current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 172 /* PropertyDeclaration */) { + if (current.kind === 173 /* PropertyDeclaration */) { if (isStatic(current)) { rangeFacts |= 32 /* InStaticRegion */; } break; - } else if (current.kind === 169 /* Parameter */) { + } else if (current.kind === 170 /* Parameter */) { const ctorOrMethod = getContainingFunction(current); - if (ctorOrMethod.kind === 176 /* Constructor */) { + if (ctorOrMethod.kind === 177 /* Constructor */) { rangeFacts |= 32 /* InStaticRegion */; } break; - } else if (current.kind === 174 /* MethodDeclaration */) { + } else if (current.kind === 175 /* MethodDeclaration */) { if (isStatic(current)) { rangeFacts |= 32 /* InStaticRegion */; } @@ -149232,7 +150137,7 @@ function getRangeToExtract2(sourceFile, span, invoked = true) { /*includeClassComputedPropertyName*/ false ); - if (container.kind === 262 /* FunctionDeclaration */ || container.kind === 174 /* MethodDeclaration */ && container.parent.kind === 210 /* ObjectLiteralExpression */ || container.kind === 218 /* FunctionExpression */) { + if (container.kind === 263 /* FunctionDeclaration */ || container.kind === 175 /* MethodDeclaration */ && container.parent.kind === 211 /* ObjectLiteralExpression */ || container.kind === 219 /* FunctionExpression */) { rangeFacts |= 16 /* UsesThisInFunction */; } } @@ -149242,21 +150147,21 @@ function getRangeToExtract2(sourceFile, span, invoked = true) { return true; } if (isDeclaration(node2)) { - const declaringNode = node2.kind === 260 /* VariableDeclaration */ ? node2.parent.parent : node2; + const declaringNode = node2.kind === 261 /* VariableDeclaration */ ? node2.parent.parent : node2; if (hasSyntacticModifier(declaringNode, 32 /* Export */)) { (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractExportedEntity)); return true; } } switch (node2.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractImport)); return true; - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractExportedEntity)); return true; case 108 /* SuperKeyword */: - if (node2.parent.kind === 213 /* CallExpression */) { + if (node2.parent.kind === 214 /* CallExpression */) { const containingClass2 = getContainingClass(node2); if (containingClass2 === void 0 || containingClass2.pos < span.start || containingClass2.end >= span.start + span.length) { (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractSuper)); @@ -149267,7 +150172,7 @@ function getRangeToExtract2(sourceFile, span, invoked = true) { thisNode = node2; } break; - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: forEachChild(node2, function check(n) { if (isThis(n)) { rangeFacts |= 8 /* UsesThis */; @@ -149279,35 +150184,35 @@ function getRangeToExtract2(sourceFile, span, invoked = true) { } }); // falls through - case 263 /* ClassDeclaration */: - case 262 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: + case 263 /* FunctionDeclaration */: if (isSourceFile(node2.parent) && node2.parent.externalModuleIndicator === void 0) { (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.functionWillNotBeVisibleInTheNewScope)); } // falls through - case 231 /* ClassExpression */: - case 218 /* FunctionExpression */: - case 174 /* MethodDeclaration */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 232 /* ClassExpression */: + case 219 /* FunctionExpression */: + case 175 /* MethodDeclaration */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return false; } const savedPermittedJumps = permittedJumps; switch (node2.kind) { - case 245 /* IfStatement */: + case 246 /* IfStatement */: permittedJumps &= ~4 /* Return */; break; - case 258 /* TryStatement */: + case 259 /* TryStatement */: permittedJumps = 0 /* None */; break; - case 241 /* Block */: - if (node2.parent && node2.parent.kind === 258 /* TryStatement */ && node2.parent.finallyBlock === node2) { + case 242 /* Block */: + if (node2.parent && node2.parent.kind === 259 /* TryStatement */ && node2.parent.finallyBlock === node2) { permittedJumps = 4 /* Return */; } break; - case 297 /* DefaultClause */: - case 296 /* CaseClause */: + case 298 /* DefaultClause */: + case 297 /* CaseClause */: permittedJumps |= 1 /* Break */; break; default: @@ -149321,39 +150226,39 @@ function getRangeToExtract2(sourceFile, span, invoked = true) { break; } switch (node2.kind) { - case 197 /* ThisType */: + case 198 /* ThisType */: case 110 /* ThisKeyword */: rangeFacts |= 8 /* UsesThis */; thisNode = node2; break; - case 256 /* LabeledStatement */: { + case 257 /* LabeledStatement */: { const label = node2.label; (seenLabels || (seenLabels = [])).push(label.escapedText); forEachChild(node2, visit); seenLabels.pop(); break; } - case 252 /* BreakStatement */: - case 251 /* ContinueStatement */: { + case 253 /* BreakStatement */: + case 252 /* ContinueStatement */: { const label = node2.label; if (label) { if (!contains(seenLabels, label.escapedText)) { (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)); } } else { - if (!(permittedJumps & (node2.kind === 252 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node2.kind === 253 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 223 /* AwaitExpression */: + case 224 /* AwaitExpression */: rangeFacts |= 4 /* IsAsyncFunction */; break; - case 229 /* YieldExpression */: + case 230 /* YieldExpression */: rangeFacts |= 2 /* IsGenerator */; break; - case 253 /* ReturnStatement */: + case 254 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= 1 /* HasReturn */; } else { @@ -149403,12 +150308,12 @@ function collectEnclosingScopes(range) { const scopes = []; while (true) { current = current.parent; - if (current.kind === 169 /* Parameter */) { + if (current.kind === 170 /* Parameter */) { current = findAncestor(current, (parent2) => isFunctionLikeDeclaration(parent2)).parent; } if (isScope(current)) { scopes.push(current); - if (current.kind === 307 /* SourceFile */) { + if (current.kind === 308 /* SourceFile */) { return scopes; } } @@ -149484,28 +150389,28 @@ function getDescriptionForConstantInScope(scope) { } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 176 /* Constructor */: + case 177 /* Constructor */: return "constructor"; - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: return scope.name ? `function '${scope.name.text}'` : ANONYMOUS; - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return "arrow function"; - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return `method '${scope.name.getText()}'`; - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return `'get ${scope.name.getText()}'`; - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return `'set ${scope.name.getText()}'`; default: Debug.assertNever(scope, `Unexpected scope kind ${scope.kind}`); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 263 /* ClassDeclaration */ ? scope.name ? `class '${scope.name.text}'` : "anonymous class declaration" : scope.name ? `class expression '${scope.name.text}'` : "anonymous class expression"; + return scope.kind === 264 /* ClassDeclaration */ ? scope.name ? `class '${scope.name.text}'` : "anonymous class declaration" : scope.name ? `class expression '${scope.name.text}'` : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 268 /* ModuleBlock */ ? `namespace '${scope.parent.name.getText()}'` : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; + return scope.kind === 269 /* ModuleBlock */ ? `namespace '${scope.parent.name.getText()}'` : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } function extractFunctionInScope(node, scope, { usages: usagesInScope, typeParameterUsages, substitutions }, exposedVariableDeclarations, range, context) { const checker = context.program.getTypeChecker(); @@ -149878,7 +150783,7 @@ function extractConstantInScope(node, scope, { substitutions }, rangeFacts, cont changeTracker.insertNodeBefore(context.file, oldVariableDeclaration, newVariableDeclaration); const localReference = factory.createIdentifier(localNameText); changeTracker.replaceNode(context.file, node, localReference); - } else if (node.parent.kind === 244 /* ExpressionStatement */ && scope === findAncestor(node, isScope)) { + } else if (node.parent.kind === 245 /* ExpressionStatement */ && scope === findAncestor(node, isScope)) { const newVariableStatement = factory.createVariableStatement( /*modifiers*/ void 0, @@ -149908,7 +150813,7 @@ function extractConstantInScope(node, scope, { substitutions }, rangeFacts, cont false ); } - if (node.parent.kind === 244 /* ExpressionStatement */) { + if (node.parent.kind === 245 /* ExpressionStatement */) { changeTracker.delete(context.file, node.parent); } else { let localReference = factory.createIdentifier(localNameText); @@ -150442,18 +151347,18 @@ function getExtractableParent(node) { function isExtractableExpression(node) { const { parent: parent2 } = node; switch (parent2.kind) { - case 306 /* EnumMember */: + case 307 /* EnumMember */: return false; } switch (node.kind) { case 11 /* StringLiteral */: - return parent2.kind !== 272 /* ImportDeclaration */ && parent2.kind !== 276 /* ImportSpecifier */; - case 230 /* SpreadElement */: - case 206 /* ObjectBindingPattern */: - case 208 /* BindingElement */: + return parent2.kind !== 273 /* ImportDeclaration */ && parent2.kind !== 277 /* ImportSpecifier */; + case 231 /* SpreadElement */: + case 207 /* ObjectBindingPattern */: + case 209 /* BindingElement */: return false; case 80 /* Identifier */: - return parent2.kind !== 208 /* BindingElement */ && parent2.kind !== 276 /* ImportSpecifier */ && parent2.kind !== 281 /* ExportSpecifier */; + return parent2.kind !== 209 /* BindingElement */ && parent2.kind !== 277 /* ImportSpecifier */ && parent2.kind !== 282 /* ExportSpecifier */; } return true; } @@ -150611,10 +151516,10 @@ function getInfo4(context) { } function isConvertibleDeclaration(node) { switch (node.kind) { - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: return true; default: return false; @@ -150685,13 +151590,13 @@ function collectTokens(program, sourceFile, span, collector, cancellationToken) let inJSXElement = false; function visit(node) { switch (node.kind) { - case 267 /* ModuleDeclaration */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 262 /* FunctionDeclaration */: - case 231 /* ClassExpression */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 268 /* ModuleDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 263 /* FunctionDeclaration */: + case 232 /* ClassExpression */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } if (!node || !textSpanIntersectsWith(span, node.pos, node.getFullWidth()) || node.getFullWidth() === 0) { @@ -150828,25 +151733,25 @@ function isRightSideOfQualifiedNameOrPropertyAccess2(node) { return isQualifiedName(node.parent) && node.parent.right === node || isPropertyAccessExpression(node.parent) && node.parent.name === node; } var tokenFromDeclarationMapping = /* @__PURE__ */ new Map([ - [260 /* VariableDeclaration */, 7 /* variable */], - [169 /* Parameter */, 6 /* parameter */], - [172 /* PropertyDeclaration */, 9 /* property */], - [267 /* ModuleDeclaration */, 3 /* namespace */], - [266 /* EnumDeclaration */, 1 /* enum */], - [306 /* EnumMember */, 8 /* enumMember */], - [263 /* ClassDeclaration */, 0 /* class */], - [174 /* MethodDeclaration */, 11 /* member */], - [262 /* FunctionDeclaration */, 10 /* function */], - [218 /* FunctionExpression */, 10 /* function */], - [173 /* MethodSignature */, 11 /* member */], - [177 /* GetAccessor */, 9 /* property */], - [178 /* SetAccessor */, 9 /* property */], - [171 /* PropertySignature */, 9 /* property */], - [264 /* InterfaceDeclaration */, 2 /* interface */], - [265 /* TypeAliasDeclaration */, 5 /* type */], - [168 /* TypeParameter */, 4 /* typeParameter */], - [303 /* PropertyAssignment */, 9 /* property */], - [304 /* ShorthandPropertyAssignment */, 9 /* property */] + [261 /* VariableDeclaration */, 7 /* variable */], + [170 /* Parameter */, 6 /* parameter */], + [173 /* PropertyDeclaration */, 9 /* property */], + [268 /* ModuleDeclaration */, 3 /* namespace */], + [267 /* EnumDeclaration */, 1 /* enum */], + [307 /* EnumMember */, 8 /* enumMember */], + [264 /* ClassDeclaration */, 0 /* class */], + [175 /* MethodDeclaration */, 11 /* member */], + [263 /* FunctionDeclaration */, 10 /* function */], + [219 /* FunctionExpression */, 10 /* function */], + [174 /* MethodSignature */, 11 /* member */], + [178 /* GetAccessor */, 9 /* property */], + [179 /* SetAccessor */, 9 /* property */], + [172 /* PropertySignature */, 9 /* property */], + [265 /* InterfaceDeclaration */, 2 /* interface */], + [266 /* TypeAliasDeclaration */, 5 /* type */], + [169 /* TypeParameter */, 4 /* typeParameter */], + [304 /* PropertyAssignment */, 9 /* property */], + [305 /* ShorthandPropertyAssignment */, 9 /* property */] ]); // src/services/services.ts @@ -150927,8 +151832,8 @@ var NodeObject = class { if (!children.length) { return void 0; } - const child = find(children, (kid) => kid.kind < 309 /* FirstJSDocNode */ || kid.kind > 351 /* LastJSDocNode */); - return child.kind < 166 /* FirstNode */ ? child : child.getFirstToken(sourceFile); + const child = find(children, (kid) => kid.kind < 310 /* FirstJSDocNode */ || kid.kind > 352 /* LastJSDocNode */); + return child.kind < 167 /* FirstNode */ ? child : child.getFirstToken(sourceFile); } getLastToken(sourceFile) { this.assertHasRealPosition(); @@ -150937,7 +151842,7 @@ var NodeObject = class { if (!child) { return void 0; } - return child.kind < 166 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 167 /* FirstNode */ ? child : child.getLastToken(sourceFile); } forEachChild(cbNode, cbNodeArray) { return forEachChild(this, cbNode, cbNodeArray); @@ -150951,7 +151856,9 @@ function createChildren(node, sourceFile) { }); return children; } + const languageVariant = (sourceFile == null ? void 0 : sourceFile.languageVariant) ?? 0 /* Standard */; scanner.setText((sourceFile || node.getSourceFile()).text); + scanner.setLanguageVariant(languageVariant); let pos = node.pos; const processNode = (child) => { addSyntheticNodes(children, pos, child.pos, node); @@ -150968,6 +151875,7 @@ function createChildren(node, sourceFile) { node.forEachChild(processNode, processNodes); addSyntheticNodes(children, pos, node.end, node); scanner.setText(void 0); + scanner.setLanguageVariant(0 /* Standard */); return children; } function addSyntheticNodes(nodes, pos, end, parent2) { @@ -150991,7 +151899,7 @@ function addSyntheticNodes(nodes, pos, end, parent2) { } } function createSyntaxList(nodes, parent2) { - const list = createNode(352 /* SyntaxList */, nodes.pos, nodes.end, parent2); + const list = createNode(353 /* SyntaxList */, nodes.pos, nodes.end, parent2); const children = []; let pos = nodes.pos; for (const node of nodes) { @@ -151320,7 +152228,7 @@ function getJsDocTagsOfDeclarations(declarations, checker) { var _a; if (!seenSymbols.has(symbol)) { seenSymbols.add(symbol); - if (declaration.kind === 177 /* GetAccessor */ || declaration.kind === 178 /* SetAccessor */) { + if (declaration.kind === 178 /* GetAccessor */ || declaration.kind === 179 /* SetAccessor */) { return symbol.getContextualJsDocTags(declaration, checker); } return ((_a = symbol.declarations) == null ? void 0 : _a.length) === 1 ? symbol.getJsDocTags(checker) : void 0; @@ -151342,7 +152250,7 @@ function getDocumentationComment(declarations, checker) { const inheritedDocs = findBaseOfDeclaration(checker, declaration, (symbol) => { if (!seenSymbols.has(symbol)) { seenSymbols.add(symbol); - if (declaration.kind === 177 /* GetAccessor */ || declaration.kind === 178 /* SetAccessor */) { + if (declaration.kind === 178 /* GetAccessor */ || declaration.kind === 179 /* SetAccessor */) { return symbol.getContextualDocumentationComment(declaration, checker); } return symbol.getDocumentationComment(checker); @@ -151355,7 +152263,7 @@ function getDocumentationComment(declarations, checker) { } function findBaseOfDeclaration(checker, declaration, cb) { var _a; - const classOrInterfaceDeclaration = ((_a = declaration.parent) == null ? void 0 : _a.kind) === 176 /* Constructor */ ? declaration.parent.parent : declaration.parent; + const classOrInterfaceDeclaration = ((_a = declaration.parent) == null ? void 0 : _a.kind) === 177 /* Constructor */ ? declaration.parent.parent : declaration.parent; if (!classOrInterfaceDeclaration) return; const isStaticMember = hasStaticModifier(declaration); return firstDefined(getAllSuperTypeNodes(classOrInterfaceDeclaration), (superTypeNode) => { @@ -151423,10 +152331,10 @@ var SourceFileObject = class extends NodeObject { } function visit(node) { switch (node.kind) { - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: const functionDeclaration = node; const declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -151442,30 +152350,30 @@ var SourceFileObject = class extends NodeObject { } forEachChild(node, visit); break; - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 266 /* EnumDeclaration */: - case 267 /* ModuleDeclaration */: - case 271 /* ImportEqualsDeclaration */: - case 281 /* ExportSpecifier */: - case 276 /* ImportSpecifier */: - case 273 /* ImportClause */: - case 274 /* NamespaceImport */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 187 /* TypeLiteral */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 267 /* EnumDeclaration */: + case 268 /* ModuleDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 282 /* ExportSpecifier */: + case 277 /* ImportSpecifier */: + case 274 /* ImportClause */: + case 275 /* NamespaceImport */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 188 /* TypeLiteral */: addDeclaration(node); forEachChild(node, visit); break; - case 169 /* Parameter */: + case 170 /* Parameter */: if (!hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */)) { break; } // falls through - case 260 /* VariableDeclaration */: - case 208 /* BindingElement */: { + case 261 /* VariableDeclaration */: + case 209 /* BindingElement */: { const decl = node; if (isBindingPattern(decl.name)) { forEachChild(decl.name, visit); @@ -151476,12 +152384,12 @@ var SourceFileObject = class extends NodeObject { } } // falls through - case 306 /* EnumMember */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: + case 307 /* EnumMember */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: addDeclaration(node); break; - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: const exportDeclaration = node; if (exportDeclaration.exportClause) { if (isNamedExports(exportDeclaration.exportClause)) { @@ -151491,14 +152399,14 @@ var SourceFileObject = class extends NodeObject { } } break; - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: const importClause = node.importClause; if (importClause) { if (importClause.name) { addDeclaration(importClause.name); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 274 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 275 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { forEach(importClause.namedBindings.elements, visit); @@ -151506,7 +152414,7 @@ var SourceFileObject = class extends NodeObject { } } break; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: if (getAssignmentDeclarationKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -152221,7 +153129,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h synchronizeHostData(); return ts_Completions_exports.getCompletionEntrySymbol(program, log, getValidSourceFile(fileName), position, { name, source }, host, preferences); } - function getQuickInfoAtPosition(fileName, position) { + function getQuickInfoAtPosition(fileName, position, maximumLength, verbosityLevel) { synchronizeHostData(); const sourceFile = getValidSourceFile(fileName); const node = getTouchingPropertyName(sourceFile, position); @@ -152237,19 +153145,42 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h kind: "" /* unknown */, kindModifiers: "" /* none */, textSpan: createTextSpanFromNode(nodeForQuickInfo, sourceFile), - displayParts: typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => typeToDisplayParts(typeChecker2, type, getContainerNode(nodeForQuickInfo))), + displayParts: typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => typeToDisplayParts( + typeChecker2, + type, + getContainerNode(nodeForQuickInfo), + /*flags*/ + void 0, + verbosityLevel + )), documentation: type.symbol ? type.symbol.getDocumentationComment(typeChecker) : void 0, tags: type.symbol ? type.symbol.getJsDocTags(typeChecker) : void 0 }; } - const { symbolKind, displayParts, documentation, tags } = typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker2, symbol, sourceFile, getContainerNode(nodeForQuickInfo), nodeForQuickInfo)); + const { symbolKind, displayParts, documentation, tags, canIncreaseVerbosityLevel } = typeChecker.runWithCancellationToken( + cancellationToken, + (typeChecker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind( + typeChecker2, + symbol, + sourceFile, + getContainerNode(nodeForQuickInfo), + nodeForQuickInfo, + /*semanticMeaning*/ + void 0, + /*alias*/ + void 0, + maximumLength ?? defaultHoverMaximumTruncationLength, + verbosityLevel + ) + ); return { kind: symbolKind, kindModifiers: ts_SymbolDisplay_exports.getSymbolModifiers(typeChecker, symbol), textSpan: createTextSpanFromNode(nodeForQuickInfo, sourceFile), displayParts, documentation, - tags + tags, + canIncreaseVerbosityLevel }; } function preparePasteEditsForFile(fileName, copiedTextRange) { @@ -152291,19 +153222,19 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h function shouldGetType(sourceFile, node, position) { switch (node.kind) { case 80 /* Identifier */: - if (node.flags & 16777216 /* JSDoc */ && !isInJSFile(node) && (node.parent.kind === 171 /* PropertySignature */ && node.parent.name === node || findAncestor(node, (n) => n.kind === 169 /* Parameter */))) { + if (node.flags & 16777216 /* JSDoc */ && !isInJSFile(node) && (node.parent.kind === 172 /* PropertySignature */ && node.parent.name === node || findAncestor(node, (n) => n.kind === 170 /* Parameter */))) { return false; } return !isLabelName(node) && !isTagName(node) && !isConstTypeReference(node.parent); - case 211 /* PropertyAccessExpression */: - case 166 /* QualifiedName */: + case 212 /* PropertyAccessExpression */: + case 167 /* QualifiedName */: return !isInComment(sourceFile, position); case 110 /* ThisKeyword */: - case 197 /* ThisType */: + case 198 /* ThisType */: case 108 /* SuperKeyword */: - case 202 /* NamedTupleMember */: + case 203 /* NamedTupleMember */: return true; - case 236 /* MetaProperty */: + case 237 /* MetaProperty */: return isImportMeta(node); default: return false; @@ -152397,15 +153328,15 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h return void 0; } switch (node.kind) { - case 211 /* PropertyAccessExpression */: - case 166 /* QualifiedName */: + case 212 /* PropertyAccessExpression */: + case 167 /* QualifiedName */: case 11 /* StringLiteral */: case 97 /* FalseKeyword */: case 112 /* TrueKeyword */: case 106 /* NullKeyword */: case 108 /* SuperKeyword */: case 110 /* ThisKeyword */: - case 197 /* ThisType */: + case 198 /* ThisType */: case 80 /* Identifier */: break; // Cant create the text span @@ -152417,7 +153348,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h if (isRightSideOfPropertyAccess(nodeForStartPos) || isRightSideOfQualifiedName(nodeForStartPos)) { nodeForStartPos = nodeForStartPos.parent; } else if (isNameOfModuleDeclaration(nodeForStartPos)) { - if (nodeForStartPos.parent.parent.kind === 267 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { + if (nodeForStartPos.parent.parent.kind === 268 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { nodeForStartPos = nodeForStartPos.parent.parent.name; } else { break; @@ -152594,7 +153525,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h function getLinkedEditingRangeAtPosition(fileName, position) { const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); const token = findPrecedingToken(position, sourceFile); - if (!token || token.parent.kind === 307 /* SourceFile */) return void 0; + if (!token || token.parent.kind === 308 /* SourceFile */) return void 0; const jsxTagWordPattern = "[a-zA-Z0-9:\\-\\._$]*"; if (isJsxFragment(token.parent.parent)) { const openFragment = token.parent.parent.openingFragment; @@ -153113,7 +154044,7 @@ function initializeNameTable(sourceFile) { }); } function literalIsName(node) { - return isDeclarationName(node) || node.parent.kind === 283 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || isLiteralComputedPropertyDeclarationName(node); + return isDeclarationName(node) || node.parent.kind === 284 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || isLiteralComputedPropertyDeclarationName(node); } function getContainingObjectLiteralElement(node) { const element = getContainingObjectLiteralElementWorker(node); @@ -153124,12 +154055,13 @@ function getContainingObjectLiteralElementWorker(node) { case 11 /* StringLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: case 9 /* NumericLiteral */: - if (node.parent.kind === 167 /* ComputedPropertyName */) { + if (node.parent.kind === 168 /* ComputedPropertyName */) { return isObjectLiteralElement(node.parent.parent) ? node.parent.parent : void 0; } // falls through case 80 /* Identifier */: - return isObjectLiteralElement(node.parent) && (node.parent.parent.kind === 210 /* ObjectLiteralExpression */ || node.parent.parent.kind === 292 /* JsxAttributes */) && node.parent.name === node ? node.parent : void 0; + case 296 /* JsxNamespacedName */: + return isObjectLiteralElement(node.parent) && (node.parent.parent.kind === 211 /* ObjectLiteralExpression */ || node.parent.parent.kind === 293 /* JsxAttributes */) && node.parent.name === node ? node.parent : void 0; } return void 0; } @@ -153169,7 +154101,7 @@ function getPropertySymbolsFromContextualType(node, checker, contextualType, uni return deduplicate(discriminatedPropertySymbols, equateValues); } function isArgumentOfElementAccessExpression(node) { - return node && node.parent && node.parent.kind === 212 /* ElementAccessExpression */ && node.parent.argumentExpression === node; + return node && node.parent && node.parent.kind === 213 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } function getDefaultLibFilePath(options) { if (sys) { @@ -153261,92 +154193,92 @@ function spanInSourceFileAtLocation(sourceFile, position) { if (node) { const { parent: parent2 } = node; switch (node.kind) { - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 260 /* VariableDeclaration */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: + case 261 /* VariableDeclaration */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: return spanInVariableDeclaration(node); - case 169 /* Parameter */: + case 170 /* Parameter */: return spanInParameterDeclaration(node); - case 262 /* FunctionDeclaration */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 176 /* Constructor */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 177 /* Constructor */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 241 /* Block */: + case 242 /* Block */: if (isFunctionBlock(node)) { return spanInFunctionBlock(node); } // falls through - case 268 /* ModuleBlock */: + case 269 /* ModuleBlock */: return spanInBlock(node); - case 299 /* CatchClause */: + case 300 /* CatchClause */: return spanInBlock(node.block); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return textSpan(node.expression); - case 253 /* ReturnStatement */: + case 254 /* ReturnStatement */: return textSpan(node.getChildAt(0), node.expression); - case 247 /* WhileStatement */: + case 248 /* WhileStatement */: return textSpanEndingAtNextToken(node, node.expression); - case 246 /* DoStatement */: + case 247 /* DoStatement */: return spanInNode(node.statement); - case 259 /* DebuggerStatement */: + case 260 /* DebuggerStatement */: return textSpan(node.getChildAt(0)); - case 245 /* IfStatement */: + case 246 /* IfStatement */: return textSpanEndingAtNextToken(node, node.expression); - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return spanInNode(node.statement); - case 252 /* BreakStatement */: - case 251 /* ContinueStatement */: + case 253 /* BreakStatement */: + case 252 /* ContinueStatement */: return textSpan(node.getChildAt(0), node.label); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return spanInForStatement(node); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return textSpanEndingAtNextToken(node, node.expression); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return spanInInitializerOfForLike(node); - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return textSpanEndingAtNextToken(node, node.expression); - case 296 /* CaseClause */: - case 297 /* DefaultClause */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: return spanInNode(node.statements[0]); - case 258 /* TryStatement */: + case 259 /* TryStatement */: return spanInBlock(node.tryBlock); - case 257 /* ThrowStatement */: + case 258 /* ThrowStatement */: return textSpan(node, node.expression); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return textSpan(node, node.expression); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return textSpan(node, node.moduleReference); - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return textSpan(node, node.moduleSpecifier); - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: return textSpan(node, node.moduleSpecifier); - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: if (getModuleInstanceState(node) !== 1 /* Instantiated */) { return void 0; } // falls through - case 263 /* ClassDeclaration */: - case 266 /* EnumDeclaration */: - case 306 /* EnumMember */: - case 208 /* BindingElement */: + case 264 /* ClassDeclaration */: + case 267 /* EnumDeclaration */: + case 307 /* EnumMember */: + case 209 /* BindingElement */: return textSpan(node); - case 254 /* WithStatement */: + case 255 /* WithStatement */: return spanInNode(node.statement); - case 170 /* Decorator */: + case 171 /* Decorator */: return spanInNodeArray(parent2.modifiers, node, isDecorator); - case 206 /* ObjectBindingPattern */: - case 207 /* ArrayBindingPattern */: + case 207 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: return void 0; // Tokens: case 27 /* SemicolonToken */: @@ -153382,10 +154314,10 @@ function spanInSourceFileAtLocation(sourceFile, position) { if (isArrayLiteralOrObjectLiteralDestructuringPattern(node)) { return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node); } - if ((node.kind === 80 /* Identifier */ || node.kind === 230 /* SpreadElement */ || node.kind === 303 /* PropertyAssignment */ || node.kind === 304 /* ShorthandPropertyAssignment */) && isArrayLiteralOrObjectLiteralDestructuringPattern(parent2)) { + if ((node.kind === 80 /* Identifier */ || node.kind === 231 /* SpreadElement */ || node.kind === 304 /* PropertyAssignment */ || node.kind === 305 /* ShorthandPropertyAssignment */) && isArrayLiteralOrObjectLiteralDestructuringPattern(parent2)) { return textSpan(node); } - if (node.kind === 226 /* BinaryExpression */) { + if (node.kind === 227 /* BinaryExpression */) { const { left, operatorToken } = node; if (isArrayLiteralOrObjectLiteralDestructuringPattern(left)) { return spanInArrayLiteralOrObjectLiteralDestructuringPattern( @@ -153401,19 +154333,19 @@ function spanInSourceFileAtLocation(sourceFile, position) { } if (isExpressionNode(node)) { switch (parent2.kind) { - case 246 /* DoStatement */: + case 247 /* DoStatement */: return spanInPreviousNode(node); - case 170 /* Decorator */: + case 171 /* Decorator */: return spanInNode(node.parent); - case 248 /* ForStatement */: - case 250 /* ForOfStatement */: + case 249 /* ForStatement */: + case 251 /* ForOfStatement */: return textSpan(node); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: if (node.parent.operatorToken.kind === 28 /* CommaToken */) { return textSpan(node); } break; - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: if (node.parent.body === node) { return textSpan(node); } @@ -153421,25 +154353,25 @@ function spanInSourceFileAtLocation(sourceFile, position) { } } switch (node.parent.kind) { - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: if (node.parent.name === node && !isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } break; - case 216 /* TypeAssertionExpression */: + case 217 /* TypeAssertionExpression */: if (node.parent.type === node) { return spanInNextNode(node.parent.type); } break; - case 260 /* VariableDeclaration */: - case 169 /* Parameter */: { + case 261 /* VariableDeclaration */: + case 170 /* Parameter */: { const { initializer, type } = node.parent; if (initializer === node || type === node || isAssignmentOperator(node.kind)) { return spanInPreviousNode(node); } break; } - case 226 /* BinaryExpression */: { + case 227 /* BinaryExpression */: { const { left } = node.parent; if (isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { return spanInPreviousNode(node); @@ -153462,14 +154394,14 @@ function spanInSourceFileAtLocation(sourceFile, position) { } } function spanInVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.parent.kind === 249 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 250 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } const parent2 = variableDeclaration.parent; if (isBindingPattern(variableDeclaration.name)) { return spanInBindingPattern(variableDeclaration.name); } - if (hasOnlyExpressionInitializer(variableDeclaration) && variableDeclaration.initializer || hasSyntacticModifier(variableDeclaration, 32 /* Export */) || parent2.parent.kind === 250 /* ForOfStatement */) { + if (hasOnlyExpressionInitializer(variableDeclaration) && variableDeclaration.initializer || hasSyntacticModifier(variableDeclaration, 32 /* Export */) || parent2.parent.kind === 251 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } if (isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] !== variableDeclaration) { @@ -153496,7 +154428,7 @@ function spanInSourceFileAtLocation(sourceFile, position) { } } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { - return hasSyntacticModifier(functionDeclaration, 32 /* Export */) || functionDeclaration.parent.kind === 263 /* ClassDeclaration */ && functionDeclaration.kind !== 176 /* Constructor */; + return hasSyntacticModifier(functionDeclaration, 32 /* Export */) || functionDeclaration.parent.kind === 264 /* ClassDeclaration */ && functionDeclaration.kind !== 177 /* Constructor */; } function spanInFunctionDeclaration(functionDeclaration) { if (!functionDeclaration.body) { @@ -153516,25 +154448,25 @@ function spanInSourceFileAtLocation(sourceFile, position) { } function spanInBlock(block) { switch (block.parent.kind) { - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: if (getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return void 0; } // Set on parent if on same line otherwise on first statement // falls through - case 247 /* WhileStatement */: - case 245 /* IfStatement */: - case 249 /* ForInStatement */: + case 248 /* WhileStatement */: + case 246 /* IfStatement */: + case 250 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 248 /* ForStatement */: - case 250 /* ForOfStatement */: + case 249 /* ForStatement */: + case 251 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 261 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 262 /* VariableDeclarationList */) { const variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { return spanInNode(variableDeclarationList.declarations[0]); @@ -153555,62 +154487,62 @@ function spanInSourceFileAtLocation(sourceFile, position) { } } function spanInBindingPattern(bindingPattern) { - const firstBindingElement = forEach(bindingPattern.elements, (element) => element.kind !== 232 /* OmittedExpression */ ? element : void 0); + const firstBindingElement = forEach(bindingPattern.elements, (element) => element.kind !== 233 /* OmittedExpression */ ? element : void 0); if (firstBindingElement) { return spanInNode(firstBindingElement); } - if (bindingPattern.parent.kind === 208 /* BindingElement */) { + if (bindingPattern.parent.kind === 209 /* BindingElement */) { return textSpan(bindingPattern.parent); } return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node2) { - Debug.assert(node2.kind !== 207 /* ArrayBindingPattern */ && node2.kind !== 206 /* ObjectBindingPattern */); - const elements = node2.kind === 209 /* ArrayLiteralExpression */ ? node2.elements : node2.properties; - const firstBindingElement = forEach(elements, (element) => element.kind !== 232 /* OmittedExpression */ ? element : void 0); + Debug.assert(node2.kind !== 208 /* ArrayBindingPattern */ && node2.kind !== 207 /* ObjectBindingPattern */); + const elements = node2.kind === 210 /* ArrayLiteralExpression */ ? node2.elements : node2.properties; + const firstBindingElement = forEach(elements, (element) => element.kind !== 233 /* OmittedExpression */ ? element : void 0); if (firstBindingElement) { return spanInNode(firstBindingElement); } - return textSpan(node2.parent.kind === 226 /* BinaryExpression */ ? node2.parent : node2); + return textSpan(node2.parent.kind === 227 /* BinaryExpression */ ? node2.parent : node2); } function spanInOpenBraceToken(node2) { switch (node2.parent.kind) { - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: const enumDeclaration = node2.parent; return spanInNodeIfStartsOnSameLine(findPrecedingToken(node2.pos, sourceFile, node2.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: const classDeclaration = node2.parent; return spanInNodeIfStartsOnSameLine(findPrecedingToken(node2.pos, sourceFile, node2.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 269 /* CaseBlock */: + case 270 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node2.parent.parent, node2.parent.clauses[0]); } return spanInNode(node2.parent); } function spanInCloseBraceToken(node2) { switch (node2.parent.kind) { - case 268 /* ModuleBlock */: + case 269 /* ModuleBlock */: if (getModuleInstanceState(node2.parent.parent) !== 1 /* Instantiated */) { return void 0; } // falls through - case 266 /* EnumDeclaration */: - case 263 /* ClassDeclaration */: + case 267 /* EnumDeclaration */: + case 264 /* ClassDeclaration */: return textSpan(node2); - case 241 /* Block */: + case 242 /* Block */: if (isFunctionBlock(node2.parent)) { return textSpan(node2); } // falls through - case 299 /* CatchClause */: + case 300 /* CatchClause */: return spanInNode(lastOrUndefined(node2.parent.statements)); - case 269 /* CaseBlock */: + case 270 /* CaseBlock */: const caseBlock = node2.parent; const lastClause = lastOrUndefined(caseBlock.clauses); if (lastClause) { return spanInNode(lastOrUndefined(lastClause.statements)); } return void 0; - case 206 /* ObjectBindingPattern */: + case 207 /* ObjectBindingPattern */: const bindingPattern = node2.parent; return spanInNode(lastOrUndefined(bindingPattern.elements) || bindingPattern); // Default to parent node @@ -153624,7 +154556,7 @@ function spanInSourceFileAtLocation(sourceFile, position) { } function spanInCloseBracketToken(node2) { switch (node2.parent.kind) { - case 207 /* ArrayBindingPattern */: + case 208 /* ArrayBindingPattern */: const bindingPattern = node2.parent; return textSpan(lastOrUndefined(bindingPattern.elements) || bindingPattern); default: @@ -153636,32 +154568,32 @@ function spanInSourceFileAtLocation(sourceFile, position) { } } function spanInOpenParenToken(node2) { - if (node2.parent.kind === 246 /* DoStatement */ || // Go to while keyword and do action instead - node2.parent.kind === 213 /* CallExpression */ || node2.parent.kind === 214 /* NewExpression */) { + if (node2.parent.kind === 247 /* DoStatement */ || // Go to while keyword and do action instead + node2.parent.kind === 214 /* CallExpression */ || node2.parent.kind === 215 /* NewExpression */) { return spanInPreviousNode(node2); } - if (node2.parent.kind === 217 /* ParenthesizedExpression */) { + if (node2.parent.kind === 218 /* ParenthesizedExpression */) { return spanInNextNode(node2); } return spanInNode(node2.parent); } function spanInCloseParenToken(node2) { switch (node2.parent.kind) { - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 176 /* Constructor */: - case 247 /* WhileStatement */: - case 246 /* DoStatement */: - case 248 /* ForStatement */: - case 250 /* ForOfStatement */: - case 213 /* CallExpression */: - case 214 /* NewExpression */: - case 217 /* ParenthesizedExpression */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 177 /* Constructor */: + case 248 /* WhileStatement */: + case 247 /* DoStatement */: + case 249 /* ForStatement */: + case 251 /* ForOfStatement */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: + case 218 /* ParenthesizedExpression */: return spanInPreviousNode(node2); // Default to parent node default: @@ -153669,25 +154601,25 @@ function spanInSourceFileAtLocation(sourceFile, position) { } } function spanInColonToken(node2) { - if (isFunctionLike(node2.parent) || node2.parent.kind === 303 /* PropertyAssignment */ || node2.parent.kind === 169 /* Parameter */) { + if (isFunctionLike(node2.parent) || node2.parent.kind === 304 /* PropertyAssignment */ || node2.parent.kind === 170 /* Parameter */) { return spanInPreviousNode(node2); } return spanInNode(node2.parent); } function spanInGreaterThanOrLessThanToken(node2) { - if (node2.parent.kind === 216 /* TypeAssertionExpression */) { + if (node2.parent.kind === 217 /* TypeAssertionExpression */) { return spanInNextNode(node2); } return spanInNode(node2.parent); } function spanInWhileKeyword(node2) { - if (node2.parent.kind === 246 /* DoStatement */) { + if (node2.parent.kind === 247 /* DoStatement */) { return textSpanEndingAtNextToken(node2, node2.parent.expression); } return spanInNode(node2.parent); } function spanInOfKeyword(node2) { - if (node2.parent.kind === 250 /* ForOfStatement */) { + if (node2.parent.kind === 251 /* ForOfStatement */) { return spanInNextNode(node2); } return spanInNode(node2.parent); @@ -153779,16 +154711,16 @@ function getCallHierarchItemContainerName(node) { return; } switch (node.kind) { - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 174 /* MethodDeclaration */: - if (node.parent.kind === 210 /* ObjectLiteralExpression */) { + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 175 /* MethodDeclaration */: + if (node.parent.kind === 211 /* ObjectLiteralExpression */) { return (_c = getAssignedName(node.parent)) == null ? void 0 : _c.getText(); } return (_d = getNameOfDeclaration(node.parent)) == null ? void 0 : _d.getText(); - case 262 /* FunctionDeclaration */: - case 263 /* ClassDeclaration */: - case 267 /* ModuleDeclaration */: + case 263 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: + case 268 /* ModuleDeclaration */: if (isModuleBlock(node.parent) && isIdentifier(node.parent.parent.name)) { return node.parent.parent.name.getText(); } @@ -154004,55 +154936,55 @@ function createCallSiteCollector(program, callSites) { } switch (node.kind) { case 80 /* Identifier */: - case 271 /* ImportEqualsDeclaration */: - case 272 /* ImportDeclaration */: - case 278 /* ExportDeclaration */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 273 /* ImportDeclaration */: + case 279 /* ExportDeclaration */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: return; - case 175 /* ClassStaticBlockDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: recordCallSite(node); return; - case 216 /* TypeAssertionExpression */: - case 234 /* AsExpression */: + case 217 /* TypeAssertionExpression */: + case 235 /* AsExpression */: collect(node.expression); return; - case 260 /* VariableDeclaration */: - case 169 /* Parameter */: + case 261 /* VariableDeclaration */: + case 170 /* Parameter */: collect(node.name); collect(node.initializer); return; - case 213 /* CallExpression */: + case 214 /* CallExpression */: recordCallSite(node); collect(node.expression); forEach(node.arguments, collect); return; - case 214 /* NewExpression */: + case 215 /* NewExpression */: recordCallSite(node); collect(node.expression); forEach(node.arguments, collect); return; - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: recordCallSite(node); collect(node.tag); collect(node.template); return; - case 286 /* JsxOpeningElement */: - case 285 /* JsxSelfClosingElement */: + case 287 /* JsxOpeningElement */: + case 286 /* JsxSelfClosingElement */: recordCallSite(node); collect(node.tagName); collect(node.attributes); return; - case 170 /* Decorator */: + case 171 /* Decorator */: recordCallSite(node); collect(node.expression); return; - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: recordCallSite(node); forEachChild(node, collect); break; - case 238 /* SatisfiesExpression */: + case 239 /* SatisfiesExpression */: collect(node.expression); return; } @@ -154105,25 +155037,25 @@ function collectCallSites(program, node) { const callSites = []; const collect = createCallSiteCollector(program, callSites); switch (node.kind) { - case 307 /* SourceFile */: + case 308 /* SourceFile */: collectCallSitesOfSourceFile(node, collect); break; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: collectCallSitesOfModuleDeclaration(node, collect); break; - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect); break; - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: collectCallSitesOfClassLikeDeclaration(node, collect); break; - case 175 /* ClassStaticBlockDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: collectCallSitesOfClassStaticBlockDeclaration(node, collect); break; default: @@ -154182,7 +155114,6 @@ __export(ts_codefix_exports, { generateAccessorFromProperty: () => generateAccessorFromProperty, getAccessorConvertiblePropertyAtPosition: () => getAccessorConvertiblePropertyAtPosition, getAllFixes: () => getAllFixes, - getAllSupers: () => getAllSupers, getFixes: () => getFixes, getImportCompletionAction: () => getImportCompletionAction, getImportKind: () => getImportKind, @@ -154522,7 +155453,7 @@ function findAwaitableInitializers(expression, sourceFile, cancellationToken, pr } const declaration = tryCast(symbol.valueDeclaration, isVariableDeclaration); const variableName = declaration && tryCast(declaration.name, isIdentifier); - const variableStatement = getAncestor(declaration, 243 /* VariableStatement */); + const variableStatement = getAncestor(declaration, 244 /* VariableStatement */); if (!declaration || !variableStatement || declaration.type || !declaration.initializer || variableStatement.getSourceFile() !== sourceFile || hasSyntacticModifier(variableStatement, 32 /* Export */) || !variableName || !isInsideAwaitableBody(declaration.initializer)) { isCompleteFix = false; continue; @@ -154581,7 +155512,7 @@ function symbolReferenceIsAlsoMissingAwait(reference, diagnostics, sourceFile, c checker.getTypeAtLocation(errorNode).flags & 1 /* Any */; } function isInsideAwaitableBody(node) { - return node.flags & 65536 /* AwaitContext */ || !!findAncestor(node, (ancestor) => ancestor.parent && isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || isBlock(ancestor) && (ancestor.parent.kind === 262 /* FunctionDeclaration */ || ancestor.parent.kind === 218 /* FunctionExpression */ || ancestor.parent.kind === 219 /* ArrowFunction */ || ancestor.parent.kind === 174 /* MethodDeclaration */)); + return node.flags & 65536 /* AwaitContext */ || !!findAncestor(node, (ancestor) => ancestor.parent && isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || isBlock(ancestor) && (ancestor.parent.kind === 263 /* FunctionDeclaration */ || ancestor.parent.kind === 219 /* FunctionExpression */ || ancestor.parent.kind === 220 /* ArrowFunction */ || ancestor.parent.kind === 175 /* MethodDeclaration */)); } function makeChange3(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) { if (isForOfStatement(insertionSite.parent) && !insertionSite.parent.awaitModifier) { @@ -154696,10 +155627,10 @@ function applyChange(changeTracker, initializer, sourceFile, fixedNodes) { function isPossiblyPartOfDestructuring(node) { switch (node.kind) { case 80 /* Identifier */: - case 209 /* ArrayLiteralExpression */: - case 210 /* ObjectLiteralExpression */: - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: + case 210 /* ArrayLiteralExpression */: + case 211 /* ObjectLiteralExpression */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return true; default: return false; @@ -154716,7 +155647,7 @@ function arrayElementCouldBeVariableDeclaration(expression, checker) { function isPossiblyPartOfCommaSeperatedInitializer(node) { switch (node.kind) { case 80 /* Identifier */: - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: case 28 /* CommaToken */: return true; default: @@ -154758,7 +155689,7 @@ function makeChange5(changeTracker, sourceFile, pos, fixedNodes) { return; } const declaration = token.parent; - if (declaration.kind === 172 /* PropertyDeclaration */ && (!fixedNodes || tryAddToSet(fixedNodes, declaration))) { + if (declaration.kind === 173 /* PropertyDeclaration */ && (!fixedNodes || tryAddToSet(fixedNodes, declaration))) { changeTracker.insertModifierBefore(sourceFile, 138 /* DeclareKeyword */, declaration); } } @@ -154842,7 +155773,7 @@ function makeChange7(changeTracker, sourceFile, pos, program, host, preferences) ) ]) ); - if (importNode.kind === 272 /* ImportDeclaration */) { + if (importNode.kind === 273 /* ImportDeclaration */) { changeTracker.replaceNode( sourceFile, importNode, @@ -154990,7 +155921,7 @@ function addUndefinedToOptionalProperty(changes, toAdd) { const d = add.valueDeclaration; if (d && (isPropertySignature(d) || isPropertyDeclaration(d)) && d.type) { const t = factory.createUnionTypeNode([ - ...d.type.kind === 192 /* UnionType */ ? d.type.types : [d.type], + ...d.type.kind === 193 /* UnionType */ ? d.type.types : [d.type], factory.createTypeReferenceNode("undefined") ]); changes.replaceNode(d.getSourceFile(), d.type, t); @@ -155051,26 +155982,26 @@ function doChange8(changes, sourceFile, decl) { } } function isDeclarationWithType(node) { - return isFunctionLikeDeclaration(node) || node.kind === 260 /* VariableDeclaration */ || node.kind === 171 /* PropertySignature */ || node.kind === 172 /* PropertyDeclaration */; + return isFunctionLikeDeclaration(node) || node.kind === 261 /* VariableDeclaration */ || node.kind === 172 /* PropertySignature */ || node.kind === 173 /* PropertyDeclaration */; } function transformJSDocType(node) { switch (node.kind) { - case 312 /* JSDocAllType */: - case 313 /* JSDocUnknownType */: + case 313 /* JSDocAllType */: + case 314 /* JSDocUnknownType */: return factory.createTypeReferenceNode("any", emptyArray); - case 316 /* JSDocOptionalType */: + case 317 /* JSDocOptionalType */: return transformJSDocOptionalType(node); - case 315 /* JSDocNonNullableType */: + case 316 /* JSDocNonNullableType */: return transformJSDocType(node.type); - case 314 /* JSDocNullableType */: + case 315 /* JSDocNullableType */: return transformJSDocNullableType(node); - case 318 /* JSDocVariadicType */: + case 319 /* JSDocVariadicType */: return transformJSDocVariadicType(node); - case 317 /* JSDocFunctionType */: + case 318 /* JSDocFunctionType */: return transformJSDocFunctionType(node); - case 183 /* TypeReference */: + case 184 /* TypeReference */: return transformJSDocTypeReference(node); - case 322 /* JSDocTypeLiteral */: + case 323 /* JSDocTypeLiteral */: return transformJSDocTypeLiteral(node); default: const visited = visitEachChild( @@ -155108,7 +156039,7 @@ function transformJSDocFunctionType(node) { } function transformJSDocParameter(node) { const index = node.parent.parameters.indexOf(node); - const isRest = node.type.kind === 318 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; + const isRest = node.type.kind === 319 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; const name = node.name || (isRest ? "rest" : "arg" + index); const dotdotdot = isRest ? factory.createToken(26 /* DotDotDotToken */) : node.dotDotDotToken; return factory.createParameterDeclaration(node.modifiers, dotdotdot, name, node.questionToken, visitNode(node.type, transformJSDocType, isTypeNode), node.initializer); @@ -155271,7 +156202,7 @@ function doChange9(changes, sourceFile, position, checker, preferences, compiler })) { return; } - const nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 244 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; + const nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 245 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; changes.delete(sourceFile, nodeToDelete); if (!assignmentExpr) { members.push(factory.createPropertyDeclaration( @@ -155351,7 +156282,7 @@ function doChange9(changes, sourceFile, position, checker, preferences, compiler function createArrowFunctionExpressionMember(members2, arrowFunction, name) { const arrowFunctionBody = arrowFunction.body; let bodyBlock; - if (arrowFunctionBody.kind === 241 /* Block */) { + if (arrowFunctionBody.kind === 242 /* Block */) { bodyBlock = arrowFunctionBody; } else { bodyBlock = factory.createBlock([factory.createReturnStatement(arrowFunctionBody)]); @@ -155890,7 +156821,7 @@ function transformCallbackArgument(func, hasContinuation, continuationArgName, i switch (func.kind) { case 106 /* NullKeyword */: break; - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: case 80 /* Identifier */: if (!inputArgName) { break; @@ -155915,8 +156846,8 @@ function transformCallbackArgument(func, hasContinuation, continuationArgName, i continuationArgName.types.push(transformer.checker.getAwaitedType(returnType) || returnType); } return varDeclOrAssignment; - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: { + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: { const funcBody = func.body; const returnType2 = (_a = getLastCallSignature(transformer.checker.getTypeAtLocation(func), transformer.checker)) == null ? void 0 : _a.getReturnType(); if (isBlock(funcBody)) { @@ -156151,7 +157082,7 @@ function fixImportOfModuleExports(importingFile, exportingFile, program, changes } const importNode = importFromModuleSpecifier(moduleSpecifier); switch (importNode.kind) { - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: changes.replaceNode(importingFile, importNode, makeImport( importNode.name, /*namedImports*/ @@ -156160,7 +157091,7 @@ function fixImportOfModuleExports(importingFile, exportingFile, program, changes quotePreference )); break; - case 213 /* CallExpression */: + case 214 /* CallExpression */: if (isRequireCall( importNode, /*requireStringLiteralLikeArgument*/ @@ -156229,13 +157160,13 @@ function forEachExportReference(sourceFile, cb) { } function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports2, useSitesToUnqualify, quotePreference) { switch (statement.kind) { - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); return false; - case 244 /* ExpressionStatement */: { + case 245 /* ExpressionStatement */: { const { expression } = statement; switch (expression.kind) { - case 213 /* CallExpression */: { + case 214 /* CallExpression */: { if (isRequireCall( expression, /*requireStringLiteralLikeArgument*/ @@ -156252,7 +157183,7 @@ function convertStatement(sourceFile, statement, checker, changes, identifiers, } return false; } - case 226 /* BinaryExpression */: { + case 227 /* BinaryExpression */: { const { operatorToken } = expression; return operatorToken.kind === 64 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports2, useSitesToUnqualify); } @@ -156307,8 +157238,8 @@ function convertVariableStatement(sourceFile, statement, changes, checker, ident } function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) { switch (name.kind) { - case 206 /* ObjectBindingPattern */: - case 207 /* ArrayBindingPattern */: { + case 207 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: { const tmp = makeUniqueName(propertyName, identifiers); return convertedImports([ makeSingleImport(tmp, propertyName, moduleSpecifier, quotePreference), @@ -156356,16 +157287,16 @@ function convertAssignment(sourceFile, checker, assignment, changes, exports2, u function tryChangeModuleExportsObject(object, useSitesToUnqualify) { const statements = mapAllOrFail(object.properties, (prop) => { switch (prop.kind) { - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. // falls through - case 304 /* ShorthandPropertyAssignment */: - case 305 /* SpreadAssignment */: + case 305 /* ShorthandPropertyAssignment */: + case 306 /* SpreadAssignment */: return void 0; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return !isIdentifier(prop.name) ? void 0 : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer, useSitesToUnqualify); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return !isIdentifier(prop.name) ? void 0 : functionExpressionToDeclaration(prop.name.text, [factory.createToken(95 /* ExportKeyword */)], prop, useSitesToUnqualify); default: Debug.assertNever(prop, `Convert to ES6 got invalid prop kind ${prop.kind}`); @@ -156435,16 +157366,16 @@ function convertExportsPropertyAssignment({ left, right, parent: parent2 }, sour function convertExportsDotXEquals_replaceNode(name, exported, useSitesToUnqualify) { const modifiers = [factory.createToken(95 /* ExportKeyword */)]; switch (exported.kind) { - case 218 /* FunctionExpression */: { + case 219 /* FunctionExpression */: { const { name: expressionName } = exported; if (expressionName && expressionName.text !== name) { return exportConst(); } } // falls through - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return functionExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return classExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify); default: return exportConst(); @@ -156469,7 +157400,7 @@ function replaceImportUseSites(nodeOrNodes, useSitesToUnqualify) { replaceNode ); function replaceNode(original) { - if (original.kind === 211 /* PropertyAccessExpression */) { + if (original.kind === 212 /* PropertyAccessExpression */) { const replacement = useSitesToUnqualify.get(original); useSitesToUnqualify.delete(original); return replacement; @@ -156478,7 +157409,7 @@ function replaceImportUseSites(nodeOrNodes, useSitesToUnqualify) { } function convertSingleImport(name, moduleSpecifier, checker, identifiers, target, quotePreference) { switch (name.kind) { - case 206 /* ObjectBindingPattern */: { + case 207 /* ObjectBindingPattern */: { const importSpecifiers = mapAllOrFail(name.elements, (e) => e.dotDotDotToken || e.initializer || e.propertyName && !isIdentifier(e.propertyName) || !isIdentifier(e.name) ? void 0 : makeImportSpecifier2(e.propertyName && e.propertyName.text, e.name.text)); if (importSpecifiers) { return convertedImports([makeImport( @@ -156491,7 +157422,7 @@ function convertSingleImport(name, moduleSpecifier, checker, identifiers, target } } // falls through -- object destructuring has an interesting pattern and must be a variable declaration - case 207 /* ArrayBindingPattern */: { + case 208 /* ArrayBindingPattern */: { const tmp = makeUniqueName(moduleSpecifierToValidIdentifier(moduleSpecifier.text, target), identifiers); return convertedImports([ makeImport( @@ -156577,11 +157508,11 @@ function forEachFreeIdentifier(node, cb) { function isFreeIdentifier(node) { const { parent: parent2 } = node; switch (parent2.kind) { - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return parent2.name !== node; - case 208 /* BindingElement */: + case 209 /* BindingElement */: return parent2.propertyName !== node; - case 276 /* ImportSpecifier */: + case 277 /* ImportSpecifier */: return parent2.propertyName !== node; default: return true; @@ -156791,11 +157722,11 @@ registerCodeFix({ const declaration = getDeclaration2(context.sourceFile, context.span.start); if (declaration) { const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, context.sourceFile, declaration)); - const importDeclarationChanges = declaration.kind === 276 /* ImportSpecifier */ && isImportDeclaration(declaration.parent.parent.parent) && canConvertImportDeclarationForSpecifier(declaration, context.sourceFile, context.program) ? ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, context.sourceFile, declaration.parent.parent.parent)) : void 0; + const importDeclarationChanges = declaration.kind === 277 /* ImportSpecifier */ && isImportDeclaration(declaration.parent.parent.parent) && canConvertImportDeclarationForSpecifier(declaration, context.sourceFile, context.program) ? ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, context.sourceFile, declaration.parent.parent.parent)) : void 0; const mainAction = createCodeFixAction( fixId14, changes, - declaration.kind === 276 /* ImportSpecifier */ ? [Diagnostics.Use_type_0, ((_a = declaration.propertyName) == null ? void 0 : _a.text) ?? declaration.name.text] : Diagnostics.Use_import_type, + declaration.kind === 277 /* ImportSpecifier */ ? [Diagnostics.Use_type_0, ((_a = declaration.propertyName) == null ? void 0 : _a.text) ?? declaration.name.text] : Diagnostics.Use_import_type, fixId14, Diagnostics.Fix_all_with_type_only_imports ); @@ -156814,13 +157745,13 @@ registerCodeFix({ const fixedImportDeclarations = /* @__PURE__ */ new Set(); return codeFixAll(context, errorCodes15, (changes, diag2) => { const errorDeclaration = getDeclaration2(diag2.file, diag2.start); - if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 272 /* ImportDeclaration */ && !fixedImportDeclarations.has(errorDeclaration)) { + if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 273 /* ImportDeclaration */ && !fixedImportDeclarations.has(errorDeclaration)) { doChange11(changes, diag2.file, errorDeclaration); fixedImportDeclarations.add(errorDeclaration); - } else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 276 /* ImportSpecifier */ && isImportDeclaration(errorDeclaration.parent.parent.parent) && !fixedImportDeclarations.has(errorDeclaration.parent.parent.parent) && canConvertImportDeclarationForSpecifier(errorDeclaration, diag2.file, context.program)) { + } else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 277 /* ImportSpecifier */ && isImportDeclaration(errorDeclaration.parent.parent.parent) && !fixedImportDeclarations.has(errorDeclaration.parent.parent.parent) && canConvertImportDeclarationForSpecifier(errorDeclaration, diag2.file, context.program)) { doChange11(changes, diag2.file, errorDeclaration.parent.parent.parent); fixedImportDeclarations.add(errorDeclaration.parent.parent.parent); - } else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 276 /* ImportSpecifier */) { + } else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 277 /* ImportSpecifier */) { doChange11(changes, diag2.file, errorDeclaration); } }); @@ -156871,8 +157802,7 @@ function doChange11(changes, sourceFile, declaration) { true ), factory.createImportClause( - /*isTypeOnly*/ - true, + 156 /* TypeKeyword */, getSynthesizedDeepClone( importClause.name, /*includeTrivia*/ @@ -156899,8 +157829,7 @@ function doChange11(changes, sourceFile, declaration) { true ), factory.createImportClause( - /*isTypeOnly*/ - true, + 156 /* TypeKeyword */, /*name*/ void 0, getSynthesizedDeepClone( @@ -156922,7 +157851,7 @@ function doChange11(changes, sourceFile, declaration) { ) ]); } else { - const newNamedBindings = ((_a = importClause.namedBindings) == null ? void 0 : _a.kind) === 275 /* NamedImports */ ? factory.updateNamedImports( + const newNamedBindings = ((_a = importClause.namedBindings) == null ? void 0 : _a.kind) === 276 /* NamedImports */ ? factory.updateNamedImports( importClause.namedBindings, sameMap(importClause.namedBindings.elements, (e) => factory.updateImportSpecifier( e, @@ -156932,13 +157861,7 @@ function doChange11(changes, sourceFile, declaration) { e.name )) ) : importClause.namedBindings; - const importDeclaration = factory.updateImportDeclaration(declaration, declaration.modifiers, factory.updateImportClause( - importClause, - /*isTypeOnly*/ - true, - importClause.name, - newNamedBindings - ), declaration.moduleSpecifier, declaration.attributes); + const importDeclaration = factory.updateImportDeclaration(declaration, declaration.modifiers, factory.updateImportClause(importClause, 156 /* TypeKeyword */, importClause.name, newNamedBindings), declaration.moduleSpecifier, declaration.attributes); changes.replaceNode(sourceFile, declaration, importDeclaration); } } @@ -157040,10 +157963,10 @@ function createDeclaration(tag) { if (!typeExpression) return; const typeName = (_a = tag.name) == null ? void 0 : _a.getText(); if (!typeName) return; - if (typeExpression.kind === 322 /* JSDocTypeLiteral */) { + if (typeExpression.kind === 323 /* JSDocTypeLiteral */) { return createInterfaceForTypeLiteral(typeName, typeExpression); } - if (typeExpression.kind === 309 /* JSDocTypeExpression */) { + if (typeExpression.kind === 310 /* JSDocTypeExpression */) { return createTypeAliasForTypeExpression(typeName, typeExpression); } } @@ -157460,7 +158383,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre preferences ); let fix; - if (existingFix && importKind !== 2 /* Namespace */) { + if (existingFix && importKind !== 2 /* Namespace */ && existingFix.kind !== 0 /* UseNamespace */ && existingFix.kind !== 1 /* JsdocTypeImport */) { fix = { ...existingFix, addAsTypeOnly, @@ -157534,7 +158457,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre } } function removeExistingImport(declaration) { - if (declaration.kind === 273 /* ImportClause */) { + if (declaration.kind === 274 /* ImportClause */) { Debug.assertIsDefined(declaration.name, "ImportClause should have a name if it's being removed"); } removeExisting.add(declaration); @@ -157675,8 +158598,8 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre const emptyVariableDeclarations = [...variableDeclarationsWithRemovals].filter( (d) => ( // no binding elements being added to the variable declaration - (d.name.kind !== 206 /* ObjectBindingPattern */ || !addToExisting.has(d.name)) && // no binding elements, or all binding elements are being removed - (d.name.kind !== 206 /* ObjectBindingPattern */ || every(d.name.elements, (e) => removeExisting.has(e))) + (d.name.kind !== 207 /* ObjectBindingPattern */ || !addToExisting.has(d.name)) && // no binding elements, or all binding elements are being removed + (d.name.kind !== 207 /* ObjectBindingPattern */ || every(d.name.elements, (e) => removeExisting.has(e))) ) ); const namedBindingsToDelete = [...importDeclarationsWithRemovals].filter( @@ -157687,7 +158610,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre ((_a2 = d.importClause) == null ? void 0 : _a2.namedBindings) && // is not being fully removed emptyImportDeclarations.indexOf(d) === -1 && // is not gaining named imports !((_b2 = addToExisting.get(d.importClause)) == null ? void 0 : _b2.namedImports) && // all named imports are being removed - (d.importClause.namedBindings.kind === 274 /* NamespaceImport */ || every(d.importClause.namedBindings.elements, (e) => removeExisting.has(e))) + (d.importClause.namedBindings.kind === 275 /* NamespaceImport */ || every(d.importClause.namedBindings.elements, (e) => removeExisting.has(e))) ); } ); @@ -157700,7 +158623,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre declaration.importClause, factory.updateImportClause( declaration.importClause, - declaration.importClause.isTypeOnly, + declaration.importClause.phaseModifier, declaration.importClause.name, /*namedBindings*/ void 0 @@ -157710,23 +158633,23 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre for (const declaration of removeExisting) { const importDeclaration = findAncestor(declaration, isImportDeclaration); if (importDeclaration && emptyImportDeclarations.indexOf(importDeclaration) === -1 && namedBindingsToDelete.indexOf(importDeclaration) === -1) { - if (declaration.kind === 273 /* ImportClause */) { + if (declaration.kind === 274 /* ImportClause */) { changeTracker.delete(sourceFile, declaration.name); } else { - Debug.assert(declaration.kind === 276 /* ImportSpecifier */, "NamespaceImport should have been handled earlier"); + Debug.assert(declaration.kind === 277 /* ImportSpecifier */, "NamespaceImport should have been handled earlier"); if ((_a = addToExisting.get(importDeclaration.importClause)) == null ? void 0 : _a.namedImports) { (importSpecifiersToRemoveWhileAdding ?? (importSpecifiersToRemoveWhileAdding = /* @__PURE__ */ new Set())).add(declaration); } else { changeTracker.delete(sourceFile, declaration); } } - } else if (declaration.kind === 208 /* BindingElement */) { + } else if (declaration.kind === 209 /* BindingElement */) { if ((_b = addToExisting.get(declaration.parent)) == null ? void 0 : _b.namedImports) { (importSpecifiersToRemoveWhileAdding ?? (importSpecifiersToRemoveWhileAdding = /* @__PURE__ */ new Set())).add(declaration); } else { changeTracker.delete(sourceFile, declaration); } - } else if (declaration.kind === 271 /* ImportEqualsDeclaration */) { + } else if (declaration.kind === 272 /* ImportEqualsDeclaration */) { changeTracker.delete(sourceFile, declaration); } } @@ -157774,7 +158697,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre const importDeclarations = new Set(mapDefined([...verbatimImports], (d) => findAncestor(d, isImportDeclaration))); const requireStatements = new Set(mapDefined([...verbatimImports], (d) => findAncestor(d, isRequireVariableStatement))); return [ - ...mapDefined([...verbatimImports], (d) => d.kind === 271 /* ImportEqualsDeclaration */ ? getSynthesizedDeepClone( + ...mapDefined([...verbatimImports], (d) => d.kind === 272 /* ImportEqualsDeclaration */ ? getSynthesizedDeepClone( d, /*includeTrivia*/ true @@ -157794,7 +158717,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre d.modifiers, d.importClause && factory.updateImportClause( d.importClause, - d.importClause.isTypeOnly, + d.importClause.phaseModifier, verbatimImports.has(d.importClause) ? d.importClause.name : void 0, verbatimImports.has(d.importClause.namedBindings) ? d.importClause.namedBindings : ((_a = tryCast(d.importClause.namedBindings, isNamedImports)) == null ? void 0 : _a.elements.some((e) => verbatimImports.has(e))) ? factory.updateNamedImports( d.importClause.namedBindings, @@ -157828,7 +158751,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre } return factory.updateVariableDeclaration( d, - d.name.kind === 206 /* ObjectBindingPattern */ ? factory.updateObjectBindingPattern( + d.name.kind === 207 /* ObjectBindingPattern */ ? factory.updateObjectBindingPattern( d.name, d.name.elements.filter((e) => verbatimImports.has(e)) ) : d.name, @@ -157923,7 +158846,7 @@ function getAllExportInfoForSymbol(importingFile, symbol, symbolName2, moduleSym const getChecker = createGetChecker(program, host); const isFileExcluded = preferences.autoImportFileExcludePatterns && getIsFileExcluded(host, preferences); const mergedModuleSymbol = program.getTypeChecker().getMergedSymbol(moduleSymbol); - const moduleSourceFile = isFileExcluded && mergedModuleSymbol.declarations && getDeclarationOfKind(mergedModuleSymbol, 307 /* SourceFile */); + const moduleSourceFile = isFileExcluded && mergedModuleSymbol.declarations && getDeclarationOfKind(mergedModuleSymbol, 308 /* SourceFile */); const moduleSymbolExcluded = moduleSourceFile && isFileExcluded(moduleSourceFile); return getExportInfoMap(importingFile, host, program, preferences, cancellationToken).search(importingFile.path, preferCapitalized, (name) => name === symbolName2, (info) => { const checker = getChecker(info[0].isFromPackageJson); @@ -158001,12 +158924,12 @@ function tryUseExistingNamespaceImport(existingImports, position) { function getNamespaceLikeImportText(declaration) { var _a, _b, _c; switch (declaration.kind) { - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return (_a = tryCast(declaration.name, isIdentifier)) == null ? void 0 : _a.text; - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return declaration.name.text; - case 351 /* JSDocImportTag */: - case 272 /* ImportDeclaration */: + case 352 /* JSDocImportTag */: + case 273 /* ImportDeclaration */: return (_c = tryCast((_b = declaration.importClause) == null ? void 0 : _b.namedBindings, isNamespaceImport)) == null ? void 0 : _c.name.text; default: return Debug.assertNever(declaration); @@ -158034,11 +158957,11 @@ function tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker } return best; function getAddToExistingImportFix({ declaration, importKind, symbol, targetFlags }) { - if (importKind === 3 /* CommonJS */ || importKind === 2 /* Namespace */ || declaration.kind === 271 /* ImportEqualsDeclaration */) { + if (importKind === 3 /* CommonJS */ || importKind === 2 /* Namespace */ || declaration.kind === 272 /* ImportEqualsDeclaration */) { return void 0; } - if (declaration.kind === 260 /* VariableDeclaration */) { - return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 206 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind, moduleSpecifierKind: void 0, moduleSpecifier: declaration.initializer.arguments[0].text, addAsTypeOnly: 4 /* NotAllowed */ } : void 0; + if (declaration.kind === 261 /* VariableDeclaration */) { + return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 207 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind, moduleSpecifierKind: void 0, moduleSpecifier: declaration.initializer.arguments[0].text, addAsTypeOnly: 4 /* NotAllowed */ } : void 0; } const { importClause } = declaration; if (!importClause || !isStringLiteralLike(declaration.moduleSpecifier)) { @@ -158061,7 +158984,7 @@ function tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker addAsTypeOnly === 2 /* Required */ && namedBindings)) { return void 0; } - if (importKind === 0 /* Named */ && (namedBindings == null ? void 0 : namedBindings.kind) === 274 /* NamespaceImport */) { + if (importKind === 0 /* Named */ && (namedBindings == null ? void 0 : namedBindings.kind) === 275 /* NamespaceImport */) { return void 0; } return { @@ -158084,7 +159007,7 @@ function createExistingImportMap(importingFile, program) { if (moduleSymbol) { (importMap || (importMap = createMultiMap())).add(getSymbolId(moduleSymbol), i.parent); } - } else if (i.kind === 272 /* ImportDeclaration */ || i.kind === 271 /* ImportEqualsDeclaration */ || i.kind === 351 /* JSDocImportTag */) { + } else if (i.kind === 273 /* ImportDeclaration */ || i.kind === 272 /* ImportEqualsDeclaration */ || i.kind === 352 /* JSDocImportTag */) { const moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier); if (moduleSymbol) { (importMap || (importMap = createMultiMap())).add(getSymbolId(moduleSymbol), i); @@ -158385,6 +159308,7 @@ function getUmdImportKind(importingFile, program, forceImportKeyword) { return 2 /* Namespace */; case 100 /* Node16 */: case 101 /* Node18 */: + case 102 /* Node20 */: case 199 /* NodeNext */: return getImpliedNodeFormatForEmit(importingFile, program) === 99 /* ESNext */ ? 2 /* Namespace */ : 3 /* CommonJS */; default: @@ -158556,7 +159480,7 @@ function codeActionForFixWorker(changes, sourceFile, symbolName2, fix, includeSy case 4 /* PromoteTypeOnly */: { const { typeOnlyAliasDeclaration } = fix; const promotedDeclaration = promoteFromTypeOnly(changes, typeOnlyAliasDeclaration, program, sourceFile, preferences); - return promotedDeclaration.kind === 276 /* ImportSpecifier */ ? [Diagnostics.Remove_type_from_import_of_0_from_1, symbolName2, getModuleSpecifierText(promotedDeclaration.parent.parent)] : [Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)]; + return promotedDeclaration.kind === 277 /* ImportSpecifier */ ? [Diagnostics.Remove_type_from_import_of_0_from_1, symbolName2, getModuleSpecifierText(promotedDeclaration.parent.parent)] : [Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)]; } default: return Debug.assertNever(fix, `Unexpected fix kind ${fix.kind}`); @@ -158564,13 +159488,13 @@ function codeActionForFixWorker(changes, sourceFile, symbolName2, fix, includeSy } function getModuleSpecifierText(promotedDeclaration) { var _a, _b; - return promotedDeclaration.kind === 271 /* ImportEqualsDeclaration */ ? ((_b = tryCast((_a = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text; + return promotedDeclaration.kind === 272 /* ImportEqualsDeclaration */ ? ((_b = tryCast((_a = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text; } function promoteFromTypeOnly(changes, aliasDeclaration, program, sourceFile, preferences) { const compilerOptions = program.getCompilerOptions(); const convertExistingToTypeOnly = compilerOptions.verbatimModuleSyntax; switch (aliasDeclaration.kind) { - case 276 /* ImportSpecifier */: + case 277 /* ImportSpecifier */: if (aliasDeclaration.isTypeOnly) { if (aliasDeclaration.parent.elements.length > 1) { const newSpecifier = factory.updateImportSpecifier( @@ -158595,13 +159519,13 @@ function promoteFromTypeOnly(changes, aliasDeclaration, program, sourceFile, pre promoteImportClause(aliasDeclaration.parent.parent); return aliasDeclaration.parent.parent; } - case 273 /* ImportClause */: + case 274 /* ImportClause */: promoteImportClause(aliasDeclaration); return aliasDeclaration; - case 274 /* NamespaceImport */: + case 275 /* NamespaceImport */: promoteImportClause(aliasDeclaration.parent); return aliasDeclaration.parent; - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: changes.deleteRange(sourceFile, aliasDeclaration.getChildAt(1)); return aliasDeclaration; default: @@ -158622,7 +159546,7 @@ function promoteFromTypeOnly(changes, aliasDeclaration, program, sourceFile, pre const namedImports = tryCast(importClause.namedBindings, isNamedImports); if (namedImports && namedImports.elements.length > 1) { const sortState = ts_OrganizeImports_exports.getNamedImportSpecifierComparerWithDetection(importClause.parent, preferences, sourceFile); - if (sortState.isSorted !== false && aliasDeclaration.kind === 276 /* ImportSpecifier */ && namedImports.elements.indexOf(aliasDeclaration) !== 0) { + if (sortState.isSorted !== false && aliasDeclaration.kind === 277 /* ImportSpecifier */ && namedImports.elements.indexOf(aliasDeclaration) !== 0) { changes.delete(sourceFile, aliasDeclaration); changes.insertImportSpecifierAtIndex(sourceFile, aliasDeclaration, namedImports, 0); } @@ -158637,7 +159561,7 @@ function promoteFromTypeOnly(changes, aliasDeclaration, program, sourceFile, pre } function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, removeExistingImportSpecifiers, preferences) { var _a; - if (clause.kind === 206 /* ObjectBindingPattern */) { + if (clause.kind === 207 /* ObjectBindingPattern */) { if (removeExistingImportSpecifiers && clause.elements.some((e) => removeExistingImportSpecifiers.has(e))) { changes.replaceNode( sourceFile, @@ -158797,7 +159721,7 @@ function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImp /*modifiers*/ void 0, factory.createImportClause( - shouldUseTypeOnly(namespaceLikeImport, preferences), + shouldUseTypeOnly(namespaceLikeImport, preferences) ? 156 /* TypeKeyword */ : void 0, /*name*/ void 0, factory.createNamespaceImport(factory.createIdentifier(namespaceLikeImport.name)) @@ -159107,13 +160031,13 @@ function doRemoveOverrideModifierChange(changeTracker, sourceFile, pos) { } function isClassElementLikeHasJSDoc(node) { switch (node.kind) { - case 176 /* Constructor */: - case 172 /* PropertyDeclaration */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 177 /* Constructor */: + case 173 /* PropertyDeclaration */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return true; - case 169 /* Parameter */: + case 170 /* Parameter */: return isParameterPropertyDeclaration(node, node.parent); default: return false; @@ -159392,7 +160316,7 @@ registerCodeFix({ }); function getNamedTupleMember(sourceFile, pos) { const token = getTokenAtPosition(sourceFile, pos); - return findAncestor(token, (t) => t.kind === 202 /* NamedTupleMember */); + return findAncestor(token, (t) => t.kind === 203 /* NamedTupleMember */); } function doChange17(changes, sourceFile, namedTupleMember) { if (!namedTupleMember) { @@ -159401,10 +160325,10 @@ function doChange17(changes, sourceFile, namedTupleMember) { let unwrappedType = namedTupleMember.type; let sawOptional = false; let sawRest = false; - while (unwrappedType.kind === 190 /* OptionalType */ || unwrappedType.kind === 191 /* RestType */ || unwrappedType.kind === 196 /* ParenthesizedType */) { - if (unwrappedType.kind === 190 /* OptionalType */) { + while (unwrappedType.kind === 191 /* OptionalType */ || unwrappedType.kind === 192 /* RestType */ || unwrappedType.kind === 197 /* ParenthesizedType */) { + if (unwrappedType.kind === 191 /* OptionalType */) { sawOptional = true; - } else if (unwrappedType.kind === 191 /* RestType */) { + } else if (unwrappedType.kind === 192 /* RestType */) { sawRest = true; } unwrappedType = unwrappedType.type; @@ -159729,19 +160653,19 @@ function getInfo9(checker, sourceFile, position, errorCode) { } function getVariableLikeInitializer(declaration) { switch (declaration.kind) { - case 260 /* VariableDeclaration */: - case 169 /* Parameter */: - case 208 /* BindingElement */: - case 172 /* PropertyDeclaration */: - case 303 /* PropertyAssignment */: + case 261 /* VariableDeclaration */: + case 170 /* Parameter */: + case 209 /* BindingElement */: + case 173 /* PropertyDeclaration */: + case 304 /* PropertyAssignment */: return declaration.initializer; - case 291 /* JsxAttribute */: + case 292 /* JsxAttribute */: return declaration.initializer && (isJsxExpression(declaration.initializer) ? declaration.initializer.expression : void 0); - case 304 /* ShorthandPropertyAssignment */: - case 171 /* PropertySignature */: - case 306 /* EnumMember */: - case 348 /* JSDocPropertyTag */: - case 341 /* JSDocParameterTag */: + case 305 /* ShorthandPropertyAssignment */: + case 172 /* PropertySignature */: + case 307 /* EnumMember */: + case 349 /* JSDocPropertyTag */: + case 342 /* JSDocParameterTag */: return void 0; } } @@ -160000,7 +160924,7 @@ function createActionForAddMissingMemberInJavascriptFile(context, { parentDeclar function addMissingMemberInJs(changeTracker, sourceFile, classDeclaration, token, makeStatic) { const tokenName = token.text; if (makeStatic) { - if (classDeclaration.kind === 231 /* ClassExpression */) { + if (classDeclaration.kind === 232 /* ClassExpression */) { return; } const className = classDeclaration.name.getText(); @@ -160053,7 +160977,7 @@ function createActionsForAddMissingMemberInTypeScriptFile(context, { parentDecla } function getTypeNode2(checker, node, token) { let typeNode; - if (token.parent.parent.kind === 226 /* BinaryExpression */) { + if (token.parent.parent.kind === 227 /* BinaryExpression */) { const binaryExpression = token.parent.parent; const otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; const widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); @@ -160141,7 +161065,7 @@ function getActionsForMissingMethodDeclaration(context, info) { } function addMethodDeclaration(context, changes, callExpression, name, modifierFlags, parentDeclaration, sourceFile) { const importAdder = createImportAdder(sourceFile, context.program, context.preferences, context.host); - const kind = isClassLike(parentDeclaration) ? 174 /* MethodDeclaration */ : 173 /* MethodSignature */; + const kind = isClassLike(parentDeclaration) ? 175 /* MethodDeclaration */ : 174 /* MethodSignature */; const signatureDeclaration = createSignatureDeclarationFromCallExpression(kind, context, importAdder, callExpression, name, modifierFlags, parentDeclaration); const containingMethodDeclaration = tryGetContainingMethodDeclaration(parentDeclaration, callExpression); if (containingMethodDeclaration) { @@ -160168,8 +161092,8 @@ function addEnumMemberDeclaration(changes, checker, { token, parentDeclaration } function addFunctionDeclaration(changes, context, info) { const quotePreference = getQuotePreference(context.sourceFile, context.preferences); const importAdder = createImportAdder(context.sourceFile, context.program, context.preferences, context.host); - const functionDeclaration = info.kind === 2 /* Function */ ? createSignatureDeclarationFromCallExpression(262 /* FunctionDeclaration */, context, importAdder, info.call, idText(info.token), info.modifierFlags, info.parentDeclaration) : createSignatureDeclarationFromSignature( - 262 /* FunctionDeclaration */, + const functionDeclaration = info.kind === 2 /* Function */ ? createSignatureDeclarationFromCallExpression(263 /* FunctionDeclaration */, context, importAdder, info.call, idText(info.token), info.modifierFlags, info.parentDeclaration) : createSignatureDeclarationFromSignature( + 263 /* FunctionDeclaration */, context, quotePreference, info.signature, @@ -160317,7 +161241,7 @@ function tryGetValueFromType(context, checker, importAdder, quotePreference, typ const signature = checker.getSignaturesOfType(type, 0 /* Call */); if (signature === void 0) return createUndefined(); const func = createSignatureDeclarationFromSignature( - 218 /* FunctionExpression */, + 219 /* FunctionExpression */, context, quotePreference, signature[0], @@ -160411,6 +161335,20 @@ function findScope(node) { } return getSourceFileOfNode(node); } +function getAllSupers(decl, checker) { + const res = []; + while (decl) { + const superElement = getClassExtendsHeritageElement(decl); + const superSymbol = superElement && checker.getSymbolAtLocation(superElement.expression); + if (!superSymbol) break; + const symbol = superSymbol.flags & 2097152 /* Alias */ ? checker.getAliasedSymbol(superSymbol) : superSymbol; + const superDecl = symbol.declarations && find(symbol.declarations, isClassLike); + if (!superDecl) break; + res.push(superDecl); + decl = superDecl; + } + return res; +} // src/services/codefixes/fixAddMissingNewOperator.ts var fixId25 = "addMissingNewOperator"; @@ -160597,10 +161535,10 @@ function doChange19(changes, program, preferences, host, declarations, newParame } function isConvertibleSignatureDeclaration(node) { switch (node.kind) { - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 174 /* MethodDeclaration */: - case 219 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 175 /* MethodDeclaration */: + case 220 /* ArrowFunction */: return true; default: return false; @@ -160942,9 +161880,9 @@ function getSuggestion(messageText) { // src/services/codefixes/fixModuleAndTargetOptions.ts registerCodeFix({ errorCodes: [ - Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code, - Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code, - Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code + Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code, + Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code, + Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code ], getCodeActions: function getCodeActionsToFixModuleAndTarget(context) { const compilerOptions = context.program.getCompilerOptions(); @@ -161224,7 +162162,7 @@ registerCodeFix({ getCodeActions: (context) => { const importDeclaration = getImportDeclaration(context.sourceFile, context.program, context.span.start); if (!importDeclaration) return; - const namespaceChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => importDeclaration.kind === 276 /* ImportSpecifier */ && doNamespaceImportChange(t, context.sourceFile, importDeclaration, context.program)); + const namespaceChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => importDeclaration.kind === 277 /* ImportSpecifier */ && doNamespaceImportChange(t, context.sourceFile, importDeclaration, context.program)); const typeOnlyChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => doTypeOnlyImportChange(t, context.sourceFile, importDeclaration, context.program)); let actions2; if (namespaceChanges.length) { @@ -161239,17 +162177,17 @@ registerCodeFix({ }); function getImportDeclaration(sourceFile, program, start) { const identifier = tryCast(getTokenAtPosition(sourceFile, start), isIdentifier); - if (!identifier || identifier.parent.kind !== 183 /* TypeReference */) return; + if (!identifier || identifier.parent.kind !== 184 /* TypeReference */) return; const checker = program.getTypeChecker(); const symbol = checker.getSymbolAtLocation(identifier); return find((symbol == null ? void 0 : symbol.declarations) || emptyArray, or(isImportClause, isImportSpecifier, isImportEqualsDeclaration)); } function doTypeOnlyImportChange(changes, sourceFile, importDeclaration, program) { - if (importDeclaration.kind === 271 /* ImportEqualsDeclaration */) { + if (importDeclaration.kind === 272 /* ImportEqualsDeclaration */) { changes.insertModifierBefore(sourceFile, 156 /* TypeKeyword */, importDeclaration.name); return; } - const importClause = importDeclaration.kind === 273 /* ImportClause */ ? importDeclaration : importDeclaration.parent.parent; + const importClause = importDeclaration.kind === 274 /* ImportClause */ ? importDeclaration : importDeclaration.parent.parent; if (importClause.name && importClause.namedBindings) { return; } @@ -161451,7 +162389,7 @@ function deleteTypeParameters(changes, sourceFile, token) { changes.delete(sourceFile, Debug.checkDefined(cast(token.parent, isDeclarationWithTypeParameterChildren).typeParameters, "The type parameter to delete should exist")); } function isImport(token) { - return token.kind === 102 /* ImportKeyword */ || token.kind === 80 /* Identifier */ && (token.parent.kind === 276 /* ImportSpecifier */ || token.parent.kind === 273 /* ImportClause */); + return token.kind === 102 /* ImportKeyword */ || token.kind === 80 /* Identifier */ && (token.parent.kind === 277 /* ImportSpecifier */ || token.parent.kind === 274 /* ImportClause */); } function tryGetFullImport(token) { return token.kind === 102 /* ImportKeyword */ ? tryCast(token.parent, isImportDeclaration) : void 0; @@ -161460,7 +162398,7 @@ function canDeleteEntireVariableStatement(sourceFile, token) { return isVariableDeclarationList(token.parent) && first(token.parent.getChildren(sourceFile)) === token; } function deleteEntireVariableStatement(changes, sourceFile, node) { - changes.delete(sourceFile, node.parent.kind === 243 /* VariableStatement */ ? node.parent : node); + changes.delete(sourceFile, node.parent.kind === 244 /* VariableStatement */ ? node.parent : node); } function deleteDestructuringElements(changes, sourceFile, node) { forEach(node.elements, (n) => changes.delete(sourceFile, n)); @@ -161501,14 +162439,14 @@ function tryPrefixDeclaration(changes, errorCode, sourceFile, token) { } function canPrefix(token) { switch (token.parent.kind) { - case 169 /* Parameter */: - case 168 /* TypeParameter */: + case 170 /* Parameter */: + case 169 /* TypeParameter */: return true; - case 260 /* VariableDeclaration */: { + case 261 /* VariableDeclaration */: { const varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 250 /* ForOfStatement */: - case 249 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 250 /* ForInStatement */: return true; } } @@ -161556,8 +162494,8 @@ function isNotProvidedArguments(parameter, checker, sourceFiles) { function mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program, cancellationToken, isFixAll) { const { parent: parent2 } = parameter; switch (parent2.kind) { - case 174 /* MethodDeclaration */: - case 176 /* Constructor */: + case 175 /* MethodDeclaration */: + case 177 /* Constructor */: const index = parent2.parameters.indexOf(parameter); const referent = isMethodDeclaration(parent2) ? parent2.name : parent2; const entries = ts_FindAllReferences_exports.Core.getReferencedSymbolsForNode(parent2.pos, referent, program, sourceFiles, cancellationToken); @@ -161574,18 +162512,18 @@ function mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program } } return true; - case 262 /* FunctionDeclaration */: { + case 263 /* FunctionDeclaration */: { if (parent2.name && isCallbackLike(checker, sourceFile, parent2.name)) { return isLastParameter(parent2, parameter, isFixAll); } return true; } - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return isLastParameter(parent2, parameter, isFixAll); - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return false; - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return true; default: return Debug.failBadSyntaxKind(parent2); @@ -161642,7 +162580,7 @@ function doChange27(changes, sourceFile, start, length2, errorCode) { const container = (isBlock(statement.parent) ? statement.parent : statement).parent; if (!isBlock(statement.parent) || statement === first(statement.parent.statements)) { switch (container.kind) { - case 245 /* IfStatement */: + case 246 /* IfStatement */: if (container.elseStatement) { if (isBlock(statement.parent)) { break; @@ -161652,8 +162590,8 @@ function doChange27(changes, sourceFile, start, length2, errorCode) { return; } // falls through - case 247 /* WhileStatement */: - case 248 /* ForStatement */: + case 248 /* WhileStatement */: + case 249 /* ForStatement */: changes.delete(sourceFile, container); return; } @@ -161719,7 +162657,7 @@ registerCodeFix({ const { typeNode, type } = info; const original = typeNode.getText(sourceFile); const actions2 = [fix(type, fixIdPlain, Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)]; - if (typeNode.kind === 314 /* JSDocNullableType */) { + if (typeNode.kind === 315 /* JSDocNullableType */) { actions2.push(fix(type, fixIdNullable, Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)); } return actions2; @@ -161736,7 +162674,7 @@ registerCodeFix({ const info = getInfo15(err.file, err.start, checker); if (!info) return; const { typeNode, type } = info; - const fixedType = typeNode.kind === 314 /* JSDocNullableType */ && fixId56 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; + const fixedType = typeNode.kind === 315 /* JSDocNullableType */ && fixId56 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; doChange29(changes, sourceFile, typeNode, fixedType, checker); }); } @@ -161757,22 +162695,22 @@ function getInfo15(sourceFile, pos, checker) { } function isTypeContainer(node) { switch (node.kind) { - case 234 /* AsExpression */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 262 /* FunctionDeclaration */: - case 177 /* GetAccessor */: - case 181 /* IndexSignature */: - case 200 /* MappedType */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 169 /* Parameter */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 178 /* SetAccessor */: - case 265 /* TypeAliasDeclaration */: - case 216 /* TypeAssertionExpression */: - case 260 /* VariableDeclaration */: + case 235 /* AsExpression */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 263 /* FunctionDeclaration */: + case 178 /* GetAccessor */: + case 182 /* IndexSignature */: + case 201 /* MappedType */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 170 /* Parameter */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 179 /* SetAccessor */: + case 266 /* TypeAliasDeclaration */: + case 217 /* TypeAssertionExpression */: + case 261 /* VariableDeclaration */: return true; default: return false; @@ -161858,18 +162796,18 @@ var errorCodes48 = [ Diagnostics.Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit.code ]; var canHaveTypeAnnotation = /* @__PURE__ */ new Set([ - 177 /* GetAccessor */, - 174 /* MethodDeclaration */, - 172 /* PropertyDeclaration */, - 262 /* FunctionDeclaration */, - 218 /* FunctionExpression */, - 219 /* ArrowFunction */, - 260 /* VariableDeclaration */, - 169 /* Parameter */, - 277 /* ExportAssignment */, - 263 /* ClassDeclaration */, - 206 /* ObjectBindingPattern */, - 207 /* ArrayBindingPattern */ + 178 /* GetAccessor */, + 175 /* MethodDeclaration */, + 173 /* PropertyDeclaration */, + 263 /* FunctionDeclaration */, + 219 /* FunctionExpression */, + 220 /* ArrowFunction */, + 261 /* VariableDeclaration */, + 170 /* Parameter */, + 278 /* ExportAssignment */, + 264 /* ClassDeclaration */, + 207 /* ObjectBindingPattern */, + 208 /* ArrayBindingPattern */ ]); var declarationEmitNodeBuilderFlags2 = 1024 /* MultilineObjectLiterals */ | 2048 /* WriteClassExpressionAsTypeLiteral */ | 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | 524288 /* AllowEmptyTuple */ | 4 /* GenerateNamesForShadowedTypeParams */ | 1 /* NoTruncation */; var declarationEmitInternalNodeBuilderFlags2 = 1 /* WriteComputedProps */; @@ -162151,22 +163089,22 @@ function withContext(context, typePrintMode, cb) { if (fixedNodes == null ? void 0 : fixedNodes.has(node)) return void 0; fixedNodes == null ? void 0 : fixedNodes.add(node); switch (node.kind) { - case 169 /* Parameter */: - case 172 /* PropertyDeclaration */: - case 260 /* VariableDeclaration */: + case 170 /* Parameter */: + case 173 /* PropertyDeclaration */: + case 261 /* VariableDeclaration */: return addTypeToVariableLike(node); - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: return addTypeToSignatureDeclaration(node, sourceFile); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return transformExportAssignment(node); - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return transformExtendsClauseWithExpression(node); - case 206 /* ObjectBindingPattern */: - case 207 /* ArrayBindingPattern */: + case 207 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: return transformDestructuringPatterns(node); default: throw new Error(`Cannot find a fix for the given node ${node.kind}`); @@ -162769,14 +163707,14 @@ function getNodes3(sourceFile, start) { } let insertBefore; switch (containingFunction.kind) { - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: insertBefore = containingFunction.name; break; - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: insertBefore = findChildOfKind(containingFunction, 100 /* FunctionKeyword */, sourceFile); break; - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: const kind = containingFunction.typeParameters ? 30 /* LessThanToken */ : 21 /* OpenParenToken */; insertBefore = findChildOfKind(containingFunction, kind, sourceFile) || first(containingFunction.parameters); break; @@ -162831,14 +163769,20 @@ function doChange32(file, start, length2, code, context) { } else if (code === Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code) { const checker = context.program.getTypeChecker(); const node = getTokenAtPosition(file, start).parent; + if (isComputedPropertyName(node)) { + return; + } Debug.assert(isAccessor(node), "error span of fixPropertyOverrideAccessor should only be on an accessor"); const containingClass = node.parent; Debug.assert(isClassLike(containingClass), "erroneous accessors should only be inside classes"); - const base = singleOrUndefined(getAllSupers(containingClass, checker)); - if (!base) return []; - const name = unescapeLeadingUnderscores(getTextOfPropertyName(node.name)); - const baseProp = checker.getPropertyOfType(checker.getTypeAtLocation(base), name); - if (!baseProp || !baseProp.valueDeclaration) return []; + const baseTypeNode = getEffectiveBaseTypeNode(containingClass); + if (!baseTypeNode) return; + const expression = skipParentheses(baseTypeNode.expression); + const base = isClassExpression(expression) ? expression.symbol : checker.getSymbolAtLocation(expression); + if (!base) return; + const baseType = checker.getDeclaredTypeOfSymbol(base); + const baseProp = checker.getPropertyOfType(baseType, unescapeLeadingUnderscores(getTextOfPropertyName(node.name))); + if (!baseProp || !baseProp.valueDeclaration) return; startPosition = baseProp.valueDeclaration.pos; endPosition = baseProp.valueDeclaration.end; file = getSourceFileOfNode(baseProp.valueDeclaration); @@ -163109,7 +164053,7 @@ function annotateSetAccessor(changes, importAdder, sourceFile, setAccessorDeclar function annotate(changes, importAdder, sourceFile, declaration, type, program, host) { const typeNode = getTypeNodeIfAccessible(type, declaration, program, host); if (typeNode) { - if (isInJSFile(sourceFile) && declaration.kind !== 171 /* PropertySignature */) { + if (isInJSFile(sourceFile) && declaration.kind !== 172 /* PropertySignature */) { const parent2 = isVariableDeclaration(declaration) ? tryCast(declaration.parent.parent, isVariableStatement) : declaration; if (!parent2) { return; @@ -163220,17 +164164,17 @@ function inferTypeForParametersFromUsage(func, sourceFile, program, cancellation function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) { let searchToken; switch (containingFunction.kind) { - case 176 /* Constructor */: + case 177 /* Constructor */: searchToken = findChildOfKind(containingFunction, 137 /* ConstructorKeyword */, sourceFile); break; - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: const parent2 = containingFunction.parent; searchToken = (isVariableDeclaration(parent2) || isPropertyDeclaration(parent2)) && isIdentifier(parent2.name) ? parent2.name : containingFunction.name; break; - case 262 /* FunctionDeclaration */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 263 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: searchToken = containingFunction.name; break; } @@ -163366,44 +164310,44 @@ function inferTypeFromReferences(program, references, cancellationToken) { node = node.parent; } switch (node.parent.kind) { - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: inferTypeFromExpressionStatement(node, usage); break; - case 225 /* PostfixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: usage.isNumber = true; break; - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpression(node.parent, usage); break; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: inferTypeFromBinaryExpression(node, node.parent, usage); break; - case 296 /* CaseClause */: - case 297 /* DefaultClause */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: inferTypeFromSwitchStatementLabel(node.parent, usage); break; - case 213 /* CallExpression */: - case 214 /* NewExpression */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpression(node.parent, usage); } else { inferTypeFromContextualType(node, usage); } break; - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpression(node.parent, usage); break; - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: inferTypeFromPropertyElementExpression(node.parent, node, usage); break; - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: inferTypeFromPropertyAssignment(node.parent, usage); break; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: inferTypeFromPropertyDeclaration(node.parent, usage); break; - case 260 /* VariableDeclaration */: { + case 261 /* VariableDeclaration */: { const { name, initializer } = node.parent; if (node === name) { if (initializer) { @@ -163519,7 +164463,7 @@ function inferTypeFromReferences(program, references, cancellationToken) { // LogicalOperator Or NullishCoalescing case 57 /* BarBarToken */: case 61 /* QuestionQuestionToken */: - if (node === parent2.left && (node.parent.parent.kind === 260 /* VariableDeclaration */ || isAssignmentExpression( + if (node === parent2.left && (node.parent.parent.kind === 261 /* VariableDeclaration */ || isAssignmentExpression( node.parent.parent, /*excludeCompoundAssignment*/ true @@ -163547,7 +164491,7 @@ function inferTypeFromReferences(program, references, cancellationToken) { } } calculateUsageOfNode(parent2, call.return_); - if (parent2.kind === 213 /* CallExpression */) { + if (parent2.kind === 214 /* CallExpression */) { (usage.calls || (usage.calls = [])).push(call); } else { (usage.constructs || (usage.constructs = [])).push(call); @@ -164008,7 +164952,7 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con const declaration = firstOrUndefined(declarations); const checker = context.program.getTypeChecker(); const scriptTarget = getEmitScriptTarget(context.program.getCompilerOptions()); - const kind = (declaration == null ? void 0 : declaration.kind) ?? 171 /* PropertySignature */; + const kind = (declaration == null ? void 0 : declaration.kind) ?? 172 /* PropertySignature */; const declarationName = createDeclarationName(symbol, declaration); const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */; let modifierFlags = effectiveModifierFlags & 256 /* Static */; @@ -164023,8 +164967,8 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con const quotePreference = getQuotePreference(sourceFile, preferences); const flags = 1 /* NoTruncation */ | (quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : 0 /* None */); switch (kind) { - case 171 /* PropertySignature */: - case 172 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 173 /* PropertyDeclaration */: let typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, 8 /* AllowUnresolvedNames */, getNoopSymbolTrackerWithResolver(context)); if (importAdder) { const importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget); @@ -164042,8 +164986,8 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con void 0 )); break; - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: { + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: { Debug.assertIsDefined(declarations); let typeNode2 = checker.typeToTypeNode( type, @@ -164092,8 +165036,8 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con } break; } - case 173 /* MethodSignature */: - case 174 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 175 /* MethodDeclaration */: Debug.assertIsDefined(declarations); const signatures = type.isUnion() ? flatMap(type.types, (t) => t.getCallSignatures()) : type.getCallSignatures(); if (!some(signatures)) { @@ -164123,7 +165067,7 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con break; } function outputMethod(quotePreference2, signature, modifiers2, name, body2) { - const method = createSignatureDeclarationFromSignature(174 /* MethodDeclaration */, context, quotePreference2, signature, body2, name, modifiers2, optional && !!(preserveOptional & 1 /* Method */), enclosingDeclaration, importAdder); + const method = createSignatureDeclarationFromSignature(175 /* MethodDeclaration */, context, quotePreference2, signature, body2, name, modifiers2, optional && !!(preserveOptional & 1 /* Method */), enclosingDeclaration, importAdder); if (method) addClassElement(method); } function createModifiers() { @@ -164308,7 +165252,7 @@ function createSignatureDeclarationFromCallExpression(kind, context, importAdder tracker ); switch (kind) { - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return factory.createMethodDeclaration( modifiers, asteriskToken, @@ -164320,7 +165264,7 @@ function createSignatureDeclarationFromCallExpression(kind, context, importAdder type, createStubbedMethodBody(quotePreference) ); - case 173 /* MethodSignature */: + case 174 /* MethodSignature */: return factory.createMethodSignature( modifiers, name, @@ -164330,7 +165274,7 @@ function createSignatureDeclarationFromCallExpression(kind, context, importAdder parameters, type === void 0 ? factory.createKeywordTypeNode(159 /* UnknownKeyword */) : type ); - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: Debug.assert(typeof name === "string" || isIdentifier(name), "Unexpected name"); return factory.createFunctionDeclaration( modifiers, @@ -164390,10 +165334,14 @@ function typeNodeToAutoImportableTypeNode(typeNode, importAdder, scriptTarget) { return getSynthesizedDeepClone(typeNode); } function endOfRequiredTypeParameters(checker, type) { + var _a; Debug.assert(type.typeArguments); const fullTypeArguments = type.typeArguments; const target = type.target; for (let cutoff = 0; cutoff < fullTypeArguments.length; cutoff++) { + if (((_a = target.localTypeParameters) == null ? void 0 : _a[cutoff].constraint) === void 0) { + continue; + } const typeArguments = fullTypeArguments.slice(0, cutoff); const filledIn = checker.fillMissingTypeArguments( typeArguments, @@ -164789,7 +165737,7 @@ function getAccessorConvertiblePropertyAtPosition(file, program, start, end, con isStatic: hasStaticModifier(declaration), isReadonly: hasEffectiveReadonlyModifier(declaration), type: getDeclarationType(declaration, program), - container: declaration.kind === 169 /* Parameter */ ? declaration.parent.parent : declaration.parent, + container: declaration.kind === 170 /* Parameter */ ? declaration.parent.parent : declaration.parent, originalName: declaration.name.text, declaration, fieldName, @@ -164901,20 +165849,6 @@ function getDeclarationType(declaration, program) { } return typeNode; } -function getAllSupers(decl, checker) { - const res = []; - while (decl) { - const superElement = getClassExtendsHeritageElement(decl); - const superSymbol = superElement && checker.getSymbolAtLocation(superElement.expression); - if (!superSymbol) break; - const symbol = superSymbol.flags & 2097152 /* Alias */ ? checker.getAliasedSymbol(superSymbol) : superSymbol; - const superDecl = symbol.declarations && find(symbol.declarations, isClassLike); - if (!superDecl) break; - res.push(superDecl); - decl = superDecl; - } - return res; -} // src/services/codefixes/fixInvalidImportSyntax.ts var fixName5 = "invalidImportSyntax"; @@ -164960,7 +165894,7 @@ registerCodeFix({ }); function getActionsForUsageOfInvalidImport(context) { const sourceFile = context.sourceFile; - const targetKind = Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 213 /* CallExpression */ : 214 /* NewExpression */; + const targetKind = Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 214 /* CallExpression */ : 215 /* NewExpression */; const node = findAncestor(getTokenAtPosition(sourceFile, context.span.start), (a) => a.kind === targetKind); if (!node) { return []; @@ -165189,8 +166123,8 @@ function doChange35(changes, sourceFile, info) { /*modifiers*/ void 0, factory.createImportClause( - /*isTypeOnly*/ - false, + /*phaseModifier*/ + void 0, defaultImportName, namedImports ), @@ -165326,7 +166260,7 @@ registerCodeFix({ function getImportTypeNode(sourceFile, pos) { const token = getTokenAtPosition(sourceFile, pos); Debug.assert(token.kind === 102 /* ImportKeyword */, "This token should be an ImportKeyword"); - Debug.assert(token.parent.kind === 205 /* ImportType */, "Token parent should be an ImportType"); + Debug.assert(token.parent.kind === 206 /* ImportType */, "Token parent should be an ImportType"); return token.parent; } function doChange37(changes, sourceFile, importType) { @@ -165567,7 +166501,7 @@ function splitTypeOnlyImport(changes, importDeclaration, context) { importDeclaration.modifiers, factory.updateImportClause( importClause, - importClause.isTypeOnly, + importClause.phaseModifier, importClause.name, /*namedBindings*/ void 0 @@ -165584,7 +166518,7 @@ function splitTypeOnlyImport(changes, importDeclaration, context) { void 0, factory.updateImportClause( importClause, - importClause.isTypeOnly, + importClause.phaseModifier, /*name*/ void 0, importClause.namedBindings @@ -166597,14 +167531,14 @@ function getExhaustiveCaseSnippets(caseBlock, sourceFile, preferences, options, } function typeNodeToExpression(typeNode, languageVersion, quotePreference) { switch (typeNode.kind) { - case 183 /* TypeReference */: + case 184 /* TypeReference */: const typeName = typeNode.typeName; return entityNameToExpression(typeName, languageVersion, quotePreference); - case 199 /* IndexedAccessType */: + case 200 /* IndexedAccessType */: const objectExpression = typeNodeToExpression(typeNode.objectType, languageVersion, quotePreference); const indexExpression = typeNodeToExpression(typeNode.indexType, languageVersion, quotePreference); return objectExpression && indexExpression && factory.createElementAccessExpression(objectExpression, indexExpression); - case 201 /* LiteralType */: + case 202 /* LiteralType */: const literal = typeNode.literal; switch (literal.kind) { case 11 /* StringLiteral */: @@ -166613,12 +167547,12 @@ function typeNodeToExpression(typeNode, languageVersion, quotePreference) { return factory.createNumericLiteral(literal.text, literal.numericLiteralFlags); } return void 0; - case 196 /* ParenthesizedType */: + case 197 /* ParenthesizedType */: const exp = typeNodeToExpression(typeNode.type, languageVersion, quotePreference); return exp && (isIdentifier(exp) ? exp : factory.createParenthesizedExpression(exp)); - case 186 /* TypeQuery */: + case 187 /* TypeQuery */: return entityNameToExpression(typeNode.exprName, languageVersion, quotePreference); - case 205 /* ImportType */: + case 206 /* ImportType */: Debug.fail(`We should not get an import type after calling 'codefix.typeToAutoImportableTypeNode'.`); } return void 0; @@ -166653,12 +167587,12 @@ function isMemberCompletionKind(kind) { function getJsxClosingTagCompletion(location, sourceFile) { const jsxClosingElement = findAncestor(location, (node) => { switch (node.kind) { - case 287 /* JsxClosingElement */: + case 288 /* JsxClosingElement */: return true; - case 44 /* SlashToken */: + case 31 /* LessThanSlashToken */: case 32 /* GreaterThanToken */: case 80 /* Identifier */: - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return false; default: return "quit"; @@ -166846,14 +167780,14 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken, const languageVersion = getEmitScriptTarget(host.getCompilationSettings()); if (!isIdentifierText(name, languageVersion)) { insertText = quotePropertyName(sourceFile, preferences, name); - if (parentNamedImportOrExport.kind === 275 /* NamedImports */) { + if (parentNamedImportOrExport.kind === 276 /* NamedImports */) { scanner.setText(sourceFile.text); scanner.resetTokenState(position); if (!(scanner.scan() === 130 /* AsKeyword */ && scanner.scan() === 80 /* Identifier */)) { insertText += " as " + generateIdentifierForArbitraryString(name, languageVersion); } } - } else if (parentNamedImportOrExport.kind === 275 /* NamedImports */) { + } else if (parentNamedImportOrExport.kind === 276 /* NamedImports */) { const possibleToken = stringToToken(name); if (possibleToken && (possibleToken === 135 /* AwaitKeyword */ || isNonContextualKeyword(possibleToken))) { insertText = `${name} as ${name}_`; @@ -167125,10 +168059,10 @@ function createObjectLiteralMethod(symbol, enclosingDeclaration, sourceFile, pro const quotePreference = getQuotePreference(sourceFile, preferences); const builderFlags = 33554432 /* OmitThisParameter */ | (quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : 0 /* None */); switch (declaration.kind) { - case 171 /* PropertySignature */: - case 172 /* PropertyDeclaration */: - case 173 /* MethodSignature */: - case 174 /* MethodDeclaration */: { + case 172 /* PropertySignature */: + case 173 /* PropertyDeclaration */: + case 174 /* MethodSignature */: + case 175 /* MethodDeclaration */: { let effectiveType = type.flags & 1048576 /* Union */ && type.types.length < 10 ? checker.getUnionType(type.types, 2 /* Subtype */) : type; if (effectiveType.flags & 1048576 /* Union */) { const functionTypes = filter(effectiveType.types, (type2) => checker.getSignaturesOfType(type2, 0 /* Call */).length > 0); @@ -167479,43 +168413,46 @@ function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, con function shouldIncludeSymbol(symbol, symbolToSortTextMap2) { var _a; let allFlags = symbol.flags; - if (!isSourceFile(location)) { - if (isExportAssignment(location.parent)) { - return true; + if (location.parent && isExportAssignment(location.parent)) { + return true; + } + if (closestSymbolDeclaration && tryCast(closestSymbolDeclaration, isVariableDeclaration)) { + if (symbol.valueDeclaration === closestSymbolDeclaration) { + return false; } - if (tryCast(closestSymbolDeclaration, isVariableDeclaration) && symbol.valueDeclaration === closestSymbolDeclaration) { + if (isBindingPattern(closestSymbolDeclaration.name) && closestSymbolDeclaration.name.elements.some((e) => e === symbol.valueDeclaration)) { return false; } - const symbolDeclaration = symbol.valueDeclaration ?? ((_a = symbol.declarations) == null ? void 0 : _a[0]); - if (closestSymbolDeclaration && symbolDeclaration) { - if (isParameter(closestSymbolDeclaration) && isParameter(symbolDeclaration)) { - const parameters = closestSymbolDeclaration.parent.parameters; - if (symbolDeclaration.pos >= closestSymbolDeclaration.pos && symbolDeclaration.pos < parameters.end) { - return false; - } - } else if (isTypeParameterDeclaration(closestSymbolDeclaration) && isTypeParameterDeclaration(symbolDeclaration)) { - if (closestSymbolDeclaration === symbolDeclaration && (contextToken == null ? void 0 : contextToken.kind) === 96 /* ExtendsKeyword */) { + } + const symbolDeclaration = symbol.valueDeclaration ?? ((_a = symbol.declarations) == null ? void 0 : _a[0]); + if (closestSymbolDeclaration && symbolDeclaration) { + if (isParameter(closestSymbolDeclaration) && isParameter(symbolDeclaration)) { + const parameters = closestSymbolDeclaration.parent.parameters; + if (symbolDeclaration.pos >= closestSymbolDeclaration.pos && symbolDeclaration.pos < parameters.end) { + return false; + } + } else if (isTypeParameterDeclaration(closestSymbolDeclaration) && isTypeParameterDeclaration(symbolDeclaration)) { + if (closestSymbolDeclaration === symbolDeclaration && (contextToken == null ? void 0 : contextToken.kind) === 96 /* ExtendsKeyword */) { + return false; + } + if (isInTypeParameterDefault(contextToken) && !isInferTypeNode(closestSymbolDeclaration.parent)) { + const typeParameters = closestSymbolDeclaration.parent.typeParameters; + if (typeParameters && symbolDeclaration.pos >= closestSymbolDeclaration.pos && symbolDeclaration.pos < typeParameters.end) { return false; } - if (isInTypeParameterDefault(contextToken) && !isInferTypeNode(closestSymbolDeclaration.parent)) { - const typeParameters = closestSymbolDeclaration.parent.typeParameters; - if (typeParameters && symbolDeclaration.pos >= closestSymbolDeclaration.pos && symbolDeclaration.pos < typeParameters.end) { - return false; - } - } } } - const symbolOrigin = skipAlias(symbol, typeChecker); - if (!!sourceFile.externalModuleIndicator && !compilerOptions.allowUmdGlobalAccess && symbolToSortTextMap2[getSymbolId(symbol)] === SortText.GlobalsOrKeywords && (symbolToSortTextMap2[getSymbolId(symbolOrigin)] === SortText.AutoImportSuggestions || symbolToSortTextMap2[getSymbolId(symbolOrigin)] === SortText.LocationPriority)) { - return false; - } - allFlags |= getCombinedLocalAndExportSymbolFlags(symbolOrigin); - if (isInRightSideOfInternalImportEqualsDeclaration(location)) { - return !!(allFlags & 1920 /* Namespace */); - } - if (isTypeOnlyLocation) { - return symbolCanBeReferencedAtTypeLocation(symbol, typeChecker); - } + } + const symbolOrigin = skipAlias(symbol, typeChecker); + if (!!sourceFile.externalModuleIndicator && !compilerOptions.allowUmdGlobalAccess && symbolToSortTextMap2[getSymbolId(symbol)] === SortText.GlobalsOrKeywords && (symbolToSortTextMap2[getSymbolId(symbolOrigin)] === SortText.AutoImportSuggestions || symbolToSortTextMap2[getSymbolId(symbolOrigin)] === SortText.LocationPriority)) { + return false; + } + allFlags |= getCombinedLocalAndExportSymbolFlags(symbolOrigin); + if (isInRightSideOfInternalImportEqualsDeclaration(location)) { + return !!(allFlags & 1920 /* Namespace */); + } + if (isTypeOnlyLocation) { + return symbolCanBeReferencedAtTypeLocation(symbol, typeChecker); } return !!(allFlags & 111551 /* Value */); } @@ -167817,12 +168754,12 @@ function getContextualType(previousToken, position, sourceFile, checker) { return getContextualTypeFromParent(previousToken, checker); case 64 /* EqualsToken */: switch (parent2.kind) { - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return checker.getContextualType(parent2.initializer); // TODO: GH#18217 - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return checker.getTypeAtLocation(parent2.left); - case 291 /* JsxAttribute */: + case 292 /* JsxAttribute */: return checker.getContextualTypeForJsxAttribute(parent2); default: return void 0; @@ -167856,7 +168793,7 @@ function getFirstSymbolInChain(symbol, enclosingDeclaration, checker) { } function isModuleSymbol(symbol) { var _a; - return !!((_a = symbol.declarations) == null ? void 0 : _a.some((d) => d.kind === 307 /* SourceFile */)); + return !!((_a = symbol.declarations) == null ? void 0 : _a.some((d) => d.kind === 308 /* SourceFile */)); } function getCompletionData(program, log, sourceFile, compilerOptions, position, preferences, detailsEntryId, host, formatContext, cancellationToken) { const typeChecker = program.getTypeChecker(); @@ -167892,7 +168829,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, const typeExpression = tryGetTypeExpressionFromTag(tag); if (typeExpression) { currentToken = getTokenAtPosition(sourceFile, position); - if (!currentToken || !isDeclarationName(currentToken) && (currentToken.parent.kind !== 348 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken)) { + if (!currentToken || !isDeclarationName(currentToken) && (currentToken.parent.kind !== 349 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken)) { insideJsDocTagTypeExpression = isCurrentlyEditingNode(typeExpression); } } @@ -167952,7 +168889,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, isRightOfDot = contextToken.kind === 25 /* DotToken */; isRightOfQuestionDot = contextToken.kind === 29 /* QuestionDotToken */; switch (parent2.kind) { - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: propertyAccessToConvert = parent2; node = propertyAccessToConvert.expression; const leftmostAccessExpression = getLeftmostAccessExpression(propertyAccessToConvert); @@ -167960,16 +168897,16 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, return void 0; } break; - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: node = parent2.left; break; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: node = parent2.name; break; - case 205 /* ImportType */: + case 206 /* ImportType */: node = parent2; break; - case 236 /* MetaProperty */: + case 237 /* MetaProperty */: node = parent2.getFirstToken(sourceFile); Debug.assert(node.kind === 102 /* ImportKeyword */ || node.kind === 105 /* NewKeyword */); break; @@ -167977,52 +168914,52 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, return void 0; } } else if (!importStatementCompletion) { - if (parent2 && parent2.kind === 211 /* PropertyAccessExpression */) { + if (parent2 && parent2.kind === 212 /* PropertyAccessExpression */) { contextToken = parent2; parent2 = parent2.parent; } if (currentToken.parent === location) { switch (currentToken.kind) { case 32 /* GreaterThanToken */: - if (currentToken.parent.kind === 284 /* JsxElement */ || currentToken.parent.kind === 286 /* JsxOpeningElement */) { + if (currentToken.parent.kind === 285 /* JsxElement */ || currentToken.parent.kind === 287 /* JsxOpeningElement */) { location = currentToken; } break; - case 44 /* SlashToken */: - if (currentToken.parent.kind === 285 /* JsxSelfClosingElement */) { + case 31 /* LessThanSlashToken */: + if (currentToken.parent.kind === 286 /* JsxSelfClosingElement */) { location = currentToken; } break; } } switch (parent2.kind) { - case 287 /* JsxClosingElement */: - if (contextToken.kind === 44 /* SlashToken */) { + case 288 /* JsxClosingElement */: + if (contextToken.kind === 31 /* LessThanSlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: if (!binaryExpressionMayBeOpenTag(parent2)) { break; } // falls through - case 285 /* JsxSelfClosingElement */: - case 284 /* JsxElement */: - case 286 /* JsxOpeningElement */: + case 286 /* JsxSelfClosingElement */: + case 285 /* JsxElement */: + case 287 /* JsxOpeningElement */: isJsxIdentifierExpected = true; if (contextToken.kind === 30 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; - case 294 /* JsxExpression */: - case 293 /* JsxSpreadAttribute */: - if (previousToken.kind === 20 /* CloseBraceToken */ || previousToken.kind === 80 /* Identifier */ && previousToken.parent.kind === 291 /* JsxAttribute */) { + case 295 /* JsxExpression */: + case 294 /* JsxSpreadAttribute */: + if (previousToken.kind === 20 /* CloseBraceToken */ || previousToken.kind === 80 /* Identifier */ && previousToken.parent.kind === 292 /* JsxAttribute */) { isJsxIdentifierExpected = true; } break; - case 291 /* JsxAttribute */: + case 292 /* JsxAttribute */: if (parent2.initializer === previousToken && previousToken.end < position) { isJsxIdentifierExpected = true; break; @@ -168110,15 +169047,15 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 341 /* JSDocParameterTag */: - case 348 /* JSDocPropertyTag */: - case 342 /* JSDocReturnTag */: - case 344 /* JSDocTypeTag */: - case 346 /* JSDocTypedefTag */: - case 349 /* JSDocThrowsTag */: - case 350 /* JSDocSatisfiesTag */: + case 342 /* JSDocParameterTag */: + case 349 /* JSDocPropertyTag */: + case 343 /* JSDocReturnTag */: + case 345 /* JSDocTypeTag */: + case 347 /* JSDocTypedefTag */: + case 350 /* JSDocThrowsTag */: + case 351 /* JSDocSatisfiesTag */: return true; - case 345 /* JSDocTemplateTag */: + case 346 /* JSDocTemplateTag */: return !!tag.constraint; default: return false; @@ -168127,7 +169064,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, function tryGetTypeExpressionFromTag(tag) { if (isTagWithTypeExpression(tag)) { const typeExpression = isJSDocTemplateTag(tag) ? tag.constraint : tag.typeExpression; - return typeExpression && typeExpression.kind === 309 /* JSDocTypeExpression */ ? typeExpression : void 0; + return typeExpression && typeExpression.kind === 310 /* JSDocTypeExpression */ ? typeExpression : void 0; } if (isJSDocAugmentsTag(tag) || isJSDocImplementsTag(tag)) { return tag.class; @@ -168165,7 +169102,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, symbols.push(exportedSymbol); } } - if (!isTypeLocation && !insideJsDocTagTypeExpression && symbol.declarations && symbol.declarations.some((d) => d.kind !== 307 /* SourceFile */ && d.kind !== 267 /* ModuleDeclaration */ && d.kind !== 266 /* EnumDeclaration */)) { + if (!isTypeLocation && !insideJsDocTagTypeExpression && symbol.declarations && symbol.declarations.some((d) => d.kind !== 308 /* SourceFile */ && d.kind !== 268 /* ModuleDeclaration */ && d.kind !== 267 /* EnumDeclaration */)) { let type = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType(); let insertQuestionDot = false; if (type.isNullableType()) { @@ -168222,7 +169159,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, isNewIdentifierLocation = true; defaultCommitCharacters ?? (defaultCommitCharacters = allCommitCharacters); } - const propertyAccess = node.kind === 205 /* ImportType */ ? node : node.parent; + const propertyAccess = node.kind === 206 /* ImportType */ ? node : node.parent; if (inCheckedFile) { for (const symbol of type.getApparentProperties()) { if (typeChecker.isValidPropertyAccessForCompletions(propertyAccess, type, symbol)) { @@ -168383,7 +169320,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, } } } - if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 307 /* SourceFile */) { + if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 308 /* SourceFile */) { const thisType = typeChecker.tryGetThisTypeAt( scopeNode, /*includeGlobalThis*/ @@ -168413,10 +169350,10 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, } function isSnippetScope(scopeNode) { switch (scopeNode.kind) { - case 307 /* SourceFile */: - case 228 /* TemplateExpression */: - case 294 /* JsxExpression */: - case 241 /* Block */: + case 308 /* SourceFile */: + case 229 /* TemplateExpression */: + case 295 /* JsxExpression */: + case 242 /* Block */: return true; default: return isStatement(scopeNode); @@ -168426,24 +169363,24 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, return insideJsDocTagTypeExpression || insideJsDocImportTag || !!importStatementCompletion && isTypeOnlyImportOrExportDeclaration(location.parent) || !isContextTokenValueLocation(contextToken) && (isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker) || isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)); } function isContextTokenValueLocation(contextToken2) { - return contextToken2 && (contextToken2.kind === 114 /* TypeOfKeyword */ && (contextToken2.parent.kind === 186 /* TypeQuery */ || isTypeOfExpression(contextToken2.parent)) || contextToken2.kind === 131 /* AssertsKeyword */ && contextToken2.parent.kind === 182 /* TypePredicate */); + return contextToken2 && (contextToken2.kind === 114 /* TypeOfKeyword */ && (contextToken2.parent.kind === 187 /* TypeQuery */ || isTypeOfExpression(contextToken2.parent)) || contextToken2.kind === 131 /* AssertsKeyword */ && contextToken2.parent.kind === 183 /* TypePredicate */); } function isContextTokenTypeLocation(contextToken2) { if (contextToken2) { const parentKind = contextToken2.parent.kind; switch (contextToken2.kind) { case 59 /* ColonToken */: - return parentKind === 172 /* PropertyDeclaration */ || parentKind === 171 /* PropertySignature */ || parentKind === 169 /* Parameter */ || parentKind === 260 /* VariableDeclaration */ || isFunctionLikeKind(parentKind); + return parentKind === 173 /* PropertyDeclaration */ || parentKind === 172 /* PropertySignature */ || parentKind === 170 /* Parameter */ || parentKind === 261 /* VariableDeclaration */ || isFunctionLikeKind(parentKind); case 64 /* EqualsToken */: - return parentKind === 265 /* TypeAliasDeclaration */ || parentKind === 168 /* TypeParameter */; + return parentKind === 266 /* TypeAliasDeclaration */ || parentKind === 169 /* TypeParameter */; case 130 /* AsKeyword */: - return parentKind === 234 /* AsExpression */; + return parentKind === 235 /* AsExpression */; case 30 /* LessThanToken */: - return parentKind === 183 /* TypeReference */ || parentKind === 216 /* TypeAssertionExpression */; + return parentKind === 184 /* TypeReference */ || parentKind === 217 /* TypeAssertionExpression */; case 96 /* ExtendsKeyword */: - return parentKind === 168 /* TypeParameter */; + return parentKind === 169 /* TypeParameter */; case 152 /* SatisfiesKeyword */: - return parentKind === 238 /* SatisfiesExpression */; + return parentKind === 239 /* SatisfiesExpression */; } } return false; @@ -168606,14 +169543,14 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, return true; } if (contextToken2.kind === 32 /* GreaterThanToken */ && contextToken2.parent) { - if (location === contextToken2.parent && (location.kind === 286 /* JsxOpeningElement */ || location.kind === 285 /* JsxSelfClosingElement */)) { + if (location === contextToken2.parent && (location.kind === 287 /* JsxOpeningElement */ || location.kind === 286 /* JsxSelfClosingElement */)) { return false; } - if (contextToken2.parent.kind === 286 /* JsxOpeningElement */) { - return location.parent.kind !== 286 /* JsxOpeningElement */; + if (contextToken2.parent.kind === 287 /* JsxOpeningElement */) { + return location.parent.kind !== 287 /* JsxOpeningElement */; } - if (contextToken2.parent.kind === 287 /* JsxClosingElement */ || contextToken2.parent.kind === 285 /* JsxSelfClosingElement */) { - return !!contextToken2.parent.parent && contextToken2.parent.parent.kind === 284 /* JsxElement */; + if (contextToken2.parent.kind === 288 /* JsxClosingElement */ || contextToken2.parent.kind === 286 /* JsxSelfClosingElement */) { + return !!contextToken2.parent.parent && contextToken2.parent.parent.kind === 285 /* JsxElement */; } } return false; @@ -168625,57 +169562,57 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, switch (tokenKind) { case 28 /* CommaToken */: switch (containingNodeKind) { - case 213 /* CallExpression */: + case 214 /* CallExpression */: // func( a, | - case 214 /* NewExpression */: { + case 215 /* NewExpression */: { const expression = contextToken.parent.expression; if (getLineAndCharacterOfPosition(sourceFile, expression.end).line !== getLineAndCharacterOfPosition(sourceFile, position).line) { return { defaultCommitCharacters: noCommaCommitCharacters, isNewIdentifierLocation: true }; } return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true }; } - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return { defaultCommitCharacters: noCommaCommitCharacters, isNewIdentifierLocation: true }; - case 176 /* Constructor */: + case 177 /* Constructor */: // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - case 184 /* FunctionType */: + case 185 /* FunctionType */: // var x: (s: string, list| - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return { defaultCommitCharacters: [], isNewIdentifierLocation: true }; - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true }; default: return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; } case 21 /* OpenParenToken */: switch (containingNodeKind) { - case 213 /* CallExpression */: + case 214 /* CallExpression */: // func( | - case 214 /* NewExpression */: { + case 215 /* NewExpression */: { const expression = contextToken.parent.expression; if (getLineAndCharacterOfPosition(sourceFile, expression.end).line !== getLineAndCharacterOfPosition(sourceFile, position).line) { return { defaultCommitCharacters: noCommaCommitCharacters, isNewIdentifierLocation: true }; } return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true }; } - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return { defaultCommitCharacters: noCommaCommitCharacters, isNewIdentifierLocation: true }; - case 176 /* Constructor */: + case 177 /* Constructor */: // constructor( | - case 196 /* ParenthesizedType */: + case 197 /* ParenthesizedType */: return { defaultCommitCharacters: [], isNewIdentifierLocation: true }; default: return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; } case 23 /* OpenBracketToken */: switch (containingNodeKind) { - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: // [ | - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: // [ | : string ] - case 189 /* TupleType */: + case 190 /* TupleType */: // [ | : string ] - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true }; default: return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; @@ -168688,25 +169625,25 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, return { defaultCommitCharacters: [], isNewIdentifierLocation: true }; case 25 /* DotToken */: switch (containingNodeKind) { - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return { defaultCommitCharacters: [], isNewIdentifierLocation: true }; default: return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; } case 19 /* OpenBraceToken */: switch (containingNodeKind) { - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: // class A { | - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return { defaultCommitCharacters: [], isNewIdentifierLocation: true }; default: return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; } case 64 /* EqualsToken */: switch (containingNodeKind) { - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: // const x = a| - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true }; default: return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; @@ -168714,19 +169651,19 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, case 16 /* TemplateHead */: return { defaultCommitCharacters: allCommitCharacters, - isNewIdentifierLocation: containingNodeKind === 228 /* TemplateExpression */ + isNewIdentifierLocation: containingNodeKind === 229 /* TemplateExpression */ // `aa ${| }; case 17 /* TemplateMiddle */: return { defaultCommitCharacters: allCommitCharacters, - isNewIdentifierLocation: containingNodeKind === 239 /* TemplateSpan */ + isNewIdentifierLocation: containingNodeKind === 240 /* TemplateSpan */ // `aa ${10} dd ${| }; case 134 /* AsyncKeyword */: - return containingNodeKind === 174 /* MethodDeclaration */ || containingNodeKind === 304 /* ShorthandPropertyAssignment */ ? { defaultCommitCharacters: [], isNewIdentifierLocation: true } : { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; + return containingNodeKind === 175 /* MethodDeclaration */ || containingNodeKind === 305 /* ShorthandPropertyAssignment */ ? { defaultCommitCharacters: [], isNewIdentifierLocation: true } : { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; case 42 /* AsteriskToken */: - return containingNodeKind === 174 /* MethodDeclaration */ ? { defaultCommitCharacters: [], isNewIdentifierLocation: true } : { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; + return containingNodeKind === 175 /* MethodDeclaration */ ? { defaultCommitCharacters: [], isNewIdentifierLocation: true } : { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; } if (isClassMemberCompletionKeyword(tokenKind)) { return { defaultCommitCharacters: [], isNewIdentifierLocation: true }; @@ -168762,7 +169699,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, completionKind = 0 /* ObjectPropertyDeclaration */; let typeMembers; let existingMembers; - if (objectLikeContainer.kind === 210 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 211 /* ObjectLiteralExpression */) { const instantiatedType = tryGetObjectLiteralContextualType(objectLikeContainer, typeChecker); if (instantiatedType === void 0) { if (objectLikeContainer.flags & 67108864 /* InWithStatement */) { @@ -168782,15 +169719,15 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, } } } else { - Debug.assert(objectLikeContainer.kind === 206 /* ObjectBindingPattern */); + Debug.assert(objectLikeContainer.kind === 207 /* ObjectBindingPattern */); isNewIdentifierLocation = false; const rootDeclaration = getRootDeclaration(objectLikeContainer.parent); if (!isVariableLike(rootDeclaration)) return Debug.fail("Root declaration is not variable-like."); - let canGetType = hasInitializer(rootDeclaration) || !!getEffectiveTypeAnnotationNode(rootDeclaration) || rootDeclaration.parent.parent.kind === 250 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 169 /* Parameter */) { + let canGetType = hasInitializer(rootDeclaration) || !!getEffectiveTypeAnnotationNode(rootDeclaration) || rootDeclaration.parent.parent.kind === 251 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 170 /* Parameter */) { if (isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); - } else if (rootDeclaration.parent.kind === 174 /* MethodDeclaration */ || rootDeclaration.parent.kind === 178 /* SetAccessor */) { + } else if (rootDeclaration.parent.kind === 175 /* MethodDeclaration */ || rootDeclaration.parent.kind === 179 /* SetAccessor */) { canGetType = isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -168815,7 +169752,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, const filteredMembers = filterObjectMembersList(typeMembers, Debug.checkDefined(existingMembers)); symbols = concatenate(symbols, filteredMembers); setSortTextToOptionalMember(); - if (objectLikeContainer.kind === 210 /* ObjectLiteralExpression */ && preferences.includeCompletionsWithObjectLiteralMethodSnippets && preferences.includeCompletionsWithInsertText) { + if (objectLikeContainer.kind === 211 /* ObjectLiteralExpression */ && preferences.includeCompletionsWithObjectLiteralMethodSnippets && preferences.includeCompletionsWithInsertText) { transformObjectLiteralMembersSortText(symbolsStartIndex); collectObjectLiteralMethodSymbols(filteredMembers, objectLikeContainer); } @@ -168829,10 +169766,10 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, if (!isTypeKeywordTokenOrIdentifier(contextToken)) { keywordFilters = 8 /* TypeKeyword */; } - const { moduleSpecifier } = namedImportsOrExports.kind === 275 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent; + const { moduleSpecifier } = namedImportsOrExports.kind === 276 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent; if (!moduleSpecifier) { isNewIdentifierLocation = true; - return namedImportsOrExports.kind === 275 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */; + return namedImportsOrExports.kind === 276 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */; } const moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); if (!moduleSpecifierSymbol) { @@ -168964,11 +169901,11 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, case 31 /* LessThanSlashToken */: case 44 /* SlashToken */: case 80 /* Identifier */: - case 211 /* PropertyAccessExpression */: - case 292 /* JsxAttributes */: - case 291 /* JsxAttribute */: - case 293 /* JsxSpreadAttribute */: - if (parent2 && (parent2.kind === 285 /* JsxSelfClosingElement */ || parent2.kind === 286 /* JsxOpeningElement */)) { + case 212 /* PropertyAccessExpression */: + case 293 /* JsxAttributes */: + case 292 /* JsxAttribute */: + case 294 /* JsxSpreadAttribute */: + if (parent2 && (parent2.kind === 286 /* JsxSelfClosingElement */ || parent2.kind === 287 /* JsxOpeningElement */)) { if (contextToken2.kind === 32 /* GreaterThanToken */) { const precedingToken = findPrecedingToken( contextToken2.pos, @@ -168979,7 +169916,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, if (!parent2.typeArguments || precedingToken && precedingToken.kind === 44 /* SlashToken */) break; } return parent2; - } else if (parent2.kind === 291 /* JsxAttribute */) { + } else if (parent2.kind === 292 /* JsxAttribute */) { return parent2.parent.parent; } break; @@ -168987,15 +169924,15 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 11 /* StringLiteral */: - if (parent2 && (parent2.kind === 291 /* JsxAttribute */ || parent2.kind === 293 /* JsxSpreadAttribute */)) { + if (parent2 && (parent2.kind === 292 /* JsxAttribute */ || parent2.kind === 294 /* JsxSpreadAttribute */)) { return parent2.parent.parent; } break; case 20 /* CloseBraceToken */: - if (parent2 && parent2.kind === 294 /* JsxExpression */ && parent2.parent && parent2.parent.kind === 291 /* JsxAttribute */) { + if (parent2 && parent2.kind === 295 /* JsxExpression */ && parent2.parent && parent2.parent.kind === 292 /* JsxAttribute */) { return parent2.parent.parent.parent; } - if (parent2 && parent2.kind === 293 /* JsxSpreadAttribute */) { + if (parent2 && parent2.kind === 294 /* JsxSpreadAttribute */) { return parent2.parent.parent; } break; @@ -169011,49 +169948,49 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, const containingNodeKind = parent2.kind; switch (contextToken2.kind) { case 28 /* CommaToken */: - return containingNodeKind === 260 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken2) || containingNodeKind === 243 /* VariableStatement */ || containingNodeKind === 266 /* EnumDeclaration */ || // enum a { foo, | - isFunctionLikeButNotConstructor(containingNodeKind) || containingNodeKind === 264 /* InterfaceDeclaration */ || // interface A= contextToken2.pos; case 25 /* DotToken */: - return containingNodeKind === 207 /* ArrayBindingPattern */; + return containingNodeKind === 208 /* ArrayBindingPattern */; // var [.| case 59 /* ColonToken */: - return containingNodeKind === 208 /* BindingElement */; + return containingNodeKind === 209 /* BindingElement */; // var {x :html| case 23 /* OpenBracketToken */: - return containingNodeKind === 207 /* ArrayBindingPattern */; + return containingNodeKind === 208 /* ArrayBindingPattern */; // var [x| case 21 /* OpenParenToken */: - return containingNodeKind === 299 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); + return containingNodeKind === 300 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 19 /* OpenBraceToken */: - return containingNodeKind === 266 /* EnumDeclaration */; + return containingNodeKind === 267 /* EnumDeclaration */; // enum a { | case 30 /* LessThanToken */: - return containingNodeKind === 263 /* ClassDeclaration */ || // class A< | - containingNodeKind === 231 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 264 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 265 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 264 /* ClassDeclaration */ || // class A< | + containingNodeKind === 232 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 265 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 266 /* TypeAliasDeclaration */ || // type List< | isFunctionLikeKind(containingNodeKind); case 126 /* StaticKeyword */: - return containingNodeKind === 172 /* PropertyDeclaration */ && !isClassLike(parent2.parent); + return containingNodeKind === 173 /* PropertyDeclaration */ && !isClassLike(parent2.parent); case 26 /* DotDotDotToken */: - return containingNodeKind === 169 /* Parameter */ || !!parent2.parent && parent2.parent.kind === 207 /* ArrayBindingPattern */; + return containingNodeKind === 170 /* Parameter */ || !!parent2.parent && parent2.parent.kind === 208 /* ArrayBindingPattern */; // var [...z| case 125 /* PublicKeyword */: case 123 /* PrivateKeyword */: case 124 /* ProtectedKeyword */: - return containingNodeKind === 169 /* Parameter */ && !isConstructorDeclaration(parent2.parent); + return containingNodeKind === 170 /* Parameter */ && !isConstructorDeclaration(parent2.parent); case 130 /* AsKeyword */: - return containingNodeKind === 276 /* ImportSpecifier */ || containingNodeKind === 281 /* ExportSpecifier */ || containingNodeKind === 274 /* NamespaceImport */; + return containingNodeKind === 277 /* ImportSpecifier */ || containingNodeKind === 282 /* ExportSpecifier */ || containingNodeKind === 275 /* NamespaceImport */; case 139 /* GetKeyword */: case 153 /* SetKeyword */: return !isFromObjectTypeDeclaration(contextToken2); case 80 /* Identifier */: { - if ((containingNodeKind === 276 /* ImportSpecifier */ || containingNodeKind === 281 /* ExportSpecifier */) && contextToken2 === parent2.name && contextToken2.text === "type") { + if ((containingNodeKind === 277 /* ImportSpecifier */ || containingNodeKind === 282 /* ExportSpecifier */) && contextToken2 === parent2.name && contextToken2.text === "type") { return false; } const ancestorVariableDeclaration = findAncestor( @@ -169076,7 +170013,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, case 140 /* InferKeyword */: return true; case 156 /* TypeKeyword */: - return containingNodeKind !== 276 /* ImportSpecifier */; + return containingNodeKind !== 277 /* ImportSpecifier */; case 42 /* AsteriskToken */: return isFunctionLike(contextToken2.parent) && !isMethodDeclaration(contextToken2.parent); } @@ -169110,7 +170047,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, if (ancestorClassLike && contextToken2 === previousToken && isPreviousPropertyDeclarationTerminated(contextToken2, position)) { return false; } - const ancestorPropertyDeclaraion = getAncestor(contextToken2.parent, 172 /* PropertyDeclaration */); + const ancestorPropertyDeclaraion = getAncestor(contextToken2.parent, 173 /* PropertyDeclaration */); if (ancestorPropertyDeclaraion && contextToken2 !== previousToken && isClassLike(previousToken.parent.parent) && position <= previousToken.end) { if (isPreviousPropertyDeclarationTerminated(contextToken2, previousToken.end)) { return false; @@ -169124,7 +170061,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, return contextToken2.kind !== 64 /* EqualsToken */ && (contextToken2.kind === 27 /* SemicolonToken */ || !positionsAreOnSameLine(contextToken2.end, position2, sourceFile)); } function isFunctionLikeButNotConstructor(kind) { - return isFunctionLikeKind(kind) && kind !== 176 /* Constructor */; + return isFunctionLikeKind(kind) && kind !== 177 /* Constructor */; } function isDotOfNumericLiteral(contextToken2) { if (contextToken2.kind === 9 /* NumericLiteral */) { @@ -169134,7 +170071,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, return false; } function isVariableDeclarationListButNotTypeArgument(node2) { - return node2.parent.kind === 261 /* VariableDeclarationList */ && !isPossiblyTypeArgumentPosition(node2, sourceFile, typeChecker); + return node2.parent.kind === 262 /* VariableDeclarationList */ && !isPossiblyTypeArgumentPosition(node2, sourceFile, typeChecker); } function filterObjectMembersList(contextualMemberSymbols, existingMembers) { if (existingMembers.length === 0) { @@ -169143,7 +170080,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, const membersDeclaredBySpreadAssignment = /* @__PURE__ */ new Set(); const existingMemberNames = /* @__PURE__ */ new Set(); for (const m of existingMembers) { - if (m.kind !== 303 /* PropertyAssignment */ && m.kind !== 304 /* ShorthandPropertyAssignment */ && m.kind !== 208 /* BindingElement */ && m.kind !== 174 /* MethodDeclaration */ && m.kind !== 177 /* GetAccessor */ && m.kind !== 178 /* SetAccessor */ && m.kind !== 305 /* SpreadAssignment */) { + if (m.kind !== 304 /* PropertyAssignment */ && m.kind !== 305 /* ShorthandPropertyAssignment */ && m.kind !== 209 /* BindingElement */ && m.kind !== 175 /* MethodDeclaration */ && m.kind !== 178 /* GetAccessor */ && m.kind !== 179 /* SetAccessor */ && m.kind !== 306 /* SpreadAssignment */) { continue; } if (isCurrentlyEditingNode(m)) { @@ -169221,7 +170158,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, function filterClassMembersList(baseSymbols, existingMembers, currentClassElementModifierFlags) { const existingMemberNames = /* @__PURE__ */ new Set(); for (const m of existingMembers) { - if (m.kind !== 172 /* PropertyDeclaration */ && m.kind !== 174 /* MethodDeclaration */ && m.kind !== 177 /* GetAccessor */ && m.kind !== 178 /* SetAccessor */) { + if (m.kind !== 173 /* PropertyDeclaration */ && m.kind !== 175 /* MethodDeclaration */ && m.kind !== 178 /* GetAccessor */ && m.kind !== 179 /* SetAccessor */) { continue; } if (isCurrentlyEditingNode(m)) { @@ -169249,7 +170186,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 291 /* JsxAttribute */) { + if (attr.kind === 292 /* JsxAttribute */) { seenNames.add(getEscapedTextOfJsxAttributeName(attr.name)); } else if (isJsxSpreadAttribute(attr)) { setMembersDeclaredBySpreadAssignment(attr, membersDeclaredBySpreadAssignment); @@ -169364,7 +170301,7 @@ function getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, js var _keywordCompletions = []; var allKeywordsCompletions = memoize(() => { const res = []; - for (let i = 83 /* FirstKeyword */; i <= 165 /* LastKeyword */; i++) { + for (let i = 83 /* FirstKeyword */; i <= 166 /* LastKeyword */; i++) { res.push({ name: tokenToString(i), kind: "keyword" /* keyword */, @@ -169513,7 +170450,7 @@ function getPropertiesForCompletion(type, checker) { } function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) { switch (location.kind) { - case 352 /* SyntaxList */: + case 353 /* SyntaxList */: return tryCast(location.parent, isObjectTypeDeclaration); case 1 /* EndOfFileToken */: const cls = tryCast(lastOrUndefined(cast(location.parent, isSourceFile).statements), isObjectTypeDeclaration); @@ -169577,7 +170514,7 @@ function tryGetTypeLiteralNode(node) { case 27 /* SemicolonToken */: case 28 /* CommaToken */: case 80 /* Identifier */: - if (parent2.kind === 171 /* PropertySignature */ && isTypeLiteralNode(parent2.parent)) { + if (parent2.kind === 172 /* PropertySignature */ && isTypeLiteralNode(parent2.parent)) { return parent2.parent; } break; @@ -169592,11 +170529,11 @@ function getConstraintOfTypeArgumentProperty(node, checker) { const t = getConstraintOfTypeArgumentProperty(node.parent, checker); if (!t) return void 0; switch (node.kind) { - case 171 /* PropertySignature */: + case 172 /* PropertySignature */: return checker.getTypeOfPropertyOfContextualType(t, node.symbol.escapedName); - case 193 /* IntersectionType */: - case 187 /* TypeLiteral */: - case 192 /* UnionType */: + case 194 /* IntersectionType */: + case 188 /* TypeLiteral */: + case 193 /* UnionType */: return t; } } @@ -169617,9 +170554,9 @@ function isValidTrigger(sourceFile, triggerCharacter, contextToken, position) { case "<": return !!contextToken && contextToken.kind === 30 /* LessThanToken */ && (!isBinaryExpression(contextToken.parent) || binaryExpressionMayBeOpenTag(contextToken.parent)); case "/": - return !!contextToken && (isStringLiteralLike(contextToken) ? !!tryGetImportFromModuleSpecifier(contextToken) : contextToken.kind === 44 /* SlashToken */ && isJsxClosingElement(contextToken.parent)); + return !!contextToken && (isStringLiteralLike(contextToken) ? !!tryGetImportFromModuleSpecifier(contextToken) : contextToken.kind === 31 /* LessThanSlashToken */ && isJsxClosingElement(contextToken.parent)); case " ": - return !!contextToken && isImportKeyword(contextToken) && contextToken.parent.kind === 307 /* SourceFile */; + return !!contextToken && isImportKeyword(contextToken) && contextToken.parent.kind === 308 /* SourceFile */; default: return Debug.assertNever(triggerCharacter); } @@ -169746,8 +170683,8 @@ function getSingleLineReplacementSpanForImportCompletionNode(node) { if (rangeIsOnSingleLine(top, sourceFile)) { return createTextSpanFromNode(top, sourceFile); } - Debug.assert(top.kind !== 102 /* ImportKeyword */ && top.kind !== 276 /* ImportSpecifier */); - const potentialSplitPoint = top.kind === 272 /* ImportDeclaration */ || top.kind === 351 /* JSDocImportTag */ ? getPotentiallyInvalidImportSpecifier((_a = top.importClause) == null ? void 0 : _a.namedBindings) ?? top.moduleSpecifier : top.moduleReference; + Debug.assert(top.kind !== 102 /* ImportKeyword */ && top.kind !== 277 /* ImportSpecifier */); + const potentialSplitPoint = top.kind === 273 /* ImportDeclaration */ || top.kind === 352 /* JSDocImportTag */ ? getPotentiallyInvalidImportSpecifier((_a = top.importClause) == null ? void 0 : _a.namedBindings) ?? top.moduleSpecifier : top.moduleReference; const withoutModuleSpecifier = { pos: top.getFirstToken().getStart(), end: potentialSplitPoint.pos @@ -170048,39 +170985,39 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, program, const typeChecker = program.getTypeChecker(); const parent2 = walkUpParentheses(node.parent); switch (parent2.kind) { - case 201 /* LiteralType */: { + case 202 /* LiteralType */: { const grandParent = walkUpParentheses(parent2.parent); - if (grandParent.kind === 205 /* ImportType */) { + if (grandParent.kind === 206 /* ImportType */) { return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, program, host, preferences) }; } return fromUnionableLiteralType(grandParent); } - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: if (isObjectLiteralExpression(parent2.parent) && parent2.name === node) { return stringLiteralCompletionsForObjectLiteral(typeChecker, parent2.parent); } return fromContextualType() || fromContextualType(0 /* None */); - case 212 /* ElementAccessExpression */: { + case 213 /* ElementAccessExpression */: { const { expression, argumentExpression } = parent2; if (node === skipParentheses(argumentExpression)) { return stringLiteralCompletionsFromProperties(typeChecker.getTypeAtLocation(expression)); } return void 0; } - case 213 /* CallExpression */: - case 214 /* NewExpression */: - case 291 /* JsxAttribute */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: + case 292 /* JsxAttribute */: if (!isRequireCallArgument(node) && !isImportCall(parent2)) { - const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 291 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile, typeChecker); + const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 292 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile, typeChecker); return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType(0 /* None */); } // falls through (is `require("")` or `require(""` or `import("")`) - case 272 /* ImportDeclaration */: - case 278 /* ExportDeclaration */: - case 283 /* ExternalModuleReference */: - case 351 /* JSDocImportTag */: + case 273 /* ImportDeclaration */: + case 279 /* ExportDeclaration */: + case 284 /* ExternalModuleReference */: + case 352 /* JSDocImportTag */: return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, program, host, preferences) }; - case 296 /* CaseClause */: + case 297 /* CaseClause */: const tracker = newCaseClauseTracker(typeChecker, parent2.parent.clauses); const contextualTypes = fromContextualType(); if (!contextualTypes) { @@ -170088,14 +171025,14 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, program, } const literals = contextualTypes.types.filter((literal) => !tracker.hasValue(literal.value)); return { kind: 2 /* Types */, types: literals, isNewIdentifier: false }; - case 276 /* ImportSpecifier */: - case 281 /* ExportSpecifier */: + case 277 /* ImportSpecifier */: + case 282 /* ExportSpecifier */: const specifier = parent2; if (specifier.propertyName && node !== specifier.propertyName) { return; } const namedImportsOrExports = specifier.parent; - const { moduleSpecifier } = namedImportsOrExports.kind === 275 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent; + const { moduleSpecifier } = namedImportsOrExports.kind === 276 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent; if (!moduleSpecifier) return; const moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); if (!moduleSpecifierSymbol) return; @@ -170103,26 +171040,37 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, program, const existing = new Set(namedImportsOrExports.elements.map((n) => moduleExportNameTextEscaped(n.propertyName || n.name))); const uniques = exports2.filter((e) => e.escapedName !== "default" /* Default */ && !existing.has(e.escapedName)); return { kind: 1 /* Properties */, symbols: uniques, hasIndexSignature: false }; + case 227 /* BinaryExpression */: + if (parent2.operatorToken.kind === 103 /* InKeyword */) { + const type = typeChecker.getTypeAtLocation(parent2.right); + const properties = type.isUnion() ? typeChecker.getAllPossiblePropertiesOfTypes(type.types) : type.getApparentProperties(); + return { + kind: 1 /* Properties */, + symbols: properties.filter((prop) => !prop.valueDeclaration || !isPrivateIdentifierClassElementDeclaration(prop.valueDeclaration)), + hasIndexSignature: false + }; + } + return fromContextualType(0 /* None */); default: return fromContextualType() || fromContextualType(0 /* None */); } function fromUnionableLiteralType(grandParent) { switch (grandParent.kind) { - case 233 /* ExpressionWithTypeArguments */: - case 183 /* TypeReference */: { + case 234 /* ExpressionWithTypeArguments */: + case 184 /* TypeReference */: { const typeArgument = findAncestor(parent2, (n) => n.parent === grandParent); if (typeArgument) { return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false }; } return void 0; } - case 199 /* IndexedAccessType */: + case 200 /* IndexedAccessType */: const { indexType, objectType } = grandParent; if (!rangeContainsPosition(indexType, position)) { return void 0; } return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType)); - case 192 /* UnionType */: { + case 193 /* UnionType */: { const result = fromUnionableLiteralType(walkUpParentheses(grandParent.parent)); if (!result) { return void 0; @@ -170147,9 +171095,9 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, program, } function walkUpParentheses(node) { switch (node.kind) { - case 196 /* ParenthesizedType */: + case 197 /* ParenthesizedType */: return walkUpParenthesizedTypes(node); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return walkUpParenthesizedExpressions(node); default: return node; @@ -170948,14 +171896,14 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, { } if (cancellationToken) cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 213 /* CallExpression */: + case 214 /* CallExpression */: if (isImportCall(direct)) { handleImportCall(direct); break; } if (!isAvailableThroughGlobal) { const parent2 = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent2.kind === 260 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent2.kind === 261 /* VariableDeclaration */) { const { name } = parent2; if (name.kind === 80 /* Identifier */) { directImports.push(name); @@ -170967,7 +171915,7 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, { case 80 /* Identifier */: break; // TODO: GH#23879 - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: handleNamespaceImport( direct, direct.name, @@ -170976,11 +171924,11 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, { false ); break; - case 272 /* ImportDeclaration */: - case 351 /* JSDocImportTag */: + case 273 /* ImportDeclaration */: + case 352 /* JSDocImportTag */: directImports.push(direct); const namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 274 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 275 /* NamespaceImport */) { handleNamespaceImport( direct, namedBindings.name, @@ -170993,10 +171941,10 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, { addIndirectUser(getSourceFileLikeForImportDeclaration(direct)); } break; - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: if (!direct.exportClause) { handleDirectImports(getContainingModuleSymbol(direct, checker)); - } else if (direct.exportClause.kind === 280 /* NamespaceExport */) { + } else if (direct.exportClause.kind === 281 /* NamespaceExport */) { addIndirectUser( getSourceFileLikeForImportDeclaration(direct), /*addTransitiveDependencies*/ @@ -171006,7 +171954,7 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, { directImports.push(direct); } break; - case 205 /* ImportType */: + case 206 /* ImportType */: if (!isAvailableThroughGlobal && direct.isTypeOf && !direct.qualifier && isExported2(direct)) { addIndirectUser( direct.getSourceFile(), @@ -171045,7 +171993,7 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, { if (!alreadyAddedDirect) directImports.push(importDeclaration); } else if (!isAvailableThroughGlobal) { const sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - Debug.assert(sourceFileLike.kind === 307 /* SourceFile */ || sourceFileLike.kind === 267 /* ModuleDeclaration */); + Debug.assert(sourceFileLike.kind === 308 /* SourceFile */ || sourceFileLike.kind === 268 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUser( sourceFileLike, @@ -171096,7 +172044,7 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c } return { importSearches, singleReferences }; function handleImport(decl) { - if (decl.kind === 271 /* ImportEqualsDeclaration */) { + if (decl.kind === 272 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -171106,7 +172054,7 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c handleNamespaceImportLike(decl); return; } - if (decl.kind === 205 /* ImportType */) { + if (decl.kind === 206 /* ImportType */) { if (decl.qualifier) { const firstIdentifier = getFirstIdentifier(decl.qualifier); if (firstIdentifier.escapedText === symbolName(exportSymbol)) { @@ -171120,7 +172068,7 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c if (decl.moduleSpecifier.kind !== 11 /* StringLiteral */) { return; } - if (decl.kind === 278 /* ExportDeclaration */) { + if (decl.kind === 279 /* ExportDeclaration */) { if (decl.exportClause && isNamedExports(decl.exportClause)) { searchForNamedImport(decl.exportClause); } @@ -171129,10 +172077,10 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c const { name, namedBindings } = decl.importClause || { name: void 0, namedBindings: void 0 }; if (namedBindings) { switch (namedBindings.kind) { - case 274 /* NamespaceImport */: + case 275 /* NamespaceImport */: handleNamespaceImportLike(namedBindings.name); break; - case 275 /* NamedImports */: + case 276 /* NamedImports */: if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) { searchForNamedImport(namedBindings); } @@ -171166,7 +172114,7 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c addSearch(name, checker.getSymbolAtLocation(name)); } } else { - const localSymbol = element.kind === 281 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) : checker.getSymbolAtLocation(name); + const localSymbol = element.kind === 282 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); } } @@ -171189,7 +172137,7 @@ function findModuleReferences(program, sourceFiles, searchModuleSymbol) { const checker = program.getTypeChecker(); for (const referencingFile of sourceFiles) { const searchSourceFile = searchModuleSymbol.valueDeclaration; - if ((searchSourceFile == null ? void 0 : searchSourceFile.kind) === 307 /* SourceFile */) { + if ((searchSourceFile == null ? void 0 : searchSourceFile.kind) === 308 /* SourceFile */) { for (const ref of referencingFile.referencedFiles) { if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { refs.push({ kind: "reference", referencingFile, ref }); @@ -171230,7 +172178,7 @@ function getDirectImportsMap(sourceFiles, checker, cancellationToken) { return map2; } function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return forEach(sourceFileLike.kind === 307 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, (statement) => ( + return forEach(sourceFileLike.kind === 308 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, (statement) => ( // TODO: GH#18217 action(statement) || isAmbientModuleDeclaration(statement) && forEach(statement.body && statement.body.statements, action) )); @@ -171243,15 +172191,15 @@ function forEachImport(sourceFile, action) { } else { forEachPossibleImportOrExportStatement(sourceFile, (statement) => { switch (statement.kind) { - case 278 /* ExportDeclaration */: - case 272 /* ImportDeclaration */: { + case 279 /* ExportDeclaration */: + case 273 /* ImportDeclaration */: { const decl = statement; if (decl.moduleSpecifier && isStringLiteral(decl.moduleSpecifier)) { action(decl, decl.moduleSpecifier); } break; } - case 271 /* ImportEqualsDeclaration */: { + case 272 /* ImportEqualsDeclaration */: { const decl = statement; if (isExternalModuleImportEquals(decl)) { action(decl, decl.moduleReference.expression); @@ -171269,7 +172217,7 @@ function getImportOrExportSymbol(node, symbol, checker, comingFromExport) { const { parent: parent2 } = node; const grandparent = parent2.parent; if (symbol.exportSymbol) { - if (parent2.kind === 211 /* PropertyAccessExpression */) { + if (parent2.kind === 212 /* PropertyAccessExpression */) { return ((_a = symbol.declarations) == null ? void 0 : _a.some((d) => d === parent2)) && isBinaryExpression(grandparent) ? getSpecialPropertyExport( grandparent, /*useLhsSymbol*/ @@ -171382,15 +172330,15 @@ function getExportNode(parent2, node) { function isNodeImport(node) { const { parent: parent2 } = node; switch (parent2.kind) { - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return parent2.name === node && isExternalModuleImportEquals(parent2); - case 276 /* ImportSpecifier */: + case 277 /* ImportSpecifier */: return !parent2.propertyName; - case 273 /* ImportClause */: - case 274 /* NamespaceImport */: + case 274 /* ImportClause */: + case 275 /* NamespaceImport */: Debug.assert(parent2.name === node); return true; - case 208 /* BindingElement */: + case 209 /* BindingElement */: return isInJSFile(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(parent2.parent.parent); default: return false; @@ -171420,21 +172368,21 @@ function getContainingModuleSymbol(importer, checker) { return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 213 /* CallExpression */ || node.kind === 351 /* JSDocImportTag */) { + if (node.kind === 214 /* CallExpression */ || node.kind === 352 /* JSDocImportTag */) { return node.getSourceFile(); } const { parent: parent2 } = node; - if (parent2.kind === 307 /* SourceFile */) { + if (parent2.kind === 308 /* SourceFile */) { return parent2; } - Debug.assert(parent2.kind === 268 /* ModuleBlock */); + Debug.assert(parent2.kind === 269 /* ModuleBlock */); return cast(parent2.parent, isAmbientModuleDeclaration); } function isAmbientModuleDeclaration(node) { - return node.kind === 267 /* ModuleDeclaration */ && node.name.kind === 11 /* StringLiteral */; + return node.kind === 268 /* ModuleDeclaration */ && node.name.kind === 11 /* StringLiteral */; } function isExternalModuleImportEquals(eq) { - return eq.moduleReference.kind === 283 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 11 /* StringLiteral */; + return eq.moduleReference.kind === 284 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 11 /* StringLiteral */; } // src/services/findAllReferences.ts @@ -171502,32 +172450,32 @@ function getContextNodeForNodeEntry(node) { function getContextNode(node) { if (!node) return void 0; switch (node.kind) { - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return !isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ? node : isVariableStatement(node.parent.parent) ? node.parent.parent : isForInOrOfStatement(node.parent.parent) ? getContextNode(node.parent.parent) : node.parent; - case 208 /* BindingElement */: + case 209 /* BindingElement */: return getContextNode(node.parent.parent); - case 276 /* ImportSpecifier */: + case 277 /* ImportSpecifier */: return node.parent.parent.parent; - case 281 /* ExportSpecifier */: - case 274 /* NamespaceImport */: + case 282 /* ExportSpecifier */: + case 275 /* NamespaceImport */: return node.parent.parent; - case 273 /* ImportClause */: - case 280 /* NamespaceExport */: + case 274 /* ImportClause */: + case 281 /* NamespaceExport */: return node.parent; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return isExpressionStatement(node.parent) ? node.parent : node; - case 250 /* ForOfStatement */: - case 249 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 250 /* ForInStatement */: return { start: node.initializer, end: node.expression }; - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode( findAncestor(node.parent, (node2) => isBinaryExpression(node2) || isForInOrOfStatement(node2)) ) : node; - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return { start: find(node.getChildren(node.getSourceFile()), (node2) => node2.kind === 109 /* SwitchKeyword */), end: node.caseBlock @@ -171569,7 +172517,7 @@ function getImplementationsAtPosition(program, cancellationToken, sourceFiles, s const node = getTouchingPropertyName(sourceFile, position); let referenceEntries; const entries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position); - if (node.parent.kind === 211 /* PropertyAccessExpression */ || node.parent.kind === 208 /* BindingElement */ || node.parent.kind === 212 /* ElementAccessExpression */ || node.kind === 108 /* SuperKeyword */) { + if (node.parent.kind === 212 /* PropertyAccessExpression */ || node.parent.kind === 209 /* BindingElement */ || node.parent.kind === 213 /* ElementAccessExpression */ || node.kind === 108 /* SuperKeyword */) { referenceEntries = entries && [...entries]; } else if (entries) { const queue = createQueue(entries); @@ -171590,11 +172538,11 @@ function getImplementationsAtPosition(program, cancellationToken, sourceFiles, s return map(referenceEntries, (entry) => toImplementationLocation(entry, checker)); } function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { - if (node.kind === 307 /* SourceFile */) { + if (node.kind === 308 /* SourceFile */) { return void 0; } const checker = program.getTypeChecker(); - if (node.parent.kind === 304 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 305 /* ShorthandPropertyAssignment */) { const result = []; Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, (node2) => result.push(nodeEntry(node2))); return result; @@ -171788,12 +172736,12 @@ function implementationKindDisplayParts(node, checker) { const symbol = checker.getSymbolAtLocation(isDeclaration(node) && node.name ? node.name : node); if (symbol) { return getDefinitionKindAndDisplayParts(symbol, checker, node); - } else if (node.kind === 210 /* ObjectLiteralExpression */) { + } else if (node.kind === 211 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [punctuationPart(21 /* OpenParenToken */), textPart("object literal"), punctuationPart(22 /* CloseParenToken */)] }; - } else if (node.kind === 231 /* ClassExpression */) { + } else if (node.kind === 232 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [punctuationPart(21 /* OpenParenToken */), textPart("anonymous local class"), punctuationPart(22 /* CloseParenToken */)] @@ -171830,7 +172778,7 @@ function getTextSpan(node, sourceFile, endNode2) { start += 1; end -= 1; } - if ((endNode2 == null ? void 0 : endNode2.kind) === 269 /* CaseBlock */) { + if ((endNode2 == null ? void 0 : endNode2.kind) === 270 /* CaseBlock */) { end = endNode2.getFullStart(); } return createTextSpanFromBounds(start, end); @@ -171852,47 +172800,47 @@ function isDeclarationOfSymbol(node, target) { function declarationIsWriteAccess(decl) { if (!!(decl.flags & 33554432 /* Ambient */)) return true; switch (decl.kind) { - case 226 /* BinaryExpression */: - case 208 /* BindingElement */: - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 227 /* BinaryExpression */: + case 209 /* BindingElement */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: case 90 /* DefaultKeyword */: - case 266 /* EnumDeclaration */: - case 306 /* EnumMember */: - case 281 /* ExportSpecifier */: - case 273 /* ImportClause */: + case 267 /* EnumDeclaration */: + case 307 /* EnumMember */: + case 282 /* ExportSpecifier */: + case 274 /* ImportClause */: // default import - case 271 /* ImportEqualsDeclaration */: - case 276 /* ImportSpecifier */: - case 264 /* InterfaceDeclaration */: - case 338 /* JSDocCallbackTag */: - case 346 /* JSDocTypedefTag */: - case 291 /* JsxAttribute */: - case 267 /* ModuleDeclaration */: - case 270 /* NamespaceExportDeclaration */: - case 274 /* NamespaceImport */: - case 280 /* NamespaceExport */: - case 169 /* Parameter */: - case 304 /* ShorthandPropertyAssignment */: - case 265 /* TypeAliasDeclaration */: - case 168 /* TypeParameter */: + case 272 /* ImportEqualsDeclaration */: + case 277 /* ImportSpecifier */: + case 265 /* InterfaceDeclaration */: + case 339 /* JSDocCallbackTag */: + case 347 /* JSDocTypedefTag */: + case 292 /* JsxAttribute */: + case 268 /* ModuleDeclaration */: + case 271 /* NamespaceExportDeclaration */: + case 275 /* NamespaceImport */: + case 281 /* NamespaceExport */: + case 170 /* Parameter */: + case 305 /* ShorthandPropertyAssignment */: + case 266 /* TypeAliasDeclaration */: + case 169 /* TypeParameter */: return true; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return !isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent); - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 176 /* Constructor */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 177 /* Constructor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return !!decl.body; - case 260 /* VariableDeclaration */: - case 172 /* PropertyDeclaration */: + case 261 /* VariableDeclaration */: + case 173 /* PropertyDeclaration */: return !!decl.initializer || isCatchClause(decl.parent); - case 173 /* MethodSignature */: - case 171 /* PropertySignature */: - case 348 /* JSDocPropertyTag */: - case 341 /* JSDocParameterTag */: + case 174 /* MethodSignature */: + case 172 /* PropertySignature */: + case 349 /* JSDocPropertyTag */: + case 342 /* JSDocParameterTag */: return false; default: return Debug.failBadSyntaxKind(decl); @@ -172114,9 +173062,9 @@ var Core; if (symbol.declarations) { for (const decl of symbol.declarations) { switch (decl.kind) { - case 307 /* SourceFile */: + case 308 /* SourceFile */: break; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: if (sourceFilesSet.has(decl.getSourceFile().fileName)) { references.push(nodeEntry(decl.name)); } @@ -172184,7 +173132,7 @@ var Core; /*useLocalSymbolForExportSpecifier*/ !isForRenameWithPrefixAndSuffixText(options) ) || originalSymbol; - const searchMeaning = node ? getIntersectingMeaningFromDeclarations(node, symbol) : 7 /* All */; + const searchMeaning = node && options.use !== 2 /* Rename */ ? getIntersectingMeaningFromDeclarations(node, symbol) : 7 /* All */; const result = []; const state = new State(sourceFiles, sourceFilesSet, node ? getSpecialSearchKind(node) : 0 /* None */, checker, cancellationToken, searchMeaning, options, result); const exportSpecifier = !isForRenameWithPrefixAndSuffixText(options) || !symbol.declarations ? void 0 : find(symbol.declarations, isExportSpecifier); @@ -172240,7 +173188,7 @@ var Core; } function getSpecialSearchKind(node) { switch (node.kind) { - case 176 /* Constructor */: + case 177 /* Constructor */: case 137 /* ConstructorKeyword */: return 1 /* Constructor */; case 80 /* Identifier */: @@ -172442,7 +173390,7 @@ var Core; } function getSymbolScope(symbol) { const { declarations, flags, parent: parent2, valueDeclaration } = symbol; - if (valueDeclaration && (valueDeclaration.kind === 218 /* FunctionExpression */ || valueDeclaration.kind === 231 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 219 /* FunctionExpression */ || valueDeclaration.kind === 232 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { @@ -172451,7 +173399,7 @@ var Core; if (flags & (4 /* Property */ | 8192 /* Method */)) { const privateDeclaration = find(declarations, (d) => hasEffectiveModifier(d, 2 /* Private */) || isPrivateIdentifierClassElementDeclaration(d)); if (privateDeclaration) { - return getAncestor(privateDeclaration, 263 /* ClassDeclaration */); + return getAncestor(privateDeclaration, 264 /* ClassDeclaration */); } return void 0; } @@ -172468,7 +173416,7 @@ var Core; if (scope && scope !== container) { return void 0; } - if (!container || container.kind === 307 /* SourceFile */ && !isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 308 /* SourceFile */ && !isExternalOrCommonJsModule(container)) { return void 0; } scope = container; @@ -172819,14 +173767,14 @@ var Core; if (constructorSymbol && constructorSymbol.declarations) { for (const decl of constructorSymbol.declarations) { const ctrKeyword = findChildOfKind(decl, 137 /* ConstructorKeyword */, sourceFile); - Debug.assert(decl.kind === 176 /* Constructor */ && !!ctrKeyword); + Debug.assert(decl.kind === 177 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } } if (classSymbol.exports) { classSymbol.exports.forEach((member) => { const decl = member.valueDeclaration; - if (decl && decl.kind === 174 /* MethodDeclaration */) { + if (decl && decl.kind === 175 /* MethodDeclaration */) { const body = decl.body; if (body) { forEachDescendantOfKind(body, 110 /* ThisKeyword */, (thisKeyword) => { @@ -172848,7 +173796,7 @@ var Core; return; } for (const decl of constructor.declarations) { - Debug.assert(decl.kind === 176 /* Constructor */); + Debug.assert(decl.kind === 177 /* Constructor */); const body = decl.body; if (body) { forEachDescendantOfKind(body, 108 /* SuperKeyword */, (node) => { @@ -172882,7 +173830,7 @@ var Core; if (refNode.kind !== 80 /* Identifier */) { return; } - if (refNode.parent.kind === 304 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 305 /* ShorthandPropertyAssignment */) { getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference2); } const containingNode = getContainingNodeIfInHeritageClause(refNode); @@ -172897,7 +173845,7 @@ var Core; addIfImplementation(typeHavingNode.initializer); } else if (isFunctionLike(typeHavingNode) && typeHavingNode.body) { const body = typeHavingNode.body; - if (body.kind === 241 /* Block */) { + if (body.kind === 242 /* Block */) { forEachReturnStatement(body, (returnStatement) => { if (returnStatement.expression) addIfImplementation(returnStatement.expression); }); @@ -172917,13 +173865,13 @@ var Core; } function isImplementationExpression(node) { switch (node.kind) { - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: - case 210 /* ObjectLiteralExpression */: - case 231 /* ClassExpression */: - case 209 /* ArrayLiteralExpression */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 211 /* ObjectLiteralExpression */: + case 232 /* ClassExpression */: + case 210 /* ArrayLiteralExpression */: return true; default: return false; @@ -172959,13 +173907,13 @@ var Core; } let staticFlag = 256 /* Static */; switch (searchSpaceNode.kind) { - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: staticFlag &= getSyntacticModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; break; @@ -172987,7 +173935,7 @@ var Core; return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references }]; } function isParameterName(node) { - return node.kind === 80 /* Identifier */ && node.parent.kind === 169 /* Parameter */ && node.parent.name === node; + return node.kind === 80 /* Identifier */ && node.parent.kind === 170 /* Parameter */ && node.parent.name === node; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { let searchSpaceNode = getThisContainer( @@ -172999,36 +173947,36 @@ var Core; ); let staticFlag = 256 /* Static */; switch (searchSpaceNode.kind) { - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: if (isObjectLiteralMethod(searchSpaceNode)) { staticFlag &= getSyntacticModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; break; } // falls through - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: staticFlag &= getSyntacticModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; break; - case 307 /* SourceFile */: + case 308 /* SourceFile */: if (isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { return void 0; } // falls through - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. default: return void 0; } - const references = flatMap(searchSpaceNode.kind === 307 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], (sourceFile) => { + const references = flatMap(searchSpaceNode.kind === 308 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], (sourceFile) => { cancellationToken.throwIfCancellationRequested(); return getPossibleSymbolReferenceNodes(sourceFile, "this", isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter((node) => { if (!isThis(node)) { @@ -173043,18 +173991,18 @@ var Core; ); if (!canHaveSymbol(container)) return false; switch (searchSpaceNode.kind) { - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: return searchSpaceNode.symbol === container.symbol; - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: return isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol; - case 231 /* ClassExpression */: - case 263 /* ClassDeclaration */: - case 210 /* ObjectLiteralExpression */: + case 232 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 211 /* ObjectLiteralExpression */: return container.parent && canHaveSymbol(container.parent) && searchSpaceNode.symbol === container.parent.symbol && isStatic(container) === !!staticFlag; - case 307 /* SourceFile */: - return container.kind === 307 /* SourceFile */ && !isExternalModule(container) && !isParameterName(node); + case 308 /* SourceFile */: + return container.kind === 308 /* SourceFile */ && !isExternalModule(container) && !isParameterName(node); } }); }).map((n) => nodeEntry(n)); @@ -173178,7 +174126,7 @@ var Core; Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1 /* FunctionScopedVariable */) && !!(paramProps[1].flags & 4 /* Property */)); return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]); } - const exportSpecifier = getDeclarationOfKind(symbol, 281 /* ExportSpecifier */); + const exportSpecifier = getDeclarationOfKind(symbol, 282 /* ExportSpecifier */); if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) { const localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (localSymbol) { @@ -173218,7 +174166,7 @@ var Core; ) || (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */) && allowBaseTypes(rootSymbol) ? getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, checker, (base) => cbSymbol(sym, rootSymbol, base, kind)) : void 0)); } function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol2, checker2) { - const bindingElement = getDeclarationOfKind(symbol2, 208 /* BindingElement */); + const bindingElement = getDeclarationOfKind(symbol2, 209 /* BindingElement */); if (bindingElement && isObjectBindingElementWithoutPropertyName(bindingElement)) { return getPropertySymbolFromBindingElement(checker2, bindingElement); } @@ -173231,8 +174179,8 @@ var Core; if (!(symbol2.flags & (32 /* Class */ | 64 /* Interface */)) || !addToSeen(seen, symbol2)) return; return firstDefined(symbol2.declarations, (declaration) => firstDefined(getAllSuperTypeNodes(declaration), (typeReference) => { const type = checker.getTypeAtLocation(typeReference); - const propertySymbol = type && type.symbol && checker.getPropertyOfType(type, propertyName); - return type && propertySymbol && (firstDefined(checker.getRootSymbols(propertySymbol), cb) || recur(type.symbol)); + const propertySymbol = type.symbol && checker.getPropertyOfType(type, propertyName); + return propertySymbol && firstDefined(checker.getRootSymbols(propertySymbol), cb) || type.symbol && recur(type.symbol); })); } } @@ -173447,7 +174395,7 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles const defs = getDefinitionFromSymbol(typeChecker, symbol, node, failedAliasResolution, declarationFilter) || emptyArray; return node.kind === 108 /* SuperKeyword */ ? [sigInfo, ...defs] : [...defs, sigInfo]; } - if (node.parent.kind === 304 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 305 /* ShorthandPropertyAssignment */) { const shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); const definitions = (shorthandSymbol == null ? void 0 : shorthandSymbol.declarations) ? shorthandSymbol.declarations.map((decl) => createDefinitionInfo( decl, @@ -173501,10 +174449,23 @@ function getDefinitionFromOverriddenMember(typeChecker, node) { const expression = skipParentheses(baseTypeNode.expression); const base = isClassExpression(expression) ? expression.symbol : typeChecker.getSymbolAtLocation(expression); if (!base) return; - const name = unescapeLeadingUnderscores(getTextOfPropertyName(classElement.name)); - const symbol = hasStaticModifier(classElement) ? typeChecker.getPropertyOfType(typeChecker.getTypeOfSymbol(base), name) : typeChecker.getPropertyOfType(typeChecker.getDeclaredTypeOfSymbol(base), name); - if (!symbol) return; - return getDefinitionFromSymbol(typeChecker, symbol, node); + const baseType = hasStaticModifier(classElement) ? typeChecker.getTypeOfSymbol(base) : typeChecker.getDeclaredTypeOfSymbol(base); + let baseProp; + if (isComputedPropertyName(classElement.name)) { + const prop = typeChecker.getSymbolAtLocation(classElement.name); + if (!prop) { + return; + } + if (isKnownSymbol(prop)) { + baseProp = find(typeChecker.getPropertiesOfType(baseType), (s) => s.escapedName === prop.escapedName); + } else { + baseProp = typeChecker.getPropertyOfType(baseType, unescapeLeadingUnderscores(prop.escapedName)); + } + } else { + baseProp = typeChecker.getPropertyOfType(baseType, unescapeLeadingUnderscores(getTextOfPropertyName(classElement.name))); + } + if (!baseProp) return; + return getDefinitionFromSymbol(typeChecker, baseProp, node); } function getReferenceAtPosition(sourceFile, position, program) { var _a, _b; @@ -173692,7 +174653,7 @@ function shouldSkipAlias(node, declaration) { if (node.parent === declaration) { return true; } - if (declaration.kind === 274 /* NamespaceImport */) { + if (declaration.kind === 275 /* NamespaceImport */) { return false; } return true; @@ -173810,20 +174771,20 @@ function isDefinitionVisible(checker, declaration) { if (!declaration.parent) return false; if (hasInitializer(declaration.parent) && declaration.parent.initializer === declaration) return isDefinitionVisible(checker, declaration.parent); switch (declaration.kind) { - case 172 /* PropertyDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 174 /* MethodDeclaration */: + case 173 /* PropertyDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 175 /* MethodDeclaration */: if (hasEffectiveModifier(declaration, 2 /* Private */)) return false; // Public properties/methods are visible if its parents are visible, so: // falls through - case 176 /* Constructor */: - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: - case 210 /* ObjectLiteralExpression */: - case 231 /* ClassExpression */: - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: + case 177 /* Constructor */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: + case 211 /* ObjectLiteralExpression */: + case 232 /* ClassExpression */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: return isDefinitionVisible(checker, declaration.parent); default: return false; @@ -173867,10 +174828,10 @@ function tryGetSignatureDeclaration(typeChecker, node) { } function isJsxConstructorLike(node) { switch (node.kind) { - case 176 /* Constructor */: - case 185 /* ConstructorType */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: + case 177 /* Constructor */: + case 186 /* ConstructorType */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: return true; default: return false; @@ -173910,14 +174871,14 @@ function provideInlayHints(context) { return; } switch (node.kind) { - case 267 /* ModuleDeclaration */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 262 /* FunctionDeclaration */: - case 231 /* ClassExpression */: - case 218 /* FunctionExpression */: - case 174 /* MethodDeclaration */: - case 219 /* ArrowFunction */: + case 268 /* ModuleDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 263 /* FunctionDeclaration */: + case 232 /* ClassExpression */: + case 219 /* FunctionExpression */: + case 175 /* MethodDeclaration */: + case 220 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } if (!textSpanIntersectsWith(span, node.pos, node.getFullWidth())) { @@ -174082,7 +175043,7 @@ function provideInlayHints(context) { } function isHintableLiteral(node) { switch (node.kind) { - case 224 /* PrefixUnaryExpression */: { + case 225 /* PrefixUnaryExpression */: { const operand = node.operand; return isLiteralExpression(operand) || isIdentifier(operand) && isInfinityOrNaNString(operand.escapedText); } @@ -174090,7 +175051,7 @@ function provideInlayHints(context) { case 97 /* FalseKeyword */: case 106 /* NullKeyword */: case 15 /* NoSubstitutionTemplateLiteral */: - case 228 /* TemplateExpression */: + case 229 /* TemplateExpression */: return true; case 80 /* Identifier */: { const name = node.escapedText; @@ -174268,13 +175229,13 @@ function provideInlayHints(context) { parts.push({ text: identifierText }); } break; - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: Debug.assertNode(node2, isQualifiedName); visitForDisplayParts(node2.left); parts.push({ text: "." }); visitForDisplayParts(node2.right); break; - case 182 /* TypePredicate */: + case 183 /* TypePredicate */: Debug.assertNode(node2, isTypePredicateNode); if (node2.assertsModifier) { parts.push({ text: "asserts " }); @@ -174285,7 +175246,7 @@ function provideInlayHints(context) { visitForDisplayParts(node2.type); } break; - case 183 /* TypeReference */: + case 184 /* TypeReference */: Debug.assertNode(node2, isTypeReferenceNode); visitForDisplayParts(node2.typeName); if (node2.typeArguments) { @@ -174294,7 +175255,7 @@ function provideInlayHints(context) { parts.push({ text: ">" }); } break; - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: Debug.assertNode(node2, isTypeParameterDeclaration); if (node2.modifiers) { visitDisplayPartList(node2.modifiers, " "); @@ -174309,7 +175270,7 @@ function provideInlayHints(context) { visitForDisplayParts(node2.default); } break; - case 169 /* Parameter */: + case 170 /* Parameter */: Debug.assertNode(node2, isParameter); if (node2.modifiers) { visitDisplayPartList(node2.modifiers, " "); @@ -174326,14 +175287,14 @@ function provideInlayHints(context) { visitForDisplayParts(node2.type); } break; - case 185 /* ConstructorType */: + case 186 /* ConstructorType */: Debug.assertNode(node2, isConstructorTypeNode); parts.push({ text: "new " }); visitParametersAndTypeParameters(node2); parts.push({ text: " => " }); visitForDisplayParts(node2.type); break; - case 186 /* TypeQuery */: + case 187 /* TypeQuery */: Debug.assertNode(node2, isTypeQueryNode); parts.push({ text: "typeof " }); visitForDisplayParts(node2.exprName); @@ -174343,7 +175304,7 @@ function provideInlayHints(context) { parts.push({ text: ">" }); } break; - case 187 /* TypeLiteral */: + case 188 /* TypeLiteral */: Debug.assertNode(node2, isTypeLiteralNode); parts.push({ text: "{" }); if (node2.members.length) { @@ -174353,18 +175314,18 @@ function provideInlayHints(context) { } parts.push({ text: "}" }); break; - case 188 /* ArrayType */: + case 189 /* ArrayType */: Debug.assertNode(node2, isArrayTypeNode); visitForDisplayParts(node2.elementType); parts.push({ text: "[]" }); break; - case 189 /* TupleType */: + case 190 /* TupleType */: Debug.assertNode(node2, isTupleTypeNode); parts.push({ text: "[" }); visitDisplayPartList(node2.elements, ", "); parts.push({ text: "]" }); break; - case 202 /* NamedTupleMember */: + case 203 /* NamedTupleMember */: Debug.assertNode(node2, isNamedTupleMember); if (node2.dotDotDotToken) { parts.push({ text: "..." }); @@ -174376,25 +175337,25 @@ function provideInlayHints(context) { parts.push({ text: ": " }); visitForDisplayParts(node2.type); break; - case 190 /* OptionalType */: + case 191 /* OptionalType */: Debug.assertNode(node2, isOptionalTypeNode); visitForDisplayParts(node2.type); parts.push({ text: "?" }); break; - case 191 /* RestType */: + case 192 /* RestType */: Debug.assertNode(node2, isRestTypeNode); parts.push({ text: "..." }); visitForDisplayParts(node2.type); break; - case 192 /* UnionType */: + case 193 /* UnionType */: Debug.assertNode(node2, isUnionTypeNode); visitDisplayPartList(node2.types, " | "); break; - case 193 /* IntersectionType */: + case 194 /* IntersectionType */: Debug.assertNode(node2, isIntersectionTypeNode); visitDisplayPartList(node2.types, " & "); break; - case 194 /* ConditionalType */: + case 195 /* ConditionalType */: Debug.assertNode(node2, isConditionalTypeNode); visitForDisplayParts(node2.checkType); parts.push({ text: " extends " }); @@ -174404,30 +175365,30 @@ function provideInlayHints(context) { parts.push({ text: " : " }); visitForDisplayParts(node2.falseType); break; - case 195 /* InferType */: + case 196 /* InferType */: Debug.assertNode(node2, isInferTypeNode); parts.push({ text: "infer " }); visitForDisplayParts(node2.typeParameter); break; - case 196 /* ParenthesizedType */: + case 197 /* ParenthesizedType */: Debug.assertNode(node2, isParenthesizedTypeNode); parts.push({ text: "(" }); visitForDisplayParts(node2.type); parts.push({ text: ")" }); break; - case 198 /* TypeOperator */: + case 199 /* TypeOperator */: Debug.assertNode(node2, isTypeOperatorNode); parts.push({ text: `${tokenToString(node2.operator)} ` }); visitForDisplayParts(node2.type); break; - case 199 /* IndexedAccessType */: + case 200 /* IndexedAccessType */: Debug.assertNode(node2, isIndexedAccessTypeNode); visitForDisplayParts(node2.objectType); parts.push({ text: "[" }); visitForDisplayParts(node2.indexType); parts.push({ text: "]" }); break; - case 200 /* MappedType */: + case 201 /* MappedType */: Debug.assertNode(node2, isMappedTypeNode); parts.push({ text: "{ " }); if (node2.readonlyToken) { @@ -174459,17 +175420,17 @@ function provideInlayHints(context) { } parts.push({ text: "; }" }); break; - case 201 /* LiteralType */: + case 202 /* LiteralType */: Debug.assertNode(node2, isLiteralTypeNode); visitForDisplayParts(node2.literal); break; - case 184 /* FunctionType */: + case 185 /* FunctionType */: Debug.assertNode(node2, isFunctionTypeNode); visitParametersAndTypeParameters(node2); parts.push({ text: " => " }); visitForDisplayParts(node2.type); break; - case 205 /* ImportType */: + case 206 /* ImportType */: Debug.assertNode(node2, isImportTypeNode); if (node2.isTypeOf) { parts.push({ text: "typeof " }); @@ -174492,7 +175453,7 @@ function provideInlayHints(context) { parts.push({ text: ">" }); } break; - case 171 /* PropertySignature */: + case 172 /* PropertySignature */: Debug.assertNode(node2, isPropertySignature); if ((_a = node2.modifiers) == null ? void 0 : _a.length) { visitDisplayPartList(node2.modifiers, " "); @@ -174507,7 +175468,7 @@ function provideInlayHints(context) { visitForDisplayParts(node2.type); } break; - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: Debug.assertNode(node2, isIndexSignatureDeclaration); parts.push({ text: "[" }); visitDisplayPartList(node2.parameters, ", "); @@ -174517,7 +175478,7 @@ function provideInlayHints(context) { visitForDisplayParts(node2.type); } break; - case 173 /* MethodSignature */: + case 174 /* MethodSignature */: Debug.assertNode(node2, isMethodSignature); if ((_b = node2.modifiers) == null ? void 0 : _b.length) { visitDisplayPartList(node2.modifiers, " "); @@ -174533,7 +175494,7 @@ function provideInlayHints(context) { visitForDisplayParts(node2.type); } break; - case 179 /* CallSignature */: + case 180 /* CallSignature */: Debug.assertNode(node2, isCallSignatureDeclaration); visitParametersAndTypeParameters(node2); if (node2.type) { @@ -174541,13 +175502,22 @@ function provideInlayHints(context) { visitForDisplayParts(node2.type); } break; - case 207 /* ArrayBindingPattern */: + case 181 /* ConstructSignature */: + Debug.assertNode(node2, isConstructSignatureDeclaration); + parts.push({ text: "new " }); + visitParametersAndTypeParameters(node2); + if (node2.type) { + parts.push({ text: ": " }); + visitForDisplayParts(node2.type); + } + break; + case 208 /* ArrayBindingPattern */: Debug.assertNode(node2, isArrayBindingPattern); parts.push({ text: "[" }); visitDisplayPartList(node2.elements, ", "); parts.push({ text: "]" }); break; - case 206 /* ObjectBindingPattern */: + case 207 /* ObjectBindingPattern */: Debug.assertNode(node2, isObjectBindingPattern); parts.push({ text: "{" }); if (node2.elements.length) { @@ -174557,16 +175527,16 @@ function provideInlayHints(context) { } parts.push({ text: "}" }); break; - case 208 /* BindingElement */: + case 209 /* BindingElement */: Debug.assertNode(node2, isBindingElement); visitForDisplayParts(node2.name); break; - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: Debug.assertNode(node2, isPrefixUnaryExpression); parts.push({ text: tokenToString(node2.operator) }); visitForDisplayParts(node2.operand); break; - case 203 /* TemplateLiteralType */: + case 204 /* TemplateLiteralType */: Debug.assertNode(node2, isTemplateLiteralTypeNode); visitForDisplayParts(node2.head); node2.templateSpans.forEach(visitForDisplayParts); @@ -174575,7 +175545,7 @@ function provideInlayHints(context) { Debug.assertNode(node2, isTemplateHead); parts.push({ text: getLiteralText2(node2) }); break; - case 204 /* TemplateLiteralTypeSpan */: + case 205 /* TemplateLiteralTypeSpan */: Debug.assertNode(node2, isTemplateLiteralTypeSpan); visitForDisplayParts(node2.type); visitForDisplayParts(node2.literal); @@ -174588,10 +175558,16 @@ function provideInlayHints(context) { Debug.assertNode(node2, isTemplateTail); parts.push({ text: getLiteralText2(node2) }); break; - case 197 /* ThisType */: + case 198 /* ThisType */: Debug.assertNode(node2, isThisTypeNode); parts.push({ text: "this" }); break; + case 168 /* ComputedPropertyName */: + Debug.assertNode(node2, isComputedPropertyName); + parts.push({ text: "[" }); + visitForDisplayParts(node2.expression); + parts.push({ text: "]" }); + break; default: Debug.failBadSyntaxKind(node2); } @@ -174762,8 +175738,8 @@ function getJsDocCommentsFromDeclarations(declarations, checker) { const parts = []; forEachUnique(declarations, (declaration) => { for (const jsdoc of getCommentHavingNodes(declaration)) { - const inheritDoc = isJSDoc(jsdoc) && jsdoc.tags && find(jsdoc.tags, (t) => t.kind === 327 /* JSDocTag */ && (t.tagName.escapedText === "inheritDoc" || t.tagName.escapedText === "inheritdoc")); - if (jsdoc.comment === void 0 && !inheritDoc || isJSDoc(jsdoc) && declaration.kind !== 346 /* JSDocTypedefTag */ && declaration.kind !== 338 /* JSDocCallbackTag */ && jsdoc.tags && jsdoc.tags.some((t) => t.kind === 346 /* JSDocTypedefTag */ || t.kind === 338 /* JSDocCallbackTag */) && !jsdoc.tags.some((t) => t.kind === 341 /* JSDocParameterTag */ || t.kind === 342 /* JSDocReturnTag */)) { + const inheritDoc = isJSDoc(jsdoc) && jsdoc.tags && find(jsdoc.tags, (t) => t.kind === 328 /* JSDocTag */ && (t.tagName.escapedText === "inheritDoc" || t.tagName.escapedText === "inheritdoc")); + if (jsdoc.comment === void 0 && !inheritDoc || isJSDoc(jsdoc) && declaration.kind !== 347 /* JSDocTypedefTag */ && declaration.kind !== 339 /* JSDocCallbackTag */ && jsdoc.tags && jsdoc.tags.some((t) => t.kind === 347 /* JSDocTypedefTag */ || t.kind === 339 /* JSDocCallbackTag */) && !jsdoc.tags.some((t) => t.kind === 342 /* JSDocParameterTag */ || t.kind === 343 /* JSDocReturnTag */)) { continue; } let newparts = jsdoc.comment ? getDisplayPartsFromComment(jsdoc.comment, checker) : []; @@ -174782,13 +175758,13 @@ function isIdenticalListOfDisplayParts(parts1, parts2) { } function getCommentHavingNodes(declaration) { switch (declaration.kind) { - case 341 /* JSDocParameterTag */: - case 348 /* JSDocPropertyTag */: + case 342 /* JSDocParameterTag */: + case 349 /* JSDocPropertyTag */: return [declaration]; - case 338 /* JSDocCallbackTag */: - case 346 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: + case 347 /* JSDocTypedefTag */: return [declaration, declaration.parent]; - case 323 /* JSDocSignature */: + case 324 /* JSDocSignature */: if (isJSDocOverloadTag(declaration.parent)) { return [declaration.parent.parent]; } @@ -174801,7 +175777,7 @@ function getJsDocTagsFromDeclarations(declarations, checker) { const infos = []; forEachUnique(declarations, (declaration) => { const tags = getJSDocTags(declaration); - if (tags.some((t) => t.kind === 346 /* JSDocTypedefTag */ || t.kind === 338 /* JSDocCallbackTag */) && !tags.some((t) => t.kind === 341 /* JSDocParameterTag */ || t.kind === 342 /* JSDocReturnTag */)) { + if (tags.some((t) => t.kind === 347 /* JSDocTypedefTag */ || t.kind === 339 /* JSDocCallbackTag */) && !tags.some((t) => t.kind === 342 /* JSDocParameterTag */ || t.kind === 343 /* JSDocReturnTag */)) { return; } for (const tag of tags) { @@ -174823,21 +175799,21 @@ function getDisplayPartsFromComment(comment, checker) { } return flatMap( comment, - (node) => node.kind === 321 /* JSDocText */ ? [textPart(node.text)] : buildLinkParts(node, checker) + (node) => node.kind === 322 /* JSDocText */ ? [textPart(node.text)] : buildLinkParts(node, checker) ); } function getCommentDisplayParts(tag, checker) { const { comment, kind } = tag; const namePart = getTagNameDisplayPart(kind); switch (kind) { - case 349 /* JSDocThrowsTag */: + case 350 /* JSDocThrowsTag */: const typeExpression = tag.typeExpression; return typeExpression ? withNode(typeExpression) : comment === void 0 ? void 0 : getDisplayPartsFromComment(comment, checker); - case 329 /* JSDocImplementsTag */: + case 330 /* JSDocImplementsTag */: return withNode(tag.class); - case 328 /* JSDocAugmentsTag */: + case 329 /* JSDocAugmentsTag */: return withNode(tag.class); - case 345 /* JSDocTemplateTag */: + case 346 /* JSDocTemplateTag */: const templateTag = tag; const displayParts = []; if (templateTag.constraint) { @@ -174859,14 +175835,14 @@ function getCommentDisplayParts(tag, checker) { displayParts.push(...[spacePart(), ...getDisplayPartsFromComment(comment, checker)]); } return displayParts; - case 344 /* JSDocTypeTag */: - case 350 /* JSDocSatisfiesTag */: + case 345 /* JSDocTypeTag */: + case 351 /* JSDocSatisfiesTag */: return withNode(tag.typeExpression); - case 346 /* JSDocTypedefTag */: - case 338 /* JSDocCallbackTag */: - case 348 /* JSDocPropertyTag */: - case 341 /* JSDocParameterTag */: - case 347 /* JSDocSeeTag */: + case 347 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: + case 349 /* JSDocPropertyTag */: + case 342 /* JSDocParameterTag */: + case 348 /* JSDocSeeTag */: const { name } = tag; return name ? withNode(name) : comment === void 0 ? void 0 : getDisplayPartsFromComment(comment, checker); default: @@ -174889,14 +175865,14 @@ function getCommentDisplayParts(tag, checker) { } function getTagNameDisplayPart(kind) { switch (kind) { - case 341 /* JSDocParameterTag */: + case 342 /* JSDocParameterTag */: return parameterNamePart; - case 348 /* JSDocPropertyTag */: + case 349 /* JSDocPropertyTag */: return propertyNamePart; - case 345 /* JSDocTemplateTag */: + case 346 /* JSDocTemplateTag */: return typeParameterNamePart; - case 346 /* JSDocTypedefTag */: - case 338 /* JSDocCallbackTag */: + case 347 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: return typeAliasNamePart; default: return textPart; @@ -175019,46 +175995,46 @@ function getCommentOwnerInfo(tokenAtPos, options) { } function getCommentOwnerInfoWorker(commentOwner, options) { switch (commentOwner.kind) { - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 174 /* MethodDeclaration */: - case 176 /* Constructor */: - case 173 /* MethodSignature */: - case 219 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 175 /* MethodDeclaration */: + case 177 /* Constructor */: + case 174 /* MethodSignature */: + case 220 /* ArrowFunction */: const host = commentOwner; return { commentOwner, parameters: host.parameters, hasReturn: hasReturn(host, options) }; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return getCommentOwnerInfoWorker(commentOwner.initializer, options); - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: - case 306 /* EnumMember */: - case 265 /* TypeAliasDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: + case 307 /* EnumMember */: + case 266 /* TypeAliasDeclaration */: return { commentOwner }; - case 171 /* PropertySignature */: { + case 172 /* PropertySignature */: { const host2 = commentOwner; return host2.type && isFunctionTypeNode(host2.type) ? { commentOwner, parameters: host2.type.parameters, hasReturn: hasReturn(host2.type, options) } : { commentOwner }; } - case 243 /* VariableStatement */: { + case 244 /* VariableStatement */: { const varStatement = commentOwner; const varDeclarations = varStatement.declarationList.declarations; const host2 = varDeclarations.length === 1 && varDeclarations[0].initializer ? getRightHandSideOfAssignment(varDeclarations[0].initializer) : void 0; return host2 ? { commentOwner, parameters: host2.parameters, hasReturn: hasReturn(host2, options) } : { commentOwner }; } - case 307 /* SourceFile */: + case 308 /* SourceFile */: return "quit"; - case 267 /* ModuleDeclaration */: - return commentOwner.parent.kind === 267 /* ModuleDeclaration */ ? void 0 : { commentOwner }; - case 244 /* ExpressionStatement */: + case 268 /* ModuleDeclaration */: + return commentOwner.parent.kind === 268 /* ModuleDeclaration */ ? void 0 : { commentOwner }; + case 245 /* ExpressionStatement */: return getCommentOwnerInfoWorker(commentOwner.expression, options); - case 226 /* BinaryExpression */: { + case 227 /* BinaryExpression */: { const be = commentOwner; if (getAssignmentDeclarationKind(be) === 0 /* None */) { return "quit"; } return isFunctionLike(be.right) ? { commentOwner, parameters: be.right.parameters, hasReturn: hasReturn(be.right, options) } : { commentOwner }; } - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: const init = commentOwner.initializer; if (init && (isFunctionExpression(init) || isArrowFunction(init))) { return { commentOwner, parameters: init.parameters, hasReturn: hasReturn(init, options) }; @@ -175069,14 +176045,14 @@ function hasReturn(node, options) { return !!(options == null ? void 0 : options.generateReturnInDocTemplate) && (isFunctionTypeNode(node) || isArrowFunction(node) && isExpression(node.body) || isFunctionLikeDeclaration(node) && node.body && isBlock(node.body) && !!forEachReturnStatement(node.body, (n) => n)); } function getRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 217 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 218 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return rightHandSide; - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return find(rightHandSide.members, isConstructorDeclaration); } } @@ -175253,7 +176229,7 @@ function matchNode(a, b) { if (a.kind !== b.kind) { return false; } - if (a.kind === 176 /* Constructor */) { + if (a.kind === 177 /* Constructor */) { return a.kind === b.kind; } if (isNamedDeclaration(a) && isNamedDeclaration(b)) { @@ -175706,7 +176682,7 @@ function updateImportDeclarationAndClause(importDeclaration, name, namedBindings return factory.updateImportDeclaration( importDeclaration, importDeclaration.modifiers, - factory.updateImportClause(importDeclaration.importClause, importDeclaration.importClause.isTypeOnly, name, namedBindings), + factory.updateImportClause(importDeclaration.importClause, importDeclaration.importClause.phaseModifier, name, namedBindings), // TODO: GH#18217 importDeclaration.moduleSpecifier, importDeclaration.attributes @@ -175733,11 +176709,11 @@ function getModuleNamesFromDecls(decls) { function getModuleSpecifierExpression(declaration) { var _a; switch (declaration.kind) { - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return (_a = tryCast(declaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a.expression; - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return declaration.moduleSpecifier; - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return declaration.declarationList.declarations[0].initializer.arguments[0]; } } @@ -175851,15 +176827,15 @@ function compareImportKind(s1, s2) { function getImportKindOrder(s1) { var _a; switch (s1.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: if (!s1.importClause) return 0; if (s1.importClause.isTypeOnly) return 1; - if (((_a = s1.importClause.namedBindings) == null ? void 0 : _a.kind) === 274 /* NamespaceImport */) return 2; + if (((_a = s1.importClause.namedBindings) == null ? void 0 : _a.kind) === 275 /* NamespaceImport */) return 2; if (s1.importClause.name) return 3; return 4; - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return 5; - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return 6; } } @@ -176108,21 +177084,21 @@ function createOutliningSpanFromBounds(pos, end, kind) { } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 241 /* Block */: + case 242 /* Block */: if (isFunctionLike(n.parent)) { return functionSpan(n.parent, n, sourceFile); } switch (n.parent.kind) { - case 246 /* DoStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 248 /* ForStatement */: - case 245 /* IfStatement */: - case 247 /* WhileStatement */: - case 254 /* WithStatement */: - case 299 /* CatchClause */: + case 247 /* DoStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 249 /* ForStatement */: + case 246 /* IfStatement */: + case 248 /* WhileStatement */: + case 255 /* WithStatement */: + case 300 /* CatchClause */: return spanForNode(n.parent); - case 258 /* TryStatement */: + case 259 /* TryStatement */: const tryStatement = n.parent; if (tryStatement.tryBlock === n) { return spanForNode(n.parent); @@ -176134,17 +177110,17 @@ function getOutliningSpanForNode(n, sourceFile) { default: return createOutliningSpan(createTextSpanFromNode(n, sourceFile), "code" /* Code */); } - case 268 /* ModuleBlock */: + case 269 /* ModuleBlock */: return spanForNode(n.parent); - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: - case 269 /* CaseBlock */: - case 187 /* TypeLiteral */: - case 206 /* ObjectBindingPattern */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: + case 270 /* CaseBlock */: + case 188 /* TypeLiteral */: + case 207 /* ObjectBindingPattern */: return spanForNode(n); - case 189 /* TupleType */: + case 190 /* TupleType */: return spanForNode( n, /*autoCollapse*/ @@ -176153,24 +177129,24 @@ function getOutliningSpanForNode(n, sourceFile) { !isTupleTypeNode(n.parent), 23 /* OpenBracketToken */ ); - case 296 /* CaseClause */: - case 297 /* DefaultClause */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: return spanForNodeArray(n.statements); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 23 /* OpenBracketToken */); - case 284 /* JsxElement */: + case 285 /* JsxElement */: return spanForJSXElement(n); - case 288 /* JsxFragment */: + case 289 /* JsxFragment */: return spanForJSXFragment(n); - case 285 /* JsxSelfClosingElement */: - case 286 /* JsxOpeningElement */: + case 286 /* JsxSelfClosingElement */: + case 287 /* JsxOpeningElement */: return spanForJSXAttributes(n.attributes); - case 228 /* TemplateExpression */: + case 229 /* TemplateExpression */: case 15 /* NoSubstitutionTemplateLiteral */: return spanForTemplateLiteral(n); - case 207 /* ArrayBindingPattern */: + case 208 /* ArrayBindingPattern */: return spanForNode( n, /*autoCollapse*/ @@ -176179,15 +177155,15 @@ function getOutliningSpanForNode(n, sourceFile) { !isBindingElement(n.parent), 23 /* OpenBracketToken */ ); - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return spanForArrowFunction(n); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return spanForCallExpression(n); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return spanForParenthesizedExpression(n); - case 275 /* NamedImports */: - case 279 /* NamedExports */: - case 300 /* ImportAttributes */: + case 276 /* NamedImports */: + case 280 /* NamedExports */: + case 301 /* ImportAttributes */: return spanForImportExportElements(n); } function spanForImportExportElements(node) { @@ -176307,7 +177283,7 @@ function functionSpan(node, body, sourceFile) { node, sourceFile, /*autoCollapse*/ - node.kind !== 219 /* ArrowFunction */ + node.kind !== 220 /* ArrowFunction */ ); } function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse = false, useFullStart = true) { @@ -176375,7 +177351,7 @@ function getRenameInfoForNode(node, typeChecker, sourceFile, program, preference return getRenameInfoError(wouldRenameNodeModules); } const kind = ts_SymbolDisplay_exports.getSymbolKind(typeChecker, symbol, node); - const specifierName = isImportOrExportSpecifierName(node) || isStringOrNumericLiteralLike(node) && node.parent.kind === 167 /* ComputedPropertyName */ ? stripQuotes(getTextOfIdentifierOrLiteral(node)) : void 0; + const specifierName = isImportOrExportSpecifierName(node) || isStringOrNumericLiteralLike(node) && node.parent.kind === 168 /* ComputedPropertyName */ ? stripQuotes(getTextOfIdentifierOrLiteral(node)) : void 0; const displayName = specifierName || typeChecker.symbolToString(symbol); const fullDisplayName = specifierName || typeChecker.getFullyQualifiedName(symbol); return getRenameInfoSuccess(displayName, fullDisplayName, kind, ts_SymbolDisplay_exports.getSymbolModifiers(typeChecker, symbol), node, sourceFile); @@ -176635,10 +177611,10 @@ function getImmediatelyContainingArgumentInfo(node, position, sourceFile, checke ); } return void 0; - } else if (isTemplateHead(node) && parent2.parent.kind === 215 /* TaggedTemplateExpression */) { + } else if (isTemplateHead(node) && parent2.parent.kind === 216 /* TaggedTemplateExpression */) { const templateExpression = parent2; const tagExpression = templateExpression.parent; - Debug.assert(templateExpression.kind === 228 /* TemplateExpression */); + Debug.assert(templateExpression.kind === 229 /* TemplateExpression */); const argumentIndex = isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } else if (isTemplateSpan(parent2) && isTaggedTemplateExpression(parent2.parent.parent)) { @@ -176711,16 +177687,16 @@ function getAdjustedNode(node) { function getContextualSignatureLocationInfo(node, sourceFile, position, checker) { const { parent: parent2 } = node; switch (parent2.kind) { - case 217 /* ParenthesizedExpression */: - case 174 /* MethodDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 218 /* ParenthesizedExpression */: + case 175 /* MethodDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: const info = getArgumentOrParameterListInfo(node, position, sourceFile, checker); if (!info) return void 0; const { argumentIndex, argumentCount, argumentsSpan } = info; const contextualType = isMethodDeclaration(parent2) ? checker.getContextualTypeForObjectLiteralElement(parent2) : checker.getContextualType(parent2); return contextualType && { contextualType, argumentIndex, argumentCount, argumentsSpan }; - case 226 /* BinaryExpression */: { + case 227 /* BinaryExpression */: { const highestBinary = getHighestBinary(parent2); const contextualType2 = checker.getContextualType(highestBinary); const argumentIndex2 = node.kind === 21 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent2) - 1; @@ -176829,7 +177805,7 @@ function getApplicableSpanForTaggedTemplate(taggedTemplate, sourceFile) { const template = taggedTemplate.template; const applicableSpanStart = template.getStart(); let applicableSpanEnd = template.getEnd(); - if (template.kind === 228 /* TemplateExpression */) { + if (template.kind === 229 /* TemplateExpression */) { const lastSpan = last(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = skipTrivia( @@ -177122,7 +178098,7 @@ function getSelectionChildren(node) { Debug.assertEqual(openBraceToken.kind, 19 /* OpenBraceToken */); Debug.assertEqual(closeBraceToken.kind, 20 /* CloseBraceToken */); const groupedWithPlusMinusTokens = groupChildren(children, (child) => child === node.readonlyToken || child.kind === 148 /* ReadonlyKeyword */ || child === node.questionToken || child.kind === 58 /* QuestionToken */); - const groupedWithBrackets = groupChildren(groupedWithPlusMinusTokens, ({ kind }) => kind === 23 /* OpenBracketToken */ || kind === 168 /* TypeParameter */ || kind === 24 /* CloseBracketToken */); + const groupedWithBrackets = groupChildren(groupedWithPlusMinusTokens, ({ kind }) => kind === 23 /* OpenBracketToken */ || kind === 169 /* TypeParameter */ || kind === 24 /* CloseBracketToken */); return [ openBraceToken, // Pivot on `:` @@ -177132,7 +178108,7 @@ function getSelectionChildren(node) { } if (isPropertySignature(node)) { const children = groupChildren(node.getChildren(), (child) => child === node.name || contains(node.modifiers, child)); - const firstJSDocChild = ((_a = children[0]) == null ? void 0 : _a.kind) === 320 /* JSDoc */ ? children[0] : void 0; + const firstJSDocChild = ((_a = children[0]) == null ? void 0 : _a.kind) === 321 /* JSDoc */ ? children[0] : void 0; const withJSDocSeparated = firstJSDocChild ? children.slice(1) : children; const splittedChildren = splitChildren(withJSDocSeparated, ({ kind }) => kind === 59 /* ColonToken */); return firstJSDocChild ? [firstJSDocChild, createSyntaxList2(splittedChildren)] : splittedChildren; @@ -177193,19 +178169,19 @@ function createSyntaxList2(children) { } function isListOpener(token) { const kind = token && token.kind; - return kind === 19 /* OpenBraceToken */ || kind === 23 /* OpenBracketToken */ || kind === 21 /* OpenParenToken */ || kind === 286 /* JsxOpeningElement */; + return kind === 19 /* OpenBraceToken */ || kind === 23 /* OpenBracketToken */ || kind === 21 /* OpenParenToken */ || kind === 287 /* JsxOpeningElement */; } function isListCloser(token) { const kind = token && token.kind; - return kind === 20 /* CloseBraceToken */ || kind === 24 /* CloseBracketToken */ || kind === 22 /* CloseParenToken */ || kind === 287 /* JsxClosingElement */; + return kind === 20 /* CloseBraceToken */ || kind === 24 /* CloseBracketToken */ || kind === 22 /* CloseParenToken */ || kind === 288 /* JsxClosingElement */; } function getEndPos(sourceFile, node) { switch (node.kind) { - case 341 /* JSDocParameterTag */: - case 338 /* JSDocCallbackTag */: - case 348 /* JSDocPropertyTag */: - case 346 /* JSDocTypedefTag */: - case 343 /* JSDocThisTag */: + case 342 /* JSDocParameterTag */: + case 339 /* JSDocCallbackTag */: + case 349 /* JSDocPropertyTag */: + case 347 /* JSDocTypedefTag */: + case 344 /* JSDocThisTag */: return sourceFile.getLineEndOfPosition(node.getStart()); default: return node.getEnd(); @@ -177229,7 +178205,7 @@ function getSymbolKind(typeChecker, symbol, location) { } const flags = getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return getDeclarationOfKind(symbol, 231 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; + return getDeclarationOfKind(symbol, 232 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) return "enum" /* enumElement */; if (flags & 524288 /* TypeAlias */) return "type" /* typeElement */; @@ -177325,7 +178301,7 @@ function getSymbolModifiers(typeChecker, symbol) { } return modifiers.size > 0 ? arrayFrom(modifiers.values()).join(",") : "" /* none */; } -function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symbol, sourceFile, enclosingDeclaration, location, type, semanticMeaning, alias) { +function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symbol, sourceFile, enclosingDeclaration, location, type, semanticMeaning, alias, maximumLength, verbosityLevel) { var _a; const displayParts = []; let documentation = []; @@ -177337,21 +178313,26 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb let documentationFromAlias; let tagsFromAlias; let hasMultipleSignatures = false; + const typeWriterOut = { canIncreaseExpansionDepth: false, truncated: false }; + let symbolWasExpanded = false; if (location.kind === 110 /* ThisKeyword */ && !isThisExpression) { return { displayParts: [keywordPart(110 /* ThisKeyword */)], documentation: [], symbolKind: "primitive type" /* primitiveType */, tags: void 0 }; } if (symbolKind !== "" /* unknown */ || symbolFlags & 32 /* Class */ || symbolFlags & 2097152 /* Alias */) { if (symbolKind === "getter" /* memberGetAccessorElement */ || symbolKind === "setter" /* memberSetAccessorElement */) { - const declaration = find(symbol.declarations, (declaration2) => declaration2.name === location); + const declaration = find( + symbol.declarations, + (declaration2) => declaration2.name === location && declaration2.kind !== 212 /* PropertyAccessExpression */ + ); if (declaration) { switch (declaration.kind) { - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: symbolKind = "getter" /* memberGetAccessorElement */; break; - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: symbolKind = "setter" /* memberSetAccessorElement */; break; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: symbolKind = "accessor" /* memberAccessorVariableElement */; break; default: @@ -177363,7 +178344,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb } let signature; type ?? (type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol, location)); - if (location.parent && location.parent.kind === 211 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 212 /* PropertyAccessExpression */) { const right = location.parent.name; if (right === location || right && right.getFullWidth() === 0) { location = location.parent; @@ -177379,7 +178360,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb } if (callExpressionLike) { signature = typeChecker.getResolvedSignature(callExpressionLike); - const useConstructSignatures = callExpressionLike.kind === 214 /* NewExpression */ || isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 108 /* SuperKeyword */; + const useConstructSignatures = callExpressionLike.kind === 215 /* NewExpression */ || isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 108 /* SuperKeyword */; const allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (signature && !contains(allSignatures, signature.target) && !contains(allSignatures, signature)) { signature = allSignatures.length ? allSignatures[0] : void 0; @@ -177442,22 +178423,22 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb hasMultipleSignatures = allSignatures.length > 1; } } else if (isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */) || // name of function declaration - location.kind === 137 /* ConstructorKeyword */ && location.parent.kind === 176 /* Constructor */) { + location.kind === 137 /* ConstructorKeyword */ && location.parent.kind === 177 /* Constructor */) { const functionDeclaration = location.parent; const locationIsSymbolDeclaration = symbol.declarations && find(symbol.declarations, (declaration) => declaration === (location.kind === 137 /* ConstructorKeyword */ ? functionDeclaration.parent : functionDeclaration)); if (locationIsSymbolDeclaration) { - const allSignatures = functionDeclaration.kind === 176 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + const allSignatures = functionDeclaration.kind === 177 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; } - if (functionDeclaration.kind === 176 /* Constructor */) { + if (functionDeclaration.kind === 177 /* Constructor */) { symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { addPrefixForAnyFunctionOrVar( - functionDeclaration.kind === 179 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, + functionDeclaration.kind === 180 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind ); } @@ -177471,21 +178452,28 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { addAliasPrefixIfNecessary(); - if (getDeclarationOfKind(symbol, 231 /* ClassExpression */)) { + const classExpression = getDeclarationOfKind(symbol, 232 /* ClassExpression */); + if (classExpression) { pushSymbolKind("local class" /* localClassElement */); - } else { - displayParts.push(keywordPart(86 /* ClassKeyword */)); + displayParts.push(spacePart()); + } + if (!tryExpandSymbol(symbol, semanticMeaning)) { + if (!classExpression) { + displayParts.push(keywordPart(86 /* ClassKeyword */)); + displayParts.push(spacePart()); + } + addFullSymbolName(symbol); + writeTypeParametersOfSymbol(symbol, sourceFile); } - displayParts.push(spacePart()); - addFullSymbolName(symbol); - writeTypeParametersOfSymbol(symbol, sourceFile); } if (symbolFlags & 64 /* Interface */ && semanticMeaning & 2 /* Type */) { prefixNextMeaning(); - displayParts.push(keywordPart(120 /* InterfaceKeyword */)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); - writeTypeParametersOfSymbol(symbol, sourceFile); + if (!tryExpandSymbol(symbol, semanticMeaning)) { + displayParts.push(keywordPart(120 /* InterfaceKeyword */)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + writeTypeParametersOfSymbol(symbol, sourceFile); + } } if (symbolFlags & 524288 /* TypeAlias */ && semanticMeaning & 2 /* Type */) { prefixNextMeaning(); @@ -177496,25 +178484,44 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb displayParts.push(spacePart()); displayParts.push(operatorPart(64 /* EqualsToken */)); displayParts.push(spacePart()); - addRange(displayParts, typeToDisplayParts(typeChecker, location.parent && isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */)); + addRange( + displayParts, + typeToDisplayParts( + typeChecker, + location.parent && isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), + enclosingDeclaration, + 8388608 /* InTypeAlias */, + maximumLength, + verbosityLevel, + typeWriterOut + ) + ); } if (symbolFlags & 384 /* Enum */) { prefixNextMeaning(); - if (some(symbol.declarations, (d) => isEnumDeclaration(d) && isEnumConst(d))) { - displayParts.push(keywordPart(87 /* ConstKeyword */)); + if (!tryExpandSymbol(symbol, semanticMeaning)) { + if (some(symbol.declarations, (d) => isEnumDeclaration(d) && isEnumConst(d))) { + displayParts.push(keywordPart(87 /* ConstKeyword */)); + displayParts.push(spacePart()); + } + displayParts.push(keywordPart(94 /* EnumKeyword */)); displayParts.push(spacePart()); + addFullSymbolName( + symbol, + /*enclosingDeclaration*/ + void 0 + ); } - displayParts.push(keywordPart(94 /* EnumKeyword */)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); } if (symbolFlags & 1536 /* Module */ && !isThisExpression) { prefixNextMeaning(); - const declaration = getDeclarationOfKind(symbol, 267 /* ModuleDeclaration */); - const isNamespace = declaration && declaration.name && declaration.name.kind === 80 /* Identifier */; - displayParts.push(keywordPart(isNamespace ? 145 /* NamespaceKeyword */ : 144 /* ModuleKeyword */)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); + if (!tryExpandSymbol(symbol, semanticMeaning)) { + const declaration = getDeclarationOfKind(symbol, 268 /* ModuleDeclaration */); + const isNamespace = declaration && declaration.name && declaration.name.kind === 80 /* Identifier */; + displayParts.push(keywordPart(isNamespace ? 145 /* NamespaceKeyword */ : 144 /* ModuleKeyword */)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + } } if (symbolFlags & 262144 /* TypeParameter */ && semanticMeaning & 2 /* Type */) { prefixNextMeaning(); @@ -177528,17 +178535,17 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb addFullSymbolName(symbol.parent, enclosingDeclaration); writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); } else { - const decl = getDeclarationOfKind(symbol, 168 /* TypeParameter */); + const decl = getDeclarationOfKind(symbol, 169 /* TypeParameter */); if (decl === void 0) return Debug.fail(); const declaration = decl.parent; if (declaration) { if (isFunctionLike(declaration)) { addInPrefix(); const signature = typeChecker.getSignatureFromDeclaration(declaration); - if (declaration.kind === 180 /* ConstructSignature */) { + if (declaration.kind === 181 /* ConstructSignature */) { displayParts.push(keywordPart(105 /* NewKeyword */)); displayParts.push(spacePart()); - } else if (declaration.kind !== 179 /* CallSignature */ && declaration.name) { + } else if (declaration.kind !== 180 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } addRange(displayParts, signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); @@ -177556,7 +178563,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); const declaration = (_a = symbol.declarations) == null ? void 0 : _a[0]; - if ((declaration == null ? void 0 : declaration.kind) === 306 /* EnumMember */) { + if ((declaration == null ? void 0 : declaration.kind) === 307 /* EnumMember */) { const constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== void 0) { displayParts.push(spacePart()); @@ -177584,12 +178591,17 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb declarationName, type, semanticMeaning, - shouldUseAliasName ? symbol : resolvedSymbol + shouldUseAliasName ? symbol : resolvedSymbol, + maximumLength, + verbosityLevel ); displayParts.push(...resolvedInfo.displayParts); displayParts.push(lineBreakPart()); documentationFromAlias = resolvedInfo.documentation; tagsFromAlias = resolvedInfo.tags; + if (typeWriterOut && resolvedInfo.canIncreaseVerbosityLevel) { + typeWriterOut.canIncreaseExpansionDepth = true; + } } else { documentationFromAlias = resolvedSymbol.getContextualDocumentationComment(resolvedNode, typeChecker); tagsFromAlias = resolvedSymbol.getJsDocTags(typeChecker); @@ -177598,17 +178610,17 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb } if (symbol.declarations) { switch (symbol.declarations[0].kind) { - case 270 /* NamespaceExportDeclaration */: + case 271 /* NamespaceExportDeclaration */: displayParts.push(keywordPart(95 /* ExportKeyword */)); displayParts.push(spacePart()); displayParts.push(keywordPart(145 /* NamespaceKeyword */)); break; - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: displayParts.push(keywordPart(95 /* ExportKeyword */)); displayParts.push(spacePart()); displayParts.push(keywordPart(symbol.declarations[0].isExportEquals ? 64 /* EqualsToken */ : 90 /* DefaultKeyword */)); break; - case 281 /* ExportSpecifier */: + case 282 /* ExportSpecifier */: displayParts.push(keywordPart(95 /* ExportKeyword */)); break; default: @@ -177618,7 +178630,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb displayParts.push(spacePart()); addFullSymbolName(symbol); forEach(symbol.declarations, (declaration) => { - if (declaration.kind === 271 /* ImportEqualsDeclaration */) { + if (declaration.kind === 272 /* ImportEqualsDeclaration */) { const importEqualsDeclaration = declaration; if (isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(spacePart()); @@ -177655,12 +178667,35 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb displayParts.push(spacePart()); if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */ && symbolKind !== "index" /* indexSignatureElement */) { const typeParameterParts = mapToDisplayParts((writer) => { - const param = typeChecker.typeParameterToDeclaration(type, enclosingDeclaration, symbolDisplayNodeBuilderFlags); + const param = typeChecker.typeParameterToDeclaration( + type, + enclosingDeclaration, + symbolDisplayNodeBuilderFlags, + /*internalFlags*/ + void 0, + /*tracker*/ + void 0, + maximumLength, + verbosityLevel, + typeWriterOut + ); getPrinter().writeNode(4 /* Unspecified */, param, getSourceFileOfNode(getParseTreeNode(enclosingDeclaration)), writer); - }); + }, maximumLength); addRange(displayParts, typeParameterParts); } else { - addRange(displayParts, typeToDisplayParts(typeChecker, type, enclosingDeclaration)); + addRange( + displayParts, + typeToDisplayParts( + typeChecker, + type, + enclosingDeclaration, + /*flags*/ + void 0, + maximumLength, + verbosityLevel, + typeWriterOut + ) + ); } if (isTransientSymbol(symbol) && symbol.links.target && isTransientSymbol(symbol.links.target) && symbol.links.target.links.tupleLabelDeclaration) { const labelDecl = symbol.links.target.links.tupleLabelDeclaration; @@ -177686,9 +178721,9 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb documentation = symbol.getContextualDocumentationComment(enclosingDeclaration, typeChecker); } if (documentation.length === 0 && symbolFlags & 4 /* Property */) { - if (symbol.parent && symbol.declarations && forEach(symbol.parent.declarations, (declaration) => declaration.kind === 307 /* SourceFile */)) { + if (symbol.parent && symbol.declarations && forEach(symbol.parent.declarations, (declaration) => declaration.kind === 308 /* SourceFile */)) { for (const declaration of symbol.declarations) { - if (!declaration.parent || declaration.parent.kind !== 226 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 227 /* BinaryExpression */) { continue; } const rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -177716,7 +178751,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb }) || emptyArray; } } - if (tags.length === 0 && !hasMultipleSignatures) { + if (tags.length === 0 && !hasMultipleSignatures && !isInJSDoc(location)) { tags = symbol.getContextualJsDocTags(enclosingDeclaration, typeChecker); } if (documentation.length === 0 && documentationFromAlias) { @@ -177725,7 +178760,14 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb if (tags.length === 0 && tagsFromAlias) { tags = tagsFromAlias; } - return { displayParts, documentation, symbolKind, tags: tags.length === 0 ? void 0 : tags }; + const canIncreaseVerbosityLevel = !typeWriterOut.truncated && typeWriterOut.canIncreaseExpansionDepth; + return { + displayParts, + documentation, + symbolKind, + tags: tags.length === 0 ? void 0 : tags, + canIncreaseVerbosityLevel: verbosityLevel !== void 0 ? canIncreaseVerbosityLevel : void 0 + }; function getPrinter() { return createPrinterWithRemoveComments(); } @@ -177746,6 +178788,63 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb displayParts.push(keywordPart(103 /* InKeyword */)); displayParts.push(spacePart()); } + function canExpandSymbol(symbol2, out) { + if (verbosityLevel === void 0) { + return false; + } + const type2 = symbol2.flags & (32 /* Class */ | 64 /* Interface */) ? typeChecker.getDeclaredTypeOfSymbol(symbol2) : typeChecker.getTypeOfSymbolAtLocation(symbol2, location); + if (!type2 || typeChecker.isLibType(type2)) { + return false; + } + if (0 < verbosityLevel) { + return true; + } + if (out) { + out.canIncreaseExpansionDepth = true; + } + return false; + } + function semanticToSymbolMeaning(meaning) { + let symbolMeaning = 0 /* None */; + if (meaning & 1 /* Value */) { + symbolMeaning |= 111551 /* Value */; + } + if (meaning & 2 /* Type */) { + symbolMeaning |= 788968 /* Type */; + } + if (meaning & 4 /* Namespace */) { + symbolMeaning |= 1920 /* Namespace */; + } + return symbolMeaning; + } + function tryExpandSymbol(symbol2, meaning) { + if (symbolWasExpanded) { + return true; + } + if (canExpandSymbol(symbol2, typeWriterOut)) { + const symbolMeaning = semanticToSymbolMeaning(meaning); + const expandedDisplayParts = mapToDisplayParts((writer) => { + const nodes = typeChecker.getEmitResolver().symbolToDeclarations( + symbol2, + symbolMeaning, + 1024 /* MultilineObjectLiterals */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, + maximumLength, + verbosityLevel !== void 0 ? verbosityLevel - 1 : void 0, + typeWriterOut + ); + const printer = getPrinter(); + const sourceFile2 = symbol2.valueDeclaration && getSourceFileOfNode(symbol2.valueDeclaration); + nodes.forEach((node, i) => { + if (i > 0) writer.writeLine(); + printer.writeNode(4 /* Unspecified */, node, sourceFile2, writer); + }); + }, maximumLength); + addRange(displayParts, expandedDisplayParts); + symbolWasExpanded = true; + return true; + } + return false; + } function addFullSymbolName(symbolToDisplay, enclosingDeclaration2) { let indexInfos; if (alias && symbolToDisplay === symbol) { @@ -177813,7 +178912,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb } } function addSignatureDisplayParts(signature, allSignatures, flags = 0 /* None */) { - addRange(displayParts, signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */)); + addRange(displayParts, signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */, maximumLength, verbosityLevel, typeWriterOut)); if (allSignatures.length > 1) { displayParts.push(spacePart()); displayParts.push(punctuationPart(21 /* OpenParenToken */)); @@ -177838,7 +178937,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb addRange(displayParts, typeParameterParts); } } -function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location, semanticMeaning = getMeaningFromLocation(location), alias) { +function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location, semanticMeaning = getMeaningFromLocation(location), alias, maximumLength, verbosityLevel) { return getSymbolDisplayPartsDocumentationAndSymbolKindWorker( typeChecker, symbol, @@ -177848,7 +178947,9 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, so /*type*/ void 0, semanticMeaning, - alias + alias, + maximumLength, + verbosityLevel ); } function isLocalVariableOrFunction(symbol) { @@ -177856,14 +178957,14 @@ function isLocalVariableOrFunction(symbol) { return false; } return forEach(symbol.declarations, (declaration) => { - if (declaration.kind === 218 /* FunctionExpression */) { + if (declaration.kind === 219 /* FunctionExpression */) { return true; } - if (declaration.kind !== 260 /* VariableDeclaration */ && declaration.kind !== 262 /* FunctionDeclaration */) { + if (declaration.kind !== 261 /* VariableDeclaration */ && declaration.kind !== 263 /* FunctionDeclaration */) { return false; } for (let parent2 = declaration.parent; !isFunctionBlock(parent2); parent2 = parent2.parent) { - if (parent2.kind === 307 /* SourceFile */ || parent2.kind === 268 /* ModuleBlock */) { + if (parent2.kind === 308 /* SourceFile */ || parent2.kind === 269 /* ModuleBlock */) { return false; } } @@ -178047,7 +179148,7 @@ function getAdjustedEndPosition(sourceFile, node, options) { return newEnd !== end && (trailingTriviaOption === 2 /* Include */ || isLineBreak(sourceFile.text.charCodeAt(newEnd - 1))) ? newEnd : end; } function isSeparator(node, candidate) { - return !!candidate && !!node.parent && (candidate.kind === 28 /* CommaToken */ || candidate.kind === 27 /* SemicolonToken */ && node.parent.kind === 210 /* ObjectLiteralExpression */); + return !!candidate && !!node.parent && (candidate.kind === 28 /* CommaToken */ || candidate.kind === 27 /* SemicolonToken */ && node.parent.kind === 211 /* ObjectLiteralExpression */); } function isThisTypeAnnotatable(containingFunction) { return isFunctionExpression(containingFunction) || isFunctionDeclaration(containingFunction); @@ -178276,7 +179377,7 @@ var ChangeTracker = class _ChangeTracker { endNode2 = first(node.parameters); } } else { - endNode2 = (node.kind === 260 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken) ?? node.name; + endNode2 = (node.kind === 261 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken) ?? node.name; } this.insertNodeAt(sourceFile, endNode2.end, type, { prefix: ": " }); return true; @@ -178427,18 +179528,18 @@ ${options.prefix}` : "\n" : options.prefix } getInsertNodeAfterOptionsWorker(node) { switch (node.kind) { - case 263 /* ClassDeclaration */: - case 267 /* ModuleDeclaration */: + case 264 /* ClassDeclaration */: + case 268 /* ModuleDeclaration */: return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: case 11 /* StringLiteral */: case 80 /* Identifier */: return { prefix: ", " }; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return { suffix: "," + this.newLineCharacter }; case 95 /* ExportKeyword */: return { prefix: " " }; - case 169 /* Parameter */: + case 170 /* Parameter */: return {}; default: Debug.assert(isStatement(node) || isClassOrTypeElement(node)); @@ -178447,7 +179548,7 @@ ${options.prefix}` : "\n" : options.prefix } insertName(sourceFile, node, name) { Debug.assert(!node.name); - if (node.kind === 219 /* ArrowFunction */) { + if (node.kind === 220 /* ArrowFunction */) { const arrow = findChildOfKind(node, 39 /* EqualsGreaterThanToken */, sourceFile); const lparen = findChildOfKind(node, 21 /* OpenParenToken */, sourceFile); if (lparen) { @@ -178457,12 +179558,12 @@ ${options.prefix}` : "\n" : options.prefix this.insertText(sourceFile, first(node.parameters).getStart(sourceFile), `function ${name}(`); this.replaceRange(sourceFile, arrow, factory.createToken(22 /* CloseParenToken */)); } - if (node.body.kind !== 241 /* Block */) { + if (node.body.kind !== 242 /* Block */) { this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [factory.createToken(19 /* OpenBraceToken */), factory.createToken(107 /* ReturnKeyword */)], { joiner: " ", suffix: " " }); this.insertNodesAt(sourceFile, node.body.end, [factory.createToken(27 /* SemicolonToken */), factory.createToken(20 /* CloseBraceToken */)], { joiner: " " }); } } else { - const pos = findChildOfKind(node, node.kind === 218 /* FunctionExpression */ ? 100 /* FunctionKeyword */ : 86 /* ClassKeyword */, sourceFile).end; + const pos = findChildOfKind(node, node.kind === 219 /* FunctionExpression */ ? 100 /* FunctionKeyword */ : 86 /* ClassKeyword */, sourceFile).end; this.insertNodeAt(sourceFile, pos, factory.createIdentifier(name), { prefix: " " }); } } @@ -178602,10 +179703,10 @@ ${options.prefix}` : "\n" : options.prefix } }; function updateJSDocHost(parent2) { - if (parent2.kind !== 219 /* ArrowFunction */) { + if (parent2.kind !== 220 /* ArrowFunction */) { return parent2; } - const jsDocNode = parent2.parent.kind === 172 /* PropertyDeclaration */ ? parent2.parent : parent2.parent.parent; + const jsDocNode = parent2.parent.kind === 173 /* PropertyDeclaration */ ? parent2.parent : parent2.parent.parent; jsDocNode.jsDoc = parent2.jsDoc; return jsDocNode; } @@ -178614,7 +179715,7 @@ function tryMergeJsdocTags(oldTag, newTag) { return void 0; } switch (oldTag.kind) { - case 341 /* JSDocParameterTag */: { + case 342 /* JSDocParameterTag */: { const oldParam = oldTag; const newParam = newTag; return isIdentifier(oldParam.name) && isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? factory.createJSDocParameterTag( @@ -178628,14 +179729,14 @@ function tryMergeJsdocTags(oldTag, newTag) { oldParam.comment ) : void 0; } - case 342 /* JSDocReturnTag */: + case 343 /* JSDocReturnTag */: return factory.createJSDocReturnTag( /*tagName*/ void 0, newTag.typeExpression, oldTag.comment ); - case 344 /* JSDocTypeTag */: + case 345 /* JSDocTypeTag */: return factory.createJSDocTypeTag( /*tagName*/ void 0, @@ -179083,13 +180184,13 @@ function isValidLocationToAddComment(sourceFile, position) { return !isInComment(sourceFile, position) && !isInString(sourceFile, position) && !isInTemplateString(sourceFile, position) && !isInJSXText(sourceFile, position); } function needSemicolonBetween(a, b) { - return (isPropertySignature(a) || isPropertyDeclaration(a)) && isClassOrTypeElement(b) && b.name.kind === 167 /* ComputedPropertyName */ || isStatementButNotDeclaration(a) && isStatementButNotDeclaration(b); + return (isPropertySignature(a) || isPropertyDeclaration(a)) && isClassOrTypeElement(b) && b.name.kind === 168 /* ComputedPropertyName */ || isStatementButNotDeclaration(a) && isStatementButNotDeclaration(b); } var deleteDeclaration; ((_deleteDeclaration) => { function deleteDeclaration2(changes, deletedNodesInLists, sourceFile, node) { switch (node.kind) { - case 169 /* Parameter */: { + case 170 /* Parameter */: { const oldFunction = node.parent; if (isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && !findChildOfKind(oldFunction, 21 /* OpenParenToken */, sourceFile)) { changes.replaceNodeWithText(sourceFile, node, "()"); @@ -179098,29 +180199,29 @@ var deleteDeclaration; } break; } - case 272 /* ImportDeclaration */: - case 271 /* ImportEqualsDeclaration */: + case 273 /* ImportDeclaration */: + case 272 /* ImportEqualsDeclaration */: const isFirstImport = sourceFile.imports.length && node === first(sourceFile.imports).parent || node === find(sourceFile.statements, isAnyImportSyntax); deleteNode(changes, sourceFile, node, { leadingTriviaOption: isFirstImport ? 0 /* Exclude */ : hasJSDocNodes(node) ? 2 /* JSDoc */ : 3 /* StartLine */ }); break; - case 208 /* BindingElement */: + case 209 /* BindingElement */: const pattern = node.parent; - const preserveComma = pattern.kind === 207 /* ArrayBindingPattern */ && node !== last(pattern.elements); + const preserveComma = pattern.kind === 208 /* ArrayBindingPattern */ && node !== last(pattern.elements); if (preserveComma) { deleteNode(changes, sourceFile, node); } else { deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node); break; - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); break; - case 276 /* ImportSpecifier */: + case 277 /* ImportSpecifier */: const namedImports = node.parent; if (namedImports.elements.length === 1) { deleteImportBinding(changes, sourceFile, namedImports); @@ -179128,7 +180229,7 @@ var deleteDeclaration; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 274 /* NamespaceImport */: + case 275 /* NamespaceImport */: deleteImportBinding(changes, sourceFile, node); break; case 27 /* SemicolonToken */: @@ -179137,8 +180238,8 @@ var deleteDeclaration; case 100 /* FunctionKeyword */: deleteNode(changes, sourceFile, node, { leadingTriviaOption: 0 /* Exclude */ }); break; - case 263 /* ClassDeclaration */: - case 262 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: + case 263 /* FunctionDeclaration */: deleteNode(changes, sourceFile, node, { leadingTriviaOption: hasJSDocNodes(node) ? 2 /* JSDoc */ : 3 /* StartLine */ }); break; default: @@ -179180,13 +180281,13 @@ var deleteDeclaration; const previousToken = Debug.checkDefined(getTokenAtPosition(sourceFile, node.pos - 1)); changes.deleteRange(sourceFile, { pos: previousToken.getStart(sourceFile), end: node.end }); } else { - const importDecl = getAncestor(node, 272 /* ImportDeclaration */); + const importDecl = getAncestor(node, 273 /* ImportDeclaration */); deleteNode(changes, sourceFile, importDecl); } } function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) { const { parent: parent2 } = node; - if (parent2.kind === 299 /* CatchClause */) { + if (parent2.kind === 300 /* CatchClause */) { changes.deleteNodeRange(sourceFile, findChildOfKind(parent2, 21 /* OpenParenToken */, sourceFile), findChildOfKind(parent2, 22 /* CloseParenToken */, sourceFile)); return; } @@ -179196,14 +180297,14 @@ var deleteDeclaration; } const gp = parent2.parent; switch (gp.kind) { - case 250 /* ForOfStatement */: - case 249 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 250 /* ForInStatement */: changes.replaceNode(sourceFile, node, factory.createObjectLiteralExpression()); break; - case 248 /* ForStatement */: + case 249 /* ForStatement */: deleteNode(changes, sourceFile, parent2); break; - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: deleteNode(changes, sourceFile, gp, { leadingTriviaOption: hasJSDocNodes(gp) ? 2 /* JSDoc */ : 3 /* StartLine */ }); break; default: @@ -179413,10 +180514,10 @@ function getFormattingScanner(text, languageVariant, startPos, endPos, cb) { function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 291 /* JsxAttribute */: - case 286 /* JsxOpeningElement */: - case 287 /* JsxClosingElement */: - case 285 /* JsxSelfClosingElement */: + case 292 /* JsxAttribute */: + case 287 /* JsxOpeningElement */: + case 288 /* JsxClosingElement */: + case 286 /* JsxSelfClosingElement */: return isKeyword(node.kind) || node.kind === 80 /* Identifier */; } } @@ -179590,7 +180691,7 @@ var RuleFlags = /* @__PURE__ */ ((RuleFlags2) => { // src/services/formatting/rules.ts function getAllRules() { const allTokens = []; - for (let token = 0 /* FirstToken */; token <= 165 /* LastToken */; token++) { + for (let token = 0 /* FirstToken */; token <= 166 /* LastToken */; token++) { if (token !== 1 /* EndOfFileToken */) { allTokens.push(token); } @@ -179601,7 +180702,7 @@ function getAllRules() { const anyToken = { tokens: allTokens, isSpecific: false }; const anyTokenIncludingMultilineComments = tokenRangeFrom([...allTokens, 3 /* MultiLineCommentTrivia */]); const anyTokenIncludingEOF = tokenRangeFrom([...allTokens, 1 /* EndOfFileToken */]); - const keywords = tokenRangeFromRange(83 /* FirstKeyword */, 165 /* LastKeyword */); + const keywords = tokenRangeFromRange(83 /* FirstKeyword */, 166 /* LastKeyword */); const binaryOperators = tokenRangeFromRange(30 /* FirstBinaryOperator */, 79 /* LastBinaryOperator */); const binaryKeywordOperators = [ 103 /* InKeyword */, @@ -179941,54 +181042,54 @@ function isOptionEnabledOrUndefined(optionName) { return (context) => !context.options || !hasProperty(context.options, optionName) || !!context.options[optionName]; } function isForContext(context) { - return context.contextNode.kind === 248 /* ForStatement */; + return context.contextNode.kind === 249 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return context.contextNode.operatorToken.kind !== 28 /* CommaToken */; - case 227 /* ConditionalExpression */: - case 194 /* ConditionalType */: - case 234 /* AsExpression */: - case 281 /* ExportSpecifier */: - case 276 /* ImportSpecifier */: - case 182 /* TypePredicate */: - case 192 /* UnionType */: - case 193 /* IntersectionType */: - case 238 /* SatisfiesExpression */: + case 228 /* ConditionalExpression */: + case 195 /* ConditionalType */: + case 235 /* AsExpression */: + case 282 /* ExportSpecifier */: + case 277 /* ImportSpecifier */: + case 183 /* TypePredicate */: + case 193 /* UnionType */: + case 194 /* IntersectionType */: + case 239 /* SatisfiesExpression */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 208 /* BindingElement */: + case 209 /* BindingElement */: // equals in type X = ... // falls through - case 265 /* TypeAliasDeclaration */: + case 266 /* TypeAliasDeclaration */: // equal in import a = module('a'); // falls through - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: // equal in export = 1 // falls through - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: // equal in let a = 0 // falls through - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: // equal in p = 0 // falls through - case 169 /* Parameter */: - case 306 /* EnumMember */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: + case 170 /* Parameter */: + case 307 /* EnumMember */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: return context.currentTokenSpan.kind === 64 /* EqualsToken */ || context.nextTokenSpan.kind === 64 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] // falls through - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: return context.currentTokenSpan.kind === 103 /* InKeyword */ || context.nextTokenSpan.kind === 103 /* InKeyword */ || context.currentTokenSpan.kind === 64 /* EqualsToken */ || context.nextTokenSpan.kind === 64 /* EqualsToken */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return context.currentTokenSpan.kind === 165 /* OfKeyword */ || context.nextTokenSpan.kind === 165 /* OfKeyword */; } return false; @@ -180001,7 +181102,7 @@ function isNotTypeAnnotationContext(context) { } function isTypeAnnotationContext(context) { const contextKind = context.contextNode.kind; - return contextKind === 172 /* PropertyDeclaration */ || contextKind === 171 /* PropertySignature */ || contextKind === 169 /* Parameter */ || contextKind === 260 /* VariableDeclaration */ || isFunctionLikeKind(contextKind); + return contextKind === 173 /* PropertyDeclaration */ || contextKind === 172 /* PropertySignature */ || contextKind === 170 /* Parameter */ || contextKind === 261 /* VariableDeclaration */ || isFunctionLikeKind(contextKind); } function isOptionalPropertyContext(context) { return isPropertyDeclaration(context.contextNode) && context.contextNode.questionToken; @@ -180010,13 +181111,13 @@ function isNonOptionalPropertyContext(context) { return !isOptionalPropertyContext(context); } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 227 /* ConditionalExpression */ || context.contextNode.kind === 194 /* ConditionalType */; + return context.contextNode.kind === 228 /* ConditionalExpression */ || context.contextNode.kind === 195 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 206 /* ObjectBindingPattern */ || context.contextNode.kind === 200 /* MappedType */ || isSingleLineBlockContext(context); + return context.contextNode.kind === 207 /* ObjectBindingPattern */ || context.contextNode.kind === 201 /* MappedType */ || isSingleLineBlockContext(context); } function isBeforeMultilineBlockContext(context) { return isBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine()); @@ -180038,34 +181139,34 @@ function nodeIsBlockContext(node) { return true; } switch (node.kind) { - case 241 /* Block */: - case 269 /* CaseBlock */: - case 210 /* ObjectLiteralExpression */: - case 268 /* ModuleBlock */: + case 242 /* Block */: + case 270 /* CaseBlock */: + case 211 /* ObjectLiteralExpression */: + case 269 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 262 /* FunctionDeclaration */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 263 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: // falls through - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: // case SyntaxKind.MethodSignature: // falls through - case 179 /* CallSignature */: - case 218 /* FunctionExpression */: - case 176 /* Constructor */: - case 219 /* ArrowFunction */: + case 180 /* CallSignature */: + case 219 /* FunctionExpression */: + case 177 /* Constructor */: + case 220 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: // falls through - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: return true; } return false; @@ -180074,39 +181175,39 @@ function isNotFunctionDeclContext(context) { return !isFunctionDeclContext(context); } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 262 /* FunctionDeclaration */ || context.contextNode.kind === 218 /* FunctionExpression */; + return context.contextNode.kind === 263 /* FunctionDeclaration */ || context.contextNode.kind === 219 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: - case 187 /* TypeLiteral */: - case 267 /* ModuleDeclaration */: - case 278 /* ExportDeclaration */: - case 279 /* NamedExports */: - case 272 /* ImportDeclaration */: - case 275 /* NamedImports */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: + case 188 /* TypeLiteral */: + case 268 /* ModuleDeclaration */: + case 279 /* ExportDeclaration */: + case 280 /* NamedExports */: + case 273 /* ImportDeclaration */: + case 276 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 263 /* ClassDeclaration */: - case 267 /* ModuleDeclaration */: - case 266 /* EnumDeclaration */: - case 299 /* CatchClause */: - case 268 /* ModuleBlock */: - case 255 /* SwitchStatement */: + case 264 /* ClassDeclaration */: + case 268 /* ModuleDeclaration */: + case 267 /* EnumDeclaration */: + case 300 /* CatchClause */: + case 269 /* ModuleBlock */: + case 256 /* SwitchStatement */: return true; - case 241 /* Block */: { + case 242 /* Block */: { const blockParent = context.currentTokenParent.parent; - if (!blockParent || blockParent.kind !== 219 /* ArrowFunction */ && blockParent.kind !== 218 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 220 /* ArrowFunction */ && blockParent.kind !== 219 /* FunctionExpression */) { return true; } } @@ -180115,32 +181216,32 @@ function isAfterCodeBlockContext(context) { } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 245 /* IfStatement */: - case 255 /* SwitchStatement */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 247 /* WhileStatement */: - case 258 /* TryStatement */: - case 246 /* DoStatement */: - case 254 /* WithStatement */: + case 246 /* IfStatement */: + case 256 /* SwitchStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 248 /* WhileStatement */: + case 259 /* TryStatement */: + case 247 /* DoStatement */: + case 255 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: // falls through - case 299 /* CatchClause */: + case 300 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 210 /* ObjectLiteralExpression */; + return context.contextNode.kind === 211 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 213 /* CallExpression */; + return context.contextNode.kind === 214 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 214 /* NewExpression */; + return context.contextNode.kind === 215 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -180155,10 +181256,10 @@ function isNextTokenNotCloseParen(context) { return context.nextTokenSpan.kind !== 22 /* CloseParenToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 219 /* ArrowFunction */; + return context.contextNode.kind === 220 /* ArrowFunction */; } function isImportTypeContext(context) { - return context.contextNode.kind === 205 /* ImportType */; + return context.contextNode.kind === 206 /* ImportType */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 12 /* JsxText */; @@ -180167,25 +181268,25 @@ function isNonJsxTextContext(context) { return context.contextNode.kind !== 12 /* JsxText */; } function isNonJsxElementOrFragmentContext(context) { - return context.contextNode.kind !== 284 /* JsxElement */ && context.contextNode.kind !== 288 /* JsxFragment */; + return context.contextNode.kind !== 285 /* JsxElement */ && context.contextNode.kind !== 289 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 294 /* JsxExpression */ || context.contextNode.kind === 293 /* JsxSpreadAttribute */; + return context.contextNode.kind === 295 /* JsxExpression */ || context.contextNode.kind === 294 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 291 /* JsxAttribute */ || context.nextTokenParent.kind === 295 /* JsxNamespacedName */ && context.nextTokenParent.parent.kind === 291 /* JsxAttribute */; + return context.nextTokenParent.kind === 292 /* JsxAttribute */ || context.nextTokenParent.kind === 296 /* JsxNamespacedName */ && context.nextTokenParent.parent.kind === 292 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 291 /* JsxAttribute */; + return context.contextNode.kind === 292 /* JsxAttribute */; } function isNextTokenParentNotJsxNamespacedName(context) { - return context.nextTokenParent.kind !== 295 /* JsxNamespacedName */; + return context.nextTokenParent.kind !== 296 /* JsxNamespacedName */; } function isNextTokenParentJsxNamespacedName(context) { - return context.nextTokenParent.kind === 295 /* JsxNamespacedName */; + return context.nextTokenParent.kind === 296 /* JsxNamespacedName */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 285 /* JsxSelfClosingElement */; + return context.contextNode.kind === 286 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -180197,44 +181298,44 @@ function nodeIsInDecoratorContext(node) { while (node && isExpression(node)) { node = node.parent; } - return node && node.kind === 170 /* Decorator */; + return node && node.kind === 171 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 261 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; + return context.currentTokenParent.kind === 262 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 267 /* ModuleDeclaration */; + return context.contextNode.kind === 268 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 187 /* TypeLiteral */; + return context.contextNode.kind === 188 /* TypeLiteral */; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 180 /* ConstructSignature */; + return context.contextNode.kind === 181 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent2) { if (token.kind !== 30 /* LessThanToken */ && token.kind !== 32 /* GreaterThanToken */) { return false; } switch (parent2.kind) { - case 183 /* TypeReference */: - case 216 /* TypeAssertionExpression */: - case 265 /* TypeAliasDeclaration */: - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 213 /* CallExpression */: - case 214 /* NewExpression */: - case 233 /* ExpressionWithTypeArguments */: + case 184 /* TypeReference */: + case 217 /* TypeAssertionExpression */: + case 266 /* TypeAliasDeclaration */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: + case 234 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -180244,31 +181345,31 @@ function isTypeArgumentOrParameterOrAssertionContext(context) { return isTypeArgumentOrParameterOrAssertion(context.currentTokenSpan, context.currentTokenParent) || isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 216 /* TypeAssertionExpression */; + return context.contextNode.kind === 217 /* TypeAssertionExpression */; } function isNonTypeAssertionContext(context) { return !isTypeAssertionContext(context); } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 116 /* VoidKeyword */ && context.currentTokenParent.kind === 222 /* VoidExpression */; + return context.currentTokenSpan.kind === 116 /* VoidKeyword */ && context.currentTokenParent.kind === 223 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 229 /* YieldExpression */ && context.contextNode.expression !== void 0; + return context.contextNode.kind === 230 /* YieldExpression */ && context.contextNode.expression !== void 0; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 235 /* NonNullExpression */; + return context.contextNode.kind === 236 /* NonNullExpression */; } function isNotStatementConditionContext(context) { return !isStatementConditionContext(context); } function isStatementConditionContext(context) { switch (context.contextNode.kind) { - case 245 /* IfStatement */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: + case 246 /* IfStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: return true; default: return false; @@ -180297,16 +181398,16 @@ function isSemicolonDeletionContext(context) { if (nextTokenKind === 27 /* SemicolonToken */ && context.currentTokenSpan.kind === 27 /* SemicolonToken */) { return true; } - if (nextTokenKind === 240 /* SemicolonClassElement */ || nextTokenKind === 27 /* SemicolonToken */) { + if (nextTokenKind === 241 /* SemicolonClassElement */ || nextTokenKind === 27 /* SemicolonToken */) { return false; } - if (context.contextNode.kind === 264 /* InterfaceDeclaration */ || context.contextNode.kind === 265 /* TypeAliasDeclaration */) { + if (context.contextNode.kind === 265 /* InterfaceDeclaration */ || context.contextNode.kind === 266 /* TypeAliasDeclaration */) { return !isPropertySignature(context.currentTokenParent) || !!context.currentTokenParent.type || nextTokenKind !== 21 /* OpenParenToken */; } if (isPropertyDeclaration(context.currentTokenParent)) { return !context.currentTokenParent.initializer; } - return context.currentTokenParent.kind !== 248 /* ForStatement */ && context.currentTokenParent.kind !== 242 /* EmptyStatement */ && context.currentTokenParent.kind !== 240 /* SemicolonClassElement */ && nextTokenKind !== 23 /* OpenBracketToken */ && nextTokenKind !== 21 /* OpenParenToken */ && nextTokenKind !== 40 /* PlusToken */ && nextTokenKind !== 41 /* MinusToken */ && nextTokenKind !== 44 /* SlashToken */ && nextTokenKind !== 14 /* RegularExpressionLiteral */ && nextTokenKind !== 28 /* CommaToken */ && nextTokenKind !== 228 /* TemplateExpression */ && nextTokenKind !== 16 /* TemplateHead */ && nextTokenKind !== 15 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 25 /* DotToken */; + return context.currentTokenParent.kind !== 249 /* ForStatement */ && context.currentTokenParent.kind !== 243 /* EmptyStatement */ && context.currentTokenParent.kind !== 241 /* SemicolonClassElement */ && nextTokenKind !== 23 /* OpenBracketToken */ && nextTokenKind !== 21 /* OpenParenToken */ && nextTokenKind !== 40 /* PlusToken */ && nextTokenKind !== 41 /* MinusToken */ && nextTokenKind !== 44 /* SlashToken */ && nextTokenKind !== 14 /* RegularExpressionLiteral */ && nextTokenKind !== 28 /* CommaToken */ && nextTokenKind !== 229 /* TemplateExpression */ && nextTokenKind !== 16 /* TemplateHead */ && nextTokenKind !== 15 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 25 /* DotToken */; } function isSemicolonInsertionContext(context) { return positionIsASICandidate(context.currentTokenSpan.end, context.currentTokenParent, context.sourceFile); @@ -180381,12 +181482,12 @@ function buildMap(rules) { return map2; } function getRuleBucketIndex(row, column) { - Debug.assert(row <= 165 /* LastKeyword */ && column <= 165 /* LastKeyword */, "Must compute formatting context from tokens"); + Debug.assert(row <= 166 /* LastKeyword */ && column <= 166 /* LastKeyword */, "Must compute formatting context from tokens"); return row * mapRowLength + column; } var maskBitSize = 5; var mask = 31; -var mapRowLength = 165 /* LastToken */ + 1; +var mapRowLength = 166 /* LastToken */ + 1; var RulesPosition = ((RulesPosition2) => { RulesPosition2[RulesPosition2["StopRulesSpecific"] = 0] = "StopRulesSpecific"; RulesPosition2[RulesPosition2["StopRulesAny"] = maskBitSize * 1] = "StopRulesAny"; @@ -180495,17 +181596,17 @@ function findOutermostNodeWithinListLevel(node) { } function isListElement(parent2, node) { switch (parent2.kind) { - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: return rangeContainsRange(parent2.members, node); - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: const body = parent2.body; - return !!body && body.kind === 268 /* ModuleBlock */ && rangeContainsRange(body.statements, node); - case 307 /* SourceFile */: - case 241 /* Block */: - case 268 /* ModuleBlock */: + return !!body && body.kind === 269 /* ModuleBlock */ && rangeContainsRange(body.statements, node); + case 308 /* SourceFile */: + case 242 /* Block */: + case 269 /* ModuleBlock */: return rangeContainsRange(parent2.statements, node); - case 299 /* CatchClause */: + case 300 /* CatchClause */: return rangeContainsRange(parent2.block.statements, node); } return false; @@ -180742,25 +181843,25 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt if (modifier) return modifier.kind; } switch (node.kind) { - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return 86 /* ClassKeyword */; - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: return 120 /* InterfaceKeyword */; - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return 100 /* FunctionKeyword */; - case 266 /* EnumDeclaration */: - return 266 /* EnumDeclaration */; - case 177 /* GetAccessor */: + case 267 /* EnumDeclaration */: + return 267 /* EnumDeclaration */; + case 178 /* GetAccessor */: return 139 /* GetKeyword */; - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return 153 /* SetKeyword */; - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: if (node.asteriskToken) { return 42 /* AsteriskToken */; } // falls through - case 172 /* PropertyDeclaration */: - case 169 /* Parameter */: + case 173 /* PropertyDeclaration */: + case 170 /* Parameter */: const name = getNameOfDeclaration(node); if (name) { return name.kind; @@ -180815,15 +181916,15 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt case 44 /* SlashToken */: case 32 /* GreaterThanToken */: switch (container.kind) { - case 286 /* JsxOpeningElement */: - case 287 /* JsxClosingElement */: - case 285 /* JsxSelfClosingElement */: + case 287 /* JsxOpeningElement */: + case 288 /* JsxClosingElement */: + case 286 /* JsxSelfClosingElement */: return false; } break; case 23 /* OpenBracketToken */: case 24 /* CloseBracketToken */: - if (container.kind !== 200 /* MappedType */) { + if (container.kind !== 201 /* MappedType */) { return false; } break; @@ -180924,11 +182025,11 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt return inheritedIndentation; } } - const effectiveParentStartLine = child.kind === 170 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + const effectiveParentStartLine = child.kind === 171 /* Decorator */ ? childStartLine : undecoratedParentStartLine; const childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); childContextNode = node; - if (isFirstListItem && parent2.kind === 209 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent2.kind === 210 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -181342,50 +182443,50 @@ function getRangeOfEnclosingComment(sourceFile, position, precedingToken, tokenA } function getOpenTokenForList(node, list) { switch (node.kind) { - case 176 /* Constructor */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 219 /* ArrowFunction */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 177 /* Constructor */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 220 /* ArrowFunction */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: if (node.typeParameters === list) { return 30 /* LessThanToken */; } else if (node.parameters === list) { return 21 /* OpenParenToken */; } break; - case 213 /* CallExpression */: - case 214 /* NewExpression */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: if (node.typeArguments === list) { return 30 /* LessThanToken */; } else if (node.arguments === list) { return 21 /* OpenParenToken */; } break; - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: if (node.typeParameters === list) { return 30 /* LessThanToken */; } break; - case 183 /* TypeReference */: - case 215 /* TaggedTemplateExpression */: - case 186 /* TypeQuery */: - case 233 /* ExpressionWithTypeArguments */: - case 205 /* ImportType */: + case 184 /* TypeReference */: + case 216 /* TaggedTemplateExpression */: + case 187 /* TypeQuery */: + case 234 /* ExpressionWithTypeArguments */: + case 206 /* ImportType */: if (node.typeArguments === list) { return 30 /* LessThanToken */; } break; - case 187 /* TypeLiteral */: + case 188 /* TypeLiteral */: return 19 /* OpenBraceToken */; } return 0 /* Unknown */; @@ -181475,11 +182576,11 @@ var SmartIndenter; } const lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; const currentToken = getTokenAtPosition(sourceFile, position); - const isObjectLiteral = currentToken.kind === 19 /* OpenBraceToken */ && currentToken.parent.kind === 210 /* ObjectLiteralExpression */; + const isObjectLiteral = currentToken.kind === 19 /* OpenBraceToken */ && currentToken.parent.kind === 211 /* ObjectLiteralExpression */; if (options.indentStyle === 1 /* Block */ || isObjectLiteral) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 28 /* CommaToken */ && precedingToken.parent.kind !== 226 /* BinaryExpression */) { + if (precedingToken.kind === 28 /* CommaToken */ && precedingToken.parent.kind !== 227 /* BinaryExpression */) { const actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { return actualIndentation; @@ -181487,7 +182588,7 @@ var SmartIndenter; } const containerList = getListByPosition(position, precedingToken.parent, sourceFile); if (containerList && !rangeContainsRange(containerList, precedingToken)) { - const useTheSameBaseIndentation = [218 /* FunctionExpression */, 219 /* ArrowFunction */].includes(currentToken.parent.kind); + const useTheSameBaseIndentation = [219 /* FunctionExpression */, 220 /* ArrowFunction */].includes(currentToken.parent.kind); const indentSize = useTheSameBaseIndentation ? 0 : options.indentSize; return getActualIndentationForListStartLine(containerList, sourceFile, options) + indentSize; } @@ -181629,7 +182730,7 @@ var SmartIndenter; } } function getActualIndentationForNode(current, parent2, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { - const useActualIndentation = (isDeclaration(current) || isStatementButNotDeclaration(current)) && (parent2.kind === 307 /* SourceFile */ || !parentAndChildShareLine); + const useActualIndentation = (isDeclaration(current) || isStatementButNotDeclaration(current)) && (parent2.kind === 308 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -181667,7 +182768,7 @@ var SmartIndenter; } SmartIndenter2.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent2, child, childStartLine, sourceFile) { - if (parent2.kind === 245 /* IfStatement */ && parent2.elseStatement === child) { + if (parent2.kind === 246 /* IfStatement */ && parent2.elseStatement === child) { const elseKeyword = findChildOfKind(parent2, 93 /* ElseKeyword */, sourceFile); Debug.assert(elseKeyword !== void 0); const elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -181715,42 +182816,42 @@ var SmartIndenter; } function getListByRange(start, end, node, sourceFile) { switch (node.kind) { - case 183 /* TypeReference */: + case 184 /* TypeReference */: return getList(node.typeArguments); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return getList(node.properties); - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return getList(node.elements); - case 187 /* TypeLiteral */: + case 188 /* TypeLiteral */: return getList(node.members); - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 179 /* CallSignature */: - case 176 /* Constructor */: - case 185 /* ConstructorType */: - case 180 /* ConstructSignature */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 180 /* CallSignature */: + case 177 /* Constructor */: + case 186 /* ConstructorType */: + case 181 /* ConstructSignature */: return getList(node.typeParameters) || getList(node.parameters); - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return getList(node.parameters); - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 345 /* JSDocTemplateTag */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 346 /* JSDocTemplateTag */: return getList(node.typeParameters); - case 214 /* NewExpression */: - case 213 /* CallExpression */: + case 215 /* NewExpression */: + case 214 /* CallExpression */: return getList(node.typeArguments) || getList(node.arguments); - case 261 /* VariableDeclarationList */: + case 262 /* VariableDeclarationList */: return getList(node.declarations); - case 275 /* NamedImports */: - case 279 /* NamedExports */: + case 276 /* NamedImports */: + case 280 /* NamedExports */: return getList(node.elements); - case 206 /* ObjectBindingPattern */: - case 207 /* ArrayBindingPattern */: + case 207 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: return getList(node.elements); } function getList(list) { @@ -181773,7 +182874,7 @@ var SmartIndenter; return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options); } function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) { - if (node.parent && node.parent.kind === 261 /* VariableDeclarationList */) { + if (node.parent && node.parent.kind === 262 /* VariableDeclarationList */) { return -1 /* Unknown */; } const containingList = getContainingList(node, sourceFile); @@ -181834,97 +182935,102 @@ var SmartIndenter; function nodeWillIndentChild(settings, parent2, child, sourceFile, indentByDefault) { const childKind = child ? child.kind : 0 /* Unknown */; switch (parent2.kind) { - case 244 /* ExpressionStatement */: - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 209 /* ArrayLiteralExpression */: - case 241 /* Block */: - case 268 /* ModuleBlock */: - case 210 /* ObjectLiteralExpression */: - case 187 /* TypeLiteral */: - case 200 /* MappedType */: - case 189 /* TupleType */: - case 217 /* ParenthesizedExpression */: - case 211 /* PropertyAccessExpression */: - case 213 /* CallExpression */: - case 214 /* NewExpression */: - case 243 /* VariableStatement */: - case 277 /* ExportAssignment */: - case 253 /* ReturnStatement */: - case 227 /* ConditionalExpression */: - case 207 /* ArrayBindingPattern */: - case 206 /* ObjectBindingPattern */: - case 286 /* JsxOpeningElement */: - case 289 /* JsxOpeningFragment */: - case 285 /* JsxSelfClosingElement */: - case 294 /* JsxExpression */: - case 173 /* MethodSignature */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 169 /* Parameter */: - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 196 /* ParenthesizedType */: - case 215 /* TaggedTemplateExpression */: - case 223 /* AwaitExpression */: - case 279 /* NamedExports */: - case 275 /* NamedImports */: - case 281 /* ExportSpecifier */: - case 276 /* ImportSpecifier */: - case 172 /* PropertyDeclaration */: - case 296 /* CaseClause */: - case 297 /* DefaultClause */: + case 245 /* ExpressionStatement */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 210 /* ArrayLiteralExpression */: + case 242 /* Block */: + case 269 /* ModuleBlock */: + case 211 /* ObjectLiteralExpression */: + case 188 /* TypeLiteral */: + case 201 /* MappedType */: + case 190 /* TupleType */: + case 218 /* ParenthesizedExpression */: + case 212 /* PropertyAccessExpression */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: + case 244 /* VariableStatement */: + case 278 /* ExportAssignment */: + case 254 /* ReturnStatement */: + case 228 /* ConditionalExpression */: + case 208 /* ArrayBindingPattern */: + case 207 /* ObjectBindingPattern */: + case 287 /* JsxOpeningElement */: + case 290 /* JsxOpeningFragment */: + case 286 /* JsxSelfClosingElement */: + case 295 /* JsxExpression */: + case 174 /* MethodSignature */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 170 /* Parameter */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 197 /* ParenthesizedType */: + case 216 /* TaggedTemplateExpression */: + case 224 /* AwaitExpression */: + case 280 /* NamedExports */: + case 276 /* NamedImports */: + case 282 /* ExportSpecifier */: + case 277 /* ImportSpecifier */: + case 173 /* PropertyDeclaration */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: return true; - case 269 /* CaseBlock */: + case 270 /* CaseBlock */: return settings.indentSwitchCase ?? true; - case 260 /* VariableDeclaration */: - case 303 /* PropertyAssignment */: - case 226 /* BinaryExpression */: - if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 210 /* ObjectLiteralExpression */) { + case 261 /* VariableDeclaration */: + case 304 /* PropertyAssignment */: + case 227 /* BinaryExpression */: + if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 211 /* ObjectLiteralExpression */) { return rangeIsOnOneLine(sourceFile, child); } - if (parent2.kind === 226 /* BinaryExpression */ && sourceFile && child && childKind === 284 /* JsxElement */) { + if (parent2.kind === 227 /* BinaryExpression */ && sourceFile && child && childKind === 285 /* JsxElement */) { const parentStartLine = sourceFile.getLineAndCharacterOfPosition(skipTrivia(sourceFile.text, parent2.pos)).line; const childStartLine = sourceFile.getLineAndCharacterOfPosition(skipTrivia(sourceFile.text, child.pos)).line; return parentStartLine !== childStartLine; } - if (parent2.kind !== 226 /* BinaryExpression */) { + if (parent2.kind !== 227 /* BinaryExpression */) { return true; } break; - case 246 /* DoStatement */: - case 247 /* WhileStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 248 /* ForStatement */: - case 245 /* IfStatement */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 174 /* MethodDeclaration */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - return childKind !== 241 /* Block */; - case 219 /* ArrowFunction */: - if (sourceFile && childKind === 217 /* ParenthesizedExpression */) { + case 247 /* DoStatement */: + case 248 /* WhileStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 249 /* ForStatement */: + case 246 /* IfStatement */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 175 /* MethodDeclaration */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + return childKind !== 242 /* Block */; + case 220 /* ArrowFunction */: + if (sourceFile && childKind === 218 /* ParenthesizedExpression */) { return rangeIsOnOneLine(sourceFile, child); } - return childKind !== 241 /* Block */; - case 278 /* ExportDeclaration */: - return childKind !== 279 /* NamedExports */; - case 272 /* ImportDeclaration */: - return childKind !== 273 /* ImportClause */ || !!child.namedBindings && child.namedBindings.kind !== 275 /* NamedImports */; - case 284 /* JsxElement */: - return childKind !== 287 /* JsxClosingElement */; - case 288 /* JsxFragment */: - return childKind !== 290 /* JsxClosingFragment */; - case 193 /* IntersectionType */: - case 192 /* UnionType */: - case 238 /* SatisfiesExpression */: - if (childKind === 187 /* TypeLiteral */ || childKind === 189 /* TupleType */ || childKind === 200 /* MappedType */) { + return childKind !== 242 /* Block */; + case 279 /* ExportDeclaration */: + return childKind !== 280 /* NamedExports */; + case 273 /* ImportDeclaration */: + return childKind !== 274 /* ImportClause */ || !!child.namedBindings && child.namedBindings.kind !== 276 /* NamedImports */; + case 285 /* JsxElement */: + return childKind !== 288 /* JsxClosingElement */; + case 289 /* JsxFragment */: + return childKind !== 291 /* JsxClosingFragment */; + case 194 /* IntersectionType */: + case 193 /* UnionType */: + case 239 /* SatisfiesExpression */: + if (childKind === 188 /* TypeLiteral */ || childKind === 190 /* TupleType */ || childKind === 201 /* MappedType */) { + return false; + } + break; + case 259 /* TryStatement */: + if (childKind === 242 /* Block */) { return false; } break; @@ -181934,11 +183040,11 @@ var SmartIndenter; SmartIndenter2.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent2) { switch (kind) { - case 253 /* ReturnStatement */: - case 257 /* ThrowStatement */: - case 251 /* ContinueStatement */: - case 252 /* BreakStatement */: - return parent2.kind !== 241 /* Block */; + case 254 /* ReturnStatement */: + case 258 /* ThrowStatement */: + case 252 /* ContinueStatement */: + case 253 /* BreakStatement */: + return parent2.kind !== 242 /* Block */; default: return false; } @@ -182569,6 +183675,7 @@ __export(ts_exports2, { decodeMappings: () => decodeMappings, decodedTextSpanIntersectsWith: () => decodedTextSpanIntersectsWith, deduplicate: () => deduplicate, + defaultHoverMaximumTruncationLength: () => defaultHoverMaximumTruncationLength, defaultInitCompilerOptions: () => defaultInitCompilerOptions, defaultMaximumTruncationLength: () => defaultMaximumTruncationLength, diagnosticCategoryName: () => diagnosticCategoryName, @@ -182753,7 +183860,6 @@ __export(ts_exports2, { getCommonSourceDirectory: () => getCommonSourceDirectory, getCommonSourceDirectoryOfConfig: () => getCommonSourceDirectoryOfConfig, getCompilerOptionValue: () => getCompilerOptionValue, - getCompilerOptionsDiffValue: () => getCompilerOptionsDiffValue, getConditions: () => getConditions, getConfigFileParsingDiagnostics: () => getConfigFileParsingDiagnostics, getConstantValue: () => getConstantValue, @@ -184787,9 +185893,9 @@ var TypingsInstaller = class { this.log.writeLine(`Loaded content of '${packageJson}':${stringifyIndented(npmConfig)}`); this.log.writeLine(`Loaded content of '${packageLockJson}':${stringifyIndented(npmLock)}`); } - if (npmConfig.devDependencies && npmLock.dependencies) { + if (npmConfig.devDependencies && (npmLock.packages || npmLock.dependencies)) { for (const key in npmConfig.devDependencies) { - if (!hasProperty(npmLock.dependencies, key)) { + if (npmLock.packages && !hasProperty(npmLock.packages, `node_modules/${key}`) || npmLock.dependencies && !hasProperty(npmLock.dependencies, key)) { continue; } const packageName = getBaseFileName(key); @@ -184813,7 +185919,7 @@ var TypingsInstaller = class { if (this.log.isEnabled()) { this.log.writeLine(`Adding entry into typings cache: '${packageName}' => '${typingFile}'`); } - const info = getProperty(npmLock.dependencies, key); + const info = npmLock.packages && getProperty(npmLock.packages, `node_modules/${key}`) || getProperty(npmLock.dependencies, key); const version2 = info && info.version; if (!version2) { continue; @@ -185327,6 +186433,7 @@ var ModuleKind2 = /* @__PURE__ */ ((ModuleKind3) => { ModuleKind3["ESNext"] = "esnext"; ModuleKind3["Node16"] = "node16"; ModuleKind3["Node18"] = "node18"; + ModuleKind3["Node20"] = "node20"; ModuleKind3["NodeNext"] = "nodenext"; ModuleKind3["Preserve"] = "preserve"; return ModuleKind3; @@ -186080,7 +187187,7 @@ var Project2 = class _Project { this.projectService.onProjectCreation(this); } /** @internal */ - getResolvedProjectReferenceToRedirect(_fileName) { + getRedirectFromSourceFile(_fileName) { return void 0; } isNonTsProject() { @@ -188129,9 +189236,9 @@ var ConfiguredProject2 = class extends Project2 { (this.potentialProjectReferences || (this.potentialProjectReferences = /* @__PURE__ */ new Set())).add(canonicalConfigPath); } /** @internal */ - getResolvedProjectReferenceToRedirect(fileName) { + getRedirectFromSourceFile(fileName) { const program = this.getCurrentProgram(); - return program && program.getResolvedProjectReferenceToRedirect(fileName); + return program && program.getRedirectFromSourceFile(fileName); } /** @internal */ forEachResolvedProjectReference(cb) { @@ -194246,7 +195353,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter } const initialNode = getTouchingPropertyName(program.getSourceFile(file), position); const symbol = program.getTypeChecker().getSymbolAtLocation(initialNode); - const importSpecifier = symbol && getDeclarationOfKind(symbol, 276 /* ImportSpecifier */); + const importSpecifier = symbol && getDeclarationOfKind(symbol, 277 /* ImportSpecifier */); if (!importSpecifier) return void 0; const nameToSearch = ((_a2 = importSpecifier.propertyName) == null ? void 0 : _a2.text) || importSpecifier.name.text; return searchForDeclaration(nameToSearch, fileToSearch, noDtsProgram); @@ -194798,11 +195905,17 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter getQuickInfoWorker(args, simplifiedResult) { const { file, project } = this.getFileAndProject(args); const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); - const quickInfo = project.getLanguageService().getQuickInfoAtPosition(file, this.getPosition(args, scriptInfo)); + const userPreferences = this.getPreferences(file); + const quickInfo = project.getLanguageService().getQuickInfoAtPosition( + file, + this.getPosition(args, scriptInfo), + userPreferences.maximumHoverLength, + args.verbosityLevel + ); if (!quickInfo) { return void 0; } - const useDisplayParts = !!this.getPreferences(file).displayPartsForJSDoc; + const useDisplayParts = !!userPreferences.displayPartsForJSDoc; if (simplifiedResult) { const displayString = displayPartsToString(quickInfo.displayParts); return { @@ -194812,7 +195925,8 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter end: scriptInfo.positionToLineOffset(textSpanEnd(quickInfo.textSpan)), displayString, documentation: useDisplayParts ? this.mapDisplayParts(quickInfo.documentation, project) : displayPartsToString(quickInfo.documentation), - tags: this.mapJSDocTagInfo(quickInfo.tags, project, useDisplayParts) + tags: this.mapJSDocTagInfo(quickInfo.tags, project, useDisplayParts), + canIncreaseVerbosityLevel: quickInfo.canIncreaseVerbosityLevel }; } else { return useDisplayParts ? quickInfo : { @@ -197322,6 +198436,7 @@ if (typeof console !== "undefined") { decodeMappings, decodedTextSpanIntersectsWith, deduplicate, + defaultHoverMaximumTruncationLength, defaultInitCompilerOptions, defaultMaximumTruncationLength, diagnosticCategoryName, @@ -197506,7 +198621,6 @@ if (typeof console !== "undefined") { getCommonSourceDirectory, getCommonSourceDirectoryOfConfig, getCompilerOptionValue, - getCompilerOptionsDiffValue, getConditions, getConfigFileParsingDiagnostics, getConstantValue, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f1a729169c22..0c075641a650 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,7 +5,7 @@ settings: excludeLinksFromLockfile: false overrides: - typescript: 5.8.3 + typescript: 5.9.0-beta '@angular/build': workspace:* packageExtensionsChecksum: d67b1f07b351844d00c57cbace376860 @@ -15,47 +15,47 @@ importers: .: devDependencies: '@angular/animations': - specifier: 20.2.0-next.0 - version: 20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)) + specifier: 20.2.0-next.1 + version: 20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)) '@angular/cdk': specifier: 20.1.0-rc.0 - version: 20.1.0-rc.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) + version: 20.1.0-rc.0(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) '@angular/common': - specifier: 20.2.0-next.0 - version: 20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) + specifier: 20.2.0-next.1 + version: 20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) '@angular/compiler': - specifier: 20.2.0-next.0 - version: 20.2.0-next.0 + specifier: 20.2.0-next.1 + version: 20.2.0-next.1 '@angular/compiler-cli': - specifier: 20.2.0-next.0 - version: 20.2.0-next.0(@angular/compiler@20.2.0-next.0)(typescript@5.8.3) + specifier: 20.2.0-next.1 + version: 20.2.0-next.1(@angular/compiler@20.2.0-next.1)(typescript@5.9.0-beta) '@angular/core': - specifier: 20.2.0-next.0 - version: 20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1) + specifier: 20.2.0-next.1 + version: 20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1) '@angular/forms': - specifier: 20.2.0-next.0 - version: 20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.2.0-next.0(@angular/animations@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2) + specifier: 20.2.0-next.1 + version: 20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.2.0-next.1(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2) '@angular/localize': - specifier: 20.2.0-next.0 - version: 20.2.0-next.0(@angular/compiler-cli@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(typescript@5.8.3))(@angular/compiler@20.2.0-next.0) + specifier: 20.2.0-next.1 + version: 20.2.0-next.1(@angular/compiler-cli@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(typescript@5.9.0-beta))(@angular/compiler@20.2.0-next.1) '@angular/material': specifier: 20.1.0-rc.0 - version: 20.1.0-rc.0(difxyzoi5ta3rok2swggpxhcoq) + version: 20.1.0-rc.0(cduru5ovfso2xbyofiyvo3xmyu) '@angular/ng-dev': specifier: https://github.com/angular/dev-infra-private-ng-dev-builds.git#7cdb4cce7349f791492eee3ac1f84e2a0e243287 version: https://codeload.github.com/angular/dev-infra-private-ng-dev-builds/tar.gz/7cdb4cce7349f791492eee3ac1f84e2a0e243287(@modelcontextprotocol/sdk@1.15.1)(encoding@0.1.13) '@angular/platform-browser': - specifier: 20.2.0-next.0 - version: 20.2.0-next.0(@angular/animations@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)) + specifier: 20.2.0-next.1 + version: 20.2.0-next.1(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)) '@angular/platform-server': - specifier: 20.2.0-next.0 - version: 20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/compiler@20.2.0-next.0)(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.2.0-next.0(@angular/animations@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2) + specifier: 20.2.0-next.1 + version: 20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/compiler@20.2.0-next.1)(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.2.0-next.1(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2) '@angular/router': - specifier: 20.2.0-next.0 - version: 20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.2.0-next.0(@angular/animations@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2) + specifier: 20.2.0-next.1 + version: 20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.2.0-next.1(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2) '@angular/service-worker': - specifier: 20.2.0-next.0 - version: 20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) + specifier: 20.2.0-next.1 + version: 20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) '@bazel/bazelisk': specifier: 1.26.0 version: 1.26.0 @@ -160,10 +160,10 @@ importers: version: 1.1.9 '@typescript-eslint/eslint-plugin': specifier: 8.37.0 - version: 8.37.0(@typescript-eslint/parser@8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.8.3))(eslint@9.31.0(jiti@1.21.7))(typescript@5.8.3) + version: 8.37.0(@typescript-eslint/parser@8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.9.0-beta))(eslint@9.31.0(jiti@1.21.7))(typescript@5.9.0-beta) '@typescript-eslint/parser': specifier: 8.37.0 - version: 8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.8.3) + version: 8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.9.0-beta) ajv: specifier: 8.17.1 version: 8.17.1 @@ -193,7 +193,7 @@ importers: version: 3.1.1(eslint@9.31.0(jiti@1.21.7)) eslint-plugin-import: specifier: 2.32.0 - version: 2.32.0(@typescript-eslint/parser@8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.8.3))(eslint@9.31.0(jiti@1.21.7)) + version: 2.32.0(@typescript-eslint/parser@8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.9.0-beta))(eslint@9.31.0(jiti@1.21.7)) express: specifier: 5.1.0 version: 5.1.0 @@ -274,7 +274,7 @@ importers: version: 3.0.2 rollup-plugin-dts: specifier: 6.2.1 - version: 6.2.1(rollup@4.45.1)(typescript@5.8.3) + version: 6.2.1(rollup@4.45.1)(typescript@5.9.0-beta) rollup-plugin-sourcemaps2: specifier: 0.5.3 version: 0.5.3(@types/node@20.19.8)(rollup@4.45.1) @@ -292,13 +292,13 @@ importers: version: 7.4.3 ts-node: specifier: ^10.9.1 - version: 10.9.2(@types/node@20.19.8)(typescript@5.8.3) + version: 10.9.2(@types/node@20.19.8)(typescript@5.9.0-beta) tslib: specifier: 2.8.1 version: 2.8.1 typescript: - specifier: 5.8.3 - version: 5.8.3 + specifier: 5.9.0-beta + version: 5.9.0-beta undici: specifier: 7.11.0 version: 7.11.0 @@ -443,7 +443,7 @@ importers: version: 4.3.0 ng-packagr: specifier: 20.1.0-rc.0 - version: 20.1.0-rc.0(@angular/compiler-cli@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(typescript@5.8.3))(tslib@2.8.1)(typescript@5.8.3) + version: 20.1.0-rc.0(@angular/compiler-cli@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(typescript@5.9.0-beta))(tslib@2.8.1)(typescript@5.9.0-beta) postcss: specifier: 8.5.6 version: 8.5.6 @@ -546,13 +546,13 @@ importers: version: 20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1) '@angular/platform-browser': specifier: 20.2.0-next.0 - version: 20.2.0-next.0(@angular/animations@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)) + version: 20.2.0-next.0(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)) '@angular/platform-server': specifier: 20.2.0-next.0 - version: 20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/compiler@20.2.0-next.0)(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.2.0-next.0(@angular/animations@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2) + version: 20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/compiler@20.2.0-next.0)(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.2.0-next.0(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2) '@angular/router': specifier: 20.2.0-next.0 - version: 20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.2.0-next.0(@angular/animations@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2) + version: 20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.2.0-next.0(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2) '@schematics/angular': specifier: workspace:* version: link:../../schematics/angular @@ -706,7 +706,7 @@ importers: version: 8.5.6 postcss-loader: specifier: 8.1.1 - version: 8.1.1(postcss@8.5.6)(typescript@5.8.3)(webpack@5.100.2(esbuild@0.25.6)) + version: 8.1.1(postcss@8.5.6)(typescript@5.9.0-beta)(webpack@5.100.2(esbuild@0.25.6)) resolve-url-loader: specifier: 5.0.0 version: 5.0.0 @@ -768,7 +768,7 @@ importers: version: 3.0.4 ng-packagr: specifier: 20.1.0-rc.0 - version: 20.1.0-rc.0(@angular/compiler-cli@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(typescript@5.8.3))(tslib@2.8.1)(typescript@5.8.3) + version: 20.1.0-rc.0(@angular/compiler-cli@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(typescript@5.9.0-beta))(tslib@2.8.1)(typescript@5.9.0-beta) undici: specifier: 7.11.0 version: 7.11.0 @@ -866,10 +866,10 @@ importers: version: 20.2.0-next.0 '@angular/compiler-cli': specifier: 20.2.0-next.0 - version: 20.2.0-next.0(@angular/compiler@20.2.0-next.0)(typescript@5.8.3) + version: 20.2.0-next.0(@angular/compiler@20.2.0-next.0)(typescript@5.9.0-beta) typescript: - specifier: 5.8.3 - version: 5.8.3 + specifier: 5.9.0-beta + version: 5.9.0-beta webpack: specifier: 5.100.2 version: 5.100.2(esbuild@0.25.6) @@ -962,12 +962,12 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} - '@angular/animations@20.2.0-next.0': - resolution: {integrity: sha512-3Rf2BOOCKSGoH6VnrXb0y11h9A/WB9c3y3m/QCvNmFzh8zm35ObGLf8OSbQ6hN1zCupTZVm1VS8zfJRa+wbQJQ==} + '@angular/animations@20.2.0-next.1': + resolution: {integrity: sha512-5q0ho+h6S8mHKCoTpA9KRp+ncWQhmemPhII7rpjZ3wyCyOzgE98uQ15B3KiNF7r7gl99x6qe3phWXZps8XQOzA==} engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} peerDependencies: - '@angular/common': 20.2.0-next.0 - '@angular/core': 20.2.0-next.0 + '@angular/common': 20.2.0-next.1 + '@angular/core': 20.2.0-next.1 '@angular/cdk@20.1.0-rc.0': resolution: {integrity: sha512-e81eOu3Nxf6QGzhZKBC40udh4R3NdA+fExcJ7XX3Pt4uRBy17NodYWZZUazoiD9S9i+FKfwA1jBbucm7WA6QMg==} @@ -983,13 +983,31 @@ packages: '@angular/core': 20.2.0-next.0 rxjs: ^6.5.3 || ^7.4.0 + '@angular/common@20.2.0-next.1': + resolution: {integrity: sha512-I5njujaVyRfA7IGBUAhgSWw4XYWqx79qyzlXuMOGBOgGSUFfx/n7Uv1yfm4O9STA9Rmdqj3z6/q8lHe7pmidOA==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} + peerDependencies: + '@angular/core': 20.2.0-next.1 + rxjs: ^6.5.3 || ^7.4.0 + '@angular/compiler-cli@20.2.0-next.0': resolution: {integrity: sha512-Sp0VAnPlS9BQ1J/m6wwSqbBVEwiHac8kZqeoNcZtbh0AAw8vP5OIQZZ+UV2SVQevSJyWQ3QaLpp4LLkvc7PVfg==} engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} hasBin: true peerDependencies: '@angular/compiler': 20.2.0-next.0 - typescript: 5.8.3 + typescript: 5.9.0-beta + peerDependenciesMeta: + typescript: + optional: true + + '@angular/compiler-cli@20.2.0-next.1': + resolution: {integrity: sha512-t7dgF+n0YDjEtSWkosMgnGz7xUuGBMCe1KaXccGhlD9hrTzemyiOO3+oNSpDxgk0b7hmqhjt14iWFioVpMbSGw==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} + hasBin: true + peerDependencies: + '@angular/compiler': 20.2.0-next.1 + typescript: 5.9.0-beta peerDependenciesMeta: typescript: optional: true @@ -998,6 +1016,10 @@ packages: resolution: {integrity: sha512-llDJiVyw8XOCsxgNP5JRQuxggIFvrGw+btOrctoCglr00y/OJOYjWF7KvK1zB+e3gO3TI3549eDnlgoTSwfUfg==} engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} + '@angular/compiler@20.2.0-next.1': + resolution: {integrity: sha512-DOHh/PBWmN3hF8Umf8eM7FbUYwwA7oFrySk/4E8c6IAFq5H9ZbWG9Zlxr9LBYXtxtic0z8GVIHUMdvkV7iPZDA==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} + '@angular/core@20.2.0-next.0': resolution: {integrity: sha512-cvtCuoENQYxliuXsIiYKXau8/AhVwMalTe0yh/YQ0fBU8ofVQBsyMQFicxLAtv9PFShphXKrPTE/mBmkRZkpCw==} engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} @@ -1011,22 +1033,35 @@ packages: zone.js: optional: true - '@angular/forms@20.2.0-next.0': - resolution: {integrity: sha512-LomtE6a1QBNuPjqeBhInxlOhurGaMHtMR5Hf/GWx7//WD5w86ecDQ+4LnY/9J6+vTL+QaEFbhXt6VoF2/QVjJw==} + '@angular/core@20.2.0-next.1': + resolution: {integrity: sha512-lCvQC1J7m6T0RAbKmfNxrZTje8qGom3ALkjino4EiTzzT0bfRGXC5a0rySVR1cIqXe9UMgSlTyyU2Tc5Sqex5g==} engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} peerDependencies: - '@angular/common': 20.2.0-next.0 - '@angular/core': 20.2.0-next.0 - '@angular/platform-browser': 20.2.0-next.0 + '@angular/compiler': 20.2.0-next.1 rxjs: ^6.5.3 || ^7.4.0 + zone.js: ~0.15.0 + peerDependenciesMeta: + '@angular/compiler': + optional: true + zone.js: + optional: true - '@angular/localize@20.2.0-next.0': - resolution: {integrity: sha512-sJdaBoqcIWsdeHJw2xVvhcX+LH4JbFIeZK1/f785wJKrl+EEzqeZv4tQL7202zdQaCkknCgEAS5YjpJj2pD0lQ==} + '@angular/forms@20.2.0-next.1': + resolution: {integrity: sha512-/eWmPRSFFf05z6BTBMRbFbsjb/ocsPmyG0kXFdZ9ahkezMXJFNje6u8hcQsRxPNKZovzPgDPEHZ0GZ/3BnIBOQ==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} + peerDependencies: + '@angular/common': 20.2.0-next.1 + '@angular/core': 20.2.0-next.1 + '@angular/platform-browser': 20.2.0-next.1 + rxjs: ^6.5.3 || ^7.4.0 + + '@angular/localize@20.2.0-next.1': + resolution: {integrity: sha512-LngudwEcfgsZAJtDJMiXnHBeCJN4XqQ1LoyAHOpV7oGv/9mvHwgEdxOPzCavAxw+T0v6YLVNEdUrr2dgiEgs8Q==} engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} hasBin: true peerDependencies: - '@angular/compiler': 20.2.0-next.0 - '@angular/compiler-cli': 20.2.0-next.0 + '@angular/compiler': 20.2.0-next.1 + '@angular/compiler-cli': 20.2.0-next.1 '@angular/material@20.1.0-rc.0': resolution: {integrity: sha512-PwwK7p6WHZsrXEQODZdWHMN2BclcCBjArOmYF487gWYySzKDYZUcm/6lXjXV5Tdw8vT564VEFBQpkFPVz5Sq1Q==} @@ -1054,6 +1089,17 @@ packages: '@angular/animations': optional: true + '@angular/platform-browser@20.2.0-next.1': + resolution: {integrity: sha512-X8g777B6N7PukvPhxVysp2SXNCkM4oI70eo2hr1EWcspdbGK2/7rlXZC02Fv7WaILOoyYRClNEktRdSSuKczrw==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} + peerDependencies: + '@angular/animations': 20.2.0-next.1 + '@angular/common': 20.2.0-next.1 + '@angular/core': 20.2.0-next.1 + peerDependenciesMeta: + '@angular/animations': + optional: true + '@angular/platform-server@20.2.0-next.0': resolution: {integrity: sha512-9N9NSQhocvnKdnGKrhZREXQVueS312Mvfb2rw3p8MqbzL6sbgIfWkQ6RS3YFGcVEhyBdOeENK/PukMaqupU/lg==} engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} @@ -1064,6 +1110,16 @@ packages: '@angular/platform-browser': 20.2.0-next.0 rxjs: ^6.5.3 || ^7.4.0 + '@angular/platform-server@20.2.0-next.1': + resolution: {integrity: sha512-G3OMPqKCg0f87sWh219KHVolZhJcnSzx+EHiiEVTo/nCb9/0wl1nrIIlsClrrzwFg11rfnJcQqbYIIJdOaGJQg==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} + peerDependencies: + '@angular/common': 20.2.0-next.1 + '@angular/compiler': 20.2.0-next.1 + '@angular/core': 20.2.0-next.1 + '@angular/platform-browser': 20.2.0-next.1 + rxjs: ^6.5.3 || ^7.4.0 + '@angular/router@20.2.0-next.0': resolution: {integrity: sha512-NYOfZeg3ppXHpgA1l4EQPhweRsolFh9FE24GMH/ehk69lCurhZnh9A56UKkYonN5Nlt7X4kANqg4FO0rLP82pw==} engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} @@ -1073,12 +1129,21 @@ packages: '@angular/platform-browser': 20.2.0-next.0 rxjs: ^6.5.3 || ^7.4.0 - '@angular/service-worker@20.2.0-next.0': - resolution: {integrity: sha512-Ltws05ZpdSyaqPe9xnA9HZLaAZxL/BkTsfuXoRtleCc7BpYqKHvtBo439Syed5FqaiSeyfLbq9+xFC4Z52argQ==} + '@angular/router@20.2.0-next.1': + resolution: {integrity: sha512-KPWNupKlM6xb5/P3/Jvmn7XeCuO0McIJ0VoKJ/YZsZkueQ0czNm4iT2DL6v7DhaEVG5yoMTHvacyfNyYoqWXhA==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} + peerDependencies: + '@angular/common': 20.2.0-next.1 + '@angular/core': 20.2.0-next.1 + '@angular/platform-browser': 20.2.0-next.1 + rxjs: ^6.5.3 || ^7.4.0 + + '@angular/service-worker@20.2.0-next.1': + resolution: {integrity: sha512-MHI1s4hxNzJl1vvyY6DW7/WO1VDprp42TK69dA2lXGNHUrfGN3G/Y+I64+IrjXq2bLgCmcOK9IzhtWbQ6SwpdA==} engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} hasBin: true peerDependencies: - '@angular/core': 20.2.0-next.0 + '@angular/core': 20.2.0-next.1 rxjs: ^6.5.3 || ^7.4.0 '@asamuzakjp/css-color@3.2.0': @@ -3026,20 +3091,20 @@ packages: peerDependencies: '@typescript-eslint/parser': ^8.37.0 eslint: ^8.57.0 || ^9.0.0 - typescript: 5.8.3 + typescript: 5.9.0-beta '@typescript-eslint/parser@8.37.0': resolution: {integrity: sha512-kVIaQE9vrN9RLCQMQ3iyRlVJpTiDUY6woHGb30JDkfJErqrQEmtdWH3gV0PBAfGZgQXoqzXOO0T3K6ioApbbAA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: 5.8.3 + typescript: 5.9.0-beta '@typescript-eslint/project-service@8.37.0': resolution: {integrity: sha512-BIUXYsbkl5A1aJDdYJCBAo8rCEbAvdquQ8AnLb6z5Lp1u3x5PNgSSx9A/zqYc++Xnr/0DVpls8iQ2cJs/izTXA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: 5.8.3 + typescript: 5.9.0-beta '@typescript-eslint/scope-manager@8.37.0': resolution: {integrity: sha512-0vGq0yiU1gbjKob2q691ybTg9JX6ShiVXAAfm2jGf3q0hdP6/BruaFjL/ManAR/lj05AvYCH+5bbVo0VtzmjOA==} @@ -3049,14 +3114,14 @@ packages: resolution: {integrity: sha512-1/YHvAVTimMM9mmlPvTec9NP4bobA1RkDbMydxG8omqwJJLEW/Iy2C4adsAESIXU3WGLXFHSZUU+C9EoFWl4Zg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: 5.8.3 + typescript: 5.9.0-beta '@typescript-eslint/type-utils@8.37.0': resolution: {integrity: sha512-SPkXWIkVZxhgwSwVq9rqj/4VFo7MnWwVaRNznfQDc/xPYHjXnPfLWn+4L6FF1cAz6e7dsqBeMawgl7QjUMj4Ow==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: 5.8.3 + typescript: 5.9.0-beta '@typescript-eslint/types@8.37.0': resolution: {integrity: sha512-ax0nv7PUF9NOVPs+lmQ7yIE7IQmAf8LGcXbMvHX5Gm+YJUYNAl340XkGnrimxZ0elXyoQJuN5sbg6C4evKA4SQ==} @@ -3066,14 +3131,14 @@ packages: resolution: {integrity: sha512-zuWDMDuzMRbQOM+bHyU4/slw27bAUEcKSKKs3hcv2aNnc/tvE/h7w60dwVw8vnal2Pub6RT1T7BI8tFZ1fE+yg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: 5.8.3 + typescript: 5.9.0-beta '@typescript-eslint/utils@8.37.0': resolution: {integrity: sha512-TSFvkIW6gGjN2p6zbXo20FzCABbyUAuq6tBvNRGsKdsSQ6a7rnV6ADfZ7f4iI3lIiXc4F4WWvtUfDw9CJ9pO5A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: 5.8.3 + typescript: 5.9.0-beta '@typescript-eslint/visitor-keys@8.37.0': resolution: {integrity: sha512-YzfhzcTnZVPiLfP/oeKtDp2evwvHLMe0LOy7oe+hb9KKIumLNohYS9Hgp1ifwpu42YWxhZE8yieggz6JpqO/1w==} @@ -4036,7 +4101,7 @@ packages: resolution: {integrity: sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==} engines: {node: '>=14'} peerDependencies: - typescript: 5.8.3 + typescript: 5.9.0-beta peerDependenciesMeta: typescript: optional: true @@ -6202,7 +6267,7 @@ packages: '@angular/compiler-cli': ^20.0.0 || ^20.1.0-next.0 tailwindcss: ^2.0.0 || ^3.0.0 || ^4.0.0 tslib: ^2.3.0 - typescript: 5.8.3 + typescript: 5.9.0-beta peerDependenciesMeta: tailwindcss: optional: true @@ -7048,7 +7113,7 @@ packages: engines: {node: '>=16'} peerDependencies: rollup: ^3.29.4 || ^4 - typescript: 5.8.3 + typescript: 5.9.0-beta rollup-plugin-sourcemaps2@0.5.3: resolution: {integrity: sha512-KmD8A50Lvi/FVkmu8Xo1LXFfhE5tCK/CIAWcnN44cJlgjyGR1l8WqYrSpJ+SQ3e6KNSj7GBvwqUg/4nQt3Agow==} @@ -7698,7 +7763,7 @@ packages: resolution: {integrity: sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==} engines: {node: '>=18.12'} peerDependencies: - typescript: 5.8.3 + typescript: 5.9.0-beta ts-node@10.9.2: resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} @@ -7707,7 +7772,7 @@ packages: '@swc/core': '>=1.2.50' '@swc/wasm': '>=1.2.50' '@types/node': '*' - typescript: 5.8.3 + typescript: 5.9.0-beta peerDependenciesMeta: '@swc/core': optional: true @@ -7778,8 +7843,8 @@ packages: typed-query-selector@2.12.0: resolution: {integrity: sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg==} - typescript@5.8.3: - resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==} + typescript@5.9.0-beta: + resolution: {integrity: sha512-p91qoTdwWKj9YEBYavmGiBn0DF4OBElzw4pW4oPbK4HeCfr/SDz9+yviVWshZXGvGvFCJ3AVQ+J7F1UZXc23QQ==} engines: {node: '>=14.17'} hasBin: true @@ -8442,16 +8507,16 @@ snapshots: '@jridgewell/gen-mapping': 0.3.12 '@jridgewell/trace-mapping': 0.3.29 - '@angular/animations@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))': + '@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))': dependencies: - '@angular/common': 20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) - '@angular/core': 20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1) + '@angular/common': 20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) + '@angular/core': 20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1) tslib: 2.8.1 - '@angular/cdk@20.1.0-rc.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2)': + '@angular/cdk@20.1.0-rc.0(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2)': dependencies: - '@angular/common': 20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) - '@angular/core': 20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1) + '@angular/common': 20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) + '@angular/core': 20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1) parse5: 7.3.0 rxjs: 7.8.2 tslib: 2.8.1 @@ -8462,7 +8527,13 @@ snapshots: rxjs: 7.8.2 tslib: 2.8.1 - '@angular/compiler-cli@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(typescript@5.8.3)': + '@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2)': + dependencies: + '@angular/core': 20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1) + rxjs: 7.8.2 + tslib: 2.8.1 + + '@angular/compiler-cli@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(typescript@5.9.0-beta)': dependencies: '@angular/compiler': 20.2.0-next.0 '@babel/core': 7.28.0 @@ -8474,7 +8545,23 @@ snapshots: tslib: 2.8.1 yargs: 18.0.0 optionalDependencies: - typescript: 5.8.3 + typescript: 5.9.0-beta + transitivePeerDependencies: + - supports-color + + '@angular/compiler-cli@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(typescript@5.9.0-beta)': + dependencies: + '@angular/compiler': 20.2.0-next.1 + '@babel/core': 7.28.0 + '@jridgewell/sourcemap-codec': 1.5.4 + chokidar: 4.0.3 + convert-source-map: 1.9.0 + reflect-metadata: 0.2.2 + semver: 7.7.2 + tslib: 2.8.1 + yargs: 18.0.0 + optionalDependencies: + typescript: 5.9.0-beta transitivePeerDependencies: - supports-color @@ -8482,6 +8569,10 @@ snapshots: dependencies: tslib: 2.8.1 + '@angular/compiler@20.2.0-next.1': + dependencies: + tslib: 2.8.1 + '@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)': dependencies: rxjs: 7.8.2 @@ -8490,18 +8581,26 @@ snapshots: '@angular/compiler': 20.2.0-next.0 zone.js: 0.15.1 - '@angular/forms@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.2.0-next.0(@angular/animations@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2)': + '@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)': dependencies: - '@angular/common': 20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) - '@angular/core': 20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1) - '@angular/platform-browser': 20.2.0-next.0(@angular/animations@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)) rxjs: 7.8.2 tslib: 2.8.1 + optionalDependencies: + '@angular/compiler': 20.2.0-next.1 + zone.js: 0.15.1 - '@angular/localize@20.2.0-next.0(@angular/compiler-cli@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(typescript@5.8.3))(@angular/compiler@20.2.0-next.0)': + '@angular/forms@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.2.0-next.1(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2)': dependencies: - '@angular/compiler': 20.2.0-next.0 - '@angular/compiler-cli': 20.2.0-next.0(@angular/compiler@20.2.0-next.0)(typescript@5.8.3) + '@angular/common': 20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) + '@angular/core': 20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1) + '@angular/platform-browser': 20.2.0-next.1(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)) + rxjs: 7.8.2 + tslib: 2.8.1 + + '@angular/localize@20.2.0-next.1(@angular/compiler-cli@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(typescript@5.9.0-beta))(@angular/compiler@20.2.0-next.1)': + dependencies: + '@angular/compiler': 20.2.0-next.1 + '@angular/compiler-cli': 20.2.0-next.1(@angular/compiler@20.2.0-next.1)(typescript@5.9.0-beta) '@babel/core': 7.28.0 '@types/babel__core': 7.20.5 tinyglobby: 0.2.14 @@ -8509,13 +8608,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@angular/material@20.1.0-rc.0(difxyzoi5ta3rok2swggpxhcoq)': + '@angular/material@20.1.0-rc.0(cduru5ovfso2xbyofiyvo3xmyu)': dependencies: - '@angular/cdk': 20.1.0-rc.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) - '@angular/common': 20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) - '@angular/core': 20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1) - '@angular/forms': 20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.2.0-next.0(@angular/animations@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2) - '@angular/platform-browser': 20.2.0-next.0(@angular/animations@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)) + '@angular/cdk': 20.1.0-rc.0(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) + '@angular/common': 20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) + '@angular/core': 20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1) + '@angular/forms': 20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.2.0-next.1(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2) + '@angular/platform-browser': 20.2.0-next.1(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)) rxjs: 7.8.2 tslib: 2.8.1 @@ -8531,7 +8630,7 @@ snapshots: semver: 7.7.2 supports-color: 10.0.0 typed-graphqlify: 3.1.6 - typescript: 5.8.3 + typescript: 5.9.0-beta which: 5.0.0 yaml: 2.8.0 transitivePeerDependencies: @@ -8540,35 +8639,61 @@ snapshots: - encoding - utf-8-validate - '@angular/platform-browser@20.2.0-next.0(@angular/animations@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))': + '@angular/platform-browser@20.2.0-next.0(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))': dependencies: '@angular/common': 20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) '@angular/core': 20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1) tslib: 2.8.1 optionalDependencies: - '@angular/animations': 20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)) + '@angular/animations': 20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)) - '@angular/platform-server@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/compiler@20.2.0-next.0)(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.2.0-next.0(@angular/animations@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2)': + '@angular/platform-browser@20.2.0-next.1(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))': + dependencies: + '@angular/common': 20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) + '@angular/core': 20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1) + tslib: 2.8.1 + optionalDependencies: + '@angular/animations': 20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)) + + '@angular/platform-server@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/compiler@20.2.0-next.0)(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.2.0-next.0(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2)': dependencies: '@angular/common': 20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) '@angular/compiler': 20.2.0-next.0 '@angular/core': 20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1) - '@angular/platform-browser': 20.2.0-next.0(@angular/animations@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)) + '@angular/platform-browser': 20.2.0-next.0(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)) rxjs: 7.8.2 tslib: 2.8.1 xhr2: 0.2.1 - '@angular/router@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.2.0-next.0(@angular/animations@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2)': + '@angular/platform-server@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/compiler@20.2.0-next.1)(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.2.0-next.1(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2)': + dependencies: + '@angular/common': 20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) + '@angular/compiler': 20.2.0-next.1 + '@angular/core': 20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1) + '@angular/platform-browser': 20.2.0-next.1(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)) + rxjs: 7.8.2 + tslib: 2.8.1 + xhr2: 0.2.1 + + '@angular/router@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.2.0-next.0(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2)': dependencies: '@angular/common': 20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) '@angular/core': 20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1) - '@angular/platform-browser': 20.2.0-next.0(@angular/animations@20.2.0-next.0(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)) + '@angular/platform-browser': 20.2.0-next.0(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1)) rxjs: 7.8.2 tslib: 2.8.1 - '@angular/service-worker@20.2.0-next.0(@angular/core@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2)': + '@angular/router@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@20.2.0-next.1(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(rxjs@7.8.2)': dependencies: - '@angular/core': 20.2.0-next.0(@angular/compiler@20.2.0-next.0)(rxjs@7.8.2)(zone.js@0.15.1) + '@angular/common': 20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2) + '@angular/core': 20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1) + '@angular/platform-browser': 20.2.0-next.1(@angular/animations@20.2.0-next.1(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1)) + rxjs: 7.8.2 + tslib: 2.8.1 + + '@angular/service-worker@20.2.0-next.1(@angular/core@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2)': + dependencies: + '@angular/core': 20.2.0-next.1(@angular/compiler@20.2.0-next.1)(rxjs@7.8.2)(zone.js@0.15.1) rxjs: 7.8.2 tslib: 2.8.1 @@ -10628,41 +10753,41 @@ snapshots: '@types/node': 20.19.8 optional: true - '@typescript-eslint/eslint-plugin@8.37.0(@typescript-eslint/parser@8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.8.3))(eslint@9.31.0(jiti@1.21.7))(typescript@5.8.3)': + '@typescript-eslint/eslint-plugin@8.37.0(@typescript-eslint/parser@8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.9.0-beta))(eslint@9.31.0(jiti@1.21.7))(typescript@5.9.0-beta)': dependencies: '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.8.3) + '@typescript-eslint/parser': 8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.9.0-beta) '@typescript-eslint/scope-manager': 8.37.0 - '@typescript-eslint/type-utils': 8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.8.3) - '@typescript-eslint/utils': 8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.8.3) + '@typescript-eslint/type-utils': 8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.9.0-beta) + '@typescript-eslint/utils': 8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.9.0-beta) '@typescript-eslint/visitor-keys': 8.37.0 eslint: 9.31.0(jiti@1.21.7) graphemer: 1.4.0 ignore: 7.0.5 natural-compare: 1.4.0 - ts-api-utils: 2.1.0(typescript@5.8.3) - typescript: 5.8.3 + ts-api-utils: 2.1.0(typescript@5.9.0-beta) + typescript: 5.9.0-beta transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.8.3)': + '@typescript-eslint/parser@8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.9.0-beta)': dependencies: '@typescript-eslint/scope-manager': 8.37.0 '@typescript-eslint/types': 8.37.0 - '@typescript-eslint/typescript-estree': 8.37.0(typescript@5.8.3) + '@typescript-eslint/typescript-estree': 8.37.0(typescript@5.9.0-beta) '@typescript-eslint/visitor-keys': 8.37.0 debug: 4.4.1(supports-color@10.0.0) eslint: 9.31.0(jiti@1.21.7) - typescript: 5.8.3 + typescript: 5.9.0-beta transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.37.0(typescript@5.8.3)': + '@typescript-eslint/project-service@8.37.0(typescript@5.9.0-beta)': dependencies: - '@typescript-eslint/tsconfig-utils': 8.37.0(typescript@5.8.3) + '@typescript-eslint/tsconfig-utils': 8.37.0(typescript@5.9.0-beta) '@typescript-eslint/types': 8.37.0 debug: 4.4.1(supports-color@10.0.0) - typescript: 5.8.3 + typescript: 5.9.0-beta transitivePeerDependencies: - supports-color @@ -10671,28 +10796,28 @@ snapshots: '@typescript-eslint/types': 8.37.0 '@typescript-eslint/visitor-keys': 8.37.0 - '@typescript-eslint/tsconfig-utils@8.37.0(typescript@5.8.3)': + '@typescript-eslint/tsconfig-utils@8.37.0(typescript@5.9.0-beta)': dependencies: - typescript: 5.8.3 + typescript: 5.9.0-beta - '@typescript-eslint/type-utils@8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.8.3)': + '@typescript-eslint/type-utils@8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.9.0-beta)': dependencies: '@typescript-eslint/types': 8.37.0 - '@typescript-eslint/typescript-estree': 8.37.0(typescript@5.8.3) - '@typescript-eslint/utils': 8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.8.3) + '@typescript-eslint/typescript-estree': 8.37.0(typescript@5.9.0-beta) + '@typescript-eslint/utils': 8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.9.0-beta) debug: 4.4.1(supports-color@10.0.0) eslint: 9.31.0(jiti@1.21.7) - ts-api-utils: 2.1.0(typescript@5.8.3) - typescript: 5.8.3 + ts-api-utils: 2.1.0(typescript@5.9.0-beta) + typescript: 5.9.0-beta transitivePeerDependencies: - supports-color '@typescript-eslint/types@8.37.0': {} - '@typescript-eslint/typescript-estree@8.37.0(typescript@5.8.3)': + '@typescript-eslint/typescript-estree@8.37.0(typescript@5.9.0-beta)': dependencies: - '@typescript-eslint/project-service': 8.37.0(typescript@5.8.3) - '@typescript-eslint/tsconfig-utils': 8.37.0(typescript@5.8.3) + '@typescript-eslint/project-service': 8.37.0(typescript@5.9.0-beta) + '@typescript-eslint/tsconfig-utils': 8.37.0(typescript@5.9.0-beta) '@typescript-eslint/types': 8.37.0 '@typescript-eslint/visitor-keys': 8.37.0 debug: 4.4.1(supports-color@10.0.0) @@ -10700,19 +10825,19 @@ snapshots: is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.7.2 - ts-api-utils: 2.1.0(typescript@5.8.3) - typescript: 5.8.3 + ts-api-utils: 2.1.0(typescript@5.9.0-beta) + typescript: 5.9.0-beta transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.8.3)': + '@typescript-eslint/utils@8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.9.0-beta)': dependencies: '@eslint-community/eslint-utils': 4.7.0(eslint@9.31.0(jiti@1.21.7)) '@typescript-eslint/scope-manager': 8.37.0 '@typescript-eslint/types': 8.37.0 - '@typescript-eslint/typescript-estree': 8.37.0(typescript@5.8.3) + '@typescript-eslint/typescript-estree': 8.37.0(typescript@5.9.0-beta) eslint: 9.31.0(jiti@1.21.7) - typescript: 5.8.3 + typescript: 5.9.0-beta transitivePeerDependencies: - supports-color @@ -12001,14 +12126,14 @@ snapshots: object-assign: 4.1.1 vary: 1.1.2 - cosmiconfig@9.0.0(typescript@5.8.3): + cosmiconfig@9.0.0(typescript@5.9.0-beta): dependencies: env-paths: 2.2.1 import-fresh: 3.3.1 js-yaml: 4.1.0 parse-json: 5.2.0 optionalDependencies: - typescript: 5.8.3 + typescript: 5.9.0-beta create-require@1.1.1: {} @@ -12527,11 +12652,11 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.1(@typescript-eslint/parser@8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint@9.31.0(jiti@1.21.7)): + eslint-module-utils@2.12.1(@typescript-eslint/parser@8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.9.0-beta))(eslint-import-resolver-node@0.3.9)(eslint@9.31.0(jiti@1.21.7)): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.8.3) + '@typescript-eslint/parser': 8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.9.0-beta) eslint: 9.31.0(jiti@1.21.7) eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: @@ -12541,7 +12666,7 @@ snapshots: dependencies: eslint: 9.31.0(jiti@1.21.7) - eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.8.3))(eslint@9.31.0(jiti@1.21.7)): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.9.0-beta))(eslint@9.31.0(jiti@1.21.7)): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9 @@ -12552,7 +12677,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.31.0(jiti@1.21.7) eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint@9.31.0(jiti@1.21.7)) + eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.9.0-beta))(eslint-import-resolver-node@0.3.9)(eslint@9.31.0(jiti@1.21.7)) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -12564,7 +12689,7 @@ snapshots: string.prototype.trimend: 1.0.9 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.8.3) + '@typescript-eslint/parser': 8.37.0(eslint@9.31.0(jiti@1.21.7))(typescript@5.9.0-beta) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -14475,10 +14600,10 @@ snapshots: netmask@2.0.2: {} - ng-packagr@20.1.0-rc.0(@angular/compiler-cli@20.2.0-next.0(@angular/compiler@20.2.0-next.0)(typescript@5.8.3))(tslib@2.8.1)(typescript@5.8.3): + ng-packagr@20.1.0-rc.0(@angular/compiler-cli@20.2.0-next.1(@angular/compiler@20.2.0-next.1)(typescript@5.9.0-beta))(tslib@2.8.1)(typescript@5.9.0-beta): dependencies: '@ampproject/remapping': 2.3.0 - '@angular/compiler-cli': 20.2.0-next.0(@angular/compiler@20.2.0-next.0)(typescript@5.8.3) + '@angular/compiler-cli': 20.2.0-next.1(@angular/compiler@20.2.0-next.1)(typescript@5.9.0-beta) '@rollup/plugin-json': 6.1.0(rollup@4.45.1) '@rollup/wasm-node': 4.45.1 ajv: 8.17.1 @@ -14495,12 +14620,12 @@ snapshots: ora: 8.2.0 piscina: 5.1.3 postcss: 8.5.6 - rollup-plugin-dts: 6.2.1(rollup@4.45.1)(typescript@5.8.3) + rollup-plugin-dts: 6.2.1(rollup@4.45.1)(typescript@5.9.0-beta) rxjs: 7.8.2 sass: 1.89.2 tinyglobby: 0.2.14 tslib: 2.8.1 - typescript: 5.8.3 + typescript: 5.9.0-beta optionalDependencies: rollup: 4.45.1 @@ -14969,9 +15094,9 @@ snapshots: possible-typed-array-names@1.1.0: {} - postcss-loader@8.1.1(postcss@8.5.6)(typescript@5.8.3)(webpack@5.100.2(esbuild@0.25.6)): + postcss-loader@8.1.1(postcss@8.5.6)(typescript@5.9.0-beta)(webpack@5.100.2(esbuild@0.25.6)): dependencies: - cosmiconfig: 9.0.0(typescript@5.8.3) + cosmiconfig: 9.0.0(typescript@5.9.0-beta) jiti: 1.21.7 postcss: 8.5.6 semver: 7.7.2 @@ -15408,11 +15533,11 @@ snapshots: node-fetch: 3.3.2 spdx-expression-validate: 2.0.0 - rollup-plugin-dts@6.2.1(rollup@4.45.1)(typescript@5.8.3): + rollup-plugin-dts@6.2.1(rollup@4.45.1)(typescript@5.9.0-beta): dependencies: magic-string: 0.30.17 rollup: 4.45.1 - typescript: 5.8.3 + typescript: 5.9.0-beta optionalDependencies: '@babel/code-frame': 7.27.1 @@ -16221,11 +16346,11 @@ snapshots: tree-kill@1.2.2: {} - ts-api-utils@2.1.0(typescript@5.8.3): + ts-api-utils@2.1.0(typescript@5.9.0-beta): dependencies: - typescript: 5.8.3 + typescript: 5.9.0-beta - ts-node@10.9.2(@types/node@20.19.8)(typescript@5.8.3): + ts-node@10.9.2(@types/node@20.19.8)(typescript@5.9.0-beta): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 @@ -16239,7 +16364,7 @@ snapshots: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.8.3 + typescript: 5.9.0-beta v8-compile-cache-lib: 3.0.1 yn: 3.1.1 @@ -16326,7 +16451,7 @@ snapshots: typed-query-selector@2.12.0: {} - typescript@5.8.3: {} + typescript@5.9.0-beta: {} typical@4.0.0: {}