@situm/react-native 3.0.10 → 3.1.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.
Files changed (77) hide show
  1. package/android/src/main/java/com/situm/plugin/PluginHelper.java +3 -2
  2. package/android/src/main/java/com/situm/plugin/SitumMapper.java +38 -59
  3. package/android/src/main/java/com/situm/plugin/SitumPlugin.java +1 -0
  4. package/android/src/main/java/com/situm/plugin/SitumPluginImpl.java +1 -1
  5. package/ios/SitumPlugin.m +8 -2
  6. package/lib/commonjs/sdk/index.js +509 -251
  7. package/lib/commonjs/sdk/index.js.map +1 -1
  8. package/lib/commonjs/sdk/nativeInterface.js.map +1 -1
  9. package/lib/commonjs/sdk/types/constants.js +31 -4
  10. package/lib/commonjs/sdk/types/constants.js.map +1 -1
  11. package/lib/commonjs/sdk/utils.js +103 -0
  12. package/lib/commonjs/sdk/utils.js.map +1 -0
  13. package/lib/commonjs/utils/requestPermission.js +9 -16
  14. package/lib/commonjs/utils/requestPermission.js.map +1 -1
  15. package/lib/commonjs/wayfinding/components/MapView.js +78 -134
  16. package/lib/commonjs/wayfinding/components/MapView.js.map +1 -1
  17. package/lib/commonjs/wayfinding/hooks/index.js +118 -278
  18. package/lib/commonjs/wayfinding/hooks/index.js.map +1 -1
  19. package/lib/commonjs/wayfinding/store/index.js +17 -6
  20. package/lib/commonjs/wayfinding/store/index.js.map +1 -1
  21. package/lib/commonjs/wayfinding/types/index.js +1 -3
  22. package/lib/commonjs/wayfinding/types/index.js.map +1 -1
  23. package/lib/commonjs/wayfinding/utils/mapper.js +128 -71
  24. package/lib/commonjs/wayfinding/utils/mapper.js.map +1 -1
  25. package/lib/module/sdk/index.js +509 -249
  26. package/lib/module/sdk/index.js.map +1 -1
  27. package/lib/module/sdk/nativeInterface.js.map +1 -1
  28. package/lib/module/sdk/types/constants.js +27 -3
  29. package/lib/module/sdk/types/constants.js.map +1 -1
  30. package/lib/module/sdk/utils.js +94 -0
  31. package/lib/module/sdk/utils.js.map +1 -0
  32. package/lib/module/utils/requestPermission.js +9 -16
  33. package/lib/module/utils/requestPermission.js.map +1 -1
  34. package/lib/module/wayfinding/components/MapView.js +77 -133
  35. package/lib/module/wayfinding/components/MapView.js.map +1 -1
  36. package/lib/module/wayfinding/hooks/index.js +119 -278
  37. package/lib/module/wayfinding/hooks/index.js.map +1 -1
  38. package/lib/module/wayfinding/store/index.js +15 -6
  39. package/lib/module/wayfinding/store/index.js.map +1 -1
  40. package/lib/module/wayfinding/types/index.js +1 -1
  41. package/lib/module/wayfinding/types/index.js.map +1 -1
  42. package/lib/module/wayfinding/utils/mapper.js +123 -72
  43. package/lib/module/wayfinding/utils/mapper.js.map +1 -1
  44. package/lib/typescript/src/sdk/index.d.ts +183 -145
  45. package/lib/typescript/src/sdk/index.d.ts.map +1 -1
  46. package/lib/typescript/src/sdk/nativeInterface.d.ts +59 -0
  47. package/lib/typescript/src/sdk/nativeInterface.d.ts.map +1 -1
  48. package/lib/typescript/src/sdk/types/constants.d.ts +24 -3
  49. package/lib/typescript/src/sdk/types/constants.d.ts.map +1 -1
  50. package/lib/typescript/src/sdk/types/index.d.ts +91 -146
  51. package/lib/typescript/src/sdk/types/index.d.ts.map +1 -1
  52. package/lib/typescript/src/sdk/utils.d.ts +53 -0
  53. package/lib/typescript/src/sdk/utils.d.ts.map +1 -0
  54. package/lib/typescript/src/utils/requestPermission.d.ts +1 -1
  55. package/lib/typescript/src/utils/requestPermission.d.ts.map +1 -1
  56. package/lib/typescript/src/wayfinding/components/MapView.d.ts +16 -28
  57. package/lib/typescript/src/wayfinding/components/MapView.d.ts.map +1 -1
  58. package/lib/typescript/src/wayfinding/hooks/index.d.ts +3 -34
  59. package/lib/typescript/src/wayfinding/hooks/index.d.ts.map +1 -1
  60. package/lib/typescript/src/wayfinding/store/index.d.ts +8 -6
  61. package/lib/typescript/src/wayfinding/store/index.d.ts.map +1 -1
  62. package/lib/typescript/src/wayfinding/types/index.d.ts +36 -17
  63. package/lib/typescript/src/wayfinding/types/index.d.ts.map +1 -1
  64. package/lib/typescript/src/wayfinding/utils/mapper.d.ts +16 -11
  65. package/lib/typescript/src/wayfinding/utils/mapper.d.ts.map +1 -1
  66. package/package.json +2 -2
  67. package/src/sdk/index.ts +467 -476
  68. package/src/sdk/nativeInterface.ts +149 -1
  69. package/src/sdk/types/constants.ts +27 -3
  70. package/src/sdk/types/index.ts +98 -158
  71. package/src/sdk/utils.ts +129 -0
  72. package/src/utils/requestPermission.ts +18 -23
  73. package/src/wayfinding/components/MapView.tsx +145 -215
  74. package/src/wayfinding/hooks/index.ts +155 -385
  75. package/src/wayfinding/store/index.tsx +19 -9
  76. package/src/wayfinding/types/index.ts +49 -15
  77. package/src/wayfinding/utils/mapper.ts +145 -104
