-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaws-amplify-react-native.d.ts
220 lines (192 loc) · 6.11 KB
/
aws-amplify-react-native.d.ts
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
/* eslint-disable */
declare module 'aws-amplify-react-native' {
const Amplify: any;
export default Amplify;
// *** UI ***
interface iTheme {
container: {};
section: {};
sectionHeader: {};
sectionHeaderText: {};
sectionFooter: {};
sectionFooterLink: {};
navBar: {};
navButton: {};
cell: {};
errorRow: {};
errorRowText: {};
photo: {};
album: {};
button: {};
buttonDisabled: {};
buttonText: {};
formField: {};
input: {};
inputLabel: {};
phoneContainer: {};
phoneInput: {};
picker: {};
pickerItem: {};
}
export const AmplifyTheme: iTheme;
export const AmplifyMessageMapEntries: (String | RegExp)[][];
interface iUIProps {
theme?: iTheme;
}
interface iFormFieldProps extends iUIProps {
label?: string;
required?: boolean;
[propName: string]: any;
}
export const FormField: React.FC<iFormFieldProps>;
interface iPhoneFieldProps extends iUIProps {
label?: string;
required?: boolean;
defaultDialCode?: string;
onChangeText: (phone: string) => void;
[propName: string]: any;
}
export const PhoneField: React.ComponentClass<iPhoneFieldProps>;
// DON'T THINK THIS IS ACTUALLY USED
export const SectionFooter: React.FC<iUIProps>;
interface iLinkCellProps extends iUIProps {
onPress: () => void;
}
export const LinkCell: React.FC<iLinkCellProps>;
export const Header: React.FC<iUIProps>;
export const ErrorRow: React.FC<iUIProps>;
interface iAmplifyButtonProps extends iUIProps {
disabled?: boolean;
style?: any;
text?: string;
[propName: string]: any;
}
export const AmplifyButton: React.FC<iAmplifyButtonProps>;
// *** AUTH ***
interface iSignUpFields {
label: string;
key: string;
required: boolean;
displayOrder: number;
type: string;
custom?: boolean;
}
interface iSignUpConfig {
header?: string;
hiddenDefaults?: string[];
hideAllDefaults?: boolean;
defaultCountryCode?: string;
signUpFields?: iSignUpFields[];
}
interface iAuthConfig {
includeGreetings?: boolean;
usernameAttributes?: string;
authenticatorComponents?: typeof AuthPiece[];
signUpConfig?: iSignUpConfig;
}
interface iWACompProps {
authState: string;
authData: any;
onStateChange: (state: string, data: any) => void;
}
interface iWithAuthenticatorProps {
authState?: string;
onStateChange?: (state: string, data: any) => void;
[propName: string]: any;
}
export function withAuthenticator(
Comp: React.ComponentType<iWACompProps>,
includeGreetings?: boolean | iAuthConfig,
authenticatorComponents?: typeof AuthPiece[],
federated?: any,
theme?: iTheme,
signUpConfig?: iSignUpConfig,
): React.ComponentClass<iWithAuthenticatorProps>;
interface iAuthenticatorProps {
authState?: string;
authData?: any;
onStateChange?: (state: string, data: any) => void;
theme?: iTheme;
errorMessage?: (message: string) => string;
hideDefault?: boolean;
signUpConfig?: iSignUpConfig;
usernameAttributes?: string;
}
export const Authenticator: React.ComponentClass<iAuthenticatorProps>;
interface iAuthPieceProps {
usernameAttributes?: string;
onStateChange?: (state: string, data: any) => void;
errorMessage?: (message: string) => string;
messageMap?: (message: string) => string;
authState?: string;
track?: () => void;
theme?: iTheme;
authData?: any;
}
export const AuthPiece: React.ComponentClass<iAuthPieceProps>;
export const Loading: typeof AuthPiece;
export const SignIn: typeof AuthPiece;
export const ConfirmSignIn: typeof AuthPiece;
interface iSignUpProps extends iAuthPieceProps {
signUpConfig?: iSignUpConfig;
}
export const SignUp: React.ComponentClass<iSignUpProps>;
export const ConfirmSignUp: typeof AuthPiece;
export const ForgotPassword: typeof AuthPiece;
export const RequireNewPassword: typeof AuthPiece;
export const VerifyContact: typeof AuthPiece;
interface iGreetingsProps extends iAuthPieceProps {
signedInMessage?: string;
signedOutMessage?: string;
}
export const Greetings: React.ComponentClass<iGreetingsProps>;
interface iWithOAuthProps {
oauth_config?: any;
[propName: string]: any;
}
interface iWOACompProps {
loading: boolean;
oAuthUser: any;
oAuthError: any;
hostedUISignIn: () => void;
facebookSignIn: () => void;
amazonSignIn: () => void;
googleSignIn: () => void;
customProviderSignIn: (provider: string) => void;
signOut: () => void;
}
export function withOAuth(
Comp: React.ComponentType<iWOACompProps>,
): React.ComponentClass<iWithOAuthProps>;
// *** API ***
interface iGraphQLOperation {
query: any;
variables: {};
}
interface iConnectProps {
query?: iGraphQLOperation;
mutation?: iGraphQLOperation;
subscription?: iGraphQLOperation;
onSubscriptionMsg?: (prevData: any, data: any) => any;
}
export const Connect: React.ComponentClass<iConnectProps>;
// *** STORAGE ***
interface iS3ImageProps extends iUIProps {
imgKey?: string;
level?: string;
body?: any;
contentType?: string;
style?: string;
resizeMode?: string;
}
export const S3Image: React.ComponentClass<iS3ImageProps>;
interface iS3AlbumProps extends iUIProps {
path?: string;
level?: string;
filter?: (data: any) => boolean;
[propName: string]: any;
}
export const S3Album: React.ComponentClass<iS3AlbumProps>;
// *** INTERACTIONS ***
export const ChatBot: React.ComponentClass<any>;
}