@wayq/beekon-rn 0.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.
Files changed (69) hide show
  1. package/BeekonRn.podspec +37 -0
  2. package/LICENSE.txt +14 -0
  3. package/README.md +122 -0
  4. package/android/build.gradle +81 -0
  5. package/android/src/main/AndroidManifest.xml +2 -0
  6. package/android/src/main/java/com/wayq/beekonrn/BeekonRnModule.kt +233 -0
  7. package/android/src/main/java/com/wayq/beekonrn/BeekonRnPackage.kt +31 -0
  8. package/ios/BeekonRn.h +5 -0
  9. package/ios/BeekonRn.mm +80 -0
  10. package/ios/BeekonRn.swift +211 -0
  11. package/ios/Frameworks/BeekonKit.xcframework/Info.plist +44 -0
  12. package/ios/Frameworks/BeekonKit.xcframework/LICENSE.txt +14 -0
  13. package/ios/Frameworks/BeekonKit.xcframework/_CodeSignature/CodeDirectory +0 -0
  14. package/ios/Frameworks/BeekonKit.xcframework/_CodeSignature/CodeRequirements +0 -0
  15. package/ios/Frameworks/BeekonKit.xcframework/_CodeSignature/CodeRequirements-1 +0 -0
  16. package/ios/Frameworks/BeekonKit.xcframework/_CodeSignature/CodeResources +233 -0
  17. package/ios/Frameworks/BeekonKit.xcframework/_CodeSignature/CodeSignature +0 -0
  18. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/BeekonKit +0 -0
  19. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Info.plist +0 -0
  20. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/PrivacyInfo.xcprivacy +77 -0
  21. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/_CodeSignature/CodeResources +113 -0
  22. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/BeekonKit +0 -0
  23. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Info.plist +0 -0
  24. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/PrivacyInfo.xcprivacy +77 -0
  25. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/_CodeSignature/CodeResources +113 -0
  26. package/lib/module/NativeBeekonRn.js +16 -0
  27. package/lib/module/NativeBeekonRn.js.map +1 -0
  28. package/lib/module/beekon.js +107 -0
  29. package/lib/module/beekon.js.map +1 -0
  30. package/lib/module/index.js +4 -0
  31. package/lib/module/index.js.map +1 -0
  32. package/lib/module/internal/mappers.js +58 -0
  33. package/lib/module/internal/mappers.js.map +1 -0
  34. package/lib/module/package.json +1 -0
  35. package/lib/module/types/config.js +4 -0
  36. package/lib/module/types/config.js.map +1 -0
  37. package/lib/module/types/position.js +2 -0
  38. package/lib/module/types/position.js.map +1 -0
  39. package/lib/module/types/preset.js +2 -0
  40. package/lib/module/types/preset.js.map +1 -0
  41. package/lib/module/types/state.js +2 -0
  42. package/lib/module/types/state.js.map +1 -0
  43. package/lib/typescript/package.json +1 -0
  44. package/lib/typescript/src/NativeBeekonRn.d.ts +58 -0
  45. package/lib/typescript/src/NativeBeekonRn.d.ts.map +1 -0
  46. package/lib/typescript/src/beekon.d.ts +80 -0
  47. package/lib/typescript/src/beekon.d.ts.map +1 -0
  48. package/lib/typescript/src/index.d.ts +6 -0
  49. package/lib/typescript/src/index.d.ts.map +1 -0
  50. package/lib/typescript/src/internal/mappers.d.ts +8 -0
  51. package/lib/typescript/src/internal/mappers.d.ts.map +1 -0
  52. package/lib/typescript/src/types/config.d.ts +41 -0
  53. package/lib/typescript/src/types/config.d.ts.map +1 -0
  54. package/lib/typescript/src/types/position.d.ts +24 -0
  55. package/lib/typescript/src/types/position.d.ts.map +1 -0
  56. package/lib/typescript/src/types/preset.d.ts +12 -0
  57. package/lib/typescript/src/types/preset.d.ts.map +1 -0
  58. package/lib/typescript/src/types/state.d.ts +22 -0
  59. package/lib/typescript/src/types/state.d.ts.map +1 -0
  60. package/package.json +137 -0
  61. package/scripts/fetch-beekonkit.sh +58 -0
  62. package/src/NativeBeekonRn.ts +64 -0
  63. package/src/beekon.ts +110 -0
  64. package/src/index.tsx +5 -0
  65. package/src/internal/mappers.ts +50 -0
  66. package/src/types/config.ts +42 -0
  67. package/src/types/position.ts +23 -0
  68. package/src/types/preset.ts +11 -0
  69. package/src/types/state.ts +16 -0
