import { ChangeEventHandler, FocusEventHandler } from 'react'; import { GlobalError } from './ferdium-components.types'; interface SelectOptions { disabled?: boolean; label?: string; value?: string; } interface Listeners { onChange?: ChangeEventHandler; onBlur?: FocusEventHandler; onFocus?: FocusEventHandler; onDrop?: (file: File) => void; } export interface Field extends Listeners { id?: string; type?: string; // todo specifiy probably name?: string; value?: any; label?: string; placeholder?: string; disabled?: boolean; error?: GlobalError | string; options?: SelectOptions[]; default?: string | boolean | number | null; validators?: any; // Not sure yet. set?: (value: any) => void; [key: string]: any; } export interface FormFields { fields: { [key: string]: Field; }; }