@symbiote-native/sensors 0.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.
Files changed (264) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +138 -0
  3. package/build/angular/index.d.ts +16 -0
  4. package/build/angular/index.js +12 -0
  5. package/build/angular/services/accelerometer.service/index.d.ts +6 -0
  6. package/build/angular/services/accelerometer.service/index.js +81 -0
  7. package/build/angular/services/barometer.service/index.d.ts +6 -0
  8. package/build/angular/services/barometer.service/index.js +81 -0
  9. package/build/angular/services/device-motion.service/index.d.ts +6 -0
  10. package/build/angular/services/device-motion.service/index.js +81 -0
  11. package/build/angular/services/gyroscope.service/index.d.ts +6 -0
  12. package/build/angular/services/gyroscope.service/index.js +81 -0
  13. package/build/angular/services/light-sensor.service/index.d.ts +6 -0
  14. package/build/angular/services/light-sensor.service/index.js +81 -0
  15. package/build/angular/services/magnetometer-uncalibrated.service/index.d.ts +6 -0
  16. package/build/angular/services/magnetometer-uncalibrated.service/index.js +81 -0
  17. package/build/angular/services/magnetometer.service/index.d.ts +6 -0
  18. package/build/angular/services/magnetometer.service/index.js +81 -0
  19. package/build/angular/services/pedometer.service/index.d.ts +6 -0
  20. package/build/angular/services/pedometer.service/index.js +76 -0
  21. package/build/core/accelerometer.d.ts +10 -0
  22. package/build/core/accelerometer.js +6 -0
  23. package/build/core/barometer.d.ts +9 -0
  24. package/build/core/barometer.js +6 -0
  25. package/build/core/device-motion.d.ts +40 -0
  26. package/build/core/device-motion.js +21 -0
  27. package/build/core/device-sensor.d.ts +27 -0
  28. package/build/core/device-sensor.js +61 -0
  29. package/build/core/gyroscope.d.ts +10 -0
  30. package/build/core/gyroscope.js +6 -0
  31. package/build/core/index.d.ts +11 -0
  32. package/build/core/index.js +10 -0
  33. package/build/core/light-sensor.d.ts +8 -0
  34. package/build/core/light-sensor.js +6 -0
  35. package/build/core/magnetometer-uncalibrated.d.ts +10 -0
  36. package/build/core/magnetometer-uncalibrated.js +6 -0
  37. package/build/core/magnetometer.d.ts +10 -0
  38. package/build/core/magnetometer.js +6 -0
  39. package/build/core/native/exponent-accelerometer.d.ts +3 -0
  40. package/build/core/native/exponent-accelerometer.js +3 -0
  41. package/build/core/native/exponent-barometer.d.ts +3 -0
  42. package/build/core/native/exponent-barometer.js +3 -0
  43. package/build/core/native/exponent-device-motion.d.ts +7 -0
  44. package/build/core/native/exponent-device-motion.js +3 -0
  45. package/build/core/native/exponent-gyroscope.d.ts +3 -0
  46. package/build/core/native/exponent-gyroscope.js +3 -0
  47. package/build/core/native/exponent-light-sensor/index.android.d.ts +3 -0
  48. package/build/core/native/exponent-light-sensor/index.android.js +3 -0
  49. package/build/core/native/exponent-light-sensor/index.d.ts +1 -0
  50. package/build/core/native/exponent-light-sensor/index.ios.d.ts +3 -0
  51. package/build/core/native/exponent-light-sensor/index.ios.js +6 -0
  52. package/build/core/native/exponent-light-sensor/index.js +5 -0
  53. package/build/core/native/exponent-magnetometer-uncalibrated.d.ts +3 -0
  54. package/build/core/native/exponent-magnetometer-uncalibrated.js +3 -0
  55. package/build/core/native/exponent-magnetometer.d.ts +3 -0
  56. package/build/core/native/exponent-magnetometer.js +3 -0
  57. package/build/core/native/exponent-pedometer.d.ts +10 -0
  58. package/build/core/native/exponent-pedometer.js +3 -0
  59. package/build/core/pedometer.d.ts +10 -0
  60. package/build/core/pedometer.js +44 -0
  61. package/build/react/hooks/use-accelerometer/index.d.ts +2 -0
  62. package/build/react/hooks/use-accelerometer/index.js +17 -0
  63. package/build/react/hooks/use-barometer/index.d.ts +2 -0
  64. package/build/react/hooks/use-barometer/index.js +17 -0
  65. package/build/react/hooks/use-device-motion/index.d.ts +2 -0
  66. package/build/react/hooks/use-device-motion/index.js +17 -0
  67. package/build/react/hooks/use-gyroscope/index.d.ts +2 -0
  68. package/build/react/hooks/use-gyroscope/index.js +17 -0
  69. package/build/react/hooks/use-light-sensor/index.d.ts +2 -0
  70. package/build/react/hooks/use-light-sensor/index.js +17 -0
  71. package/build/react/hooks/use-magnetometer/index.d.ts +2 -0
  72. package/build/react/hooks/use-magnetometer/index.js +17 -0
  73. package/build/react/hooks/use-magnetometer-uncalibrated/index.d.ts +2 -0
  74. package/build/react/hooks/use-magnetometer-uncalibrated/index.js +17 -0
  75. package/build/react/hooks/use-pedometer/index.d.ts +2 -0
  76. package/build/react/hooks/use-pedometer/index.js +14 -0
  77. package/build/react/index.d.ts +16 -0
  78. package/build/react/index.js +14 -0
  79. package/build/vue/composables/use-accelerometer/index.d.ts +3 -0
  80. package/build/vue/composables/use-accelerometer/index.js +25 -0
  81. package/build/vue/composables/use-barometer/index.d.ts +3 -0
  82. package/build/vue/composables/use-barometer/index.js +25 -0
  83. package/build/vue/composables/use-device-motion/index.d.ts +3 -0
  84. package/build/vue/composables/use-device-motion/index.js +25 -0
  85. package/build/vue/composables/use-gyroscope/index.d.ts +3 -0
  86. package/build/vue/composables/use-gyroscope/index.js +25 -0
  87. package/build/vue/composables/use-light-sensor/index.d.ts +3 -0
  88. package/build/vue/composables/use-light-sensor/index.js +25 -0
  89. package/build/vue/composables/use-magnetometer/index.d.ts +3 -0
  90. package/build/vue/composables/use-magnetometer/index.js +25 -0
  91. package/build/vue/composables/use-magnetometer-uncalibrated/index.d.ts +3 -0
  92. package/build/vue/composables/use-magnetometer-uncalibrated/index.js +25 -0
  93. package/build/vue/composables/use-pedometer/index.d.ts +3 -0
  94. package/build/vue/composables/use-pedometer/index.js +20 -0
  95. package/build/vue/index.d.ts +16 -0
  96. package/build/vue/index.js +14 -0
  97. package/build-ngc/angular/index.d.ts +16 -0
  98. package/build-ngc/angular/index.js +13 -0
  99. package/build-ngc/angular/index.js.map +1 -0
  100. package/build-ngc/angular/services/accelerometer.service/index.d.ts +9 -0
  101. package/build-ngc/angular/services/accelerometer.service/index.js +40 -0
  102. package/build-ngc/angular/services/accelerometer.service/index.js.map +1 -0
  103. package/build-ngc/angular/services/barometer.service/index.d.ts +9 -0
  104. package/build-ngc/angular/services/barometer.service/index.js +40 -0
  105. package/build-ngc/angular/services/barometer.service/index.js.map +1 -0
  106. package/build-ngc/angular/services/device-motion.service/index.d.ts +9 -0
  107. package/build-ngc/angular/services/device-motion.service/index.js +40 -0
  108. package/build-ngc/angular/services/device-motion.service/index.js.map +1 -0
  109. package/build-ngc/angular/services/gyroscope.service/index.d.ts +9 -0
  110. package/build-ngc/angular/services/gyroscope.service/index.js +40 -0
  111. package/build-ngc/angular/services/gyroscope.service/index.js.map +1 -0
  112. package/build-ngc/angular/services/light-sensor.service/index.d.ts +9 -0
  113. package/build-ngc/angular/services/light-sensor.service/index.js +40 -0
  114. package/build-ngc/angular/services/light-sensor.service/index.js.map +1 -0
  115. package/build-ngc/angular/services/magnetometer-uncalibrated.service/index.d.ts +9 -0
  116. package/build-ngc/angular/services/magnetometer-uncalibrated.service/index.js +40 -0
  117. package/build-ngc/angular/services/magnetometer-uncalibrated.service/index.js.map +1 -0
  118. package/build-ngc/angular/services/magnetometer.service/index.d.ts +9 -0
  119. package/build-ngc/angular/services/magnetometer.service/index.js +40 -0
  120. package/build-ngc/angular/services/magnetometer.service/index.js.map +1 -0
  121. package/build-ngc/angular/services/pedometer.service/index.d.ts +9 -0
  122. package/build-ngc/angular/services/pedometer.service/index.js +35 -0
  123. package/build-ngc/angular/services/pedometer.service/index.js.map +1 -0
  124. package/build-ngc/core/accelerometer.d.ts +10 -0
  125. package/build-ngc/core/accelerometer.js +7 -0
  126. package/build-ngc/core/accelerometer.js.map +1 -0
  127. package/build-ngc/core/barometer.d.ts +9 -0
  128. package/build-ngc/core/barometer.js +7 -0
  129. package/build-ngc/core/barometer.js.map +1 -0
  130. package/build-ngc/core/device-motion.d.ts +40 -0
  131. package/build-ngc/core/device-motion.js +22 -0
  132. package/build-ngc/core/device-motion.js.map +1 -0
  133. package/build-ngc/core/device-sensor.d.ts +27 -0
  134. package/build-ngc/core/device-sensor.js +62 -0
  135. package/build-ngc/core/device-sensor.js.map +1 -0
  136. package/build-ngc/core/gyroscope.d.ts +10 -0
  137. package/build-ngc/core/gyroscope.js +7 -0
  138. package/build-ngc/core/gyroscope.js.map +1 -0
  139. package/build-ngc/core/index.d.ts +11 -0
  140. package/build-ngc/core/index.js +11 -0
  141. package/build-ngc/core/index.js.map +1 -0
  142. package/build-ngc/core/light-sensor.d.ts +8 -0
  143. package/build-ngc/core/light-sensor.js +7 -0
  144. package/build-ngc/core/light-sensor.js.map +1 -0
  145. package/build-ngc/core/magnetometer-uncalibrated.d.ts +10 -0
  146. package/build-ngc/core/magnetometer-uncalibrated.js +7 -0
  147. package/build-ngc/core/magnetometer-uncalibrated.js.map +1 -0
  148. package/build-ngc/core/magnetometer.d.ts +10 -0
  149. package/build-ngc/core/magnetometer.js +7 -0
  150. package/build-ngc/core/magnetometer.js.map +1 -0
  151. package/build-ngc/core/native/exponent-accelerometer.d.ts +3 -0
  152. package/build-ngc/core/native/exponent-accelerometer.js +4 -0
  153. package/build-ngc/core/native/exponent-accelerometer.js.map +1 -0
  154. package/build-ngc/core/native/exponent-barometer.d.ts +3 -0
  155. package/build-ngc/core/native/exponent-barometer.js +4 -0
  156. package/build-ngc/core/native/exponent-barometer.js.map +1 -0
  157. package/build-ngc/core/native/exponent-device-motion.d.ts +7 -0
  158. package/build-ngc/core/native/exponent-device-motion.js +4 -0
  159. package/build-ngc/core/native/exponent-device-motion.js.map +1 -0
  160. package/build-ngc/core/native/exponent-gyroscope.d.ts +3 -0
  161. package/build-ngc/core/native/exponent-gyroscope.js +4 -0
  162. package/build-ngc/core/native/exponent-gyroscope.js.map +1 -0
  163. package/build-ngc/core/native/exponent-light-sensor/index.android.d.ts +3 -0
  164. package/build-ngc/core/native/exponent-light-sensor/index.android.js +4 -0
  165. package/build-ngc/core/native/exponent-light-sensor/index.android.js.map +1 -0
  166. package/build-ngc/core/native/exponent-light-sensor/index.d.ts +1 -0
  167. package/build-ngc/core/native/exponent-light-sensor/index.ios.d.ts +3 -0
  168. package/build-ngc/core/native/exponent-light-sensor/index.ios.js +7 -0
  169. package/build-ngc/core/native/exponent-light-sensor/index.ios.js.map +1 -0
  170. package/build-ngc/core/native/exponent-light-sensor/index.js +6 -0
  171. package/build-ngc/core/native/exponent-light-sensor/index.js.map +1 -0
  172. package/build-ngc/core/native/exponent-magnetometer-uncalibrated.d.ts +3 -0
  173. package/build-ngc/core/native/exponent-magnetometer-uncalibrated.js +4 -0
  174. package/build-ngc/core/native/exponent-magnetometer-uncalibrated.js.map +1 -0
  175. package/build-ngc/core/native/exponent-magnetometer.d.ts +3 -0
  176. package/build-ngc/core/native/exponent-magnetometer.js +4 -0
  177. package/build-ngc/core/native/exponent-magnetometer.js.map +1 -0
  178. package/build-ngc/core/native/exponent-pedometer.d.ts +10 -0
  179. package/build-ngc/core/native/exponent-pedometer.js +4 -0
  180. package/build-ngc/core/native/exponent-pedometer.js.map +1 -0
  181. package/build-ngc/core/pedometer.d.ts +10 -0
  182. package/build-ngc/core/pedometer.js +45 -0
  183. package/build-ngc/core/pedometer.js.map +1 -0
  184. package/package.json +106 -0
  185. package/src/angular/index.ts +26 -0
  186. package/src/angular/services/accelerometer.service/accelerometer.service.test.ts +118 -0
  187. package/src/angular/services/accelerometer.service/index.ts +39 -0
  188. package/src/angular/services/barometer.service/barometer.service.test.ts +122 -0
  189. package/src/angular/services/barometer.service/index.ts +39 -0
  190. package/src/angular/services/device-motion.service/device-motion.service.test.ts +125 -0
  191. package/src/angular/services/device-motion.service/index.ts +39 -0
  192. package/src/angular/services/gyroscope.service/gyroscope.service.test.ts +118 -0
  193. package/src/angular/services/gyroscope.service/index.ts +39 -0
  194. package/src/angular/services/light-sensor.service/index.ts +39 -0
  195. package/src/angular/services/light-sensor.service/light-sensor.service.test.ts +118 -0
  196. package/src/angular/services/magnetometer-uncalibrated.service/index.ts +39 -0
  197. package/src/angular/services/magnetometer-uncalibrated.service/magnetometer-uncalibrated.service.test.ts +123 -0
  198. package/src/angular/services/magnetometer.service/index.ts +39 -0
  199. package/src/angular/services/magnetometer.service/magnetometer.service.test.ts +118 -0
  200. package/src/angular/services/pedometer.service/index.ts +34 -0
  201. package/src/angular/services/pedometer.service/pedometer.service.test.ts +86 -0
  202. package/src/core/accelerometer.test.ts +49 -0
  203. package/src/core/accelerometer.ts +19 -0
  204. package/src/core/barometer.test.ts +46 -0
  205. package/src/core/barometer.ts +15 -0
  206. package/src/core/device-motion.test.ts +60 -0
  207. package/src/core/device-motion.ts +41 -0
  208. package/src/core/device-sensor.test.ts +76 -0
  209. package/src/core/device-sensor.ts +95 -0
  210. package/src/core/gyroscope.test.ts +46 -0
  211. package/src/core/gyroscope.ts +16 -0
  212. package/src/core/index.ts +37 -0
  213. package/src/core/light-sensor.test.ts +49 -0
  214. package/src/core/light-sensor.ts +18 -0
  215. package/src/core/magnetometer-uncalibrated.test.ts +49 -0
  216. package/src/core/magnetometer-uncalibrated.ts +20 -0
  217. package/src/core/magnetometer.test.ts +49 -0
  218. package/src/core/magnetometer.ts +19 -0
  219. package/src/core/native/exponent-accelerometer.ts +9 -0
  220. package/src/core/native/exponent-barometer.ts +9 -0
  221. package/src/core/native/exponent-device-motion.ts +15 -0
  222. package/src/core/native/exponent-gyroscope.ts +9 -0
  223. package/src/core/native/exponent-light-sensor/index.android.ts +9 -0
  224. package/src/core/native/exponent-light-sensor/index.ios.ts +12 -0
  225. package/src/core/native/exponent-light-sensor/index.ts +5 -0
  226. package/src/core/native/exponent-magnetometer-uncalibrated.ts +9 -0
  227. package/src/core/native/exponent-magnetometer.ts +9 -0
  228. package/src/core/native/exponent-pedometer.ts +17 -0
  229. package/src/core/pedometer.test.ts +118 -0
  230. package/src/core/pedometer.ts +62 -0
  231. package/src/react/hooks/use-accelerometer/index.ts +21 -0
  232. package/src/react/hooks/use-accelerometer/use-accelerometer.test.tsx +81 -0
  233. package/src/react/hooks/use-barometer/index.ts +21 -0
  234. package/src/react/hooks/use-barometer/use-barometer.test.tsx +83 -0
  235. package/src/react/hooks/use-device-motion/index.ts +21 -0
  236. package/src/react/hooks/use-device-motion/use-device-motion.test.tsx +88 -0
  237. package/src/react/hooks/use-gyroscope/index.ts +21 -0
  238. package/src/react/hooks/use-gyroscope/use-gyroscope.test.tsx +79 -0
  239. package/src/react/hooks/use-light-sensor/index.ts +21 -0
  240. package/src/react/hooks/use-light-sensor/use-light-sensor.test.tsx +79 -0
  241. package/src/react/hooks/use-magnetometer/index.ts +21 -0
  242. package/src/react/hooks/use-magnetometer/use-magnetometer.test.tsx +81 -0
  243. package/src/react/hooks/use-magnetometer-uncalibrated/index.ts +23 -0
  244. package/src/react/hooks/use-magnetometer-uncalibrated/use-magnetometer-uncalibrated.test.tsx +88 -0
  245. package/src/react/hooks/use-pedometer/index.ts +17 -0
  246. package/src/react/hooks/use-pedometer/use-pedometer.test.tsx +69 -0
  247. package/src/react/index.ts +29 -0
  248. package/src/vue/composables/use-accelerometer/index.ts +34 -0
  249. package/src/vue/composables/use-accelerometer/use-accelerometer.test.ts +96 -0
  250. package/src/vue/composables/use-barometer/index.ts +30 -0
  251. package/src/vue/composables/use-barometer/use-barometer.test.ts +100 -0
  252. package/src/vue/composables/use-device-motion/index.ts +30 -0
  253. package/src/vue/composables/use-device-motion/use-device-motion.test.ts +104 -0
  254. package/src/vue/composables/use-gyroscope/index.ts +30 -0
  255. package/src/vue/composables/use-gyroscope/use-gyroscope.test.ts +96 -0
  256. package/src/vue/composables/use-light-sensor/index.ts +30 -0
  257. package/src/vue/composables/use-light-sensor/use-light-sensor.test.ts +96 -0
  258. package/src/vue/composables/use-magnetometer/index.ts +30 -0
  259. package/src/vue/composables/use-magnetometer/use-magnetometer.test.ts +96 -0
  260. package/src/vue/composables/use-magnetometer-uncalibrated/index.ts +36 -0
  261. package/src/vue/composables/use-magnetometer-uncalibrated/use-magnetometer-uncalibrated.test.ts +103 -0
  262. package/src/vue/composables/use-pedometer/index.ts +25 -0
  263. package/src/vue/composables/use-pedometer/use-pedometer.test.ts +77 -0
  264. package/src/vue/index.ts +29 -0
