timed-silky
Version:
Timed-Silky 是基于一款基于 TypeScript 的定时任务调度器。得益于 TypeScript,Timed-Silky 可以用符合特定句式的自然语言描述任务的调度规则,提供丝滑的链式调用接口。
21 lines (20 loc) • 1.3 kB
TypeScript
declare type Hour = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23;
declare type Minute = "00" | "01" | "02" | "03" | "04" | "05" | "06" | "07" | "08" | "09" | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59;
declare type TimePointTemplate = `${Hour}:${Minute}`;
declare class TimePoint {
hour: number;
minute: number;
second: number;
constructor(hour: number, minute?: number, second?: number);
static compare(tp1: TimePoint, tp2: TimePoint): number;
static subtract(tp1: TimePoint, tp2: TimePoint): number;
}
declare const timePointReg: RegExp;
declare type DayOfWeekNum = 0 | 1 | 2 | 3 | 4 | 5 | 6;
declare type DayOfWeek = "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday";
declare type DayOfWeek2Num = {
[_ in DayOfWeek]: DayOfWeekNum;
};
declare const day2num: DayOfWeek2Num;
declare function dayRange(start: DayOfWeek, end: DayOfWeek): DayOfWeekNum[];
export { TimePointTemplate, TimePoint, timePointReg, DayOfWeekNum, DayOfWeek, day2num, dayRange, };