@superbright/indexeddb-orm 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,582 @@
1
+ import { z } from "zod";
2
+ export declare const QuestionEnumValues: readonly ["location", "budget", "size", "other"];
3
+ export type QuestionEnum = (typeof QuestionEnumValues)[number];
4
+ export type FilterEnum = string;
5
+ export declare const SortEnumValues: readonly ["cost_low_to_high", "cost_high_to_low", "newest", "relevance"];
6
+ export type SortEnum = (typeof SortEnumValues)[number];
7
+ declare const propertyContextSchema: z.ZodObject<{
8
+ property_id: z.ZodString;
9
+ property_slug: z.ZodString;
10
+ }, "strip", z.ZodTypeAny, {
11
+ property_id: string;
12
+ property_slug: string;
13
+ }, {
14
+ property_id: string;
15
+ property_slug: string;
16
+ }>;
17
+ declare const viewAllUnitsSchema: z.ZodObject<{
18
+ property_id: z.ZodString;
19
+ property_slug: z.ZodString;
20
+ } & {
21
+ property_name: z.ZodString;
22
+ } & {
23
+ total_units_available: z.ZodNumber;
24
+ results_unit_count: z.ZodNumber;
25
+ unit_count_date: z.ZodOptional<z.ZodString>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ property_id: string;
28
+ property_slug: string;
29
+ property_name: string;
30
+ total_units_available: number;
31
+ results_unit_count: number;
32
+ unit_count_date?: string | undefined;
33
+ }, {
34
+ property_id: string;
35
+ property_slug: string;
36
+ property_name: string;
37
+ total_units_available: number;
38
+ results_unit_count: number;
39
+ unit_count_date?: string | undefined;
40
+ }>;
41
+ declare const loadMoreSchema: z.ZodObject<{
42
+ property_id: z.ZodString;
43
+ property_slug: z.ZodString;
44
+ } & {
45
+ property_name: z.ZodString;
46
+ } & {
47
+ total_units_available: z.ZodNumber;
48
+ results_unit_count: z.ZodNumber;
49
+ unit_count_date: z.ZodOptional<z.ZodString>;
50
+ }, "strip", z.ZodTypeAny, {
51
+ property_id: string;
52
+ property_slug: string;
53
+ property_name: string;
54
+ total_units_available: number;
55
+ results_unit_count: number;
56
+ unit_count_date?: string | undefined;
57
+ }, {
58
+ property_id: string;
59
+ property_slug: string;
60
+ property_name: string;
61
+ total_units_available: number;
62
+ results_unit_count: number;
63
+ unit_count_date?: string | undefined;
64
+ }>;
65
+ declare const questionnaireEventSchema: z.ZodObject<{
66
+ property_id: z.ZodString;
67
+ property_slug: z.ZodString;
68
+ } & {
69
+ question_index: z.ZodNumber;
70
+ question_ENUM: z.ZodString;
71
+ }, "strip", z.ZodTypeAny, {
72
+ property_id: string;
73
+ property_slug: string;
74
+ question_index: number;
75
+ question_ENUM: string;
76
+ }, {
77
+ property_id: string;
78
+ property_slug: string;
79
+ question_index: number;
80
+ question_ENUM: string;
81
+ }>;
82
+ declare const continueQuestionnaireEventSchema: z.ZodObject<{
83
+ property_id: z.ZodString;
84
+ property_slug: z.ZodString;
85
+ } & {
86
+ question_index: z.ZodNumber;
87
+ question_ENUM: z.ZodString;
88
+ } & {
89
+ selected_answers_ENUM_Array: z.ZodEffects<z.ZodEffects<z.ZodAny, string[], any>, string[], any>;
90
+ }, "strip", z.ZodTypeAny, {
91
+ property_id: string;
92
+ property_slug: string;
93
+ question_index: number;
94
+ question_ENUM: string;
95
+ selected_answers_ENUM_Array: string[];
96
+ }, {
97
+ property_id: string;
98
+ property_slug: string;
99
+ question_index: number;
100
+ question_ENUM: string;
101
+ selected_answers_ENUM_Array?: any;
102
+ }>;
103
+ declare const unitEventSchema: z.ZodObject<{
104
+ property_id: z.ZodString;
105
+ property_slug: z.ZodString;
106
+ } & {
107
+ unit_id: z.ZodString;
108
+ unit_title: z.ZodString;
109
+ unit_slug: z.ZodString;
110
+ }, "strip", z.ZodTypeAny, {
111
+ property_id: string;
112
+ property_slug: string;
113
+ unit_id: string;
114
+ unit_title: string;
115
+ unit_slug: string;
116
+ }, {
117
+ property_id: string;
118
+ property_slug: string;
119
+ unit_id: string;
120
+ unit_title: string;
121
+ unit_slug: string;
122
+ }>;
123
+ declare const hoverUnitSchema: z.ZodObject<{
124
+ property_id: z.ZodString;
125
+ property_slug: z.ZodString;
126
+ } & {
127
+ property_name: z.ZodString;
128
+ } & {
129
+ unit_id: z.ZodString;
130
+ unit_title: z.ZodString;
131
+ unit_slug: z.ZodString;
132
+ } & {
133
+ favorited_unit: z.ZodBoolean;
134
+ }, "strip", z.ZodTypeAny, {
135
+ property_id: string;
136
+ property_slug: string;
137
+ property_name: string;
138
+ unit_id: string;
139
+ unit_title: string;
140
+ unit_slug: string;
141
+ favorited_unit: boolean;
142
+ }, {
143
+ property_id: string;
144
+ property_slug: string;
145
+ property_name: string;
146
+ unit_id: string;
147
+ unit_title: string;
148
+ unit_slug: string;
149
+ favorited_unit: boolean;
150
+ }>;
151
+ declare const filterOpenSchema: z.ZodObject<{
152
+ property_id: z.ZodString;
153
+ property_slug: z.ZodString;
154
+ } & {
155
+ property_name: z.ZodString;
156
+ } & {
157
+ filter_index: z.ZodNumber;
158
+ filter_label: z.ZodString;
159
+ selected_filters_ENUM: z.ZodEffects<z.ZodEffects<z.ZodAny, string[], any>, string[], any>;
160
+ filter_name: z.ZodOptional<z.ZodString>;
161
+ }, "strip", z.ZodTypeAny, {
162
+ property_id: string;
163
+ property_slug: string;
164
+ property_name: string;
165
+ filter_index: number;
166
+ filter_label: string;
167
+ selected_filters_ENUM: string[];
168
+ filter_name?: string | undefined;
169
+ }, {
170
+ property_id: string;
171
+ property_slug: string;
172
+ property_name: string;
173
+ filter_index: number;
174
+ filter_label: string;
175
+ selected_filters_ENUM?: any;
176
+ filter_name?: string | undefined;
177
+ }>;
178
+ declare const filterMutationSchema: z.ZodObject<{
179
+ property_id: z.ZodString;
180
+ property_slug: z.ZodString;
181
+ } & {
182
+ property_name: z.ZodString;
183
+ } & {
184
+ filter_index: z.ZodNumber;
185
+ filter_label: z.ZodString;
186
+ selected_filters_ENUM: z.ZodEffects<z.ZodEffects<z.ZodAny, string[], any>, string[], any>;
187
+ }, "strip", z.ZodTypeAny, {
188
+ property_id: string;
189
+ property_slug: string;
190
+ property_name: string;
191
+ filter_index: number;
192
+ filter_label: string;
193
+ selected_filters_ENUM: string[];
194
+ }, {
195
+ property_id: string;
196
+ property_slug: string;
197
+ property_name: string;
198
+ filter_index: number;
199
+ filter_label: string;
200
+ selected_filters_ENUM?: any;
201
+ }>;
202
+ declare const sortEventSchema: z.ZodObject<{
203
+ property_id: z.ZodString;
204
+ property_slug: z.ZodString;
205
+ } & {
206
+ sort_index: z.ZodNumber;
207
+ sort_ENUM: z.ZodEnum<["cost_low_to_high", "cost_high_to_low", "newest", "relevance"]>;
208
+ }, "strip", z.ZodTypeAny, {
209
+ property_id: string;
210
+ property_slug: string;
211
+ sort_index: number;
212
+ sort_ENUM: "relevance" | "newest" | "cost_low_to_high" | "cost_high_to_low";
213
+ }, {
214
+ property_id: string;
215
+ property_slug: string;
216
+ sort_index: number;
217
+ sort_ENUM: "relevance" | "newest" | "cost_low_to_high" | "cost_high_to_low";
218
+ }>;
219
+ declare const sortOpenSchema: z.ZodObject<{
220
+ property_id: z.ZodString;
221
+ property_slug: z.ZodString;
222
+ } & {
223
+ property_name: z.ZodString;
224
+ } & {
225
+ sort_index: z.ZodNumber;
226
+ sort_ENUM: z.ZodEnum<["cost_low_to_high", "cost_high_to_low", "newest", "relevance"]>;
227
+ results_unit_count: z.ZodNumber;
228
+ unit_count_date: z.ZodOptional<z.ZodString>;
229
+ }, "strip", z.ZodTypeAny, {
230
+ property_id: string;
231
+ property_slug: string;
232
+ property_name: string;
233
+ results_unit_count: number;
234
+ sort_index: number;
235
+ sort_ENUM: "relevance" | "newest" | "cost_low_to_high" | "cost_high_to_low";
236
+ unit_count_date?: string | undefined;
237
+ }, {
238
+ property_id: string;
239
+ property_slug: string;
240
+ property_name: string;
241
+ results_unit_count: number;
242
+ sort_index: number;
243
+ sort_ENUM: "relevance" | "newest" | "cost_low_to_high" | "cost_high_to_low";
244
+ unit_count_date?: string | undefined;
245
+ }>;
246
+ declare const questionnaireResultSchema: z.ZodObject<{
247
+ property_id: z.ZodString;
248
+ property_slug: z.ZodString;
249
+ } & {
250
+ full_questionnaire_schema_json: z.ZodOptional<z.ZodUnknown>;
251
+ unit_results: z.ZodOptional<z.ZodObject<{
252
+ type: z.ZodOptional<z.ZodString>;
253
+ total: z.ZodOptional<z.ZodNumber>;
254
+ units: z.ZodOptional<z.ZodArray<z.ZodObject<{
255
+ unit_id: z.ZodString;
256
+ unit_name: z.ZodOptional<z.ZodString>;
257
+ }, "strip", z.ZodTypeAny, {
258
+ unit_id: string;
259
+ unit_name?: string | undefined;
260
+ }, {
261
+ unit_id: string;
262
+ unit_name?: string | undefined;
263
+ }>, "many">>;
264
+ }, "strip", z.ZodTypeAny, {
265
+ type?: string | undefined;
266
+ units?: {
267
+ unit_id: string;
268
+ unit_name?: string | undefined;
269
+ }[] | undefined;
270
+ total?: number | undefined;
271
+ }, {
272
+ type?: string | undefined;
273
+ units?: {
274
+ unit_id: string;
275
+ unit_name?: string | undefined;
276
+ }[] | undefined;
277
+ total?: number | undefined;
278
+ }>>;
279
+ }, "strip", z.ZodTypeAny, {
280
+ property_id: string;
281
+ property_slug: string;
282
+ full_questionnaire_schema_json?: unknown;
283
+ unit_results?: {
284
+ type?: string | undefined;
285
+ units?: {
286
+ unit_id: string;
287
+ unit_name?: string | undefined;
288
+ }[] | undefined;
289
+ total?: number | undefined;
290
+ } | undefined;
291
+ }, {
292
+ property_id: string;
293
+ property_slug: string;
294
+ full_questionnaire_schema_json?: unknown;
295
+ unit_results?: {
296
+ type?: string | undefined;
297
+ units?: {
298
+ unit_id: string;
299
+ unit_name?: string | undefined;
300
+ }[] | undefined;
301
+ total?: number | undefined;
302
+ } | undefined;
303
+ }>;
304
+ declare const clickUnitSchema: z.ZodObject<{
305
+ property_id: z.ZodString;
306
+ property_slug: z.ZodString;
307
+ } & {
308
+ property_name: z.ZodString;
309
+ } & {
310
+ unit_id: z.ZodString;
311
+ unit_title: z.ZodString;
312
+ unit_slug: z.ZodString;
313
+ } & {
314
+ favorited_unit: z.ZodBoolean;
315
+ }, "strip", z.ZodTypeAny, {
316
+ property_id: string;
317
+ property_slug: string;
318
+ property_name: string;
319
+ unit_id: string;
320
+ unit_title: string;
321
+ unit_slug: string;
322
+ favorited_unit: boolean;
323
+ }, {
324
+ property_id: string;
325
+ property_slug: string;
326
+ property_name: string;
327
+ unit_id: string;
328
+ unit_title: string;
329
+ unit_slug: string;
330
+ favorited_unit: boolean;
331
+ }>;
332
+ declare const clickUnitFavoritesSchema: z.ZodObject<{
333
+ property_id: z.ZodString;
334
+ property_slug: z.ZodString;
335
+ } & {
336
+ property_name: z.ZodString;
337
+ } & {
338
+ unit_id: z.ZodString;
339
+ unit_title: z.ZodString;
340
+ unit_slug: z.ZodString;
341
+ } & {
342
+ favorited_unit: z.ZodBoolean;
343
+ }, "strip", z.ZodTypeAny, {
344
+ property_id: string;
345
+ property_slug: string;
346
+ property_name: string;
347
+ unit_id: string;
348
+ unit_title: string;
349
+ unit_slug: string;
350
+ favorited_unit: boolean;
351
+ }, {
352
+ property_id: string;
353
+ property_slug: string;
354
+ property_name: string;
355
+ unit_id: string;
356
+ unit_title: string;
357
+ unit_slug: string;
358
+ favorited_unit: boolean;
359
+ }>;
360
+ export type BaseEvent = z.infer<typeof propertyContextSchema>;
361
+ export type ViewAllUnitsEvent = z.infer<typeof viewAllUnitsSchema>;
362
+ export type LoadMoreEvent = z.infer<typeof loadMoreSchema>;
363
+ export type QuestionnaireEvent = z.infer<typeof questionnaireEventSchema>;
364
+ export type ContinueQuestionnaireEvent = z.infer<typeof continueQuestionnaireEventSchema>;
365
+ export type ClickUnitEvent = z.infer<typeof clickUnitSchema>;
366
+ export type UnitEvent = z.infer<typeof unitEventSchema>;
367
+ export type HoverUnitEvent = z.infer<typeof hoverUnitSchema>;
368
+ export type FilterEvent = z.infer<typeof filterMutationSchema>;
369
+ export type FilterOpenEvent = z.infer<typeof filterOpenSchema>;
370
+ export type SortEvent = z.infer<typeof sortEventSchema>;
371
+ export type SortOpenEvent = z.infer<typeof sortOpenSchema>;
372
+ export type QuestionnaireResultEvent = z.infer<typeof questionnaireResultSchema>;
373
+ export type ClickUnitFavoritesEvent = z.infer<typeof clickUnitFavoritesSchema>;
374
+ export type TrackingEventWithUnits = FilterEvent & {
375
+ trackingEvent: (payload: FilterEvent) => void;
376
+ [metadata: string]: unknown;
377
+ };
378
+ export type TrackEventFn = (eventName: string, data?: Record<string, any>) => void;
379
+ export declare function useTrackEvent(): (eventName: string, data?: Record<string, any>) => void;
380
+ export declare function buildTrackingEvents(trackEvent: TrackEventFn): {
381
+ trackViewAllUnits: (payload: z.input<typeof viewAllUnitsSchema>) => void;
382
+ trackQuestionnaireSkip: (payload: {
383
+ property_id: string;
384
+ property_slug: string;
385
+ question_index: number;
386
+ question_ENUM: string;
387
+ }) => void;
388
+ trackQuestionnaireContinue: (payload: {
389
+ property_id: string;
390
+ property_slug: string;
391
+ question_index: number;
392
+ question_ENUM: string;
393
+ selected_answers_ENUM_Array?: any;
394
+ }) => void;
395
+ trackQuestionnaireBack: (payload: {
396
+ property_id: string;
397
+ property_slug: string;
398
+ question_index: number;
399
+ question_ENUM: string;
400
+ }) => void;
401
+ trackClickUnit: (payload: {
402
+ property_id: string;
403
+ property_slug: string;
404
+ property_name: string;
405
+ unit_id: string;
406
+ unit_title: string;
407
+ unit_slug: string;
408
+ favorited_unit: boolean;
409
+ }) => void;
410
+ trackHoverUnit: (payload: {
411
+ property_id: string;
412
+ property_slug: string;
413
+ property_name: string;
414
+ unit_id: string;
415
+ unit_title: string;
416
+ unit_slug: string;
417
+ favorited_unit: boolean;
418
+ }) => void;
419
+ trackLoadMore: (payload: z.input<typeof loadMoreSchema>) => void;
420
+ trackOpenFilters: (payload: {
421
+ property_id: string;
422
+ property_slug: string;
423
+ property_name: string;
424
+ filter_index: number;
425
+ filter_label: string;
426
+ selected_filters_ENUM?: any;
427
+ filter_name?: string | undefined;
428
+ }) => void;
429
+ trackCancelFilter: (payload: {
430
+ property_id: string;
431
+ property_slug: string;
432
+ property_name: string;
433
+ filter_index: number;
434
+ filter_label: string;
435
+ selected_filters_ENUM?: any;
436
+ }) => void;
437
+ trackApplyFilter: (payload: {
438
+ property_id: string;
439
+ property_slug: string;
440
+ property_name: string;
441
+ filter_index: number;
442
+ filter_label: string;
443
+ selected_filters_ENUM?: any;
444
+ }) => void;
445
+ trackOpenSort: (payload: z.input<typeof sortOpenSchema>) => void;
446
+ trackSelectSort: (payload: {
447
+ property_id: string;
448
+ property_slug: string;
449
+ sort_index: number;
450
+ sort_ENUM: "relevance" | "newest" | "cost_low_to_high" | "cost_high_to_low";
451
+ }) => void;
452
+ trackCancelSort: (payload: {
453
+ property_id: string;
454
+ property_slug: string;
455
+ sort_index: number;
456
+ sort_ENUM: "relevance" | "newest" | "cost_low_to_high" | "cost_high_to_low";
457
+ }) => void;
458
+ trackClickUnitFavorites: (payload: {
459
+ property_id: string;
460
+ property_slug: string;
461
+ property_name: string;
462
+ unit_id: string;
463
+ unit_title: string;
464
+ unit_slug: string;
465
+ favorited_unit: boolean;
466
+ }) => void;
467
+ trackQuestionnaireResult: (payload: {
468
+ property_id: string;
469
+ property_slug: string;
470
+ full_questionnaire_schema_json?: unknown;
471
+ unit_results?: {
472
+ type?: string | undefined;
473
+ units?: {
474
+ unit_id: string;
475
+ unit_name?: string | undefined;
476
+ }[] | undefined;
477
+ total?: number | undefined;
478
+ } | undefined;
479
+ }) => void;
480
+ };
481
+ export declare function useTrackingEvents(): {
482
+ trackViewAllUnits: (payload: z.input<typeof viewAllUnitsSchema>) => void;
483
+ trackQuestionnaireSkip: (payload: {
484
+ property_id: string;
485
+ property_slug: string;
486
+ question_index: number;
487
+ question_ENUM: string;
488
+ }) => void;
489
+ trackQuestionnaireContinue: (payload: {
490
+ property_id: string;
491
+ property_slug: string;
492
+ question_index: number;
493
+ question_ENUM: string;
494
+ selected_answers_ENUM_Array?: any;
495
+ }) => void;
496
+ trackQuestionnaireBack: (payload: {
497
+ property_id: string;
498
+ property_slug: string;
499
+ question_index: number;
500
+ question_ENUM: string;
501
+ }) => void;
502
+ trackClickUnit: (payload: {
503
+ property_id: string;
504
+ property_slug: string;
505
+ property_name: string;
506
+ unit_id: string;
507
+ unit_title: string;
508
+ unit_slug: string;
509
+ favorited_unit: boolean;
510
+ }) => void;
511
+ trackHoverUnit: (payload: {
512
+ property_id: string;
513
+ property_slug: string;
514
+ property_name: string;
515
+ unit_id: string;
516
+ unit_title: string;
517
+ unit_slug: string;
518
+ favorited_unit: boolean;
519
+ }) => void;
520
+ trackLoadMore: (payload: z.input<typeof loadMoreSchema>) => void;
521
+ trackOpenFilters: (payload: {
522
+ property_id: string;
523
+ property_slug: string;
524
+ property_name: string;
525
+ filter_index: number;
526
+ filter_label: string;
527
+ selected_filters_ENUM?: any;
528
+ filter_name?: string | undefined;
529
+ }) => void;
530
+ trackCancelFilter: (payload: {
531
+ property_id: string;
532
+ property_slug: string;
533
+ property_name: string;
534
+ filter_index: number;
535
+ filter_label: string;
536
+ selected_filters_ENUM?: any;
537
+ }) => void;
538
+ trackApplyFilter: (payload: {
539
+ property_id: string;
540
+ property_slug: string;
541
+ property_name: string;
542
+ filter_index: number;
543
+ filter_label: string;
544
+ selected_filters_ENUM?: any;
545
+ }) => void;
546
+ trackOpenSort: (payload: z.input<typeof sortOpenSchema>) => void;
547
+ trackSelectSort: (payload: {
548
+ property_id: string;
549
+ property_slug: string;
550
+ sort_index: number;
551
+ sort_ENUM: "relevance" | "newest" | "cost_low_to_high" | "cost_high_to_low";
552
+ }) => void;
553
+ trackCancelSort: (payload: {
554
+ property_id: string;
555
+ property_slug: string;
556
+ sort_index: number;
557
+ sort_ENUM: "relevance" | "newest" | "cost_low_to_high" | "cost_high_to_low";
558
+ }) => void;
559
+ trackClickUnitFavorites: (payload: {
560
+ property_id: string;
561
+ property_slug: string;
562
+ property_name: string;
563
+ unit_id: string;
564
+ unit_title: string;
565
+ unit_slug: string;
566
+ favorited_unit: boolean;
567
+ }) => void;
568
+ trackQuestionnaireResult: (payload: {
569
+ property_id: string;
570
+ property_slug: string;
571
+ full_questionnaire_schema_json?: unknown;
572
+ unit_results?: {
573
+ type?: string | undefined;
574
+ units?: {
575
+ unit_id: string;
576
+ unit_name?: string | undefined;
577
+ }[] | undefined;
578
+ total?: number | undefined;
579
+ } | undefined;
580
+ }) => void;
581
+ };
582
+ export {};
@@ -0,0 +1 @@
1
+ export declare const generateUserUUID: Promise<string>;
@@ -0,0 +1,3 @@
1
+ export * from "./analytics";
2
+ export { MixpanelProvider, useMixpanel } from "./MixpanelProvider";
3
+ export { generateUserUUID } from "./generateUserUUID";
@@ -0,0 +1,75 @@
1
+ export declare const DEFAULT_WEB_ORIGIN = "//web.inresiapp.com";
2
+ export declare const DEFAULT_PLACEHOLDER_IMAGE = "/placeholder.jpg";
3
+ export interface UnitImageApiResponse {
4
+ CFURL?: string;
5
+ name?: string;
6
+ signature?: string;
7
+ }
8
+ export interface UnitSourceApiResponse extends Record<string, unknown> {
9
+ id?: number | string;
10
+ name?: string;
11
+ title?: string;
12
+ slug?: string;
13
+ cost?: number;
14
+ bedrooms?: number;
15
+ bathrooms?: number;
16
+ totalSqFt?: number;
17
+ amenities?: unknown;
18
+ highlights?: unknown;
19
+ availability?: string | Date | null;
20
+ image?: UnitImageApiResponse;
21
+ additionalImages?: UnitImageApiResponse[];
22
+ }
23
+ export interface UnitHitApiResponse<Source extends Record<string, unknown> = UnitSourceApiResponse> {
24
+ _index?: string;
25
+ _id?: string;
26
+ _score?: number;
27
+ _source?: Source;
28
+ }
29
+ export interface UnitsTotalInfo {
30
+ value: number;
31
+ relation?: string;
32
+ }
33
+ export interface UnitsDataApiResponse<Source extends Record<string, unknown> = UnitSourceApiResponse> {
34
+ total?: UnitsTotalInfo;
35
+ max_score?: number | null;
36
+ hits?: UnitHitApiResponse<Source>[];
37
+ type?: string;
38
+ }
39
+ export interface UnitsApiResponse<Source extends Record<string, unknown> = UnitSourceApiResponse> {
40
+ data: UnitsDataApiResponse<Source>;
41
+ }
42
+ export type TransformedUnit<Source extends Record<string, unknown> = UnitSourceApiResponse> = Source & {
43
+ title: string;
44
+ slug: string;
45
+ imageUrl: string;
46
+ secondaryImageUrl?: string;
47
+ tertiaryImageUrl?: string;
48
+ };
49
+ export interface UnitsClientList<Source extends Record<string, unknown> = UnitSourceApiResponse> {
50
+ total: number;
51
+ maxScore: number | null;
52
+ type: string;
53
+ hits: TransformedUnit<Source>[];
54
+ }
55
+ export interface TransformUnitsOptions {
56
+ origin?: string;
57
+ placeholderImage?: string;
58
+ }
59
+ export declare const buildExploreUrl: (unitSlug: string, propertySlug: string, origin?: string) => string;
60
+ export declare const buildImageUrl: (image?: UnitImageApiResponse, placeholder?: string) => string;
61
+ export declare function transformUnitsApiResponse<Source extends Record<string, unknown> = UnitSourceApiResponse>(apiResponse: UnitsDataApiResponse<Source>): UnitsApiResponse<Source>;
62
+ export declare function transformUnitsApiResponseToClient<Source extends Record<string, unknown> = UnitSourceApiResponse>(apiResponse: UnitsDataApiResponse<Source>, propertySlug: string, options?: TransformUnitsOptions): UnitsClientList<Source>;
63
+ export interface UnitsFilterParams {
64
+ availability?: string[];
65
+ bedrooms?: (number | string)[];
66
+ cost?: number | null;
67
+ highlights?: string[];
68
+ }
69
+ export interface UnitsClientFilters {
70
+ availability?: string[];
71
+ bedrooms?: string[];
72
+ cost?: number;
73
+ highlights: string[];
74
+ }
75
+ export declare const transformUnitsApiResponseToClientFilters: (params: UnitsFilterParams) => UnitsClientFilters;