@@ -5636,11 +5636,14 @@ var ts;
56365636 (node.name.kind === 9 /* StringLiteral */ || isGlobalScopeAugmentation(node));
56375637 }
56385638 ts.isAmbientModule = isAmbientModule;
5639+ function isShorthandAmbientModuleSymbol(moduleSymbol) {
5640+ return isShorthandAmbientModule(moduleSymbol.valueDeclaration);
5641+ }
5642+ ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol;
56395643 function isShorthandAmbientModule(node) {
56405644 // The only kind of module that can be missing a body is a shorthand ambient module.
56415645 return node.kind === 225 /* ModuleDeclaration */ && (!node.body);
56425646 }
5643- ts.isShorthandAmbientModule = isShorthandAmbientModule;
56445647 function isBlockScopedContainerTopLevel(node) {
56455648 return node.kind === 256 /* SourceFile */ ||
56465649 node.kind === 225 /* ModuleDeclaration */ ||
@@ -17445,7 +17448,7 @@ var ts;
1744517448 function getTargetOfImportClause(node) {
1744617449 var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier);
1744717450 if (moduleSymbol) {
17448- var exportDefaultSymbol = ts.isShorthandAmbientModule (moduleSymbol.valueDeclaration ) ?
17451+ var exportDefaultSymbol = ts.isShorthandAmbientModuleSymbol (moduleSymbol) ?
1744917452 moduleSymbol :
1745017453 moduleSymbol.exports["export="] ?
1745117454 getPropertyOfType(getTypeOfSymbol(moduleSymbol.exports["export="]), "default") :
@@ -17518,7 +17521,7 @@ var ts;
1751817521 if (targetSymbol) {
1751917522 var name_10 = specifier.propertyName || specifier.name;
1752017523 if (name_10.text) {
17521- if (ts.isShorthandAmbientModule (moduleSymbol.valueDeclaration )) {
17524+ if (ts.isShorthandAmbientModuleSymbol (moduleSymbol)) {
1752217525 return moduleSymbol;
1752317526 }
1752417527 var symbolFromVariable = void 0;
@@ -19549,7 +19552,7 @@ var ts;
1954919552 function getTypeOfFuncClassEnumModule(symbol) {
1955019553 var links = getSymbolLinks(symbol);
1955119554 if (!links.type) {
19552- if (symbol.valueDeclaration.kind === 225 /* ModuleDeclaration */ && ts.isShorthandAmbientModule (symbol.valueDeclaration )) {
19555+ if (symbol.valueDeclaration.kind === 225 /* ModuleDeclaration */ && ts.isShorthandAmbientModuleSymbol (symbol)) {
1955319556 links.type = anyType;
1955419557 }
1955519558 else {
@@ -24454,7 +24457,7 @@ var ts;
2445424457 // type. Otherwise, the types are completely unrelated, so narrow to an intersection of the
2445524458 // two types.
2445624459 var targetType = type.flags & 16384 /* TypeParameter */ ? getApparentType(type) : type;
24457- return isTypeSubtypeOf(candidate, targetType ) ? candidate :
24460+ return isTypeSubtypeOf(candidate, type ) ? candidate :
2445824461 isTypeAssignableTo(type, candidate) ? type :
2445924462 isTypeAssignableTo(candidate, targetType) ? candidate :
2446024463 getIntersectionType([type, candidate]);
@@ -33082,8 +33085,8 @@ var ts;
3308233085 }
3308333086 function moduleExportsSomeValue(moduleReferenceExpression) {
3308433087 var moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression);
33085- if (!moduleSymbol) {
33086- // module not found - be conservative
33088+ if (!moduleSymbol || ts.isShorthandAmbientModuleSymbol(moduleSymbol) ) {
33089+ // If the module is not found or is shorthand, assume that it may export a value.
3308733090 return true;
3308833091 }
3308933092 var hasExportAssignment = hasExportAssignmentSymbol(moduleSymbol);
0 commit comments