import { StandardSchemaV1 } from './standard-schema-v1';
export type ValidationError = {
    message: string;
    path?: (PropertyKey | StandardSchemaV1.PathSegment)[];
};
export type ValidatorResult<T> = {
    success: true;
    data: T;
} | {
    success: false;
    errors: ValidationError[];
};
export interface Validator<Input, Output = Input> {
    validate(value: unknown): ValidatorResult<Output>;
    optional(): Validator<Input | undefined, Output | undefined>;
    default(defaultValue: Output): Validator<Input | undefined, Output>;
}
export type SafeParseSuccess<T> = {
    success: true;
    data: T;
};
export type SafeParseError = {
    success: false;
    error: {
        errors: Array<{
            message: string;
            path: (string | number)[];
        }>;
    };
};
export type SafeParseResult<T> = SafeParseSuccess<T> | SafeParseError;
declare function createStandardSchema<Input, Output = Input>(validator: Validator<Input, Output>): StandardSchemaV1<Input, Output> & {
    safeParse: (value: unknown) => SafeParseResult<Output>;
};
declare abstract class BaseValidator<Input, Output = Input> implements Validator<Input, Output> {
    abstract validate(value: unknown): ValidatorResult<Output>;
    optional(): Validator<Input | undefined, Output | undefined>;
    default(defaultValue: Output): Validator<Input | undefined, Output>;
    schema(): StandardSchemaV1<Input, Output> & {
        safeParse: (value: unknown) => SafeParseResult<Output>;
    };
}
export declare class StringValidator extends BaseValidator<string> {
    private minLength?;
    private maxLength?;
    private pattern?;
    private customValidations;
    validate(value: unknown): ValidatorResult<string>;
    min(length: number, message?: string): StringValidator;
    max(length: number, message?: string): StringValidator;
    regex(pattern: RegExp, message?: string): StringValidator;
    email(message?: string): StringValidator;
    refine(validation: (value: string) => string | null): StringValidator;
}
export declare class BooleanValidator extends BaseValidator<boolean> {
    private mustBeTrue;
    private trueMessage?;
    validate(value: unknown): ValidatorResult<boolean>;
    refine(condition: (value: boolean) => boolean, message: string): BooleanValidator;
    literal(_value: true, message?: string): BooleanValidator;
}
export declare class ObjectValidator<T extends Record<string, any>> extends BaseValidator<T> {
    private shape;
    constructor(shape: {
        [K in keyof T]: Validator<any, T[K]>;
    });
    validate(value: unknown): ValidatorResult<T>;
    refine<R extends T>(validation: (value: T) => string | null, options?: {
        path?: (keyof T)[];
    }): ObjectValidator<R>;
}
export declare const string: () => StringValidator;
export declare const boolean: () => BooleanValidator;
export declare const object: <T extends Record<string, any>>(shape: { [K in keyof T]: Validator<any, T[K]>; }) => ObjectValidator<T>;
export { createStandardSchema };
