/** * HTTP retry mechanism for the TIDAL API client * * Read-only requests (GET/HEAD/OPTIONS) are retried with exponential backoff * and jitter. The delay before a retry is * * D = min(B * 2 ** n * j, M) * * where B is the base delay, n is the zero-based retry number, j is a random * jitter factor in [0.8, 1) and M is the maximum delay. * * Write requests (POST/PATCH/PUT/DELETE) are passed through untouched. */ /** A fetch implementation compatible with openapi-fetch's `fetch` option. */ type FetchLike = (input: Request) => Promise; type RetryPolicy = { /** Base delay B in milliseconds. */ baseDelayMs: number; /** Maximum delay M in milliseconds; the backoff is clamped to this. */ maxDelayMs: number; /** Maximum number of retries N, in addition to the initial attempt. */ maxRetries: number; }; type RetryCategory = 'network' | 'status' | 'timeout'; export type RetryOptions = Partial>> & { /** Set to `false` to disable retries and the read timeout entirely. */ enabled?: boolean; }; /** Per-attempt read timeout in milliseconds. */ export declare const READ_TIMEOUT_MS = 10000; /** * Wraps a fetch implementation with a retry mechanism. The returned function * matches openapi-fetch's `fetch` option signature, so it can be passed * straight to `createClient({ fetch })`. */ export declare function fetchWithRetry(options?: RetryOptions, baseFetch?: FetchLike): FetchLike; export {};