import { UseFormReturn } from 'react-hook-form';
import * as Yup from 'yup';
import { FormFieldProps } from 'components/FormField/FormField';
import { RadioGroupOption } from 'components/Inputs/RadioGroup/RadioGroup';
import { Ref, ReactNode } from 'react';
import { SelectOption, SelectOptionGroup } from 'components/Inputs/Select/Select';
import { SelectInstance, GroupBase } from 'chakra-react-select';

type FormMethods = UseFormReturn<{
    [k: string]: string | number | boolean | string[] | undefined;
}, any>;
interface GenericField extends FormFieldProps {
    name: string;
    value?: any;
    label: string;
    description?: string | ReactNode;
    footerDescription?: string | ReactNode;
    tooltip?: string | ReactNode;
    defaultValue?: any;
    placeholder?: string;
    help?: string;
    fieldType?: 'text' | 'textarea' | 'number' | 'select' | 'radio' | 'hidden' | 'toggle';
    isRequired?: boolean;
    isDisabled?: boolean;
    hide?: boolean;
    schema: Yup.Schema;
    columns?: 1 | 2 | 3 | 4 | 5 | 6;
}
interface TextField extends GenericField {
    schema: Yup.StringSchema<string | undefined, Yup.AnyObject, undefined, ''>;
    inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
    pattern?: string;
}
interface TextAreaField extends GenericField {
    schema: Yup.StringSchema<string | undefined, Yup.AnyObject, undefined, ''>;
}
interface NumberField extends GenericField {
    schema: Yup.NumberSchema<number, Yup.AnyObject, undefined, ''>;
    min?: number;
    max?: number;
    step?: number;
}
interface SelectField extends GenericField {
    options: SelectOption[] | SelectOptionGroup[];
    isMulti?: boolean;
    innerRef?: Ref<SelectInstance<SelectOption, boolean, GroupBase<SelectOption>>>;
    max?: number;
}
interface HiddenField extends GenericField {
    schema: Yup.StringSchema<string | undefined, Yup.AnyObject, undefined, ''>;
}
interface RadioField extends GenericField {
    options: RadioGroupOption[];
    isAttached?: boolean;
}
interface ToggleField extends GenericField {
    schema: Yup.StringSchema<string, Yup.AnyObject, undefined, ''>;
}
type CustomField = TextField | TextAreaField | NumberField | SelectField | HiddenField | RadioField | ToggleField;

export { CustomField, FormMethods, GenericField, HiddenField, NumberField, RadioField, SelectField, TextAreaField, TextField, ToggleField };
//# sourceMappingURL=formTypes.js.map
