mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
🤖 Merge PR #65866 Update node-cron index.d.ts file by @neerajkumar161
* Update index.d.ts - Added description comment for `schedule`, `validate` and `getTasks` methods * fix: trailing whitespace
This commit is contained in:
13
types/node-cron/index.d.ts
vendored
13
types/node-cron/index.d.ts
vendored
@@ -9,10 +9,23 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
/**
|
||||
* Creates a new task to execute the given function when the cron expression ticks.
|
||||
* @param cronExpression
|
||||
* @param func
|
||||
* @param options
|
||||
*/
|
||||
export function schedule(cronExpression: string, func: ((now: Date | "manual" | "init") => void) | string, options?: ScheduleOptions): ScheduledTask;
|
||||
|
||||
/**
|
||||
* To validate whether the expression is a cron expression or not
|
||||
* @param cronExpression
|
||||
*/
|
||||
export function validate(cronExpression: string): boolean;
|
||||
|
||||
/**
|
||||
* Get the list of tasks created using the `schedule` function
|
||||
*/
|
||||
export function getTasks(): Map<string, ScheduledTask>;
|
||||
|
||||
export interface ScheduledTask extends EventEmitter {
|
||||
|
||||
Reference in New Issue
Block a user