/**
 * Copyright 2023 Kapeta Inc.
 * SPDX-License-Identifier: MIT
 */
export type AsyncValidationContext = {
    cancel: () => void;
    promise: Promise<any>;
};
export type ValidationContext = {
    cancel: () => void;
    errors: Promise<string[]>;
    hasAsync: boolean;
};
export type AsyncValidatorFunction = (fieldName: string, value: any) => AsyncValidationContext | void;
export type ValidatorFunction = AsyncValidatorFunction | string;
export type ValidatorList = ValidatorFunction[];
export type ValidatorListUnresolved = ValidatorList | string | ValidatorFunction;
export declare const Validators: {
    [key: string]: ValidatorFunction;
};
export declare function normaliseValidators(validation?: ValidatorListUnresolved): ValidatorList;
export declare function useValidation(active: boolean, validation: ValidatorListUnresolved, name: string, value: any): {
    errors: import("react-use/lib/useAsyncFn").AsyncState<string[]>;
    hasAsync: boolean;
};
/**
 * Debounce an async validator - e.g. if you want to wait for the user to stop typing before validating
 *
 * @param delay
 * @param func
 */
export declare function debouncedValidator(delay: number, func: AsyncValidatorFunction): AsyncValidatorFunction;
export declare function applyValidation(validation: ValidatorListUnresolved, name: string, value: any): ValidationContext;
