import { RetryPolicyOptions, RetryPolicyResult, JitterConfig, BackoffConfig, OperationRetryConfig, OperationTypePolicyConfig, ExecuteOptions, ExecuteResult } from './types'; /** * Default retry policy options */ export declare const DEFAULT_RETRY_OPTIONS: Required; /** * Default jitter configuration */ export declare const DEFAULT_JITTER_CONFIG: JitterConfig; /** * Default backoff configuration */ export declare const DEFAULT_BACKOFF_CONFIG: BackoffConfig; /** * Core retry policy class that provides atomic retry utilities with optional runtime configuration */ export declare class RetryPolicy { private options; private backoffConfig; private operationDefaultConfig; private operationConfigs; constructor(options?: Partial, backoffConfig?: Partial); /** * Evaluate whether an operation should be retried based on current attempt and error */ evaluateRetry(attempt: number, error: any): RetryPolicyResult; /** * Calculate the delay for the next retry attempt */ calculateDelay(attempt: number): number; /** * Calculate exponential backoff delay */ private calculateExponentialDelay; /** * Calculate linear backoff delay */ private calculateLinearDelay; /** * Apply jitter to a delay value */ private applyJitter; /** * Determine if an operation should be retried based on attempt count and error */ private shouldRetry; /** * Get the current retry policy options */ getOptions(): Required; /** * Get the current backoff configuration */ getBackoffConfig(): BackoffConfig; /** * Update retry policy options */ updateOptions(options: Partial): void; /** * Update backoff configuration */ updateBackoffConfig(config: Partial): void; /** * Get configuration sources for transparency */ getConfigurationSources(): any[]; /** * Set per-operation-type retry configurations */ setOperationConfigs(defaultConfig: OperationRetryConfig, operations?: Record): void; /** * Get the resolved config for a given operation type. * Falls back: operation-specific -> operation default -> class-level defaults. */ getOperationConfig(operationType?: string): OperationRetryConfig; /** * List all registered operation type names */ getOperationTypes(): string[]; /** * Execute an operation with retry logic using per-operation-type config. * Supports AbortSignal for cancellation. */ execute(fn: () => Promise, options?: ExecuteOptions): Promise>; /** * Delay that can be cancelled via AbortSignal */ private delayWithSignal; } /** * Factory function to create a retry policy. * * Supports two calling signatures: * - Legacy: createRetryPolicy(options?, backoffConfig?) * - Per-operation-type: createRetryPolicy({ default: {...}, operations: {...} }) */ export declare function createRetryPolicy(optionsOrConfig?: Partial | OperationTypePolicyConfig, backoffConfig?: Partial): RetryPolicy; /** * Utility function to calculate delay for a specific attempt */ export declare function calculateRetryDelay(attempt: number, options?: Partial, backoffConfig?: Partial): number; /** * Utility function to determine if an error should trigger a retry */ export declare function shouldRetry(attempt: number, error: any, options?: Partial): boolean; //# sourceMappingURL=retry-policy.d.ts.map