import { IJSONSchema } from "./jsonSchema.js"; export interface IValidator { validate(content: unknown): { content: T; error: undefined; } | { content: undefined; error: ValidationError; }; getJSONSchema(): IJSONSchema; } export declare abstract class ValidatorBase implements IValidator { abstract validate(content: unknown): { content: T; error: undefined; } | { content: undefined; error: ValidationError; }; abstract getJSONSchema(): IJSONSchema; validateOrThrow(content: unknown): T; } export type ValidatorType = T extends IValidator ? U : never; export interface ValidationError { message: string; } export declare function vString(): ValidatorBase; export declare function vNumber(): ValidatorBase; export declare function vBoolean(): ValidatorBase; export declare function vObjAny(): ValidatorBase; export declare function vUnchecked(): ValidatorBase; export declare function vUndefined(): ValidatorBase; export declare function vUnknown(): ValidatorBase; export type ObjectProperties = Record; export declare class Optional> { readonly validator: T; constructor(validator: T); } export declare function vOptionalProp(validator: IValidator): Optional>; type ExtractOptionalKeys = { [K in keyof T]: T[K] extends Optional> ? K : never; }[keyof T]; type ExtractRequiredKeys = { [K in keyof T]: T[K] extends Optional> ? never : K; }[keyof T]; export type vObjType | Optional>>> = { [K in ExtractRequiredKeys]: T[K] extends IValidator ? U : never; } & { [K in ExtractOptionalKeys]?: T[K] extends Optional> ? U : never; }; export declare function vObj | Optional>>>(properties: T): ValidatorBase>; export declare function vArray(validator: IValidator): ValidatorBase; type vTupleType[]> = { [K in keyof T]: ValidatorType; }; export declare function vTuple[]>(...validators: T): ValidatorBase>; export declare function vUnion[]>(...validators: T): ValidatorBase>; export declare function vEnum(...values: T): ValidatorBase; export declare function vLiteral(value: T): ValidatorBase; export declare function vLazy(fn: () => IValidator): ValidatorBase; export declare function vWithJsonSchemaRef(ref: string, validator: IValidator): ValidatorBase; export {};