Skip to content

Commit

Permalink
feat: docs add extract union
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Mar 26, 2020
1 parent 6c99842 commit ed8e089
Show file tree
Hide file tree
Showing 10 changed files with 3,722 additions and 204 deletions.
37 changes: 29 additions & 8 deletions core/specification/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
- [Overview](#overview)
- [Installation](#installation)
- [API](#api)
- [RectDocgenTypescriptOptions](#rectdocgentypescriptoptions)
- [NodePath](#nodepath)
- [Scope](#scope)
- [ParserPluginWithOptions](#parserpluginwithoptions)

# Overview

Expand All @@ -23,17 +25,36 @@ $ npm install @component-controls/specification --save-dev

<!-- START-TSDOC-TYPESCRIPT -->

## RectDocgenTypescriptOptions

a callback to transfor them props table and the options to be passd to react-docgen-typescript.
## NodePath

_defined in [@component-controls/specification/src/test.ts](https://github.com/ccontrols/component-controls/tree/master/core/specification/src/test.ts#L6)_



### properties

| Name | Type | Description |
| ---------------- | ------------------------------------------------------------------------------------------ | ------------------------------------- |
| `transformProps` | undefined \| (`props`\*: [ComponentDoc](#componentdoc)\[]): [ComponentDoc](#componentdoc); | callback to transform the props table |
| `ParserOptions` | [ParserOptions](#parseroptions) | |
| Name | Type | Description |
| ------------- | --------------------- | ----------- |
| `parentPath*` | [NodePath](#nodepath) | |
| `scope*` | [Scope](#scope) | |

## Scope

_defined in [@component-controls/specification/src/test.ts](https://github.com/ccontrols/component-controls/tree/master/core/specification/src/test.ts#L1)_



### properties

| Name | Type | Description |
| --------- | ------------------------------------------------- | ----------- |
| `lookup*` | (`name`\*: string): [Scope](#scope) \| undefined; | |
| `node*` | [NodePath](#nodepath) | |

## ParserPluginWithOptions

_defined in [@component-controls/specification/src/test.ts](https://github.com/ccontrols/component-controls/tree/master/core/specification/src/test.ts#L11)_

\['decorators', [NodePath](#nodepath)] \| \['pipelineOperator', [Scope](#scope)]

<!-- END-TSDOC-TYPESCRIPT -->
22 changes: 12 additions & 10 deletions core/specification/src/test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { ParserOptions, ComponentDoc } from 'react-docgen-typescript';
export interface Scope {
lookup: (name: string) => Scope | undefined;
node: NodePath;
}

/**
* a callback to transfor them props table and the options to be passd to react-docgen-typescript.
*/
export type RectDocgenTypescriptOptions = {
/**
* callback to transform the props table
*/
transformProps?: (props: ComponentDoc[]) => ComponentDoc;
} & ParserOptions;
export interface NodePath {
parentPath: NodePath;
scope: Scope;
}

export type ParserPluginWithOptions =
| ['decorators', NodePath]
| ['pipelineOperator', Scope];
Loading

0 comments on commit ed8e089

Please sign in to comment.