smarttime/dist_ts/smarttime.classes.cronjob.d.ts
2020-05-25 21:45:43 +00:00

18 lines
592 B
TypeScript

import { CronManager } from './smarttime.classes.cronmanager';
export declare type TJobFunction = (() => void) | (() => Promise<any>);
export declare class CronJob {
status: 'started' | 'stopped' | 'initial';
cronExpression: string;
jobFunction: TJobFunction;
private cronInterval;
private nextExecutionUnix;
constructor(cronManager: CronManager, cronExpressionArg: string, jobFunction: TJobFunction);
/**
* checks wether the cronjob needs to be executed
*/
checkExecution(): void;
start(): void;
stop(): void;
private getCronInterval;
}