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

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,13 +1,13 @@
1
1
  import { QueryClient, QueryObserver, EnsureQueryDataOptions } from '@tanstack/query-core';
2
2
  export { QueryObserver } from '@tanstack/query-core';
3
3
  import * as geojson from 'geojson';
4
- import { Position, Geometry, GeoJsonProperties, Feature, Point, Polygon, MultiPolygon, LineString, GeometryCollection } from 'geojson';
4
+ import { Position, Geometry, GeoJsonProperties, Feature, Point, Polygon, MultiPolygon, LineString, MultiLineString, GeometryCollection } from 'geojson';
5
5
  import * as maptalks_dist_core_Class from 'maptalks/dist/core/Class';
6
6
  import * as maptalks$1 from 'maptalks-gl';
7
7
  import { Map, Coordinate as Coordinate$1 } from 'maptalks-gl';
8
8
  import { BaseObject, ThreeLayer } from 'maptalks.three';
9
9
  import * as maptalks from 'maptalks';
10
- import { Coordinate, Extent, Marker, ui, LineString as LineString$1, Polygon as Polygon$1, MultiPolygon as MultiPolygon$1, MultiLineString } from 'maptalks';
10
+ import { Coordinate, Extent, Marker, ui, LineString as LineString$1, Polygon as Polygon$1, MultiPolygon as MultiPolygon$1, MultiLineString as MultiLineString$1 } from 'maptalks';
11
11
  import { BaseObjectOptionType, BarOptionType, ExtrudePolygonOptionType, ExtrudeLineOptionType } from 'maptalks.three/dist/type';
12
12
  import { PolygonOptionsType } from 'maptalks/dist/geometry/Polygon';
13
13
  import { LineStringOptionsType } from 'maptalks/dist/geometry/LineString';
@@ -102,6 +102,7 @@ type AmenityProperties = EntityTimestamps & {
102
102
  style: unknown;
103
103
  unit_ids: Id[];
104
104
  venue_id: Id;
105
+ hours: string | null;
105
106
  };
