Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to export an interface as a default export in one line #8985

Closed
raybooysen opened this issue Jun 6, 2016 · 2 comments
Closed

Unable to export an interface as a default export in one line #8985

raybooysen opened this issue Jun 6, 2016 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@raybooysen
Copy link

raybooysen commented Jun 6, 2016

This is valid typescript

interface Bar {
    name: string;
}

export default Bar;

However, the compiler complains if I do this:

export default interface Bar {
    name: string;
}

I would have expected this to work in both cases as if I substitute interface with class it works fine.

Reading the spec here, https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#11.3.4, shows that interfaces cannot be part of a default export, but why?

Thanks!

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Jun 6, 2016
@RyanCavanaugh
Copy link
Member

Duplicate of #3792. Please use the GitHub search feature before logging new issues.

image

@raybooysen
Copy link
Author

Apologies. I didn't search

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants