venue-js 1.4.0-next.13 → 1.4.0-next.14

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.
package/dist/index.d.mts CHANGED
@@ -1,856 +1,21 @@
1
- import { QueryClient, QueryObserver, EnsureQueryDataOptions } from '@tanstack/query-core';
2
1
  export { QueryObserver } from '@tanstack/query-core';
3
- import * as geojson from 'geojson';
4
- import { Position, Geometry, GeometryCollection, GeoJsonProperties, Point, Polygon, MultiPolygon, LineString, MultiLineString, Feature } from 'geojson';
5
- import { FuseResult } from 'fuse.js';
2
+ import { VenueDataClient } from './data/index.mjs';
3
+ export { ALL_FEATURE_TYPES, AmenityFeature, AmenityFeaturePopulated, AmenityGeometry, AmenityProperties, AnchorFeature, AnchorFeaturePopulated, AnchorGeometry, AnchorProperties, DEFAULT_BASE_URL, DetailFeature, DetailGeometry, DetailProperties, ElementFeature, ElementGeometry, ElementProperties, EventFeature, EventGeometry, EventProperties, FeaturePopulatedResponseMap, FeatureQueryOptions, FeatureResponseMap, FeatureType, FilterParams, FindParams, FixtureFeature, FixtureFeaturePopulated, FixtureGeometry, FixtureProperties, GEOJSON_FEATURE_TYPES, IMDF_FEATURE_TYPES, Id, ImdfFeature, InternalFilterByType, InternalFindById, KioskFeature, KioskFeaturePopulated, KioskGeometry, KioskProperties, LabelFeature, LabelGeometry, LabelProperties, LevelFeature, LevelFeaturePopulated, LevelGeometry, LevelProperties, Media, MediaFile, Model3d, Model3dFeature, Model3dGeometry, Model3dPopulated, Model3dProperties, NONIMDF_FEATURE_TYPES, OccupantFeature, OccupantFeaturePopulated, OccupantGeometry, OccupantHelpers, OccupantProperties, OpeningFeature, OpeningFeaturePopulated, OpeningGeometry, OpeningProperties, Page, PolygonalFeature, PopulatableFeatureType, PopulatedParams, PrivilegeFeature, PrivilegeGeometry, PrivilegeProperties, PromotionFeature, PromotionProperties, RelationshipFeature, RelationshipGeometry, RelationshipProperties, SearchClient, SectionFeature, SectionFeaturePopulated, SectionGeometry, SectionProperties, SingleGeometry, SponsoredContentFeature, SponsoredContentLegacyType, SponsoredContentPlacementType, SponsoredContentStrapiV4ApiResponse, TaxonomyFeature, TaxonomyFeaturePopulated, TaxonomyGeometry, TaxonomyProperties, UnitFeature, UnitFeaturePopulated, UnitGeometry, UnitProperties, VenueClientOptions, VenueFeature, VenueFeaturePopulated, VenueGeometry, VenueProperties, defaultFeatureQueryOptionsMap, fetchDeliveryApi, fetchPreviewApi, getDataClient, getSearchClient, isValidCoordinate, isValidLineString, isValidLineStringCoordinates, isValidMultiPolygon, isValidMultiPolygonCoordinates, isValidPoint, isValidPolygon, isValidPolygonCoordinates, matchFilter, matchFilters, safeFetchFeature } from './data/index.mjs';
6
4
  import * as maptalks_dist_core_Class from 'maptalks/dist/core/Class';
7
5
  import * as maptalks$1 from 'maptalks-gl';
8
6
  import { Map, Coordinate as Coordinate$1 } from 'maptalks-gl';
7
+ import * as geojson from 'geojson';
8
+ import { Position, Feature, LineString, GeoJsonProperties, Polygon as Polygon$1, MultiPolygon as MultiPolygon$1, Point } from 'geojson';
9
9
  import { BaseObject, ThreeLayer } from 'maptalks.three';
10
10
  import * as maptalks from 'maptalks';
11
- import { Coordinate, Extent, Marker, ui, LineString as LineString$1, Polygon as Polygon$1, MultiPolygon as MultiPolygon$1, MultiLineString as MultiLineString$1 } from 'maptalks';
11
+ import { Coordinate, Extent, Marker, ui, LineString as LineString$1, Polygon, MultiPolygon, MultiLineString } from 'maptalks';
12
12
  import { BaseObjectOptionType, BarOptionType, ExtrudePolygonOptionType, ExtrudeLineOptionType } from 'maptalks.three/dist/type';
13
13
  import { PolygonOptionsType } from 'maptalks/dist/geometry/Polygon';
14
14
  import { LineStringOptionsType } from 'maptalks/dist/geometry/LineString';
15
15
  import { MapViewType, MapAnimationOptionsType, MapPaddingType } from 'maptalks/dist/map/Map';
16
16
  import * as THREE from 'three';
17
17
  import { SpriteMaterial } from 'three';
