typescript 7.1.0-dev.20260913.1 → 7.1.0-dev.20260916.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,7 @@ import { CompletionItemKind } from "#enums/completionItemKind";
4
4
  import { DiagnosticCategory } from "#enums/diagnosticCategory";
5
5
  import { ElementFlags } from "#enums/elementFlags";
6
6
  import { EmitOnly } from "#enums/emitOnly";
7
+ import { IndexKind } from "#enums/indexKind";
7
8
  import { JsxEmit } from "#enums/jsxEmit";
8
9
  import { ModuleKind } from "#enums/moduleKind";
9
10
  import { ModuleResolutionKind } from "#enums/moduleResolutionKind";
@@ -27,7 +28,7 @@ import { SourceFileCache } from "../sourceFileCache.js";
27
28
  import { Client, } from "./client.js";
28
29
  export { formatDiagnostics, formatDiagnosticsWithColorAndContext } from "../diagnosticFormatter.js";
29
30
  export { documentURIToFileName, fileNameToDocumentURI } from "../path.js";
30
- export { CheckFlags, CompletionItemKind, DiagnosticCategory, ElementFlags, EmitOnly, JsxEmit, ModifierFlags, ModuleKind, ModuleResolutionKind, NodeBuilderFlags, ObjectFlags, SignatureFlags, SignatureKind, SymbolFlags, TypeFlags, TypeFormatFlags, TypePredicateKind };
31
+ export { CheckFlags, CompletionItemKind, DiagnosticCategory, ElementFlags, EmitOnly, IndexKind, JsxEmit, ModifierFlags, ModuleKind, ModuleResolutionKind, NodeBuilderFlags, ObjectFlags, SignatureFlags, SignatureKind, SymbolFlags, TypeFlags, TypeFormatFlags, TypePredicateKind };
31
32
  export { all, defer } from "./generatorSupport.js";
32
33
  import { executeRequestGenerators, } from "./generatorSupport.js";
33
34
  export class API {
@@ -2471,6 +2472,44 @@ export class Checker {
2471
2472
  return data ? owner.objectRegistry.getOrCreateType(data) : undefined;
2472
2473
  });
2473
2474
  }
2475
+ get getContextualTypeForArgumentAtIndex() {
2476
+ const owner = this;
2477
+ return cacheGeneratorMethod(owner, "getContextualTypeForArgumentAtIndex", function (node, argIndex) {
2478
+ const data = owner.client.apiRequest("getContextualTypeForArgument", {
2479
+ snapshot: owner.snapshotId,
2480
+ project: owner.project.id,
2481
+ location: getNodeId(node),
2482
+ index: argIndex,
2483
+ });
2484
+ return data ? owner.objectRegistry.getOrCreateType(data) : undefined;
2485
+ }, function* (node, argIndex) {
2486
+ const data = yield* apiRequest("getContextualTypeForArgument", {
2487
+ snapshot: owner.snapshotId,
2488
+ project: owner.project.id,
2489
+ location: getNodeId(node),
2490
+ index: argIndex,
2491
+ });
2492
+ return data ? owner.objectRegistry.getOrCreateType(data) : undefined;
2493
+ });
2494
+ }
2495
+ get getAwaitedType() {
2496
+ const owner = this;
2497
+ return cacheGeneratorMethod(owner, "getAwaitedType", function (type) {
2498
+ const data = owner.client.apiRequest("getAwaitedType", {
2499
+ snapshot: owner.snapshotId,
2500
+ project: owner.project.id,
2501
+ type: type.id,
2502
+ });
2503
+ return data ? owner.objectRegistry.getOrCreateType(data) : undefined;
2504
+ }, function* (type) {
2505
+ const data = yield* apiRequest("getAwaitedType", {
2506
+ snapshot: owner.snapshotId,
2507
+ project: owner.project.id,
2508
+ type: type.id,
2509
+ });
2510
+ return data ? owner.objectRegistry.getOrCreateType(data) : undefined;
2511
+ });
2512
+ }
2474
2513
  /** Get the base type of a literal type (e.g. `number` for `42`). Always returns a type. */
2475
2514
  get getBaseTypeOfLiteralType() {
2476
2515
  const owner = this;
@@ -3016,6 +3055,76 @@ export class Checker {
3016
3055
  return yield* type.getIndexInfos.gen();
3017
3056
  });
3018
3057
  }
