From 80ac5cb31c85bc071dfa43229d1248eae72b6725 Mon Sep 17 00:00:00 2001 From: Roberto Bianchi Date: Wed, 29 May 2024 15:38:42 +0200 Subject: [PATCH 1/2] fix(types): Remove start method --- index.d.ts | 5 ++--- index.test-d.ts | 5 ----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/index.d.ts b/index.d.ts index e9b90c9..b2f1f54 100644 --- a/index.d.ts +++ b/index.d.ts @@ -8,8 +8,8 @@ import { declare module "fastify" { interface FastifyInstance { - runInAsyncScope (fn: () => T) : T; - enterWith() : void + runInAsyncScope(fn: () => T): T; + enterWith(): void; } } @@ -18,7 +18,6 @@ declare namespace fastifyasyncforge { export function request(): T; export function reply(): T; export function logger(): T; - export function start(app: FastifyInstance): Promise; } declare function fastifyasyncforge(): FastifyPluginCallback; diff --git a/index.test-d.ts b/index.test-d.ts index 3fc3806..5286f03 100644 --- a/index.test-d.ts +++ b/index.test-d.ts @@ -48,8 +48,3 @@ expectType(logger().info({ msg: "oh!" })); expectType(logger().warn({ msg: "let's go!!!" })); expectError(logger()); expectError({}); - -// start -expectType(await start(fastifyInstance)); -expectError(await start({ invalid: "object" })); -expectError(await start()); From 6e37e86f7c585fb4149045cd76e60865cca8f863 Mon Sep 17 00:00:00 2001 From: Roberto Bianchi Date: Wed, 29 May 2024 15:40:13 +0200 Subject: [PATCH 2/2] Remove start import --- index.test-d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.test-d.ts b/index.test-d.ts index 5286f03..ce4f3a5 100644 --- a/index.test-d.ts +++ b/index.test-d.ts @@ -1,5 +1,5 @@ import { expectAssignable, expectError, expectType } from "tsd"; -import fastifyasyncforge, { app, logger, reply, request, start } from "."; +import fastifyasyncforge, { app, logger, reply, request } from "."; import fastify, { type FastifyInstance, type FastifyBaseLogger,