FormBindingMethods
FormBindingMethods<
T,Bindings,Overrides> ={ [K in keyof Bindings]: K extends keyof Overrides ? Overrides[K] : FormBindingMethod<T, Bindings[K]> }
Defined in: binding.ts:193
Bind methods for the binding classes passed to extendFormBinding()
Form is extended with it to type the methods that extendFormBinding() adds.
Type Parameters
Section titled “Type Parameters”T
The subject of the form
Bindings
Section titled “Bindings”Bindings extends { [K in keyof Bindings]: FormBindingConstructor }
Type of the binding classes by method name, as passed to extendFormBinding()
Overrides
Section titled “Overrides”Overrides extends { [K in keyof Overrides]: K extends keyof Bindings ? IsIdentical<ErasedSignature<Overrides[K]>, ErasedSignature<FormBindingMethod<T, Bindings[K]>>> extends true ? FormBindingMethod<T, Bindings[K]> : "override diverges from the binding" : "no binding for this override" } = Record<never, never>
Methods written by hand, by method name
Example
Section titled “Example”export const myBindings = extendFormBinding({ bindDropdown: DropdownBinding,});
declare module "@mobx-sentinel/form" { interface Form<T> extends FormBindingMethods<T, typeof myBindings> {}}Remarks
Section titled “Remarks”Each method is derived from its binding class (see FormBindingMethod),
except for the methods written by hand in Overrides.
A generic binding class needs an override to keep its type parameters, which the derivation replaces with their
constraints. An override may differ from the derived method only in having type parameters of its own:
with them replaced by their constraints, it must be identical to the derived method.
Writing the config with the binding's own types (e.g. RadioGroupBinding.Config<V>) keeps it in step with the class.