Generate TypeScript ambient declarations from react-native’s Flow source.
This is a work-in-progress. Current results can be found here.
git clone https://github.com/alloy/rn2dts.git
cd rn2dts
yarn install
yarn start
- Support platform file extensions, at first just by assuming iOS.
- Feed tsc file contents from memory, instead of having to persist to disk first.
- Make warnings from jscodeshift & flow-to-ts show up.
- Comments do not take inserted import typeof lines of code into account, see e.g. this file.
- Make nominal types, in order to not inline all properties in declarations:
- Libraries/Components/View/ViewPropTypes.js
- Libraries/Components/TextInput/TextInput.js ?
- Libraries/StyleSheet/StyleSheetTypes.js