lunex-http
Version:
A lightweight and flexible REST API client for JavaScript and TypeScript, supporting CommonJS and ES modules (ESM). Features include HTTP methods (GET, POST, PUT, PATCH, DELETE), built-in retry policies with exponential backoff, request lifecycle hooks fo
13 lines (12 loc) • 435 B
TypeScript
/**
* Delay helper for retry logic.
* @param ms - Milliseconds to delay.
* @returns A promise that resolves after the specified delay.
*/
export declare function delay(ms: number): Promise<void>;
/**
* Calculate exponential backoff delay in milliseconds.
* @param {number} retryCount - Current retry attempt (0-based).
* @returns {number} Delay in ms.
*/
export declare function exponentialBackoff(retryCount: number): number;