prex-es5
Version:
Async coordination primitives and extensions on top of ES6 Promises
36 lines (34 loc) • 1.51 kB
TypeScript
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Licensed under the Apache License, Version 2.0.
See LICENSE file in the project root for details.
***************************************************************************** */
import { CancellationToken } from "./cancellation";
/**
* Waits the specified number of milliseconds before resolving.
*
* @param msec The number of milliseconds to wait before resolving.
*/
export declare function delay(msec: number): Promise<void>;
/**
* Waits the specified number of milliseconds before resolving with the provided value.
*
* @param msec The number of milliseconds to wait before resolving.
* @param value An optional value for the resulting Promise.
*/
export declare function delay<T>(msec: number, value: T | PromiseLike<T>): Promise<T>;
/**
* Waits the specified number of milliseconds before resolving.
*
* @param token A CancellationToken
* @param msec The number of milliseconds to wait before resolving.
*/
export declare function delay(token: CancellationToken, msec: number): Promise<void>;
/**
* Waits the specified number of milliseconds before resolving with the provided value.
*
* @param token A CancellationToken
* @param msec The number of milliseconds to wait before resolving.
* @param value An optional value for the resulting Promise.
*/
export declare function delay<T>(token: CancellationToken, msec: number, value: T | PromiseLike<T>): Promise<T>;