-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypings.d.ts
361 lines (323 loc) · 7.12 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
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
type SafeNumber = number | `${number}`;
// Define the type based on the Zod schema
type Base = {
_createdAt: string;
_id: string;
_rev: string;
_type: string;
_updatedAt: string;
};
interface DrType extends Base {
image: Image;
name: string;
}
interface ImageUploadResponse {
_type: string; // The type of the document (e.g., 'gallery')
image: {
// The ID of the created document
_type: string; // The type of the image field (e.g., 'image')
asset: {
_type: string; // The type of the asset reference (e.g., 'reference')
_ref: string; // The reference to the asset ID
};
caption: string;
height: number;
};
taken_by: {
_type: string; // The type of the taken_by field (e.g., 'reference')
_ref: string; // The reference to the drone ID
};
// Additional properties if any
}
interface Image {
_type: "image";
asset: Reference;
caption: string;
height: number;
nickname: string;
email: string;
}
interface Post extends Base {
author: Author;
body: Block[];
categories: Category[];
mainImage: Image;
slug: Slug;
title: string;
description: string;
relatedDrones: DroneThumbnail[];
}
interface Author extends Base {
bio: Block[];
image: Image;
name: string;
slug: Slug;
}
interface Reference {
_ref: "string";
_type: "reference";
}
interface Slug {
_type: "slug";
current: string;
}
interface Block {
_key: string;
_type: "block";
children: Span[];
markDefs: any[];
style: "normal" | "h1" | "h2" | "h3" | "h4" | "blockquote";
split: (separator: string | RegExp) => string[];
}
interface Span {
_key: string;
_type: "span";
marks: string[];
text: string;
}
interface Category extends Base {
description: string;
title: string;
}
interface MainImage {
_type: "image";
asset: Reference;
}
interface Title {
_type: "string";
current: string;
}
interface Drone extends Base {
_id: string;
name: string;
aircraft: Aircraft;
flight_specs: FlightSpecifications;
camera: Camera;
gimbal: Gimbal;
sensing: Sensing;
video_transmission: VideoTransmission;
battery: Battery;
remote_controller: RemoteController;
accessories: Accessories;
drone_image: DroneImage;
drone_type: DrType[];
drone_types_list: string[];
compatibility: Compatibility;
images: Image[];
relatedArticles: Post[];
// You can uncomment and add other fields as needed
}
interface Compatibility {
mobile_devices: string[];
supported_oss: string[];
vr_headsets: VRHeadset[];
}
interface Aircraft {
id: number;
name: string;
price: number;
description: string;
buy_link: string;
manufacturer: string;
takeoff_weight: number;
length_folded: number;
width_folded: number;
height_folded: number;
// Add more fields for folded dimensions and other aircraft-related information
}
interface FlightSpecifications {
max_ascent_speed: number;
max_descent_speed: number;
max_horizontal_speed: number;
// Add more fields for flight specifications
}
interface Camera {
color_mode: string;
digital_zoom: string;
iso_range: string;
// Add more fields for camera specifications
}
interface Gimbal {
mechanical_range: string;
controllable_range: string;
// Add more fields for gimbal specifications
}
interface Sensing {
sensing_type: string;
forward_measurement_range: string;
forward_detection_range: string;
// Add more fields for sensing specifications
}
interface VideoTransmission {
video_transmission_system: string;
live_view_quality: string;
// Add more fields for video transmission specifications
}
interface Battery {
capacity: string;
weight: string;
nominal_voltage: string;
// Add more fields for battery specifications
}
interface RemoteController {
max_operating_time: string;
max_supported_mobile_device_size: string;
// Add more fields for remote controller specifications
}
interface VRHeadset {
brand: string;
versions: string[];
}
interface Accessories {
extra_batteries: boolean;
propeller_guards: boolean;
additional_propellers: boolean;
carrying_case: boolean;
charger_and_hub: boolean;
remote_controller_accessories: boolean;
camera_filters: boolean;
landing_pad: boolean;
gps_tracker: boolean;
fpv_goggles: boolean;
sunshade: boolean;
spare_memory_cards: boolean;
drone_skins_decals: boolean;
drone_lights: boolean;
range_extenders: boolean;
gimbal_stabilizers: boolean;
wind_gauges: boolean;
tool_kit: boolean;
}
interface DroneCompare {
attribute: string;
drone0: string;
drone1: string;
isHeader: boolean;
}
interface DroneThumbnail extends Base {
name: string;
drone_image: DroneImage;
description: string;
}
interface Photo extends Base {
taken_by: Drone;
image: Image;
approved: boolean;
media_url: string;
}
interface Coordinates {
x: number;
y: number;
title: string;
details: string;
type: string;
}
interface DroneImage {
image: {
asset: {
_ref: string;
};
height: number;
width: number;
};
coordinates: Coordinates[];
}
// types.ts
interface EventLocation {
name: string;
address: string;
coordinates: {
latitude: number;
longitude: number;
};
}
interface EventDateTime {
start: Date; // Assuming date strings in ISO format
end: Date;
}
interface EventOrganizer {
name: string;
contactEmail: string;
}
interface AdditionalDetails {
eventCapacity?: number;
registrationDeadline?: string; // Assuming date string in ISO format
entryFee?: number;
prizes?: string[];
}
interface EventData {
_id: string;
title: string;
description: string;
location: EventLocation;
dateTime: EventDateTime;
organizer: EventOrganizer;
category: string[];
isPrivateEvent: string;
eventSiteLink: string;
eventImage: string;
additionalDetails: AdditionalDetails;
}
interface EventRegistration {
eventId: string;
userId: string;
registrationDate: string; // Assuming date string in ISO format
}
interface EventAttendee {
eventId: string;
userId: string;
}
interface DroneSearchState {
selectedReviews: string[];
selectedPriceRanges: string[];
selectedRatings: string[];
selectedWeightClasses: string[];
selectedCompatibility: string[];
selectedUsage: string[];
selectedFlightTime: string[];
selectedEaseOfUse: string[];
selectedBatteryType: string[];
selectedBatteryLife: string[];
selectedChargingTime: string[];
selectedCameraQuality: string[];
selectedPortability: string[];
[key: string]: any;
}
const AssetType = {
Home = "Home",
Airport = "Airport",
Highway = "Highway",
Park = "Park",
Store = "Store",
School = "School",
Start = "Start",
End = "End",
TrainTrack = "TrainTrack",
Stadium = "Stadium",
Hospital = "Hospital",
FireStation = "FireStation",
PoliceStation = "PoliceStation",
} as const;
type EnumValues<T> = T[keyof T];
type AssetTypes = EnumValues<typeof AssetType>;
type AssetTool = {
label: string;
type: AssetTypes;
traversable: boolean;
rotatable: boolean;
height: number;
width: number;
icon: React.ReactNode;
maxCount: number;
weight: number;
color: string;
};
type Asset = {
seq: string;
type: AssetTypes;
x: number;
y: number;
label: string;
height: number;
width: number;
};