@situm/react-native 3.0.0-beta.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 (147) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +656 -0
  3. package/ReactNativeSitumPlugin.podspec +22 -0
  4. package/SECURITY-POLICY.md +9 -0
  5. package/android/.gradle/5.6.4/fileChanges/last-build.bin +0 -0
  6. package/android/.gradle/5.6.4/fileHashes/fileHashes.lock +0 -0
  7. package/android/.gradle/5.6.4/gc.properties +0 -0
  8. package/android/.idea/.name +1 -0
  9. package/android/.idea/codeStyles/Project.xml +116 -0
  10. package/android/.idea/encodings.xml +6 -0
  11. package/android/.idea/misc.xml +31 -0
  12. package/android/.idea/sonarlint/issuestore/index.pb +15 -0
  13. package/android/.project +34 -0
  14. package/android/build.gradle +45 -0
  15. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  16. package/android/gradle/wrapper/gradle-wrapper.properties +6 -0
  17. package/android/gradlew +172 -0
  18. package/android/gradlew.bat +84 -0
  19. package/android/src/main/AndroidManifest.xml +6 -0
  20. package/android/src/main/java/com/situm/plugin/PluginHelper.java +989 -0
  21. package/android/src/main/java/com/situm/plugin/SitumMapper.java +1206 -0
  22. package/android/src/main/java/com/situm/plugin/SitumPackage.java +29 -0
  23. package/android/src/main/java/com/situm/plugin/SitumPlugin.java +84 -0
  24. package/android/src/main/java/com/situm/plugin/SitumPluginImpl.java +344 -0
  25. package/android/src/main/java/com/situm/plugin/utils/ReactNativeJson.java +122 -0
  26. package/android/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  27. package/android/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  28. package/android/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  29. package/android/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  30. package/android/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  31. package/android/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  32. package/android/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  33. package/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  34. package/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  35. package/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  36. package/android/src/main/res/values/strings.xml +3 -0
  37. package/android/src/main/res/values/styles.xml +9 -0
  38. package/ios/Constants.h +14 -0
  39. package/ios/Constants.m +14 -0
  40. package/ios/RNSitumReactNativePlugin.xcodeproj/project.pbxproj +272 -0
  41. package/ios/SitumLocationWrapper.h +112 -0
  42. package/ios/SitumLocationWrapper.m +1132 -0
  43. package/ios/SitumPlugin.h +15 -0
  44. package/ios/SitumPlugin.m +911 -0
  45. package/lib/commonjs/index.js +25 -0
  46. package/lib/commonjs/index.js.map +1 -0
  47. package/lib/commonjs/sdk/index.js +399 -0
  48. package/lib/commonjs/sdk/index.js.map +1 -0
  49. package/lib/commonjs/sdk/nativeInterface.js +20 -0
  50. package/lib/commonjs/sdk/nativeInterface.js.map +1 -0
  51. package/lib/commonjs/sdk/types/index.d.js +6 -0
  52. package/lib/commonjs/sdk/types/index.d.js.map +1 -0
  53. package/lib/commonjs/sdk/utils.js +22 -0
  54. package/lib/commonjs/sdk/utils.js.map +1 -0
  55. package/lib/commonjs/utils/requestPermission.js +73 -0
  56. package/lib/commonjs/utils/requestPermission.js.map +1 -0
  57. package/lib/commonjs/wayfinding/components/MapView.js +220 -0
  58. package/lib/commonjs/wayfinding/components/MapView.js.map +1 -0
  59. package/lib/commonjs/wayfinding/hooks/index.js +401 -0
  60. package/lib/commonjs/wayfinding/hooks/index.js.map +1 -0
  61. package/lib/commonjs/wayfinding/index.js +45 -0
  62. package/lib/commonjs/wayfinding/index.js.map +1 -0
  63. package/lib/commonjs/wayfinding/store/index.js +237 -0
  64. package/lib/commonjs/wayfinding/store/index.js.map +1 -0
  65. package/lib/commonjs/wayfinding/store/utils.js +44 -0
  66. package/lib/commonjs/wayfinding/store/utils.js.map +1 -0
  67. package/lib/commonjs/wayfinding/styles/colors.js +18 -0
  68. package/lib/commonjs/wayfinding/styles/colors.js.map +1 -0
  69. package/lib/commonjs/wayfinding/types/index.d.js +6 -0
  70. package/lib/commonjs/wayfinding/types/index.d.js.map +1 -0
  71. package/lib/commonjs/wayfinding/utils/index.js +11 -0
  72. package/lib/commonjs/wayfinding/utils/index.js.map +1 -0
  73. package/lib/commonjs/wayfinding/utils/mapper.js +106 -0
  74. package/lib/commonjs/wayfinding/utils/mapper.js.map +1 -0
  75. package/lib/module/index.js +6 -0
  76. package/lib/module/index.js.map +1 -0
  77. package/lib/module/sdk/index.js +390 -0
  78. package/lib/module/sdk/index.js.map +1 -0
  79. package/lib/module/sdk/nativeInterface.js +18 -0
  80. package/lib/module/sdk/nativeInterface.js.map +1 -0
  81. package/lib/module/sdk/types/index.d.js +2 -0
  82. package/lib/module/sdk/types/index.d.js.map +1 -0
  83. package/lib/module/sdk/utils.js +15 -0
  84. package/lib/module/sdk/utils.js.map +1 -0
  85. package/lib/module/utils/requestPermission.js +67 -0
  86. package/lib/module/utils/requestPermission.js.map +1 -0
  87. package/lib/module/wayfinding/components/MapView.js +207 -0
  88. package/lib/module/wayfinding/components/MapView.js.map +1 -0
  89. package/lib/module/wayfinding/hooks/index.js +392 -0
  90. package/lib/module/wayfinding/hooks/index.js.map +1 -0
  91. package/lib/module/wayfinding/index.js +12 -0
  92. package/lib/module/wayfinding/index.js.map +1 -0
  93. package/lib/module/wayfinding/store/index.js +202 -0
  94. package/lib/module/wayfinding/store/index.js.map +1 -0
  95. package/lib/module/wayfinding/store/utils.js +34 -0
  96. package/lib/module/wayfinding/store/utils.js.map +1 -0
  97. package/lib/module/wayfinding/styles/colors.js +11 -0
  98. package/lib/module/wayfinding/styles/colors.js.map +1 -0
  99. package/lib/module/wayfinding/types/index.d.js +2 -0
  100. package/lib/module/wayfinding/types/index.d.js.map +1 -0
  101. package/lib/module/wayfinding/utils/index.js +4 -0
  102. package/lib/module/wayfinding/utils/index.js.map +1 -0
  103. package/lib/module/wayfinding/utils/mapper.js +100 -0
  104. package/lib/module/wayfinding/utils/mapper.js.map +1 -0
  105. package/lib/typescript/src/index.d.ts +4 -0
  106. package/lib/typescript/src/index.d.ts.map +1 -0
  107. package/lib/typescript/src/sdk/index.d.ts +269 -0
  108. package/lib/typescript/src/sdk/index.d.ts.map +1 -0
  109. package/lib/typescript/src/sdk/nativeInterface.d.ts +2 -0
  110. package/lib/typescript/src/sdk/nativeInterface.d.ts.map +1 -0
  111. package/lib/typescript/src/sdk/utils.d.ts +7 -0
  112. package/lib/typescript/src/sdk/utils.d.ts.map +1 -0
  113. package/lib/typescript/src/utils/requestPermission.d.ts +3 -0
  114. package/lib/typescript/src/utils/requestPermission.d.ts.map +1 -0
  115. package/lib/typescript/src/wayfinding/components/MapView.d.ts +36 -0
  116. package/lib/typescript/src/wayfinding/components/MapView.d.ts.map +1 -0
  117. package/lib/typescript/src/wayfinding/hooks/index.d.ts +53 -0
  118. package/lib/typescript/src/wayfinding/hooks/index.d.ts.map +1 -0
  119. package/lib/typescript/src/wayfinding/index.d.ts +5 -0
  120. package/lib/typescript/src/wayfinding/index.d.ts.map +1 -0
  121. package/lib/typescript/src/wayfinding/store/index.d.ts +103 -0
  122. package/lib/typescript/src/wayfinding/store/index.d.ts.map +1 -0
  123. package/lib/typescript/src/wayfinding/store/utils.d.ts +9 -0
  124. package/lib/typescript/src/wayfinding/store/utils.d.ts.map +1 -0
  125. package/lib/typescript/src/wayfinding/styles/colors.d.ts +8 -0
  126. package/lib/typescript/src/wayfinding/styles/colors.d.ts.map +1 -0
  127. package/lib/typescript/src/wayfinding/utils/index.d.ts +3 -0
  128. package/lib/typescript/src/wayfinding/utils/index.d.ts.map +1 -0
  129. package/lib/typescript/src/wayfinding/utils/mapper.d.ts +17 -0
  130. package/lib/typescript/src/wayfinding/utils/mapper.d.ts.map +1 -0
  131. package/package.json +130 -0
  132. package/security.txt +4 -0
  133. package/src/index.ts +6 -0
  134. package/src/sdk/index.ts +656 -0
  135. package/src/sdk/nativeInterface.ts +18 -0
  136. package/src/sdk/types/index.d.ts +718 -0
  137. package/src/sdk/utils.ts +16 -0
  138. package/src/utils/requestPermission.ts +94 -0
  139. package/src/wayfinding/components/MapView.tsx +312 -0
  140. package/src/wayfinding/hooks/index.ts +539 -0
  141. package/src/wayfinding/index.tsx +11 -0
  142. package/src/wayfinding/store/index.tsx +254 -0
  143. package/src/wayfinding/store/utils.ts +40 -0
  144. package/src/wayfinding/styles/colors.tsx +6 -0
  145. package/src/wayfinding/types/index.d.ts +56 -0
  146. package/src/wayfinding/utils/index.ts +5 -0
  147. package/src/wayfinding/utils/mapper.ts +129 -0
