/** * Error Handling Implementation using p-retry and p-timeout * Replaced with industry-standard error handling libraries for better maintainability * * Migration Guide: * - withErrorLogging() -> use p-retry + custom error logging * - safeExecute() -> p-timeout + try/catch * - withFallback() -> p-retry with fallback function * - Better retry strategies and timeout handling */ declare function getPRetry(): Promise; declare function getAbortError(): Promise; declare function getPTimeout(): Promise; export interface RetryOptions { retries?: number; factor?: number; minTimeout?: number; maxTimeout?: number; randomize?: boolean; shouldRetry?: (error: Error) => boolean; } export interface TimeoutOptions { milliseconds?: number; message?: string; fallback?: () => any; } export interface ErrorHandlingOptions extends RetryOptions, TimeoutOptions { enableLogging?: boolean; enableRetry?: boolean; enableTimeout?: boolean; context?: string; } /** * Enhanced error handling with retry and timeout support */ export declare class EnhancedErrorHandler { private options; constructor(options?: ErrorHandlingOptions); /** * Execute function with retry logic */ executeWithRetry(fn: () => Promise): Promise; /** * Execute function with timeout */ executeWithTimeout(fn: () => Promise, customTimeout?: number): Promise; /** * Execute function with both retry and timeout */ executeWithRetryAndTimeout(fn: () => Promise): Promise; /** * Execute function with fallback */ executeWithFallback(fn: () => Promise, fallbackFn: () => Promise): Promise; /** * Safe execute with comprehensive error handling */ safeExecute(fn: () => Promise): Promise; } /** * Legacy compatibility functions for backward compatibility */ /** * Execute function with error logging */ export declare function withErrorLogging(fn: () => Promise, context?: string): Promise; /** * Execute function safely with error handling */ export declare function safeExecute(fn: () => Promise, context?: string, timeout?: number): Promise; /** * Execute function with fallback */ export declare function withFallback(fn: () => Promise, fallbackFn: () => Promise, context?: string): Promise; /** * Execute function with async error logging */ export declare function withAsyncErrorLogging(fn: () => Promise, context?: string): Promise; /** * Execute function with retry logic */ export declare function withRetry(fn: () => Promise, retryOptions?: RetryOptions, context?: string): Promise; /** * Execute function with timeout */ export declare function withTimeout(fn: () => Promise, timeoutOptions?: TimeoutOptions, context?: string): Promise; export { getPRetry as pRetry, getPTimeout as pTimeout, getAbortError as AbortError }; export default EnhancedErrorHandler; //# sourceMappingURL=pRetryTimeoutWrapper.d.ts.map