import { TimeoutError } from '../common/Errors.js'; /** * @internal */ export interface DeferredOptions { message: string; timeout: number; } /** * Creates and returns a deferred object along with the resolve/reject functions. * * If the deferred has not been resolved/rejected within the `timeout` period, * the deferred gets resolves with a timeout error. `timeout` has to be greater than 0 or * it is ignored. * * @internal */ export declare class Deferred { #private; constructor(opts?: DeferredOptions); resolve(value: T): void; reject(error: V | TimeoutError): void; resolved(): boolean; finished(): boolean; value(): T | V | TimeoutError | undefined; valueOrThrow(): Promise; static create(opts?: DeferredOptions): Deferred; static race(awaitables: Array | Deferred>): Promise; } //# sourceMappingURL=Deferred.d.ts.map