import type { AnyAction, Effect } from '../../libs/cargo-hold'; import type { WithActionKey, WithAsyncCallback, WithEnableLoadingMore, WithLensInstance, WithMapOnFailure, WithMapOnSuccess, WithOptimisticUpdate, WithPayloadTypes, WithTriggerActionFilter } from './async.builder.types'; import type { AsyncState } from './async.types'; export declare type AsyncEffectDeps = Partial & Partial> & Partial> & WithActionKey & WithPayloadTypes & WithTriggerActionFilter & (CallbackResultType extends SuccessType ? Partial> & WithAsyncCallback : WithAsyncCallback & WithMapOnSuccess); /** * Given a correctly-typed builder object, construct an Effect that will be triggered by the * triggering action, instigate loading states, run optimistic predictions, and end with success or * failure. Also reverts optimistic predictions if necessary on failure. * * @param builder * @return The async effect */ export declare const buildAsyncEffect: , CallbackResultType>(builder: AsyncEffectDeps) => Effect>; /** * Given a correctly-typed builder object, construct an Effect that will be triggered by the * triggering action, instigate loading states, run optimistic predictions, and end with success or * failure. Also reverts optimistic predictions if necessary on failure. This runs inside a lens, so * as to operate on a larger data structure. * * @param builder * @return The async effect */ export declare const buildAsyncEffectWithLens: , CallbackResultType, OuterStructureType>(builder: Partial & Partial> & Partial> & WithActionKey & import("./async.builder.types").WithFailureType & import("./async.builder.types").WithIdleType & import("./async.builder.types").WithSuccessType & WithTriggerActionFilter & (CallbackResultType extends SuccessType ? Partial> & WithAsyncCallback : WithAsyncCallback & WithMapOnSuccess) & WithLensInstance) => Effect;