From 774bd35b4c48a5f1d9bc6c12921ffa8aea1bccfc Mon Sep 17 00:00:00 2001 From: flakey5 <73616808+flakey5@users.noreply.github.com> Date: Thu, 14 Mar 2024 12:32:00 -0700 Subject: [PATCH] Add statusCode to errorResponseBuilderContext type Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> --- types/index.d.ts | 1 + types/index.test-d.ts | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/types/index.d.ts b/types/index.d.ts index f3ddcf84..3acf44af 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -23,6 +23,7 @@ declare namespace fastifyRateLimit { export interface FastifyRateLimitOptions { } export interface errorResponseBuilderContext { + statusCode: number; ban: boolean; after: string; max: number; diff --git a/types/index.test-d.ts b/types/index.test-d.ts index e18dc614..87e8489e 100644 --- a/types/index.test-d.ts +++ b/types/index.test-d.ts @@ -152,3 +152,11 @@ appWithHttp2.get('/public', { }, (request, reply) => { reply.send({ hello: 'from ... public' }) }) + +const errorResponseContext: errorResponseBuilderContext = { + statusCode: 429, + ban: true, + after: '123', + max: 1000, + ttl: 123 +}