@transistorsoft/background-geolocation-types 5.1.2 → 5.2.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.
@@ -2,6 +2,7 @@ import type { Logger } from './Logger';
2
2
  import type { DeviceSettings } from './DeviceSettings';
3
3
  import type { CurrentPositionRequest } from './CurrentPositionRequest';
4
4
  import type { WatchPositionRequest } from './WatchPositionRequest';
5
+ import type { LocationQuery } from './LocationQuery';
5
6
  import type { Config } from '../config/Config';
6
7
  import type { State } from './State';
7
8
  import type { Location } from '../data/Location';
@@ -18,6 +19,7 @@ import type { HeartbeatEvent } from '../events/HeartbeatEvent';
18
19
  import type { GeofencesChangeEvent } from '../events/GeofencesChangeEvent';
19
20
  import type { ConnectivityChangeEvent } from '../events/ConnectivityChangeEvent';
20
21
  import type { MotionChangeEvent } from '../events/MotionChangeEvent';
22
+ import type { LocationFilterEvent } from '../events/LocationFilterEvent';
21
23
  import type { ProviderChangeEvent } from '../events/ProviderChangeEvent';
22
24
  import type { HttpEvent } from '../events/HttpEvent';
23
25
  import type { AuthorizationStatus } from '../../enums/AuthorizationStatus';
