export interface ValidationError { code: string; message: string; expected?: any; received?: any; path?: string[]; min?: number; max?: number; positive?: boolean; negative?: boolean; } export type ValidationResult = | { success: true; value: T; } | { success: false; errors: ValidationError[]; }; export type ValidationType = { validate: (value: any) => ValidationResult; examples?: T[]; items?: ValidationType | ValidationType[]; properties?: { [key: string]: ValidationType }; type: string; name?: string; description?: string; optional?: boolean; nullable?: boolean; hidden?: boolean; }; export type ValidationTypeValue = T extends ValidationType ? U : never; export type ValidationModifier = (value: T) => ValidationError[]; export type Preprocessor = (value: any) => any; export type Transformer = (value: T) => T; export interface ValidatorOptions { modifiers?: ValidationModifier[]; transformers?: Transformer[]; message?: string; name?: string; description?: string; examples?: T[]; preprocessors?: Preprocessor[]; oneOf?: T[]; hidden?: boolean; }