import type { AxiosResponse } from "axios"; /** * Error-detection fields the retryer inspects to detect rate-limiting and credential failures. * Every fetcher's payload is intersected with this, * so the retryer can read `errors`/`message` regardless of the payload's own shape. */ interface ResponseErrors { errors?: Array<{ type?: string; message?: string; }>; message?: string; } /** * A fetcher's Axios response. `TData` is the shape of `response.data`, * which is intersected with {@link ResponseErrors} so the retryer can inspect * `errors`/`message`. * Defaults to `unknown` (error fields only) for callers that don't care about the payload. */ type FetcherResponse = AxiosResponse; type FetcherFunction> = (variables: TVariables, token: string, retriesForTests?: number) => Promise>; /** * Try to execute the fetcher function until it succeeds or retries are exhausted. * * Rate-limited or rejected credentials are retried immediately with the next * available PAT, temporary problems (e.g. network failures) are retried with * the same PAT after the delays defined in {@link TRANSIENT_RETRY_DELAYS_MS}. * Both budgets are independent, so retries of one kind never consume the other's. * * @template TData Shape of `response.data` returned by the fetcher. * @template TVariables Variables the fetcher accepts. * @param fetcher The fetcher function. * @param variables Object with arguments to pass to the fetcher function. * @param pat Optional PAT override. * @returns The response from the fetcher function. */ declare const retryer: >(fetcher: FetcherFunction, variables: TVariables, pat?: string | null) => Promise>; export { retryer }; //# sourceMappingURL=retryer.d.ts.map