homemanager-fe/src/components/form/form.types.ts

32 lines
579 B
TypeScript

export type FormData = Record<string, unknown>;
export type FormErrors = Record<string, string[]>;
export interface FormSubmit {
isValid: boolean;
formData: FormData;
fieldErrors: FormErrors;
}
export type InputType =
| 'text'
| 'number'
| 'password'
| 'color'
| 'email'
| 'checkbox'
| 'radio';
export interface SharedFieldProps {
name: string;
label: string;
disabled?: boolean;
placeholder?: string;
readonly?: boolean;
}
export interface SelectOption {
value: string | number;
name: string;
description?: string;
disabled?: boolean;
}