1 | export type Deadline = Date | number;
|
2 | export declare function minDeadline(...deadlineList: Deadline[]): Deadline;
|
3 | export 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 | */
|
13 | export declare function getRelativeTimeout(deadline: Deadline): number;
|
14 | export declare function deadlineToString(deadline: Deadline): string;
|
15 | /**
|
16 | * Calculate the difference between two dates as a number of seconds and format
|
17 | * it as a string.
|
18 | * @param startDate
|
19 | * @param endDate
|
20 | * @returns
|
21 | */
|
22 | export declare function formatDateDifference(startDate: Date, endDate: Date): string;
|