yarfl
Version:
Yet Another Redux Forms Library
24 lines (23 loc) • 1.95 kB
TypeScript
import { Options } from 'react-redux';
import { Dispatch } from 'redux';
import { CompleteConfig, FormProps, FormState } from './typings';
export declare const createConnector: <S extends object>(config: CompleteConfig<S>) => (mapStateToProps?: any, mapDispatchToProps?: any, mergeProps?: any, options?: any) => import("react-redux").InferableComponentEnhancerWithProps<any, object>;
export declare const connectDirectly: <S extends object>(config: CompleteConfig<S>, options?: Options<{}, {}, {}, {}> | undefined) => import("react-redux").InferableComponentEnhancerWithProps<{}, {}>;
export declare const localFormMap: (config: CompleteConfig<any>) => (state: any, dispatch: any) => FormProps<any>;
export declare const createStateMapper: (config: CompleteConfig<any>) => (state: object) => FormState<any>;
export declare const mapDispatch: <S extends object>(config: CompleteConfig<S>) => (dispatch: Dispatch<any>) => {
updateForm: (value: any) => (dispatch: any) => any;
clearForm: () => (dispatch: any) => any;
resetForm: () => (dispatch: any) => any;
showFormErrors: (showErrors?: boolean | undefined) => (dispatch: any, getState: any) => any;
updateField: (key: string, value: any) => (dispatch: any) => any;
focusField: (key: string) => (dispatch: any) => any;
blurField: (key: string) => (dispatch: any) => any;
clearField: (key: string) => (dispatch: any) => any;
resetField: (key: string) => (dispatch: any) => any;
validateField: (key: string) => (dispatch: any, getState: any) => any;
showFieldErrors: (key: string, showErrors?: boolean | undefined) => (dispatch: any) => any;
addArrayField: (key: string) => (dispatch: any, getState: any) => Promise<any[]>;
deleteArrayField: (key: string, index: number) => (dispatch: any) => any;
};
export declare const mergeFormProps: <S extends object>(config: CompleteConfig<S>) => (state: FormState<S>, dispatchers: object) => FormProps<S>;