venue-js 1.4.0-next.17 → 1.4.0-next.19

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