@@ -0,0 +1,718 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ /* eslint-disable @typescript-eslint/ban-types */
3
+
4
+ /** @name
5
+ * Building
6
+ * @description
7
+ * A Building object definition
8
+ * @property {string} buildingIdentifier - The unique identifier of the resource
9
+ * @property {string} name - The building name that is appropriate for display to the user.
10
+ * @property {string} address - Te building address.
11
+ * @property {Bounds} bounds - Compute corners of this building, without rotation, in earth coordinates.
12
+ * @property {Bounds} boundsRotated - Compute corners of this building, with rotation, in earth coordinates.
13
+ * @property {Coordinate} center - Center of the building's base, as geographical coordinate.
14
+ * @property {Dimensions} Dimensions - Dimensions of building's base (height and width) in meters.
15
+ * @property {string} infoHtml - Additional information about building, formatted with HTML
16
+ * @property {string} pictureThumbUrl - The URL of building thumbnail image
17
+ * @property {string} pictureUrl - The URL of building image
18
+ * @property {number} rotation - Rotation angle of the building's base, relative to the west-east axis, increasing in counter-clockwise, being 0 the west-east axis.
19
+ * @property {string} userIdentifier - Unique identifier of the owner user of the building
20
+ * @property {object} customFields - Map of custom fields, indexed by their name.
21
+ */
22
+
23
+ export type Building = {
24
+ buildingIdentifier: string;
25
+ name: string;
26
+ address: string;
27
+ bounds: Bounds;
28
+ boundsRotated: Bounds;
29
+ center: Coordinate;
30
+ dimensions: Dimensions;
31
+ infoHtml: string;
32
+ pictureThumbUrl: string;
33
+ pictureUrl: string;
34
+ rotation: number;
35
+ userIdentifier: string;
36
+ customFields: object;
37
+ };
38
+
39
+ /** @name
40
+ * Bounds
41
+ * @description
42
+ * Represents a rectangle bounds in a greographic 2D space.
43
+ * @property {Coordinate} northEast - The coordinate of the north-east corner of the bound.
44
+ * @property {Coordinate} northWest - The coordinate of the north-west corner of the bound.
45
+ * @property {Coordinate} southEast - The coordinate of the south-east corner of the bound.
46
+ * @property {Coordinate} southWest - The coordinate of the south-east corner of the bound.
47
+ */
48
+
49
+ export type Bounds = {
50
+ northEast: Coordinate;
51
+ northWest: Coordinate;
52
+ southEast: Coordinate;
53
+ southWest: Coordinate;
54
+ };
55
+
56
+ /** @name
57
+ * Dimensions
58
+ * @description
59
+ * Define 2D dimensions of a rectangular area.
60
+ * @property {number} width - Width of rectangle in meters
61
+ * @property {number} height - Height of rectangle in meters.
62
+ */
63
+
64
+ export type Dimensions = {
65
+ width: number;
66
+ height: number;
67
+ };
68
+
69
+ /**
70
+ * @name
71
+ * Coordinate
72
+ * @description
73
+ * A structure that contains geographical coordinate.
74
+ * @property {number} latitude - Latitude in degrees
75
+ * @property {number} longitude - Longitude in degrees
76
+ */
77
+
78
+ export type Coordinate = {
79
+ latitude: number;
80
+ longitude: number;
81
+ };
82
+
83
+ /**
84
+ * @name
85
+ * CartesianCoordinate
86
+ * @description
87
+ * A structure that contains cartesian coordinate.
88
+ * @property {number} x - Value of coordinate at x-axis
89
+ * @property {number} y - Value of coordinate at y-axis
90
+ */
91
+
92
+ export type CartesianCoordinate = {
93
+ x: number;
94
+ y: number;
95
+ };
96
+
97
+ /**
98
+ * @name
99
+ * Floor
100
+ * @description
101
+ * Floor of a building.
102
+ * @property {number} altitude - Altitude of the floor above ground level, in meters.
103
+ * @property {string} buildingIdentifier - The identifier of building which this floor belongs.
104
+ * @property {number} level - The number of the floor.
105
+ * @property {string} name - The name of the floor
106
+ * @property {string} mapUrl - The floor map image url
107
+ * @property {number} scale - The scale of the floor image, in px/meters
108
+ * @property {string} floorIdentifier - The unique identifier of the resource
109
+ */
110
+
111
+ export type Floor = {
112
+ altitude: number;
113
+ buildingIdentifier: string;
114
+ level: number;
115
+ name: string;
116
+ mapUrl: string;
117
+ scale: number;
118
+ floorIdentifier: string;
119
+ };
120
+
121
+ /**
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.
126
+ * @property {string} identifier - The unique identifier of the resource
127
+ * @property {string} buildingIdentifier - Identifier of building to which the POI belongs.
128
+ * @property {CartesianCoordinate} cartesianCoordinate - Cartesian coordinate of this position, relative to building {@link Bounds}.
129
+ * @property {Coordinate} coordinate - Geographical coordinate of this position
130
+ * @property {string} floorIdentifier - If this POI is outside the building (isOutdoor == true), this field has no meaning.
131
+ * @property {string} poiName - A name for the POI, appropriate for display to the user.
132
+ * @property {Point} position - {@link Point} where the point is located.
133
+ * @property {boolean} isIndoor - Whether the POI is placed outside the building or not.
134
+ * @property {boolean} isOutdoor - Whether the POI is placed outside the building or not.
135
+ * @property {PoiCategory} category - Category of the POI
136
+ * @property {string} infoHtml - Additional information about POI, in HTML
137
+ * @property {object} customFields - Map of custom fields, indexed by their name.
138
+ */
139
+
140
+ export type Poi = {
141
+ identifier: string;
142
+ buildingIdentifier: string;
143
+ cartesianCoordinate: CartesianCoordinate;
144
+ coordinate: Coordinate;
145
+ floorIdentifier: string;
146
+ poiName: string;
147
+ position: Point;
148
+ isIndoor: boolean;
149
+ isOutdoor: boolean;
150
+ category: PoiCategory;
151
+ infoHtml: string;
152
+ customFields: object;
153
+ };
154
+
155
+ /**
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.
160
+ * @property {string} identifier - The unique identifier of the resource
161
+ * @property {string} buildingIdentifier - Identifier of building to which the POI belongs.
162
+ * @property {string} floorIdentifier - If this POI is outside the building (isOutdoor == true), this field has no meaning.
163
+ * @property {string} name - A name for the geofence, appropriate for display to the user.
164
+ * @property {string} infoHtml - Additional information about POI, in HTML
165
+ * @property {Point[]} polygonPoints - List of points of that define the area of the geofence
166
+ * @property {object} customFields - Map of custom fields, indexed by their name.
167
+ */
168
+
169
+ export type Geofence = {
170
+ identifier: string;
171
+ buildingIdentifier: string;
172
+ floorIdentifier: string;
173
+ infoHtml: string;
174
+ polygonPoints: Point[];
175
+ customFields: object;
176
+ };
177
+
178
+ /**
179
+ * @name
180
+ * PoiCategory
181
+ * @description
182
+ * Category of Point of Interest.
183
+ * @property {string} poiCategoryCode - Unique code of the category
184
+ * @property {string} poiCategoryName - The category name appropriate for display to the user
185
+ * @property {string} icon_selected - The selected icon url
186
+ * @property {string} icon_unselected - The unselected icon url
187
+ * @property {boolean} public - Whether the category is public or not
188
+ */
189
+
190
+ export type PoiCategory = {
191
+ poiCategoryCode: string;
192
+ poiCategoryName: string;
193
+ icon_selected: string;
194
+ icon_unselected: string;
195
+ isPublic: boolean;
196
+ };
197
+
198
+ /**
199
+ * @name
200
+ * Point
201
+ * @description
202
+ * Associate geographical coordinate (Location) with Building and Floor (Cartography) and cartesian coordinate relative to that building.
203
+ * @property {string} buildingIdentifier - Unique identifier for the building to which this point belongs
204
+ * @property {CartesianCoordinate} cartesianCoordinate - Cartesian coordinate (in meters) relative to the Bounds of building's base.
205
+ * @property {Coordinate} coordinate - Geographic coordinate (latitude, longitude) of the point, regardless of whether it's placed inside or outside the building.
206
+ * @property {string} floorIdentifier - Floor identifier (inside the building) where this point is placed.
207
+ * @property {boolean} isIndoor - If the POI is inside the building.
208
+ * @property {boolean} idOutdoor - If the POI is outside the building.
209
+ */
210
+
211
+ export type Point = {
212
+ buildingIdentifier: string;
213
+ cartesianCoordinate: CartesianCoordinate;
214
+ coordinate: Coordinate;
215
+ floorIdentifier: string;
216
+ isIndoor: boolean;
217
+ isOutdoor: boolean;
218
+ };
219
+ export type DirectionPoint = {
220
+ floorIdentifier: Floor["floorIdentifier"];
221
+ buildingIdentifier: Building["buildingIdentifier"];
222
+ coordinate: Coordinate;
223
+ };
224
+ /**
225
+ * @name
226
+ * Route
227
+ * @description
228
+ * Route between two points.
229
+ * @property {RouteStep[]} edges - Ordered list of steps to go to the goal point
230
+ * @property {RouteStep} firstStep - First step
231
+ * @property {Point} from - Point where the route starts.
232
+ * @property {Indication} indications - Ordered list of instructions to go to the destination
233
+ * @property {RouteStep} lastStep - Last step
234
+ * @property {Point[]} nodes - A collection of points of the route (not ordered)
235
+ * @property {Point[]} points - List of ordered points of the route
236
+ * @property {Point} to - Last point and goal of the route.
237
+ * @property {RouteStep[]} steps - Ordered list of steps to go to the goal point
238
+ * @property {RouteSegment[]} segments - List of segments formed by consecutive points and a floor identifier
239
+ */
240
+
241
+ export type Route = {
242
+ edges: RouteStep[];
243
+ firstStep: RouteStep;
244
+ from: Point;
245
+ indications: Indication;
246
+ lastStep: RouteStep;
247
+ nodes: Point[];
248
+ points: Point[];
249
+ to: Point;
250
+ steps: RouteStep[];
251
+ segments: RouteSegment[];
252
+ };
253
+
254
+ /**
255
+ * @name
256
+ * RouteStep
257
+ * @description
258
+ * 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.
259
+ * @property {number} distance - Distance between from and to in meters.
260
+ * @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).
261
+ * @property {Point} from - Start point of this step.
262
+ * @property {number} id - Position of this RouteStep in the list of steps (Route.steps) of the route to which it belongs.
263
+ * @property {Point} to - End point of this step.
264
+ * @property {boolean} isFirst - Returns true if this is the first step in the route.
265
+ * @property {boolean} isLast - Returns true if this is the last step in the route.
266
+ */
267
+
268
+ export type RouteStep = {
269
+ distance: number;
270
+ distanceToGoal: number;
271
+ from: Point;
272
+ id: number;
273
+ to: Point;
274
+ isFirst: boolean;
275
+ isLast: boolean;
276
+ };
277
+
278
+ /**
279
+ * @name
280
+ * RouteSegment
281
+ * @description
282
+ * A fragment of a route, described by a floor identifier and a list of consecutive points from the same floor
283
+ * @property {string} floorIdentifier - Identifier of the floor containing the points in this segment
284
+ * @property {Point[]} points - Consecutive points in the same floor forming a path
285
+ */
286
+
287
+ export type RouteSegment = {
288
+ floorIdentifier: string;
289
+ points: Point[];
290
+ };
291
+
292
+ /**
293
+ * @name
294
+ * Indication
295
+ * @description
296
+ * Represents the instruction that a user should follow when on a RouteStep to continue the route.
297
+ * @property {number} distance - The distance between the origin and destination
298
+ * @property {number} distanceToNextLevel - The number of levels between the origin and destination
299
+ * @property {string} indicationType - The Indication.Action of the instruction as String
300
+ * @property {number} orientation - The angle a user should change his direction in order to go from the origin to the destination.
301
+ * @property {string} orientationType - The Indication.Orientation of the instruction as String
302
+ * @property {number} stepIdxDestination - The index of the indication's step of destination.
303
+ * @property {number} stepIdxOrigin - The index of the indication's step of origin
304
+ * @property {boolean} neededLevelChange - If the user should change the level in order to arrive to destination
305
+ */
306
+
307
+ export type Indication = {
308
+ distance: number;
309
+ distanceToNextLevel: number;
310
+ indicationType: string;
311
+ orientation: number;
312
+ orientationType: string;
313
+ stepIdxDestination: number;
314
+ stepIdxOrigin: number;
315
+ neededLevelChange: boolean;
316
+ };
317
+
318
+ /**
319
+ * @name
320
+ * NavigationProgress
321
+ * @description
322
+ * Provides information of the progress of a user while following a route.
323
+ * @property {Point} closestPointInRoute - Closest point in the route from the user location provided . @deprecated Use closestLocationInRoute instead.
324
+ * @property {Location} closestLocationInRoute - Closest location in the route from the user location provided .
325
+ * @property {number} distanceToClosestPointInRoute - Distance between the real user location (provided to updateWithLocation(Location)) and the closest route location.
326
+ * @property {Indication} currentIndication - The current indication.
327
+ * @property {Indication} nextIndication - The next indication.
328
+ * @property {number} currentStepIndex - The index of the closest route step to the user, where closestLocationInRoute is.
329
+ * @property {number} distanceToGoal - The distance in meters from closestLocationInRoute to route's goal point.
330
+ * @property {number} distanceToEndStep - The distance in meters to go from closestLocationInRoute to the end of the current step.
331
+ * @property {number} timeToEndStep - The estimated time to go from closestLocationInRoute to the end of the current route step, considering a speed of 1 meter/second.
332
+ * @property {number} timeToGoal - The estimated time to go from closestLocationInRoute to the goal/end of route, considering a speed of 1 meter/second.
333
+ * @property {RouteStep} routeStep - The closest route step to the user, where closestLocationInRoute is.
334
+ * @property {Point[]} points - List of ordered points of the remaining route
335
+ * @property {RouteSegment[]} segments - List of segments formed by consecutive points and a floor identifier
336
+ */
337
+
338
+ export type NavigationProgress = {
339
+ closestPointInRoute: Point;
340
+ closestLocationInRoute: Location;
341
+ distanceToClosestPointInRoute: number;
342
+ currentIndication: number;
343
+ nextIndication: Indication;
344
+ currentStepIndex: number;
345
+ distanceToGoal: number;
346
+ distanceToEndStep: number;
347
+ timeToEndStep: number;
348
+ timeToGoal: number;
349
+ routeStep: RouteStep;
350
+ points: Point[];
351
+ segments: RouteSegment[];
352
+ };
353
+
354
+ /**
355
+ * @name
356
+ * SitumEvent
357
+ * @description
358
+ * An event: POI with radius, conversion area and asociated statistics. It is intended for usage in marketing apps.
359
+ * @property {number} buildingIdentifier - The identifier of the building this floor belongs to. Deprecated, use trigger.center.buildingIdentifier instead
360
+ * @property {number} identifier - Unique identifier of the SitumEvent.
361
+ * @property {number} floorIdentifier - The identifier of the floor this event is located at. @deprecated, use trigger.center.floorIdentifier instead
362
+ * @property {string} infoHtml - Information contained into the event, in HTML format.
363
+ * @property {SitumConversionArea} conversionArea - Location where the event is located. @deprecated, use conversion instead
364
+ * @property {Circle} conversion - Location where the event is located.
365
+ * @property {Circle} trigger - Location where the event should be fired
366
+ * @property {object} customFields - Key-value pairs that allow to extend and fully customize the information associated with the event.
367
+ * @property {number} radius - Radius of the event associated area. @deprecated, use trigger.radius instead
368
+ * @property {string} name - Name of the event
369
+ * @property {number} x - Center of the event in the x-axis. @deprecated, use trigger.center.cartesianCoordinate.x instead
370
+ * @property {number} y - Center of the event in the y-axis. @deprecated, use trigger.center.cartesianCoordinate.y instead
371
+ */
372
+
373
+ export type SitumEvent = {
374
+ buildingIdentifier: number;
375
+ identifier: number;
376
+ floorIdentifier: number;
377
+ infoHtml: string;
378
+ conversionArea: SitumConversionArea;
379
+ conversion: Circle;
380
+ trigget: Circle;
381
+ customFields: object;
382
+ radius: number;
383
+ name: string;
384
+ x: number;
385
+ y: number;
386
+ };
387
+
388
+ /**
389
+ * @name
390
+ * SitumConversionArea
391
+ * @description
392
+ * A rectangular area of a floor defining the conversion area of an event
393
+ * @property {number} floorIdentifier - The identifier of the floor the SitumConversionArea is located at.
394
+ * @property {object} topLeft - Top-left corner
395
+ * @property {object} topRight - Top-right corner
396
+ * @property {object} bottomLeft - Bottom-left corner
397
+ * @property {object} bottomRight - Bottom-right corner
398
+ */
399
+
400
+ export type SitumConversionArea = {
401
+ floorIdentifier: number;
402
+ topLeft: object;
403
+ topRight: object;
404
+ bottomLeft: object;
405
+ bottomRight: object;
406
+ };
407
+
408
+ /**
409
+ * @name
410
+ * Circle
411
+ * @description
412
+ * A circular area
413
+ * @property {Point} center - The center of the circle
414
+ * @property {number} radius - The radius of the circle
415
+ */
416
+
417
+ export type Circle = {
418
+ center: Point;
419
+ radius: number;
420
+ };
421
+
422
+ /**
423
+ * @name
424
+ * LocationOptions
425
+ * @description
426
+ * A data object that contains parameters for the location service, LocationManager.
427
+ * @property {number} buildingIdentifier - Identifier of the building on which the positioning will be started
428
+ * @property {number} interval - Default interval (in milliseconds) to notify location updates
429
+ * @property {string} indoorProvider - Default indoor provider. Possible values are INPHONE and SUPPORT
430
+ * @property {boolean} useBle - Defines whether or not to use BLE for positioning
431
+ * @property {boolean} useWifi - Defines whether or not to use Wi-Fi for positioning
432
+ * @property {boolean} useGps - Defines whether or not to use the GPS for indoor positioning
433
+ * @property {boolean} useBarometer - Defines whether or not to use barometer for indoor positioning
434
+ * @property {string} motionMode - Default motion mode. Possible values are BY_CAR, BY_FOOT and RADIOMAX
435
+ * @property {boolean} useForegroundService - Defines whether or not to activate the {@link http://developers.situm.es/pages/android/using_situm_sdk_background.html foreground service}
436
+ * @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.
437
+ * @property {OutdoorLocationOptions} outdoorLocationOptions - Outdoor location options. Only used in an indoor/outdoor request
438
+ * @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
439
+ * @property {number} smallestDisplacement - Default smallest displacement to nofiy location updates
440
+ * @property {string} realtimeUpdateInterval - Default interval to send locations to the Realtime. Possible values are REALTIME, FAST, NORMAL, SLOW and BATTERY_SAVER
441
+ * @property {boolean} autoEnableBleDuringPositioning - Set if the BLE should be re-enabled during positioning if the ble is used. Android only
442
+ */
443
+
444
+ export type LocationRequestOptions = {
445
+ buildingIdentifier: number;
446
+ interval: number;
447
+ indoorProvider: string;
448
+ useBle: boolean;
449
+ useWifi: boolean;
450
+ useGps: boolean;
451
+ useBarometer: boolean;
452
+ motionMode: string;
453
+ useForegroundService: boolean;
454
+ useDeadReckoning: boolean;
455
+ outdoorLocationOptions: OutdoorLocationOptions;
456
+ beaconFilters: BeaconFilter[];
457
+ smallestDisplacement: number;
458
+ realtimeUpdateInterval: string;
459
+ autoEnableBleDuringPositioning: boolean;
460
+ };
461
+
462
+ /**
463
+ * @name
464
+ * LocationRequest
465
+ * @description
466
+ * A data object that contains parameters for the location service, LocationManager.
467
+ * @type {array}
468
+ * @property {Building} building 0 - Building on which the positioning will be started
469
+ * @property {LocationOptions} locationOptions 1 - Location options.
470
+ */
471
+
472
+ export type LocationRequest = {
473
+ building: Building;
474
+ locationOptions: LocationRequestOptions;
475
+ };
476
+
477
+ /**
478
+ * @name
479
+ * NavigationRequest
480
+ * @description
481
+ * A data object that contains parameters for the navigation service, NavigationManager.
482
+ * @property {number} distanceToChangeIndicationThreshold - Distance threshold from when the next indication is considered reached.
483
+ * @property {number} distanceToFloorChangeThreshold - Distance threshold from when a floor change is considered reached.
484
+ * @property {number} distanceToGoalThreshold - Distance threshold from when the goal is considered reached.
485
+ * @property {number} distanceToIgnoreFirstIndication - Maximum distance to ignore the first indication when navigating a route (Only available for Android).
486
+ * @property {number} ignoreLowQualityLocations - Set if low quality locations should be ignored. (Only available for Android).
487
+ * @property {number} indicationsInterval - Time to wait between indications.
488
+ * @property {number} outsideRouteThreshold - Set the distance to consider the use is outside of the route. A type=userOutsideRoute will be sent trough the NavigationListener .
489
+ * @property {number} roundIndicationsStep - Step that will be used to round indications distance.
490
+ * @property {number} timeToFirstIndication - Time to wait until the first indication is returned.
491
+ * @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).
492
+ */
493
+
494
+ export type NavigationRequest = {
495
+ distanceToIgnoreFirstIndication: number;
496
+ ignoreLowQualityLocations: number;
497
+ distanceToGoalThreshold: number;
498
+ outsideRouteThreshold: number;
499
+ distanceToFloorChangeThreshold: number;
500
+ distanceToChangeIndicationThreshold: number;
501
+ indicationsInterval: number;
502
+ timeToFirstIndication: number;
503
+ roundIndicationsStep: number;
504
+ timeToIgnoreUnexpectedFloorChanges: number;
505
+ };
506
+
507
+ /**
508
+ * @name
509
+ * DirectionsRequest
510
+ * @description
511
+ * A data object that contains the request for directions.
512
+ * @property {Building} positioningBuilding
513
+ * @property {Point|Location} from - Current user's position as the starting point of the route.
514
+ * @property {Point|POI} to - Point to, where the route should end.
515
+ * @property {DirectionsOptions} options - Options that can be added to the request.
516
+ */
517
+
518
+ export type DirectionsRequest = {
519
+ positioningBuilding: Building;
520
+ from: Point | Location;
521
+ to: Point | Poi;
522
+ options: DirectionsOptions;
523
+ };
524
+
525
+ /**
526
+ * @name
527
+ * DirectionsOptions
528
+ * @description
529
+ * A data object that contains the directions options.
530
+ * @property {boolean} minimizeFloorChanges - Defines wheter or not the route should be calculated minimizing the floor changes even if the result is longer.
531
+ * @property {boolean} accessibleRoute - Deprecated, use accessibilityMode. Defines wheter or not the route has to be suitable for wheel chairs (true) or not (false).
532
+ * @property {boolean} accessible - Deprecated, use accessibilityMode. Defines wheter or not the route has to be suitable for wheel chairs (true) or not (false).
533
+ * @property {string} accessibilityMode - Defines the accessibility mode of the route. Possible values are: CHOOSE_SHORTEST, ONLY_NOT_ACCESSIBLE_FLOOR_CHANGES, ONLY_ACCESSIBLE
534
+ * @property {number} startingAngle - Current user's orientation in degrees.
535
+ */
536
+
537
+ export type DirectionsOptions = {
538
+ minimizeFloorChanges: boolean;
539
+ accessibleRoute: boolean;
540
+ accessible: boolean;
541
+ assebilityMode: string;
542
+ startingAngle: number;
543
+ };
544
+
545
+ /**
546
+ * @name
547
+ * OutdoorLocationOptions
548
+ * @description
549
+ * Outdoor location options are only used in indoor-outdoor mode (Only available for Android)
550
+ * @property {boolean} continuousMode - Environment detection continuous mode (true) or burst mode (false).
551
+ * @property {boolean} userDefinedThreshold
552
+ * @property {number} burstInterval - Interval to scan for GPS and detect the environment (in seconds).
553
+ * @property {number} averageSnrThreshold
554
+ */
555
+
556
+ export type OutdoorLocationOptions = {
557
+ continuousMode: boolean;
558
+ userDefinedThreshold: boolean;
559
+ burstInterval: number;
560
+ averageSnrThreshold: number;
561
+ };
562
+
563
+ /**
564
+ * @name
565
+ * BeaconFilter
566
+ * @description
567
+ * Represents a BLE filter. Now the only field is the BLE proximity UUID
568
+ * @property {string} uuid - Assigns the proximity UUID
569
+ */
570
+
571
+ export type BeaconFilter = {
572
+ uuid: string;
573
+ };
574
+
575
+ /**
576
+ * @name
577
+ * RealTimeRequest
578
+ * @description
579
+ * A data object that contains the parameters to process realtime data of the users.
580
+ * @property {Building} building object
581
+ * @property {int} pollTime - Interval in milliseconds (minimum is 3000ms).
582
+ */
583
+
584
+ export type RealTimeRequest = {
585
+ building: Building;
586
+ pollTime: number;
587
+ };
588
+
589
+ /**
590
+ * @name
591
+ * RealTimeData
592
+ * @description
593
+ * A data object that contains information of the location of users in realtime.
594
+ * @property {Array<Location>} locations object
595
+ */
596
+
597
+ export type RealTimeData = {
598
+ locations: Location[];
599
+ };
600
+
601
+ export interface SitumPluginStatic {
602
+ initSitumSDK(): void;
603
+
604
+ setApiKey(
605
+ email: string,
606
+ apiKey: string,
607
+ callback?: (success: boolean) => void
608
+ ): void;
609
+
610
+ setUserPass(
611
+ email: string,
612
+ password: string,
613
+ callback?: (success: boolean) => void
614
+ ): void;
615
+
616
+ setCacheMaxAge(cacheAge: number, callback?: (success: boolean) => void): void;
617
+
618
+ fetchBuildings(
619
+ success: (buildings: Array<Building>) => void,
620
+ error?: (error: string) => void
621
+ ): void;
622
+
623
+ fetchBuildingInfo(
624
+ building: Building,
625
+ success: (building: Building) => void,
626
+ error?: (error: string) => void
627
+ ): void;
628
+
629
+ fetchFloorsFromBuilding(
630
+ building: Building,
631
+ success: (floors: Array<Floor>) => void,
632
+ error?: (error: string) => void
633
+ ): void;
634
+
635
+ fetchMapFromFloor(floor: Floor, success: Function, error: Function): void;
636
+
637
+ fetchGeofencesFromBuilding(
638
+ building: Building,
639
+ success: (geofence: Array<Geofence>) => void,
640
+ error?: (error: string) => void
641
+ ): void;
642
+
643
+ startPositioning(
644
+ location: (location: Location) => void,
645
+ status: Function,
646
+ error?: Function,
647
+ locationOptions: LocationRequestOptions
648
+ ): void;
649
+
650
+ stopPositioning(success: Function, error?: Function): void;
651
+
652
+ requestDirections(
653
+ directionParams: Array<any>,
654
+ success: (route: Route) => void,
655
+ error?: Function
656
+ ): void;
657
+
658
+ fetchPoiCategories(success: Function, error?: Function): void;
659
+
660
+ fetchPoiCategoryIconNormal(
661
+ category: PoiCategory,
662
+ success: Function,
663
+ error?: Function
664
+ ): void;
665
+
666
+ fetchPoiCategoryIconSelected(
667
+ category: PoiCategory,
668
+ success: Function,
669
+ error?: Function
670
+ ): void;
671
+
672
+ requestNavigationUpdates(
673
+ navigationUpdates: Function,
674
+ error?: Function,
675
+ options?: LocationOptions
676
+ ): void;
677
+
678
+ updateNavigationWithLocation(
679
+ location,
680
+ success: Function,
681
+ error?: Function
682
+ ): void;
683
+
684
+ removeNavigationUpdates(callback?: Function): void;
685
+
686
+ fetchIndoorPOIsFromBuilding(
687
+ building: Building,
688
+ success: Function,
689
+ error?: Function
690
+ ): void;
691
+
692
+ fetchOutdoorPOIsFromBuilding(
693
+ building: Building,
694
+ success: Function,
695
+ error?: Function
696
+ ): void;
697
+
698
+ fetchEventsFromBuilding(
699
+ building: Building,
700
+ success: Function,
701
+ error?: Function
702
+ ): void;
703
+
704
+ requestRealTimeUpdates(
705
+ navigationUpdates: Function,
706
+ error?: Function,
707
+ request?: RealTimeRequest
708
+ ): void;
709
+
710
+ removeRealTimeUpdates(callback?: Function): void;
711
+
712
+ checkIfPointInsideGeofence(request: any, callback?: Function): void;
713
+
714
+ invalidateCache(callback: Function): void;
715
+ }
716
+
717
+ declare let SitumPlugin: SitumPluginStatic;
718
+ export default SitumPlugin;