@@ -0,0 +1,42 @@
1
+ import type { Preset } from './preset';
2
+
3
+ /**
4
+ * Foreground service notification config — required when running on Android
5
+ * because Android 8+ requires a persistent notification while a foreground
6
+ * service is active. Ignored on iOS.
7
+ */
8
+ export type AndroidNotificationConfig = {
9
+ /** NotificationChannel id (Android 8+). */
10
+ channelId: string;
11
+ /** User-visible channel display name. */
12
+ channelName: string;
13
+ /** Foreground notification id. Must be > 0. */
14
+ notificationId: number;
15
+ /** Notification title shown in the status bar. */
16
+ title: string;
17
+ /** Notification body text. */
18
+ text: string;
19
+ /**
20
+ * Drawable resource name for the notification icon (e.g. `ic_notification`).
21
+ * Resolved at runtime via `Resources.getIdentifier()` against the host app's
22
+ * `res/drawable*` folders. Pass the resource name without extension or
23
+ * `R.drawable.` prefix.
24
+ */
25
+ smallIconResName: string;
26
+ };
27
+
28
+ export type BeekonConfig = {
29
+ /** Sampling preset. Default: `'balanced'`. */
30
+ preset?: Preset;
31
+ /** Override the preset's distance gate (meters). */
32
+ distanceFilterMeters?: number;
33
+ /** Override the preset's interval (milliseconds). */
34
+ intervalMillis?: number;
35
+ /**
36
+ * Required when running on Android. Ignored on iOS. The plugin throws
37
+ * `NOT_CONFIGURED` if missing on Android.
38
+ */
39
+ androidNotification?: AndroidNotificationConfig;
40
+ /** Optional license key. Reserved for future use. */
41
+ licenseKey?: string;
42
+ };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * A single location fix as emitted by the native SDK after gating. Fields map
3
+ * 1:1 to `com.wayq.beekon.Position` on Android and `Beekon.Position` on iOS.
4
+ *
5
+ * The SDK does NOT smooth or filter positions beyond the gate — values are
6
+ * forwarded as the OS provider reported them (raw passthrough).
7
+ */
8
+ export type Position = {
9
+ /** Latitude in degrees, WGS-84. */
10
+ lat: number;
11
+ /** Longitude in degrees, WGS-84. */
12
+ lng: number;
13
+ /** Horizontal accuracy in meters (1-sigma). */
14
+ accuracy: number;
15
+ /** Speed in m/s. May be 0 if the OS provider doesn't supply it. */
16
+ speed: number;
17
+ /** Bearing in degrees clockwise from true north. */
18
+ bearing: number;
19
+ /** Altitude in meters above the WGS-84 ellipsoid. */
20
+ altitude: number;
21
+ /** Time the OS provider reported this fix (not when JS received it). */
22
+ timestamp: Date;
23
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Sampling preset. Determines the gating interval and distance threshold the
3
+ * native SDK uses before emitting a position. Per `docs/REQUIREMENTS.md`:
4
+ *
5
+ * | Preset | Interval | Distance | Battery (typical) |
6
+ * |-----------|----------|----------|-------------------|
7
+ * | saver | 60_000ms | 150 m | 3–8% |
8
+ * | balanced | 30_000ms | 100 m | 5–10% |
9
+ * | precision | 10_000ms | 30 m | 15–25% |
10
+ */
11
+ export type Preset = 'saver' | 'balanced' | 'precision';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Why tracking is paused. Names match the native `PauseReason` enum on both
3
+ * platforms byte-for-byte.
4
+ */
5
+ export type PauseReason = 'permissionRevoked' | 'locationDisabled' | 'unknown';
6
+
7
+ /**
8
+ * Tracking state. Mirrors the native `BeekonState` sealed hierarchy on both
9
+ * platforms. Use the `kind` field as a discriminator.
10
+ */
11
+ export type BeekonState =
12
+ | { kind: 'idle' }
13
+ | { kind: 'starting' }
14
+ | { kind: 'tracking' }
15
+ | { kind: 'paused'; reason: PauseReason }
16
+ | { kind: 'stopped' };