@@ -2802,7 +2802,7 @@ namespace ts {
2802
2802
}
2803
2803
}
2804
2804
2805
- function getTargetofModuleDefault(moduleSymbol: Symbol, node: TypeOnlyCompatibleAliasDeclaration , dontResolveAlias: boolean) {
2805
+ function getTargetofModuleDefault(moduleSymbol: Symbol, node: ImportClause | ImportOrExportSpecifier , dontResolveAlias: boolean) {
2806
2806
let exportDefaultSymbol: Symbol | undefined;
2807
2807
if (isShorthandAmbientModuleSymbol(moduleSymbol)) {
2808
2808
exportDefaultSymbol = moduleSymbol;
@@ -2812,7 +2812,7 @@ namespace ts {
2812
2812
}
2813
2813
2814
2814
const file = moduleSymbol.declarations?.find(isSourceFile);
2815
- const specifier = getModuleSpecifierForTypeOnlyCompatibleAliasDeclaration (node);
2815
+ const specifier = getModuleSpecifierForImportOrExport (node);
2816
2816
if (!specifier) {
2817
2817
return exportDefaultSymbol;
2818
2818
}
@@ -2850,7 +2850,7 @@ namespace ts {
2850
2850
return exportDefaultSymbol;
2851
2851
}
2852
2852
2853
- function getModuleSpecifierForTypeOnlyCompatibleAliasDeclaration (node: TypeOnlyCompatibleAliasDeclaration ): Expression | undefined {
2853
+ function getModuleSpecifierForImportOrExport (node: ImportEqualsDeclaration | ImportClause | NamespaceImport | ImportOrExportSpecifier ): Expression | undefined {
2854
2854
switch (node.kind) {
2855
2855
case SyntaxKind.ImportClause: return node.parent.moduleSpecifier;
2856
2856
case SyntaxKind.ImportEqualsDeclaration: return isExternalModuleReference(node.moduleReference) ? node.moduleReference.expression : undefined;
@@ -3073,7 +3073,7 @@ namespace ts {
3073
3073
3074
3074
function getTargetOfImportSpecifier(node: ImportSpecifier | BindingElement, dontResolveAlias: boolean): Symbol | undefined {
3075
3075
if (isImportSpecifier(node) && idText(node.propertyName || node.name) === InternalSymbolName.Default) {
3076
- const specifier = getModuleSpecifierForTypeOnlyCompatibleAliasDeclaration (node);
3076
+ const specifier = getModuleSpecifierForImportOrExport (node);
3077
3077
const moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
3078
3078
if (moduleSymbol) {
3079
3079
return getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias);
@@ -3104,7 +3104,7 @@ namespace ts {
3104
3104
3105
3105
function getTargetOfExportSpecifier(node: ExportSpecifier, meaning: SymbolFlags, dontResolveAlias?: boolean) {
3106
3106
if (idText(node.propertyName || node.name) === InternalSymbolName.Default) {
3107
- const specifier = getModuleSpecifierForTypeOnlyCompatibleAliasDeclaration (node);
3107
+ const specifier = getModuleSpecifierForImportOrExport (node);
3108
3108
const moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
3109
3109
if (moduleSymbol) {
3110
3110
return getTargetofModuleDefault(moduleSymbol, node, !!dontResolveAlias);
0 commit comments