@typescript-deploys/pr-build 5.3.0-pr-56064-15 → 5.3.0-pr-56004-36
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/README.md +0 -1
- package/lib/tsc.js +59 -21
- package/lib/tsserver.js +110 -79
- package/lib/typescript.d.ts +0 -2
- package/lib/typescript.js +134 -102
- package/lib/typingsInstaller.js +114 -111
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
# TypeScript
|
|
3
3
|
|
|
4
4
|
[](https://github.com/microsoft/TypeScript/actions?query=workflow%3ACI)
|
|
5
|
-
[](https://dev.azure.com/typescript/TypeScript/_build?definitionId=7)
|
|
6
5
|
[](https://www.npmjs.com/package/typescript)
|
|
7
6
|
[](https://www.npmjs.com/package/typescript)
|
|
8
7
|
[](https://api.securityscorecards.dev/projects/github.com/microsoft/TypeScript)
|
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 = "5.3";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20231015`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -48109,7 +48109,7 @@ function createTypeChecker(host) {
|
|
|
48109
48109
|
return result;
|
|
48110
48110
|
}
|
|
48111
48111
|
function createAnonymousTypeNode(type2) {
|
|
48112
|
-
var _a2;
|
|
48112
|
+
var _a2, _b2;
|
|
48113
48113
|
const typeId = type2.id;
|
|
48114
48114
|
const symbol = type2.symbol;
|
|
48115
48115
|
if (symbol) {
|
|
@@ -48135,6 +48135,20 @@ function createTypeChecker(host) {
|
|
|
48135
48135
|
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
48136
48136
|
}
|
|
48137
48137
|
} else {
|
|
48138
|
+
const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */);
|
|
48139
|
+
if (isInstantiationExpressionType) {
|
|
48140
|
+
const instantiationExpressionType = type2;
|
|
48141
|
+
if (isTypeQueryNode(instantiationExpressionType.node)) {
|
|
48142
|
+
const typeNode = serializeExistingTypeNode(context, instantiationExpressionType.node);
|
|
48143
|
+
if (typeNode) {
|
|
48144
|
+
return typeNode;
|
|
48145
|
+
}
|
|
48146
|
+
}
|
|
48147
|
+
if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) {
|
|
48148
|
+
return createElidedInformationPlaceholder(context);
|
|
48149
|
+
}
|
|
48150
|
+
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
48151
|
+
}
|
|
48138
48152
|
return createTypeNodeFromObjectType(type2);
|
|
48139
48153
|
}
|
|
48140
48154
|
function shouldWriteTypeOfFunctionSymbol() {
|
|
@@ -54071,7 +54085,12 @@ function createTypeChecker(host) {
|
|
|
54071
54085
|
const checkType = type.checkType;
|
|
54072
54086
|
const constraint = getLowerBoundOfKeyType(checkType);
|
|
54073
54087
|
if (constraint !== checkType) {
|
|
54074
|
-
return getConditionalTypeInstantiation(
|
|
54088
|
+
return getConditionalTypeInstantiation(
|
|
54089
|
+
type,
|
|
54090
|
+
prependTypeMapping(type.root.checkType, constraint, type.mapper),
|
|
54091
|
+
/*forConstraint*/
|
|
54092
|
+
false
|
|
54093
|
+
);
|
|
54075
54094
|
}
|
|
54076
54095
|
}
|
|
54077
54096
|
return type;
|
|
@@ -54423,7 +54442,12 @@ function createTypeChecker(host) {
|
|
|
54423
54442
|
);
|
|
54424
54443
|
const constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified;
|
|
54425
54444
|
if (constraint && constraint !== type.checkType) {
|
|
54426
|
-
const instantiated = getConditionalTypeInstantiation(
|
|
54445
|
+
const instantiated = getConditionalTypeInstantiation(
|
|
54446
|
+
type,
|
|
54447
|
+
prependTypeMapping(type.root.checkType, constraint, type.mapper),
|
|
54448
|
+
/*forConstraint*/
|
|
54449
|
+
true
|
|
54450
|
+
);
|
|
54427
54451
|
if (!(instantiated.flags & 131072 /* Never */)) {
|
|
54428
54452
|
type.resolvedConstraintOfDistributive = instantiated;
|
|
54429
54453
|
return instantiated;
|
|
@@ -57986,7 +58010,7 @@ function createTypeChecker(host) {
|
|
|
57986
58010
|
function isDeferredType(type, checkTuples) {
|
|
57987
58011
|
return isGenericType(type) || checkTuples && isTupleType(type) && some(getElementTypes(type), isGenericType);
|
|
57988
58012
|
}
|
|
57989
|
-
function getConditionalType(root, mapper, aliasSymbol, aliasTypeArguments) {
|
|
58013
|
+
function getConditionalType(root, mapper, forConstraint, aliasSymbol, aliasTypeArguments) {
|
|
57990
58014
|
let result;
|
|
57991
58015
|
let extraTypes;
|
|
57992
58016
|
let tailCount = 0;
|
|
@@ -58032,7 +58056,7 @@ function createTypeChecker(host) {
|
|
|
58032
58056
|
const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType;
|
|
58033
58057
|
if (!checkTypeDeferred && !isDeferredType(inferredExtendsType, checkTuples)) {
|
|
58034
58058
|
if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (checkType.flags & 1 /* Any */ || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) {
|
|
58035
|
-
if (checkType.flags & 1 /* Any */) {
|
|
58059
|
+
if (checkType.flags & 1 /* Any */ || forConstraint && !(inferredExtendsType.flags & 131072 /* Never */) && someType(getPermissiveInstantiation(inferredExtendsType), (t) => isTypeAssignableTo(t, getPermissiveInstantiation(checkType)))) {
|
|
58036
58060
|
(extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper));
|
|
58037
58061
|
}
|
|
58038
58062
|
const falseType2 = getTypeFromTypeNode(root.node.falseType);
|
|
@@ -58142,7 +58166,9 @@ function createTypeChecker(host) {
|
|
|
58142
58166
|
links.resolvedType = getConditionalType(
|
|
58143
58167
|
root,
|
|
58144
58168
|
/*mapper*/
|
|
58145
|
-
void 0
|
|
58169
|
+
void 0,
|
|
58170
|
+
/*forConstraint*/
|
|
58171
|
+
false
|
|
58146
58172
|
);
|
|
58147
58173
|
if (outerTypeParameters) {
|
|
58148
58174
|
root.instantiations = /* @__PURE__ */ new Map();
|
|
@@ -58977,7 +59003,6 @@ function createTypeChecker(host) {
|
|
|
58977
59003
|
) : strictNullChecks && modifiers & 8 /* ExcludeOptional */ && isOptional ? getTypeWithFacts(propType, 524288 /* NEUndefined */) : propType;
|
|
58978
59004
|
}
|
|
58979
59005
|
function instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
58980
|
-
Debug.assert(type.symbol, "anonymous type must have symbol to be instantiated");
|
|
58981
59006
|
const result = createObjectType(type.objectFlags & ~(524288 /* CouldContainTypeVariablesComputed */ | 1048576 /* CouldContainTypeVariables */) | 64 /* Instantiated */, type.symbol);
|
|
58982
59007
|
if (type.objectFlags & 32 /* Mapped */) {
|
|
58983
59008
|
result.declaration = type.declaration;
|
|
@@ -58997,17 +59022,17 @@ function createTypeChecker(host) {
|
|
|
58997
59022
|
result.objectFlags |= result.aliasTypeArguments ? getPropagatingFlagsOfTypes(result.aliasTypeArguments) : 0;
|
|
58998
59023
|
return result;
|
|
58999
59024
|
}
|
|
59000
|
-
function getConditionalTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
59025
|
+
function getConditionalTypeInstantiation(type, mapper, forConstraint, aliasSymbol, aliasTypeArguments) {
|
|
59001
59026
|
const root = type.root;
|
|
59002
59027
|
if (root.outerTypeParameters) {
|
|
59003
59028
|
const typeArguments = map(root.outerTypeParameters, (t) => getMappedType(t, mapper));
|
|
59004
|
-
const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
59029
|
+
const id = (forConstraint ? "C" : "") + getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
59005
59030
|
let result = root.instantiations.get(id);
|
|
59006
59031
|
if (!result) {
|
|
59007
59032
|
const newMapper = createTypeMapper(root.outerTypeParameters, typeArguments);
|
|
59008
59033
|
const checkType = root.checkType;
|
|
59009
59034
|
const distributionType = root.isDistributive ? getMappedType(checkType, newMapper) : void 0;
|
|
59010
|
-
result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(getReducedType(distributionType), (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper)), aliasSymbol, aliasTypeArguments) : getConditionalType(root, newMapper, aliasSymbol, aliasTypeArguments);
|
|
59035
|
+
result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(getReducedType(distributionType), (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper), forConstraint), aliasSymbol, aliasTypeArguments) : getConditionalType(root, newMapper, forConstraint, aliasSymbol, aliasTypeArguments);
|
|
59011
59036
|
root.instantiations.set(id, result);
|
|
59012
59037
|
}
|
|
59013
59038
|
return result;
|
|
@@ -59095,7 +59120,14 @@ function createTypeChecker(host) {
|
|
|
59095
59120
|
);
|
|
59096
59121
|
}
|
|
59097
59122
|
if (flags & 16777216 /* Conditional */) {
|
|
59098
|
-
return getConditionalTypeInstantiation(
|
|
59123
|
+
return getConditionalTypeInstantiation(
|
|
59124
|
+
type,
|
|
59125
|
+
combineTypeMappers(type.mapper, mapper),
|
|
59126
|
+
/*forConstraint*/
|
|
59127
|
+
false,
|
|
59128
|
+
aliasSymbol,
|
|
59129
|
+
aliasTypeArguments
|
|
59130
|
+
);
|
|
59099
59131
|
}
|
|
59100
59132
|
if (flags & 33554432 /* Substitution */) {
|
|
59101
59133
|
const newBaseType = instantiateType(type.baseType, mapper);
|
|
@@ -61636,13 +61668,6 @@ function createTypeChecker(host) {
|
|
|
61636
61668
|
return result2;
|
|
61637
61669
|
}
|
|
61638
61670
|
}
|
|
61639
|
-
} else {
|
|
61640
|
-
const distributiveConstraint = hasNonCircularBaseConstraint(source2) ? getConstraintOfDistributiveConditionalType(source2) : void 0;
|
|
61641
|
-
if (distributiveConstraint) {
|
|
61642
|
-
if (result2 = isRelatedTo(distributiveConstraint, target2, 1 /* Source */, reportErrors2)) {
|
|
61643
|
-
return result2;
|
|
61644
|
-
}
|
|
61645
|
-
}
|
|
61646
61671
|
}
|
|
61647
61672
|
const defaultConstraint = getDefaultConstraintOfConditionalType(source2);
|
|
61648
61673
|
if (defaultConstraint) {
|
|
@@ -61650,6 +61675,13 @@ function createTypeChecker(host) {
|
|
|
61650
61675
|
return result2;
|
|
61651
61676
|
}
|
|
61652
61677
|
}
|
|
61678
|
+
const distributiveConstraint = !(targetFlags & 16777216 /* Conditional */) && hasNonCircularBaseConstraint(source2) ? getConstraintOfDistributiveConditionalType(source2) : void 0;
|
|
61679
|
+
if (distributiveConstraint) {
|
|
61680
|
+
resetErrorInfo(saveErrorInfo);
|
|
61681
|
+
if (result2 = isRelatedTo(distributiveConstraint, target2, 1 /* Source */, reportErrors2)) {
|
|
61682
|
+
return result2;
|
|
61683
|
+
}
|
|
61684
|
+
}
|
|
61653
61685
|
} else {
|
|
61654
61686
|
if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target2) && isEmptyObjectType(source2)) {
|
|
61655
61687
|
return -1 /* True */;
|
|
@@ -62225,7 +62257,6 @@ function createTypeChecker(host) {
|
|
|
62225
62257
|
const sourceObjectFlags = getObjectFlags(source2);
|
|
62226
62258
|
const targetObjectFlags = getObjectFlags(target2);
|
|
62227
62259
|
if (sourceObjectFlags & 64 /* Instantiated */ && targetObjectFlags & 64 /* Instantiated */ && source2.symbol === target2.symbol || sourceObjectFlags & 4 /* Reference */ && targetObjectFlags & 4 /* Reference */ && source2.target === target2.target) {
|
|
62228
|
-
Debug.assertEqual(sourceSignatures.length, targetSignatures.length);
|
|
62229
62260
|
for (let i = 0; i < targetSignatures.length; i++) {
|
|
62230
62261
|
const related = signatureRelatedTo(
|
|
62231
62262
|
sourceSignatures[i],
|
|
@@ -72443,7 +72474,14 @@ function createTypeChecker(host) {
|
|
|
72443
72474
|
hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0);
|
|
72444
72475
|
hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
|
|
72445
72476
|
if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
|
|
72446
|
-
const result3 = createAnonymousType(
|
|
72477
|
+
const result3 = createAnonymousType(
|
|
72478
|
+
/*symbol*/
|
|
72479
|
+
void 0,
|
|
72480
|
+
resolved.members,
|
|
72481
|
+
callSignatures,
|
|
72482
|
+
constructSignatures,
|
|
72483
|
+
resolved.indexInfos
|
|
72484
|
+
);
|
|
72447
72485
|
result3.objectFlags |= 8388608 /* InstantiationExpressionType */;
|
|
72448
72486
|
result3.node = node;
|
|
72449
72487
|
return result3;
|
package/lib/tsserver.js
CHANGED
|
@@ -2328,7 +2328,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2328
2328
|
|
|
2329
2329
|
// src/compiler/corePublic.ts
|
|
2330
2330
|
var versionMajorMinor = "5.3";
|
|
2331
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2331
|
+
var version = `${versionMajorMinor}.0-insiders.20231015`;
|
|
2332
2332
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2333
2333
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2334
2334
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6573,7 +6573,6 @@ var InternalSymbolName = /* @__PURE__ */ ((InternalSymbolName2) => {
|
|
|
6573
6573
|
InternalSymbolName2["ExportEquals"] = "export=";
|
|
6574
6574
|
InternalSymbolName2["Default"] = "default";
|
|
6575
6575
|
InternalSymbolName2["This"] = "this";
|
|
6576
|
-
InternalSymbolName2["InstantiationExpression"] = "__instantiationExpression";
|
|
6577
6576
|
return InternalSymbolName2;
|
|
6578
6577
|
})(InternalSymbolName || {});
|
|
6579
6578
|
var NodeCheckFlags = /* @__PURE__ */ ((NodeCheckFlags2) => {
|
|
@@ -52822,7 +52821,7 @@ function createTypeChecker(host) {
|
|
|
52822
52821
|
return result;
|
|
52823
52822
|
}
|
|
52824
52823
|
function createAnonymousTypeNode(type2) {
|
|
52825
|
-
var _a2;
|
|
52824
|
+
var _a2, _b2;
|
|
52826
52825
|
const typeId = type2.id;
|
|
52827
52826
|
const symbol = type2.symbol;
|
|
52828
52827
|
if (symbol) {
|
|
@@ -52848,6 +52847,20 @@ function createTypeChecker(host) {
|
|
|
52848
52847
|
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
52849
52848
|
}
|
|
52850
52849
|
} else {
|
|
52850
|
+
const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */);
|
|
52851
|
+
if (isInstantiationExpressionType) {
|
|
52852
|
+
const instantiationExpressionType = type2;
|
|
52853
|
+
if (isTypeQueryNode(instantiationExpressionType.node)) {
|
|
52854
|
+
const typeNode = serializeExistingTypeNode(context, instantiationExpressionType.node);
|
|
52855
|
+
if (typeNode) {
|
|
52856
|
+
return typeNode;
|
|
52857
|
+
}
|
|
52858
|
+
}
|
|
52859
|
+
if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) {
|
|
52860
|
+
return createElidedInformationPlaceholder(context);
|
|
52861
|
+
}
|
|
52862
|
+
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
52863
|
+
}
|
|
52851
52864
|
return createTypeNodeFromObjectType(type2);
|
|
52852
52865
|
}
|
|
52853
52866
|
function shouldWriteTypeOfFunctionSymbol() {
|
|
@@ -58784,7 +58797,12 @@ function createTypeChecker(host) {
|
|
|
58784
58797
|
const checkType = type.checkType;
|
|
58785
58798
|
const constraint = getLowerBoundOfKeyType(checkType);
|
|
58786
58799
|
if (constraint !== checkType) {
|
|
58787
|
-
return getConditionalTypeInstantiation(
|
|
58800
|
+
return getConditionalTypeInstantiation(
|
|
58801
|
+
type,
|
|
58802
|
+
prependTypeMapping(type.root.checkType, constraint, type.mapper),
|
|
58803
|
+
/*forConstraint*/
|
|
58804
|
+
false
|
|
58805
|
+
);
|
|
58788
58806
|
}
|
|
58789
58807
|
}
|
|
58790
58808
|
return type;
|
|
@@ -59136,7 +59154,12 @@ function createTypeChecker(host) {
|
|
|
59136
59154
|
);
|
|
59137
59155
|
const constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified;
|
|
59138
59156
|
if (constraint && constraint !== type.checkType) {
|
|
59139
|
-
const instantiated = getConditionalTypeInstantiation(
|
|
59157
|
+
const instantiated = getConditionalTypeInstantiation(
|
|
59158
|
+
type,
|
|
59159
|
+
prependTypeMapping(type.root.checkType, constraint, type.mapper),
|
|
59160
|
+
/*forConstraint*/
|
|
59161
|
+
true
|
|
59162
|
+
);
|
|
59140
59163
|
if (!(instantiated.flags & 131072 /* Never */)) {
|
|
59141
59164
|
type.resolvedConstraintOfDistributive = instantiated;
|
|
59142
59165
|
return instantiated;
|
|
@@ -62699,7 +62722,7 @@ function createTypeChecker(host) {
|
|
|
62699
62722
|
function isDeferredType(type, checkTuples) {
|
|
62700
62723
|
return isGenericType(type) || checkTuples && isTupleType(type) && some(getElementTypes(type), isGenericType);
|
|
62701
62724
|
}
|
|
62702
|
-
function getConditionalType(root, mapper, aliasSymbol, aliasTypeArguments) {
|
|
62725
|
+
function getConditionalType(root, mapper, forConstraint, aliasSymbol, aliasTypeArguments) {
|
|
62703
62726
|
let result;
|
|
62704
62727
|
let extraTypes;
|
|
62705
62728
|
let tailCount = 0;
|
|
@@ -62745,7 +62768,7 @@ function createTypeChecker(host) {
|
|
|
62745
62768
|
const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType;
|
|
62746
62769
|
if (!checkTypeDeferred && !isDeferredType(inferredExtendsType, checkTuples)) {
|
|
62747
62770
|
if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (checkType.flags & 1 /* Any */ || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) {
|
|
62748
|
-
if (checkType.flags & 1 /* Any */) {
|
|
62771
|
+
if (checkType.flags & 1 /* Any */ || forConstraint && !(inferredExtendsType.flags & 131072 /* Never */) && someType(getPermissiveInstantiation(inferredExtendsType), (t) => isTypeAssignableTo(t, getPermissiveInstantiation(checkType)))) {
|
|
62749
62772
|
(extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper));
|
|
62750
62773
|
}
|
|
62751
62774
|
const falseType2 = getTypeFromTypeNode(root.node.falseType);
|
|
@@ -62855,7 +62878,9 @@ function createTypeChecker(host) {
|
|
|
62855
62878
|
links.resolvedType = getConditionalType(
|
|
62856
62879
|
root,
|
|
62857
62880
|
/*mapper*/
|
|
62858
|
-
void 0
|
|
62881
|
+
void 0,
|
|
62882
|
+
/*forConstraint*/
|
|
62883
|
+
false
|
|
62859
62884
|
);
|
|
62860
62885
|
if (outerTypeParameters) {
|
|
62861
62886
|
root.instantiations = /* @__PURE__ */ new Map();
|
|
@@ -63690,7 +63715,6 @@ function createTypeChecker(host) {
|
|
|
63690
63715
|
) : strictNullChecks && modifiers & 8 /* ExcludeOptional */ && isOptional ? getTypeWithFacts(propType, 524288 /* NEUndefined */) : propType;
|
|
63691
63716
|
}
|
|
63692
63717
|
function instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
63693
|
-
Debug.assert(type.symbol, "anonymous type must have symbol to be instantiated");
|
|
63694
63718
|
const result = createObjectType(type.objectFlags & ~(524288 /* CouldContainTypeVariablesComputed */ | 1048576 /* CouldContainTypeVariables */) | 64 /* Instantiated */, type.symbol);
|
|
63695
63719
|
if (type.objectFlags & 32 /* Mapped */) {
|
|
63696
63720
|
result.declaration = type.declaration;
|
|
@@ -63710,17 +63734,17 @@ function createTypeChecker(host) {
|
|
|
63710
63734
|
result.objectFlags |= result.aliasTypeArguments ? getPropagatingFlagsOfTypes(result.aliasTypeArguments) : 0;
|
|
63711
63735
|
return result;
|
|
63712
63736
|
}
|
|
63713
|
-
function getConditionalTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
63737
|
+
function getConditionalTypeInstantiation(type, mapper, forConstraint, aliasSymbol, aliasTypeArguments) {
|
|
63714
63738
|
const root = type.root;
|
|
63715
63739
|
if (root.outerTypeParameters) {
|
|
63716
63740
|
const typeArguments = map(root.outerTypeParameters, (t) => getMappedType(t, mapper));
|
|
63717
|
-
const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
63741
|
+
const id = (forConstraint ? "C" : "") + getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
63718
63742
|
let result = root.instantiations.get(id);
|
|
63719
63743
|
if (!result) {
|
|
63720
63744
|
const newMapper = createTypeMapper(root.outerTypeParameters, typeArguments);
|
|
63721
63745
|
const checkType = root.checkType;
|
|
63722
63746
|
const distributionType = root.isDistributive ? getMappedType(checkType, newMapper) : void 0;
|
|
63723
|
-
result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(getReducedType(distributionType), (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper)), aliasSymbol, aliasTypeArguments) : getConditionalType(root, newMapper, aliasSymbol, aliasTypeArguments);
|
|
63747
|
+
result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(getReducedType(distributionType), (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper), forConstraint), aliasSymbol, aliasTypeArguments) : getConditionalType(root, newMapper, forConstraint, aliasSymbol, aliasTypeArguments);
|
|
63724
63748
|
root.instantiations.set(id, result);
|
|
63725
63749
|
}
|
|
63726
63750
|
return result;
|
|
@@ -63808,7 +63832,14 @@ function createTypeChecker(host) {
|
|
|
63808
63832
|
);
|
|
63809
63833
|
}
|
|
63810
63834
|
if (flags & 16777216 /* Conditional */) {
|
|
63811
|
-
return getConditionalTypeInstantiation(
|
|
63835
|
+
return getConditionalTypeInstantiation(
|
|
63836
|
+
type,
|
|
63837
|
+
combineTypeMappers(type.mapper, mapper),
|
|
63838
|
+
/*forConstraint*/
|
|
63839
|
+
false,
|
|
63840
|
+
aliasSymbol,
|
|
63841
|
+
aliasTypeArguments
|
|
63842
|
+
);
|
|
63812
63843
|
}
|
|
63813
63844
|
if (flags & 33554432 /* Substitution */) {
|
|
63814
63845
|
const newBaseType = instantiateType(type.baseType, mapper);
|
|
@@ -66349,13 +66380,6 @@ function createTypeChecker(host) {
|
|
|
66349
66380
|
return result2;
|
|
66350
66381
|
}
|
|
66351
66382
|
}
|
|
66352
|
-
} else {
|
|
66353
|
-
const distributiveConstraint = hasNonCircularBaseConstraint(source2) ? getConstraintOfDistributiveConditionalType(source2) : void 0;
|
|
66354
|
-
if (distributiveConstraint) {
|
|
66355
|
-
if (result2 = isRelatedTo(distributiveConstraint, target2, 1 /* Source */, reportErrors2)) {
|
|
66356
|
-
return result2;
|
|
66357
|
-
}
|
|
66358
|
-
}
|
|
66359
66383
|
}
|
|
66360
66384
|
const defaultConstraint = getDefaultConstraintOfConditionalType(source2);
|
|
66361
66385
|
if (defaultConstraint) {
|
|
@@ -66363,6 +66387,13 @@ function createTypeChecker(host) {
|
|
|
66363
66387
|
return result2;
|
|
66364
66388
|
}
|
|
66365
66389
|
}
|
|
66390
|
+
const distributiveConstraint = !(targetFlags & 16777216 /* Conditional */) && hasNonCircularBaseConstraint(source2) ? getConstraintOfDistributiveConditionalType(source2) : void 0;
|
|
66391
|
+
if (distributiveConstraint) {
|
|
66392
|
+
resetErrorInfo(saveErrorInfo);
|
|
66393
|
+
if (result2 = isRelatedTo(distributiveConstraint, target2, 1 /* Source */, reportErrors2)) {
|
|
66394
|
+
return result2;
|
|
66395
|
+
}
|
|
66396
|
+
}
|
|
66366
66397
|
} else {
|
|
66367
66398
|
if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target2) && isEmptyObjectType(source2)) {
|
|
66368
66399
|
return -1 /* True */;
|
|
@@ -66938,7 +66969,6 @@ function createTypeChecker(host) {
|
|
|
66938
66969
|
const sourceObjectFlags = getObjectFlags(source2);
|
|
66939
66970
|
const targetObjectFlags = getObjectFlags(target2);
|
|
66940
66971
|
if (sourceObjectFlags & 64 /* Instantiated */ && targetObjectFlags & 64 /* Instantiated */ && source2.symbol === target2.symbol || sourceObjectFlags & 4 /* Reference */ && targetObjectFlags & 4 /* Reference */ && source2.target === target2.target) {
|
|
66941
|
-
Debug.assertEqual(sourceSignatures.length, targetSignatures.length);
|
|
66942
66972
|
for (let i = 0; i < targetSignatures.length; i++) {
|
|
66943
66973
|
const related = signatureRelatedTo(
|
|
66944
66974
|
sourceSignatures[i],
|
|
@@ -77156,7 +77186,14 @@ function createTypeChecker(host) {
|
|
|
77156
77186
|
hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0);
|
|
77157
77187
|
hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
|
|
77158
77188
|
if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
|
|
77159
|
-
const result3 = createAnonymousType(
|
|
77189
|
+
const result3 = createAnonymousType(
|
|
77190
|
+
/*symbol*/
|
|
77191
|
+
void 0,
|
|
77192
|
+
resolved.members,
|
|
77193
|
+
callSignatures,
|
|
77194
|
+
constructSignatures,
|
|
77195
|
+
resolved.indexInfos
|
|
77196
|
+
);
|
|
77160
77197
|
result3.objectFlags |= 8388608 /* InstantiationExpressionType */;
|
|
77161
77198
|
result3.node = node;
|
|
77162
77199
|
return result3;
|
|
@@ -130363,6 +130400,44 @@ __export(ts_JsTyping_exports, {
|
|
|
130363
130400
|
validatePackageName: () => validatePackageName
|
|
130364
130401
|
});
|
|
130365
130402
|
|
|
130403
|
+
// src/jsTyping/shared.ts
|
|
130404
|
+
var ActionSet = "action::set";
|
|
130405
|
+
var ActionInvalidate = "action::invalidate";
|
|
130406
|
+
var ActionPackageInstalled = "action::packageInstalled";
|
|
130407
|
+
var EventTypesRegistry = "event::typesRegistry";
|
|
130408
|
+
var EventBeginInstallTypes = "event::beginInstallTypes";
|
|
130409
|
+
var EventEndInstallTypes = "event::endInstallTypes";
|
|
130410
|
+
var EventInitializationFailed = "event::initializationFailed";
|
|
130411
|
+
var ActionWatchTypingLocations = "action::watchTypingLocations";
|
|
130412
|
+
var Arguments;
|
|
130413
|
+
((Arguments2) => {
|
|
130414
|
+
Arguments2.GlobalCacheLocation = "--globalTypingsCacheLocation";
|
|
130415
|
+
Arguments2.LogFile = "--logFile";
|
|
130416
|
+
Arguments2.EnableTelemetry = "--enableTelemetry";
|
|
130417
|
+
Arguments2.TypingSafeListLocation = "--typingSafeListLocation";
|
|
130418
|
+
Arguments2.TypesMapLocation = "--typesMapLocation";
|
|
130419
|
+
Arguments2.NpmLocation = "--npmLocation";
|
|
130420
|
+
Arguments2.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
|
|
130421
|
+
})(Arguments || (Arguments = {}));
|
|
130422
|
+
function hasArgument(argumentName) {
|
|
130423
|
+
return sys.args.includes(argumentName);
|
|
130424
|
+
}
|
|
130425
|
+
function findArgument(argumentName) {
|
|
130426
|
+
const index = sys.args.indexOf(argumentName);
|
|
130427
|
+
return index >= 0 && index < sys.args.length - 1 ? sys.args[index + 1] : void 0;
|
|
130428
|
+
}
|
|
130429
|
+
function nowString() {
|
|
130430
|
+
const d = /* @__PURE__ */ new Date();
|
|
130431
|
+
return `${d.getHours().toString().padStart(2, "0")}:${d.getMinutes().toString().padStart(2, "0")}:${d.getSeconds().toString().padStart(2, "0")}.${d.getMilliseconds().toString().padStart(3, "0")}`;
|
|
130432
|
+
}
|
|
130433
|
+
var indentStr = "\n ";
|
|
130434
|
+
function indent2(str) {
|
|
130435
|
+
return indentStr + str.replace(/\n/g, indentStr);
|
|
130436
|
+
}
|
|
130437
|
+
function stringifyIndented(json) {
|
|
130438
|
+
return indent2(JSON.stringify(json, void 0, 2));
|
|
130439
|
+
}
|
|
130440
|
+
|
|
130366
130441
|
// src/jsTyping/jsTyping.ts
|
|
130367
130442
|
function isTypingUpToDate(cachedTyping, availableTypingVersions) {
|
|
130368
130443
|
const availableVersion = new Version(getProperty(availableTypingVersions, `ts${versionMajorMinor}`) || getProperty(availableTypingVersions, "latest"));
|
|
@@ -130469,21 +130544,21 @@ function discoverTypings(host, log, fileNames, projectRootPath, safeList, packag
|
|
|
130469
130544
|
);
|
|
130470
130545
|
addInferredTypings(module2, "Inferred typings from unresolved imports");
|
|
130471
130546
|
}
|
|
130472
|
-
packageNameToTypingLocation.forEach((typing, name) => {
|
|
130473
|
-
const registryEntry = typesRegistry.get(name);
|
|
130474
|
-
if (inferredTypings.has(name) && inferredTypings.get(name) === void 0 && registryEntry !== void 0 && isTypingUpToDate(typing, registryEntry)) {
|
|
130475
|
-
inferredTypings.set(name, typing.typingLocation);
|
|
130476
|
-
}
|
|
130477
|
-
});
|
|
130478
130547
|
for (const excludeTypingName of exclude) {
|
|
130479
130548
|
const didDelete = inferredTypings.delete(excludeTypingName);
|
|
130480
130549
|
if (didDelete && log)
|
|
130481
130550
|
log(`Typing for ${excludeTypingName} is in exclude list, will be ignored.`);
|
|
130482
130551
|
}
|
|
130552
|
+
packageNameToTypingLocation.forEach((typing, name) => {
|
|
130553
|
+
const registryEntry = typesRegistry.get(name);
|
|
130554
|
+
if (inferredTypings.get(name) === false && registryEntry !== void 0 && isTypingUpToDate(typing, registryEntry)) {
|
|
130555
|
+
inferredTypings.set(name, typing.typingLocation);
|
|
130556
|
+
}
|
|
130557
|
+
});
|
|
130483
130558
|
const newTypingNames = [];
|
|
130484
130559
|
const cachedTypingPaths = [];
|
|
130485
130560
|
inferredTypings.forEach((inferred, typing) => {
|
|
130486
|
-
if (inferred
|
|
130561
|
+
if (inferred) {
|
|
130487
130562
|
cachedTypingPaths.push(inferred);
|
|
130488
130563
|
} else {
|
|
130489
130564
|
newTypingNames.push(typing);
|
|
@@ -130491,11 +130566,11 @@ function discoverTypings(host, log, fileNames, projectRootPath, safeList, packag
|
|
|
130491
130566
|
});
|
|
130492
130567
|
const result = { cachedTypingPaths, newTypingNames, filesToWatch };
|
|
130493
130568
|
if (log)
|
|
130494
|
-
log(`
|
|
130569
|
+
log(`Finished typings discovery:${stringifyIndented(result)}`);
|
|
130495
130570
|
return result;
|
|
130496
130571
|
function addInferredTyping(typingName) {
|
|
130497
130572
|
if (!inferredTypings.has(typingName)) {
|
|
130498
|
-
inferredTypings.set(typingName,
|
|
130573
|
+
inferredTypings.set(typingName, false);
|
|
130499
130574
|
}
|
|
130500
130575
|
}
|
|
130501
130576
|
function addInferredTypings(typingNames, message) {
|
|
@@ -130668,37 +130743,6 @@ function renderPackageNameValidationFailureWorker(typing, result, name, isScopeN
|
|
|
130668
130743
|
}
|
|
130669
130744
|
}
|
|
130670
130745
|
|
|
130671
|
-
// src/jsTyping/shared.ts
|
|
130672
|
-
var ActionSet = "action::set";
|
|
130673
|
-
var ActionInvalidate = "action::invalidate";
|
|
130674
|
-
var ActionPackageInstalled = "action::packageInstalled";
|
|
130675
|
-
var EventTypesRegistry = "event::typesRegistry";
|
|
130676
|
-
var EventBeginInstallTypes = "event::beginInstallTypes";
|
|
130677
|
-
var EventEndInstallTypes = "event::endInstallTypes";
|
|
130678
|
-
var EventInitializationFailed = "event::initializationFailed";
|
|
130679
|
-
var ActionWatchTypingLocations = "action::watchTypingLocations";
|
|
130680
|
-
var Arguments;
|
|
130681
|
-
((Arguments2) => {
|
|
130682
|
-
Arguments2.GlobalCacheLocation = "--globalTypingsCacheLocation";
|
|
130683
|
-
Arguments2.LogFile = "--logFile";
|
|
130684
|
-
Arguments2.EnableTelemetry = "--enableTelemetry";
|
|
130685
|
-
Arguments2.TypingSafeListLocation = "--typingSafeListLocation";
|
|
130686
|
-
Arguments2.TypesMapLocation = "--typesMapLocation";
|
|
130687
|
-
Arguments2.NpmLocation = "--npmLocation";
|
|
130688
|
-
Arguments2.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
|
|
130689
|
-
})(Arguments || (Arguments = {}));
|
|
130690
|
-
function hasArgument(argumentName) {
|
|
130691
|
-
return sys.args.includes(argumentName);
|
|
130692
|
-
}
|
|
130693
|
-
function findArgument(argumentName) {
|
|
130694
|
-
const index = sys.args.indexOf(argumentName);
|
|
130695
|
-
return index >= 0 && index < sys.args.length - 1 ? sys.args[index + 1] : void 0;
|
|
130696
|
-
}
|
|
130697
|
-
function nowString() {
|
|
130698
|
-
const d = /* @__PURE__ */ new Date();
|
|
130699
|
-
return `${d.getHours().toString().padStart(2, "0")}:${d.getMinutes().toString().padStart(2, "0")}:${d.getSeconds().toString().padStart(2, "0")}.${d.getMilliseconds().toString().padStart(3, "0")}`;
|
|
130700
|
-
}
|
|
130701
|
-
|
|
130702
130746
|
// src/services/types.ts
|
|
130703
130747
|
var ScriptSnapshot;
|
|
130704
130748
|
((ScriptSnapshot2) => {
|
|
@@ -174689,7 +174733,7 @@ var TypingsInstaller = class {
|
|
|
174689
174733
|
}
|
|
174690
174734
|
install(req) {
|
|
174691
174735
|
if (this.log.isEnabled()) {
|
|
174692
|
-
this.log.writeLine(`Got install request
|
|
174736
|
+
this.log.writeLine(`Got install request${stringifyIndented(req)}`);
|
|
174693
174737
|
}
|
|
174694
174738
|
if (req.cachePath) {
|
|
174695
174739
|
if (this.log.isEnabled()) {
|
|
@@ -174712,9 +174756,6 @@ var TypingsInstaller = class {
|
|
|
174712
174756
|
this.typesRegistry,
|
|
174713
174757
|
req.compilerOptions
|
|
174714
174758
|
);
|
|
174715
|
-
if (this.log.isEnabled()) {
|
|
174716
|
-
this.log.writeLine(`Finished typings discovery: ${JSON.stringify(discoverTypingsResult)}`);
|
|
174717
|
-
}
|
|
174718
174759
|
this.watchFiles(req.projectName, discoverTypingsResult.filesToWatch);
|
|
174719
174760
|
if (discoverTypingsResult.newTypingNames.length) {
|
|
174720
174761
|
this.installTypings(req, req.cachePath || this.globalCachePath, discoverTypingsResult.cachedTypingPaths, discoverTypingsResult.newTypingNames);
|
|
@@ -174756,8 +174797,8 @@ var TypingsInstaller = class {
|
|
|
174756
174797
|
const npmConfig = JSON.parse(this.installTypingHost.readFile(packageJson));
|
|
174757
174798
|
const npmLock = JSON.parse(this.installTypingHost.readFile(packageLockJson));
|
|
174758
174799
|
if (this.log.isEnabled()) {
|
|
174759
|
-
this.log.writeLine(`Loaded content of '${packageJson}'
|
|
174760
|
-
this.log.writeLine(`Loaded content of '${packageLockJson}'`);
|
|
174800
|
+
this.log.writeLine(`Loaded content of '${packageJson}':${stringifyIndented(npmConfig)}`);
|
|
174801
|
+
this.log.writeLine(`Loaded content of '${packageLockJson}':${stringifyIndented(npmLock)}`);
|
|
174761
174802
|
}
|
|
174762
174803
|
if (npmConfig.devDependencies && npmLock.dependencies) {
|
|
174763
174804
|
for (const key in npmConfig.devDependencies) {
|
|
@@ -175134,13 +175175,6 @@ function removeSorted(array, remove, compare) {
|
|
|
175134
175175
|
array.splice(removeIndex, 1);
|
|
175135
175176
|
}
|
|
175136
175177
|
}
|
|
175137
|
-
var indentStr = "\n ";
|
|
175138
|
-
function indent2(str) {
|
|
175139
|
-
return indentStr + str.replace(/\n/g, indentStr);
|
|
175140
|
-
}
|
|
175141
|
-
function stringifyIndented(json) {
|
|
175142
|
-
return indentStr + JSON.stringify(json);
|
|
175143
|
-
}
|
|
175144
175178
|
|
|
175145
175179
|
// src/server/_namespaces/ts.server.protocol.ts
|
|
175146
175180
|
var ts_server_protocol_exports = {};
|
|
@@ -177993,9 +178027,6 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
177993
178027
|
includePackageJsonAutoImports() {
|
|
177994
178028
|
return 0 /* Off */;
|
|
177995
178029
|
}
|
|
177996
|
-
getTypeAcquisition() {
|
|
177997
|
-
return { enable: false };
|
|
177998
|
-
}
|
|
177999
178030
|
/** @internal */
|
|
178000
178031
|
getSymlinkCache() {
|
|
178001
178032
|
return this.hostProject.getSymlinkCache();
|
|
@@ -181919,7 +181950,7 @@ function formatMessage2(msg, logger, byteLength, newLine) {
|
|
|
181919
181950
|
const verboseLogging = logger.hasLevel(3 /* verbose */);
|
|
181920
181951
|
const json = JSON.stringify(msg);
|
|
181921
181952
|
if (verboseLogging) {
|
|
181922
|
-
logger.info(`${msg.type}:${
|
|
181953
|
+
logger.info(`${msg.type}:${stringifyIndented(msg)}`);
|
|
181923
181954
|
}
|
|
181924
181955
|
const len = byteLength(json, "utf8");
|
|
181925
181956
|
return `Content-Length: ${1 + len}\r
|
package/lib/typescript.d.ts
CHANGED
|
@@ -3450,7 +3450,6 @@ declare namespace ts {
|
|
|
3450
3450
|
getLanguageService(): never;
|
|
3451
3451
|
getHostForAutoImportProvider(): never;
|
|
3452
3452
|
getProjectReferences(): readonly ts.ProjectReference[] | undefined;
|
|
3453
|
-
getTypeAcquisition(): TypeAcquisition;
|
|
3454
3453
|
}
|
|
3455
3454
|
/**
|
|
3456
3455
|
* If a file is opened, the server will look for a tsconfig (or jsconfig)
|
|
@@ -7048,7 +7047,6 @@ declare namespace ts {
|
|
|
7048
7047
|
ExportEquals = "export=",
|
|
7049
7048
|
Default = "default",
|
|
7050
7049
|
This = "this",
|
|
7051
|
-
InstantiationExpression = "__instantiationExpression",
|
|
7052
7050
|
}
|
|
7053
7051
|
/**
|
|
7054
7052
|
* This represents a string whose leading underscore have been escaped by adding extra leading underscores.
|