18
-
19
- type Id = string;
20
- type MediaFile = {
21
- ext: string;
22
- hash: string;
23
- height: number;
24
- mime: string;
25
- name: string;
26
- path: string | null;
27
- size: number;
28
- url: string;
29
- width: number;
30
- };
31
- type Media = MediaFile & {
32
- id: Id;
33
- alternativeText: string | null;
34
- caption: string | null;
35
- createdAt: string;
36
- ext: string;
37
- folderPath: string;
38
- formats: Record<string, MediaFile>;
39
- previewUrl: string | null;
40
- provider: string;
41
- provider_metadata: string | null;
42
- updatedAt: string;
43
- };
44
- type Model3d = {
45
- id: Id;
46
- name: string;
47
- properties: {
48
- position: Position;
49
- rotation: {
50
- x: number;
51
- y: number;
52
- z?: number;
53
- };
54
- scale: [number, number, number];
55
- url: string;
56
- };
57
- };
58
- type EntityTimestamps = {
59
- createdAt: string;
60
- updatedAt: string;
61
- publishedAt: string;
62
- };
63
- type SymbolProperties = {
64
- lineColor?: string;
65
- lineWidth?: string;
66
- lineDasharray?: string;
67
- lineOpacity?: string;
68
- lineJoin?: string;
69
- lineCap?: string;
70
- linePatternFile?: string;
71
- lineDx?: string;
72
- lineDy?: string;
73
- polygonFill?: string;
74
- polygonOpacity?: string;
75
- polygonPatternFile?: string;
76
- };
77
- type TransalatableString = Record<string, string>;
78
- type SingleGeometry = Exclude<Geometry, GeometryCollection>;
79
- type ImdfFeature<G extends SingleGeometry | null = SingleGeometry, P = GeoJsonProperties, T extends string = FeatureType | string> = Feature<G, P> & {
80
- id: Id;
81
- feature_type: T;
82
- };
83
- type AnchorGeometry = Point;
84
- type AnchorProperties = EntityTimestamps & {
85
- address_id: Id | null;
86
- unit_id: Id;
87
- locale: string;
88
- };
89
- type AnchorFeature = ImdfFeature<AnchorGeometry, AnchorProperties, "anchor">;
90
- type AmenityGeometry = Point;
91
- type AmenityProperties = EntityTimestamps & {
92
- amenity_logo: Media | null;
93
- category: string;
94
- description: TransalatableString | null;
95
- gallery: Media[];
96
- isNavigatable: boolean;
97
- is_featured: boolean;
98
- level_id: Id;
99
- location_description: string;
100
- logo: Media | null;
101
- name: TransalatableString | null;
102
- style: unknown;
103
- unit_ids: Id[];
104
- venue_id: Id;
105
- hours: string | null;
106
- };
107
- type AmenityFeature = ImdfFeature<AmenityGeometry, AmenityProperties, "amenity">;
108
- type DetailGeometry = Point;
109
- type DetailProperties = {
110
- level_id: Id;
111
- [k: string]: any;
112
- };
113
- type DetailFeature = ImdfFeature<DetailGeometry, DetailProperties>;
114
- type FixtureGeometry = Polygon | MultiPolygon | LineString | MultiLineString;
115
- type FixtureProperties = EntityTimestamps & {
116
- anchor_id: Id | null;
117
- category: string;
118
- is_landmark: boolean;
119
- level_id: Id;
120
- locale: string;
121
- model3d: Model3d[];
122
- name: string | null;
123
- style: SymbolProperties;
124
- venue_id: Id;
125
- [k: string]: any;
126
- };
127
- type FixtureFeature = ImdfFeature<FixtureGeometry, FixtureProperties, "fixture">;
128
- type KioskGeometry = Polygon | MultiPolygon;
129
- type KioskProperties = EntityTimestamps & {
130
- alt_name: string;
131
- anchor_id: Id;
132
- is_landmark: boolean;
133
- level_id: Id;
134
- locale: string;
135
- model3d: Model3d[];
136
- name: TransalatableString;
137
- style: SymbolProperties;
138
- venue_id: Id;
139
- };
140
- type KioskFeature = ImdfFeature<KioskGeometry, KioskProperties, "fixture">;
141
- type LevelGeometry = Polygon | MultiPolygon;
142
- type LevelProperties = EntityTimestamps & {
143
- alt_name: string | null;
144
- display_point: Point;
145
- name: TransalatableString;
146
- ordinal: number;
147
- properties: unknown;
148
- venue_id: Id;
149
- };
150
- type LevelFeature = ImdfFeature<LevelGeometry, LevelProperties, "level">;
151
- type ExternalLink = {
152
- id: number;
153
- link?: string;
154
- ios_link?: string;
155
- android_link?: string;
156
- };
157
- type OccupantGeometry = null;
158
- type OccupantProperties = EntityTimestamps & {
159
- anchor_id: Id;
160
- category: string | null;
161
- category_group: string | null;
162
- cover_image: Media | null;
163
- description: TransalatableString;
164
- featured_image: Media | null;
165
- gallery: Media[] | null;
166
- group_ids: Id[];
167
- hours: string;
168
- is_featured: boolean;
169
- is_landmark: boolean;
170
- is_maintenance: boolean;
171
- keywords: string[];
172
- kiosk_id: Id | null;
173
- local_category_ids: Id[];
174
- logo: Media | null;
175
- maintenance_end_date: string | null;
176
- maintenance_start_date: string | null;
177
- name: TransalatableString;
178
- phone: string | null;
179
- privilege_ids: Id[];
180
- promotion_ids: Id[];
181
- render_priority: number;
182
- render_type: string;
183
- room_no: string | null;
184
- short_name: string | null;
185
- start_date: string;
186
- style: SymbolProperties | null;
187
- temp_anchor_id: Id | null;
188
- temp_kiosk_id: Id | null;
189
- temp_unit_id: Id | null;
190
- unit_id: Id | null;
191
- venue_id: Id;
192
- kiosk_ids: Id[];
193
- unit_ids: Id[];
194
- website_link: string | null;
195
- show_name_on_all_units: boolean;
196
- reservations?: ExternalLink[];
197
- can_reserve?: boolean;
198
- display_settings?: {
199
- card_style?: string | null;
200
- };
201
- };
202
- type OccupantFeature = ImdfFeature<OccupantGeometry, OccupantProperties, "occupant">;
203
- type OpeningCategories = "automobile" | "bicycle" | "emergencyexit" | "pedestrian" | "pedestrian.principal" | "pedestrian.transit" | "service" | string;
204
- type OpeningGeometry = LineString;
205
- type OpeningProperties = EntityTimestamps & {
206
- alt_name: string;
207
- category: OpeningCategories;
208
- door: {
209
- type: string;
210
- };
211
- level_id: Id;
212
- name: TransalatableString;
213
- style: SymbolProperties;
214
- venue_id: Id;
215
- };
216
- type OpeningFeature = ImdfFeature<OpeningGeometry, OpeningProperties, "opening">;
217
- type RelationshipCategories = "elevator" | "escalator" | "movingwalkway" | "ramp" | "stairs" | "stairs.emergencyexit" | "traversal" | "traversal.path" | string;
218
- type RelationshipDirectionTypes = "directed" | "undirected";
219
- type RelationshipGeometry = SingleGeometry | null;
220
- type RelationshipProperties<T extends RelationshipCategories = RelationshipCategories> = EntityTimestamps & {
221
- category: RelationshipCategories;
222
- destination: {
223
- id: Id;
224
- feature_type: FeatureType;
225
- };
226
- direction: RelationshipDirectionTypes;
227
- hours: string | null;
228
- intermediary: {
229
- id: Id;
230
- feature_type: FeatureType;
231
- }[];
232
- locale: string;
233
- name: TransalatableString;
234
- origin: {
235
- id: Id;
236
- feature_type: FeatureType;
237
- };
238
- };
239
- type RelationshipFeature = ImdfFeature<RelationshipGeometry, RelationshipProperties>;
240
- type SectionGeometry = Polygon | MultiPolygon;
241
- type SectionProperties = EntityTimestamps & {
242
- venue_id: Id;
243
- level_id: Id;
244
- correlation_id: Id | null;
245
- category: string;
246
- ordinal: number;
247
- imdf_category: string;
248
- local_category_ids: string[];
249
- feature_image: Media | null;
250
- cover_image: Media | null;
251
- gallery: Media[] | null;
252
- is_featured: boolean;
253
- hours: string | null;
254
- [k: string]: any;
255
- };
256
- type SectionFeature = ImdfFeature<SectionGeometry, SectionProperties, "section">;
257
- type UnitGeometry = Polygon | MultiPolygon;
258
- type UnitProperties = EntityTimestamps & {
259
- alt_name: string | null;
260
- category: string;
261
- is_landmark: boolean;
262
- level_id: Id;
263
- locale: string;
264
- model3d: Model3d[];
265
- name: TransalatableString;
266
- style: SymbolProperties;
267
- venue_id: Id;
268
- };
269
- type UnitFeature = ImdfFeature<UnitGeometry, UnitProperties, "unit">;
270
- type VenueGeometry = Polygon | MultiPolygon;
271
- type VenueProperties = EntityTimestamps & {
272
- address: string;
273
- address_id: Id | null;
274
- country: string;
275
- display_point: Point;
276
- hours: string;
277
- imdf_category: string;
278
- locale: string;
279
- locality: string;
280
- logo: Media | null;
281
- logo_simple: Media | null;
282
- model3d: Model3d[];
283
- name: TransalatableString;
284
- phone: string;
285
- postal_code: string;
286
- province: string;
287
- reference: string;
288
- style: SymbolProperties | null;
289
- supported_locales: string[];
290
- theme_color: string;
291
- zoom: string | null;
292
- };
293
- type VenueFeature = ImdfFeature<VenueGeometry, VenueProperties, "venue">;
294
- /**
295
- * Non-IMDF
296
- *********************** */
297
- type TaxonomyGeometry = null;
298
- type TaxonomyProperties = EntityTimestamps & {
299
- description: string;
300
- icon_image: string;
301
- icon_path: string;
302
- is_featured: boolean;
303
- local_id: string;
304
- locale: string;
305
- name: TransalatableString;
306
- order: number;
307
- parent_id: Id | null;
308
- reference: string;
309
- taxonomy: string;
310
- venue_id: Id | null;
311
- };
312
- type TaxonomyFeature = ImdfFeature<TaxonomyGeometry, TaxonomyProperties>;
313
- type EventGeometry = Polygon;
314
- type EventProperties = {
315
- name: string;
316
- ordinal: number;
317
- venue_id: Id;
318
- angle: number;
319
- fontSize: number;
320
- };
321
- type EventFeature = ImdfFeature<EventGeometry, EventProperties>;
322
- type PromotionProperties = {
323
- name: TransalatableString;
324
- category: string;
325
- cover_image: Media;
326
- daily_end_time: string;
327
- daily_start_time: string;
328
- description: TransalatableString;
329
- end_date: string;
330
- feature_id: string | null;
331
- gallery: Media[];
332
- is_featured: boolean;
333
- local_category_ids: string[];
334
- locale: string;
335
- publishedAt: string;
336
- start_date: string;
337
- updatedAt: string;
338
- venue_id: Id;
339
- website_link: string | null;
340
- };
341
- type PromotionFeature = ImdfFeature<null, PromotionProperties>;
342
- type PrivilegeGeometry = null;
343
- type PrivilegeProperties = {
344
- createdAt: string;
345
- description: TransalatableString;
346
- locale: string;
347
- occupant_id: Id;
348
- publishedAt: string;
349
- updatedAt: string;
350
- venue_id: Id;
351
- };
352
- type PrivilegeFeature = ImdfFeature<PrivilegeGeometry, PrivilegeProperties>;
353
- type LabelGeometry = Polygon;
354
- type LabelProperties = {
355
- name: string;
356
- ordinal: number;
357
- venue_id: Id;
358
- angle: number;
359
- fontSize: number;
360
- };
361
- type LabelFeature = ImdfFeature<LabelGeometry, LabelProperties>;
362
- type ElementGeometry = null;
363
- type ElementProperties = EntityTimestamps & {
364
- geometries: Array<{
365
- type: string;
366
- id: Id;
367
- geometry: SingleGeometry;
368
- options: Record<string, unknown>;
369
- properties: {
370
- additionalField: string;
371
- name: string | null;
372
- image: Media | null;
373
- ordinal: number;
374
- };
375
- }>;
376
- locale: string;
377
- name: TransalatableString;
378
- };
379
- type ElementFeature = ImdfFeature<ElementGeometry, ElementProperties>;
380
- /**
381
- * Sponsored Content
382
- */
383
- type SponsoredContentLegacyType = "HOMEPAGE_SPOTLIGHT" | "SCREENSAVER" | "SUGGESTED_BRAND" | "SEARCH_RESULT" | "POPUP_BANNER" | "FOOTER_BANNER" | "RECOMMENDED_EVENT" | "RECOMMENDED_PROMOTION" | "RECOMMENDED_DIRECTORY";
384
- type SponsoredContentPlacementType = "HOMEPAGE_SPOTLIGHT" | "SEARCH_SUGGESTION" | "SEARCH_RESULT" | "LIST_TOPITEM" | "POPUP_BANNER" | "FOOTER_BANNER";
385
- type SponsoredContentAttributes = {
386
- venue_id: string;
387
- project_id: string;
388
- name: {
389
- en: string;
390
- };
391
- type: SponsoredContentLegacyType;
392
- placement_type: SponsoredContentPlacementType;
393
- start_date: string;
394
- end_date: string;
395
- daily_start_time: string;
396
- daily_end_time: string;
397
- order: number;
398
- url: string | null;
399
- feature_id: string | null;
400
- createdAt: string;
401
- updatedAt: string;
402
- publishedAt: string;
403
- media?: Media;
404
- locale: string;
405
- };
406
- type SponsoredContentStrapiV4ApiResponse = {
407
- id: string;
408
- attributes: SponsoredContentAttributes;
409
- };
410
- /** Parsed for internal use */
411
- type SponsoredContentFeature = SponsoredContentAttributes & {
412
- id: string;
413
- };
414
- type Page = {
415
- id: Id;
416
- attributes: Record<string, unknown>;
417
- };
418
- type Model3dGeometry = null;
419
- type Model3dProperties = {
420
- name: TransalatableString;
421
- model: string;
422
- level_id: Id;
423
- project_id: Id;
424
- rotation_x: number;
425
- rotation_y: number;
426
- rotation_z: number;
427
- center: number[];
428
- scale: number;
429
- bottom_height: number;
430
- translation_x: number;
431
- translation_y: number;
432
- translation_z: number;
433
- createdAt: string;
434
- updatedAt: string;
435
- publishedAt: string;
436
- locale: string;
437
- };
438
- type Model3dFeature = ImdfFeature<Model3dGeometry, Model3dProperties>;
439
- type FeatureResponseMap = {
440
- address: ImdfFeature;
441
- amenity: AmenityFeature;
442
- anchor: AnchorFeature;
443
- building: ImdfFeature;
444
- detail: DetailFeature;
445
- fixture: FixtureFeature;
446
- footprint: ImdfFeature;
447
- geofence: ImdfFeature;
448
- kiosk: KioskFeature;
449
- level: LevelFeature;
450
- occupant: OccupantFeature;
451
- opening: OpeningFeature;
452
- relationship: RelationshipFeature;
453
- section: SectionFeature;
454
- unit: UnitFeature;
455
- venue: VenueFeature;
456
- taxonomy: TaxonomyFeature;
457
- privilege: PrivilegeFeature;
458
- event: EventFeature;
459
- promotion: PromotionFeature;
460
- label: LabelFeature;
461
- element: ElementFeature;
462
- model3d: Model3dFeature;
463
- "sponsored-content": SponsoredContentFeature;
464
- page: Page;
465
- };
466
- type FeatureType = keyof FeatureResponseMap;
467
- type PolygonalFeature = UnitFeature | KioskFeature | LevelFeature | SectionFeature;
468
-
469
- type AmenityFeaturePopulated = AmenityFeature & {
470
- properties: AmenityFeature["properties"] & {
471
- /**
472
- * [IMDF] Unit(s) the Amenity is associated with
473
- */
474
- units: UnitFeaturePopulated[];
475
- /**
476
- * [venue.in.th] Venue that amenity is in
477
- */
478
- venue: VenueFeaturePopulated;
479
- /**
480
- * [IMDF] Level that amenity is on
481
- */
482
- level: LevelFeaturePopulated;
483
- /**
484
- * [Derived] From units[0] --> level's ordinal
485
- * This is added during feature enrichment and not part of the original IMDF dataset.
486
- */
487
- ordinal: number;
488
- /**
489
- * [Derived] From units[0] --> level's name
490
- * This is added during feature enrichment and not part of the original IMDF dataset.
491
- */
492
- level_name: string;
493
- /**
494
- * [Derived] The section this amenity is on.
495
- * This is added during feature enrichment and not part of the original IMDF dataset.
496
- */
497
- section?: SectionFeaturePopulated;
498
- /**
499
- * [Experimental | Derived] The kiosk this amenity is on.
500
- * This is added during feature enrichment and not part of the original IMDF dataset.
501
- */
502
- _experimental_kiosk?: KioskFeaturePopulated;
503
- };
504
- };
505
- type AnchorFeaturePopulated = AnchorFeature & {
506
- properties: AnchorFeature["properties"] & {
507
- /**
508
- * [IMDF] The unit this anchor is on.
509
- */
510
- unit: UnitFeaturePopulated;
511
- /**
512
- * [IMDF] Level that kiosk is on
513
- */
514
- level: LevelFeaturePopulated;
515
- /**
516
- * [venue.in.th] Venue that anchor is in
517
- */
518
- venue: VenueFeaturePopulated;
519
- /**
520
- * [Derived] The section this anchor is on.
521
- * This is added during feature enrichment and not part of the original IMDF dataset.
522
- */
523
- section?: SectionFeaturePopulated;
524
- /**
525
- * [Derived] Level's ordinal that anchor is on
526
- */
527
- ordinal: number;
528
- };
529
- };
530
- type FixtureFeaturePopulated = FixtureFeature & {
531
- properties: FixtureFeature["properties"] & {
532
- /**
533
- * [IMDF] The unit this anchor is on.
534
- */
535
- anchor: AnchorFeaturePopulated;
536
- /**
537
- * [IMDF] Level that kiosk is on
538
- */
539
- level: LevelFeaturePopulated;
540
- /**
541
- * [IMDF] Venue that kiosk is in
542
- */
543
- venue?: VenueFeaturePopulated;
544
- /**
545
- * [Derived] Level's ordinal that fixture is on
546
- */
547
- ordinal: number;
548
- };
549
- };
550
- type KioskFeaturePopulated = KioskFeature & {
551
- properties: KioskFeature["properties"] & {
552
- /**
553
- * [IMDF] An Occupant MUST be positioned (via Anchor) within a Kiosk that models a space that is leased to a business entity
554
- */
555
- anchor: AnchorFeaturePopulated;
556
- /**
557
- * [IMDF] Level that kiosk is on
558
- */
559
- level: LevelFeaturePopulated;
560
- /**
561
- * [venue.in.th] Venue that kiosk is in
562
- */
563
- venue: VenueFeaturePopulated;
564
- /**
565
- * [Derived] The unit this kiosk is on, usually a walkway.
566
- * This is added during feature enrichment and not part of the original IMDF dataset.
567
- */
568
- unit: UnitFeaturePopulated;
569
- /**
570
- * [Derived] The section this kiosk is in
571
- * This is added during feature enrichment and not part of the original IMDF dataset.
572
- */
573
- section?: SectionFeaturePopulated;
574
- /**
575
- * [Derived] Level's ordinal that fixture is on
576
- */
577
- ordinal: number;
578
- };
579
- };
580
- type LevelFeaturePopulated = LevelFeature & {
581
- properties: LevelFeature["properties"] & {
582
- /**
583
- * [venue.in.th] Venue that level is in
584
- */
585
- venue: VenueFeaturePopulated;
586
- };
587
- };
588
- type OccupantFeaturePopulated = OccupantFeature & {
589
- properties: OccupantFeature["properties"] & {
590
- /**
591
- * [IMDF] Occupant's position
592
- */
593
- anchor: AnchorFeaturePopulated;
594
- /**
595
- * [Derived] Level's ordinal that occupant is on
596
- */
597
- ordinal: number;
598
- /**
599
- * [venue.in.th] Occupant's category
600
- */
601
- local_categories: TaxonomyFeaturePopulated[];
602
- unit?: UnitFeaturePopulated;
603
- kiosk?: KioskFeaturePopulated;
604
- /**
605
- * [venue.in.th] Bind correlation between units on an occupant,
606
- * which will be used for highlighting in the floor plan and
607
- * displaying location details later.
608
- */
609
- units: UnitFeaturePopulated[];
610
- /**
611
- * [venue.in.th] Bind correlation between kiosks on an occupant,
612
- * which will be used for highlighting in the floor plan and
613
- * displaying location details later.
614
- */
615
- kiosks: KioskFeaturePopulated[];
616
- /**
617
- * [venue.in.th] Venue that level is in
618
- */
619
- venue: VenueFeaturePopulated;
620
- /**
621
- * [venue.in.th] Occupant's promotions
622
- */
623
- promotions: PromotionFeature[];
624
- /**
625
- * [venue.in.th] Occupant's privileges
626
- */
627
- privileges: PrivilegeFeature[];
628
- };
629
- };
630
- type OpeningFeaturePopulated = OpeningFeature & {
631
- properties: OpeningFeature["properties"] & {
632
- /**
633
- * [IMDF] Level that section is on
634
- */
635
- level: LevelFeaturePopulated;
636
- /**
637
- * [venue.in.th] Venue that level is in
638
- */
639
- venue: VenueFeaturePopulated;
640
- /**
641
- * [Derived] Level's ordinal that unit is on
642
- */
643
- ordinal: number;
644
- };
645
- };
646
- type SectionFeaturePopulated = SectionFeature & {
647
- properties: SectionFeature["properties"] & {
648
- /**
649
- * [IMDF] Level that section is on
650
- */
651
- level: LevelFeaturePopulated;
652
- /**
653
- * [venue.in.th] Venue that level is in
654
- */
655
- venue: VenueFeaturePopulated;
656
- /**
657
- * [Derived] Level's ordinal that unit is on
658
- */
659
- ordinal: number;
660
- };
661
- };
662
- type UnitFeaturePopulated = UnitFeature & {
663
- properties: UnitFeature["properties"] & {
664
- /**
665
- * [IMDF] Level that unit is on
666
- */
667
- level: LevelFeaturePopulated;
668
- /**
669
- * [venue.in.th] Venue that level is in
670
- */
671
- venue: VenueFeaturePopulated;
672
- /**
673
- * [Derived] Level's ordinal that unit is on
674
- */
675
- ordinal: number;
676
- /**
677
- * [Derived] Secion that unit is in
678
- */
679
- section?: SectionFeaturePopulated;
680
- };
681
- };
682
- type VenueFeaturePopulated = VenueFeature;
683
- type TaxonomyFeaturePopulated = TaxonomyFeature & {
684
- properties: TaxonomyFeature["properties"] & {
685
- venue: VenueFeaturePopulated;
686
- };
687
- };
688
- type Model3dPopulated = Model3dFeature & {
689
- properties: Model3dFeature["properties"] & {
690
- /**
691
- * [IMDF] Level that model 3D is on
692
- */
693
- level: LevelFeaturePopulated;
694
- };
695
- };
696
- type FeaturePopulatedResponseMap = {
697
- address: ImdfFeature;
698
- amenity: AmenityFeaturePopulated;
699
- anchor: AnchorFeaturePopulated;
700
- building: ImdfFeature;
701
- detail: DetailFeature;
702
- fixture: FixtureFeaturePopulated;
703
- footprint: ImdfFeature;
704
- geofence: ImdfFeature;
705
- kiosk: KioskFeaturePopulated;
706
- level: LevelFeaturePopulated;
707
- occupant: OccupantFeaturePopulated;
708
- opening: OpeningFeaturePopulated;
709
- relationship: RelationshipFeature;
710
- section: SectionFeaturePopulated;
711
- unit: UnitFeaturePopulated;
712
- venue: VenueFeaturePopulated;
713
- taxonomy: TaxonomyFeaturePopulated;
714
- privilege: PrivilegeFeature;
715
- event: EventFeature;
716
- promotion: PromotionFeature;
717
- label: LabelFeature;
718
- element: ImdfFeature;
719
- model3d: Model3dPopulated;
720
- "sponsored-content": SponsoredContentFeature;
721
- page: Page;
722
- };
723
- type PopulatableFeatureType = keyof FeaturePopulatedResponseMap;
724
-
725
- type Value = string | boolean | number;
726
- type EqFilter = Value;
727
- type InFilter = {
728
- $in: (Value)[];
729
- };
730
- type Filter = EqFilter | InFilter;
731
- type Filters = Record<string, Filter>;
732
-
733
- interface VenueClientOptions {
734
- mode?: "delivery" | "preview";
735
- projectId: string;
736
- apiKey?: string;
737
- previewToken?: string;
738
- baseUrl?: string;
739
- queryClient?: QueryClient;
740
- }
741
- interface FindParams {
742
- populate?: boolean;
743
- }
744
- interface FilterParams {
745
- populate?: boolean;
746
- filters?: Filters;
747
- }
748
- interface PopulatedParams {
749
- populate: true;
750
- }
751
- interface FeatureQueryOptions {
752
- refetchInterval?: number;
753
- staleTime?: number;
754
- cacheTime?: number;
755
- enabled?: boolean;
756
- retry?: boolean | number;
757
- }
758
- type InternalFindById = <T extends FeatureType>(id: Id) => Promise<FeatureResponseMap[T]>;
759
- type InternalFilterByType = <T extends FeatureType>(featureType: T) => Promise<FeatureResponseMap[T][]>;
760
- type SearchClient = {
761
- search: (txt: string) => FuseResult<ImdfFeature>[];
762
- };
763
- interface VenueDataClient {
764
- projectId: string;
765
- queryClient: QueryClient;
766
- registerObserver: (featureType: FeatureType, refetchInterval: number) => QueryObserver;
767
- destroyObserver: (featureType: FeatureType) => void;
768
- destroyObservers: () => void;
769
- createFilterByTypeQueryOptions: <T extends FeatureType = FeatureType>(featureType: T, params: FilterParams, options: FeatureQueryOptions) => EnsureQueryDataOptions<FeatureResponseMap[T][] | FeaturePopulatedResponseMap[T][]>;
770
- createFindByIdQueryOptions: <T extends FeatureType = FeatureType>(featureType: T, id: string, params: FindParams, options: FeatureQueryOptions) => EnsureQueryDataOptions<FeatureResponseMap[T] | FeaturePopulatedResponseMap[T]>;
771
- filterByType: <T extends FeatureType>(featureType: T, params?: FilterParams) => Promise<FeatureResponseMap[T][] | FeaturePopulatedResponseMap[T][]>;
772
- findById: <T extends FeatureType>(featureType: T, id: string, params?: FindParams) => Promise<FeatureResponseMap[T] | FeaturePopulatedResponseMap[T]>;
773
- search: (txt: string) => Promise<FuseResult<ImdfFeature>[]>;
774
- }
775
-
776
- declare const DEFAULT_BASE_URL = "https://service.venue.in.th/api";
777
- declare const IMDF_FEATURE_TYPES: FeatureType[];
778
- declare const NONIMDF_FEATURE_TYPES: FeatureType[];
779
- declare const GEOJSON_FEATURE_TYPES: FeatureType[];
780
- declare const ALL_FEATURE_TYPES: FeatureType[];
781
- declare const defaultFeatureQueryOptionsMap: Record<FeatureType, FeatureQueryOptions>;
782
-
783
- declare function fetchDeliveryApi<T extends FeatureType = FeatureType>(projectId: string, apiKey: string, featureType: FeatureType, baseUrl?: string): Promise<FeatureResponseMap[T][]>;
784
- declare function fetchPreviewApi<T extends FeatureType = FeatureType>(projectId: string, previewToken: string, featureType: FeatureType, baseUrl?: string): Promise<FeatureResponseMap[T][]>;
785
- declare const safeFetchFeature: <T extends FeatureType = FeatureType>(featureType: FeatureType, params: {
786
- mode: "delivery" | "preview";
787
- projectId: string;
788
- apiKey: string;
789
- previewToken?: string;
790
- baseUrl: string;
791
- }) => Promise<FeatureResponseMap[T][]>;
792
-
793
- /**
794
- * Checks if a point is a valid coordinate pair.
795
- *
796
- * @param point - The point to be checked.
797
- * @return True if the point is a valid coordinate pair, false otherwise.
798
- */
799
- declare const isValidCoordinate: (point: Position) => boolean;
800
- /**
801
- * Checks if an input represents a valid polygon, which may include holes.
802
- * The input can be a single array of coordinates for simple polygons, or
803
- * an array of arrays of coordinates for polygons with holes.
804
- *
805
- * @param polygon - The input representing a polygon.
806
- * @return True if the polygon is valid, false otherwise.
807
- */
808
- declare const isValidPolygonCoordinates: (polygon: Position[] | Position[][]) => boolean;
809
- /**
810
- * Checks if an array of polygons forms a valid MultiPolygon.
811
- *
812
- * @param multipolygon - The array of polygons.
813
- * @return True if the multipolygon is valid, false otherwise.
814
- */
815
- declare const isValidMultiPolygonCoordinates: (multipolygon: Position[][][]) => boolean;
816
- /**
817
- * Checks if a set of points forms a valid LineString.
818
- * A valid LineString must have at least two points, each point must be a valid coordinate,
819
- * and it should not form a closed loop.
820
- *
821
- * @param lineString - The array of points representing a LineString.
822
- * @return True if the LineString is valid, false otherwise.
823
- */
824
- declare const isValidLineStringCoordinates: (lineString: Position[]) => boolean;
825
- declare const isValidMultiPolygon: (geometry: Exclude<Geometry, GeometryCollection>) => boolean;
826
- declare const isValidPolygon: (geometry: Exclude<Geometry, GeometryCollection>) => boolean;
827
- declare const isValidLineString: (geometry: Exclude<Geometry, GeometryCollection>) => boolean;
828
- declare const isValidPoint: (geometry: Exclude<Geometry, GeometryCollection>) => boolean;
829
-
830
- declare function matchFilter(value: Value | Value[], filter: Filter): boolean;
831
- declare function matchFilters<T extends Record<string, any>>(item: T, filters: Filters): boolean;
832
-
833
- declare const getOccupantMainLocation: (occupant: OccupantFeaturePopulated) => UnitFeaturePopulated | KioskFeaturePopulated;
834
- declare const getOccupantCorrelatedLocations: (occupant: OccupantFeaturePopulated) => Array<UnitFeaturePopulated | KioskFeaturePopulated>;
835
- type OccupantMarkerPlacementType = 'ONCE_PER_LEVEL' | 'ALL_LOCATIONS';
836
- declare const getOccupantMarkerLocations: (occupant: OccupantFeaturePopulated, options?: {
837
- type: OccupantMarkerPlacementType;
838
- }) => Array<UnitFeaturePopulated | KioskFeaturePopulated>;
839
-
840
- type occupantHelper_OccupantMarkerPlacementType = OccupantMarkerPlacementType;
841
- declare const occupantHelper_getOccupantCorrelatedLocations: typeof getOccupantCorrelatedLocations;
842
- declare const occupantHelper_getOccupantMainLocation: typeof getOccupantMainLocation;
843
- declare const occupantHelper_getOccupantMarkerLocations: typeof getOccupantMarkerLocations;
844
- declare namespace occupantHelper {
845
- export { type occupantHelper_OccupantMarkerPlacementType as OccupantMarkerPlacementType, occupantHelper_getOccupantCorrelatedLocations as getOccupantCorrelatedLocations, occupantHelper_getOccupantMainLocation as getOccupantMainLocation, occupantHelper_getOccupantMarkerLocations as getOccupantMarkerLocations };
846
- }
847
-
848
- declare const getDataClient: (options: VenueClientOptions) => VenueDataClient;
849
-
850
- declare const getSearchClient: ({ occupants, amenities }: {
851
- occupants: OccupantFeaturePopulated[];
852
- amenities: AmenityFeature[];
853
- }) => SearchClient;
18
+ import 'fuse.js';
854
19
 
