I\'m using TypeScript 1.5 beta, and I\'m trying to export an interface as the default export. The following code causes an error in both Visual Studio and WebStorm:
it is not necessary to export the interface
// Foo.ts
interface Foo {}
// Bar.ts
class Bar {
constructor(foo:Foo) {}
}
TypeScript v2.4.0 allows export default interface
. Here is the pull-request that introduced the change.
We can now do both of these:
// Foo.ts
export interface Foo { }
// Bar.ts
export default interface Bar { }
// Baz.ts
import { Foo } from "./foo";
import Bar from "./bar";
export class Baz implements Foo, Bar
{
}