google / google/closure-compiler
Allow to annotate `export default` with `@type`
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
(updated, see below) TypeScript allows to set a type on a function

CC should allow that too
This will allow to define a function as a type in one file and then use it in implementation.
This way I can create interfaces for functions, import them in implementations and have type checking done by the compiler. Otherwise, I have manually add the parameters to the function which I don't want to do because it's wasting time since I already have function's types in a separate place. TypeScript in vs code does it properly as you can see on the screenshot.
Contributor guide
Assessment
This issue has not been assessed yet.