-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.tsx
180 lines (159 loc) · 4.05 KB
/
types.tsx
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
/**
* Learn more about using TypeScript with React Navigation:
* https://reactnavigation.org/docs/typescript/
*/
import { BottomTabScreenProps } from '@react-navigation/bottom-tabs';
import { CompositeScreenProps, NavigatorScreenParams } from '@react-navigation/native';
import { NativeStackScreenProps } from '@react-navigation/native-stack';
import { LatLng } from 'react-native-maps';
declare global {
namespace ReactNavigation {
interface RootParamList extends RootStackParamList {}
}
}
export type RootStackParamList = {
Root: NavigatorScreenParams<RootTabParamList> | undefined;
Announcements: undefined;
Badges: undefined;
CatForm: undefined;
Facebook: undefined;
BugReporting: undefined;
CreateAnnouncement: { announcement: Announcement};
UserRank: undefined;
Rewards: undefined;
NotFound: undefined;
Cat: { cat: Cat };
User: { user: User };
FeedingStations: { feedingStation: FeedingStations };
ReportedPosts: undefined;
DownvotedPosts: undefined;
ModeratorRequests: undefined;
ScoringInfo: undefined;
};
export type RootStackScreenProps<Screen extends keyof RootStackParamList> = NativeStackScreenProps<
RootStackParamList,
Screen
>;
export type RootTabParamList = {
Home: undefined;
Resources: undefined;
Leaderboard: undefined;
Account: undefined;
Facebook: undefined;
};
export type RootTabScreenProps<Screen extends keyof RootTabParamList> = CompositeScreenProps<
BottomTabScreenProps<RootTabParamList, Screen>,
NativeStackScreenProps<RootStackParamList>
>;
export type Badge = {
modBadge: boolean;
firstCommentBadge: boolean;
catRescuerBadge: boolean;
feedingStationAttendeeBadge: boolean;
firstCatPostedBadge: boolean;
hundredPointsBadge: boolean;
thousandPointsBadge: boolean;
};
export type Report = {
reportID: string;
catID: string;
accountID: string;
reason: string;
};
export type Application = {
applicationID: string;
accountID: string;
reason1: string;
reason2: string;
reason3: string;
votes: Number;
date: Date,
time: Date,
};
export type ReportList = {
[key: string]: Report;
};
export type Comment = {
commentID: string;
content: string;
accountID: string;
reports: ReportList;
votes: number;
type: CommentType;
};
export enum CommentType {
Comment = 'Just a comment!',
FoodWater = 'Gave this cat food/water',
Microchip = 'Took cat to get scanned for a microchip',
Neuter = 'Trap/neuter/returned this cat',
Shelter = 'Took this cat to a no-kill shelter',
Foster = 'Fostering this cat',
Return = 'Returned this cat to it\'s owner',
Station = 'Completed feeding station request',
}
export type CommentList = {
[key: string]: Comment;
};
export type Announcement = {
announcementID: string;
time: Date;
content: string;
subject: string;
accountID: string;
};
export type AnnouncementFeeder = {
announcementID: string;
time: Date;
content: string;
subject: string;
accountID: string;
};
export type Account = {
accountID: string;
modStatus: boolean;
banned: boolean;
points: number;
Application: {applicationID: {accountID: string, applicationID: string, name: String, reason1: String, reason2: String, reason3: String, votes: Number, date: Date, time: Date} }
};
export type FeedingStation = {
StationID: string;
Media: string;
Comments: CommentList;
};
export type Cat = {
catID: string;
media: string;
name: string;
color: string;
eyeColor: string;
kitten: boolean;
healthy: boolean;
friendly: boolean;
comments: string;
location: LatLng;
date: Date;
time: Date;
votes: number;
accountID: string;
commentList: CommentList;
reports: ReportList;
};
export type FeedingStations = {
title: String;
info: String;
latitude: any;
longitude: any;
street: String;
commentList: CommentList;
};
export type User = {
displayName: string | null | undefined;
accountID: string | undefined;
email: string | null | undefined;
photo: string | null | undefined;
badges: true | false;
points: 0;
posts: 0;
modStatus: 1 | 2 | 3; // user, feeder, moderator
banStatus: true | false;
};