Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types): Remove start method #12

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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());
Loading