Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
import { Resolvable } from './types';
/**
 * Returns a promise that will be fulfilled with `value` promise's fulfillment value or
 * rejection reason. However, if `value` promise is not fulfilled or rejected within
 * `ms` milliseconds, the returned promise is rejected with a `TimeoutError` using given
 * `message` as the reason.
 * @param ms Timeout in milliseconds.
 * @param message Error message of the `TimeoutError` to be rejected with. Default is `operation timed out`.
 * @param value Value to be resolved to or a promise-like object to be fulfilled.
 */
export declare function timeout<T>(ms: number, message: string | undefined, value: Resolvable<T>): Promise<T>;
/**
 * Returns a promise that will be fulfilled with `value` promise's fulfillment value or
 * rejection reason. However, if `value` promise is not fulfilled or rejected within
 * `ms` milliseconds, the returned promise is rejected with the given `error` as the reason.
 * @param ms Timeout in milliseconds.
 * @param error Error to be rejected with.
 * @param value Value to be resolved to or a promise-like object to be fulfilled.
 */
export declare function timeout<T>(ms: number, error: Error, value: Resolvable<T>): Promise<T>;
/**
 * Returns a promise that will be rejected with `TimeoutError` after given `ms` milliseconds.
 * @param ms Timeout in milliseconds.
 * @param message Error message of the `TimeoutError` to be rejected with. Default is `operation timed out`.
 */
export declare function timeout<T = never>(ms: number, message?: string): Promise<T>;
/**
 * Returns a promise that will be rejected with given `error` after given `ms` milliseconds.
 * @param ms Timeout in milliseconds.
 * @param error Error to be rejected with.
 */
export declare function timeout<T = never>(ms: number, error: Error): Promise<T>;