@transistorsoft/background-geolocation-types 5.0.0 → 5.0.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.
@@ -1,6 +1,7 @@
1
1
  import type { Logger } from './Logger';
2
2
  import type { DeviceSettings } from './DeviceSettings';
3
3
  import type { CurrentPositionRequest } from './CurrentPositionRequest';
4
+ import type { WatchPositionRequest } from './WatchPositionRequest';
4
5
  import type { Config } from '../config/Config';
5
6
  import type { State } from './State';
6
7
  import type { Location } from '../data/Location';
@@ -81,8 +82,8 @@ export interface BackgroundGeolocationAPI extends BackgroundGeolocationEvents {
81
82
  getState(): Promise<State>;
82
83
  setConfig(config: Partial<Config>): Promise<State>;
83
84
  getCurrentPosition(options?: CurrentPositionRequest): Promise<Location>;
84
- watchPosition(cb: (location: Location) => void, options?: CurrentPositionRequest): Subscription;
85
- stopWatchPosition?(sub?: Subscription): void;
85
+ watchPosition(options: WatchPositionRequest, locationCallback: (location: Location) => void, errorCallback?: (errorCode: number) => void): Subscription;
86
+ stopWatchPosition?(watchId?: number): void;
86
87
  resetOdometer(): Promise<number>;
87
88
  setOdometer(value: number): Promise<number>;
88
89
  getOdometer(): Promise<number>;
@@ -0,0 +1,8 @@
1
+ import type { DesiredAccuracy } from '../../enums/DesiredAccuracy';
2
+ export interface WatchPositionRequest {
3
+ interval?: number;
4
+ desiredAccuracy?: DesiredAccuracy;
5
+ persist?: boolean;
6
+ extras?: Record<string, any>;
7
+ timeout?: number;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/index.d.ts CHANGED
@@ -48,4 +48,5 @@ export * from './core/api/State';
48
48
  export * from './core/api/Logger';
49
49
  export * from './core/api/DeviceSettings';
50
50
  export * from './core/api/CurrentPositionRequest';
51
+ export * from './core/api/WatchPositionRequest';
51
52
  export * from './core/api/TransistorAuthorizationService';
package/dist/index.js CHANGED
@@ -64,4 +64,5 @@ __exportStar(require("./core/api/State"), exports);
64
64
  __exportStar(require("./core/api/Logger"), exports);
65
65
  __exportStar(require("./core/api/DeviceSettings"), exports);
66
66
  __exportStar(require("./core/api/CurrentPositionRequest"), exports);
67
+ __exportStar(require("./core/api/WatchPositionRequest"), exports);
67
68
  __exportStar(require("./core/api/TransistorAuthorizationService"), exports);
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@transistorsoft/background-geolocation-types",
3
- "version": "5.0.0",
3
+ "version": "5.0.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>",
7
- "license": "SEE LICENSE IN LICENSE",
7
+ "license": "MIT",
8
8
  "homepage": "https://github.com/transistorsoft/background-geolocation",
9
9
  "repository": {
10
10
  "type": "git",