Merge pull request #22146 from linyows/express-rate-limit-patches

Update express-rate-limit types
This commit is contained in:
Mine Starks
2017-12-13 10:06:13 -08:00
committed by GitHub
2 changed files with 3 additions and 2 deletions
@@ -21,7 +21,7 @@ const callbackWithFewerParams = new RateLimit({
class SomeStore implements RateLimit.Store {
incr(key: string, cb: RateLimit.StoreIncrementCallback) { }
resetAll() { }
decrement(key: string) { }
resetKey(key: string) { }
}
+2 -1
View File
@@ -11,7 +11,7 @@ declare namespace RateLimit {
interface Store {
incr(key: string, cb: StoreIncrementCallback): void;
resetAll(): void;
decrement(key: string): void;
resetKey(key: string): void;
}
@@ -24,6 +24,7 @@ declare namespace RateLimit {
max?: number;
message?: string;
skip?(req: express.Request, res: express.Response): boolean;
skipFailedRequests?: boolean;
statusCode?: number;
store?: Store;
onLimitReached?(req: express.Request, res: express.Response, optionsUsed: Options): void;