UNPKG

1.15 kBTypeScriptView Raw
1/** describes a component of time. `H:MM:SS.MS` */
2export declare enum TimeUnit {
3 HOUR_24 = "hour24",
4 HOUR_12 = "hour12",
5 MINUTE = "minute",
6 SECOND = "second",
7 MS = "ms"
8}
9/** Returns the given time unit component of the date. */
10export declare function getTimeUnit(unit: TimeUnit, date: Date): number;
11/** Sets the given time unit to the given time in date object. Modifies given `date` object and returns it. */
12export declare function setTimeUnit(unit: TimeUnit, time: number, date: Date, isPm: boolean): Date;
13/** Returns true if `time` is a valid value */
14export declare function isTimeUnitValid(unit: TimeUnit, time?: number): boolean;
15/** If unit of time is greater than max, returns min. If less than min, returns max. Otherwise, returns time. */
16export declare function wrapTimeAtUnit(unit: TimeUnit, time: number): number;
17export declare function getTimeUnitClassName(unit: TimeUnit): string;
18export declare function getTimeUnitMax(unit: TimeUnit): number;
19export declare function getTimeUnitMin(unit: TimeUnit): number;
20export declare function getDefaultMinTime(): Date;
21export declare function getDefaultMaxTime(): Date;