import type { RetryConfig } from './types.js'; /** * Calculates delay based on retry strategy */ export declare class RetryDelayCalculator { private config; constructor(config: RetryConfig); /** * Calculate delay for the given attempt number */ calculateDelay(attempt: number): number; } /** * Default retry configuration */ export declare const DEFAULT_RETRY_CONFIG: RetryConfig; /** * Determines if an error should be retried based on its characteristics */ export declare function shouldRetryError(error: Error): boolean; /** * Retry policy for executing operations with automatic retry * * @example * ```typescript * const policy = new RetryPolicy({ * maxAttempts: 5, * strategy: 'exponential', * initialDelay: 1000, * maxDelay: 30000, * }); * * const result = await policy.execute(async () => { * return await someElasticsearchOperation(); * }); * ``` */ export declare class RetryPolicy { private config; private delayCalculator; constructor(config?: Partial); /** * Execute an operation with retry logic */ execute(operation: () => Promise, context?: { operationName?: string; onRetry?: (attempt: number, error: Error, delayMs: number) => void; }): Promise; /** * Determine if an error should be retried */ private shouldRetry; /** * Sleep for the specified number of milliseconds */ private sleep; /** * Get current configuration */ getConfig(): RetryConfig; /** * Update configuration */ updateConfig(config: Partial): void; }