-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom-types.d.ts
152 lines (135 loc) · 2.79 KB
/
custom-types.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
152
import { Dispatch, SetStateAction } from "react";
import { CSSProperties } from "react";
export interface CSSPropertiesWithVars extends CSSProperties {
"--section-rotate"?: string;
}
export interface Tour {
name: string;
difficulty: string;
duration: number;
summary: string;
startLocation: GeoPoint;
startDates: Array<string>;
locations: Array<GeoPoint>;
maxGroupSize: number;
price: number;
ratingsAverage: number;
ratingsQuantity: number;
imageCover: string;
images: Array<string>;
id: string;
guides: Array<Guide>;
description: string;
}
export interface GeoPoint {
type: string;
description: string;
coordinates: Array<number>;
address?: string;
id: string;
_id: string;
}
export interface Guide {
name: string;
email: string;
id: string;
}
export interface Review {
review: string;
rating: number;
createdAt: string;
tour: string;
user: string;
}
export interface User {
name: string;
email: string;
photo: string;
role: string;
}
// Login status provider
export interface LoginStatus {
name: string;
loginStatus: boolean;
email: string;
photo: string;
}
export interface LoginStatusContext {
loginStatus: LoginStatus;
setLoginStatus: Dispatch<SetStateAction<LoginStatus>>;
}
// Error message component
export interface Notification {
reveal: boolean;
message: string;
category: string;
}
export interface NotificationContext {
notification: Notification;
setNotificationStatus: Dispatch<SetStateAction<Notification>>;
}
export interface SearchParams {
field: string;
value: string | number;
sort: string;
date?: string | Date;
submit: boolean;
budget?: string;
}
export interface SearchContext {
searchParams: SearchParams;
setSearchParams: Dispatch<SetStateAction<SearchParams>>;
}
export interface CheckoutInfo {
name: string;
description: string;
images: Array<string>;
price: number;
}
export interface BookingInfo {
_id: string;
user: string;
tour: {
name: string;
summary: string;
price: number;
duration: number;
startLocation: { description: string };
difficulty: string;
startDates: Array<string>;
guides: Array<{ email: string; name: string; id: string }>;
id: string;
imageCover: string;
};
review: {
id: string;
rating: number;
};
createdAt: Date;
paymentStatus: "pending" | "paid" | "rejected";
order: string;
url: string;
invoice: string;
startDate: string;
}
export interface ReviewPopulated {
_id: string;
user: string;
tour: {
name: string;
imageCover: string;
};
order: string;
createdAt: string;
review: string;
title: string;
rating: number;
visible: boolean;
}
export interface FootbarLink {
label: string;
href: string;
}
export interface FootbarNavsection {
[key: string]: FootbarLink[];
}