import { pLimit } from "./pLimit.js";

//#region src/utils/parallelizeGlobal.d.ts
/** Get (and optionally configure) the single, shared limiter. */
declare const getGlobalLimiter: (concurrency?: number) => (fn: (...args: any[]) => Promise<any>, ...arguments_: any[]) => Promise<any>;
/** Limits how many *tasks* run concurrently (independent from AI calls). */
declare const getTaskLimiter: (concurrency?: number) => (fn: (...args: any[]) => Promise<any>, ...arguments_: any[]) => Promise<any>;
declare const parallelizeGlobal: <T, R>(items: T[], callback?: (item: T, index: number) => Promise<R>, options?: {
  /** Share a single limiter across the app. If omitted, uses global limiter. */limiter?: ReturnType<typeof pLimit>; /** If provided and no limiter is passed, configure the global limiter. */
  concurrency?: number;
  /**
   * Whether to wrap *each* callback run in the limiter.
   * - For orchestration (outer loops): set `false` (don't burn limiter slots).
   * - For atomic work (AI calls, writes): leave `true` (default).
   */
  wrapInLimiter?: boolean;
}) => Promise<R[]>;
//#endregion
export { getGlobalLimiter, getTaskLimiter, parallelizeGlobal };
//# sourceMappingURL=parallelizeGlobal.d.ts.map