import { krl } from "krl-stdlib"; import { PicoEvent, PicoFramework } from "pico-framework"; interface ScheduledEvent_base { id: string; event: PicoEvent; } interface ScheduledEvent_at extends ScheduledEvent_base { type: "at"; time: number; } interface ScheduledEvent_repeat extends ScheduledEvent_base { type: "repeat"; timespec: string; } export type ScheduledEvent = ScheduledEvent_at | ScheduledEvent_repeat; type ScheduleJob = (timespec: string, handler: () => void) => { handler: () => void; cancel: () => void; }; type SetTimeout = (handler: () => void, time: number) => void; type ClearTimeout = (handle: any) => void; export declare class Scheduler { private currTimeout; private futures; private crons; private scheduleJob; private setTimeout; private clearTimeout; private now; constructor(scheduleJob?: ScheduleJob, setTimeout?: SetTimeout, clearTimeout?: ClearTimeout, now?: () => number); addFuture(id: string, time: number, handler: () => void): void; addCron(id: string, timespec: string, handler: () => void): void; remove(id: string): void; update(): void; private onTime; } export declare function initScheduleModule(pf: PicoFramework): { module: krl.Module; start(): Promise; }; export {};