rolling-rate-limiter: replace intersection by extending interface

This commit is contained in:
Jonas L
2018-05-10 06:05:11 +02:00
parent 449a5e2d87
commit 5ba41a7789
+1 -2
View File
@@ -15,7 +15,7 @@ declare namespace RollingRateLimiter {
minDifference?: number;
}
interface RedisOptions {
interface WithRedisOptions extends GeneralOptions {
redis: CompatibleRedisClient;
namespace?: string;
}
@@ -25,7 +25,6 @@ declare namespace RollingRateLimiter {
}
type InMemoryOptions = GeneralOptions;
type WithRedisOptions = GeneralOptions & RedisOptions;
type AsyncLimiterWithToken = (token: string, callback: AsyncLimiterCallback) => void;
type AsyncLimiterWithoutToken = (callback: AsyncLimiterCallback) => void;