UNPKG

676 BTypeScriptView Raw
1/**
2 * Error that is thrown on timeouts.
3 */
4export declare class TimeoutError extends Error {
5 constructor(message?: string);
6}
7/**
8 * Adds a timeout to a promise and rejects if the specified timeout has elapsed. Also rejects if the specified promise
9 * rejects, and resolves if the specified promise resolves.
10 *
11 * <p> NOTE: this operation will continue even after it throws a {@link TimeoutError}.
12 *
13 * @param promise promise to use with timeout.
14 * @param timeout the timeout in milliseconds until the returned promise is rejected.
15 */
16export declare function callWithTimeout<T>(promise: Promise<T>, timeout: number): Promise<T>;
17//# sourceMappingURL=timeout.d.ts.map
\No newline at end of file