TypeStrong / dts-bundle

Export TypeScript .d.ts files as an external module definition
MIT License
308 stars 57 forks source link

Export declaration conflicts #37

Closed heruan closed 8 years ago

heruan commented 8 years ago

Say I have a main index.d.ts generated by the TS compiler such as:

import { Logger } from "logger";
import { Cache } from "cache;
export { Logger, Cache };

then dts-bundle produces this:

declare module "my-module" {
    import { Logger } from "logger";
    import { Cache } from "cache;
    export { Logger, Cache };
}

which throws this error when seen by the compiler:

Export declaration conflicts with exported declaration of 'Logger'"
Export declaration conflicts with exported declaration of 'Cache'"

After removing the export { Logger, Cache }; line, it works.

heruan commented 8 years ago

IMHO dts-bundle should remove all exports of types already present in the module declaration, since anything in the module declaration is already exported implicitly.

heruan commented 8 years ago

Maybe I'm wrong, closing for now until I've a chance to investigate more on this.