// Type definitions for node-cron 3.0 // Project: https://github.com/node-cron/node-cron, https://github.com/merencia/node-cron // Definitions by: morsic , // burtek , // Richard Honor // Ata Berk YILMAZ // Alex Seidmann // Pedro Américo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import { EventEmitter } from 'events'; export function schedule(cronExpression: string, func: ((now: Date | "manual" | "init") => void) | string, options?: ScheduleOptions): ScheduledTask; export function validate(cronExpression: string): boolean; export function getTasks(): Map; export interface ScheduledTask extends EventEmitter { now: (now?: Date) => void; start: () => void; stop: () => void; } export interface ScheduleOptions { /** * A boolean to set if the created task is scheduled. * * Defaults to `true` */ scheduled?: boolean | undefined; /** * The timezone that is used for job scheduling */ timezone?: string; /** * Specifies whether to recover missed executions instead of skipping them. * * Defaults to `false` */ recoverMissedExecutions?: boolean; /** * The schedule name */ name?: string; /** * Execute task immediately after creation */ runOnInit?: boolean; }