import { Reducer, Action, Types } from './type-helpers'; declare type HandleActionChainApi = TInputAction, THandledAction extends ReturnType, TOutputAction extends Exclude>(singleOrMultipleCreatorsAndTypes: TActionCreator | TActionCreator[], reducer: (state: TState, action: THandledAction) => TState) => [TOutputAction] extends [Action] ? Reducer & { handlers: Record['type'], (state: TState, action: TRootAction) => TState>; handleAction: HandleActionChainApi; } : Reducer & { handlers: Record TState>; }; declare type HandleTypeChainApi = >, TOutputAction extends Exclude>(singleOrMultipleCreatorsAndTypes: TType | TType[], reducer: (state: TState, action: THandledAction) => TState) => [TOutputAction] extends [Action] ? Reducer & { handlers: Record['type'], (state: TState, action: TRootAction) => TState>; handleType: HandleTypeChainApi; } : Reducer & { handlers: Record TState>; }; 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: InitialHandler; handleAction: [unknown] extends [TRootAction] ? any : HandleActionChainApi; handleType: [unknown] extends [TRootAction] ? any : HandleTypeChainApi; }>; export {};