@transistorsoft/background-geolocation-types 5.0.0-beta.3 → 5.0.0-beta.4
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/dist/core/api/BackgroundGeolocation.d.ts +0 -1551
- package/dist/core/api/CurrentPositionRequest.d.ts +0 -36
- package/dist/core/api/DeviceSettings.d.ts +0 -63
- package/dist/core/api/Logger.d.ts +0 -400
- package/dist/core/api/State.d.ts +0 -63
- package/dist/core/api/TransistorAuthorizationService.d.ts +0 -110
- package/dist/core/config/ActivityConfig.d.ts +0 -260
- package/dist/core/config/AppConfig.d.ts +0 -581
- package/dist/core/config/AuthorizationConfig.d.ts +0 -191
- package/dist/core/config/Config.d.ts +0 -176
- package/dist/core/config/GeoConfig.d.ts +0 -876
- package/dist/core/config/HttpConfig.d.ts +0 -565
- package/dist/core/config/LocationFilter.d.ts +0 -256
- package/dist/core/config/LoggerConfig.d.ts +0 -313
- package/dist/core/config/NotificationConfig.d.ts +0 -504
- package/dist/core/config/PersistenceConfig.d.ts +0 -541
- package/dist/core/data/DeviceInfo.d.ts +0 -54
- package/dist/core/data/Geofence.d.ts +0 -5
- package/dist/core/data/Location.d.ts +0 -213
- package/dist/core/data/Sensors.d.ts +0 -22
- package/dist/core/events/AuthorizationEvent.d.ts +0 -9
- package/dist/core/events/ConnectivityChangeEvent.d.ts +0 -6
- package/dist/core/events/GeofenceEvent.d.ts +0 -10
- package/dist/core/events/GeofencesChangeEvent.d.ts +0 -7
- package/dist/core/events/HeadlessEvent.d.ts +0 -7
- package/dist/core/events/HeartbeatEvent.d.ts +0 -10
- package/dist/core/events/HttpEvent.d.ts +0 -8
- package/dist/core/events/MotionActivityEvent.d.ts +0 -7
- package/dist/core/events/MotionChangeEvent.d.ts +0 -7
- package/dist/core/events/ProviderChangeEvent.d.ts +0 -10
- package/dist/core/events/Subscription.d.ts +0 -83
- package/dist/docs-entry.js +0 -3
- package/dist/enums/AccuracyAuthorization.d.ts +0 -16
- package/dist/enums/AccuracyAuthorization.js +0 -12
- package/dist/enums/ActivityType.d.ts +0 -25
- package/dist/enums/ActivityType.js +0 -21
- package/dist/enums/AuthorizationStatus.d.ts +0 -16
- package/dist/enums/AuthorizationStatus.js +0 -13
- package/dist/enums/AuthorizationStrategy.d.ts +0 -9
- package/dist/enums/AuthorizationStrategy.js +0 -6
- package/dist/enums/DesiredAccuracy.d.ts +0 -6
- package/dist/enums/DesiredAccuracy.js +0 -5
- package/dist/enums/Event.d.ts +0 -9
- package/dist/enums/Event.js +0 -5
- package/dist/enums/GeofenceAction.d.ts +0 -17
- package/dist/enums/GeofenceAction.js +0 -13
- package/dist/enums/HttpMethod.d.ts +0 -7
- package/dist/enums/HttpMethod.js +0 -6
- package/dist/enums/KalmanProfile.d.ts +0 -26
- package/dist/enums/KalmanProfile.js +0 -25
- package/dist/enums/LocationError.d.ts +0 -19
- package/dist/enums/LocationError.js +0 -15
- package/dist/enums/LocationFilterPolicy.d.ts +0 -104
- package/dist/enums/LocationFilterPolicy.js +0 -103
- package/dist/enums/LocationRequest.d.ts +0 -19
- package/dist/enums/LocationRequest.js +0 -15
- package/dist/enums/LogLevel.d.ts +0 -20
- package/dist/enums/LogLevel.js +0 -16
- package/dist/enums/LogLevelName.d.ts +0 -6
- package/dist/enums/LogLevelName.js +0 -5
- package/dist/enums/MotionActivityType.d.ts +0 -6
- package/dist/enums/MotionActivityType.js +0 -5
- package/dist/enums/NotificationPriority.d.ts +0 -16
- package/dist/enums/NotificationPriority.js +0 -15
- package/dist/enums/PersistMode.d.ts +0 -7
- package/dist/enums/PersistMode.js +0 -6
- package/dist/enums/SQLQueryOrder.d.ts +0 -11
- package/dist/enums/SQLQueryOrder.js +0 -10
- package/dist/enums/TrackingMode.d.ts +0 -11
- package/dist/enums/TrackingMode.js +0 -10
- package/dist/enums/TriggerActivity.d.ts +0 -7
- package/dist/enums/TriggerActivity.js +0 -6
- package/dist/index.js +0 -4
- package/dist/legacy/LegacyConfig.d.ts +0 -19
- package/package.json +8 -9
|
@@ -1,253 +1,40 @@
|
|
|
1
1
|
import { ProviderChangeEvent } from '../events/ProviderChangeEvent';
|
|
2
2
|
import { MotionActivityType } from '../../enums/MotionActivityType';
|
|
3
3
|
import { GeofenceEvent } from '../events/GeofenceEvent';
|
|
4
|
-
/**
|
|
5
|
-
* This object is attached to instances of {@link Location.coords}.
|
|
6
|
-
*
|
|
7
|
-
* @category Data
|
|
8
|
-
*/
|
|
9
4
|
export interface Coords {
|
|
10
|
-
/**
|
|
11
|
-
* __[iOS Only]__ When the environment contains indoor-tracking hardware (eg: bluetooth beacons) the current floor within a building.
|
|
12
|
-
*/
|
|
13
5
|
floor?: number;
|
|
14
|
-
/**
|
|
15
|
-
* Latitude of the location.
|
|
16
|
-
*/
|
|
17
6
|
latitude: number;
|
|
18
|
-
/**
|
|
19
|
-
* Longitude of the location.
|
|
20
|
-
*/
|
|
21
7
|
longitude: number;
|
|
22
|
-
/**
|
|
23
|
-
* Accuracy in meters.
|
|
24
|
-
*/
|
|
25
8
|
accuracy: number;
|
|
26
|
-
/**
|
|
27
|
-
* [iOS] Altitude above sea-level in meters.
|
|
28
|
-
* [Android] The altitude of this location in meters above the WGS84 reference ellipsoid.
|
|
29
|
-
* - See {@link ellipsoidal_altitude}
|
|
30
|
-
*
|
|
31
|
-
*/
|
|
32
9
|
altitude?: number;
|
|
33
|
-
/**
|
|
34
|
-
* The altitude of this location in meters above the WGS84 reference ellipsoid.
|
|
35
|
-
*/
|
|
36
10
|
ellipsoidal_altitude?: number;
|
|
37
|
-
/**
|
|
38
|
-
* Altitude accuracy in meters.
|
|
39
|
-
*
|
|
40
|
-
* If this location does not have `altitude_accuracy`, then `-1` is returned.
|
|
41
|
-
*
|
|
42
|
-
* __iOS:__
|
|
43
|
-
*
|
|
44
|
-
* When this property contains 0 or a positive number, the value in the altitude property is plus or minus the specified number of meters. When this property contains a negative number, the value in the altitude property is invalid.
|
|
45
|
-
*
|
|
46
|
-
* Determining the [altitudeAccuracy] requires a device with GPS capabilities. Thus, on some devices, this property always contains a negative value.
|
|
47
|
-
*
|
|
48
|
-
* __Android:__
|
|
49
|
-
*
|
|
50
|
-
* Android defines vertical accuracy at 68% confidence. Specifically, as 1-side of the 2-sided range above and below the estimated altitude reported by [altitude], within which there is a 68% probability of finding the true altitude.
|
|
51
|
-
*
|
|
52
|
-
* In the case where the underlying distribution is assumed Gaussian normal, this would be considered 1 standard deviation.
|
|
53
|
-
*
|
|
54
|
-
* For example, if [altitude] returns `150`, and [verticalAccuracy] returns `20` then there is a 68% probability of the true altitude being between `130` and `170` meters.
|
|
55
|
-
*
|
|
56
|
-
*/
|
|
57
11
|
altitude_accuracy?: number;
|
|
58
|
-
/**
|
|
59
|
-
* Heading in degrees.
|
|
60
|
-
* ⚠️ Note: Only present when location came from GPS. `-1` otherwise.
|
|
61
|
-
*/
|
|
62
12
|
heading?: number;
|
|
63
|
-
/**
|
|
64
|
-
* Heading accuracy in degrees.
|
|
65
|
-
* ⚠️ Note: Only present when location came from GPS. `-1` otherwise.
|
|
66
|
-
*/
|
|
67
13
|
heading_accuracy?: number;
|
|
68
|
-
/**
|
|
69
|
-
* Speed in meters / second.
|
|
70
|
-
* ⚠️ Note: Only present when location came from GPS. `-1` otherwise.
|
|
71
|
-
*/
|
|
72
14
|
speed?: number;
|
|
73
|
-
/**
|
|
74
|
-
* Speed accuracy in meters / second.
|
|
75
|
-
* ⚠️ Note: Only present when location came from GPS. `-1` otherwise.
|
|
76
|
-
*/
|
|
77
15
|
speed_accuracy?: number;
|
|
78
16
|
}
|
|
79
|
-
/**
|
|
80
|
-
* This object is attached to instances of {@link Location.battery}.
|
|
81
|
-
*
|
|
82
|
-
* @category Data
|
|
83
|
-
*/
|
|
84
17
|
export interface Battery {
|
|
85
|
-
/**
|
|
86
|
-
* `true` when device is plugged in to power.
|
|
87
|
-
*/
|
|
88
18
|
is_charging: boolean;
|
|
89
|
-
/**
|
|
90
|
-
* Battery level. `0.0` = empty; `1.0` = full charge.
|
|
91
|
-
*/
|
|
92
19
|
level: number;
|
|
93
20
|
}
|
|
94
|
-
/**
|
|
95
|
-
* The last known motion-activity when this location was recorded.
|
|
96
|
-
*
|
|
97
|
-
* @category Data
|
|
98
|
-
*/
|
|
99
21
|
export interface MotionActivity {
|
|
100
|
-
/**
|
|
101
|
-
* The reported device {@link MotionActivityType motion activity} (eg: `still`, `on_foot`, `in_vehicle`).
|
|
102
|
-
*/
|
|
103
22
|
type: MotionActivityType;
|
|
104
|
-
/**
|
|
105
|
-
* Confidence of the reported device motion activity in %.
|
|
106
|
-
*/
|
|
107
23
|
confidence: number;
|
|
108
24
|
}
|
|
109
|
-
/**
|
|
110
|
-
* A `Location` object represents a geographic location captured by the device's native location API.
|
|
111
|
-
*
|
|
112
|
-
* - `CLLocationManager` delivers instance of `CLLocation` on iOS
|
|
113
|
-
* - `FusedLocationProviderClient` deliver instance of `android.location.Location` on Android
|
|
114
|
-
*
|
|
115
|
-
* __Javascript Callback Schema__
|
|
116
|
-
*
|
|
117
|
-
* @example
|
|
118
|
-
* ```
|
|
119
|
-
* {
|
|
120
|
-
* "timestamp": [Date], // <-- Javascript Date instance
|
|
121
|
-
* "event": [String], // <-- motionchange|geofence|heartbeat
|
|
122
|
-
* "is_moving": [Boolean], // <-- The motion-state when location was recorded.
|
|
123
|
-
* "uuid": [String], // <-- Universally unique identifier
|
|
124
|
-
* "age": [Integer], // <-- Age of the location in milliseconds
|
|
125
|
-
* "coords": {
|
|
126
|
-
* "latitude": [Double],
|
|
127
|
-
* "longitude": [Double],
|
|
128
|
-
* "accuracy": [Double],
|
|
129
|
-
* "speed": [Double],
|
|
130
|
-
* "heading": [Double],
|
|
131
|
-
* "altitude": [Double]
|
|
132
|
-
* "ellipsoidal_altitude": [Double]
|
|
133
|
-
* },
|
|
134
|
-
* "activity": {
|
|
135
|
-
* "type": [still|on_foot|walking|running|in_vehicle|on_bicycle],
|
|
136
|
-
* "confidence": [0-100%]
|
|
137
|
-
* },
|
|
138
|
-
* "battery": {
|
|
139
|
-
* "level": [Double],
|
|
140
|
-
* "is_charging": [Boolean]
|
|
141
|
-
* },
|
|
142
|
-
* "odometer": [Double/meters]
|
|
143
|
-
* }
|
|
144
|
-
* ```
|
|
145
|
-
*
|
|
146
|
-
* __HTTP POST Schema__
|
|
147
|
-
*
|
|
148
|
-
* The location-data schema POSTed to your server takes the following form:
|
|
149
|
-
* @example
|
|
150
|
-
* ```
|
|
151
|
-
* {
|
|
152
|
-
* "location": {
|
|
153
|
-
* "coords": {
|
|
154
|
-
* "latitude": [Double],
|
|
155
|
-
* "longitude": [Double],
|
|
156
|
-
* "accuracy": [Double],
|
|
157
|
-
* "speed": [Double],
|
|
158
|
-
* "heading": [Double],
|
|
159
|
-
* "altitude": [Double],
|
|
160
|
-
* "ellipsoidal_altitude": [Double]
|
|
161
|
-
* },
|
|
162
|
-
* "extras": { // <-- optional meta-data
|
|
163
|
-
* "foo": "bar"
|
|
164
|
-
* },
|
|
165
|
-
* "activity": {
|
|
166
|
-
* "type": [still|on_foot|walking|running|in_vehicle|on_bicycle|unknown],
|
|
167
|
-
* "confidence": [0-100%]
|
|
168
|
-
* },
|
|
169
|
-
* "geofence": { // <-- Present only if a geofence was triggered at this location
|
|
170
|
-
* "identifier": [String],
|
|
171
|
-
* "action": [String ENTER|EXIT]
|
|
172
|
-
* },
|
|
173
|
-
* "battery": {
|
|
174
|
-
* "level": [Double],
|
|
175
|
-
* "is_charging": [Boolean]
|
|
176
|
-
* },
|
|
177
|
-
* "timestamp": [ISO-8601 UTC], // eg: "2015-05-05T04:31:54.123Z"
|
|
178
|
-
* "age": [Integer], // <-- Age of the location in milliseconds
|
|
179
|
-
* "uuid": [String], // <-- Universally unique identifier
|
|
180
|
-
* "event" [String], // <-- motionchange|geofence|heartbeat
|
|
181
|
-
* "is_moving": [Boolean], // <-- The motion-state when recorded.
|
|
182
|
-
* "odometer": [Double/meters]
|
|
183
|
-
* }
|
|
184
|
-
* }
|
|
185
|
-
* ```
|
|
186
|
-
*
|
|
187
|
-
* @category Data
|
|
188
|
-
*/
|
|
189
25
|
export interface Location {
|
|
190
|
-
/**
|
|
191
|
-
* `ISO-8601 UTC` timestamp provided by the native location API.
|
|
192
|
-
*/
|
|
193
26
|
timestamp: string;
|
|
194
|
-
/**
|
|
195
|
-
* The age of the location in milliseconds, relative to the Device system-time when the location was received.
|
|
196
|
-
* For example, if the reported `age` is `10000`, that location was recorded 10s ago, relative to the system-time.
|
|
197
|
-
* `location.timestamp` + `location.age` = Device system-time when location was recorded.
|
|
198
|
-
*/
|
|
199
27
|
age: number;
|
|
200
|
-
/**
|
|
201
|
-
* Distance-traveled in meters.
|
|
202
|
-
* ℹ️
|
|
203
|
-
* - {@link BackgroundGeolocation.resetOdometer}
|
|
204
|
-
* - {@link BackgroundGeolocation.getOdometer}
|
|
205
|
-
*/
|
|
206
28
|
odometer: number;
|
|
207
|
-
/**
|
|
208
|
-
* `true` if location was recorded while plugin is in the *moving* state.
|
|
209
|
-
*/
|
|
210
29
|
is_moving: boolean;
|
|
211
|
-
/**
|
|
212
|
-
* Universally Unique Identifier. You can use this to match locations recorded at your server with those in the logs.
|
|
213
|
-
* It can also be used to ensure if the plugin has ever posted the same location *twice*.
|
|
214
|
-
*/
|
|
215
30
|
uuid: string;
|
|
216
|
-
/**
|
|
217
|
-
* Event responsible for generating this location (`motionchange`, `providerchange`, `geofence`, `heartbeat`).
|
|
218
|
-
*/
|
|
219
31
|
event?: string;
|
|
220
|
-
/**
|
|
221
|
-
* Present (and `true`) if the location was generated by a "Fake Location" application or simulator.
|
|
222
|
-
*/
|
|
223
32
|
mock?: boolean;
|
|
224
|
-
/**
|
|
225
|
-
* `true` if the plugin is currently waiting for the best possible location to arrive. Samples are recorded when the plugin is transitioning between motion-states (*moving* vs *stationary*) or [[BackgroundGeolocation.getCurrentPosition]].
|
|
226
|
-
* If you're manually posting location to your server, you should not persist these "samples".
|
|
227
|
-
*/
|
|
228
33
|
sample?: boolean;
|
|
229
|
-
/**
|
|
230
|
-
* `latitude`, `longitude`, `speed`, `heading`, etc.
|
|
231
|
-
*/
|
|
232
34
|
coords: Coords;
|
|
233
|
-
/**
|
|
234
|
-
* Device battery level when the location was recorded.
|
|
235
|
-
*/
|
|
236
35
|
battery: Battery;
|
|
237
|
-
/**
|
|
238
|
-
* Optional arbitrary meta-data attached to this location.
|
|
239
|
-
*/
|
|
240
36
|
extras?: Record<string, any>;
|
|
241
|
-
/**
|
|
242
|
-
* If this location was recorded due to a geofence transition, the corresponding geofence-event.
|
|
243
|
-
*/
|
|
244
37
|
geofence?: GeofenceEvent;
|
|
245
|
-
/**
|
|
246
|
-
* Device motion-activity when this location was recorded (eg: `still`, `on_foot`, `in_vehicle`).
|
|
247
|
-
*/
|
|
248
38
|
activity: MotionActivity;
|
|
249
|
-
/**
|
|
250
|
-
* If this location was recorded due to {@link ProviderChangeEvent}, this is a reference to the location-provider state.
|
|
251
|
-
*/
|
|
252
39
|
provider?: ProviderChangeEvent;
|
|
253
40
|
}
|
|
@@ -1,30 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Detected device sensors related to motion-detection.
|
|
3
|
-
* @category Data
|
|
4
|
-
*/
|
|
5
1
|
export interface Sensors {
|
|
6
|
-
/**
|
|
7
|
-
* `ios` | `android`
|
|
8
|
-
*/
|
|
9
2
|
platform: string;
|
|
10
|
-
/**
|
|
11
|
-
* `true` when the device has an accelerometer.
|
|
12
|
-
*/
|
|
13
3
|
accelerometer: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* `true` when the device has a magnetometer (compass).
|
|
16
|
-
*/
|
|
17
4
|
magnetometer: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* `true` when the device has a gyroscope.
|
|
20
|
-
*/
|
|
21
5
|
gyroscope: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* __[Android only]__ `true` when the Android device has significant motion hardware.
|
|
24
|
-
*/
|
|
25
6
|
significant_motion?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* __[iOS only]__ `true` when the device has an __M7__ motion co-processor (iPhone 5S and up).
|
|
28
|
-
*/
|
|
29
7
|
motion_hardware?: boolean;
|
|
30
8
|
}
|
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Emitted by {@link BackgroundGeolocation.onAuthorization}.
|
|
3
|
-
*
|
|
4
|
-
* @category Events
|
|
5
|
-
*/
|
|
6
1
|
export interface AuthorizationEvent {
|
|
7
|
-
/** HTTP status returned from your Authorization.refreshUrl (or 0 if failed). */
|
|
8
2
|
status: number;
|
|
9
|
-
/** True when the authorization request succeeded. */
|
|
10
3
|
success: boolean;
|
|
11
|
-
/** Error message when success is false; otherwise null. */
|
|
12
4
|
error: string | null;
|
|
13
|
-
/** Decoded JSON response when success is true; otherwise null. */
|
|
14
5
|
response: any;
|
|
15
6
|
}
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
import type { Location } from '../data/Location';
|
|
2
2
|
import type { GeofenceAction } from '../../enums/GeofenceAction';
|
|
3
|
-
/**
|
|
4
|
-
* Emitted by {@link BackgroundGeolocation.onGeofence}.
|
|
5
|
-
*
|
|
6
|
-
* @category Events
|
|
7
|
-
*/
|
|
8
3
|
export interface GeofenceEvent {
|
|
9
|
-
/** Device system time when the OS received the geofence event. */
|
|
10
4
|
timestamp: string;
|
|
11
|
-
/** Identifier of the geofence which fired. */
|
|
12
5
|
identifier: string;
|
|
13
|
-
/** Transition type: 'ENTER' | 'EXIT' | 'DWELL'. */
|
|
14
6
|
action: GeofenceAction;
|
|
15
|
-
/** Location where the geofence transition occurred. */
|
|
16
7
|
location: Location;
|
|
17
|
-
/** Optional extras originally configured on the Geofence. */
|
|
18
8
|
extras?: Record<string, any>;
|
|
19
9
|
}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import type { Geofence } from '../data/Geofence';
|
|
2
|
-
/**
|
|
3
|
-
* Emitted by {@link BackgroundGeolocation.onGeofencesChange}.
|
|
4
|
-
*
|
|
5
|
-
* @category Events
|
|
6
|
-
*/
|
|
7
2
|
export interface GeofencesChangeEvent {
|
|
8
|
-
/** Geofences that have just been activated. */
|
|
9
3
|
on: Geofence[];
|
|
10
|
-
/** Identifiers of geofences that have just been de-activated (or removed). */
|
|
11
4
|
off: string[];
|
|
12
5
|
}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import type { Event } from '../../enums/Event';
|
|
2
|
-
/**
|
|
3
|
-
* Event for Android headless tasks registered via {@link BackgroundGeolocation.registerHeadlessTask}
|
|
4
|
-
*
|
|
5
|
-
* @category Events
|
|
6
|
-
*/
|
|
7
2
|
export interface HeadlessEvent {
|
|
8
|
-
/** BackgroundGeolocation event name (e.g., 'location', 'http', 'terminate'). */
|
|
9
3
|
name: Event;
|
|
10
|
-
/** General event params according to the event context. */
|
|
11
4
|
params: Record<string, any>;
|
|
12
5
|
}
|
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
import type { Location } from '../data/Location';
|
|
2
|
-
/**
|
|
3
|
-
* Emitted by {@link BackgroundGeolocation.onHeartbeat}.
|
|
4
|
-
*
|
|
5
|
-
* @category Events
|
|
6
|
-
*/
|
|
7
2
|
export interface HeartbeatEvent {
|
|
8
|
-
/**
|
|
9
|
-
* The last-known location.
|
|
10
|
-
* Note: Heartbeat does not actively engage location-services.
|
|
11
|
-
* Use getCurrentPosition for a fresh fix.
|
|
12
|
-
*/
|
|
13
3
|
location: Location;
|
|
14
4
|
}
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Emitted by {@link BackgroundGeolocation.onHttp}.
|
|
3
|
-
*
|
|
4
|
-
* @category Events
|
|
5
|
-
*/
|
|
6
1
|
export interface HttpEvent {
|
|
7
|
-
/** True if HTTP request succeeded (e.g., 200, 201, 204). */
|
|
8
2
|
success: boolean;
|
|
9
|
-
/** HTTP status code (e.g., 200, 500, 404). */
|
|
10
3
|
status: number;
|
|
11
|
-
/** HTTP response text provided by the server. */
|
|
12
4
|
responseText: string;
|
|
13
5
|
}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import type { MotionActivityType } from '../../enums/MotionActivityType';
|
|
2
|
-
/**
|
|
3
|
-
* Emitted by {@link BackgroundGeolocation.onActivityChange}.
|
|
4
|
-
*
|
|
5
|
-
* @category Events
|
|
6
|
-
*/
|
|
7
2
|
export interface MotionActivityEvent {
|
|
8
|
-
/** Reported device motion activity. */
|
|
9
3
|
activity: MotionActivityType;
|
|
10
|
-
/** Confidence of the reported activity in percent. */
|
|
11
4
|
confidence: number;
|
|
12
5
|
}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import type { Location } from '../data/Location';
|
|
2
|
-
/**
|
|
3
|
-
* Emitted by {@link BackgroundGeolocation.onMotionChange}.
|
|
4
|
-
*
|
|
5
|
-
* @category Events
|
|
6
|
-
*/
|
|
7
2
|
export interface MotionChangeEvent {
|
|
8
|
-
/** True when moving; false when stationary. */
|
|
9
3
|
isMoving: boolean;
|
|
10
|
-
/** Location associated with the motionchange. */
|
|
11
4
|
location: Location;
|
|
12
5
|
}
|
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Emitted by {@link BackgroundGeolocation.onProviderChange}.
|
|
3
|
-
*
|
|
4
|
-
* @category Events
|
|
5
|
-
*/
|
|
6
1
|
export interface ProviderChangeEvent {
|
|
7
|
-
/** True when device location-services are enabled. */
|
|
8
2
|
enabled: boolean;
|
|
9
|
-
/** Authorization status for location-services (platform numeric). */
|
|
10
3
|
status: number;
|
|
11
|
-
/** True if network geolocation provider is available. */
|
|
12
4
|
network: boolean;
|
|
13
|
-
/** True if GPS geolocation provider is available. */
|
|
14
5
|
gps: boolean;
|
|
15
|
-
/** iOS 14+ "Precise" authorization (platform numeric FULL/REDUCED). */
|
|
16
6
|
accuracyAuthorization: number;
|
|
17
7
|
}
|
|
@@ -1,86 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Object returned by BackgroundGeolocation event-listeners.
|
|
3
|
-
*
|
|
4
|
-
* `Subscription` contains just a single method {@link remove}, used for removing an event-listener.
|
|
5
|
-
*
|
|
6
|
-
* - {@link BackgroundGeolocation.onLocation}
|
|
7
|
-
* - {@link BackgroundGeolocation.onMotionChange}
|
|
8
|
-
* - {@link BackgroundGeolocation.onHttp}
|
|
9
|
-
* - {@link BackgroundGeolocation.onHeartbeat}
|
|
10
|
-
* - {@link BackgroundGeolocation.onProviderChange}
|
|
11
|
-
* - {@link BackgroundGeolocation.onActivityChange}
|
|
12
|
-
* - {@link BackgroundGeolocation.onGeofence}
|
|
13
|
-
* - {@link BackgroundGeolocation.onGeofencesChange}
|
|
14
|
-
* - {@link BackgroundGeolocation.onEnabledChange}
|
|
15
|
-
* - {@link BackgroundGeolocation.onConnectivityChange}
|
|
16
|
-
* - {@link BackgroundGeolocation.onSchedule}
|
|
17
|
-
* - {@link BackgroundGeolocation.onPowerSaveChange}
|
|
18
|
-
* - {@link BackgroundGeolocation.onNotificationAction}
|
|
19
|
-
* - {@link BackgroundGeolocation.onAuthorization}
|
|
20
|
-
*
|
|
21
|
-
* __Removing an event-listener__:
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```typescript
|
|
25
|
-
* // Event-listeners return a Subscription instance, containing a .remove() method.
|
|
26
|
-
* const subscription = BackgroundGeolocation.onLocation(location => {
|
|
27
|
-
* console.log("[onLocation] ", location);
|
|
28
|
-
* });
|
|
29
|
-
* .
|
|
30
|
-
* .
|
|
31
|
-
* .
|
|
32
|
-
* // Later, to remove the event-listener:
|
|
33
|
-
* subscription.remove();
|
|
34
|
-
* ```
|
|
35
|
-
*
|
|
36
|
-
* One might typically manage a collection of `Subscription` instances
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```typescript
|
|
40
|
-
* import BackgroundGeolocation, {
|
|
41
|
-
* Location,
|
|
42
|
-
* Subscription
|
|
43
|
-
* } from ...
|
|
44
|
-
*
|
|
45
|
-
* // Your custom Collection of Subscription instances.
|
|
46
|
-
* const SUBSCRIPTIONS = [];
|
|
47
|
-
*
|
|
48
|
-
* // Your custom method to push a Subscription instance.
|
|
49
|
-
* const subscribe = (subscription:Subscription) => {
|
|
50
|
-
* SUBSCRIPTIONS.push(subscription);
|
|
51
|
-
* }
|
|
52
|
-
*
|
|
53
|
-
* // Your custom method to interate your SUBSCRIPTIONS and .remove each.
|
|
54
|
-
* const unsubscribe = () => {
|
|
55
|
-
* SUBSCRIPTIONS.forEach((subscription:Subscription) => subscription.remove());
|
|
56
|
-
* }
|
|
57
|
-
*
|
|
58
|
-
* const initBackgroundGeolocation = () {
|
|
59
|
-
* // Create event-listeners as usual, feeding the returned Subscription into
|
|
60
|
-
* // your custom subscribe() method.
|
|
61
|
-
* subscribe(BackgroundGeolocation.onLocation((location:Location) => {
|
|
62
|
-
* console.log('[onLocation]', location);
|
|
63
|
-
* });
|
|
64
|
-
*
|
|
65
|
-
* subscribe(BackgroundGeolocation.onMotionChange((location:Location) => {
|
|
66
|
-
* console.log('[onMotionChange]', location);
|
|
67
|
-
* });
|
|
68
|
-
*
|
|
69
|
-
* subscribe(BackgroundGeolocation.onEnabledChange((enabled:boolean) => {
|
|
70
|
-
* console.log('[onEnabledChange]', enabled);
|
|
71
|
-
* });
|
|
72
|
-
* }
|
|
73
|
-
*
|
|
74
|
-
* const onDestroyView = () => {
|
|
75
|
-
* // Call your custom unsubscribe method
|
|
76
|
-
* unsubscribe();
|
|
77
|
-
* }
|
|
78
|
-
*
|
|
79
|
-
* ```
|
|
80
|
-
*
|
|
81
|
-
* @category Events
|
|
82
|
-
*/
|
|
83
1
|
export interface Subscription {
|
|
84
|
-
/** Remove the event-listener. */
|
|
85
2
|
remove(): void;
|
|
86
3
|
}
|
package/dist/docs-entry.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Docs-only barrel so TypeDoc can include deprecated LegacyConfig
|
|
3
|
-
// without exporting it from the package root.
|
|
4
|
-
// Consumers import from package root, which intentionally hides LegacyConfig.
|
|
5
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
3
|
if (k2 === undefined) k2 = k;
|
|
7
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Accuracy authorization granted by the user.
|
|
3
|
-
*
|
|
4
|
-
* | Name | Value | Description |
|
|
5
|
-
* |---------------------|:-----:|-----------------------------|
|
|
6
|
-
* | Full | 0 | Full accuracy authorized. |
|
|
7
|
-
* | Reduced | 1 | Reduced accuracy granted. |
|
|
8
|
-
*
|
|
9
|
-
* Mirrors iOS `CLAccuracyAuthorization` and Android location accuracy permission levels.
|
|
10
|
-
*
|
|
11
|
-
* @category Events
|
|
12
|
-
*/
|
|
13
1
|
export declare const AccuracyAuthorization: {
|
|
14
2
|
readonly Full: 0;
|
|
15
3
|
readonly Reduced: 1;
|
|
16
4
|
};
|
|
17
|
-
/**
|
|
18
|
-
* Type union of the AccuracyAuthorization values.
|
|
19
|
-
* @internal @hidden
|
|
20
|
-
*/
|
|
21
5
|
export type AccuracyAuthorization = (typeof AccuracyAuthorization)[keyof typeof AccuracyAuthorization];
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AccuracyAuthorization = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Accuracy authorization granted by the user.
|
|
6
|
-
*
|
|
7
|
-
* | Name | Value | Description |
|
|
8
|
-
* |---------------------|:-----:|-----------------------------|
|
|
9
|
-
* | Full | 0 | Full accuracy authorized. |
|
|
10
|
-
* | Reduced | 1 | Reduced accuracy granted. |
|
|
11
|
-
*
|
|
12
|
-
* Mirrors iOS `CLAccuracyAuthorization` and Android location accuracy permission levels.
|
|
13
|
-
*
|
|
14
|
-
* @category Events
|
|
15
|
-
*/
|
|
16
4
|
exports.AccuracyAuthorization = {
|
|
17
5
|
Full: 0,
|
|
18
6
|
Reduced: 1,
|
|
@@ -1,33 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* iOS Activity Type used with {@link GeoConfig.activityType}.
|
|
3
|
-
*
|
|
4
|
-
* Corresponds to Apple's `CLActivityType` enum:
|
|
5
|
-
* https://developer.apple.com/documentation/corelocation/clactivitytype
|
|
6
|
-
*
|
|
7
|
-
* | Name | Value | Description |
|
|
8
|
-
* |------------------------|:-----:|---------------------------------------|
|
|
9
|
-
* | Other | 1 | Default/unspecified activity. |
|
|
10
|
-
* | AutomotiveNavigation | 2 | Automotive navigation mode. |
|
|
11
|
-
* | Fitness | 3 | Fitness-related activity. |
|
|
12
|
-
* | OtherNavigation | 4 | Non-automotive navigation mode. |
|
|
13
|
-
* | Airborne | 5 | Airborne activity (iOS 15+). |
|
|
14
|
-
*
|
|
15
|
-
* @category Config
|
|
16
|
-
*/
|
|
17
1
|
export declare const ActivityType: {
|
|
18
|
-
/** Default/unspecified activity. */
|
|
19
2
|
readonly Other: 1;
|
|
20
|
-
/** Automotive navigation activity. */
|
|
21
3
|
readonly AutomotiveNavigation: 2;
|
|
22
|
-
/** Fitness (walking, running, etc). */
|
|
23
4
|
readonly Fitness: 3;
|
|
24
|
-
/** Other navigation (non-automotive). */
|
|
25
5
|
readonly OtherNavigation: 4;
|
|
26
|
-
/** Airborne activity (iOS 15+). */
|
|
27
6
|
readonly Airborne: 5;
|
|
28
7
|
};
|
|
29
|
-
/**
|
|
30
|
-
* Type union of the ActivityType values.
|
|
31
|
-
* @internal @hidden
|
|
32
|
-
*/
|
|
33
8
|
export type ActivityType = (typeof ActivityType)[keyof typeof ActivityType];
|
|
@@ -1,31 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ActivityType = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* iOS Activity Type used with {@link GeoConfig.activityType}.
|
|
6
|
-
*
|
|
7
|
-
* Corresponds to Apple's `CLActivityType` enum:
|
|
8
|
-
* https://developer.apple.com/documentation/corelocation/clactivitytype
|
|
9
|
-
*
|
|
10
|
-
* | Name | Value | Description |
|
|
11
|
-
* |------------------------|:-----:|---------------------------------------|
|
|
12
|
-
* | Other | 1 | Default/unspecified activity. |
|
|
13
|
-
* | AutomotiveNavigation | 2 | Automotive navigation mode. |
|
|
14
|
-
* | Fitness | 3 | Fitness-related activity. |
|
|
15
|
-
* | OtherNavigation | 4 | Non-automotive navigation mode. |
|
|
16
|
-
* | Airborne | 5 | Airborne activity (iOS 15+). |
|
|
17
|
-
*
|
|
18
|
-
* @category Config
|
|
19
|
-
*/
|
|
20
4
|
exports.ActivityType = {
|
|
21
|
-
/** Default/unspecified activity. */
|
|
22
5
|
Other: 1,
|
|
23
|
-
/** Automotive navigation activity. */
|
|
24
6
|
AutomotiveNavigation: 2,
|
|
25
|
-
/** Fitness (walking, running, etc). */
|
|
26
7
|
Fitness: 3,
|
|
27
|
-
/** Other navigation (non-automotive). */
|
|
28
8
|
OtherNavigation: 4,
|
|
29
|
-
/** Airborne activity (iOS 15+). */
|
|
30
9
|
Airborne: 5,
|
|
31
10
|
};
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* iOS/Android location authorization status.
|
|
3
|
-
*
|
|
4
|
-
* | Name | Value | Platform |
|
|
5
|
-
* |---------------------|:-----:|-------------------------|
|
|
6
|
-
* | NotDetermined | 0 | iOS only |
|
|
7
|
-
* | Restricted | 1 | iOS only |
|
|
8
|
-
* | Denied | 2 | iOS & Android |
|
|
9
|
-
* | Always | 3 | iOS & Android |
|
|
10
|
-
* | WhenInUse | 4 | iOS & Android 10+ |
|
|
11
|
-
*
|
|
12
|
-
* @category Events
|
|
13
|
-
*/
|
|
14
1
|
export declare const AuthorizationStatus: {
|
|
15
2
|
readonly NotDetermined: 0;
|
|
16
3
|
readonly Restricted: 1;
|
|
@@ -18,7 +5,4 @@ export declare const AuthorizationStatus: {
|
|
|
18
5
|
readonly Always: 3;
|
|
19
6
|
readonly WhenInUse: 4;
|
|
20
7
|
};
|
|
21
|
-
/**
|
|
22
|
-
* @hidden @internal
|
|
23
|
-
*/
|
|
24
8
|
export type AuthorizationStatus = (typeof AuthorizationStatus)[keyof typeof AuthorizationStatus];
|