@wayq/beekon-rn 0.0.3 → 0.0.5
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.
- package/BeekonRn.podspec +1 -1
- package/README.md +91 -39
- package/android/build.gradle +9 -4
- package/android/src/main/java/in/wayq/beekonrn/BeekonRnModule.kt +306 -60
- package/ios/BeekonRn.mm +90 -24
- package/ios/BeekonRn.swift +360 -60
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/BeekonKit +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Info.plist +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.abi.json +7521 -1312
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.swiftinterface +191 -40
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/BeekonKit +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Info.plist +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.abi.json +7521 -1312
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +191 -40
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +7521 -1312
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +191 -40
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/_CodeSignature/CodeResources +2 -80
- package/lib/module/NativeBeekonRn.js +22 -7
- package/lib/module/NativeBeekonRn.js.map +1 -1
- package/lib/module/beekon.js +198 -46
- package/lib/module/beekon.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal/mappers.js +122 -28
- package/lib/module/internal/mappers.js.map +1 -1
- package/lib/module/types/config.js +2 -0
- package/lib/module/types/enums.js +2 -0
- package/lib/module/types/enums.js.map +1 -0
- package/lib/module/types/error.js +10 -4
- package/lib/module/types/error.js.map +1 -1
- package/lib/module/types/geofence.js +2 -0
- package/lib/module/types/geofence.js.map +1 -0
- package/lib/module/types/location.js +2 -0
- package/lib/module/types/sync.js +2 -0
- package/lib/module/types/sync.js.map +1 -0
- package/lib/typescript/src/NativeBeekonRn.d.ts +102 -20
- package/lib/typescript/src/NativeBeekonRn.d.ts.map +1 -1
- package/lib/typescript/src/beekon.d.ts +81 -33
- package/lib/typescript/src/beekon.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +5 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/internal/mappers.d.ts +12 -6
- package/lib/typescript/src/internal/mappers.d.ts.map +1 -1
- package/lib/typescript/src/types/config.d.ts +50 -20
- package/lib/typescript/src/types/config.d.ts.map +1 -1
- package/lib/typescript/src/types/enums.d.ts +48 -0
- package/lib/typescript/src/types/enums.d.ts.map +1 -0
- package/lib/typescript/src/types/error.d.ts +11 -5
- package/lib/typescript/src/types/error.d.ts.map +1 -1
- package/lib/typescript/src/types/geofence.d.ts +36 -0
- package/lib/typescript/src/types/geofence.d.ts.map +1 -0
- package/lib/typescript/src/types/location.d.ts +22 -8
- package/lib/typescript/src/types/location.d.ts.map +1 -1
- package/lib/typescript/src/types/state.d.ts +13 -4
- package/lib/typescript/src/types/state.d.ts.map +1 -1
- package/lib/typescript/src/types/sync.d.ts +27 -0
- package/lib/typescript/src/types/sync.d.ts.map +1 -0
- package/package.json +4 -5
- package/scripts/fetch-beekonkit.sh +5 -5
- package/src/NativeBeekonRn.ts +110 -20
- package/src/beekon.ts +219 -49
- package/src/index.tsx +21 -2
- package/src/internal/mappers.ts +187 -30
- package/src/types/config.ts +52 -20
- package/src/types/enums.ts +64 -0
- package/src/types/error.ts +11 -8
- package/src/types/geofence.ts +37 -0
- package/src/types/location.ts +28 -8
- package/src/types/state.ts +13 -3
- package/src/types/sync.ts +23 -0
- package/ios/Frameworks/BeekonKit.xcframework/_CodeSignature/CodeDirectory +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/_CodeSignature/CodeRequirements +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/_CodeSignature/CodeResources +0 -296
- package/ios/Frameworks/BeekonKit.xcframework/_CodeSignature/CodeSignature +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/_CodeSignature/CodeResources +0 -146
|
@@ -1,17 +1,23 @@
|
|
|
1
|
+
import type { ActivityType, LocationQuality, LocationTrigger, MotionState } from './enums';
|
|
1
2
|
/**
|
|
2
3
|
* A single location fix as emitted by the native SDK after gating. Fields map
|
|
3
4
|
* 1:1 to `in.wayq.beekon.Location` on Android and `BeekonKit.Location` on iOS.
|
|
4
5
|
*
|
|
5
|
-
* `
|
|
6
|
-
* are `null` when the OS did not report a value — the
|
|
7
|
-
* value to mask absence (e.g. a stationary device returns
|
|
8
|
-
* not `0`).
|
|
6
|
+
* `id`, `latitude`, `longitude`, and `timestamp` are always present. The four
|
|
7
|
+
* optional numeric fields are `null` when the OS did not report a value — the
|
|
8
|
+
* SDK never invents a value to mask absence (e.g. a stationary device returns
|
|
9
|
+
* `bearing === null`, not `0`). `activity` is `null` unless
|
|
10
|
+
* {@link BeekonConfig.detectActivity} is enabled.
|
|
9
11
|
*/
|
|
10
12
|
export type Location = {
|
|
13
|
+
/** Stable, unique storage id. Used as the dedup key on upload. */
|
|
14
|
+
id: string;
|
|
11
15
|
/** Latitude in degrees, WGS-84. */
|
|
12
|
-
|
|
16
|
+
latitude: number;
|
|
13
17
|
/** Longitude in degrees, WGS-84. */
|
|
14
|
-
|
|
18
|
+
longitude: number;
|
|
19
|
+
/** Time the OS provider reported this fix (not when JS received it). */
|
|
20
|
+
timestamp: Date;
|
|
15
21
|
/** Horizontal accuracy in meters (1-sigma); `null` if unreported. */
|
|
16
22
|
accuracy: number | null;
|
|
17
23
|
/** Speed in m/s; `null` if unreported. */
|
|
@@ -20,7 +26,15 @@ export type Location = {
|
|
|
20
26
|
bearing: number | null;
|
|
21
27
|
/** Altitude in meters above the WGS-84 ellipsoid; `null` if unreported. */
|
|
22
28
|
altitude: number | null;
|
|
23
|
-
/**
|
|
24
|
-
|
|
29
|
+
/** The gate's quality verdict for this fix. */
|
|
30
|
+
quality: LocationQuality;
|
|
31
|
+
/** Why this fix was captured. */
|
|
32
|
+
trigger: LocationTrigger;
|
|
33
|
+
/** Device motion when this fix was captured. */
|
|
34
|
+
motion: MotionState;
|
|
35
|
+
/** Detected activity, or `null` unless activity detection is enabled. */
|
|
36
|
+
activity: ActivityType | null;
|
|
37
|
+
/** `true` if the OS flagged this fix as mock/simulated. */
|
|
38
|
+
isMock: boolean;
|
|
25
39
|
};
|
|
26
40
|
//# sourceMappingURL=location.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../../../src/types/location.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../../../src/types/location.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EACf,eAAe,EACf,WAAW,EACZ,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;GASG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,kEAAkE;IAClE,EAAE,EAAE,MAAM,CAAC;IACX,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,SAAS,EAAE,IAAI,CAAC;IAChB,qEAAqE;IACrE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,0CAA0C;IAC1C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,qFAAqF;IACrF,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,+CAA+C;IAC/C,OAAO,EAAE,eAAe,CAAC;IACzB,iCAAiC;IACjC,OAAO,EAAE,eAAe,CAAC;IACzB,gDAAgD;IAChD,MAAM,EAAE,WAAW,CAAC;IACpB,yEAAyE;IACzE,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC;IAC9B,2DAA2D;IAC3D,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC"}
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Reason a tracking session ended. Mirrors `StopReason` on both platforms.
|
|
3
3
|
*
|
|
4
|
-
* `'
|
|
5
|
-
*
|
|
4
|
+
* - `'user'` — `Beekon.stop()` was called.
|
|
5
|
+
* - `'permissionDenied'` — location permission is missing or was revoked
|
|
6
|
+
* (user-fixable in Settings).
|
|
7
|
+
* - `'locationServicesDisabled'` — system-wide location services are off
|
|
8
|
+
* (user-fixable in Settings).
|
|
9
|
+
* - `'locationUnavailable'` — no usable location backend on this device (e.g.
|
|
10
|
+
* Google Play Services absent/outdated on Android). Not user-fixable.
|
|
11
|
+
* - `'system'` — the OS terminated tracking (e.g. foreground-service kill,
|
|
12
|
+
* or an unrecoverable internal error).
|
|
6
13
|
*/
|
|
7
|
-
export type StopReason = 'user' | 'permissionDenied' | 'locationServicesDisabled' | 'system';
|
|
14
|
+
export type StopReason = 'user' | 'permissionDenied' | 'locationServicesDisabled' | 'locationUnavailable' | 'system';
|
|
8
15
|
/**
|
|
9
16
|
* Tracking state. Mirrors the native `BeekonState` sealed type on both
|
|
10
17
|
* platforms. Use the `kind` field as a discriminator.
|
|
11
18
|
*
|
|
12
|
-
* Lifecycle: `idle → tracking → stopped(reason)`.
|
|
19
|
+
* Lifecycle: `idle → tracking → stopped(reason)`. `start()` / `stop()` never
|
|
20
|
+
* throw — this stream is the single source of truth for whether tracking is
|
|
21
|
+
* active and why it stopped.
|
|
13
22
|
*/
|
|
14
23
|
export type BeekonState = {
|
|
15
24
|
kind: 'idle';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/types/state.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/types/state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,UAAU,GAClB,MAAM,GACN,kBAAkB,GAClB,0BAA0B,GAC1B,qBAAqB,GACrB,QAAQ,CAAC;AAEb;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why a server upload failed terminally. Mirrors `SyncFailure` on both
|
|
3
|
+
* platforms.
|
|
4
|
+
*
|
|
5
|
+
* - `'auth'` — `401`/`403`; credentials were rejected. Refresh them (via
|
|
6
|
+
* `Beekon.configure()` with new `sync.headers`) and sync resumes.
|
|
7
|
+
* - `'rejected'` — `400`/`422`; the server rejected the payload. A payload bug;
|
|
8
|
+
* it won't self-resolve.
|
|
9
|
+
*/
|
|
10
|
+
export type SyncFailure = 'auth' | 'rejected';
|
|
11
|
+
/**
|
|
12
|
+
* Upload health, delivered via `Beekon.onSyncStatus()`. Mirrors the native
|
|
13
|
+
* `SyncStatus` sealed type. Use the `kind` field as a discriminator.
|
|
14
|
+
*
|
|
15
|
+
* - `'idle'` — caught up, or sync is not configured.
|
|
16
|
+
* - `'pending'` — uploading or retrying (healthy).
|
|
17
|
+
* - `'failed'` — a terminal failure the app must act on.
|
|
18
|
+
*/
|
|
19
|
+
export type SyncStatus = {
|
|
20
|
+
kind: 'idle';
|
|
21
|
+
} | {
|
|
22
|
+
kind: 'pending';
|
|
23
|
+
} | {
|
|
24
|
+
kind: 'failed';
|
|
25
|
+
reason: SyncFailure;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../../src/types/sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,UAAU,CAAC;AAE9C;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wayq/beekon-rn",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "React Native binding for the Beekon location SDK (Android + iOS).",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -53,15 +53,14 @@
|
|
|
53
53
|
],
|
|
54
54
|
"repository": {
|
|
55
55
|
"type": "git",
|
|
56
|
-
"url": "git+https://github.com/wayqteam/beekon.git"
|
|
57
|
-
"directory": "beekon-rn"
|
|
56
|
+
"url": "git+https://github.com/wayqteam/beekon-rn.git"
|
|
58
57
|
},
|
|
59
58
|
"author": "wayqteam <wayqteam@users.noreply.github.com> (https://github.com/wayqteam)",
|
|
60
59
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
61
60
|
"bugs": {
|
|
62
|
-
"url": "https://github.com/wayqteam/beekon/issues"
|
|
61
|
+
"url": "https://github.com/wayqteam/beekon-rn/issues"
|
|
63
62
|
},
|
|
64
|
-
"homepage": "https://github.com/wayqteam/beekon
|
|
63
|
+
"homepage": "https://github.com/wayqteam/beekon-rn#readme",
|
|
65
64
|
"publishConfig": {
|
|
66
65
|
"registry": "https://registry.npmjs.org/",
|
|
67
66
|
"access": "public"
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
|
|
14
14
|
set -euo pipefail
|
|
15
15
|
|
|
16
|
-
VERSION="0.0.
|
|
16
|
+
VERSION="0.0.5"
|
|
17
17
|
URL="https://github.com/wayqteam/beekon-ios-binary/releases/download/v${VERSION}/BeekonKit.xcframework.zip"
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
EXPECTED_SHA="
|
|
18
|
+
# SHA256 of the v0.0.5 BeekonKit.xcframework.zip. Matches the SwiftPM
|
|
19
|
+
# `binaryTarget` checksum in beekon-ios-binary's Package.swift at tag v0.0.5
|
|
20
|
+
# (SwiftPM's compute-checksum is the SHA256 of the zip).
|
|
21
|
+
EXPECTED_SHA="437bf493d7de19d8df9599da097be162796a8304eb2d7826cf2505c33d4603f7"
|
|
22
22
|
|
|
23
23
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
24
24
|
DEST_DIR="${ROOT}/ios/Frameworks"
|
package/src/NativeBeekonRn.ts
CHANGED
|
@@ -1,60 +1,150 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Codegen TurboModule spec —
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Codegen TurboModule spec — the single source React Native's Codegen reads to
|
|
3
|
+
* generate the native interface. **DO NOT export Wire* types from
|
|
4
|
+
* `src/index.tsx`.** The public TS API in `src/beekon.ts` and `src/types/` is
|
|
5
|
+
* what consumers use; mappers in `src/internal/mappers.ts` convert between the
|
|
6
|
+
* two.
|
|
5
7
|
*
|
|
6
|
-
* Wire types are flat (primitives + nested
|
|
7
|
-
* TS
|
|
8
|
-
* recursive structures
|
|
9
|
-
*
|
|
8
|
+
* Wire types are deliberately **flat** (primitives + flat nested objects +
|
|
9
|
+
* arrays) because Codegen's TS→Kotlin/ObjC derivation has no support for unions
|
|
10
|
+
* or recursive structures:
|
|
11
|
+
*
|
|
12
|
+
* - **Enums travel as plain `string`** (e.g. `accuracyMode`, `quality`); the
|
|
13
|
+
* mappers translate to/from the public string-literal unions with a defensive
|
|
14
|
+
* fallback, so an unknown value never crashes a subscriber.
|
|
15
|
+
* - **Sum types** (`WireState`, `WireSyncStatus`) are a `type` discriminator
|
|
16
|
+
* string plus sibling fields nullable per variant.
|
|
17
|
+
* - **String maps** (`headers`, `extras`) travel as `WireKeyValue[]` pairs —
|
|
18
|
+
* Codegen has no portable dictionary type.
|
|
19
|
+
* - **Timestamps** are epoch-milliseconds; intervals are seconds.
|
|
10
20
|
*/
|
|
11
21
|
import type { CodegenTypes, TurboModule } from 'react-native';
|
|
12
22
|
import { TurboModuleRegistry } from 'react-native';
|
|
13
23
|
|
|
14
|
-
|
|
24
|
+
/** A single string map entry — see `headers` / `setExtras`. */
|
|
25
|
+
export type WireKeyValue = {
|
|
26
|
+
key: string;
|
|
27
|
+
value: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type WireSyncConfig = {
|
|
31
|
+
url: string;
|
|
32
|
+
headers: WireKeyValue[];
|
|
33
|
+
intervalSeconds: number;
|
|
34
|
+
batchSize: number;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** Android-only foreground-service notification overrides. iOS ignores it. */
|
|
38
|
+
export type WireNotificationConfig = {
|
|
15
39
|
title?: string;
|
|
16
40
|
text?: string;
|
|
17
|
-
smallIconResName?: string;
|
|
18
41
|
};
|
|
19
42
|
|
|
20
43
|
export type WireConfig = {
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
44
|
+
/** All fields required at the wire level — the TS facade applies defaults. */
|
|
45
|
+
minTimeBetweenLocationsSeconds: number;
|
|
46
|
+
minDistanceBetweenLocationsMeters: number;
|
|
47
|
+
/** One of: 'high' | 'balanced' | 'low'. */
|
|
48
|
+
accuracyMode: string;
|
|
49
|
+
/** One of: 'keepTracking' | 'pause' | 'pauseWithCheckIns'. */
|
|
50
|
+
whenStationary: string;
|
|
51
|
+
stationaryRadiusMeters: number;
|
|
52
|
+
detectActivity: boolean;
|
|
53
|
+
/** Omitted keeps tracking local-only. */
|
|
54
|
+
sync?: WireSyncConfig;
|
|
55
|
+
/** Android-only; the iOS native module ignores it. */
|
|
56
|
+
notification?: WireNotificationConfig;
|
|
27
57
|
};
|
|
28
58
|
|
|
29
59
|
export type WireLocation = {
|
|
60
|
+
id: string;
|
|
30
61
|
lat: number;
|
|
31
62
|
lng: number;
|
|
32
63
|
timestampMs: number;
|
|
33
|
-
/** `null` when the OS did not report a value
|
|
64
|
+
/** `null` when the OS did not report a value. */
|
|
34
65
|
accuracy: number | null;
|
|
35
66
|
speed: number | null;
|
|
36
67
|
bearing: number | null;
|
|
37
68
|
altitude: number | null;
|
|
69
|
+
/** One of: 'ok' | 'lowAccuracy' | 'implausibleSpeed'. */
|
|
70
|
+
quality: string;
|
|
71
|
+
/** One of: 'interval' | 'motion' | 'checkIn' | 'geofence' | 'manual'. */
|
|
72
|
+
trigger: string;
|
|
73
|
+
/** One of: 'moving' | 'stationary' | 'unknown'. */
|
|
74
|
+
motion: string;
|
|
75
|
+
/** Activity enum string, or `null` unless activity detection is enabled. */
|
|
76
|
+
activity: string | null;
|
|
77
|
+
isMock: boolean;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export type WireGeofence = {
|
|
81
|
+
id: string;
|
|
82
|
+
lat: number;
|
|
83
|
+
lng: number;
|
|
84
|
+
radiusMeters: number;
|
|
85
|
+
notifyOnEntry: boolean;
|
|
86
|
+
notifyOnExit: boolean;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export type WireGeofenceEvent = {
|
|
90
|
+
id: string;
|
|
91
|
+
geofenceId: string;
|
|
92
|
+
/** One of: 'enter' | 'exit'. */
|
|
93
|
+
type: string;
|
|
94
|
+
timestampMs: number;
|
|
38
95
|
};
|
|
39
96
|
|
|
40
97
|
export type WireState = {
|
|
41
98
|
/** One of: 'idle' | 'tracking' | 'stopped'. */
|
|
42
99
|
type: string;
|
|
43
100
|
/**
|
|
44
|
-
* Only populated when `type === 'stopped'`. One of:
|
|
45
|
-
* '
|
|
101
|
+
* Only populated when `type === 'stopped'`. One of: 'user' |
|
|
102
|
+
* 'permissionDenied' | 'locationServicesDisabled' | 'locationUnavailable' |
|
|
103
|
+
* 'system'.
|
|
46
104
|
*/
|
|
47
105
|
stopReason?: string;
|
|
48
106
|
};
|
|
49
107
|
|
|
108
|
+
export type WireSyncStatus = {
|
|
109
|
+
/** One of: 'idle' | 'pending' | 'failed'. */
|
|
110
|
+
type: string;
|
|
111
|
+
/** Only populated when `type === 'failed'`. One of: 'auth' | 'rejected'. */
|
|
112
|
+
failure?: string;
|
|
113
|
+
};
|
|
114
|
+
|
|
50
115
|
export interface Spec extends TurboModule {
|
|
51
|
-
|
|
116
|
+
/**
|
|
117
|
+
* The config crosses as an untyped object (`ReadableMap` on Android,
|
|
118
|
+
* `NSDictionary` on iOS) and is parsed natively. Typing it as the nested
|
|
119
|
+
* {@link WireConfig} struct would force the iOS ObjC++ layer to walk Codegen's
|
|
120
|
+
* generated C++ structs; the facade still builds a `WireConfig`-shaped value
|
|
121
|
+
* via `configToWire`, so the shape is enforced upstream.
|
|
122
|
+
*/
|
|
123
|
+
configure(config: CodegenTypes.UnsafeObject): Promise<void>;
|
|
52
124
|
start(): Promise<void>;
|
|
53
125
|
stop(): Promise<void>;
|
|
54
|
-
|
|
126
|
+
resumeIfNeeded(): Promise<void>;
|
|
127
|
+
|
|
128
|
+
getLocations(fromMs: number, toMs: number): Promise<WireLocation[]>;
|
|
129
|
+
/**
|
|
130
|
+
* A negative `beforeMs` deletes all stored locations (the wire encoding of
|
|
131
|
+
* the public `deleteLocations()` no-argument case). A plain `number` is used
|
|
132
|
+
* rather than `number | null` for portable Codegen support across platforms.
|
|
133
|
+
*/
|
|
134
|
+
deleteLocations(beforeMs: number): Promise<number>;
|
|
135
|
+
pendingUploadCount(): Promise<number>;
|
|
136
|
+
|
|
137
|
+
sync(): Promise<void>;
|
|
138
|
+
setExtras(entries: WireKeyValue[]): Promise<void>;
|
|
139
|
+
|
|
140
|
+
addGeofences(geofences: WireGeofence[]): Promise<void>;
|
|
141
|
+
removeGeofences(ids: string[]): Promise<void>;
|
|
142
|
+
listGeofences(): Promise<WireGeofence[]>;
|
|
55
143
|
|
|
56
144
|
readonly onState: CodegenTypes.EventEmitter<WireState>;
|
|
57
145
|
readonly onLocation: CodegenTypes.EventEmitter<WireLocation>;
|
|
146
|
+
readonly onGeofenceEvent: CodegenTypes.EventEmitter<WireGeofenceEvent>;
|
|
147
|
+
readonly onSyncStatus: CodegenTypes.EventEmitter<WireSyncStatus>;
|
|
58
148
|
}
|
|
59
149
|
|
|
60
150
|
export default TurboModuleRegistry.getEnforcing<Spec>('BeekonRn');
|