You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
713 B
27 lines
713 B
/// <reference lib="dom" />
|
|
|
|
declare module 'fetch-retry' {
|
|
const _fetch: typeof fetch;
|
|
|
|
type RequestDelayFunction = ((
|
|
attempt: number,
|
|
error: Error | null,
|
|
response: Response | null
|
|
) => number);
|
|
|
|
type RequestRetryOnFunction = ((
|
|
attempt: number,
|
|
error: Error | null,
|
|
response: Response | null
|
|
) => boolean | Promise<boolean>);
|
|
|
|
interface IRequestInitWithRetry extends RequestInit {
|
|
retries?: number;
|
|
retryDelay?: number | RequestDelayFunction;
|
|
retryOn?: number[] | RequestRetryOnFunction;
|
|
}
|
|
|
|
function fetchBuilder(fetch: typeof _fetch, defaults?: object): ((input: RequestInfo, init?: IRequestInitWithRetry) => Promise<Response>);
|
|
export = fetchBuilder;
|
|
}
|