/** * Utility functions for timeout and retry logic * Used by storage adapters to handle network operations reliably */ export interface TimeoutConfig { get?: number; add?: number; delete?: number; } export interface RetryConfig { maxRetries?: number; initialDelay?: number; maxDelay?: number; backoffMultiplier?: number; } export interface OperationConfig { timeouts?: TimeoutConfig; retryPolicy?: RetryConfig; } export declare const DEFAULT_TIMEOUTS: Required; export declare const DEFAULT_RETRY_POLICY: Required; /** * Wraps a promise with a timeout */ export declare function withTimeout(promise: Promise, timeoutMs: number, operation: string): Promise; /** * Executes an operation with retry logic and exponential backoff */ export declare function withRetry(operation: () => Promise, operationName: string, config?: RetryConfig): Promise; /** * Executes an operation with both timeout and retry logic */ export declare function withTimeoutAndRetry(operation: () => Promise, operationName: string, timeoutMs: number, retryConfig?: RetryConfig): Promise; /** * Creates a configured operation executor for a specific operation type */ export declare function createOperationExecutor(operationType: keyof TimeoutConfig, config?: OperationConfig): (operation: () => Promise, operationName: string) => Promise; /** * Storage operation executors for different operation types */ export declare class StorageOperationExecutors { private getExecutor; private addExecutor; private deleteExecutor; constructor(config?: OperationConfig); /** * Execute a get operation with timeout and retry */ executeGet(operation: () => Promise, operationName: string): Promise; /** * Execute an add operation with timeout and retry */ executeAdd(operation: () => Promise, operationName: string): Promise; /** * Execute a delete operation with timeout and retry */ executeDelete(operation: () => Promise, operationName: string): Promise; }