/** * CronScheduler * Schedules callbacks on a cron schedule using setTimeout. */ import type { CronInput, ScheduleController, ScheduleOptions } from './types'; /** CronScheduler schedules callbacks to run according to a cron expression. */ export declare class CronScheduler { private static readonly parser; private static readonly calculator; private static instance?; /** Get the CronScheduler instance. */ static getInstance(): CronScheduler; private constructor(); /** * Schedule a callback to run on the given cron schedule. * * @param expr - A standard 5-field cron string, parsed cron object or special alias. * The special '@reboot' alias fires the callback immediately once. * @param callback - Function to invoke on each scheduled occurrence. * @param options - Optional ScheduleOptions with timezone. * @returns A ScheduleController with stop(), on(), and off() methods. * * @example * const job = scheduler.schedule( '0 * * * *', () => console.log( 'tick' ), { timezone: 'UTC' } ); * job.on( 'tick', () => console.log( 'about to fire' ) ); * job.stop(); */ schedule(expr: CronInput, callback: () => void, options?: ScheduleOptions): ScheduleController; }