/** * An object with contains for each element of a date, which values are allowed. * Everything starting at 0, except for days. */ export interface ICronDefinition { readonly seconds: Set; readonly minutes: Set; readonly hours: Set; readonly days: Set; readonly months: Set; readonly weekdays: Set; } export declare class Cron { readonly seconds: ReadonlyArray; readonly minutes: ReadonlyArray; readonly hours: ReadonlyArray; readonly days: ReadonlyArray; readonly months: ReadonlyArray; readonly weekdays: ReadonlyArray; readonly reversed: { seconds: ReadonlyArray; minutes: ReadonlyArray; hours: ReadonlyArray; days: ReadonlyArray; months: ReadonlyArray; weekdays: ReadonlyArray; }; constructor({ seconds, minutes, hours, days, months, weekdays, }: ICronDefinition); /** * Find the next or previous hour, starting from the given start hour that matches the hour constraint. * startHour itself might also be allowed. */ private findAllowedHour; /** * Find the next or previous minute, starting from the given start minute that matches the minute constraint. * startMinute itself might also be allowed. */ private findAllowedMinute; /** * Find the next or previous second, starting from the given start second that matches the second constraint. * startSecond itself IS NOT allowed. */ private findAllowedSecond; /** * Find the next or previous time, starting from the given start time that matches the hour, minute * and second constraints. startTime itself might also be allowed. */ private findAllowedTime; /** * Find the next or previous day in the given month, starting from the given startDay * that matches either the day or the weekday constraint. startDay itself might also be allowed. */ private findAllowedDayInMonth; /** Gets the next date starting from the given start date or now. */ getNextDate(startDate?: Date): Date; /** Gets the specified amount of future dates starting from the given start date or now. */ getNextDates(amount: number, startDate?: Date): Date[]; /** * Get an ES6 compatible iterator which iterates over the next dates starting from startDate or now. * The iterator runs until the optional endDate is reached or forever. */ getNextDatesIterator(startDate?: Date, endDate?: Date): Generator; /** Gets the previous date starting from the given start date or now. */ getPrevDate(startDate?: Date): Date; /** Gets the specified amount of previous dates starting from the given start date or now. */ getPrevDates(amount: number, startDate?: Date): Date[]; /** * Get an ES6 compatible iterator which iterates over the previous dates starting from startDate or now. * The iterator runs until the optional endDate is reached or forever. */ getPrevDatesIterator(startDate?: Date, endDate?: Date): Generator; /** Returns true when there is a cron date at the given date. */ matchDate(date: Date): boolean; }