@transistorsoft/background-geolocation-types 5.2.0 → 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';
@@ -110,7 +111,7 @@ export interface BackgroundGeolocationAPI extends BackgroundGeolocationEvents {
110
111
  destroyLocations(): Promise<void>;
111
112
  destroyLocation(uuid: string): Promise<void>;
112
113
  insertLocation(location: Location): Promise<Location>;
113
- getLocations(): Promise<Array<Object>>;
114
+ getLocations(query?: LocationQuery): Promise<Array<Object>>;
114
115
  getCount(): Promise<number>;
115
116
  sync(): Promise<Array<Object>>;
116
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 });
@@ -1,8 +1,17 @@
1
1
  import type { Location } from '../data/Location';
2
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
+ }
3
11
  export interface LocationFilterEvent {
4
12
  location: Location;
5
13
  reason: LocationFilterReason;
6
14
  accuracy: number;
7
15
  trackingAccuracyThreshold: number;
16
+ geofence?: GeofenceFilterInfo;
8
17
  }
@@ -2,5 +2,7 @@ export declare const LocationFilterReason: {
2
2
  readonly LowAccuracy: "low-accuracy";
3
3
  readonly ImpliedSpeed: "implied-speed";
4
4
  readonly OutlierCapped: "outlier-capped";
5
+ readonly GeofenceSpuriousExit: "geofence-spurious-exit";
6
+ readonly GeofenceDuplicateEnter: "geofence-duplicate-enter";
5
7
  };
6
8
  export type LocationFilterReason = (typeof LocationFilterReason)[keyof typeof LocationFilterReason];
@@ -5,4 +5,6 @@ exports.LocationFilterReason = {
5
5
  LowAccuracy: 'low-accuracy',
6
6
  ImpliedSpeed: 'implied-speed',
7
7
  OutlierCapped: 'outlier-capped',
8
+ GeofenceSpuriousExit: 'geofence-spurious-exit',
9
+ GeofenceDuplicateEnter: 'geofence-duplicate-enter',
8
10
  };
package/dist/index.d.ts CHANGED
@@ -51,4 +51,5 @@ export * from './core/api/Logger';
51
51
  export * from './core/api/DeviceSettings';
52
52
  export * from './core/api/CurrentPositionRequest';
53
53
  export * from './core/api/WatchPositionRequest';
54
+ export * from './core/api/LocationQuery';
54
55
  export * from './core/api/TransistorAuthorizationService';
package/dist/index.js CHANGED
@@ -67,4 +67,5 @@ __exportStar(require("./core/api/Logger"), exports);
67
67
  __exportStar(require("./core/api/DeviceSettings"), exports);
68
68
  __exportStar(require("./core/api/CurrentPositionRequest"), exports);
69
69
  __exportStar(require("./core/api/WatchPositionRequest"), exports);
70
+ __exportStar(require("./core/api/LocationQuery"), exports);
70
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.2.0",
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>",