/** * Retries an asynchronous function a specified number of times until it succeeds * or the retry count is exhausted. * * @template T The type of the value that the function returns. * @param fn The asynchronous function to retry. * @param retries The number of times to retry the function. Must be a positive number. * Defaults to 3 if not specified. * @returns A Promise that resolves with the function's return value if it succeeds, * or rejects with the last error encountered if all retries fail. * @throws {TypeError} If the first argument is not a function. * @throws {RangeError} If the retries parameter is not a positive number. * @throws {Error} If the function does not succeed within the retry attempts. */ export declare function retry(fn: () => Promise, retries?: number): Promise; /** * Creates a debounced function that delays invoking the provided function until * after `delay` milliseconds have passed since the last time the debounced * function was called. The debounced function returns a function that can be * used to cancel the pending call to the underlying function. * * @param fn The function to debounce. * @param delay The number of milliseconds to delay calling the function. * @returns A debounced function with an extra `cancel` method to cancel the pending call. */ export declare function debounce void>(fn: T, delay: number): T & { cancel: () => void; }; /** * Creates a throttled function that invokes the provided function at most once * every `limit` milliseconds. Subsequent calls to the throttled function will * be ignored until the specified time has passed. * * @param fn The function to throttle. * @param limit The number of milliseconds to throttle. * @returns A throttled function. */ export declare function throttle(fn: (...args: any[]) => void, limit: number): (...args: any[]) => void; /** * Returns a Promise that resolves after the specified number of milliseconds. * @param ms The number of milliseconds to wait before resolving the Promise. * Defaults to 2000 (2 seconds) if omitted. */ export declare function delay(ms?: number): Promise;