Skip to content

Commit

Permalink
fix(types): Remove start method (#12)
Browse files Browse the repository at this point in the history
* fix(types): Remove start method

* Remove start import
  • Loading branch information
rozzilla authored May 29, 2024
1 parent 1ae303c commit 42ee630
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
5 changes: 2 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {

declare module "fastify" {
interface FastifyInstance {
runInAsyncScope<T> (fn: () => T) : T;
enterWith() : void
runInAsyncScope<T>(fn: () => T): T;
enterWith(): void;
}
}

Expand All @@ -18,7 +18,6 @@ declare namespace fastifyasyncforge {
export function request<T extends FastifyRequest>(): T;
export function reply<T extends FastifyReply>(): T;
export function logger<T extends FastifyBaseLogger>(): T;
export function start(app: FastifyInstance): Promise<void>;
}

declare function fastifyasyncforge(): FastifyPluginCallback;
Expand Down
7 changes: 1 addition & 6 deletions index.test-d.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -48,8 +48,3 @@ expectType<void>(logger().info({ msg: "oh!" }));
expectType<void>(logger().warn({ msg: "let's go!!!" }));
expectError<FastifyBaseLogger>(logger<object>());
expectError<FastifyBaseLogger>({});

// start
expectType<void>(await start(fastifyInstance));
expectError<void>(await start({ invalid: "object" }));
expectError<void>(await start());

0 comments on commit 42ee630

Please sign in to comment.