@@ -29,6 +31,7 @@ export interface EventPayloads {
29
31
  location: Location;
30
32
  motionchange: MotionChangeEvent;
31
33
  activitychange: MotionActivityEvent;
34
+ locationfilter: LocationFilterEvent;
32
35
  geofence: GeofenceEvent;
33
36
  geofenceschange: GeofencesChangeEvent;
34
37
  http: HttpEvent;
@@ -53,6 +56,7 @@ export interface EventPayloads {
53
56
  export interface BackgroundGeolocationEvents {
54
57
  onLocation(cb: (location: Location) => void, onError?: (err: LocationError) => void): Subscription;
55
58
  onMotionChange(cb: (event: MotionChangeEvent) => void): Subscription;
59
+ onLocationFilter(cb: (event: LocationFilterEvent) => void): Subscription;
56
60
  onGeofence(cb: (event: GeofenceEvent) => void): Subscription;
57
61
  onGeofencesChange(cb: (event: GeofencesChangeEvent) => void): Subscription;
58
62
  onActivityChange(cb: (event: MotionActivityEvent) => void): Subscription;
@@ -107,7 +111,7 @@ export interface BackgroundGeolocationAPI extends BackgroundGeolocationEvents {
107
111
  destroyLocations(): Promise<void>;
108
112
  destroyLocation(uuid: string): Promise<void>;
109
113
  insertLocation(location: Location): Promise<Location>;
110
- getLocations(): Promise<Array<Object>>;
114
+ getLocations(query?: LocationQuery): Promise<Array<Object>>;
111
115
  getCount(): Promise<number>;
112
116
  sync(): Promise<Array<Object>>;
113
117
  startBackgroundTask(): Promise<number>;
@@ -0,0 +1,7 @@
1
+ import { SQLQueryOrder } from "../../enums/SQLQueryOrder";
2
+ export interface LocationQuery {
3
+ limit?: number;
4
+ offset?: number;
5
+ page?: number;
6
+ order?: SQLQueryOrder;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ import type { Location } from '../data/Location';
2
+ import type { LocationFilterReason } from '../../enums/LocationFilterReason';
3
+ export interface GeofenceFilterInfo {
4
+ identifier: string;
5
+ action: string;
6
+ reason: string;
7
+ dist: number;
8
+ radius: number;
9
+ outsideBy: number;
10
+ }
11
+ export interface LocationFilterEvent {
12
+ location: Location;
13
+ reason: LocationFilterReason;
14
+ accuracy: number;
15
+ trackingAccuracyThreshold: number;
16
+ geofence?: GeofenceFilterInfo;
17
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -4,6 +4,7 @@ export declare const Event: {
4
4
  readonly Location: "location";
5
5
  readonly MotionChange: "motionchange";
6
6
  readonly ActivityChange: "activitychange";
7
+ readonly LocationFilter: "locationfilter";
7
8
  readonly Geofence: "geofence";
8
9
  readonly GeofencesChange: "geofenceschange";
9
10
  readonly Http: "http";
@@ -7,6 +7,7 @@ exports.Event = {
7
7
  Location: 'location',
8
8
  MotionChange: 'motionchange',
9
9
  ActivityChange: 'activitychange',
10
+ LocationFilter: 'locationfilter',
10
11
  Geofence: 'geofence',
11
12
  GeofencesChange: 'geofenceschange',
12
13
  Http: 'http',
@@ -0,0 +1,8 @@
1
+ export declare const LocationFilterReason: {
2
+ readonly LowAccuracy: "low-accuracy";
3
+ readonly ImpliedSpeed: "implied-speed";
4
+ readonly OutlierCapped: "outlier-capped";
5
+ readonly GeofenceSpuriousExit: "geofence-spurious-exit";
6
+ readonly GeofenceDuplicateEnter: "geofence-duplicate-enter";
7
+ };
8
+ export type LocationFilterReason = (typeof LocationFilterReason)[keyof typeof LocationFilterReason];
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LocationFilterReason = void 0;
4
+ exports.LocationFilterReason = {
5
+ LowAccuracy: 'low-accuracy',
6
+ ImpliedSpeed: 'implied-speed',
7
+ OutlierCapped: 'outlier-capped',
8
+ GeofenceSpuriousExit: 'geofence-spurious-exit',
9
+ GeofenceDuplicateEnter: 'geofence-duplicate-enter',
10
+ };
package/dist/index.d.ts CHANGED
@@ -17,6 +17,7 @@ export * from './enums/GeofenceAction';
17
17
  export * from './enums/Event';
18
18
  export * from './enums/ActivityType';
19
19
  export * from './enums/LocationError';
20
+ export * from './enums/LocationFilterReason';
20
21
  export * from './enums/SQLQueryOrder';
21
22
  export * from "./core/data/Location";
22
23
  export * from './core/data/Geofence';
@@ -31,6 +32,7 @@ export * from "./core/events/HeartbeatEvent";
31
32
  export * from "./core/events/GeofencesChangeEvent";
32
33
  export * from "./core/events/ConnectivityChangeEvent";
33
34
  export * from "./core/events/MotionChangeEvent";
35
+ export * from "./core/events/LocationFilterEvent";
34
36
  export * from "./core/events/ProviderChangeEvent";
35
37
  export * from "./core/events/HttpEvent";
36
38
  export * from './core/config/Config';
@@ -49,4 +51,5 @@ export * from './core/api/Logger';
49
51
  export * from './core/api/DeviceSettings';
50
52
  export * from './core/api/CurrentPositionRequest';
51
53
  export * from './core/api/WatchPositionRequest';
54
+ export * from './core/api/LocationQuery';
52
55
  export * from './core/api/TransistorAuthorizationService';
package/dist/index.js CHANGED
@@ -33,6 +33,7 @@ __exportStar(require("./enums/GeofenceAction"), exports);
33
33
  __exportStar(require("./enums/Event"), exports);
34
34
  __exportStar(require("./enums/ActivityType"), exports);
35
35
  __exportStar(require("./enums/LocationError"), exports);
36
+ __exportStar(require("./enums/LocationFilterReason"), exports);
36
37
  __exportStar(require("./enums/SQLQueryOrder"), exports);
37
38
  __exportStar(require("./core/data/Location"), exports);
38
39
  __exportStar(require("./core/data/Geofence"), exports);
@@ -47,6 +48,7 @@ __exportStar(require("./core/events/HeartbeatEvent"), exports);
47
48
  __exportStar(require("./core/events/GeofencesChangeEvent"), exports);
48
49
  __exportStar(require("./core/events/ConnectivityChangeEvent"), exports);
49
50
  __exportStar(require("./core/events/MotionChangeEvent"), exports);
51
+ __exportStar(require("./core/events/LocationFilterEvent"), exports);
50
52
  __exportStar(require("./core/events/ProviderChangeEvent"), exports);
51
53
  __exportStar(require("./core/events/HttpEvent"), exports);
52
54
  __exportStar(require("./core/config/Config"), exports);
@@ -65,4 +67,5 @@ __exportStar(require("./core/api/Logger"), exports);
65
67
  __exportStar(require("./core/api/DeviceSettings"), exports);
66
68
  __exportStar(require("./core/api/CurrentPositionRequest"), exports);
67
69
  __exportStar(require("./core/api/WatchPositionRequest"), exports);
70
+ __exportStar(require("./core/api/LocationQuery"), exports);
68
71
  __exportStar(require("./core/api/TransistorAuthorizationService"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transistorsoft/background-geolocation-types",
3
- "version": "5.1.2",
3
+ "version": "5.2.1",
4
4
  "type": "commonjs",
5
5
  "description": "Shared TypeScript type definitions and documentation for Transistor Software's Background Geolocation SDKs (React Native, Capacitor, Cordova)",
6
6
  "author": "Transistor Software <info@transistorsoft.com>",