-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
255 lines (229 loc) · 6.33 KB
/
types.ts
File metadata and controls
255 lines (229 loc) · 6.33 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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
/**
* Learn more about using TypeScript with React Navigation:
* https://reactnavigation.org/docs/typescript/
*/
import type {
CompositeScreenProps,
NavigatorScreenParams,
} from '@react-navigation/native';
import type {StackScreenProps} from '@react-navigation/stack';
import type {BottomTabScreenProps} from '@react-navigation/bottom-tabs';
import type {RouteProp} from '@react-navigation/native';
export type NO_PARAMS = undefined;
export type RootStackParamList = {
Root: NO_PARAMS;
SelectLocation: NO_PARAMS;
AllowNotifications: NO_PARAMS;
TabNavigation: NO_PARAMS;
};
export type AuthStackParamList = {
Main: NO_PARAMS;
SignUpSocial: NO_PARAMS;
Login: NO_PARAMS;
ForgotPassword: NO_PARAMS;
Register: NO_PARAMS;
Registered: NO_PARAMS;
SelectLocation: NO_PARAMS;
};
export type AuthStackScreenProps<T extends keyof AuthStackParamList> =
StackScreenProps<AuthStackParamList, T>;
export type BottomTabParamList = {
ShopTab: NO_PARAMS;
ExploreTab: {
screen: string | undefined;
//group_id: string | undefined;
};
CartTab: NO_PARAMS;
FavoriteTab: NO_PARAMS;
AccountTab: NO_PARAMS;
};
export type InitBottomTabParamList = {
InitShopTab: NO_PARAMS;
InitExploreTab: {
screen: string | undefined;
//group_id: string | undefined;
};
InitCartTab: NO_PARAMS;
InitFavoriteTab: NO_PARAMS;
InitAccountTab: NO_PARAMS;
};
//+ Account Tab
export type AccountSettingsParamList = {
AccountScreen: NO_PARAMS;
RemoveUserDataScreen: NO_PARAMS;
OrdersScreen: NO_PARAMS;
AboutScreen: NO_PARAMS;
ConnectionErr: NO_PARAMS;
MessagesScreen: NO_PARAMS;
ChatScreen: NO_PARAMS;
UserDetailsScreen: NO_PARAMS;
};
export type AccountSettingsStackScreenProps<
T extends keyof AccountSettingsParamList,
> = StackScreenProps<AccountSettingsParamList, T>;
export type AccountTabScreenProps<T extends keyof BottomTabParamList> =
CompositeScreenProps<
BottomTabScreenProps<BottomTabParamList, T>,
AccountSettingsStackScreenProps<keyof AccountSettingsParamList>
>;
export type AccountScreenRouteProp = RouteProp<
AccountSettingsParamList,
'AccountScreen'
>;
export type MessagesScreenRouteProp = RouteProp<
AccountSettingsParamList,
'MessagesScreen'
>;
export type OrdersScreenRouteProp = RouteProp<
AccountSettingsParamList,
'OrdersScreen'
>;
export type RemoveUserDataScreenRouteProp = RouteProp<
AccountSettingsParamList,
'RemoveUserDataScreen'
>;
export type AboutScreenRouteProp = RouteProp<
AccountSettingsParamList,
'AboutScreen'
>;
export type ChatScreenRouteProp = RouteProp<
AccountSettingsParamList,
'ChatScreen'
>;
export type UserDetailsScreenRouteProp = RouteProp<
AccountSettingsParamList,
'UserDetailsScreen'
>;
//- Account Tab
//+ Shop Tab
export type ShopParamList = {
ShopListsScreen: NO_PARAMS;
GoodsScreen: {
blockName: string;
blockTitle: string;
groupGoodsFiltered: never[];
};
GoodsDetailsScreen: {
good_id: string | undefined;
};
SearchGoodsScreen: {
searchText: string | undefined;
};
ConnectionErr: NO_PARAMS;
};
export type ShopStackScreenProps<T extends keyof ShopParamList> =
StackScreenProps<ShopParamList, T>;
export type ShopTabScreenProps<T extends keyof BottomTabParamList> =
CompositeScreenProps<
BottomTabScreenProps<BottomTabParamList, T>,
ShopStackScreenProps<keyof ShopParamList>
>;
export type ShopGoodsScreenRouteProp = RouteProp<ShopParamList, 'GoodsScreen'>;
export type ShopSearchGoodsScreenRouteProp = RouteProp<
ShopParamList,
'SearchGoodsScreen'
>;
export type ShopGoodsDetailsScreenRouteProp = RouteProp<
ShopParamList,
'GoodsDetailsScreen'
>;
//- Shop Tab
//+ Explore Tab
export type ExploreParamList = {
ExploreGroupsScreen: NO_PARAMS;
GoodsScreen: {
group_id: string | undefined;
};
GoodsDetailsScreen: {
good_id: string | undefined;
};
SearchGoodsScreen: {
searchText: string | undefined;
};
ConnectionErr: NO_PARAMS;
};
export type ExploreStackScreenProps<T extends keyof ExploreParamList> =
StackScreenProps<ExploreParamList, T>;
export type ExploreTabScreenProps<T extends keyof BottomTabParamList> =
CompositeScreenProps<
BottomTabScreenProps<BottomTabParamList, T>,
ExploreStackScreenProps<keyof ExploreParamList>
>;
export type ExploreGroupsScreenRouteProp = RouteProp<
ExploreParamList,
'ExploreGroupsScreen'
>;
export type ExploreGoodsScreenRouteProp = RouteProp<
ExploreParamList,
'GoodsScreen'
>;
export type ExploreSearchGoodsScreenRouteProp = RouteProp<
ShopParamList,
'SearchGoodsScreen'
>;
export type ExploreGoodsDetailsScreenRouteProp = RouteProp<
ExploreParamList,
'GoodsDetailsScreen'
>;
//- Explore Tab
//+ Cart Tab
export type CartParamList = {
CartScreen: NO_PARAMS;
CartListScreen: NO_PARAMS;
GoodsDetailsScreen: {
good_id: string | undefined;
};
CheckOutScreen: NO_PARAMS;
SuccessScreen: NO_PARAMS;
ConnectionErr: NO_PARAMS;
};
export type CartStackScreenProps<T extends keyof CartParamList> =
StackScreenProps<CartParamList, T>;
export type CartTabScreenProps<T extends keyof BottomTabParamList> =
CompositeScreenProps<
BottomTabScreenProps<BottomTabParamList, T>,
CartStackScreenProps<keyof CartParamList>
>;
export type CartListScreenRouteProp = RouteProp<
CartParamList,
'CartListScreen'
>;
export type CartGoodsDetailsScreenRouteProp = RouteProp<
CartParamList,
'GoodsDetailsScreen'
>;
export type CheckOutScreenRouteProp = RouteProp<
CartParamList,
'CheckOutScreen'
>;
export type SuccessScreenRouteProp = RouteProp<CartParamList, 'SuccessScreen'>;
//- Cart Tab
//+ Favorites Tab
export type FavoritesParamList = {
FavoritesScreen: NO_PARAMS;
FavoritesListScreen: NO_PARAMS;
GoodsDetailsScreen: {
good_id: string | undefined;
};
ConnectionErr: NO_PARAMS;
};
export type FavoritesStackScreenProps<T extends keyof FavoritesParamList> =
StackScreenProps<FavoritesParamList, T>;
export type FavoritesTabScreenProps<T extends keyof BottomTabParamList> =
CompositeScreenProps<
BottomTabScreenProps<BottomTabParamList, T>,
FavoritesStackScreenProps<keyof FavoritesParamList>
>;
export type FavoritesScreenRouteProp = RouteProp<
FavoritesParamList,
'FavoritesScreen'
>;
export type FavoritesListScreenRouteProp = RouteProp<
FavoritesParamList,
'FavoritesListScreen'
>;
export type FavoritesGoodsDetailsScreenRouteProp = RouteProp<
FavoritesParamList,
'GoodsDetailsScreen'
>;
//- Favorites Tab