import { AsyncOrPromise, InferData, MapData, MapRecordData, CombinedSettledResult, MapCombinedSettledResult, CombinedRaceResult } from './types'; /** * Returns the first successful result from an array or record of async states. * Supports both AsyncState and PromiseWithState. * * @example * ```ts * // Array form * const [key, data] = async.race([state1, state2]); * * // Map form * const [key, data] = async.race({ user: userState, posts: postsState }); * ``` */ export declare function race(states: T): [number, InferData]; export declare function race>(states: T): CombinedRaceResult; /** * Returns all data if all states are ready. * Supports both AsyncState and PromiseWithState, as array, record, or rest params. * * @example * ```ts * // Rest params (backward compatible) * const [a, b, c] = async.all(state1, state2, state3); * * // Array form - returns tuple of data * const [userData, postsData] = async.all([userState, postsState]); * * // Map form - returns record of data * const { user, posts } = async.all({ user: userState, posts: postsState }); * ``` */ export declare function all(states: T): MapData; export declare function all>(states: T): MapRecordData; export declare function all(...states: T): MapData; /** * Returns the first ready data from multiple states. * Supports both AsyncState and PromiseWithState, as array, record, or rest params. * * @example * ```ts * // Rest params (backward compatible) * const data = async.any(state1, state2, state3); * * // Array form * const data = async.any([state1, state2, state3]); * * // Map form * const data = async.any({ primary: primaryState, fallback: fallbackState }); * ``` */ export declare function any(states: T): InferData; export declare function any>(states: T): InferData; export declare function any(...states: T): InferData; /** * Returns settled results for all states (never throws). * Supports both AsyncState and PromiseWithState, as array, record, or rest params. * * @example * ```ts * // Rest params (backward compatible) * const results = async.settled(state1, state2); * * // Array form * const results = async.settled([state1, state2]); * // [{ status: "fulfilled", value: data1 }, { status: "rejected", reason: error }] * * // Map form * const results = async.settled({ user: userState, posts: postsState }); * // { user: { status: "fulfilled", value: userData }, posts: { status: "pending" } } * ``` */ export declare function settled(states: T): MapCombinedSettledResult; export declare function settled>(states: T): { [K in keyof T]: CombinedSettledResult>; }; export declare function settled(...states: T): MapCombinedSettledResult; //# sourceMappingURL=combine.d.ts.map