I'm unable to import a class that was exported two times.
a.ts
import * as moduleB from "./b";
export class A {
b: moduleB.B;
constructor() {
this.b = new moduleB.B();
this.b.hello();
}
}
b.ts
import {C} from "./c";
export const B = C;
c.ts
export class C {
hello() {
console.log("hello");
}
}
The error message is:
a.ts(3,14): error TS2305: Module '"b"' has no exported member 'B'.
The problem seems to be that the type of C has not been probably exported with "export const B = C;". The error would go away if I change "b: moduleB.B;" to just "b: any;". How can I fix this?
Using a default export in b.ts would work but I want to export several things in b.ts so that's not an option. I'm using Typescript 1.7.5.