-
Notifications
You must be signed in to change notification settings - Fork 0
/
typings.d.ts
151 lines (120 loc) · 3.14 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/// Types for React Navigation ///
type RootStackParamList = {
Home: undefined,
Chat: undefined,
Login: undifined,
ModalScreen: undifined,
Match: { loggedinProfile: FireBaseData, userSwiped: FireBaseData },
Message: { matcheDetial: FireBaseMatchDataRetrieve}
}
type ChatScreenNavigationProp = NavigationProp<RootStackParamList, "Chat">
type HomeScreenNavigationProp = NavigationProp<RootStackParamList, "Home">
type ModalScreenNavigationProp = NavigationProp<RootStackParamList, "ModalScreen">
type MatchScreenNavigationProp = NavigationProp<RootStackParamList, "Match">;
type MatchScreenRouteProp = RouteProp<RootStackParamList, "Match">;
type MessageScreenNavigationProp = NavigationProp<RootStackParamList, "Message">
type MessageScreenRouteProp = RouteProp<RootStackParamList, "Message">
// types for Provider:
type AuthProviderProp = {
children: ReactNode;
}
/// Dummy Data for Home Screen ///
type DummyData = {
firstName: string,
lastName: string,
job: string,
photoURL: string,
age: number,
id: number,
}
/// type for Firebase Database ///
type FireBaseData = {
age: string,
displayName: string,
gender: string,
id: string,
job: string,
photoURL: string,
timestamp?: {seconds: number, nonoseconds: number}
}
/// user data from the ModalScreen.tsx ///
type UserData = {
image: string,
job: string,
age: string,
gender: string,
}
type SetDocData = {
id: string,
displayName: string,
photoURL: string,
job: string,
age: string,
gender: string,
timestamp: FieldValue,
}
///////////////////////
// intfaces for Project
///////////////////////
/// Google interFaces ///
interface GoogleConfig {
responseType?: string,
expoClientId: string,
iosClientId: string,
androidClientId: string,
scopes: string[],
permissions: string[],
}
interface FirebaseConfig {
apiKey1: string,
authDomain1: sting,
projectId1: string,
storageBucket1: string,
messagingSenderId1: string,
appId1: string,
}
interface FirebaseConfigure {
apiKey: string,
authDomain: sting,
projectId: string,
storageBucket: string,
messagingSenderId: string,
appId: string,
}
/// types ///
type Memoed = {
user: firebase.default.User | null;
loading: boolean;
error: string | null;
logOut: () => void;
signInWithGoogle: () => Promise<void>;
}
/////////////////////////////////////////////////////////////////
/// 2 types required due to FlatList not liking types with ? ///
type MessageFBData = {
timestamp?: FieldValue,
userId: string,
displayName: string,
photoURL: string,
message: string,
id: string,
}
type InputMessageFBData = {
timestamp: FieldValue,
userId: string,
displayName: string,
photoURL: string,
message: string,
}
//////////////////////////////////
type FireBaseMatchData = {
users: Record<string, FireBaseData>,
userMatched: string[],
timestamp?: FieldValue
}
type FireBaseMatchDataRetrieve = {
id: string,
users: Record<string, FireBaseData>,
userMatched: string[],
timestamp?: {seconds: number, nonoseconds: number}
}