From 69b92989d384e8e8ee15c7724a1bf99c4629c611 Mon Sep 17 00:00:00 2001 From: Duran <31602742+duranhumes@users.noreply.github.com> Date: Mon, 24 Dec 2018 11:54:13 -0500 Subject: [PATCH] Added message interface Added message interface to account for known and unknown keys --- types/express-rate-limit/index.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/types/express-rate-limit/index.d.ts b/types/express-rate-limit/index.d.ts index 6967b901ce..35e30ec936 100644 --- a/types/express-rate-limit/index.d.ts +++ b/types/express-rate-limit/index.d.ts @@ -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;