mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
Merge pull request #26472 from maddijoyce/@pr/redux-form-getFormState
Redux Form - Adding 'undocumented' parameter to selectors.
This commit is contained in:
Vendored
+1
-1
@@ -8,9 +8,9 @@
|
||||
// Anton Novik <https://github.com/tehbi4>
|
||||
// Huw Martin <https://github.com/huwmartin>
|
||||
// Tim de Koning <https://github.com/reggino>
|
||||
// Maddi Joyce <https://github.com/maddijoyce>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
import {
|
||||
ComponentClass,
|
||||
StatelessComponent,
|
||||
|
||||
Vendored
+2
-1
@@ -20,6 +20,7 @@ import {
|
||||
export type FormSubmitHandler<FormData = {}, P = {}> =
|
||||
(values: FormData, dispatch: Dispatch<any>, props: P) => void | FormErrors<FormData> | Promise<any>;
|
||||
|
||||
export type GetFormState = (state: any) => FormStateMap;
|
||||
export interface SubmitHandler<FormData = {}, P = {}> {
|
||||
(
|
||||
submit: FormSubmitHandler<FormData, P>,
|
||||
@@ -105,7 +106,7 @@ export interface ConfigProps<FormData = {}, P = {}> {
|
||||
destroyOnUnmount?: boolean;
|
||||
enableReinitialize?: boolean;
|
||||
forceUnregisterOnUnmount?: boolean;
|
||||
getFormState?(state: any): FormStateMap;
|
||||
getFormState?: GetFormState;
|
||||
immutableProps?: string[];
|
||||
initialValues?: Partial<FormData>;
|
||||
keepDirtyOnReinitialize?: boolean;
|
||||
|
||||
Vendored
+6
-5
@@ -1,8 +1,9 @@
|
||||
import { FormErrors } from "../index";
|
||||
import { FormErrors, GetFormState } from "../index";
|
||||
|
||||
export type DataSelector<FormData = {}, State = {}> = (formName: string) => (state: State) => FormData;
|
||||
export type ErrorSelector<FormData = {}, State = {}> = (formName: string) => (state: State) => FormErrors<FormData>;
|
||||
export type BooleanSelector<State = {}> = (formName: string) => (state: State) => boolean;
|
||||
export type DataSelector<FormData = {}, State = {}> = (formName: string, getFormState?: GetFormState) => (state: State) => FormData;
|
||||
export type ErrorSelector<FormData = {}, State = {}> = (formName: string, getFormState?: GetFormState) => (state: State) => FormErrors<FormData>;
|
||||
export type BooleanSelector<State = {}> = (formName: string, getFormState?: GetFormState) => (state: State) => boolean;
|
||||
export type NamesSelector<State = {}> = (getFormState?: GetFormState) => (state: State) => string[];
|
||||
|
||||
export const getFormValues: DataSelector;
|
||||
export const getFormInitialValues: DataSelector;
|
||||
@@ -12,7 +13,7 @@ export const getFormAsyncErrors: ErrorSelector;
|
||||
export const getFormSyncWarnings: ErrorSelector;
|
||||
export const getFormSubmitErrors: ErrorSelector;
|
||||
export const getFormError: ErrorSelector;
|
||||
export function getFormNames(state: any): string[];
|
||||
export const getFormNames: NamesSelector;
|
||||
export const isDirty: BooleanSelector;
|
||||
export const isPristine: BooleanSelector;
|
||||
export const isValid: BooleanSelector;
|
||||
|
||||
Reference in New Issue
Block a user