From 24f369807ca3b604a51211d805d1d42a8829e668 Mon Sep 17 00:00:00 2001 From: Roman Voloboev Date: Sun, 1 May 2022 16:42:00 +0200 Subject: [PATCH] #156 add clearExpiredByTimeout option type for MySQL and PostgresQL --- lib/index.d.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/index.d.ts b/lib/index.d.ts index 80786b0..43c7faa 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -237,6 +237,10 @@ interface IRateLimiterStoreOptions extends IRateLimiterOptions { tableCreated?: boolean; } +interface IRateLimiterStoreNoAutoExpiryOptions extends IRateLimiterStoreOptions { + clearExpiredByTimeout?: boolean; +} + interface IRateLimiterMongoOptions extends IRateLimiterStoreOptions { indexKeyPrefix?: { [key: string]: any; @@ -326,11 +330,11 @@ export class RateLimiterMongo extends RateLimiterStoreAbstract { } export class RateLimiterMySQL extends RateLimiterStoreAbstract { - constructor(opts: IRateLimiterStoreOptions, cb?: ICallbackReady); + constructor(opts: IRateLimiterStoreNoAutoExpiryOptions, cb?: ICallbackReady); } export class RateLimiterPostgres extends RateLimiterStoreAbstract { - constructor(opts: IRateLimiterStoreOptions, cb?: ICallbackReady); + constructor(opts: IRateLimiterStoreNoAutoExpiryOptions, cb?: ICallbackReady); } export class RateLimiterMemcache extends RateLimiterStoreAbstract {}