import { type PolicyHandle } from './types'; export type ResilientFetch = (input: string | URL, init?: RequestInit) => Promise; /** * Wraps the global `fetch` in the supplied policy. Per-attempt AbortSignal is * forwarded so a timeout actually closes the socket rather than letting the * receiver respond into a discarded promise. * * Retry behaviour: * - Network errors → retry per policy. * - 5xx + 408/425/429 → retry (the failed Response is converted to an Error). * - Other 4xx → throw NonRetriable, which bypasses the retry policy. * * The returned Response is always fully buffered — see `bufferResponse`. This * is a deliberate non-streaming contract: `ResilientFetch` is for * service-to-service RPC, where responses are small and the caller reads the * whole body anyway. */ export declare function resilientFetch(policy: PolicyHandle): ResilientFetch; //# sourceMappingURL=fetch.d.ts.map