/** * Retry utility with exponential backoff and jitter. * * Parameters: * - Initial delay: 1000ms * - Max delay: 30000ms * - Max attempts: 3 * - Jitter: ±20% * * Formula: delay = min(maxDelay, initialDelay * 2^attempt) * (0.8 + random() * 0.4) */ import type { RetryConfig } from '../config/types.js'; export interface RetryOptions extends RetryConfig { shouldRetry?: (error: unknown) => boolean; onRetry?: (error: unknown, attempt: number, delayMs: number) => void; } /** * Calculate delay with exponential backoff and jitter. */ export declare function calculateDelay(attempt: number, initialDelayMs: number, maxDelayMs: number): number; /** * Sleep for a specified duration. */ export declare function sleep(ms: number): Promise; /** * Execute a function with retry logic. */ export declare function withRetry(fn: () => Promise, options?: Partial): Promise; /** * Create a retry wrapper with pre-configured options. */ export declare function createRetryWrapper(config: RetryConfig): (fn: () => Promise) => Promise; /** * Check if an error is retryable based on HTTP/gRPC status codes. */ export declare function isRetryableStatusCode(statusCode: number): boolean; /** * Enhanced retry check that considers both CloudBuildError and status codes. */ export declare function shouldRetryError(error: unknown): boolean; //# sourceMappingURL=retry.d.ts.map