import { Observable } from 'rxjs'; export declare type IState = { [key: string]: any; }; export interface IAction { type: string; payload: { [key: string]: any; }; } export declare type IDispatcher = (store: IStore, payload: A['payload']) => void; export declare type Reducer = (state: TState, action: TAction, options?: StoreContext) => TState | void; export declare type StoreContext = { context?: any; name?: string; key?: string; }; export declare type StateChange = { type: TAction['type']; state: TState; action: TAction; payload: TAction['payload']; options: StoreContext; }; export interface IActionEpic extends StateChange { dispatch: (type: T['type'], payload?: T['payload']) => void; } export interface IStore { readonly uid: string | number; readonly name?: string; readonly state$: Observable>; readonly state: S; readonly context?: any; dispatch: (type: T['type'], payload?: T['payload']) => IStore; reducer: (fn: Reducer) => IStore; reduce: (action: T['type'], fn: Reducer) => IStore; on: (action: T['type'] | Array) => Observable>; dict: (path: string, factory: StoreFactory) => IStore; add: (path: string, store: IStore) => IStore; remove: (path: string, options?: { key?: string; }) => IStore; get: (path?: string, options?: { key?: string; initialState?: S; }) => IStore | undefined; } export declare type StoreFactory = (options?: StoreFactoryOptions) => IStore; export declare type StoreFactoryOptions = { initial?: S; path?: string; key?: string; [key: string]: any; };