3058
+ get getIndexInfoOfType() {
3059
+ const owner = this;
3060
+ return cacheGeneratorMethod(owner, "getIndexInfoOfType", function (type, kind) {
3061
+ const data = owner.client.apiRequest("getIndexInfoOfType", {
3062
+ snapshot: owner.snapshotId,
3063
+ project: owner.project.id,
3064
+ type: type.id,
3065
+ kind,
3066
+ });
3067
+ return data ? {
3068
+ keyType: owner.objectRegistry.getOrCreateType(data.keyType),
3069
+ valueType: owner.objectRegistry.getOrCreateType(data.valueType),
3070
+ isReadonly: data.isReadonly ?? false,
3071
+ declaration: data.declaration ? new NodeHandle(data.declaration, owner.project) : undefined,
3072
+ } : undefined;
3073
+ }, function* (type, kind) {
3074
+ const data = yield* apiRequest("getIndexInfoOfType", {
3075
+ snapshot: owner.snapshotId,
3076
+ project: owner.project.id,
3077
+ type: type.id,
3078
+ kind,
3079
+ });
3080
+ return data ? {
3081
+ keyType: owner.objectRegistry.getOrCreateType(data.keyType),
3082
+ valueType: owner.objectRegistry.getOrCreateType(data.valueType),
3083
+ isReadonly: data.isReadonly ?? false,
3084
+ declaration: data.declaration ? new NodeHandle(data.declaration, owner.project) : undefined,
3085
+ } : undefined;
3086
+ });
3087
+ }
3088
+ get getIndexTypeOfType() {
3089
+ const owner = this;
3090
+ return cacheGeneratorMethod(owner, "getIndexTypeOfType", function (type, kind) {
3091
+ const data = owner.client.apiRequest("getIndexTypeOfTypeByKind", {
3092
+ snapshot: owner.snapshotId,
3093
+ project: owner.project.id,
3094
+ type: type.id,
3095
+ kind,
3096
+ });
3097
+ return data ? owner.objectRegistry.getOrCreateType(data) : undefined;
3098
+ }, function* (type, kind) {
3099
+ const data = yield* apiRequest("getIndexTypeOfTypeByKind", {
3100
+ snapshot: owner.snapshotId,
3101
+ project: owner.project.id,
3102
+ type: type.id,
3103
+ kind,
3104
+ });
3105
+ return data ? owner.objectRegistry.getOrCreateType(data) : undefined;
3106
+ });
3107
+ }
3108
+ get getTypeOfPropertyOfType() {
3109
+ const owner = this;
3110
+ return cacheGeneratorMethod(owner, "getTypeOfPropertyOfType", function (type, propertyName) {
3111
+ const data = owner.client.apiRequest("getTypeOfPropertyOfType", {
3112
+ snapshot: owner.snapshotId,
3113
+ project: owner.project.id,
3114
+ type: type.id,
3115
+ name: propertyName,
3116
+ });
3117
+ return data ? owner.objectRegistry.getOrCreateType(data) : undefined;
3118
+ }, function* (type, propertyName) {
3119
+ const data = yield* apiRequest("getTypeOfPropertyOfType", {
3120
+ snapshot: owner.snapshotId,
3121
+ project: owner.project.id,
3122
+ type: type.id,
3123
+ name: propertyName,
3124
+ });
3125
+ return data ? owner.objectRegistry.getOrCreateType(data) : undefined;
3126
+ });
3127
+ }
3019
3128
  /**
3020
3129
  * Get the constraint of a type parameter (the `T` in `<U extends T>`), or
3021
3130
  * undefined if it has none.
@@ -3217,6 +3326,24 @@ export class Checker {
3217
3326
  return symbol;
3218
3327
  });
3219
3328
  }
3329
+ get getExportSymbolOfSymbol() {
3330
+ const owner = this;
3331
+ return cacheGeneratorMethod(owner, "getExportSymbolOfSymbol", function (symbol) {
3332
+ const data = owner.client.apiRequest("getExportSymbolOfSymbolForChecker", {
3333
+ snapshot: owner.snapshotId,
3334
+ project: owner.project.id,
3335
+ symbol: symbol.id,
3336
+ });
3337
+ return owner.objectRegistry.getOrCreateSymbol(data);
3338
+ }, function* (symbol) {
3339
+ const data = yield* apiRequest("getExportSymbolOfSymbolForChecker", {
3340
+ snapshot: owner.snapshotId,
3341
+ project: owner.project.id,
3342
+ symbol: symbol.id,
3343
+ });
3344
+ return owner.objectRegistry.getOrCreateSymbol(data);
3345
+ });
3346
+ }
3220
3347
  /**
3221
3348
  * Fetch (once, then cache) the handle ids of the per-checker singleton
3222
3349
  * symbols (unknown, undefined, arguments). These ids are stable for the life
@@ -3656,6 +3783,7 @@ class TypeObject {
3656
3783
  typeParameters;
3657
3784
  outerTypeParameters;
3658
3785
  localTypeParameters;
3786
+ thisType;
3659
3787
  aliasTypeArguments;
3660
3788
  aliasSymbol;
3661
3789
  elementFlags;
@@ -3717,6 +3845,8 @@ class TypeObject {
3717
3845
  this.typeParameters = data.typeParameters ?? [];
3718
3846
  this.outerTypeParameters = data.outerTypeParameters ?? [];
3719
3847
  this.localTypeParameters = data.localTypeParameters ?? [];
3848
+ if (data.thisType !== undefined)
3849
+ this.thisType = data.thisType;
3720
3850
  this.aliasTypeArguments = data.aliasTypeArguments ?? [];
3721
3851
  if (data.aliasSymbol !== undefined)
3722
3852
  this.aliasSymbol = data.aliasSymbol;
@@ -4005,6 +4135,14 @@ class TypeObject {
4005
4135
  return (yield* owner.objectRegistry.fetchTypes.gen(owner, "getLocalTypeParametersOfType", owner.localTypeParameters));
4006
4136
  });
4007
4137
  }
4138
+ get getThisType() {
4139
+ const owner = this;
4140
+ return cacheGeneratorMethod(owner, "getThisType", function () {
4141
+ return owner.objectRegistry.fetchOptionalType(owner, "getThisTypeOfType", owner.thisType);
4142
+ }, function* () {
4143
+ return (yield* owner.objectRegistry.fetchOptionalType.gen(owner, "getThisTypeOfType", owner.thisType));
4144
+ });
4145
+ }
4008
4146
  get getAliasTypeArguments() {
4009
4147
  const owner = this;
4010
4148
  return cacheGeneratorMethod(owner, "getAliasTypeArguments", function () {