typescript 4.5.0-dev.20210927 → 4.5.0-dev.20210928
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/de/diagnosticMessages.generated.json +17 -5
- package/lib/it/diagnosticMessages.generated.json +15 -4
- package/lib/ko/diagnosticMessages.generated.json +15 -4
- package/lib/lib.dom.d.ts +669 -1896
- package/lib/lib.dom.iterable.d.ts +16 -48
- package/lib/lib.webworker.d.ts +183 -520
- package/lib/lib.webworker.iterable.d.ts +10 -30
- package/lib/ru/diagnosticMessages.generated.json +15 -4
- package/lib/tsc.js +204 -102
- package/lib/tsserver.js +677 -290
- package/lib/tsserverlibrary.d.ts +10 -8
- package/lib/tsserverlibrary.js +677 -290
- package/lib/typescript.d.ts +10 -8
- package/lib/typescript.js +677 -290
- package/lib/typescriptServices.d.ts +10 -8
- package/lib/typescriptServices.js +677 -290
- package/lib/typingsInstaller.js +255 -111
- package/lib/zh-tw/diagnosticMessages.generated.json +15 -4
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.5";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20210928";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
function tryGetNativeMap() {
|
|
@@ -5424,6 +5424,8 @@ var ts;
|
|
|
5424
5424
|
Construct_signature_return_types_0_and_1_are_incompatible: diag(2203, ts.DiagnosticCategory.Error, "Construct_signature_return_types_0_and_1_are_incompatible_2203", "Construct signature return types '{0}' and '{1}' are incompatible.", undefined, true),
|
|
5425
5425
|
Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag(2204, ts.DiagnosticCategory.Error, "Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204", "Call signatures with no arguments have incompatible return types '{0}' and '{1}'.", undefined, true),
|
|
5426
5426
|
Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag(2205, ts.DiagnosticCategory.Error, "Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205", "Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.", undefined, true),
|
|
5427
|
+
The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement: diag(2206, ts.DiagnosticCategory.Error, "The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206", "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."),
|
|
5428
|
+
The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement: diag(2207, ts.DiagnosticCategory.Error, "The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207", "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."),
|
|
5427
5429
|
Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."),
|
|
5428
5430
|
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
|
|
5429
5431
|
Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."),
|
|
@@ -9723,7 +9725,7 @@ var ts;
|
|
|
9723
9725
|
switch (node.kind) {
|
|
9724
9726
|
case 269:
|
|
9725
9727
|
case 274:
|
|
9726
|
-
return node.parent.parent.isTypeOnly;
|
|
9728
|
+
return node.isTypeOnly || node.parent.parent.isTypeOnly;
|
|
9727
9729
|
case 267:
|
|
9728
9730
|
return node.parent.isTypeOnly;
|
|
9729
9731
|
case 266:
|
|
@@ -15689,7 +15691,8 @@ var ts;
|
|
|
15689
15691
|
var aParts = ts.getPathComponents(ts.getNormalizedAbsolutePath(a, cwd));
|
|
15690
15692
|
var bParts = ts.getPathComponents(ts.getNormalizedAbsolutePath(b, cwd));
|
|
15691
15693
|
var isDirectory = false;
|
|
15692
|
-
while (
|
|
15694
|
+
while (aParts.length >= 2 && bParts.length >= 2 &&
|
|
15695
|
+
!isNodeModulesOrScopedPackageDirectory(aParts[aParts.length - 2], getCanonicalFileName) &&
|
|
15693
15696
|
!isNodeModulesOrScopedPackageDirectory(bParts[bParts.length - 2], getCanonicalFileName) &&
|
|
15694
15697
|
getCanonicalFileName(aParts[aParts.length - 1]) === getCanonicalFileName(bParts[bParts.length - 1])) {
|
|
15695
15698
|
aParts.pop();
|
|
@@ -15699,7 +15702,7 @@ var ts;
|
|
|
15699
15702
|
return isDirectory ? [ts.getPathFromPathComponents(aParts), ts.getPathFromPathComponents(bParts)] : undefined;
|
|
15700
15703
|
}
|
|
15701
15704
|
function isNodeModulesOrScopedPackageDirectory(s, getCanonicalFileName) {
|
|
15702
|
-
return getCanonicalFileName(s) === "node_modules" || ts.startsWith(s, "@");
|
|
15705
|
+
return s !== undefined && (getCanonicalFileName(s) === "node_modules" || ts.startsWith(s, "@"));
|
|
15703
15706
|
}
|
|
15704
15707
|
function stripLeadingDirectorySeparator(s) {
|
|
15705
15708
|
return ts.isAnyDirectorySeparator(s.charCodeAt(0)) ? s.slice(1) : undefined;
|
|
@@ -16239,10 +16242,6 @@ var ts;
|
|
|
16239
16242
|
|| !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite));
|
|
16240
16243
|
}
|
|
16241
16244
|
ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite;
|
|
16242
|
-
function typeOnlyDeclarationIsExport(typeOnlyDeclaration) {
|
|
16243
|
-
return typeOnlyDeclaration.kind === 274;
|
|
16244
|
-
}
|
|
16245
|
-
ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport;
|
|
16246
16245
|
function isShorthandPropertyNameUseSite(useSite) {
|
|
16247
16246
|
return ts.isIdentifier(useSite) && ts.isShorthandPropertyAssignment(useSite.parent) && useSite.parent.name === useSite;
|
|
16248
16247
|
}
|
|
@@ -19699,8 +19698,9 @@ var ts;
|
|
|
19699
19698
|
? update(createNamedImports(elements), node)
|
|
19700
19699
|
: node;
|
|
19701
19700
|
}
|
|
19702
|
-
function createImportSpecifier(propertyName, name) {
|
|
19701
|
+
function createImportSpecifier(isTypeOnly, propertyName, name) {
|
|
19703
19702
|
var node = createBaseNode(269);
|
|
19703
|
+
node.isTypeOnly = isTypeOnly;
|
|
19704
19704
|
node.propertyName = propertyName;
|
|
19705
19705
|
node.name = name;
|
|
19706
19706
|
node.transformFlags |=
|
|
@@ -19709,10 +19709,11 @@ var ts;
|
|
|
19709
19709
|
node.transformFlags &= ~16777216;
|
|
19710
19710
|
return node;
|
|
19711
19711
|
}
|
|
19712
|
-
function updateImportSpecifier(node, propertyName, name) {
|
|
19713
|
-
return node.
|
|
19712
|
+
function updateImportSpecifier(node, isTypeOnly, propertyName, name) {
|
|
19713
|
+
return node.isTypeOnly !== isTypeOnly
|
|
19714
|
+
|| node.propertyName !== propertyName
|
|
19714
19715
|
|| node.name !== name
|
|
19715
|
-
? update(createImportSpecifier(propertyName, name), node)
|
|
19716
|
+
? update(createImportSpecifier(isTypeOnly, propertyName, name), node)
|
|
19716
19717
|
: node;
|
|
19717
19718
|
}
|
|
19718
19719
|
function createExportAssignment(decorators, modifiers, isExportEquals, expression) {
|
|
@@ -19766,8 +19767,9 @@ var ts;
|
|
|
19766
19767
|
? update(createNamedExports(elements), node)
|
|
19767
19768
|
: node;
|
|
19768
19769
|
}
|
|
19769
|
-
function createExportSpecifier(propertyName, name) {
|
|
19770
|
+
function createExportSpecifier(isTypeOnly, propertyName, name) {
|
|
19770
19771
|
var node = createBaseNode(274);
|
|
19772
|
+
node.isTypeOnly = isTypeOnly;
|
|
19771
19773
|
node.propertyName = asName(propertyName);
|
|
19772
19774
|
node.name = asName(name);
|
|
19773
19775
|
node.transformFlags |=
|
|
@@ -19776,10 +19778,11 @@ var ts;
|
|
|
19776
19778
|
node.transformFlags &= ~16777216;
|
|
19777
19779
|
return node;
|
|
19778
19780
|
}
|
|
19779
|
-
function updateExportSpecifier(node, propertyName, name) {
|
|
19780
|
-
return node.
|
|
19781
|
+
function updateExportSpecifier(node, isTypeOnly, propertyName, name) {
|
|
19782
|
+
return node.isTypeOnly !== isTypeOnly
|
|
19783
|
+
|| node.propertyName !== propertyName
|
|
19781
19784
|
|| node.name !== name
|
|
19782
|
-
? update(createExportSpecifier(propertyName, name), node)
|
|
19785
|
+
? update(createExportSpecifier(isTypeOnly, propertyName, name), node)
|
|
19783
19786
|
: node;
|
|
19784
19787
|
}
|
|
19785
19788
|
function createMissingDeclaration() {
|
|
@@ -20656,7 +20659,7 @@ var ts;
|
|
|
20656
20659
|
}
|
|
20657
20660
|
function createExternalModuleExport(exportName) {
|
|
20658
20661
|
return createExportDeclaration(undefined, undefined, false, createNamedExports([
|
|
20659
|
-
createExportSpecifier(undefined, exportName)
|
|
20662
|
+
createExportSpecifier(false, undefined, exportName)
|
|
20660
20663
|
]));
|
|
20661
20664
|
}
|
|
20662
20665
|
function createTypeCheck(value, tag) {
|
|
@@ -23307,8 +23310,8 @@ var ts;
|
|
|
23307
23310
|
if (ts.some(helperNames)) {
|
|
23308
23311
|
helperNames.sort(ts.compareStringsCaseSensitive);
|
|
23309
23312
|
namedBindings = nodeFactory.createNamedImports(ts.map(helperNames, function (name) { return ts.isFileLevelUniqueName(sourceFile, name)
|
|
23310
|
-
? nodeFactory.createImportSpecifier(undefined, nodeFactory.createIdentifier(name))
|
|
23311
|
-
: nodeFactory.createImportSpecifier(nodeFactory.createIdentifier(name), helperFactory.getUnscopedHelperName(name)); }));
|
|
23313
|
+
? nodeFactory.createImportSpecifier(false, undefined, nodeFactory.createIdentifier(name))
|
|
23314
|
+
: nodeFactory.createImportSpecifier(false, nodeFactory.createIdentifier(name), helperFactory.getUnscopedHelperName(name)); }));
|
|
23312
23315
|
var parseNode = ts.getOriginalNode(sourceFile, ts.isSourceFile);
|
|
23313
23316
|
var emitNode = ts.getOrCreateEmitNode(parseNode);
|
|
23314
23317
|
emitNode.externalHelpers = true;
|
|
@@ -29079,27 +29082,60 @@ var ts;
|
|
|
29079
29082
|
var checkIdentifierIsKeyword = ts.isKeyword(token()) && !isIdentifier();
|
|
29080
29083
|
var checkIdentifierStart = scanner.getTokenPos();
|
|
29081
29084
|
var checkIdentifierEnd = scanner.getTextPos();
|
|
29082
|
-
var
|
|
29085
|
+
var isTypeOnly = false;
|
|
29083
29086
|
var propertyName;
|
|
29084
|
-
var
|
|
29085
|
-
|
|
29086
|
-
|
|
29087
|
-
|
|
29088
|
-
|
|
29089
|
-
|
|
29090
|
-
|
|
29091
|
-
|
|
29087
|
+
var canParseAsKeyword = true;
|
|
29088
|
+
var name = parseIdentifierName();
|
|
29089
|
+
if (name.escapedText === "type") {
|
|
29090
|
+
if (token() === 127) {
|
|
29091
|
+
var firstAs = parseIdentifierName();
|
|
29092
|
+
if (token() === 127) {
|
|
29093
|
+
var secondAs = parseIdentifierName();
|
|
29094
|
+
if (ts.tokenIsIdentifierOrKeyword(token())) {
|
|
29095
|
+
isTypeOnly = true;
|
|
29096
|
+
propertyName = firstAs;
|
|
29097
|
+
name = parseNameWithKeywordCheck();
|
|
29098
|
+
canParseAsKeyword = false;
|
|
29099
|
+
}
|
|
29100
|
+
else {
|
|
29101
|
+
propertyName = name;
|
|
29102
|
+
name = secondAs;
|
|
29103
|
+
canParseAsKeyword = false;
|
|
29104
|
+
}
|
|
29105
|
+
}
|
|
29106
|
+
else if (ts.tokenIsIdentifierOrKeyword(token())) {
|
|
29107
|
+
propertyName = name;
|
|
29108
|
+
canParseAsKeyword = false;
|
|
29109
|
+
name = parseNameWithKeywordCheck();
|
|
29110
|
+
}
|
|
29111
|
+
else {
|
|
29112
|
+
isTypeOnly = true;
|
|
29113
|
+
name = firstAs;
|
|
29114
|
+
}
|
|
29115
|
+
}
|
|
29116
|
+
else if (ts.tokenIsIdentifierOrKeyword(token())) {
|
|
29117
|
+
isTypeOnly = true;
|
|
29118
|
+
name = parseNameWithKeywordCheck();
|
|
29119
|
+
}
|
|
29092
29120
|
}
|
|
29093
|
-
|
|
29094
|
-
|
|
29121
|
+
if (canParseAsKeyword && token() === 127) {
|
|
29122
|
+
propertyName = name;
|
|
29123
|
+
parseExpected(127);
|
|
29124
|
+
name = parseNameWithKeywordCheck();
|
|
29095
29125
|
}
|
|
29096
29126
|
if (kind === 269 && checkIdentifierIsKeyword) {
|
|
29097
29127
|
parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected);
|
|
29098
29128
|
}
|
|
29099
29129
|
var node = kind === 269
|
|
29100
|
-
? factory.createImportSpecifier(propertyName, name)
|
|
29101
|
-
: factory.createExportSpecifier(propertyName, name);
|
|
29130
|
+
? factory.createImportSpecifier(isTypeOnly, propertyName, name)
|
|
29131
|
+
: factory.createExportSpecifier(isTypeOnly, propertyName, name);
|
|
29102
29132
|
return finishNode(node, pos);
|
|
29133
|
+
function parseNameWithKeywordCheck() {
|
|
29134
|
+
checkIdentifierIsKeyword = ts.isKeyword(token()) && !isIdentifier();
|
|
29135
|
+
checkIdentifierStart = scanner.getTokenPos();
|
|
29136
|
+
checkIdentifierEnd = scanner.getTextPos();
|
|
29137
|
+
return parseIdentifierName();
|
|
29138
|
+
}
|
|
29103
29139
|
}
|
|
29104
29140
|
function parseNamespaceExport(pos) {
|
|
29105
29141
|
return finishNode(factory.createNamespaceExport(parseIdentifierName()), pos);
|
|
@@ -38401,6 +38437,7 @@ var ts;
|
|
|
38401
38437
|
getLocalTypeParametersOfClassOrInterfaceOrTypeAlias: getLocalTypeParametersOfClassOrInterfaceOrTypeAlias,
|
|
38402
38438
|
isDeclarationVisible: isDeclarationVisible,
|
|
38403
38439
|
isPropertyAccessible: isPropertyAccessible,
|
|
38440
|
+
getTypeOnlyAliasDeclaration: getTypeOnlyAliasDeclaration,
|
|
38404
38441
|
};
|
|
38405
38442
|
function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode) {
|
|
38406
38443
|
var node = ts.getParseTreeNode(nodeIn, ts.isCallLikeExpression);
|
|
@@ -39580,8 +39617,7 @@ var ts;
|
|
|
39580
39617
|
if (!ts.isValidTypeOnlyAliasUseSite(useSite)) {
|
|
39581
39618
|
var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(symbol);
|
|
39582
39619
|
if (typeOnlyDeclaration) {
|
|
39583
|
-
var
|
|
39584
|
-
var message = isExport
|
|
39620
|
+
var message = typeOnlyDeclaration.kind === 274
|
|
39585
39621
|
? ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type
|
|
39586
39622
|
: ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
|
|
39587
39623
|
var unescapedName = ts.unescapeLeadingUnderscores(name);
|
|
@@ -39592,7 +39628,7 @@ var ts;
|
|
|
39592
39628
|
function addTypeOnlyDeclarationRelatedInfo(diagnostic, typeOnlyDeclaration, unescapedName) {
|
|
39593
39629
|
if (!typeOnlyDeclaration)
|
|
39594
39630
|
return diagnostic;
|
|
39595
|
-
return ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(typeOnlyDeclaration,
|
|
39631
|
+
return ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(typeOnlyDeclaration, typeOnlyDeclaration.kind === 274 ? ts.Diagnostics._0_was_exported_here : ts.Diagnostics._0_was_imported_here, unescapedName));
|
|
39596
39632
|
}
|
|
39597
39633
|
function getIsDeferredContext(location, lastLocation) {
|
|
39598
39634
|
if (location.kind !== 213 && location.kind !== 212) {
|
|
@@ -39885,7 +39921,7 @@ var ts;
|
|
|
39885
39921
|
function checkAndReportErrorForResolvingImportAliasToTypeOnlySymbol(node, resolved) {
|
|
39886
39922
|
if (markSymbolOfAliasDeclarationIfTypeOnly(node, undefined, resolved, false) && !node.isTypeOnly) {
|
|
39887
39923
|
var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfNode(node));
|
|
39888
|
-
var isExport =
|
|
39924
|
+
var isExport = typeOnlyDeclaration.kind === 274;
|
|
39889
39925
|
var message = isExport
|
|
39890
39926
|
? ts.Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type
|
|
39891
39927
|
: ts.Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type;
|
|
@@ -43087,7 +43123,7 @@ var ts;
|
|
|
43087
43123
|
var name_2 = ns.name;
|
|
43088
43124
|
var body = ns.body;
|
|
43089
43125
|
if (ts.length(excessExports)) {
|
|
43090
|
-
ns = ts.factory.updateModuleDeclaration(ns, ns.decorators, ns.modifiers, ns.name, body = ts.factory.updateModuleBlock(body, ts.factory.createNodeArray(__spreadArray(__spreadArray([], ns.body.statements, true), [ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports(ts.map(ts.flatMap(excessExports, function (e) { return getNamesOfDeclaration(e); }), function (id) { return ts.factory.createExportSpecifier(undefined, id); })), undefined)], false))));
|
|
43126
|
+
ns = ts.factory.updateModuleDeclaration(ns, ns.decorators, ns.modifiers, ns.name, body = ts.factory.updateModuleBlock(body, ts.factory.createNodeArray(__spreadArray(__spreadArray([], ns.body.statements, true), [ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports(ts.map(ts.flatMap(excessExports, function (e) { return getNamesOfDeclaration(e); }), function (id) { return ts.factory.createExportSpecifier(false, undefined, id); })), undefined)], false))));
|
|
43091
43127
|
statements = __spreadArray(__spreadArray(__spreadArray([], statements.slice(0, nsIndex), true), [ns], false), statements.slice(nsIndex + 1), true);
|
|
43092
43128
|
}
|
|
43093
43129
|
if (!ts.find(statements, function (s) { return s !== ns && ts.nodeHasName(s, name_2); })) {
|
|
@@ -43269,7 +43305,7 @@ var ts;
|
|
|
43269
43305
|
if (propertyAccessRequire && ts.isBinaryExpression(propertyAccessRequire.parent) && ts.isIdentifier(propertyAccessRequire.parent.right)
|
|
43270
43306
|
&& ((_b = type.symbol) === null || _b === void 0 ? void 0 : _b.valueDeclaration) && ts.isSourceFile(type.symbol.valueDeclaration)) {
|
|
43271
43307
|
var alias = localName === propertyAccessRequire.parent.right.escapedText ? undefined : propertyAccessRequire.parent.right;
|
|
43272
|
-
addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(alias, localName)])), 0);
|
|
43308
|
+
addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(false, alias, localName)])), 0);
|
|
43273
43309
|
context.tracker.trackSymbol(type.symbol, context.enclosingDeclaration, 111551);
|
|
43274
43310
|
}
|
|
43275
43311
|
else {
|
|
@@ -43278,7 +43314,7 @@ var ts;
|
|
|
43278
43314
|
], flags)), textRange);
|
|
43279
43315
|
addResult(statement, name !== localName ? modifierFlags & ~1 : modifierFlags);
|
|
43280
43316
|
if (name !== localName && !isPrivate) {
|
|
43281
|
-
addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(name, localName)])), 0);
|
|
43317
|
+
addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(false, name, localName)])), 0);
|
|
43282
43318
|
needsExportDeclaration = false;
|
|
43283
43319
|
needsPostExportDefault = false;
|
|
43284
43320
|
}
|
|
@@ -43327,7 +43363,7 @@ var ts;
|
|
|
43327
43363
|
addResult(ts.factory.createExportAssignment(undefined, undefined, false, ts.factory.createIdentifier(getInternalSymbolName(symbol, symbolName))), 0);
|
|
43328
43364
|
}
|
|
43329
43365
|
else if (needsExportDeclaration) {
|
|
43330
|
-
addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(getInternalSymbolName(symbol, symbolName), symbolName)])), 0);
|
|
43366
|
+
addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(false, getInternalSymbolName(symbol, symbolName), symbolName)])), 0);
|
|
43331
43367
|
}
|
|
43332
43368
|
}
|
|
43333
43369
|
function includePrivateSymbol(symbol) {
|
|
@@ -43432,7 +43468,7 @@ var ts;
|
|
|
43432
43468
|
var target = aliasDecl && getTargetOfAliasDeclaration(aliasDecl, true);
|
|
43433
43469
|
includePrivateSymbol(target || s);
|
|
43434
43470
|
var targetName = target ? getInternalSymbolName(target, ts.unescapeLeadingUnderscores(target.escapedName)) : localName;
|
|
43435
|
-
return ts.factory.createExportSpecifier(name === targetName ? undefined : targetName, name);
|
|
43471
|
+
return ts.factory.createExportSpecifier(false, name === targetName ? undefined : targetName, name);
|
|
43436
43472
|
})))]);
|
|
43437
43473
|
addResult(ts.factory.createModuleDeclaration(undefined, undefined, ts.factory.createIdentifier(localName), nsBody, 16), 0);
|
|
43438
43474
|
}
|
|
@@ -43492,7 +43528,7 @@ var ts;
|
|
|
43492
43528
|
addingDeclare = oldAddingDeclare;
|
|
43493
43529
|
var declarations = results;
|
|
43494
43530
|
results = oldResults;
|
|
43495
|
-
var defaultReplaced = ts.map(declarations, function (d) { return ts.isExportAssignment(d) && !d.isExportEquals && ts.isIdentifier(d.expression) ? ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(d.expression, ts.factory.createIdentifier("default"))])) : d; });
|
|
43531
|
+
var defaultReplaced = ts.map(declarations, function (d) { return ts.isExportAssignment(d) && !d.isExportEquals && ts.isIdentifier(d.expression) ? ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(false, d.expression, ts.factory.createIdentifier("default"))])) : d; });
|
|
43496
43532
|
var exportModifierStripped = ts.every(defaultReplaced, function (d) { return ts.hasSyntacticModifier(d, 1); }) ? ts.map(defaultReplaced, removeExportModifier) : defaultReplaced;
|
|
43497
43533
|
fakespace = ts.factory.updateModuleDeclaration(fakespace, fakespace.decorators, fakespace.modifiers, fakespace.name, ts.factory.createModuleBlock(exportModifierStripped));
|
|
43498
43534
|
addResult(fakespace, modifierFlags);
|
|
@@ -43615,7 +43651,7 @@ var ts;
|
|
|
43615
43651
|
if (((_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.kind) === 253) {
|
|
43616
43652
|
var specifier_1 = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
43617
43653
|
var propertyName = node.propertyName;
|
|
43618
|
-
addResult(ts.factory.createImportDeclaration(undefined, undefined, ts.factory.createImportClause(false, undefined, ts.factory.createNamedImports([ts.factory.createImportSpecifier(propertyName && ts.isIdentifier(propertyName) ? ts.factory.createIdentifier(ts.idText(propertyName)) : undefined, ts.factory.createIdentifier(localName))])), ts.factory.createStringLiteral(specifier_1), undefined), 0);
|
|
43654
|
+
addResult(ts.factory.createImportDeclaration(undefined, undefined, ts.factory.createImportClause(false, undefined, ts.factory.createNamedImports([ts.factory.createImportSpecifier(false, propertyName && ts.isIdentifier(propertyName) ? ts.factory.createIdentifier(ts.idText(propertyName)) : undefined, ts.factory.createIdentifier(localName))])), ts.factory.createStringLiteral(specifier_1), undefined), 0);
|
|
43619
43655
|
break;
|
|
43620
43656
|
}
|
|
43621
43657
|
ts.Debug.failBadSyntaxKind(((_c = node.parent) === null || _c === void 0 ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization");
|
|
@@ -43658,7 +43694,7 @@ var ts;
|
|
|
43658
43694
|
break;
|
|
43659
43695
|
case 269:
|
|
43660
43696
|
addResult(ts.factory.createImportDeclaration(undefined, undefined, ts.factory.createImportClause(false, undefined, ts.factory.createNamedImports([
|
|
43661
|
-
ts.factory.createImportSpecifier(localName !== verbatimTargetName ? ts.factory.createIdentifier(verbatimTargetName) : undefined, ts.factory.createIdentifier(localName))
|
|
43697
|
+
ts.factory.createImportSpecifier(false, localName !== verbatimTargetName ? ts.factory.createIdentifier(verbatimTargetName) : undefined, ts.factory.createIdentifier(localName))
|
|
43662
43698
|
])), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context)), undefined), 0);
|
|
43663
43699
|
break;
|
|
43664
43700
|
case 274:
|
|
@@ -43683,7 +43719,7 @@ var ts;
|
|
|
43683
43719
|
}
|
|
43684
43720
|
}
|
|
43685
43721
|
function serializeExportSpecifier(localName, targetName, specifier) {
|
|
43686
|
-
addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(localName !== targetName ? targetName : undefined, localName)]), specifier), 0);
|
|
43722
|
+
addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(false, localName !== targetName ? targetName : undefined, localName)]), specifier), 0);
|
|
43687
43723
|
}
|
|
43688
43724
|
function serializeMaybeAliasAssignment(symbol) {
|
|
43689
43725
|
if (symbol.flags & 4194304) {
|
|
@@ -46709,6 +46745,23 @@ var ts;
|
|
|
46709
46745
|
function getIsLateCheckFlag(s) {
|
|
46710
46746
|
return ts.getCheckFlags(s) & 4096;
|
|
46711
46747
|
}
|
|
46748
|
+
function forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(type, include, stringsOnly, cb) {
|
|
46749
|
+
for (var _i = 0, _a = getPropertiesOfType(type); _i < _a.length; _i++) {
|
|
46750
|
+
var prop = _a[_i];
|
|
46751
|
+
cb(getLiteralTypeFromProperty(prop, include));
|
|
46752
|
+
}
|
|
46753
|
+
if (type.flags & 1) {
|
|
46754
|
+
cb(stringType);
|
|
46755
|
+
}
|
|
46756
|
+
else {
|
|
46757
|
+
for (var _b = 0, _c = getIndexInfosOfType(type); _b < _c.length; _b++) {
|
|
46758
|
+
var info = _c[_b];
|
|
46759
|
+
if (!stringsOnly || info.keyType.flags & (4 | 134217728)) {
|
|
46760
|
+
cb(info.keyType);
|
|
46761
|
+
}
|
|
46762
|
+
}
|
|
46763
|
+
}
|
|
46764
|
+
}
|
|
46712
46765
|
function resolveMappedTypeMembers(type) {
|
|
46713
46766
|
var members = ts.createSymbolTable();
|
|
46714
46767
|
var indexInfos;
|
|
@@ -46721,21 +46774,7 @@ var ts;
|
|
|
46721
46774
|
var templateModifiers = getMappedTypeModifiers(type);
|
|
46722
46775
|
var include = keyofStringsOnly ? 128 : 8576;
|
|
46723
46776
|
if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
|
|
46724
|
-
|
|
46725
|
-
var prop = _a[_i];
|
|
46726
|
-
addMemberForKeyType(getLiteralTypeFromProperty(prop, include));
|
|
46727
|
-
}
|
|
46728
|
-
if (modifiersType.flags & 1) {
|
|
46729
|
-
addMemberForKeyType(stringType);
|
|
46730
|
-
}
|
|
46731
|
-
else {
|
|
46732
|
-
for (var _b = 0, _c = getIndexInfosOfType(modifiersType); _b < _c.length; _b++) {
|
|
46733
|
-
var info = _c[_b];
|
|
46734
|
-
if (!keyofStringsOnly || info.keyType.flags & (4 | 134217728)) {
|
|
46735
|
-
addMemberForKeyType(info.keyType);
|
|
46736
|
-
}
|
|
46737
|
-
}
|
|
46738
|
-
}
|
|
46777
|
+
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, include, keyofStringsOnly, addMemberForKeyType);
|
|
46739
46778
|
}
|
|
46740
46779
|
else {
|
|
46741
46780
|
forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType);
|
|
@@ -49495,16 +49534,38 @@ var ts;
|
|
|
49495
49534
|
type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(type, true)) :
|
|
49496
49535
|
type.resolvedIndexType || (type.resolvedIndexType = createIndexType(type, false));
|
|
49497
49536
|
}
|
|
49498
|
-
function
|
|
49499
|
-
|
|
49500
|
-
|
|
49501
|
-
|
|
49502
|
-
|
|
49503
|
-
|
|
49504
|
-
|
|
49505
|
-
|
|
49506
|
-
|
|
49507
|
-
|
|
49537
|
+
function getIndexTypeForMappedType(type, stringsOnly, noIndexSignatures) {
|
|
49538
|
+
var typeParameter = getTypeParameterFromMappedType(type);
|
|
49539
|
+
var constraintType = getConstraintTypeFromMappedType(type);
|
|
49540
|
+
var nameType = getNameTypeFromMappedType(type.target || type);
|
|
49541
|
+
if (!nameType && !noIndexSignatures) {
|
|
49542
|
+
return constraintType;
|
|
49543
|
+
}
|
|
49544
|
+
var keyTypes = [];
|
|
49545
|
+
if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
|
|
49546
|
+
if (!isGenericIndexType(constraintType)) {
|
|
49547
|
+
var modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
49548
|
+
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576, stringsOnly, addMemberForKeyType);
|
|
49549
|
+
}
|
|
49550
|
+
else {
|
|
49551
|
+
return getIndexTypeForGenericType(type, stringsOnly);
|
|
49552
|
+
}
|
|
49553
|
+
}
|
|
49554
|
+
else {
|
|
49555
|
+
forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType);
|
|
49556
|
+
}
|
|
49557
|
+
if (isGenericIndexType(constraintType)) {
|
|
49558
|
+
forEachType(constraintType, addMemberForKeyType);
|
|
49559
|
+
}
|
|
49560
|
+
var result = noIndexSignatures ? filterType(getUnionType(keyTypes), function (t) { return !(t.flags & (1 | 4)); }) : getUnionType(keyTypes);
|
|
49561
|
+
if (result.flags & 1048576 && constraintType.flags & 1048576 && getTypeListId(result.types) === getTypeListId(constraintType.types)) {
|
|
49562
|
+
return constraintType;
|
|
49563
|
+
}
|
|
49564
|
+
return result;
|
|
49565
|
+
function addMemberForKeyType(keyType) {
|
|
49566
|
+
var propNameType = nameType ? instantiateType(nameType, appendTypeMapping(type.mapper, typeParameter, keyType)) : keyType;
|
|
49567
|
+
keyTypes.push(propNameType === stringType ? stringOrNumberType : propNameType);
|
|
49568
|
+
}
|
|
49508
49569
|
}
|
|
49509
49570
|
function hasDistributiveNameType(mappedType) {
|
|
49510
49571
|
var typeVariable = getTypeParameterFromMappedType(mappedType);
|
|
@@ -49556,7 +49617,7 @@ var ts;
|
|
|
49556
49617
|
return type.flags & 1048576 ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
|
|
49557
49618
|
type.flags & 2097152 ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
|
|
49558
49619
|
type.flags & 58982400 || isGenericTupleType(type) || isGenericMappedType(type) && !hasDistributiveNameType(type) ? getIndexTypeForGenericType(type, stringsOnly) :
|
|
49559
|
-
ts.getObjectFlags(type) & 32 ? getIndexTypeForMappedType(type, noIndexSignatures) :
|
|
49620
|
+
ts.getObjectFlags(type) & 32 ? getIndexTypeForMappedType(type, stringsOnly, noIndexSignatures) :
|
|
49560
49621
|
type === wildcardType ? wildcardType :
|
|
49561
49622
|
type.flags & 2 ? neverType :
|
|
49562
49623
|
type.flags & (1 | 131072) ? keyofConstraintType :
|
|
@@ -52880,24 +52941,41 @@ var ts;
|
|
|
52880
52941
|
}
|
|
52881
52942
|
}
|
|
52882
52943
|
else if (target.flags & 4194304) {
|
|
52883
|
-
var
|
|
52944
|
+
var targetType_1 = target.type;
|
|
52884
52945
|
if (source.flags & 4194304) {
|
|
52885
|
-
if (result = isRelatedTo(
|
|
52946
|
+
if (result = isRelatedTo(targetType_1, source.type, false)) {
|
|
52886
52947
|
return result;
|
|
52887
52948
|
}
|
|
52888
52949
|
}
|
|
52889
|
-
if (isTupleType(
|
|
52890
|
-
if (result = isRelatedTo(source, getKnownKeysOfTupleType(
|
|
52950
|
+
if (isTupleType(targetType_1)) {
|
|
52951
|
+
if (result = isRelatedTo(source, getKnownKeysOfTupleType(targetType_1), reportErrors)) {
|
|
52891
52952
|
return result;
|
|
52892
52953
|
}
|
|
52893
52954
|
}
|
|
52894
52955
|
else {
|
|
52895
|
-
var constraint = getSimplifiedTypeOrConstraint(
|
|
52956
|
+
var constraint = getSimplifiedTypeOrConstraint(targetType_1);
|
|
52896
52957
|
if (constraint) {
|
|
52897
52958
|
if (isRelatedTo(source, getIndexType(constraint, target.stringsOnly), reportErrors) === -1) {
|
|
52898
52959
|
return -1;
|
|
52899
52960
|
}
|
|
52900
52961
|
}
|
|
52962
|
+
else if (isGenericMappedType(targetType_1)) {
|
|
52963
|
+
var nameType_1 = getNameTypeFromMappedType(targetType_1);
|
|
52964
|
+
var constraintType = getConstraintTypeFromMappedType(targetType_1);
|
|
52965
|
+
var targetKeys = void 0;
|
|
52966
|
+
if (nameType_1 && isMappedTypeWithKeyofConstraintDeclaration(targetType_1)) {
|
|
52967
|
+
var modifiersType = getApparentType(getModifiersTypeFromMappedType(targetType_1));
|
|
52968
|
+
var mappedKeys_1 = [];
|
|
52969
|
+
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576, false, function (t) { return void mappedKeys_1.push(instantiateType(nameType_1, appendTypeMapping(targetType_1.mapper, getTypeParameterFromMappedType(targetType_1), t))); });
|
|
52970
|
+
targetKeys = getUnionType(__spreadArray(__spreadArray([], mappedKeys_1, true), [nameType_1], false));
|
|
52971
|
+
}
|
|
52972
|
+
else {
|
|
52973
|
+
targetKeys = nameType_1 || constraintType;
|
|
52974
|
+
}
|
|
52975
|
+
if (isRelatedTo(source, targetKeys, reportErrors) === -1) {
|
|
52976
|
+
return -1;
|
|
52977
|
+
}
|
|
52978
|
+
}
|
|
52901
52979
|
}
|
|
52902
52980
|
}
|
|
52903
52981
|
else if (target.flags & 8388608) {
|
|
@@ -55485,8 +55563,10 @@ var ts;
|
|
|
55485
55563
|
function inferToTemplateLiteralType(source, target) {
|
|
55486
55564
|
var matches = inferTypesFromTemplateLiteralType(source, target);
|
|
55487
55565
|
var types = target.types;
|
|
55488
|
-
|
|
55489
|
-
|
|
55566
|
+
if (matches || ts.every(target.texts, function (s) { return s.length === 0; })) {
|
|
55567
|
+
for (var i = 0; i < types.length; i++) {
|
|
55568
|
+
inferFromTypes(matches ? matches[i] : neverType, types[i]);
|
|
55569
|
+
}
|
|
55490
55570
|
}
|
|
55491
55571
|
}
|
|
55492
55572
|
function inferFromObjectTypes(source, target) {
|
|
@@ -58704,8 +58784,8 @@ var ts;
|
|
|
58704
58784
|
return getTypeOfPropertyOfContextualType(type, getSymbolOfNode(element).escapedName);
|
|
58705
58785
|
}
|
|
58706
58786
|
if (element.name) {
|
|
58707
|
-
var
|
|
58708
|
-
return mapType(type, function (t) { var _a; return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t),
|
|
58787
|
+
var nameType_2 = getLiteralTypeFromPropertyName(element.name);
|
|
58788
|
+
return mapType(type, function (t) { var _a; return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType_2)) === null || _a === void 0 ? void 0 : _a.type; }, true);
|
|
58709
58789
|
}
|
|
58710
58790
|
}
|
|
58711
58791
|
return undefined;
|
|
@@ -69059,11 +69139,15 @@ var ts;
|
|
|
69059
69139
|
}
|
|
69060
69140
|
function checkGrammarExportDeclaration(node) {
|
|
69061
69141
|
var _a;
|
|
69062
|
-
|
|
69063
|
-
|
|
69064
|
-
|
|
69142
|
+
if (node.isTypeOnly) {
|
|
69143
|
+
if (((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) === 272) {
|
|
69144
|
+
return checkGrammarNamedImportsOrExports(node.exportClause);
|
|
69145
|
+
}
|
|
69146
|
+
else {
|
|
69147
|
+
return grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type);
|
|
69148
|
+
}
|
|
69065
69149
|
}
|
|
69066
|
-
return
|
|
69150
|
+
return false;
|
|
69067
69151
|
}
|
|
69068
69152
|
function checkGrammarModuleElementContext(node, errorMessage) {
|
|
69069
69153
|
var isInAppropriateContext = node.parent.kind === 303 || node.parent.kind === 261 || node.parent.kind === 260;
|
|
@@ -72408,11 +72492,24 @@ var ts;
|
|
|
72408
72492
|
return ambientModulesCache;
|
|
72409
72493
|
}
|
|
72410
72494
|
function checkGrammarImportClause(node) {
|
|
72495
|
+
var _a;
|
|
72411
72496
|
if (node.isTypeOnly && node.name && node.namedBindings) {
|
|
72412
72497
|
return grammarErrorOnNode(node, ts.Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both);
|
|
72413
72498
|
}
|
|
72499
|
+
if (node.isTypeOnly && ((_a = node.namedBindings) === null || _a === void 0 ? void 0 : _a.kind) === 268) {
|
|
72500
|
+
return checkGrammarNamedImportsOrExports(node.namedBindings);
|
|
72501
|
+
}
|
|
72414
72502
|
return false;
|
|
72415
72503
|
}
|
|
72504
|
+
function checkGrammarNamedImportsOrExports(namedBindings) {
|
|
72505
|
+
return !!ts.forEach(namedBindings.elements, function (specifier) {
|
|
72506
|
+
if (specifier.isTypeOnly) {
|
|
72507
|
+
return grammarErrorOnFirstToken(specifier, specifier.kind === 269
|
|
72508
|
+
? ts.Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement
|
|
72509
|
+
: ts.Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement);
|
|
72510
|
+
}
|
|
72511
|
+
});
|
|
72512
|
+
}
|
|
72416
72513
|
function checkGrammarImportCallExpression(node) {
|
|
72417
72514
|
if (moduleKind === ts.ModuleKind.ES2015) {
|
|
72418
72515
|
return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system_umd_node12_or_nodenext);
|
|
@@ -73086,7 +73183,7 @@ var ts;
|
|
|
73086
73183
|
return factory.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier));
|
|
73087
73184
|
case 269:
|
|
73088
73185
|
ts.Debug.type(node);
|
|
73089
|
-
return factory.updateImportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier));
|
|
73186
|
+
return factory.updateImportSpecifier(node, node.isTypeOnly, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier));
|
|
73090
73187
|
case 270:
|
|
73091
73188
|
ts.Debug.type(node);
|
|
73092
73189
|
return factory.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.expression, visitor, ts.isExpression));
|
|
@@ -73098,7 +73195,7 @@ var ts;
|
|
|
73098
73195
|
return factory.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier));
|
|
73099
73196
|
case 274:
|
|
73100
73197
|
ts.Debug.type(node);
|
|
73101
|
-
return factory.updateExportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier));
|
|
73198
|
+
return factory.updateExportSpecifier(node, node.isTypeOnly, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier));
|
|
73102
73199
|
case 276:
|
|
73103
73200
|
ts.Debug.type(node);
|
|
73104
73201
|
return factory.updateExternalModuleReference(node, nodeVisitor(node.expression, visitor, ts.isExpression));
|
|
@@ -75876,12 +75973,14 @@ var ts;
|
|
|
75876
75973
|
return shouldEmitAliasDeclaration(node) ? node : undefined;
|
|
75877
75974
|
}
|
|
75878
75975
|
else {
|
|
75976
|
+
var allowEmpty = compilerOptions.preserveValueImports && (compilerOptions.importsNotUsedAsValues === 1 ||
|
|
75977
|
+
compilerOptions.importsNotUsedAsValues === 2);
|
|
75879
75978
|
var elements = ts.visitNodes(node.elements, visitImportSpecifier, ts.isImportSpecifier);
|
|
75880
|
-
return ts.some(elements) ? factory.updateNamedImports(node, elements) : undefined;
|
|
75979
|
+
return allowEmpty || ts.some(elements) ? factory.updateNamedImports(node, elements) : undefined;
|
|
75881
75980
|
}
|
|
75882
75981
|
}
|
|
75883
75982
|
function visitImportSpecifier(node) {
|
|
75884
|
-
return shouldEmitAliasDeclaration(node) ? node : undefined;
|
|
75983
|
+
return !node.isTypeOnly && shouldEmitAliasDeclaration(node) ? node : undefined;
|
|
75885
75984
|
}
|
|
75886
75985
|
function visitExportAssignment(node) {
|
|
75887
75986
|
return resolver.isValueAliasDeclaration(node)
|
|
@@ -75895,26 +75994,25 @@ var ts;
|
|
|
75895
75994
|
if (!node.exportClause || ts.isNamespaceExport(node.exportClause)) {
|
|
75896
75995
|
return node;
|
|
75897
75996
|
}
|
|
75898
|
-
|
|
75899
|
-
|
|
75900
|
-
}
|
|
75901
|
-
var exportClause = ts.visitNode(node.exportClause, visitNamedExportBindings, ts.isNamedExportBindings);
|
|
75997
|
+
var allowEmpty = !!node.moduleSpecifier && (compilerOptions.importsNotUsedAsValues === 1 ||
|
|
75998
|
+
compilerOptions.importsNotUsedAsValues === 2);
|
|
75999
|
+
var exportClause = ts.visitNode(node.exportClause, function (bindings) { return visitNamedExportBindings(bindings, allowEmpty); }, ts.isNamedExportBindings);
|
|
75902
76000
|
return exportClause
|
|
75903
76001
|
? factory.updateExportDeclaration(node, undefined, undefined, node.isTypeOnly, exportClause, node.moduleSpecifier, node.assertClause)
|
|
75904
76002
|
: undefined;
|
|
75905
76003
|
}
|
|
75906
|
-
function visitNamedExports(node) {
|
|
76004
|
+
function visitNamedExports(node, allowEmpty) {
|
|
75907
76005
|
var elements = ts.visitNodes(node.elements, visitExportSpecifier, ts.isExportSpecifier);
|
|
75908
|
-
return ts.some(elements) ? factory.updateNamedExports(node, elements) : undefined;
|
|
76006
|
+
return allowEmpty || ts.some(elements) ? factory.updateNamedExports(node, elements) : undefined;
|
|
75909
76007
|
}
|
|
75910
76008
|
function visitNamespaceExports(node) {
|
|
75911
76009
|
return factory.updateNamespaceExport(node, ts.visitNode(node.name, visitor, ts.isIdentifier));
|
|
75912
76010
|
}
|
|
75913
|
-
function visitNamedExportBindings(node) {
|
|
75914
|
-
return ts.isNamespaceExport(node) ? visitNamespaceExports(node) : visitNamedExports(node);
|
|
76011
|
+
function visitNamedExportBindings(node, allowEmpty) {
|
|
76012
|
+
return ts.isNamespaceExport(node) ? visitNamespaceExports(node) : visitNamedExports(node, allowEmpty);
|
|
75915
76013
|
}
|
|
75916
76014
|
function visitExportSpecifier(node) {
|
|
75917
|
-
return resolver.isValueAliasDeclaration(node) ? node : undefined;
|
|
76015
|
+
return !node.isTypeOnly && resolver.isValueAliasDeclaration(node) ? node : undefined;
|
|
75918
76016
|
}
|
|
75919
76017
|
function shouldEmitImportEqualsDeclaration(node) {
|
|
75920
76018
|
return shouldEmitAliasDeclaration(node)
|
|
@@ -78888,7 +78986,7 @@ var ts;
|
|
|
78888
78986
|
currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports);
|
|
78889
78987
|
}
|
|
78890
78988
|
var generatedName = factory.createUniqueName("_" + name, 16 | 32 | 64);
|
|
78891
|
-
var specifier = factory.createImportSpecifier(factory.createIdentifier(name), generatedName);
|
|
78989
|
+
var specifier = factory.createImportSpecifier(false, factory.createIdentifier(name), generatedName);
|
|
78892
78990
|
generatedName.generatedImportReference = specifier;
|
|
78893
78991
|
specifierSourceImports.set(name, specifier);
|
|
78894
78992
|
return generatedName;
|
|
@@ -85206,7 +85304,7 @@ var ts;
|
|
|
85206
85304
|
if (!importRequireStatements) {
|
|
85207
85305
|
var createRequireName = factory.createUniqueName("_createRequire", 16 | 32);
|
|
85208
85306
|
var importStatement = factory.createImportDeclaration(undefined, undefined, factory.createImportClause(false, undefined, factory.createNamedImports([
|
|
85209
|
-
factory.createImportSpecifier(factory.createIdentifier("createRequire"), createRequireName)
|
|
85307
|
+
factory.createImportSpecifier(false, factory.createIdentifier("createRequire"), createRequireName)
|
|
85210
85308
|
])), factory.createStringLiteral("module"));
|
|
85211
85309
|
var requireHelperName = factory.createUniqueName("__require", 16 | 32);
|
|
85212
85310
|
var requireStatement = factory.createVariableStatement(undefined, factory.createVariableDeclarationList([
|
|
@@ -85231,7 +85329,7 @@ var ts;
|
|
|
85231
85329
|
}
|
|
85232
85330
|
function appendExportsOfImportEqualsDeclaration(statements, node) {
|
|
85233
85331
|
if (ts.hasSyntacticModifier(node, 1)) {
|
|
85234
|
-
statements = ts.append(statements, factory.createExportDeclaration(undefined, undefined, node.isTypeOnly, factory.createNamedExports([factory.createExportSpecifier(undefined, ts.idText(node.name))])));
|
|
85332
|
+
statements = ts.append(statements, factory.createExportDeclaration(undefined, undefined, node.isTypeOnly, factory.createNamedExports([factory.createExportSpecifier(false, undefined, ts.idText(node.name))])));
|
|
85235
85333
|
}
|
|
85236
85334
|
return statements;
|
|
85237
85335
|
}
|
|
@@ -85249,7 +85347,7 @@ var ts;
|
|
|
85249
85347
|
var synthName = factory.getGeneratedNameForNode(oldIdentifier);
|
|
85250
85348
|
var importDecl = factory.createImportDeclaration(undefined, undefined, factory.createImportClause(false, undefined, factory.createNamespaceImport(synthName)), node.moduleSpecifier, node.assertClause);
|
|
85251
85349
|
ts.setOriginalNode(importDecl, node.exportClause);
|
|
85252
|
-
var exportDecl = ts.isExportNamespaceAsDefaultDeclaration(node) ? factory.createExportDefault(synthName) : factory.createExportDeclaration(undefined, undefined, false, factory.createNamedExports([factory.createExportSpecifier(synthName, oldIdentifier)]));
|
|
85350
|
+
var exportDecl = ts.isExportNamespaceAsDefaultDeclaration(node) ? factory.createExportDefault(synthName) : factory.createExportDeclaration(undefined, undefined, false, factory.createNamedExports([factory.createExportSpecifier(false, synthName, oldIdentifier)]));
|
|
85253
85351
|
ts.setOriginalNode(exportDecl, node);
|
|
85254
85352
|
return [importDecl, exportDecl];
|
|
85255
85353
|
}
|
|
@@ -86663,7 +86761,7 @@ var ts;
|
|
|
86663
86761
|
else {
|
|
86664
86762
|
declarations.push(factory.createExportDeclaration(undefined, undefined, false, factory.createNamedExports(ts.map(exportMappings_1, function (_a) {
|
|
86665
86763
|
var gen = _a[0], exp = _a[1];
|
|
86666
|
-
return factory.createExportSpecifier(gen, exp);
|
|
86764
|
+
return factory.createExportSpecifier(false, gen, exp);
|
|
86667
86765
|
}))));
|
|
86668
86766
|
}
|
|
86669
86767
|
var namespaceDecl = factory.createModuleDeclaration(undefined, ensureModifiers(input), input.name, factory.createModuleBlock(declarations), 16);
|
|
@@ -90257,6 +90355,10 @@ var ts;
|
|
|
90257
90355
|
writePunctuation("}");
|
|
90258
90356
|
}
|
|
90259
90357
|
function emitImportOrExportSpecifier(node) {
|
|
90358
|
+
if (node.isTypeOnly) {
|
|
90359
|
+
writeKeyword("type");
|
|
90360
|
+
writeSpace();
|
|
90361
|
+
}
|
|
90260
90362
|
if (node.propertyName) {
|
|
90261
90363
|
emit(node.propertyName);
|
|
90262
90364
|
writeSpace();
|