UNPKG

2.18 kBTypeScriptView Raw
1// Type definitions for redux-form 8.3
2// Project: https://github.com/erikras/redux-form, https://redux-form.com
3// Definitions by: Daniel Lytkin <https://github.com/aikoven>
4// Karol Janyst <https://github.com/LKay>
5// Luka Zakrajsek <https://github.com/bancek>
6// Huw Martin <https://github.com/huwmartin>
7// Matt Davis <https://github.com/m-b-davis>
8// Ethan Resnick <https://github.com/ethanresnick>
9// Maddi Joyce <https://github.com/maddijoyce>
10// Kamil Wojcik <https://github.com/smifun>
11// Mohamed Shaaban <https://github.com/mshaaban088>
12// Ethan Setnik <https://github.com/esetnik>
13// Kota Marusue <https://github.com/mrsekut>
14// Adam Bouqdib <https://github.com/abemedia>
15// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
16// TypeScript Version: 3.0
17import {
18 ComponentClass,
19 FunctionComponent,
20 ReactElement
21} from "react";
22
23export type FieldType = "Field" | "FieldArray";
24
25export interface ErrorOther<T = string> {
26 _error?: T | undefined;
27}
28
29export type FormErrors<FormData = {}, T = string> = {
30 [P in keyof FormData]?: ReactElement | T;
31} & ErrorOther<T>;
32
33export interface WarningOther<T = void> {
34 _warning?: T | undefined;
35}
36
37export type FormWarnings<FormData = {}, T = void> = {
38 [P in keyof FormData]?: ReactElement | string | WarningOther<T>;
39};
40
41export interface RegisteredFieldState {
42 name: string;
43 type: FieldType;
44}
45
46export 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]>;
47
48export * from "./lib/reduxForm";
49export * from "./lib/Field";
50export * from "./lib/Fields";
51export * from "./lib/FieldArray";
52export * from "./lib/Form";
53export * from "./lib/FormName";
54export * from "./lib/FormSection";
55export * from "./lib/formValues";
56export * from "./lib/formValueSelector";
57export * from "./lib/reducer";
58export * from "./lib/SubmissionError";
59export * from "./lib/actions";
60export * from "./lib/actionTypes";
61export * from "./lib/selectors";