1 | import { Action } from "redux";
|
2 | import { FieldType, FormErrors, FormWarnings } from "../index";
|
3 |
|
4 | export interface FormAction extends Action {
|
5 | meta?: any;
|
6 | payload?: any;
|
7 | error?: any;
|
8 | }
|
9 |
|
10 | export declare function arrayInsert(form: string, field: string, index: number, value: any): FormAction;
|
11 | export declare function arrayMove(form: string, field: string, from: number, to: number): FormAction;
|
12 | export declare function arrayPop(form: string, field: string): FormAction;
|
13 | export declare function arrayPush(form: string, field: string, value: any): FormAction;
|
14 | export declare function arrayRemove(form: string, field: string, index: number): FormAction;
|
15 | export declare function arrayRemoveAll(form: string, field: string): FormAction;
|
16 | export declare function arrayShift(form: string, field: string): FormAction;
|
17 | export declare function arraySplice(
|
18 | form: string,
|
19 | field: string,
|
20 | index: number,
|
21 | removeNum: number,
|
22 | value: any,
|
23 | ): FormAction;
|
24 | export declare function arraySwap(form: string, field: string, indexA: number, indexB: number): FormAction;
|
25 | export declare function arrayUnshift(form: string, field: string, value: any): FormAction;
|
26 | export declare function autofill(form: string, field: string, value: any): FormAction;
|
27 | export declare function blur(form: string, field: string, value: any, touch?: boolean): FormAction;
|
28 | export declare function change(
|
29 | form: string,
|
30 | field: string,
|
31 | value: any,
|
32 | touch?: boolean,
|
33 | persistentSubmitErrors?: boolean,
|
34 | ): FormAction;
|
35 | export declare function destroy(...form: string[]): FormAction;
|
36 | export declare function focus(form: string, field: string): FormAction;
|
37 |
|
38 | export interface InitializeOptions {
|
39 | keepDirty: boolean;
|
40 | keepSubmitSucceeded: boolean;
|
41 | updateUnregisteredFields: boolean;
|
42 | keepValues: boolean;
|
43 | }
|
44 |
|
45 | export declare function initialize(
|
46 | form: string,
|
47 | data: any,
|
48 | keepDirty?: boolean,
|
49 | options?: Partial<InitializeOptions>,
|
50 | ): FormAction;
|
51 | export declare function initialize(form: string, data: any, options?: Partial<InitializeOptions>): FormAction;
|
52 | export declare function registerField(form: string, name: string, type: FieldType): FormAction;
|
53 | export declare function reset(form: string): FormAction;
|
54 | export declare function resetSection(form: string, ...sections: string[]): FormAction;
|
55 | export declare function startAsyncValidation(form: string): FormAction;
|
56 | export declare function stopAsyncValidation(form: string, errors?: FormErrors<any, any>): FormAction;
|
57 | export declare function setSubmitFailed(form: string, ...fields: string[]): FormAction;
|
58 | export declare function setSubmitSucceeded(form: string, ...fields: string[]): FormAction;
|
59 | export declare function startSubmit(form: string): FormAction;
|
60 | export declare function stopSubmit(form: string, errors?: FormErrors<any, any>): FormAction;
|
61 | export declare function submit(form: string): FormAction;
|
62 | export declare function clearSubmit(form: string): FormAction;
|
63 | export declare function clearSubmitErrors(form: string): FormAction;
|
64 | export declare function clearAsyncError(form: string, field: string): FormAction;
|
65 | export declare function clearFields(
|
66 | form: string,
|
67 | keepTouched: boolean,
|
68 | persistentSubmitErrors: boolean,
|
69 | ...fields: string[]
|
70 | ): FormAction;
|
71 | export declare function touch(form: string, ...fields: string[]): FormAction;
|
72 | export declare function unregisterField(form: string, name: string): FormAction;
|
73 | export declare function untouch(form: string, ...fields: string[]): FormAction;
|
74 | export declare function updateSyncErrors<T = any>(form: string, syncErrors: FormErrors<any, T>, error: T): FormAction;
|
75 | export declare function updateSyncWarnings<T = any>(
|
76 | form: string,
|
77 | syncWarnings: FormWarnings<any, T>,
|
78 | warning: T,
|
79 | ): FormAction;
|
80 |
|
81 | declare const actions: {
|
82 | arrayInsert: typeof arrayInsert;
|
83 | arrayMove: typeof arrayMove;
|
84 | arrayPop: typeof arrayPop;
|
85 | arrayPush: typeof arrayPush;
|
86 | arrayRemove: typeof arrayRemove;
|
87 | arrayRemoveAll: typeof arrayRemoveAll;
|
88 | arrayShift: typeof arrayShift;
|
89 | arraySplice: typeof arraySplice;
|
90 | arraySwap: typeof arraySwap;
|
91 | arrayUnshift: typeof arrayUnshift;
|
92 | autofill: typeof autofill;
|
93 | blur: typeof blur;
|
94 | change: typeof change;
|
95 | clearSubmit: typeof clearSubmit;
|
96 | clearSubmitErrors: typeof clearSubmitErrors;
|
97 | clearAsyncError: typeof clearAsyncError;
|
98 | clearFields: typeof clearFields;
|
99 | destroy: typeof destroy;
|
100 | focus: typeof focus;
|
101 | initialize: typeof initialize;
|
102 | registerField: typeof registerField;
|
103 | reset: typeof reset;
|
104 | resetSection: typeof resetSection;
|
105 | startAsyncValidation: typeof startAsyncValidation;
|
106 | startSubmit: typeof startSubmit;
|
107 | stopAsyncValidation: typeof stopAsyncValidation;
|
108 | stopSubmit: typeof stopSubmit;
|
109 | submit: typeof submit;
|
110 | setSubmitFailed: typeof setSubmitFailed;
|
111 | setSubmitSucceeded: typeof setSubmitSucceeded;
|
112 | touch: typeof touch;
|
113 | unregisterField: typeof unregisterField;
|
114 | untouch: typeof untouch;
|
115 | updateSyncErrors: typeof updateSyncErrors;
|
116 | updateSyncWarnings: typeof updateSyncWarnings;
|
117 | };
|
118 |
|
119 | export default actions;
|