mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Merge pull request #22146 from linyows/express-rate-limit-patches
Update express-rate-limit types
This commit is contained in:
@@ -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) { }
|
||||
}
|
||||
|
||||
|
||||
Vendored
+2
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user