/**
 * Retry-After / rate-limit-reset capture.
 *
 * Parses `Retry-After` and provider-specific rate-limit-reset HTTP headers into
 * millisecond delays, and stores them in a provider-keyed ephemeral cache so
 * callers can consume the hint on their next request to the same provider.
 *
 * Pure standard library — no external dependencies.
 */
/** Output format for {@link parseRateLimitResetHeader}. */
export type RateLimitResetFormat = "rfc3339" | "duration" | "epoch-seconds";
/**
 * Parse a `Retry-After` header (RFC 7231) into a millisecond delay.
 *
 * - Delta-seconds (e.g. `"120"`): positive integer seconds → ms.
 *   `"0"` and negative values resolve to `undefined` (no delay).
 * - HTTP-date (e.g. `"Wed, 21 Oct 2025 07:28:00 GMT"`): clamped to `>= 0` delta
 *   from `now`. Invalid dates resolve to `undefined`.
 * - `null` / `undefined` / empty → `undefined`.
 *
 * @returns delay in ms, or `undefined` when there is nothing to wait for.
 */
export declare function parseRetryAfterHeader(value: string | null | undefined, now?: number): number | undefined;
/**
 * Parse a rate-limit-reset header into a millisecond delay from `now`.
 *
 * - `"rfc3339"`: e.g. `"2025-10-21T07:28:00Z"` → clamped delta from `now`.
 * - `"duration"`: Go-style duration → ms.
 * - `"epoch-seconds"`: e.g. `"1718956800"` → clamped delta from `now`.
 *
 * @returns delay in ms, or `undefined` when the value is invalid.
 */
export declare function parseRateLimitResetHeader(value: string | null | undefined, format: RateLimitResetFormat, now?: number): number | undefined;
/** Store a `Retry-After` delay (ms) for `provider`. */
export declare function recordRetryAfterMs(provider: string, ms: number): void;
/** Return and delete the stored `Retry-After` delay for `provider` (if fresh). */
export declare function consumeRetryAfterMs(provider: string): number | undefined;
/** Store a rate-limit-reset delay (ms) for `provider`. */
export declare function recordRateLimitResetMs(provider: string, ms: number): void;
/** Return and delete the stored rate-limit-reset delay for `provider` (if fresh). */
export declare function consumeRateLimitResetMs(provider: string): number | undefined;
/**
 * Inspect a response's headers and record any `Retry-After` / rate-limit-reset
 * hints into the ephemeral cache keyed by `provider`.
 *
 * - `retry-after` (delta-seconds or HTTP-date) and `retry-after-ms` (raw ms)
 *   feed {@link recordRetryAfterMs}.
 * - Multiple rate-limit-reset headers are parsed; the longest reset wins
 *   (stored via {@link recordRateLimitResetMs}).
 */
export declare function captureHeadersFromResponse(provider: string, headers: Headers): void;
export declare const __testing: {
    /** Clear both ephemeral caches. */
    clearAll(): void;
    /** Report the size of each cache (used for eviction tests). */
    getCacheSize(): {
        retryAfter: number;
        rateLimitReset: number;
    };
};
