UNPKG

752 BTypeScriptView Raw
1export type Deadline = Date | number;
2export declare function minDeadline(...deadlineList: Deadline[]): Deadline;
3export declare function getDeadlineTimeoutString(deadline: Deadline): string;
4/**
5 * Get the timeout value that should be passed to setTimeout now for the timer
6 * to end at the deadline. For any deadline before now, the timer should end
7 * immediately, represented by a value of 0. For any deadline more than
8 * MAX_TIMEOUT_TIME milliseconds in the future, a timer cannot be set that will
9 * end at that time, so it is treated as infinitely far in the future.
10 * @param deadline
11 * @returns
12 */
13export declare function getRelativeTimeout(deadline: Deadline): number;
14export declare function deadlineToString(deadline: Deadline): string;