From be5f254ca0fe31c0ddfc4ddb3e1674fb74898fea Mon Sep 17 00:00:00 2001 From: Roberto Bianchi Date: Wed, 24 Apr 2024 09:21:37 +0200 Subject: [PATCH] chore(type): Add enterwith decorator --- index.d.ts | 6 ++++++ index.test-d.ts | 2 ++ 2 files changed, 8 insertions(+) diff --git a/index.d.ts b/index.d.ts index ee2169f..c425e8e 100644 --- a/index.d.ts +++ b/index.d.ts @@ -6,6 +6,12 @@ import { type FastifyPluginCallback, } from "fastify"; +declare module "fastify" { + interface FastifyInstance { + enterWith: () => void; + } +} + declare namespace fastifyasyncforge { export function app(): T; export function request(): T; diff --git a/index.test-d.ts b/index.test-d.ts index 2f930ab..0608401 100644 --- a/index.test-d.ts +++ b/index.test-d.ts @@ -13,10 +13,12 @@ import fastify, { const fastifyInstance = fastify(); expectAssignable(fastifyInstance.register(fastifyasyncforge)); expectAssignable(fastifyasyncforge); +expectType(fastifyInstance.enterWith()); // app expectAssignable(fastifyInstance); expectAssignable(app()); +expectType(app().enterWith()); expectAssignable(app>()); expectError(app()); expectError({});