@strictly/react-form 0.0.33 → 0.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,8 @@
1
- import { type ReadonlyTypeOfType, type ValueOfType } from '@strictly/define';
1
+ import { type ReadonlyTypeOfType, type Type, type ValueOfType } from '@strictly/define';
2
2
  import { type FormModel } from './FormModel';
3
- type ValueOfModel<M extends FormModel<any, any, any, any, any>> = M extends FormModel<infer T, any, any, any, any> ? ValueOfType<ReadonlyTypeOfType<T>> : never;
4
- export declare function useDefaultMobxFormHooks<M extends FormModel<any, any, any, any, any>, F extends M['fields'] = M['fields']>(model: M, { onValidFieldSubmit, onValidFormSubmit, }?: {
3
+ type FormModelInterface<T extends Type = any> = Pick<FormModel<T, any, any, any, any>, 'fields' | 'value' | 'getValidation' | 'validateField' | 'setFieldValue' | 'validateSubmit' | 'isFieldDirty' | 'isValuePathActive'>;
4
+ type ValueOfModel<M extends FormModelInterface> = M extends FormModelInterface<infer T> ? ValueOfType<ReadonlyTypeOfType<T>> : never;
5
+ export declare function useDefaultMobxFormHooks<M extends FormModelInterface, F extends M['fields'] = M['fields']>(model: M, { onValidFieldSubmit, onValidFormSubmit, }?: {
5
6
  onValidFieldSubmit?: <Path extends keyof F>(valuePath: Path) => void;
6
7
  onValidFormSubmit?: (value: ValueOfModel<M>) => void;
7
8
  }): {