@@ -1,4 +1,151 @@
1
- import { NativeEventEmitter, NativeModules } from "react-native";
1
+ import {
2
+ NativeEventEmitter,
3
+ type NativeModule,
4
+ NativeModules,
5
+ } from "react-native";
6
+
7
+ import type {
8
+ Building,
9
+ BuildingInfo,
10
+ Directions,
11
+ DirectionsOptions,
12
+ Error,
13
+ Floor,
14
+ Geofence,
15
+ Location,
16
+ LocationRequest,
17
+ NavigationRequest,
18
+ Poi,
19
+ PoiCategory,
20
+ PoiIcon,
21
+ Point,
22
+ } from "./types";
23
+
24
+ interface CartographyAPI {
25
+ fetchBuildings: (
26
+ onSuccess: (response: Building[]) => void,
27
+ onError: (error: Error) => void
28
+ ) => void;
29
+ fetchBuildingInfo: (
30
+ bluilding: Building,
31
+ onSuccess: (response: BuildingInfo) => void,
32
+ onError: (error: Error) => void
33
+ ) => void;
34
+ fetchTilesFromBuilding: (
35
+ building: Building,
36
+ onSuccess: (response: string) => void,
37
+ onError: (error: Error) => void
38
+ ) => void;
39
+ fetchFloorsFromBuilding: (
40
+ building: Building,
41
+ onSuccess: (response: Floor[]) => void,
42
+ onError: (error: Error) => void
43
+ ) => void;
44
+ fetchMapFromFloor: (
45
+ floor: Floor,
46
+ onSuccess: (response: string) => void,
47
+ onError: (error: Error) => void
48
+ ) => void;
49
+ fetchGeofencesFromBuilding: (
50
+ building: Building,
51
+ onSuccess: (response: Geofence[]) => void,
52
+ onError: (error: Error) => void
53
+ ) => void;
54
+ fetchPoiCategories: (
55
+ onSuccess: (response: PoiCategory[]) => void,
56
+ onError: (error: Error) => void
57
+ ) => void;
58
+ fetchPoiCategoryIconNormal: (
59
+ category: PoiCategory,
60
+ onSuccess: (response: PoiIcon) => void,
61
+ onError: (error: Error) => void
62
+ ) => void;
63
+ fetchPoiCategoryIconSelected: (
64
+ category: PoiCategory,
65
+ onSuccess: (response: PoiIcon) => void,
66
+ onError: (error: Error) => void
67
+ ) => void;
68
+ fetchIndoorPOIsFromBuilding: (
69
+ building: Building,
70
+ onSuccess: (response: Poi[]) => void,
71
+ onError: (error: Error) => void
72
+ ) => void;
73
+ fetchOutdoorPOIsFromBuilding: (
74
+ building: Building,
75
+ onSuccess: (response: Poi[]) => void,
76
+ onError: (error: Error) => void
77
+ ) => void;
78
+ checkIfPointInsideGeofence: (
79
+ request: any,
80
+ callback: (response: { isInsideGeofence: boolean; geofence: any }) => void
81
+ ) => void;
82
+ onEnterGeofences: () => void;
83
+ onExitGeofences: () => void;
84
+ }
85
+
86
+ interface LocationAPI {
87
+ startPositioning: (locationRequest?: LocationRequest) => void;
88
+ stopPositioning: (callback: (response: { success: boolean }) => void) => void;
89
+ }
90
+
91
+ interface NavigationAPI {
92
+ updateNavigationWithLocation: (
93
+ location: Location,
94
+ onSuccess: (response: void) => void,
95
+ onError: (error: Error) => void
96
+ ) => void;
97
+ }
98
+
99
+ interface DirectionsAPI {
100
+ requestDirections: (
101
+ directionsParameters: (
102
+ | Building
103
+ | (Point | Location | Poi)
104
+ | DirectionsOptions
105
+ )[],
106
+ onSuccess: (response: Directions) => void,
107
+ onError: (error: Error) => void
108
+ ) => void;
109
+ requestNavigationUpdates: (navigationOptions: NavigationRequest) => void;
110
+ removeNavigationUpdates: (
111
+ callback: (response: { success: boolean }) => void
112
+ ) => void;
113
+ }
114
+
115
+ export interface SitumPluginInterface
116
+ extends NativeModule,
117
+ CartographyAPI,
118
+ LocationAPI,
119
+ NavigationAPI,
120
+ DirectionsAPI {
121
+ initSitumSDK: () => void;
122
+ setApiKey: (
123
+ email: string,
124
+ apiKey: string,
125
+ callback: (response: { success: boolean }) => void
126
+ ) => void;
127
+ setUserPass: (
128
+ email: string,
129
+ password: string,
130
+ callback: (response: { success: boolean }) => void
131
+ ) => void;
132
+ setDashboardURL: (
133
+ url: string,
134
+ callback: (response: { success: boolean }) => void
135
+ ) => void;
136
+ setUseRemoteConfig: (
137
+ useRemoteConfig: string,
138
+ callback: (response: { success: boolean }) => void
139
+ ) => void;
140
+ setCacheMaxAge: (
141
+ cacheAge: number,
142
+ callback: (response: { success: boolean }) => void
143
+ ) => void;
144
+ invalidateCache: () => void;
145
+ getDeviceId: (callback: (response: string) => void) => void;
146
+ requestRealTimeUpdates: (options: any) => void;
147
+ removeRealTimeUpdates: () => void;
148
+ }
2
149
 
