reshuffle
Version:
Reshuffle is a fast, unopinionated, minimalist integration framework
18 lines (17 loc) • 644 B
TypeScript
import { BaseConnector, EventConfiguration } from 'reshuffle-base-connector';
import cron from 'node-cron';
import Reshuffle from '../Reshuffle';
export interface CronEventOptions {
expression: string;
timezone?: cron.ScheduleOptions['timezone'];
}
export default class CronConnector extends BaseConnector<null, CronEventOptions> {
tasksByEventId: {
[eventId: string]: cron.ScheduledTask;
};
constructor(app: Reshuffle, id?: string);
on(options: CronEventOptions, handler: any, eventId?: string): EventConfiguration;
onRemoveEvent(event: EventConfiguration): void;
onStart(): void;
onStop(): void;
}