1 | // Type definitions for node-cron 3.0
|
2 | // Project: https://github.com/node-cron/node-cron, https://github.com/merencia/node-cron
|
3 | // Definitions by: morsic <https://github.com/maximelkin>,
|
4 | // burtek <https://github.com/burtek>,
|
5 | // Richard Honor <https://github.com/RMHonor>
|
6 | // Ata Berk YILMAZ <https://github.com/ataberkylmz>
|
7 | // Alex Seidmann <https://github.com/aseidma>
|
8 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
9 | import EventEmitter = require('events');
|
10 |
|
11 | export function schedule(cronExpression: string, func: (now: Date) => void, options?: ScheduleOptions): ScheduledTask;
|
12 |
|
13 | export function validate(cronExpression: string): boolean;
|
14 |
|
15 | export function getTasks(): ScheduledTask[];
|
16 |
|
17 | export interface ScheduledTask extends EventEmitter {
|
18 | start: () => this;
|
19 | stop: () => this;
|
20 | }
|
21 |
|
22 | export interface ScheduleOptions {
|
23 | /**
|
24 | * A boolean to set if the created task is scheduled.
|
25 | *
|
26 | * Defaults to `true`
|
27 | */
|
28 | scheduled?: boolean | undefined;
|
29 | /**
|
30 | * The timezone that is used for job scheduling
|
31 | */
|
32 | timezone?: string;
|
33 | /**
|
34 | * Specifies whether to recover missed executions instead of skipping them.
|
35 | *
|
36 | * Defaults to `false`
|
37 | */
|
38 | recoverMissedExecutions?: boolean;
|
39 | }
|