-
Notifications
You must be signed in to change notification settings - Fork 0
/
typings.d.ts
130 lines (109 loc) · 2.63 KB
/
typings.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
// this it the types for our RootStack and Navigation
type RootStackParamList = {
Home: undefined;
Restaurant: undefined;
Basket: undefined;
OrderScreen: undefined;
Delivery: undefined;
};
type RestaurantScreenNavigationProp = NavigationProp<RootStackParamList, 'Restaurant'>
type RestaurantScreenRouteProp = RouteProp<RootStackParamList, 'Restaurant'>
type BasketScreenNavigationProp = NavigationProp<RootStackParamList, 'Basket'>
type OrderScreenNavigationProp = NavigationProp<RootStackParamList, "OrderScreen">
type DeliveryScreenNavigationProp = NavigationProp<RootStackParamList, 'Delivery'>
type HomeScreenNavigationProp = NavigationProp<RootStackParamList, 'Home'>
// this is for the Restraunt type
type Restraunt = {
id: string | number,
imgUrl: string | asset,
title: string,
rating: number | string,
genre: string,
address: string,
short_description: string,
dishes: string | dish[],
long: number | string,
lat: number | string,
name: string,
}
////////////////////////
/// API Call Types ///
//////////////////////
// all the types for dish and Dish type:
type asset = {
_ref: string,
_type: string
}
type dish = {
image: asset,
name: string,
price: number,
short_description: string,
_createdAt: string,
_id: string,
_rev: string,
_type: string,
_updatedAt: string,
}
type DishCheckOut = {
description: string,
id: string,
image: { asset: asset , _type?: string},
name: string,
price: number
}
type GroupedItems = Record<string, BasketDispatch[]>
// The type for restraunts:
type category = {
_createdAt: string,
_id: string,
_rev: string,
_type: string,
_updatedAt: string
image:{ _type: string, asset: asset}
name: string
}
type RestaurantResponse = {
address: string,
dishes: dish[],
image: asset,
lat: number,
long: number
name: string,
category: category,
rating: number,
short_description: string,
type: {_ref: string , _type: string },
_createdAt: string,
_id: string,
_rev: string,
_type: string,
_updatedAt: string,
}
// Featured type:
type Featured = {
name: string
restraunts: RestaurantResponse[],
_createdAt: string,
_id: string,
_rev: string,
_type: string,
_updatedAt: string,
}
/////////////////////////
/// Redux Types ///
///////////////////////
type BasketDispatch = {
id: string,
name: string,
description: string,
price: number,
image: asset,
}
type BasketDispatchAdd = {
id: string,
name: string,
description: string,
price: number,
image: asset,
}