3
150
  const { RNCSitumPlugin } = NativeModules;
4
151
 
@@ -7,6 +154,7 @@ if (!RNCSitumPlugin) {
7
154
  }
8
155
 
9
156
  let nativeEventEmitter = null;
157
+
10
158
  module.exports = {
11
159
  RNCSitumPlugin,
12
160
  get SitumPluginEventEmitter() {
@@ -1,13 +1,20 @@
1
1
  export enum NavigationStatus {
2
2
  START = "start",
3
3
  STOP = "stop",
4
+ OUT_OF_ROUTE = "outOfRoute",
4
5
  UPDATE = "update",
5
6
  }
6
7
 
7
8
  export enum NavigationUpdateType {
8
- progress = "PROGRESS",
9
- userOutsideRoute = "OUT_OF_ROUTE",
10
- destinationReached = "DESTINATION_REACHED",
9
+ PROGRESS = "PROGRESS",
10
+ OUT_OF_ROUTE = "OUT_OF_ROUTE",
11
+ FINISHED = "DESTINATION_REACHED",
12
+ }
13
+
14
+ export enum SdkNavigationUpdateType {
15
+ PROGRESS = "progress",
16
+ OUT_OF_ROUTE = "userOutsideRoute",
17
+ FINISHED = "destinationReached",
11
18
  }
12
19
 
13
20
  export enum LocationStatusName {
@@ -19,3 +26,20 @@ export enum LocationStatusName {
19
26
  USER_NOT_IN_BUILDING = "USER_NOT_IN_BUILDING",
20
27
  STOPPED = "STOPPED",
21
28
  }
29
+
30
+ /**
31
+ * Available accessibility modes used in the {@link DirectionsRequest}.
32
+ *
33
+ * @property CHOOSE_SHORTEST The route should choose the best route, without taking into account if it is accessible or not
34
+ * This option is the default so you don't have to do anything in order to use it
35
+ * @property ONLY_ACCESSIBLE The route should always use accessible nodes.
36
+ * @property ONLY_NOT_ACCESSIBLE_FLOOR_CHANGES The route should never use accessible floor changes (use this to force routes not to use lifts).
37
+ */
38
+ export enum AccessibilityMode {
39
+ CHOOSE_SHORTEST = "CHOOSE_SHORTEST",
40
+ ONLY_ACCESSIBLE = "ONLY_ACCESSIBLE",
41
+ ONLY_NOT_ACCESSIBLE_FLOOR_CHANGES = "ONLY_NOT_ACCESSIBLE_FLOOR_CHANGES",
42
+ }
43
+
44
+ export const CURRENT_USER_LOCATION_ID = -1;
45
+ export const CUSTOM_DESTINATION_LOCATION_ID = -2;
@@ -1,9 +1,9 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
 
3
3
  import type {
4
+ AccessibilityMode,
4
5
  LocationStatusName,
5
- NavigationStatus,
6
- NavigationUpdateType,
6
+ SdkNavigationUpdateType,
7
7
  } from "src/sdk";
8
8
 
9
9
  /**
@@ -40,6 +40,25 @@ export type Building = {
40
40
  customFields: object;
41
41
  };
42
42
 
43
+ /**
44
+ * @name BuildingInfo
45
+ * @description Full information of a building
46
+ *
47
+ * @property {Building} building - Building basic information
48
+ * @property {Floor[]} floors - Array with the information of each floor
49
+ * @property {Poi[]} indoorPOIs - Array with the information of each indoor POI
50
+ * @property {Poi[]} outdoorPOIs - Array with the information of each outdoor POI
51
+ * @property {Geofence} geofences - Array with the information of each geofence
52
+ */
53
+
54
+ export type BuildingInfo = {
55
+ building: Building;
56
+ floors: Floor[];
57
+ indoorPOIs: Poi[];
58
+ outdoorPOIs: Poi[];
59
+ geofences: Geofence[];
60
+ };
61
+
43
62
  /** @name Bounds
44
63
  * @description Represents a rectangle bounds in a greographic 2D space.
45
64
  *
@@ -183,6 +202,16 @@ export type PoiCategory = {
183
202
  isPublic: boolean;
184
203
  };
185
204
 
205
+ /**
206
+ * @name PoiIcon
207
+ * @description Category of Point of Interest.
208
+ *
209
+ * @property {string} data - Base64 POI icon image
210
+ */
211
+ export type PoiIcon = {
212
+ data: string;
213
+ };
214
+
186
215
  /**
187
216
  * @name Point
188
217
  * @description Associate geographical coordinate (Location) with Building and Floor (Cartography) and cartesian coordinate relative to that building.
@@ -199,13 +228,8 @@ export type Point = {
199
228
  cartesianCoordinate: CartesianCoordinate;
200
229
  coordinate: Coordinate;
201
230
  floorIdentifier: string;
202
- isIndoor: boolean;
203
- isOutdoor: boolean;
204
- };
205
- export type DirectionPoint = {
206
- floorIdentifier: Floor["floorIdentifier"];
207
- buildingIdentifier: Building["buildingIdentifier"];
208
- coordinate: Coordinate;
231
+ isIndoor?: boolean;
232
+ isOutdoor?: boolean;
209
233
  };
210
234
 
211
235
  /**
@@ -281,24 +305,23 @@ export type RouteSegment = {
281
305
  * @property {string} orientationType - The Indication.Orientation of the instruction as String
282
306
  * @property {number} stepIdxDestination - The index of the indication's step of destination.
283
307
  * @property {number} stepIdxOrigin - The index of the indication's step of origin
284
- * @property {boolean} neededLevelChange - If the user should change the level in order to arrive to destination
308
+ * @property {boolean} neededLevelChange - If the user should change the level in order to arrive at the destination.
285
309
  */
286
310
  export type Indication = {
287
311
  distance: number;
288
312
  distanceToNextLevel: number;
289
313
  indicationType: string;
314
+ neededLevelChange: boolean;
290
315
  orientation: number;
291
316
  orientationType: string;
292
317
  stepIdxDestination: number;
293
318
  stepIdxOrigin: number;
294
- neededLevelChange: boolean;
295
319
  };
296
320
 
297
321
  /**
298
322
  * @name NavigationProgress
299
323
  * @description Provides information of the progress of a user while following a route.
300
324
  *
301
- * @property {Point} closestPointInRoute - Closest point in the route from the user location provided . @deprecated Use closestLocationInRoute instead.
302
325
  * @property {Location} closestLocationInRoute - Closest location in the route from the user location provided .
303
326
  * @property {number} distanceToClosestPointInRoute - Distance between the real user location (provided to updateWithLocation(Location)) and the closest route location.
304
327
  * @property {Indication} currentIndication - The current indication.
@@ -313,85 +336,23 @@ export type Indication = {
313
336
  * @property {RouteSegment[]} segments - List of segments formed by consecutive points and a floor identifier
314
337
  */
315
338
  export type NavigationProgress = {
316
- closestPointInRoute: Point;
317
339
  closestLocationInRoute: Location;
318
- distanceToClosestPointInRoute: number;
319
340
  currentIndication: number;
320
- nextIndication: Indication;
321
341
  currentStepIndex: number;
322
- distanceToGoal: number;
342
+ distanceToClosestPointInRoute: number;
323
343
  distanceToEndStep: number;
324
- timeToEndStep: number;
325
- timeToGoal: number;
326
- routeStep: RouteStep;
344
+ distanceToGoal: number;
345
+ nextIndication: Indication;
327
346
  points: Point[];
347
+ routeStep: RouteStep;
328
348
  segments: RouteSegment[];
349
+ timeToEndStep: number;
350
+ timeToGoal: number;
351
+ type: SdkNavigationUpdateType;
329
352
  };
330
353
 
331
354
  /**
332
- * @name SitumEvent
333
- * @description An event: POI with radius, conversion area and asociated statistics. It is intended for usage in marketing apps.
334
- *
335
- * @property {number} buildingIdentifier - The identifier of the building this floor belongs to. Deprecated, use trigger.center.buildingIdentifier instead
336
- * @property {number} identifier - Unique identifier of the SitumEvent.
337
- * @property {number} floorIdentifier - The identifier of the floor this event is located at. @deprecated, use trigger.center.floorIdentifier instead
338
- * @property {string} infoHtml - Information contained into the event, in HTML format.
339
- * @property {SitumConversionArea} conversionArea - Location where the event is located. @deprecated, use conversion instead
340
- * @property {Circle} conversion - Location where the event is located.
341
- * @property {Circle} trigger - Location where the event should be fired
342
- * @property {object} customFields - Key-value pairs that allow to extend and fully customize the information associated with the event.
343
- * @property {number} radius - Radius of the event associated area. @deprecated, use trigger.radius instead
344
- * @property {string} name - Name of the event
345
- * @property {number} x - Center of the event in the x-axis. @deprecated, use trigger.center.cartesianCoordinate.x instead
346
- * @property {number} y - Center of the event in the y-axis. @deprecated, use trigger.center.cartesianCoordinate.y instead
347
- */
348
- export type SitumEvent = {
349
- buildingIdentifier: number;
350
- identifier: number;
351
- floorIdentifier: number;
352
- infoHtml: string;
353
- conversionArea: SitumConversionArea;
354
- conversion: Circle;
355
- trigget: Circle;
356
- customFields: object;
357
- radius: number;
358
- name: string;
359
- x: number;
360
- y: number;
361
- };
362
-
363
- /**
364
- * @name SitumConversionArea
365
- * @description A rectangular area of a floor defining the conversion area of an event
366
- *
367
- * @property {number} floorIdentifier - The identifier of the floor the SitumConversionArea is located at.
368
- * @property {object} topLeft - Top-left corner
369
- * @property {object} topRight - Top-right corner
370
- * @property {object} bottomLeft - Bottom-left corner
371
- * @property {object} bottomRight - Bottom-right corner
372
- */
373
- export type SitumConversionArea = {
374
- floorIdentifier: number;
375
- topLeft: object;
376
- topRight: object;
377
- bottomLeft: object;
378
- bottomRight: object;
379
- };
380
-
381
- /**
382
- * @name Circle
383
- * @description A circular area
384
- *
385
- * @property {Point} center - The center of the circle
386
- * @property {number} radius - The radius of the circle
387
- */
388
- export type Circle = {
389
- center: Point;
390
- radius: number;
391
- };
392
-
393
- /**
394
- * @name LocationOptions
355
+ * @name LocationRequest
395
356
  * @description A data object that contains parameters for the location service, LocationManager.
396
357
  *
397
358
  * @property {number} buildingIdentifier - Identifier of the building on which the positioning will be started
@@ -399,72 +360,60 @@ export type Circle = {
399
360
  * @property {string} indoorProvider - Default indoor provider. Possible values are INPHONE and SUPPORT
400
361
  * @property {boolean} useBle - Defines whether or not to use BLE for positioning
401
362
  * @property {boolean} useWifi - Defines whether or not to use Wi-Fi for positioning
402
- * @property {boolean} useGps - Defines whether or not to use the GPS for indoor positioning
403
- * @property {boolean} useBarometer - Defines whether or not to use barometer for indoor positioning
404
- * @property {string} motionMode - Default motion mode. Possible values are BY_CAR, BY_FOOT and RADIOMAX
363
+ * @property {boolean} useGps - Defines whether or not to use GPS for indoor positioning
364
+ * @property {boolean} useBarometer - Defines whether or not to use the barometer for indoor positioning
365
+ * @property {string} motionMode - Default motion mode. Possible values are BY_CAR, BY_FOOT, and RADIOMAX
405
366
  * @property {boolean} useForegroundService - Defines whether or not to activate the {@link http://developers.situm.es/pages/android/using_situm_sdk_background.html foreground service}
406
- * @property {boolean} useDeadReckoning - Defines whether ot not to use dead reckoning to get fast position updates using only the inertial sensors, between the server position updates.
367
+ * @property {boolean} useDeadReckoning - Defines whether or not to use dead reckoning to get fast position updates using only the inertial sensors, between the server position updates.
407
368
  * @property {OutdoorLocationOptions} outdoorLocationOptions - Outdoor location options. Only used in an indoor/outdoor request
408
369
  * @property {BeaconFilter[]} beaconFilters - Deprecated - Beacon filters to be handled during scan time, otherwise only Situm beacons will be scanned. Can be invoked multiple times to add as much beacon filters as you want. The SitumSDK now does it automatically
409
- * @property {number} smallestDisplacement - Default smallest displacement to nofiy location updates
410
- * @property {string} realtimeUpdateInterval - Default interval to send locations to the Realtime. Possible values are REALTIME, FAST, NORMAL, SLOW and BATTERY_SAVER
411
- * @property {boolean} autoEnableBleDuringPositioning - Set if the BLE should be re-enabled during positioning if the ble is used. Android only
370
+ * @property {number} smallestDisplacement - Default smallest displacement to notify location updates
371
+ * @property {string} realtimeUpdateInterval - Default interval to send locations to the Realtime. Possible values are REALTIME, FAST, NORMAL, SLOW, and BATTERY_SAVER
412
372
  */
413
- export type LocationRequestOptions = {
373
+ export type LocationRequest = {
374
+ autoEnableBleDuringPositioning?: boolean;
375
+ beaconFilters?: BeaconFilter[];
414
376
  buildingIdentifier?: number;
415
- interval?: number;
416
377
  indoorProvider?: string;
417
- useBle?: boolean;
418
- useWifi?: boolean;
419
- useGps?: boolean;
420
- useBarometer?: boolean;
378
+ interval?: number;
421
379
  motionMode?: string;
422
- useForegroundService?: boolean;
423
- useDeadReckoning?: boolean;
424
380
  outdoorLocationOptions?: OutdoorLocationOptions;
425
- beaconFilters?: BeaconFilter[];
426
- smallestDisplacement?: number;
427
381
  realtimeUpdateInterval?: string;
428
- autoEnableBleDuringPositioning?: boolean;
429
- };
430
-
431
- /**
432
- * @name LocationRequest
433
- * @description A data object that contains parameters for the location service, LocationManager.
434
- *
435
- * @property {Building} building 0 - Building on which the positioning will be started
436
- * @property {LocationOptions} locationOptions 1 - Location options.
437
- */
438
- export type LocationRequest = {
439
- building: Building;
440
- locationOptions: LocationRequestOptions;
382
+ smallestDisplacement?: number;
383
+ useBarometer?: boolean;
384
+ useBle?: boolean;
385
+ useDeadReckoning?: boolean;
386
+ useForegroundService?: boolean;
387
+ useGps?: boolean;
388
+ useWifi?: boolean;
441
389
  };
442
390
 
443
391
  /**
444
392
  * @name NavigationRequest
445
- * @description A data object that contains parameters for the navigation service, NavigationManager.
393
+ * @description A data object that contains the request for navigation.
446
394
  *
447
- * @property {number} distanceToChangeIndicationThreshold - Distance threshold from when the next indication is considered reached.
448
- * @property {number} distanceToFloorChangeThreshold - Distance threshold from when a floor change is considered reached.
449
- * @property {number} distanceToGoalThreshold - Distance threshold from when the goal is considered reached.
450
- * @property {number} distanceToIgnoreFirstIndication - Maximum distance to ignore the first indication when navigating a route (Only available for Android).
451
- * @property {number} ignoreLowQualityLocations - Set if low quality locations should be ignored. (Only available for Android).
452
- * @property {number} indicationsInterval - Time to wait between indications.
453
- * @property {number} outsideRouteThreshold - Set the distance to consider the use is outside of the route. A type=userOutsideRoute will be sent trough the NavigationListener .
454
- * @property {number} roundIndicationsStep - Step that will be used to round indications distance.
455
- * @property {number} timeToFirstIndication - Time to wait until the first indication is returned.
456
- * @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).
395
+ * @property {number} distanceToGoalThreshold - Distance threshold to consider reaching the goal (meters).
396
+ * @property {number} distanceToIgnoreFirstIndication - Maximum distance to ignore the first indication when navigating (meters).
397
+ * @property {number} distanceToFloorChangeThreshold - Distance threshold from when a floor change is considered reached (meters).
398
+ * @property {number} distanceToChangeIndicationThreshold - Distance threshold to change the indication (meters).
399
+ * @property {boolean} ignoreLowQualityLocations - Ignore low-quality locations.
400
+ * @property {number} indicationsInterval - Interval between indications (milliseconds).
401
+ * @property {number} outsideRouteThreshold - Distance threshold to consider being outside the route (meters).
402
+ * @property {number} roundIndicationsStep - Step to round indications (meters).
403
+ * @property {number} timeToFirstIndication - Time to wait until the first indication is returned (milliseconds).
404
+ * @property {number} timeToIgnoreUnexpectedFloorChanges - Time to ignore the locations received during navigation, when the next indication is a floor change,
405
+ * if the locations are on a wrong floor (not in origin or destination floors) (milliseconds).
457
406
  */
458
407
  export type NavigationRequest = {
459
- distanceToIgnoreFirstIndication?: number;
460
- ignoreLowQualityLocations?: number;
461
- distanceToGoalThreshold?: number;
462
- outsideRouteThreshold?: number;
463
- distanceToFloorChangeThreshold?: number;
464
408
  distanceToChangeIndicationThreshold?: number;
409
+ distanceToFloorChangeThreshold?: number;
410
+ distanceToGoalThreshold?: number;
411
+ distanceToIgnoreFirstIndication?: number;
412
+ ignoreLowQualityLocations?: boolean;
465
413
  indicationsInterval?: number;
466
- timeToFirstIndication?: number;
414
+ outsideRouteThreshold?: number;
467
415
  roundIndicationsStep?: number;
416
+ timeToFirstIndication?: number;
468
417
  timeToIgnoreUnexpectedFloorChanges?: number;
469
418
  };
470
419
 
@@ -474,32 +423,29 @@ export type NavigationRequest = {
474
423
  *
475
424
  * @property {Building} positioningBuilding
476
425
  * @property {Point|Location} from - Current user's position as the starting point of the route.
477
- * @property {Point|POI} to - Point to, where the route should end.
426
+ * @property {Point|Poi} to - Point to, where the route should end.
478
427
  * @property {DirectionsOptions} options - Options that can be added to the request.
479
428
  */
480
429
  export type DirectionsRequest = {
481
- positioningBuilding: Building;
430
+ buildingIdentifier: string;
482
431
  from: Point | Location;
483
432
  to: Point | Poi;
484
- options: DirectionsOptions;
485
- };
433
+ } & DirectionsOptions;
486
434
 
487
435
  /**
488
436
  * @name DirectionsOptions
489
437
  * @description A data object that contains the directions options.
490
438
  *
491
439
  * @property {boolean} minimizeFloorChanges - Defines wheter or not the route should be calculated minimizing the floor changes even if the result is longer.
492
- * @property {boolean} accessibleRoute - Deprecated, use accessibilityMode. Defines wheter or not the route has to be suitable for wheel chairs (true) or not (false).
493
- * @property {boolean} accessible - Deprecated, use accessibilityMode. Defines wheter or not the route has to be suitable for wheel chairs (true) or not (false).
494
440
  * @property {string} accessibilityMode - Defines the accessibility mode of the route. Possible values are: CHOOSE_SHORTEST, ONLY_NOT_ACCESSIBLE_FLOOR_CHANGES, ONLY_ACCESSIBLE
495
441
  * @property {number} startingAngle - Current user's orientation in degrees.
496
442
  */
497
443
  export type DirectionsOptions = {
498
- minimizeFloorChanges: boolean;
499
- accessibleRoute: boolean;
500
- accessible: boolean;
501
- assebilityMode: string;
502
- startingAngle: number;
444
+ minimizeFloorChanges?: boolean;
445
+ accessibilityMode?: AccessibilityMode;
446
+ // startingAngle = bearingFrom
447
+ startingAngle?: number;
448
+ bearingFrom?: number;
503
449
  };
504
450
 
505
451
  /**
@@ -550,6 +496,17 @@ export type RealTimeData = {
550
496
  locations: Location[];
551
497
  };
552
498
 
499
+ export type SdkVersion = {
500
+ react_native: string;
501
+ ios?: string;
502
+ android?: string;
503
+ };
504
+
505
+ export type ConfigurationOptions = {
506
+ useRemoteConfig?: boolean;
507
+ cacheMaxAge?: number;
508
+ };
509
+
553
510
  export interface Location {
554
511
  position?: Position;
555
512
  accuracy?: number;
@@ -580,27 +537,10 @@ export interface LocationStatus {
580
537
  statusCode: number;
581
538
  }
582
539
 
583
- export interface SDKError {
540
+ export interface Error {
584
541
  code?: number;
585
542
  message: string;
586
543
  }
587
544
 
588
545
  // TODO: add types
589
546
  export type Directions = any;
590
-
591
- export interface SDKNavigation {
592
- //closestPositionInRoute: any;
593
- currentIndication?: any;
594
- //currentStepIndex:number;
595
- //distanceToEndStep: number;
596
- distanceToGoal?: number;
597
- //nextIndication: any;
598
- points?: any;
599
- routeStep?: any;
600
- segments?: any;
601
- route?: Directions;
602
- //timeToEndStep: number;
603
- //timeToGoal: number;
604
- type?: NavigationUpdateType;
605
- status: NavigationStatus;
606
- }