1 | import { Action } from "redux";
|
2 | import { FormErrors, FormWarnings, FieldType } 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(form: string, field: string, index: number, removeNum: number, value: any): FormAction;
|
18 | export declare function arraySwap(form: string, field: string, indexA: number, indexB: number): FormAction;
|
19 | export declare function arrayUnshift(form: string, field: string, value: any): FormAction;
|
20 | export declare function autofill(form: string, field: string, value: any): FormAction;
|
21 | export declare function blur(form: string, field: string, value: any, touch?: boolean): FormAction;
|
22 | export declare function change(form: string, field: string, value: any, touch?: boolean, persistentSubmitErrors?: boolean): FormAction;
|
23 | export declare function destroy(...form: string[]): FormAction;
|
24 | export declare function focus(form: string, field: string): FormAction;
|
25 |
|
26 | export interface InitializeOptions {
|
27 | keepDirty: boolean;
|
28 | keepSubmitSucceeded: boolean;
|
29 | updateUnregisteredFields: boolean;
|
30 | keepValues: boolean;
|
31 | }
|
32 |
|
33 | export declare function initialize(form: string, data: any, keepDirty?: boolean, options?: Partial<InitializeOptions>): FormAction;
|
34 | export declare function initialize(form: string, data: any, options?: Partial<InitializeOptions>): FormAction;
|
35 | export declare function registerField(form: string, name: string, type: FieldType): FormAction;
|
36 | export declare function reset(form: string): FormAction;
|
37 | export declare function resetSection(form: string, ...sections: string[]): FormAction;
|
38 | export declare function startAsyncValidation(form: string): FormAction;
|
39 | export declare function stopAsyncValidation(form: string, errors?: FormErrors<any, any>): FormAction;
|
40 | export declare function setSubmitFailed(form: string, ...fields: string[]): FormAction;
|
41 | export declare function setSubmitSucceeded(form: string, ...fields: string[]): FormAction;
|
42 | export declare function startSubmit(form: string): FormAction;
|
43 | export declare function stopSubmit(form: string, errors?: FormErrors<any, any>): FormAction;
|
44 | export declare function submit(form: string): FormAction;
|
45 | export declare function clearSubmit(form: string): FormAction;
|
46 | export declare function clearSubmitErrors(form: string): FormAction;
|
47 | export declare function clearAsyncError(form: string, field: string): FormAction;
|
48 | export declare function clearFields(form: string, keepTouched: boolean, persistentSubmitErrors: boolean, ...fields: string[]): FormAction;
|
49 | export declare function touch(form: string, ...fields: string[]): FormAction;
|
50 | export declare function unregisterField(form: string, name: string): FormAction;
|
51 | export declare function untouch(form: string, ...fields: string[]): FormAction;
|
52 | export declare function updateSyncErrors<T = any>(form: string, syncErrors: FormErrors<any, T>, error: T): FormAction;
|
53 | export declare function updateSyncWarnings<T = any>(form: string, syncWarnings: FormWarnings<any, T>, warning: T): FormAction;
|
54 |
|
55 | declare const actions: {
|
56 | arrayInsert: typeof arrayInsert,
|
57 | arrayMove: typeof arrayMove,
|
58 | arrayPop: typeof arrayPop,
|
59 | arrayPush: typeof arrayPush,
|
60 | arrayRemove: typeof arrayRemove,
|
61 | arrayRemoveAll: typeof arrayRemoveAll,
|
62 | arrayShift: typeof arrayShift,
|
63 | arraySplice: typeof arraySplice,
|
64 | arraySwap: typeof arraySwap,
|
65 | arrayUnshift: typeof arrayUnshift,
|
66 | autofill: typeof autofill,
|
67 | blur: typeof blur,
|
68 | change: typeof change,
|
69 | clearSubmit: typeof clearSubmit,
|
70 | clearSubmitErrors: typeof clearSubmitErrors,
|
71 | clearAsyncError: typeof clearAsyncError,
|
72 | clearFields: typeof clearFields,
|
73 | destroy: typeof destroy,
|
74 | focus: typeof focus,
|
75 | initialize: typeof initialize,
|
76 | registerField: typeof registerField,
|
77 | reset: typeof reset,
|
78 | resetSection: typeof resetSection,
|
79 | startAsyncValidation: typeof startAsyncValidation,
|
80 | startSubmit: typeof startSubmit,
|
81 | stopAsyncValidation: typeof stopAsyncValidation,
|
82 | stopSubmit: typeof stopSubmit,
|
83 | submit: typeof submit,
|
84 | setSubmitFailed: typeof setSubmitFailed,
|
85 | setSubmitSucceeded: typeof setSubmitSucceeded,
|
86 | touch: typeof touch,
|
87 | unregisterField: typeof unregisterField,
|
88 | untouch: typeof untouch,
|
89 | updateSyncErrors: typeof updateSyncErrors,
|
90 | updateSyncWarnings: typeof updateSyncWarnings
|
91 | };
|
92 |
|
93 | export default actions;
|