/**
 * API Input Validation Middleware
 *
 * Provides Zod-based validation middleware for Fastify routes with
 * OpenTelemetry tracing, detailed error responses, and security features.
 *
 * @packageDocumentation
 */
import type { FastifyRequest, FastifyReply, FastifyInstance } from 'fastify';
import { ZodError, ZodSchema } from 'zod';
/**
 * Validation error details for API responses
 */
export interface ValidationErrorDetail {
    /** JSON path to the invalid field */
    path: string;
    /** Human-readable error message */
    message: string;
    /** Zod error code */
    code: string;
    /** Expected type or value */
    expected?: string;
    /** Received value type */
    received?: string;
}
/**
 * Validation middleware options
 */
export interface ValidationOptions {
    /** Maximum payload size in bytes (default: 1MB) */
    maxPayloadSize?: number;
    /** Check for injection patterns (default: true) */
    checkInjection?: boolean;
    /** Sanitize input strings (default: true) */
    sanitize?: boolean;
    /** Strip unknown properties (default: true) */
    stripUnknown?: boolean;
    /** Custom error message for validation failures */
    customErrorMessage?: string;
    /** Skip validation for certain paths */
    skipPaths?: string[];
}
/**
 * Create validation middleware for request body
 *
 * @param schema - Zod schema to validate against
 * @param options - Validation options
 * @returns Fastify preHandler hook
 *
 * @example
 * ```typescript
 * const createUserSchema = z.object({
 *   name: z.string().min(1).max(100),
 *   email: z.string().email(),
 * });
 *
 * server.post('/users', {
 *   preHandler: validateBody(createUserSchema),
 * }, handler);
 * ```
 */
export declare function validateBody<T extends ZodSchema>(schema: T, options?: ValidationOptions): (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
/**
 * Create validation middleware for query parameters
 *
 * @param schema - Zod schema to validate against
 * @returns Fastify preHandler hook
 *
 * @example
 * ```typescript
 * const listQuerySchema = z.object({
 *   page: z.coerce.number().int().min(1).default(1),
 *   limit: z.coerce.number().int().min(1).max(100).default(20),
 * });
 *
 * server.get('/users', {
 *   preHandler: validateQuery(listQuerySchema),
 * }, handler);
 * ```
 */
export declare function validateQuery<T extends ZodSchema>(schema: T): (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
/**
 * Create validation middleware for path parameters
 *
 * @param schema - Zod schema to validate against
 * @returns Fastify preHandler hook
 *
 * @example
 * ```typescript
 * const idParamSchema = z.object({
 *   id: z.string().uuid(),
 * });
 *
 * server.get('/users/:id', {
 *   preHandler: validateParams(idParamSchema),
 * }, handler);
 * ```
 */
export declare function validateParams<T extends ZodSchema>(schema: T): (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
/**
 * Create combined validation middleware for body, query, and params
 *
 * @param schemas - Object containing schemas for body, query, and/or params
 * @param options - Validation options (applies to body only)
 * @returns Fastify preHandler hook
 *
 * @example
 * ```typescript
 * server.put('/users/:id', {
 *   preHandler: validateRequest({
 *     params: z.object({ id: z.string().uuid() }),
 *     body: z.object({ name: z.string() }),
 *   }),
 * }, handler);
 * ```
 */
export declare function validateRequest<TBody extends ZodSchema = ZodSchema, TQuery extends ZodSchema = ZodSchema, TParams extends ZodSchema = ZodSchema>(schemas: {
    body?: TBody;
    query?: TQuery;
    params?: TParams;
}, options?: ValidationOptions): (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
/**
 * Register validation middleware plugin for Fastify
 *
 * This plugin adds the validation decorators to the Fastify instance.
 *
 * @param server - Fastify instance
 * @param options - Default validation options
 */
export declare function registerValidationPlugin(server: FastifyInstance, options?: ValidationOptions): Promise<void>;
export type { ZodSchema, ZodError };
//# sourceMappingURL=validation.d.ts.map