export interface RangeClientOptions { fetch: typeof fetch; retries: number; /** First backoff delay; doubles per attempt. Tests drop it to a millisecond. */ backoffBaseMs: number; cacheDir?: string; } export type RangeResult = { status: 'ok'; bytes: Uint8Array; networkBytes: number; } /** 404 / 403: S3 answers 403 for an absent key when the bucket forbids listing, so both mean "no such object". */ | { status: 'missing'; code: number; networkBytes: number; }; export interface RangeStats { requests: number; bytesFetched: number; cacheHits: number; } /** * Ranged GETs with a bounded retry and an optional on-disk cache of every range, so a rerun is offline-capable and * polite to the bucket. A range is a pure function of (url, start, end) because the bucket's objects are immutable. */ export declare class RangeClient { private readonly options; readonly stats: RangeStats; constructor(options: RangeClientOptions); /** Bytes `[start, endInclusive]` of `url`; a range past the end of a short object comes back short (the header read relies on that). */ getRange(url: string, start: number, endInclusive: number, exact: boolean): Promise; private fetchWithRetry; private cachePath; private readCache; private writeCache; } /** Runs `worker` over `items` with at most `limit` in flight; results keep input order. */ export declare function mapPool(items: readonly T[], limit: number, worker: (item: T, index: number) => Promise): Promise;