From bae6427ce9d9fac26b198402068bd84647fd8208 Mon Sep 17 00:00:00 2001 From: Shean de Montigny-Desautels Date: Wed, 24 May 2023 07:44:17 -0400 Subject: [PATCH] fix(types): rename strategyOptions to options to reflect js file --- PATTERNS.md | 2 +- REFERENCE.md | 2 +- index.d.ts | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/PATTERNS.md b/PATTERNS.md index 2e1c09993..63696b830 100644 --- a/PATTERNS.md +++ b/PATTERNS.md @@ -199,7 +199,7 @@ myQueue.add({ foo: 'bar' }, { attempts: 10, backoff: { type: 'binaryExponential', - strategyOptions: { + options: { delay: 500, truncate: 5 } diff --git a/REFERENCE.md b/REFERENCE.md index d91f4972a..f2066b5b5 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -388,7 +388,7 @@ await queue.add({}, { jobId: 'example' }) // Will not be created, conflicts with interface BackoffOpts { type: string; // Backoff type, which can be either `fixed` or `exponential`. A custom backoff strategy can also be specified in `backoffStrategies` on the queue settings. delay: number; // Backoff delay, in milliseconds. - strategyOptions?: any; // Options for custom strategies + options?: any; // Options for custom strategies } ``` diff --git a/index.d.ts b/index.d.ts index 632aaf230..3afa9ece0 100644 --- a/index.d.ts +++ b/index.d.ts @@ -64,7 +64,7 @@ declare namespace Bull { * Options passed into the `ioredis` constructor's `options` parameter. * `connectionName` is overwritten with `Queue.clientName()`. other properties are copied */ - redis?: Redis.RedisOptions | string| undefined; + redis?: Redis.RedisOptions | string | undefined; /** * When specified, the `Queue` will use this function to create new `ioredis` client connections. @@ -377,7 +377,7 @@ declare namespace Bull { /** * Options for custom strategies */ - strategyOptions?: any; + options?: any; } interface RepeatOptions { @@ -395,7 +395,7 @@ declare namespace Bull { * Number of times the job should repeat at max. */ limit?: number | undefined; - + /** * The start value for the repeat iteration count. */ @@ -913,10 +913,10 @@ declare namespace Bull { * @returns - Returns an object with queue metrics. */ getMetrics( - type: 'completed' | 'failed', - start?: number, + type: 'completed' | 'failed', + start?: number, end?: number - ) : Promise<{ + ): Promise<{ meta: { count: number; prevTS: number; @@ -924,7 +924,7 @@ declare namespace Bull { }; data: number[]; count: number; - }> + }>; /** * Returns a promise that marks the start of a transaction block.