venue-js 1.4.0-next.2 → 1.4.0-next.21

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,1025 @@
1
+ import { QueryClient, QueryObserver, EnsureQueryDataOptions } from '@tanstack/query-core';
2
+ import { Position, Geometry, GeometryCollection, GeoJsonProperties, Point, Polygon, MultiPolygon, LineString, MultiLineString, Feature } from 'geojson';
3
+ import { FuseResult } from 'fuse.js';
4
+
5
+ type Id = string;
6
+ type MediaFile = {
7
+ ext: string;
8
+ hash: string;
9
+ height: number;
10
+ mime: string;
11
+ name: string;
12
+ path: string | null;
13
+ size: number;
14
+ url: string;
15
+ width: number;
16
+ };
17
+ type Media = MediaFile & {
18
+ id: Id;
19
+ alternativeText: string | null;
20
+ caption: string | null;
21
+ createdAt: string;
22
+ ext: string;
23
+ folderPath: string;
24
+ formats: Record<string, MediaFile>;
25
+ previewUrl: string | null;
26
+ provider: string;
27
+ provider_metadata: string | null;
28
+ updatedAt: string;
29
+ };
30
+ type Model3d = {
31
+ id: Id;
32
+ name: string;
33
+ properties: {
34
+ position: Position;
35
+ rotation: {
36
+ x: number;
37
+ y: number;
38
+ z?: number;
39
+ };
40
+ scale: [number, number, number];
41
+ url: string;
42
+ };
43
+ };
44
+ type EntityTimestamps = {
45
+ createdAt: string;
46
+ updatedAt: string;
47
+ publishedAt: string;
48
+ };
49
+ type SymbolProperties = {
50
+ lineColor?: string;
51
+ lineWidth?: string;
52
+ lineDasharray?: string;
53
+ lineOpacity?: string;
54
+ lineJoin?: string;
55
+ lineCap?: string;
56
+ linePatternFile?: string;
57
+ lineDx?: string;
58
+ lineDy?: string;
59
+ polygonFill?: string;
60
+ polygonOpacity?: string;
61
+ polygonPatternFile?: string;
62
+ };
63
+ type TransalatableString = {
64
+ en: string;
65
+ th?: string;
66
+ } & Record<string, string | undefined>;
67
+ type SingleGeometry = Exclude<Geometry, GeometryCollection>;
68
+ type ImdfFeature<G extends SingleGeometry | null = SingleGeometry, P = GeoJsonProperties, T extends string = FeatureType | string> = Feature<G, P> & {
69
+ id: Id;
70
+ feature_type: T;
71
+ };
72
+ type AnchorGeometry = Point;
73
+ type AnchorProperties = EntityTimestamps & {
74
+ address_id: Id | null;
75
+ unit_id: Id;
76
+ locale: string;
77
+ };
78
+ type AnchorFeature = ImdfFeature<AnchorGeometry, AnchorProperties, "anchor">;
79
+ type AmenityGeometry = Point;
80
+ type AmenityProperties = EntityTimestamps & {
81
+ amenity_logo: Media | null;
82
+ category: string;
83
+ description: TransalatableString | null;
84
+ gallery: Media[];
85
+ isNavigatable: boolean;
86
+ is_featured: boolean;
87
+ level_id: Id;
88
+ location_description: string;
89
+ logo: Media | null;
90
+ name: TransalatableString | null;
91
+ style: unknown;
92
+ unit_ids: Id[];
93
+ venue_id: Id;
94
+ hours: string | null;
95
+ };
96
+ type AmenityFeature = ImdfFeature<AmenityGeometry, AmenityProperties, "amenity">;
97
+ type DetailGeometry = Point;
98
+ type DetailProperties = {
99
+ level_id: Id;
100
+ [k: string]: any;
101
+ };
102
+ type DetailFeature = ImdfFeature<DetailGeometry, DetailProperties>;
103
+ type FixtureGeometry = Polygon | MultiPolygon | LineString | MultiLineString;
104
+ type FixtureProperties = EntityTimestamps & {
105
+ anchor_id: Id | null;
106
+ category: string;
107
+ is_landmark: boolean;
108
+ level_id: Id;
109
+ locale: string;
110
+ model3d: Model3d[];
111
+ name: string | null;
112
+ style: SymbolProperties;
113
+ venue_id: Id;
114
+ [k: string]: any;
115
+ };
116
+ type FixtureFeature = ImdfFeature<FixtureGeometry, FixtureProperties, "fixture">;
117
+ type KioskGeometry = Polygon | MultiPolygon;
118
+ type KioskProperties = EntityTimestamps & {
119
+ alt_name: string;
120
+ anchor_id: Id;
121
+ is_landmark: boolean;
122
+ level_id: Id;
123
+ locale: string;
124
+ model3d: Model3d[];
125
+ name: TransalatableString;
126
+ style: SymbolProperties;
127
+ venue_id: Id;
128
+ };
129
+ type KioskFeature = ImdfFeature<KioskGeometry, KioskProperties, "kiosk">;
130
+ type LevelGeometry = Polygon | MultiPolygon;
131
+ type LevelProperties = EntityTimestamps & {
132
+ alt_name: string | null;
133
+ display_point: Point | null;
134
+ name: TransalatableString;
135
+ ordinal: number;
136
+ properties?: unknown;
137
+ venue_id: Id;
138
+ };
139
+ type LevelFeature = ImdfFeature<LevelGeometry, LevelProperties, "level">;
140
+ type ExternalLink = {
141
+ id: number;
142
+ link?: string;
143
+ ios_link?: string;
144
+ android_link?: string;
145
+ };
146
+ type OccupantGeometry = null;
147
+ type OccupantProperties = EntityTimestamps & {
148
+ /** Anchor is used for marker position */
149
+ anchor_id: Id;
150
+ category: string | null;
151
+ category_group: string | null;
152
+ cover_image: Media | null;
153
+ description: TransalatableString;
154
+ featured_image: Media | null;
155
+ gallery: Media[] | null;
156
+ group_ids: Id[];
157
+ hours: string;
158
+ is_featured: boolean;
159
+ is_landmark: boolean;
160
+ is_maintenance: boolean;
161
+ keywords: string[];
162
+ kiosk_id: Id | null;
163
+ kiosk_name: string | null;
164
+ local_category_ids: Id[];
165
+ local_category_names: string[];
166
+ logo: Media | null;
167
+ maintenance_end_date: string | null;
168
+ maintenance_start_date: string | null;
169
+ name: TransalatableString;
170
+ phone: string | null;
171
+ privilege_ids: Id[];
172
+ promotion_ids: Id[];
173
+ render_priority: number;
174
+ render_type: string;
175
+ /**
176
+ * @deprecated Use `unit_id or kiosk_id` instead.
177
+ */
178
+ room_no: string | null;
179
+ short_name: string | null;
180
+ start_date: string;
181
+ style: SymbolProperties | null;
182
+ temp_anchor_id: Id | null;
183
+ temp_kiosk_id: Id | null;
184
+ temp_unit_id: Id | null;
185
+ unit_id: Id | null;
186
+ unit_name: string | null;
187
+ venue_id: Id;
188
+ kiosk_ids: Id[];
189
+ unit_ids: Id[];
190
+ website_link: string | null;
191
+ show_name_on_all_units: boolean;
192
+ reservations?: ExternalLink[];
193
+ can_reserve?: boolean;
194
+ display_settings?: {
195
+ card_style?: string | null;
196
+ };
197
+ };
198
+ type OccupantFeature = ImdfFeature<OccupantGeometry, OccupantProperties, "occupant">;
199
+ type OpeningCategories = "automobile" | "bicycle" | "emergencyexit" | "pedestrian" | "pedestrian.principal" | "pedestrian.transit" | "service" | string;
200
+ type OpeningGeometry = LineString;
201
+ type OpeningProperties = EntityTimestamps & {
202
+ alt_name: string;
203
+ category: OpeningCategories;
204
+ door: {
205
+ type: string;
206
+ };
207
+ level_id: Id;
208
+ name: TransalatableString;
209
+ style: SymbolProperties;
210
+ venue_id: Id;
211
+ };
212
+ type OpeningFeature = ImdfFeature<OpeningGeometry, OpeningProperties, "opening">;
213
+ /** Relationship */
214
+ type RelationshipCategories = "elevator" | "escalator" | "movingwalkway" | "ramp" | "stairs" | "stairs.emergencyexit" | "traversal" | "traversal.path" | string;
215
+ type RelationshipDirectionTypes = "directed" | "undirected";
216
+ type UnitTypeAndId = {
217
+ feature_type: "unit";
218
+ id: string;
219
+ };
220
+ type OpeningTypeAndId = {
221
+ feature_type: "opening";
222
+ id: string;
223
+ };
224
+ type RelationshipGeometry = SingleGeometry | null;
225
+ type BaseRelationshipProperties = EntityTimestamps & {
226
+ category: RelationshipCategories;
227
+ destination: UnitTypeAndId | OpeningTypeAndId;
228
+ direction: RelationshipDirectionTypes;
229
+ hours: string | null;
230
+ intermediary: UnitTypeAndId[] | OpeningTypeAndId[];
231
+ locale: string;
232
+ name: TransalatableString;
233
+ origin: UnitTypeAndId | OpeningTypeAndId;
234
+ };
235
+ type RelationshipFeature = ImdfFeature<RelationshipGeometry, BaseRelationshipProperties>;
236
+ type TraversalRelationshipProperties = Omit<BaseRelationshipProperties, "origin" | "destination" | "intermediary" | "category"> & {
237
+ origin: UnitTypeAndId | null;
238
+ destination: UnitTypeAndId;
239
+ intermediary: OpeningTypeAndId[] | null;
240
+ category: "traversal" | "movingwalkway" | "traversal.path";
241
+ };
242
+ type TraversalRelationshipFeature = ImdfFeature<RelationshipGeometry, TraversalRelationshipProperties>;
243
+ type ElevatorRelationshipProperties = Omit<BaseRelationshipProperties, "origin" | "destination" | "intermediary" | "direction" | "category"> & {
244
+ origin: UnitTypeAndId;
245
+ destination: UnitTypeAndId;
246
+ intermediary: UnitTypeAndId[] | null;
247
+ direction: "undirected";
248
+ category: "elevator";
249
+ };
250
+ type ElevatorRelationshipFeature = ImdfFeature<RelationshipGeometry, ElevatorRelationshipProperties>;
251
+ type RampRelationshipProperties = Omit<BaseRelationshipProperties, "origin" | "destination" | "intermediary" | "category"> & {
252
+ origin: OpeningTypeAndId;
253
+ destination: OpeningTypeAndId;
254
+ intermediary: UnitTypeAndId[];
255
+ category: "ramp";
256
+ };
257
+ type RampRelationshipFeature = ImdfFeature<RelationshipGeometry, EscalatorRelationshipProperties>;
258
+ type StairsRelationshipProperties = Omit<BaseRelationshipProperties, "origin" | "destination" | "intermediary" | "direction" | "category"> & {
259
+ origin: OpeningTypeAndId;
260
+ destination: OpeningTypeAndId;
261
+ intermediary: UnitTypeAndId[] | null;
262
+ direction: "undirected";
263
+ category: "stairs" | "stairs.emergencyexit";
264
+ };
265
+ type StairsRelationshipFeature = ImdfFeature<RelationshipGeometry, StairsRelationshipProperties>;
266
+ type EscalatorRelationshipProperties = Omit<BaseRelationshipProperties, "origin" | "destination" | "intermediary" | "category"> & {
267
+ origin: OpeningTypeAndId;
268
+ destination: OpeningTypeAndId;
269
+ intermediary: UnitTypeAndId[];
270
+ category: "escalator";
271
+ };
272
+ type EscalatorRelationshipFeature = ImdfFeature<RelationshipGeometry, EscalatorRelationshipProperties>;
273
+ type AnyRelationshipFeature = TraversalRelationshipFeature | EscalatorRelationshipFeature | ElevatorRelationshipFeature | RampRelationshipFeature | StairsRelationshipFeature;
274
+ /**
275
+ * Section
276
+ */
277
+ type SectionGeometry = Polygon | MultiPolygon;
278
+ type SectionProperties = EntityTimestamps & {
279
+ venue_id: Id;
280
+ level_id: Id;
281
+ correlation_id: Id | null;
282
+ category: string;
283
+ ordinal: number;
284
+ imdf_category: string;
285
+ local_category_ids: string[];
286
+ feature_image: Media | null;
287
+ cover_image: Media | null;
288
+ gallery: Media[] | null;
289
+ is_featured: boolean;
290
+ hours: string | null;
291
+ [k: string]: any;
292
+ };
293
+ type SectionFeature = ImdfFeature<SectionGeometry, SectionProperties, "section">;
294
+ type UnitGeometry = Polygon | MultiPolygon;
295
+ type UnitProperties = EntityTimestamps & {
296
+ alt_name: string | null;
297
+ category: string;
298
+ is_landmark: boolean;
299
+ level_id: Id;
300
+ locale: string;
301
+ model3d: Model3d[];
302
+ name: TransalatableString;
303
+ style: SymbolProperties;
304
+ venue_id: Id;
305
+ };
306
+ type UnitFeature = ImdfFeature<UnitGeometry, UnitProperties, "unit">;
307
+ type VenueGeometry = Polygon | MultiPolygon;
308
+ type VenueProperties = EntityTimestamps & {
309
+ address: string;
310
+ address_id: Id | null;
311
+ country: string;
312
+ display_point: Point;
313
+ hours: string;
314
+ imdf_category: string;
315
+ locale: string;
316
+ locality: string;
317
+ logo: Media | null;
318
+ logo_simple: Media | null;
319
+ model3d: Model3d[];
320
+ name: TransalatableString;
321
+ phone: string;
322
+ postal_code: string;
323
+ province: string;
324
+ reference: string;
325
+ style: SymbolProperties | null;
326
+ supported_locales: string[];
327
+ theme_color: string;
328
+ zoom: string | null;
329
+ };
330
+ type VenueFeature = ImdfFeature<VenueGeometry, VenueProperties, "venue">;
331
+ /**
332
+ * Non-IMDF
333
+ *********************** */
334
+ type TaxonomyGeometry = null;
335
+ type TaxonomyProperties = EntityTimestamps & {
336
+ description: string;
337
+ icon_image: string;
338
+ icon_path: string;
339
+ is_featured: boolean;
340
+ local_id: string;
341
+ locale: string;
342
+ name: TransalatableString;
343
+ order: number;
344
+ parent_id: Id | null;
345
+ reference: string;
346
+ taxonomy: string;
347
+ venue_id: Id | null;
348
+ };
349
+ type TaxonomyFeature = ImdfFeature<TaxonomyGeometry, TaxonomyProperties>;
350
+ type EventGeometry = Polygon;
351
+ type EventProperties = {
352
+ name: string;
353
+ ordinal: number;
354
+ venue_id: Id;
355
+ angle: number;
356
+ fontSize: number;
357
+ };
358
+ type EventFeature = ImdfFeature<EventGeometry, EventProperties>;
359
+ type PromotionProperties = {
360
+ name: TransalatableString;
361
+ category: string;
362
+ cover_image: Media;
363
+ daily_end_time: string;
364
+ daily_start_time: string;
365
+ description: TransalatableString;
366
+ end_date: string;
367
+ feature_id: string | null;
368
+ gallery: Media[];
369
+ is_featured: boolean;
370
+ local_category_ids: string[];
371
+ locale: string;
372
+ publishedAt: string;
373
+ start_date: string;
374
+ updatedAt: string;
375
+ venue_id: Id;
376
+ website_link: string | null;
377
+ };
378
+ type PromotionFeature = ImdfFeature<null, PromotionProperties>;
379
+ type PrivilegeGeometry = null;
380
+ type PrivilegeProperties = {
381
+ createdAt: string;
382
+ description: TransalatableString;
383
+ locale: string;
384
+ occupant_id: Id;
385
+ publishedAt: string;
386
+ updatedAt: string;
387
+ venue_id: Id;
388
+ };
389
+ type PrivilegeFeature = ImdfFeature<PrivilegeGeometry, PrivilegeProperties>;
390
+ type LabelGeometry = Polygon;
391
+ type LabelProperties = {
392
+ name: string;
393
+ ordinal: number;
394
+ venue_id: Id;
395
+ angle: number;
396
+ fontSize: number;
397
+ };
398
+ type LabelFeature = ImdfFeature<LabelGeometry, LabelProperties>;
399
+ type ElementGeometry = null;
400
+ type ElementProperties = EntityTimestamps & {
401
+ geometries: Array<{
402
+ type: string;
403
+ id: Id;
404
+ geometry: SingleGeometry;
405
+ options: Record<string, unknown>;
406
+ properties: {
407
+ additionalField: string;
408
+ name: string | null;
409
+ image: Media | null;
410
+ ordinal: number;
411
+ };
412
+ }>;
413
+ locale: string;
414
+ name: TransalatableString;
415
+ };
416
+ type ElementFeature = ImdfFeature<ElementGeometry, ElementProperties>;
417
+ /**
418
+ * Sponsored Content
419
+ */
420
+ type SponsoredContentLegacyType = "HOMEPAGE_SPOTLIGHT" | "SCREENSAVER" | "SUGGESTED_BRAND" | "SEARCH_RESULT" | "POPUP_BANNER" | "FOOTER_BANNER" | "RECOMMENDED_EVENT" | "RECOMMENDED_PROMOTION" | "RECOMMENDED_DIRECTORY";
421
+ type SponsoredContentPlacementType = "HOMEPAGE_SPOTLIGHT" | "SEARCH_SUGGESTION" | "SEARCH_RESULT" | "LIST_TOPITEM" | "POPUP_BANNER" | "FOOTER_BANNER";
422
+ type SponsoredContentAttributes = {
423
+ venue_id: string;
424
+ project_id: string;
425
+ name: {
426
+ en: string;
427
+ };
428
+ type: SponsoredContentLegacyType;
429
+ placement_type: SponsoredContentPlacementType;
430
+ start_date: string;
431
+ end_date: string;
432
+ daily_start_time: string;
433
+ daily_end_time: string;
434
+ order: number;
435
+ url: string | null;
436
+ feature_id: string | null;
437
+ createdAt: string;
438
+ updatedAt: string;
439
+ publishedAt: string;
440
+ media?: Media;
441
+ locale: string;
442
+ };
443
+ type SponsoredContentStrapiV4ApiResponse = {
444
+ id: string;
445
+ attributes: SponsoredContentAttributes;
446
+ };
447
+ /** Parsed for internal use */
448
+ type SponsoredContentFeature = SponsoredContentAttributes & {
449
+ id: string;
450
+ };
451
+ type Page = {
452
+ id: Id;
453
+ attributes: Record<string, unknown>;
454
+ };
455
+ type Model3dGeometry = null;
456
+ type Model3dProperties = {
457
+ name: TransalatableString;
458
+ model: string;
459
+ level_id: Id;
460
+ project_id: Id;
461
+ rotation_x: number;
462
+ rotation_y: number;
463
+ rotation_z: number;
464
+ center: number[];
465
+ scale: number;
466
+ bottom_height: number;
467
+ translation_x: number;
468
+ translation_y: number;
469
+ translation_z: number;
470
+ createdAt: string;
471
+ updatedAt: string;
472
+ publishedAt: string;
473
+ locale: string;
474
+ };
475
+ type Model3dFeature = ImdfFeature<Model3dGeometry, Model3dProperties>;
476
+ type FeatureResponseMap = {
477
+ address: ImdfFeature;
478
+ amenity: AmenityFeature;
479
+ anchor: AnchorFeature;
480
+ building: ImdfFeature;
481
+ detail: DetailFeature;
482
+ fixture: FixtureFeature;
483
+ footprint: ImdfFeature;
484
+ geofence: ImdfFeature;
485
+ kiosk: KioskFeature;
486
+ level: LevelFeature;
487
+ occupant: OccupantFeature;
488
+ opening: OpeningFeature;
489
+ relationship: RelationshipFeature;
490
+ section: SectionFeature;
491
+ unit: UnitFeature;
492
+ venue: VenueFeature;
493
+ taxonomy: TaxonomyFeature;
494
+ privilege: PrivilegeFeature;
495
+ event: EventFeature;
496
+ promotion: PromotionFeature;
497
+ label: LabelFeature;
498
+ element: ElementFeature;
499
+ model3d: Model3dFeature;
500
+ "sponsored-content": SponsoredContentFeature;
501
+ page: Page;
502
+ };
503
+ type FeatureType = keyof FeatureResponseMap;
504
+ type PolygonalFeature = UnitFeature | KioskFeature | LevelFeature | SectionFeature;
505
+
506
+ type AmenityFeaturePopulated = AmenityFeature & {
507
+ properties: AmenityFeature["properties"] & {
508
+ /**
509
+ * [IMDF] Unit(s) the Amenity is associated with
510
+ */
511
+ units: UnitFeaturePopulated[];
512
+ /**
513
+ * [venue.in.th] Venue that amenity is in
514
+ */
515
+ venue: VenueFeaturePopulated;
516
+ /**
517
+ * [IMDF] Level that amenity is on
518
+ */
519
+ level: LevelFeaturePopulated;
520
+ /**
521
+ * [Derived] From units[0] --> level's ordinal
522
+ * This is added during feature enrichment and not part of the original IMDF dataset.
523
+ */
524
+ ordinal: number;
525
+ /**
526
+ * [Derived] From units[0] --> level's name
527
+ * This is added during feature enrichment and not part of the original IMDF dataset.
528
+ */
529
+ level_name: string;
530
+ /**
531
+ * [Derived] The section this amenity is on.
532
+ * This is added during feature enrichment and not part of the original IMDF dataset.
533
+ */
534
+ section?: SectionFeaturePopulated;
535
+ /**
536
+ * [Experimental | Derived] The kiosk this amenity is on.
537
+ * This is added during feature enrichment and not part of the original IMDF dataset.
538
+ */
539
+ _experimental_kiosk?: KioskFeaturePopulated;
540
+ };
541
+ };
542
+ type AnchorFeaturePopulated = AnchorFeature & {
543
+ properties: AnchorFeature["properties"] & {
544
+ /**
545
+ * [IMDF] The unit this anchor is on.
546
+ */
547
+ unit: UnitFeaturePopulated;
548
+ /**
549
+ * [IMDF] Level that kiosk is on
550
+ */
551
+ level: LevelFeaturePopulated;
552
+ /**
553
+ * [venue.in.th] Venue that anchor is in
554
+ */
555
+ venue: VenueFeaturePopulated;
556
+ /**
557
+ * [Derived] The section this anchor is on.
558
+ * This is added during feature enrichment and not part of the original IMDF dataset.
559
+ */
560
+ section?: SectionFeaturePopulated;
561
+ /**
562
+ * [Derived] Level's ordinal that anchor is on
563
+ */
564
+ ordinal: number;
565
+ };
566
+ };
567
+ type FixtureFeaturePopulated = FixtureFeature & {
568
+ properties: FixtureFeature["properties"] & {
569
+ /**
570
+ * [IMDF] The unit this anchor is on.
571
+ */
572
+ anchor: AnchorFeaturePopulated;
573
+ /**
574
+ * [IMDF] Level that kiosk is on
575
+ */
576
+ level: LevelFeaturePopulated;
577
+ /**
578
+ * [IMDF] Venue that kiosk is in
579
+ */
580
+ venue?: VenueFeaturePopulated;
581
+ /**
582
+ * [Derived] Level's ordinal that fixture is on
583
+ */
584
+ ordinal: number;
585
+ };
586
+ };
587
+ type KioskFeaturePopulated = KioskFeature & {
588
+ properties: KioskFeature["properties"] & {
589
+ /**
590
+ * [IMDF] An Occupant MUST be positioned (via Anchor) within a Kiosk that models a space that is leased to a business entity
591
+ */
592
+ anchor: AnchorFeaturePopulated;
593
+ /**
594
+ * [IMDF] Level that kiosk is on
595
+ */
596
+ level: LevelFeaturePopulated;
597
+ /**
598
+ * [venue.in.th] Venue that kiosk is in
599
+ */
600
+ venue: VenueFeaturePopulated;
601
+ /**
602
+ * [Derived] The unit this kiosk is on, usually a walkway.
603
+ * This is added during feature enrichment and not part of the original IMDF dataset.
604
+ */
605
+ unit: UnitFeaturePopulated;
606
+ /**
607
+ * [Derived] The section this kiosk is in
608
+ * This is added during feature enrichment and not part of the original IMDF dataset.
609
+ */
610
+ section?: SectionFeaturePopulated;
611
+ /**
612
+ * [Derived] Level's ordinal that fixture is on
613
+ */
614
+ ordinal: number;
615
+ };
616
+ };
617
+ type LevelFeaturePopulated = LevelFeature & {
618
+ properties: LevelFeature["properties"] & {
619
+ /**
620
+ * [venue.in.th] Venue that level is in
621
+ */
622
+ venue: VenueFeaturePopulated;
623
+ };
624
+ };
625
+ type OccupantFeaturePopulated = OccupantFeature & {
626
+ properties: OccupantFeature["properties"] & {
627
+ /**
628
+ * [IMDF] Occupant's position
629
+ */
630
+ anchor: AnchorFeaturePopulated;
631
+ /**
632
+ * [Derived] Level's ordinal that occupant is on
633
+ */
634
+ ordinal: number;
635
+ /**
636
+ * [venue.in.th] Occupant's category
637
+ */
638
+ local_categories: TaxonomyFeaturePopulated[];
639
+ unit?: UnitFeaturePopulated;
640
+ kiosk?: KioskFeaturePopulated;
641
+ /**
642
+ * [venue.in.th] Bind correlation between units on an occupant,
643
+ * which will be used for highlighting in the floor plan and
644
+ * displaying location details later.
645
+ */
646
+ units: UnitFeaturePopulated[];
647
+ /**
648
+ * [venue.in.th] Bind correlation between kiosks on an occupant,
649
+ * which will be used for highlighting in the floor plan and
650
+ * displaying location details later.
651
+ */
652
+ kiosks: KioskFeaturePopulated[];
653
+ /**
654
+ * [venue.in.th] Venue that level is in
655
+ */
656
+ venue: VenueFeaturePopulated;
657
+ /**
658
+ * [venue.in.th] Occupant's promotions
659
+ */
660
+ promotions: PromotionFeature[];
661
+ /**
662
+ * [venue.in.th] Occupant's privileges
663
+ */
664
+ privileges: PrivilegeFeature[];
665
+ };
666
+ };
667
+ type OpeningFeaturePopulated = OpeningFeature & {
668
+ properties: OpeningFeature["properties"] & {
669
+ /**
670
+ * [IMDF] Level that section is on
671
+ */
672
+ level: LevelFeaturePopulated;
673
+ /**
674
+ * [venue.in.th] Venue that level is in
675
+ */
676
+ venue: VenueFeaturePopulated;
677
+ /**
678
+ * [Derived] Level's ordinal that unit is on
679
+ */
680
+ ordinal: number;
681
+ };
682
+ };
683
+ type RelationshipFeaturePopulated = RelationshipFeature & {
684
+ properties: RelationshipFeature["properties"] & {
685
+ origin: UnitFeature | OpeningFeature | null;
686
+ destination: UnitFeature | OpeningFeature | null;
687
+ intermediary: (UnitFeature | OpeningFeature)[] | null;
688
+ };
689
+ };
690
+ type TraversalRelationshipFeaturePopulated = TraversalRelationshipFeature & {
691
+ properties: TraversalRelationshipFeature["properties"] & {
692
+ origin: UnitFeature | null;
693
+ destination: UnitFeature;
694
+ intermediary: OpeningFeature[] | null;
695
+ };
696
+ };
697
+ type EscalatorRelationshipFeaturePopulated = EscalatorRelationshipFeature & {
698
+ properties: EscalatorRelationshipFeature["properties"] & {
699
+ origin: OpeningFeature;
700
+ destination: OpeningFeature;
701
+ intermediary: UnitFeature[] | null;
702
+ };
703
+ };
704
+ type RampRelationshipFeaturePopulated = RampRelationshipFeature & {
705
+ properties: RampRelationshipFeature["properties"] & {
706
+ origin: OpeningFeature;
707
+ destination: OpeningFeature;
708
+ intermediary: UnitFeature[] | null;
709
+ };
710
+ };
711
+ type ElevatorRelationshipFeaturePopulated = ElevatorRelationshipFeature & {
712
+ properties: ElevatorRelationshipFeature["properties"] & {
713
+ origin: UnitFeature;
714
+ destination: UnitFeature;
715
+ intermediary: UnitFeature[] | null;
716
+ };
717
+ };
718
+ type StairRelationshipFeaturePopulated = StairsRelationshipFeature & {
719
+ properties: StairsRelationshipFeature["properties"] & {
720
+ origin: UnitFeature;
721
+ destination: UnitFeature;
722
+ intermediary: UnitFeature[] | null;
723
+ };
724
+ };
725
+ type SectionFeaturePopulated = SectionFeature & {
726
+ properties: SectionFeature["properties"] & {
727
+ /**
728
+ * [IMDF] Level that section is on
729
+ */
730
+ level: LevelFeaturePopulated;
731
+ /**
732
+ * [venue.in.th] Venue that level is in
733
+ */
734
+ venue: VenueFeaturePopulated;
735
+ /**
736
+ * [Derived] Level's ordinal that unit is on
737
+ */
738
+ ordinal: number;
739
+ };
740
+ };
741
+ type UnitFeaturePopulated = UnitFeature & {
742
+ properties: UnitFeature["properties"] & {
743
+ /**
744
+ * [IMDF] Level that unit is on
745
+ */
746
+ level: LevelFeaturePopulated;
747
+ /**
748
+ * [venue.in.th] Venue that level is in
749
+ */
750
+ venue: VenueFeaturePopulated;
751
+ /**
752
+ * [Derived] Level's ordinal that unit is on
753
+ */
754
+ ordinal: number;
755
+ /**
756
+ * [Derived] Secion that unit is in
757
+ */
758
+ section?: SectionFeaturePopulated;
759
+ };
760
+ };
761
+ type VenueFeaturePopulated = VenueFeature;
762
+ type TaxonomyFeaturePopulated = TaxonomyFeature & {
763
+ properties: TaxonomyFeature["properties"] & {
764
+ venue: VenueFeaturePopulated;
765
+ };
766
+ };
767
+ type Model3dPopulated = Model3dFeature & {
768
+ properties: Model3dFeature["properties"] & {
769
+ /**
770
+ * [IMDF] Level that model 3D is on
771
+ */
772
+ level: LevelFeaturePopulated;
773
+ };
774
+ };
775
+ type FeaturePopulatedResponseMap = {
776
+ address: ImdfFeature;
777
+ amenity: AmenityFeaturePopulated;
778
+ anchor: AnchorFeaturePopulated;
779
+ building: ImdfFeature;
780
+ detail: DetailFeature;
781
+ fixture: FixtureFeaturePopulated;
782
+ footprint: ImdfFeature;
783
+ geofence: ImdfFeature;
784
+ kiosk: KioskFeaturePopulated;
785
+ level: LevelFeaturePopulated;
786
+ occupant: OccupantFeaturePopulated;
787
+ opening: OpeningFeaturePopulated;
788
+ relationship: RelationshipFeaturePopulated;
789
+ section: SectionFeaturePopulated;
790
+ unit: UnitFeaturePopulated;
791
+ venue: VenueFeaturePopulated;
792
+ taxonomy: TaxonomyFeaturePopulated;
793
+ privilege: PrivilegeFeature;
794
+ event: EventFeature;
795
+ promotion: PromotionFeature;
796
+ label: LabelFeature;
797
+ element: ImdfFeature;
798
+ model3d: Model3dPopulated;
799
+ "sponsored-content": SponsoredContentFeature;
800
+ page: Page;
801
+ };
802
+ type PopulatableFeatureType = keyof FeaturePopulatedResponseMap;
803
+
804
+ type Value = string | boolean | number;
805
+ type EqFilter = Value;
806
+ type InFilter = {
807
+ $in: (Value)[];
808
+ };
809
+ type Filter = EqFilter | InFilter;
810
+ type Filters = Record<string, Filter>;
811
+
812
+ type WaypointHint = {
813
+ kind: "landmark";
814
+ name: TransalatableString;
815
+ refId?: string;
816
+ } | {
817
+ kind: "area";
818
+ name: TransalatableString;
819
+ } | {
820
+ kind: "generic";
821
+ name: TransalatableString;
822
+ };
823
+ type Waypoint = {
824
+ id?: string;
825
+ type: 'start' | 'end' | 'between';
826
+ levelId: string | null;
827
+ ordinal: number | null;
828
+ point: Position;
829
+ name: TransalatableString | null;
830
+ hint?: WaypointHint;
831
+ source: {
832
+ type: "occupant";
833
+ id: string;
834
+ } | {
835
+ type: "opening";
836
+ id: string;
837
+ } | {
838
+ type: "kiosk";
839
+ id: string;
840
+ } | {
841
+ type: "amenity";
842
+ id: string;
843
+ } | {
844
+ type: "anchor";
845
+ id: string;
846
+ } | {
847
+ type: "coordinate";
848
+ raw: string;
849
+ };
850
+ };
851
+
852
+ type Step = {
853
+ from: Waypoint;
854
+ to: Waypoint;
855
+ levelIds: string[];
856
+ ordinals: number[];
857
+ intermediaryCategory: string;
858
+ path: Position[];
859
+ description: null | {
860
+ text: string;
861
+ options?: any;
862
+ };
863
+ };
864
+
865
+ type GetNavigateClientOptions = {
866
+ data: {
867
+ anchors?: AnchorFeature[];
868
+ amenities?: AmenityFeature[];
869
+ fixtures?: FixtureFeature[];
870
+ kiosks?: KioskFeature[];
871
+ levels: LevelFeature[];
872
+ occupants?: OccupantFeature[];
873
+ openings: OpeningFeature[];
874
+ relationships: RelationshipFeature[];
875
+ units: UnitFeature[];
876
+ };
877
+ };
878
+ type FindByIdSync = <T extends FeatureType>(id: string) => FeatureResponseMap[T];
879
+ /** Things that can navigate */
880
+ type FeatureId = `${string}-${number}`;
881
+ type CoordinateOrdinalString = `${number},${number},${number}o`;
882
+ type NavigatableParam = FeatureId | CoordinateOrdinalString;
883
+ type Route = {
884
+ steps: Step[];
885
+ duration: null | number;
886
+ distance: null | number;
887
+ };
888
+
889
+ interface VenueClientOptions {
890
+ mode?: "delivery" | "preview";
891
+ projectId: string;
892
+ apiKey?: string;
893
+ previewToken?: string;
894
+ baseUrl?: string;
895
+ queryClient?: QueryClient;
896
+ }
897
+ type SearchClient = {
898
+ search: (txt: string) => FuseResult<ImdfFeature>[];
899
+ };
900
+ type NavigateClient$1 = {
901
+ findRoute: (origin: string, destination: string) => void;
902
+ };
903
+ interface FindParams {
904
+ populate?: boolean;
905
+ }
906
+ interface FilterParams {
907
+ populate?: boolean;
908
+ filters?: Filters;
909
+ }
910
+ interface PopulatedParams {
911
+ populate: true;
912
+ }
913
+ interface FeatureQueryOptions {
914
+ refetchInterval?: number;
915
+ staleTime?: number;
916
+ cacheTime?: number;
917
+ enabled?: boolean;
918
+ retry?: boolean | number;
919
+ }
920
+ type InternalFindById = <T extends FeatureType>(id: Id) => Promise<FeatureResponseMap[T]>;
921
+ type InternalFilterByType = <T extends FeatureType>(featureType: T) => Promise<FeatureResponseMap[T][]>;
922
+ interface VenueDataClient {
923
+ projectId: string;
924
+ queryClient: QueryClient;
925
+ registerObserver: (featureType: FeatureType, refetchInterval: number) => QueryObserver;
926
+ destroyObserver: (featureType: FeatureType) => void;
927
+ destroyObservers: () => void;
928
+ createFilterByTypeQueryOptions: <T extends FeatureType = FeatureType>(featureType: T, params: FilterParams, options: FeatureQueryOptions) => EnsureQueryDataOptions<FeatureResponseMap[T][] | FeaturePopulatedResponseMap[T][]>;
929
+ createFindByIdQueryOptions: <T extends FeatureType = FeatureType>(featureType: T, id: string, params: FindParams, options: FeatureQueryOptions) => EnsureQueryDataOptions<FeatureResponseMap[T] | FeaturePopulatedResponseMap[T]>;
930
+ _internalFindById: InternalFindById;
931
+ filterByType: <T extends FeatureType>(featureType: T, params?: FilterParams) => Promise<FeatureResponseMap[T][] | FeaturePopulatedResponseMap[T][]>;
932
+ findById: <T extends FeatureType>(featureType: T, id: string, params?: FindParams) => Promise<FeatureResponseMap[T] | FeaturePopulatedResponseMap[T]>;
933
+ search: (txt: string) => Promise<FuseResult<ImdfFeature>[]>;
934
+ navigate: (origin: NavigatableParam, destination: NavigatableParam, options?: any) => any;
935
+ }
936
+
937
+ declare const DEFAULT_BASE_URL = "https://service.venue.in.th/api";
938
+ declare const IMDF_FEATURE_TYPES: FeatureType[];
939
+ declare const IMDF_UNIT_CATEGORIES: string[];
940
+ declare const NONIMDF_FEATURE_TYPES: FeatureType[];
941
+ declare const GEOJSON_FEATURE_TYPES: FeatureType[];
942
+ declare const ALL_FEATURE_TYPES: FeatureType[];
943
+ declare const defaultFeatureQueryOptionsMap: Record<FeatureType, FeatureQueryOptions>;
944
+
945
+ type IMDFUnitCategory = typeof IMDF_UNIT_CATEGORIES[number];
946
+
947
+ /**
948
+ * Checks if a point is a valid coordinate pair.
949
+ *
950
+ * @param point - The point to be checked.
951
+ * @return True if the point is a valid coordinate pair, false otherwise.
952
+ */
953
+ declare const isValidCoordinate: (point: Position) => boolean;
954
+ /**
955
+ * Checks if an input represents a valid polygon, which may include holes.
956
+ * The input can be a single array of coordinates for simple polygons, or
957
+ * an array of arrays of coordinates for polygons with holes.
958
+ *
959
+ * @param polygon - The input representing a polygon.
960
+ * @return True if the polygon is valid, false otherwise.
961
+ */
962
+ declare const isValidPolygonCoordinates: (polygon: Position[] | Position[][]) => boolean;
963
+ /**
964
+ * Checks if an array of polygons forms a valid MultiPolygon.
965
+ *
966
+ * @param multipolygon - The array of polygons.
967
+ * @return True if the multipolygon is valid, false otherwise.
968
+ */
969
+ declare const isValidMultiPolygonCoordinates: (multipolygon: Position[][][]) => boolean;
970
+ /**
971
+ * Checks if a set of points forms a valid LineString.
972
+ * A valid LineString must have at least two points, each point must be a valid coordinate,
973
+ * and it should not form a closed loop.
974
+ *
975
+ * @param lineString - The array of points representing a LineString.
976
+ * @return True if the LineString is valid, false otherwise.
977
+ */
978
+ declare const isValidLineStringCoordinates: (lineString: Position[]) => boolean;
979
+ declare const isValidMultiPolygon: (geometry: Exclude<Geometry, GeometryCollection>) => boolean;
980
+ declare const isValidPolygon: (geometry: Exclude<Geometry, GeometryCollection>) => boolean;
981
+ declare const isValidLineString: (geometry: Exclude<Geometry, GeometryCollection>) => boolean;
982
+ declare const isValidPoint: (geometry: Exclude<Geometry, GeometryCollection>) => boolean;
983
+
984
+ declare function matchFilter(value: Value | Value[], filter: Filter): boolean;
985
+ declare function matchFilters<T extends Record<string, any>>(item: T, filters: Filters): boolean;
986
+
987
+ declare const getOccupantMainLocation: (occupant: OccupantFeaturePopulated) => UnitFeaturePopulated | KioskFeaturePopulated;
988
+ declare const getOccupantCorrelatedLocations: (occupant: OccupantFeaturePopulated) => Array<UnitFeaturePopulated | KioskFeaturePopulated>;
989
+ type OccupantMarkerPlacementType = 'ONCE_PER_LEVEL' | 'ALL_LOCATIONS';
990
+ declare const getOccupantMarkerLocations: (occupant: OccupantFeaturePopulated, options?: {
991
+ type: OccupantMarkerPlacementType;
992
+ }) => Array<UnitFeaturePopulated | KioskFeaturePopulated>;
993
+
994
+ type occupantHelper_OccupantMarkerPlacementType = OccupantMarkerPlacementType;
995
+ declare const occupantHelper_getOccupantCorrelatedLocations: typeof getOccupantCorrelatedLocations;
996
+ declare const occupantHelper_getOccupantMainLocation: typeof getOccupantMainLocation;
997
+ declare const occupantHelper_getOccupantMarkerLocations: typeof getOccupantMarkerLocations;
998
+ declare namespace occupantHelper {
999
+ export { type occupantHelper_OccupantMarkerPlacementType as OccupantMarkerPlacementType, occupantHelper_getOccupantCorrelatedLocations as getOccupantCorrelatedLocations, occupantHelper_getOccupantMainLocation as getOccupantMainLocation, occupantHelper_getOccupantMarkerLocations as getOccupantMarkerLocations };
1000
+ }
1001
+
1002
+ declare const getDataClient: (options: VenueClientOptions) => VenueDataClient;
1003
+
1004
+ declare function fetchDeliveryApi<T extends FeatureType = FeatureType>(projectId: string, apiKey: string, featureType: FeatureType, baseUrl?: string): Promise<FeatureResponseMap[T][]>;
1005
+ declare function fetchPreviewApi<T extends FeatureType = FeatureType>(projectId: string, previewToken: string, featureType: FeatureType, baseUrl?: string): Promise<FeatureResponseMap[T][]>;
1006
+ declare const safeFetchFeature: <T extends FeatureType = FeatureType>(featureType: FeatureType, params: {
1007
+ mode: "delivery" | "preview";
1008
+ projectId: string;
1009
+ apiKey: string;
1010
+ previewToken?: string;
1011
+ baseUrl: string;
1012
+ }) => Promise<FeatureResponseMap[T][]>;
1013
+
1014
+ declare const getSearchClient: ({ occupants, amenities }: {
1015
+ occupants: OccupantFeature[];
1016
+ amenities: AmenityFeature[];
1017
+ }) => SearchClient;
1018
+
1019
+ type NavigateClient = {
1020
+ findRoute: (routeOriginParam: NavigatableParam, routeDestinationParam: NavigatableParam, options?: any) => Promise<Route>;
1021
+ findByIdSync: FindByIdSync;
1022
+ };
1023
+ declare const getNavigateClient: (options: GetNavigateClientOptions) => NavigateClient;
1024
+
1025
+ export { type SectionFeature as $, type AnchorGeometry as A, type BaseRelationshipProperties as B, type TraversalRelationshipProperties as C, type DetailGeometry as D, type TraversalRelationshipFeature as E, type FixtureGeometry as F, type ElevatorRelationshipProperties as G, type ElevatorRelationshipFeature as H, type Id as I, type RampRelationshipProperties as J, type KioskGeometry as K, type LevelGeometry as L, type MediaFile as M, type RampRelationshipFeature as N, type OccupantGeometry as O, type StairsRelationshipProperties as P, type StairsRelationshipFeature as Q, type Route as R, type SingleGeometry as S, type TransalatableString as T, type UnitTypeAndId as U, type VenueDataClient as V, type EscalatorRelationshipProperties as W, type EscalatorRelationshipFeature as X, type AnyRelationshipFeature as Y, type SectionGeometry as Z, type SectionProperties as _, type Media as a, type IMDFUnitCategory as a$, type UnitGeometry as a0, type UnitProperties as a1, type UnitFeature as a2, type VenueGeometry as a3, type VenueProperties as a4, type VenueFeature as a5, type TaxonomyGeometry as a6, type TaxonomyProperties as a7, type TaxonomyFeature as a8, type EventGeometry as a9, type FixtureFeaturePopulated as aA, type KioskFeaturePopulated as aB, type LevelFeaturePopulated as aC, type OccupantFeaturePopulated as aD, type OpeningFeaturePopulated as aE, type RelationshipFeaturePopulated as aF, type TraversalRelationshipFeaturePopulated as aG, type EscalatorRelationshipFeaturePopulated as aH, type RampRelationshipFeaturePopulated as aI, type ElevatorRelationshipFeaturePopulated as aJ, type StairRelationshipFeaturePopulated as aK, type SectionFeaturePopulated as aL, type UnitFeaturePopulated as aM, type VenueFeaturePopulated as aN, type TaxonomyFeaturePopulated as aO, type Model3dPopulated as aP, type FeaturePopulatedResponseMap as aQ, type PopulatableFeatureType as aR, type VenueClientOptions as aS, type SearchClient as aT, type NavigateClient$1 as aU, type FindParams as aV, type FilterParams as aW, type PopulatedParams as aX, type FeatureQueryOptions as aY, type InternalFindById as aZ, type InternalFilterByType as a_, type EventProperties as aa, type EventFeature as ab, type PromotionProperties as ac, type PromotionFeature as ad, type PrivilegeGeometry as ae, type PrivilegeProperties as af, type PrivilegeFeature as ag, type LabelGeometry as ah, type LabelProperties as ai, type LabelFeature as aj, type ElementGeometry as ak, type ElementProperties as al, type ElementFeature as am, type SponsoredContentLegacyType as an, type SponsoredContentPlacementType as ao, type SponsoredContentStrapiV4ApiResponse as ap, type SponsoredContentFeature as aq, type Page as ar, type Model3dGeometry as as, type Model3dProperties as at, type Model3dFeature as au, type FeatureResponseMap as av, type FeatureType as aw, type PolygonalFeature as ax, type AmenityFeaturePopulated as ay, type AnchorFeaturePopulated as az, type Model3d as b, DEFAULT_BASE_URL as b0, IMDF_FEATURE_TYPES as b1, IMDF_UNIT_CATEGORIES as b2, NONIMDF_FEATURE_TYPES as b3, GEOJSON_FEATURE_TYPES as b4, ALL_FEATURE_TYPES as b5, defaultFeatureQueryOptionsMap as b6, occupantHelper as b7, isValidCoordinate as b8, isValidPolygonCoordinates as b9, isValidMultiPolygonCoordinates as ba, isValidLineStringCoordinates as bb, isValidMultiPolygon as bc, isValidPolygon as bd, isValidLineString as be, isValidPoint as bf, matchFilter as bg, matchFilters as bh, getDataClient as bi, fetchDeliveryApi as bj, fetchPreviewApi as bk, safeFetchFeature as bl, getSearchClient as bm, getNavigateClient as bn, type ImdfFeature as c, type AnchorProperties as d, type AnchorFeature as e, type AmenityGeometry as f, type AmenityProperties as g, type AmenityFeature as h, type DetailProperties as i, type DetailFeature as j, type FixtureProperties as k, type FixtureFeature as l, type KioskProperties as m, type KioskFeature as n, type LevelProperties as o, type LevelFeature as p, type OccupantProperties as q, type OccupantFeature as r, type OpeningGeometry as s, type OpeningProperties as t, type OpeningFeature as u, type RelationshipCategories as v, type RelationshipDirectionTypes as w, type OpeningTypeAndId as x, type RelationshipGeometry as y, type RelationshipFeature as z };