import type { BinderNode } from './BinderNode.js'; import type { BinderRoot } from './BinderRoot.js'; import { AbstractModel, type Value } from './Models.js'; export interface ValueError { property: AbstractModel | string; message: string; value: T; validator: Validator; validatorMessage?: string; } export interface ValidationResult { property: AbstractModel | string; message?: string; } export declare class ValidationError extends Error { errors: readonly ValueError[]; constructor(errors: readonly ValueError[]); } export type InterpolateMessageCallback = (message: string, validator: Validator>, binderNode: BinderNode) => string; export interface Validator { message: string; impliesRequired?: boolean; name?: string; validate(value: T, binder: BinderRoot): Promise | ValidationResult | boolean | readonly ValidationResult[]; } export declare class ServerValidator implements Validator { name: string; message: string; constructor(message: string); validate: () => boolean; } export declare function runValidator(model: M, validator: Validator>, interpolateMessageCallback?: InterpolateMessageCallback): Promise>>>;