import type { FastifyPluginAsync, FastifyPluginCallback, FastifyPluginOptions, FastifySchema, FastifySchemaCompiler, FastifyTypeProvider, RawServerBase, RawServerDefault } from 'fastify'; import type { FastifySerializerCompiler } from 'fastify/types/schema'; import type { ZodAny, ZodTypeAny, z } from 'zod'; type FreeformRecord = Record; export interface ZodTypeProvider extends FastifyTypeProvider { output: this['input'] extends ZodTypeAny ? z.infer : never; } interface Schema extends FastifySchema { hide?: boolean; } export declare const createJsonSchemaTransform: ({ skipList }: { skipList: readonly string[]; }) => ({ schema, url }: { schema: Schema; url: string; }) => { schema: Schema; url: string; } | { schema: FreeformRecord; url: string; }; export declare const jsonSchemaTransform: ({ schema, url }: { schema: Schema; url: string; }) => { schema: Schema; url: string; } | { schema: FreeformRecord; url: string; }; export declare const validatorCompiler: FastifySchemaCompiler; export declare class ResponseValidationError extends Error { details: FreeformRecord; constructor(validationResult: FreeformRecord); } export declare const serializerCompiler: FastifySerializerCompiler; /** * FastifyPluginCallbackZod with Zod automatic type inference * * @example * ```typescript * import { FastifyPluginCallbackZod } fromg "fastify-type-provider-zod" * * const plugin: FastifyPluginCallbackZod = (fastify, options, done) => { * done() * } * ``` */ export type FastifyPluginCallbackZod, Server extends RawServerBase = RawServerDefault> = FastifyPluginCallback; /** * FastifyPluginAsyncZod with Zod automatic type inference * * @example * ```typescript * import { FastifyPluginAsyncZod } fromg "fastify-type-provider-zod" * * const plugin: FastifyPluginAsyncZod = async (fastify, options) => { * } * ``` */ export type FastifyPluginAsyncZod, Server extends RawServerBase = RawServerDefault> = FastifyPluginAsync; export {};