import type { NumberOfMilliseconds, PromisableFunction } from '../types.js'; import type { DeferredPromise } from './pDefer.js'; /** * Promisified version of setTimeout. * * Can return a value. * If value is instanceof Error - rejects the Promise instead of resolving. */ export declare function pDelay(ms?: NumberOfMilliseconds, value?: T): Promise; /** * Like pDelay, but also resolves early (without an error) as soon as * the passed AbortSignal aborts. */ export declare function pDelaySignal(ms: NumberOfMilliseconds, signal?: AbortSignal): Promise; /** * Promisified version of setTimeout. * * Wraps the passed function with try/catch, * catch will propagate to pDelayFn rejection, * otherwise pDelayFn will resolve with returned value. * * On abort() - clears the Timeout and immediately resolves the Promise with void. */ export declare function pDelayFn(ms: NumberOfMilliseconds, fn: PromisableFunction): DeferredPromise;