In TypeScript 1.5, I have the following interface in IFoo.ts:
// IFoo.ts
interface IFoo<T> {
bar(): T;
}
And an implementation in FooString.ts:
// FooString.ts
export default {
bar: () => 'Hello world'
}
How can the module FooString.ts declare the object literal it is exporting as an implementation of IFoo<sring>? Without a declaration, the implementation of the interface is not checked by the compiler, and losing compile-time checking of the FooString module would be problematic.