UNPKG

@daiso-tech/core

Version:

The library offers flexible, framework-agnostic solutions for modern web applications, built on adaptable components that integrate seamlessly with popular frameworks like Next Js.

29 lines (28 loc) 925 B
/** * @module BackoffPolicy */ import { type BackoffSettingsEnum, type SerializedBackoffSettingsEnum } from "../backoff-policies/types.js"; import { type ITimeSpan } from "../time-span/contracts/_module.js"; import { type Invokable } from "../utilities/_module.js"; /** * @returns Amount milliseconds to wait * * IMPORT_PATH: `"@daiso-tech/core/backoff-policies"` */ export type BackoffPolicy = Invokable<[ attempt: number, error: unknown ], ITimeSpan>; /** * * IMPORT_PATH: `"@daiso-tech/core/backoff-policies"` */ export type DynamicBackoffPolicy<TSettings> = TSettings | Invokable<[error: unknown], TSettings | undefined>; /** * @internal */ export declare function resolveBackoffSettingsEnum(settings: BackoffSettingsEnum): Required<BackoffSettingsEnum>; /** * @internal */ export declare function serializeBackoffSettingsEnum(settings: BackoffSettingsEnum): Required<SerializedBackoffSettingsEnum>;