16 lines
300 B
TypeScript
16 lines
300 B
TypeScript
export interface ValidState {
|
|
isValid: boolean;
|
|
message: string;
|
|
}
|
|
|
|
export type FormValidatorFn = (
|
|
field: string,
|
|
value: unknown,
|
|
formData: Record<string, unknown>
|
|
) => ValidState | Promise<ValidState>;
|
|
|
|
export interface FormValidator {
|
|
field: string;
|
|
validators: FormValidatorFn[];
|
|
}
|