import { ReactNode } from 'react';
import { SelectFieldProps } from '@chakra-ui/react';
import { UseFormReturn } from 'react-hook-form';
import * as Yup from 'yup';
import { FormFieldProps } from 'components/FormField/FormField';

type FormNextMethods = UseFormReturn<{
    [k: string]: string | number | boolean | string[] | undefined;
}, any>;
interface FieldOption {
    value: SelectFieldProps['value'] | boolean;
    label: string | ReactNode;
    group?: string;
    disabled?: boolean;
    invalid?: boolean;
}
interface CustomField extends FormFieldProps {
    name: string;
    label: string;
    value?: any;
    defaultValue?: any;
    placeholder?: string;
    help?: string;
    disabled?: boolean;
    fieldType?: 'text' | 'textarea' | 'number' | 'select' | 'radio' | 'hidden' | 'toggle';
    options?: FieldOption[];
    isMulti?: boolean;
    isGroup?: boolean;
    inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
    min?: number;
    max?: number;
    step?: number;
    pattern?: string;
    columns?: 1 | 2 | 3 | 4 | 5 | 6;
    hide?: boolean;
    schema: Yup.AnySchema;
}

export { CustomField, FieldOption, FormNextMethods };
