/** * Parallel execution with concurrency control. */ /** Result of parallel execution */ export interface ParallelResult { /** Results array - undefined entries indicate tasks that were skipped due to abort */ results: (R | undefined)[]; /** Whether execution was aborted before all tasks completed */ aborted: boolean; } /** * Execute items with a concurrency limit using a worker pool pattern. * Results are returned in the same order as input items. * * On abort: returns partial results with `aborted: true`. Completed tasks are preserved, * in-progress tasks will complete with their abort handling, skipped tasks are `undefined`. * * On error: fails fast - does not wait for other workers to complete. * * @param items - Items to process * @param concurrency - Maximum concurrent operations * @param fn - Async function to execute for each item * @param signal - Optional abort signal to stop scheduling new work */ export declare function mapWithConcurrencyLimit(items: T[], concurrency: number, fn: (item: T, index: number) => Promise, signal?: AbortSignal): Promise>; /** * Simple counting semaphore for limiting concurrency across independently-scheduled async work. */ export declare class Semaphore { #private; constructor(max: number); acquire(): Promise; release(): void; }