typescript 5.5.0-dev.20240319 → 5.5.0-dev.20240321
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lib.esnext.array.d.ts +35 -0
- package/lib/lib.esnext.d.ts +1 -0
- package/lib/tsc.js +130 -401
- package/lib/tsserver.js +108 -114
- package/lib/typescript.d.ts +1 -0
- package/lib/typescript.js +141 -372
- package/lib/typingsInstaller.js +18 -24
- package/package.json +2 -2
package/lib/typescript.js
CHANGED
|
@@ -2326,7 +2326,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2326
2326
|
|
|
2327
2327
|
// src/compiler/corePublic.ts
|
|
2328
2328
|
var versionMajorMinor = "5.5";
|
|
2329
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2329
|
+
var version = `${versionMajorMinor}.0-dev.20240321`;
|
|
2330
2330
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2331
2331
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2332
2332
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -7393,7 +7393,8 @@ var commentPragmas = {
|
|
|
7393
7393
|
{ name: "lib", optional: true, captureSpan: true },
|
|
7394
7394
|
{ name: "path", optional: true, captureSpan: true },
|
|
7395
7395
|
{ name: "no-default-lib", optional: true },
|
|
7396
|
-
{ name: "resolution-mode", optional: true }
|
|
7396
|
+
{ name: "resolution-mode", optional: true },
|
|
7397
|
+
{ name: "preserve", optional: true }
|
|
7397
7398
|
],
|
|
7398
7399
|
kind: 1 /* TripleSlashXML */
|
|
7399
7400
|
},
|
|
@@ -11347,7 +11348,9 @@ var Diagnostics = {
|
|
|
11347
11348
|
The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
|
|
11348
11349
|
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
|
|
11349
11350
|
Its_type_0_is_not_a_valid_JSX_element_type: diag(18053, 1 /* Error */, "Its_type_0_is_not_a_valid_JSX_element_type_18053", "Its type '{0}' is not a valid JSX element type."),
|
|
11350
|
-
await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1 /* Error */, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block.")
|
|
11351
|
+
await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1 /* Error */, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block."),
|
|
11352
|
+
_0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is_enabled: diag(18055, 1 /* Error */, "_0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is__18055", "'{0}' has a string type, but must have syntactically recognizable string syntax when 'isolatedModules' is enabled."),
|
|
11353
|
+
Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled: diag(18056, 1 /* Error */, "Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is__18056", "Enum member following a non-literal numeric member must have an initializer when 'isolatedModules' is enabled.")
|
|
11351
11354
|
};
|
|
11352
11355
|
|
|
11353
11356
|
// src/compiler/scanner.ts
|
|
@@ -15657,6 +15660,9 @@ var getScriptTargetFeatures = /* @__PURE__ */ memoize(
|
|
|
15657
15660
|
es2015: [
|
|
15658
15661
|
"from",
|
|
15659
15662
|
"of"
|
|
15663
|
+
],
|
|
15664
|
+
esnext: [
|
|
15665
|
+
"fromAsync"
|
|
15660
15666
|
]
|
|
15661
15667
|
})),
|
|
15662
15668
|
ObjectConstructor: new Map(Object.entries({
|
|
@@ -36962,7 +36968,7 @@ var Parser;
|
|
|
36962
36968
|
80 /* Identifier */,
|
|
36963
36969
|
/*reportAtCurrentPosition*/
|
|
36964
36970
|
false
|
|
36965
|
-
) :
|
|
36971
|
+
) : parseIdentifierName()), pos);
|
|
36966
36972
|
}
|
|
36967
36973
|
while (token() === 81 /* PrivateIdentifier */) {
|
|
36968
36974
|
reScanHashToken();
|
|
@@ -37910,16 +37916,17 @@ function processPragmasIntoFields(context, reportDiagnostic) {
|
|
|
37910
37916
|
const typeReferenceDirectives = context.typeReferenceDirectives;
|
|
37911
37917
|
const libReferenceDirectives = context.libReferenceDirectives;
|
|
37912
37918
|
forEach(toArray(entryOrList), (arg) => {
|
|
37913
|
-
const { types, lib, path, ["resolution-mode"]: res } = arg.arguments;
|
|
37919
|
+
const { types, lib, path, ["resolution-mode"]: res, preserve: _preserve } = arg.arguments;
|
|
37920
|
+
const preserve = _preserve === "true" ? true : void 0;
|
|
37914
37921
|
if (arg.arguments["no-default-lib"] === "true") {
|
|
37915
37922
|
context.hasNoDefaultLib = true;
|
|
37916
37923
|
} else if (types) {
|
|
37917
37924
|
const parsed = parseResolutionMode(res, types.pos, types.end, reportDiagnostic);
|
|
37918
|
-
typeReferenceDirectives.push({ pos: types.pos, end: types.end, fileName: types.value, ...parsed ? { resolutionMode: parsed } : {} });
|
|
37925
|
+
typeReferenceDirectives.push({ pos: types.pos, end: types.end, fileName: types.value, ...parsed ? { resolutionMode: parsed } : {}, ...preserve ? { preserve } : {} });
|
|
37919
37926
|
} else if (lib) {
|
|
37920
|
-
libReferenceDirectives.push({ pos: lib.pos, end: lib.end, fileName: lib.value });
|
|
37927
|
+
libReferenceDirectives.push({ pos: lib.pos, end: lib.end, fileName: lib.value, ...preserve ? { preserve } : {} });
|
|
37921
37928
|
} else if (path) {
|
|
37922
|
-
referencedFiles.push({ pos: path.pos, end: path.end, fileName: path.value });
|
|
37929
|
+
referencedFiles.push({ pos: path.pos, end: path.end, fileName: path.value, ...preserve ? { preserve } : {} });
|
|
37923
37930
|
} else {
|
|
37924
37931
|
reportDiagnostic(arg.range.pos, arg.range.end - arg.range.pos, Diagnostics.Invalid_reference_directive_syntax);
|
|
37925
37932
|
}
|
|
@@ -38177,6 +38184,7 @@ var libEntries = [
|
|
|
38177
38184
|
["esnext.weakref", "lib.es2021.weakref.d.ts"],
|
|
38178
38185
|
["esnext.decorators", "lib.esnext.decorators.d.ts"],
|
|
38179
38186
|
["esnext.object", "lib.esnext.object.d.ts"],
|
|
38187
|
+
["esnext.array", "lib.esnext.array.d.ts"],
|
|
38180
38188
|
["esnext.regexp", "lib.esnext.regexp.d.ts"],
|
|
38181
38189
|
["decorators", "lib.decorators.d.ts"],
|
|
38182
38190
|
["decorators.legacy", "lib.decorators.legacy.d.ts"]
|
|
@@ -51869,13 +51877,6 @@ function createTypeChecker(host) {
|
|
|
51869
51877
|
});
|
|
51870
51878
|
}
|
|
51871
51879
|
function getSymbolIfSameReference(s1, s2) {
|
|
51872
|
-
var _a, _b;
|
|
51873
|
-
if (s1.flags & 524288 /* TypeAlias */ && ((_a = s2.declarations) == null ? void 0 : _a.find(isTypeAlias))) {
|
|
51874
|
-
s2 = getDeclaredTypeOfTypeAlias(s2).aliasSymbol || s2;
|
|
51875
|
-
}
|
|
51876
|
-
if (s2.flags & 524288 /* TypeAlias */ && ((_b = s1.declarations) == null ? void 0 : _b.find(isTypeAlias))) {
|
|
51877
|
-
s1 = getDeclaredTypeOfTypeAlias(s1).aliasSymbol || s1;
|
|
51878
|
-
}
|
|
51879
51880
|
if (getMergedSymbol(resolveSymbol(getMergedSymbol(s1))) === getMergedSymbol(resolveSymbol(getMergedSymbol(s2)))) {
|
|
51880
51881
|
return s1;
|
|
51881
51882
|
}
|
|
@@ -54038,14 +54039,6 @@ function createTypeChecker(host) {
|
|
|
54038
54039
|
return file.moduleName;
|
|
54039
54040
|
}
|
|
54040
54041
|
if (!file) {
|
|
54041
|
-
if (context.tracker.trackReferencedAmbientModule) {
|
|
54042
|
-
const ambientDecls = filter(symbol.declarations, isAmbientModule);
|
|
54043
|
-
if (length(ambientDecls)) {
|
|
54044
|
-
for (const decl of ambientDecls) {
|
|
54045
|
-
context.tracker.trackReferencedAmbientModule(decl, symbol);
|
|
54046
|
-
}
|
|
54047
|
-
}
|
|
54048
|
-
}
|
|
54049
54042
|
if (ambientModuleSymbolRegex.test(symbol.escapedName)) {
|
|
54050
54043
|
return symbol.escapedName.substring(1, symbol.escapedName.length - 1);
|
|
54051
54044
|
}
|
|
@@ -54138,8 +54131,6 @@ function createTypeChecker(host) {
|
|
|
54138
54131
|
}
|
|
54139
54132
|
}
|
|
54140
54133
|
const lit = factory.createLiteralTypeNode(factory.createStringLiteral(specifier));
|
|
54141
|
-
if (context.tracker.trackExternalModuleSymbolOfImportTypeNode)
|
|
54142
|
-
context.tracker.trackExternalModuleSymbolOfImportTypeNode(chain[0]);
|
|
54143
54134
|
context.approximateLength += specifier.length + 10;
|
|
54144
54135
|
if (!nonRootParts || isEntityName(nonRootParts)) {
|
|
54145
54136
|
if (nonRootParts) {
|
|
@@ -54698,18 +54689,6 @@ function createTypeChecker(host) {
|
|
|
54698
54689
|
return factory.createStringLiteral(newName);
|
|
54699
54690
|
}
|
|
54700
54691
|
}
|
|
54701
|
-
} else {
|
|
54702
|
-
if (context.tracker && context.tracker.trackExternalModuleSymbolOfImportTypeNode) {
|
|
54703
|
-
const moduleSym = resolveExternalModuleNameWorker(
|
|
54704
|
-
lit,
|
|
54705
|
-
lit,
|
|
54706
|
-
/*moduleNotFoundError*/
|
|
54707
|
-
void 0
|
|
54708
|
-
);
|
|
54709
|
-
if (moduleSym) {
|
|
54710
|
-
context.tracker.trackExternalModuleSymbolOfImportTypeNode(moduleSym);
|
|
54711
|
-
}
|
|
54712
|
-
}
|
|
54713
54692
|
}
|
|
54714
54693
|
return lit;
|
|
54715
54694
|
}
|
|
@@ -85274,19 +85253,21 @@ function createTypeChecker(host) {
|
|
|
85274
85253
|
if (!(nodeLinks2.flags & 1024 /* EnumValuesComputed */)) {
|
|
85275
85254
|
nodeLinks2.flags |= 1024 /* EnumValuesComputed */;
|
|
85276
85255
|
let autoValue = 0;
|
|
85256
|
+
let previous;
|
|
85277
85257
|
for (const member of node.members) {
|
|
85278
|
-
const value = computeMemberValue(member, autoValue);
|
|
85258
|
+
const value = computeMemberValue(member, autoValue, previous);
|
|
85279
85259
|
getNodeLinks(member).enumMemberValue = value;
|
|
85280
85260
|
autoValue = typeof value === "number" ? value + 1 : void 0;
|
|
85261
|
+
previous = member;
|
|
85281
85262
|
}
|
|
85282
85263
|
}
|
|
85283
85264
|
}
|
|
85284
|
-
function computeMemberValue(member, autoValue) {
|
|
85265
|
+
function computeMemberValue(member, autoValue, previous) {
|
|
85285
85266
|
if (isComputedNonLiteralName(member.name)) {
|
|
85286
85267
|
error2(member.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums);
|
|
85287
85268
|
} else {
|
|
85288
85269
|
const text = getTextOfPropertyName(member.name);
|
|
85289
|
-
if (isNumericLiteralName(text)) {
|
|
85270
|
+
if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) {
|
|
85290
85271
|
error2(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name);
|
|
85291
85272
|
}
|
|
85292
85273
|
}
|
|
@@ -85296,11 +85277,17 @@ function createTypeChecker(host) {
|
|
|
85296
85277
|
if (member.parent.flags & 33554432 /* Ambient */ && !isEnumConst(member.parent)) {
|
|
85297
85278
|
return void 0;
|
|
85298
85279
|
}
|
|
85299
|
-
if (autoValue
|
|
85300
|
-
|
|
85280
|
+
if (autoValue === void 0) {
|
|
85281
|
+
error2(member.name, Diagnostics.Enum_member_must_have_initializer);
|
|
85282
|
+
return void 0;
|
|
85301
85283
|
}
|
|
85302
|
-
|
|
85303
|
-
|
|
85284
|
+
if (getIsolatedModules(compilerOptions) && (previous == null ? void 0 : previous.initializer) && !isSyntacticallyNumericConstant(previous.initializer)) {
|
|
85285
|
+
error2(
|
|
85286
|
+
member.name,
|
|
85287
|
+
Diagnostics.Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled
|
|
85288
|
+
);
|
|
85289
|
+
}
|
|
85290
|
+
return autoValue;
|
|
85304
85291
|
}
|
|
85305
85292
|
function computeConstantValue(member) {
|
|
85306
85293
|
const isConstEnum = isEnumConst(member.parent);
|
|
@@ -85312,6 +85299,12 @@ function createTypeChecker(host) {
|
|
|
85312
85299
|
initializer,
|
|
85313
85300
|
isNaN(value) ? Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN : Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value
|
|
85314
85301
|
);
|
|
85302
|
+
} else if (getIsolatedModules(compilerOptions) && typeof value === "string" && !isSyntacticallyString(initializer)) {
|
|
85303
|
+
error2(
|
|
85304
|
+
initializer,
|
|
85305
|
+
Diagnostics._0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is_enabled,
|
|
85306
|
+
`${idText(member.parent.name)}.${getTextOfPropertyName(member.name)}`
|
|
85307
|
+
);
|
|
85315
85308
|
}
|
|
85316
85309
|
} else if (isConstEnum) {
|
|
85317
85310
|
error2(initializer, Diagnostics.const_enum_member_initializers_must_be_constant_expressions);
|
|
@@ -85322,6 +85315,18 @@ function createTypeChecker(host) {
|
|
|
85322
85315
|
}
|
|
85323
85316
|
return value;
|
|
85324
85317
|
}
|
|
85318
|
+
function isSyntacticallyNumericConstant(expr) {
|
|
85319
|
+
expr = skipOuterExpressions(expr);
|
|
85320
|
+
switch (expr.kind) {
|
|
85321
|
+
case 224 /* PrefixUnaryExpression */:
|
|
85322
|
+
return isSyntacticallyNumericConstant(expr.operand);
|
|
85323
|
+
case 226 /* BinaryExpression */:
|
|
85324
|
+
return isSyntacticallyNumericConstant(expr.left) && isSyntacticallyNumericConstant(expr.right);
|
|
85325
|
+
case 9 /* NumericLiteral */:
|
|
85326
|
+
return true;
|
|
85327
|
+
}
|
|
85328
|
+
return false;
|
|
85329
|
+
}
|
|
85325
85330
|
function evaluate(expr, location) {
|
|
85326
85331
|
switch (expr.kind) {
|
|
85327
85332
|
case 224 /* PrefixUnaryExpression */:
|
|
@@ -87351,23 +87356,6 @@ function createTypeChecker(host) {
|
|
|
87351
87356
|
const isPropertyName2 = (isPropertyAccessExpression(parent2) || isPropertyAssignment(parent2)) && parent2.name === node;
|
|
87352
87357
|
return !isPropertyName2 && getReferencedValueSymbol(node) === argumentsSymbol;
|
|
87353
87358
|
}
|
|
87354
|
-
function moduleExportsSomeValue(moduleReferenceExpression) {
|
|
87355
|
-
let moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression);
|
|
87356
|
-
if (!moduleSymbol || isShorthandAmbientModuleSymbol(moduleSymbol)) {
|
|
87357
|
-
return true;
|
|
87358
|
-
}
|
|
87359
|
-
const hasExportAssignment = hasExportAssignmentSymbol(moduleSymbol);
|
|
87360
|
-
moduleSymbol = resolveExternalModuleSymbol(moduleSymbol);
|
|
87361
|
-
const symbolLinks2 = getSymbolLinks(moduleSymbol);
|
|
87362
|
-
if (symbolLinks2.exportsSomeValue === void 0) {
|
|
87363
|
-
symbolLinks2.exportsSomeValue = hasExportAssignment ? !!(moduleSymbol.flags & 111551 /* Value */) : forEachEntry(getExportsOfModule(moduleSymbol), isValue);
|
|
87364
|
-
}
|
|
87365
|
-
return symbolLinks2.exportsSomeValue;
|
|
87366
|
-
function isValue(s) {
|
|
87367
|
-
s = resolveSymbol(s);
|
|
87368
|
-
return s && !!(getSymbolFlags(s) & 111551 /* Value */);
|
|
87369
|
-
}
|
|
87370
|
-
}
|
|
87371
87359
|
function isNameOfModuleOrEnumDeclaration(node) {
|
|
87372
87360
|
return isModuleOrEnumDeclaration(node.parent) && node === node.parent.name;
|
|
87373
87361
|
}
|
|
@@ -87944,20 +87932,6 @@ function createTypeChecker(host) {
|
|
|
87944
87932
|
}
|
|
87945
87933
|
}
|
|
87946
87934
|
function createResolver() {
|
|
87947
|
-
const resolvedTypeReferenceDirectives = host.getResolvedTypeReferenceDirectives();
|
|
87948
|
-
let fileToDirective;
|
|
87949
|
-
if (resolvedTypeReferenceDirectives) {
|
|
87950
|
-
fileToDirective = /* @__PURE__ */ new Map();
|
|
87951
|
-
resolvedTypeReferenceDirectives.forEach(({ resolvedTypeReferenceDirective }, key, mode) => {
|
|
87952
|
-
if (!(resolvedTypeReferenceDirective == null ? void 0 : resolvedTypeReferenceDirective.resolvedFileName)) {
|
|
87953
|
-
return;
|
|
87954
|
-
}
|
|
87955
|
-
const file = host.getSourceFile(resolvedTypeReferenceDirective.resolvedFileName);
|
|
87956
|
-
if (file) {
|
|
87957
|
-
addReferencedFilesToTypeDirective(file, key, mode);
|
|
87958
|
-
}
|
|
87959
|
-
});
|
|
87960
|
-
}
|
|
87961
87935
|
return {
|
|
87962
87936
|
getReferencedExportContainer,
|
|
87963
87937
|
getReferencedImportDeclaration,
|
|
@@ -87997,14 +87971,11 @@ function createTypeChecker(host) {
|
|
|
87997
87971
|
getReferencedValueDeclarations,
|
|
87998
87972
|
getTypeReferenceSerializationKind,
|
|
87999
87973
|
isOptionalParameter,
|
|
88000
|
-
moduleExportsSomeValue,
|
|
88001
87974
|
isArgumentsLocalBinding,
|
|
88002
87975
|
getExternalModuleFileFromDeclaration: (nodeIn) => {
|
|
88003
87976
|
const node = getParseTreeNode(nodeIn, hasPossibleExternalModuleReference);
|
|
88004
87977
|
return node && getExternalModuleFileFromDeclaration(node);
|
|
88005
87978
|
},
|
|
88006
|
-
getTypeReferenceDirectivesForEntityName,
|
|
88007
|
-
getTypeReferenceDirectivesForSymbol,
|
|
88008
87979
|
isLiteralConstDeclaration,
|
|
88009
87980
|
isLateBound: (nodeIn) => {
|
|
88010
87981
|
const node = getParseTreeNode(nodeIn, isDeclaration);
|
|
@@ -88028,12 +87999,6 @@ function createTypeChecker(host) {
|
|
|
88028
87999
|
getAccessor
|
|
88029
88000
|
};
|
|
88030
88001
|
},
|
|
88031
|
-
getSymbolOfExternalModuleSpecifier: (moduleName) => resolveExternalModuleNameWorker(
|
|
88032
|
-
moduleName,
|
|
88033
|
-
moduleName,
|
|
88034
|
-
/*moduleNotFoundError*/
|
|
88035
|
-
void 0
|
|
88036
|
-
),
|
|
88037
88002
|
isBindingCapturedByNode: (node, decl) => {
|
|
88038
88003
|
const parseNode = getParseTreeNode(node);
|
|
88039
88004
|
const parseDecl = getParseTreeNode(decl);
|
|
@@ -88048,16 +88013,7 @@ function createTypeChecker(host) {
|
|
|
88048
88013
|
}
|
|
88049
88014
|
return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, tracker, bundled);
|
|
88050
88015
|
},
|
|
88051
|
-
isImportRequiredByAugmentation
|
|
88052
|
-
tryFindAmbientModule: (moduleReferenceExpression) => {
|
|
88053
|
-
const node = getParseTreeNode(moduleReferenceExpression);
|
|
88054
|
-
const moduleSpecifier = node && isStringLiteralLike(node) ? node.text : void 0;
|
|
88055
|
-
return moduleSpecifier !== void 0 ? tryFindAmbientModule(
|
|
88056
|
-
moduleSpecifier,
|
|
88057
|
-
/*withAugmentations*/
|
|
88058
|
-
true
|
|
88059
|
-
) : void 0;
|
|
88060
|
-
}
|
|
88016
|
+
isImportRequiredByAugmentation
|
|
88061
88017
|
};
|
|
88062
88018
|
function isImportRequiredByAugmentation(node) {
|
|
88063
88019
|
const file = getSourceFileOfNode(node);
|
|
@@ -88084,84 +88040,6 @@ function createTypeChecker(host) {
|
|
|
88084
88040
|
}
|
|
88085
88041
|
return false;
|
|
88086
88042
|
}
|
|
88087
|
-
function isInHeritageClause(node) {
|
|
88088
|
-
return node.parent && node.parent.kind === 233 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 298 /* HeritageClause */;
|
|
88089
|
-
}
|
|
88090
|
-
function getTypeReferenceDirectivesForEntityName(node) {
|
|
88091
|
-
if (!fileToDirective) {
|
|
88092
|
-
return void 0;
|
|
88093
|
-
}
|
|
88094
|
-
let meaning;
|
|
88095
|
-
if (node.parent.kind === 167 /* ComputedPropertyName */) {
|
|
88096
|
-
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
|
|
88097
|
-
} else {
|
|
88098
|
-
meaning = 788968 /* Type */ | 1920 /* Namespace */;
|
|
88099
|
-
if (node.kind === 80 /* Identifier */ && isInTypeQuery(node) || node.kind === 211 /* PropertyAccessExpression */ && !isInHeritageClause(node)) {
|
|
88100
|
-
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
|
|
88101
|
-
}
|
|
88102
|
-
}
|
|
88103
|
-
const symbol = resolveEntityName(
|
|
88104
|
-
node,
|
|
88105
|
-
meaning,
|
|
88106
|
-
/*ignoreErrors*/
|
|
88107
|
-
true
|
|
88108
|
-
);
|
|
88109
|
-
return symbol && symbol !== unknownSymbol ? getTypeReferenceDirectivesForSymbol(symbol, meaning) : void 0;
|
|
88110
|
-
}
|
|
88111
|
-
function getTypeReferenceDirectivesForSymbol(symbol, meaning) {
|
|
88112
|
-
if (!fileToDirective || !isSymbolFromTypeDeclarationFile(symbol)) {
|
|
88113
|
-
return void 0;
|
|
88114
|
-
}
|
|
88115
|
-
let typeReferenceDirectives;
|
|
88116
|
-
for (const decl of symbol.declarations) {
|
|
88117
|
-
if (decl.symbol && decl.symbol.flags & meaning) {
|
|
88118
|
-
const file = getSourceFileOfNode(decl);
|
|
88119
|
-
const typeReferenceDirective = fileToDirective.get(file.path);
|
|
88120
|
-
if (typeReferenceDirective) {
|
|
88121
|
-
(typeReferenceDirectives || (typeReferenceDirectives = [])).push(typeReferenceDirective);
|
|
88122
|
-
} else {
|
|
88123
|
-
return void 0;
|
|
88124
|
-
}
|
|
88125
|
-
}
|
|
88126
|
-
}
|
|
88127
|
-
return typeReferenceDirectives;
|
|
88128
|
-
}
|
|
88129
|
-
function isSymbolFromTypeDeclarationFile(symbol) {
|
|
88130
|
-
if (!symbol.declarations) {
|
|
88131
|
-
return false;
|
|
88132
|
-
}
|
|
88133
|
-
let current = symbol;
|
|
88134
|
-
while (true) {
|
|
88135
|
-
const parent2 = getParentOfSymbol(current);
|
|
88136
|
-
if (parent2) {
|
|
88137
|
-
current = parent2;
|
|
88138
|
-
} else {
|
|
88139
|
-
break;
|
|
88140
|
-
}
|
|
88141
|
-
}
|
|
88142
|
-
if (current.valueDeclaration && current.valueDeclaration.kind === 307 /* SourceFile */ && current.flags & 512 /* ValueModule */) {
|
|
88143
|
-
return false;
|
|
88144
|
-
}
|
|
88145
|
-
for (const decl of symbol.declarations) {
|
|
88146
|
-
const file = getSourceFileOfNode(decl);
|
|
88147
|
-
if (fileToDirective.has(file.path)) {
|
|
88148
|
-
return true;
|
|
88149
|
-
}
|
|
88150
|
-
}
|
|
88151
|
-
return false;
|
|
88152
|
-
}
|
|
88153
|
-
function addReferencedFilesToTypeDirective(file, key, mode) {
|
|
88154
|
-
if (fileToDirective.has(file.path))
|
|
88155
|
-
return;
|
|
88156
|
-
fileToDirective.set(file.path, [key, mode]);
|
|
88157
|
-
for (const { fileName } of file.referencedFiles) {
|
|
88158
|
-
const resolvedFile = resolveTripleslashReference(fileName, file.fileName);
|
|
88159
|
-
const referencedFile = host.getSourceFile(resolvedFile);
|
|
88160
|
-
if (referencedFile) {
|
|
88161
|
-
addReferencedFilesToTypeDirective(referencedFile, key, mode || file.impliedNodeFormat);
|
|
88162
|
-
}
|
|
88163
|
-
}
|
|
88164
|
-
}
|
|
88165
88043
|
}
|
|
88166
88044
|
function getExternalModuleFileFromDeclaration(declaration) {
|
|
88167
88045
|
const specifier = declaration.kind === 267 /* ModuleDeclaration */ ? tryCast(declaration.name, isStringLiteral) : getExternalModuleName(declaration);
|
|
@@ -90085,20 +89963,6 @@ var SymbolTrackerImpl = class _SymbolTrackerImpl {
|
|
|
90085
89963
|
this.inner.reportTruncationError();
|
|
90086
89964
|
}
|
|
90087
89965
|
}
|
|
90088
|
-
trackReferencedAmbientModule(decl, symbol) {
|
|
90089
|
-
var _a;
|
|
90090
|
-
if ((_a = this.inner) == null ? void 0 : _a.trackReferencedAmbientModule) {
|
|
90091
|
-
this.onDiagnosticReported();
|
|
90092
|
-
this.inner.trackReferencedAmbientModule(decl, symbol);
|
|
90093
|
-
}
|
|
90094
|
-
}
|
|
90095
|
-
trackExternalModuleSymbolOfImportTypeNode(symbol) {
|
|
90096
|
-
var _a;
|
|
90097
|
-
if ((_a = this.inner) == null ? void 0 : _a.trackExternalModuleSymbolOfImportTypeNode) {
|
|
90098
|
-
this.onDiagnosticReported();
|
|
90099
|
-
this.inner.trackExternalModuleSymbolOfImportTypeNode(symbol);
|
|
90100
|
-
}
|
|
90101
|
-
}
|
|
90102
89966
|
reportNonlocalAugmentation(containingFile, parentSymbol, augmentingSymbol) {
|
|
90103
89967
|
var _a;
|
|
90104
89968
|
if ((_a = this.inner) == null ? void 0 : _a.reportNonlocalAugmentation) {
|
|
@@ -113290,11 +113154,9 @@ function transformDeclarations(context) {
|
|
|
113290
113154
|
let needsScopeFixMarker = false;
|
|
113291
113155
|
let resultHasScopeMarker = false;
|
|
113292
113156
|
let enclosingDeclaration;
|
|
113293
|
-
let necessaryTypeReferences;
|
|
113294
113157
|
let lateMarkedStatements;
|
|
113295
113158
|
let lateStatementReplacementMap;
|
|
113296
113159
|
let suppressNewDiagnosticContexts;
|
|
113297
|
-
let exportedModulesFromDeclarationEmit;
|
|
113298
113160
|
const { factory: factory2 } = context;
|
|
113299
113161
|
const host = context.getEmitHost();
|
|
113300
113162
|
const symbolTracker = {
|
|
@@ -113306,49 +113168,19 @@ function transformDeclarations(context) {
|
|
|
113306
113168
|
reportLikelyUnsafeImportRequiredError,
|
|
113307
113169
|
reportTruncationError,
|
|
113308
113170
|
moduleResolverHost: host,
|
|
113309
|
-
trackReferencedAmbientModule,
|
|
113310
|
-
trackExternalModuleSymbolOfImportTypeNode,
|
|
113311
113171
|
reportNonlocalAugmentation,
|
|
113312
113172
|
reportNonSerializableProperty
|
|
113313
113173
|
};
|
|
113314
113174
|
let errorNameNode;
|
|
113315
113175
|
let errorFallbackNode;
|
|
113316
113176
|
let currentSourceFile;
|
|
113317
|
-
let
|
|
113318
|
-
let
|
|
113319
|
-
let
|
|
113177
|
+
let rawReferencedFiles;
|
|
113178
|
+
let rawTypeReferenceDirectives;
|
|
113179
|
+
let rawLibReferenceDirectives;
|
|
113320
113180
|
const resolver = context.getEmitResolver();
|
|
113321
113181
|
const options = context.getCompilerOptions();
|
|
113322
|
-
const {
|
|
113182
|
+
const { stripInternal } = options;
|
|
113323
113183
|
return transformRoot;
|
|
113324
|
-
function recordTypeReferenceDirectivesIfNecessary(typeReferenceDirectives) {
|
|
113325
|
-
if (!typeReferenceDirectives) {
|
|
113326
|
-
return;
|
|
113327
|
-
}
|
|
113328
|
-
necessaryTypeReferences = necessaryTypeReferences || /* @__PURE__ */ new Set();
|
|
113329
|
-
for (const ref of typeReferenceDirectives) {
|
|
113330
|
-
necessaryTypeReferences.add(ref);
|
|
113331
|
-
}
|
|
113332
|
-
}
|
|
113333
|
-
function trackReferencedAmbientModule(node, symbol) {
|
|
113334
|
-
const directives = resolver.getTypeReferenceDirectivesForSymbol(symbol, -1 /* All */);
|
|
113335
|
-
if (length(directives)) {
|
|
113336
|
-
return recordTypeReferenceDirectivesIfNecessary(directives);
|
|
113337
|
-
}
|
|
113338
|
-
const container = getSourceFileOfNode(node);
|
|
113339
|
-
refs.set(getOriginalNodeId(container), container);
|
|
113340
|
-
}
|
|
113341
|
-
function trackReferencedAmbientModuleFromImport(node) {
|
|
113342
|
-
const moduleSpecifier = tryGetModuleSpecifierFromDeclaration(node);
|
|
113343
|
-
const symbol = moduleSpecifier && resolver.tryFindAmbientModule(moduleSpecifier);
|
|
113344
|
-
if (symbol == null ? void 0 : symbol.declarations) {
|
|
113345
|
-
for (const decl of symbol.declarations) {
|
|
113346
|
-
if (isAmbientModule(decl) && getSourceFileOfNode(decl) !== currentSourceFile) {
|
|
113347
|
-
trackReferencedAmbientModule(decl, symbol);
|
|
113348
|
-
}
|
|
113349
|
-
}
|
|
113350
|
-
}
|
|
113351
|
-
}
|
|
113352
113184
|
function handleSymbolAccessibilityError(symbolAccessibilityResult) {
|
|
113353
113185
|
if (symbolAccessibilityResult.accessibility === 0 /* Accessible */) {
|
|
113354
113186
|
if (symbolAccessibilityResult.aliasesToMakeVisible) {
|
|
@@ -113373,11 +113205,6 @@ function transformDeclarations(context) {
|
|
|
113373
113205
|
}
|
|
113374
113206
|
return false;
|
|
113375
113207
|
}
|
|
113376
|
-
function trackExternalModuleSymbolOfImportTypeNode(symbol) {
|
|
113377
|
-
if (!isBundledEmit) {
|
|
113378
|
-
(exportedModulesFromDeclarationEmit || (exportedModulesFromDeclarationEmit = [])).push(symbol);
|
|
113379
|
-
}
|
|
113380
|
-
}
|
|
113381
113208
|
function trackSymbol(symbol, enclosingDeclaration2, meaning) {
|
|
113382
113209
|
if (symbol.flags & 262144 /* TypeParameter */)
|
|
113383
113210
|
return false;
|
|
@@ -113388,7 +113215,6 @@ function transformDeclarations(context) {
|
|
|
113388
113215
|
/*shouldComputeAliasToMarkVisible*/
|
|
113389
113216
|
true
|
|
113390
113217
|
));
|
|
113391
|
-
recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForSymbol(symbol, meaning));
|
|
113392
113218
|
return issuedDiagnostic;
|
|
113393
113219
|
}
|
|
113394
113220
|
function reportPrivateInBaseOfClassExpression(propertyName) {
|
|
@@ -113460,8 +113286,9 @@ function transformDeclarations(context) {
|
|
|
113460
113286
|
}
|
|
113461
113287
|
if (node.kind === 308 /* Bundle */) {
|
|
113462
113288
|
isBundledEmit = true;
|
|
113463
|
-
|
|
113464
|
-
|
|
113289
|
+
rawReferencedFiles = [];
|
|
113290
|
+
rawTypeReferenceDirectives = [];
|
|
113291
|
+
rawLibReferenceDirectives = [];
|
|
113465
113292
|
let hasNoDefaultLib = false;
|
|
113466
113293
|
const bundle = factory2.createBundle(
|
|
113467
113294
|
map(node.sourceFiles, (sourceFile) => {
|
|
@@ -113476,8 +113303,7 @@ function transformDeclarations(context) {
|
|
|
113476
113303
|
getSymbolAccessibilityDiagnostic = throwDiagnostic;
|
|
113477
113304
|
needsScopeFixMarker = false;
|
|
113478
113305
|
resultHasScopeMarker = false;
|
|
113479
|
-
|
|
113480
|
-
collectLibs(sourceFile, libs2);
|
|
113306
|
+
collectFileReferences(sourceFile);
|
|
113481
113307
|
if (isExternalOrCommonJsModule(sourceFile) || isJsonSourceFile(sourceFile)) {
|
|
113482
113308
|
resultHasExternalModuleIndicator = false;
|
|
113483
113309
|
needsDeclare = false;
|
|
@@ -113524,18 +113350,16 @@ function transformDeclarations(context) {
|
|
|
113524
113350
|
);
|
|
113525
113351
|
})
|
|
113526
113352
|
);
|
|
113527
|
-
bundle.syntheticFileReferences = [];
|
|
113528
|
-
bundle.syntheticTypeReferences = getFileReferencesForUsedTypeReferences();
|
|
113529
|
-
bundle.syntheticLibReferences = getLibReferences();
|
|
113530
|
-
bundle.hasNoDefaultLib = hasNoDefaultLib;
|
|
113531
113353
|
const outputFilePath2 = getDirectoryPath(normalizeSlashes(getOutputPathsFor(
|
|
113532
113354
|
node,
|
|
113533
113355
|
host,
|
|
113534
113356
|
/*forceDtsPaths*/
|
|
113535
113357
|
true
|
|
113536
113358
|
).declarationFilePath));
|
|
113537
|
-
|
|
113538
|
-
|
|
113359
|
+
bundle.syntheticFileReferences = getReferencedFiles(outputFilePath2);
|
|
113360
|
+
bundle.syntheticTypeReferences = getTypeReferences();
|
|
113361
|
+
bundle.syntheticLibReferences = getLibReferences();
|
|
113362
|
+
bundle.hasNoDefaultLib = hasNoDefaultLib;
|
|
113539
113363
|
return bundle;
|
|
113540
113364
|
}
|
|
113541
113365
|
needsDeclare = true;
|
|
@@ -113549,66 +113373,68 @@ function transformDeclarations(context) {
|
|
|
113549
113373
|
suppressNewDiagnosticContexts = false;
|
|
113550
113374
|
lateMarkedStatements = void 0;
|
|
113551
113375
|
lateStatementReplacementMap = /* @__PURE__ */ new Map();
|
|
113552
|
-
|
|
113553
|
-
|
|
113554
|
-
|
|
113555
|
-
|
|
113556
|
-
const outputFilePath = getDirectoryPath(normalizeSlashes(getOutputPathsFor(
|
|
113557
|
-
node,
|
|
113558
|
-
host,
|
|
113559
|
-
/*forceDtsPaths*/
|
|
113560
|
-
true
|
|
113561
|
-
).declarationFilePath));
|
|
113562
|
-
const referenceVisitor = mapReferencesIntoArray(references, outputFilePath);
|
|
113376
|
+
rawReferencedFiles = [];
|
|
113377
|
+
rawTypeReferenceDirectives = [];
|
|
113378
|
+
rawLibReferenceDirectives = [];
|
|
113379
|
+
collectFileReferences(currentSourceFile);
|
|
113563
113380
|
let combinedStatements;
|
|
113564
113381
|
if (isSourceFileJS(currentSourceFile)) {
|
|
113565
113382
|
combinedStatements = factory2.createNodeArray(transformDeclarationsForJS(node));
|
|
113566
|
-
refs.forEach(referenceVisitor);
|
|
113567
|
-
emittedImports = filter(combinedStatements, isAnyImportSyntax);
|
|
113568
113383
|
} else {
|
|
113569
113384
|
const statements = visitNodes2(node.statements, visitDeclarationStatements, isStatement);
|
|
113570
113385
|
combinedStatements = setTextRange(factory2.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), node.statements);
|
|
113571
|
-
refs.forEach(referenceVisitor);
|
|
113572
|
-
emittedImports = filter(combinedStatements, isAnyImportSyntax);
|
|
113573
113386
|
if (isExternalModule(node) && (!resultHasExternalModuleIndicator || needsScopeFixMarker && !resultHasScopeMarker)) {
|
|
113574
113387
|
combinedStatements = setTextRange(factory2.createNodeArray([...combinedStatements, createEmptyExports(factory2)]), combinedStatements);
|
|
113575
113388
|
}
|
|
113576
113389
|
}
|
|
113390
|
+
const outputFilePath = getDirectoryPath(normalizeSlashes(getOutputPathsFor(
|
|
113391
|
+
node,
|
|
113392
|
+
host,
|
|
113393
|
+
/*forceDtsPaths*/
|
|
113394
|
+
true
|
|
113395
|
+
).declarationFilePath));
|
|
113577
113396
|
return factory2.updateSourceFile(
|
|
113578
113397
|
node,
|
|
113579
113398
|
combinedStatements,
|
|
113580
113399
|
/*isDeclarationFile*/
|
|
113581
113400
|
true,
|
|
113582
|
-
|
|
113583
|
-
|
|
113401
|
+
getReferencedFiles(outputFilePath),
|
|
113402
|
+
getTypeReferences(),
|
|
113584
113403
|
node.hasNoDefaultLib,
|
|
113585
113404
|
getLibReferences()
|
|
113586
113405
|
);
|
|
113587
|
-
function
|
|
113588
|
-
|
|
113406
|
+
function collectFileReferences(sourceFile) {
|
|
113407
|
+
rawReferencedFiles = concatenate(rawReferencedFiles, map(sourceFile.referencedFiles, (f) => [sourceFile, f]));
|
|
113408
|
+
rawTypeReferenceDirectives = concatenate(rawTypeReferenceDirectives, sourceFile.typeReferenceDirectives);
|
|
113409
|
+
rawLibReferenceDirectives = concatenate(rawLibReferenceDirectives, sourceFile.libReferenceDirectives);
|
|
113589
113410
|
}
|
|
113590
|
-
function
|
|
113591
|
-
|
|
113411
|
+
function copyFileReferenceAsSynthetic(ref) {
|
|
113412
|
+
const newRef = { ...ref };
|
|
113413
|
+
newRef.pos = -1;
|
|
113414
|
+
newRef.end = -1;
|
|
113415
|
+
return newRef;
|
|
113592
113416
|
}
|
|
113593
|
-
function
|
|
113594
|
-
|
|
113595
|
-
|
|
113596
|
-
|
|
113597
|
-
|
|
113598
|
-
|
|
113599
|
-
return void 0;
|
|
113600
|
-
}
|
|
113601
|
-
} else if (isImportDeclaration(importStatement) && isStringLiteral(importStatement.moduleSpecifier) && importStatement.moduleSpecifier.text === typeName) {
|
|
113602
|
-
return void 0;
|
|
113603
|
-
}
|
|
113604
|
-
}
|
|
113605
|
-
}
|
|
113606
|
-
return { fileName: typeName, pos: -1, end: -1, ...mode ? { resolutionMode: mode } : void 0 };
|
|
113417
|
+
function getTypeReferences() {
|
|
113418
|
+
return mapDefined(rawTypeReferenceDirectives, (ref) => {
|
|
113419
|
+
if (!ref.preserve)
|
|
113420
|
+
return void 0;
|
|
113421
|
+
return copyFileReferenceAsSynthetic(ref);
|
|
113422
|
+
});
|
|
113607
113423
|
}
|
|
113608
|
-
function
|
|
113609
|
-
return (
|
|
113610
|
-
if (
|
|
113611
|
-
return;
|
|
113424
|
+
function getLibReferences() {
|
|
113425
|
+
return mapDefined(rawLibReferenceDirectives, (ref) => {
|
|
113426
|
+
if (!ref.preserve)
|
|
113427
|
+
return void 0;
|
|
113428
|
+
return copyFileReferenceAsSynthetic(ref);
|
|
113429
|
+
});
|
|
113430
|
+
}
|
|
113431
|
+
function getReferencedFiles(outputFilePath2) {
|
|
113432
|
+
return mapDefined(rawReferencedFiles, ([sourceFile, ref]) => {
|
|
113433
|
+
if (!ref.preserve)
|
|
113434
|
+
return void 0;
|
|
113435
|
+
const file = host.getSourceFileFromReference(sourceFile, ref);
|
|
113436
|
+
if (!file) {
|
|
113437
|
+
return void 0;
|
|
113612
113438
|
}
|
|
113613
113439
|
let declFileName;
|
|
113614
113440
|
if (file.isDeclarationFile) {
|
|
@@ -113624,61 +113450,22 @@ function transformDeclarations(context) {
|
|
|
113624
113450
|
);
|
|
113625
113451
|
declFileName = paths.declarationFilePath || paths.jsFilePath || file.fileName;
|
|
113626
113452
|
}
|
|
113627
|
-
if (declFileName)
|
|
113628
|
-
|
|
113629
|
-
|
|
113630
|
-
|
|
113631
|
-
|
|
113632
|
-
|
|
113633
|
-
|
|
113634
|
-
|
|
113635
|
-
|
|
113636
|
-
|
|
113637
|
-
|
|
113638
|
-
|
|
113639
|
-
|
|
113640
|
-
|
|
113641
|
-
return;
|
|
113642
|
-
}
|
|
113643
|
-
let fileName = getRelativePathToDirectoryOrUrl(
|
|
113644
|
-
outputFilePath2,
|
|
113645
|
-
declFileName,
|
|
113646
|
-
host.getCurrentDirectory(),
|
|
113647
|
-
host.getCanonicalFileName,
|
|
113648
|
-
/*isAbsolutePathAnUrl*/
|
|
113649
|
-
false
|
|
113650
|
-
);
|
|
113651
|
-
if (startsWith(fileName, "./") && hasExtension(fileName)) {
|
|
113652
|
-
fileName = fileName.substring(2);
|
|
113653
|
-
}
|
|
113654
|
-
if (startsWith(fileName, "node_modules/") || pathContainsNodeModules(fileName)) {
|
|
113655
|
-
return;
|
|
113656
|
-
}
|
|
113657
|
-
references2.push({ pos: -1, end: -1, fileName });
|
|
113658
|
-
}
|
|
113659
|
-
};
|
|
113453
|
+
if (!declFileName)
|
|
113454
|
+
return void 0;
|
|
113455
|
+
const fileName = getRelativePathToDirectoryOrUrl(
|
|
113456
|
+
outputFilePath2,
|
|
113457
|
+
declFileName,
|
|
113458
|
+
host.getCurrentDirectory(),
|
|
113459
|
+
host.getCanonicalFileName,
|
|
113460
|
+
/*isAbsolutePathAnUrl*/
|
|
113461
|
+
false
|
|
113462
|
+
);
|
|
113463
|
+
const newRef = copyFileReferenceAsSynthetic(ref);
|
|
113464
|
+
newRef.fileName = fileName;
|
|
113465
|
+
return newRef;
|
|
113466
|
+
});
|
|
113660
113467
|
}
|
|
113661
113468
|
}
|
|
113662
|
-
function collectReferences(sourceFile, ret) {
|
|
113663
|
-
if (noResolve || isSourceFileJS(sourceFile))
|
|
113664
|
-
return ret;
|
|
113665
|
-
forEach(sourceFile.referencedFiles, (f) => {
|
|
113666
|
-
const elem = host.getSourceFileFromReference(sourceFile, f);
|
|
113667
|
-
if (elem) {
|
|
113668
|
-
ret.set(getOriginalNodeId(elem), elem);
|
|
113669
|
-
}
|
|
113670
|
-
});
|
|
113671
|
-
return ret;
|
|
113672
|
-
}
|
|
113673
|
-
function collectLibs(sourceFile, ret) {
|
|
113674
|
-
forEach(sourceFile.libReferenceDirectives, (ref) => {
|
|
113675
|
-
const lib = host.getLibFileFromReference(ref);
|
|
113676
|
-
if (lib) {
|
|
113677
|
-
ret.set(toFileNameLowerCase(ref.fileName), true);
|
|
113678
|
-
}
|
|
113679
|
-
});
|
|
113680
|
-
return ret;
|
|
113681
|
-
}
|
|
113682
113469
|
function filterBindingPatternInitializers(name) {
|
|
113683
113470
|
if (name.kind === 80 /* Identifier */) {
|
|
113684
113471
|
return name;
|
|
@@ -113877,7 +113664,6 @@ function transformDeclarations(context) {
|
|
|
113877
113664
|
function checkEntityNameVisibility(entityName, enclosingDeclaration2) {
|
|
113878
113665
|
const visibilityResult = resolver.isEntityNameVisible(entityName, enclosingDeclaration2);
|
|
113879
113666
|
handleSymbolAccessibilityError(visibilityResult);
|
|
113880
|
-
recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForEntityName(entityName));
|
|
113881
113667
|
}
|
|
113882
113668
|
function preserveJsDoc(updated, original) {
|
|
113883
113669
|
if (hasJSDocNodes(updated) && hasJSDocNodes(original)) {
|
|
@@ -113895,11 +113681,6 @@ function transformDeclarations(context) {
|
|
|
113895
113681
|
if (newName) {
|
|
113896
113682
|
return factory2.createStringLiteral(newName);
|
|
113897
113683
|
}
|
|
113898
|
-
} else {
|
|
113899
|
-
const symbol = resolver.getSymbolOfExternalModuleSpecifier(input);
|
|
113900
|
-
if (symbol) {
|
|
113901
|
-
(exportedModulesFromDeclarationEmit || (exportedModulesFromDeclarationEmit = [])).push(symbol);
|
|
113902
|
-
}
|
|
113903
113684
|
}
|
|
113904
113685
|
}
|
|
113905
113686
|
return input;
|
|
@@ -114292,7 +114073,6 @@ function transformDeclarations(context) {
|
|
|
114292
114073
|
case 205 /* ImportType */: {
|
|
114293
114074
|
if (!isLiteralImportTypeNode(input))
|
|
114294
114075
|
return cleanup(input);
|
|
114295
|
-
trackReferencedAmbientModuleFromImport(input);
|
|
114296
114076
|
return cleanup(factory2.updateImportTypeNode(
|
|
114297
114077
|
input,
|
|
114298
114078
|
factory2.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)),
|
|
@@ -114344,7 +114124,6 @@ function transformDeclarations(context) {
|
|
|
114344
114124
|
resultHasExternalModuleIndicator = true;
|
|
114345
114125
|
}
|
|
114346
114126
|
resultHasScopeMarker = true;
|
|
114347
|
-
trackReferencedAmbientModuleFromImport(input);
|
|
114348
114127
|
return factory2.updateExportDeclaration(
|
|
114349
114128
|
input,
|
|
114350
114129
|
input.modifiers,
|
|
@@ -114419,18 +114198,10 @@ function transformDeclarations(context) {
|
|
|
114419
114198
|
return;
|
|
114420
114199
|
switch (input.kind) {
|
|
114421
114200
|
case 271 /* ImportEqualsDeclaration */: {
|
|
114422
|
-
|
|
114423
|
-
if (transformed) {
|
|
114424
|
-
trackReferencedAmbientModuleFromImport(input);
|
|
114425
|
-
}
|
|
114426
|
-
return transformed;
|
|
114201
|
+
return transformImportEqualsDeclaration(input);
|
|
114427
114202
|
}
|
|
114428
114203
|
case 272 /* ImportDeclaration */: {
|
|
114429
|
-
|
|
114430
|
-
if (transformed) {
|
|
114431
|
-
trackReferencedAmbientModuleFromImport(input);
|
|
114432
|
-
}
|
|
114433
|
-
return transformed;
|
|
114204
|
+
return transformImportDeclaration(input);
|
|
114434
114205
|
}
|
|
114435
114206
|
}
|
|
114436
114207
|
if (isDeclaration(input) && isDeclarationAndNotVisible(input))
|
|
@@ -116000,20 +115771,15 @@ var notImplementedResolver = {
|
|
|
116000
115771
|
getReferencedValueDeclarations: notImplemented,
|
|
116001
115772
|
getTypeReferenceSerializationKind: notImplemented,
|
|
116002
115773
|
isOptionalParameter: notImplemented,
|
|
116003
|
-
moduleExportsSomeValue: notImplemented,
|
|
116004
115774
|
isArgumentsLocalBinding: notImplemented,
|
|
116005
115775
|
getExternalModuleFileFromDeclaration: notImplemented,
|
|
116006
|
-
getTypeReferenceDirectivesForEntityName: notImplemented,
|
|
116007
|
-
getTypeReferenceDirectivesForSymbol: notImplemented,
|
|
116008
115776
|
isLiteralConstDeclaration: notImplemented,
|
|
116009
115777
|
getJsxFactoryEntity: notImplemented,
|
|
116010
115778
|
getJsxFragmentFactoryEntity: notImplemented,
|
|
116011
115779
|
getAllAccessorDeclarations: notImplemented,
|
|
116012
|
-
getSymbolOfExternalModuleSpecifier: notImplemented,
|
|
116013
115780
|
isBindingCapturedByNode: notImplemented,
|
|
116014
115781
|
getDeclarationStatementsForSourceFile: notImplemented,
|
|
116015
|
-
isImportRequiredByAugmentation: notImplemented
|
|
116016
|
-
tryFindAmbientModule: notImplemented
|
|
115782
|
+
isImportRequiredByAugmentation: notImplemented
|
|
116017
115783
|
};
|
|
116018
115784
|
var createPrinterWithDefaults = /* @__PURE__ */ memoize(() => createPrinter({}));
|
|
116019
115785
|
var createPrinterWithRemoveComments = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true }));
|
|
@@ -118768,19 +118534,17 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
118768
118534
|
writeLine();
|
|
118769
118535
|
}
|
|
118770
118536
|
}
|
|
118771
|
-
|
|
118772
|
-
|
|
118773
|
-
|
|
118774
|
-
|
|
118775
|
-
|
|
118776
|
-
|
|
118777
|
-
|
|
118778
|
-
writeLine();
|
|
118779
|
-
}
|
|
118780
|
-
for (const directive of libs2) {
|
|
118781
|
-
writeComment(`/// <reference lib="${directive.fileName}" />`);
|
|
118782
|
-
writeLine();
|
|
118537
|
+
function writeDirectives(kind, directives) {
|
|
118538
|
+
for (const directive of directives) {
|
|
118539
|
+
const preserve = directive.preserve ? `preserve="true" ` : "";
|
|
118540
|
+
const resolutionMode = directive.resolutionMode && directive.resolutionMode !== (currentSourceFile == null ? void 0 : currentSourceFile.impliedNodeFormat) ? `resolution-mode="${directive.resolutionMode === 99 /* ESNext */ ? "import" : "require"}" ` : "";
|
|
118541
|
+
writeComment(`/// <reference ${kind}="${directive.fileName}" ${resolutionMode}${preserve}/>`);
|
|
118542
|
+
writeLine();
|
|
118543
|
+
}
|
|
118783
118544
|
}
|
|
118545
|
+
writeDirectives("path", files);
|
|
118546
|
+
writeDirectives("types", types);
|
|
118547
|
+
writeDirectives("lib", libs2);
|
|
118784
118548
|
}
|
|
118785
118549
|
function emitSourceFileWorker(node) {
|
|
118786
118550
|
const statements = node.statements;
|
|
@@ -122660,7 +122424,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
122660
122424
|
getSourceFile: program.getSourceFile,
|
|
122661
122425
|
getSourceFileByPath: program.getSourceFileByPath,
|
|
122662
122426
|
getSourceFiles: program.getSourceFiles,
|
|
122663
|
-
getLibFileFromReference: program.getLibFileFromReference,
|
|
122664
122427
|
isSourceFileFromExternalLibrary,
|
|
122665
122428
|
getResolvedProjectReferenceToRedirect,
|
|
122666
122429
|
getProjectReferenceRedirect,
|
|
@@ -133032,9 +132795,13 @@ function createTextSpanFromNode(node, sourceFile, endNode2) {
|
|
|
133032
132795
|
return createTextSpanFromBounds(node.getStart(sourceFile), (endNode2 || node).getEnd());
|
|
133033
132796
|
}
|
|
133034
132797
|
function createTextSpanFromStringLiteralLikeContent(node) {
|
|
133035
|
-
|
|
133036
|
-
|
|
133037
|
-
|
|
132798
|
+
let replacementEnd = node.getEnd() - 1;
|
|
132799
|
+
if (node.isUnterminated) {
|
|
132800
|
+
if (node.getStart() === replacementEnd)
|
|
132801
|
+
return void 0;
|
|
132802
|
+
replacementEnd = node.getEnd();
|
|
132803
|
+
}
|
|
132804
|
+
return createTextSpanFromBounds(node.getStart() + 1, replacementEnd);
|
|
133038
132805
|
}
|
|
133039
132806
|
function createTextRangeFromNode(node, sourceFile) {
|
|
133040
132807
|
return createRange(node.getStart(sourceFile), node.end);
|
|
@@ -140057,7 +139824,9 @@ function updateImportsInOtherFiles(changes, program, host, oldFile, movedSymbols
|
|
|
140057
139824
|
return !!symbol && movedSymbols.has(symbol);
|
|
140058
139825
|
};
|
|
140059
139826
|
deleteUnusedImports(sourceFile, importNode, changes, shouldMove);
|
|
140060
|
-
const pathToTargetFileWithExtension = resolvePath(getDirectoryPath(oldFile.
|
|
139827
|
+
const pathToTargetFileWithExtension = resolvePath(getDirectoryPath(getNormalizedAbsolutePath(oldFile.fileName, program.getCurrentDirectory())), targetFileName);
|
|
139828
|
+
if (getStringComparer(!program.useCaseSensitiveFileNames())(pathToTargetFileWithExtension, sourceFile.fileName) === 0 /* EqualTo */)
|
|
139829
|
+
return;
|
|
140061
139830
|
const newModuleSpecifier = getModuleSpecifier(program.getCompilerOptions(), sourceFile, sourceFile.fileName, pathToTargetFileWithExtension, createModuleSpecifierResolutionHost(program, host));
|
|
140062
139831
|
const newImportDeclaration = filterImport(importNode, makeStringLiteral(newModuleSpecifier, quotePreference), shouldMove);
|
|
140063
139832
|
if (newImportDeclaration)
|
|
@@ -140192,7 +139961,7 @@ function createOldFileImportsFromTargetFile(sourceFile, targetFileNeedExport, ta
|
|
|
140192
139961
|
return makeImportOrRequire(sourceFile, defaultImport, imports, targetFileNameWithExtension, program, host, useEs6Imports, quotePreference);
|
|
140193
139962
|
}
|
|
140194
139963
|
function makeImportOrRequire(sourceFile, defaultImport, imports, targetFileNameWithExtension, program, host, useEs6Imports, quotePreference) {
|
|
140195
|
-
const pathToTargetFile = resolvePath(getDirectoryPath(sourceFile.
|
|
139964
|
+
const pathToTargetFile = resolvePath(getDirectoryPath(getNormalizedAbsolutePath(sourceFile.fileName, program.getCurrentDirectory())), targetFileNameWithExtension);
|
|
140196
139965
|
const pathToTargetFileWithCorrectExtension = getModuleSpecifier(program.getCompilerOptions(), sourceFile, sourceFile.fileName, pathToTargetFile, createModuleSpecifierResolutionHost(program, host));
|
|
140197
139966
|
if (useEs6Imports) {
|
|
140198
139967
|
const specifiers = imports.map((i) => factory.createImportSpecifier(
|