Add typings for getJobs and fix remove repeatable 'repeat' param (#27602)

This commit is contained in:
Maxime VAST
2018-07-26 11:58:04 -07:00
committed by Andy
parent 712a47b529
commit 10afd44fc9
+9 -2
View File
@@ -8,6 +8,7 @@
// Oleg Repin <https://github.com/iamolegga>
// David Koblas <https://github.com/koblas>
// Bond Akinmade <https://github.com/bondz>
// Wuha Team <https://github.com/wuha-team>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -534,7 +535,7 @@ declare namespace Bull {
* Removes a given repeatable job. The RepeatOptions and JobId needs to be the same as the ones
* used for the job when it was added.
*/
removeRepeatable(repeat: RepeatOptions & { jobId?: JobId }): Promise<void>;
removeRepeatable(repeat: (CronRepeatOptions | EveryRepeatOptions) & { jobId?: JobId }): Promise<void>;
/**
* Removes a given repeatable job. The RepeatOptions and JobId needs to be the same as the ones
@@ -542,7 +543,13 @@ declare namespace Bull {
*
* name: The name of the to be removed job
*/
removeRepeatable(name: string, repeat: RepeatOptions & { jobId?: JobId }): Promise<void>;
removeRepeatable(name: string, repeat: (CronRepeatOptions | EveryRepeatOptions) & { jobId?: JobId }): Promise<void>;
/**
* Returns a promise that will return an array of job instances of the given types.
* Optional parameters for range and ordering are provided.
*/
getJobs(types: string[], start?: number, end?: number, asc?: boolean): Promise<Job[]>;
/**
* Returns a promise that resolves with the job counts for the given queue.