import type { AnyActionReducer, StateReducer } from '../../libs/cargo-hold'; import type { WithActionKey, WithIdleType, WithLensInstance, WithPayloadTypes, WithSuccessType } from './async.builder.types'; import type { AsyncIdleState, AsyncLoadingMoreState, AsyncLoadingState, AsyncState, AsyncSuccessState } from './async.types'; /** * Given a payload it will return a state reducer that gives us an idle state of that payload. * * @param _builder * @return */ export declare const buildInitStateReducer: (_builder: WithIdleType) => (payload: IdleType) => () => AsyncIdleState; /** * Given a payload it will return a state reducer that gives us a loading state of that payload. * * @param _builder * @return */ export declare const buildLoadingStateReducer: (_builder: WithIdleType & WithSuccessType) => (payload: SuccessType | IdleType) => () => AsyncLoadingState; /** * Given a payload it will return a state reducer that gives us a loading more state * of that payload. * * @param _builder * @return */ export declare const buildLoadingMoreStateReducer: (_builder: WithSuccessType) => (payload: SuccessType) => () => AsyncLoadingMoreState; /** * Given a payload it will return a state reducer that gives us a success state of that payload. * * @param _builder * @return */ export declare const buildSuccessStateReducer: (_builder: WithSuccessType) => (payload: SuccessType) => () => AsyncSuccessState; /** * Given a failure it will return a state reducer that gives us a failure state. * * @param _builder * @return */ export declare const buildFailureStateReducer: (_builder: WithPayloadTypes) => (failure: FailureType) => (state: AsyncState) => import("./async.types").AsyncFailureState; /** * Given a payload it will return a state reducer that reverts to the given payload but leaving * the status the same. * * @param _builder * @return */ export declare const buildRevertStateReducer: (_builder: WithPayloadTypes) => (payload: SuccessType | IdleType) => StateReducer>; /** * Given a builder this makes an action reducer that results in an idle state. * * @param builder A builder with an action key and an idle type. * @return */ export declare const buildInitActionReducer: (builder: WithActionKey & WithIdleType) => AnyActionReducer>; /** * Given a builder this makes an action reducer that results in a loading state. * * @param builder A builder with an action key and a loading type. * @return */ export declare const buildLoadingActionReducer: (builder: WithActionKey & WithIdleType & WithSuccessType) => AnyActionReducer>; /** * Given a builder this makes an action reducer that results in a loading more state. * * @param builder A builder with an action key and a loading more type. * @return */ export declare const buildLoadingMoreActionReducer: (builder: WithActionKey & WithSuccessType) => AnyActionReducer>; /** * Given a builder this makes an action reducer that results in a success state. * * @param builder A builder with an action key and a success type. * @return */ export declare const buildSuccessActionReducer: (builder: WithActionKey & WithSuccessType) => AnyActionReducer>; /** * Given a builder this makes an action reducer that results in a failure state. * * @param builder A builder with an action key and payload types. * @return */ export declare const buildFailureActionReducer: (builder: WithActionKey & import("./async.builder.types").WithFailureType & WithIdleType & WithSuccessType) => AnyActionReducer>; /** * Given a builder this makes an action reducer that results in a reverted payload. * * @param builder A builder with an action key and payload types. * @return */ export declare const buildRevertActionReducer: (builder: WithActionKey & import("./async.builder.types").WithFailureType & WithIdleType & WithSuccessType) => AnyActionReducer>; /** * Given a builder it makes an action reducer that looks for all of the async actions * and performs the appropriate state change. * * @param builder A builder with an action key an payload types. * @return */ export declare const buildCombinedReducers: (builder: WithActionKey & import("./async.builder.types").WithFailureType & WithIdleType & WithSuccessType) => AnyActionReducer>; /** * Returns an action reducer from buildCombinedReducers, but run in a lens so that it handles * a larger data structure. * * @param builder * @return */ export declare const buildCombinedLensedReducers: (builder: WithActionKey & WithLensInstance & import("./async.builder.types").WithFailureType & WithIdleType & WithSuccessType) => AnyActionReducer;