Hey, i'm trying to extend FastifyRequest while using type-provider-typebox.
let fastify = Fastify(opts).withTypeProvider<TypeBoxTypeProvider>();
// then in another file
const route: FastifyPluginAsyncTypebox = async (instance, opts) => {
instance.register((request, reply) => {
request.user; // not defined
});
}
// maybe the solution is something like this but I'm not sure how:
// fastify.d.ts
declare module "fastify" {
export type FastifyNewRoute = FastifyPluginAsyncTypebox & {
instance: FastifyInstance... // now sure what to do next
};
}
💬 Question here
Hey, i'm trying to extend FastifyRequest while using type-provider-typebox.