@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/tsserverlibrary.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230314`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3545,7 +3545,7 @@ ${lanes.join("\n")}
|
|
|
3545
3545
|
const name = DiagnosticCategory[d.category];
|
|
3546
3546
|
return lowerCase ? name.toLowerCase() : name;
|
|
3547
3547
|
}
|
|
3548
|
-
var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, InternalEmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas;
|
|
3548
|
+
var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, IndexFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, InternalEmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas;
|
|
3549
3549
|
var init_types = __esm({
|
|
3550
3550
|
"src/compiler/types.ts"() {
|
|
3551
3551
|
"use strict";
|
|
@@ -4556,6 +4556,13 @@ ${lanes.join("\n")}
|
|
|
4556
4556
|
AccessFlags2[AccessFlags2["Persistent"] = 1 /* IncludeUndefined */] = "Persistent";
|
|
4557
4557
|
return AccessFlags2;
|
|
4558
4558
|
})(AccessFlags || {});
|
|
4559
|
+
IndexFlags = /* @__PURE__ */ ((IndexFlags2) => {
|
|
4560
|
+
IndexFlags2[IndexFlags2["None"] = 0] = "None";
|
|
4561
|
+
IndexFlags2[IndexFlags2["StringsOnly"] = 1] = "StringsOnly";
|
|
4562
|
+
IndexFlags2[IndexFlags2["NoIndexSignatures"] = 2] = "NoIndexSignatures";
|
|
4563
|
+
IndexFlags2[IndexFlags2["NoReducibleCheck"] = 4] = "NoReducibleCheck";
|
|
4564
|
+
return IndexFlags2;
|
|
4565
|
+
})(IndexFlags || {});
|
|
4559
4566
|
JsxReferenceKind = /* @__PURE__ */ ((JsxReferenceKind2) => {
|
|
4560
4567
|
JsxReferenceKind2[JsxReferenceKind2["Component"] = 0] = "Component";
|
|
4561
4568
|
JsxReferenceKind2[JsxReferenceKind2["Function"] = 1] = "Function";
|
|
@@ -7215,6 +7222,7 @@ ${lanes.join("\n")}
|
|
|
7215
7222
|
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'."),
|
|
7216
7223
|
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."),
|
|
7217
7224
|
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."),
|
|
7225
|
+
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."),
|
|
7218
7226
|
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."),
|
|
7219
7227
|
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."),
|
|
7220
7228
|
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."),
|
|
@@ -11671,36 +11679,32 @@ ${lanes.join("\n")}
|
|
|
11671
11679
|
return filter(node.modifiers, isModifier);
|
|
11672
11680
|
}
|
|
11673
11681
|
}
|
|
11674
|
-
function getJSDocParameterTagsWorker(
|
|
11675
|
-
|
|
11676
|
-
|
|
11677
|
-
|
|
11678
|
-
|
|
11679
|
-
|
|
11680
|
-
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
const i = signatureDeclaration.parameters.indexOf(declaration);
|
|
11687
|
-
Debug.assert(i > -1, "Parameters should always be in their parents' parameter list");
|
|
11688
|
-
if (i < length(jsDocParameterTags)) {
|
|
11689
|
-
return [jsDocParameterTags[i]];
|
|
11682
|
+
function getJSDocParameterTagsWorker(param, noCache) {
|
|
11683
|
+
if (param.name) {
|
|
11684
|
+
if (isIdentifier(param.name)) {
|
|
11685
|
+
const name = param.name.escapedText;
|
|
11686
|
+
return getJSDocTagsWorker(param.parent, noCache).filter((tag) => isJSDocParameterTag(tag) && isIdentifier(tag.name) && tag.name.escapedText === name);
|
|
11687
|
+
} else {
|
|
11688
|
+
const i = param.parent.parameters.indexOf(param);
|
|
11689
|
+
Debug.assert(i > -1, "Parameters should always be in their parents' parameter list");
|
|
11690
|
+
const paramTags = getJSDocTagsWorker(param.parent, noCache).filter(isJSDocParameterTag);
|
|
11691
|
+
if (i < paramTags.length) {
|
|
11692
|
+
return [paramTags[i]];
|
|
11693
|
+
}
|
|
11690
11694
|
}
|
|
11691
11695
|
}
|
|
11692
11696
|
return emptyArray;
|
|
11693
11697
|
}
|
|
11694
|
-
function getJSDocParameterTags(
|
|
11698
|
+
function getJSDocParameterTags(param) {
|
|
11695
11699
|
return getJSDocParameterTagsWorker(
|
|
11696
|
-
|
|
11700
|
+
param,
|
|
11697
11701
|
/*noCache*/
|
|
11698
11702
|
false
|
|
11699
11703
|
);
|
|
11700
11704
|
}
|
|
11701
|
-
function getJSDocParameterTagsNoCache(
|
|
11705
|
+
function getJSDocParameterTagsNoCache(param) {
|
|
11702
11706
|
return getJSDocParameterTagsWorker(
|
|
11703
|
-
|
|
11707
|
+
param,
|
|
11704
11708
|
/*noCache*/
|
|
11705
11709
|
true
|
|
11706
11710
|
);
|
|
@@ -15351,7 +15355,7 @@ ${lanes.join("\n")}
|
|
|
15351
15355
|
if (hasJSDocNodes(node)) {
|
|
15352
15356
|
result = addRange(result, filterOwnedJSDocTags(hostNode, last(node.jsDoc)));
|
|
15353
15357
|
}
|
|
15354
|
-
if (node.kind === 167 /* Parameter */
|
|
15358
|
+
if (node.kind === 167 /* Parameter */) {
|
|
15355
15359
|
result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
|
|
15356
15360
|
break;
|
|
15357
15361
|
}
|
|
@@ -45086,6 +45090,7 @@ ${lanes.join("\n")}
|
|
|
45086
45090
|
var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
|
|
45087
45091
|
var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
45088
45092
|
var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
|
|
45093
|
+
var defaultIndexFlags = keyofStringsOnly ? 1 /* StringsOnly */ : 0 /* None */;
|
|
45089
45094
|
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */;
|
|
45090
45095
|
var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
|
|
45091
45096
|
var checkBinaryExpression = createCheckBinaryExpression();
|
|
@@ -56354,6 +56359,13 @@ ${lanes.join("\n")}
|
|
|
56354
56359
|
function isConflictingPrivateProperty(prop) {
|
|
56355
56360
|
return !prop.valueDeclaration && !!(getCheckFlags(prop) & 1024 /* ContainsPrivate */);
|
|
56356
56361
|
}
|
|
56362
|
+
function isGenericReducibleType(type) {
|
|
56363
|
+
return !!(type.flags & 1048576 /* Union */ && type.objectFlags & 16777216 /* ContainsIntersections */ && some(type.types, isGenericReducibleType) || type.flags & 2097152 /* Intersection */ && isReducibleIntersection(type));
|
|
56364
|
+
}
|
|
56365
|
+
function isReducibleIntersection(type) {
|
|
56366
|
+
const uniqueFilled = type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
|
|
56367
|
+
return getReducedType(uniqueFilled) !== uniqueFilled;
|
|
56368
|
+
}
|
|
56357
56369
|
function elaborateNeverIntersection(errorInfo, type) {
|
|
56358
56370
|
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 33554432 /* IsNeverIntersection */) {
|
|
56359
56371
|
const neverProp = find(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType);
|
|
@@ -58723,10 +58735,10 @@ ${lanes.join("\n")}
|
|
|
58723
58735
|
}
|
|
58724
58736
|
return links.resolvedType;
|
|
58725
58737
|
}
|
|
58726
|
-
function createIndexType(type,
|
|
58738
|
+
function createIndexType(type, indexFlags) {
|
|
58727
58739
|
const result = createType(4194304 /* Index */);
|
|
58728
58740
|
result.type = type;
|
|
58729
|
-
result.
|
|
58741
|
+
result.indexFlags = indexFlags;
|
|
58730
58742
|
return result;
|
|
58731
58743
|
}
|
|
58732
58744
|
function createOriginIndexType(type) {
|
|
@@ -58734,31 +58746,23 @@ ${lanes.join("\n")}
|
|
|
58734
58746
|
result.type = type;
|
|
58735
58747
|
return result;
|
|
58736
58748
|
}
|
|
58737
|
-
function getIndexTypeForGenericType(type,
|
|
58738
|
-
return
|
|
58739
|
-
type,
|
|
58740
|
-
/*stringsOnly*/
|
|
58741
|
-
true
|
|
58742
|
-
)) : type.resolvedIndexType || (type.resolvedIndexType = createIndexType(
|
|
58743
|
-
type,
|
|
58744
|
-
/*stringsOnly*/
|
|
58745
|
-
false
|
|
58746
|
-
));
|
|
58749
|
+
function getIndexTypeForGenericType(type, indexFlags) {
|
|
58750
|
+
return indexFlags & 1 /* StringsOnly */ ? type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(type, 1 /* StringsOnly */)) : type.resolvedIndexType || (type.resolvedIndexType = createIndexType(type, 0 /* None */));
|
|
58747
58751
|
}
|
|
58748
|
-
function getIndexTypeForMappedType(type,
|
|
58752
|
+
function getIndexTypeForMappedType(type, indexFlags) {
|
|
58749
58753
|
const typeParameter = getTypeParameterFromMappedType(type);
|
|
58750
58754
|
const constraintType = getConstraintTypeFromMappedType(type);
|
|
58751
58755
|
const nameType = getNameTypeFromMappedType(type.target || type);
|
|
58752
|
-
if (!nameType && !
|
|
58756
|
+
if (!nameType && !(indexFlags & 2 /* NoIndexSignatures */)) {
|
|
58753
58757
|
return constraintType;
|
|
58754
58758
|
}
|
|
58755
58759
|
const keyTypes = [];
|
|
58756
58760
|
if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
|
|
58757
58761
|
if (!isGenericIndexType(constraintType)) {
|
|
58758
58762
|
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
58759
|
-
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576 /* StringOrNumberLiteralOrUnique */,
|
|
58763
|
+
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576 /* StringOrNumberLiteralOrUnique */, !!(indexFlags & 1 /* StringsOnly */), addMemberForKeyType);
|
|
58760
58764
|
} else {
|
|
58761
|
-
return getIndexTypeForGenericType(type,
|
|
58765
|
+
return getIndexTypeForGenericType(type, indexFlags);
|
|
58762
58766
|
}
|
|
58763
58767
|
} else {
|
|
58764
58768
|
forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType);
|
|
@@ -58766,7 +58770,7 @@ ${lanes.join("\n")}
|
|
|
58766
58770
|
if (isGenericIndexType(constraintType)) {
|
|
58767
58771
|
forEachType(constraintType, addMemberForKeyType);
|
|
58768
58772
|
}
|
|
58769
|
-
const result =
|
|
58773
|
+
const result = indexFlags & 2 /* NoIndexSignatures */ ? filterType(getUnionType(keyTypes), (t) => !(t.flags & (1 /* Any */ | 4 /* String */))) : getUnionType(keyTypes);
|
|
58770
58774
|
if (result.flags & 1048576 /* Union */ && constraintType.flags & 1048576 /* Union */ && getTypeListId(result.types) === getTypeListId(constraintType.types)) {
|
|
58771
58775
|
return constraintType;
|
|
58772
58776
|
}
|
|
@@ -58819,19 +58823,15 @@ ${lanes.join("\n")}
|
|
|
58819
58823
|
origin
|
|
58820
58824
|
);
|
|
58821
58825
|
}
|
|
58822
|
-
function
|
|
58823
|
-
|
|
58824
|
-
return getReducedType(uniqueFilled) !== uniqueFilled;
|
|
58826
|
+
function shouldDeferIndexType(type, indexFlags = 0 /* None */) {
|
|
58827
|
+
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));
|
|
58825
58828
|
}
|
|
58826
|
-
function
|
|
58827
|
-
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));
|
|
58828
|
-
}
|
|
58829
|
-
function getIndexType(type, stringsOnly = keyofStringsOnly, noIndexSignatures) {
|
|
58829
|
+
function getIndexType(type, indexFlags = defaultIndexFlags) {
|
|
58830
58830
|
type = getReducedType(type);
|
|
58831
|
-
return shouldDeferIndexType(type) ? getIndexTypeForGenericType(type,
|
|
58831
|
+
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(
|
|
58832
58832
|
type,
|
|
58833
|
-
(
|
|
58834
|
-
|
|
58833
|
+
(indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */),
|
|
58834
|
+
indexFlags === defaultIndexFlags
|
|
58835
58835
|
);
|
|
58836
58836
|
}
|
|
58837
58837
|
function getExtractStringType(type) {
|
|
@@ -59371,12 +59371,13 @@ ${lanes.join("\n")}
|
|
|
59371
59371
|
if (objectType === wildcardType || indexType === wildcardType) {
|
|
59372
59372
|
return wildcardType;
|
|
59373
59373
|
}
|
|
59374
|
+
objectType = getReducedType(objectType);
|
|
59374
59375
|
if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
|
|
59375
59376
|
indexType = stringType;
|
|
59376
59377
|
}
|
|
59377
59378
|
if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
|
|
59378
59379
|
accessFlags |= 1 /* IncludeUndefined */;
|
|
59379
|
-
if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 197 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) {
|
|
59380
|
+
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))) {
|
|
59380
59381
|
if (objectType.flags & 3 /* AnyOrUnknown */) {
|
|
59381
59382
|
return objectType;
|
|
59382
59383
|
}
|
|
@@ -60562,9 +60563,6 @@ ${lanes.join("\n")}
|
|
|
60562
60563
|
}
|
|
60563
60564
|
return type;
|
|
60564
60565
|
}
|
|
60565
|
-
function getUniqueLiteralFilledInstantiation(type) {
|
|
60566
|
-
return type.flags & (402784252 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
|
|
60567
|
-
}
|
|
60568
60566
|
function getPermissiveInstantiation(type) {
|
|
60569
60567
|
return type.flags & (402784252 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper));
|
|
60570
60568
|
}
|
|
@@ -61276,7 +61274,12 @@ ${lanes.join("\n")}
|
|
|
61276
61274
|
const paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount);
|
|
61277
61275
|
const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
|
|
61278
61276
|
for (let i = 0; i < paramCount; i++) {
|
|
61279
|
-
const sourceType = i === restIndex ? getRestTypeAtPosition(
|
|
61277
|
+
const sourceType = i === restIndex ? getRestTypeAtPosition(
|
|
61278
|
+
source,
|
|
61279
|
+
i,
|
|
61280
|
+
/*readonly*/
|
|
61281
|
+
true
|
|
61282
|
+
) : tryGetTypeAtPosition(source, i);
|
|
61280
61283
|
const targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
|
|
61281
61284
|
if (sourceType && targetType) {
|
|
61282
61285
|
const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
|
|
@@ -62747,7 +62750,7 @@ ${lanes.join("\n")}
|
|
|
62747
62750
|
} else {
|
|
62748
62751
|
const constraint = getSimplifiedTypeOrConstraint(targetType);
|
|
62749
62752
|
if (constraint) {
|
|
62750
|
-
if (isRelatedTo(source2, getIndexType(constraint, target2.
|
|
62753
|
+
if (isRelatedTo(source2, getIndexType(constraint, target2.indexFlags | 4 /* NoReducibleCheck */), 2 /* Target */, reportErrors2) === -1 /* True */) {
|
|
62751
62754
|
return -1 /* True */;
|
|
62752
62755
|
}
|
|
62753
62756
|
} else if (isGenericMappedType(targetType)) {
|
|
@@ -62828,13 +62831,7 @@ ${lanes.join("\n")}
|
|
|
62828
62831
|
}
|
|
62829
62832
|
if (!isGenericMappedType(source2)) {
|
|
62830
62833
|
const targetKeys = keysRemapped ? getNameTypeFromMappedType(target2) : getConstraintTypeFromMappedType(target2);
|
|
62831
|
-
const sourceKeys = getIndexType(
|
|
62832
|
-
source2,
|
|
62833
|
-
/*stringsOnly*/
|
|
62834
|
-
void 0,
|
|
62835
|
-
/*noIndexSignatures*/
|
|
62836
|
-
true
|
|
62837
|
-
);
|
|
62834
|
+
const sourceKeys = getIndexType(source2, 2 /* NoIndexSignatures */);
|
|
62838
62835
|
const includeOptional = modifiers & 4 /* IncludeOptional */;
|
|
62839
62836
|
const filteredByApplicability = includeOptional ? intersectTypes(targetKeys, sourceKeys) : void 0;
|
|
62840
62837
|
if (includeOptional ? !(filteredByApplicability.flags & 131072 /* Never */) : isRelatedTo(targetKeys, sourceKeys, 3 /* Both */)) {
|
|
@@ -73767,12 +73764,12 @@ ${lanes.join("\n")}
|
|
|
73767
73764
|
}
|
|
73768
73765
|
return void 0;
|
|
73769
73766
|
}
|
|
73770
|
-
function getRestTypeAtPosition(source, pos) {
|
|
73767
|
+
function getRestTypeAtPosition(source, pos, readonly = false) {
|
|
73771
73768
|
const parameterCount = getParameterCount(source);
|
|
73772
73769
|
const minArgumentCount = getMinArgumentCount(source);
|
|
73773
73770
|
const restType = getEffectiveRestType(source);
|
|
73774
73771
|
if (restType && pos >= parameterCount - 1) {
|
|
73775
|
-
return pos === parameterCount - 1 ? restType : createArrayType(getIndexedAccessType(restType, numberType));
|
|
73772
|
+
return pos === parameterCount - 1 ? restType : createArrayType(getIndexedAccessType(restType, numberType), readonly);
|
|
73776
73773
|
}
|
|
73777
73774
|
const types = [];
|
|
73778
73775
|
const flags = [];
|
|
@@ -73790,13 +73787,7 @@ ${lanes.join("\n")}
|
|
|
73790
73787
|
names.push(name);
|
|
73791
73788
|
}
|
|
73792
73789
|
}
|
|
73793
|
-
return createTupleType(
|
|
73794
|
-
types,
|
|
73795
|
-
flags,
|
|
73796
|
-
/*readonly*/
|
|
73797
|
-
false,
|
|
73798
|
-
length(names) === length(types) ? names : void 0
|
|
73799
|
-
);
|
|
73790
|
+
return createTupleType(types, flags, readonly, length(names) === length(types) ? names : void 0);
|
|
73800
73791
|
}
|
|
73801
73792
|
function getParameterCount(signature) {
|
|
73802
73793
|
const length2 = signature.parameters.length;
|
|
@@ -77074,11 +77065,7 @@ ${lanes.join("\n")}
|
|
|
77074
77065
|
}
|
|
77075
77066
|
const objectType = type.objectType;
|
|
77076
77067
|
const indexType = type.indexType;
|
|
77077
|
-
if (isTypeAssignableTo(indexType, getIndexType(
|
|
77078
|
-
objectType,
|
|
77079
|
-
/*stringsOnly*/
|
|
77080
|
-
false
|
|
77081
|
-
))) {
|
|
77068
|
+
if (isTypeAssignableTo(indexType, getIndexType(objectType, 0 /* None */))) {
|
|
77082
77069
|
if (accessNode.kind === 210 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
|
|
77083
77070
|
error(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
|
|
77084
77071
|
}
|
|
@@ -83898,7 +83885,8 @@ ${lanes.join("\n")}
|
|
|
83898
83885
|
return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);
|
|
83899
83886
|
}
|
|
83900
83887
|
if (!(node.parent.kind === 261 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) {
|
|
83901
|
-
|
|
83888
|
+
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;
|
|
83889
|
+
return grammarErrorOnNode(modifier, message);
|
|
83902
83890
|
}
|
|
83903
83891
|
if (flags & 32 /* Static */) {
|
|
83904
83892
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract");
|
|
@@ -131932,6 +131920,9 @@ ${lanes.join("\n")}
|
|
|
131932
131920
|
}
|
|
131933
131921
|
}
|
|
131934
131922
|
for (const option of transpileOptionValueCompilerOptions) {
|
|
131923
|
+
if (options.verbatimModuleSyntax && optionsRedundantWithVerbatimModuleSyntax.has(option.name)) {
|
|
131924
|
+
continue;
|
|
131925
|
+
}
|
|
131935
131926
|
options[option.name] = option.transpileOptionValue;
|
|
131936
131927
|
}
|
|
131937
131928
|
options.suppressOutputPathCheck = true;
|
|
@@ -132035,11 +132026,16 @@ ${lanes.join("\n")}
|
|
|
132035
132026
|
}
|
|
132036
132027
|
return options;
|
|
132037
132028
|
}
|
|
132038
|
-
var commandLineOptionsStringToEnum;
|
|
132029
|
+
var optionsRedundantWithVerbatimModuleSyntax, commandLineOptionsStringToEnum;
|
|
132039
132030
|
var init_transpile = __esm({
|
|
132040
132031
|
"src/services/transpile.ts"() {
|
|
132041
132032
|
"use strict";
|
|
132042
132033
|
init_ts4();
|
|
132034
|
+
optionsRedundantWithVerbatimModuleSyntax = /* @__PURE__ */ new Set([
|
|
132035
|
+
"isolatedModules",
|
|
132036
|
+
"preserveValueImports",
|
|
132037
|
+
"importsNotUsedAsValues"
|
|
132038
|
+
]);
|
|
132043
132039
|
}
|
|
132044
132040
|
});
|
|
132045
132041
|
|
|
@@ -178687,6 +178683,7 @@ ${e.message}`;
|
|
|
178687
178683
|
ImportKind: () => ImportKind,
|
|
178688
178684
|
ImportsNotUsedAsValues: () => ImportsNotUsedAsValues,
|
|
178689
178685
|
IndentStyle: () => IndentStyle,
|
|
178686
|
+
IndexFlags: () => IndexFlags,
|
|
178690
178687
|
IndexKind: () => IndexKind,
|
|
178691
178688
|
InferenceFlags: () => InferenceFlags,
|
|
178692
178689
|
InferencePriority: () => InferencePriority,
|
|
@@ -181043,6 +181040,7 @@ ${e.message}`;
|
|
|
181043
181040
|
ImportKind: () => ImportKind,
|
|
181044
181041
|
ImportsNotUsedAsValues: () => ImportsNotUsedAsValues,
|
|
181045
181042
|
IndentStyle: () => IndentStyle,
|
|
181043
|
+
IndexFlags: () => IndexFlags,
|
|
181046
181044
|
IndexKind: () => IndexKind,
|
|
181047
181045
|
InferenceFlags: () => InferenceFlags,
|
|
181048
181046
|
InferencePriority: () => InferencePriority,
|
package/lib/typescript.d.ts
CHANGED
|
@@ -4575,7 +4575,7 @@ declare namespace ts {
|
|
|
4575
4575
|
*
|
|
4576
4576
|
* For binding patterns, parameter tags are matched by position.
|
|
4577
4577
|
*/
|
|
4578
|
-
function getJSDocParameterTags(
|
|
4578
|
+
function getJSDocParameterTags(param: ParameterDeclaration): readonly JSDocParameterTag[];
|
|
4579
4579
|
/**
|
|
4580
4580
|
* Gets the JSDoc type parameter tags for the node if present.
|
|
4581
4581
|
*
|