tc39 / proposal-first-class-protocols

a proposal to bring protocol-based interfaces to ECMAScript users

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is `export interface` needed?

bmeck opened this issue · comments

It seems that interfaces are objects, so couldn't you just:

interface Monad {/*...*/};
export default Monad;

It's just as necessary as any of the other combined declaration/export forms. You could make the same argument that we don't need

export class C {}

because we have

class C {}
export { C }

or

export function f() {}

because we have

function f() {}
export { f }

For consistency, I will leave this in the proposal.

Ah, might want to clear that up then, I assumed it was w/o a body.

like:

export interface T;

Okay, I will clear that up. Thanks for the feedback.