import { Focus } from '../types'; import { AsyncState, AsyncMode, AsyncHandler, AsyncOptions, AsyncActions } from './types'; import { Abortable } from './abortable'; /** * Internal implementation for focus-based async. * @internal */ export declare function asyncWithFocus(focus: Focus>, handler: AsyncHandler, options?: AsyncOptions): AsyncActions; /** * Create async actions bound to a focus (lens) for async state management. * Use *Query naming for read operations, *Mutation for write operations. * * @example * const userStore = store({ * name: 'user', * state: { user: async.fresh() }, * setup({ focus }) { * const userQuery = async.action(focus('user'), async (ctx, id: string) => { * const res = await fetch(`/api/users/${id}`, { signal: ctx.signal }); * return res.json(); * }); * return { fetchUser: userQuery.dispatch }; * }, * }); */ export declare function action(focus: Focus>, handler: AsyncHandler, options?: AsyncOptions): AsyncActions; /** * Create async actions with an Abortable (signal auto-injected). */ export declare function action(focus: Focus>, abortableFn: Abortable, options?: AsyncOptions): AsyncActions; //# sourceMappingURL=action.d.ts.map