Skip to content

Commit

Permalink
docs: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Aug 18, 2020
1 parent 7d75327 commit 9439410
Show file tree
Hide file tree
Showing 5 changed files with 162 additions and 45 deletions.
135 changes: 95 additions & 40 deletions core/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- [Overview](#overview)
- [Installation](#installation)
- [API](#api)
- [DefaultStore](#defaultstore)
- [ArgUsageLocation](#argusagelocation)
- [SmartControls](#smartcontrols)
- [SourceIdentifier](#sourceidentifier)
Expand All @@ -21,7 +22,7 @@
- [CURRENT_STORY](#current_story)
- [defDocType](#defdoctype)
- [dateToLocalString](#datetolocalstring)
- [defaultStore](#defaultstore)
- [getDefaultStore](#getdefaultstore)
- [ControlTypes](#controltypes)
- [ComponentControlArray](#componentcontrolarray)
- [ComponentControlBase](#componentcontrolbase)
Expand Down Expand Up @@ -75,12 +76,12 @@
- [defaultBuildConfig](#defaultbuildconfig)
- [defaultRunConfig](#defaultrunconfig)
- [StoreObserver](#storeobserver-1)
- [Story](#story-1)
- [Components](#components-1)
- [RunConfiguration](#runconfiguration-1)
- [Documents](#documents-1)
- [Packages](#packages-1)
- [Stories](#stories-1)
- [Story](#story-1)
- [StoryArguments](#storyarguments-1)
- [StoryRenderFn](#storyrenderfn-1)
- [DocType](#doctype-1)
Expand All @@ -96,11 +97,14 @@
- [PageConfiguration](#pageconfiguration-1)
- [BuildConfiguration](#buildconfiguration-1)
- [WebpackConfigFn](#webpackconfigfn-1)
- [Story](#story-2)
- [DocType](#doctype-2)
- [SideNavConfiguration](#sidenavconfiguration-2)
- [PageTabs](#pagetabs-2)
- [WebpackConfig](#webpackconfig-2)
- [PagesOnlyRoutes](#pagesonlyroutes-2)
- [StoryArguments](#storyarguments-2)
- [StoryRenderFn](#storyrenderfn-2)
- [WebpackConfigFn](#webpackconfigfn-2)
- [DocType](#doctype-3)
- [PageConfiguration](#pageconfiguration-2)
Expand Down Expand Up @@ -133,6 +137,25 @@ $ npm install @component-controls/core --save-dev

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

## DefaultStore

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



### properties

| Name | Type | Description |
| ----------------- | --------------------------------------------------------------------------------- | ----------- |
| `components*` | | |
| `config*` | | |
| `docs*` | | |
| `packages*` | | |
| `stories*` | | |
| `addObserver*` | **function** addObserver(`observer`\*: [StoreObserver](#storeobserver)): void; | |
| `removeObserver*` | **function** removeObserver(`observer`\*: [StoreObserver](#storeobserver)): void; | |
| `updateStory*` | **function** updateStory(`story`\*: [Story](#story)): void; | |

## ArgUsageLocation

_defined in [@component-controls/core/src/document.ts](https://github.com/ccontrols/component-controls/tree/master/core/core/src/document.ts#L12)_
Expand Down Expand Up @@ -387,25 +410,11 @@ _defined in [@component-controls/core/src/document.ts](https://github.com/ccontr
| `date` | [Date](#date) | |
| `returns` | string | |

## defaultStore

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

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


### properties

| Name | Type | Description |
| ----------------- | --------------------------------------------------------------------------------- | ----------- |
| `_observers*` | undefined\[] | |
| `components*` | | |
| `config*` | | |
| `docs*` | | |
| `packages*` | | |
| `stories*` | | |
| `addObserver*` | **function** addObserver(`observer`\*: [StoreObserver](#storeobserver)): void; | |
| `removeObserver*` | **function** removeObserver(`observer`\*: [StoreObserver](#storeobserver)): void; | |
| `updateStory*` | **function** updateStory(`story`\*: [Story](#story)): void; | |
**function** getDefaultStore(): [Store](#store);

## ControlTypes

Expand Down Expand Up @@ -1259,6 +1268,27 @@ _defined in [@component-controls/core/src/document.ts](https://github.com/ccontr
| `story` | [Story](#story) | |
| `returns` | void | |

## Story

Story interface - usually extracted by the AST instrumenting loader

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

### properties

| Name | Type | Description |
| ------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `arguments` | [StoryArguments](#storyarguments) | arguments passed to the story function. eg \`export const story = props => &lt;Story {...props} />;\` |
| `description` | string | story extended description. can use markdown. |
| `doc` | string | title of the file/group of stories |
| `id` | string | id of the story |
| `loc` | [CodeLocation](#codelocation) | location in the source file of the story definition |
| `name*` | string | name of the Story. |
| `renderFn` | [StoryRenderFn](#storyrenderfn) | render function for the story |
| `source` | string | the source code of the story, extracted by the AST instrumenting loaders |
| `subtitle` | string | optional story subtitle property |
| `StoryProps` | [StoryProps](#storyprops) | |

## Components

list of components used in stories
Expand Down Expand Up @@ -1318,27 +1348,6 @@ Record&lt;string,

>
## Story

Story interface - usually extracted by the AST instrumenting loader

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

### properties

| Name | Type | Description |
| ------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `arguments` | [StoryArguments](#storyarguments) | arguments passed to the story function. eg \`export const story = props => &lt;Story {...props} />;\` |
| `description` | string | story extended description. can use markdown. |
| `doc` | string | title of the file/group of stories |
| `id` | string | id of the story |
| `loc` | [CodeLocation](#codelocation) | location in the source file of the story definition |
| `name*` | string | name of the Story. |
| `renderFn` | [StoryRenderFn](#storyrenderfn) | render function for the story |
| `source` | string | the source code of the story, extracted by the AST instrumenting loaders |
| `subtitle` | string | optional story subtitle property |
| `StoryProps` | [StoryProps](#storyprops) | |

## StoryArguments

list of story arguments. Each argument can be a deconstructed argument of itself
Expand Down Expand Up @@ -1547,6 +1556,27 @@ _defined in [@component-controls/core/src/configuration.ts](https://github.com/c
| `options` | any | |
| `returns` | [WebpackConfiguration](#webpackconfiguration) | |

## Story

Story interface - usually extracted by the AST instrumenting loader

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

### properties

| Name | Type | Description |
| ------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `arguments` | [StoryArguments](#storyarguments) | arguments passed to the story function. eg \`export const story = props => &lt;Story {...props} />;\` |
| `description` | string | story extended description. can use markdown. |
| `doc` | string | title of the file/group of stories |
| `id` | string | id of the story |
| `loc` | [CodeLocation](#codelocation) | location in the source file of the story definition |
| `name*` | string | name of the Story. |
| `renderFn` | [StoryRenderFn](#storyrenderfn) | render function for the story |
| `source` | string | the source code of the story, extracted by the AST instrumenting loaders |
| `subtitle` | string | optional story subtitle property |
| `StoryProps` | [StoryProps](#storyprops) | |

## DocType

_defined in [@component-controls/core/src/configuration.ts](https://github.com/ccontrols/component-controls/tree/master/core/core/src/configuration.ts#L30)_
Expand Down Expand Up @@ -1596,6 +1626,31 @@ Record&lt;

>
## StoryArguments

list of story arguments. Each argument can be a deconstructed argument of itself
the first argument are the control 'values'

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

[StoryArgument](#storyargument)\[]

## StoryRenderFn

story render function

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

**function** (`controlValues`\*: \[key: string]: any, `context`: any): any;

### parameters

| Name | Type | Description |
| ---------------- | ------------------- | ----------- |
| `controlValues*` | \[key: string]: any | |
| `context` | any | |
| `returns` | any | |

## WebpackConfigFn

_defined in [@component-controls/core/src/configuration.ts](https://github.com/ccontrols/component-controls/tree/master/core/core/src/configuration.ts#L100)_
Expand Down
10 changes: 6 additions & 4 deletions core/webpack-compile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,31 +44,33 @@ _defined in [@component-controls/webpack-compile/src/index.ts](https://github.co
compile the stories with webpack
returns the stories store object

_defined in [@component-controls/webpack-compile/src/index.ts](https://github.com/ccontrols/component-controls/tree/master/core/webpack-compile/src/index.ts#L13)_
_defined in [@component-controls/webpack-compile/src/index.ts](https://github.com/ccontrols/component-controls/tree/master/core/webpack-compile/src/index.ts#L15)_

**function** compile(`__namedParameters`\*: **bundleName**: string**configPath**: string**distFolder**: string**presets**: string | [RuleOptions](#ruleoptions)\[]**staticFolder**: string**webPack**: [Configuration](#configuration)): Promise&lt;[CompileResults](#compileresults)>;
**function** compile(`__namedParameters`\*: **bundleName**: string**configPath**: string**distFolder**: string**presets**: string | [RuleOptions](#ruleoptions)\[]**staticFolder**: string**webPack**: [Configuration](#configuration), `callback`: [CompilerCallbackFn](#compilercallbackfn)): Promise&lt;[CompileResults](#compileresults)>;

### parameters

| Name | Type | Description |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| `__namedParameters*` | **bundleName**: string**configPath**: string**distFolder**: string**presets**: string \| [RuleOptions](#ruleoptions)\[]**staticFolder**: string**webPack**: [Configuration](#configuration) | |
| `callback` | [CompilerCallbackFn](#compilercallbackfn) | |
| `returns` | Promise&lt;[CompileResults](#compileresults)> | |

## watch

compile the stories with webpack and launch watching for changes
returns the stories store object

_defined in [@component-controls/webpack-compile/src/index.ts](https://github.com/ccontrols/component-controls/tree/master/core/webpack-compile/src/index.ts#L40)_
_defined in [@component-controls/webpack-compile/src/index.ts](https://github.com/ccontrols/component-controls/tree/master/core/webpack-compile/src/index.ts#L49)_

**function** watch(`__namedParameters`\*: **bundleName**: string**configPath**: string**distFolder**: string**presets**: string | [RuleOptions](#ruleoptions)\[]**staticFolder**: string**watchOptions**: [WatchOptions](#watchoptions)**webPack**: [Configuration](#configuration)): Promise&lt;[CompileResults](#compileresults)>;
**function** watch(`__namedParameters`\*: **bundleName**: string**configPath**: string**distFolder**: string**presets**: string | [RuleOptions](#ruleoptions)\[]**staticFolder**: string**watchOptions**: [WatchOptions](#watchoptions)**webPack**: [Configuration](#configuration), `callback`: [CompilerCallbackFn](#compilercallbackfn)): Promise&lt;[CompileResults](#compileresults)>;

### parameters

| Name | Type | Description |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- |
| `__namedParameters*` | **bundleName**: string**configPath**: string**distFolder**: string**presets**: string \| [RuleOptions](#ruleoptions)\[]**staticFolder**: string**watchOptions**: [WatchOptions](#watchoptions)**webPack**: [Configuration](#configuration) | |
| `callback` | [CompilerCallbackFn](#compilercallbackfn) | |
| `returns` | Promise&lt;[CompileResults](#compileresults)> | |

<!-- END-TSDOC-TYPESCRIPT -->
Loading

0 comments on commit 9439410

Please sign in to comment.