/** * Bounded-concurrency async iteration helper. Used to parallelize * I/O-bound network calls (e.g. `fetchItemData` for each item in a * serialization pull) without blasting unbounded request fans out at * Sitecore — which would hit rate limits, exhaust local sockets, or * blow up memory holding too many in-flight Response bodies. * * Results preserve input order. The first failure aborts: pending * tasks are not started, in-flight tasks are awaited then their * results discarded. * * Default concurrency is 8 (conservative for typical XM Cloud rate * limits). Override via `SITECOREAI_HTTP_CONCURRENCY`. */ export declare const DEFAULT_CONCURRENCY = 8; export declare const resolveDefaultConcurrency: () => number; export interface MapWithConcurrencyOptions { concurrency?: number; } export declare const mapWithConcurrency: (items: readonly T[], worker: (item: T, index: number) => Promise, options?: MapWithConcurrencyOptions) => Promise; /** * Sleep for `ms`, optionally abortable via `signal` so a Ctrl-C during a * backoff wait exits promptly (rejects with "aborted"). Without a signal it * is a plain timeout. Canonical home — do not re-declare per module. */ export declare const sleep: (ms: number, signal?: AbortSignal) => Promise;