/** * Error Handling Utilities * * Centralized error handling functions to eliminate code duplication */ export interface ErrorWithContext { error: Error; context: Record; } /** * Standardized error creation with context */ export declare function createError(message: string, context?: Record): ErrorWithContext; /** * Safe error message extraction */ export declare function extractErrorMessage(error: unknown): string; /** * Safe error stack extraction */ export declare function extractErrorStack(error: unknown): string | undefined; /** * Convert unknown error to Error instance */ export declare function normalizeError(error: unknown, defaultMessage?: string): Error; /** * Retry with exponential backoff utility */ export interface RetryConfig { maxAttempts: number; delay: number; backoff: 'linear' | 'exponential'; jitter?: boolean; } export declare function retryWithBackoff(operation: (attempt: number) => Promise, config: RetryConfig): Promise; /** * Create timeout wrapper for promises */ export declare function withTimeout(promise: Promise, timeoutMs: number): Promise; /** * Safe async operation wrapper */ export declare function safeAsync(operation: () => Promise, fallback: T, onError?: (error: Error) => void): Promise; /** * Environment detection utilities */ export declare function isBrowser(): boolean; export declare function isNode(): boolean; /** * Browser/Node.js feature detection */ export declare function hasFeature(feature: 'fetch' | 'WebSocket' | 'localStorage' | 'crypto'): boolean; //# sourceMappingURL=ErrorHandling.d.ts.map