Skip to content

Commit 79632ea

Browse files
author
Simon Grondin
committed
Update typings
1 parent 78ae54b commit 79632ea

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

bottleneck.d.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ declare module "bottleneck" {
7777
* An existing Bottleneck.RedisConnection or Bottleneck.IORedisConnection object to use.
7878
* If using, `datastore`, `clientOptions` and `clusterNodes` will be ignored.
7979
*/
80+
/**
81+
* Optional Redis/IORedis library from `require('ioredis')` or equivalent. If not, Bottleneck will attempt to require Redis/IORedis at runtime.
82+
*/
83+
readonly Redis?: any;
84+
/**
85+
* Bottleneck connection object created from `new Bottleneck.RedisConnection` or `new Bottleneck.IORedisConnection`.
86+
*/
8087
readonly connection?: Bottleneck.RedisConnection | Bottleneck.IORedisConnection | null;
8188
/**
8289
* When set to `true`, on initial startup, the limiter will wipe any existing Bottleneck state data on the Redis db.
@@ -170,7 +177,7 @@ declare module "bottleneck" {
170177
*/
171178
readonly client?: any;
172179
/**
173-
* Optional IORedis library from `require('ioredis')` or equivalent. If not, bottleneck will attempt to require ioredis at runtime.
180+
* Optional Redis library from `require('redis')` or equivalent. If not, Bottleneck will attempt to require Redis at runtime.
174181
*/
175182
readonly Redis?: any;
176183
};
@@ -189,7 +196,7 @@ declare module "bottleneck" {
189196
*/
190197
readonly client?: any;
191198
/**
192-
* Optional IORedis library from `require('ioredis')` or equivalent. If not, bottleneck will attempt to require
199+
* Optional IORedis library from `require('ioredis')` or equivalent. If not, Bottleneck will attempt to require IORedis at runtime.
193200
*/
194201
readonly Redis?: any;
195202
};

bottleneck.d.ts.ejs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ declare module "bottleneck" {
7777
* An existing Bottleneck.RedisConnection or Bottleneck.IORedisConnection object to use.
7878
* If using, `datastore`, `clientOptions` and `clusterNodes` will be ignored.
7979
*/
80+
/**
81+
* Optional Redis/IORedis library from `require('ioredis')` or equivalent. If not, Bottleneck will attempt to require Redis/IORedis at runtime.
82+
*/
83+
readonly Redis?: any;
84+
/**
85+
* Bottleneck connection object created from `new Bottleneck.RedisConnection` or `new Bottleneck.IORedisConnection`.
86+
*/
8087
readonly connection?: Bottleneck.RedisConnection | Bottleneck.IORedisConnection | null;
8188
/**
8289
* When set to `true`, on initial startup, the limiter will wipe any existing Bottleneck state data on the Redis db.
@@ -169,6 +176,10 @@ declare module "bottleneck" {
169176
* An existing NodeRedis client to use. If using, `clientOptions` will be ignored.
170177
*/
171178
readonly client?: any;
179+
/**
180+
* Optional Redis library from `require('redis')` or equivalent. If not, Bottleneck will attempt to require Redis at runtime.
181+
*/
182+
readonly Redis?: any;
172183
};
173184

174185
type IORedisConnectionOptions = {
@@ -184,6 +195,10 @@ declare module "bottleneck" {
184195
* An existing ioredis client to use. If using, `clientOptions` and `clusterNodes` will be ignored.
185196
*/
186197
readonly client?: any;
198+
/**
199+
* Optional IORedis library from `require('ioredis')` or equivalent. If not, Bottleneck will attempt to require IORedis at runtime.
200+
*/
201+
readonly Redis?: any;
187202
};
188203

189204
type BatcherOptions = {

0 commit comments

Comments
 (0)