import { Type } from '../reflection/type.js'; import type { TypeHook } from './registry.js'; import type { JsonBuildContext } from './state.js'; /** * Validation post-hook that runs validators after type guard passes. * * This hook: * 1. Lets the main type guard run first * 2. If type guard passes (true), runs validation annotations * 3. Returns false if validation fails * * @example * ```typescript * // With type: string & MinLength<3> * // 1. Type guard returns true (string matches) * // 2. MinLength validator runs * // 3. If length < 3, returns false and error is added * ``` */ export declare const validationHook: TypeHook; /** * Register validation hook on type guards. */ export declare function registerValidationHook(serializer: { typeGuards: { addPostHook(hook: TypeHook): void; }; }): void; /** * Create a validation function for a type. * * The returned function validates input and returns true if valid, * optionally collecting errors into a provided array. * * @example * ```typescript * const validate = createValidator(userType, serializer); * * const errors: ValidationErrorItem[] = []; * if (!validate(data, { errors })) { * console.log('Validation failed:', errors); * } * ``` */ export declare function createValidator(type: Type, serializer: { typeGuards: any; }): (data: any, state?: { errors?: any[]; }) => boolean;