@typescript-deploys/pr-build 5.4.0-pr-57133-2 → 5.4.0-pr-55371-20
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 +19 -13
- package/lib/tsserver.js +19 -13
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +20 -2317
- package/lib/typingsInstaller.js +1 -1
- 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 = "5.4";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240125`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -42806,7 +42806,11 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
|
|
|
42806
42806
|
if (modulePath.isRedirect) {
|
|
42807
42807
|
redirectPathsSpecifiers = append(redirectPathsSpecifiers, local);
|
|
42808
42808
|
} else if (pathIsBareSpecifier(local)) {
|
|
42809
|
-
|
|
42809
|
+
if (pathContainsNodeModules(local)) {
|
|
42810
|
+
relativeSpecifiers = append(relativeSpecifiers, local);
|
|
42811
|
+
} else {
|
|
42812
|
+
pathsSpecifiers = append(pathsSpecifiers, local);
|
|
42813
|
+
}
|
|
42810
42814
|
} else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) {
|
|
42811
42815
|
relativeSpecifiers = append(relativeSpecifiers, local);
|
|
42812
42816
|
}
|
|
@@ -58188,6 +58192,7 @@ function createTypeChecker(host) {
|
|
|
58188
58192
|
return links.resolvedType;
|
|
58189
58193
|
}
|
|
58190
58194
|
function getTemplateLiteralType(texts, types) {
|
|
58195
|
+
var _a, _b;
|
|
58191
58196
|
const unionIndex = findIndex(types, (t) => !!(t.flags & (131072 /* Never */ | 1048576 /* Union */)));
|
|
58192
58197
|
if (unionIndex >= 0) {
|
|
58193
58198
|
return checkCrossProductUnion(types) ? mapType(types[unionIndex], (t) => getTemplateLiteralType(texts, replaceElement(types, unionIndex, t))) : errorType;
|
|
@@ -58195,6 +58200,9 @@ function createTypeChecker(host) {
|
|
|
58195
58200
|
if (contains(types, wildcardType)) {
|
|
58196
58201
|
return wildcardType;
|
|
58197
58202
|
}
|
|
58203
|
+
if (texts.length === 2 && texts[0] === "" && texts[1] === "" && !(types[0].flags & 2944 /* Literal */) && !((_b = (_a = types[0].symbol) == null ? void 0 : _a.declarations) == null ? void 0 : _b.some((d) => d.parent.kind === 195 /* InferType */)) && isTypeAssignableTo(types[0], stringType)) {
|
|
58204
|
+
return types[0];
|
|
58205
|
+
}
|
|
58198
58206
|
const newTypes = [];
|
|
58199
58207
|
const newTexts = [];
|
|
58200
58208
|
let text = texts[0];
|
|
@@ -76090,19 +76098,16 @@ function createTypeChecker(host) {
|
|
|
76090
76098
|
}
|
|
76091
76099
|
}
|
|
76092
76100
|
}
|
|
76093
|
-
function
|
|
76101
|
+
function getReturnTypeOfSingleNonGenericCallSignature(funcType) {
|
|
76094
76102
|
const signature = getSingleCallSignature(funcType);
|
|
76095
|
-
if (signature) {
|
|
76096
|
-
|
|
76097
|
-
if (!signature.typeParameters || !couldContainTypeVariables(returnType)) {
|
|
76098
|
-
return returnType;
|
|
76099
|
-
}
|
|
76103
|
+
if (signature && !signature.typeParameters) {
|
|
76104
|
+
return getReturnTypeOfSignature(signature);
|
|
76100
76105
|
}
|
|
76101
76106
|
}
|
|
76102
76107
|
function getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) {
|
|
76103
76108
|
const funcType = checkExpression(expr.expression);
|
|
76104
76109
|
const nonOptionalType = getOptionalExpressionType(funcType, expr.expression);
|
|
76105
|
-
const returnType =
|
|
76110
|
+
const returnType = getReturnTypeOfSingleNonGenericCallSignature(funcType);
|
|
76106
76111
|
return returnType && propagateOptionalTypeMarker(returnType, expr, nonOptionalType !== funcType);
|
|
76107
76112
|
}
|
|
76108
76113
|
function getTypeOfExpression(node) {
|
|
@@ -76147,7 +76152,7 @@ function createTypeChecker(host) {
|
|
|
76147
76152
|
/*requireStringLiteralLikeArgument*/
|
|
76148
76153
|
true
|
|
76149
76154
|
) && !isSymbolOrSymbolForCall(expr)) {
|
|
76150
|
-
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) :
|
|
76155
|
+
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression));
|
|
76151
76156
|
} else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) {
|
|
76152
76157
|
return getTypeFromTypeNode(expr.type);
|
|
76153
76158
|
} else if (isLiteralExpression(node) || isBooleanLiteral(node)) {
|
|
@@ -81502,14 +81507,15 @@ function createTypeChecker(host) {
|
|
|
81502
81507
|
idText(id)
|
|
81503
81508
|
);
|
|
81504
81509
|
}
|
|
81505
|
-
if (!isIllegalExportDefaultInCJS && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
|
|
81506
|
-
|
|
81510
|
+
if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
|
|
81511
|
+
const nonLocalMeanings = getSymbolFlags(
|
|
81507
81512
|
sym,
|
|
81508
81513
|
/*excludeTypeOnlyMeanings*/
|
|
81509
81514
|
false,
|
|
81510
81515
|
/*excludeLocalMeanings*/
|
|
81511
81516
|
true
|
|
81512
|
-
)
|
|
81517
|
+
);
|
|
81518
|
+
if (sym.flags & 2097152 /* Alias */ && nonLocalMeanings & 788968 /* Type */ && !(nonLocalMeanings & 111551 /* Value */) && (!typeOnlyDeclaration || getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node))) {
|
|
81513
81519
|
error(
|
|
81514
81520
|
id,
|
|
81515
81521
|
node.isExportEquals ? Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported : Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default,
|
package/lib/tsserver.js
CHANGED
|
@@ -2340,7 +2340,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2340
2340
|
|
|
2341
2341
|
// src/compiler/corePublic.ts
|
|
2342
2342
|
var versionMajorMinor = "5.4";
|
|
2343
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2343
|
+
var version = `${versionMajorMinor}.0-insiders.20240125`;
|
|
2344
2344
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2345
2345
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2346
2346
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -47541,7 +47541,11 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
|
|
|
47541
47541
|
if (modulePath.isRedirect) {
|
|
47542
47542
|
redirectPathsSpecifiers = append(redirectPathsSpecifiers, local);
|
|
47543
47543
|
} else if (pathIsBareSpecifier(local)) {
|
|
47544
|
-
|
|
47544
|
+
if (pathContainsNodeModules(local)) {
|
|
47545
|
+
relativeSpecifiers = append(relativeSpecifiers, local);
|
|
47546
|
+
} else {
|
|
47547
|
+
pathsSpecifiers = append(pathsSpecifiers, local);
|
|
47548
|
+
}
|
|
47545
47549
|
} else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) {
|
|
47546
47550
|
relativeSpecifiers = append(relativeSpecifiers, local);
|
|
47547
47551
|
}
|
|
@@ -62923,6 +62927,7 @@ function createTypeChecker(host) {
|
|
|
62923
62927
|
return links.resolvedType;
|
|
62924
62928
|
}
|
|
62925
62929
|
function getTemplateLiteralType(texts, types) {
|
|
62930
|
+
var _a, _b;
|
|
62926
62931
|
const unionIndex = findIndex(types, (t) => !!(t.flags & (131072 /* Never */ | 1048576 /* Union */)));
|
|
62927
62932
|
if (unionIndex >= 0) {
|
|
62928
62933
|
return checkCrossProductUnion(types) ? mapType(types[unionIndex], (t) => getTemplateLiteralType(texts, replaceElement(types, unionIndex, t))) : errorType;
|
|
@@ -62930,6 +62935,9 @@ function createTypeChecker(host) {
|
|
|
62930
62935
|
if (contains(types, wildcardType)) {
|
|
62931
62936
|
return wildcardType;
|
|
62932
62937
|
}
|
|
62938
|
+
if (texts.length === 2 && texts[0] === "" && texts[1] === "" && !(types[0].flags & 2944 /* Literal */) && !((_b = (_a = types[0].symbol) == null ? void 0 : _a.declarations) == null ? void 0 : _b.some((d) => d.parent.kind === 195 /* InferType */)) && isTypeAssignableTo(types[0], stringType)) {
|
|
62939
|
+
return types[0];
|
|
62940
|
+
}
|
|
62933
62941
|
const newTypes = [];
|
|
62934
62942
|
const newTexts = [];
|
|
62935
62943
|
let text = texts[0];
|
|
@@ -80825,19 +80833,16 @@ function createTypeChecker(host) {
|
|
|
80825
80833
|
}
|
|
80826
80834
|
}
|
|
80827
80835
|
}
|
|
80828
|
-
function
|
|
80836
|
+
function getReturnTypeOfSingleNonGenericCallSignature(funcType) {
|
|
80829
80837
|
const signature = getSingleCallSignature(funcType);
|
|
80830
|
-
if (signature) {
|
|
80831
|
-
|
|
80832
|
-
if (!signature.typeParameters || !couldContainTypeVariables(returnType)) {
|
|
80833
|
-
return returnType;
|
|
80834
|
-
}
|
|
80838
|
+
if (signature && !signature.typeParameters) {
|
|
80839
|
+
return getReturnTypeOfSignature(signature);
|
|
80835
80840
|
}
|
|
80836
80841
|
}
|
|
80837
80842
|
function getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) {
|
|
80838
80843
|
const funcType = checkExpression(expr.expression);
|
|
80839
80844
|
const nonOptionalType = getOptionalExpressionType(funcType, expr.expression);
|
|
80840
|
-
const returnType =
|
|
80845
|
+
const returnType = getReturnTypeOfSingleNonGenericCallSignature(funcType);
|
|
80841
80846
|
return returnType && propagateOptionalTypeMarker(returnType, expr, nonOptionalType !== funcType);
|
|
80842
80847
|
}
|
|
80843
80848
|
function getTypeOfExpression(node) {
|
|
@@ -80882,7 +80887,7 @@ function createTypeChecker(host) {
|
|
|
80882
80887
|
/*requireStringLiteralLikeArgument*/
|
|
80883
80888
|
true
|
|
80884
80889
|
) && !isSymbolOrSymbolForCall(expr)) {
|
|
80885
|
-
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) :
|
|
80890
|
+
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression));
|
|
80886
80891
|
} else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) {
|
|
80887
80892
|
return getTypeFromTypeNode(expr.type);
|
|
80888
80893
|
} else if (isLiteralExpression(node) || isBooleanLiteral(node)) {
|
|
@@ -86237,14 +86242,15 @@ function createTypeChecker(host) {
|
|
|
86237
86242
|
idText(id)
|
|
86238
86243
|
);
|
|
86239
86244
|
}
|
|
86240
|
-
if (!isIllegalExportDefaultInCJS && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
|
|
86241
|
-
|
|
86245
|
+
if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
|
|
86246
|
+
const nonLocalMeanings = getSymbolFlags(
|
|
86242
86247
|
sym,
|
|
86243
86248
|
/*excludeTypeOnlyMeanings*/
|
|
86244
86249
|
false,
|
|
86245
86250
|
/*excludeLocalMeanings*/
|
|
86246
86251
|
true
|
|
86247
|
-
)
|
|
86252
|
+
);
|
|
86253
|
+
if (sym.flags & 2097152 /* Alias */ && nonLocalMeanings & 788968 /* Type */ && !(nonLocalMeanings & 111551 /* Value */) && (!typeOnlyDeclaration || getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node))) {
|
|
86248
86254
|
error2(
|
|
86249
86255
|
id,
|
|
86250
86256
|
node.isExportEquals ? Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported : Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default,
|
package/lib/typescript.d.ts
CHANGED
|
@@ -205,7 +205,7 @@ declare namespace ts {
|
|
|
205
205
|
/**
|
|
206
206
|
* Request to reload the project structure for all the opened files
|
|
207
207
|
*/
|
|
208
|
-
interface ReloadProjectsRequest extends
|
|
208
|
+
interface ReloadProjectsRequest extends Request {
|
|
209
209
|
command: CommandTypes.ReloadProjects;
|
|
210
210
|
}
|
|
211
211
|
/**
|