Type aliases
CreateSubmitHandlerConfig
Create
SubmitHandlerConfig<Data>: { onError?: FormConfig < Data > [ "onError" ] ; onSubmit?: FormConfig < Data > [ "onSubmit" ] ; validate?: FormConfig < Data > [ "validate" ] }
Defined in common/dist/types-9bd61299.d.ts:5
Type parameters
CurrentForm
Current
Form<Data>: { config: FormConfig < Data > ; controls?: FormControl [] ; data: Writable < Data > ; errors: Writable < Errors < Data > > ; form?: HTMLFormElement ; touched: Writable < Touched < Data > > }
Defined in common/dist/types-9bd61299.d.ts:10
Type parameters
Type declaration
data: Writable < Data >
errors: Writable < Errors < Data > >
Optional form?: HTMLFormElement
touched: Writable < Touched < Data > >
DeepSetResult
Deep
SetResult<Data, Value>: { [ key in keyof Data ] : Data [ key ] extends Obj ? DeepSetResult < Data [ key ] , Value > : Value }
Defined in common/dist/types-9bd61299.d.ts:2
Type parameters
Errors
Errors<Data>
: { [ key in keyof Data ] : Data [ key ] extends Obj ? Errors < Data [ key ] > : string | string [] | null }
Defined in common/dist/types-9bd61299.d.ts:70
Type parameters
Extender
Defined in common/dist/types-9bd61299.d.ts:31
Type parameters
ExtenderHandler
Extender
Handler<Data>: { destroy?: ( ) => void ; onSubmitError?: ( state: OnSubmitErrorState < Data > ) => void }
Defined in common/dist/types-9bd61299.d.ts:27
Type parameters
Type declaration
Optional destroy?: ( ) => void
Optional onSubmitError?: ( state: OnSubmitErrorState < Data > ) => void
FieldValue
FieldValue: string | string [] | boolean | number | File | File [] | undefined
Defined in common/dist/types-9bd61299.d.ts:35
Form
Form<Data>
: { createSubmitHandler
: ( altConfig
?: CreateSubmitHandlerConfig < Data > ) => ( e
?: Event ) => void ; form
: FormAction ; handleSubmit
: ( e
?: Event ) => void ; reset
: ( ) => void ; setError
: ( path
: string , error
: string | string [] ) => void ; setField
: ( path
: string , value
?: FieldValue , touch
?: boolean ) => void ; setFields
: ( values
: Data ) => void ; setTouched
: ( path
: string ) => void ; validate
: ( ) => Promise < Errors < Data > | void > } & Stores < Data >
Defined in common/dist/types-9bd61299.d.ts:94
Type parameters
FormAction
FormAction: ( node: HTMLFormElement ) => { destroy: ( ) => void }
Defined in common/dist/types-9bd61299.d.ts:77
Type declaration
( node: HTMLFormElement ) : { destroy: ( ) => void }
Parameters
Returns { destroy: ( ) => void }
FormControl
FormControl: HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement
Defined in common/dist/types-9bd61299.d.ts:36
Obj
Obj: Record < string , unknown >
Defined in common/dist/types-9bd61299.d.ts:33
OnSubmitErrorState
On
SubmitErrorState<Data>: { data: Data ; errors: Errors < Data > }
Defined in common/dist/types-9bd61299.d.ts:18
Type parameters
Type declaration
data: Data
errors: Errors < Data >
Reporter
Defined in common/dist/types-9bd61299.d.ts:26
Type parameters
ReporterHandler
Reporter
Handler<Data>: { destroy?: ( ) => void ; onSubmitError?: ( state: OnSubmitErrorState < Data > ) => void }
Defined in common/dist/types-9bd61299.d.ts:22
Type parameters
Type declaration
Optional destroy?: ( ) => void
Optional onSubmitError?: ( state: OnSubmitErrorState < Data > ) => void
Stores
Stores<Data>
: { data
: Writable < Data > ; errors
: Writable < Errors < Data > > ; isSubmitting
: Writable < boolean > ; isValid
: Readable < boolean > ; touched
: Writable < Touched < Data > > }
Defined in common/dist/types-9bd61299.d.ts:81
Type parameters
Type declaration
data: Writable < Data >
errors: Writable < Errors < Data > >
isSubmitting: Writable < boolean >
isValid: Readable < boolean >
touched: Writable < Touched < Data > >
Touched
Touched<Data>
: { [ key in keyof Data ] : Data [ key ] extends Obj ? Touched < Data [ key ] > : boolean }
Defined in common/dist/types-9bd61299.d.ts:74
Type parameters
ValidationFunction
Validation
Function<Data>: ( values: Data ) => Errors < Data > | undefined | Promise < Errors < Data > | undefined >
Defined in common/dist/types-9bd61299.d.ts:37
Type parameters
Type declaration
( values: Data ) : Errors < Data > | undefined | Promise < Errors < Data > | undefined >
Parameters
Returns Errors < Data > | undefined | Promise < Errors < Data > | undefined >
The errors object may contain either a string or array or string per key.