/** * Error which will be thrown if a timeout happens and no other * error is provided. */ export declare class TimeoutError extends Error { readonly name = "TimeoutError"; } /** * Options for {@link withTimeout}. */ export interface WithTimeoutOptions { block: Promise | (() => Promise); /** * If the timeout happens, generate the error which will be thrown. */ onThrow?: () => Error; /** * If the timeout happens, generate a value which will be used * to resolve the promise instead of throwing an error. */ onTimeout?: undefined | T | (() => T); /** * Maximum time to wait for the original promise to resolve before * giving up and forcing a resolution. */ timeoutMS: number; } /** * Wrap a given block or promise in another promise which will * resolve or reject if the first has not resolved within the * specified time limit. */ export declare function withTimeout(options: WithTimeoutOptions): Promise; //# sourceMappingURL=with-timeout.d.ts.map