typescript 6.0.0-dev.20250930 → 6.0.0-dev.20251002
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.
- package/lib/_tsc.js +127 -19
- package/lib/typescript.d.ts +1 -0
- package/lib/typescript.js +145 -24
- package/package.json +2 -2
package/lib/_tsc.js
CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
18
18
|
|
19
19
|
// src/compiler/corePublic.ts
|
20
20
|
var versionMajorMinor = "6.0";
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20251002`;
|
22
22
|
|
23
23
|
// src/compiler/core.ts
|
24
24
|
var emptyArray = [];
|
@@ -7010,6 +7010,7 @@ var Diagnostics = {
|
|
7010
7010
|
Option_0_1_has_been_removed_Please_remove_it_from_your_configuration: diag(5108, 1 /* Error */, "Option_0_1_has_been_removed_Please_remove_it_from_your_configuration_5108", "Option '{0}={1}' has been removed. Please remove it from your configuration."),
|
7011
7011
|
Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1: diag(5109, 1 /* Error */, "Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1_5109", "Option 'moduleResolution' must be set to '{0}' (or left unspecified) when option 'module' is set to '{1}'."),
|
7012
7012
|
Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1: diag(5110, 1 /* Error */, "Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1_5110", "Option 'module' must be set to '{0}' when option 'moduleResolution' is set to '{1}'."),
|
7013
|
+
Visit_https_Colon_Slash_Slashaka_ms_Slashts6_for_migration_information: diag(5111, 3 /* Message */, "Visit_https_Colon_Slash_Slashaka_ms_Slashts6_for_migration_information_5111", "Visit https://aka.ms/ts6 for migration information."),
|
7013
7014
|
Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3 /* Message */, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."),
|
7014
7015
|
Concatenate_and_emit_output_to_single_file: diag(6001, 3 /* Message */, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."),
|
7015
7016
|
Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."),
|
@@ -15492,6 +15493,9 @@ function getTypeParameterFromJsDoc(node) {
|
|
15492
15493
|
const { typeParameters } = node.parent.parent.parent;
|
15493
15494
|
return typeParameters && find(typeParameters, (p) => p.name.escapedText === name);
|
15494
15495
|
}
|
15496
|
+
function hasTypeArguments(node) {
|
15497
|
+
return !!node.typeArguments;
|
15498
|
+
}
|
15495
15499
|
function getAssignmentTarget(node) {
|
15496
15500
|
let parent = node.parent;
|
15497
15501
|
while (true) {
|
@@ -67453,7 +67457,7 @@ function createTypeChecker(host) {
|
|
67453
67457
|
if (isReadonlySymbol(sourceProp) !== isReadonlySymbol(targetProp)) {
|
67454
67458
|
return 0 /* False */;
|
67455
67459
|
}
|
67456
|
-
return compareTypes(
|
67460
|
+
return compareTypes(getNonMissingTypeOfSymbol(sourceProp), getNonMissingTypeOfSymbol(targetProp));
|
67457
67461
|
}
|
67458
67462
|
function isMatchingSignature(source, target, partialMatch) {
|
67459
67463
|
const sourceParameterCount = getParameterCount(source);
|
@@ -81598,6 +81602,47 @@ function createTypeChecker(host) {
|
|
81598
81602
|
}
|
81599
81603
|
return void 0;
|
81600
81604
|
}
|
81605
|
+
function getUninstantiatedSignatures(node) {
|
81606
|
+
switch (node.kind) {
|
81607
|
+
case 214 /* CallExpression */:
|
81608
|
+
case 171 /* Decorator */:
|
81609
|
+
return getSignaturesOfType(
|
81610
|
+
getTypeOfExpression(node.expression),
|
81611
|
+
0 /* Call */
|
81612
|
+
);
|
81613
|
+
case 215 /* NewExpression */:
|
81614
|
+
return getSignaturesOfType(
|
81615
|
+
getTypeOfExpression(node.expression),
|
81616
|
+
1 /* Construct */
|
81617
|
+
);
|
81618
|
+
case 286 /* JsxSelfClosingElement */:
|
81619
|
+
case 287 /* JsxOpeningElement */:
|
81620
|
+
if (isJsxIntrinsicTagName(node.tagName)) return [];
|
81621
|
+
return getSignaturesOfType(
|
81622
|
+
getTypeOfExpression(node.tagName),
|
81623
|
+
0 /* Call */
|
81624
|
+
);
|
81625
|
+
case 216 /* TaggedTemplateExpression */:
|
81626
|
+
return getSignaturesOfType(
|
81627
|
+
getTypeOfExpression(node.tag),
|
81628
|
+
0 /* Call */
|
81629
|
+
);
|
81630
|
+
case 227 /* BinaryExpression */:
|
81631
|
+
case 290 /* JsxOpeningFragment */:
|
81632
|
+
return [];
|
81633
|
+
}
|
81634
|
+
}
|
81635
|
+
function getTypeParameterConstraintForPositionAcrossSignatures(signatures, position) {
|
81636
|
+
const relevantTypeParameterConstraints = flatMap(signatures, (signature) => {
|
81637
|
+
var _a;
|
81638
|
+
const relevantTypeParameter = (_a = signature.typeParameters) == null ? void 0 : _a[position];
|
81639
|
+
if (relevantTypeParameter === void 0) return [];
|
81640
|
+
const relevantConstraint = getConstraintOfTypeParameter(relevantTypeParameter);
|
81641
|
+
if (relevantConstraint === void 0) return [];
|
81642
|
+
return [relevantConstraint];
|
81643
|
+
});
|
81644
|
+
return getUnionType(relevantTypeParameterConstraints);
|
81645
|
+
}
|
81601
81646
|
function checkTypeReferenceNode(node) {
|
81602
81647
|
checkGrammarTypeArguments(node, node.typeArguments);
|
81603
81648
|
if (node.kind === 184 /* TypeReference */ && !isInJSFile(node) && !isInJSDoc(node) && node.typeArguments && node.typeName.end !== node.typeArguments.pos) {
|
@@ -81633,12 +81678,48 @@ function createTypeChecker(host) {
|
|
81633
81678
|
}
|
81634
81679
|
}
|
81635
81680
|
function getTypeArgumentConstraint(node) {
|
81636
|
-
|
81637
|
-
if (
|
81638
|
-
|
81639
|
-
|
81640
|
-
|
81641
|
-
|
81681
|
+
let typeArgumentPosition;
|
81682
|
+
if (hasTypeArguments(node.parent) && Array.isArray(node.parent.typeArguments)) {
|
81683
|
+
typeArgumentPosition = node.parent.typeArguments.indexOf(node);
|
81684
|
+
}
|
81685
|
+
if (typeArgumentPosition !== void 0) {
|
81686
|
+
if (isCallLikeExpression(node.parent)) {
|
81687
|
+
return getTypeParameterConstraintForPositionAcrossSignatures(
|
81688
|
+
getUninstantiatedSignatures(node.parent),
|
81689
|
+
typeArgumentPosition
|
81690
|
+
);
|
81691
|
+
}
|
81692
|
+
if (isDecorator(node.parent.parent)) {
|
81693
|
+
return getTypeParameterConstraintForPositionAcrossSignatures(
|
81694
|
+
getUninstantiatedSignatures(node.parent.parent),
|
81695
|
+
typeArgumentPosition
|
81696
|
+
);
|
81697
|
+
}
|
81698
|
+
if (isExpressionWithTypeArguments(node.parent) && isExpressionStatement(node.parent.parent)) {
|
81699
|
+
const uninstantiatedType = checkExpression(node.parent.expression);
|
81700
|
+
const callConstraint = getTypeParameterConstraintForPositionAcrossSignatures(
|
81701
|
+
getSignaturesOfType(uninstantiatedType, 0 /* Call */),
|
81702
|
+
typeArgumentPosition
|
81703
|
+
);
|
81704
|
+
const constructConstraint = getTypeParameterConstraintForPositionAcrossSignatures(
|
81705
|
+
getSignaturesOfType(uninstantiatedType, 1 /* Construct */),
|
81706
|
+
typeArgumentPosition
|
81707
|
+
);
|
81708
|
+
if (constructConstraint.flags & 131072 /* Never */) return callConstraint;
|
81709
|
+
if (callConstraint.flags & 131072 /* Never */) return constructConstraint;
|
81710
|
+
return getIntersectionType([callConstraint, constructConstraint]);
|
81711
|
+
}
|
81712
|
+
if (isTypeReferenceType(node.parent)) {
|
81713
|
+
const typeParameters = getTypeParametersForTypeReferenceOrImport(node.parent);
|
81714
|
+
if (!typeParameters) return void 0;
|
81715
|
+
const relevantTypeParameter = typeParameters[typeArgumentPosition];
|
81716
|
+
const constraint = getConstraintOfTypeParameter(relevantTypeParameter);
|
81717
|
+
return constraint && instantiateType(
|
81718
|
+
constraint,
|
81719
|
+
createTypeMapper(typeParameters, getEffectiveTypeArguments(node.parent, typeParameters))
|
81720
|
+
);
|
81721
|
+
}
|
81722
|
+
}
|
81642
81723
|
}
|
81643
81724
|
function checkTypeQuery(node) {
|
81644
81725
|
getTypeFromTypeQueryNode(node);
|
@@ -124495,32 +124576,35 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
124495
124576
|
const mustBeRemoved = !(removedInVersion.compareTo(typescriptVersion) === 1 /* GreaterThan */);
|
124496
124577
|
const canBeSilenced = !mustBeRemoved && ignoreDeprecationsVersion.compareTo(deprecatedInVersion) === -1 /* LessThan */;
|
124497
124578
|
if (mustBeRemoved || canBeSilenced) {
|
124498
|
-
fn((name, value, useInstead) => {
|
124579
|
+
fn((name, value, useInstead, related) => {
|
124499
124580
|
if (mustBeRemoved) {
|
124500
124581
|
if (value === void 0) {
|
124501
|
-
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_has_been_removed_Please_remove_it_from_your_configuration, name);
|
124582
|
+
createDiagnostic(name, value, useInstead, related, Diagnostics.Option_0_has_been_removed_Please_remove_it_from_your_configuration, name);
|
124502
124583
|
} else {
|
124503
|
-
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_has_been_removed_Please_remove_it_from_your_configuration, name, value);
|
124584
|
+
createDiagnostic(name, value, useInstead, related, Diagnostics.Option_0_1_has_been_removed_Please_remove_it_from_your_configuration, name, value);
|
124504
124585
|
}
|
124505
124586
|
} else {
|
124506
124587
|
if (value === void 0) {
|
124507
|
-
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, name, removedIn, deprecatedIn);
|
124588
|
+
createDiagnostic(name, value, useInstead, related, Diagnostics.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, name, removedIn, deprecatedIn);
|
124508
124589
|
} else {
|
124509
|
-
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error, name, value, removedIn, deprecatedIn);
|
124590
|
+
createDiagnostic(name, value, useInstead, related, Diagnostics.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error, name, value, removedIn, deprecatedIn);
|
124510
124591
|
}
|
124511
124592
|
}
|
124512
124593
|
});
|
124513
124594
|
}
|
124514
124595
|
}
|
124515
124596
|
function verifyDeprecatedCompilerOptions() {
|
124516
|
-
function createDiagnostic(name, value, useInstead, message, ...args) {
|
124597
|
+
function createDiagnostic(name, value, useInstead, related, message, ...args) {
|
124517
124598
|
if (useInstead) {
|
124518
|
-
|
124599
|
+
let details = chainDiagnosticMessages(
|
124519
124600
|
/*details*/
|
124520
124601
|
void 0,
|
124521
124602
|
Diagnostics.Use_0_instead,
|
124522
124603
|
useInstead
|
124523
124604
|
);
|
124605
|
+
if (related) {
|
124606
|
+
details = chainDiagnosticMessages(details, related);
|
124607
|
+
}
|
124524
124608
|
const chain = chainDiagnosticMessages(details, message, ...args);
|
124525
124609
|
createDiagnosticForOption(
|
124526
124610
|
/*onKey*/
|
@@ -124531,14 +124615,22 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
124531
124615
|
chain
|
124532
124616
|
);
|
124533
124617
|
} else {
|
124618
|
+
let details;
|
124619
|
+
if (related) {
|
124620
|
+
details = chainDiagnosticMessages(
|
124621
|
+
/*details*/
|
124622
|
+
void 0,
|
124623
|
+
related
|
124624
|
+
);
|
124625
|
+
}
|
124626
|
+
const chain = chainDiagnosticMessages(details, message, ...args);
|
124534
124627
|
createDiagnosticForOption(
|
124535
124628
|
/*onKey*/
|
124536
124629
|
!value,
|
124537
124630
|
name,
|
124538
124631
|
/*option2*/
|
124539
124632
|
void 0,
|
124540
|
-
|
124541
|
-
...args
|
124633
|
+
chain
|
124542
124634
|
);
|
124543
124635
|
}
|
124544
124636
|
}
|
@@ -124591,12 +124683,28 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
124591
124683
|
});
|
124592
124684
|
checkDeprecations("6.0", "7.0", createDiagnostic, (createDeprecatedDiagnostic) => {
|
124593
124685
|
if (options.moduleResolution === 2 /* Node10 */) {
|
124594
|
-
createDeprecatedDiagnostic(
|
124686
|
+
createDeprecatedDiagnostic(
|
124687
|
+
"moduleResolution",
|
124688
|
+
"node10",
|
124689
|
+
/*useInstead*/
|
124690
|
+
void 0,
|
124691
|
+
Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashts6_for_migration_information
|
124692
|
+
);
|
124693
|
+
}
|
124694
|
+
if (options.baseUrl !== void 0) {
|
124695
|
+
createDeprecatedDiagnostic(
|
124696
|
+
"baseUrl",
|
124697
|
+
/*value*/
|
124698
|
+
void 0,
|
124699
|
+
/*useInstead*/
|
124700
|
+
void 0,
|
124701
|
+
Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashts6_for_migration_information
|
124702
|
+
);
|
124595
124703
|
}
|
124596
124704
|
});
|
124597
124705
|
}
|
124598
124706
|
function verifyDeprecatedProjectReference(ref, parentFile, index) {
|
124599
|
-
function createDiagnostic(_name, _value, _useInstead, message, ...args) {
|
124707
|
+
function createDiagnostic(_name, _value, _useInstead, _related, message, ...args) {
|
124600
124708
|
createDiagnosticForReference(parentFile, index, message, ...args);
|
124601
124709
|
}
|
124602
124710
|
checkDeprecations("5.0", "5.5", createDiagnostic, (createDeprecatedDiagnostic) => {
|
package/lib/typescript.d.ts
CHANGED
package/lib/typescript.js
CHANGED
@@ -2286,7 +2286,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
2286
2286
|
|
2287
2287
|
// src/compiler/corePublic.ts
|
2288
2288
|
var versionMajorMinor = "6.0";
|
2289
|
-
var version = `${versionMajorMinor}.0-dev.
|
2289
|
+
var version = `${versionMajorMinor}.0-dev.20251002`;
|
2290
2290
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
2291
2291
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
2292
2292
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
@@ -10397,6 +10397,7 @@ var Diagnostics = {
|
|
10397
10397
|
Option_0_1_has_been_removed_Please_remove_it_from_your_configuration: diag(5108, 1 /* Error */, "Option_0_1_has_been_removed_Please_remove_it_from_your_configuration_5108", "Option '{0}={1}' has been removed. Please remove it from your configuration."),
|
10398
10398
|
Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1: diag(5109, 1 /* Error */, "Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1_5109", "Option 'moduleResolution' must be set to '{0}' (or left unspecified) when option 'module' is set to '{1}'."),
|
10399
10399
|
Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1: diag(5110, 1 /* Error */, "Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1_5110", "Option 'module' must be set to '{0}' when option 'moduleResolution' is set to '{1}'."),
|
10400
|
+
Visit_https_Colon_Slash_Slashaka_ms_Slashts6_for_migration_information: diag(5111, 3 /* Message */, "Visit_https_Colon_Slash_Slashaka_ms_Slashts6_for_migration_information_5111", "Visit https://aka.ms/ts6 for migration information."),
|
10400
10401
|
Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3 /* Message */, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."),
|
10401
10402
|
Concatenate_and_emit_output_to_single_file: diag(6001, 3 /* Message */, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."),
|
10402
10403
|
Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."),
|
@@ -72062,7 +72063,7 @@ function createTypeChecker(host) {
|
|
72062
72063
|
if (isReadonlySymbol(sourceProp) !== isReadonlySymbol(targetProp)) {
|
72063
72064
|
return 0 /* False */;
|
72064
72065
|
}
|
72065
|
-
return compareTypes(
|
72066
|
+
return compareTypes(getNonMissingTypeOfSymbol(sourceProp), getNonMissingTypeOfSymbol(targetProp));
|
72066
72067
|
}
|
72067
72068
|
function isMatchingSignature(source, target, partialMatch) {
|
72068
72069
|
const sourceParameterCount = getParameterCount(source);
|
@@ -86207,6 +86208,47 @@ function createTypeChecker(host) {
|
|
86207
86208
|
}
|
86208
86209
|
return void 0;
|
86209
86210
|
}
|
86211
|
+
function getUninstantiatedSignatures(node) {
|
86212
|
+
switch (node.kind) {
|
86213
|
+
case 214 /* CallExpression */:
|
86214
|
+
case 171 /* Decorator */:
|
86215
|
+
return getSignaturesOfType(
|
86216
|
+
getTypeOfExpression(node.expression),
|
86217
|
+
0 /* Call */
|
86218
|
+
);
|
86219
|
+
case 215 /* NewExpression */:
|
86220
|
+
return getSignaturesOfType(
|
86221
|
+
getTypeOfExpression(node.expression),
|
86222
|
+
1 /* Construct */
|
86223
|
+
);
|
86224
|
+
case 286 /* JsxSelfClosingElement */:
|
86225
|
+
case 287 /* JsxOpeningElement */:
|
86226
|
+
if (isJsxIntrinsicTagName(node.tagName)) return [];
|
86227
|
+
return getSignaturesOfType(
|
86228
|
+
getTypeOfExpression(node.tagName),
|
86229
|
+
0 /* Call */
|
86230
|
+
);
|
86231
|
+
case 216 /* TaggedTemplateExpression */:
|
86232
|
+
return getSignaturesOfType(
|
86233
|
+
getTypeOfExpression(node.tag),
|
86234
|
+
0 /* Call */
|
86235
|
+
);
|
86236
|
+
case 227 /* BinaryExpression */:
|
86237
|
+
case 290 /* JsxOpeningFragment */:
|
86238
|
+
return [];
|
86239
|
+
}
|
86240
|
+
}
|
86241
|
+
function getTypeParameterConstraintForPositionAcrossSignatures(signatures, position) {
|
86242
|
+
const relevantTypeParameterConstraints = flatMap(signatures, (signature) => {
|
86243
|
+
var _a;
|
86244
|
+
const relevantTypeParameter = (_a = signature.typeParameters) == null ? void 0 : _a[position];
|
86245
|
+
if (relevantTypeParameter === void 0) return [];
|
86246
|
+
const relevantConstraint = getConstraintOfTypeParameter(relevantTypeParameter);
|
86247
|
+
if (relevantConstraint === void 0) return [];
|
86248
|
+
return [relevantConstraint];
|
86249
|
+
});
|
86250
|
+
return getUnionType(relevantTypeParameterConstraints);
|
86251
|
+
}
|
86210
86252
|
function checkTypeReferenceNode(node) {
|
86211
86253
|
checkGrammarTypeArguments(node, node.typeArguments);
|
86212
86254
|
if (node.kind === 184 /* TypeReference */ && !isInJSFile(node) && !isInJSDoc(node) && node.typeArguments && node.typeName.end !== node.typeArguments.pos) {
|
@@ -86242,12 +86284,48 @@ function createTypeChecker(host) {
|
|
86242
86284
|
}
|
86243
86285
|
}
|
86244
86286
|
function getTypeArgumentConstraint(node) {
|
86245
|
-
|
86246
|
-
if (
|
86247
|
-
|
86248
|
-
|
86249
|
-
|
86250
|
-
|
86287
|
+
let typeArgumentPosition;
|
86288
|
+
if (hasTypeArguments(node.parent) && Array.isArray(node.parent.typeArguments)) {
|
86289
|
+
typeArgumentPosition = node.parent.typeArguments.indexOf(node);
|
86290
|
+
}
|
86291
|
+
if (typeArgumentPosition !== void 0) {
|
86292
|
+
if (isCallLikeExpression(node.parent)) {
|
86293
|
+
return getTypeParameterConstraintForPositionAcrossSignatures(
|
86294
|
+
getUninstantiatedSignatures(node.parent),
|
86295
|
+
typeArgumentPosition
|
86296
|
+
);
|
86297
|
+
}
|
86298
|
+
if (isDecorator(node.parent.parent)) {
|
86299
|
+
return getTypeParameterConstraintForPositionAcrossSignatures(
|
86300
|
+
getUninstantiatedSignatures(node.parent.parent),
|
86301
|
+
typeArgumentPosition
|
86302
|
+
);
|
86303
|
+
}
|
86304
|
+
if (isExpressionWithTypeArguments(node.parent) && isExpressionStatement(node.parent.parent)) {
|
86305
|
+
const uninstantiatedType = checkExpression(node.parent.expression);
|
86306
|
+
const callConstraint = getTypeParameterConstraintForPositionAcrossSignatures(
|
86307
|
+
getSignaturesOfType(uninstantiatedType, 0 /* Call */),
|
86308
|
+
typeArgumentPosition
|
86309
|
+
);
|
86310
|
+
const constructConstraint = getTypeParameterConstraintForPositionAcrossSignatures(
|
86311
|
+
getSignaturesOfType(uninstantiatedType, 1 /* Construct */),
|
86312
|
+
typeArgumentPosition
|
86313
|
+
);
|
86314
|
+
if (constructConstraint.flags & 131072 /* Never */) return callConstraint;
|
86315
|
+
if (callConstraint.flags & 131072 /* Never */) return constructConstraint;
|
86316
|
+
return getIntersectionType([callConstraint, constructConstraint]);
|
86317
|
+
}
|
86318
|
+
if (isTypeReferenceType(node.parent)) {
|
86319
|
+
const typeParameters = getTypeParametersForTypeReferenceOrImport(node.parent);
|
86320
|
+
if (!typeParameters) return void 0;
|
86321
|
+
const relevantTypeParameter = typeParameters[typeArgumentPosition];
|
86322
|
+
const constraint = getConstraintOfTypeParameter(relevantTypeParameter);
|
86323
|
+
return constraint && instantiateType(
|
86324
|
+
constraint,
|
86325
|
+
createTypeMapper(typeParameters, getEffectiveTypeArguments2(node.parent, typeParameters))
|
86326
|
+
);
|
86327
|
+
}
|
86328
|
+
}
|
86251
86329
|
}
|
86252
86330
|
function checkTypeQuery(node) {
|
86253
86331
|
getTypeFromTypeQueryNode(node);
|
@@ -129343,32 +129421,35 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
129343
129421
|
const mustBeRemoved = !(removedInVersion.compareTo(typescriptVersion) === 1 /* GreaterThan */);
|
129344
129422
|
const canBeSilenced = !mustBeRemoved && ignoreDeprecationsVersion.compareTo(deprecatedInVersion) === -1 /* LessThan */;
|
129345
129423
|
if (mustBeRemoved || canBeSilenced) {
|
129346
|
-
fn((name, value, useInstead) => {
|
129424
|
+
fn((name, value, useInstead, related) => {
|
129347
129425
|
if (mustBeRemoved) {
|
129348
129426
|
if (value === void 0) {
|
129349
|
-
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_has_been_removed_Please_remove_it_from_your_configuration, name);
|
129427
|
+
createDiagnostic(name, value, useInstead, related, Diagnostics.Option_0_has_been_removed_Please_remove_it_from_your_configuration, name);
|
129350
129428
|
} else {
|
129351
|
-
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_has_been_removed_Please_remove_it_from_your_configuration, name, value);
|
129429
|
+
createDiagnostic(name, value, useInstead, related, Diagnostics.Option_0_1_has_been_removed_Please_remove_it_from_your_configuration, name, value);
|
129352
129430
|
}
|
129353
129431
|
} else {
|
129354
129432
|
if (value === void 0) {
|
129355
|
-
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, name, removedIn, deprecatedIn);
|
129433
|
+
createDiagnostic(name, value, useInstead, related, Diagnostics.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, name, removedIn, deprecatedIn);
|
129356
129434
|
} else {
|
129357
|
-
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error, name, value, removedIn, deprecatedIn);
|
129435
|
+
createDiagnostic(name, value, useInstead, related, Diagnostics.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error, name, value, removedIn, deprecatedIn);
|
129358
129436
|
}
|
129359
129437
|
}
|
129360
129438
|
});
|
129361
129439
|
}
|
129362
129440
|
}
|
129363
129441
|
function verifyDeprecatedCompilerOptions() {
|
129364
|
-
function createDiagnostic(name, value, useInstead, message, ...args) {
|
129442
|
+
function createDiagnostic(name, value, useInstead, related, message, ...args) {
|
129365
129443
|
if (useInstead) {
|
129366
|
-
|
129444
|
+
let details = chainDiagnosticMessages(
|
129367
129445
|
/*details*/
|
129368
129446
|
void 0,
|
129369
129447
|
Diagnostics.Use_0_instead,
|
129370
129448
|
useInstead
|
129371
129449
|
);
|
129450
|
+
if (related) {
|
129451
|
+
details = chainDiagnosticMessages(details, related);
|
129452
|
+
}
|
129372
129453
|
const chain = chainDiagnosticMessages(details, message, ...args);
|
129373
129454
|
createDiagnosticForOption(
|
129374
129455
|
/*onKey*/
|
@@ -129379,14 +129460,22 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
129379
129460
|
chain
|
129380
129461
|
);
|
129381
129462
|
} else {
|
129463
|
+
let details;
|
129464
|
+
if (related) {
|
129465
|
+
details = chainDiagnosticMessages(
|
129466
|
+
/*details*/
|
129467
|
+
void 0,
|
129468
|
+
related
|
129469
|
+
);
|
129470
|
+
}
|
129471
|
+
const chain = chainDiagnosticMessages(details, message, ...args);
|
129382
129472
|
createDiagnosticForOption(
|
129383
129473
|
/*onKey*/
|
129384
129474
|
!value,
|
129385
129475
|
name,
|
129386
129476
|
/*option2*/
|
129387
129477
|
void 0,
|
129388
|
-
|
129389
|
-
...args
|
129478
|
+
chain
|
129390
129479
|
);
|
129391
129480
|
}
|
129392
129481
|
}
|
@@ -129439,12 +129528,28 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
129439
129528
|
});
|
129440
129529
|
checkDeprecations("6.0", "7.0", createDiagnostic, (createDeprecatedDiagnostic) => {
|
129441
129530
|
if (options.moduleResolution === 2 /* Node10 */) {
|
129442
|
-
createDeprecatedDiagnostic(
|
129531
|
+
createDeprecatedDiagnostic(
|
129532
|
+
"moduleResolution",
|
129533
|
+
"node10",
|
129534
|
+
/*useInstead*/
|
129535
|
+
void 0,
|
129536
|
+
Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashts6_for_migration_information
|
129537
|
+
);
|
129538
|
+
}
|
129539
|
+
if (options.baseUrl !== void 0) {
|
129540
|
+
createDeprecatedDiagnostic(
|
129541
|
+
"baseUrl",
|
129542
|
+
/*value*/
|
129543
|
+
void 0,
|
129544
|
+
/*useInstead*/
|
129545
|
+
void 0,
|
129546
|
+
Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashts6_for_migration_information
|
129547
|
+
);
|
129443
129548
|
}
|
129444
129549
|
});
|
129445
129550
|
}
|
129446
129551
|
function verifyDeprecatedProjectReference(ref, parentFile, index) {
|
129447
|
-
function createDiagnostic(_name, _value, _useInstead, message, ...args) {
|
129552
|
+
function createDiagnostic(_name, _value, _useInstead, _related, message, ...args) {
|
129448
129553
|
createDiagnosticForReference(parentFile, index, message, ...args);
|
129449
129554
|
}
|
129450
129555
|
checkDeprecations("5.0", "5.5", createDiagnostic, (createDeprecatedDiagnostic) => {
|
@@ -166696,6 +166801,7 @@ __export(ts_Completions_exports, {
|
|
166696
166801
|
getCompletionEntryDetails: () => getCompletionEntryDetails,
|
166697
166802
|
getCompletionEntrySymbol: () => getCompletionEntrySymbol,
|
166698
166803
|
getCompletionsAtPosition: () => getCompletionsAtPosition,
|
166804
|
+
getConstraintOfTypeArgumentProperty: () => getConstraintOfTypeArgumentProperty,
|
166699
166805
|
getDefaultCommitCharacters: () => getDefaultCommitCharacters,
|
166700
166806
|
getPropertiesForObjectExpression: () => getPropertiesForObjectExpression,
|
166701
166807
|
moduleSpecifierResolutionCacheAttemptLimit: () => moduleSpecifierResolutionCacheAttemptLimit,
|
@@ -169020,13 +169126,13 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
169020
169126
|
}
|
169021
169127
|
}
|
169022
169128
|
log("getCompletionData: Semantic work: " + (timestamp() - semanticStart));
|
169023
|
-
const
|
169129
|
+
const contextualTypeOrConstraint = previousToken && (getContextualType(previousToken, position, sourceFile, typeChecker) ?? getConstraintOfTypeArgumentProperty(previousToken, typeChecker));
|
169024
169130
|
const isLiteralExpected = !tryCast(previousToken, isStringLiteralLike) && !isJsxIdentifierExpected;
|
169025
169131
|
const literals = !isLiteralExpected ? [] : mapDefined(
|
169026
|
-
|
169132
|
+
contextualTypeOrConstraint && (contextualTypeOrConstraint.isUnion() ? contextualTypeOrConstraint.types : [contextualTypeOrConstraint]),
|
169027
169133
|
(t) => t.isLiteral() && !(t.flags & 1024 /* EnumLiteral */) ? t.value : void 0
|
169028
169134
|
);
|
169029
|
-
const recommendedCompletion = previousToken &&
|
169135
|
+
const recommendedCompletion = previousToken && contextualTypeOrConstraint && getRecommendedCompletion(previousToken, contextualTypeOrConstraint, typeChecker);
|
169030
169136
|
return {
|
169031
169137
|
kind: 0 /* Data */,
|
169032
169138
|
symbols,
|
@@ -170532,18 +170638,26 @@ function tryGetTypeLiteralNode(node) {
|
|
170532
170638
|
}
|
170533
170639
|
function getConstraintOfTypeArgumentProperty(node, checker) {
|
170534
170640
|
if (!node) return void 0;
|
170535
|
-
if (isTypeNode(node)
|
170536
|
-
|
170641
|
+
if (isTypeNode(node)) {
|
170642
|
+
const constraint = checker.getTypeArgumentConstraint(node);
|
170643
|
+
if (constraint) return constraint;
|
170537
170644
|
}
|
170538
170645
|
const t = getConstraintOfTypeArgumentProperty(node.parent, checker);
|
170539
170646
|
if (!t) return void 0;
|
170540
170647
|
switch (node.kind) {
|
170541
170648
|
case 172 /* PropertySignature */:
|
170542
170649
|
return checker.getTypeOfPropertyOfContextualType(t, node.symbol.escapedName);
|
170650
|
+
case 59 /* ColonToken */:
|
170651
|
+
if (node.parent.kind === 172 /* PropertySignature */) {
|
170652
|
+
return t;
|
170653
|
+
}
|
170654
|
+
break;
|
170543
170655
|
case 194 /* IntersectionType */:
|
170544
170656
|
case 188 /* TypeLiteral */:
|
170545
170657
|
case 193 /* UnionType */:
|
170546
170658
|
return t;
|
170659
|
+
case 23 /* OpenBracketToken */:
|
170660
|
+
return checker.getElementTypeOfArrayType(t);
|
170547
170661
|
}
|
170548
170662
|
}
|
170549
170663
|
function isFromObjectTypeDeclaration(node) {
|
@@ -171065,7 +171179,12 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, program,
|
|
171065
171179
|
}
|
171066
171180
|
function fromUnionableLiteralType(grandParent) {
|
171067
171181
|
switch (grandParent.kind) {
|
171182
|
+
case 214 /* CallExpression */:
|
171068
171183
|
case 234 /* ExpressionWithTypeArguments */:
|
171184
|
+
case 287 /* JsxOpeningElement */:
|
171185
|
+
case 286 /* JsxSelfClosingElement */:
|
171186
|
+
case 215 /* NewExpression */:
|
171187
|
+
case 216 /* TaggedTemplateExpression */:
|
171069
171188
|
case 184 /* TypeReference */: {
|
171070
171189
|
const typeArgument = findAncestor(parent2, (n) => n.parent === grandParent);
|
171071
171190
|
if (typeArgument) {
|
@@ -171079,6 +171198,8 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, program,
|
|
171079
171198
|
return void 0;
|
171080
171199
|
}
|
171081
171200
|
return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType));
|
171201
|
+
case 172 /* PropertySignature */:
|
171202
|
+
return { kind: 2 /* Types */, types: getStringLiteralTypes(getConstraintOfTypeArgumentProperty(grandParent, typeChecker)), isNewIdentifier: false };
|
171082
171203
|
case 193 /* UnionType */: {
|
171083
171204
|
const result = fromUnionableLiteralType(walkUpParentheses(grandParent.parent));
|
171084
171205
|
if (!result) {
|
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "typescript",
|
3
3
|
"author": "Microsoft Corp.",
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
5
|
-
"version": "6.0.0-dev.
|
5
|
+
"version": "6.0.0-dev.20251002",
|
6
6
|
"license": "Apache-2.0",
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
8
8
|
"keywords": [
|
@@ -115,5 +115,5 @@
|
|
115
115
|
"node": "20.1.0",
|
116
116
|
"npm": "8.19.4"
|
117
117
|
},
|
118
|
-
"gitHead": "
|
118
|
+
"gitHead": "837e3a1df996b505e1d376fa46166740b7ed5450"
|
119
119
|
}
|