🤖 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:
Neeraj Kumar
2023-06-24 23:55:42 +05:30
committed by GitHub
parent 4c849782b0
commit fb01caea76

View File

@@ -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 {