Flow Type definitions
Opened this issue · 0 comments
NShahri commented
At the moment the only way to export flow types is to rename .js
files to .js.flow
. It means you need to publish your source.
- facebook/flow#1996
- facebook/flow#6504
- Time to deprecate
gen-flow-files
facebook/flow#5871 - what's the future of flow gen-flow-files? facebook/flow#5519
- No simple way to author and share flow packages facebook/flow#1996
I am thinking about one of these solutions:
- Generate flow type definition manually (the same as
flow-typed
)- Keep it up to date manually (the same as TypeScript Definitions). This make sense for small packages like react-workbox.
- It does not make sense to use flow types in js, and have the same definition for exporting in another file
- Convert flow types to flow comments
- https://flow.org/blog/2015/02/20/Flow-Comments/
- Needs more to do
- There is a babel plugin: https://babeljs.io/docs/en/babel-plugin-transform-flow-comments
- It can be added to both
build/esm
andbuild/cjs