export interface CronExplanation { /** The cron schedule portion of the input (the five time fields). */ expression: string; /** The command appended after the schedule, when present. */ command?: string; /** A human-readable summary of the schedule. */ description: string; /** The next execution dates, starting after `from`. */ nextRuns: Date[]; } export interface CronExpressionExplainerOptions { /** How many upcoming runs to compute. Defaults to `5`. */ count?: number; /** The reference date to compute runs from. Defaults to `new Date()`. */ from?: Date; } /** * Explain a cron expression in plain language and compute its upcoming runs. * * Accepts a standard 5-field cron expression (`minute hour day-of-month month * day-of-week`), optionally followed by a command. Supports `*`, lists (`1,2,3`), * ranges (`1-5`), steps (`*\/5`, `0-30/10`) and month/weekday aliases * (`jan`, `mon`, …). Day-of-week accepts both `0` and `7` for Sunday. * * @param input - A cron expression, optionally followed by a command to run. * @param options - Controls how many runs to compute and the reference date. * @returns The parsed schedule, optional command, description and next runs. * * @example * ```ts * cronExpressionExplainer('0 * * * 0 /bin/bash') * // { * // expression: '0 * * * 0', * // command: '/bin/bash', * // description: 'Minute 0, on Sunday', * // nextRuns: [Date, Date, Date, Date, Date], * // } * ``` */ export declare function cronExpressionExplainer(input: string, options?: CronExpressionExplainerOptions): CronExplanation; /** * Compute the upcoming execution dates of a cron expression. * * @param expression - A cron expression (a trailing command is ignored). * @param options - Controls how many runs to compute and the reference date. * @returns The next execution dates, in chronological order, after `from`. */ export declare function getNextCronRuns(expression: string, options?: CronExpressionExplainerOptions): Date[]; /** * Compute the most recent past execution dates of a cron expression. * * @param expression - A cron expression (a trailing command is ignored). * @param options - Controls how many runs to compute and the reference date. * @returns The previous execution dates, most recent first, before `from`. */ export declare function getPreviousCronRuns(expression: string, options?: CronExpressionExplainerOptions): Date[]; /** * Check whether a date satisfies a cron expression. * * Matching is done at minute granularity (seconds and milliseconds are ignored). * * @param expression - A cron expression (a trailing command is ignored). * @param date - The date to test. * @returns `true` when the cron would fire during the date's minute. */ export declare function cronMatches(expression: string, date: Date): boolean; //# sourceMappingURL=cron.d.ts.map