typescript: sched.d.ts: distinguish between Timer & Sched

pull/3579/head
Rob Pilling 2024-10-03 22:10:53 +01:00
parent 2517f80754
commit 6f4a3b8c78
1 changed files with 3 additions and 1 deletions

View File

@ -77,6 +77,8 @@ declare module Sched {
} }
); );
type Timer = Sched & { timer: Milliseconds };
type Repeat = { type Repeat = {
num: number, num: number,
interval: "day" | "week" | "month" | "year", interval: "day" | "week" | "month" | "year",
@ -103,7 +105,7 @@ declare module Sched {
function setAlarm(id: string, alarm?: NewSched): void; function setAlarm(id: string, alarm?: NewSched): void;
function resetTimer(alarm: Sched, time?: Date): void; function resetTimer(alarm: Timer, time?: Date): void;
function getTimeToAlarm(alarm: Sched | undefined | null, time?: Date): number | undefined; function getTimeToAlarm(alarm: Sched | undefined | null, time?: Date): number | undefined;
function getTimeToAlarm(alarm?: undefined | null, time?: Date): undefined; function getTimeToAlarm(alarm?: undefined | null, time?: Date): undefined;