From 10afd44fc9a0f5e80c67ea3b8cf757c64373be2c Mon Sep 17 00:00:00 2001 From: Maxime VAST Date: Thu, 26 Jul 2018 20:58:04 +0200 Subject: [PATCH] Add typings for getJobs and fix remove repeatable 'repeat' param (#27602) --- types/bull/index.d.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index 8486e03f59..c204fea135 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -8,6 +8,7 @@ // Oleg Repin // David Koblas // Bond Akinmade +// 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; + removeRepeatable(repeat: (CronRepeatOptions | EveryRepeatOptions) & { jobId?: JobId }): Promise; /** * 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; + removeRepeatable(name: string, repeat: (CronRepeatOptions | EveryRepeatOptions) & { jobId?: JobId }): Promise; + + /** + * 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; /** * Returns a promise that resolves with the job counts for the given queue.