import { ActionCreator } from './create-action-creator'; import { AnyAction } from './create-action'; import { Handler } from './types'; export declare const othersHandlerKey: unique symbol; declare type CustomHandlerMap = { [type in TAction['type']]: Handler; }; declare type OthersHandlerMap = { [othersHandlerKey]: Handler; }; export declare type HandlerMap = CustomHandlerMap | OthersHandlerMap; export declare type MergedHandlerMap = CustomHandlerMap & OthersHandlerMap; export declare type InferActionFromHandlerMap> = THandlerMap extends CustomHandlerMap ? T : never; export declare type InferNextStateFromHandlerMap> = THandlerMap extends CustomHandlerMap ? T : never; declare type InferActionFromCreator = TActionCreator extends (...args: any[]) => infer T ? T : never; declare type CreateOthersHandler = , TNextState extends TPrevState, TAction extends AnyAction = InferActionFromCreator>(handler: Handler) => OthersHandlerMap; declare type CreateCustomHandlerMap = , TNextState extends TPrevState, TAction extends AnyAction = InferActionFromCreator>(actionCreators: TActionCreator | TActionCreator[], handler: Handler) => CustomHandlerMap; export declare type CreateHandlerMap = CreateCustomHandlerMap & { others: CreateOthersHandler; }; /** * Handler map factory * @description create an action(s) to reducer map * @example * createHandlerMap(increment, (state: number) => state + 1) * @example * createHandlerMap([increment, increase], (state: number) => state + 1) * @example * createHandlerMap.others((state: number) => state + 1) */ export declare function createHandlerMap, TPrevState, TNextState extends TPrevState, TAction extends AnyAction = InferActionFromCreator>(actionCreators: TActionCreator | TActionCreator[], handler: Handler): CustomHandlerMap; export declare namespace createHandlerMap { var others: typeof createOthersHandlerMap; } declare function createOthersHandlerMap, TPrevState, TNextState extends TPrevState, TAction extends AnyAction = InferActionFromCreator>(handler: Handler): OthersHandlerMap; export {};