Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Dosant committed May 28, 2020
1 parent c0cbd0e commit e693561
Show file tree
Hide file tree
Showing 25 changed files with 125 additions and 112 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## BaseState type

Base state shape valid for state container
Base [StateContainer](./kibana-plugin-plugins-kibana_utils-common-state_containers.statecontainer.md) state shape

<b>Signature:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## BaseStateContainer.get property

Retrieves current state from the container

<b>Signature:</b>

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface BaseStateContainer<State extends BaseState>

| Property | Type | Description |
| --- | --- | --- |
| [get](./kibana-plugin-plugins-kibana_utils-common-state_containers.basestatecontainer.get.md) | <code>() =&gt; State</code> | |
| [set](./kibana-plugin-plugins-kibana_utils-common-state_containers.basestatecontainer.set.md) | <code>(state: State) =&gt; void</code> | |
| [state$](./kibana-plugin-plugins-kibana_utils-common-state_containers.basestatecontainer.state_.md) | <code>Observable&lt;State&gt;</code> | |
| [get](./kibana-plugin-plugins-kibana_utils-common-state_containers.basestatecontainer.get.md) | <code>() =&gt; State</code> | Retrieves current state from the container |
| [set](./kibana-plugin-plugins-kibana_utils-common-state_containers.basestatecontainer.set.md) | <code>(state: State) =&gt; void</code> | Sets state into container |
| [state$](./kibana-plugin-plugins-kibana_utils-common-state_containers.basestatecontainer.state_.md) | <code>Observable&lt;State&gt;</code> | of state |

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## BaseStateContainer.set property

Sets state into container

<b>Signature:</b>

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## BaseStateContainer.state$ property

of state

<b>Signature:</b>

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export declare function createStateContainer<State extends BaseState, PureTransi
| Parameter | Type | Description |
| --- | --- | --- |
| defaultState | <code>State</code> | initial state |
| pureTransitions | <code>PureTransitions</code> | state transitions configuration object |
| pureTransitions | <code>PureTransitions</code> | state transitions configuration object. Map of . |

<b>Returns:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export declare function createStateContainer<State extends BaseState, PureTransi
| Parameter | Type | Description |
| --- | --- | --- |
| defaultState | <code>State</code> | initial state |
| pureTransitions | <code>PureTransitions</code> | state transitions configuration object |
| pureSelectors | <code>PureSelectors</code> | state selectors configuration object |
| options | <code>CreateStateContainerOptions</code> | |
| pureTransitions | <code>PureTransitions</code> | state transitions configuration object. Map of . |
| pureSelectors | <code>PureSelectors</code> | state selectors configuration object. Map of . |
| options | <code>CreateStateContainerOptions</code> | state container options [CreateStateContainerOptions](./kibana-plugin-plugins-kibana_utils-common-state_containers.createstatecontaineroptions.md) |

<b>Returns:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## createStateContainerReactHelpers variable

Creates helpers for using [State Containers](./kibana-plugin-plugins-kibana_utils-common-state_containers.statecontainer.md) with react
Creates helpers for using [State Containers](./kibana-plugin-plugins-kibana_utils-common-state_containers.statecontainer.md) with react Refer to \[guide\](https://github.com/elastic/kibana/blob/master/src/plugins/kibana\_utils/docs/state\_containers/react.md) for details

<b>Signature:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

## Dispatch type

Redux like dispatch

<b>Signature:</b>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-kibana\_utils-common-state\_containers](./kibana-plugin-plugins-kibana_utils-common-state_containers.md) &gt; [EnsurePureTransition](./kibana-plugin-plugins-kibana_utils-common-state_containers.ensurepuretransition.md)

## EnsurePureTransition type


<b>Signature:</b>

