1 | import { Component, FormHTMLAttributes } from "react";
|
2 | import { 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> =
|
9 | & Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit">
|
10 | & FormSubmitProp<FormData, P, ErrorType>;
|
11 |
|
12 | export class GenericForm<FormData, P, ErrorType> extends Component<FormProps<FormData, P, ErrorType>> {}
|
13 |
|
14 | export class Form<FormData = {}, P = {}, ErrorType = string> extends Component<FormProps<FormData, P, ErrorType>>
|
15 | implements GenericForm<FormData, P, ErrorType>
|
16 | {
|
17 | }
|