import * as cron from 'cron'; import { CronMetadata } from './metadata/CronMetadata'; /** * Mounted cron job. * * @export * @interface ICronJob */ export interface ICronJob { job: cron.CronJob; cronMetadata: CronMetadata; } /** * Manages all mounted crons. * * @export * @class CronManager */ export declare class CronManager { /** * All mounted crons. * * @private * @static * @type {ICronJob[]} * @memberof CronManager */ private static cronJobs; /** * Registers all controllers and their crons. * * @static * @param {Function[]} classes Controller classes * @memberof CronManager */ static registerController(classes: Function[]): void; /** * Starts a stopped cron. * * @static * @param {string} name Name of the cron to start * @returns {boolean} Flag, wheter or not the cron could be started * @memberof CronManager */ static startCron(name: string): boolean; /** * Stops a running cron job. * * @static * @param {string} name Name of the cron job to stop * @returns {boolean} Flag, wheter or not the cron could be stopped * @memberof CronManager */ static stopCron(name: string): boolean; /** * Executes a cron job manually. * * @static * @param {string} name Name of the cron job to execute * @returns {boolean} Flag, wheter or not the cron could be executed * @memberof CronManager */ static execCron(name: string): boolean; /** * Returns a mounted cron job. * * @static * @param {string} name Name of the cron job to return * @returns {(cron.CronJob | undefined)} Found cron job or undefined if the cron could not be found * @memberof CronManager */ static getCron(name: string): cron.CronJob | undefined; /** * Returns all mounted cron jobs. * * @static * @param {string} [namespace] Namespace to filter the cron jobs * @returns {Map} Found cronjobs * @memberof CronManager */ static getCrons(namespace?: string): Map; }