/** * Configuration for exponential backoff retry logic. */ export type BackoffConfig = { maxRetries: number; baseDelayInMs: number; backoffFactor: number; errHandler?: (error: Error, attempt: number) => 'stop' | 'continue'; }; /** * Checks if an error is safe to retry. * Only transient errors matching the allowlist should return true. * All other errors fail fast to avoid masking security-critical failures. * * @param error - The error to check * @returns true if the error is transient and safe to retry, false otherwise */ export declare function isRetryableError(error: Error): boolean; /** * Default error handler that only retries known transient errors. * Security-critical errors will fail fast. */ export declare function defaultRetryErrorHandler(error: Error): 'stop' | 'continue'; /** * Helper function to implement exponential backoff retry logic. * @param fn - The function to retry * @param config - Optional backoff configuration * @returns Promise that resolves with the result of the function */ export declare function retryWithBackoff(fn: () => Promise, { maxRetries, baseDelayInMs, backoffFactor, errHandler, }?: Partial): Promise;