react-bfm
Version:
A basic field / form manager for React using hooks
17 lines (16 loc) • 1.1 kB
TypeScript
import { StateCreatorReturnType } from './state';
import { DirtyCheckFunction, FieldNameType, NamespaceType } from './common';
/**
* @deprecated Will be removed in v3.0.0. This is an internal implementation detail and should not be used directly.
*/
export interface BFMHookContextType extends Omit<StateCreatorReturnType, 'updateFieldStateWithCallback' | 'initFieldState'> {
blurField: (namespace: NamespaceType, fieldName: FieldNameType) => void;
changeField: (namespace: NamespaceType, fieldName: FieldNameType, value: any, error: any, dirtyCheck?: DirtyCheckFunction) => void;
initialValueField: (namespace: NamespaceType, fieldName: FieldNameType, initialValue: any, error: any) => void;
focusField: (namespace: NamespaceType, fieldName: FieldNameType) => void;
initField: (namespace: NamespaceType, fieldName: FieldNameType, value: any, error: any) => void;
}
/**
* @deprecated Will be removed in v3.0.0. This is an internal implementation detail and should not be used directly.
*/
export declare const BFMHooksContext: import("react").Context<BFMHookContextType>;