import { Action, AnyAction, Reducer } from 'redux'; import { DeepReadonly } from '../../types'; import { ActionReducerMapBuilder } from './mapBuilders'; import { NoInfer } from './tsHelpers'; export type CaseReducer = (state: S, action: A) => S | void; export interface ActionMatcher { (action: AnyAction): action is A; } /** * Defines a mapping from action types to corresponding action object shapes. * * @deprecated This should not be used manually - it is only used for internal * inference purposes and should not have any further value. * It might be removed in the future. * @public */ export type Actions = Record; /** * A mapping from action types to case reducers for `createReducer()`. * * @deprecated This should not be used manually - it is only used * for internal inference purposes and using it manually * would lead to type erasure. * It might be removed in the future. * @public */ export type CaseReducers = { [T in keyof AS]: AS[T] extends Action ? CaseReducer : void; }; export type ActionMatcherDescription = { matcher: ActionMatcher; reducer: CaseReducer>; }; export type ActionMatcherDescriptionCollection = Array>; export type NotFunction = T extends Function ? never : T; export type ReducerWithInitialState> = Reducer> & { getInitialState: () => DeepReadonly; }; export type ReadonlyActionMatcherDescriptionCollection = ReadonlyArray>; export declare function createReducer>(initialState: S | (() => S), builderCallback: (builder: ActionReducerMapBuilder) => void): ReducerWithInitialState; export declare function createReducer, CR extends CaseReducers = CaseReducers>(initialState: S | (() => S), actionsMap: CR, actionMatchers?: ActionMatcherDescriptionCollection, defaultCaseReducer?: CaseReducer): ReducerWithInitialState; //# sourceMappingURL=createReducer.d.ts.map