UNPKG

fastify-typebox-module-types

Version:

A plugin for Fastify that allows you to use TypeBox module types and register them as normal ajv schemas.

12 lines (11 loc) 491 B
import type { FastifyPluginAsync } from 'fastify'; import { type TSchema, Type } from '@sinclair/typebox'; export interface FastifyTypeboxModuleTypesOptions { schemas: Record<string, TSchema>; } declare const _default: FastifyPluginAsync<FastifyTypeboxModuleTypesOptions>; export default _default; export interface FastifyTypeboxModuleTypesPlugin<S extends Record<string, TSchema>> { module: ReturnType<typeof Type.Module<S>>; ref: ReturnType<typeof Type.Module<S>>['Import']; }