Fix export binding of namespaced typedefs (#40980)

The binder incorrectly rejected implicit namespace declarations in
typedefs.
This commit is contained in:
Nathan Shively-Sanders
2020-10-07 13:21:02 -07:00
committed by GitHub
parent 4dc7e59248
commit 4283428906
8 changed files with 80 additions and 17 deletions

View File

@@ -586,6 +586,9 @@ namespace ts {
}
function jsdocTreatAsExported(node: Node) {
if (node.parent && isModuleDeclaration(node)) {
node = node.parent;
}
if (!isJSDocTypeAlias(node)) return false;
// jsdoc typedef handling is a bit of a doozy, but to summarize, treat the typedef as exported if:
// 1. It has an explicit name (since by default typedefs are always directly exported, either at the top level or in a container), or