import { Reducer, Action, Types } from './type-helpers'; declare type CreateReducerChainApi = TPrevNotHandledAction, TNextNotHandledAction extends Exclude & ReturnType>, TAction extends TPrevNotHandledAction extends Action ? TPrevNotHandledAction extends ReturnType ? TPrevNotHandledAction : never : never>(singleOrMultipleCreatorsAndTypes: TType | TType[] | TCreator | TCreator[], reducer: (state: TState, action: TAction) => TState) => [TNextNotHandledAction] extends [never] ? Reducer & { handlers: Record TState>; } : Reducer & { handlers: Record['type'], (state: TState, action: TRootAction) => TState>; handleAction: CreateReducerChainApi; }; declare type GetAction = TAction extends Action ? TAction : never; declare type InitialHandler = { [P in TRootAction['type']]?: (state: TState, action: GetAction) => TState; }; declare type RootAction = Types extends { RootAction: infer T; } ? T : any; export declare function createReducer(initialState: TState, initialHandlers?: InitialHandler): Reducer & { readonly handlers: any; readonly handleAction: CreateReducerChainApi; }; export {};