/** * Retry Decorator * * Reusable retry logic with exponential backoff for source operations. * * @since v1.37.0 */ /** * Retry configuration options */ export interface RetryOptions { /** Maximum number of retry attempts (default: 3) */ maxAttempts?: number; /** Base delay in milliseconds (default: 1000) */ baseDelay?: number; /** Maximum delay in milliseconds (default: 10000) */ maxDelay?: number; /** Whether to add random jitter to delays (default: true) */ jitter?: boolean; /** Custom function to determine if an error is retryable */ isRetryable?: (error: unknown) => boolean; /** Callback invoked before each retry */ onRetry?: (attempt: number, error: unknown, delay: number) => void; } /** * Default retry options */ export declare const DEFAULT_RETRY_OPTIONS: Required>; /** * Check if an error is retryable */ export declare function isRetryableError(error: unknown): boolean; /** * Wrap a function with retry logic * * @example * ```typescript * const fetchWithRetry = withRetry( * async (url: string) => fetch(url), * { maxAttempts: 3, baseDelay: 1000 } * ); * * const response = await fetchWithRetry('https://api.example.com'); * ``` */ export declare function withRetry Promise>(fn: T, options?: RetryOptions): T; /** * Decorator for class methods to add retry logic * * @example * ```typescript * class ApiClient { * @retryable({ maxAttempts: 3 }) * async fetchData(): Promise { * return fetch('/api/data'); * } * } * ``` */ export declare function retryable(options?: RetryOptions): Promise>(_target: unknown, _propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor; //# sourceMappingURL=retry-decorator.d.ts.map