/**
 * Copyright 2023 Kapeta Inc.
 * SPDX-License-Identifier: MIT
 */
import React from 'react';
import { ValidatorListUnresolved } from '../validation/Validators';
import { AsyncState } from 'react-use/lib/useAsync';
import { FormInputProps } from './inputs/FormInput';
export declare enum StatusType {
    ERROR = "error",
    OK = "ok"
}
export interface FormFieldControllerProps<V = any> {
    name: string;
    value?: V;
    defaultValue?: V;
    help?: string;
    validation?: ValidatorListUnresolved;
    label?: string;
    disabled?: boolean;
    readOnly?: boolean;
    autoFocus?: FormInputProps['autoFocus'];
    variant?: FormInputProps['variant'];
    onFocus?: FormInputProps['onFocus'];
    onBlur?: FormInputProps['onBlur'];
    autoComplete?: FormInputProps['autoComplete'];
    className?: HTMLElement['className'];
}
export interface FormFieldController<V = any> {
    name: string;
    value?: V;
    filled: boolean;
    touched: boolean;
    required: boolean;
    errors: AsyncState<string[]>;
    processing: boolean;
    showError: boolean;
    status: StatusType;
    help?: string;
    label?: string;
    disabled: boolean;
    readOnly: boolean;
    autoFocus?: FormInputProps['autoFocus'];
    variant?: FormInputProps['variant'];
    onFocus?: FormInputProps['onFocus'];
    onBlur?: FormInputProps['onBlur'];
    autoComplete?: FormInputProps['autoComplete'];
    className?: HTMLElement['className'];
}
export declare const useIsFormSubmitAttempted: () => boolean;
export declare const useFormFieldController: <T = any>(props: FormFieldControllerProps<T>) => FormFieldController<T>;
export declare const withFormFieldController: <V = any, P = any>(component: (props: P, controller: FormFieldController<V>) => React.JSX.Element) => (props: P & FormFieldControllerProps<V>) => React.JSX.Element;
