rsxjs
Version:
Resilience Extensions for JS.
13 lines (12 loc) • 527 B
TypeScript
/**
* @file src/timeout/from-promise.ts
* @copyright 2018-present Karim Alibhai. All rights reserved.
*/
import { TimeoutOptionsGiven } from './types';
/**
* Enforce a timeout over an async function.
* @param {AsyncFunction<T>} cb async function to enforce timeout over
* @param {TimeoutOptions} _options timeout options
* @returns {AsyncFunction<T>} an async function with identical behavior, but will timeout
*/
export declare function fromPromise<T>(promise: Promise<T>, _options?: TimeoutOptionsGiven): Promise<T>;