export declare namespace $fn { export function retriable(fn: T, ctx: any): Retriable; export function timeoutPromise>(promise: T, ms: number): T; export function waitForObject(check: () => Promise<[Error, T?]>, opts?: { intervalMs?: number; timeoutMs?: number; timeoutMessage?: string | (() => string); }): Promise; type TRetriableMethod = (...args: any[]) => Promise; interface IRetriableOptions { timeout?: number; retries?: number; onError?: (error: any, ...args: any[]) => Promise> | void; } class Retriable { fn: T; ctx: any; private _retries; private _options; constructor(fn: T, ctx: any); options(opts: IRetriableOptions): this; call(...args: Parameters): ReturnType; private tick; } export {}; }