@typescript-deploys/pr-build 5.1.0-pr-50951-3 → 5.1.0-pr-53258-7
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 +2 -2
- package/lib/tsc.js +58 -77
- package/lib/tsserver.js +76 -77
- package/lib/tsserverlibrary.d.ts +1 -1
- package/lib/tsserverlibrary.js +77 -79
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +76 -79
- package/lib/typingsInstaller.js +19 -28
- package/package.json +3 -3
package/lib/tsserver.js
CHANGED
|
@@ -91,6 +91,7 @@ __export(server_exports, {
|
|
|
91
91
|
ImportKind: () => ImportKind,
|
|
92
92
|
ImportsNotUsedAsValues: () => ImportsNotUsedAsValues,
|
|
93
93
|
IndentStyle: () => IndentStyle,
|
|
94
|
+
IndexFlags: () => IndexFlags,
|
|
94
95
|
IndexKind: () => IndexKind,
|
|
95
96
|
InferenceFlags: () => InferenceFlags,
|
|
96
97
|
InferencePriority: () => InferencePriority,
|
|
@@ -2284,7 +2285,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2284
2285
|
|
|
2285
2286
|
// src/compiler/corePublic.ts
|
|
2286
2287
|
var versionMajorMinor = "5.1";
|
|
2287
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2288
|
+
var version = `${versionMajorMinor}.0-insiders.20230314`;
|
|
2288
2289
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2289
2290
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2290
2291
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6747,6 +6748,13 @@ var AccessFlags = /* @__PURE__ */ ((AccessFlags2) => {
|
|
|
6747
6748
|
AccessFlags2[AccessFlags2["Persistent"] = 1 /* IncludeUndefined */] = "Persistent";
|
|
6748
6749
|
return AccessFlags2;
|
|
6749
6750
|
})(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 || {});
|
|
6750
6758
|
var JsxReferenceKind = /* @__PURE__ */ ((JsxReferenceKind2) => {
|
|
6751
6759
|
JsxReferenceKind2[JsxReferenceKind2["Component"] = 0] = "Component";
|
|
6752
6760
|
JsxReferenceKind2[JsxReferenceKind2["Function"] = 1] = "Function";
|
|
@@ -9389,6 +9397,7 @@ var Diagnostics = {
|
|
|
9389
9397
|
Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5: diag(1250, 1 /* Error */, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'."),
|
|
9390
9398
|
Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode: diag(1251, 1 /* Error */, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Class definitions are automatically in strict mode."),
|
|
9391
9399
|
Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode: diag(1252, 1 /* Error */, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Modules are automatically in strict mode."),
|
|
9400
|
+
Abstract_properties_can_only_appear_within_an_abstract_class: diag(1253, 1 /* Error */, "Abstract_properties_can_only_appear_within_an_abstract_class_1253", "Abstract properties can only appear within an abstract class."),
|
|
9392
9401
|
A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference: diag(1254, 1 /* Error */, "A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254", "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference."),
|
|
9393
9402
|
A_definite_assignment_assertion_is_not_permitted_in_this_context: diag(1255, 1 /* Error */, "A_definite_assignment_assertion_is_not_permitted_in_this_context_1255", "A definite assignment assertion '!' is not permitted in this context."),
|
|
9394
9403
|
A_required_element_cannot_follow_an_optional_element: diag(1257, 1 /* Error */, "A_required_element_cannot_follow_an_optional_element_1257", "A required element cannot follow an optional element."),
|
|
@@ -13838,36 +13847,32 @@ function getModifiers(node) {
|
|
|
13838
13847
|
return filter(node.modifiers, isModifier);
|
|
13839
13848
|
}
|
|
13840
13849
|
}
|
|
13841
|
-
function getJSDocParameterTagsWorker(
|
|
13842
|
-
|
|
13843
|
-
|
|
13844
|
-
|
|
13845
|
-
|
|
13846
|
-
|
|
13847
|
-
|
|
13848
|
-
|
|
13849
|
-
|
|
13850
|
-
|
|
13851
|
-
|
|
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]];
|
|
13850
|
+
function getJSDocParameterTagsWorker(param, noCache) {
|
|
13851
|
+
if (param.name) {
|
|
13852
|
+
if (isIdentifier(param.name)) {
|
|
13853
|
+
const name = param.name.escapedText;
|
|
13854
|
+
return getJSDocTagsWorker(param.parent, noCache).filter((tag) => isJSDocParameterTag(tag) && isIdentifier(tag.name) && tag.name.escapedText === name);
|
|
13855
|
+
} else {
|
|
13856
|
+
const i = param.parent.parameters.indexOf(param);
|
|
13857
|
+
Debug.assert(i > -1, "Parameters should always be in their parents' parameter list");
|
|
13858
|
+
const paramTags = getJSDocTagsWorker(param.parent, noCache).filter(isJSDocParameterTag);
|
|
13859
|
+
if (i < paramTags.length) {
|
|
13860
|
+
return [paramTags[i]];
|
|
13861
|
+
}
|
|
13857
13862
|
}
|
|
13858
13863
|
}
|
|
13859
13864
|
return emptyArray;
|
|
13860
13865
|
}
|
|
13861
|
-
function getJSDocParameterTags(
|
|
13866
|
+
function getJSDocParameterTags(param) {
|
|
13862
13867
|
return getJSDocParameterTagsWorker(
|
|
13863
|
-
|
|
13868
|
+
param,
|
|
13864
13869
|
/*noCache*/
|
|
13865
13870
|
false
|
|
13866
13871
|
);
|
|
13867
13872
|
}
|
|
13868
|
-
function getJSDocParameterTagsNoCache(
|
|
13873
|
+
function getJSDocParameterTagsNoCache(param) {
|
|
13869
13874
|
return getJSDocParameterTagsWorker(
|
|
13870
|
-
|
|
13875
|
+
param,
|
|
13871
13876
|
/*noCache*/
|
|
13872
13877
|
true
|
|
13873
13878
|
);
|
|
@@ -17526,7 +17531,7 @@ function getJSDocCommentsAndTags(hostNode, noCache) {
|
|
|
17526
17531
|
if (hasJSDocNodes(node)) {
|
|
17527
17532
|
result = addRange(result, filterOwnedJSDocTags(hostNode, last(node.jsDoc)));
|
|
17528
17533
|
}
|
|
17529
|
-
if (node.kind === 167 /* Parameter */
|
|
17534
|
+
if (node.kind === 167 /* Parameter */) {
|
|
17530
17535
|
result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
|
|
17531
17536
|
break;
|
|
17532
17537
|
}
|
|
@@ -47274,6 +47279,7 @@ function createTypeChecker(host) {
|
|
|
47274
47279
|
var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
|
|
47275
47280
|
var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
47276
47281
|
var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
|
|
47282
|
+
var defaultIndexFlags = keyofStringsOnly ? 1 /* StringsOnly */ : 0 /* None */;
|
|
47277
47283
|
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */;
|
|
47278
47284
|
var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
|
|
47279
47285
|
var checkBinaryExpression = createCheckBinaryExpression();
|
|
@@ -58542,6 +58548,13 @@ function createTypeChecker(host) {
|
|
|
58542
58548
|
function isConflictingPrivateProperty(prop) {
|
|
58543
58549
|
return !prop.valueDeclaration && !!(getCheckFlags(prop) & 1024 /* ContainsPrivate */);
|
|
58544
58550
|
}
|
|
58551
|
+
function isGenericReducibleType(type) {
|
|
58552
|
+
return !!(type.flags & 1048576 /* Union */ && type.objectFlags & 16777216 /* ContainsIntersections */ && some(type.types, isGenericReducibleType) || type.flags & 2097152 /* Intersection */ && isReducibleIntersection(type));
|
|
58553
|
+
}
|
|
58554
|
+
function isReducibleIntersection(type) {
|
|
58555
|
+
const uniqueFilled = type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
|
|
58556
|
+
return getReducedType(uniqueFilled) !== uniqueFilled;
|
|
58557
|
+
}
|
|
58545
58558
|
function elaborateNeverIntersection(errorInfo, type) {
|
|
58546
58559
|
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 33554432 /* IsNeverIntersection */) {
|
|
58547
58560
|
const neverProp = find(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType);
|
|
@@ -60911,10 +60924,10 @@ function createTypeChecker(host) {
|
|
|
60911
60924
|
}
|
|
60912
60925
|
return links.resolvedType;
|
|
60913
60926
|
}
|
|
60914
|
-
function createIndexType(type,
|
|
60927
|
+
function createIndexType(type, indexFlags) {
|
|
60915
60928
|
const result = createType(4194304 /* Index */);
|
|
60916
60929
|
result.type = type;
|
|
60917
|
-
result.
|
|
60930
|
+
result.indexFlags = indexFlags;
|
|
60918
60931
|
return result;
|
|
60919
60932
|
}
|
|
60920
60933
|
function createOriginIndexType(type) {
|
|
@@ -60922,31 +60935,23 @@ function createTypeChecker(host) {
|
|
|
60922
60935
|
result.type = type;
|
|
60923
60936
|
return result;
|
|
60924
60937
|
}
|
|
60925
|
-
function getIndexTypeForGenericType(type,
|
|
60926
|
-
return
|
|
60927
|
-
type,
|
|
60928
|
-
/*stringsOnly*/
|
|
60929
|
-
true
|
|
60930
|
-
)) : type.resolvedIndexType || (type.resolvedIndexType = createIndexType(
|
|
60931
|
-
type,
|
|
60932
|
-
/*stringsOnly*/
|
|
60933
|
-
false
|
|
60934
|
-
));
|
|
60938
|
+
function getIndexTypeForGenericType(type, indexFlags) {
|
|
60939
|
+
return indexFlags & 1 /* StringsOnly */ ? type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(type, 1 /* StringsOnly */)) : type.resolvedIndexType || (type.resolvedIndexType = createIndexType(type, 0 /* None */));
|
|
60935
60940
|
}
|
|
60936
|
-
function getIndexTypeForMappedType(type,
|
|
60941
|
+
function getIndexTypeForMappedType(type, indexFlags) {
|
|
60937
60942
|
const typeParameter = getTypeParameterFromMappedType(type);
|
|
60938
60943
|
const constraintType = getConstraintTypeFromMappedType(type);
|
|
60939
60944
|
const nameType = getNameTypeFromMappedType(type.target || type);
|
|
60940
|
-
if (!nameType && !
|
|
60945
|
+
if (!nameType && !(indexFlags & 2 /* NoIndexSignatures */)) {
|
|
60941
60946
|
return constraintType;
|
|
60942
60947
|
}
|
|
60943
60948
|
const keyTypes = [];
|
|
60944
60949
|
if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
|
|
60945
60950
|
if (!isGenericIndexType(constraintType)) {
|
|
60946
60951
|
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
60947
|
-
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576 /* StringOrNumberLiteralOrUnique */,
|
|
60952
|
+
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576 /* StringOrNumberLiteralOrUnique */, !!(indexFlags & 1 /* StringsOnly */), addMemberForKeyType);
|
|
60948
60953
|
} else {
|
|
60949
|
-
return getIndexTypeForGenericType(type,
|
|
60954
|
+
return getIndexTypeForGenericType(type, indexFlags);
|
|
60950
60955
|
}
|
|
60951
60956
|
} else {
|
|
60952
60957
|
forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType);
|
|
@@ -60954,7 +60959,7 @@ function createTypeChecker(host) {
|
|
|
60954
60959
|
if (isGenericIndexType(constraintType)) {
|
|
60955
60960
|
forEachType(constraintType, addMemberForKeyType);
|
|
60956
60961
|
}
|
|
60957
|
-
const result =
|
|
60962
|
+
const result = indexFlags & 2 /* NoIndexSignatures */ ? filterType(getUnionType(keyTypes), (t) => !(t.flags & (1 /* Any */ | 4 /* String */))) : getUnionType(keyTypes);
|
|
60958
60963
|
if (result.flags & 1048576 /* Union */ && constraintType.flags & 1048576 /* Union */ && getTypeListId(result.types) === getTypeListId(constraintType.types)) {
|
|
60959
60964
|
return constraintType;
|
|
60960
60965
|
}
|
|
@@ -61007,19 +61012,15 @@ function createTypeChecker(host) {
|
|
|
61007
61012
|
origin
|
|
61008
61013
|
);
|
|
61009
61014
|
}
|
|
61010
|
-
function
|
|
61011
|
-
|
|
61012
|
-
return getReducedType(uniqueFilled) !== uniqueFilled;
|
|
61015
|
+
function shouldDeferIndexType(type, indexFlags = 0 /* None */) {
|
|
61016
|
+
return !!(type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && !hasDistributiveNameType(type) || type.flags & 1048576 /* Union */ && !(indexFlags & 4 /* NoReducibleCheck */) && isGenericReducibleType(type) || type.flags & 2097152 /* Intersection */ && maybeTypeOfKind(type, 465829888 /* Instantiable */) && some(type.types, isEmptyAnonymousObjectType));
|
|
61013
61017
|
}
|
|
61014
|
-
function
|
|
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) {
|
|
61018
|
+
function getIndexType(type, indexFlags = defaultIndexFlags) {
|
|
61018
61019
|
type = getReducedType(type);
|
|
61019
|
-
return shouldDeferIndexType(type) ? getIndexTypeForGenericType(type,
|
|
61020
|
+
return shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : getLiteralTypeFromProperties(
|
|
61020
61021
|
type,
|
|
61021
|
-
(
|
|
61022
|
-
|
|
61022
|
+
(indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */),
|
|
61023
|
+
indexFlags === defaultIndexFlags
|
|
61023
61024
|
);
|
|
61024
61025
|
}
|
|
61025
61026
|
function getExtractStringType(type) {
|
|
@@ -61559,12 +61560,13 @@ function createTypeChecker(host) {
|
|
|
61559
61560
|
if (objectType === wildcardType || indexType === wildcardType) {
|
|
61560
61561
|
return wildcardType;
|
|
61561
61562
|
}
|
|
61563
|
+
objectType = getReducedType(objectType);
|
|
61562
61564
|
if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
|
|
61563
61565
|
indexType = stringType;
|
|
61564
61566
|
}
|
|
61565
61567
|
if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
|
|
61566
61568
|
accessFlags |= 1 /* IncludeUndefined */;
|
|
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)))) {
|
|
61569
|
+
if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 197 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)) || isGenericReducibleType(objectType))) {
|
|
61568
61570
|
if (objectType.flags & 3 /* AnyOrUnknown */) {
|
|
61569
61571
|
return objectType;
|
|
61570
61572
|
}
|
|
@@ -62750,9 +62752,6 @@ function createTypeChecker(host) {
|
|
|
62750
62752
|
}
|
|
62751
62753
|
return type;
|
|
62752
62754
|
}
|
|
62753
|
-
function getUniqueLiteralFilledInstantiation(type) {
|
|
62754
|
-
return type.flags & (402784252 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
|
|
62755
|
-
}
|
|
62756
62755
|
function getPermissiveInstantiation(type) {
|
|
62757
62756
|
return type.flags & (402784252 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper));
|
|
62758
62757
|
}
|
|
@@ -63464,7 +63463,12 @@ function createTypeChecker(host) {
|
|
|
63464
63463
|
const paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount);
|
|
63465
63464
|
const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
|
|
63466
63465
|
for (let i = 0; i < paramCount; i++) {
|
|
63467
|
-
const sourceType = i === restIndex ? getRestTypeAtPosition(
|
|
63466
|
+
const sourceType = i === restIndex ? getRestTypeAtPosition(
|
|
63467
|
+
source,
|
|
63468
|
+
i,
|
|
63469
|
+
/*readonly*/
|
|
63470
|
+
true
|
|
63471
|
+
) : tryGetTypeAtPosition(source, i);
|
|
63468
63472
|
const targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
|
|
63469
63473
|
if (sourceType && targetType) {
|
|
63470
63474
|
const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
|
|
@@ -64935,7 +64939,7 @@ function createTypeChecker(host) {
|
|
|
64935
64939
|
} else {
|
|
64936
64940
|
const constraint = getSimplifiedTypeOrConstraint(targetType);
|
|
64937
64941
|
if (constraint) {
|
|
64938
|
-
if (isRelatedTo(source2, getIndexType(constraint, target2.
|
|
64942
|
+
if (isRelatedTo(source2, getIndexType(constraint, target2.indexFlags | 4 /* NoReducibleCheck */), 2 /* Target */, reportErrors2) === -1 /* True */) {
|
|
64939
64943
|
return -1 /* True */;
|
|
64940
64944
|
}
|
|
64941
64945
|
} else if (isGenericMappedType(targetType)) {
|
|
@@ -65016,13 +65020,7 @@ function createTypeChecker(host) {
|
|
|
65016
65020
|
}
|
|
65017
65021
|
if (!isGenericMappedType(source2)) {
|
|
65018
65022
|
const targetKeys = keysRemapped ? getNameTypeFromMappedType(target2) : getConstraintTypeFromMappedType(target2);
|
|
65019
|
-
const sourceKeys = getIndexType(
|
|
65020
|
-
source2,
|
|
65021
|
-
/*stringsOnly*/
|
|
65022
|
-
void 0,
|
|
65023
|
-
/*noIndexSignatures*/
|
|
65024
|
-
true
|
|
65025
|
-
);
|
|
65023
|
+
const sourceKeys = getIndexType(source2, 2 /* NoIndexSignatures */);
|
|
65026
65024
|
const includeOptional = modifiers & 4 /* IncludeOptional */;
|
|
65027
65025
|
const filteredByApplicability = includeOptional ? intersectTypes(targetKeys, sourceKeys) : void 0;
|
|
65028
65026
|
if (includeOptional ? !(filteredByApplicability.flags & 131072 /* Never */) : isRelatedTo(targetKeys, sourceKeys, 3 /* Both */)) {
|
|
@@ -75955,12 +75953,12 @@ function createTypeChecker(host) {
|
|
|
75955
75953
|
}
|
|
75956
75954
|
return void 0;
|
|
75957
75955
|
}
|
|
75958
|
-
function getRestTypeAtPosition(source, pos) {
|
|
75956
|
+
function getRestTypeAtPosition(source, pos, readonly = false) {
|
|
75959
75957
|
const parameterCount = getParameterCount(source);
|
|
75960
75958
|
const minArgumentCount = getMinArgumentCount(source);
|
|
75961
75959
|
const restType = getEffectiveRestType(source);
|
|
75962
75960
|
if (restType && pos >= parameterCount - 1) {
|
|
75963
|
-
return pos === parameterCount - 1 ? restType : createArrayType(getIndexedAccessType(restType, numberType));
|
|
75961
|
+
return pos === parameterCount - 1 ? restType : createArrayType(getIndexedAccessType(restType, numberType), readonly);
|
|
75964
75962
|
}
|
|
75965
75963
|
const types = [];
|
|
75966
75964
|
const flags = [];
|
|
@@ -75978,13 +75976,7 @@ function createTypeChecker(host) {
|
|
|
75978
75976
|
names.push(name);
|
|
75979
75977
|
}
|
|
75980
75978
|
}
|
|
75981
|
-
return createTupleType(
|
|
75982
|
-
types,
|
|
75983
|
-
flags,
|
|
75984
|
-
/*readonly*/
|
|
75985
|
-
false,
|
|
75986
|
-
length(names) === length(types) ? names : void 0
|
|
75987
|
-
);
|
|
75979
|
+
return createTupleType(types, flags, readonly, length(names) === length(types) ? names : void 0);
|
|
75988
75980
|
}
|
|
75989
75981
|
function getParameterCount(signature) {
|
|
75990
75982
|
const length2 = signature.parameters.length;
|
|
@@ -79262,11 +79254,7 @@ function createTypeChecker(host) {
|
|
|
79262
79254
|
}
|
|
79263
79255
|
const objectType = type.objectType;
|
|
79264
79256
|
const indexType = type.indexType;
|
|
79265
|
-
if (isTypeAssignableTo(indexType, getIndexType(
|
|
79266
|
-
objectType,
|
|
79267
|
-
/*stringsOnly*/
|
|
79268
|
-
false
|
|
79269
|
-
))) {
|
|
79257
|
+
if (isTypeAssignableTo(indexType, getIndexType(objectType, 0 /* None */))) {
|
|
79270
79258
|
if (accessNode.kind === 210 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
|
|
79271
79259
|
error(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
|
|
79272
79260
|
}
|
|
@@ -86086,7 +86074,8 @@ function createTypeChecker(host) {
|
|
|
86086
86074
|
return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);
|
|
86087
86075
|
}
|
|
86088
86076
|
if (!(node.parent.kind === 261 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) {
|
|
86089
|
-
|
|
86077
|
+
const message = node.kind === 170 /* PropertyDeclaration */ ? Diagnostics.Abstract_properties_can_only_appear_within_an_abstract_class : Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class;
|
|
86078
|
+
return grammarErrorOnNode(modifier, message);
|
|
86090
86079
|
}
|
|
86091
86080
|
if (flags & 32 /* Static */) {
|
|
86092
86081
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract");
|
|
@@ -133512,6 +133501,11 @@ function canBeConvertedToAsync(node) {
|
|
|
133512
133501
|
}
|
|
133513
133502
|
|
|
133514
133503
|
// src/services/transpile.ts
|
|
133504
|
+
var optionsRedundantWithVerbatimModuleSyntax = /* @__PURE__ */ new Set([
|
|
133505
|
+
"isolatedModules",
|
|
133506
|
+
"preserveValueImports",
|
|
133507
|
+
"importsNotUsedAsValues"
|
|
133508
|
+
]);
|
|
133515
133509
|
function transpileModule(input, transpileOptions) {
|
|
133516
133510
|
const diagnostics = [];
|
|
133517
133511
|
const options = transpileOptions.compilerOptions ? fixupCompilerOptions(transpileOptions.compilerOptions, diagnostics) : {};
|
|
@@ -133522,6 +133516,9 @@ function transpileModule(input, transpileOptions) {
|
|
|
133522
133516
|
}
|
|
133523
133517
|
}
|
|
133524
133518
|
for (const option of transpileOptionValueCompilerOptions) {
|
|
133519
|
+
if (options.verbatimModuleSyntax && optionsRedundantWithVerbatimModuleSyntax.has(option.name)) {
|
|
133520
|
+
continue;
|
|
133521
|
+
}
|
|
133525
133522
|
options[option.name] = option.transpileOptionValue;
|
|
133526
133523
|
}
|
|
133527
133524
|
options.suppressOutputPathCheck = true;
|
|
@@ -168077,6 +168074,7 @@ __export(ts_exports3, {
|
|
|
168077
168074
|
ImportKind: () => ImportKind,
|
|
168078
168075
|
ImportsNotUsedAsValues: () => ImportsNotUsedAsValues,
|
|
168079
168076
|
IndentStyle: () => IndentStyle,
|
|
168077
|
+
IndexFlags: () => IndexFlags,
|
|
168080
168078
|
IndexKind: () => IndexKind,
|
|
168081
168079
|
InferenceFlags: () => InferenceFlags,
|
|
168082
168080
|
InferencePriority: () => InferencePriority,
|
|
@@ -182035,6 +182033,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
182035
182033
|
ImportKind,
|
|
182036
182034
|
ImportsNotUsedAsValues,
|
|
182037
182035
|
IndentStyle,
|
|
182036
|
+
IndexFlags,
|
|
182038
182037
|
IndexKind,
|
|
182039
182038
|
InferenceFlags,
|
|
182040
182039
|
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(param: ParameterDeclaration): readonly JSDocParameterTag[];
|
|
8522
8522
|
/**
|
|
8523
8523
|
* Gets the JSDoc type parameter tags for the node if present.
|
|
8524
8524
|
*
|