I am trying to compose some classes using ES2015 module syntax using TypeScript. Each class implements an interface in a .d.ts file.
Here are the MWE problems.
In the .d.ts file I have:
interface IBar { foo: IFoo;
My export:
// file: foo.ts export default class Foo implements IFoo { someFunction(): void {} // ... } // no errors yet.
And my import:
import Foo from "./foo"; export class Bar implements IBar { foo: IFoo = Foo; }
The error is here:
error TS2322: Type 'typeof Foo' is not assignable to type 'IFoo'. Property 'someFunction' is missing in type 'typeof Foo'.
Any ideas here?
javascript ecmascript-6 typescript
azz
source share