defineForm()
An identity function whose argument type extends the Form type. This function is used for type checking.
typescript
function defineForm<T extends Form>(form: T): T {
return form;
}Details of Form type
An object that satisfies the following:
- Key
- Starting with
$are not available.
- Starting with
- Value is one of the following
Fieldobject (field()returns)PrivateFieldobject (privateField()returns)FormsFieldobject (formsField()returns)- A Function
Formobject recursively
typescript
type Form = {
[key: `$${string}`]: never;
[key: string]:
| Field<any>
| PrivateField<any>
| FormsField<(arg: any) => Form>
| ((...args: any[]) => any)
| Form;
};