This repository was archived by the owner on Nov 28, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtypes.ts
More file actions
76 lines (67 loc) · 1.6 KB
/
types.ts
File metadata and controls
76 lines (67 loc) · 1.6 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
export interface PaginatedResponse<T> {
results: T[]
next?: string
previous?: string
}
export interface TripType {
id: string
start: string
end: string
city: CityType
user: UserType
notes?: string // `notes` is not present when viewing others' trips
}
export interface CountryType {
code: string
code3: string
name: string
currency: string
tld: string
capital: string
}
export interface RegionType {
// First-level administrative organization; e.g. states (US) or provinces (CA).
code: string
name: string
}
export interface CityType {
id: number // Only `id` that is numberic
name: string
country: CountryType
region?: RegionType
location: number[]
kind: string
timezone: string
}
export interface WorkHoursType {
start?: string
end?: string
}
export interface UserType {
id: string
first_name: string
email: string
avatar_url: string
home_city?: CityType
trips?: Omit<TripType, 'user' | 'notes'>[]
work_hours: WorkHoursType
}
// Where the user is located at a given point in time
export interface UserAtDateType extends UserType {
current_location: CityType
travelling: boolean
}
export interface UserTravelingType {
user: Omit<UserType, 'trips'>
trip: Omit<TripType, 'user'>
}
export interface MatchType {
id: string
source_user: Omit<UserType, 'trips'>
target_user: Omit<UserType, 'trips'>
distance: number
overlap_start: string
overlap_end: string
source_trip?: Omit<TripType, 'user' | 'notes'>
target_trip?: Omit<TripType, 'user' | 'notes'>
}