1 | import { Component, FormHTMLAttributes, FormEvent, FormEventHandler } from "react";
|
2 | import { FormErrors, FormSubmitHandler, Omit } from "../index";
|
3 |
|
4 | interface FormSubmitProp<FormData = {}, P = {}, ErrorType = string> {
|
5 | onSubmit?: FormSubmitHandler<FormData, P, ErrorType> | undefined;
|
6 | }
|
7 |
|
8 | export type FormProps<FormData, P, ErrorType = string> = Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"> & FormSubmitProp<FormData, P, ErrorType>;
|
9 |
|
10 | export class GenericForm<FormData, P, ErrorType> extends Component<FormProps<FormData, P, ErrorType>> {}
|
11 |
|
12 | export class Form<FormData = {}, P = {}, ErrorType = string> extends Component<FormProps<FormData, P, ErrorType>> implements GenericForm<FormData, P, ErrorType> {}
|