/opt/canhelp/node_modules/@better-fetch/fetch/dist
Edit: /opt/canhelp/node_modules/@better-fetch/fetch/dist/index.d.ts (33011B)
type RetryCondition = (response: Response | null) => boolean | Promise
;
type LinearRetry = {
type: "linear";
attempts: number;
delay: number;
shouldRetry?: RetryCondition;
};
type ExponentialRetry = {
type: "exponential";
attempts: number;
baseDelay: number;
maxDelay: number;
shouldRetry?: RetryCondition;
};
type RetryOptions = LinearRetry | ExponentialRetry | number;
interface RetryStrategy {
shouldAttemptRetry(attempt: number, response: Response | null): Promise;
getDelay(attempt: number): number;
}
declare function createRetryStrategy(options: RetryOptions): RetryStrategy;
/** The Standard Schema interface. */
interface StandardSchemaV1 {
/** The Standard Schema properties. */
readonly "~standard": StandardSchemaV1.Props;
}
declare namespace StandardSchemaV1 {
/** The Standard Schema properties interface. */
interface Props {
/** The version number of the standard. */
readonly version: 1;
/** The vendor name of the schema library. */
readonly vendor: string;
/** Validates unknown input values. */
readonly validate: (value: unknown) => Result