@csod-oss/react-props-to-docs-ts
v0.0.12
Published
`npm install @csod-oss/react-props-to-docs-ts --save-dev`
Downloads
18
Readme
react-props-to-docs-ts
npm install @csod-oss/react-props-to-docs-ts --save-dev
Parse out documentation from the typescript interface that defines a React component's props.
import { propsParser } from '@csod-oss/react-props-to-docs-ts';
const docs = docsParser($packageName, component);
- Find declaration file (*.d.ts) based on component name
- accept declaration filename paramater in options
- use require.resolve to locate declaration
- Parse file and search for Component to retreive the documenting interface from its jsdoc comment
- Search for interface, retreive properties and corresponding typings with jsdocs