Open nicolo-ribaudo opened 6 months ago
So the issue is that the compiler generates dts like so:
export declare function a(): void;
export declare namespace a {
var fn: typeof import("./other-file").fn;
}
And then the tool traverse this and removes all dynamic imports of local files (it happens here) and resolves the name on the right with its registered "local" name. The issue is that the tool doesn't consider any names declared in namespaces thus fn
stays fn
, not being renamed to something fn$1
or so.
Bug report
Input code
Actual output
Notice that the type of
var fn
refers tovar fn
and not tofunction fn
Expected output
Maybe this?
or this
Additional context
This also happens in rollup-plugin-dts