import { PartialBy } from "../typings"; export declare const makePoolMachine: (params: MakePoolMachineParams) => import("xstate").StateMachine, any, { type: "START"; } | { type: "task.started"; index: number; } | { type: "task.resolved"; index: number; result: Return; } | { type: "task.rejected"; index: number; error: any; } | { type: "UPDATE_CONCURRENCY"; concurrency: number; } | { type: "DONE"; }, { value: any; context: Context; }, import("xstate").BaseActionObject, import("xstate").ServiceMap, import("xstate").ResolveTypegenMeta>; interface Context extends Pick, "concurrency" | "delayInMs"> { runningList: number[]; resolvedList: Array<{ index: number; result: Return; }>; rejectedList: Array<{ index: number; error: any; }>; } type Thunk = () => Promise; interface MakePoolMachineParams { taskList: Array>; concurrency: number; delayInMs?: number; onStart?: (index: number) => void; onSuccess?: (result: Return, index: number) => void; onError?: (error: any, index: number) => void; onDone?: (ctx: Context) => void; } export declare const createPool: (taskList: Thunk[], { autoStart, ...params }?: CreatePoolParams) => import("xstate").Interpreter, any, { type: "START"; } | { type: "task.started"; index: number; } | { type: "task.rejected"; index: number; error: any; } | { type: "UPDATE_CONCURRENCY"; concurrency: number; } | { type: "DONE"; } | { type: "task.resolved"; index: number; result: Return; }, { value: any; context: Context; }, import("xstate").ResolveTypegenMeta>; export declare const createAsyncPool: (taskList: Thunk[], { autoStart, ...params }?: CreatePoolParams) => Promise; interface CreatePoolParams extends Omit, "concurrency" | "delayInMs">, "taskList"> { autoStart?: boolean; } export {}; //# sourceMappingURL=poolMachine.d.ts.map