UNPKG

@trendmoon/api-client

Version:
28 lines 973 B
/** * Retry configuration options */ export interface RetryOptions { /** Maximum number of retry attempts */ maxAttempts: number; /** Base delay between retries in milliseconds */ baseDelay: number; /** Maximum delay between retries in milliseconds */ maxDelay: number; /** Whether to use exponential backoff */ exponentialBackoff: boolean; /** Function to determine if an error should trigger a retry */ shouldRetry?: (error: Error) => boolean; } /** * Default retry configuration */ export declare const DEFAULT_RETRY_OPTIONS: RetryOptions; /** * Retry utility function with exponential backoff */ export declare function withRetry<T>(operation: () => Promise<T>, options?: Partial<RetryOptions>): Promise<T>; /** * Create a retry wrapper for a function */ export declare function createRetryWrapper<T extends (...args: any[]) => Promise<any>>(fn: T, options?: Partial<RetryOptions>): T; //# sourceMappingURL=retry.d.ts.map