@situm/react-native 3.0.0-beta.5 → 3.0.0

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,10 +1,10 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  /* eslint-disable @typescript-eslint/ban-types */
3
3
 
4
- /** @name
5
- * Building
6
- * @description
7
- * A Building object definition
4
+ /**
5
+ * @name Building
6
+ * @description A Building object definition
7
+ *
8
8
  * @property {string} buildingIdentifier - The unique identifier of the resource
9
9
  * @property {string} name - The building name that is appropriate for display to the user.
10
10
  * @property {string} address - Te building address.
@@ -19,7 +19,6 @@
19
19
  * @property {string} userIdentifier - Unique identifier of the owner user of the building
20
20
  * @property {object} customFields - Map of custom fields, indexed by their name.
21
21
  */
22
-
23
22
  export type Building = {
24
23
  buildingIdentifier: string;
25
24
  name: string;
@@ -36,16 +35,14 @@ export type Building = {
36
35
  customFields: object;
37
36
  };
38
37
 
39
- /** @name
40
- * Bounds
41
- * @description
42
- * Represents a rectangle bounds in a greographic 2D space.
38
+ /** @name Bounds
39
+ * @description Represents a rectangle bounds in a greographic 2D space.
40
+ *
43
41
  * @property {Coordinate} northEast - The coordinate of the north-east corner of the bound.
44
42
  * @property {Coordinate} northWest - The coordinate of the north-west corner of the bound.
45
43
  * @property {Coordinate} southEast - The coordinate of the south-east corner of the bound.
46
44
  * @property {Coordinate} southWest - The coordinate of the south-east corner of the bound.
47
45
  */
48
-
49
46
  export type Bounds = {
50
47
  northEast: Coordinate;
51
48
  northWest: Coordinate;
@@ -53,52 +50,45 @@ export type Bounds = {
53
50
  southWest: Coordinate;
54
51
  };
55
52
 
56
- /** @name
57
- * Dimensions
58
- * @description
59
- * Define 2D dimensions of a rectangular area.
53
+ /** @name Dimensions
54
+ * @description Define 2D dimensions of a rectangular area.
55
+ *
60
56
  * @property {number} width - Width of rectangle in meters
61
57
  * @property {number} height - Height of rectangle in meters.
62
58
  */
63
-
64
59
  export type Dimensions = {
65
60
  width: number;
66
61
  height: number;
67
62
  };
68
63
 
69
64
  /**
70
- * @name
71
- * Coordinate
72
- * @description
73
- * A structure that contains geographical coordinate.
65
+ * @name Coordinate
66
+ * @description A structure that contains geographical coordinate.
67
+ *
74
68
  * @property {number} latitude - Latitude in degrees
75
69
  * @property {number} longitude - Longitude in degrees
76
70
  */
77
-
78
71
  export type Coordinate = {
79
72
  latitude: number;
80
73
  longitude: number;
81
74
  };
82
75
 
83
76
  /**
84
- * @name
85
- * CartesianCoordinate
86
- * @description
87
- * A structure that contains cartesian coordinate.
77
+ * @name CartesianCoordinate
78
+ * @description A structure that contains cartesian coordinate.
79
+ *
88
80
  * @property {number} x - Value of coordinate at x-axis
89
81
  * @property {number} y - Value of coordinate at y-axis
90
82
  */
91
-
92
83
  export type CartesianCoordinate = {
93
84
  x: number;
94
85
  y: number;
95
86
  };
96
87
 
97
88
  /**
98
- * @name
99
- * Floor
100
- * @description
101
- * Floor of a building.
89
+ * @name Floor
90
+ * @description Floor of a building.
91
+ *
102
92
  * @property {number} altitude - Altitude of the floor above ground level, in meters.
103
93
  * @property {string} buildingIdentifier - The identifier of building which this floor belongs.
104
94
  * @property {number} level - The number of the floor.
@@ -107,7 +97,6 @@ export type CartesianCoordinate = {
107
97
  * @property {number} scale - The scale of the floor image, in px/meters
108
98
  * @property {string} floorIdentifier - The unique identifier of the resource
109
99
  */
110
-
111
100
  export type Floor = {
112
101
  altitude: number;
113
102
  buildingIdentifier: string;
@@ -119,10 +108,9 @@ export type Floor = {
119
108
  };
120
109
 
121
110
  /**
122
- * @name
123
- * POI
124
- * @description
125
- * Point of Interest, associated to a building, regardless of whether it's place inside or outside the building.
111
+ * @name POI
112
+ * @description Point of Interest, associated to a building, regardless of whether it's place inside or outside the building.
113
+ *
126
114
  * @property {string} identifier - The unique identifier of the resource
127
115
  * @property {string} buildingIdentifier - Identifier of building to which the POI belongs.
128
116
  * @property {CartesianCoordinate} cartesianCoordinate - Cartesian coordinate of this position, relative to building {@link Bounds}.
@@ -136,7 +124,6 @@ export type Floor = {
136
124
  * @property {string} infoHtml - Additional information about POI, in HTML
137
125
  * @property {object} customFields - Map of custom fields, indexed by their name.
138
126
  */
139
-
140
127
  export type Poi = {
141
128
  identifier: string;
142
129
  buildingIdentifier: string;
@@ -153,10 +140,9 @@ export type Poi = {
153
140
  };
154
141
 
155
142
  /**
156
- * @name
157
- * Geofence
158
- * @description
159
- * Point of Interest, associated to a building, regardless of whether it's place inside or outside the building.
143
+ * @name Geofence
144
+ * @description Point of Interest, associated to a building, regardless of whether it's place inside or outside the building.
145
+ *
160
146
  * @property {string} identifier - The unique identifier of the resource
161
147
  * @property {string} buildingIdentifier - Identifier of building to which the POI belongs.
162
148
  * @property {string} floorIdentifier - If this POI is outside the building (isOutdoor == true), this field has no meaning.
@@ -165,7 +151,6 @@ export type Poi = {
165
151
  * @property {Point[]} polygonPoints - List of points of that define the area of the geofence
166
152
  * @property {object} customFields - Map of custom fields, indexed by their name.
167
153
  */
168
-
169
154
  export type Geofence = {
170
155
  identifier: string;
171
156
  buildingIdentifier: string;
@@ -176,17 +161,15 @@ export type Geofence = {
176
161
  };
177
162
 
178
163
  /**
179
- * @name
180
- * PoiCategory
181
- * @description
182
- * Category of Point of Interest.
164
+ * @name PoiCategory
165
+ * @description Category of Point of Interest.
166
+ *
183
167
  * @property {string} poiCategoryCode - Unique code of the category
184
168
  * @property {string} poiCategoryName - The category name appropriate for display to the user
185
169
  * @property {string} icon_selected - The selected icon url
186
170
  * @property {string} icon_unselected - The unselected icon url
187
171
  * @property {boolean} public - Whether the category is public or not
188
172
  */
189
-
190
173
  export type PoiCategory = {
191
174
  poiCategoryCode: string;
192
175
  poiCategoryName: string;
@@ -196,10 +179,9 @@ export type PoiCategory = {
196
179
  };
197
180
 
198
181
  /**
199
- * @name
200
- * Point
201
- * @description
202
- * Associate geographical coordinate (Location) with Building and Floor (Cartography) and cartesian coordinate relative to that building.
182
+ * @name Point
183
+ * @description Associate geographical coordinate (Location) with Building and Floor (Cartography) and cartesian coordinate relative to that building.
184
+ *
203
185
  * @property {string} buildingIdentifier - Unique identifier for the building to which this point belongs
204
186
  * @property {CartesianCoordinate} cartesianCoordinate - Cartesian coordinate (in meters) relative to the Bounds of building's base.
205
187
  * @property {Coordinate} coordinate - Geographic coordinate (latitude, longitude) of the point, regardless of whether it's placed inside or outside the building.
@@ -207,7 +189,6 @@ export type PoiCategory = {
207
189
  * @property {boolean} isIndoor - If the POI is inside the building.
208
190
  * @property {boolean} idOutdoor - If the POI is outside the building.
209
191
  */
210
-
211
192
  export type Point = {
212
193
  buildingIdentifier: string;
213
194
  cartesianCoordinate: CartesianCoordinate;
@@ -216,17 +197,16 @@ export type Point = {
216
197
  isIndoor: boolean;
217
198
  isOutdoor: boolean;
218
199
  };
219
-
220
200
  export type DirectionPoint = {
221
201
  floorIdentifier: Floor["floorIdentifier"];
222
202
  buildingIdentifier: Building["buildingIdentifier"];
223
203
  coordinate: Coordinate;
224
204
  };
205
+
225
206
  /**
226
- * @name
227
- * Route
228
- * @description
229
- * Route between two points.
207
+ * @name Route
208
+ * @description Route between two points.
209
+ *
230
210
  * @property {RouteStep[]} edges - Ordered list of steps to go to the goal point
231
211
  * @property {RouteStep} firstStep - First step
232
212
  * @property {Point} from - Point where the route starts.
@@ -238,7 +218,6 @@ export type DirectionPoint = {
238
218
  * @property {RouteStep[]} steps - Ordered list of steps to go to the goal point
239
219
  * @property {RouteSegment[]} segments - List of segments formed by consecutive points and a floor identifier
240
220
  */
241
-
242
221
  export type Route = {
243
222
  edges: RouteStep[];
244
223
  firstStep: RouteStep;
@@ -253,10 +232,9 @@ export type Route = {
253
232
  };
254
233
 
255
234
  /**
256
- * @name
257
- * RouteStep
258
- * @description
259
- * A fragment of a route, described by the initial point from and the last point to of the fragment, and some information about the step within the route.
235
+ * @name RouteStep
236
+ * @description A fragment of a route, described by the initial point from and the last point to of the fragment, and some information about the step within the route.
237
+ *
260
238
  * @property {number} distance - Distance between from and to in meters.
261
239
  * @property {number} distanceToGoal - Distance in meters between the start point of this step (from) and the last point in the route ('to' of the last step).
262
240
  * @property {Point} from - Start point of this step.
@@ -265,7 +243,6 @@ export type Route = {
265
243
  * @property {boolean} isFirst - Returns true if this is the first step in the route.
266
244
  * @property {boolean} isLast - Returns true if this is the last step in the route.
267
245
  */
268
-
269
246
  export type RouteStep = {
270
247
  distance: number;
271
248
  distanceToGoal: number;
@@ -277,24 +254,21 @@ export type RouteStep = {
277
254
  };
278
255
 
279
256
  /**
280
- * @name
281
- * RouteSegment
282
- * @description
283
- * A fragment of a route, described by a floor identifier and a list of consecutive points from the same floor
257
+ * @name RouteSegment
258
+ * @description A fragment of a route, described by a floor identifier and a list of consecutive points from the same floor
259
+ *
284
260
  * @property {string} floorIdentifier - Identifier of the floor containing the points in this segment
285
261
  * @property {Point[]} points - Consecutive points in the same floor forming a path
286
262
  */
287
-
288
263
  export type RouteSegment = {
289
264
  floorIdentifier: string;
290
265
  points: Point[];
291
266
  };
292
267
 
293
268
  /**
294
- * @name
295
- * Indication
296
- * @description
297
- * Represents the instruction that a user should follow when on a RouteStep to continue the route.
269
+ * @name Indication
270
+ * @description Represents the instruction that a user should follow when on a RouteStep to continue the route.
271
+ *
298
272
  * @property {number} distance - The distance between the origin and destination
299
273
  * @property {number} distanceToNextLevel - The number of levels between the origin and destination
300
274
  * @property {string} indicationType - The Indication.Action of the instruction as String
@@ -304,7 +278,6 @@ export type RouteSegment = {
304
278
  * @property {number} stepIdxOrigin - The index of the indication's step of origin
305
279
  * @property {boolean} neededLevelChange - If the user should change the level in order to arrive to destination
306
280
  */
307
-
308
281
  export type Indication = {
309
282
  distance: number;
310
283
  distanceToNextLevel: number;
@@ -317,10 +290,9 @@ export type Indication = {
317
290
  };
318
291
 
319
292
  /**
320
- * @name
321
- * NavigationProgress
322
- * @description
323
- * Provides information of the progress of a user while following a route.
293
+ * @name NavigationProgress
294
+ * @description Provides information of the progress of a user while following a route.
295
+ *
324
296
  * @property {Point} closestPointInRoute - Closest point in the route from the user location provided . @deprecated Use closestLocationInRoute instead.
325
297
  * @property {Location} closestLocationInRoute - Closest location in the route from the user location provided .
326
298
  * @property {number} distanceToClosestPointInRoute - Distance between the real user location (provided to updateWithLocation(Location)) and the closest route location.
@@ -335,7 +307,6 @@ export type Indication = {
335
307
  * @property {Point[]} points - List of ordered points of the remaining route
336
308
  * @property {RouteSegment[]} segments - List of segments formed by consecutive points and a floor identifier
337
309
  */
338
-
339
310
  export type NavigationProgress = {
340
311
  closestPointInRoute: Point;
341
312
  closestLocationInRoute: Location;
@@ -353,10 +324,9 @@ export type NavigationProgress = {
353
324
  };
354
325
 
355
326
  /**
356
- * @name
357
- * SitumEvent
358
- * @description
359
- * An event: POI with radius, conversion area and asociated statistics. It is intended for usage in marketing apps.
327
+ * @name SitumEvent
328
+ * @description An event: POI with radius, conversion area and asociated statistics. It is intended for usage in marketing apps.
329
+ *
360
330
  * @property {number} buildingIdentifier - The identifier of the building this floor belongs to. Deprecated, use trigger.center.buildingIdentifier instead
361
331
  * @property {number} identifier - Unique identifier of the SitumEvent.
362
332
  * @property {number} floorIdentifier - The identifier of the floor this event is located at. @deprecated, use trigger.center.floorIdentifier instead
@@ -370,7 +340,6 @@ export type NavigationProgress = {
370
340
  * @property {number} x - Center of the event in the x-axis. @deprecated, use trigger.center.cartesianCoordinate.x instead
371
341
  * @property {number} y - Center of the event in the y-axis. @deprecated, use trigger.center.cartesianCoordinate.y instead
372
342
  */
373
-
374
343
  export type SitumEvent = {
375
344
  buildingIdentifier: number;
376
345
  identifier: number;
@@ -387,17 +356,15 @@ export type SitumEvent = {
387
356
  };
388
357
 
389
358
  /**
390
- * @name
391
- * SitumConversionArea
392
- * @description
393
- * A rectangular area of a floor defining the conversion area of an event
359
+ * @name SitumConversionArea
360
+ * @description A rectangular area of a floor defining the conversion area of an event
361
+ *
394
362
  * @property {number} floorIdentifier - The identifier of the floor the SitumConversionArea is located at.
395
363
  * @property {object} topLeft - Top-left corner
396
364
  * @property {object} topRight - Top-right corner
397
365
  * @property {object} bottomLeft - Bottom-left corner
398
366
  * @property {object} bottomRight - Bottom-right corner
399
367
  */
400
-
401
368
  export type SitumConversionArea = {
402
369
  floorIdentifier: number;
403
370
  topLeft: object;
@@ -407,24 +374,21 @@ export type SitumConversionArea = {
407
374
  };
408
375
 
409
376
  /**
410
- * @name
411
- * Circle
412
- * @description
413
- * A circular area
377
+ * @name Circle
378
+ * @description A circular area
379
+ *
414
380
  * @property {Point} center - The center of the circle
415
381
  * @property {number} radius - The radius of the circle
416
382
  */
417
-
418
383
  export type Circle = {
419
384
  center: Point;
420
385
  radius: number;
421
386
  };
422
387
 
423
388
  /**
424
- * @name
425
- * LocationOptions
426
- * @description
427
- * A data object that contains parameters for the location service, LocationManager.
389
+ * @name LocationOptions
390
+ * @description A data object that contains parameters for the location service, LocationManager.
391
+ *
428
392
  * @property {number} buildingIdentifier - Identifier of the building on which the positioning will be started
429
393
  * @property {number} interval - Default interval (in milliseconds) to notify location updates
430
394
  * @property {string} indoorProvider - Default indoor provider. Possible values are INPHONE and SUPPORT
@@ -441,7 +405,6 @@ export type Circle = {
441
405
  * @property {string} realtimeUpdateInterval - Default interval to send locations to the Realtime. Possible values are REALTIME, FAST, NORMAL, SLOW and BATTERY_SAVER
442
406
  * @property {boolean} autoEnableBleDuringPositioning - Set if the BLE should be re-enabled during positioning if the ble is used. Android only
443
407
  */
444
-
445
408
  export type LocationRequestOptions = {
446
409
  buildingIdentifier: number;
447
410
  interval?: number;
@@ -461,25 +424,21 @@ export type LocationRequestOptions = {
461
424
  };
462
425
 
463
426
  /**
464
- * @name
465
- * LocationRequest
466
- * @description
467
- * A data object that contains parameters for the location service, LocationManager.
468
- * @type {array}
427
+ * @name LocationRequest
428
+ * @description A data object that contains parameters for the location service, LocationManager.
429
+ *
469
430
  * @property {Building} building 0 - Building on which the positioning will be started
470
431
  * @property {LocationOptions} locationOptions 1 - Location options.
471
432
  */
472
-
473
433
  export type LocationRequest = {
474
434
  building: Building;
475
435
  locationOptions: LocationRequestOptions;
476
436
  };
477
437
 
478
438
  /**
479
- * @name
480
- * NavigationRequest
481
- * @description
482
- * A data object that contains parameters for the navigation service, NavigationManager.
439
+ * @name NavigationRequest
440
+ * @description A data object that contains parameters for the navigation service, NavigationManager.
441
+ *
483
442
  * @property {number} distanceToChangeIndicationThreshold - Distance threshold from when the next indication is considered reached.
484
443
  * @property {number} distanceToFloorChangeThreshold - Distance threshold from when a floor change is considered reached.
485
444
  * @property {number} distanceToGoalThreshold - Distance threshold from when the goal is considered reached.
@@ -491,7 +450,6 @@ export type LocationRequest = {
491
450
  * @property {number} timeToFirstIndication - Time to wait until the first indication is returned.
492
451
  * @property {number} timeToIgnoreUnexpectedFloorChanges - Time (in millis) to ignore the locations received during navigation, when the next indication is a floor change, if the locations are in a wrong floor (not in origin or destination floors).
493
452
  */
494
-
495
453
  export type NavigationRequest = {
496
454
  distanceToIgnoreFirstIndication: number;
497
455
  ignoreLowQualityLocations: number;
@@ -506,16 +464,14 @@ export type NavigationRequest = {
506
464
  };
507
465
 
508
466
  /**
509
- * @name
510
- * DirectionsRequest
511
- * @description
512
- * A data object that contains the request for directions.
467
+ * @name DirectionsRequest
468
+ * @description A data object that contains the request for directions.
469
+ *
513
470
  * @property {Building} positioningBuilding
514
471
  * @property {Point|Location} from - Current user's position as the starting point of the route.
515
472
  * @property {Point|POI} to - Point to, where the route should end.
516
473
  * @property {DirectionsOptions} options - Options that can be added to the request.
517
474
  */
518
-
519
475
  export type DirectionsRequest = {
520
476
  positioningBuilding: Building;
521
477
  from: Point | Location;
@@ -524,17 +480,15 @@ export type DirectionsRequest = {
524
480
  };
525
481
 
526
482
  /**
527
- * @name
528
- * DirectionsOptions
529
- * @description
530
- * A data object that contains the directions options.
483
+ * @name DirectionsOptions
484
+ * @description A data object that contains the directions options.
485
+ *
531
486
  * @property {boolean} minimizeFloorChanges - Defines wheter or not the route should be calculated minimizing the floor changes even if the result is longer.
532
487
  * @property {boolean} accessibleRoute - Deprecated, use accessibilityMode. Defines wheter or not the route has to be suitable for wheel chairs (true) or not (false).
533
488
  * @property {boolean} accessible - Deprecated, use accessibilityMode. Defines wheter or not the route has to be suitable for wheel chairs (true) or not (false).
534
489
  * @property {string} accessibilityMode - Defines the accessibility mode of the route. Possible values are: CHOOSE_SHORTEST, ONLY_NOT_ACCESSIBLE_FLOOR_CHANGES, ONLY_ACCESSIBLE
535
490
  * @property {number} startingAngle - Current user's orientation in degrees.
536
491
  */
537
-
538
492
  export type DirectionsOptions = {
539
493
  minimizeFloorChanges: boolean;
540
494
  accessibleRoute: boolean;
@@ -544,16 +498,14 @@ export type DirectionsOptions = {
544
498
  };
545
499
 
546
500
  /**
547
- * @name
548
- * OutdoorLocationOptions
549
- * @description
550
- * Outdoor location options are only used in indoor-outdoor mode (Only available for Android)
501
+ * @name OutdoorLocationOptions
502
+ * @description Outdoor location options are only used in indoor-outdoor mode (Only available for Android)
503
+ *
551
504
  * @property {boolean} continuousMode - Environment detection continuous mode (true) or burst mode (false).
552
505
  * @property {boolean} userDefinedThreshold
553
506
  * @property {number} burstInterval - Interval to scan for GPS and detect the environment (in seconds).
554
507
  * @property {number} averageSnrThreshold
555
508
  */
556
-
557
509
  export type OutdoorLocationOptions = {
558
510
  continuousMode?: boolean;
559
511
  userDefinedThreshold?: boolean;
@@ -562,39 +514,33 @@ export type OutdoorLocationOptions = {
562
514
  };
563
515
 
564
516
  /**
565
- * @name
566
- * BeaconFilter
567
- * @description
568
- * Represents a BLE filter. Now the only field is the BLE proximity UUID
517
+ * @name BeaconFilter
518
+ * @description Represents a BLE filter. Now the only field is the BLE proximity UUID
519
+ *
569
520
  * @property {string} uuid - Assigns the proximity UUID
570
521
  */
571
-
572
522
  export type BeaconFilter = {
573
523
  uuid: string;
574
524
  };
575
525
 
576
526
  /**
577
- * @name
578
- * RealTimeRequest
579
- * @description
580
- * A data object that contains the parameters to process realtime data of the users.
527
+ * @name RealTimeRequest
528
+ * @description A data object that contains the parameters to process realtime data of the users.
529
+ *
581
530
  * @property {Building} building object
582
531
  * @property {int} pollTime - Interval in milliseconds (minimum is 3000ms).
583
532
  */
584
-
585
533
  export type RealTimeRequest = {
586
534
  building: Building;
587
535
  pollTime: number;
588
536
  };
589
537
 
590
538
  /**
591
- * @name
592
- * RealTimeData
593
- * @description
594
- * A data object that contains information of the location of users in realtime.
539
+ * @name RealTimeData
540
+ * @description A data object that contains information of the location of users in realtime.
541
+ *
595
542
  * @property {Array<Location>} locations object
596
543
  */
597
-
598
544
  export type RealTimeData = {
599
545
  locations: Location[];
600
546
  };
@@ -1,5 +1,5 @@
1
1
  // Definitions
2
- export type * from "./types";
2
+ export * from "./types";
3
3
 
4
4
  // Hook
5
5
  export { default as useSitum } from "./hooks";
@@ -1,9 +1,8 @@
1
- //@ts-ignore
2
- import { DirectionPoint } from "src/sdk/types";
1
+ import { DirectionPoint, Poi } from "src/sdk/types";
3
2
 
4
3
  import { ErrorName } from "../components/MapView";
5
4
 
6
- interface MapViewError {
5
+ export interface MapViewError {
7
6
  name: ErrorName;
8
7
  description: string;
9
8
  }
@@ -18,6 +17,7 @@ export interface WayfindingResult {
18
17
  status: string;
19
18
  message: string;
20
19
  }
20
+
21
21
  export interface OnPoiSelectedResult {
22
22
  buildingId: string;
23
23
  buildingName: string;
@@ -26,10 +26,12 @@ export interface OnPoiSelectedResult {
26
26
  poiId: string;
27
27
  poiName: string;
28
28
  }
29
+
29
30
  export interface OnPoiDeselectedResult {
30
31
  buildingId: string;
31
32
  buildingName: string;
32
33
  }
34
+
33
35
  export interface OnFloorChangedResult {
34
36
  buildingId: string;
35
37
  buildingName: string;
@@ -45,10 +47,12 @@ export interface Destination {
45
47
  name?: string;
46
48
  point: DirectionPoint;
47
49
  }
50
+
48
51
  export interface Navigation {
49
52
  status: string;
50
53
  destination?: Destination;
51
54
  }
55
+
52
56
  export interface OnNavigationResult {
53
57
  navigation: Navigation;
54
58
  error?: Error;
File without changes