mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 00:07:07 +00:00
Added message interface
Added message interface to account for known and unknown keys
This commit is contained in:
Vendored
+7
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user