UNPKG

@react-rx/form

Version:

rx form for react, use typescript for development

35 lines (34 loc) 1.31 kB
import { IFieldAction, IFieldMeta, IFields, IFormState, IFormValues, TErrors } from "./interfaces"; export declare const formUpdateField: (state: IFormState, action: IFieldAction) => { fields: { [x: string]: IFieldMeta | { dirty?: boolean | undefined; touched?: boolean | undefined; visited?: boolean | undefined; error?: string | undefined; }; }; values: IFormValues; }; export declare const formFocusField: (state: IFormState, action: IFieldAction) => { values: IFormValues; fields: { [x: string]: IFieldMeta | { dirty?: boolean | undefined; touched?: boolean | undefined; visited?: boolean | undefined; error?: string | undefined; destroyValueOnUnmount?: boolean | undefined; }; }; }; export declare const formRemoveField: (state: IFormState, action: IFieldAction) => { fields: Pick<IFields, number>; values: Pick<IFormValues, number>; }; export declare const formUpdateValues: (formState: IFormState) => (formValues: IFormValues) => { fields: IFields; values: IFormValues; }; export declare const formSetErrors: (errors: TErrors, fields: IFields) => IFields; export declare const isFormValid: (fields: IFields) => boolean;