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 +}