UNPKG

1.17 kBTypeScriptView Raw
1import { PendingWaiterState, Waiter } from './types';
2/**
3 * Registers a waiter.
4 *
5 * @public
6 * @param waiter {Waiter} A test waiter instance
7 */
8export declare function register(waiter: Waiter): void;
9/**
10 * Un-registers a waiter.
11 *
12 * @public
13 * @param waiter {Waiter} A test waiter instance
14 */
15export declare function unregister(waiter: Waiter): void;
16/**
17 * Gets an array of all waiters current registered.
18 *
19 * @public
20 * @returns {Waiter[]}
21 */
22export declare function getWaiters(): Waiter[];
23/**
24 * Clears all waiters.
25 *
26 * @private
27 */
28export declare function _reset(): void;
29/**
30 * Gets the current state of all waiters. Any waiters whose
31 * `waitUntil` method returns false will be considered `pending`.
32 *
33 * @returns {PendingWaiterState} An object containing a count of all waiters
34 * pending and a `waiters` object containing the name of all pending waiters
35 * and their debug info.
36 */
37export declare function getPendingWaiterState(): PendingWaiterState;
38/**
39 * Determines if there are any pending waiters.
40 *
41 * @returns {boolean} `true` if there are pending waiters, otherwise `false`.
42 */
43export declare function hasPendingWaiters(): boolean;