@@ -0,0 +1,5 @@
1
+ // Base resolution for plain Node/vitest imports of './native/exponent-light-sensor', which
2
+ // don't go through Metro's platform-extension picking — re-exports the iOS stub so headless
3
+ // resolution stays side-effect-free and never calls requireNativeModule() outside a real RN
4
+ // runtime. Metro still picks index.ios.ts/index.android.ts per real platform at bundle time.
5
+ export { exponentLightSensor } from './index.ios.js';
@@ -0,0 +1,3 @@
1
+ import type { INativeSensorModule } from '../device-sensor';
2
+ import type { IMagnetometerUncalibratedMeasurement } from '../magnetometer-uncalibrated';
3
+ export declare const exponentMagnetometerUncalibrated: INativeSensorModule<IMagnetometerUncalibratedMeasurement>;
@@ -0,0 +1,3 @@
1
+ import { requireNativeModule } from 'expo-modules-core';
2
+ const EXPONENT_MAGNETOMETER_UNCALIBRATED_MODULE_NAME = 'ExponentMagnetometerUncalibrated';
3
+ export const exponentMagnetometerUncalibrated = requireNativeModule(EXPONENT_MAGNETOMETER_UNCALIBRATED_MODULE_NAME);
@@ -0,0 +1,3 @@
1
+ import type { INativeSensorModule } from '../device-sensor';
2
+ import type { IMagnetometerMeasurement } from '../magnetometer';
3
+ export declare const exponentMagnetometer: INativeSensorModule<IMagnetometerMeasurement>;
@@ -0,0 +1,3 @@
1
+ import { requireNativeModule } from 'expo-modules-core';
2
+ const EXPONENT_MAGNETOMETER_MODULE_NAME = 'ExponentMagnetometer';
3
+ export const exponentMagnetometer = requireNativeModule(EXPONENT_MAGNETOMETER_MODULE_NAME);
@@ -0,0 +1,10 @@
1
+ import type { EventSubscription, PermissionResponse } from 'expo-modules-core';
2
+ import type { IPedometerResult } from '../pedometer';
3
+ export type IExponentPedometerModule = {
4
+ addListener(eventName: string, listener: (result: IPedometerResult) => void): EventSubscription;
5
+ getStepCountAsync?(startMs: number, endMs: number): Promise<IPedometerResult>;
6
+ isAvailableAsync(): Promise<boolean>;
7
+ getPermissionsAsync?(): Promise<PermissionResponse>;
8
+ requestPermissionsAsync?(): Promise<PermissionResponse>;
9
+ };
10
+ export declare const exponentPedometer: IExponentPedometerModule;
@@ -0,0 +1,3 @@
1
+ import { requireNativeModule } from 'expo-modules-core';
2
+ const EXPONENT_PEDOMETER_MODULE_NAME = 'ExponentPedometer';
3
+ export const exponentPedometer = requireNativeModule(EXPONENT_PEDOMETER_MODULE_NAME);
@@ -0,0 +1,10 @@
1
+ import { type EventSubscription, type PermissionResponse } from 'expo-modules-core';
2
+ export type IPedometerResult = {
3
+ steps: number;
4
+ };
5
+ export type IPedometerUpdateCallback = (result: IPedometerResult) => void;
6
+ export declare function watchStepCount(callback: IPedometerUpdateCallback): EventSubscription;
7
+ export declare function getStepCountAsync(start: Date, end: Date): Promise<IPedometerResult>;
8
+ export declare function isAvailableAsync(): Promise<boolean>;
9
+ export declare function getPermissionsAsync(): Promise<PermissionResponse>;
10
+ export declare function requestPermissionsAsync(): Promise<PermissionResponse>;
@@ -0,0 +1,44 @@
1
+ // Pedometer's upstream API (.vendors/expo/packages/expo-sensors/src/Pedometer.ts) is a set of
2
+ // free functions, not a class — unlike every other sensor here it has no shared instance to hang
3
+ // addListener/removeAllListeners/setUpdateInterval off, so it intentionally does NOT extend
4
+ // DeviceSensor (see device-sensor.ts for that shared shape).
5
+ import { PermissionStatus, UnavailabilityError, } from 'expo-modules-core';
6
+ import { exponentPedometer } from './native/exponent-pedometer.js';
7
+ // Upstream event name — the only sensor event in this package carrying a dot, because it is
8
+ // Exponent's original (pre-Expo-rename) native module identifier.
9
+ const PEDOMETER_UPDATE_EVENT_NAME = 'Exponent.pedometerUpdate';
10
+ const DEFAULT_PERMISSION_RESPONSE = {
11
+ granted: true,
12
+ expires: 'never',
13
+ canAskAgain: true,
14
+ status: PermissionStatus.GRANTED,
15
+ };
16
+ export function watchStepCount(callback) {
17
+ return exponentPedometer.addListener(PEDOMETER_UPDATE_EVENT_NAME, callback);
18
+ }
19
+ // iOS only in practice (Android has no native getStepCountAsync) — proven by the same
20
+ // optional-native-method check upstream uses, not a Platform.OS branch.
21
+ export async function getStepCountAsync(start, end) {
22
+ if (!exponentPedometer.getStepCountAsync) {
23
+ throw new UnavailabilityError('ExponentPedometer', 'getStepCountAsync');
24
+ }
25
+ if (start > end) {
26
+ throw new Error('Pedometer: the start date must precede the end date.');
27
+ }
28
+ return exponentPedometer.getStepCountAsync(start.getTime(), end.getTime());
29
+ }
30
+ export async function isAvailableAsync() {
31
+ return exponentPedometer.isAvailableAsync();
32
+ }
33
+ export async function getPermissionsAsync() {
34
+ if (!exponentPedometer.getPermissionsAsync) {
35
+ return DEFAULT_PERMISSION_RESPONSE;
36
+ }
37
+ return exponentPedometer.getPermissionsAsync();
38
+ }
39
+ export async function requestPermissionsAsync() {
40
+ if (!exponentPedometer.requestPermissionsAsync) {
41
+ return DEFAULT_PERMISSION_RESPONSE;
42
+ }
43
+ return exponentPedometer.requestPermissionsAsync();
44
+ }
@@ -0,0 +1,2 @@
1
+ import { type IAccelerometerMeasurement } from '../../../core';
2
+ export declare function useAccelerometer(updateIntervalMs?: number): IAccelerometerMeasurement | null;
@@ -0,0 +1,17 @@
1
+ // React lifecycle wiring over the framework-agnostic Accelerometer singleton (core/) —
2
+ // mirrors the lifecycle-bucket naming convention of adapters/react/src/hooks.
3
+ import { useEffect, useState } from 'react';
4
+ import { Accelerometer } from '../../../core/index.js';
5
+ export function useAccelerometer(updateIntervalMs) {
6
+ const [measurement, setMeasurement] = useState(null);
7
+ useEffect(() => {
8
+ // Re-subscribing on interval change keeps the native update rate in sync with the
9
+ // caller's latest `updateIntervalMs` rather than only ever honoring the first mount's.
10
+ if (updateIntervalMs !== undefined) {
11
+ Accelerometer.setUpdateInterval(updateIntervalMs);
12
+ }
13
+ const subscription = Accelerometer.addListener(setMeasurement);
14
+ return () => subscription.remove();
15
+ }, [updateIntervalMs]);
16
+ return measurement;
17
+ }
@@ -0,0 +1,2 @@
1
+ import { type IBarometerMeasurement } from '../../../core';
2
+ export declare function useBarometer(updateIntervalMs?: number): IBarometerMeasurement | null;
@@ -0,0 +1,17 @@
1
+ // React lifecycle wiring over the framework-agnostic Barometer singleton (core/) —
2
+ // mirrors the lifecycle-bucket naming convention of adapters/react/src/hooks.
3
+ import { useEffect, useState } from 'react';
4
+ import { Barometer } from '../../../core/index.js';
5
+ export function useBarometer(updateIntervalMs) {
6
+ const [measurement, setMeasurement] = useState(null);
7
+ useEffect(() => {
8
+ // Re-subscribing on interval change keeps the native update rate in sync with the
9
+ // caller's latest `updateIntervalMs` rather than only ever honoring the first mount's.
10
+ if (updateIntervalMs !== undefined) {
11
+ Barometer.setUpdateInterval(updateIntervalMs);
12
+ }
13
+ const subscription = Barometer.addListener(setMeasurement);
14
+ return () => subscription.remove();
15
+ }, [updateIntervalMs]);
16
+ return measurement;
17
+ }
@@ -0,0 +1,2 @@
1
+ import { type IDeviceMotionMeasurement } from '../../../core';
2
+ export declare function useDeviceMotion(updateIntervalMs?: number): IDeviceMotionMeasurement | null;
@@ -0,0 +1,17 @@
1
+ // React lifecycle wiring over the framework-agnostic DeviceMotion singleton (core/) —
2
+ // mirrors the lifecycle-bucket naming convention of adapters/react/src/hooks.
3
+ import { useEffect, useState } from 'react';
4
+ import { DeviceMotion } from '../../../core/index.js';
5
+ export function useDeviceMotion(updateIntervalMs) {
6
+ const [measurement, setMeasurement] = useState(null);
7
+ useEffect(() => {
8
+ // Re-subscribing on interval change keeps the native update rate in sync with the
9
+ // caller's latest `updateIntervalMs` rather than only ever honoring the first mount's.
10
+ if (updateIntervalMs !== undefined) {
11
+ DeviceMotion.setUpdateInterval(updateIntervalMs);
12
+ }
13
+ const subscription = DeviceMotion.addListener(setMeasurement);
14
+ return () => subscription.remove();
15
+ }, [updateIntervalMs]);
16
+ return measurement;
17
+ }
@@ -0,0 +1,2 @@
1
+ import { type IGyroscopeMeasurement } from '../../../core';
2
+ export declare function useGyroscope(updateIntervalMs?: number): IGyroscopeMeasurement | null;
@@ -0,0 +1,17 @@
1
+ // React lifecycle wiring over the framework-agnostic Gyroscope singleton (core/) —
2
+ // mirrors the lifecycle-bucket naming convention of adapters/react/src/hooks.
3
+ import { useEffect, useState } from 'react';
4
+ import { Gyroscope } from '../../../core/index.js';
5
+ export function useGyroscope(updateIntervalMs) {
6
+ const [measurement, setMeasurement] = useState(null);
7
+ useEffect(() => {
8
+ // Re-subscribing on interval change keeps the native update rate in sync with the
9
+ // caller's latest `updateIntervalMs` rather than only ever honoring the first mount's.
10
+ if (updateIntervalMs !== undefined) {
11
+ Gyroscope.setUpdateInterval(updateIntervalMs);
12
+ }
13
+ const subscription = Gyroscope.addListener(setMeasurement);
14
+ return () => subscription.remove();
15
+ }, [updateIntervalMs]);
16
+ return measurement;
17
+ }
@@ -0,0 +1,2 @@
1
+ import { type ILightSensorMeasurement } from '../../../core';
2
+ export declare function useLightSensor(updateIntervalMs?: number): ILightSensorMeasurement | null;
@@ -0,0 +1,17 @@
1
+ // React lifecycle wiring over the framework-agnostic LightSensor singleton (core/) —
2
+ // mirrors the lifecycle-bucket naming convention of adapters/react/src/hooks.
3
+ import { useEffect, useState } from 'react';
4
+ import { LightSensor } from '../../../core/index.js';
5
+ export function useLightSensor(updateIntervalMs) {
6
+ const [measurement, setMeasurement] = useState(null);
7
+ useEffect(() => {
8
+ // Re-subscribing on interval change keeps the native update rate in sync with the
9
+ // caller's latest `updateIntervalMs` rather than only ever honoring the first mount's.
10
+ if (updateIntervalMs !== undefined) {
11
+ LightSensor.setUpdateInterval(updateIntervalMs);
12
+ }
13
+ const subscription = LightSensor.addListener(setMeasurement);
14
+ return () => subscription.remove();
15
+ }, [updateIntervalMs]);
16
+ return measurement;
17
+ }
@@ -0,0 +1,2 @@
1
+ import { type IMagnetometerMeasurement } from '../../../core';
2
+ export declare function useMagnetometer(updateIntervalMs?: number): IMagnetometerMeasurement | null;
@@ -0,0 +1,17 @@
1
+ // React lifecycle wiring over the framework-agnostic Magnetometer singleton (core/) —
2
+ // mirrors the lifecycle-bucket naming convention of adapters/react/src/hooks.
3
+ import { useEffect, useState } from 'react';
4
+ import { Magnetometer } from '../../../core/index.js';
5
+ export function useMagnetometer(updateIntervalMs) {
6
+ const [measurement, setMeasurement] = useState(null);
7
+ useEffect(() => {
8
+ // Re-subscribing on interval change keeps the native update rate in sync with the
9
+ // caller's latest `updateIntervalMs` rather than only ever honoring the first mount's.
10
+ if (updateIntervalMs !== undefined) {
11
+ Magnetometer.setUpdateInterval(updateIntervalMs);
12
+ }
13
+ const subscription = Magnetometer.addListener(setMeasurement);
14
+ return () => subscription.remove();
15
+ }, [updateIntervalMs]);
16
+ return measurement;
17
+ }
@@ -0,0 +1,2 @@
1
+ import { type IMagnetometerUncalibratedMeasurement } from '../../../core';
2
+ export declare function useMagnetometerUncalibrated(updateIntervalMs?: number): IMagnetometerUncalibratedMeasurement | null;
@@ -0,0 +1,17 @@
1
+ // React lifecycle wiring over the framework-agnostic MagnetometerUncalibrated singleton
2
+ // (core/) — mirrors the lifecycle-bucket naming convention of adapters/react/src/hooks.
3
+ import { useEffect, useState } from 'react';
4
+ import { MagnetometerUncalibrated } from '../../../core/index.js';
5
+ export function useMagnetometerUncalibrated(updateIntervalMs) {
6
+ const [measurement, setMeasurement] = useState(null);
7
+ useEffect(() => {
8
+ // Re-subscribing on interval change keeps the native update rate in sync with the
9
+ // caller's latest `updateIntervalMs` rather than only ever honoring the first mount's.
10
+ if (updateIntervalMs !== undefined) {
11
+ MagnetometerUncalibrated.setUpdateInterval(updateIntervalMs);
12
+ }
13
+ const subscription = MagnetometerUncalibrated.addListener(setMeasurement);
14
+ return () => subscription.remove();
15
+ }, [updateIntervalMs]);
16
+ return measurement;
17
+ }
@@ -0,0 +1,2 @@
1
+ import { type IPedometerResult } from '../../../core';
2
+ export declare function usePedometer(): IPedometerResult | null;
@@ -0,0 +1,14 @@
1
+ // React lifecycle wiring over the framework-agnostic watchStepCount free function (core/) —
2
+ // mirrors the lifecycle-bucket naming convention of adapters/react/src/hooks. Unlike
3
+ // useAccelerometer, Pedometer has no setUpdateInterval, so there is no updateIntervalMs param
4
+ // to sync on re-render.
5
+ import { useEffect, useState } from 'react';
6
+ import { watchStepCount } from '../../../core/index.js';
7
+ export function usePedometer() {
8
+ const [result, setResult] = useState(null);
9
+ useEffect(() => {
10
+ const subscription = watchStepCount(setResult);
11
+ return () => subscription.remove();
12
+ }, []);
13
+ return result;
14
+ }
@@ -0,0 +1,16 @@
1
+ export { useAccelerometer } from './hooks/use-accelerometer';
2
+ export type { IAccelerometerMeasurement } from '../core';
3
+ export { useBarometer } from './hooks/use-barometer';
4
+ export type { IBarometerMeasurement } from '../core';
5
+ export { useDeviceMotion } from './hooks/use-device-motion';
6
+ export { DeviceMotionOrientation, gravity, type IDeviceMotionMeasurement } from '../core';
7
+ export { useGyroscope } from './hooks/use-gyroscope';
8
+ export type { IGyroscopeMeasurement } from '../core';
9
+ export { useLightSensor } from './hooks/use-light-sensor';
10
+ export type { ILightSensorMeasurement } from '../core';
11
+ export { useMagnetometer } from './hooks/use-magnetometer';
12
+ export type { IMagnetometerMeasurement } from '../core';
13
+ export { useMagnetometerUncalibrated } from './hooks/use-magnetometer-uncalibrated';
14
+ export type { IMagnetometerUncalibratedMeasurement } from '../core';
15
+ export { usePedometer } from './hooks/use-pedometer';
16
+ export { watchStepCount, getStepCountAsync, isAvailableAsync, getPermissionsAsync, requestPermissionsAsync, type IPedometerResult, type IPedometerUpdateCallback, } from '../core';
@@ -0,0 +1,14 @@
1
+ // @symbiote-native/sensors/react: the React entry over the framework-agnostic core.
2
+ // useAccelerometer wraps the Accelerometer singleton with React's own lifecycle
3
+ // (hooks/use-accelerometer) — mirrors the lifecycle-bucket naming convention of
4
+ // adapters/react/src/hooks (never `composables`, that's Vue's term).
5
+ export { useAccelerometer } from './hooks/use-accelerometer/index.js';
6
+ export { useBarometer } from './hooks/use-barometer/index.js';
7
+ export { useDeviceMotion } from './hooks/use-device-motion/index.js';
8
+ export { DeviceMotionOrientation, gravity } from '../core/index.js';
9
+ export { useGyroscope } from './hooks/use-gyroscope/index.js';
10
+ export { useLightSensor } from './hooks/use-light-sensor/index.js';
11
+ export { useMagnetometer } from './hooks/use-magnetometer/index.js';
12
+ export { useMagnetometerUncalibrated } from './hooks/use-magnetometer-uncalibrated/index.js';
13
+ export { usePedometer } from './hooks/use-pedometer/index.js';
14
+ export { watchStepCount, getStepCountAsync, isAvailableAsync, getPermissionsAsync, requestPermissionsAsync, } from '../core/index.js';
@@ -0,0 +1,3 @@
1
+ import { type Ref } from '@vue/runtime-core';
2
+ import { type IAccelerometerMeasurement } from '../../../core';
3
+ export declare function useAccelerometer(updateIntervalMs?: number): Ref<IAccelerometerMeasurement | null>;
@@ -0,0 +1,25 @@
1
+ // Vue lifecycle wiring over the framework-agnostic Accelerometer singleton (core/) — mirrors
2
+ // the lifecycle-bucket naming convention of adapters/vue/src/composables and the
3
+ // onMounted/onUnmounted shape of use-color-scheme.ts's subscription handle. Unlike
4
+ // use-hide-animation.ts (which takes a config getter because its consumer's config changes
5
+ // across reactive updates), this subscribes exactly once at mount and never needs to react to
6
+ // a later change of updateIntervalMs, so a plain numeric param is enough.
7
+ import { onMounted, onUnmounted, ref } from '@vue/runtime-core';
8
+ import { Accelerometer, } from '../../../core/index.js';
9
+ export function useAccelerometer(updateIntervalMs) {
10
+ // A plain ref: the value is a POJO measurement, not an engine node, so no shallowRef needed.
11
+ const measurement = ref(null);
12
+ let subscription;
13
+ onMounted(() => {
14
+ if (updateIntervalMs !== undefined) {
15
+ Accelerometer.setUpdateInterval(updateIntervalMs);
16
+ }
17
+ subscription = Accelerometer.addListener(next => {
18
+ measurement.value = next;
19
+ });
20
+ });
21
+ onUnmounted(() => {
22
+ subscription?.remove();
23
+ });
24
+ return measurement;
25
+ }
@@ -0,0 +1,3 @@
1
+ import { type Ref } from '@vue/runtime-core';
2
+ import { type IBarometerMeasurement } from '../../../core';
3
+ export declare function useBarometer(updateIntervalMs?: number): Ref<IBarometerMeasurement | null>;
@@ -0,0 +1,25 @@
1
+ // Vue lifecycle wiring over the framework-agnostic Barometer singleton (core/) — mirrors
2
+ // the lifecycle-bucket naming convention of adapters/vue/src/composables and the
3
+ // onMounted/onUnmounted shape of use-color-scheme.ts's subscription handle. Unlike
4
+ // use-hide-animation.ts (which takes a config getter because its consumer's config changes
5
+ // across reactive updates), this subscribes exactly once at mount and never needs to react to
6
+ // a later change of updateIntervalMs, so a plain numeric param is enough.
7
+ import { onMounted, onUnmounted, ref } from '@vue/runtime-core';
8
+ import { Barometer } from '../../../core/index.js';
9
+ export function useBarometer(updateIntervalMs) {
10
+ // A plain ref: the value is a POJO measurement, not an engine node, so no shallowRef needed.
11
+ const measurement = ref(null);
12
+ let subscription;
13
+ onMounted(() => {
14
+ if (updateIntervalMs !== undefined) {
15
+ Barometer.setUpdateInterval(updateIntervalMs);
16
+ }
17
+ subscription = Barometer.addListener(next => {
18
+ measurement.value = next;
19
+ });
20
+ });
21
+ onUnmounted(() => {
22
+ subscription?.remove();
23
+ });
24
+ return measurement;
25
+ }
@@ -0,0 +1,3 @@
1
+ import { type Ref } from '@vue/runtime-core';
2
+ import { type IDeviceMotionMeasurement } from '../../../core';
3
+ export declare function useDeviceMotion(updateIntervalMs?: number): Ref<IDeviceMotionMeasurement | null>;
@@ -0,0 +1,25 @@
1
+ // Vue lifecycle wiring over the framework-agnostic DeviceMotion singleton (core/) — mirrors
2
+ // the lifecycle-bucket naming convention of adapters/vue/src/composables and the
3
+ // onMounted/onUnmounted shape of use-color-scheme.ts's subscription handle. Unlike
4
+ // use-hide-animation.ts (which takes a config getter because its consumer's config changes
5
+ // across reactive updates), this subscribes exactly once at mount and never needs to react to
6
+ // a later change of updateIntervalMs, so a plain numeric param is enough.
7
+ import { onMounted, onUnmounted, ref } from '@vue/runtime-core';
8
+ import { DeviceMotion } from '../../../core/index.js';
9
+ export function useDeviceMotion(updateIntervalMs) {
10
+ // A plain ref: the value is a POJO measurement, not an engine node, so no shallowRef needed.
11
+ const measurement = ref(null);
12
+ let subscription;
13
+ onMounted(() => {
14
+ if (updateIntervalMs !== undefined) {
15
+ DeviceMotion.setUpdateInterval(updateIntervalMs);
16
+ }
17
+ subscription = DeviceMotion.addListener(next => {
18
+ measurement.value = next;
19
+ });
20
+ });
21
+ onUnmounted(() => {
22
+ subscription?.remove();
23
+ });
24
+ return measurement;
25
+ }
@@ -0,0 +1,3 @@
1
+ import { type Ref } from '@vue/runtime-core';
2
+ import { type IGyroscopeMeasurement } from '../../../core';
3
+ export declare function useGyroscope(updateIntervalMs?: number): Ref<IGyroscopeMeasurement | null>;
@@ -0,0 +1,25 @@
1
+ // Vue lifecycle wiring over the framework-agnostic Gyroscope singleton (core/) — mirrors
2
+ // the lifecycle-bucket naming convention of adapters/vue/src/composables and the
3
+ // onMounted/onUnmounted shape of use-color-scheme.ts's subscription handle. Unlike
4
+ // use-hide-animation.ts (which takes a config getter because its consumer's config changes
5
+ // across reactive updates), this subscribes exactly once at mount and never needs to react to
6
+ // a later change of updateIntervalMs, so a plain numeric param is enough.
7
+ import { onMounted, onUnmounted, ref } from '@vue/runtime-core';
8
+ import { Gyroscope } from '../../../core/index.js';
9
+ export function useGyroscope(updateIntervalMs) {
10
+ // A plain ref: the value is a POJO measurement, not an engine node, so no shallowRef needed.
11
+ const measurement = ref(null);
12
+ let subscription;
13
+ onMounted(() => {
14
+ if (updateIntervalMs !== undefined) {
15
+ Gyroscope.setUpdateInterval(updateIntervalMs);
16
+ }
17
+ subscription = Gyroscope.addListener(next => {
18
+ measurement.value = next;
19
+ });
20
+ });
21
+ onUnmounted(() => {
22
+ subscription?.remove();
23
+ });
24
+ return measurement;
25
+ }
@@ -0,0 +1,3 @@
1
+ import { type Ref } from '@vue/runtime-core';
2
+ import { type ILightSensorMeasurement } from '../../../core';
3
+ export declare function useLightSensor(updateIntervalMs?: number): Ref<ILightSensorMeasurement | null>;
@@ -0,0 +1,25 @@
1
+ // Vue lifecycle wiring over the framework-agnostic LightSensor singleton (core/) — mirrors
2
+ // the lifecycle-bucket naming convention of adapters/vue/src/composables and the
3
+ // onMounted/onUnmounted shape of use-color-scheme.ts's subscription handle. Unlike
4
+ // use-hide-animation.ts (which takes a config getter because its consumer's config changes
5
+ // across reactive updates), this subscribes exactly once at mount and never needs to react to
6
+ // a later change of updateIntervalMs, so a plain numeric param is enough.
7
+ import { onMounted, onUnmounted, ref } from '@vue/runtime-core';
8
+ import { LightSensor } from '../../../core/index.js';
9
+ export function useLightSensor(updateIntervalMs) {
10
+ // A plain ref: the value is a POJO measurement, not an engine node, so no shallowRef needed.
11
+ const measurement = ref(null);
12
+ let subscription;
13
+ onMounted(() => {
14
+ if (updateIntervalMs !== undefined) {
15
+ LightSensor.setUpdateInterval(updateIntervalMs);
16
+ }
17
+ subscription = LightSensor.addListener(next => {
18
+ measurement.value = next;
19
+ });
20
+ });
21
+ onUnmounted(() => {
22
+ subscription?.remove();
23
+ });
24
+ return measurement;
25
+ }
@@ -0,0 +1,3 @@
1
+ import { type Ref } from '@vue/runtime-core';
2
+ import { type IMagnetometerMeasurement } from '../../../core';
3
+ export declare function useMagnetometer(updateIntervalMs?: number): Ref<IMagnetometerMeasurement | null>;
@@ -0,0 +1,25 @@
1
+ // Vue lifecycle wiring over the framework-agnostic Magnetometer singleton (core/) — mirrors
2
+ // the lifecycle-bucket naming convention of adapters/vue/src/composables and the
3
+ // onMounted/onUnmounted shape of use-color-scheme.ts's subscription handle. Unlike
4
+ // use-hide-animation.ts (which takes a config getter because its consumer's config changes
5
+ // across reactive updates), this subscribes exactly once at mount and never needs to react to
6
+ // a later change of updateIntervalMs, so a plain numeric param is enough.
7
+ import { onMounted, onUnmounted, ref } from '@vue/runtime-core';
8
+ import { Magnetometer } from '../../../core/index.js';
9
+ export function useMagnetometer(updateIntervalMs) {
10
+ // A plain ref: the value is a POJO measurement, not an engine node, so no shallowRef needed.
11
+ const measurement = ref(null);
12
+ let subscription;
13
+ onMounted(() => {
14
+ if (updateIntervalMs !== undefined) {
15
+ Magnetometer.setUpdateInterval(updateIntervalMs);
16
+ }
17
+ subscription = Magnetometer.addListener(next => {
18
+ measurement.value = next;
19
+ });
20
+ });
21
+ onUnmounted(() => {
22
+ subscription?.remove();
23
+ });
24
+ return measurement;
25
+ }
@@ -0,0 +1,3 @@
1
+ import { type Ref } from '@vue/runtime-core';
2
+ import { type IMagnetometerUncalibratedMeasurement } from '../../../core';
3
+ export declare function useMagnetometerUncalibrated(updateIntervalMs?: number): Ref<IMagnetometerUncalibratedMeasurement | null>;
@@ -0,0 +1,25 @@
1
+ // Vue lifecycle wiring over the framework-agnostic MagnetometerUncalibrated singleton (core/) —
2
+ // mirrors the lifecycle-bucket naming convention of adapters/vue/src/composables and the
3
+ // onMounted/onUnmounted shape of use-color-scheme.ts's subscription handle. Unlike
4
+ // use-hide-animation.ts (which takes a config getter because its consumer's config changes
5
+ // across reactive updates), this subscribes exactly once at mount and never needs to react to
6
+ // a later change of updateIntervalMs, so a plain numeric param is enough.
7
+ import { onMounted, onUnmounted, ref } from '@vue/runtime-core';
8
+ import { MagnetometerUncalibrated, } from '../../../core/index.js';
9
+ export function useMagnetometerUncalibrated(updateIntervalMs) {
10
+ // A plain ref: the value is a POJO measurement, not an engine node, so no shallowRef needed.
11
+ const measurement = ref(null);
12
+ let subscription;
13
+ onMounted(() => {
14
+ if (updateIntervalMs !== undefined) {
15
+ MagnetometerUncalibrated.setUpdateInterval(updateIntervalMs);
16
+ }
17
+ subscription = MagnetometerUncalibrated.addListener(next => {
18
+ measurement.value = next;
19
+ });
20
+ });
21
+ onUnmounted(() => {
22
+ subscription?.remove();
23
+ });
24
+ return measurement;
25
+ }
@@ -0,0 +1,3 @@
1
+ import { type Ref } from '@vue/runtime-core';
2
+ import { type IPedometerResult } from '../../../core';
3
+ export declare function usePedometer(): Ref<IPedometerResult | null>;
@@ -0,0 +1,20 @@
1
+ // Vue lifecycle wiring over the framework-agnostic watchStepCount free function (core/) —
2
+ // mirrors the lifecycle-bucket naming convention of adapters/vue/src/composables and the
3
+ // onMounted/onUnmounted shape of useAccelerometer. Pedometer has no setUpdateInterval, so
4
+ // unlike useAccelerometer there is no interval param to apply at subscribe time.
5
+ import { onMounted, onUnmounted, ref } from '@vue/runtime-core';
6
+ import { watchStepCount } from '../../../core/index.js';
7
+ export function usePedometer() {
8
+ // A plain ref: the value is a POJO result, not an engine node, so no shallowRef needed.
9
+ const result = ref(null);
10
+ let subscription;
11
+ onMounted(() => {
12
+ subscription = watchStepCount(next => {
13
+ result.value = next;
14
+ });
15
+ });
16
+ onUnmounted(() => {
17
+ subscription?.remove();
18
+ });
19
+ return result;
20
+ }
@@ -0,0 +1,16 @@
1
+ export { useAccelerometer } from './composables/use-accelerometer';
2
+ export type { IAccelerometerMeasurement } from '../core';
3
+ export { useBarometer } from './composables/use-barometer';
4
+ export type { IBarometerMeasurement } from '../core';
5
+ export { useDeviceMotion } from './composables/use-device-motion';
6
+ export { DeviceMotionOrientation, gravity, type IDeviceMotionMeasurement } from '../core';
7
+ export { useGyroscope } from './composables/use-gyroscope';
8
+ export type { IGyroscopeMeasurement } from '../core';
9
+ export { useLightSensor } from './composables/use-light-sensor';
10
+ export type { ILightSensorMeasurement } from '../core';
11
+ export { useMagnetometer } from './composables/use-magnetometer';
12
+ export type { IMagnetometerMeasurement } from '../core';
13
+ export { useMagnetometerUncalibrated } from './composables/use-magnetometer-uncalibrated';
14
+ export type { IMagnetometerUncalibratedMeasurement } from '../core';
15
+ export { usePedometer } from './composables/use-pedometer';
16
+ export { watchStepCount, getStepCountAsync, isAvailableAsync, getPermissionsAsync, requestPermissionsAsync, type IPedometerResult, type IPedometerUpdateCallback, } from '../core';
@@ -0,0 +1,14 @@
1
+ // @symbiote-native/sensors/vue: the Vue entry over the framework-agnostic core. useAccelerometer
2
+ // wires the Accelerometer singleton's addListener lifecycle onto Vue's own onMounted/onUnmounted
3
+ // (composables/use-accelerometer) — mirrors the lifecycle-bucket naming convention of
4
+ // adapters/vue/src/composables (never `hooks/`, that's React's term).
5
+ export { useAccelerometer } from './composables/use-accelerometer/index.js';
6
+ export { useBarometer } from './composables/use-barometer/index.js';
7
+ export { useDeviceMotion } from './composables/use-device-motion/index.js';
8
+ export { DeviceMotionOrientation, gravity } from '../core/index.js';
9
+ export { useGyroscope } from './composables/use-gyroscope/index.js';
10
+ export { useLightSensor } from './composables/use-light-sensor/index.js';
11
+ export { useMagnetometer } from './composables/use-magnetometer/index.js';
12
+ export { useMagnetometerUncalibrated } from './composables/use-magnetometer-uncalibrated/index.js';
13
+ export { usePedometer } from './composables/use-pedometer/index.js';
14
+ export { watchStepCount, getStepCountAsync, isAvailableAsync, getPermissionsAsync, requestPermissionsAsync, } from '../core/index.js';
@@ -0,0 +1,16 @@
1
+ export { AccelerometerService } from './services/accelerometer.service';
2
+ export type { IAccelerometerMeasurement } from '../core';
3
+ export { BarometerService } from './services/barometer.service';
4
+ export type { IBarometerMeasurement } from '../core';
5
+ export { DeviceMotionService } from './services/device-motion.service';
6
+ export { DeviceMotionOrientation, gravity, type IDeviceMotionMeasurement } from '../core';
7
+ export { GyroscopeService } from './services/gyroscope.service';
8
+ export type { IGyroscopeMeasurement } from '../core';
9
+ export { LightSensorService } from './services/light-sensor.service';
10
+ export type { ILightSensorMeasurement } from '../core';
11
+ export { MagnetometerService } from './services/magnetometer.service';
12
+ export type { IMagnetometerMeasurement } from '../core';
13
+ export { MagnetometerUncalibratedService } from './services/magnetometer-uncalibrated.service';
14
+ export type { IMagnetometerUncalibratedMeasurement } from '../core';
15
+ export { PedometerService } from './services/pedometer.service';
16
+ export { watchStepCount, getStepCountAsync, isAvailableAsync, getPermissionsAsync, requestPermissionsAsync, type IPedometerResult, type IPedometerUpdateCallback, } from '../core';