import { Jitter } from './enums/jitter'; /** * A class that calculates the exponential backoff time. */ export default class ExponentialBackoff { /** * The ceiling for the maximum number of attempts. */ static readonly ceilingForMaxAttempts = 10; /** * Calculates the exponential backoff time. * @param {number} attempt The attempt number. * @param {number} maxAttempts The maximum number of attempts. * @param {number} baseDelay The base delay. * @param {number} maxDelay The maximum delay. * @param {Jitter} jitter The jitter. * @returns {number} The exponential backoff time. * @throws {Error} The max attempts must be between 0 and 10. */ static calculateBackoff(attempt: number, maxAttempts: number, baseDelay: number, maxDelay: number, jitter: Jitter): number; }