@transistorsoft/background-geolocation-types 5.2.1 → 5.3.0

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.
@@ -5,7 +5,7 @@ import type { WatchPositionRequest } from './WatchPositionRequest';
5
5
  import type { LocationQuery } from './LocationQuery';
6
6
  import type { Config } from '../config/Config';
7
7
  import type { State } from './State';
8
- import type { Location } from '../data/Location';
8
+ import type { Location, LocationInput } from '../data/Location';
9
9
  import type { LocationError } from '../../enums/LocationError';
10
10
  import type { Geofence } from '../data/Geofence';
11
11
  import type { DeviceInfo } from '../data/DeviceInfo';
@@ -23,6 +23,7 @@ import type { LocationFilterEvent } from '../events/LocationFilterEvent';
23
23
  import type { ProviderChangeEvent } from '../events/ProviderChangeEvent';
24
24
  import type { HttpEvent } from '../events/HttpEvent';
25
25
  import type { AuthorizationStatus } from '../../enums/AuthorizationStatus';
26
+ import type { Permission } from '../../enums/Permission';
26
27
  import type { LogLevel } from '../../enums/LogLevel';
27
28
  import type { PersistMode } from '../../enums/PersistMode';
28
29
  import type { AccuracyAuthorization } from '../../enums/AccuracyAuthorization';
@@ -92,7 +93,7 @@ export interface BackgroundGeolocationAPI extends BackgroundGeolocationEvents {
92
93
  setOdometer(value: number): Promise<number>;
93
94
  getOdometer(): Promise<number>;
94
95
  getProviderState(): Promise<ProviderChangeEvent>;
95
- requestPermission(): Promise<AuthorizationStatus>;
96
+ requestPermission(permission?: Permission): Promise<AuthorizationStatus>;
96
97
  requestTemporaryFullAccuracy(purposeKey: string): Promise<AccuracyAuthorization>;
97
98
  addGeofence(geofence: Geofence): Promise<boolean>;
98
99
  addGeofences(geofences: Geofence[]): Promise<boolean>;
@@ -110,7 +111,7 @@ export interface BackgroundGeolocationAPI extends BackgroundGeolocationEvents {
110
111
  isPowerSaveMode(): Promise<boolean>;
111
112
  destroyLocations(): Promise<void>;
112
113
  destroyLocation(uuid: string): Promise<void>;
113
- insertLocation(location: Location): Promise<Location>;
114
+ insertLocation(location: LocationInput): Promise<string>;
114
115
  getLocations(query?: LocationQuery): Promise<Array<Object>>;
115
116
  getCount(): Promise<number>;
116
117
  sync(): Promise<Array<Object>>;
@@ -40,3 +40,9 @@ export interface Location {
40
40
  activity: MotionActivity;
41
41
  provider?: ProviderChangeEvent;
42
42
  }
43
+ export interface LocationInput {
44
+ coords: Pick<Coords, "latitude" | "longitude"> & Partial<Coords>;
45
+ timestamp?: string | number;
46
+ uuid?: string;
47
+ [key: string]: any;
48
+ }
@@ -4,5 +4,6 @@ export declare const AuthorizationStatus: {
4
4
  readonly Denied: 2;
5
5
  readonly Always: 3;
6
6
  readonly WhenInUse: 4;
7
+ readonly DeniedAlways: 5;
7
8
  };
8
9
  export type AuthorizationStatus = (typeof AuthorizationStatus)[keyof typeof AuthorizationStatus];
@@ -7,4 +7,5 @@ exports.AuthorizationStatus = {
7
7
  Denied: 2,
8
8
  Always: 3,
9
9
  WhenInUse: 4,
10
+ DeniedAlways: 5,
10
11
  };
@@ -0,0 +1,5 @@
1
+ export declare const Permission: {
2
+ readonly Location: "location";
3
+ readonly Motion: "motion";
4
+ };
5
+ export type Permission = (typeof Permission)[keyof typeof Permission];
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Permission = void 0;
4
+ exports.Permission = {
5
+ Location: 'location',
6
+ Motion: 'motion',
7
+ };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './enums/AuthorizationStatus';
2
+ export * from './enums/Permission';
2
3
  export * from './enums/LogLevel';
3
4
  export * from './enums/DesiredAccuracy';
4
5
  export * from './enums/PersistMode';
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./enums/AuthorizationStatus"), exports);
18
+ __exportStar(require("./enums/Permission"), exports);
18
19
  __exportStar(require("./enums/LogLevel"), exports);
19
20
  __exportStar(require("./enums/DesiredAccuracy"), exports);
20
21
  __exportStar(require("./enums/PersistMode"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transistorsoft/background-geolocation-types",
3
- "version": "5.2.1",
3
+ "version": "5.3.0",
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>",