mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Update LKG
This commit is contained in:
+62
-467
@@ -3680,7 +3680,6 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
||||
ObjectFlags3[ObjectFlags3["IsGenericObjectType"] = 4194304] = "IsGenericObjectType";
|
||||
ObjectFlags3[ObjectFlags3["IsGenericIndexType"] = 8388608] = "IsGenericIndexType";
|
||||
ObjectFlags3[ObjectFlags3["IsGenericType"] = 12582912] = "IsGenericType";
|
||||
ObjectFlags3[ObjectFlags3["IsNarrowingType"] = 16777216] = "IsNarrowingType";
|
||||
ObjectFlags3[ObjectFlags3["ContainsIntersections"] = 16777216] = "ContainsIntersections";
|
||||
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnionComputed"] = 33554432] = "IsUnknownLikeUnionComputed";
|
||||
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnion"] = 67108864] = "IsUnknownLikeUnion";
|
||||
@@ -6825,7 +6824,7 @@ var Diagnostics = {
|
||||
This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_during_emit_because_it_is_not_a_relative_path: diag(2877, 1 /* Error */, "This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_duri_2877", "This import uses a '{0}' extension to resolve to an input TypeScript file, but will not be rewritten during emit because it is not a relative path."),
|
||||
This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files: diag(2878, 1 /* Error */, "This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_b_2878", "This import path is unsafe to rewrite because it resolves to another project, and the relative path between the projects' output files is not the same as the relative path between its input files."),
|
||||
Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found: diag(2879, 1 /* Error */, "Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found_2879", "Using JSX fragments requires fragment factory '{0}' to be in scope, but it could not be found."),
|
||||
Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_asserts: diag(2880, 1 /* Error */, "Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_asserts_2880", "Import assertions have been replaced by import attributes. Use 'with' instead of 'asserts'."),
|
||||
Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert: diag(2880, 1 /* Error */, "Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880", "Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'."),
|
||||
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
||||
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
||||
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
||||
@@ -41670,7 +41669,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
||||
state2,
|
||||
packageInfo
|
||||
);
|
||||
if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) {
|
||||
if (!pathAndExtension && !rest && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) {
|
||||
pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2);
|
||||
}
|
||||
return withPackageId(packageInfo, pathAndExtension, state2);
|
||||
@@ -46377,8 +46376,8 @@ function createTypeChecker(host) {
|
||||
writeSignature: (signature, enclosingDeclaration, flags, kind, writer) => {
|
||||
return signatureToString(signature, getParseTreeNode(enclosingDeclaration), flags, kind, writer);
|
||||
},
|
||||
writeType: (type, enclosingDeclaration, flags, writer, verbosityLevel, out) => {
|
||||
return typeToString(type, getParseTreeNode(enclosingDeclaration), flags, writer, verbosityLevel, out);
|
||||
writeType: (type, enclosingDeclaration, flags, writer) => {
|
||||
return typeToString(type, getParseTreeNode(enclosingDeclaration), flags, writer);
|
||||
},
|
||||
writeSymbol: (symbol, enclosingDeclaration, meaning, flags, writer) => {
|
||||
return symbolToString(symbol, getParseTreeNode(enclosingDeclaration), meaning, flags, writer);
|
||||
@@ -47176,7 +47175,6 @@ function createTypeChecker(host) {
|
||||
[".jsx", ".jsx"],
|
||||
[".json", ".json"]
|
||||
];
|
||||
var narrowableReturnTypeCache = /* @__PURE__ */ new Map();
|
||||
initializeTypeChecker();
|
||||
return checker;
|
||||
function isDefinitelyReferenceToGlobalSymbolObject(node) {
|
||||
@@ -50312,18 +50310,14 @@ function createTypeChecker(host) {
|
||||
return writer2;
|
||||
}
|
||||
}
|
||||
function typeToString(type, enclosingDeclaration, flags = 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer = createTextWriter(""), verbosityLevel, out) {
|
||||
const noTruncation = compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */ || verbosityLevel !== void 0;
|
||||
function typeToString(type, enclosingDeclaration, flags = 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer = createTextWriter("")) {
|
||||
const noTruncation = compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */;
|
||||
const typeNode = nodeBuilder.typeToTypeNode(
|
||||
type,
|
||||
enclosingDeclaration,
|
||||
toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0),
|
||||
toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0 /* None */),
|
||||
/*internalFlags*/
|
||||
void 0,
|
||||
/*tracker*/
|
||||
void 0,
|
||||
verbosityLevel,
|
||||
out
|
||||
void 0
|
||||
);
|
||||
if (typeNode === void 0) return Debug.fail("should always get typenode");
|
||||
const printer = type !== unresolvedType ? createPrinterWithRemoveComments() : createPrinterWithDefaults();
|
||||
@@ -50550,127 +50544,31 @@ function createTypeChecker(host) {
|
||||
};
|
||||
return {
|
||||
syntacticBuilderResolver,
|
||||
typeToTypeNode: (type, enclosingDeclaration, flags, internalFlags, tracker, verbosityLevel, out) => withContext(enclosingDeclaration, flags, internalFlags, tracker, verbosityLevel, (context) => typeToTypeNodeHelper(type, context), out),
|
||||
typePredicateToTypePredicateNode: (typePredicate, enclosingDeclaration, flags, internalFlags, tracker) => withContext(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => typePredicateToTypePredicateNodeHelper(typePredicate, context)
|
||||
),
|
||||
serializeTypeForDeclaration: (declaration, symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => syntacticNodeBuilder.serializeTypeOfDeclaration(declaration, symbol, context)
|
||||
),
|
||||
serializeReturnTypeForSignature: (signature, enclosingDeclaration, flags, internalFlags, tracker) => withContext(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => syntacticNodeBuilder.serializeReturnTypeForSignature(signature, getSymbolOfDeclaration(signature), context)
|
||||
),
|
||||
serializeTypeForExpression: (expr, enclosingDeclaration, flags, internalFlags, tracker) => withContext(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => syntacticNodeBuilder.serializeTypeOfExpression(expr, context)
|
||||
),
|
||||
indexInfoToIndexSignatureDeclaration: (indexInfo, enclosingDeclaration, flags, internalFlags, tracker) => withContext(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => indexInfoToIndexSignatureDeclarationHelper(
|
||||
indexInfo,
|
||||
context,
|
||||
/*typeNode*/
|
||||
void 0
|
||||
)
|
||||
),
|
||||
signatureToSignatureDeclaration: (signature, kind, enclosingDeclaration, flags, internalFlags, tracker) => withContext(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => signatureToSignatureDeclarationHelper(signature, kind, context)
|
||||
),
|
||||
symbolToEntityName: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => symbolToName(
|
||||
symbol,
|
||||
context,
|
||||
meaning,
|
||||
/*expectsIdentifier*/
|
||||
false
|
||||
)
|
||||
),
|
||||
symbolToExpression: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => symbolToExpression(symbol, context, meaning)
|
||||
),
|
||||
symbolToTypeParameterDeclarations: (symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => typeParametersToTypeParameterDeclarations(symbol, context)
|
||||
),
|
||||
symbolToParameterDeclaration: (symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => symbolToParameterDeclaration(symbol, context)
|
||||
),
|
||||
typeParameterToDeclaration: (parameter, enclosingDeclaration, flags, internalFlags, tracker, verbosityLevel) => withContext(enclosingDeclaration, flags, internalFlags, tracker, verbosityLevel, (context) => typeParameterToDeclaration(parameter, context)),
|
||||
symbolTableToDeclarationStatements: (symbolTable, enclosingDeclaration, flags, internalFlags, tracker) => withContext(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => symbolTableToDeclarationStatements(symbolTable, context)
|
||||
),
|
||||
symbolToNode: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => symbolToNode(symbol, context, meaning)
|
||||
)
|
||||
typeToTypeNode: (type, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => typeToTypeNodeHelper(type, context)),
|
||||
typePredicateToTypePredicateNode: (typePredicate, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => typePredicateToTypePredicateNodeHelper(typePredicate, context)),
|
||||
serializeTypeForExpression: (expr, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => syntacticNodeBuilder.serializeTypeOfExpression(expr, context)),
|
||||
serializeTypeForDeclaration: (declaration, symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => syntacticNodeBuilder.serializeTypeOfDeclaration(declaration, symbol, context)),
|
||||
serializeReturnTypeForSignature: (signature, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => syntacticNodeBuilder.serializeReturnTypeForSignature(signature, getSymbolOfDeclaration(signature), context)),
|
||||
indexInfoToIndexSignatureDeclaration: (indexInfo, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => indexInfoToIndexSignatureDeclarationHelper(
|
||||
indexInfo,
|
||||
context,
|
||||
/*typeNode*/
|
||||
void 0
|
||||
)),
|
||||
signatureToSignatureDeclaration: (signature, kind, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => signatureToSignatureDeclarationHelper(signature, kind, context)),
|
||||
symbolToEntityName: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolToName(
|
||||
symbol,
|
||||
context,
|
||||
meaning,
|
||||
/*expectsIdentifier*/
|
||||
false
|
||||
)),
|
||||
symbolToExpression: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolToExpression(symbol, context, meaning)),
|
||||
symbolToTypeParameterDeclarations: (symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => typeParametersToTypeParameterDeclarations(symbol, context)),
|
||||
symbolToParameterDeclaration: (symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolToParameterDeclaration(symbol, context)),
|
||||
typeParameterToDeclaration: (parameter, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => typeParameterToDeclaration(parameter, context)),
|
||||
symbolTableToDeclarationStatements: (symbolTable, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolTableToDeclarationStatements(symbolTable, context)),
|
||||
symbolToNode: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolToNode(symbol, context, meaning))
|
||||
};
|
||||
function getTypeFromTypeNode2(context, node, noMappedTypes) {
|
||||
const type = getTypeFromTypeNodeWithoutContext(node);
|
||||
@@ -50712,7 +50610,7 @@ function createTypeChecker(host) {
|
||||
}
|
||||
return symbolToExpression(symbol, context, meaning);
|
||||
}
|
||||
function withContext(enclosingDeclaration, flags, internalFlags, tracker, verbosityLevel, cb, out) {
|
||||
function withContext(enclosingDeclaration, flags, internalFlags, tracker, cb) {
|
||||
const moduleResolverHost = (tracker == null ? void 0 : tracker.trackSymbol) ? tracker.moduleResolverHost : (internalFlags || 0 /* None */) & 4 /* DoNotIncludeSymbolChain */ ? createBasicNodeBuilderModuleSpecifierResolutionHost(host) : void 0;
|
||||
const context = {
|
||||
enclosingDeclaration,
|
||||
@@ -50720,7 +50618,6 @@ function createTypeChecker(host) {
|
||||
flags: flags || 0 /* None */,
|
||||
internalFlags: internalFlags || 0 /* None */,
|
||||
tracker: void 0,
|
||||
unfoldDepth: verbosityLevel ?? -1,
|
||||
encounteredError: false,
|
||||
suppressReportInferenceFallback: false,
|
||||
reportedDiagnostic: false,
|
||||
@@ -50742,18 +50639,13 @@ function createTypeChecker(host) {
|
||||
typeParameterNamesByText: void 0,
|
||||
typeParameterNamesByTextNextNameCount: void 0,
|
||||
enclosingSymbolTypes: /* @__PURE__ */ new Map(),
|
||||
mapper: void 0,
|
||||
depth: 0,
|
||||
couldUnfoldMore: false
|
||||
mapper: void 0
|
||||
};
|
||||
context.tracker = new SymbolTrackerImpl(context, tracker, moduleResolverHost);
|
||||
const resultingNode = cb(context);
|
||||
if (context.truncating && context.flags & 1 /* NoTruncation */) {
|
||||
context.tracker.reportTruncationError();
|
||||
}
|
||||
if (out) {
|
||||
out.couldUnfoldMore = context.couldUnfoldMore;
|
||||
}
|
||||
return context.encounteredError ? void 0 : resultingNode;
|
||||
}
|
||||
function addSymbolTypeToContext(context, symbol, type) {
|
||||
@@ -50772,36 +50664,16 @@ function createTypeChecker(host) {
|
||||
function saveRestoreFlags(context) {
|
||||
const flags = context.flags;
|
||||
const internalFlags = context.internalFlags;
|
||||
const depth = context.depth;
|
||||
return restore;
|
||||
function restore() {
|
||||
context.flags = flags;
|
||||
context.internalFlags = internalFlags;
|
||||
context.depth = depth;
|
||||
}
|
||||
}
|
||||
function checkTruncationLength(context) {
|
||||
if (context.truncating) return context.truncating;
|
||||
return context.truncating = context.approximateLength > (context.flags & 1 /* NoTruncation */ ? noTruncationMaximumTruncationLength : defaultMaximumTruncationLength);
|
||||
}
|
||||
function couldUnfoldType(type, context) {
|
||||
var _a;
|
||||
if ((_a = context.visitedTypes) == null ? void 0 : _a.has(type.id)) {
|
||||
return false;
|
||||
}
|
||||
return context.depth < context.unfoldDepth || context.depth === context.unfoldDepth && !context.couldUnfoldMore;
|
||||
}
|
||||
function canUnfoldType(type, context) {
|
||||
var _a;
|
||||
if ((_a = context.visitedTypes) == null ? void 0 : _a.has(type.id)) {
|
||||
return false;
|
||||
}
|
||||
const result = context.depth < context.unfoldDepth;
|
||||
if (!result) {
|
||||
context.couldUnfoldMore = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function typeToTypeNodeHelper(type, context) {
|
||||
const restoreFlags = saveRestoreFlags(context);
|
||||
const typeNode = typeToTypeNodeWorker(type, context);
|
||||
@@ -50949,27 +50821,16 @@ function createTypeChecker(host) {
|
||||
return factory.createThisTypeNode();
|
||||
}
|
||||
if (!inTypeAlias && type.aliasSymbol && (context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */ || isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration))) {
|
||||
if (!canUnfoldType(type, context)) {
|
||||
const typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context);
|
||||
if (isReservedMemberName(type.aliasSymbol.escapedName) && !(type.aliasSymbol.flags & 32 /* Class */)) return factory.createTypeReferenceNode(factory.createIdentifier(""), typeArgumentNodes);
|
||||
if (length(typeArgumentNodes) === 1 && type.aliasSymbol === globalArrayType.symbol) {
|
||||
return factory.createArrayTypeNode(typeArgumentNodes[0]);
|
||||
}
|
||||
return symbolToTypeNode(type.aliasSymbol, context, 788968 /* Type */, typeArgumentNodes);
|
||||
const typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context);
|
||||
if (isReservedMemberName(type.aliasSymbol.escapedName) && !(type.aliasSymbol.flags & 32 /* Class */)) return factory.createTypeReferenceNode(factory.createIdentifier(""), typeArgumentNodes);
|
||||
if (length(typeArgumentNodes) === 1 && type.aliasSymbol === globalArrayType.symbol) {
|
||||
return factory.createArrayTypeNode(typeArgumentNodes[0]);
|
||||
}
|
||||
context.depth += 1;
|
||||
return symbolToTypeNode(type.aliasSymbol, context, 788968 /* Type */, typeArgumentNodes);
|
||||
}
|
||||
const objectFlags = getObjectFlags(type);
|
||||
if (objectFlags & 4 /* Reference */) {
|
||||
Debug.assert(!!(type.flags & 524288 /* Object */));
|
||||
if (canUnfoldType(type, context)) {
|
||||
context.depth += 1;
|
||||
return createAnonymousTypeNode(
|
||||
type,
|
||||
/*forceClassExpansion*/
|
||||
true
|
||||
);
|
||||
}
|
||||
return type.node ? visitAndTransformType(type, typeReferenceToTypeNode) : typeReferenceToTypeNode(type);
|
||||
}
|
||||
if (type.flags & 262144 /* TypeParameter */ || objectFlags & 3 /* ClassOrInterface */) {
|
||||
@@ -50999,14 +50860,6 @@ function createTypeChecker(host) {
|
||||
void 0
|
||||
);
|
||||
}
|
||||
if (objectFlags & 3 /* ClassOrInterface */ && canUnfoldType(type, context)) {
|
||||
context.depth += 1;
|
||||
return createAnonymousTypeNode(
|
||||
type,
|
||||
/*forceClassExpansion*/
|
||||
true
|
||||
);
|
||||
}
|
||||
if (type.symbol) {
|
||||
return symbolToTypeNode(type.symbol, context, 788968 /* Type */);
|
||||
}
|
||||
@@ -51210,7 +51063,7 @@ function createTypeChecker(host) {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function createAnonymousTypeNode(type2, forceClassExpansion = false) {
|
||||
function createAnonymousTypeNode(type2) {
|
||||
var _a2, _b2;
|
||||
const typeId = type2.id;
|
||||
const symbol = type2.symbol;
|
||||
@@ -51233,7 +51086,7 @@ function createTypeChecker(host) {
|
||||
const isInstanceType = isClassInstanceSide(type2) ? 788968 /* Type */ : 111551 /* Value */;
|
||||
if (isJSConstructor(symbol.valueDeclaration)) {
|
||||
return symbolToTypeNode(symbol, context, isInstanceType);
|
||||
} else if (symbol.flags & 32 /* Class */ && !forceClassExpansion && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration && isClassLike(symbol.valueDeclaration) && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ && (!isClassDeclaration(symbol.valueDeclaration) || isSymbolAccessible(
|
||||
} else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration && isClassLike(symbol.valueDeclaration) && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ && (!isClassDeclaration(symbol.valueDeclaration) || isSymbolAccessible(
|
||||
symbol,
|
||||
context.enclosingDeclaration,
|
||||
isInstanceType,
|
||||
@@ -51277,7 +51130,7 @@ function createTypeChecker(host) {
|
||||
if (id && !context.symbolDepth) {
|
||||
context.symbolDepth = /* @__PURE__ */ new Map();
|
||||
}
|
||||
const links = context.unfoldDepth >= 0 ? void 0 : context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration);
|
||||
const links = context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration);
|
||||
const key = `${getTypeId(type2)}|${context.flags}|${context.internalFlags}`;
|
||||
if (links) {
|
||||
links.serializedTypes || (links.serializedTypes = /* @__PURE__ */ new Map());
|
||||
@@ -52224,7 +52077,7 @@ function createTypeChecker(host) {
|
||||
return factory.createTypeParameterDeclaration(modifiers, name, constraintNode, defaultParameterNode);
|
||||
}
|
||||
function typeToTypeNodeHelperWithPossibleReusableTypeNode(type, typeNode, context) {
|
||||
return !couldUnfoldType(type, context) && typeNode && getTypeFromTypeNode2(context, typeNode) === type && syntacticNodeBuilder.tryReuseExistingTypeNode(context, typeNode) || typeToTypeNodeHelper(type, context);
|
||||
return typeNode && getTypeFromTypeNode2(context, typeNode) === type && syntacticNodeBuilder.tryReuseExistingTypeNode(context, typeNode) || typeToTypeNodeHelper(type, context);
|
||||
}
|
||||
function typeParameterToDeclaration(type, context, constraint = getConstraintOfTypeParameter(type)) {
|
||||
const constraintNode = constraint && typeToTypeNodeHelperWithPossibleReusableTypeNode(constraint, getConstraintDeclaration(type), context);
|
||||
@@ -52871,7 +52724,7 @@ function createTypeChecker(host) {
|
||||
let result;
|
||||
const addUndefinedForParameter = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration, context.enclosingDeclaration);
|
||||
const decl = declaration ?? symbol.valueDeclaration ?? getDeclarationWithTypeAnnotation(symbol) ?? ((_a = symbol.declarations) == null ? void 0 : _a[0]);
|
||||
if (!couldUnfoldType(type, context) && decl) {
|
||||
if (decl) {
|
||||
if (isAccessor(decl)) {
|
||||
result = syntacticNodeBuilder.serializeTypeOfAccessor(decl, symbol, context);
|
||||
} else if (hasInferredType(decl) && !nodeIsSynthesized(decl) && !(getObjectFlags(type) & 196608 /* RequiresWidening */)) {
|
||||
@@ -59583,14 +59436,11 @@ function createTypeChecker(host) {
|
||||
function isNoInferType(type) {
|
||||
return !!(type.flags & 33554432 /* Substitution */ && type.constraint.flags & 2 /* Unknown */);
|
||||
}
|
||||
function isNarrowingSubstitutionType(type) {
|
||||
return !!(type.flags & 33554432 /* Substitution */ && type.objectFlags & 16777216 /* IsNarrowingType */);
|
||||
function getSubstitutionType(baseType, constraint) {
|
||||
return constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType || baseType.flags & 1 /* Any */ ? baseType : getOrCreateSubstitutionType(baseType, constraint);
|
||||
}
|
||||
function getSubstitutionType(baseType, constraint, isNarrowed) {
|
||||
return constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType || baseType.flags & 1 /* Any */ ? baseType : getOrCreateSubstitutionType(baseType, constraint, isNarrowed);
|
||||
}
|
||||
function getOrCreateSubstitutionType(baseType, constraint, isNarrowed) {
|
||||
const id = `${getTypeId(baseType)}>${getTypeId(constraint)}${isNarrowed ? ">N" : ""}`;
|
||||
function getOrCreateSubstitutionType(baseType, constraint) {
|
||||
const id = `${getTypeId(baseType)}>${getTypeId(constraint)}`;
|
||||
const cached = substitutionTypes.get(id);
|
||||
if (cached) {
|
||||
return cached;
|
||||
@@ -59598,9 +59448,6 @@ function createTypeChecker(host) {
|
||||
const result = createType(33554432 /* Substitution */);
|
||||
result.baseType = baseType;
|
||||
result.constraint = constraint;
|
||||
if (isNarrowed) {
|
||||
result.objectFlags |= 16777216 /* IsNarrowingType */;
|
||||
}
|
||||
substitutionTypes.set(id, result);
|
||||
return result;
|
||||
}
|
||||
@@ -61806,7 +61653,7 @@ function createTypeChecker(host) {
|
||||
function isDeferredType(type, checkTuples) {
|
||||
return isGenericType(type) || checkTuples && isTupleType(type) && some(getElementTypes(type), isGenericType);
|
||||
}
|
||||
function getConditionalType(root, mapper, forConstraint, aliasSymbol, aliasTypeArguments, forNarrowing) {
|
||||
function getConditionalType(root, mapper, forConstraint, aliasSymbol, aliasTypeArguments) {
|
||||
let result;
|
||||
let extraTypes;
|
||||
let tailCount = 0;
|
||||
@@ -61823,11 +61670,10 @@ function createTypeChecker(host) {
|
||||
if (checkType === wildcardType || extendsType === wildcardType) {
|
||||
return wildcardType;
|
||||
}
|
||||
const effectiveCheckType = forNarrowing && isNarrowingSubstitutionType(checkType) ? checkType.constraint : checkType;
|
||||
const checkTypeNode = skipTypeParentheses(root.node.checkType);
|
||||
const extendsTypeNode = skipTypeParentheses(root.node.extendsType);
|
||||
const checkTuples = isSimpleTupleType(checkTypeNode) && isSimpleTupleType(extendsTypeNode) && length(checkTypeNode.elements) === length(extendsTypeNode.elements);
|
||||
const checkTypeDeferred = isDeferredType(effectiveCheckType, checkTuples);
|
||||
const checkTypeDeferred = isDeferredType(checkType, checkTuples);
|
||||
let combinedMapper;
|
||||
if (root.inferTypeParameters) {
|
||||
const context = createInferenceContext(
|
||||
@@ -61846,8 +61692,8 @@ function createTypeChecker(host) {
|
||||
}
|
||||
const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType;
|
||||
if (!checkTypeDeferred && !isDeferredType(inferredExtendsType, checkTuples)) {
|
||||
if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (effectiveCheckType.flags & 1 /* Any */ || !isTypeAssignableTo(getPermissiveInstantiation(effectiveCheckType), getPermissiveInstantiation(inferredExtendsType)))) {
|
||||
if (effectiveCheckType.flags & 1 /* Any */ || forConstraint && !(inferredExtendsType.flags & 131072 /* Never */) && someType(getPermissiveInstantiation(inferredExtendsType), (t) => isTypeAssignableTo(t, getPermissiveInstantiation(effectiveCheckType)))) {
|
||||
if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (checkType.flags & 1 /* Any */ || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) {
|
||||
if (checkType.flags & 1 /* Any */ || forConstraint && !(inferredExtendsType.flags & 131072 /* Never */) && someType(getPermissiveInstantiation(inferredExtendsType), (t) => isTypeAssignableTo(t, getPermissiveInstantiation(checkType)))) {
|
||||
(extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper));
|
||||
}
|
||||
const falseType2 = getTypeFromTypeNode(root.node.falseType);
|
||||
@@ -61864,7 +61710,7 @@ function createTypeChecker(host) {
|
||||
result = instantiateType(falseType2, mapper);
|
||||
break;
|
||||
}
|
||||
if (inferredExtendsType.flags & 3 /* AnyOrUnknown */ || isTypeAssignableTo(getRestrictiveInstantiation(effectiveCheckType), getRestrictiveInstantiation(inferredExtendsType))) {
|
||||
if (inferredExtendsType.flags & 3 /* AnyOrUnknown */ || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) {
|
||||
const trueType2 = getTypeFromTypeNode(root.node.trueType);
|
||||
const trueMapper = combinedMapper || mapper;
|
||||
if (canTailRecurse(trueType2, trueMapper)) {
|
||||
@@ -62830,39 +62676,8 @@ function createTypeChecker(host) {
|
||||
if (!result) {
|
||||
const newMapper = createTypeMapper(root.outerTypeParameters, typeArguments);
|
||||
const checkType = root.checkType;
|
||||
let distributionType = root.isDistributive ? getReducedType(getMappedType(checkType, newMapper)) : void 0;
|
||||
let narrowingBaseType;
|
||||
const forNarrowing = distributionType && isNarrowingSubstitutionType(distributionType) && isNarrowableConditionalType(type, mapper);
|
||||
if (forNarrowing) {
|
||||
narrowingBaseType = distributionType.baseType;
|
||||
distributionType = getReducedType(distributionType.constraint);
|
||||
}
|
||||
if (distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */)) {
|
||||
if (narrowingBaseType) {
|
||||
result = mapTypeToIntersection(
|
||||
distributionType,
|
||||
(t) => getConditionalType(
|
||||
root,
|
||||
prependTypeMapping(checkType, getSubstitutionType(
|
||||
narrowingBaseType,
|
||||
t,
|
||||
/*isNarrowed*/
|
||||
true
|
||||
), newMapper),
|
||||
forConstraint,
|
||||
/*aliasSymbol*/
|
||||
void 0,
|
||||
/*aliasTypeArguments*/
|
||||
void 0,
|
||||
forNarrowing
|
||||
)
|
||||
);
|
||||
} else {
|
||||
result = mapTypeWithAlias(distributionType, (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper), forConstraint), aliasSymbol, aliasTypeArguments);
|
||||
}
|
||||
} else {
|
||||
result = getConditionalType(root, newMapper, forConstraint, aliasSymbol, aliasTypeArguments, forNarrowing);
|
||||
}
|
||||
const distributionType = root.isDistributive ? getReducedType(getMappedType(checkType, newMapper)) : void 0;
|
||||
result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(distributionType, (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper), forConstraint), aliasSymbol, aliasTypeArguments) : getConditionalType(root, newMapper, forConstraint, aliasSymbol, aliasTypeArguments);
|
||||
root.instantiations.set(id, result);
|
||||
}
|
||||
return result;
|
||||
@@ -64005,12 +63820,10 @@ function createTypeChecker(host) {
|
||||
function shouldNormalizeIntersection(type) {
|
||||
let hasInstantiable = false;
|
||||
let hasNullableOrEmpty = false;
|
||||
let hasSubstitution = false;
|
||||
for (const t of type.types) {
|
||||
hasInstantiable || (hasInstantiable = !!(t.flags & 465829888 /* Instantiable */));
|
||||
hasNullableOrEmpty || (hasNullableOrEmpty = !!(t.flags & 98304 /* Nullable */) || isEmptyAnonymousObjectType(t));
|
||||
hasSubstitution || (hasSubstitution = isNarrowingSubstitutionType(t));
|
||||
if (hasInstantiable && hasNullableOrEmpty || hasSubstitution) return true;
|
||||
if (hasInstantiable && hasNullableOrEmpty) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -69170,18 +68983,6 @@ function createTypeChecker(host) {
|
||||
}
|
||||
return changed ? mappedTypes && getUnionType(mappedTypes, noReductions ? 0 /* None */ : 1 /* Literal */) : type;
|
||||
}
|
||||
function mapTypeToIntersection(type, mapper) {
|
||||
if (type.flags & 131072 /* Never */) {
|
||||
return type;
|
||||
}
|
||||
if (!(type.flags & 1048576 /* Union */)) {
|
||||
return mapper(type);
|
||||
}
|
||||
const origin = type.origin;
|
||||
const types = origin && origin.flags & 1048576 /* Union */ ? origin.types : type.types;
|
||||
const mappedTypes = types.map((t) => t.flags & 1048576 /* Union */ ? mapTypeToIntersection(t, mapper) : mapper(t));
|
||||
return getIntersectionType(mappedTypes);
|
||||
}
|
||||
function mapTypeWithAlias(type, mapper, aliasSymbol, aliasTypeArguments) {
|
||||
return type.flags & 1048576 /* Union */ && aliasSymbol ? getUnionType(map(type.types, mapper), 1 /* Literal */, aliasSymbol, aliasTypeArguments) : mapType(type, mapper);
|
||||
}
|
||||
@@ -70766,11 +70567,11 @@ function createTypeChecker(host) {
|
||||
));
|
||||
return contextualType && !isGenericType(contextualType);
|
||||
}
|
||||
function getNarrowableTypeForReference(type, reference, checkMode, forReturnTypeNarrowing) {
|
||||
function getNarrowableTypeForReference(type, reference, checkMode) {
|
||||
if (isNoInferType(type)) {
|
||||
type = type.baseType;
|
||||
}
|
||||
const substituteConstraints = !(checkMode && checkMode & 2 /* Inferential */) && someType(type, isGenericTypeWithUnionConstraint) && (forReturnTypeNarrowing || isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
|
||||
const substituteConstraints = !(checkMode && checkMode & 2 /* Inferential */) && someType(type, isGenericTypeWithUnionConstraint) && (isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
|
||||
return substituteConstraints ? mapType(type, getBaseConstraintOrType) : type;
|
||||
}
|
||||
function isExportOrExportExpression(location) {
|
||||
@@ -71897,16 +71698,9 @@ function createTypeChecker(host) {
|
||||
function getContextualTypeForReturnExpression(node, contextFlags) {
|
||||
const func = getContainingFunction(node);
|
||||
if (func) {
|
||||
const functionFlags = getFunctionFlags(func);
|
||||
const links = getNodeLinks(node);
|
||||
if (links.contextualReturnType) {
|
||||
if (functionFlags & 2 /* Async */) {
|
||||
return getUnionType([links.contextualReturnType, createPromiseLikeType(links.contextualReturnType)]);
|
||||
}
|
||||
return links.contextualReturnType;
|
||||
}
|
||||
let contextualReturnType = getContextualReturnType(func, contextFlags);
|
||||
if (contextualReturnType) {
|
||||
const functionFlags = getFunctionFlags(func);
|
||||
if (functionFlags & 1 /* Generator */) {
|
||||
const isAsyncGenerator = (functionFlags & 2 /* Async */) !== 0;
|
||||
if (contextualReturnType.flags & 1048576 /* Union */) {
|
||||
@@ -72604,13 +72398,6 @@ function createTypeChecker(host) {
|
||||
if (index >= 0) {
|
||||
return contextualTypes[index];
|
||||
}
|
||||
const links = getNodeLinks(node);
|
||||
if (links.contextualReturnType) {
|
||||
if (node.flags & 65536 /* AwaitContext */) {
|
||||
return getUnionType([links.contextualReturnType, createPromiseLikeType(links.contextualReturnType)]);
|
||||
}
|
||||
return links.contextualReturnType;
|
||||
}
|
||||
const { parent } = node;
|
||||
switch (parent.kind) {
|
||||
case 260 /* VariableDeclaration */:
|
||||
@@ -83599,199 +83386,7 @@ function createTypeChecker(host) {
|
||||
) : exprType;
|
||||
const effectiveExpr = expr && getEffectiveCheckNode(expr);
|
||||
const errorNode = inReturnStatement && !inConditionalExpression ? node : effectiveExpr;
|
||||
if (!(unwrappedReturnType.flags & (8388608 /* IndexedAccess */ | 16777216 /* Conditional */)) || !couldContainTypeVariables(unwrappedReturnType)) {
|
||||
checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, errorNode, effectiveExpr);
|
||||
return;
|
||||
}
|
||||
if (checkTypeAssignableTo(
|
||||
unwrappedExprType,
|
||||
unwrappedReturnType,
|
||||
/*errorNode*/
|
||||
void 0
|
||||
)) {
|
||||
return;
|
||||
}
|
||||
let narrowPosition = node;
|
||||
let narrowFlowNode = inReturnStatement && node.flowNode;
|
||||
if (expr && isConditionalExpression(expr.parent)) {
|
||||
narrowFlowNode = expr.parent.whenTrue === expr ? expr.parent.flowNodeWhenTrue : expr.parent.flowNodeWhenFalse;
|
||||
narrowPosition = expr;
|
||||
}
|
||||
if (!narrowFlowNode) {
|
||||
checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, errorNode, effectiveExpr);
|
||||
return;
|
||||
}
|
||||
const allTypeParameters = appendTypeParameters(getOuterTypeParameters(
|
||||
container,
|
||||
/*includeThisTypes*/
|
||||
false
|
||||
), getEffectiveTypeParameterDeclarations(container));
|
||||
const narrowableTypeParameters = allTypeParameters && getNarrowableTypeParameters(allTypeParameters);
|
||||
if (!narrowableTypeParameters || !narrowableTypeParameters.length || !isNarrowableReturnType(unwrappedReturnType)) {
|
||||
checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, errorNode, effectiveExpr);
|
||||
return;
|
||||
}
|
||||
const narrowedTypeParameters = [];
|
||||
const narrowedTypes = [];
|
||||
for (const [typeParam, symbol, reference] of narrowableTypeParameters) {
|
||||
const narrowReference = factory.cloneNode(reference);
|
||||
narrowReference.id = void 0;
|
||||
getNodeLinks(narrowReference).resolvedSymbol = symbol;
|
||||
setParent(narrowReference, narrowPosition.parent);
|
||||
narrowReference.flowNode = narrowFlowNode;
|
||||
const initialType = getNarrowableTypeForReference(
|
||||
typeParam,
|
||||
narrowReference,
|
||||
/*checkMode*/
|
||||
void 0,
|
||||
/*forReturnTypeNarrowing*/
|
||||
true
|
||||
);
|
||||
if (initialType === typeParam) {
|
||||
continue;
|
||||
}
|
||||
const flowType = getFlowTypeOfReference(narrowReference, initialType);
|
||||
const exprType2 = getTypeFromFlowType(flowType);
|
||||
if (exprType2.flags & 3 /* AnyOrUnknown */ || isErrorType(exprType2) || exprType2 === typeParam || exprType2 === mapType(typeParam, getBaseConstraintOrType)) {
|
||||
continue;
|
||||
}
|
||||
const narrowedType = getSubstitutionType(
|
||||
typeParam,
|
||||
exprType2,
|
||||
/*isNarrowed*/
|
||||
true
|
||||
);
|
||||
narrowedTypeParameters.push(typeParam);
|
||||
narrowedTypes.push(narrowedType);
|
||||
}
|
||||
const narrowMapper = createTypeMapper(narrowedTypeParameters, narrowedTypes);
|
||||
const narrowedReturnType = instantiateType(
|
||||
unwrappedReturnType,
|
||||
narrowMapper
|
||||
);
|
||||
if (expr) {
|
||||
const links = getNodeLinks(expr);
|
||||
if (!links.contextualReturnType) {
|
||||
links.contextualReturnType = narrowedReturnType;
|
||||
}
|
||||
}
|
||||
const narrowedExprType = expr ? checkExpression(expr) : undefinedType;
|
||||
const narrowedUnwrappedExprType = functionFlags & 2 /* Async */ ? checkAwaitedType(
|
||||
narrowedExprType,
|
||||
/*withAlias*/
|
||||
false,
|
||||
node,
|
||||
Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
|
||||
) : narrowedExprType;
|
||||
checkTypeAssignableToAndOptionallyElaborate(narrowedUnwrappedExprType, narrowedReturnType, errorNode, effectiveExpr);
|
||||
}
|
||||
function getNarrowableTypeParameters(candidates) {
|
||||
const narrowableParams = [];
|
||||
for (const typeParam of candidates) {
|
||||
const constraint = getConstraintOfTypeParameter(typeParam);
|
||||
if (!constraint || !(constraint.flags & 1048576 /* Union */)) continue;
|
||||
if (typeParam.symbol && typeParam.symbol.declarations && typeParam.symbol.declarations.length === 1) {
|
||||
const declaration = typeParam.symbol.declarations[0];
|
||||
const container = isJSDocTemplateTag(declaration.parent) ? getJSDocHost(declaration.parent) : declaration.parent;
|
||||
if (!isFunctionLike(container)) continue;
|
||||
let reference;
|
||||
let hasInvalidReference = false;
|
||||
for (const paramDecl of container.parameters) {
|
||||
const typeNode = getEffectiveTypeAnnotationNode(paramDecl);
|
||||
if (!typeNode) continue;
|
||||
if (isTypeParameterReferenced(typeParam, typeNode)) {
|
||||
let candidateReference;
|
||||
if (isTypeReferenceNode(typeNode) && isReferenceToTypeParameter(typeParam, typeNode) && (candidateReference = getValidParameterReference(paramDecl, constraint))) {
|
||||
if (reference) {
|
||||
hasInvalidReference = true;
|
||||
break;
|
||||
}
|
||||
reference = candidateReference;
|
||||
} else {
|
||||
hasInvalidReference = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!hasInvalidReference && reference) {
|
||||
const symbol = getResolvedSymbol(reference);
|
||||
if (symbol !== unknownSymbol) narrowableParams.push([typeParam, symbol, reference]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return narrowableParams;
|
||||
function getValidParameterReference(paramDecl, constraint) {
|
||||
if (!isIdentifier(paramDecl.name)) return;
|
||||
const isOptional = !!paramDecl.questionToken || isJSDocOptionalParameter(paramDecl);
|
||||
if (isOptional && !containsUndefinedType(constraint)) return;
|
||||
return paramDecl.name;
|
||||
}
|
||||
function isReferenceToTypeParameter(typeParam, node) {
|
||||
return getTypeFromTypeReference(node) === typeParam;
|
||||
}
|
||||
function isTypeParameterReferenced(typeParam, node) {
|
||||
return isReferenced(node);
|
||||
function isReferenced(node2) {
|
||||
if (isTypeReferenceNode(node2)) {
|
||||
return isReferenceToTypeParameter(typeParam, node2);
|
||||
}
|
||||
if (isTypeQueryNode(node2)) {
|
||||
return isTypeParameterPossiblyReferenced(typeParam, node2);
|
||||
}
|
||||
return !!forEachChild(node2, isReferenced);
|
||||
}
|
||||
}
|
||||
}
|
||||
function isNarrowableReturnType(returnType) {
|
||||
return isConditionalType(returnType) ? isNarrowableConditionalType(returnType) : !!(returnType.indexType.flags & 262144 /* TypeParameter */);
|
||||
}
|
||||
function isNarrowableConditionalType(type, mapper) {
|
||||
const typeArguments = mapper && map(type.root.outerTypeParameters, (t) => {
|
||||
const mapped = getMappedType(t, mapper);
|
||||
if (isNarrowingSubstitutionType(mapped)) {
|
||||
return mapped.baseType;
|
||||
}
|
||||
return mapped;
|
||||
});
|
||||
const id = `${type.id}:${getTypeListId(typeArguments)}`;
|
||||
let result = narrowableReturnTypeCache.get(id);
|
||||
if (result === void 0) {
|
||||
const nonNarrowingMapper = type.root.outerTypeParameters && typeArguments && createTypeMapper(type.root.outerTypeParameters, typeArguments);
|
||||
const instantiatedType = instantiateType(type, nonNarrowingMapper);
|
||||
result = isConditionalType(instantiatedType) && isNarrowableConditionalTypeWorker(instantiatedType);
|
||||
narrowableReturnTypeCache.set(id, result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function isNarrowableConditionalTypeWorker(type) {
|
||||
if (!type.root.isDistributive) {
|
||||
return false;
|
||||
}
|
||||
if (type.root.inferTypeParameters) {
|
||||
return false;
|
||||
}
|
||||
if (!(type.checkType.flags & 262144 /* TypeParameter */)) {
|
||||
return false;
|
||||
}
|
||||
const constraintType = getConstraintOfTypeParameter(type.checkType);
|
||||
if (!constraintType || !(constraintType.flags & 1048576 /* Union */)) {
|
||||
return false;
|
||||
}
|
||||
if (!everyType(type.extendsType, (extendsType) => some(
|
||||
constraintType.types,
|
||||
(constraintType2) => isTypeIdenticalTo(constraintType2, extendsType)
|
||||
))) {
|
||||
return false;
|
||||
}
|
||||
const trueType2 = getTrueTypeFromConditionalType(type);
|
||||
const isValidTrueType = isConditionalType(trueType2) ? isNarrowableConditionalType(trueType2) : true;
|
||||
if (!isValidTrueType) return false;
|
||||
const falseType2 = getFalseTypeFromConditionalType(type);
|
||||
const isValidFalseType = isConditionalType(falseType2) ? isNarrowableConditionalType(falseType2) : falseType2 === neverType;
|
||||
return isValidFalseType;
|
||||
}
|
||||
function isConditionalType(type) {
|
||||
return !!(type.flags & 16777216 /* Conditional */);
|
||||
checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, errorNode, effectiveExpr);
|
||||
}
|
||||
function checkWithStatement(node) {
|
||||
if (!checkGrammarStatementInAmbientContext(node)) {
|
||||
@@ -85401,7 +84996,7 @@ function createTypeChecker(host) {
|
||||
);
|
||||
}
|
||||
if (moduleKind === 199 /* NodeNext */ && !isImportAttributes2) {
|
||||
return grammarErrorOnFirstToken(node, Diagnostics.Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_asserts);
|
||||
return grammarErrorOnFirstToken(node, Diagnostics.Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert);
|
||||
}
|
||||
if (declaration.moduleSpecifier && getEmitSyntaxForModuleSpecifierExpression(declaration.moduleSpecifier) === 1 /* CommonJS */) {
|
||||
return grammarErrorOnNode(
|
||||
|
||||
@@ -618,6 +618,7 @@
|
||||
"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672": "Zakázat import, require nebo <reference> zvětšování počtu souborů, které by typeScript měl přidat do projektu.",
|
||||
"Disallow_inconsistently_cased_references_to_the_same_file_6078": "Zakažte odkazy na stejný soubor s nekonzistentně použitými malými a velkými písmeny.",
|
||||
"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159": "Nepřidávat odkazy se třemi lomítky nebo importované moduly do seznamu kompilovaných souborů",
|
||||
"Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721": "Nepovolit konstruktory modulu runtime, které nejsou součástí ECMAScriptu",
|
||||
"Do_not_emit_comments_to_output_6009": "Negenerovat komentáře pro výstup",
|
||||
"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056": "Negenerovat deklarace pro kód s anotací @internal",
|
||||
"Do_not_emit_outputs_6010": "Negenerovat výstupy",
|
||||
@@ -681,6 +682,7 @@
|
||||
"Enable_experimental_support_for_legacy_experimental_decorators_6630": "Povolte experimentální podporu pro starší experimentální dekoratéry.",
|
||||
"Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264": "Povolte import souborů s libovolnou příponou za předpokladu, že je k dispozici soubor deklarace.",
|
||||
"Enable_importing_json_files_6689": "Povolte importování souborů .json.",
|
||||
"Enable_lib_replacement_6808": "Povolit nahrazení knihovny",
|
||||
"Enable_project_compilation_6302": "Povolit kompilování projektu",
|
||||
"Enable_strict_bind_call_and_apply_methods_on_functions_6214": "Povolte ve funkcích metody bind, call a apply.",
|
||||
"Enable_strict_checking_of_function_types_6186": "Povolí striktní kontrolu typů funkcí.",
|
||||
@@ -890,6 +892,7 @@
|
||||
"Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836": "V příkazech, které se kompilují na volání CommonJS „require“, se nepovolují kontrolní výrazy importu.",
|
||||
"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2821": "Kontrolní výrazy importu jsou podporovány pouze v případě, že je možnost --module nastavena na esnext, node18, nodenext nebo preserve.",
|
||||
"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822": "Kontrolní výrazy importu se nedají použít s importy nebo exporty, které jsou jenom typ.",
|
||||
"Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880": "Kontrolní výrazy importu byly nahrazeny atributy importu. Místo assert použijte with.",
|
||||
"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "Přiřazení importu nelze použít, pokud jsou cílem moduly ECMAScript. Zkuste místo toho použít import * as ns from \"mod\", import {a} from \"mod\", import d from \"mod\" nebo jiný formát modulu.",
|
||||
"Import_attribute_values_must_be_string_literal_expressions_2858": "Hodnoty atributů importu musí být výrazy formou řetězcových literálů.",
|
||||
"Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856": "V příkazech, které se kompilují na volání CommonJS „require“, se nepovolují atributy importu.",
|
||||
@@ -1685,6 +1688,7 @@
|
||||
"This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1501": "Tento příznak regulárního výrazu je k dispozici pouze při cílení na „{0}“ nebo novější.",
|
||||
"This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolv_2876": "Přepsání této relativní cesty importu není bezpečné, protože cesta vypadá jako název souboru, ale ve skutečnosti se překládá na {0}.",
|
||||
"This_spread_always_overwrites_this_property_2785": "Tento rozsah vždy přepíše tuto vlastnost.",
|
||||
"This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294": "Tato syntaxe není povolená, pokud je povolená možnost erasableSyntaxOnly.",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060": "Tato syntaxe je vyhrazená pro soubory s příponou .mts nebo .cts. Přidejte koncovou čárku nebo explicitní omezení.",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059": "Tato syntaxe je vyhrazená pro soubory s příponou .mts nebo .cts. Místo toho použijte výraz „as“.",
|
||||
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "Tato syntaxe vyžaduje importovanou podpůrnou aplikaci, ale modul {0} se nenašel.",
|
||||
|
||||
@@ -618,6 +618,7 @@
|
||||
"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672": "Hiermit wird verhindert, dass „import“, „require“ oder „<reference>“ die Anzahl der Dateien erweitern, die TypeScript einem Projekt hinzufügen soll.",
|
||||
"Disallow_inconsistently_cased_references_to_the_same_file_6078": "Verweise mit uneinheitlicher Groß-/Kleinschreibung auf die gleiche Datei nicht zulassen.",
|
||||
"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159": "Fügen Sie keine Verweise mit dreifachen Schrägstrichen oder importierte Module zur Liste kompilierter Dateien hinzu.",
|
||||
"Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721": "Laufzeitkonstrukte, die nicht Teil von ECMAScript sind, nicht zulassen",
|
||||
"Do_not_emit_comments_to_output_6009": "Kommentare nicht an die Ausgabe ausgeben.",
|
||||
"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056": "Deklarationen für Code mit einer Anmerkung \"@internal\" nicht ausgeben.",
|
||||
"Do_not_emit_outputs_6010": "Keine Ausgaben ausgeben.",
|
||||
@@ -681,6 +682,7 @@
|
||||
"Enable_experimental_support_for_legacy_experimental_decorators_6630": "Aktivieren Sie experimentelle Unterstützung für experimentelle Legacy-Decorators.",
|
||||
"Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264": "Hiermit wird das Importieren von Dateien mit beliebiger Erweiterung aktiviert, sofern eine Deklarationsdatei vorhanden ist.",
|
||||
"Enable_importing_json_files_6689": "Aktivieren Sie das Importieren von JSON-Dateien.",
|
||||
"Enable_lib_replacement_6808": "Libersetzung aktivieren.",
|
||||
"Enable_project_compilation_6302": "Projektkompilierung aktivieren",
|
||||
"Enable_strict_bind_call_and_apply_methods_on_functions_6214": "Aktivieren Sie die strict-Methoden \"bind\", \"call\" und \"apply\" für Funktionen.",
|
||||
"Enable_strict_checking_of_function_types_6186": "Aktivieren Sie die strenge Überprüfung für Funktionstypen.",
|
||||
@@ -890,6 +892,7 @@
|
||||
"Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836": "Importassertionen sind für Anweisungen, die in \"require\"-Aufrufe von \"CommonJS\" kompilieren, nicht zulässig.",
|
||||
"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2821": "Importassertionen werden nur unterstützt, wenn die Option „--module“ auf „esnext“, „node18“, „nodenext“ oder „preserve“ festgelegt ist.",
|
||||
"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822": "Importassertionen können nicht mit rein typbasierten Importen oder Exporten verwendet werden.",
|
||||
"Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880": "Importassertionen wurden durch Importattribute ersetzt. Verwenden Sie \"with\" anstelle von \"assert\".",
|
||||
"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "Die Importzuweisung kann nicht verwendet werden, wenn das Ziel ECMAScript-Module sind. Verwenden Sie stattdessen ggf. \"import * as ns from 'mod'\", \"import {a} from 'mod'\", \"import d from 'mod'\" oder ein anderes Modulformat.",
|
||||
"Import_attribute_values_must_be_string_literal_expressions_2858": "Importattributwerte müssen Zeichenfolgenliteralausdrücke sein.",
|
||||
"Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856": "Importattribute sind für Anweisungen, die in \"require\"-Aufrufe von \"CommonJS\" kompiliert werden, nicht zulässig.",
|
||||
@@ -1685,6 +1688,7 @@
|
||||
"This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1501": "Dieses Flag für reguläre Ausdrücke ist nur verfügbar, wenn es auf „{0}“ oder höher ausgerichtet ist.",
|
||||
"This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolv_2876": "Dieser relative Importpfad ist unsicher umzuschreiben, da er wie ein Dateiname aussieht, aber tatsächlich auf \"{0}\" verweist.",
|
||||
"This_spread_always_overwrites_this_property_2785": "Diese Eigenschaft wird immer durch diesen Spread-Operator überschrieben.",
|
||||
"This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294": "Diese Syntax ist nicht zulässig, wenn \"erasableSyntaxOnly\" aktiviert ist.",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060": "Diese Syntax ist in Dateien mit der Erweiterung .mts oder .cts reserviert. Fügen Sie ein nachfolgendes Komma oder eine explizite Einschränkung hinzu.",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059": "Diese Syntax ist in Dateien mit der Erweiterung \".mts\" oder \".cts\" reserviert. Verwenden Sie stattdessen einen „as“-Ausdruck.",
|
||||
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "Diese Syntax erfordert ein importiertes Hilfsprogramm, aber das Modul \"{0}\" wurde nicht gefunden.",
|
||||
|
||||
@@ -618,6 +618,7 @@
|
||||
"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672": "No permita que ningún \"import\", \"require\" o \"<reference>\" amplíe el número de archivos que TypeScript debe agregar a un proyecto.",
|
||||
"Disallow_inconsistently_cased_references_to_the_same_file_6078": "No permitir referencias al mismo archivo con un uso incoherente de mayúsculas y minúsculas.",
|
||||
"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159": "No agregar módulos importados ni referencias con triple barra diagonal a la lista de archivos compilados.",
|
||||
"Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721": "No permitir construcciones en tiempo de ejecución que no formen parte de ECMAScript.",
|
||||
"Do_not_emit_comments_to_output_6009": "No emitir comentarios en la salida.",
|
||||
"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056": "No emitir declaraciones para el código que tiene una anotación \"@internal\".",
|
||||
"Do_not_emit_outputs_6010": "No emitir salidas.",
|
||||
@@ -681,6 +682,7 @@
|
||||
"Enable_experimental_support_for_legacy_experimental_decorators_6630": "Habilite la compatibilidad experimental con decoradores experimentales heredados.",
|
||||
"Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264": "Habilite la importación de archivos con cualquier extensión, siempre que haya un archivo de declaración presente.",
|
||||
"Enable_importing_json_files_6689": "Habilite la importación de archivos .json.",
|
||||
"Enable_lib_replacement_6808": "Habilite el reemplazo de bibliotecas.",
|
||||
"Enable_project_compilation_6302": "Habilitar la compilación de proyecto",
|
||||
"Enable_strict_bind_call_and_apply_methods_on_functions_6214": "Habilite los métodos estrictos \"bind\", \"call\" y \"apply\" en las funciones.",
|
||||
"Enable_strict_checking_of_function_types_6186": "Habilite la comprobación estricta de los tipos de función.",
|
||||
@@ -890,6 +892,7 @@
|
||||
"Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836": "No se permiten aserciones de importación en instrucciones que se compilan en llamadas “require” de CommonJS.",
|
||||
"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2821": "Las aserciones de importación solo se admiten cuando la opción \"--module\" está establecida en \"esnext\", \"node18\", \"nodenext\" o \"preserve\".",
|
||||
"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822": "Las aserciones de importación no se pueden usar con importaciones o exportaciones de solo tipo.",
|
||||
"Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880": "Las aserciones de importación se han reemplazado por atributos de importación. Use 'with' en lugar de 'assert'.",
|
||||
"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "No se puede usar una asignación de importación cuando se eligen módulos de ECMAScript como destino. Considere la posibilidad de usar \"import * as ns from 'mod'\", \"import {a} from 'mod'\", \"import d from 'mod'\" u otro formato de módulo en su lugar.",
|
||||
"Import_attribute_values_must_be_string_literal_expressions_2858": "Los valores de atributo de importación deben ser expresiones literales de cadena.",
|
||||
"Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856": "No se permiten atributos de importación en instrucciones que se compilan en llamadas “require” de CommonJS.",
|
||||
@@ -1685,6 +1688,7 @@
|
||||
"This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1501": "Esta marca de expresión regular solo está disponible cuando el destino es “{0}” o posterior.",
|
||||
"This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolv_2876": "Esta ruta de acceso de importación relativa no es segura de reescribir porque parece un nombre de archivo, pero realmente se resuelve en \"{0}\".",
|
||||
"This_spread_always_overwrites_this_property_2785": "Este elemento de propagación siempre sobrescribe esta propiedad.",
|
||||
"This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294": "Esta sintaxis no se permite cuando \"erasableSyntaxOnly\" está habilitado.",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060": "Esta sintaxis está reservada en archivos con la extensión .mts o .CTS. Agregue una coma o una restricción explícita al final.",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059": "Esta sintaxis se reserva a archivos con la extensión .mts o .cts. En su lugar, use una expresión \"as\".",
|
||||
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "Esta sintaxis requiere un asistente importado, pero no se puede encontrar el módulo \"{0}\".",
|
||||
|
||||
@@ -618,6 +618,7 @@
|
||||
"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672": "Interdire à « import », « require » ou « <reference> » d’étendre le nombre de fichiers que TypeScript doit ajouter à un projet.",
|
||||
"Disallow_inconsistently_cased_references_to_the_same_file_6078": "Interdisez les références dont la casse est incohérente dans le même fichier.",
|
||||
"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159": "N'ajoutez pas de références avec trois barres obliques, ni de modules importés à la liste des fichiers compilés.",
|
||||
"Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721": "N’autorisez pas les constructions d’exécution qui ne font pas partie d’ECMAScript.",
|
||||
"Do_not_emit_comments_to_output_6009": "Ne pas émettre de commentaires dans la sortie.",
|
||||
"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056": "N'émettez pas de déclarations pour du code ayant une annotation '@internal'.",
|
||||
"Do_not_emit_outputs_6010": "N'émettez pas de sorties.",
|
||||
@@ -681,6 +682,7 @@
|
||||
"Enable_experimental_support_for_legacy_experimental_decorators_6630": "Activez la prise en charge expérimentale des éléments décoratifs expérimentaux hérités.",
|
||||
"Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264": "Activez l’importation de fichiers avec n’importe quelle extension, à condition qu’un fichier de déclaration soit présent.",
|
||||
"Enable_importing_json_files_6689": "Activer l’importation des fichiers .json.",
|
||||
"Enable_lib_replacement_6808": "Activez le remplacement de la bibliothèque.",
|
||||
"Enable_project_compilation_6302": "Activer la compilation du projet",
|
||||
"Enable_strict_bind_call_and_apply_methods_on_functions_6214": "Activez des méthodes 'bind', 'call' et 'apply' strictes sur les fonctions.",
|
||||
"Enable_strict_checking_of_function_types_6186": "Activez la vérification stricte des types de fonction.",
|
||||
@@ -890,6 +892,7 @@
|
||||
"Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836": "Les assertions d’importation ne sont pas autorisées sur les instructions qui se compilent en appels CommonJS ' require'.",
|
||||
"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2821": "Les assertions d’importation sont prises en charge uniquement lorsque l’option « --module » est définie sur « esnext », « node18 », « nodenext » ou « preserve ».",
|
||||
"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822": "Les assertions d’importation ne peuvent pas être utilisées avec les importations ou exportations de type uniquement.",
|
||||
"Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880": "Les assertions d’importation ont été remplacées par des attributs d’importation. Utilisez 'with' à la place de 'assert'.",
|
||||
"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "Vous ne pouvez pas utiliser l'assignation d'importation pour cibler des modules ECMAScript. Utilisez plutôt 'import * as ns from \"mod\"', 'import {a} from \"mod\"', 'import d from \"mod\"' ou un autre format de module.",
|
||||
"Import_attribute_values_must_be_string_literal_expressions_2858": "Les valeurs d’attribut d’importation doivent être des expressions littérales de chaîne.",
|
||||
"Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856": "Les attributs d’importation ne sont pas autorisés sur les instructions qui se compilent en appels CommonJS ' require'.",
|
||||
@@ -1685,6 +1688,7 @@
|
||||
"This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1501": "Cet indicateur d’expression régulière n’est disponible que lors du ciblage de « {0} » ou d’une version ultérieure.",
|
||||
"This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolv_2876": "Ce chemin d'importation relatif n'est pas sûr à réécrire car il ressemble à un nom de fichier, mais se résout en réalité en « {0} ».",
|
||||
"This_spread_always_overwrites_this_property_2785": "Cette diffusion écrase toujours cette propriété.",
|
||||
"This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294": "Cette syntaxe n’est pas autorisée quand 'erasableSyntaxOnly' est activé.",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060": "Cette syntaxe est réservée dans les fichiers avec l’extension .mts ou .cts. Veuillez ajouter une virgule de fin ou une contrainte explicite.",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059": "Cette syntaxe est réservée dans les fichiers avec l’extension .mts ou .cts. Utilisez une expression « as »à la place.",
|
||||
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "Cette syntaxe nécessite une application d'assistance importée, mais le module '{0}' est introuvable.",
|
||||
|
||||
@@ -618,6 +618,7 @@
|
||||
"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672": "Non consente a direttive 'import's, 'require's o '<reference>' di espandere il numero di file che TypeScript deve aggiungere a un progetto.",
|
||||
"Disallow_inconsistently_cased_references_to_the_same_file_6078": "Non consente riferimenti allo stesso file in cui le maiuscole/minuscole vengono usate in modo incoerente.",
|
||||
"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159": "Non aggiunge riferimenti con tripla barra (////) o moduli importati all'elenco di file compilati.",
|
||||
"Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721": "Non consentire costrutti di runtime che non fanno parte di ECMAScript.",
|
||||
"Do_not_emit_comments_to_output_6009": "Non crea commenti nell'output.",
|
||||
"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056": "Non crea dichiarazioni per codice che contiene un'annotazione '@internal'.",
|
||||
"Do_not_emit_outputs_6010": "Non crea output.",
|
||||
@@ -681,6 +682,7 @@
|
||||
"Enable_experimental_support_for_legacy_experimental_decorators_6630": "Abilitare il supporto sperimentale per gli elementi Decorator sperimentali legacy.",
|
||||
"Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264": "Abilitare l'importazione di file con qualsiasi estensione, purché sia presente un file di dichiarazione.",
|
||||
"Enable_importing_json_files_6689": "Abilita l'importazione di file .json.",
|
||||
"Enable_lib_replacement_6808": "Abilita sostituzione librerie.",
|
||||
"Enable_project_compilation_6302": "Abilitare la compilazione dei progetti",
|
||||
"Enable_strict_bind_call_and_apply_methods_on_functions_6214": "Abilitare i metodi strict 'bind', 'call' e 'apply' nelle funzioni.",
|
||||
"Enable_strict_checking_of_function_types_6186": "Abilita il controllo tassativo dei tipi funzione.",
|
||||
@@ -890,6 +892,7 @@
|
||||
"Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836": "Le asserzioni di importazione non sono consentite nelle istruzioni che compilano nelle chiamate 'require' di CommonJS.",
|
||||
"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2821": "Le asserzioni di importazione sono supportate solo quando l'opzione '--module' è impostata su 'esnext', 'node18', 'nodenext' o 'preserve'.",
|
||||
"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822": "Non è possibile usare asserzioni di importazione con importazioni o esportazioni di solo tipo.",
|
||||
"Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880": "Le asserzioni di importazione sono state sostituite dagli attributi di importazione. Usare 'with' invece di 'assert'.",
|
||||
"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "Non è possibile usare l'assegnazione di importazione se destinata a moduli ECMAScript. Provare a usare 'import * as ns from \"mod\"', 'import {a} from \"mod\"', 'import d from \"mod\"' o un altro formato di modulo.",
|
||||
"Import_attribute_values_must_be_string_literal_expressions_2858": "I valori degli attributi di importazione devono essere espressioni letterali delle stringhe.",
|
||||
"Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856": "Gli attributi di importazione non sono consentiti nelle istruzioni che compilano nelle chiamate 'require' di CommonJS.",
|
||||
@@ -1685,6 +1688,7 @@
|
||||
"This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1501": "Questo flag di espressione regolare è disponibile solo quando la destinazione è '{0}' o versioni successive.",
|
||||
"This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolv_2876": "Questo percorso di importazione relativo non è sicuro da riscrivere perché sembra un nome di file, ma in realtà si risolve in \"{0}\".",
|
||||
"This_spread_always_overwrites_this_property_2785": "Questo spread sovrascrive sempre questa proprietà.",
|
||||
"This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294": "Questa sintassi non è consentita quando 'erasableSyntaxOnly' è abilitato.",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060": "Questa sintassi è riservata ai file con estensione MTS o CTS. Aggiungere una virgola finale o un vincolo esplicito.",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059": "Questa sintassi è riservata ai file con estensione mts o cts. Utilizzare un'espressione 'as'.",
|
||||
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "Con questa sintassi è richiesto un helper importato, ma il modulo '{0}' non è stato trovato.",
|
||||
|
||||
@@ -618,6 +618,7 @@
|
||||
"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672": "'import'、'require'、'<reference>' を使用して TypeScript がプロジェクトに追加するファイルの数を増やすことを無効にします。",
|
||||
"Disallow_inconsistently_cased_references_to_the_same_file_6078": "同じファイルへの大文字小文字の異なる参照を許可しない。",
|
||||
"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159": "トリプルスラッシュの参照やインポートしたモジュールをコンパイルされたファイルのリストに追加しないでください。",
|
||||
"Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721": "ECMAScript の一部ではないランタイム コンストラクトを許可しません。",
|
||||
"Do_not_emit_comments_to_output_6009": "コメントを出力しないでください。",
|
||||
"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056": "'@internal' の注釈を含むコードの宣言を生成しないでください。",
|
||||
"Do_not_emit_outputs_6010": "出力しないでください。",
|
||||
@@ -681,6 +682,7 @@
|
||||
"Enable_experimental_support_for_legacy_experimental_decorators_6630": "従来の実験的なデコレーターの実験的なサポートを有効にしてください。",
|
||||
"Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264": "宣言ファイルが存在する場合、拡張子を持つファイルのインポートを有効にしてください。",
|
||||
"Enable_importing_json_files_6689": ".json ファイルのインポートを有効にします。",
|
||||
"Enable_lib_replacement_6808": "lib 置換を有効にします。",
|
||||
"Enable_project_compilation_6302": "プロジェクトのコンパイルを有効にします",
|
||||
"Enable_strict_bind_call_and_apply_methods_on_functions_6214": "厳格な 'bind'、'call'、'apply' メソッドを関数で有効にします。",
|
||||
"Enable_strict_checking_of_function_types_6186": "関数の型の厳密なチェックを有効にします。",
|
||||
@@ -890,6 +892,7 @@
|
||||
"Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836": "インポート アサーションは、commonjs 'require' 呼び出しにコンパイルするステートメントでは許可されません。",
|
||||
"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2821": "インポート アサーションは、'--module' オプションが 'esnext'、'node18'、'nodenext' または 'preserve' に設定されている場合にのみサポートされます。",
|
||||
"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822": "インポート アサーションは、型のみのインポートまたはエクスポートでは使用できません。",
|
||||
"Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880": "インポート アサーションはインポート属性に置き換えられました。'assert' ではなく 'with' を使用してください。",
|
||||
"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "ECMAScript モジュールを対象にする場合は、インポート代入を使用できません。代わりに 'import * as ns from \"mod\"'、'import {a} from \"mod\"'、'import d from \"mod\"' などのモジュール書式の使用をご検討ください。",
|
||||
"Import_attribute_values_must_be_string_literal_expressions_2858": "インポート 属性の値は、文字列リテラル式である必要があります。",
|
||||
"Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856": "インポート属性は、commonjs 'require' 呼び出しにコンパイルするステートメントでは許可されません。",
|
||||
@@ -1685,6 +1688,7 @@
|
||||
"This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1501": "この正規表現フラグは、'{0}' 以降をターゲットにする場合にのみ使用できます。",
|
||||
"This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolv_2876": "この相対インポート パスは、ファイル名のようですが、実際には \"{0}\" に解決されるため、書き換えは安全ではありません。",
|
||||
"This_spread_always_overwrites_this_property_2785": "このスプレッドは、常にこのプロパティを上書きします。",
|
||||
"This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294": "'erasableSyntaxOnly' が有効な場合、この構文は使用できません。",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060": "この構文は、拡張子が .mts または .cts のファイルで予約されています。末尾のコンマまたは明示的な制約を追加します。",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059": "この構文は、拡張子が .mts または .cts のファイルで予約されています。代わりに `as` 式を使用してください。",
|
||||
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "この構文にはインポートされたヘルパーが必要ですが、モジュール '{0}' が見つかりません。",
|
||||
|
||||
@@ -618,6 +618,7 @@
|
||||
"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672": "TypeScript가 프로젝트에 추가해야 하는 파일 수를 확장하는 '가져오기', '요구' 또는 '<reference>'를 허용하지 않습니다.",
|
||||
"Disallow_inconsistently_cased_references_to_the_same_file_6078": "동일한 파일에 대해 대/소문자를 일관되지 않게 사용한 참조를 허용하지 않습니다.",
|
||||
"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159": "컴파일된 파일 목록에 삼중 슬래시 참조 또는 가져온 모듈을 추가하지 않습니다.",
|
||||
"Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721": "ECMAScript의 일부가 아닌 런타임 구문을 허용하지 않습니다.",
|
||||
"Do_not_emit_comments_to_output_6009": "주석을 출력에 내보내지 마세요.",
|
||||
"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056": "'@internal' 주석이 있는 코드에 대한 선언을 내보내지 마세요.",
|
||||
"Do_not_emit_outputs_6010": "출력을 내보내지 않습니다.",
|
||||
@@ -681,6 +682,7 @@
|
||||
"Enable_experimental_support_for_legacy_experimental_decorators_6630": "레거시 실험적 데코레이터에 대해 실험적 지원을 사용하도록 설정합니다.",
|
||||
"Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264": "선언 파일이 있는 경우 확장자가 있는 파일 가져오기를 사용하도록 설정합니다.",
|
||||
"Enable_importing_json_files_6689": ".json 파일 가져오기를 활성화합니다.",
|
||||
"Enable_lib_replacement_6808": "라이브러리 바꾸기를 사용하도록 설정합니다.",
|
||||
"Enable_project_compilation_6302": "프로젝트 컴파일을 사용하도록 설정",
|
||||
"Enable_strict_bind_call_and_apply_methods_on_functions_6214": "함수에서 strict 'bind', 'call' 및 'apply' 메서드를 사용하도록 설정합니다.",
|
||||
"Enable_strict_checking_of_function_types_6186": "함수 형식에 대한 엄격한 검사를 사용하도록 설정합니다.",
|
||||
@@ -890,6 +892,7 @@
|
||||
"Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836": "CommonJS 'require' 호출로 컴파일되는 문에서는 가져오기 어설션을 사용할 수 없습니다.",
|
||||
"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2821": "가져오기 어설션은 '--module' 옵션이 'esnext', 'node18', 'nodenext' 또는 'preserve'로 설정된 경우에만 지원됩니다.",
|
||||
"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822": "가져오기 어설션은 형식 전용 가져오기 또는 내보내기에서 사용할 수 없습니다.",
|
||||
"Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880": "가져오기 어설션이 가져오기 특성으로 바뀌었습니다. 'assert' 대신 'with'를 사용합니다.",
|
||||
"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "ECMAScript 모듈을 대상으로 하는 경우 할당 가져오기를 사용할 수 없습니다. 대신 'import * as ns from \"mod\"', 'import {a} from \"mod\"', 'import d from \"mod\"' 또는 다른 모듈 형식 사용을 고려하세요.",
|
||||
"Import_attribute_values_must_be_string_literal_expressions_2858": "가져오기 특성 값은 문자열 리터럴 식이어야 합니다.",
|
||||
"Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856": "CommonJS 'require' 호출로 컴파일되는 문에서는 가져오기 특성을 사용할 수 없습니다.",
|
||||
@@ -1685,6 +1688,7 @@
|
||||
"This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1501": "이 정규식 플래그는 '{0}' 이상을 대상으로 하는 경우에만 사용할 수 있습니다.",
|
||||
"This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolv_2876": "이 상대 가져오기 경로는 파일 이름처럼 보이지만 실제로는 \"{0}\"(으)로 확인되므로 다시 작성하는 것이 안전하지 않습니다.",
|
||||
"This_spread_always_overwrites_this_property_2785": "이 스프레드는 항상 이 속성을 덮어씁니다.",
|
||||
"This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294": "'erasableSyntaxOnly'를 사용하도록 설정한 경우에는 이 구문을 사용할 수 없습니다.",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060": "이 구문은 확장자가 .mts 또는 .cts인 파일에 예약되어 있습니다. 후행 쉼표 또는 명시적 제약 조건을 추가합니다.",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059": "이 구문은 확장자가 .mts 또는 .cts인 파일에 예약되어 있습니다. 대신 'as' 식을 사용하세요.",
|
||||
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "이 구문에는 가져온 도우미가 필요하지만 '{0}' 모듈을 찾을 수 없습니다.",
|
||||
|
||||
Vendored
+51
-23
@@ -4872,11 +4872,23 @@ interface CSSStyleDeclaration {
|
||||
paddingTop: string;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/page) */
|
||||
page: string;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/page-break-after) */
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/page-break-after)
|
||||
*/
|
||||
pageBreakAfter: string;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/page-break-before) */
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/page-break-before)
|
||||
*/
|
||||
pageBreakBefore: string;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/page-break-inside) */
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/page-break-inside)
|
||||
*/
|
||||
pageBreakInside: string;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/paint-order) */
|
||||
paintOrder: string;
|
||||
@@ -5985,11 +5997,9 @@ interface CanvasRect {
|
||||
*
|
||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D)
|
||||
*/
|
||||
interface CanvasRenderingContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform, CanvasUserInterface {
|
||||
interface CanvasRenderingContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasSettings, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform, CanvasUserInterface {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/canvas) */
|
||||
readonly canvas: HTMLCanvasElement;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/getContextAttributes) */
|
||||
getContextAttributes(): CanvasRenderingContext2DSettings;
|
||||
}
|
||||
|
||||
declare var CanvasRenderingContext2D: {
|
||||
@@ -5997,6 +6007,11 @@ declare var CanvasRenderingContext2D: {
|
||||
new(): CanvasRenderingContext2D;
|
||||
};
|
||||
|
||||
interface CanvasSettings {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/getContextAttributes) */
|
||||
getContextAttributes(): CanvasRenderingContext2DSettings;
|
||||
}
|
||||
|
||||
interface CanvasShadowStyles {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/shadowBlur) */
|
||||
shadowBlur: number;
|
||||
@@ -6702,7 +6717,9 @@ interface DOMMatrixReadOnly {
|
||||
readonly e: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly#instance_properties) */
|
||||
readonly f: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/is2D) */
|
||||
readonly is2D: boolean;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/isIdentity) */
|
||||
readonly isIdentity: boolean;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly#instance_properties) */
|
||||
readonly m11: number;
|
||||
@@ -11457,7 +11474,7 @@ interface HTMLImageElement extends HTMLElement {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLImageElement/decoding) */
|
||||
decoding: "async" | "sync" | "auto";
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLImageElement/fetchPriority) */
|
||||
fetchPriority: string;
|
||||
fetchPriority: "high" | "low" | "auto";
|
||||
/**
|
||||
* Sets or retrieves the height of the object.
|
||||
*
|
||||
@@ -11976,7 +11993,7 @@ interface HTMLLinkElement extends HTMLElement, LinkStyle {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLLinkElement/disabled) */
|
||||
disabled: boolean;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLLinkElement/fetchPriority) */
|
||||
fetchPriority: string;
|
||||
fetchPriority: "high" | "low" | "auto";
|
||||
/**
|
||||
* Sets or retrieves a destination URL or an anchor point.
|
||||
*
|
||||
@@ -12448,7 +12465,11 @@ interface HTMLModElement extends HTMLElement {
|
||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLModElement/cite)
|
||||
*/
|
||||
cite: string;
|
||||
/** Sets or retrieves the date and time of a modification to the object. */
|
||||
/**
|
||||
* Sets or retrieves the date and time of a modification to the object.
|
||||
*
|
||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLModElement/dateTime)
|
||||
*/
|
||||
dateTime: string;
|
||||
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLModElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
||||
@@ -13022,7 +13043,7 @@ interface HTMLScriptElement extends HTMLElement {
|
||||
*/
|
||||
event: string;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLScriptElement/fetchPriority) */
|
||||
fetchPriority: string;
|
||||
fetchPriority: "high" | "low" | "auto";
|
||||
/**
|
||||
* Sets or retrieves the object that is bound to the event script.
|
||||
* @deprecated
|
||||
@@ -15133,7 +15154,7 @@ interface ImageDecoder {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageDecoder/complete) */
|
||||
readonly complete: boolean;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageDecoder/completed) */
|
||||
readonly completed: Promise<undefined>;
|
||||
readonly completed: Promise<void>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageDecoder/tracks) */
|
||||
readonly tracks: ImageTrackList;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageDecoder/type) */
|
||||
@@ -15175,7 +15196,7 @@ interface ImageTrackList {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageTrackList/length) */
|
||||
readonly length: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageTrackList/ready) */
|
||||
readonly ready: Promise<undefined>;
|
||||
readonly ready: Promise<void>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageTrackList/selectedIndex) */
|
||||
readonly selectedIndex: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageTrackList/selectedTrack) */
|
||||
@@ -16412,9 +16433,9 @@ interface MessageEventTarget<T> {
|
||||
onmessage: ((this: T, ev: MessageEvent) => any) | null;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/messageerror_event) */
|
||||
onmessageerror: ((this: T, ev: MessageEvent) => any) | null;
|
||||
addEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget<T>, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
||||
addEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: T, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
||||
removeEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget<T>, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
||||
removeEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: T, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
||||
}
|
||||
|
||||
@@ -19630,7 +19651,7 @@ declare var ReadableStreamDefaultReader: {
|
||||
|
||||
interface ReadableStreamGenericReader {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/closed) */
|
||||
readonly closed: Promise<undefined>;
|
||||
readonly closed: Promise<void>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/cancel) */
|
||||
cancel(reason?: any): Promise<void>;
|
||||
}
|
||||
@@ -20204,8 +20225,11 @@ interface SVGAnimationElement extends SVGElement, SVGTests {
|
||||
endElement(): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAnimationElement/endElementAt) */
|
||||
endElementAt(offset: number): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAnimationElement/getCurrentTime) */
|
||||
getCurrentTime(): number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAnimationElement/getSimpleDuration) */
|
||||
getSimpleDuration(): number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAnimationElement/getStartTime) */
|
||||
getStartTime(): number;
|
||||
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGAnimationElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
||||
@@ -20886,8 +20910,11 @@ declare var SVGFEOffsetElement: {
|
||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGFEPointLightElement)
|
||||
*/
|
||||
interface SVGFEPointLightElement extends SVGElement {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGFEPointLightElement/x) */
|
||||
readonly x: SVGAnimatedNumber;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGFEPointLightElement/y) */
|
||||
readonly y: SVGAnimatedNumber;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGFEPointLightElement/z) */
|
||||
readonly z: SVGAnimatedNumber;
|
||||
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEPointLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
||||
@@ -20938,8 +20965,11 @@ interface SVGFESpotLightElement extends SVGElement {
|
||||
readonly pointsAtY: SVGAnimatedNumber;
|
||||
readonly pointsAtZ: SVGAnimatedNumber;
|
||||
readonly specularExponent: SVGAnimatedNumber;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGFESpotLightElement/x) */
|
||||
readonly x: SVGAnimatedNumber;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGFESpotLightElement/y) */
|
||||
readonly y: SVGAnimatedNumber;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGFESpotLightElement/z) */
|
||||
readonly z: SVGAnimatedNumber;
|
||||
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFESpotLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
||||
@@ -24167,12 +24197,12 @@ declare var VideoPlaybackQuality: {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ViewTransition) */
|
||||
interface ViewTransition {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ViewTransition/finished) */
|
||||
readonly finished: Promise<undefined>;
|
||||
readonly finished: Promise<void>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ViewTransition/ready) */
|
||||
readonly ready: Promise<undefined>;
|
||||
readonly ready: Promise<void>;
|
||||
types: ViewTransitionTypeSet;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ViewTransition/updateCallbackDone) */
|
||||
readonly updateCallbackDone: Promise<undefined>;
|
||||
readonly updateCallbackDone: Promise<void>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ViewTransition/skipTransition) */
|
||||
skipTransition(): void;
|
||||
}
|
||||
@@ -26763,7 +26793,7 @@ interface WebTransport {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/incomingUnidirectionalStreams) */
|
||||
readonly incomingUnidirectionalStreams: ReadableStream;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/ready) */
|
||||
readonly ready: Promise<undefined>;
|
||||
readonly ready: Promise<void>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/close) */
|
||||
close(closeInfo?: WebTransportCloseInfo): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/createBidirectionalStream) */
|
||||
@@ -27277,8 +27307,6 @@ interface WindowSessionStorage {
|
||||
}
|
||||
|
||||
interface WorkerEventMap extends AbstractWorkerEventMap, MessageEventTargetEventMap {
|
||||
"message": MessageEvent;
|
||||
"messageerror": MessageEvent;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -27379,11 +27407,11 @@ declare var WritableStreamDefaultController: {
|
||||
*/
|
||||
interface WritableStreamDefaultWriter<W = any> {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
|
||||
readonly closed: Promise<undefined>;
|
||||
readonly closed: Promise<void>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
|
||||
readonly desiredSize: number | null;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
|
||||
readonly ready: Promise<undefined>;
|
||||
readonly ready: Promise<void>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
|
||||
abort(reason?: any): Promise<void>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
|
||||
|
||||
Vendored
+12
-12
@@ -292,7 +292,7 @@ interface ExtendableMessageEventInit extends ExtendableEventInit {
|
||||
|
||||
interface FetchEventInit extends ExtendableEventInit {
|
||||
clientId?: string;
|
||||
handled?: Promise<undefined>;
|
||||
handled?: Promise<void>;
|
||||
preloadResponse?: Promise<any>;
|
||||
replacesClientId?: string;
|
||||
request: Request;
|
||||
@@ -2276,7 +2276,9 @@ interface DOMMatrixReadOnly {
|
||||
readonly e: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly#instance_properties) */
|
||||
readonly f: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/is2D) */
|
||||
readonly is2D: boolean;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/isIdentity) */
|
||||
readonly isIdentity: boolean;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly#instance_properties) */
|
||||
readonly m11: number;
|
||||
@@ -2973,7 +2975,7 @@ interface FetchEvent extends ExtendableEvent {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/clientId) */
|
||||
readonly clientId: string;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/handled) */
|
||||
readonly handled: Promise<undefined>;
|
||||
readonly handled: Promise<void>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/preloadResponse) */
|
||||
readonly preloadResponse: Promise<any>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */
|
||||
@@ -4143,7 +4145,7 @@ interface ImageDecoder {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageDecoder/complete) */
|
||||
readonly complete: boolean;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageDecoder/completed) */
|
||||
readonly completed: Promise<undefined>;
|
||||
readonly completed: Promise<void>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageDecoder/tracks) */
|
||||
readonly tracks: ImageTrackList;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageDecoder/type) */
|
||||
@@ -4185,7 +4187,7 @@ interface ImageTrackList {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageTrackList/length) */
|
||||
readonly length: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageTrackList/ready) */
|
||||
readonly ready: Promise<undefined>;
|
||||
readonly ready: Promise<void>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageTrackList/selectedIndex) */
|
||||
readonly selectedIndex: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ImageTrackList/selectedTrack) */
|
||||
@@ -4356,9 +4358,9 @@ interface MessageEventTarget<T> {
|
||||
onmessage: ((this: T, ev: MessageEvent) => any) | null;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/messageerror_event) */
|
||||
onmessageerror: ((this: T, ev: MessageEvent) => any) | null;
|
||||
addEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget<T>, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
||||
addEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: T, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
||||
removeEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget<T>, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
||||
removeEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: T, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
||||
}
|
||||
|
||||
@@ -5369,7 +5371,7 @@ declare var ReadableStreamDefaultReader: {
|
||||
|
||||
interface ReadableStreamGenericReader {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/closed) */
|
||||
readonly closed: Promise<undefined>;
|
||||
readonly closed: Promise<void>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/cancel) */
|
||||
cancel(reason?: any): Promise<void>;
|
||||
}
|
||||
@@ -8797,7 +8799,7 @@ interface WebTransport {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/incomingUnidirectionalStreams) */
|
||||
readonly incomingUnidirectionalStreams: ReadableStream;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/ready) */
|
||||
readonly ready: Promise<undefined>;
|
||||
readonly ready: Promise<void>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/close) */
|
||||
close(closeInfo?: WebTransportCloseInfo): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/createBidirectionalStream) */
|
||||
@@ -8938,8 +8940,6 @@ interface WindowOrWorkerGlobalScope {
|
||||
}
|
||||
|
||||
interface WorkerEventMap extends AbstractWorkerEventMap, MessageEventTargetEventMap {
|
||||
"message": MessageEvent;
|
||||
"messageerror": MessageEvent;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -9134,11 +9134,11 @@ declare var WritableStreamDefaultController: {
|
||||
*/
|
||||
interface WritableStreamDefaultWriter<W = any> {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
|
||||
readonly closed: Promise<undefined>;
|
||||
readonly closed: Promise<void>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
|
||||
readonly desiredSize: number | null;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
|
||||
readonly ready: Promise<undefined>;
|
||||
readonly ready: Promise<void>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
|
||||
abort(reason?: any): Promise<void>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
|
||||
|
||||
@@ -618,6 +618,7 @@
|
||||
"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672": "Nie zezwalaj elementom „import”, „require” i „<reference>” na zwiększanie liczby plików, które powinny zostać dodane do projektu przez język TypeScript.",
|
||||
"Disallow_inconsistently_cased_references_to_the_same_file_6078": "Nie zezwalaj na przywoływanie tego samego pliku za pomocą nazw różniących się wielkością liter.",
|
||||
"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159": "Nie dodawaj odwołań z trzema ukośnikami ani zaimportowanych modułów do listy skompilowanych plików.",
|
||||
"Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721": "Nie zezwalaj na konstrukcje środowiska uruchomieniowego, które nie są częścią języka ECMAScript.",
|
||||
"Do_not_emit_comments_to_output_6009": "Nie emituj komentarzy do danych wyjściowych.",
|
||||
"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056": "Nie emituj deklaracji dla kodu z adnotacją „@internal”.",
|
||||
"Do_not_emit_outputs_6010": "Nie emituj danych wyjściowych.",
|
||||
@@ -681,6 +682,7 @@
|
||||
"Enable_experimental_support_for_legacy_experimental_decorators_6630": "Włącz eksperymentalną obsługę starszych dekoratorów eksperymentalnych.",
|
||||
"Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264": "Włącz importowanie plików z dowolnym rozszerzeniem, pod warunkiem, że istnieje plik deklaracji.",
|
||||
"Enable_importing_json_files_6689": "Włącz importowanie plików json.",
|
||||
"Enable_lib_replacement_6808": "Włącz zastępowanie biblioteki.",
|
||||
"Enable_project_compilation_6302": "Włącz kompilację projektu",
|
||||
"Enable_strict_bind_call_and_apply_methods_on_functions_6214": "Włącz ścisłe metody „bind”, „call” i „apply” dla funkcji.",
|
||||
"Enable_strict_checking_of_function_types_6186": "Włącz dokładne sprawdzanie typów funkcji.",
|
||||
@@ -890,6 +892,7 @@
|
||||
"Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836": "Asercje importu są niedozwolone w instrukcjach, które kompilują do wywołań „require” CommonJS.",
|
||||
"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2821": "Asercje importu są obsługiwane tylko wtedy, gdy opcja „--module” jest ustawiona na „esnext”, „node18” „nodenext” lub „preserve”.",
|
||||
"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822": "Asercji importu nie można używać z importami ani eksportami ograniczonymi do tylko danego typu.",
|
||||
"Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880": "Asercje importu zostały zastąpione atrybutami importu. Użyj instrukcji \"with\" zamiast \"assert\".",
|
||||
"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "Nie można użyć przypisania importu, gdy są używane moduły języka ECMAScript. Zamiast tego rozważ użycie elementu „import * as ns from \"mod\"”, „import {a} from \"mod\"” lub „import d from \"mod\"” albo innego formatu modułu.",
|
||||
"Import_attribute_values_must_be_string_literal_expressions_2858": "Wartości atrybutów importu muszą być wyrażeniami literału ciągu.",
|
||||
"Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856": "Atrybuty importu są niedozwolone w instrukcjach kompilowanych do wywołań „require” CommonJS.",
|
||||
@@ -1685,6 +1688,7 @@
|
||||
"This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1501": "Ta flaga wyrażenia regularnego jest dostępna tylko w przypadku określania wartości docelowej „{0}” lub nowszej.",
|
||||
"This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolv_2876": "Ta względna ścieżka importu jest niebezpieczna do ponownego zapisania, ponieważ wygląda jak nazwa pliku, ale w rzeczywistości jest rozpoznawana jako „{0}”.",
|
||||
"This_spread_always_overwrites_this_property_2785": "To rozmieszczenie zawsze powoduje zastąpienie tej właściwości.",
|
||||
"This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294": "Ta składnia jest niedozwolona, gdy jest włączona opcja \"erasableSyntaxOnly\".",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060": "Ta składnia jest zarezerwowana w plikach z rozszerzeniem .MTS lub CTS. Dodaj końcowy przecinek lub jawne ograniczenie.",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059": "Ta składnia jest zarezerwowana w plikach z rozszerzeniem. MTS lub. CTS. Użyj zamiast tego wyrażenia „as”.",
|
||||
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "Ta składnia wymaga zaimportowanego pomocnika, ale nie można znaleźć modułu „{0}”.",
|
||||
|
||||
@@ -618,6 +618,7 @@
|
||||
"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672": "Não permitir 'importar', 'necessário ou' <reference> de expandir o número de arquivos que TypeScript deve adicionar a um projeto.",
|
||||
"Disallow_inconsistently_cased_references_to_the_same_file_6078": "Não permitir referências com maiúsculas de minúsculas inconsistentes no mesmo arquivo.",
|
||||
"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159": "Não adicionar as referências de barra tripla nem os módulos importados à lista de arquivos compilados.",
|
||||
"Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721": "Não permitir construções de tempo de execução que não fazem parte de ECMAScript.",
|
||||
"Do_not_emit_comments_to_output_6009": "Não emita comentários para a saída.",
|
||||
"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056": "Não emita declarações de código que contenham uma anotação '@internal'.",
|
||||
"Do_not_emit_outputs_6010": "Não emita saídas.",
|
||||
@@ -681,6 +682,7 @@
|
||||
"Enable_experimental_support_for_legacy_experimental_decorators_6630": "Habilite o suporte experimental para decoradores experimentais herdados.",
|
||||
"Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264": "Permite a importação de arquivos com qualquer extensão, desde que um arquivo de declaração esteja presente.",
|
||||
"Enable_importing_json_files_6689": "Habilitar importação de arquivos .json.",
|
||||
"Enable_lib_replacement_6808": "Habilitar substituição de biblioteca.",
|
||||
"Enable_project_compilation_6302": "Habilitar a compilação do projeto",
|
||||
"Enable_strict_bind_call_and_apply_methods_on_functions_6214": "Habilite os métodos estritos 'bind', 'call' e 'apply' em funções.",
|
||||
"Enable_strict_checking_of_function_types_6186": "Habilitar verificação estrita de tipos de função.",
|
||||
@@ -890,6 +892,7 @@
|
||||
"Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836": "As declarações de importação não são permitidas em declarações que compilam para chamadas 'require' do commonjs.",
|
||||
"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2821": "As declarações de importação são suportadas apenas quando a opção '--module' estiver definida como 'esnext', 'node18', 'nodenext' ou 'preserve'.",
|
||||
"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822": "As afirmações de importação não podem ser usadas com importações ou exportações somente de tipo.",
|
||||
"Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880": "As asserções de importação foram substituídas por atributos de importação. Use 'with' em vez de 'assert'.",
|
||||
"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "Não é possível usar a atribuição de importação durante o direcionamento para módulos de ECMAScript. Use 'importar * como ns de \"mod\"', 'importar {a} de \"mod\"', 'importar d de \"mod\"' ou outro formato de módulo em vez disso.",
|
||||
"Import_attribute_values_must_be_string_literal_expressions_2858": "Os valores do atributo de importação devem ser expressões literais de cadeias de caracteres.",
|
||||
"Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856": "Atributos de importação não são permitidos em instruções que são compiladas para chamadas 'require' do CommonJS.",
|
||||
@@ -1685,6 +1688,7 @@
|
||||
"This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1501": "Esse sinalizador de expressão regular só está disponível ao direcionar para '{0}' ou posterior.",
|
||||
"This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolv_2876": "Não é seguro reescrever esse caminho de importação relativo porque ele se parece com um nome de arquivo, mas, na verdade, é resolvido como \"{0}\".",
|
||||
"This_spread_always_overwrites_this_property_2785": "Essa difusão sempre substitui essa propriedade.",
|
||||
"This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294": "Esta sintaxe não é permitida quando 'erasableSyntaxOnly' está habilitado.",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060": "Essa sintaxe é reservada em arquivos com extensão .mts ou .cts. Adicione uma vírgula final ou restrição explícita.",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059": "Essa sintaxe é reservada em arquivos com extensão .mts ou .cts. Em vez disso, use uma expressão `as`.",
|
||||
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "Essa sintaxe requer um auxiliar importado, mas o módulo '{0}' não pode ser encontrado.",
|
||||
|
||||
@@ -618,6 +618,7 @@
|
||||
"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672": "Запретите \"import\", \"require\" или \"<reference>\" увеличивать количество файлов, которые TypeScript должен добавить в проект.",
|
||||
"Disallow_inconsistently_cased_references_to_the_same_file_6078": "Запретить ссылки с разным регистром, указывающие на один файл.",
|
||||
"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159": "Не добавлять ссылки с тройной косой чертой или импортированные модули в список скомпилированных файлов.",
|
||||
"Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721": "Не разрешать конструкции среды выполнения, которые не являются частью ECMAScript.",
|
||||
"Do_not_emit_comments_to_output_6009": "Не создавать комментарии в выходных данных.",
|
||||
"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056": "Не создавать объявления для кода, имеющего аннотацию \"@internal\".",
|
||||
"Do_not_emit_outputs_6010": "Не создавать выходные данные.",
|
||||
@@ -681,6 +682,7 @@
|
||||
"Enable_experimental_support_for_legacy_experimental_decorators_6630": "Включите экспериментальную поддержку устаревших экспериментальных декораторов.",
|
||||
"Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264": "Разрешить импорт файлов с любым расширением при наличии файла декларации.",
|
||||
"Enable_importing_json_files_6689": "Включите импорт файлов JSON.",
|
||||
"Enable_lib_replacement_6808": "Включить замену библиотеки.",
|
||||
"Enable_project_compilation_6302": "Включить компиляцию проекта",
|
||||
"Enable_strict_bind_call_and_apply_methods_on_functions_6214": "Включите строгие методы \"bind\", \"call\" и \"apply\" для функций.",
|
||||
"Enable_strict_checking_of_function_types_6186": "Включение строгой проверки типов функций.",
|
||||
@@ -890,6 +892,7 @@
|
||||
"Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836": "Утверждения импорта не допускаются для операторов, которые компилируются в вызовы \"require\" CommonJS.",
|
||||
"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2821": "Утверждения импорта поддерживаются только в том случае, если параметр \"--module\" имеет значение \"esnext\", \"node18\", \"nodenext\" или \"preserve\".",
|
||||
"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822": "Утверждения импорта не могут использоваться с импортом или экспортом, затрагивающими только тип.",
|
||||
"Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880": "Утверждения импорта заменены атрибутами импорта. Используйте \"with\" вместо \"assert\".",
|
||||
"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "Назначение импорта невозможно использовать при разработке для модулей ECMAScript. Попробуйте использовать \"import * as ns from \"mod\", \"import {a} from \"mod\", \"import d from \"mod\" или другой формат модуля.",
|
||||
"Import_attribute_values_must_be_string_literal_expressions_2858": "Значения атрибутов импорта должны быть строковыми литеральными выражениями.",
|
||||
"Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856": "Атрибуты импорта не разрешены в операторах, которые компилируются в вызовы \"require\" CommonJS.",
|
||||
@@ -1685,6 +1688,7 @@
|
||||
"This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1501": "Этот флаг регулярного выражения доступен только при таргетинге \" {0} \" или более поздней версии.",
|
||||
"This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolv_2876": "Этот относительный путь импорта небезопасен для перезаписи, потому что он выглядит как имя файла, но на самом деле разрешается как \"{0}\".",
|
||||
"This_spread_always_overwrites_this_property_2785": "Это распространение всегда перезаписывает данное свойство.",
|
||||
"This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294": "Этот синтаксис недопустим, если включен параметр \"erasableSyntaxOnly\".",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060": "Этот синтаксис зарезервирован в файлах с расширениями MTS или CTS. Добавьте конечную запятую или явное ограничение.",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059": "Этот синтаксис зарезервирован в файлах с расширениями MTS или CTS. Вместо этого используйте выражение \"AS\".",
|
||||
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "Для этого синтаксиса требуется импортированный вспомогательный объект, но найти модуль \"{0}\" не удается.",
|
||||
|
||||
@@ -618,6 +618,7 @@
|
||||
"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672": "'import', 'require' veya '<reference>' ifadelerinin TypeScript'in projeye eklemesi gereken dosya sayısını artırmasına izin verme.",
|
||||
"Disallow_inconsistently_cased_references_to_the_same_file_6078": "Aynı dosyaya yönelik tutarsız büyük/küçük harflere sahip başvurulara izin verme.",
|
||||
"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159": "Derlenen dosya listesine üç eğik çizgi başvuruları veya içeri aktarılan modüller eklemeyin.",
|
||||
"Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721": "ECMAScript'in parçası olmayan çalışma zamanı yapılarına izin verme.",
|
||||
"Do_not_emit_comments_to_output_6009": "Çıktıya ait açıklamaları gösterme.",
|
||||
"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056": "'@internal' ek açıklamasına sahip kod için bildirimleri gösterme.",
|
||||
"Do_not_emit_outputs_6010": "Çıktıları gösterme.",
|
||||
@@ -681,6 +682,7 @@
|
||||
"Enable_experimental_support_for_legacy_experimental_decorators_6630": "Eski deneysel dekoratörler için deneysel desteği etkinleştirin.",
|
||||
"Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264": "Bir bildirim dosyasının mevcut olması koşuluyla, herhangi bir uzantıya sahip dosyaların içe aktarılmasını etkinleştirin.",
|
||||
"Enable_importing_json_files_6689": ".json dosyalarını içeri aktarmayı etkinleştirin.",
|
||||
"Enable_lib_replacement_6808": "Kitaplık değişimini etkinleştir.",
|
||||
"Enable_project_compilation_6302": "Proje derlemeyi etkinleştir",
|
||||
"Enable_strict_bind_call_and_apply_methods_on_functions_6214": "İşlevlerde katı 'bind', 'call' ve 'apply' metotlarını etkinleştirin.",
|
||||
"Enable_strict_checking_of_function_types_6186": "İşlev türleri üzerinde katı denetimi etkinleştirin.",
|
||||
@@ -890,6 +892,7 @@
|
||||
"Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836": "CommonJS 'require' çağrılarına derlenen deyimler için içeri aktarma onaylamalarına izin verilmiyor.",
|
||||
"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2821": "İçeri aktarma onayları, yalnızca '--module' seçeneği 'esnext', 'node18', 'nodenext' veya 'preserve' olarak ayarlandığında desteklenir.",
|
||||
"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822": "İçeri aktarma onayları, yalnızca tür içeri aktarmaları veya dışarı aktarmaları ile kullanılamaz.",
|
||||
"Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880": "İçeri aktarma onaylamaları içeri aktarma öznitelikleriyle değiştirildi. 'assert' yerine 'with' kullanın.",
|
||||
"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "ECMAScript modülleri hedeflenirken içeri aktarma ataması kullanılamaz. Bunun yerine 'import * as ns from \"mod\"', 'import {a} from \"mod\"', 'import d from \"mod\"' veya başka bir modül biçimi kullanmayı deneyin.",
|
||||
"Import_attribute_values_must_be_string_literal_expressions_2858": "İçeri aktarma öznitelik değerleri, sabit değerli dize ifadeleri olmalıdır.",
|
||||
"Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856": "CommonJS 'require' çağrılarına derlenen deyimler üzerinde içeri aktarma özniteliklerine izin verilmiyor.",
|
||||
@@ -1685,6 +1688,7 @@
|
||||
"This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1501": "Bu normal ifade bayrağı, yalnızca '{0}' veya üzeri hedeflenirken kullanılabilir.",
|
||||
"This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolv_2876": "Bu göreli içeri aktarma yolu bir dosya adı gibi görünse de aslında \"{0}\" olarak çözümlendiğinden yolun yeniden yazılması güvenli değildir.",
|
||||
"This_spread_always_overwrites_this_property_2785": "Bu yayılma her zaman bu özelliğin üzerine yazar.",
|
||||
"This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294": "'erasableSyntaxOnly' etkinleştirildiğinde bu söz dizimi kullanılamaz.",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060": "Bu söz dizimi, .mts veya .cts uzantısı içeren dosyalarda ayrılmıştır. Sonuna virgül veya açık kısıtlama ekleyin.",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059": "Bu söz dizimi, .mts veya .cts uzantısı içeren dosyalarda ayrılmıştır. Bunun yerine `as` ifadesi kullanın.",
|
||||
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "Bu söz dizimi, içeri aktarılan bir yardımcı gerektiriyor ancak '{0}' modülü bulunamıyor.",
|
||||
|
||||
Vendored
-9
@@ -1486,10 +1486,6 @@ declare namespace ts {
|
||||
command: CommandTypes.Quickinfo;
|
||||
arguments: FileLocationRequestArgs;
|
||||
}
|
||||
export interface QuickInfoRequestArgs extends FileLocationRequestArgs {
|
||||
/** TODO */
|
||||
verbosityLevel?: number;
|
||||
}
|
||||
/**
|
||||
* Body of QuickInfoResponse.
|
||||
*/
|
||||
@@ -1523,10 +1519,6 @@ declare namespace ts {
|
||||
* JSDoc tags associated with symbol.
|
||||
*/
|
||||
tags: JSDocTagInfo[];
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
canIncreaseVerbosityLevel?: boolean;
|
||||
}
|
||||
/**
|
||||
* Quickinfo response message.
|
||||
@@ -10765,7 +10757,6 @@ declare namespace ts {
|
||||
displayParts?: SymbolDisplayPart[];
|
||||
documentation?: SymbolDisplayPart[];
|
||||
tags?: JSDocTagInfo[];
|
||||
canIncreaseVerbosityLevel?: boolean;
|
||||
}
|
||||
type RenameInfo = RenameInfoSuccess | RenameInfoFailure;
|
||||
interface RenameInfoSuccess {
|
||||
|
||||
+78
-544
@@ -6538,7 +6538,6 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
||||
ObjectFlags3[ObjectFlags3["IsGenericObjectType"] = 4194304] = "IsGenericObjectType";
|
||||
ObjectFlags3[ObjectFlags3["IsGenericIndexType"] = 8388608] = "IsGenericIndexType";
|
||||
ObjectFlags3[ObjectFlags3["IsGenericType"] = 12582912] = "IsGenericType";
|
||||
ObjectFlags3[ObjectFlags3["IsNarrowingType"] = 16777216] = "IsNarrowingType";
|
||||
ObjectFlags3[ObjectFlags3["ContainsIntersections"] = 16777216] = "ContainsIntersections";
|
||||
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnionComputed"] = 33554432] = "IsUnknownLikeUnionComputed";
|
||||
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnion"] = 67108864] = "IsUnknownLikeUnion";
|
||||
@@ -10211,7 +10210,7 @@ var Diagnostics = {
|
||||
This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_during_emit_because_it_is_not_a_relative_path: diag(2877, 1 /* Error */, "This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_duri_2877", "This import uses a '{0}' extension to resolve to an input TypeScript file, but will not be rewritten during emit because it is not a relative path."),
|
||||
This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files: diag(2878, 1 /* Error */, "This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_b_2878", "This import path is unsafe to rewrite because it resolves to another project, and the relative path between the projects' output files is not the same as the relative path between its input files."),
|
||||
Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found: diag(2879, 1 /* Error */, "Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found_2879", "Using JSX fragments requires fragment factory '{0}' to be in scope, but it could not be found."),
|
||||
Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_asserts: diag(2880, 1 /* Error */, "Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_asserts_2880", "Import assertions have been replaced by import attributes. Use 'with' instead of 'asserts'."),
|
||||
Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert: diag(2880, 1 /* Error */, "Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880", "Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'."),
|
||||
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
||||
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
||||
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
||||
@@ -46162,7 +46161,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
||||
state2,
|
||||
packageInfo
|
||||
);
|
||||
if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) {
|
||||
if (!pathAndExtension && !rest && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) {
|
||||
pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2);
|
||||
}
|
||||
return withPackageId(packageInfo, pathAndExtension, state2);
|
||||
@@ -50987,8 +50986,8 @@ function createTypeChecker(host) {
|
||||
writeSignature: (signature, enclosingDeclaration, flags, kind, writer) => {
|
||||
return signatureToString(signature, getParseTreeNode(enclosingDeclaration), flags, kind, writer);
|
||||
},
|
||||
writeType: (type, enclosingDeclaration, flags, writer, verbosityLevel, out) => {
|
||||
return typeToString(type, getParseTreeNode(enclosingDeclaration), flags, writer, verbosityLevel, out);
|
||||
writeType: (type, enclosingDeclaration, flags, writer) => {
|
||||
return typeToString(type, getParseTreeNode(enclosingDeclaration), flags, writer);
|
||||
},
|
||||
writeSymbol: (symbol, enclosingDeclaration, meaning, flags, writer) => {
|
||||
return symbolToString(symbol, getParseTreeNode(enclosingDeclaration), meaning, flags, writer);
|
||||
@@ -51786,7 +51785,6 @@ function createTypeChecker(host) {
|
||||
[".jsx", ".jsx"],
|
||||
[".json", ".json"]
|
||||
];
|
||||
var narrowableReturnTypeCache = /* @__PURE__ */ new Map();
|
||||
initializeTypeChecker();
|
||||
return checker;
|
||||
function isDefinitelyReferenceToGlobalSymbolObject(node) {
|
||||
@@ -54922,18 +54920,14 @@ function createTypeChecker(host) {
|
||||
return writer2;
|
||||
}
|
||||
}
|
||||
function typeToString(type, enclosingDeclaration, flags = 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer = createTextWriter(""), verbosityLevel, out) {
|
||||
const noTruncation = compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */ || verbosityLevel !== void 0;
|
||||
function typeToString(type, enclosingDeclaration, flags = 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer = createTextWriter("")) {
|
||||
const noTruncation = compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */;
|
||||
const typeNode = nodeBuilder.typeToTypeNode(
|
||||
type,
|
||||
enclosingDeclaration,
|
||||
toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0),
|
||||
toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0 /* None */),
|
||||
/*internalFlags*/
|
||||
void 0,
|
||||
/*tracker*/
|
||||
void 0,
|
||||
verbosityLevel,
|
||||
out
|
||||
void 0
|
||||
);
|
||||
if (typeNode === void 0) return Debug.fail("should always get typenode");
|
||||
const printer = type !== unresolvedType ? createPrinterWithRemoveComments() : createPrinterWithDefaults();
|
||||
@@ -55160,127 +55154,31 @@ function createTypeChecker(host) {
|
||||
};
|
||||
return {
|
||||
syntacticBuilderResolver,
|
||||
typeToTypeNode: (type, enclosingDeclaration, flags, internalFlags, tracker, verbosityLevel, out) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, verbosityLevel, (context) => typeToTypeNodeHelper(type, context), out),
|
||||
typePredicateToTypePredicateNode: (typePredicate, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => typePredicateToTypePredicateNodeHelper(typePredicate, context)
|
||||
),
|
||||
serializeTypeForDeclaration: (declaration, symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => syntacticNodeBuilder.serializeTypeOfDeclaration(declaration, symbol, context)
|
||||
),
|
||||
serializeReturnTypeForSignature: (signature, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => syntacticNodeBuilder.serializeReturnTypeForSignature(signature, getSymbolOfDeclaration(signature), context)
|
||||
),
|
||||
serializeTypeForExpression: (expr, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => syntacticNodeBuilder.serializeTypeOfExpression(expr, context)
|
||||
),
|
||||
indexInfoToIndexSignatureDeclaration: (indexInfo, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => indexInfoToIndexSignatureDeclarationHelper(
|
||||
indexInfo,
|
||||
context,
|
||||
/*typeNode*/
|
||||
void 0
|
||||
)
|
||||
),
|
||||
signatureToSignatureDeclaration: (signature, kind, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => signatureToSignatureDeclarationHelper(signature, kind, context)
|
||||
),
|
||||
symbolToEntityName: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => symbolToName(
|
||||
symbol,
|
||||
context,
|
||||
meaning,
|
||||
/*expectsIdentifier*/
|
||||
false
|
||||
)
|
||||
),
|
||||
symbolToExpression: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => symbolToExpression(symbol, context, meaning)
|
||||
),
|
||||
symbolToTypeParameterDeclarations: (symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => typeParametersToTypeParameterDeclarations(symbol, context)
|
||||
),
|
||||
symbolToParameterDeclaration: (symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => symbolToParameterDeclaration(symbol, context)
|
||||
),
|
||||
typeParameterToDeclaration: (parameter, enclosingDeclaration, flags, internalFlags, tracker, verbosityLevel) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, verbosityLevel, (context) => typeParameterToDeclaration(parameter, context)),
|
||||
symbolTableToDeclarationStatements: (symbolTable, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => symbolTableToDeclarationStatements(symbolTable, context)
|
||||
),
|
||||
symbolToNode: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(
|
||||
enclosingDeclaration,
|
||||
flags,
|
||||
internalFlags,
|
||||
tracker,
|
||||
/*verbosityLevel*/
|
||||
void 0,
|
||||
(context) => symbolToNode(symbol, context, meaning)
|
||||
)
|
||||
typeToTypeNode: (type, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => typeToTypeNodeHelper(type, context)),
|
||||
typePredicateToTypePredicateNode: (typePredicate, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => typePredicateToTypePredicateNodeHelper(typePredicate, context)),
|
||||
serializeTypeForExpression: (expr, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => syntacticNodeBuilder.serializeTypeOfExpression(expr, context)),
|
||||
serializeTypeForDeclaration: (declaration, symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => syntacticNodeBuilder.serializeTypeOfDeclaration(declaration, symbol, context)),
|
||||
serializeReturnTypeForSignature: (signature, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => syntacticNodeBuilder.serializeReturnTypeForSignature(signature, getSymbolOfDeclaration(signature), context)),
|
||||
indexInfoToIndexSignatureDeclaration: (indexInfo, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => indexInfoToIndexSignatureDeclarationHelper(
|
||||
indexInfo,
|
||||
context,
|
||||
/*typeNode*/
|
||||
void 0
|
||||
)),
|
||||
signatureToSignatureDeclaration: (signature, kind, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => signatureToSignatureDeclarationHelper(signature, kind, context)),
|
||||
symbolToEntityName: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolToName(
|
||||
symbol,
|
||||
context,
|
||||
meaning,
|
||||
/*expectsIdentifier*/
|
||||
false
|
||||
)),
|
||||
symbolToExpression: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolToExpression(symbol, context, meaning)),
|
||||
symbolToTypeParameterDeclarations: (symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => typeParametersToTypeParameterDeclarations(symbol, context)),
|
||||
symbolToParameterDeclaration: (symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolToParameterDeclaration(symbol, context)),
|
||||
typeParameterToDeclaration: (parameter, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => typeParameterToDeclaration(parameter, context)),
|
||||
symbolTableToDeclarationStatements: (symbolTable, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolTableToDeclarationStatements(symbolTable, context)),
|
||||
symbolToNode: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolToNode(symbol, context, meaning))
|
||||
};
|
||||
function getTypeFromTypeNode2(context, node, noMappedTypes) {
|
||||
const type = getTypeFromTypeNodeWithoutContext(node);
|
||||
@@ -55322,7 +55220,7 @@ function createTypeChecker(host) {
|
||||
}
|
||||
return symbolToExpression(symbol, context, meaning);
|
||||
}
|
||||
function withContext2(enclosingDeclaration, flags, internalFlags, tracker, verbosityLevel, cb, out) {
|
||||
function withContext2(enclosingDeclaration, flags, internalFlags, tracker, cb) {
|
||||
const moduleResolverHost = (tracker == null ? void 0 : tracker.trackSymbol) ? tracker.moduleResolverHost : (internalFlags || 0 /* None */) & 4 /* DoNotIncludeSymbolChain */ ? createBasicNodeBuilderModuleSpecifierResolutionHost(host) : void 0;
|
||||
const context = {
|
||||
enclosingDeclaration,
|
||||
@@ -55330,7 +55228,6 @@ function createTypeChecker(host) {
|
||||
flags: flags || 0 /* None */,
|
||||
internalFlags: internalFlags || 0 /* None */,
|
||||
tracker: void 0,
|
||||
unfoldDepth: verbosityLevel ?? -1,
|
||||
encounteredError: false,
|
||||
suppressReportInferenceFallback: false,
|
||||
reportedDiagnostic: false,
|
||||
@@ -55352,18 +55249,13 @@ function createTypeChecker(host) {
|
||||
typeParameterNamesByText: void 0,
|
||||
typeParameterNamesByTextNextNameCount: void 0,
|
||||
enclosingSymbolTypes: /* @__PURE__ */ new Map(),
|
||||
mapper: void 0,
|
||||
depth: 0,
|
||||
couldUnfoldMore: false
|
||||
mapper: void 0
|
||||
};
|
||||
context.tracker = new SymbolTrackerImpl(context, tracker, moduleResolverHost);
|
||||
const resultingNode = cb(context);
|
||||
if (context.truncating && context.flags & 1 /* NoTruncation */) {
|
||||
context.tracker.reportTruncationError();
|
||||
}
|
||||
if (out) {
|
||||
out.couldUnfoldMore = context.couldUnfoldMore;
|
||||
}
|
||||
return context.encounteredError ? void 0 : resultingNode;
|
||||
}
|
||||
function addSymbolTypeToContext(context, symbol, type) {
|
||||
@@ -55382,36 +55274,16 @@ function createTypeChecker(host) {
|
||||
function saveRestoreFlags(context) {
|
||||
const flags = context.flags;
|
||||
const internalFlags = context.internalFlags;
|
||||
const depth = context.depth;
|
||||
return restore;
|
||||
function restore() {
|
||||
context.flags = flags;
|
||||
context.internalFlags = internalFlags;
|
||||
context.depth = depth;
|
||||
}
|
||||
}
|
||||
function checkTruncationLength(context) {
|
||||
if (context.truncating) return context.truncating;
|
||||
return context.truncating = context.approximateLength > (context.flags & 1 /* NoTruncation */ ? noTruncationMaximumTruncationLength : defaultMaximumTruncationLength);
|
||||
}
|
||||
function couldUnfoldType(type, context) {
|
||||
var _a;
|
||||
if ((_a = context.visitedTypes) == null ? void 0 : _a.has(type.id)) {
|
||||
return false;
|
||||
}
|
||||
return context.depth < context.unfoldDepth || context.depth === context.unfoldDepth && !context.couldUnfoldMore;
|
||||
}
|
||||
function canUnfoldType(type, context) {
|
||||
var _a;
|
||||
if ((_a = context.visitedTypes) == null ? void 0 : _a.has(type.id)) {
|
||||
return false;
|
||||
}
|
||||
const result = context.depth < context.unfoldDepth;
|
||||
if (!result) {
|
||||
context.couldUnfoldMore = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function typeToTypeNodeHelper(type, context) {
|
||||
const restoreFlags = saveRestoreFlags(context);
|
||||
const typeNode = typeToTypeNodeWorker(type, context);
|
||||
@@ -55559,27 +55431,16 @@ function createTypeChecker(host) {
|
||||
return factory.createThisTypeNode();
|
||||
}
|
||||
if (!inTypeAlias && type.aliasSymbol && (context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */ || isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration))) {
|
||||
if (!canUnfoldType(type, context)) {
|
||||
const typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context);
|
||||
if (isReservedMemberName(type.aliasSymbol.escapedName) && !(type.aliasSymbol.flags & 32 /* Class */)) return factory.createTypeReferenceNode(factory.createIdentifier(""), typeArgumentNodes);
|
||||
if (length(typeArgumentNodes) === 1 && type.aliasSymbol === globalArrayType.symbol) {
|
||||
return factory.createArrayTypeNode(typeArgumentNodes[0]);
|
||||
}
|
||||
return symbolToTypeNode(type.aliasSymbol, context, 788968 /* Type */, typeArgumentNodes);
|
||||
const typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context);
|
||||
if (isReservedMemberName(type.aliasSymbol.escapedName) && !(type.aliasSymbol.flags & 32 /* Class */)) return factory.createTypeReferenceNode(factory.createIdentifier(""), typeArgumentNodes);
|
||||
if (length(typeArgumentNodes) === 1 && type.aliasSymbol === globalArrayType.symbol) {
|
||||
return factory.createArrayTypeNode(typeArgumentNodes[0]);
|
||||
}
|
||||
context.depth += 1;
|
||||
return symbolToTypeNode(type.aliasSymbol, context, 788968 /* Type */, typeArgumentNodes);
|
||||
}
|
||||
const objectFlags = getObjectFlags(type);
|
||||
if (objectFlags & 4 /* Reference */) {
|
||||
Debug.assert(!!(type.flags & 524288 /* Object */));
|
||||
if (canUnfoldType(type, context)) {
|
||||
context.depth += 1;
|
||||
return createAnonymousTypeNode(
|
||||
type,
|
||||
/*forceClassExpansion*/
|
||||
true
|
||||
);
|
||||
}
|
||||
return type.node ? visitAndTransformType(type, typeReferenceToTypeNode) : typeReferenceToTypeNode(type);
|
||||
}
|
||||
if (type.flags & 262144 /* TypeParameter */ || objectFlags & 3 /* ClassOrInterface */) {
|
||||
@@ -55609,14 +55470,6 @@ function createTypeChecker(host) {
|
||||
void 0
|
||||
);
|
||||
}
|
||||
if (objectFlags & 3 /* ClassOrInterface */ && canUnfoldType(type, context)) {
|
||||
context.depth += 1;
|
||||
return createAnonymousTypeNode(
|
||||
type,
|
||||
/*forceClassExpansion*/
|
||||
true
|
||||
);
|
||||
}
|
||||
if (type.symbol) {
|
||||
return symbolToTypeNode(type.symbol, context, 788968 /* Type */);
|
||||
}
|
||||
@@ -55820,7 +55673,7 @@ function createTypeChecker(host) {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function createAnonymousTypeNode(type2, forceClassExpansion = false) {
|
||||
function createAnonymousTypeNode(type2) {
|
||||
var _a2, _b2;
|
||||
const typeId = type2.id;
|
||||
const symbol = type2.symbol;
|
||||
@@ -55843,7 +55696,7 @@ function createTypeChecker(host) {
|
||||
const isInstanceType = isClassInstanceSide(type2) ? 788968 /* Type */ : 111551 /* Value */;
|
||||
if (isJSConstructor(symbol.valueDeclaration)) {
|
||||
return symbolToTypeNode(symbol, context, isInstanceType);
|
||||
} else if (symbol.flags & 32 /* Class */ && !forceClassExpansion && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration && isClassLike(symbol.valueDeclaration) && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ && (!isClassDeclaration(symbol.valueDeclaration) || isSymbolAccessible(
|
||||
} else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration && isClassLike(symbol.valueDeclaration) && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ && (!isClassDeclaration(symbol.valueDeclaration) || isSymbolAccessible(
|
||||
symbol,
|
||||
context.enclosingDeclaration,
|
||||
isInstanceType,
|
||||
@@ -55887,7 +55740,7 @@ function createTypeChecker(host) {
|
||||
if (id && !context.symbolDepth) {
|
||||
context.symbolDepth = /* @__PURE__ */ new Map();
|
||||
}
|
||||
const links = context.unfoldDepth >= 0 ? void 0 : context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration);
|
||||
const links = context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration);
|
||||
const key = `${getTypeId(type2)}|${context.flags}|${context.internalFlags}`;
|
||||
if (links) {
|
||||
links.serializedTypes || (links.serializedTypes = /* @__PURE__ */ new Map());
|
||||
@@ -56834,7 +56687,7 @@ function createTypeChecker(host) {
|
||||
return factory.createTypeParameterDeclaration(modifiers, name, constraintNode, defaultParameterNode);
|
||||
}
|
||||
function typeToTypeNodeHelperWithPossibleReusableTypeNode(type, typeNode, context) {
|
||||
return !couldUnfoldType(type, context) && typeNode && getTypeFromTypeNode2(context, typeNode) === type && syntacticNodeBuilder.tryReuseExistingTypeNode(context, typeNode) || typeToTypeNodeHelper(type, context);
|
||||
return typeNode && getTypeFromTypeNode2(context, typeNode) === type && syntacticNodeBuilder.tryReuseExistingTypeNode(context, typeNode) || typeToTypeNodeHelper(type, context);
|
||||
}
|
||||
function typeParameterToDeclaration(type, context, constraint = getConstraintOfTypeParameter(type)) {
|
||||
const constraintNode = constraint && typeToTypeNodeHelperWithPossibleReusableTypeNode(constraint, getConstraintDeclaration(type), context);
|
||||
@@ -57481,7 +57334,7 @@ function createTypeChecker(host) {
|
||||
let result;
|
||||
const addUndefinedForParameter = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration, context.enclosingDeclaration);
|
||||
const decl = declaration ?? symbol.valueDeclaration ?? getDeclarationWithTypeAnnotation(symbol) ?? ((_a = symbol.declarations) == null ? void 0 : _a[0]);
|
||||
if (!couldUnfoldType(type, context) && decl) {
|
||||
if (decl) {
|
||||
if (isAccessor(decl)) {
|
||||
result = syntacticNodeBuilder.serializeTypeOfAccessor(decl, symbol, context);
|
||||
} else if (hasInferredType(decl) && !nodeIsSynthesized(decl) && !(getObjectFlags(type) & 196608 /* RequiresWidening */)) {
|
||||
@@ -64193,14 +64046,11 @@ function createTypeChecker(host) {
|
||||
function isNoInferType(type) {
|
||||
return !!(type.flags & 33554432 /* Substitution */ && type.constraint.flags & 2 /* Unknown */);
|
||||
}
|
||||
function isNarrowingSubstitutionType(type) {
|
||||
return !!(type.flags & 33554432 /* Substitution */ && type.objectFlags & 16777216 /* IsNarrowingType */);
|
||||
function getSubstitutionType(baseType, constraint) {
|
||||
return constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType || baseType.flags & 1 /* Any */ ? baseType : getOrCreateSubstitutionType(baseType, constraint);
|
||||
}
|
||||
function getSubstitutionType(baseType, constraint, isNarrowed) {
|
||||
return constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType || baseType.flags & 1 /* Any */ ? baseType : getOrCreateSubstitutionType(baseType, constraint, isNarrowed);
|
||||
}
|
||||
function getOrCreateSubstitutionType(baseType, constraint, isNarrowed) {
|
||||
const id = `${getTypeId(baseType)}>${getTypeId(constraint)}${isNarrowed ? ">N" : ""}`;
|
||||
function getOrCreateSubstitutionType(baseType, constraint) {
|
||||
const id = `${getTypeId(baseType)}>${getTypeId(constraint)}`;
|
||||
const cached = substitutionTypes.get(id);
|
||||
if (cached) {
|
||||
return cached;
|
||||
@@ -64208,9 +64058,6 @@ function createTypeChecker(host) {
|
||||
const result = createType(33554432 /* Substitution */);
|
||||
result.baseType = baseType;
|
||||
result.constraint = constraint;
|
||||
if (isNarrowed) {
|
||||
result.objectFlags |= 16777216 /* IsNarrowingType */;
|
||||
}
|
||||
substitutionTypes.set(id, result);
|
||||
return result;
|
||||
}
|
||||
@@ -66416,7 +66263,7 @@ function createTypeChecker(host) {
|
||||
function isDeferredType(type, checkTuples) {
|
||||
return isGenericType(type) || checkTuples && isTupleType(type) && some(getElementTypes(type), isGenericType);
|
||||
}
|
||||
function getConditionalType(root, mapper, forConstraint, aliasSymbol, aliasTypeArguments, forNarrowing) {
|
||||
function getConditionalType(root, mapper, forConstraint, aliasSymbol, aliasTypeArguments) {
|
||||
let result;
|
||||
let extraTypes;
|
||||
let tailCount = 0;
|
||||
@@ -66433,11 +66280,10 @@ function createTypeChecker(host) {
|
||||
if (checkType === wildcardType || extendsType === wildcardType) {
|
||||
return wildcardType;
|
||||
}
|
||||
const effectiveCheckType = forNarrowing && isNarrowingSubstitutionType(checkType) ? checkType.constraint : checkType;
|
||||
const checkTypeNode = skipTypeParentheses(root.node.checkType);
|
||||
const extendsTypeNode = skipTypeParentheses(root.node.extendsType);
|
||||
const checkTuples = isSimpleTupleType(checkTypeNode) && isSimpleTupleType(extendsTypeNode) && length(checkTypeNode.elements) === length(extendsTypeNode.elements);
|
||||
const checkTypeDeferred = isDeferredType(effectiveCheckType, checkTuples);
|
||||
const checkTypeDeferred = isDeferredType(checkType, checkTuples);
|
||||
let combinedMapper;
|
||||
if (root.inferTypeParameters) {
|
||||
const context = createInferenceContext(
|
||||
@@ -66456,8 +66302,8 @@ function createTypeChecker(host) {
|
||||
}
|
||||
const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType;
|
||||
if (!checkTypeDeferred && !isDeferredType(inferredExtendsType, checkTuples)) {
|
||||
if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (effectiveCheckType.flags & 1 /* Any */ || !isTypeAssignableTo(getPermissiveInstantiation(effectiveCheckType), getPermissiveInstantiation(inferredExtendsType)))) {
|
||||
if (effectiveCheckType.flags & 1 /* Any */ || forConstraint && !(inferredExtendsType.flags & 131072 /* Never */) && someType(getPermissiveInstantiation(inferredExtendsType), (t) => isTypeAssignableTo(t, getPermissiveInstantiation(effectiveCheckType)))) {
|
||||
if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (checkType.flags & 1 /* Any */ || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) {
|
||||
if (checkType.flags & 1 /* Any */ || forConstraint && !(inferredExtendsType.flags & 131072 /* Never */) && someType(getPermissiveInstantiation(inferredExtendsType), (t) => isTypeAssignableTo(t, getPermissiveInstantiation(checkType)))) {
|
||||
(extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper));
|
||||
}
|
||||
const falseType2 = getTypeFromTypeNode(root.node.falseType);
|
||||
@@ -66474,7 +66320,7 @@ function createTypeChecker(host) {
|
||||
result = instantiateType(falseType2, mapper);
|
||||
break;
|
||||
}
|
||||
if (inferredExtendsType.flags & 3 /* AnyOrUnknown */ || isTypeAssignableTo(getRestrictiveInstantiation(effectiveCheckType), getRestrictiveInstantiation(inferredExtendsType))) {
|
||||
if (inferredExtendsType.flags & 3 /* AnyOrUnknown */ || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) {
|
||||
const trueType2 = getTypeFromTypeNode(root.node.trueType);
|
||||
const trueMapper = combinedMapper || mapper;
|
||||
if (canTailRecurse(trueType2, trueMapper)) {
|
||||
@@ -67440,39 +67286,8 @@ function createTypeChecker(host) {
|
||||
if (!result) {
|
||||
const newMapper = createTypeMapper(root.outerTypeParameters, typeArguments);
|
||||
const checkType = root.checkType;
|
||||
let distributionType = root.isDistributive ? getReducedType(getMappedType(checkType, newMapper)) : void 0;
|
||||
let narrowingBaseType;
|
||||
const forNarrowing = distributionType && isNarrowingSubstitutionType(distributionType) && isNarrowableConditionalType(type, mapper);
|
||||
if (forNarrowing) {
|
||||
narrowingBaseType = distributionType.baseType;
|
||||
distributionType = getReducedType(distributionType.constraint);
|
||||
}
|
||||
if (distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */)) {
|
||||
if (narrowingBaseType) {
|
||||
result = mapTypeToIntersection(
|
||||
distributionType,
|
||||
(t) => getConditionalType(
|
||||
root,
|
||||
prependTypeMapping(checkType, getSubstitutionType(
|
||||
narrowingBaseType,
|
||||
t,
|
||||
/*isNarrowed*/
|
||||
true
|
||||
), newMapper),
|
||||
forConstraint,
|
||||
/*aliasSymbol*/
|
||||
void 0,
|
||||
/*aliasTypeArguments*/
|
||||
void 0,
|
||||
forNarrowing
|
||||
)
|
||||
);
|
||||
} else {
|
||||
result = mapTypeWithAlias(distributionType, (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper), forConstraint), aliasSymbol, aliasTypeArguments);
|
||||
}
|
||||
} else {
|
||||
result = getConditionalType(root, newMapper, forConstraint, aliasSymbol, aliasTypeArguments, forNarrowing);
|
||||
}
|
||||
const distributionType = root.isDistributive ? getReducedType(getMappedType(checkType, newMapper)) : void 0;
|
||||
result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(distributionType, (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper), forConstraint), aliasSymbol, aliasTypeArguments) : getConditionalType(root, newMapper, forConstraint, aliasSymbol, aliasTypeArguments);
|
||||
root.instantiations.set(id, result);
|
||||
}
|
||||
return result;
|
||||
@@ -68615,12 +68430,10 @@ function createTypeChecker(host) {
|
||||
function shouldNormalizeIntersection(type) {
|
||||
let hasInstantiable = false;
|
||||
let hasNullableOrEmpty = false;
|
||||
let hasSubstitution = false;
|
||||
for (const t of type.types) {
|
||||
hasInstantiable || (hasInstantiable = !!(t.flags & 465829888 /* Instantiable */));
|
||||
hasNullableOrEmpty || (hasNullableOrEmpty = !!(t.flags & 98304 /* Nullable */) || isEmptyAnonymousObjectType(t));
|
||||
hasSubstitution || (hasSubstitution = isNarrowingSubstitutionType(t));
|
||||
if (hasInstantiable && hasNullableOrEmpty || hasSubstitution) return true;
|
||||
if (hasInstantiable && hasNullableOrEmpty) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -73780,18 +73593,6 @@ function createTypeChecker(host) {
|
||||
}
|
||||
return changed ? mappedTypes && getUnionType(mappedTypes, noReductions ? 0 /* None */ : 1 /* Literal */) : type;
|
||||
}
|
||||
function mapTypeToIntersection(type, mapper) {
|
||||
if (type.flags & 131072 /* Never */) {
|
||||
return type;
|
||||
}
|
||||
if (!(type.flags & 1048576 /* Union */)) {
|
||||
return mapper(type);
|
||||
}
|
||||
const origin = type.origin;
|
||||
const types = origin && origin.flags & 1048576 /* Union */ ? origin.types : type.types;
|
||||
const mappedTypes = types.map((t) => t.flags & 1048576 /* Union */ ? mapTypeToIntersection(t, mapper) : mapper(t));
|
||||
return getIntersectionType(mappedTypes);
|
||||
}
|
||||
function mapTypeWithAlias(type, mapper, aliasSymbol, aliasTypeArguments) {
|
||||
return type.flags & 1048576 /* Union */ && aliasSymbol ? getUnionType(map(type.types, mapper), 1 /* Literal */, aliasSymbol, aliasTypeArguments) : mapType(type, mapper);
|
||||
}
|
||||
@@ -75376,11 +75177,11 @@ function createTypeChecker(host) {
|
||||
));
|
||||
return contextualType && !isGenericType(contextualType);
|
||||
}
|
||||
function getNarrowableTypeForReference(type, reference, checkMode, forReturnTypeNarrowing) {
|
||||
function getNarrowableTypeForReference(type, reference, checkMode) {
|
||||
if (isNoInferType(type)) {
|
||||
type = type.baseType;
|
||||
}
|
||||
const substituteConstraints = !(checkMode && checkMode & 2 /* Inferential */) && someType(type, isGenericTypeWithUnionConstraint) && (forReturnTypeNarrowing || isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
|
||||
const substituteConstraints = !(checkMode && checkMode & 2 /* Inferential */) && someType(type, isGenericTypeWithUnionConstraint) && (isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
|
||||
return substituteConstraints ? mapType(type, getBaseConstraintOrType) : type;
|
||||
}
|
||||
function isExportOrExportExpression(location) {
|
||||
@@ -76507,16 +76308,9 @@ function createTypeChecker(host) {
|
||||
function getContextualTypeForReturnExpression(node, contextFlags) {
|
||||
const func = getContainingFunction(node);
|
||||
if (func) {
|
||||
const functionFlags = getFunctionFlags(func);
|
||||
const links = getNodeLinks(node);
|
||||
if (links.contextualReturnType) {
|
||||
if (functionFlags & 2 /* Async */) {
|
||||
return getUnionType([links.contextualReturnType, createPromiseLikeType(links.contextualReturnType)]);
|
||||
}
|
||||
return links.contextualReturnType;
|
||||
}
|
||||
let contextualReturnType = getContextualReturnType(func, contextFlags);
|
||||
if (contextualReturnType) {
|
||||
const functionFlags = getFunctionFlags(func);
|
||||
if (functionFlags & 1 /* Generator */) {
|
||||
const isAsyncGenerator = (functionFlags & 2 /* Async */) !== 0;
|
||||
if (contextualReturnType.flags & 1048576 /* Union */) {
|
||||
@@ -77214,13 +77008,6 @@ function createTypeChecker(host) {
|
||||
if (index >= 0) {
|
||||
return contextualTypes[index];
|
||||
}
|
||||
const links = getNodeLinks(node);
|
||||
if (links.contextualReturnType) {
|
||||
if (node.flags & 65536 /* AwaitContext */) {
|
||||
return getUnionType([links.contextualReturnType, createPromiseLikeType(links.contextualReturnType)]);
|
||||
}
|
||||
return links.contextualReturnType;
|
||||
}
|
||||
const { parent: parent2 } = node;
|
||||
switch (parent2.kind) {
|
||||
case 260 /* VariableDeclaration */:
|
||||
@@ -88209,199 +87996,7 @@ function createTypeChecker(host) {
|
||||
) : exprType;
|
||||
const effectiveExpr = expr && getEffectiveCheckNode(expr);
|
||||
const errorNode = inReturnStatement && !inConditionalExpression ? node : effectiveExpr;
|
||||
if (!(unwrappedReturnType.flags & (8388608 /* IndexedAccess */ | 16777216 /* Conditional */)) || !couldContainTypeVariables(unwrappedReturnType)) {
|
||||
checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, errorNode, effectiveExpr);
|
||||
return;
|
||||
}
|
||||
if (checkTypeAssignableTo(
|
||||
unwrappedExprType,
|
||||
unwrappedReturnType,
|
||||
/*errorNode*/
|
||||
void 0
|
||||
)) {
|
||||
return;
|
||||
}
|
||||
let narrowPosition = node;
|
||||
let narrowFlowNode = inReturnStatement && node.flowNode;
|
||||
if (expr && isConditionalExpression(expr.parent)) {
|
||||
narrowFlowNode = expr.parent.whenTrue === expr ? expr.parent.flowNodeWhenTrue : expr.parent.flowNodeWhenFalse;
|
||||
narrowPosition = expr;
|
||||
}
|
||||
if (!narrowFlowNode) {
|
||||
checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, errorNode, effectiveExpr);
|
||||
return;
|
||||
}
|
||||
const allTypeParameters = appendTypeParameters(getOuterTypeParameters(
|
||||
container,
|
||||
/*includeThisTypes*/
|
||||
false
|
||||
), getEffectiveTypeParameterDeclarations(container));
|
||||
const narrowableTypeParameters = allTypeParameters && getNarrowableTypeParameters(allTypeParameters);
|
||||
if (!narrowableTypeParameters || !narrowableTypeParameters.length || !isNarrowableReturnType(unwrappedReturnType)) {
|
||||
checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, errorNode, effectiveExpr);
|
||||
return;
|
||||
}
|
||||
const narrowedTypeParameters = [];
|
||||
const narrowedTypes = [];
|
||||
for (const [typeParam, symbol, reference] of narrowableTypeParameters) {
|
||||
const narrowReference = factory.cloneNode(reference);
|
||||
narrowReference.id = void 0;
|
||||
getNodeLinks(narrowReference).resolvedSymbol = symbol;
|
||||
setParent(narrowReference, narrowPosition.parent);
|
||||
narrowReference.flowNode = narrowFlowNode;
|
||||
const initialType = getNarrowableTypeForReference(
|
||||
typeParam,
|
||||
narrowReference,
|
||||
/*checkMode*/
|
||||
void 0,
|
||||
/*forReturnTypeNarrowing*/
|
||||
true
|
||||
);
|
||||
if (initialType === typeParam) {
|
||||
continue;
|
||||
}
|
||||
const flowType = getFlowTypeOfReference(narrowReference, initialType);
|
||||
const exprType2 = getTypeFromFlowType(flowType);
|
||||
if (exprType2.flags & 3 /* AnyOrUnknown */ || isErrorType(exprType2) || exprType2 === typeParam || exprType2 === mapType(typeParam, getBaseConstraintOrType)) {
|
||||
continue;
|
||||
}
|
||||
const narrowedType = getSubstitutionType(
|
||||
typeParam,
|
||||
exprType2,
|
||||
/*isNarrowed*/
|
||||
true
|
||||
);
|
||||
narrowedTypeParameters.push(typeParam);
|
||||
narrowedTypes.push(narrowedType);
|
||||
}
|
||||
const narrowMapper = createTypeMapper(narrowedTypeParameters, narrowedTypes);
|
||||
const narrowedReturnType = instantiateType(
|
||||
unwrappedReturnType,
|
||||
narrowMapper
|
||||
);
|
||||
if (expr) {
|
||||
const links = getNodeLinks(expr);
|
||||
if (!links.contextualReturnType) {
|
||||
links.contextualReturnType = narrowedReturnType;
|
||||
}
|
||||
}
|
||||
const narrowedExprType = expr ? checkExpression(expr) : undefinedType;
|
||||
const narrowedUnwrappedExprType = functionFlags & 2 /* Async */ ? checkAwaitedType(
|
||||
narrowedExprType,
|
||||
/*withAlias*/
|
||||
false,
|
||||
node,
|
||||
Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
|
||||
) : narrowedExprType;
|
||||
checkTypeAssignableToAndOptionallyElaborate(narrowedUnwrappedExprType, narrowedReturnType, errorNode, effectiveExpr);
|
||||
}
|
||||
function getNarrowableTypeParameters(candidates) {
|
||||
const narrowableParams = [];
|
||||
for (const typeParam of candidates) {
|
||||
const constraint = getConstraintOfTypeParameter(typeParam);
|
||||
if (!constraint || !(constraint.flags & 1048576 /* Union */)) continue;
|
||||
if (typeParam.symbol && typeParam.symbol.declarations && typeParam.symbol.declarations.length === 1) {
|
||||
const declaration = typeParam.symbol.declarations[0];
|
||||
const container = isJSDocTemplateTag(declaration.parent) ? getJSDocHost(declaration.parent) : declaration.parent;
|
||||
if (!isFunctionLike(container)) continue;
|
||||
let reference;
|
||||
let hasInvalidReference = false;
|
||||
for (const paramDecl of container.parameters) {
|
||||
const typeNode = getEffectiveTypeAnnotationNode(paramDecl);
|
||||
if (!typeNode) continue;
|
||||
if (isTypeParameterReferenced(typeParam, typeNode)) {
|
||||
let candidateReference;
|
||||
if (isTypeReferenceNode(typeNode) && isReferenceToTypeParameter(typeParam, typeNode) && (candidateReference = getValidParameterReference(paramDecl, constraint))) {
|
||||
if (reference) {
|
||||
hasInvalidReference = true;
|
||||
break;
|
||||
}
|
||||
reference = candidateReference;
|
||||
} else {
|
||||
hasInvalidReference = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!hasInvalidReference && reference) {
|
||||
const symbol = getResolvedSymbol(reference);
|
||||
if (symbol !== unknownSymbol) narrowableParams.push([typeParam, symbol, reference]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return narrowableParams;
|
||||
function getValidParameterReference(paramDecl, constraint) {
|
||||
if (!isIdentifier(paramDecl.name)) return;
|
||||
const isOptional = !!paramDecl.questionToken || isJSDocOptionalParameter(paramDecl);
|
||||
if (isOptional && !containsUndefinedType(constraint)) return;
|
||||
return paramDecl.name;
|
||||
}
|
||||
function isReferenceToTypeParameter(typeParam, node) {
|
||||
return getTypeFromTypeReference(node) === typeParam;
|
||||
}
|
||||
function isTypeParameterReferenced(typeParam, node) {
|
||||
return isReferenced(node);
|
||||
function isReferenced(node2) {
|
||||
if (isTypeReferenceNode(node2)) {
|
||||
return isReferenceToTypeParameter(typeParam, node2);
|
||||
}
|
||||
if (isTypeQueryNode(node2)) {
|
||||
return isTypeParameterPossiblyReferenced(typeParam, node2);
|
||||
}
|
||||
return !!forEachChild(node2, isReferenced);
|
||||
}
|
||||
}
|
||||
}
|
||||
function isNarrowableReturnType(returnType) {
|
||||
return isConditionalType(returnType) ? isNarrowableConditionalType(returnType) : !!(returnType.indexType.flags & 262144 /* TypeParameter */);
|
||||
}
|
||||
function isNarrowableConditionalType(type, mapper) {
|
||||
const typeArguments = mapper && map(type.root.outerTypeParameters, (t) => {
|
||||
const mapped = getMappedType(t, mapper);
|
||||
if (isNarrowingSubstitutionType(mapped)) {
|
||||
return mapped.baseType;
|
||||
}
|
||||
return mapped;
|
||||
});
|
||||
const id = `${type.id}:${getTypeListId(typeArguments)}`;
|
||||
let result = narrowableReturnTypeCache.get(id);
|
||||
if (result === void 0) {
|
||||
const nonNarrowingMapper = type.root.outerTypeParameters && typeArguments && createTypeMapper(type.root.outerTypeParameters, typeArguments);
|
||||
const instantiatedType = instantiateType(type, nonNarrowingMapper);
|
||||
result = isConditionalType(instantiatedType) && isNarrowableConditionalTypeWorker(instantiatedType);
|
||||
narrowableReturnTypeCache.set(id, result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function isNarrowableConditionalTypeWorker(type) {
|
||||
if (!type.root.isDistributive) {
|
||||
return false;
|
||||
}
|
||||
if (type.root.inferTypeParameters) {
|
||||
return false;
|
||||
}
|
||||
if (!(type.checkType.flags & 262144 /* TypeParameter */)) {
|
||||
return false;
|
||||
}
|
||||
const constraintType = getConstraintOfTypeParameter(type.checkType);
|
||||
if (!constraintType || !(constraintType.flags & 1048576 /* Union */)) {
|
||||
return false;
|
||||
}
|
||||
if (!everyType(type.extendsType, (extendsType) => some(
|
||||
constraintType.types,
|
||||
(constraintType2) => isTypeIdenticalTo(constraintType2, extendsType)
|
||||
))) {
|
||||
return false;
|
||||
}
|
||||
const trueType2 = getTrueTypeFromConditionalType(type);
|
||||
const isValidTrueType = isConditionalType(trueType2) ? isNarrowableConditionalType(trueType2) : true;
|
||||
if (!isValidTrueType) return false;
|
||||
const falseType2 = getFalseTypeFromConditionalType(type);
|
||||
const isValidFalseType = isConditionalType(falseType2) ? isNarrowableConditionalType(falseType2) : falseType2 === neverType;
|
||||
return isValidFalseType;
|
||||
}
|
||||
function isConditionalType(type) {
|
||||
return !!(type.flags & 16777216 /* Conditional */);
|
||||
checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, errorNode, effectiveExpr);
|
||||
}
|
||||
function checkWithStatement(node) {
|
||||
if (!checkGrammarStatementInAmbientContext(node)) {
|
||||
@@ -90011,7 +89606,7 @@ function createTypeChecker(host) {
|
||||
);
|
||||
}
|
||||
if (moduleKind === 199 /* NodeNext */ && !isImportAttributes2) {
|
||||
return grammarErrorOnFirstToken(node, Diagnostics.Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_asserts);
|
||||
return grammarErrorOnFirstToken(node, Diagnostics.Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert);
|
||||
}
|
||||
if (declaration.moduleSpecifier && getEmitSyntaxForModuleSpecifierExpression(declaration.moduleSpecifier) === 1 /* CommonJS */) {
|
||||
return grammarErrorOnNode(
|
||||
@@ -140640,9 +140235,9 @@ function mapToDisplayParts(writeDisplayParts) {
|
||||
displayPartWriter.clear();
|
||||
}
|
||||
}
|
||||
function typeToDisplayParts(typechecker, type, enclosingDeclaration, flags = 0 /* None */, verbosityLevel, out) {
|
||||
function typeToDisplayParts(typechecker, type, enclosingDeclaration, flags = 0 /* None */) {
|
||||
return mapToDisplayParts((writer) => {
|
||||
typechecker.writeType(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer, verbosityLevel, out);
|
||||
typechecker.writeType(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer);
|
||||
});
|
||||
}
|
||||
function symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration, meaning, flags = 0 /* None */) {
|
||||
@@ -147254,7 +146849,7 @@ function getUsageInfo(oldFile, toMove, checker, existingTargetLocals = /* @__PUR
|
||||
const unusedImportsFromOldFile = /* @__PURE__ */ new Set();
|
||||
for (const statement of toMove) {
|
||||
forEachReference(statement, checker, enclosingRange, (symbol, isValidTypeOnlyUseSite) => {
|
||||
if (!symbol.declarations) {
|
||||
if (!some(symbol.declarations)) {
|
||||
return;
|
||||
}
|
||||
if (existingTargetLocals.has(skipAlias(symbol, checker))) {
|
||||
@@ -152607,7 +152202,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
||||
synchronizeHostData();
|
||||
return ts_Completions_exports.getCompletionEntrySymbol(program, log, getValidSourceFile(fileName), position, { name, source }, host, preferences);
|
||||
}
|
||||
function getQuickInfoAtPosition(fileName, position, verbosityLevel) {
|
||||
function getQuickInfoAtPosition(fileName, position) {
|
||||
synchronizeHostData();
|
||||
const sourceFile = getValidSourceFile(fileName);
|
||||
const node = getTouchingPropertyName(sourceFile, position);
|
||||
@@ -152623,41 +152218,19 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
||||
kind: "" /* unknown */,
|
||||
kindModifiers: "" /* none */,
|
||||
textSpan: createTextSpanFromNode(nodeForQuickInfo, sourceFile),
|
||||
displayParts: typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => typeToDisplayParts(
|
||||
typeChecker2,
|
||||
type,
|
||||
getContainerNode(nodeForQuickInfo),
|
||||
/*flags*/
|
||||
void 0,
|
||||
verbosityLevel
|
||||
)),
|
||||
displayParts: typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => typeToDisplayParts(typeChecker2, type, getContainerNode(nodeForQuickInfo))),
|
||||
documentation: type.symbol ? type.symbol.getDocumentationComment(typeChecker) : void 0,
|
||||
tags: type.symbol ? type.symbol.getJsDocTags(typeChecker) : void 0
|
||||
};
|
||||
}
|
||||
const { symbolKind, displayParts, documentation, tags, canIncreaseVerbosityLevel } = typeChecker.runWithCancellationToken(
|
||||
cancellationToken,
|
||||
(typeChecker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind(
|
||||
typeChecker2,
|
||||
symbol,
|
||||
sourceFile,
|
||||
getContainerNode(nodeForQuickInfo),
|
||||
nodeForQuickInfo,
|
||||
/*semanticMeaning*/
|
||||
void 0,
|
||||
/*alias*/
|
||||
void 0,
|
||||
verbosityLevel
|
||||
)
|
||||
);
|
||||
const { symbolKind, displayParts, documentation, tags } = typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker2, symbol, sourceFile, getContainerNode(nodeForQuickInfo), nodeForQuickInfo));
|
||||
return {
|
||||
kind: symbolKind,
|
||||
kindModifiers: ts_SymbolDisplay_exports.getSymbolModifiers(typeChecker, symbol),
|
||||
textSpan: createTextSpanFromNode(nodeForQuickInfo, sourceFile),
|
||||
displayParts,
|
||||
documentation,
|
||||
tags,
|
||||
canIncreaseVerbosityLevel
|
||||
tags
|
||||
};
|
||||
}
|
||||
function preparePasteEditsForFile(fileName, copiedTextRange) {
|
||||
@@ -177733,7 +177306,7 @@ function getSymbolModifiers(typeChecker, symbol) {
|
||||
}
|
||||
return modifiers.size > 0 ? arrayFrom(modifiers.values()).join(",") : "" /* none */;
|
||||
}
|
||||
function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symbol, sourceFile, enclosingDeclaration, location, type, semanticMeaning, alias, verbosityLevel) {
|
||||
function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symbol, sourceFile, enclosingDeclaration, location, type, semanticMeaning, alias) {
|
||||
var _a;
|
||||
const displayParts = [];
|
||||
let documentation = [];
|
||||
@@ -177745,7 +177318,6 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb
|
||||
let documentationFromAlias;
|
||||
let tagsFromAlias;
|
||||
let hasMultipleSignatures = false;
|
||||
const typeWriterOut = verbosityLevel !== void 0 ? { couldUnfoldMore: false } : void 0;
|
||||
if (location.kind === 110 /* ThisKeyword */ && !isThisExpression) {
|
||||
return { displayParts: [keywordPart(110 /* ThisKeyword */)], documentation: [], symbolKind: "primitive type" /* primitiveType */, tags: void 0 };
|
||||
}
|
||||
@@ -177905,17 +177477,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb
|
||||
displayParts.push(spacePart());
|
||||
displayParts.push(operatorPart(64 /* EqualsToken */));
|
||||
displayParts.push(spacePart());
|
||||
addRange(
|
||||
displayParts,
|
||||
typeToDisplayParts(
|
||||
typeChecker,
|
||||
location.parent && isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol),
|
||||
enclosingDeclaration,
|
||||
8388608 /* InTypeAlias */,
|
||||
verbosityLevel,
|
||||
typeWriterOut
|
||||
)
|
||||
);
|
||||
addRange(displayParts, typeToDisplayParts(typeChecker, location.parent && isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */));
|
||||
}
|
||||
if (symbolFlags & 384 /* Enum */) {
|
||||
prefixNextMeaning();
|
||||
@@ -178074,32 +177636,12 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb
|
||||
displayParts.push(spacePart());
|
||||
if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */ && symbolKind !== "index" /* indexSignatureElement */) {
|
||||
const typeParameterParts = mapToDisplayParts((writer) => {
|
||||
const param = typeChecker.typeParameterToDeclaration(
|
||||
type,
|
||||
enclosingDeclaration,
|
||||
symbolDisplayNodeBuilderFlags,
|
||||
/*internalFlags*/
|
||||
void 0,
|
||||
/*tracker*/
|
||||
void 0,
|
||||
verbosityLevel
|
||||
);
|
||||
const param = typeChecker.typeParameterToDeclaration(type, enclosingDeclaration, symbolDisplayNodeBuilderFlags);
|
||||
getPrinter().writeNode(4 /* Unspecified */, param, getSourceFileOfNode(getParseTreeNode(enclosingDeclaration)), writer);
|
||||
});
|
||||
addRange(displayParts, typeParameterParts);
|
||||
} else {
|
||||
addRange(
|
||||
displayParts,
|
||||
typeToDisplayParts(
|
||||
typeChecker,
|
||||
type,
|
||||
enclosingDeclaration,
|
||||
/*flags*/
|
||||
void 0,
|
||||
verbosityLevel,
|
||||
typeWriterOut
|
||||
)
|
||||
);
|
||||
addRange(displayParts, typeToDisplayParts(typeChecker, type, enclosingDeclaration));
|
||||
}
|
||||
if (isTransientSymbol(symbol) && symbol.links.target && isTransientSymbol(symbol.links.target) && symbol.links.target.links.tupleLabelDeclaration) {
|
||||
const labelDecl = symbol.links.target.links.tupleLabelDeclaration;
|
||||
@@ -178164,13 +177706,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb
|
||||
if (tags.length === 0 && tagsFromAlias) {
|
||||
tags = tagsFromAlias;
|
||||
}
|
||||
return {
|
||||
displayParts,
|
||||
documentation,
|
||||
symbolKind,
|
||||
tags: tags.length === 0 ? void 0 : tags,
|
||||
canIncreaseVerbosityLevel: typeWriterOut == null ? void 0 : typeWriterOut.couldUnfoldMore
|
||||
};
|
||||
return { displayParts, documentation, symbolKind, tags: tags.length === 0 ? void 0 : tags };
|
||||
function getPrinter() {
|
||||
return createPrinterWithRemoveComments();
|
||||
}
|
||||
@@ -178283,7 +177819,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb
|
||||
addRange(displayParts, typeParameterParts);
|
||||
}
|
||||
}
|
||||
function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location, semanticMeaning = getMeaningFromLocation(location), alias, verbosityLevel) {
|
||||
function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location, semanticMeaning = getMeaningFromLocation(location), alias) {
|
||||
return getSymbolDisplayPartsDocumentationAndSymbolKindWorker(
|
||||
typeChecker,
|
||||
symbol,
|
||||
@@ -178293,8 +177829,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, so
|
||||
/*type*/
|
||||
void 0,
|
||||
semanticMeaning,
|
||||
alias,
|
||||
verbosityLevel
|
||||
alias
|
||||
);
|
||||
}
|
||||
function isLocalVariableOrFunction(symbol) {
|
||||
@@ -195244,7 +194779,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
||||
getQuickInfoWorker(args, simplifiedResult) {
|
||||
const { file, project } = this.getFileAndProject(args);
|
||||
const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file);
|
||||
const quickInfo = project.getLanguageService().getQuickInfoAtPosition(file, this.getPosition(args, scriptInfo), args.verbosityLevel);
|
||||
const quickInfo = project.getLanguageService().getQuickInfoAtPosition(file, this.getPosition(args, scriptInfo));
|
||||
if (!quickInfo) {
|
||||
return void 0;
|
||||
}
|
||||
@@ -195258,8 +194793,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
||||
end: scriptInfo.positionToLineOffset(textSpanEnd(quickInfo.textSpan)),
|
||||
displayString,
|
||||
documentation: useDisplayParts ? this.mapDisplayParts(quickInfo.documentation, project) : displayPartsToString(quickInfo.documentation),
|
||||
tags: this.mapJSDocTagInfo(quickInfo.tags, project, useDisplayParts),
|
||||
canIncreaseVerbosityLevel: quickInfo.canIncreaseVerbosityLevel
|
||||
tags: this.mapJSDocTagInfo(quickInfo.tags, project, useDisplayParts)
|
||||
};
|
||||
} else {
|
||||
return useDisplayParts ? quickInfo : {
|
||||
|
||||
@@ -618,6 +618,7 @@
|
||||
"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672": "禁止 “import”、“require” 或 “<reference>” 扩展 TypeScript 应添加到项目的文件数。",
|
||||
"Disallow_inconsistently_cased_references_to_the_same_file_6078": "不允许对同一文件采用大小不一致的引用。",
|
||||
"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159": "请勿将三斜杠引用或导入的模块添加到已编译文件列表中。",
|
||||
"Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721": "不允许不属于 ECMAScript 的运行时构造。",
|
||||
"Do_not_emit_comments_to_output_6009": "请勿将注释发出到输出。",
|
||||
"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056": "请勿对具有 \"@internal\" 注释的代码发出声明。",
|
||||
"Do_not_emit_outputs_6010": "请勿发出输出。",
|
||||
@@ -681,6 +682,7 @@
|
||||
"Enable_experimental_support_for_legacy_experimental_decorators_6630": "启用对旧实验性修饰器的实验性支持。",
|
||||
"Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264": "启用导入具有任何扩展名的文件,前提是存在声明文件。",
|
||||
"Enable_importing_json_files_6689": "启用导入 .json 文件。",
|
||||
"Enable_lib_replacement_6808": "启用 lib 替换。",
|
||||
"Enable_project_compilation_6302": "启用项目编译",
|
||||
"Enable_strict_bind_call_and_apply_methods_on_functions_6214": "对函数启用严格的 \"bind\"、\"call\" 和 \"apply\" 方法。",
|
||||
"Enable_strict_checking_of_function_types_6186": "对函数类型启用严格检查。",
|
||||
@@ -890,6 +892,7 @@
|
||||
"Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836": "不允许在编译到 commonJS“require”调用的语句导入断言。",
|
||||
"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2821": "仅当“--module”选项设置为“esnext”、“node18”、“nodenext”或“preserve”时,才支持导入断言。",
|
||||
"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822": "导入断言不能用于仅类型导入或导出。",
|
||||
"Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880": "导入断言已被导入属性替换。使用 “with” 而不是 “assert”。",
|
||||
"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "面向 ECMAScript 模块时,不能使用导入分配。请考虑改用 \"import * as ns from \"mod\"\"、\"import {a} from \"mod\"\"、\"import d from \"mod\"\" 或另一种模块格式。",
|
||||
"Import_attribute_values_must_be_string_literal_expressions_2858": "导入属性值必须为字符串字面量表达式。",
|
||||
"Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856": "不允许在编译到 commonJS“require” 调用的语句导入属性。",
|
||||
@@ -1685,6 +1688,7 @@
|
||||
"This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1501": "此正则表达式标志仅在面向“{0}”或更高版本时可用。",
|
||||
"This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolv_2876": "重写此相对导入路径并不安全,因为它看起来像文件名,但实际上解析为 ‘{0}’。",
|
||||
"This_spread_always_overwrites_this_property_2785": "此扩张将始终覆盖此属性。",
|
||||
"This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294": "启用 “erasableSyntaxOnly” 时,不允许使用此语法。",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060": "此语法保留在扩展名为 .mts 或 .cts 的文件中。请添加尾随逗号或显式约束。",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059": "此语法保留在扩展名为 .mts 或 .cts 的文件中。请改用 `as` 表达式。",
|
||||
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "此语法需要一个导入的帮助程序,但找不到模块“{0}”。",
|
||||
|
||||
@@ -618,6 +618,7 @@
|
||||
"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672": "不允許 import'、'require' 或 '<reference>' 擴充 TypeScript 應該加入專案的檔案數目。",
|
||||
"Disallow_inconsistently_cased_references_to_the_same_file_6078": "不允許相同檔案大小寫不一致的參考。",
|
||||
"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159": "不要在編譯後的檔案清單中新增三道斜線的參考或匯入的模組。",
|
||||
"Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721": "不允許不屬於ECMAScript一部分的運行時間建構。",
|
||||
"Do_not_emit_comments_to_output_6009": "請勿將註解發出到輸出。",
|
||||
"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056": "請勿發出包含 '@internal' 註釋的程式碼宣告。",
|
||||
"Do_not_emit_outputs_6010": "請勿發出輸出。",
|
||||
@@ -681,6 +682,7 @@
|
||||
"Enable_experimental_support_for_legacy_experimental_decorators_6630": "啟用舊版實驗性裝飾項目的實驗性支援。",
|
||||
"Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264": "啟用匯入具有任何延伸模組的檔案,並存在宣告檔案即可。",
|
||||
"Enable_importing_json_files_6689": "啟用匯入 json 檔案。",
|
||||
"Enable_lib_replacement_6808": "啟用連結庫取代。",
|
||||
"Enable_project_compilation_6302": "啟用專案編譯",
|
||||
"Enable_strict_bind_call_and_apply_methods_on_functions_6214": "對函式啟用嚴格的 'bind'、'call' 及 'apply' 方法。",
|
||||
"Enable_strict_checking_of_function_types_6186": "啟用嚴格檢查函式類型。",
|
||||
@@ -890,6 +892,7 @@
|
||||
"Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836": "編譯為 CommonJS 'require' 呼叫的陳述式上不允許匯入判斷提示。",
|
||||
"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2821": "只有當 '--module' 選項設定為 'esnext'、'node18'、'nodenext' 或 'preserve' 時,才支援匯入判斷提示。",
|
||||
"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822": "匯入判斷提示不能與僅限類型的匯入或匯出搭配使用。",
|
||||
"Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880": "匯入宣告已由匯入屬性取代。使用 『with』 而非 'assert'。",
|
||||
"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "當目標為 ECMAScript 模組時,無法使用匯入指派。請考慮改用 'import * as ns from \"mod\"'、'import {a} from \"mod\"'、'import d from \"mod\"' 或其他模組格式。",
|
||||
"Import_attribute_values_must_be_string_literal_expressions_2858": "匯入屬性值必須是字串常值運算式。",
|
||||
"Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856": "編譯為 CommonJS 'require' 呼叫的陳述式上不允許匯入屬性。",
|
||||
@@ -1685,6 +1688,7 @@
|
||||
"This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1501": "只有以 '{0}' 或更新版本作為目標時,才能使用規則運算式旗標。",
|
||||
"This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolv_2876": "此相對匯入路徑在重寫時是不安全的,因為其看起來像檔案名稱,但實際上解析為 \"{0}\"。",
|
||||
"This_spread_always_overwrites_this_property_2785": "此展開會永遠覆寫此屬性。",
|
||||
"This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294": "啟用 'erasableSyntaxOnly' 時,不允許使用此語法。",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060": "此語法是保留在具有 mts 或 cts 副檔名的檔案中。新增尾端逗號或明確條件約束。",
|
||||
"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059": "此語法會保留在具有 mts 或 cts 副檔名的檔案中。請改用 `as` 運算式。",
|
||||
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "此語法需要已匯入的協助程式,但找不到模組 '{0}'。",
|
||||
|
||||
Reference in New Issue
Block a user