@types/rate-limit-redis
Advanced tools
Comparing version
@@ -11,16 +11,25 @@ // Type definitions for rate-limit-redis 1.7 | ||
import IORedis = require('ioredis'); | ||
import { Store } from 'express-rate-limit'; | ||
import { Store, StoreIncrementCallback } from 'express-rate-limit'; | ||
interface RedisStoreOptions { | ||
expiry?: number; | ||
prefix?: string; | ||
resetExpiryOnChange?: boolean; | ||
client?: RedisClient | IORedis.Redis; | ||
redisURL?: string; | ||
declare namespace RedisStore { | ||
interface Options { | ||
expiry?: number; | ||
prefix?: string; | ||
resetExpiryOnChange?: boolean; | ||
client?: RedisClient | IORedis.Redis; | ||
redisURL?: string; | ||
} | ||
} | ||
declare var RedisStore: { | ||
new (options?: RedisStoreOptions): Store; | ||
}; | ||
declare class RedisStore implements Store { | ||
constructor(options?: RedisStore.Options); | ||
incr(key: string, cb: StoreIncrementCallback): void; | ||
decrement(key: string): void; | ||
resetKey(key: string): void; | ||
// rate-limit-redis 1.7.0 doesn't actually implement resetAll() and | ||
// express-rate-limit 5.1.1 doesn't actually call it, but it's required by | ||
// the Store interface so it's included here. | ||
resetAll(): void; | ||
} | ||
export = RedisStore; |
{ | ||
"name": "@types/rate-limit-redis", | ||
"version": "1.7.0", | ||
"version": "1.7.1", | ||
"description": "TypeScript definitions for rate-limit-redis", | ||
@@ -36,4 +36,4 @@ "license": "MIT", | ||
}, | ||
"typesPublisherContentHash": "5e63b31e4235ea0e54a49572b7d8e291b0a6bd7d5723ea8cb0cff75561f2d499", | ||
"typesPublisherContentHash": "6aa487a3899ce03162eae73ff89d7ea020fe7923d5af34d2b69f5d01b08a0782", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Fri, 13 Mar 2020 01:20:24 GMT | ||
* Last updated: Thu, 26 Mar 2020 09:32:17 GMT | ||
* Dependencies: [@types/redis](https://npmjs.com/package/@types/redis), [@types/ioredis](https://npmjs.com/package/@types/ioredis), [@types/express-rate-limit](https://npmjs.com/package/@types/express-rate-limit) | ||
@@ -14,0 +14,0 @@ * Global values: none |
4344
11.27%30
42.86%