/**
 * Retry Logic Utilities
 * Handles exponential backoff and retry decision logic for streaming errors
 */
import type { StreamingError } from './streamingErrors';
/**
 * Retry configuration options
 */
export interface RetryConfig {
    /** Maximum number of retry attempts (default: 3) */
    maxAttempts?: number;
    /** Initial delay in milliseconds (default: 1000) */
    initialDelay?: number;
    /** Delay multiplier for exponential backoff (default: 2) */
    backoffMultiplier?: number;
    /** Maximum delay cap in milliseconds (default: 10000) */
    maxDelay?: number;
    /** Custom retry logic function */
    shouldRetry?: (error: StreamingError, attempt: number) => boolean;
}
/**
 * Calculate retry delay using exponential backoff
 *
 * @param attempt - Current retry attempt number (0-indexed)
 * @param config - Retry configuration options
 * @returns Delay in milliseconds before next retry
 *
 * @example
 * calculateRetryDelay(0) // Returns: 1000ms
 * calculateRetryDelay(1) // Returns: 2000ms
 * calculateRetryDelay(2) // Returns: 4000ms
 * calculateRetryDelay(3) // Returns: 8000ms
 * calculateRetryDelay(4) // Returns: 10000ms (capped at maxDelay)
 */
export declare const calculateRetryDelay: (attempt: number, config?: RetryConfig) => number;
/**
 * Determine if a streaming error should be retried
 *
 * @param error - The streaming error that occurred
 * @param attempt - Current retry attempt number (0-indexed)
 * @param config - Retry configuration options
 * @returns True if should retry, false otherwise
 *
 * @example
 * shouldRetry(networkError, 0) // Returns: true
 * shouldRetry(networkError, 3) // Returns: false (max attempts reached)
 * shouldRetry(parseError, 0) // Returns: false (not retryable)
 */
export declare const shouldRetry: (error: StreamingError, attempt: number, config?: RetryConfig) => boolean;
