react-native-radar 3.10.0-beta.2 → 3.10.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +1 -1
- package/dist/package.json +1 -1
- package/dist/src/@types/RadarNativeInterface.d.ts +9 -9
- package/dist/src/@types/types.d.ts +38 -24
- package/package.json +1 -1
- package/src/@types/RadarNativeInterface.ts +10 -9
- package/src/@types/types.ts +47 -29
- package/src/index.native.ts +10 -9
package/android/build.gradle
CHANGED
package/dist/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "React Native module for Radar, the leading geofencing and location tracking platform",
|
|
4
4
|
"homepage": "https://radar.com",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
-
"version": "3.10.0-beta.
|
|
6
|
+
"version": "3.10.0-beta.3",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"files": [
|
|
9
9
|
"android",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Location, RadarAutocompleteOptions, RadarContextCallback,
|
|
1
|
+
import { Location, RadarAutocompleteOptions, RadarContextCallback, RadarAddressCallback, RadarGetDistanceOptions, RadarLocationCallback, RadarLogConversionCallback, RadarLogConversionOptions, RadarLogLevel, RadarMockTrackingOptions, RadarNotificationOptions, RadarPermissionsStatus, RadarRouteCallback, RadarRouteMatrix, RadarSearchGeofencesCallback, RadarSearchGeofencesOptions, RadarSearchPlacesCallback, RadarSearchPlacesOptions, RadarStartTripOptions, RadarTrackCallback, RadarTrackOnceOptions, RadarTrackTokenCallback, RadarTrackingOptions, RadarTrackingOptionsDesiredAccuracy, RadarTrackingOptionsForegroundService, RadarTripCallback, RadarTripOptions, RadarUpdateTripOptions, Event, RadarListenerCallback, RadarGetMatrixOptions, RadarMetadata } from "./types";
|
|
2
2
|
export interface RadarNativeInterface {
|
|
3
3
|
initialize: (publishableKey: string, fraud: boolean) => void;
|
|
4
4
|
setLogLevel: (level: RadarLogLevel) => void;
|
|
@@ -6,8 +6,8 @@ export interface RadarNativeInterface {
|
|
|
6
6
|
getUserId: () => Promise<string>;
|
|
7
7
|
setDescription: (description: string) => void;
|
|
8
8
|
getDescription: () => Promise<string>;
|
|
9
|
-
setMetadata: (metadata:
|
|
10
|
-
getMetadata: () => Promise<
|
|
9
|
+
setMetadata: (metadata: RadarMetadata) => void;
|
|
10
|
+
getMetadata: () => Promise<RadarMetadata>;
|
|
11
11
|
setAnonymousTrackingEnabled: (enabled: boolean) => void;
|
|
12
12
|
getPermissionsStatus: () => Promise<RadarPermissionsStatus>;
|
|
13
13
|
requestPermissions: (background: boolean) => Promise<RadarPermissionsStatus>;
|
|
@@ -36,16 +36,16 @@ export interface RadarNativeInterface {
|
|
|
36
36
|
getContext: (location?: Location) => Promise<RadarContextCallback>;
|
|
37
37
|
searchPlaces: (options: RadarSearchPlacesOptions) => Promise<RadarSearchPlacesCallback>;
|
|
38
38
|
searchGeofences: (options: RadarSearchGeofencesOptions) => Promise<RadarSearchGeofencesCallback>;
|
|
39
|
-
autocomplete: (options: RadarAutocompleteOptions) => Promise<
|
|
40
|
-
geocode: (address: string) => Promise<
|
|
41
|
-
reverseGeocode: (location: any) => Promise<
|
|
42
|
-
ipGeocode: () => Promise<
|
|
39
|
+
autocomplete: (options: RadarAutocompleteOptions) => Promise<RadarAddressCallback>;
|
|
40
|
+
geocode: (address: string) => Promise<RadarAddressCallback>;
|
|
41
|
+
reverseGeocode: (location: any) => Promise<RadarAddressCallback>;
|
|
42
|
+
ipGeocode: () => Promise<RadarAddressCallback>;
|
|
43
43
|
getDistance: (option: RadarGetDistanceOptions) => Promise<RadarRouteCallback>;
|
|
44
44
|
getMatrix: (option: RadarGetMatrixOptions) => Promise<RadarRouteMatrix>;
|
|
45
45
|
logConversion: (options: RadarLogConversionOptions) => Promise<RadarLogConversionCallback>;
|
|
46
|
-
sendEvent: (name: string, metadata:
|
|
46
|
+
sendEvent: (name: string, metadata: RadarMetadata) => void;
|
|
47
47
|
on: (event: Event, callback: RadarListenerCallback) => void;
|
|
48
|
-
off: (event: Event, callback
|
|
48
|
+
off: (event: Event, callback?: Function | undefined) => void;
|
|
49
49
|
nativeSdkVersion: () => Promise<string>;
|
|
50
50
|
rnSdkVersion: () => string;
|
|
51
51
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type RadarMetadata = Record<string, string | number | boolean>;
|
|
1
2
|
export interface RadarTrackOnceOptions {
|
|
2
3
|
location?: Location;
|
|
3
4
|
desiredAccuracy?: RadarTrackingOptionsDesiredAccuracy;
|
|
@@ -35,7 +36,7 @@ export interface RadarTrackCallback {
|
|
|
35
36
|
events?: RadarEvent[];
|
|
36
37
|
}
|
|
37
38
|
export type RadarPermissionsStatus = "GRANTED_FOREGROUND" | "GRANTED_FOREGROUND" | "DENIED" | "NOT_DETERMINED" | "UNKNOWN";
|
|
38
|
-
export type Event = "clientLocation" | "location" | "error" | "events";
|
|
39
|
+
export type Event = "clientLocation" | "location" | "error" | "events" | "log";
|
|
39
40
|
export type RadarLogLevel = "info" | "debug" | "warning" | "error" | "none";
|
|
40
41
|
export interface RadarTrackTokenCallback {
|
|
41
42
|
status: string;
|
|
@@ -64,11 +65,11 @@ export interface RadarSearchGeofencesCallback {
|
|
|
64
65
|
export interface RadarSearchGeofencesOptions {
|
|
65
66
|
near?: Location;
|
|
66
67
|
radius?: number;
|
|
67
|
-
metadata?:
|
|
68
|
+
metadata?: RadarMetadata;
|
|
68
69
|
tags?: string[];
|
|
69
70
|
limit?: number;
|
|
70
71
|
}
|
|
71
|
-
export interface
|
|
72
|
+
export interface RadarAddressCallback {
|
|
72
73
|
status: string;
|
|
73
74
|
addresses?: RadarAddress[];
|
|
74
75
|
}
|
|
@@ -109,7 +110,7 @@ export interface RadarSearchPlacesOptions {
|
|
|
109
110
|
near?: Location;
|
|
110
111
|
radius?: number;
|
|
111
112
|
chains?: string[];
|
|
112
|
-
chainMetadata?:
|
|
113
|
+
chainMetadata?: RadarMetadata;
|
|
113
114
|
categories?: string[];
|
|
114
115
|
groups?: string[];
|
|
115
116
|
limit?: number;
|
|
@@ -131,7 +132,7 @@ export interface RadarUser {
|
|
|
131
132
|
userId?: string;
|
|
132
133
|
deviceId?: string;
|
|
133
134
|
description?: string;
|
|
134
|
-
metadata?:
|
|
135
|
+
metadata?: RadarMetadata;
|
|
135
136
|
location?: RadarCoordinate;
|
|
136
137
|
geofences?: RadarGeofence[];
|
|
137
138
|
place?: RadarPlace;
|
|
@@ -142,9 +143,9 @@ export interface RadarUser {
|
|
|
142
143
|
state?: RadarRegion;
|
|
143
144
|
dma?: RadarRegion;
|
|
144
145
|
postalCode?: RadarRegion;
|
|
145
|
-
nearbyPlaceChains?:
|
|
146
|
+
nearbyPlaceChains?: RadarChain[];
|
|
146
147
|
segments?: RadarSegment[];
|
|
147
|
-
topChains?:
|
|
148
|
+
topChains?: RadarChain[];
|
|
148
149
|
source?: LocationSource;
|
|
149
150
|
trip?: RadarTrip;
|
|
150
151
|
debug?: boolean;
|
|
@@ -166,13 +167,14 @@ export type LocationSource = "FOREGROUND_LOCATION" | "BACKGROUND_LOCATION" | "MA
|
|
|
166
167
|
export interface RadarTrip {
|
|
167
168
|
_id: string;
|
|
168
169
|
externalId: string;
|
|
169
|
-
metadata?:
|
|
170
|
+
metadata?: RadarMetadata;
|
|
170
171
|
destinationGeofenceTag?: string;
|
|
171
172
|
destinationGeofenceExternalId?: string;
|
|
172
173
|
mode?: string;
|
|
173
174
|
eta?: RadarTripEta;
|
|
174
175
|
status: string;
|
|
175
176
|
scheduledArrivalAt?: Date;
|
|
177
|
+
destinationLocation: Location;
|
|
176
178
|
}
|
|
177
179
|
export interface RadarSegment {
|
|
178
180
|
description: string;
|
|
@@ -199,7 +201,10 @@ export interface RadarEvent {
|
|
|
199
201
|
trip?: RadarTrip;
|
|
200
202
|
alternatePlaces?: RadarPlace[];
|
|
201
203
|
location?: RadarCoordinate;
|
|
202
|
-
metadata?:
|
|
204
|
+
metadata?: RadarMetadata;
|
|
205
|
+
replayed?: boolean;
|
|
206
|
+
createdAt: string;
|
|
207
|
+
actualCreatedAt: string;
|
|
203
208
|
}
|
|
204
209
|
export declare enum RadarEventConfidence {
|
|
205
210
|
none = 0,
|
|
@@ -220,7 +225,7 @@ export interface RadarGeofence {
|
|
|
220
225
|
description: string;
|
|
221
226
|
tag?: string;
|
|
222
227
|
externalId?: string;
|
|
223
|
-
metadata?:
|
|
228
|
+
metadata?: RadarMetadata;
|
|
224
229
|
type?: string;
|
|
225
230
|
geometryRadius?: number;
|
|
226
231
|
geometryCenter?: RadarCoordinate;
|
|
@@ -228,7 +233,7 @@ export interface RadarGeofence {
|
|
|
228
233
|
}
|
|
229
234
|
export interface RadarBeacon {
|
|
230
235
|
_id: string;
|
|
231
|
-
metadata?:
|
|
236
|
+
metadata?: RadarMetadata;
|
|
232
237
|
type: RadarBeaconType;
|
|
233
238
|
uuid?: string;
|
|
234
239
|
instance?: string;
|
|
@@ -242,12 +247,15 @@ export interface RadarPlace {
|
|
|
242
247
|
name: string;
|
|
243
248
|
categories: string[];
|
|
244
249
|
chain?: RadarChain;
|
|
250
|
+
location: Location;
|
|
251
|
+
metadata?: RadarMetadata;
|
|
252
|
+
group?: string;
|
|
245
253
|
}
|
|
246
254
|
export interface RadarChain {
|
|
247
255
|
name: string;
|
|
248
256
|
slug: string;
|
|
249
257
|
externalId?: string;
|
|
250
|
-
metadata?:
|
|
258
|
+
metadata?: RadarMetadata;
|
|
251
259
|
}
|
|
252
260
|
export interface RadarRegion {
|
|
253
261
|
_id: string;
|
|
@@ -285,7 +293,7 @@ export interface RadarAddress {
|
|
|
285
293
|
plus4?: string;
|
|
286
294
|
dmaCode?: string;
|
|
287
295
|
dma?: string;
|
|
288
|
-
metadata?:
|
|
296
|
+
metadata?: RadarMetadata;
|
|
289
297
|
}
|
|
290
298
|
export interface RadarAddressVerificationStatus {
|
|
291
299
|
status: string;
|
|
@@ -295,10 +303,17 @@ export interface RadarRoutes {
|
|
|
295
303
|
foot?: RadarRoute;
|
|
296
304
|
bike?: RadarRoute;
|
|
297
305
|
car?: RadarRoute;
|
|
306
|
+
truck?: RadarRoute;
|
|
307
|
+
motorbike?: RadarRoute;
|
|
308
|
+
}
|
|
309
|
+
export interface RadarRouteGeometry {
|
|
310
|
+
type: string;
|
|
311
|
+
coordinates: number[][];
|
|
298
312
|
}
|
|
299
313
|
export interface RadarRoute {
|
|
300
314
|
distance?: RadarRouteDistance;
|
|
301
315
|
duration?: RadarRouteDuration;
|
|
316
|
+
geometry?: RadarRouteGeometry;
|
|
302
317
|
}
|
|
303
318
|
export interface RadarRouteDistance {
|
|
304
319
|
value: number;
|
|
@@ -367,7 +382,7 @@ export interface RadarTrackingOptions {
|
|
|
367
382
|
export interface RadarLogConversionOptions {
|
|
368
383
|
name: string;
|
|
369
384
|
revenue?: number;
|
|
370
|
-
metadata?:
|
|
385
|
+
metadata?: RadarMetadata;
|
|
371
386
|
}
|
|
372
387
|
export type RadarRouteMode = "foot" | "bike" | "car";
|
|
373
388
|
export interface RadarTrackingStatus {
|
|
@@ -385,7 +400,7 @@ export interface RadarTrackingOptionsForegroundService {
|
|
|
385
400
|
}
|
|
386
401
|
export interface RadarTripOptions {
|
|
387
402
|
externalId: string;
|
|
388
|
-
metadata?:
|
|
403
|
+
metadata?: RadarMetadata;
|
|
389
404
|
destinationGeofenceTag?: string;
|
|
390
405
|
destinationGeofenceExternalId?: string;
|
|
391
406
|
mode?: RadarRouteMode;
|
|
@@ -393,33 +408,32 @@ export interface RadarTripOptions {
|
|
|
393
408
|
approachingThreshold?: number;
|
|
394
409
|
}
|
|
395
410
|
export type RadarTripStatus = "unknown" | "started" | "approaching" | "arrived" | "expired" | "completed" | "canceled";
|
|
396
|
-
interface RadarEventUpdate {
|
|
411
|
+
export interface RadarEventUpdate {
|
|
397
412
|
user: RadarUser;
|
|
398
413
|
events: RadarEvent[];
|
|
399
414
|
}
|
|
400
|
-
interface RadarEventUpdateCallback {
|
|
415
|
+
export interface RadarEventUpdateCallback {
|
|
401
416
|
(args: RadarEventUpdate): void;
|
|
402
417
|
}
|
|
403
|
-
interface RadarLocationUpdate {
|
|
418
|
+
export interface RadarLocationUpdate {
|
|
404
419
|
location: Location;
|
|
405
420
|
user: RadarUser;
|
|
406
421
|
}
|
|
407
|
-
interface RadarLocationUpdateCallback {
|
|
422
|
+
export interface RadarLocationUpdateCallback {
|
|
408
423
|
(args: RadarLocationUpdate): void;
|
|
409
424
|
}
|
|
410
|
-
interface RadarClientLocationUpdate {
|
|
425
|
+
export interface RadarClientLocationUpdate {
|
|
411
426
|
location: Location;
|
|
412
427
|
stopped: boolean;
|
|
413
428
|
source: string;
|
|
414
429
|
}
|
|
415
|
-
interface RadarClientLocationUpdateCallback {
|
|
430
|
+
export interface RadarClientLocationUpdateCallback {
|
|
416
431
|
(args: RadarClientLocationUpdate): void;
|
|
417
432
|
}
|
|
418
|
-
interface RadarErrorCallback {
|
|
433
|
+
export interface RadarErrorCallback {
|
|
419
434
|
(status: string): void;
|
|
420
435
|
}
|
|
421
|
-
interface RadarLogUpdateCallback {
|
|
436
|
+
export interface RadarLogUpdateCallback {
|
|
422
437
|
(status: string): void;
|
|
423
438
|
}
|
|
424
439
|
export type RadarListenerCallback = RadarEventUpdateCallback | RadarLocationUpdateCallback | RadarClientLocationUpdateCallback | RadarErrorCallback | RadarLogUpdateCallback;
|
|
425
|
-
export {};
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "React Native module for Radar, the leading geofencing and location tracking platform",
|
|
4
4
|
"homepage": "https://radar.com",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
-
"version": "3.10.0-beta.
|
|
6
|
+
"version": "3.10.0-beta.3",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"files": [
|
|
9
9
|
"android",
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
Location,
|
|
3
3
|
RadarAutocompleteOptions,
|
|
4
4
|
RadarContextCallback,
|
|
5
|
-
|
|
5
|
+
RadarAddressCallback,
|
|
6
6
|
RadarGetDistanceOptions,
|
|
7
7
|
RadarLocationCallback,
|
|
8
8
|
RadarLogConversionCallback,
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
Event,
|
|
31
31
|
RadarListenerCallback,
|
|
32
32
|
RadarGetMatrixOptions,
|
|
33
|
+
RadarMetadata,
|
|
33
34
|
} from "./types";
|
|
34
35
|
|
|
35
36
|
export interface RadarNativeInterface {
|
|
@@ -39,8 +40,8 @@ export interface RadarNativeInterface {
|
|
|
39
40
|
getUserId: () => Promise<string>;
|
|
40
41
|
setDescription: (description: string) => void;
|
|
41
42
|
getDescription: () => Promise<string>;
|
|
42
|
-
setMetadata: (metadata:
|
|
43
|
-
getMetadata: () => Promise<
|
|
43
|
+
setMetadata: (metadata: RadarMetadata) => void;
|
|
44
|
+
getMetadata: () => Promise<RadarMetadata>;
|
|
44
45
|
setAnonymousTrackingEnabled: (enabled: boolean) => void;
|
|
45
46
|
getPermissionsStatus: () => Promise<RadarPermissionsStatus>;
|
|
46
47
|
requestPermissions: (background: boolean) => Promise<RadarPermissionsStatus>;
|
|
@@ -81,18 +82,18 @@ export interface RadarNativeInterface {
|
|
|
81
82
|
) => Promise<RadarSearchGeofencesCallback>;
|
|
82
83
|
autocomplete: (
|
|
83
84
|
options: RadarAutocompleteOptions
|
|
84
|
-
) => Promise<
|
|
85
|
-
geocode: (address: string) => Promise<
|
|
86
|
-
reverseGeocode: (location: any) => Promise<
|
|
87
|
-
ipGeocode: () => Promise<
|
|
85
|
+
) => Promise<RadarAddressCallback>;
|
|
86
|
+
geocode: (address: string) => Promise<RadarAddressCallback>;
|
|
87
|
+
reverseGeocode: (location: any) => Promise<RadarAddressCallback>;
|
|
88
|
+
ipGeocode: () => Promise<RadarAddressCallback>;
|
|
88
89
|
getDistance: (option: RadarGetDistanceOptions) => Promise<RadarRouteCallback>;
|
|
89
90
|
getMatrix: (option: RadarGetMatrixOptions) => Promise<RadarRouteMatrix>;
|
|
90
91
|
logConversion: (
|
|
91
92
|
options: RadarLogConversionOptions
|
|
92
93
|
) => Promise<RadarLogConversionCallback>;
|
|
93
|
-
sendEvent: (name: string, metadata:
|
|
94
|
+
sendEvent: (name: string, metadata: RadarMetadata) => void;
|
|
94
95
|
on: (event: Event, callback: RadarListenerCallback) => void;
|
|
95
|
-
off: (event: Event, callback
|
|
96
|
+
off: (event: Event, callback?: Function | undefined) => void;
|
|
96
97
|
nativeSdkVersion: () => Promise<string>;
|
|
97
98
|
rnSdkVersion: () => string;
|
|
98
99
|
}
|
package/src/@types/types.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export type RadarMetadata = Record<string, string | number | boolean>;
|
|
2
|
+
|
|
1
3
|
export interface RadarTrackOnceOptions {
|
|
2
4
|
location?: Location;
|
|
3
5
|
desiredAccuracy?: RadarTrackingOptionsDesiredAccuracy;
|
|
@@ -48,7 +50,7 @@ export type RadarPermissionsStatus =
|
|
|
48
50
|
| "NOT_DETERMINED"
|
|
49
51
|
| "UNKNOWN";
|
|
50
52
|
|
|
51
|
-
export type Event = "clientLocation" | "location" | "error" | "events";
|
|
53
|
+
export type Event = "clientLocation" | "location" | "error" | "events" | "log";
|
|
52
54
|
|
|
53
55
|
export type RadarLogLevel = "info" | "debug" | "warning" | "error" | "none";
|
|
54
56
|
|
|
@@ -84,12 +86,12 @@ export interface RadarSearchGeofencesCallback {
|
|
|
84
86
|
export interface RadarSearchGeofencesOptions {
|
|
85
87
|
near?: Location;
|
|
86
88
|
radius?: number;
|
|
87
|
-
metadata?:
|
|
89
|
+
metadata?: RadarMetadata;
|
|
88
90
|
tags?: string[];
|
|
89
91
|
limit?: number;
|
|
90
92
|
}
|
|
91
93
|
|
|
92
|
-
export interface
|
|
94
|
+
export interface RadarAddressCallback {
|
|
93
95
|
status: string;
|
|
94
96
|
addresses?: RadarAddress[];
|
|
95
97
|
}
|
|
@@ -106,7 +108,6 @@ export interface RadarIPGeocodeCallback {
|
|
|
106
108
|
proxy?: boolean;
|
|
107
109
|
}
|
|
108
110
|
|
|
109
|
-
|
|
110
111
|
export interface RadarTrackingOptionsForegroundServiceOptions {
|
|
111
112
|
text?: string;
|
|
112
113
|
title?: string;
|
|
@@ -138,7 +139,7 @@ export interface RadarSearchPlacesOptions {
|
|
|
138
139
|
near?: Location;
|
|
139
140
|
radius?: number;
|
|
140
141
|
chains?: string[];
|
|
141
|
-
chainMetadata?:
|
|
142
|
+
chainMetadata?: RadarMetadata;
|
|
142
143
|
categories?: string[];
|
|
143
144
|
groups?: string[];
|
|
144
145
|
limit?: number;
|
|
@@ -162,7 +163,7 @@ export interface RadarUser {
|
|
|
162
163
|
userId?: string;
|
|
163
164
|
deviceId?: string;
|
|
164
165
|
description?: string;
|
|
165
|
-
metadata?:
|
|
166
|
+
metadata?: RadarMetadata;
|
|
166
167
|
location?: RadarCoordinate;
|
|
167
168
|
geofences?: RadarGeofence[];
|
|
168
169
|
place?: RadarPlace;
|
|
@@ -173,9 +174,9 @@ export interface RadarUser {
|
|
|
173
174
|
state?: RadarRegion;
|
|
174
175
|
dma?: RadarRegion;
|
|
175
176
|
postalCode?: RadarRegion;
|
|
176
|
-
nearbyPlaceChains?:
|
|
177
|
+
nearbyPlaceChains?: RadarChain[];
|
|
177
178
|
segments?: RadarSegment[];
|
|
178
|
-
topChains?:
|
|
179
|
+
topChains?: RadarChain[];
|
|
179
180
|
source?: LocationSource;
|
|
180
181
|
trip?: RadarTrip;
|
|
181
182
|
debug?: boolean;
|
|
@@ -211,13 +212,14 @@ export type LocationSource =
|
|
|
211
212
|
export interface RadarTrip {
|
|
212
213
|
_id: string;
|
|
213
214
|
externalId: string;
|
|
214
|
-
metadata?:
|
|
215
|
+
metadata?: RadarMetadata;
|
|
215
216
|
destinationGeofenceTag?: string;
|
|
216
217
|
destinationGeofenceExternalId?: string;
|
|
217
218
|
mode?: string;
|
|
218
219
|
eta?: RadarTripEta;
|
|
219
220
|
status: string;
|
|
220
221
|
scheduledArrivalAt?: Date;
|
|
222
|
+
destinationLocation: Location;
|
|
221
223
|
}
|
|
222
224
|
|
|
223
225
|
export interface RadarSegment {
|
|
@@ -247,7 +249,10 @@ export interface RadarEvent {
|
|
|
247
249
|
trip?: RadarTrip;
|
|
248
250
|
alternatePlaces?: RadarPlace[];
|
|
249
251
|
location?: RadarCoordinate;
|
|
250
|
-
metadata?:
|
|
252
|
+
metadata?: RadarMetadata;
|
|
253
|
+
replayed?: boolean;
|
|
254
|
+
createdAt: string;
|
|
255
|
+
actualCreatedAt: string;
|
|
251
256
|
}
|
|
252
257
|
|
|
253
258
|
export enum RadarEventConfidence {
|
|
@@ -300,17 +305,16 @@ export interface RadarGeofence {
|
|
|
300
305
|
description: string;
|
|
301
306
|
tag?: string;
|
|
302
307
|
externalId?: string;
|
|
303
|
-
metadata?:
|
|
308
|
+
metadata?: RadarMetadata;
|
|
304
309
|
type?: string;
|
|
305
310
|
geometryRadius?: number;
|
|
306
311
|
geometryCenter?: RadarCoordinate;
|
|
307
312
|
coordinates?: number[][];
|
|
308
|
-
|
|
309
313
|
}
|
|
310
314
|
|
|
311
315
|
export interface RadarBeacon {
|
|
312
316
|
_id: string;
|
|
313
|
-
metadata?:
|
|
317
|
+
metadata?: RadarMetadata;
|
|
314
318
|
type: RadarBeaconType;
|
|
315
319
|
uuid?: string;
|
|
316
320
|
instance?: string;
|
|
@@ -325,13 +329,16 @@ export interface RadarPlace {
|
|
|
325
329
|
name: string;
|
|
326
330
|
categories: string[];
|
|
327
331
|
chain?: RadarChain;
|
|
332
|
+
location: Location;
|
|
333
|
+
metadata?: RadarMetadata;
|
|
334
|
+
group?: string;
|
|
328
335
|
}
|
|
329
336
|
|
|
330
337
|
export interface RadarChain {
|
|
331
338
|
name: string;
|
|
332
339
|
slug: string;
|
|
333
340
|
externalId?: string;
|
|
334
|
-
metadata?:
|
|
341
|
+
metadata?: RadarMetadata;
|
|
335
342
|
}
|
|
336
343
|
|
|
337
344
|
export interface RadarRegion {
|
|
@@ -340,7 +347,7 @@ export interface RadarRegion {
|
|
|
340
347
|
code: string;
|
|
341
348
|
name: string;
|
|
342
349
|
allowed?: boolean;
|
|
343
|
-
flag?:string;
|
|
350
|
+
flag?: string;
|
|
344
351
|
}
|
|
345
352
|
|
|
346
353
|
export interface RadarLocationPermissionsCallback {
|
|
@@ -372,7 +379,7 @@ export interface RadarAddress {
|
|
|
372
379
|
plus4?: string;
|
|
373
380
|
dmaCode?: string;
|
|
374
381
|
dma?: string;
|
|
375
|
-
metadata?:
|
|
382
|
+
metadata?: RadarMetadata;
|
|
376
383
|
}
|
|
377
384
|
|
|
378
385
|
export interface RadarAddressVerificationStatus {
|
|
@@ -384,11 +391,19 @@ export interface RadarRoutes {
|
|
|
384
391
|
foot?: RadarRoute;
|
|
385
392
|
bike?: RadarRoute;
|
|
386
393
|
car?: RadarRoute;
|
|
394
|
+
truck?: RadarRoute;
|
|
395
|
+
motorbike?: RadarRoute;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export interface RadarRouteGeometry {
|
|
399
|
+
type: string;
|
|
400
|
+
coordinates: number[][];
|
|
387
401
|
}
|
|
388
402
|
|
|
389
403
|
export interface RadarRoute {
|
|
390
404
|
distance?: RadarRouteDistance;
|
|
391
405
|
duration?: RadarRouteDuration;
|
|
406
|
+
geometry?: RadarRouteGeometry;
|
|
392
407
|
}
|
|
393
408
|
|
|
394
409
|
export interface RadarRouteDistance {
|
|
@@ -467,7 +482,7 @@ export interface RadarTrackingOptions {
|
|
|
467
482
|
export interface RadarLogConversionOptions {
|
|
468
483
|
name: string;
|
|
469
484
|
revenue?: number;
|
|
470
|
-
metadata?:
|
|
485
|
+
metadata?: RadarMetadata;
|
|
471
486
|
}
|
|
472
487
|
|
|
473
488
|
export type RadarRouteMode = "foot" | "bike" | "car";
|
|
@@ -489,7 +504,7 @@ export interface RadarTrackingOptionsForegroundService {
|
|
|
489
504
|
|
|
490
505
|
export interface RadarTripOptions {
|
|
491
506
|
externalId: string;
|
|
492
|
-
metadata?:
|
|
507
|
+
metadata?: RadarMetadata;
|
|
493
508
|
destinationGeofenceTag?: string;
|
|
494
509
|
destinationGeofenceExternalId?: string;
|
|
495
510
|
mode?: RadarRouteMode;
|
|
@@ -506,42 +521,45 @@ export type RadarTripStatus =
|
|
|
506
521
|
| "completed"
|
|
507
522
|
| "canceled";
|
|
508
523
|
|
|
509
|
-
interface RadarEventUpdate {
|
|
524
|
+
export interface RadarEventUpdate {
|
|
510
525
|
user: RadarUser;
|
|
511
526
|
events: RadarEvent[];
|
|
512
527
|
}
|
|
513
528
|
|
|
514
|
-
interface RadarEventUpdateCallback {
|
|
529
|
+
export interface RadarEventUpdateCallback {
|
|
515
530
|
(args: RadarEventUpdate): void;
|
|
516
531
|
}
|
|
517
532
|
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
interface RadarLocationUpdate{
|
|
533
|
+
export interface RadarLocationUpdate {
|
|
521
534
|
location: Location;
|
|
522
535
|
user: RadarUser;
|
|
523
536
|
}
|
|
524
537
|
|
|
525
|
-
interface RadarLocationUpdateCallback{
|
|
538
|
+
export interface RadarLocationUpdateCallback {
|
|
526
539
|
(args: RadarLocationUpdate): void;
|
|
527
540
|
}
|
|
528
541
|
|
|
529
|
-
interface RadarClientLocationUpdate {
|
|
542
|
+
export interface RadarClientLocationUpdate {
|
|
530
543
|
location: Location;
|
|
531
544
|
stopped: boolean;
|
|
532
545
|
source: string;
|
|
533
546
|
}
|
|
534
547
|
|
|
535
|
-
interface RadarClientLocationUpdateCallback{
|
|
548
|
+
export interface RadarClientLocationUpdateCallback {
|
|
536
549
|
(args: RadarClientLocationUpdate): void;
|
|
537
550
|
}
|
|
538
551
|
|
|
539
|
-
interface RadarErrorCallback{
|
|
552
|
+
export interface RadarErrorCallback {
|
|
540
553
|
(status: string): void;
|
|
541
554
|
}
|
|
542
555
|
|
|
543
|
-
interface RadarLogUpdateCallback{
|
|
556
|
+
export interface RadarLogUpdateCallback {
|
|
544
557
|
(status: string): void;
|
|
545
558
|
}
|
|
546
559
|
|
|
547
|
-
export type RadarListenerCallback =
|
|
560
|
+
export type RadarListenerCallback =
|
|
561
|
+
| RadarEventUpdateCallback
|
|
562
|
+
| RadarLocationUpdateCallback
|
|
563
|
+
| RadarClientLocationUpdateCallback
|
|
564
|
+
| RadarErrorCallback
|
|
565
|
+
| RadarLogUpdateCallback;
|
package/src/index.native.ts
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
Location,
|
|
6
6
|
RadarAutocompleteOptions,
|
|
7
7
|
RadarContextCallback,
|
|
8
|
-
|
|
8
|
+
RadarAddressCallback,
|
|
9
9
|
RadarGetDistanceOptions,
|
|
10
10
|
RadarLocationCallback,
|
|
11
11
|
RadarLogConversionCallback,
|
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
Event,
|
|
34
34
|
RadarListenerCallback,
|
|
35
35
|
RadarGetMatrixOptions,
|
|
36
|
+
RadarMetadata,
|
|
36
37
|
} from "./@types/types";
|
|
37
38
|
|
|
38
39
|
if (
|
|
@@ -64,11 +65,11 @@ const setDescription = (description: string): void => {
|
|
|
64
65
|
const getDescription = (): Promise<string> =>
|
|
65
66
|
NativeModules.RNRadar.getDescription();
|
|
66
67
|
|
|
67
|
-
const setMetadata = (metadata:
|
|
68
|
+
const setMetadata = (metadata: RadarMetadata): void => {
|
|
68
69
|
NativeModules.RNRadar.setMetadata(metadata);
|
|
69
70
|
};
|
|
70
71
|
|
|
71
|
-
const getMetadata = (): Promise<
|
|
72
|
+
const getMetadata = (): Promise<RadarMetadata> => NativeModules.RNRadar.getMetadata();
|
|
72
73
|
|
|
73
74
|
const setAnonymousTrackingEnabled = (enabled: boolean): void =>
|
|
74
75
|
NativeModules.RNRadar.setAnonymousTrackingEnabled(enabled);
|
|
@@ -177,15 +178,15 @@ const searchGeofences = (
|
|
|
177
178
|
|
|
178
179
|
const autocomplete = (
|
|
179
180
|
options: RadarAutocompleteOptions
|
|
180
|
-
): Promise<
|
|
181
|
+
): Promise<RadarAddressCallback> => NativeModules.RNRadar.autocomplete(options);
|
|
181
182
|
|
|
182
|
-
const geocode = (address: string): Promise<
|
|
183
|
+
const geocode = (address: string): Promise<RadarAddressCallback> =>
|
|
183
184
|
NativeModules.RNRadar.geocode(address);
|
|
184
185
|
|
|
185
|
-
const reverseGeocode = (location: Location): Promise<
|
|
186
|
+
const reverseGeocode = (location: Location): Promise<RadarAddressCallback> =>
|
|
186
187
|
NativeModules.RNRadar.reverseGeocode(location);
|
|
187
188
|
|
|
188
|
-
const ipGeocode = (): Promise<
|
|
189
|
+
const ipGeocode = (): Promise<RadarAddressCallback> =>
|
|
189
190
|
NativeModules.RNRadar.ipGeocode();
|
|
190
191
|
|
|
191
192
|
const getDistance = (
|
|
@@ -201,13 +202,13 @@ const logConversion = (
|
|
|
201
202
|
): Promise<RadarLogConversionCallback> =>
|
|
202
203
|
NativeModules.RNRadar.logConversion(options);
|
|
203
204
|
|
|
204
|
-
const sendEvent = (name: string, metadata:
|
|
205
|
+
const sendEvent = (name: string, metadata: RadarMetadata): void =>
|
|
205
206
|
NativeModules.RNRadar.sendEvent(name, metadata);
|
|
206
207
|
|
|
207
208
|
const on = (event: Event, callback: RadarListenerCallback): void =>
|
|
208
209
|
eventEmitter.addListener(event, callback);
|
|
209
210
|
|
|
210
|
-
const off = (event: Event, callback
|
|
211
|
+
const off = (event: Event, callback?: Function | undefined): void => {
|
|
211
212
|
if (callback) {
|
|
212
213
|
// @ts-ignore
|
|
213
214
|
eventEmitter.removeListener(event, callback);
|