import { TError } from '../models/TError'; import { class_EventEmitter } from 'atma-utils'; import { TFnWithCallback } from './types'; export declare namespace $promise { function wait(ms: any): Promise; function fromEvent, TArgs extends Parameters>(eventEmitter: T, event: TArgs[0]): Promise; function fromCallback(fn: TFnWithCallback, ...args: TArgs): Promise; function fromCallbackCtx(ctx: any, fn: TFnWithCallback, ...args: TArgs): Promise; function caught(fn: () => Promise): Promise<{ result?: T; error?: TError; }>; function caught(promise: Promise): Promise<{ result?: T; error?: TError; }>; function timeout>(promise: T, ms: number, message?: string): T; function waitForTrue(check: () => boolean | Promise, opts?: Parameters[1]): Promise; function waitForObject(check: () => Promise<[Error, T?]>, opts?: { intervalMs?: number; timeoutMs?: number; timeoutMessage?: string | (() => string); }): Promise; }