/** * CronCalculator * Computes next and previous execution times using a jump-based scheduling algorithm. * Designed for O(log n) per field resolution using pre-sorted value sets. */ import type { CronInput, RunOptions } from './types'; /** Computes next/previous scheduled run times for cron expressions. */ export declare class CronCalculator { private static readonly parser; private static instance?; private readonly formatter; /** Get the CronCalculator instance. */ static getInstance(): CronCalculator; private constructor(); /** Resolve string or parsed expression into ParsedCronExpression. */ private resolve; /** Get number of days in month. */ private DOM; /** Get the day of week. */ private DOW; /** Binary search: lower bound (first >= x). */ private lower; /** Binary search: upper bound (last <= x). */ private upper; /** * Returns only the relevant candidates using binary search jumps. * No full array scans, no filtering, no allocation loops. */ private pick; /** Cron day matching logic (DOM + DOW semantics). */ private match; /** Validate chronological direction correctness. */ private valid; /** Format a date into timezone-aligned parts. */ private toDateTimeParts; /** Get date time part by key. */ private getPart; /** Extract timezone-safe date parts. */ private parts; /** Build UTC Date from timezone-aligned components. */ private build; /** * Core jump-based scheduler. * Walks year → month → day → hour → minute using binary search jumps. */ private step; /** Shared execution loop for next/prev. */ private run; /** * Compute next N execution times. * * @param expr - Cron string or pre-parsed expression * @param options - Run options (timezone, before, after, count) * * @example * calc.next( '0 9 * * MON', { count: 3, timezone: 'UTC' } ); */ next(expr: CronInput, options?: RunOptions): Date[]; /** * Compute previous N execution times. * * @param expr - Cron string or pre-parsed expression * @param options - Run options (timezone, before, after, count) * * @example * calc.prev( '0 9 * * MON', { count: 3 } ); */ prev(expr: CronInput, options?: RunOptions): Date[]; }