import * as S from './schema'; import { TypeOf, Schema, SchemaTypeOf } from './schema'; import { Result, Err } from './result'; export type ValidationError = { path?: (string | number)[]; message: string; }; export type ValidationResult = Result; export declare const SchemaErr: (message: string, path?: ValidationError['path']) => Err; export type ValidatorOptions = { strict?: boolean; }; export type Validator = (input: unknown, options?: ValidatorOptions) => ValidationResult; export type ValidatorMethods = { validate: Validator>; }; export type ValidatorImpl = ValidatorMethods | ((schema: T) => ValidatorMethods); export declare const Validator: { impl(Ctor: abstract new () => T, impl: ValidatorImpl): void; get(Ctor: T_1): ValidatorMethods> | undefined; validate(Ctor: T_2, input: unknown, options?: ValidatorOptions): ValidationResult>; }; export declare const createSchemaValidator: >(SchemaCtor: S, options?: ValidatorOptions) => (input: unknown) => ValidationResult>; export declare abstract class ValidatorType extends S.Schema { __type: T; abstract validate(input: unknown): ValidationResult; Ok(value: T): ValidationResult; Err(...args: Parameters): ValidationResult; } export declare const RegExp: (regexp: RegExp) => { new (): { validate(input: unknown): ValidationResult; __type: string; Ok(value: string): ValidationResult; Err(message: string, path?: (string | number)[] | undefined): ValidationResult; }; create>(this: T, value: S.TypeOf): S.TypeOf; displayName?: string | undefined; namespace?: string | undefined; };