@typescript-deploys/pr-build 5.1.0-pr-53098-13 → 5.1.0-pr-50951-3
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 +88 -67
- package/lib/tsserver.js +88 -77
- package/lib/tsserverlibrary.d.ts +1 -1
- package/lib/tsserverlibrary.js +89 -77
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +89 -76
- package/lib/typingsInstaller.js +39 -23
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -91,7 +91,6 @@ __export(server_exports, {
|
|
|
91
91
|
ImportKind: () => ImportKind,
|
|
92
92
|
ImportsNotUsedAsValues: () => ImportsNotUsedAsValues,
|
|
93
93
|
IndentStyle: () => IndentStyle,
|
|
94
|
-
IndexFlags: () => IndexFlags,
|
|
95
94
|
IndexKind: () => IndexKind,
|
|
96
95
|
InferenceFlags: () => InferenceFlags,
|
|
97
96
|
InferencePriority: () => InferencePriority,
|
|
@@ -2285,7 +2284,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2285
2284
|
|
|
2286
2285
|
// src/compiler/corePublic.ts
|
|
2287
2286
|
var versionMajorMinor = "5.1";
|
|
2288
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2287
|
+
var version = `${versionMajorMinor}.0-insiders.20230313`;
|
|
2289
2288
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2290
2289
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2291
2290
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3956,7 +3955,7 @@ function trimEndImpl(s) {
|
|
|
3956
3955
|
return s.slice(0, end + 1);
|
|
3957
3956
|
}
|
|
3958
3957
|
function isNodeLikeSystem() {
|
|
3959
|
-
return typeof process !== "undefined" && process.nextTick && !process.browser && typeof module === "object";
|
|
3958
|
+
return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof module === "object";
|
|
3960
3959
|
}
|
|
3961
3960
|
|
|
3962
3961
|
// src/compiler/debug.ts
|
|
@@ -6748,13 +6747,6 @@ var AccessFlags = /* @__PURE__ */ ((AccessFlags2) => {
|
|
|
6748
6747
|
AccessFlags2[AccessFlags2["Persistent"] = 1 /* IncludeUndefined */] = "Persistent";
|
|
6749
6748
|
return AccessFlags2;
|
|
6750
6749
|
})(AccessFlags || {});
|
|
6751
|
-
var IndexFlags = /* @__PURE__ */ ((IndexFlags2) => {
|
|
6752
|
-
IndexFlags2[IndexFlags2["None"] = 0] = "None";
|
|
6753
|
-
IndexFlags2[IndexFlags2["StringsOnly"] = 1] = "StringsOnly";
|
|
6754
|
-
IndexFlags2[IndexFlags2["NoIndexSignatures"] = 2] = "NoIndexSignatures";
|
|
6755
|
-
IndexFlags2[IndexFlags2["NoReducibleCheck"] = 4] = "NoReducibleCheck";
|
|
6756
|
-
return IndexFlags2;
|
|
6757
|
-
})(IndexFlags || {});
|
|
6758
6750
|
var JsxReferenceKind = /* @__PURE__ */ ((JsxReferenceKind2) => {
|
|
6759
6751
|
JsxReferenceKind2[JsxReferenceKind2["Component"] = 0] = "Component";
|
|
6760
6752
|
JsxReferenceKind2[JsxReferenceKind2["Function"] = 1] = "Function";
|
|
@@ -8360,7 +8352,7 @@ var sys = (() => {
|
|
|
8360
8352
|
getAccessibleSortedChildDirectories: (path) => getAccessibleFileSystemEntries(path).directories,
|
|
8361
8353
|
realpath,
|
|
8362
8354
|
tscWatchFile: process.env.TSC_WATCHFILE,
|
|
8363
|
-
useNonPollingWatchers: process.env.TSC_NONPOLLING_WATCHER,
|
|
8355
|
+
useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER,
|
|
8364
8356
|
tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
|
|
8365
8357
|
inodeWatching: isLinuxOrMacOs,
|
|
8366
8358
|
sysLog
|
|
@@ -8446,8 +8438,10 @@ var sys = (() => {
|
|
|
8446
8438
|
process.stdout.write("\x1Bc");
|
|
8447
8439
|
},
|
|
8448
8440
|
setBlocking: () => {
|
|
8449
|
-
|
|
8450
|
-
|
|
8441
|
+
var _a2;
|
|
8442
|
+
const handle = (_a2 = process.stdout) == null ? void 0 : _a2._handle;
|
|
8443
|
+
if (handle && handle.setBlocking) {
|
|
8444
|
+
handle.setBlocking(true);
|
|
8451
8445
|
}
|
|
8452
8446
|
},
|
|
8453
8447
|
bufferFrom,
|
|
@@ -13844,32 +13838,36 @@ function getModifiers(node) {
|
|
|
13844
13838
|
return filter(node.modifiers, isModifier);
|
|
13845
13839
|
}
|
|
13846
13840
|
}
|
|
13847
|
-
function getJSDocParameterTagsWorker(
|
|
13848
|
-
|
|
13849
|
-
|
|
13850
|
-
|
|
13851
|
-
|
|
13852
|
-
|
|
13853
|
-
|
|
13854
|
-
|
|
13855
|
-
|
|
13856
|
-
|
|
13857
|
-
|
|
13858
|
-
|
|
13841
|
+
function getJSDocParameterTagsWorker(node, noCache) {
|
|
13842
|
+
const declaration = getRootDeclaration(node);
|
|
13843
|
+
if (isParameter(declaration)) {
|
|
13844
|
+
const name = node.name;
|
|
13845
|
+
const signatureDeclaration = declaration.parent;
|
|
13846
|
+
const jsDocParameterTags = filter(getJSDocTagsWorker(signatureDeclaration, noCache), isJSDocParameterTag);
|
|
13847
|
+
if (length(jsDocParameterTags) === 0) {
|
|
13848
|
+
return emptyArray;
|
|
13849
|
+
}
|
|
13850
|
+
if (isIdentifier(name)) {
|
|
13851
|
+
return filter(jsDocParameterTags, (tag) => isIdentifier(tag.name) && tag.name.escapedText === name.escapedText);
|
|
13852
|
+
}
|
|
13853
|
+
const i = signatureDeclaration.parameters.indexOf(declaration);
|
|
13854
|
+
Debug.assert(i > -1, "Parameters should always be in their parents' parameter list");
|
|
13855
|
+
if (i < length(jsDocParameterTags)) {
|
|
13856
|
+
return [jsDocParameterTags[i]];
|
|
13859
13857
|
}
|
|
13860
13858
|
}
|
|
13861
13859
|
return emptyArray;
|
|
13862
13860
|
}
|
|
13863
|
-
function getJSDocParameterTags(
|
|
13861
|
+
function getJSDocParameterTags(node) {
|
|
13864
13862
|
return getJSDocParameterTagsWorker(
|
|
13865
|
-
|
|
13863
|
+
node,
|
|
13866
13864
|
/*noCache*/
|
|
13867
13865
|
false
|
|
13868
13866
|
);
|
|
13869
13867
|
}
|
|
13870
|
-
function getJSDocParameterTagsNoCache(
|
|
13868
|
+
function getJSDocParameterTagsNoCache(node) {
|
|
13871
13869
|
return getJSDocParameterTagsWorker(
|
|
13872
|
-
|
|
13870
|
+
node,
|
|
13873
13871
|
/*noCache*/
|
|
13874
13872
|
true
|
|
13875
13873
|
);
|
|
@@ -17528,7 +17526,7 @@ function getJSDocCommentsAndTags(hostNode, noCache) {
|
|
|
17528
17526
|
if (hasJSDocNodes(node)) {
|
|
17529
17527
|
result = addRange(result, filterOwnedJSDocTags(hostNode, last(node.jsDoc)));
|
|
17530
17528
|
}
|
|
17531
|
-
if (node.kind === 167 /* Parameter */) {
|
|
17529
|
+
if (node.kind === 167 /* Parameter */ || node.kind === 206 /* BindingElement */) {
|
|
17532
17530
|
result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
|
|
17533
17531
|
break;
|
|
17534
17532
|
}
|
|
@@ -40978,6 +40976,10 @@ function getOriginalAndResolvedFileName(fileName, host, traceEnabled) {
|
|
|
40978
40976
|
originalPath: pathsAreEqual ? void 0 : fileName
|
|
40979
40977
|
};
|
|
40980
40978
|
}
|
|
40979
|
+
function getCandidateFromTypeRoot(typeRoot, typeReferenceDirectiveName, moduleResolutionState) {
|
|
40980
|
+
const nameForLookup = endsWith(typeRoot, "/node_modules/@types") || endsWith(typeRoot, "/node_modules/@types/") ? mangleScopedPackageNameWithTrace(typeReferenceDirectiveName, moduleResolutionState) : typeReferenceDirectiveName;
|
|
40981
|
+
return combinePaths(typeRoot, nameForLookup);
|
|
40982
|
+
}
|
|
40981
40983
|
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache, resolutionMode) {
|
|
40982
40984
|
Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.");
|
|
40983
40985
|
const traceEnabled = isTraceEnabled(options, host);
|
|
@@ -41096,7 +41098,7 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
41096
41098
|
trace(host, Diagnostics.Resolving_with_primary_search_path_0, typeRoots.join(", "));
|
|
41097
41099
|
}
|
|
41098
41100
|
return firstDefined(typeRoots, (typeRoot) => {
|
|
41099
|
-
const candidate =
|
|
41101
|
+
const candidate = getCandidateFromTypeRoot(typeRoot, typeReferenceDirectiveName, moduleResolutionState);
|
|
41100
41102
|
const directoryExists = directoryProbablyExists(typeRoot, host);
|
|
41101
41103
|
if (!directoryExists && traceEnabled) {
|
|
41102
41104
|
trace(host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, typeRoot);
|
|
@@ -43221,7 +43223,7 @@ function resolveFromTypeRoot(moduleName, state) {
|
|
|
43221
43223
|
if (!state.compilerOptions.typeRoots)
|
|
43222
43224
|
return;
|
|
43223
43225
|
for (const typeRoot of state.compilerOptions.typeRoots) {
|
|
43224
|
-
const candidate =
|
|
43226
|
+
const candidate = getCandidateFromTypeRoot(typeRoot, moduleName, state);
|
|
43225
43227
|
const directoryExists = directoryProbablyExists(typeRoot, state.host);
|
|
43226
43228
|
if (!directoryExists && state.traceEnabled) {
|
|
43227
43229
|
trace(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, typeRoot);
|
|
@@ -47272,7 +47274,6 @@ function createTypeChecker(host) {
|
|
|
47272
47274
|
var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
|
|
47273
47275
|
var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
47274
47276
|
var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
|
|
47275
|
-
var defaultIndexFlags = keyofStringsOnly ? 1 /* StringsOnly */ : 0 /* None */;
|
|
47276
47277
|
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */;
|
|
47277
47278
|
var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
|
|
47278
47279
|
var checkBinaryExpression = createCheckBinaryExpression();
|
|
@@ -58541,13 +58542,6 @@ function createTypeChecker(host) {
|
|
|
58541
58542
|
function isConflictingPrivateProperty(prop) {
|
|
58542
58543
|
return !prop.valueDeclaration && !!(getCheckFlags(prop) & 1024 /* ContainsPrivate */);
|
|
58543
58544
|
}
|
|
58544
|
-
function isGenericReducibleType(type) {
|
|
58545
|
-
return !!(type.flags & 1048576 /* Union */ && type.objectFlags & 16777216 /* ContainsIntersections */ && some(type.types, isGenericReducibleType) || type.flags & 2097152 /* Intersection */ && isReducibleIntersection(type));
|
|
58546
|
-
}
|
|
58547
|
-
function isReducibleIntersection(type) {
|
|
58548
|
-
const uniqueFilled = type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
|
|
58549
|
-
return getReducedType(uniqueFilled) !== uniqueFilled;
|
|
58550
|
-
}
|
|
58551
58545
|
function elaborateNeverIntersection(errorInfo, type) {
|
|
58552
58546
|
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 33554432 /* IsNeverIntersection */) {
|
|
58553
58547
|
const neverProp = find(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType);
|
|
@@ -60917,10 +60911,10 @@ function createTypeChecker(host) {
|
|
|
60917
60911
|
}
|
|
60918
60912
|
return links.resolvedType;
|
|
60919
60913
|
}
|
|
60920
|
-
function createIndexType(type,
|
|
60914
|
+
function createIndexType(type, stringsOnly) {
|
|
60921
60915
|
const result = createType(4194304 /* Index */);
|
|
60922
60916
|
result.type = type;
|
|
60923
|
-
result.
|
|
60917
|
+
result.stringsOnly = stringsOnly;
|
|
60924
60918
|
return result;
|
|
60925
60919
|
}
|
|
60926
60920
|
function createOriginIndexType(type) {
|
|
@@ -60928,23 +60922,31 @@ function createTypeChecker(host) {
|
|
|
60928
60922
|
result.type = type;
|
|
60929
60923
|
return result;
|
|
60930
60924
|
}
|
|
60931
|
-
function getIndexTypeForGenericType(type,
|
|
60932
|
-
return
|
|
60925
|
+
function getIndexTypeForGenericType(type, stringsOnly) {
|
|
60926
|
+
return stringsOnly ? type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(
|
|
60927
|
+
type,
|
|
60928
|
+
/*stringsOnly*/
|
|
60929
|
+
true
|
|
60930
|
+
)) : type.resolvedIndexType || (type.resolvedIndexType = createIndexType(
|
|
60931
|
+
type,
|
|
60932
|
+
/*stringsOnly*/
|
|
60933
|
+
false
|
|
60934
|
+
));
|
|
60933
60935
|
}
|
|
60934
|
-
function getIndexTypeForMappedType(type,
|
|
60936
|
+
function getIndexTypeForMappedType(type, stringsOnly, noIndexSignatures) {
|
|
60935
60937
|
const typeParameter = getTypeParameterFromMappedType(type);
|
|
60936
60938
|
const constraintType = getConstraintTypeFromMappedType(type);
|
|
60937
60939
|
const nameType = getNameTypeFromMappedType(type.target || type);
|
|
60938
|
-
if (!nameType && !
|
|
60940
|
+
if (!nameType && !noIndexSignatures) {
|
|
60939
60941
|
return constraintType;
|
|
60940
60942
|
}
|
|
60941
60943
|
const keyTypes = [];
|
|
60942
60944
|
if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
|
|
60943
60945
|
if (!isGenericIndexType(constraintType)) {
|
|
60944
60946
|
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
60945
|
-
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576 /* StringOrNumberLiteralOrUnique */,
|
|
60947
|
+
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576 /* StringOrNumberLiteralOrUnique */, stringsOnly, addMemberForKeyType);
|
|
60946
60948
|
} else {
|
|
60947
|
-
return getIndexTypeForGenericType(type,
|
|
60949
|
+
return getIndexTypeForGenericType(type, stringsOnly);
|
|
60948
60950
|
}
|
|
60949
60951
|
} else {
|
|
60950
60952
|
forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType);
|
|
@@ -60952,7 +60954,7 @@ function createTypeChecker(host) {
|
|
|
60952
60954
|
if (isGenericIndexType(constraintType)) {
|
|
60953
60955
|
forEachType(constraintType, addMemberForKeyType);
|
|
60954
60956
|
}
|
|
60955
|
-
const result =
|
|
60957
|
+
const result = noIndexSignatures ? filterType(getUnionType(keyTypes), (t) => !(t.flags & (1 /* Any */ | 4 /* String */))) : getUnionType(keyTypes);
|
|
60956
60958
|
if (result.flags & 1048576 /* Union */ && constraintType.flags & 1048576 /* Union */ && getTypeListId(result.types) === getTypeListId(constraintType.types)) {
|
|
60957
60959
|
return constraintType;
|
|
60958
60960
|
}
|
|
@@ -61005,15 +61007,19 @@ function createTypeChecker(host) {
|
|
|
61005
61007
|
origin
|
|
61006
61008
|
);
|
|
61007
61009
|
}
|
|
61008
|
-
function
|
|
61009
|
-
|
|
61010
|
+
function isPossiblyReducibleByInstantiation(type) {
|
|
61011
|
+
const uniqueFilled = getUniqueLiteralFilledInstantiation(type);
|
|
61012
|
+
return getReducedType(uniqueFilled) !== uniqueFilled;
|
|
61010
61013
|
}
|
|
61011
|
-
function
|
|
61014
|
+
function shouldDeferIndexType(type) {
|
|
61015
|
+
return !!(type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && !hasDistributiveNameType(type) || type.flags & 1048576 /* Union */ && some(type.types, isPossiblyReducibleByInstantiation) || type.flags & 2097152 /* Intersection */ && maybeTypeOfKind(type, 465829888 /* Instantiable */) && some(type.types, isEmptyAnonymousObjectType));
|
|
61016
|
+
}
|
|
61017
|
+
function getIndexType(type, stringsOnly = keyofStringsOnly, noIndexSignatures) {
|
|
61012
61018
|
type = getReducedType(type);
|
|
61013
|
-
return shouldDeferIndexType(type
|
|
61019
|
+
return shouldDeferIndexType(type) ? getIndexTypeForGenericType(type, stringsOnly) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, stringsOnly, noIndexSignatures))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, stringsOnly, noIndexSignatures))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, stringsOnly, noIndexSignatures) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : getLiteralTypeFromProperties(
|
|
61014
61020
|
type,
|
|
61015
|
-
(
|
|
61016
|
-
|
|
61021
|
+
(noIndexSignatures ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (stringsOnly ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */),
|
|
61022
|
+
stringsOnly === keyofStringsOnly && !noIndexSignatures
|
|
61017
61023
|
);
|
|
61018
61024
|
}
|
|
61019
61025
|
function getExtractStringType(type) {
|
|
@@ -61553,13 +61559,12 @@ function createTypeChecker(host) {
|
|
|
61553
61559
|
if (objectType === wildcardType || indexType === wildcardType) {
|
|
61554
61560
|
return wildcardType;
|
|
61555
61561
|
}
|
|
61556
|
-
objectType = getReducedType(objectType);
|
|
61557
61562
|
if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
|
|
61558
61563
|
indexType = stringType;
|
|
61559
61564
|
}
|
|
61560
61565
|
if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
|
|
61561
61566
|
accessFlags |= 1 /* IncludeUndefined */;
|
|
61562
|
-
if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 197 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength))
|
|
61567
|
+
if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 197 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) {
|
|
61563
61568
|
if (objectType.flags & 3 /* AnyOrUnknown */) {
|
|
61564
61569
|
return objectType;
|
|
61565
61570
|
}
|
|
@@ -62745,6 +62750,9 @@ function createTypeChecker(host) {
|
|
|
62745
62750
|
}
|
|
62746
62751
|
return type;
|
|
62747
62752
|
}
|
|
62753
|
+
function getUniqueLiteralFilledInstantiation(type) {
|
|
62754
|
+
return type.flags & (402784252 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
|
|
62755
|
+
}
|
|
62748
62756
|
function getPermissiveInstantiation(type) {
|
|
62749
62757
|
return type.flags & (402784252 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper));
|
|
62750
62758
|
}
|
|
@@ -63236,20 +63244,8 @@ function createTypeChecker(host) {
|
|
|
63236
63244
|
return result;
|
|
63237
63245
|
}
|
|
63238
63246
|
const moreThanOneRealChildren = length(validChildren) > 1;
|
|
63239
|
-
|
|
63240
|
-
|
|
63241
|
-
const iterableType = getGlobalIterableType(
|
|
63242
|
-
/*reportErrors*/
|
|
63243
|
-
false
|
|
63244
|
-
);
|
|
63245
|
-
if (iterableType !== emptyGenericType) {
|
|
63246
|
-
const anyIterable = createIterableType(anyType);
|
|
63247
|
-
arrayLikeTargetParts = filterType(childrenTargetType, (t) => isTypeAssignableTo(t, anyIterable));
|
|
63248
|
-
nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isTypeAssignableTo(t, anyIterable));
|
|
63249
|
-
} else {
|
|
63250
|
-
arrayLikeTargetParts = filterType(childrenTargetType, isArrayOrTupleLikeType);
|
|
63251
|
-
nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isArrayOrTupleLikeType(t));
|
|
63252
|
-
}
|
|
63247
|
+
const arrayLikeTargetParts = filterType(childrenTargetType, isAssignableToAvailableAnyIterable);
|
|
63248
|
+
const nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isAssignableToAvailableAnyIterable(t));
|
|
63253
63249
|
if (moreThanOneRealChildren) {
|
|
63254
63250
|
if (arrayLikeTargetParts !== neverType) {
|
|
63255
63251
|
const realSource = createTupleType(checkJsxChildren(containingElement, 0 /* Normal */));
|
|
@@ -64939,7 +64935,7 @@ function createTypeChecker(host) {
|
|
|
64939
64935
|
} else {
|
|
64940
64936
|
const constraint = getSimplifiedTypeOrConstraint(targetType);
|
|
64941
64937
|
if (constraint) {
|
|
64942
|
-
if (isRelatedTo(source2, getIndexType(constraint, target2.
|
|
64938
|
+
if (isRelatedTo(source2, getIndexType(constraint, target2.stringsOnly), 2 /* Target */, reportErrors2) === -1 /* True */) {
|
|
64943
64939
|
return -1 /* True */;
|
|
64944
64940
|
}
|
|
64945
64941
|
} else if (isGenericMappedType(targetType)) {
|
|
@@ -65020,7 +65016,13 @@ function createTypeChecker(host) {
|
|
|
65020
65016
|
}
|
|
65021
65017
|
if (!isGenericMappedType(source2)) {
|
|
65022
65018
|
const targetKeys = keysRemapped ? getNameTypeFromMappedType(target2) : getConstraintTypeFromMappedType(target2);
|
|
65023
|
-
const sourceKeys = getIndexType(
|
|
65019
|
+
const sourceKeys = getIndexType(
|
|
65020
|
+
source2,
|
|
65021
|
+
/*stringsOnly*/
|
|
65022
|
+
void 0,
|
|
65023
|
+
/*noIndexSignatures*/
|
|
65024
|
+
true
|
|
65025
|
+
);
|
|
65024
65026
|
const includeOptional = modifiers & 4 /* IncludeOptional */;
|
|
65025
65027
|
const filteredByApplicability = includeOptional ? intersectTypes(targetKeys, sourceKeys) : void 0;
|
|
65026
65028
|
if (includeOptional ? !(filteredByApplicability.flags & 131072 /* Never */) : isRelatedTo(targetKeys, sourceKeys, 3 /* Both */)) {
|
|
@@ -66529,6 +66531,13 @@ function createTypeChecker(host) {
|
|
|
66529
66531
|
function isArrayOrTupleLikeType(type) {
|
|
66530
66532
|
return isArrayLikeType(type) || isTupleLikeType(type);
|
|
66531
66533
|
}
|
|
66534
|
+
function isAssignableToAvailableAnyIterable(type) {
|
|
66535
|
+
const anyIterable = getGlobalIterableType(
|
|
66536
|
+
/*reportErrors*/
|
|
66537
|
+
false
|
|
66538
|
+
) !== emptyGenericType && createIterableType(anyType);
|
|
66539
|
+
return anyIterable ? isTypeAssignableTo(type, anyIterable) : isArrayOrTupleLikeType(type);
|
|
66540
|
+
}
|
|
66532
66541
|
function getTupleElementType(type, index) {
|
|
66533
66542
|
const propType = getTypeOfPropertyOfType(type, "" + index);
|
|
66534
66543
|
if (propType) {
|
|
@@ -71282,7 +71291,7 @@ function createTypeChecker(host) {
|
|
|
71282
71291
|
return void 0;
|
|
71283
71292
|
}
|
|
71284
71293
|
function getContextualTypeForElementExpression(arrayContextualType, index) {
|
|
71285
|
-
return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) || mapType(
|
|
71294
|
+
return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(filterType(arrayContextualType, (t) => !!getIndexTypeOfType(t, numberType) || isAssignableToAvailableAnyIterable(t)), "" + index) || mapType(
|
|
71286
71295
|
arrayContextualType,
|
|
71287
71296
|
(t) => isTupleType(t) ? getElementTypeOfSliceOfTupleType(
|
|
71288
71297
|
t,
|
|
@@ -79253,7 +79262,11 @@ function createTypeChecker(host) {
|
|
|
79253
79262
|
}
|
|
79254
79263
|
const objectType = type.objectType;
|
|
79255
79264
|
const indexType = type.indexType;
|
|
79256
|
-
if (isTypeAssignableTo(indexType, getIndexType(
|
|
79265
|
+
if (isTypeAssignableTo(indexType, getIndexType(
|
|
79266
|
+
objectType,
|
|
79267
|
+
/*stringsOnly*/
|
|
79268
|
+
false
|
|
79269
|
+
))) {
|
|
79257
79270
|
if (accessNode.kind === 210 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
|
|
79258
79271
|
error(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
|
|
79259
79272
|
}
|
|
@@ -168064,7 +168077,6 @@ __export(ts_exports3, {
|
|
|
168064
168077
|
ImportKind: () => ImportKind,
|
|
168065
168078
|
ImportsNotUsedAsValues: () => ImportsNotUsedAsValues,
|
|
168066
168079
|
IndentStyle: () => IndentStyle,
|
|
168067
|
-
IndexFlags: () => IndexFlags,
|
|
168068
168080
|
IndexKind: () => IndexKind,
|
|
168069
168081
|
InferenceFlags: () => InferenceFlags,
|
|
168070
168082
|
InferencePriority: () => InferencePriority,
|
|
@@ -182023,7 +182035,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
182023
182035
|
ImportKind,
|
|
182024
182036
|
ImportsNotUsedAsValues,
|
|
182025
182037
|
IndentStyle,
|
|
182026
|
-
IndexFlags,
|
|
182027
182038
|
IndexKind,
|
|
182028
182039
|
InferenceFlags,
|
|
182029
182040
|
InferencePriority,
|
package/lib/tsserverlibrary.d.ts
CHANGED
|
@@ -8518,7 +8518,7 @@ declare namespace ts {
|
|
|
8518
8518
|
*
|
|
8519
8519
|
* For binding patterns, parameter tags are matched by position.
|
|
8520
8520
|
*/
|
|
8521
|
-
function getJSDocParameterTags(
|
|
8521
|
+
function getJSDocParameterTags(node: ParameterDeclaration | BindingElement): readonly JSDocParameterTag[];
|
|
8522
8522
|
/**
|
|
8523
8523
|
* Gets the JSDoc type parameter tags for the node if present.
|
|
8524
8524
|
*
|