react-native-radar 3.9.0 → 3.10.0-beta.1

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 (43) hide show
  1. package/android/build.gradle +2 -2
  2. package/dist/package.json +79 -0
  3. package/dist/src/@types/RadarNativeInterface.d.ts +51 -0
  4. package/dist/src/@types/RadarNativeInterface.js +2 -0
  5. package/dist/src/@types/types.d.ts +379 -0
  6. package/dist/src/@types/types.js +16 -0
  7. package/dist/src/helpers.d.ts +2 -0
  8. package/dist/src/helpers.js +11 -0
  9. package/dist/src/index.d.ts +8 -0
  10. package/dist/src/index.js +37 -0
  11. package/dist/src/index.native.d.ts +3 -0
  12. package/dist/src/index.native.js +136 -0
  13. package/dist/src/index.web.d.ts +73 -0
  14. package/dist/src/index.web.js +385 -0
  15. package/dist/src/ui/autocomplete.d.ts +4 -0
  16. package/dist/src/ui/autocomplete.js +213 -0
  17. package/dist/src/ui/images.d.ts +5 -0
  18. package/dist/src/ui/images.js +8 -0
  19. package/dist/src/ui/map.d.ts +5 -0
  20. package/dist/src/ui/map.js +112 -0
  21. package/dist/src/ui/styles.d.ts +2 -0
  22. package/dist/src/ui/styles.js +125 -0
  23. package/ios/Cartfile.resolved +1 -1
  24. package/package.json +14 -8
  25. package/react-native-radar.podspec +1 -1
  26. package/src/@types/RadarNativeInterface.ts +96 -0
  27. package/src/@types/types.ts +489 -0
  28. package/src/index.native.ts +272 -0
  29. package/src/index.ts +21 -0
  30. package/{js → src}/index.web.js +1 -1
  31. package/{js → src}/ui/autocomplete.jsx +3 -3
  32. package/js/index.js +0 -12
  33. package/js/index.native.js +0 -263
  34. /package/{js → src}/helpers.js +0 -0
  35. /package/{js → src}/ui/back.png +0 -0
  36. /package/{js → src}/ui/close.png +0 -0
  37. /package/{js → src}/ui/images.js +0 -0
  38. /package/{js → src}/ui/map-logo.png +0 -0
  39. /package/{js → src}/ui/map.jsx +0 -0
  40. /package/{js → src}/ui/marker.png +0 -0
  41. /package/{js → src}/ui/radar-logo.png +0 -0
  42. /package/{js → src}/ui/search.png +0 -0
  43. /package/{js → src}/ui/styles.js +0 -0
