@mastra/core
Version:
Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.
22 lines • 866 B
TypeScript
/**
* Validate a cron expression. Throws if the pattern is invalid.
*
* @param cron - Cron expression (5-, 6-, or 7-part).
* @param timezone - Optional IANA timezone (e.g. 'America/New_York').
*/
export declare function validateCron(cron: string, timezone?: string): void;
/**
* Compute the next fire time (ms since epoch) for a cron expression.
*
* @param cron - Cron expression.
* @param options - Optional timezone and reference time (`after`, ms since epoch).
* The next fire time is the first cron occurrence strictly after `after`.
* Defaults to `Date.now()`.
* @returns The next fire time in ms since epoch.
* @throws If the cron expression is invalid or has no future occurrence.
*/
export declare function computeNextFireAt(cron: string, options?: {
timezone?: string;
after?: number;
}): number;
//# sourceMappingURL=cron.d.ts.map