106
107
  type AmenityFeature = ImdfFeature<AmenityGeometry, AmenityProperties> & {
107
108
  feature_type: "amenity";
@@ -112,7 +113,7 @@ type DetailProperties = {
112
113
  [k: string]: any;
113
114
  };
114
115
  type DetailFeature = ImdfFeature<DetailGeometry, DetailProperties>;
115
- type FixtureGeometry = Point;
116
+ type FixtureGeometry = Polygon | MultiPolygon | LineString | MultiLineString;
116
117
  type FixtureProperties = EntityTimestamps & {
117
118
  anchor_id: Id | null;
118
119
  category: string;
@@ -125,7 +126,9 @@ type FixtureProperties = EntityTimestamps & {
125
126
  venue_id: Id;
126
127
  [k: string]: any;
127
128
  };
128
- type FixtureFeature = ImdfFeature<FixtureGeometry, FixtureProperties>;
129
+ type FixtureFeature = ImdfFeature<FixtureGeometry, FixtureProperties> & {
130
+ feature_type: "fixture";
131
+ };
129
132
  type KioskGeometry = Polygon | MultiPolygon;
130
133
  type KioskProperties = EntityTimestamps & {
131
134
  alt_name: string;
@@ -138,7 +141,9 @@ type KioskProperties = EntityTimestamps & {
138
141
  style: SymbolProperties;
139
142
  venue_id: Id;
140
143
  };
141
- type KioskFeature = ImdfFeature<KioskGeometry, KioskProperties>;
144
+ type KioskFeature = ImdfFeature<KioskGeometry, KioskProperties> & {
145
+ feature_type: "kiosk";
146
+ };
142
147
  type LevelGeometry = Polygon | MultiPolygon;
143
148
  type LevelProperties = EntityTimestamps & {
144
149
  alt_name: string | null;
@@ -148,7 +153,9 @@ type LevelProperties = EntityTimestamps & {
148
153
  properties: unknown;
149
154
  venue_id: Id;
150
155
  };
151
- type LevelFeature = ImdfFeature<LevelGeometry, LevelProperties>;
156
+ type LevelFeature = ImdfFeature<LevelGeometry, LevelProperties> & {
157
+ feature_type: "level";
158
+ };
152
159
  type OccupantGeometry = null;
153
160
  type OccupantProperties = EntityTimestamps & {
154
161
  anchor_id: Id;
@@ -189,11 +196,14 @@ type OccupantProperties = EntityTimestamps & {
189
196
  website_link: string | null;
190
197
  show_name_on_all_units: boolean;
191
198
  };
192
- type OccupantFeature = ImdfFeature<OccupantGeometry, OccupantProperties>;
199
+ type OccupantFeature = ImdfFeature<OccupantGeometry, OccupantProperties> & {
200
+ feature_type: "occupant";
201
+ };
202
+ type OpeningCategories = "automobile" | "bicycle" | "emergencyexit" | "pedestrian" | "pedestrian.principal" | "pedestrian.transit" | "service" | string;
193
203
  type OpeningGeometry = LineString;
194
204
  type OpeningProperties = EntityTimestamps & {
195
205
  alt_name: string;
196
- category: string;
206
+ category: OpeningCategories;
197
207
  door: {
198
208
  type: string;
199
209
  };
@@ -202,7 +212,9 @@ type OpeningProperties = EntityTimestamps & {
202
212
  style: SymbolProperties;
203
213
  venue_id: Id;
204
214
  };
205
- type OpeningFeature = ImdfFeature<OpeningGeometry, OpeningProperties>;
215
+ type OpeningFeature = ImdfFeature<OpeningGeometry, OpeningProperties> & {
216
+ feature_type: "opening";
217
+ };
206
218
  type RelationshipGeometry = Geometry | null;
207
219
  type RelationshipProperties = EntityTimestamps & {
208
220
  category: string;
@@ -456,9 +468,13 @@ type AmenityFeaturePopulated = AmenityFeature & {
456
468
  */
457
469
  units: UnitFeaturePopulated[];
458
470
  /**
459
- * [venue.in.th] Venue that kiosk is in
471
+ * [venue.in.th] Venue that amenity is in
460
472
  */
461
473
  venue: VenueFeaturePopulated;
474
+ /**
475
+ * [IMDF] Level that amenity is on
476
+ */
477
+ level: LevelFeaturePopulated;
462
478
  /**
463
479
  * [Derived] From units[0] --> level's ordinal
464
480
  * This is added during feature enrichment and not part of the original IMDF dataset.
@@ -516,6 +532,10 @@ type FixtureFeaturePopulated = FixtureFeature & {
516
532
  * [IMDF] Venue that kiosk is in
517
533
  */
518
534
  venue?: VenueFeaturePopulated;
535
+ /**
536
+ * [Derived] Level's ordinal that fixture is on
537
+ */
538
+ ordinal: number;
519
539
  };
520
540
  };
521
541
  type KioskFeaturePopulated = KioskFeature & {
@@ -542,6 +562,10 @@ type KioskFeaturePopulated = KioskFeature & {
542
562
  * This is added during feature enrichment and not part of the original IMDF dataset.
543
563
  */
544
564
  section?: SectionFeaturePopulated;
565
+ /**
566
+ * [Derived] Level's ordinal that fixture is on
567
+ */
568
+ ordinal: number;
545
569
  };
546
570
  };
547
571
  type LevelFeaturePopulated = LevelFeature & {
@@ -558,6 +582,9 @@ type OccupantFeaturePopulated = OccupantFeature & {
558
582
  * [IMDF] Occupant's position
559
583
  */
560
584
  anchor: AnchorFeaturePopulated;
585
+ /**
586
+ * [Derived] Level's ordinal that occupant is on
587
+ */
561
588
  ordinal: number;
562
589
  /**
563
590
  * [venue.in.th] Occupant's category
@@ -1201,7 +1228,7 @@ declare function styledFeatureGenerator(mapTheme: any): {
1201
1228
  createFixture: (feature: any) => any;
1202
1229
  createLineStringFromGeometries: (geometries: any) => LineString$1;
1203
1230
  create3DStepPath: (feature: any, threeLayer: any, option?: {}) => NavigationPath;
1204
- createDecoration: (decoration: any, options: any) => LineString$1 | Polygon$1 | MultiPolygon$1 | MultiLineString;
1231
+ createDecoration: (decoration: any, options: any) => LineString$1 | Polygon$1 | MultiPolygon$1 | MultiLineString$1;
1205
1232
  create3DBillboard: (billboard: any, threeLayer: any) => Billboard;
1206
1233
  create3DAmenityMarker: (feature: any, threeLayer: any, config: any) => SpriteMarker;
1207
1234
  create3DOccupantAmenityMarker: (feature: any, threeLayer: any, config: any) => SpriteMarker;
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import { QueryClient, QueryObserver, EnsureQueryDataOptions } from '@tanstack/query-core';
2
2
  export { QueryObserver } from '@tanstack/query-core';
3
3
  import * as geojson from 'geojson';
4
- import { Position, Geometry, GeoJsonProperties, Feature, Point, Polygon, MultiPolygon, LineString, GeometryCollection } from 'geojson';
4
+ import { Position, Geometry, GeoJsonProperties, Feature, Point, Polygon, MultiPolygon, LineString, MultiLineString, GeometryCollection } from 'geojson';
5
5
  import * as maptalks_dist_core_Class from 'maptalks/dist/core/Class';
6
6
  import * as maptalks$1 from 'maptalks-gl';
7
7
  import { Map, Coordinate as Coordinate$1 } from 'maptalks-gl';
8
8
  import { BaseObject, ThreeLayer } from 'maptalks.three';
9
9
  import * as maptalks from 'maptalks';
10
- import { Coordinate, Extent, Marker, ui, LineString as LineString$1, Polygon as Polygon$1, MultiPolygon as MultiPolygon$1, MultiLineString } from 'maptalks';
10
+ import { Coordinate, Extent, Marker, ui, LineString as LineString$1, Polygon as Polygon$1, MultiPolygon as MultiPolygon$1, MultiLineString as MultiLineString$1 } from 'maptalks';
11
11
  import { BaseObjectOptionType, BarOptionType, ExtrudePolygonOptionType, ExtrudeLineOptionType } from 'maptalks.three/dist/type';
12
12
  import { PolygonOptionsType } from 'maptalks/dist/geometry/Polygon';
13
13
  import { LineStringOptionsType } from 'maptalks/dist/geometry/LineString';
@@ -102,6 +102,7 @@ type AmenityProperties = EntityTimestamps & {
102
102
  style: unknown;
103
103
  unit_ids: Id[];
104
104
  venue_id: Id;
105
+ hours: string | null;
105
106
  };
106
107
  type AmenityFeature = ImdfFeature<AmenityGeometry, AmenityProperties> & {
107
108
  feature_type: "amenity";
@@ -112,7 +113,7 @@ type DetailProperties = {
112
113
  [k: string]: any;
113
114
  };
114
115
  type DetailFeature = ImdfFeature<DetailGeometry, DetailProperties>;
115
- type FixtureGeometry = Point;
116
+ type FixtureGeometry = Polygon | MultiPolygon | LineString | MultiLineString;
116
117
  type FixtureProperties = EntityTimestamps & {
117
118
  anchor_id: Id | null;
118
119
  category: string;
@@ -125,7 +126,9 @@ type FixtureProperties = EntityTimestamps & {
125
126
  venue_id: Id;
126
127
  [k: string]: any;
127
128
  };
128
- type FixtureFeature = ImdfFeature<FixtureGeometry, FixtureProperties>;
129
+ type FixtureFeature = ImdfFeature<FixtureGeometry, FixtureProperties> & {
130
+ feature_type: "fixture";
131
+ };
129
132
  type KioskGeometry = Polygon | MultiPolygon;
130
133
  type KioskProperties = EntityTimestamps & {
131
134
  alt_name: string;
@@ -138,7 +141,9 @@ type KioskProperties = EntityTimestamps & {
138
141
  style: SymbolProperties;
139
142
  venue_id: Id;
140
143
  };
141
- type KioskFeature = ImdfFeature<KioskGeometry, KioskProperties>;
144
+ type KioskFeature = ImdfFeature<KioskGeometry, KioskProperties> & {
145
+ feature_type: "kiosk";
146
+ };
142
147
  type LevelGeometry = Polygon | MultiPolygon;
143
148
  type LevelProperties = EntityTimestamps & {
144
149
  alt_name: string | null;
@@ -148,7 +153,9 @@ type LevelProperties = EntityTimestamps & {
148
153
  properties: unknown;
149
154
  venue_id: Id;
150
155
  };
151
- type LevelFeature = ImdfFeature<LevelGeometry, LevelProperties>;
156
+ type LevelFeature = ImdfFeature<LevelGeometry, LevelProperties> & {
157
+ feature_type: "level";
158
+ };
152
159
  type OccupantGeometry = null;
153
160
  type OccupantProperties = EntityTimestamps & {
154
161
  anchor_id: Id;
@@ -189,11 +196,14 @@ type OccupantProperties = EntityTimestamps & {
189
196
  website_link: string | null;
190
197
  show_name_on_all_units: boolean;
191
198
  };
192
- type OccupantFeature = ImdfFeature<OccupantGeometry, OccupantProperties>;
199
+ type OccupantFeature = ImdfFeature<OccupantGeometry, OccupantProperties> & {
200
+ feature_type: "occupant";
201
+ };
202
+ type OpeningCategories = "automobile" | "bicycle" | "emergencyexit" | "pedestrian" | "pedestrian.principal" | "pedestrian.transit" | "service" | string;
193
203
  type OpeningGeometry = LineString;
194
204
  type OpeningProperties = EntityTimestamps & {
195
205
  alt_name: string;
196
- category: string;
206
+ category: OpeningCategories;
197
207
  door: {
198
208
  type: string;
199
209
  };
@@ -202,7 +212,9 @@ type OpeningProperties = EntityTimestamps & {
202
212
  style: SymbolProperties;
203
213
  venue_id: Id;
204
214
  };
205
- type OpeningFeature = ImdfFeature<OpeningGeometry, OpeningProperties>;
215
+ type OpeningFeature = ImdfFeature<OpeningGeometry, OpeningProperties> & {
216
+ feature_type: "opening";
217
+ };
206
218
  type RelationshipGeometry = Geometry | null;
207
219
  type RelationshipProperties = EntityTimestamps & {
208
220
  category: string;
@@ -456,9 +468,13 @@ type AmenityFeaturePopulated = AmenityFeature & {
456
468
  */
457
469
  units: UnitFeaturePopulated[];
458
470
  /**
459
- * [venue.in.th] Venue that kiosk is in
471
+ * [venue.in.th] Venue that amenity is in
460
472
  */
461
473
  venue: VenueFeaturePopulated;
474
+ /**
475
+ * [IMDF] Level that amenity is on
476
+ */
477
+ level: LevelFeaturePopulated;
462
478
  /**
463
479
  * [Derived] From units[0] --> level's ordinal
464
480
  * This is added during feature enrichment and not part of the original IMDF dataset.
@@ -516,6 +532,10 @@ type FixtureFeaturePopulated = FixtureFeature & {
516
532
  * [IMDF] Venue that kiosk is in
517
533
  */
518
534
  venue?: VenueFeaturePopulated;
535
+ /**
536
+ * [Derived] Level's ordinal that fixture is on
537
+ */
538
+ ordinal: number;
519
539
  };
520
540
  };
521
541
  type KioskFeaturePopulated = KioskFeature & {
@@ -542,6 +562,10 @@ type KioskFeaturePopulated = KioskFeature & {
542
562
  * This is added during feature enrichment and not part of the original IMDF dataset.
543
563
  */
544
564
  section?: SectionFeaturePopulated;
565
+ /**
566
+ * [Derived] Level's ordinal that fixture is on
567
+ */
568
+ ordinal: number;
545
569
  };
546
570
  };
547
571
  type LevelFeaturePopulated = LevelFeature & {
@@ -558,6 +582,9 @@ type OccupantFeaturePopulated = OccupantFeature & {
558
582
  * [IMDF] Occupant's position
559
583
  */
560
584
  anchor: AnchorFeaturePopulated;
585
+ /**
586
+ * [Derived] Level's ordinal that occupant is on
587
+ */
561
588
  ordinal: number;
562
589
  /**
563
590
  * [venue.in.th] Occupant's category
@@ -1201,7 +1228,7 @@ declare function styledFeatureGenerator(mapTheme: any): {
1201
1228
  createFixture: (feature: any) => any;
1202
1229
  createLineStringFromGeometries: (geometries: any) => LineString$1;
1203
1230
  create3DStepPath: (feature: any, threeLayer: any, option?: {}) => NavigationPath;
1204
- createDecoration: (decoration: any, options: any) => LineString$1 | Polygon$1 | MultiPolygon$1 | MultiLineString;
1231
+ createDecoration: (decoration: any, options: any) => LineString$1 | Polygon$1 | MultiPolygon$1 | MultiLineString$1;
1205
1232
  create3DBillboard: (billboard: any, threeLayer: any) => Billboard;
1206
1233
  create3DAmenityMarker: (feature: any, threeLayer: any, config: any) => SpriteMarker;
1207
1234
  create3DOccupantAmenityMarker: (feature: any, threeLayer: any, config: any) => SpriteMarker;
package/dist/index.js CHANGED
@@ -447,6 +447,7 @@ var createPopulator = ({
447
447
  ...amenity.properties,
448
448
  ordinal: defaultLevel.properties.ordinal,
449
449
  level_name: defaultLevel.properties.name.en,
450
+ level: defaultLevel,
450
451
  units: populatedUnits,
451
452
  venue,
452
453
  _experimental_kiosk: kiosk ? await populateKiosk(kiosk) : null