1 | import { FormErrors, GetFormState } from "../index";
|
2 |
|
3 | export type DataSelector<FormData = {}, State = {}> = (
|
4 | formName: string,
|
5 | getFormState?: GetFormState,
|
6 | ) => (state: State) => FormData;
|
7 | export type ErrorSelector<FormData = {}, State = {}, ErrorType = string> = (
|
8 | formName: string,
|
9 | getFormState?: GetFormState,
|
10 | ) => (state: State) => FormErrors<FormData, ErrorType>;
|
11 | export type BooleanSelector<State = {}> = (formName: string, getFormState?: GetFormState) => (state: State) => boolean;
|
12 | export type NamesSelector<State = {}> = (getFormState?: GetFormState) => (state: State) => string[];
|
13 | export type FormOrFieldsBooleanSelector<State = {}> = (
|
14 | formName: string,
|
15 | getFormState?: GetFormState,
|
16 | ) => (state: State, ...fields: string[]) => boolean;
|
17 |
|
18 | export const getFormValues: DataSelector;
|
19 | export const getFormInitialValues: DataSelector;
|
20 | export const getFormSyncErrors: ErrorSelector;
|
21 | export const getFormMeta: DataSelector;
|
22 | export const getFormAsyncErrors: ErrorSelector;
|
23 | export const getFormSyncWarnings: ErrorSelector;
|
24 | export const getFormSubmitErrors: ErrorSelector;
|
25 | export const getFormError: ErrorSelector;
|
26 | export const getFormNames: NamesSelector;
|
27 | export const isDirty: FormOrFieldsBooleanSelector;
|
28 | export const isPristine: FormOrFieldsBooleanSelector;
|
29 | export const isValid: BooleanSelector;
|
30 | export const isInvalid: BooleanSelector;
|
31 | export const isSubmitting: BooleanSelector;
|
32 | export const isAsyncValidating: BooleanSelector;
|
33 | export const hasSubmitSucceeded: BooleanSelector;
|
34 | export const hasSubmitFailed: BooleanSelector;
|