export interface ScheduledWork { value: T; /** Opaque scheduling lane. It is used for fairness and is never emitted. */ lane: string; } /** * Lets a running worker give its permit back while it waits on something that * is not scheduled work, such as a retry backoff. The worker regains a permit, * ahead of work that has not started, before `suspend` resolves. */ export interface SchedulerSlot { suspend(during: () => Promise): Promise; } export declare class SchedulerWaitError extends Error { readonly reason: 'cancelled' | 'deadline-exceeded'; constructor(reason: 'cancelled' | 'deadline-exceeded'); } /** * Deterministic-output, round-robin scheduler. Work may complete in any order, * but returned slots always match input order. A lane can consume at most one * newly assigned permit per round, preventing a busy lane from draining the * queue ahead of other eligible lanes. */ export declare function runBoundedFair(work: ScheduledWork[], concurrency: number, worker: (value: T, index: number, slot: SchedulerSlot) => Promise, options?: { signal?: AbortSignal; deadlineEpochMs?: number; now?: () => number; }): Promise>; //# sourceMappingURL=scheduler.d.ts.map