1 | /*! *****************************************************************************
|
2 | Copyright (c) Microsoft Corporation.
|
3 | Licensed under the Apache License, Version 2.0.
|
4 |
|
5 | See LICENSE file in the project root for details.
|
6 | ***************************************************************************** */
|
7 | import { CancellationToken } from "./cancellation";
|
8 | import { Cancelable } from "@esfx/cancelable";
|
9 | /**
|
10 | * Waits the specified number of milliseconds before resolving.
|
11 | *
|
12 | * @param msec The number of milliseconds to wait before resolving.
|
13 | */
|
14 | export declare function delay(msec: number): Promise<void>;
|
15 | /**
|
16 | * Waits the specified number of milliseconds before resolving with the provided value.
|
17 | *
|
18 | * @param msec The number of milliseconds to wait before resolving.
|
19 | * @param value An optional value for the resulting Promise.
|
20 | */
|
21 | export declare function delay<T>(msec: number, value: T | PromiseLike<T>): Promise<T>;
|
22 | /**
|
23 | * Waits the specified number of milliseconds before resolving.
|
24 | *
|
25 | * @param token A CancellationToken
|
26 | * @param msec The number of milliseconds to wait before resolving.
|
27 | */
|
28 | export declare function delay(token: CancellationToken | Cancelable, msec: number): Promise<void>;
|
29 | /**
|
30 | * Waits the specified number of milliseconds before resolving with the provided value.
|
31 | *
|
32 | * @param token A CancellationToken
|
33 | * @param msec The number of milliseconds to wait before resolving.
|
34 | * @param value An optional value for the resulting Promise.
|
35 | */
|
36 | export declare function delay<T>(token: CancellationToken | Cancelable, msec: number, value: T | PromiseLike<T>): Promise<T>;
|