fetch-retry
Advanced tools
Comparing version 5.0.6 to 6.0.0
@@ -1,28 +0,29 @@ | ||
/// <reference lib="dom" /> | ||
declare module 'fetch-retry' { | ||
const _fetch: typeof fetch; | ||
export type FetchLibrary = (input: any, init?: any) => Promise<any>; | ||
type RequestDelayFunction = (( | ||
export type RequestDelayFunction<F extends FetchLibrary> = ( | ||
attempt: number, | ||
error: Error | null, | ||
response: Response | null | ||
) => number); | ||
response: Awaited<ReturnType<F>> | null, | ||
) => number; | ||
type RequestRetryOnFunction = (( | ||
export type RequestRetryOnFunction<F extends FetchLibrary> = ( | ||
attempt: number, | ||
error: Error | null, | ||
response: Response | null | ||
) => boolean | Promise<boolean>); | ||
response: Awaited<ReturnType<F>> | null, | ||
) => boolean | Promise<boolean>; | ||
export interface RequestInitRetryParams { | ||
export type RequestInitRetryParams<F extends FetchLibrary> = { | ||
retries?: number; | ||
retryDelay?: number | RequestDelayFunction; | ||
retryOn?: number[] | RequestRetryOnFunction; | ||
} | ||
retryDelay?: number | RequestDelayFunction<F>; | ||
retryOn?: number[] | RequestRetryOnFunction<F>; | ||
}; | ||
export type RequestInitWithRetry = RequestInit & RequestInitRetryParams; | ||
export type RequestInitWithRetry<F extends FetchLibrary> = Parameters<F>[1] & | ||
RequestInitRetryParams<F>; | ||
function fetchBuilder(fetch: typeof _fetch, defaults?: RequestInitRetryParams): ((input: Parameters<typeof _fetch>[0], init?: RequestInitWithRetry) => Promise<Response>); | ||
export default fetchBuilder; | ||
export default function fetchBuilder<F extends FetchLibrary>( | ||
fetch: F, | ||
defaults?: RequestInitRetryParams<F>, | ||
): (input: Parameters<F>[0], init?: RequestInitWithRetry<F>) => ReturnType<F>; | ||
} |
{ | ||
"name": "fetch-retry", | ||
"version": "5.0.6", | ||
"version": "6.0.0", | ||
"description": "Extend any fetch library with retry functionality", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/jonbern/fetch-retry.git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55195
1332