1 | import { State } from './index';
|
2 | export declare const STORAGE_KEY = "@storybook/ui/store";
|
3 | declare type GetState = () => State;
|
4 | declare type SetState = (a: any, b: any) => any;
|
5 | interface Upstream {
|
6 | getState: GetState;
|
7 | setState: SetState;
|
8 | }
|
9 | declare type Patch = Partial<State>;
|
10 | declare type InputFnPatch = (s: State) => Patch;
|
11 | declare type InputPatch = Patch | InputFnPatch;
|
12 | export interface Options {
|
13 | persistence: 'none' | 'session' | string;
|
14 | }
|
15 | declare type CallBack = (s: State) => void;
|
16 | export default class Store {
|
17 | upstreamGetState: GetState;
|
18 | upstreamSetState: SetState;
|
19 | constructor({ setState, getState }: Upstream);
|
20 | getInitialState(base: State): any;
|
21 | getState(): State;
|
22 | setState(inputPatch: InputPatch, options?: Options): Promise<State>;
|
23 | setState(inputPatch: InputPatch, callback?: CallBack, options?: Options): Promise<State>;
|
24 | }
|
25 | export {};
|