/** * Bounded-concurrency map: run an async worker over a list with at most * `limit` calls in flight, preserving input order in the result. * * Dependency-free; safe to import from any layer. * * @module lib/concurrency */ /** * Run `worker` over `items` with at most `limit` calls in flight. * * A worker that rejects rejects the whole call, as with `Promise.all`; callers * that must record per-item failures catch inside the worker. * * @param items - Inputs, processed in order of dispatch. * @param limit - Maximum concurrent workers (clamped to `1..items.length`). * @param worker - Async function applied to each item. * @returns Results in the same order as `items`. * @example * ```ts * const sizes = await runWithConcurrency(paths, 8, async (p) => (await stat(p)).size); * ``` */ export declare function runWithConcurrency(items: readonly T[], limit: number, worker: (item: T, index: number) => Promise): Promise; //# sourceMappingURL=concurrency.d.ts.map