import { JsonSchema } from './jsonSchema'; export interface IValidator { validate(content: unknown): { content: T; error: undefined; } | { content: undefined; error: ValidationError; }; toSchema(): JsonSchema; /** * Returns true if this validator represents a required field. * Used by vObj to determine which fields are required. */ isRequired?(): boolean; } export type ValidatorType = T extends IValidator ? U : never; export interface ValidationError { message: string; } export declare function vString(): IValidator; export declare function vNumber(): IValidator; export declare function vBoolean(): IValidator; export declare function vObjAny(): IValidator; export declare function vUndefined(): IValidator; export declare function vNull(): IValidator; export declare function vNullable(validator: IValidator): IValidator; export declare function vUnchecked(): IValidator; export declare function vUnknown(): IValidator; export type ObjectProperties = Record; export declare function vRequired(validator: IValidator): IValidator; export declare function vObj>>(properties: T): IValidator<{ [K in keyof T]: ValidatorType; }>; export declare function vArray(validator: IValidator): IValidator; export declare function vTuple[]>(...validators: T): IValidator<{ [K in keyof T]: ValidatorType; }>; export declare function vUnion[]>(...validators: T): IValidator>; export declare function vEnum(...values: T): IValidator; export declare function vLiteral(value: T): IValidator; export declare function vLazy(fn: () => IValidator): IValidator; //# sourceMappingURL=validator.d.ts.map