/** * Implements a generic retry mechanism with exponential backoff and jitter. This function attempts an operation multiple times, waiting progressively longer between * attempts to avoid overwhelming failing services. The exponential backoff with jitter prevents thundering herd problems where many clients retry simultaneously. * @param operation - An async function to attempt. Should throw on failure. * @param maxAttempts - Maximum number of attempts before giving up. * @param timeoutMs - Timeout in milliseconds for each individual attempt. * @param description - Human-readable description for logging purposes. * @param earlySuccessCheck - Optional async function called after timeout errors. If it returns a truthy value, that value is returned as success instead of * retrying. Useful for cases where the operation succeeded but took too long. * @param shouldAbort - Optional function called before each attempt. If it returns true, retries are aborted immediately. Useful for checking if the page was closed * during the backoff delay. * @returns The result of the operation if successful. * @throws The last error encountered if all attempts fail. */ export declare function retryOperation(operation: () => Promise, maxAttempts: number, timeoutMs: number, description: string, earlySuccessCheck?: () => Promise, shouldAbort?: () => boolean): Promise;