/** A schedule resolved to the one calculation the pump needs. */ export interface Recurrence { /** The expression exactly as the user wrote it, trimmed; listings show this. */ readonly expression: string; /** Epoch milliseconds of the first fire strictly after `after`, or null when none follows. */ nextFire(after: number): number | null; /** * The spacing of an interval schedule, or undefined for a calendar schedule. * The pump floors its next-fire gap by this when the period is shorter than * that floor (ADR-0018). */ readonly periodMs?: number; } /** Sub-second schedules are not offered; the pump itself may tick every second. */ export declare const MIN_INTERVAL_MS = 1000; /** * Parses the interval shorthand shared by `schedule` and `expiresIn`: a whole * number followed by `s`, `m` or `h`, such as `30s`, `10m` or `2h`. * * Returns undefined for anything else, including zero, fractions and days. The * caller turns that into a user-facing message; the parser holds no prose. */ export declare function parseDurationMs(input: string): number | undefined; /** Why a schedule expression was refused; the caller turns it into the message. */ export type ScheduleProblem = "invalid" | "six-field"; /** One raw expression, resolved or refused with the shape that was wrong. */ export type ScheduleResolution = { readonly kind: "resolved"; readonly recurrence: Recurrence; } | { readonly kind: "rejected"; readonly problem: ScheduleProblem; }; /** * Resolves a raw schedule expression onto {@link Recurrence}: interval shorthand * (`30s`, `10m`, `2h`) or a five-field cron expression (`0 9 * * 1-5`, ADR-0006). * * A refusal says which shape was wrong and nothing more: six whitespace-separated * fields is a cron expression written with the seconds column, which cron here * does not take, while everything else is simply invalid. The parser holds no * prose; the caller names the accepted shapes (ADR-0006). */ export declare function resolveSchedule(expression: string): ScheduleResolution; /** {@link resolveSchedule} for the callers that only ask "is there a schedule?". */ export declare function parseSchedule(expression: string): Recurrence | undefined;