```typescript
export declare type EnsurePureTransition<T> = Ensure<T, PureTransition<any, any>>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,29 @@ State containers are Redux-store-like objects meant to help you manage state in
| --- | --- |
| [BaseStateContainer](./kibana-plugin-plugins-kibana_utils-common-state_containers.basestatecontainer.md) | Base state container shape without transitions or selectors |
| [CreateStateContainerOptions](./kibana-plugin-plugins-kibana_utils-common-state_containers.createstatecontaineroptions.md) | State container options |
| [ReduxLikeStateContainer](./kibana-plugin-plugins-kibana_utils-common-state_containers.reduxlikestatecontainer.md) | Fully featured state container which matches Redux store interface |
| [StateContainer](./kibana-plugin-plugins-kibana_utils-common-state_containers.statecontainer.md) | Fully featured state container with selectors and transitions |
| [TransitionDescription](./kibana-plugin-plugins-kibana_utils-common-state_containers.transitiondescription.md) | |
| [ReduxLikeStateContainer](./kibana-plugin-plugins-kibana_utils-common-state_containers.reduxlikestatecontainer.md) | Fully featured state container which matches Redux store interface. Extends [StateContainer](./kibana-plugin-plugins-kibana_utils-common-state_containers.statecontainer.md) Allows to use state container with redux libraries |
| [StateContainer](./kibana-plugin-plugins-kibana_utils-common-state_containers.statecontainer.md) | Fully featured state container with and . Extends [BaseStateContainer](./kibana-plugin-plugins-kibana_utils-common-state_containers.basestatecontainer.md) |

## Variables

| Variable | Description |
| --- | --- |
| [createStateContainerReactHelpers](./kibana-plugin-plugins-kibana_utils-common-state_containers.createstatecontainerreacthelpers.md) | Creates helpers for using [State Containers](./kibana-plugin-plugins-kibana_utils-common-state_containers.statecontainer.md) with react |
| [createStateContainerReactHelpers](./kibana-plugin-plugins-kibana_utils-common-state_containers.createstatecontainerreacthelpers.md) | Creates helpers for using [State Containers](./kibana-plugin-plugins-kibana_utils-common-state_containers.statecontainer.md) with react Refer to \[guide\](https://github.com/elastic/kibana/blob/master/src/plugins/kibana\_utils/docs/state\_containers/react.md) for details |
| [useContainerSelector](./kibana-plugin-plugins-kibana_utils-common-state_containers.usecontainerselector.md) | Apply selector to state container to extract only needed information. Will re-render your component only when the section changes. |
| [useContainerState](./kibana-plugin-plugins-kibana_utils-common-state_containers.usecontainerstate.md) | Returns the latest state of a state container. |
| [useContainerState](./kibana-plugin-plugins-kibana_utils-common-state_containers.usecontainerstate.md) | Returns the latest state of a [StateContainer](./kibana-plugin-plugins-kibana_utils-common-state_containers.statecontainer.md)<!-- -->. |

## Type Aliases

| Type Alias | Description |
| --- | --- |
| [BaseState](./kibana-plugin-plugins-kibana_utils-common-state_containers.basestate.md) | Base state shape valid for state container |
| [BaseState](./kibana-plugin-plugins-kibana_utils-common-state_containers.basestate.md) | Base [StateContainer](./kibana-plugin-plugins-kibana_utils-common-state_containers.statecontainer.md) state shape |
| [Comparator](./kibana-plugin-plugins-kibana_utils-common-state_containers.comparator.md) | |
| [Connect](./kibana-plugin-plugins-kibana_utils-common-state_containers.connect.md) | |
| [Dispatch](./kibana-plugin-plugins-kibana_utils-common-state_containers.dispatch.md) | |
| [Dispatch](./kibana-plugin-plugins-kibana_utils-common-state_containers.dispatch.md) | Redux like dispatch |
| [EnsurePureTransition](./kibana-plugin-plugins-kibana_utils-common-state_containers.ensurepuretransition.md) | |
| [MapStateToProps](./kibana-plugin-plugins-kibana_utils-common-state_containers.mapstatetoprops.md) | |
| [Middleware](./kibana-plugin-plugins-kibana_utils-common-state_containers.middleware.md) | |
| [Middleware](./kibana-plugin-plugins-kibana_utils-common-state_containers.middleware.md) | Redux like Middleware |
| [PureSelector](./kibana-plugin-plugins-kibana_utils-common-state_containers.pureselector.md) | |
| [Reducer](./kibana-plugin-plugins-kibana_utils-common-state_containers.reducer.md) | |
| [Reducer](./kibana-plugin-plugins-kibana_utils-common-state_containers.reducer.md) | Redux like Reducer |
| [UnboxState](./kibana-plugin-plugins-kibana_utils-common-state_containers.unboxstate.md) | Utility type for inferring state shape from [StateContainer](./kibana-plugin-plugins-kibana_utils-common-state_containers.statecontainer.md) |

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

## Middleware type

Redux like Middleware

<b>Signature:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

## Reducer type

Redux like Reducer

<b>Signature:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## ReduxLikeStateContainer interface

Fully featured state container which matches Redux store interface
Fully featured state container which matches Redux store interface. Extends [StateContainer](./kibana-plugin-plugins-kibana_utils-common-state_containers.statecontainer.md) Allows to use state container with redux libraries

<b>Signature:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## StateContainer interface

Fully featured state container with selectors and transitions
Fully featured state container with and . Extends [BaseStateContainer](./kibana-plugin-plugins-kibana_utils-common-state_containers.basestatecontainer.md)

<b>Signature:</b>

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-kibana\_utils-common-state\_containers](./kibana-plugin-plugins-kibana_utils-common-state_containers.md) &gt; [UnboxState](./kibana-plugin-plugins-kibana_utils-common-state_containers.unboxstate.md)

## UnboxState type

Utility type for inferring state shape from [StateContainer](./kibana-plugin-plugins-kibana_utils-common-state_containers.statecontainer.md)

<b>Signature:</b>

```typescript
export declare type UnboxState<Container extends StateContainer<any, any>> = Container extends StateContainer<infer T, any> ? T : never;
```
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## useContainerState variable

Returns the latest state of a state container.
Returns the latest state of a [StateContainer](./kibana-plugin-plugins-kibana_utils-common-state_containers.statecontainer.md)<!-- -->.

<b>Signature:</b>

Expand Down
22 changes: 11 additions & 11 deletions src/dev/run_check_published_api_changes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const runApiExtractor = (
messageCallback: (message: ExtractorMessage) => {
if (message.messageId === 'console-api-report-not-copied') {
// ConsoleMessageId.ApiReportNotCopied
log.warning(`You have changed the signature of the ${folder} Core API`);
log.warning(`You have changed the signature of the ${folder} public API`);
log.warning(
'To accept these changes run `node scripts/check_published_api_changes.js --accept` and then:\n' +
"\t 1. Commit the updated documentation and API review file '" +
Expand All @@ -153,15 +153,15 @@ const runApiExtractor = (
message.handled = true;
} else if (message.messageId === 'console-api-report-copied') {
// ConsoleMessageId.ApiReportCopied
log.warning(`You have changed the signature of the ${folder} Core API`);
log.warning(`You have changed the signature of the ${folder} public API`);
log.warning(
"Please commit the updated API documentation and the API review file: '" +
config.reportFilePath
);
message.handled = true;
} else if (message.messageId === 'console-api-report-unchanged') {
// ConsoleMessageId.ApiReportUnchanged
log.info(`Core ${folder} API: no changes detected ✔`);
log.info(`${folder} API: no changes detected ✔`);
message.handled = true;
}
},
Expand All @@ -181,7 +181,7 @@ async function run(
folder: string,
{ log, opts }: { log: ToolingLog; opts: Options }
): Promise<boolean> {
log.info(`Core ${folder} API: checking for changes in API signature...`);
log.info(`${folder} API: checking for changes in API signature...`);

const { apiReportChanged, succeeded } = runApiExtractor(log, folder, opts.accept);

Expand All @@ -199,7 +199,7 @@ async function run(
log.error(e);
return false;
}
log.info(`Core ${folder} API: updated documentation ✔`);
log.info(`${folder} API: updated documentation ✔`);
}

// If the api signature changed or any errors or warnings occured, exit with an error
Expand Down Expand Up @@ -248,25 +248,25 @@ async function run(
dedent(chalk`
{dim usage:} node scripts/check_published_api_changes [...options]
Checks for any changes to the Kibana Core API
Checks for any changes to the Kibana shared API
Examples:
{dim # Checks for any changes to the Kibana Core API}
{dim # Checks for any changes to the Kibana shared API}
{dim $} node scripts/check_published_api_changes
{dim # Checks for any changes to the Kibana Core API and updates the documentation}
{dim # Checks for any changes to the Kibana shared API and updates the documentation}
{dim $} node scripts/check_published_api_changes --docs
{dim # Checks for and automatically accepts and updates documentation for any changes to the Kibana Core API}
{dim # Checks for and automatically accepts and updates documentation for any changes to the Kibana shared API}
{dim $} node scripts/check_published_api_changes --accept
{dim # Only checks the core/public directory}
{dim $} node scripts/check_published_api_changes --filter=core/public
Options:
--accept {dim Accepts all changes by updating the API Review files and documentation}
--docs {dim Updates the Core API documentation}
--docs {dim Updates the API documentation}
--filter {dim RegExp that folder names must match, folders: [${folders.join(', ')}]}
--help {dim Show this message}
`)
Expand All @@ -276,7 +276,7 @@ async function run(
}

try {
log.info(`Core: Building types...`);
log.info(`Building types for api extractor...`);
await runBuildTypes();
} catch (e) {
log.error(e);
Expand Down
Loading

0 comments on commit e693561

Please sign in to comment.