@transistorsoft/background-geolocation-types 5.0.0 → 5.1.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.
@@ -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>;
@@ -114,6 +115,7 @@ export interface BackgroundGeolocationAPI extends BackgroundGeolocationEvents {
114
115
  finishHeadlessTask(taskId: string): Promise<number>;
115
116
  findOrCreateTransistorAuthorizationToken(orgname: string, username: string, url?: string): Promise<TransistorAuthorizationToken>;
116
117
  destroyTransistorAuthorizationToken(url: string): Promise<void>;
118
+ playSound(soundId: number | string): void;
117
119
  }
118
120
  export interface BackgroundGeolocation extends BackgroundGeolocationAPI {
119
121
  LogLevel: typeof import('../../enums/LogLevel').LogLevel;
@@ -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 });
@@ -8,4 +8,5 @@ export interface PersistenceConfig {
8
8
  persistMode?: PersistMode;
9
9
  extras?: Record<string, any>;
10
10
  disableProviderChangeRecord?: boolean;
11
+ timestampFormat?: 'iso' | 'epoch';
11
12
  }
@@ -9,11 +9,11 @@ export declare const Event: {
9
9
  readonly Http: "http";
10
10
  readonly Heartbeat: "heartbeat";
11
11
  readonly ProviderChange: "providerchange";
12
+ readonly Schedule: "schedule";
13
+ readonly Notification: "notification";
12
14
  readonly Authorization: "authorization";
13
15
  readonly ConnectivityChange: "connectivitychange";
14
16
  readonly EnabledChange: "enabledchange";
15
17
  readonly PowerSaveChange: "powersavechange";
16
- readonly Schedule: "schedule";
17
- readonly Notification: "notification";
18
18
  };
19
19
  export type Event = (typeof Event)[keyof typeof Event];
@@ -12,10 +12,10 @@ exports.Event = {
12
12
  Http: 'http',
13
13
  Heartbeat: 'heartbeat',
14
14
  ProviderChange: 'providerchange',
15
+ Schedule: 'schedule',
16
+ Notification: 'notification',
15
17
  Authorization: 'authorization',
16
18
  ConnectivityChange: 'connectivitychange',
17
19
  EnabledChange: 'enabledchange',
18
- PowerSaveChange: 'powersavechange',
19
- Schedule: 'schedule',
20
- Notification: 'notification'
20
+ PowerSaveChange: 'powersavechange'
21
21
  };
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.1.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>",
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",
@@ -35,17 +35,19 @@
35
35
  }
36
36
  },
37
37
  "sideEffects": false,
38
+ "scripts": {
39
+ "clean": "rimraf dist",
40
+ "build": "tsc -p tsconfig.json",
41
+ "watch": "tsc -p tsconfig.json -w",
42
+ "prepare": "pnpm run build",
43
+ "docs": "typedoc --options typedoc.json",
44
+ "prepublishOnly": "pnpm run build"
45
+ },
38
46
  "devDependencies": {
39
47
  "@types/node": "^24.10.0",
40
48
  "rimraf": "^5.0.0",
41
49
  "typedoc": "^0.28.14",
42
50
  "typedoc-plugin-markdown": "^4.9.0",
43
51
  "typescript": "^5.6.0"
44
- },
45
- "scripts": {
46
- "clean": "rimraf dist",
47
- "build": "tsc -p tsconfig.json",
48
- "watch": "tsc -p tsconfig.json -w",
49
- "docs": "typedoc --options typedoc.json"
50
52
  }
51
- }
53
+ }
package/typedoc.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "githubUser": "transistorsoft",
7
7
  "out": "docs",
8
8
  "readme": "none",
9
- "highlightLanguages": ["ts", "js", "json", "xml", "bash", "console", "erb", "java"],
9
+ "highlightLanguages": ["ts", "js", "json", "xml", "bash", "console", "erb", "java", "objc"],
10
10
  "disableSources": true,
11
11
  "includeVersion": true,
12
12
  "sort": ["source-order"],
@@ -24,5 +24,15 @@
24
24
  "./tools/typedoc-plugin-gitlink/index.cjs",
25
25
  "./tools/typedoc-plugin-mediaplayer/index.cjs",
26
26
  "./tools/typedoc-plugin-site/index.cjs"
27
- ]
27
+ ],
28
+ "customCss": "./assets/css/theme.css",
29
+ "navigation": {
30
+ "includeCategories": true,
31
+ "includeGroups": true,
32
+ "includeFolders": false,
33
+ "compactFolders": true,
34
+ "excludeReferences": true
35
+ },
36
+ "categorizeByGroup": true
37
+
28
38
  }