This repository was archived by the owner on Jan 22, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 566
Expand file tree
/
Copy pathredux-form.d.ts
More file actions
201 lines (191 loc) · 6.96 KB
/
redux-form.d.ts
File metadata and controls
201 lines (191 loc) · 6.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
import { ConfigProps, FormAction, FormDecorator, GetFormState, InitializeOptions } from 'redux-form'
export type WalletFormType =
| '@SEND.BCH.FORM'
| '@SEND.BTC.FORM'
| '@SEND.ETH.FORM'
| '@SEND.XLM.FORM'
| 'activeRewardsDepositForm'
| 'activeRewardsWithdrawalForm'
| 'airdropClaim'
| 'buySellCheckout'
| 'brokerageTx'
| 'bsCheckoutConfirm'
| 'bsCurrencySelection'
| 'bsCryptoSelection'
| 'bsPaymentMethods'
| 'bsChangeEmail'
| 'cancelBSOrderForm'
| 'billingAddress'
| 'confirmCustodyWithdraw'
| 'confirmRecoveryWords'
| 'custodyWithdrawForm'
| 'dexSwapSettings'
| 'dexSelectToken'
| 'initSwap'
| 'passiveRewardsDepositForm'
| 'earnHistoryCoin'
| 'linkBankForm'
| 'linkedBanks'
| 'linkedCards'
| 'login'
| 'passiveRewardsWithdrawalForm'
| 'previewSwap'
| 'previewSell'
| 'prices'
| 'priceChartCoin'
| 'recover'
| 'register'
| 'repayLoanForm'
| 'requestCrypto'
| 'sendCrypto'
| 'settingsNotifications'
| 'setupTwoFactor'
| 'stakingDepositForm'
| 'stakingWithdrawalForm'
| 'swapAmount'
| 'swapOrderDetails'
| 'transferEth'
| 'transactionReport'
| 'walletGuidReminder'
| 'wallet2faReset'
| 'walletTxSearch'
declare module 'redux-form' {
/* eslint-disable */
export function arrayInsert(
form: WalletFormType,
field: string,
index: number,
value: any
): FormAction
export function arrayMove(
form: WalletFormType,
field: string,
from: number,
to: number
): FormAction
export function arrayPop(form: WalletFormType, field: string): FormAction
export function arrayPush(form: WalletFormType, field: string, value: any): FormAction
export function arrayRemove(form: WalletFormType, field: string, index: number): FormAction
export function arrayRemoveAll(form: WalletFormType, field: string): FormAction
export function arrayShift(form: WalletFormType, field: string): FormAction
export function arraySplice(
form: WalletFormType,
field: string,
index: number,
removeNum: number,
value: any
): FormAction
export function arraySwap(
form: WalletFormType,
field: string,
indexA: number,
indexB: number
): FormAction
export function arrayUnshift(form: WalletFormType, field: string, value: any): FormAction
export function autofill(form: WalletFormType, field: string, value: any): FormAction
export function blur(form: WalletFormType, field: string, value: any, touch?: boolean): FormAction
export function change(
form: WalletFormType,
field: string,
value: any,
touch?: boolean,
persistentSubmitErrors?: boolean
): FormAction
export function destroy(...form: WalletFormType[]): FormAction
export function focus(form: WalletFormType, field: string): FormAction
export function initialize(
form: WalletFormType,
data: any,
keepDirty?: boolean,
options?: Partial<InitializeOptions>
): FormAction
export function initialize(
form: WalletFormType,
data: any,
options?: Partial<InitializeOptions>
): FormAction
/* eslint-enable */
export function registerField(form: WalletFormType, name: string, type: FieldType): FormAction
export function reset(form: WalletFormType): FormAction
export function resetSection(form: WalletFormType, ...sections: string[]): FormAction
export function startAsyncValidation(form: WalletFormType): FormAction
export function stopAsyncValidation(form: WalletFormType, errors?: any): FormAction
export function setSubmitFailed(form: WalletFormType, ...fields: string[]): FormAction
export function setSubmitSucceeded(form: WalletFormType, ...fields: string[]): FormAction
export function startSubmit(form: WalletFormType): FormAction
export function stopSubmit(form: WalletFormType, errors?: any): FormAction
export function submit(form: WalletFormType): FormAction
export function clearSubmit(form: WalletFormType): FormAction
export function clearSubmitErrors(form: WalletFormType): FormAction
export function clearAsyncError(form: WalletFormType, field: string): FormAction
export function clearFields(
form: WalletFormType,
keepTouched: boolean,
persistentSubmitErrors: boolean,
...fields: string[]
): FormAction
export function touch(form: WalletFormType, ...fields: string[]): FormAction
export function unregisterField(form: WalletFormType, name: string): FormAction
export function untouch(form: WalletFormType, ...fields: string[]): FormAction
export function updateSyncErrors(
from: string,
syncErrors: FormErrors<FormData>,
error: any
): FormAction
export function updateSyncWarnings(
form: WalletFormType,
syncWarnings: FormWarnings<FormData>,
warning: any
): FormAction
export type DataSelector<FormData = {}, State = {}> = (
formName: WalletFormType,
getFormState?: GetFormState
) => (state: State) => FormData
export type ErrorSelector<FormData = {}, State = {}> = (
formName: WalletFormType,
getFormState?: GetFormState
) => (state: State) => FormErrors<FormData>
export type BooleanSelector<State = {}> = (
formName: WalletFormType,
getFormState?: GetFormState
) => (state: State) => boolean
export type NamesSelector<State = {}> = (
getFormState?: GetFormState
) => (state: State) => string[]
export type FormOrFieldsBooleanSelector<State = {}> = (
formName: WalletFormType,
getFormState?: GetFormState
) => (state: State, ...fields: string[]) => boolean
export const getFormValues: DataSelector
export const getFormInitialValues: DataSelector
export const getFormSyncErrors: ErrorSelector
export const getFormMeta: DataSelector
export const getFormAsyncErrors: ErrorSelector
export const getFormSyncWarnings: ErrorSelector
export const getFormSubmitErrors: ErrorSelector
export const getFormError: ErrorSelector
export const getFormNames: NamesSelector
export const isDirty: FormOrFieldsBooleanSelector
export const isPristine: FormOrFieldsBooleanSelector
export const isValid: BooleanSelector
export const isInvalid: BooleanSelector
export const isSubmitting: BooleanSelector
export const isAsyncValidating: BooleanSelector
export const hasSubmitSucceeded: BooleanSelector
export const hasSubmitFailed: BooleanSelector
interface CustomConfigProps<FormData = {}, P = {}, ErrorType = string> extends ConfigProps {
form: WalletFormType
}
// 🚨
// Make sure to keep this updated with @types/redux-form/lib/reduxForm
// Changing ConfigProps to CustomConfigProps to keep form name typesafety
/* eslint-disable */
export function reduxForm<FormData = {}, P = {}, ErrorType = string>(
config: CustomConfigProps<FormData, P, ErrorType>
): FormDecorator<FormData, P, Partial<CustomConfigProps<FormData, P, ErrorType>>, ErrorType>
export function reduxForm<FormData = {}, P = {}, ErrorType = string>(
config: Partial<CustomConfigProps<FormData, P, ErrorType>>
): FormDecorator<FormData, P, CustomConfigProps<FormData, P, ErrorType>, ErrorType>
export type WalletFormType = WalletFormType
/* eslint-enable */
}