@@ -0,0 +1,489 @@
1
+ export interface RadarTrackOnceOptions {
2
+ location?: Location;
3
+ desiredAccuracy?: RadarTrackingOptionsDesiredAccuracy;
4
+ beacons?: boolean;
5
+ }
6
+
7
+ export interface RadarGetDistanceOptions {
8
+ origin?: Location;
9
+ destination?: Location;
10
+ modes: string[];
11
+ units: string;
12
+ }
13
+
14
+ export interface RadarUpdateTripOptions {
15
+ options: RadarTripOptions;
16
+ status: RadarTripStatus;
17
+ }
18
+
19
+ export interface RadarStartTripOptions {
20
+ tripOptions: RadarTripOptions;
21
+ trackingOptions: RadarTrackingOptions;
22
+ }
23
+
24
+ export interface RadarLocationCallback {
25
+ status: string;
26
+ location?: Location;
27
+ stopped?: boolean;
28
+ }
29
+
30
+ export interface RadarTrackCallback {
31
+ status: string;
32
+ location?: Location;
33
+ user?: RadarUser;
34
+ events?: RadarEvent[];
35
+ }
36
+
37
+ export type RadarPermissionsStatus =
38
+ | "GRANTED_FOREGROUND"
39
+ | "GRANTED_FOREGROUND"
40
+ | "DENIED"
41
+ | "NOT_DETERMINED"
42
+ | "UNKNOWN";
43
+
44
+ export type Event = "clientLocation" | "location" | "error" | "events";
45
+
46
+ export type RadarLogLevel = "info" | "debug" | "warning" | "error" | "none";
47
+
48
+ export interface RadarTrackTokenCallback {
49
+ status: string;
50
+ token?: String;
51
+ }
52
+
53
+ export interface RadarTripCallback {
54
+ status: string;
55
+ trip?: RadarTrip;
56
+ events?: RadarEvent[];
57
+ }
58
+
59
+ export interface RadarContextCallback {
60
+ status: string;
61
+ location?: Location;
62
+ context?: RadarContext;
63
+ }
64
+
65
+ export interface RadarSearchPlacesCallback {
66
+ status: string;
67
+ location?: Location;
68
+ places?: RadarPlace[];
69
+ }
70
+
71
+ export interface RadarSearchGeofencesCallback {
72
+ status: string;
73
+ location?: Location;
74
+ geofences?: RadarGeofence[];
75
+ }
76
+
77
+ export interface RadarSearchGeofencesOptions {
78
+ near?: Location;
79
+ radius: number;
80
+ metadata?: object;
81
+ tags?: string[];
82
+ limit: number;
83
+ }
84
+
85
+ export interface RadarGeocodeCallback {
86
+ status: string;
87
+ addresses?: RadarAddress[];
88
+ }
89
+
90
+ export interface RadarValidateAddressCallback {
91
+ status: string;
92
+ address?: RadarAddress;
93
+ verificationStatus?: RadarAddressVerificationStatus;
94
+ }
95
+
96
+ export interface RadarIPGeocodeCallback {
97
+ status: string;
98
+ address?: RadarAddress;
99
+ }
100
+
101
+ export interface RadarTrackingOptionsForegroundServiceOptions {
102
+ text?: string;
103
+ title?: string;
104
+ updatesOnly: boolean;
105
+ activity?: string;
106
+ importance?: number;
107
+ id?: number;
108
+ channelName?: string;
109
+ iconString?: string;
110
+ iconColor?: string;
111
+ }
112
+
113
+ export interface RadarRouteCallback {
114
+ status: string;
115
+ routes?: RadarRoutes;
116
+ }
117
+
118
+ export interface RadarLogConversionCallback {
119
+ status: string;
120
+ event: RadarEvent;
121
+ }
122
+
123
+ export interface RadarRouteMatrix {
124
+ status: string;
125
+ matrix?: object;
126
+ }
127
+
128
+ export interface RadarSearchPlacesOptions {
129
+ near?: Location;
130
+ radius: number;
131
+ chains?: string[];
132
+ chainMetadata?: object;
133
+ categories?: string[];
134
+ groups?: string[];
135
+ limit: number;
136
+ }
137
+
138
+ export interface Location {
139
+ latitude: number;
140
+ longitude: number;
141
+ accuracy?: number;
142
+ speed?: number;
143
+ altitude?: number;
144
+ course?: number;
145
+ verticalAccuracy?: number;
146
+ speedAccuracy?: number;
147
+ courseAccuracy?: number;
148
+ }
149
+
150
+ export interface RadarUser {
151
+ _id: string;
152
+ userId?: string;
153
+ deviceId?: string;
154
+ description?: string;
155
+ metadata?: object;
156
+ location?: RadarCoordinate;
157
+ geofences?: RadarGeofence[];
158
+ place?: RadarPlace;
159
+ beacons?: RadarBeacon[];
160
+ stopped?: boolean;
161
+ foreground?: boolean;
162
+ country?: RadarRegion;
163
+ state?: RadarRegion;
164
+ dma?: RadarRegion;
165
+ postalCode?: RadarRegion;
166
+ nearbyPlaceChains?: RadarPlace[];
167
+ segments?: RadarSegment[];
168
+ topChains?: RadarPlace[];
169
+ source?: LocationSource;
170
+ trip?: RadarTrip;
171
+ debug?: boolean;
172
+ fraud?: RadarFraud;
173
+ }
174
+ export interface RadarAutocompleteOptions {
175
+ query: string;
176
+ near?: Location;
177
+ layers?: string[];
178
+ limit: number;
179
+ country?: string;
180
+ expandUnits?: boolean;
181
+ }
182
+
183
+ export interface RadarCoordinate {
184
+ type: string;
185
+ coordinates: [number, number];
186
+ }
187
+
188
+ export type LocationSource =
189
+ | "FOREGROUND_LOCATION"
190
+ | "BACKGROUND_LOCATION"
191
+ | "MANUAL_LOCATION"
192
+ | "VISIT_ARRIVAL"
193
+ | "VISIT_DEPARTURE"
194
+ | "GEOFENCE_ENTER"
195
+ | "GEOFENCE_EXIT"
196
+ | "MOCK_LOCATION"
197
+ | "BEACON_ENTER"
198
+ | "BEACON_EXIT"
199
+ | "UNKNOWN";
200
+
201
+ export interface RadarTrip {
202
+ _id: string;
203
+ externalId: string;
204
+ metadata?: object;
205
+ destinationGeofenceTag?: string;
206
+ destinationGeofenceExternalId?: string;
207
+ mode?: string;
208
+ eta?: RadarTripEta;
209
+ status: string;
210
+ scheduledArrivalAt?: Date;
211
+ }
212
+
213
+ export interface RadarSegment {
214
+ description: string;
215
+ externalId: string;
216
+ }
217
+
218
+ export interface RadarContext {
219
+ geofences?: RadarGeofence[];
220
+ place?: RadarPlace;
221
+ country?: RadarRegion;
222
+ state?: RadarRegion;
223
+ dma?: RadarRegion;
224
+ postalCode?: RadarRegion;
225
+ }
226
+
227
+ export interface RadarEvent {
228
+ _id: string;
229
+ live: boolean;
230
+ type: RadarEventType;
231
+ geofence?: RadarGeofence;
232
+ place?: RadarPlace;
233
+ region?: RadarRegion;
234
+ confidence: RadarEventConfidence;
235
+ duration?: number;
236
+ beacon?: RadarBeacon;
237
+ trip?: RadarTrip;
238
+ alternatePlaces?: RadarPlace[];
239
+ location?: RadarCoordinate;
240
+ metadata?: object;
241
+ }
242
+
243
+ export enum RadarEventConfidence {
244
+ none = 0,
245
+ low = 1,
246
+ medium = 2,
247
+ high = 3,
248
+ }
249
+
250
+ export type RadarEventType =
251
+ | "unknown"
252
+ | "user.entered_geofence"
253
+ | "user.entered_beacon"
254
+ | "user.dwelled_in_geofence"
255
+ | "user.entered_place"
256
+ | "user.entered_region_country"
257
+ | "user.entered_region_dma"
258
+ | "user.entered_region_state"
259
+ | "user.entered_region_postal_code"
260
+ | "user.exited_geofence"
261
+ | "user.exited_beacon"
262
+ | "user.exited_place"
263
+ | "user.exited_region_country"
264
+ | "user.exited_region_dma"
265
+ | "user.exited_region_state"
266
+ | "user.exited_region_postal_code"
267
+ | "user.nearby_place_chain"
268
+ | "user.started_trip"
269
+ | "user.updated_trip"
270
+ | "user.approaching_trip_destination"
271
+ | "user.arrived_at_trip_destination"
272
+ | "user.stopped_trip";
273
+
274
+ export type RadarTrackingOptionsDesiredAccuracy =
275
+ | "high"
276
+ | "medium"
277
+ | "low"
278
+ | "none";
279
+
280
+ export enum RadarEventVerification {
281
+ accept = 1,
282
+ unverify = 0,
283
+ reject = -1,
284
+ }
285
+
286
+ export type RadarBeaconType = "eddystone" | "ibeacon";
287
+
288
+ export interface RadarGeofence {
289
+ _id: string;
290
+ description: string;
291
+ tag?: string;
292
+ externalId?: string;
293
+ metadata?: object;
294
+ type?: string;
295
+ geometryRadius?: number;
296
+ geometryCenter?: RadarCoordinate;
297
+ coordinates?: number[][];
298
+
299
+ }
300
+
301
+ export interface RadarBeacon {
302
+ _id: string;
303
+ metadata?: object;
304
+ type: RadarBeaconType;
305
+ uuid?: string;
306
+ instance?: string;
307
+ major?: string;
308
+ minor?: string;
309
+ geometry?: RadarCoordinate;
310
+ rss?: number;
311
+ }
312
+
313
+ export interface RadarPlace {
314
+ _id: string;
315
+ name: string;
316
+ categories: string[];
317
+ chain?: RadarChain;
318
+ }
319
+
320
+ export interface RadarChain {
321
+ name: string;
322
+ slug: string;
323
+ externalId?: string;
324
+ metadata?: object;
325
+ }
326
+
327
+ export interface RadarRegion {
328
+ _id: string;
329
+ type: string;
330
+ code: string;
331
+ name: string;
332
+ allowed?: boolean;
333
+ flag?:string;
334
+ }
335
+
336
+ export interface RadarLocationPermissionsCallback {
337
+ status: string;
338
+ }
339
+
340
+ export interface RadarAddress {
341
+ latitude: number;
342
+ longitude: number;
343
+ placeLabel?: string;
344
+ addressLabel?: string;
345
+ formattedAddress?: string;
346
+ country?: string;
347
+ countryCode?: string;
348
+ countryFlag?: string;
349
+ state?: string;
350
+ stateCode?: string;
351
+ postalCode?: string;
352
+ city?: string;
353
+ borough?: string;
354
+ county?: string;
355
+ neighborhood?: string;
356
+ number?: string;
357
+ distance?: number;
358
+ confidence?: string;
359
+ layer?: string;
360
+ plus4?: string;
361
+ }
362
+
363
+ export interface RadarAddressVerificationStatus {
364
+ status: string;
365
+ }
366
+
367
+ export interface RadarRoutes {
368
+ geodesic: RadarRoute;
369
+ foot?: RadarRoute;
370
+ bike?: RadarRoute;
371
+ car?: RadarRoute;
372
+ }
373
+
374
+ export interface RadarRoute {
375
+ distance?: RadarRouteDistance;
376
+ duration?: RadarRouteDuration;
377
+ }
378
+
379
+ export interface RadarRouteDistance {
380
+ value: number;
381
+ text: string;
382
+ }
383
+
384
+ export interface RadarNotificationOptions {
385
+ iconString?: string;
386
+ iconColor?: string;
387
+ foregroundServiceIconString?: string;
388
+ foregroundServiceIconColor?: string;
389
+ eventIconString?: string;
390
+ eventIconColor?: string;
391
+ }
392
+
393
+ export interface RadarRouteDuration {
394
+ value: number;
395
+ text: string;
396
+ }
397
+
398
+ export interface RadarTripEta {
399
+ distance?: number;
400
+ duration?: number;
401
+ }
402
+
403
+ export interface RadarFraud {
404
+ passed: boolean;
405
+ bypassed: boolean;
406
+ verified: boolean;
407
+ proxy: boolean;
408
+ mocked: boolean;
409
+ compromised: boolean;
410
+ jumped: boolean;
411
+ }
412
+
413
+ export interface RadarMockTrackingOptions {
414
+ origin: Location;
415
+ destination: Location;
416
+ mode: RadarRouteMode;
417
+ steps: number;
418
+ interval: number;
419
+ }
420
+
421
+ export type RadarTrackingOptionsReplay = "all" | "stops" | "none";
422
+
423
+ export type RadarTrackingOptionsSync = "none" | "stopsAndExits" | "all";
424
+
425
+ export interface RadarTrackingOptions {
426
+ desiredStoppedUpdateInterval: number;
427
+ fastestStoppedUpdateInterval: number;
428
+ desiredMovingUpdateInterval: number;
429
+ fastestMovingUpdateInterval: number;
430
+ desiredSyncInterval: number;
431
+ desiredAccuracy: RadarTrackingOptionsDesiredAccuracy;
432
+ stopDuration: number;
433
+ stopDistance: number;
434
+ startTrackingAfter?: Date;
435
+ stopTrackingAfter?: Date;
436
+ replay: RadarTrackingOptionsReplay;
437
+ sync: RadarTrackingOptionsSync;
438
+ showBlueBar: boolean;
439
+ useStoppedGeofence: boolean;
440
+ stoppedGeofenceRadius: number;
441
+ useMovingGeofence: boolean;
442
+ movingGeofenceRadius: number;
443
+ syncGeofences: boolean;
444
+ syncGeofencesLimit: number;
445
+ foregroundServiceEnabled: boolean;
446
+ beacons: boolean;
447
+ }
448
+
449
+ export interface RadarLogConversionOptions {
450
+ name: string;
451
+ revenue?: number;
452
+ metadata?: object;
453
+ }
454
+
455
+ export type RadarRouteMode = "foot" | "bike" | "car";
456
+
457
+ export interface RadarTrackingStatus {
458
+ isTracking: string;
459
+ }
460
+
461
+ export interface RadarTrackingOptionsForegroundService {
462
+ text?: string;
463
+ title?: string;
464
+ icon?: number;
465
+ updatesOnly?: boolean;
466
+ activity?: string;
467
+ importance?: number;
468
+ id?: number;
469
+ channelName?: string;
470
+ }
471
+
472
+ export interface RadarTripOptions {
473
+ externalId: string;
474
+ metadata?: object;
475
+ destinationGeofenceTag?: string;
476
+ destinationGeofenceExternalId?: string;
477
+ mode?: RadarRouteMode;
478
+ scheduledArrivalAt?: Date;
479
+ approachingThreshold?: number;
480
+ }
481
+
482
+ export type RadarTripStatus =
483
+ | "unknown"
484
+ | "started"
485
+ | "approaching"
486
+ | "arrived"
487
+ | "expired"
488
+ | "completed"
489
+ | "canceled";