@bebraw/extract-react-types

0.16.2 • Public • Published

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
      }
    }
  ]
}

Related projects:

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.16.2
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.16.2
    1
  • 0.16.1
    0
  • 0.16.0
    0

Package Sidebar

Install

npm i @bebraw/extract-react-types

Weekly Downloads

1

Version

0.16.2

License

Apache-2.0

Unpacked Size

57.2 kB

Total Files

7

Last publish

Collaborators

  • bebraw