Create a Flow Library Definition from a 3rd party library using typescript.
- https://github.com/SitePen/dts-generator
(sudo) npm i -g typescript(sudo) npm i -g dts-generator- Clone the library you want to port
dts-generator --name library-name --project /path/to/library --out library-name.d.ts
- https://github.com/joarwilk/flowgen
(sudo) npm i -g flowgenflowgen library-name.d.ts -o library-name.js
- https://flow.org/en/docs/libdefs/
- Create a folder
/flow-typedin your project that uses flow - Copy library-name.js there and it is ready to use
- https://github.com/flowtype/flow-typed
- If your ported definition really works, consider a pull request to the flow-typed repo.