Type annotations for default export
See original GitHub issueTypeScript Version: 2.1.1
Code
import * as webpack from 'webpack';
export default: webpack.Configuration {
};
Expected behavior: No error
Actual behavior:
[ts] Expression expected.
error at default:
I couldn’t find an issue for this but it’s very likely it’s a duplicate
Please 👍 on this issue if you want to see this feature in TypeScript and avoid adding "me too" comments. Thank you!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:348
- Comments:36 (7 by maintainers)
Top Results From Across the Web
Avoid Export Default - TypeScript Deep Dive - Gitbook
Discoverability is very poor for default exports. You cannot explore a module with intellisense to see if it has a default export or...
Read more >How to flow type annotate a default object export?
The shortest way to add a type definition to your problem is a cast in flow like the following: export default ({ test:...
Read more >Documentation - Modules - TypeScript
Each module can optionally export a default export. Default exports are marked with the keyword default ; and there can only be one...
Read more >Flow Annotate-Exports
Flow Annotate-Exports · It won't be able to fill in every required type annotation. Some cases will require manual effort. · Inserted annotations...
Read more >PEP 484 – Type Hints - Python Enhancement Proposals
For a checked function, the default annotation for arguments and for the return ... classes exported from typing (e.g. Sequence and Dict ),...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The problem with
is that it’s a cast, so it purposely loses type safety.
Yes, that’s what I do know but I wish I didn’t have to.