855
20
  type TextMarkerOptions = BaseObjectOptionType & {
856
21
  text?: string;
@@ -1254,7 +419,7 @@ declare function styledFeatureGenerator(mapTheme: any): {
1254
419
  createFixture: (feature: any) => any;
1255
420
  createLineStringFromGeometries: (geometries: any) => LineString$1;
1256
421
  create3DStepPath: (feature: any, threeLayer: any, option?: {}) => NavigationPath;
1257
- createDecoration: (decoration: any, options: any) => LineString$1 | Polygon$1 | MultiPolygon$1 | MultiLineString$1;
422
+ createDecoration: (decoration: any, options: any) => LineString$1 | Polygon | MultiPolygon | MultiLineString;
1258
423
  create3DBillboard: (billboard: any, threeLayer: any) => Billboard;
1259
424
  create3DAmenityMarker: (feature: any, threeLayer: any, config: any) => SpriteMarker;
1260
425
  create3DOccupantAmenityMarker: (feature: any, threeLayer: any, config: any) => SpriteMarker;
@@ -1283,7 +448,7 @@ type GetSuitablyValueBetweenBearings = (newBearing: number, currentBearing: numb
1283
448
  declare const getBearingBetweenPoints: GetBearingBetweenPoints;
1284
449
  declare const getSuitablyValueBetweenBearings: GetSuitablyValueBetweenBearings;
1285
450
 
1286
- declare const getCenterFromGeometry: (geometry?: Polygon | MultiPolygon | Point | LineString) => number[] | null;
451
+ declare const getCenterFromGeometry: (geometry?: Polygon$1 | MultiPolygon$1 | Point | LineString) => number[] | null;
1287
452
  declare const createPolygonFromLineString: (geometry: any) => geojson.Position[][];
1288
453
 
1289
454
  declare const BASE_LAYER_NAME = "base";
@@ -1347,4 +512,4 @@ declare const VENUE_EVENTS: {
1347
512
  VENUE_MOVEINTOVIEW: string;
1348
513
  };
1349
514
 
1350
- export { ALL_FEATURE_TYPES, type AmenityFeature, type AmenityFeaturePopulated, type AmenityGeometry, type AmenityProperties, type AnchorFeature, type AnchorFeaturePopulated, type AnchorGeometry, type AnchorProperties, BASE_LAYER_NAME, DEFAULT_BASE_URL, DEFAULT_LOCALE, DESTINATION_MARKER_ID, type DetailFeature, type DetailGeometry, type DetailProperties, type ElementFeature, type ElementGeometry, type ElementProperties, 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, HIGHLIGHT_LAYER_NAME, type IAllVenuesViewConfig, type IExtrudeConfig, type IGraphFeatureOptions, type IGraphOptions, type IHighlightOptions, IMDF_FEATURE_TYPES, type IMapAnimation, type IMapConfig, type IMapExtrudeConfig, type ISetHighlight2DElementIdsOptions, type IUnitDistanceModifier, type IVerticalGraphOptions, type Id, type ImdfFeature, IndoorMap, type IndoorMapOptions, type InternalFilterByType, type InternalFindById, type KioskFeature, type KioskFeaturePopulated, type KioskGeometry, type KioskProperties, LAST_USER_LOCATION_ELEMENT_ID_PREFIX, LAYERS, LAYER_FEATURE_TYPE_OBJ, LAYER_OPTIONS, LOCALE_SYMBOL_KEY, type LabelFeature, type LabelGeometry, type LabelProperties, type LevelFeature, type LevelFeaturePopulated, type LevelGeometry, type LevelProperties, MARKER_LAYER_NAME, type Media, type MediaFile, type Model3d, type Model3dFeature, type Model3dGeometry, type Model3dPopulated, type Model3dProperties, NONIMDF_FEATURE_TYPES, ORIGIN_MARKER_ID, type OccupantFeature, type OccupantFeaturePopulated, type OccupantGeometry, occupantHelper as OccupantHelpers, type OccupantProperties, type OpeningFeature, type OpeningFeaturePopulated, type OpeningGeometry, type OpeningProperties, POI_MARKER_LAYER_NAME, type Page, type PolygonalFeature, type PopulatableFeatureType, type PopulatedParams, type PrivilegeFeature, type PrivilegeGeometry, type PrivilegeProperties, type PromotionFeature, type PromotionProperties, type RelationshipFeature, type RelationshipGeometry, type RelationshipProperties, type SearchClient, type SectionFeature, type SectionFeaturePopulated, type SectionGeometry, type SectionProperties, type SingleGeometry, type SponsoredContentFeature, type SponsoredContentLegacyType, type SponsoredContentPlacementType, type SponsoredContentStrapiV4ApiResponse, type SymbolSet, type TaxonomyFeature, type TaxonomyFeaturePopulated, type TaxonomyGeometry, type TaxonomyProperties, type TextMarkerOptions, TextSpriteMarker, USER_LOCATION_ELEMENT_ID, USER_LOCATION_LAYER_NAME, type UnitFeature, type UnitFeaturePopulated, type UnitGeometry, type UnitProperties, VENUE_EVENTS, type VenueClientOptions, type VenueDataClient, type VenueFeature, type VenueFeaturePopulated, type VenueGeometry, type VenueProperties, createPolygonFromLineString, createSpriteMaterialByLabelSymbol, createStyledUIMarkerElement, defaultFeatureQueryOptionsMap, fetchDeliveryApi, fetchPreviewApi, getBearingBetweenPoints, getCenterFromGeometry, getDataClient, getExtrudeConfigByFeature, getFeatureByLocationId, getLocationByAmenity, getLocationByFeature, getLocationByOccupant, getLocationIdByFeature, getOrdinalByLocationId, getRelatedLocationIdsByFeature, getRelatedLocationsByAmenity, getRelatedLocationsByFeature, getRelatedLocationsByOccupant, getSearchClient, getSuitablyValueBetweenBearings, isClickableFeature, isValidCoordinate, isValidLineString, isValidLineStringCoordinates, isValidMultiPolygon, isValidMultiPolygonCoordinates, isValidPoint, isValidPolygon, isValidPolygonCoordinates, matchFilter, matchFilters, safeFetchFeature, styledFeatureGenerator };
515
+ export { BASE_LAYER_NAME, DEFAULT_LOCALE, DESTINATION_MARKER_ID, HIGHLIGHT_LAYER_NAME, type IAllVenuesViewConfig, type IExtrudeConfig, type IGraphFeatureOptions, type IGraphOptions, type IHighlightOptions, type IMapAnimation, type IMapConfig, type IMapExtrudeConfig, type ISetHighlight2DElementIdsOptions, type IUnitDistanceModifier, type IVerticalGraphOptions, IndoorMap, type IndoorMapOptions, LAST_USER_LOCATION_ELEMENT_ID_PREFIX, LAYERS, LAYER_FEATURE_TYPE_OBJ, LAYER_OPTIONS, LOCALE_SYMBOL_KEY, MARKER_LAYER_NAME, ORIGIN_MARKER_ID, POI_MARKER_LAYER_NAME, type SymbolSet, type TextMarkerOptions, TextSpriteMarker, USER_LOCATION_ELEMENT_ID, USER_LOCATION_LAYER_NAME, VENUE_EVENTS, VenueDataClient, createPolygonFromLineString, createSpriteMaterialByLabelSymbol, createStyledUIMarkerElement, getBearingBetweenPoints, getCenterFromGeometry, getExtrudeConfigByFeature, getFeatureByLocationId, getLocationByAmenity, getLocationByFeature, getLocationByOccupant, getLocationIdByFeature, getOrdinalByLocationId, getRelatedLocationIdsByFeature, getRelatedLocationsByAmenity, getRelatedLocationsByFeature, getRelatedLocationsByOccupant, getSuitablyValueBetweenBearings, isClickableFeature, styledFeatureGenerator };