-
Notifications
You must be signed in to change notification settings - Fork 0
/
typings.d.ts
134 lines (124 loc) · 2.78 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
import { GeoPoint, Timestamp } from "firebase/firestore";
import { OpeningHoursForbiddenType, OpeningHoursType } from "./utils/constants";
export type GPS = {
latitude: number;
longitude: number;
};
export type Session = {
authenticated?: Boolean;
user?: User;
};
export type User =
| {
name?: string | undefined | null;
email?: string | undefined | null;
image?: string | undefined | null;
id?: string | undefined | null;
visits?: number | undefined | null;
changes?: number | undefined | null;
lastVisited?: { tower: Tower; date: string } | undefined | null;
}
| undefined;
export type UserFromDB = {
email: string;
name: string;
emailVerified: boolean | null;
image: string;
};
export type Filter = {
searchTerm: string;
province: string;
county: string;
};
export type TowerFirebase = {
access?: string;
country: string;
county?: string;
created: Timestamp;
elevation: number;
gps: GeoPoint;
gpshash?: string;
height: 55;
history?: string;
id: string;
locationText?: string;
mainPhotoUrl: string;
material: [string];
modified: Timestamp;
name: string;
nameID: string;
opened: Timestamp;
openingHours: OpeningHours;
price?: number; //todo
province?: string;
stairs: number;
type: string;
urls?: [string];
viewText?: string;
visits?: number; //todo
rating?: {
avg: number;
count: number;
};
};
export type Tower = {
isVisited?: boolean;
isFavourite?: boolean;
access?: string;
country: string;
county?: string;
created: string;
elevation: number;
gps: GeoPoint | GPS;
gpshash?: string;
height: number;
history?: string;
id: string;
locationText?: string;
mainPhotoUrl: string;
material: [string];
modified: string;
name: string;
nameID: string;
opened: string;
openingHours: OpeningHours;
price?: number; //todo
province?: string;
stairs: number;
type: string;
urls?: [string];
viewText?: string;
visits?: number; //todo
rating?: {
avg: number;
count: number;
};
};
export type Rating = {
tower_id: string;
user_id: string;
rating: number;
created: string;
text: string;
user?: User;
};
export type Visit = {
tower_id: string;
user_id: string;
date: string;
text: string;
created: string;
urls?: string[];
};
export type OpeningHours = {
type: OpeningHoursType;
months?: number[];
days?: number[];
forbidden_type?: OpeningHoursForbiddenType;
time_start?: number;
time_end?: number;
lunch_break?: boolean;
lunch_start?: number;
lunch_end?: number;
note?: string;
};