import { type RetryInfo } from './retry.js'; export interface ClientConfig { apiKey: string; baseUrl?: string; maxRetries?: number; maxRetryDelayMs?: number; timeoutMs?: number; idempotencyKey?: 'auto' | 'manual'; fetch?: typeof fetch; onRetry?: (info: RetryInfo) => void; } export interface ResolvedConfig { apiKey: string; baseUrl: string; maxRetries: number; maxRetryDelayMs: number; timeoutMs: number; idempotencyKey: 'auto' | 'manual'; fetch: typeof fetch; onRetry?: (info: RetryInfo) => void; } export declare const DEFAULTS: { baseUrl: string; maxRetries: number; maxRetryDelayMs: number; timeoutMs: number; idempotencyKey: "auto"; }; export declare function resolveConfig(config: ClientConfig): ResolvedConfig; /** * Validate `maxRetries` — must be a non-negative integer. NaN, negatives, * or non-integers (e.g. `Infinity`, `2.5`) would silently break the * `for (let attempt = 0; attempt <= config.maxRetries; attempt++)` loop in * `withRetries` and produce confusing failure modes (zero attempts, or * fractional comparisons). Validate at the boundary so the error surfaces * at construction, not on the first request. Exported for reuse from * per-call `RequestOptions.maxRetries` overrides. */ export declare function validateMaxRetries(value: number | undefined): number; /** * Validate `maxRetryDelayMs` — the ceiling on a single retry sleep. Must be * a finite positive number: `NaN` and `Infinity` would disable the cap * entirely (a comparison against `NaN` is always false, and nothing exceeds * `Infinity`), which is exactly the unbounded sleep the ceiling exists to * prevent. Zero or negative would reject every retry, including the 60s * limiter windows the API relies on. A caller who genuinely wants day-scale * sleeps passes a large finite number (`86_400_000`), never `Infinity` — * same escape hatch, and the same rejection, as `timeoutMs`. */ export declare function validateMaxRetryDelayMs(value: number | undefined): number; /** * Validate `timeoutMs` — must be a finite positive number. NaN, zero, * negative, or `Infinity` would either abort every request immediately or * never time out at all. */ export declare function validateTimeoutMs(value: number | undefined): number; //# sourceMappingURL=config.d.ts.map