mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #26026 from ZhangYiJiang/fix-redux-form-initialize
[redux-form] Add missing properties in InitializeOptions and Reset
This commit is contained in:
+1
@@ -20,6 +20,7 @@ export interface ActionTypes {
|
||||
INITIALIZE: string;
|
||||
REGISTER_FIELD: string;
|
||||
RESET: string;
|
||||
RESET_SECTION: string;
|
||||
SET_SUBMIT_FAILED: string;
|
||||
SET_SUBMIT_SUCCEEDED: string;
|
||||
START_ASYNC_VALIDATION: string;
|
||||
|
||||
Vendored
+17
-4
@@ -84,14 +84,22 @@ export function destroy(...form: string[]): FormAction;
|
||||
export function focus(form: string, field: string): FormAction;
|
||||
|
||||
/**
|
||||
* Sets the initial values in the form with which future data values will be compared to calculate dirty and pristine.
|
||||
* The data parameter may contain deep nested array and object values that match the shape of your form fields.
|
||||
* If the keepDirty parameter is true, the values of the currently dirty fields will be retained to avoid overwriting
|
||||
* user edits.
|
||||
* Sets the initial values in the form with which future data values will be compared to calculate dirty and pristine.
|
||||
*
|
||||
* If the keepDirty parameter is true, the values of currently dirty fields will be retained to avoid overwriting user edits.
|
||||
*
|
||||
* If the keepSubmitSucceeded parameter is true, it will not clear the submitSucceeded flag if it is set.
|
||||
*
|
||||
* If the updateUnregisteredFields parameter is true, it will update every initialValue if still pristine instead of only
|
||||
* registered fields. Highly recommended, defaults to false because of non-breaking backwards compatibility.
|
||||
*
|
||||
* If the keepValues parameter is true, it will keep the old values and initial values.
|
||||
*/
|
||||
interface InitializeOptions {
|
||||
keepDirty: boolean;
|
||||
keepSubmitSucceeded: boolean;
|
||||
updateUnregisteredFields: boolean;
|
||||
keepValues: boolean;
|
||||
}
|
||||
|
||||
export function initialize(form: string, data: any, keepDirty?: boolean | InitializeOptions, options?: InitializeOptions): FormAction;
|
||||
@@ -106,6 +114,11 @@ export function registerField(form: string, name: string, type: FieldType): Form
|
||||
*/
|
||||
export function reset(form: string): FormAction;
|
||||
|
||||
/**
|
||||
* Resets the values in the form sections back to the values past in with the most recent initialize action.
|
||||
*/
|
||||
export function resetSection(form: string, ...sections: string[]): FormAction;
|
||||
|
||||
/**
|
||||
* Flips the asyncValidating flag true
|
||||
*/
|
||||
|
||||
+5
@@ -518,6 +518,11 @@ export interface StrictFormProps<FormData extends DataShape, P, S> {
|
||||
*/
|
||||
reset(): void;
|
||||
|
||||
/**
|
||||
* Resets the form sections to the initialValues. It will be pristine after reset.
|
||||
*/
|
||||
resetSection(...sections: string[]) : void;
|
||||
|
||||
/**
|
||||
* Whether or not your form is currently submitting. This prop will only
|
||||
* work if you have passed an onSubmit function that returns a promise. It
|
||||
|
||||
Reference in New Issue
Block a user