Skip to content

Commit

Permalink
fix(type): Correct start signature (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
rozzilla authored Apr 22, 2024
1 parent 1383e73 commit f9fc12b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ 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<T extends FastifyInstance>(): Promise<T>;
export function start(app: FastifyInstance): Promise<void>;
}

declare function fastifyasyncforge(): FastifyPluginCallback;
Expand Down
4 changes: 3 additions & 1 deletion index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ expectError<FastifyBaseLogger>(logger<object>());
expectError<FastifyBaseLogger>({});

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

0 comments on commit f9fc12b

Please sign in to comment.