import { ReactNode } from 'react';
import { ControllerProps, FieldPath, FieldValues, PathValue, RegisterOptions } from 'react-hook-form';
import { IconModalProps } from './components';
/** Should the field show errors as soon as the field has been touched, or wait until the form has been submitted? */
export type ErrorMode = 'immediate' | 'onSubmit';
export type FormFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Pick<ControllerProps<TFieldValues, TName>, 'name' | 'rules' | 'shouldUnregister'> & {
    id?: string;
    errorMode?: ErrorMode;
};
export declare const TextFieldTypes: {
    TEXT: string;
    EMAIL: string;
    PASSWORD: string;
    NUMBER: string;
    TEL: string;
    URL: string;
};
export type StatusVariant = 'error' | 'success' | 'warning' | 'info';
export interface FormOption<TValue = string, TLabel extends ReactNode = string> {
    value: TValue;
    label: TLabel;
    disabled?: boolean;
    helpMessage?: ReactNode;
}
export type OptionProps<TOption> = {
    getOptionKey?(option: TOption): string;
    getOptionLabel?(option: TOption): ReactNode;
    getOptionHelpMessage?(option: TOption): ReactNode;
    isOptionDisabled?(option: TOption): boolean;
};
export type OptionValueProps<TFormItemValue, TOption> = {
    getOptionValue?(option: TOption): TFormItemValue;
    areOptionValuesEqual?(left?: TFormItemValue | null, right?: TFormItemValue | null): boolean;
};
/**
 * Common props for controls that support a list of `options`.
 */
export type FormOptionsControlProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TFormItemValue = PathValue<TFieldValues, TName>, TOptionValue = PathValue<TFieldValues, TName>, TOption = FormOption<TOptionValue>> = FormFieldProps<TFieldValues, TName> & OptionProps<TOption> & OptionValueProps<TFormItemValue, TOption> & {
    label: ReactNode;
    helpMessage?: ReactNode;
    disabled?: boolean;
    options: TOption[];
    infoTooltipProps?: IconModalProps;
};
/**
 * Type assertion for returning only the FieldPaths that have Array values.
 * This is used by form fields that require array values.
 */
export type ArrayFieldPath<TFieldValues extends FieldValues> = {
    [TName in FieldPath<TFieldValues>]: NonNullable<PathValue<TFieldValues, TName>> extends Array<unknown> ? TName : never;
}[FieldPath<TFieldValues>];
export type ArrayPathValue<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = NonNullable<PathValue<TFieldValues, TName>> extends Array<infer TValue> ? TValue : never;
export type FormFieldRules<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<RegisterOptions<TFieldValues, TFieldName>, 'valueAsNumber' | 'valueAsDate' | 'setValueAs' | 'disabled'>;
