Package Exports
- @uber-web-ui/extract-react-types
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@uber-web-ui/extract-react-types) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
extract-react-types
Extract Flow & TypeScript types from React Components
Features
- Supports flow and typescript
- Extracts the description of the props too ( Great for documentation )
Usage
$ yarn add extract-react-types
// Component.js
class Component extends React.Component<{ foo: boolean }> {}
Output:
{
"kind": "program",
"classes": [
{
"kind": "object",
"members": [
{
"kind": "property",
"key": {
"kind": "id",
"name": "foo"
},
"value": {
"kind": "boolean"
},
"optional": false
}
],
"name": {
"kind": "id",
"name": "Component",
"type": null
}
}
]
}