@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.
25 lines (24 loc) • 630 B
TypeScript
/**
* @module Async
*/
import type { Invokable, TimeSpan } from "../../utilities/_module-exports.js";
/**
* @returns Amount milliseconds to wait
*
* IMPORT_PATH: `"@daiso-tech/core/async"`
* @group BackoffPolicies
*/
export type BackoffPolicy = Invokable<[
attempt: number,
error: unknown
], TimeSpan>;
/**
*
* IMPORT_PATH: `"@daiso-tech/core/async"`
* @group BackoffPolicies
*/
export type DynamicBackoffPolicy<TSettings> = TSettings | Invokable<[error: unknown], TSettings | undefined>;
/**
* @internal
*/
export declare function withJitter(jitter: number, value: number, mathRandom: () => number): number;