You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is nothing on the roadmap for *.d.ts files at this time. I'm open to them being added. We would probably need to add some tests that validate them, so that they don't get out of date.
I tried using dts-gen from Microsoft last week to create Typescript definitions but couldn't get it working using their basic CLI usage on our npm library.
However I'm sure it'll be straightforward to write up a script that uses the source files to generate type definition files from the PropTypes we've already written.
. Only caveat is it seems to also removes prop-types... Never used it before but maybe there's a flag that can be passed to leave prop-types as is when converting.
Activity
interactivellama commentedon May 4, 2018
There is nothing on the roadmap for
*.d.ts
files at this time. I'm open to them being added. We would probably need to add some tests that validate them, so that they don't get out of date.[-]Typescript Type definitions[/-][+]Explore Typescript Type definitions[/+]interactivellama commentedon May 7, 2018
How can we do this based on propTypes in an automated way?
Also provide Flow typed definitions.
futuremint commentedon May 7, 2018
I tried using dts-gen from Microsoft last week to create Typescript definitions but couldn't get it working using their basic CLI usage on our npm library.
However I'm sure it'll be straightforward to write up a script that uses the source files to generate type definition files from the PropTypes we've already written.
davidlygagnon commentedon May 7, 2018
There is this codemod available to generate flow types from prop-types : https://medium.com/netscape/react-proptypes-to-flow-codemod-9757f5ec5381
. Only caveat is it seems to also removes prop-types... Never used it before but maybe there's a flag that can be passed to leave prop-types as is when converting.
I know I've used this: https://github.com/joarwilk/flowgen before to convert TypeScript defs to flow types, (but that's assuming we have TypeScript defs).
interactivellama commentedon May 7, 2018
We might be able to use something from react-docgen AST parser if we need to do something custom.
futuremint commentedon Sep 4, 2018
I'm going to work on adding a typedef file in October. I will also look into generating a library definition for flow as well.
28 remaining items