import type { DispatchArgs } from "./protocol.js"; export declare const RUN_SLOT = "{{run}}"; export interface Schedule { name: string; /** As the user wrote it (`every 2h`, `daily 09:00`, `cron 0 9 * * 1-5`). */ when: string; /** What runs: a dispatch whose sessionFile and command hold `{{run}}`. */ launch: DispatchArgs; paused: boolean; /** Run once on start when a run was due while the service was off (default true). */ catchUp: boolean; /** The task as typed (shown in lists). */ task?: string; createdAt: number; /** What `every` counts from: when it was made, or last resumed. */ anchor: number; /** The next run (ms epoch), or null while paused. */ nextAt: number | null; lastRunAt?: number; lastJob?: string; /** Why the last due run did not start (the previous one still running, an error). */ lastSkip?: { at: number; why: string; }; } export declare const SCHEDULE_NAME: RegExp; type Field = Set; export interface Cron { minute: Field; hour: Field; dom: Field; month: Field; dow: Field; /** Day of month and day of week both restricted: either matches (cron's rule). */ domAndDow: boolean; } export declare function parseCron(expr: string): Cron; /** * The first minute after `after` the cron matches (local time), within ~5 years. Steps * never go back: in the hour a DST change repeats, a local setter can land an hour * earlier; a step that would is made a minute forward instead. */ export declare function nextCron(c: Cron, after: number): number | null; export type When = { every: number; } | { cron: Cron; }; /** `every 30m` (1m at least), `daily 09:00`, `weekdays 09:00`, `cron `. */ export declare function parseWhen(text: string): When; /** The run after `after`. `every` counts from `from` (the schedule's start, or its last run). */ export declare function nextRun(when: When, after: number, from?: number): number | null; /** A run's own session file name, as pi names one (`