@bebraw/extract-react-types
Parse prop-types from react components using typescript or flow
Last updated 2 years ago by bebraw .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @bebraw/extract-react-types 
SYNC missed versions from official npm registry.

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:

Current Tags

  • 0.16.2                                ...           latest (2 years ago)

3 Versions

  • 0.16.2                                ...           2 years ago
  • 0.16.1                                ...           2 years ago
  • 0.16.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 5
Last Day 0
Last Week 5
Last Month 3
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |