diff --git a/package.json b/package.json index b8edd7b..2cd7731 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "eslint-plugin-n": "^15.2.4", "eslint-plugin-promise": "^6.0.0", "fastify": "^4.2.0", + "fastify-plugin": "^4.2.0", "fastify-tsconfig": "^1.0.1", "rimraf": "^3.0.2", "tap": "^16.3.0", diff --git a/types/plugin.test-d.ts b/types/plugin.test-d.ts index 51ed874..b84e18f 100644 --- a/types/plugin.test-d.ts +++ b/types/plugin.test-d.ts @@ -1,6 +1,7 @@ import { FastifyPluginAsyncTypebox, FastifyPluginCallbackTypebox } from '../index' import { expectType } from 'tsd' import Fastify, { FastifyPluginAsync, FastifyPluginCallback } from 'fastify' +import fp from 'fastify-plugin' import { Type } from '@sinclair/typebox' import { Http2Server } from 'http2' @@ -68,3 +69,10 @@ const fastify = Fastify() fastify.register(asyncPlugin) fastify.register(callbackPlugin) + +const asyncPluginHttpDefault: FastifyPluginAsyncTypebox<{ optionA: string }> = async (fastify, options) => { +} + +fp(asyncPlugin) +fp(callbackPlugin) +fp(asyncPluginHttpDefault)