@mobx-sentinel/react
Version:
A TypeScript library for non-intrusive model enhancement in MobX applications. Provides model change detection, validation, and form integration capabilities while maintaining the purity of domain models.
24 lines (21 loc) • 924 B
TypeScript
export { C as CheckBoxBinding, I as InputBinding, L as LabelBinding, R as RadioButtonBinding, S as SelectBoxBinding, a as SubmitButtonBinding } from './LabelBinding-BffzWbO4.js';
import { Form } from '@mobx-sentinel/form';
import 'react';
/**
* Auto reset the form when when the component is mounted and unmounted.
*
* @param form The form instance.
*/
declare function useFormAutoReset(form: Form<any>): void;
/**
* Add a handler to the form.
*
* It automatically removes the handler when the component is unmounted.
*
* @param form The form instance.
* @param event The event of the handler.
* @param handler The handler.\
* No memoization is needed as the handler is stored in a ref internally.
*/
declare function useFormHandler<T extends object, Event extends keyof Form.Handlers>(form: Form<T>, event: Event, handler: Form.Handlers[NoInfer<Event>]): void;
export { useFormAutoReset, useFormHandler };