natural-cron
Version:
Natural Cron is a easy-to-use Node.js library for creating and validating cron expressions with natural, human-readable APIs.
23 lines (22 loc) • 1.02 kB
TypeScript
import { Schedule } from './interfaces';
export declare class CronUtils {
/**
* Checks if the numbers in an array are contiguous.
* @param {Array<number>} numbers - An array of numbers to check.
* @returns {boolean} - True if the numbers form a contiguous sequence.
*/
static isContiguous(numbers: Array<number>): boolean;
/**
* Formats a list of numbers into a cron-compatible string.
* @param {Array<number>} values - An array of numbers.
* @returns {string} - A cron-formatted string.
*/
static formatCronPart(values: Array<number>): string;
/**
* Sets a default value for a given key in a schedule object if it's not already set.
* @param {Schedule} schedule - The schedule object.
* @param {string} field - The key to check in the schedule.
* @param {string | number} defaultValue - The default value to set if the key is undefined.
*/
static setDefault(schedule: Schedule, field: string, defaultValue: string | number): void;
}