export interface Dispatch { (action: Action): void; (action: AsyncAction): PromiseLike; } export interface Action { type: string; payload?: any; } export declare type AsyncAction = (dispatch: Dispatch, getState: () => object) => PromiseLike; export declare type GetState = (STATA: object) => S; export declare type CreateAction = (options: { type: string; payload?: any; }) => Action | AsyncAction; export interface Reducers { [type: string]: (state: S, action: Action) => S; } export interface Effects { [type: string]: (tools: { dispatch: Dispatch; createAction: CreateAction; getState(): object; }, action: Action) => PromiseLike; } export default function registModel({ namespace, initialState, effects, reducers, ...addon }: { [key: string]: any; namespace: string; initialState: S; reducers: Reducers; effects: Effects; }): { getState: GetState; createAction: CreateAction; };