Added message interface

Added message interface to account for known and unknown keys
This commit is contained in:
Duran
2018-12-24 11:54:13 -05:00
committed by GitHub
parent bb9bbc0f9d
commit 69b92989d3
+7 -1
View File
@@ -14,6 +14,12 @@ declare namespace RateLimit {
decrement(key: string): void;
resetKey(key: string): void;
}
interface Message {
status: number
message: string
[key: string]: any
}
interface Options {
delayAfter?: number;
@@ -22,7 +28,7 @@ declare namespace RateLimit {
headers?: boolean;
keyGenerator?(req: express.Request, res: express.Response): string;
max?: number;
message?: string | Buffer | object;
message?: string | Buffer | Message;
skip?(req: express.Request, res: express.Response): boolean;
skipFailedRequests?: boolean;
statusCode?: number;