/** * CronParser * Parses and validates cron expressions. */ import type { CronObject, CronTuple, ParsedCronExpression } from './types'; /** Parses and validates cron expressions into structured objects. */ export declare class CronParser { private static readonly SPLIT; private static instance?; /** Get the CronParser instance. */ static getInstance(): CronParser; private constructor(); /** Expand a special alias into its 5-field equivalent. */ private expandAlias; /** Split a cron expression string into its five field tokens. */ private splitFields; /** Expand a named alias (e.g. JAN) to its numeric value for the given field. */ private resolveAlias; /** Parse a single field token into components. */ private parseFieldToken; /** Compute and validate the full set of matching integers from parsed components. */ private computeValues; /** * Convert a cron expression into a ordered CronTuple. * * @param expr - A standard 5-field cron string or special alias. * @returns A CronTuple with ordered cron fields * @throws Error if the expression is malformed. * * @example * parser.toTuple( '0 1 * * SAT,SUN' ); */ toTuple(expr: string): CronTuple; /** * Convert a cron expression into a structured CronObject. * * @param expr - A standard 5-field cron string or special alias. * @returns A CronObject containing the raw field values. * @throws Error if the expression is malformed. * * @example * parser.toObject( '0 9 * * MON' ); */ toObject(expr: string): CronObject; /** * Parse a cron expression into a fully validated internal representation. * * The returned object contains the parsed field definitions together with * pre-computed value sets for efficient schedule evaluation. * * @param expr - A standard 5-field cron string or special alias. * @returns A fully parsed cron expression. * @throws Error if the expression is malformed or contains invalid values. * * @example * const parsed = parser.parse( '* 9-17 * JAN,MAR MON-FRI' ); */ parse(expr: string): ParsedCronExpression; /** * Validate a cron expression without throwing. * * @param expr - The cron expression to validate. * @returns true if valid, false otherwise. * * @example * parser.validate( '0 9 * * MON' ); // true * parser.validate( '99 * * * *' ); // false */ validate(expr: string): boolean; }