mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 17:51:46 +00:00
Adding 'undocumented' parameter to selectors.
This commit is contained in:
Vendored
+12
-8
@@ -7,14 +7,11 @@
|
||||
// Alex Young <https://github.com/alsiola>
|
||||
// Anton Novik <https://github.com/tehbi4>
|
||||
// Huw Martin <https://github.com/huwmartin>
|
||||
// Maddi Joyce <https://github.com/maddijoyce>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
import {
|
||||
ComponentClass,
|
||||
StatelessComponent,
|
||||
ReactElement
|
||||
} from "react";
|
||||
import { ComponentClass, StatelessComponent, ReactElement } from "react";
|
||||
|
||||
export type FieldType = "Field" | "FieldArray";
|
||||
|
||||
@@ -23,7 +20,7 @@ export interface ErrorOther<T = void> {
|
||||
}
|
||||
|
||||
export type FormErrors<FormData = {}, T = void> = {
|
||||
[P in keyof FormData]?: ReactElement<any> | string | ErrorOther<T>;
|
||||
[P in keyof FormData]?: ReactElement<any> | string | ErrorOther<T>
|
||||
};
|
||||
|
||||
export interface WarningOther<T = void> {
|
||||
@@ -31,7 +28,7 @@ export interface WarningOther<T = void> {
|
||||
}
|
||||
|
||||
export type FormWarnings<FormData = {}, T = void> = {
|
||||
[P in keyof FormData]?: ReactElement<any> | string | WarningOther<T>;
|
||||
[P in keyof FormData]?: ReactElement<any> | string | WarningOther<T>
|
||||
};
|
||||
|
||||
export interface RegisteredFieldState {
|
||||
@@ -39,7 +36,14 @@ export interface RegisteredFieldState {
|
||||
type: FieldType;
|
||||
}
|
||||
|
||||
export type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;
|
||||
export type Omit<T, K extends keyof T> = Pick<
|
||||
T,
|
||||
({ [P in keyof T]: P } &
|
||||
{ [P in K]: never } & {
|
||||
[x: string]: never;
|
||||
[x: number]: never;
|
||||
})[keyof T]
|
||||
>;
|
||||
|
||||
export * from "./lib/reduxForm";
|
||||
export * from "./lib/Field";
|
||||
|
||||
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
+4
-4
@@ -1,8 +1,8 @@
|
||||
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 const getFormValues: DataSelector;
|
||||
export const getFormInitialValues: DataSelector;
|
||||
|
||||
Reference in New Issue
Block a user