export interface Patience { /** Where a wait is reported (default: stderr). */ onWait?: ((line: string) => void) | undefined; /** The longest single wait, in milliseconds (default: `BUNDLE_RATE_LIMIT_WAIT` seconds, else 10 minutes). */ maxWait?: number | undefined; /** How many times one request is retried (default: 5). */ retries?: number | undefined; /** Ends a wait early, as it would end the request. */ signal?: AbortSignal | null | undefined; /** For tests: how a wait is waited. */ sleep?: ((ms: number, signal?: AbortSignal | null | undefined) => Promise) | undefined; } /** Send a request, and again — as often as `retries` — for as long as the server says to wait. */ export declare function patiently(send: () => Promise, url: string, patience?: Patience): Promise; /** * How long a response says to wait before asking again, or nothing when it * does not say to: a 429, or a 503 with `Retry-After`. Times the server gives * as dates are measured from its own `Date`, so a skewed clock here does not * skew the wait. */ export declare function waitFor(response: Response, attempt?: number): { ms: number; why: string; } | undefined; /** A fetch that waits when told to: for code that hands a fetch on. */ export declare function patientFetch(fetch?: typeof globalThis.fetch, patience?: Patience): typeof globalThis.fetch; //# sourceMappingURL=ratelimit.d.ts.map