mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
[redux-form] typing for version 7.2
Add clearFields action; update Validator type to accept optional name argument; update FieldArray meta props to type `any`; add shouldError and shouldWarn config props to reduxForm; add getFormError selector
This commit is contained in:
3
types/redux-form/index.d.ts
vendored
3
types/redux-form/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for redux-form 7.0
|
||||
// Type definitions for redux-form 7.2
|
||||
// Project: https://github.com/erikras/redux-form
|
||||
// Definitions by: Carson Full <https://github.com/carsonf>
|
||||
// Daniel Lytkin <https://github.com/aikoven>
|
||||
@@ -6,6 +6,7 @@
|
||||
// Luka Zakrajsek <https://github.com/bancek>
|
||||
// Alex Young <https://github.com/alsiola>
|
||||
// Anton Novik <https://github.com/tehbi4>
|
||||
// Huw Martin <https://github.com/huwmartin>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
|
||||
2
types/redux-form/lib/Field.d.ts
vendored
2
types/redux-form/lib/Field.d.ts
vendored
@@ -14,7 +14,7 @@ import { Dispatch } from "redux";
|
||||
export type Normalizer = (value: any, previousValue?: any, allValues?: any, previousAllValues?: any) => any;
|
||||
export type Formatter = (value: any, name: string) => any;
|
||||
export type Parser = (value: any, name: string) => any;
|
||||
export type Validator = (value: any, allValues?: any, props?: any) => any;
|
||||
export type Validator = (value: any, allValues?: any, props?: any, name?: any) => any;
|
||||
|
||||
export type EventHandler<Event> = (event: Event) => void;
|
||||
export type EventWithDataHandler<Event> = (event?: Event, newValue?: any, previousValue?: any) => void;
|
||||
|
||||
4
types/redux-form/lib/FieldArray.d.ts
vendored
4
types/redux-form/lib/FieldArray.d.ts
vendored
@@ -47,11 +47,11 @@ interface FieldsProps<FieldValue> {
|
||||
|
||||
interface FieldArrayMetaProps {
|
||||
dirty: boolean;
|
||||
error?: string;
|
||||
error?: any;
|
||||
form: string;
|
||||
invalid: boolean;
|
||||
pristine: boolean;
|
||||
submitting: boolean;
|
||||
valid: boolean;
|
||||
warning?: string;
|
||||
warning?: any;
|
||||
}
|
||||
|
||||
1
types/redux-form/lib/actionTypes.d.ts
vendored
1
types/redux-form/lib/actionTypes.d.ts
vendored
@@ -15,6 +15,7 @@ export interface ActionTypes {
|
||||
CLEAR_SUBMIT: string;
|
||||
CLEAR_SUBMIT_ERRORS: string;
|
||||
CLEAR_ASYNC_ERROR: string;
|
||||
CLEAR_FIELDS: string;
|
||||
DESTROY: string;
|
||||
FOCUS: string;
|
||||
INITIALIZE: string;
|
||||
|
||||
2
types/redux-form/lib/actions.d.ts
vendored
2
types/redux-form/lib/actions.d.ts
vendored
@@ -41,6 +41,7 @@ export declare function submit(form: string): FormAction;
|
||||
export declare function clearSubmit(form: string): FormAction;
|
||||
export declare function clearSubmitErrors(form: string): FormAction;
|
||||
export declare function clearAsyncError(form: string, field: string): FormAction;
|
||||
export declare function clearFields(form: string, keepTouched: boolean, persistentSubmitErrors: boolean, ...fields: string[]): FormAction;
|
||||
export declare function touch(form: string, ...fields: string[]): FormAction;
|
||||
export declare function unregisterField(form: string, name: string): FormAction;
|
||||
export declare function untouch(form: string, ...fields: string[]): FormAction;
|
||||
@@ -64,6 +65,7 @@ declare const actions: {
|
||||
clearSubmit: typeof clearSubmit,
|
||||
clearSubmitErrors: typeof clearSubmitErrors,
|
||||
clearAsyncError: typeof clearAsyncError,
|
||||
clearFields: typeof clearFields,
|
||||
destroy: typeof destroy,
|
||||
focus: typeof focus,
|
||||
initialize: typeof initialize,
|
||||
|
||||
2
types/redux-form/lib/reduxForm.d.ts
vendored
2
types/redux-form/lib/reduxForm.d.ts
vendored
@@ -116,6 +116,8 @@ export interface ConfigProps<FormData = {}, P = {}> {
|
||||
propNamespace?: string;
|
||||
pure?: boolean;
|
||||
shouldValidate?(params: ValidateCallback<FormData, P>): boolean;
|
||||
shouldError?(params: ValidateCallback<FormData, P>): boolean;
|
||||
shouldWarn?(params: ValidateCallback<FormData, P>): boolean;
|
||||
shouldAsyncValidate?(params: AsyncValidateCallback<FormData>): boolean;
|
||||
touchOnBlur?: boolean;
|
||||
touchOnChange?: boolean;
|
||||
|
||||
1
types/redux-form/lib/selectors.d.ts
vendored
1
types/redux-form/lib/selectors.d.ts
vendored
@@ -11,6 +11,7 @@ export const getFormMeta: DataSelector;
|
||||
export const getFormAsyncErrors: ErrorSelector;
|
||||
export const getFormSyncWarnings: ErrorSelector;
|
||||
export const getFormSubmitErrors: ErrorSelector;
|
||||
export const getFormError: ErrorSelector;
|
||||
export function getFormNames(state: any): string[];
|
||||
export const isDirty: BooleanSelector;
|
||||
export const isPristine: BooleanSelector;
|
||||
|
||||
Reference in New Issue
Block a user