import { Validate } from "react-hook-form";

export interface CreateFieldTypes {
    string: 'string';
    number: 'number';
    date: 'date';
    dateTime: 'dateTime';
    boolean: 'boolean';
    singleSelect: 'singleSelect';
    actions: 'actions';
    custom: 'custom';
}

export interface InputTypes {
    password: 'password';
}

export type CreateFieldType = CreateFieldTypes[keyof CreateFieldTypes]
export type InputType = InputTypes[keyof InputTypes]

export interface CreateField {
    key: string;
    headerName?: string;
    type: CreateFieldType;
    required?: boolean;
    defaultValue?: any;
    inputType?: InputType;
    validate?: Validate<string, boolean>;
    /** Watch for field */
    watch?: string;
    /** Message on watch */
    watchMessage?: string;
    /** Should field be included in the request */
    include?: boolean;
}