import { Reducer } from 'redux'; import { AnyQAppModuleDef, ExtractQAppModuleState } from './module'; import { AnyQAppMessage, AnyQAppMessageDef, ExtractQAppMessage } from './message'; export interface IQAppReducer extends Reducer, AnyQAppMessage> { (state: ExtractQAppModuleState, msg: AnyQAppMessage): ExtractQAppModuleState; } export declare type IQAppReducersMap = { [K in keyof ExtractQAppModuleState]: IQAppReducer[K]>; }; export interface IQAppReducerMutator { msgDef: TMsgDef; mutate: (state: Readonly>, payload: ExtractQAppMessage['payload'], msg: ExtractQAppMessage) => ExtractQAppModuleState; } export declare type ExtractQAppReducerState = TReducer extends IQAppReducer ? TState : never; export declare function createModuleReducer(moduleDef: TModuleDef, initialState: ExtractQAppModuleState, mutators: IQAppReducerMutator[]): IQAppReducer; export declare function combineReducers(reducers: IQAppReducersMap): IQAppReducer; export declare function on, TMsgDef extends AnyQAppMessageDef>(msgDef: TMsgDef, mutate: (state: Readonly, payload: ExtractQAppMessage['payload'], msg: ExtractQAppMessage) => TState): IQAppReducerMutator; export declare function getCreateModuleReducerTool(moduleDef: TModuleDef): (initialState: ExtractQAppModuleState, mutators: IQAppReducerMutator[]) => IQAppReducer;