export type NourishHttpErrorKind = "timeout" | "rate_limit" | "server_error" | "network" | "http"; export declare class NourishHttpError extends Error { readonly kind: NourishHttpErrorKind; readonly status?: number; readonly url: string; readonly attempts: number; /** True for kinds that callers may safely treat as a degraded result. */ readonly transient: boolean; constructor(input: { kind: NourishHttpErrorKind; message: string; url: string; status?: number; attempts: number; }); } export interface FetchWithTimeoutOptions extends RequestInit { /** Per-attempt timeout in ms. Defaults to config provider_timeout_ms. */ timeoutMs?: number; /** Retry count on transient errors (network/timeout/5xx/429). Defaults to 1. */ retries?: number; /** Base backoff in ms between retries; doubles each attempt. Defaults to 400. */ backoffMs?: number; } /** * Fetch with timeout + single retry + structured errors. * * Returns an OK Response. Throws `NourishHttpError` on: * - timeout (kind: "timeout", transient) * - network failure (kind: "network", transient) * - rate limit after retries exhausted (kind: "rate_limit", transient) * - 5xx after retries exhausted (kind: "server_error", transient) * - other non-OK HTTP status (kind: "http", NOT transient) */ export declare function fetchWithTimeout(input: URL | string, options?: FetchWithTimeoutOptions): Promise; export declare function isTransientHttpError(error: unknown): error is NourishHttpError;