Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
57481d3
commit 4bed979
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Definitions by: morsic <https://github.com/maximelkin>, | ||
// burtek <https://github.com/burtek>, | ||
// Richard Honor <https://github.com/RMHonor> | ||
// Ata Berk YILMAZ <https://github.com/ataberkylmz> | ||
// Alex Seidmann <https://github.com/aseidma> | ||
|
||
import EventEmitter from 'events'; | ||
|
||
export function schedule(cronExpression: string, func: (now: Date) => void, options?: ScheduleOptions): ScheduledTask; | ||
|
||
export function validate(cronExpression: string): boolean; | ||
|
||
export function getTasks(): Map<string, ScheduledTask>; | ||
|
||
export interface ScheduledTask extends EventEmitter { | ||
start: () => this; | ||
stop: () => this; | ||
} | ||
|
||
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; | ||
} |