export declare class TimeoutError extends Error { context?: any; constructor(context?: any); } export declare class TimeoutPromise implements Promise { [Symbol.toStringTag]: any; private promise; constructor(executor: (resolve: (value?: T | PromiseLike) => void, reject: (e?: any) => void) => void, timeout: number, context?: any); then(onfulfilled?: (value: T) => PromiseLike | R, onrejected?: (reason: any) => PromiseLike | E): Promise; catch(onrejected?: (reason: any) => PromiseLike | TResult): Promise; finally(onfinally?: (() => void) | undefined | null): Promise; } export declare function timeoutPromise(p: Promise, timeout: number, context?: any): Promise;