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

32 lines
579 B
TypeScript
Raw Normal View History

2023-01-25 20:03:22 +00:00
export type FormData = Record<string, unknown>;
export type FormErrors = Record<string, string[]>;
export interface FormSubmit {
isValid: boolean;
formData: FormData;
fieldErrors: FormErrors;
}
2023-01-27 16:27:14 +00:00
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;
}