/**
 * parallel-emit.ts — W0056 prototype A (client-side parallelism).
 *
 * Bounded-concurrency helper for fanning out artifact emits. The baseline
 * measurement (see `docs/design-docs/artifact-upload-throughput.md`) shows
 * producer loops call `await writer.emit(...)` serially, and per-artifact
 * wall clock is dominated by GCS response latency. A simple `p-limit(N)`
 * turns that into a batched-parallel flow against the existing writers.
 *
 * Gated on `AILF_PARALLEL_UPLOAD`:
 *   - unset → use the per-writer default set at composition time.
 *   - "0" → forced serial (override when default-on is undesirable).
 *   - "1" → parallel, default concurrency 8.
 *   - "<N>" (N > 1 integer) → parallel with concurrency N.
 *
 * The per-writer default is set by the composition root via
 * `setDefaultUploadConcurrency`. Writers with measured safe parallelism
 * (GCS direct) set 8; writers still on serial (API Gateway, until the
 * batching rollout completes) leave it at the module default of 1.
 */
/**
 * Set the default concurrency used when `AILF_PARALLEL_UPLOAD` is unset.
 * Composition root calls this once per run based on the selected remote
 * writer. Tests reset by passing 1.
 */
export declare function setDefaultUploadConcurrency(n: number): void;
/** Exposed for tests — returns the current module default. */
export declare function getDefaultUploadConcurrency(): number;
/**
 * Resolve the configured concurrency. Returns 1 (serial) when parallelism is
 * explicitly disabled or the env value is invalid; otherwise returns the
 * per-writer module default when `AILF_PARALLEL_UPLOAD` is unset.
 */
export declare function resolveUploadConcurrency(): number;
/**
 * Run `fn` against every item with at most `concurrency` active at once.
 * Preserves input order in the result array. Rejections propagate — callers
 * with non-blocking semantics should catch inside `fn`.
 *
 * When `concurrency <= 1`, runs strictly serially (drop-in equivalent of a
 * `for … await` loop).
 */
export declare function parallelMap<T, R>(items: readonly T[], concurrency: number, fn: (item: T, index: number) => Promise<R>): Promise<R[]>;
