@ovok/native 1.16.1-rc.3 → 1.16.1-rc.4

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 (597) hide show
  1. package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js +3 -1
  2. package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -1
  3. package/lib/commonjs/modules/bt-management/components/bluetooth-device-picker.js +9 -141
  4. package/lib/commonjs/modules/bt-management/components/bluetooth-device-picker.js.map +1 -1
  5. package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js +1 -0
  6. package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
  7. package/lib/commonjs/modules/bt-management/components/device-picker-sheet.js +160 -0
  8. package/lib/commonjs/modules/bt-management/components/device-picker-sheet.js.map +1 -0
  9. package/lib/commonjs/modules/bt-management/hooks/runtime-context.js.map +1 -1
  10. package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-permission.js +2 -1
  11. package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-permission.js.map +1 -1
  12. package/lib/commonjs/modules/bt-management/hooks/use-measurements.js +1 -1
  13. package/lib/commonjs/modules/bt-management/hooks/use-measurements.js.map +1 -1
  14. package/lib/commonjs/modules/bt-management/index.js +12 -0
  15. package/lib/commonjs/modules/bt-management/index.js.map +1 -1
  16. package/lib/commonjs/modules/bt-management/services/bt-manager.js +50 -0
  17. package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
  18. package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js +3 -0
  19. package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js.map +1 -1
  20. package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js +4 -2
  21. package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
  22. package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js +97 -28
  23. package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
  24. package/lib/commonjs/modules/bt-management/services/devices/bt-current-time.js +59 -0
  25. package/lib/commonjs/modules/bt-management/services/devices/bt-current-time.js.map +1 -0
  26. package/lib/commonjs/modules/bt-management/services/devices/bt-device-information.js +18 -37
  27. package/lib/commonjs/modules/bt-management/services/devices/bt-device-information.js.map +1 -1
  28. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +31 -3
  29. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  30. package/lib/commonjs/modules/bt-management/services/devices/bt-notification-readiness.js +68 -0
  31. package/lib/commonjs/modules/bt-management/services/devices/bt-notification-readiness.js.map +1 -0
  32. package/lib/commonjs/modules/bt-management/services/devices/bt-pairing-retry.js +70 -0
  33. package/lib/commonjs/modules/bt-management/services/devices/bt-pairing-retry.js.map +1 -0
  34. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +14 -0
  35. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  36. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.blood-pressure-status.js +4 -7
  37. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.blood-pressure-status.js.map +1 -1
  38. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.js +106 -0
  39. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.js.map +1 -0
  40. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +38 -31
  41. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -1
  42. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.js +41 -0
  43. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.js.map +1 -0
  44. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.js +77 -0
  45. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.js.map +1 -0
  46. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.js +49 -0
  47. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.js.map +1 -0
  48. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.js +89 -0
  49. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.js.map +1 -0
  50. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose.js +35 -42
  51. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose.js.map +1 -1
  52. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +22 -24
  53. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -1
  54. package/lib/commonjs/modules/bt-management/services/record-cursor.js +70 -0
  55. package/lib/commonjs/modules/bt-management/services/record-cursor.js.map +1 -0
  56. package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js +8 -0
  57. package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js.map +1 -1
  58. package/lib/commonjs/modules/bt-management/types/glucose-record-details.js +2 -0
  59. package/lib/commonjs/modules/bt-management/types/glucose-record-details.js.map +1 -0
  60. package/lib/commonjs/modules/bt-management/utils/bluetooth-permission-list.js +19 -0
  61. package/lib/commonjs/modules/bt-management/utils/bluetooth-permission-list.js.map +1 -0
  62. package/lib/commonjs/modules/bt-management/utils/device-user.js +22 -0
  63. package/lib/commonjs/modules/bt-management/utils/device-user.js.map +1 -0
  64. package/lib/commonjs/modules/bt-management/utils/kpa-to-mmhg.js +9 -0
  65. package/lib/commonjs/modules/bt-management/utils/kpa-to-mmhg.js.map +1 -0
  66. package/lib/commonjs/modules/bt-management/utils/result-identity.js +26 -35
  67. package/lib/commonjs/modules/bt-management/utils/result-identity.js.map +1 -1
  68. package/lib/commonjs/modules/bt-management/utils/rr-interval.js +16 -0
  69. package/lib/commonjs/modules/bt-management/utils/rr-interval.js.map +1 -0
  70. package/lib/commonjs/modules/bt-management/utils/temperature-type.js +15 -0
  71. package/lib/commonjs/modules/bt-management/utils/temperature-type.js.map +1 -0
  72. package/lib/commonjs/modules/bt-management/utils/wait.js +10 -0
  73. package/lib/commonjs/modules/bt-management/utils/wait.js.map +1 -0
  74. package/lib/commonjs/modules/next/background-sync/index.js +28 -0
  75. package/lib/commonjs/modules/next/background-sync/index.js.map +1 -0
  76. package/lib/commonjs/modules/next/background-sync/offline-measurement-background-sync.js +63 -0
  77. package/lib/commonjs/modules/next/background-sync/offline-measurement-background-sync.js.map +1 -0
  78. package/lib/commonjs/modules/next/bluetooth/auto-connect.js +32 -0
  79. package/lib/commonjs/modules/next/bluetooth/auto-connect.js.map +1 -0
  80. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-errors.js +33 -0
  81. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-errors.js.map +1 -0
  82. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-link.js +162 -0
  83. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-link.js.map +1 -0
  84. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-scanner.js +75 -0
  85. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-scanner.js.map +1 -0
  86. package/lib/commonjs/modules/next/bluetooth/ble-plx/built-in-devices.js +34 -0
  87. package/lib/commonjs/modules/next/bluetooth/ble-plx/built-in-devices.js.map +1 -0
  88. package/lib/commonjs/modules/next/bluetooth/ble-plx/legacy-driver.js +67 -0
  89. package/lib/commonjs/modules/next/bluetooth/ble-plx/legacy-driver.js.map +1 -0
  90. package/lib/commonjs/modules/next/bluetooth/connections.js +114 -0
  91. package/lib/commonjs/modules/next/bluetooth/connections.js.map +1 -0
  92. package/lib/commonjs/modules/next/bluetooth/daily-total-day.js.map +1 -0
  93. package/lib/commonjs/modules/next/bluetooth/devices.js +41 -0
  94. package/lib/commonjs/modules/next/bluetooth/devices.js.map +1 -0
  95. package/lib/commonjs/modules/next/bluetooth/driver.js +30 -20
  96. package/lib/commonjs/modules/next/bluetooth/driver.js.map +1 -1
  97. package/lib/commonjs/modules/next/bluetooth/errors.js +26 -0
  98. package/lib/commonjs/modules/next/bluetooth/errors.js.map +1 -0
  99. package/lib/commonjs/modules/next/bluetooth/index.js +122 -11
  100. package/lib/commonjs/modules/next/bluetooth/index.js.map +1 -1
  101. package/lib/commonjs/modules/next/bluetooth/link.js +0 -103
  102. package/lib/commonjs/modules/next/bluetooth/link.js.map +1 -1
  103. package/lib/commonjs/modules/next/bluetooth/paired.js +50 -0
  104. package/lib/commonjs/modules/next/bluetooth/paired.js.map +1 -0
  105. package/lib/commonjs/modules/next/bluetooth/permissions.js +2 -0
  106. package/lib/commonjs/modules/next/bluetooth/permissions.js.map +1 -0
  107. package/lib/commonjs/modules/next/bluetooth/react/bluetooth-device-picker.js +44 -0
  108. package/lib/commonjs/modules/next/bluetooth/react/bluetooth-device-picker.js.map +1 -0
  109. package/lib/commonjs/modules/next/bluetooth/react/context.js +54 -0
  110. package/lib/commonjs/modules/next/bluetooth/react/context.js.map +1 -0
  111. package/lib/commonjs/modules/next/bluetooth/react/hooks.js +86 -0
  112. package/lib/commonjs/modules/next/bluetooth/react/hooks.js.map +1 -0
  113. package/lib/commonjs/modules/next/bluetooth/react-native/create-bluetooth-runtime.js +28 -0
  114. package/lib/commonjs/modules/next/bluetooth/react-native/create-bluetooth-runtime.js.map +1 -0
  115. package/lib/commonjs/modules/next/bluetooth/react-native/os-permissions.js +32 -0
  116. package/lib/commonjs/modules/next/bluetooth/react-native/os-permissions.js.map +1 -0
  117. package/lib/commonjs/modules/next/bluetooth/react-native/ovok-sink.js +43 -0
  118. package/lib/commonjs/modules/next/bluetooth/react-native/ovok-sink.js.map +1 -0
  119. package/lib/commonjs/modules/next/bluetooth/readings.js +93 -0
  120. package/lib/commonjs/modules/next/bluetooth/readings.js.map +1 -0
  121. package/lib/commonjs/modules/next/bluetooth/result-policy.js +15 -2
  122. package/lib/commonjs/modules/next/bluetooth/result-policy.js.map +1 -1
  123. package/lib/commonjs/modules/next/bluetooth/runtime.js +223 -0
  124. package/lib/commonjs/modules/next/bluetooth/runtime.js.map +1 -0
  125. package/lib/commonjs/modules/next/bluetooth/scan-loop.js +82 -0
  126. package/lib/commonjs/modules/next/bluetooth/scan-loop.js.map +1 -0
  127. package/lib/commonjs/modules/next/bluetooth/sig-profiles.js +46 -13
  128. package/lib/commonjs/modules/next/bluetooth/sig-profiles.js.map +1 -1
  129. package/lib/commonjs/modules/next/bluetooth/sink.js +6 -0
  130. package/lib/commonjs/modules/next/bluetooth/sink.js.map +1 -0
  131. package/lib/commonjs/modules/next/bluetooth/snapshot.js +6 -0
  132. package/lib/commonjs/modules/next/bluetooth/snapshot.js.map +1 -0
  133. package/lib/commonjs/modules/next/bluetooth/stable-hash.js +42 -0
  134. package/lib/commonjs/modules/next/bluetooth/stable-hash.js.map +1 -0
  135. package/lib/commonjs/modules/next/bluetooth/store.js +61 -0
  136. package/lib/commonjs/modules/next/bluetooth/store.js.map +1 -0
  137. package/lib/commonjs/modules/next/bluetooth/transport.js +6 -0
  138. package/lib/commonjs/modules/next/bluetooth/transport.js.map +1 -0
  139. package/lib/commonjs/modules/next/data-sync/index.js +17 -0
  140. package/lib/commonjs/modules/next/data-sync/index.js.map +1 -0
  141. package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js +3 -1
  142. package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -1
  143. package/lib/module/modules/bt-management/components/bluetooth-device-picker.js +9 -141
  144. package/lib/module/modules/bt-management/components/bluetooth-device-picker.js.map +1 -1
  145. package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +1 -0
  146. package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
  147. package/lib/module/modules/bt-management/components/device-picker-sheet.js +154 -0
  148. package/lib/module/modules/bt-management/components/device-picker-sheet.js.map +1 -0
  149. package/lib/module/modules/bt-management/hooks/runtime-context.js.map +1 -1
  150. package/lib/module/modules/bt-management/hooks/use-bluetooth-permission.js +4 -3
  151. package/lib/module/modules/bt-management/hooks/use-bluetooth-permission.js.map +1 -1
  152. package/lib/module/modules/bt-management/hooks/use-measurements.js +1 -1
  153. package/lib/module/modules/bt-management/hooks/use-measurements.js.map +1 -1
  154. package/lib/module/modules/bt-management/index.js +1 -0
  155. package/lib/module/modules/bt-management/index.js.map +1 -1
  156. package/lib/module/modules/bt-management/services/bt-manager.js +50 -0
  157. package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
  158. package/lib/module/modules/bt-management/services/custom/define-custom-device.js +3 -0
  159. package/lib/module/modules/bt-management/services/custom/define-custom-device.js.map +1 -1
  160. package/lib/module/modules/bt-management/services/devices/bt-command-writer.js +4 -2
  161. package/lib/module/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
  162. package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js +97 -28
  163. package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
  164. package/lib/module/modules/bt-management/services/devices/bt-current-time.js +55 -0
  165. package/lib/module/modules/bt-management/services/devices/bt-current-time.js.map +1 -0
  166. package/lib/module/modules/bt-management/services/devices/bt-device-information.js +18 -37
  167. package/lib/module/modules/bt-management/services/devices/bt-device-information.js.map +1 -1
  168. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +33 -5
  169. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  170. package/lib/module/modules/bt-management/services/devices/bt-notification-readiness.js +65 -0
  171. package/lib/module/modules/bt-management/services/devices/bt-notification-readiness.js.map +1 -0
  172. package/lib/module/modules/bt-management/services/devices/bt-pairing-retry.js +65 -0
  173. package/lib/module/modules/bt-management/services/devices/bt-pairing-retry.js.map +1 -0
  174. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +14 -0
  175. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  176. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.blood-pressure-status.js +1 -4
  177. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.blood-pressure-status.js.map +1 -1
  178. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.js +99 -0
  179. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.js.map +1 -0
  180. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +38 -31
  181. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -1
  182. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.js +35 -0
  183. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.js.map +1 -0
  184. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.js +72 -0
  185. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.js.map +1 -0
  186. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.js +40 -0
  187. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.js.map +1 -0
  188. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.js +85 -0
  189. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.js.map +1 -0
  190. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose.js +25 -32
  191. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose.js.map +1 -1
  192. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +18 -20
  193. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -1
  194. package/lib/module/modules/bt-management/services/record-cursor.js +66 -0
  195. package/lib/module/modules/bt-management/services/record-cursor.js.map +1 -0
  196. package/lib/module/modules/bt-management/testing/fake-ble-manager.js +8 -0
  197. package/lib/module/modules/bt-management/testing/fake-ble-manager.js.map +1 -1
  198. package/lib/module/modules/bt-management/types/custom-device-definition.js +4 -0
  199. package/lib/module/modules/bt-management/types/custom-device-definition.js.map +1 -1
  200. package/lib/module/modules/bt-management/types/glucose-record-details.js +2 -0
  201. package/lib/module/modules/bt-management/types/glucose-record-details.js.map +1 -0
  202. package/lib/module/modules/bt-management/utils/bluetooth-permission-list.js +14 -0
  203. package/lib/module/modules/bt-management/utils/bluetooth-permission-list.js.map +1 -0
  204. package/lib/module/modules/bt-management/utils/device-user.js +17 -0
  205. package/lib/module/modules/bt-management/utils/device-user.js.map +1 -0
  206. package/lib/module/modules/bt-management/utils/kpa-to-mmhg.js +6 -0
  207. package/lib/module/modules/bt-management/utils/kpa-to-mmhg.js.map +1 -0
  208. package/lib/module/modules/bt-management/utils/result-identity.js +23 -33
  209. package/lib/module/modules/bt-management/utils/result-identity.js.map +1 -1
  210. package/lib/module/modules/bt-management/utils/rr-interval.js +12 -0
  211. package/lib/module/modules/bt-management/utils/rr-interval.js.map +1 -0
  212. package/lib/module/modules/bt-management/utils/temperature-type.js +11 -0
  213. package/lib/module/modules/bt-management/utils/temperature-type.js.map +1 -0
  214. package/lib/module/modules/bt-management/utils/wait.js +5 -0
  215. package/lib/module/modules/bt-management/utils/wait.js.map +1 -0
  216. package/lib/module/modules/next/background-sync/index.js +12 -0
  217. package/lib/module/modules/next/background-sync/index.js.map +1 -0
  218. package/lib/module/modules/next/background-sync/offline-measurement-background-sync.js +55 -0
  219. package/lib/module/modules/next/background-sync/offline-measurement-background-sync.js.map +1 -0
  220. package/lib/module/modules/next/bluetooth/auto-connect.js +28 -0
  221. package/lib/module/modules/next/bluetooth/auto-connect.js.map +1 -0
  222. package/lib/module/modules/next/bluetooth/ble-plx/ble-errors.js +28 -0
  223. package/lib/module/modules/next/bluetooth/ble-plx/ble-errors.js.map +1 -0
  224. package/lib/module/modules/next/bluetooth/ble-plx/ble-link.js +159 -0
  225. package/lib/module/modules/next/bluetooth/ble-plx/ble-link.js.map +1 -0
  226. package/lib/module/modules/next/bluetooth/ble-plx/ble-scanner.js +69 -0
  227. package/lib/module/modules/next/bluetooth/ble-plx/ble-scanner.js.map +1 -0
  228. package/lib/module/modules/next/bluetooth/ble-plx/built-in-devices.js +31 -0
  229. package/lib/module/modules/next/bluetooth/ble-plx/built-in-devices.js.map +1 -0
  230. package/lib/module/modules/next/bluetooth/ble-plx/legacy-driver.js +63 -0
  231. package/lib/module/modules/next/bluetooth/ble-plx/legacy-driver.js.map +1 -0
  232. package/lib/module/modules/next/bluetooth/connections.js +110 -0
  233. package/lib/module/modules/next/bluetooth/connections.js.map +1 -0
  234. package/lib/module/modules/next/bluetooth/daily-total-day.js.map +1 -0
  235. package/lib/module/modules/next/bluetooth/devices.js +37 -0
  236. package/lib/module/modules/next/bluetooth/devices.js.map +1 -0
  237. package/lib/module/modules/next/bluetooth/driver.js +29 -20
  238. package/lib/module/modules/next/bluetooth/driver.js.map +1 -1
  239. package/lib/module/modules/next/bluetooth/errors.js +21 -0
  240. package/lib/module/modules/next/bluetooth/errors.js.map +1 -0
  241. package/lib/module/modules/next/bluetooth/index.js +22 -4
  242. package/lib/module/modules/next/bluetooth/index.js.map +1 -1
  243. package/lib/module/modules/next/bluetooth/link.js +0 -101
  244. package/lib/module/modules/next/bluetooth/link.js.map +1 -1
  245. package/lib/module/modules/next/bluetooth/paired.js +46 -0
  246. package/lib/module/modules/next/bluetooth/paired.js.map +1 -0
  247. package/lib/module/modules/next/bluetooth/permissions.js +2 -0
  248. package/lib/module/modules/next/bluetooth/permissions.js.map +1 -0
  249. package/lib/module/modules/next/bluetooth/react/bluetooth-device-picker.js +39 -0
  250. package/lib/module/modules/next/bluetooth/react/bluetooth-device-picker.js.map +1 -0
  251. package/lib/module/modules/next/bluetooth/react/context.js +48 -0
  252. package/lib/module/modules/next/bluetooth/react/context.js.map +1 -0
  253. package/lib/module/modules/next/bluetooth/react/hooks.js +76 -0
  254. package/lib/module/modules/next/bluetooth/react/hooks.js.map +1 -0
  255. package/lib/module/modules/next/bluetooth/react-native/create-bluetooth-runtime.js +25 -0
  256. package/lib/module/modules/next/bluetooth/react-native/create-bluetooth-runtime.js.map +1 -0
  257. package/lib/module/modules/next/bluetooth/react-native/os-permissions.js +28 -0
  258. package/lib/module/modules/next/bluetooth/react-native/os-permissions.js.map +1 -0
  259. package/lib/module/modules/next/bluetooth/react-native/ovok-sink.js +39 -0
  260. package/lib/module/modules/next/bluetooth/react-native/ovok-sink.js.map +1 -0
  261. package/lib/module/modules/next/bluetooth/readings.js +89 -0
  262. package/lib/module/modules/next/bluetooth/readings.js.map +1 -0
  263. package/lib/module/modules/next/bluetooth/result-policy.js +14 -2
  264. package/lib/module/modules/next/bluetooth/result-policy.js.map +1 -1
  265. package/lib/module/modules/next/bluetooth/runtime.js +220 -0
  266. package/lib/module/modules/next/bluetooth/runtime.js.map +1 -0
  267. package/lib/module/modules/next/bluetooth/scan-loop.js +78 -0
  268. package/lib/module/modules/next/bluetooth/scan-loop.js.map +1 -0
  269. package/lib/module/modules/next/bluetooth/sig-profiles.js +44 -11
  270. package/lib/module/modules/next/bluetooth/sig-profiles.js.map +1 -1
  271. package/lib/module/modules/next/bluetooth/sink.js +4 -0
  272. package/lib/module/modules/next/bluetooth/sink.js.map +1 -0
  273. package/lib/module/modules/next/bluetooth/snapshot.js +4 -0
  274. package/lib/module/modules/next/bluetooth/snapshot.js.map +1 -0
  275. package/lib/module/modules/next/bluetooth/stable-hash.js +37 -0
  276. package/lib/module/modules/next/bluetooth/stable-hash.js.map +1 -0
  277. package/lib/module/modules/next/bluetooth/store.js +57 -0
  278. package/lib/module/modules/next/bluetooth/store.js.map +1 -0
  279. package/lib/module/modules/next/bluetooth/transport.js +4 -0
  280. package/lib/module/modules/next/bluetooth/transport.js.map +1 -0
  281. package/lib/module/modules/next/data-sync/index.js +11 -0
  282. package/lib/module/modules/next/data-sync/index.js.map +1 -0
  283. package/lib/typescript/commonjs/src/modules/auth/hooks/use-sign-in.d.ts +1 -1
  284. package/lib/typescript/commonjs/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -1
  285. package/lib/typescript/commonjs/src/modules/bt-management/components/bluetooth-device-picker.d.ts +1 -1
  286. package/lib/typescript/commonjs/src/modules/bt-management/components/bluetooth-device-picker.d.ts.map +1 -1
  287. package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
  288. package/lib/typescript/commonjs/src/modules/bt-management/components/device-picker-sheet.d.ts +25 -0
  289. package/lib/typescript/commonjs/src/modules/bt-management/components/device-picker-sheet.d.ts.map +1 -0
  290. package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts +1 -1
  291. package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -1
  292. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-permission.d.ts.map +1 -1
  293. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -1
  294. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +1 -0
  295. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
  296. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +20 -0
  297. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  298. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/define-custom-device.d.ts +2 -1
  299. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/define-custom-device.d.ts.map +1 -1
  300. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts +3 -1
  301. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
  302. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +14 -1
  303. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
  304. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-current-time.d.ts +11 -0
  305. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-current-time.d.ts.map +1 -0
  306. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-device-information.d.ts +2 -1
  307. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-device-information.d.ts.map +1 -1
  308. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +11 -1
  309. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  310. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-notification-readiness.d.ts +15 -0
  311. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-notification-readiness.d.ts.map +1 -0
  312. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-pairing-retry.d.ts +21 -0
  313. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-pairing-retry.d.ts.map +1 -0
  314. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts +2 -0
  315. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  316. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.blood-pressure-status.d.ts.map +1 -1
  317. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.d.ts +11 -0
  318. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.d.ts.map +1 -0
  319. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +5 -2
  320. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -1
  321. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.d.ts +10 -0
  322. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.d.ts.map +1 -0
  323. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.d.ts +7 -0
  324. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.d.ts.map +1 -0
  325. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.d.ts +16 -0
  326. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.d.ts.map +1 -0
  327. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.d.ts +8 -0
  328. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.d.ts.map +1 -0
  329. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose.d.ts.map +1 -1
  330. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +2 -0
  331. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -1
  332. package/lib/typescript/commonjs/src/modules/bt-management/services/record-cursor.d.ts +21 -0
  333. package/lib/typescript/commonjs/src/modules/bt-management/services/record-cursor.d.ts.map +1 -0
  334. package/lib/typescript/commonjs/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -1
  335. package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts +6 -2
  336. package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -1
  337. package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts +3 -0
  338. package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
  339. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts +14 -1
  340. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts.map +1 -1
  341. package/lib/typescript/commonjs/src/modules/bt-management/types/glucose-record-details.d.ts +33 -0
  342. package/lib/typescript/commonjs/src/modules/bt-management/types/glucose-record-details.d.ts.map +1 -0
  343. package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts +2 -0
  344. package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
  345. package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts +6 -0
  346. package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts.map +1 -1
  347. package/lib/typescript/commonjs/src/modules/bt-management/utils/bluetooth-permission-list.d.ts +4 -0
  348. package/lib/typescript/commonjs/src/modules/bt-management/utils/bluetooth-permission-list.d.ts.map +1 -0
  349. package/lib/typescript/commonjs/src/modules/bt-management/utils/device-user.d.ts +6 -0
  350. package/lib/typescript/commonjs/src/modules/bt-management/utils/device-user.d.ts.map +1 -0
  351. package/lib/typescript/commonjs/src/modules/bt-management/utils/kpa-to-mmhg.d.ts +4 -0
  352. package/lib/typescript/commonjs/src/modules/bt-management/utils/kpa-to-mmhg.d.ts.map +1 -0
  353. package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts +5 -4
  354. package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts.map +1 -1
  355. package/lib/typescript/commonjs/src/modules/bt-management/utils/rr-interval.d.ts +4 -0
  356. package/lib/typescript/commonjs/src/modules/bt-management/utils/rr-interval.d.ts.map +1 -0
  357. package/lib/typescript/commonjs/src/modules/bt-management/utils/temperature-type.d.ts +7 -0
  358. package/lib/typescript/commonjs/src/modules/bt-management/utils/temperature-type.d.ts.map +1 -0
  359. package/lib/typescript/commonjs/src/modules/bt-management/utils/wait.d.ts +3 -0
  360. package/lib/typescript/commonjs/src/modules/bt-management/utils/wait.d.ts.map +1 -0
  361. package/lib/typescript/commonjs/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
  362. package/lib/typescript/commonjs/src/modules/next/background-sync/index.d.ts +10 -0
  363. package/lib/typescript/commonjs/src/modules/next/background-sync/index.d.ts.map +1 -0
  364. package/lib/typescript/commonjs/src/modules/next/background-sync/offline-measurement-background-sync.d.ts +22 -0
  365. package/lib/typescript/commonjs/src/modules/next/background-sync/offline-measurement-background-sync.d.ts.map +1 -0
  366. package/lib/typescript/commonjs/src/modules/next/bluetooth/auto-connect.d.ts +10 -0
  367. package/lib/typescript/commonjs/src/modules/next/bluetooth/auto-connect.d.ts.map +1 -0
  368. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-errors.d.ts +4 -0
  369. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-errors.d.ts.map +1 -0
  370. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-link.d.ts +6 -0
  371. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-link.d.ts.map +1 -0
  372. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts +10 -0
  373. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts.map +1 -0
  374. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts +6 -0
  375. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts.map +1 -0
  376. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts +8 -0
  377. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts.map +1 -0
  378. package/lib/typescript/commonjs/src/modules/next/bluetooth/connections.d.ts +25 -0
  379. package/lib/typescript/commonjs/src/modules/next/bluetooth/connections.d.ts.map +1 -0
  380. package/lib/typescript/commonjs/src/modules/next/bluetooth/daily-total-day.d.ts.map +1 -0
  381. package/lib/typescript/commonjs/src/modules/next/bluetooth/devices.d.ts +30 -0
  382. package/lib/typescript/commonjs/src/modules/next/bluetooth/devices.d.ts.map +1 -0
  383. package/lib/typescript/commonjs/src/modules/next/bluetooth/driver.d.ts +27 -20
  384. package/lib/typescript/commonjs/src/modules/next/bluetooth/driver.d.ts.map +1 -1
  385. package/lib/typescript/commonjs/src/modules/next/bluetooth/errors.d.ts +17 -0
  386. package/lib/typescript/commonjs/src/modules/next/bluetooth/errors.d.ts.map +1 -0
  387. package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts +34 -5
  388. package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts.map +1 -1
  389. package/lib/typescript/commonjs/src/modules/next/bluetooth/link.d.ts +14 -5
  390. package/lib/typescript/commonjs/src/modules/next/bluetooth/link.d.ts.map +1 -1
  391. package/lib/typescript/commonjs/src/modules/next/bluetooth/paired.d.ts +18 -0
  392. package/lib/typescript/commonjs/src/modules/next/bluetooth/paired.d.ts.map +1 -0
  393. package/lib/typescript/commonjs/src/modules/next/bluetooth/permissions.d.ts +13 -0
  394. package/lib/typescript/commonjs/src/modules/next/bluetooth/permissions.d.ts.map +1 -0
  395. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/bluetooth-device-picker.d.ts +35 -0
  396. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/bluetooth-device-picker.d.ts.map +1 -0
  397. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/context.d.ts +30 -0
  398. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/context.d.ts.map +1 -0
  399. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/hooks.d.ts +47 -0
  400. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/hooks.d.ts.map +1 -0
  401. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/create-bluetooth-runtime.d.ts +21 -0
  402. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/create-bluetooth-runtime.d.ts.map +1 -0
  403. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/os-permissions.d.ts +5 -0
  404. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/os-permissions.d.ts.map +1 -0
  405. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/ovok-sink.d.ts +6 -0
  406. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/ovok-sink.d.ts.map +1 -0
  407. package/lib/typescript/commonjs/src/modules/next/bluetooth/readings.d.ts +21 -0
  408. package/lib/typescript/commonjs/src/modules/next/bluetooth/readings.d.ts.map +1 -0
  409. package/lib/typescript/commonjs/src/modules/next/bluetooth/result-policy.d.ts +9 -1
  410. package/lib/typescript/commonjs/src/modules/next/bluetooth/result-policy.d.ts.map +1 -1
  411. package/lib/typescript/commonjs/src/modules/next/bluetooth/runtime.d.ts +87 -0
  412. package/lib/typescript/commonjs/src/modules/next/bluetooth/runtime.d.ts.map +1 -0
  413. package/lib/typescript/commonjs/src/modules/next/bluetooth/scan-loop.d.ts +23 -0
  414. package/lib/typescript/commonjs/src/modules/next/bluetooth/scan-loop.d.ts.map +1 -0
  415. package/lib/typescript/commonjs/src/modules/next/bluetooth/sig-profiles.d.ts.map +1 -1
  416. package/lib/typescript/commonjs/src/modules/next/bluetooth/sink.d.ts +20 -0
  417. package/lib/typescript/commonjs/src/modules/next/bluetooth/sink.d.ts.map +1 -0
  418. package/lib/typescript/commonjs/src/modules/next/bluetooth/snapshot.d.ts +72 -0
  419. package/lib/typescript/commonjs/src/modules/next/bluetooth/snapshot.d.ts.map +1 -0
  420. package/lib/typescript/commonjs/src/modules/next/bluetooth/stable-hash.d.ts +6 -0
  421. package/lib/typescript/commonjs/src/modules/next/bluetooth/stable-hash.d.ts.map +1 -0
  422. package/lib/typescript/commonjs/src/modules/next/bluetooth/store.d.ts +16 -0
  423. package/lib/typescript/commonjs/src/modules/next/bluetooth/store.d.ts.map +1 -0
  424. package/lib/typescript/commonjs/src/modules/next/bluetooth/transport.d.ts +31 -0
  425. package/lib/typescript/commonjs/src/modules/next/bluetooth/transport.d.ts.map +1 -0
  426. package/lib/typescript/commonjs/src/modules/next/data-sync/index.d.ts +9 -0
  427. package/lib/typescript/commonjs/src/modules/next/data-sync/index.d.ts.map +1 -0
  428. package/lib/typescript/module/src/modules/auth/hooks/use-sign-in.d.ts +1 -1
  429. package/lib/typescript/module/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -1
  430. package/lib/typescript/module/src/modules/bt-management/components/bluetooth-device-picker.d.ts +1 -1
  431. package/lib/typescript/module/src/modules/bt-management/components/bluetooth-device-picker.d.ts.map +1 -1
  432. package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
  433. package/lib/typescript/module/src/modules/bt-management/components/device-picker-sheet.d.ts +25 -0
  434. package/lib/typescript/module/src/modules/bt-management/components/device-picker-sheet.d.ts.map +1 -0
  435. package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts +1 -1
  436. package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -1
  437. package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-permission.d.ts.map +1 -1
  438. package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -1
  439. package/lib/typescript/module/src/modules/bt-management/index.d.ts +1 -0
  440. package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
  441. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +20 -0
  442. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  443. package/lib/typescript/module/src/modules/bt-management/services/custom/define-custom-device.d.ts +2 -1
  444. package/lib/typescript/module/src/modules/bt-management/services/custom/define-custom-device.d.ts.map +1 -1
  445. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts +3 -1
  446. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
  447. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +14 -1
  448. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
  449. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-current-time.d.ts +11 -0
  450. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-current-time.d.ts.map +1 -0
  451. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-device-information.d.ts +2 -1
  452. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-device-information.d.ts.map +1 -1
  453. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +11 -1
  454. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  455. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-notification-readiness.d.ts +15 -0
  456. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-notification-readiness.d.ts.map +1 -0
  457. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-pairing-retry.d.ts +21 -0
  458. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-pairing-retry.d.ts.map +1 -0
  459. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts +2 -0
  460. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  461. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.blood-pressure-status.d.ts.map +1 -1
  462. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.d.ts +11 -0
  463. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.d.ts.map +1 -0
  464. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +5 -2
  465. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -1
  466. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.d.ts +10 -0
  467. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.d.ts.map +1 -0
  468. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.d.ts +7 -0
  469. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.d.ts.map +1 -0
  470. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.d.ts +16 -0
  471. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.d.ts.map +1 -0
  472. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.d.ts +8 -0
  473. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.d.ts.map +1 -0
  474. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose.d.ts.map +1 -1
  475. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +2 -0
  476. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -1
  477. package/lib/typescript/module/src/modules/bt-management/services/record-cursor.d.ts +21 -0
  478. package/lib/typescript/module/src/modules/bt-management/services/record-cursor.d.ts.map +1 -0
  479. package/lib/typescript/module/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -1
  480. package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts +6 -2
  481. package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -1
  482. package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts +3 -0
  483. package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
  484. package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts +14 -1
  485. package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts.map +1 -1
  486. package/lib/typescript/module/src/modules/bt-management/types/glucose-record-details.d.ts +33 -0
  487. package/lib/typescript/module/src/modules/bt-management/types/glucose-record-details.d.ts.map +1 -0
  488. package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts +2 -0
  489. package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
  490. package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts +6 -0
  491. package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts.map +1 -1
  492. package/lib/typescript/module/src/modules/bt-management/utils/bluetooth-permission-list.d.ts +4 -0
  493. package/lib/typescript/module/src/modules/bt-management/utils/bluetooth-permission-list.d.ts.map +1 -0
  494. package/lib/typescript/module/src/modules/bt-management/utils/device-user.d.ts +6 -0
  495. package/lib/typescript/module/src/modules/bt-management/utils/device-user.d.ts.map +1 -0
  496. package/lib/typescript/module/src/modules/bt-management/utils/kpa-to-mmhg.d.ts +4 -0
  497. package/lib/typescript/module/src/modules/bt-management/utils/kpa-to-mmhg.d.ts.map +1 -0
  498. package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts +5 -4
  499. package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts.map +1 -1
  500. package/lib/typescript/module/src/modules/bt-management/utils/rr-interval.d.ts +4 -0
  501. package/lib/typescript/module/src/modules/bt-management/utils/rr-interval.d.ts.map +1 -0
  502. package/lib/typescript/module/src/modules/bt-management/utils/temperature-type.d.ts +7 -0
  503. package/lib/typescript/module/src/modules/bt-management/utils/temperature-type.d.ts.map +1 -0
  504. package/lib/typescript/module/src/modules/bt-management/utils/wait.d.ts +3 -0
  505. package/lib/typescript/module/src/modules/bt-management/utils/wait.d.ts.map +1 -0
  506. package/lib/typescript/module/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
  507. package/lib/typescript/module/src/modules/next/background-sync/index.d.ts +10 -0
  508. package/lib/typescript/module/src/modules/next/background-sync/index.d.ts.map +1 -0
  509. package/lib/typescript/module/src/modules/next/background-sync/offline-measurement-background-sync.d.ts +22 -0
  510. package/lib/typescript/module/src/modules/next/background-sync/offline-measurement-background-sync.d.ts.map +1 -0
  511. package/lib/typescript/module/src/modules/next/bluetooth/auto-connect.d.ts +10 -0
  512. package/lib/typescript/module/src/modules/next/bluetooth/auto-connect.d.ts.map +1 -0
  513. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-errors.d.ts +4 -0
  514. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-errors.d.ts.map +1 -0
  515. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-link.d.ts +6 -0
  516. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-link.d.ts.map +1 -0
  517. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts +10 -0
  518. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts.map +1 -0
  519. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts +6 -0
  520. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts.map +1 -0
  521. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts +8 -0
  522. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts.map +1 -0
  523. package/lib/typescript/module/src/modules/next/bluetooth/connections.d.ts +25 -0
  524. package/lib/typescript/module/src/modules/next/bluetooth/connections.d.ts.map +1 -0
  525. package/lib/typescript/module/src/modules/next/bluetooth/daily-total-day.d.ts.map +1 -0
  526. package/lib/typescript/module/src/modules/next/bluetooth/devices.d.ts +30 -0
  527. package/lib/typescript/module/src/modules/next/bluetooth/devices.d.ts.map +1 -0
  528. package/lib/typescript/module/src/modules/next/bluetooth/driver.d.ts +27 -20
  529. package/lib/typescript/module/src/modules/next/bluetooth/driver.d.ts.map +1 -1
  530. package/lib/typescript/module/src/modules/next/bluetooth/errors.d.ts +17 -0
  531. package/lib/typescript/module/src/modules/next/bluetooth/errors.d.ts.map +1 -0
  532. package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts +34 -5
  533. package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts.map +1 -1
  534. package/lib/typescript/module/src/modules/next/bluetooth/link.d.ts +14 -5
  535. package/lib/typescript/module/src/modules/next/bluetooth/link.d.ts.map +1 -1
  536. package/lib/typescript/module/src/modules/next/bluetooth/paired.d.ts +18 -0
  537. package/lib/typescript/module/src/modules/next/bluetooth/paired.d.ts.map +1 -0
  538. package/lib/typescript/module/src/modules/next/bluetooth/permissions.d.ts +13 -0
  539. package/lib/typescript/module/src/modules/next/bluetooth/permissions.d.ts.map +1 -0
  540. package/lib/typescript/module/src/modules/next/bluetooth/react/bluetooth-device-picker.d.ts +35 -0
  541. package/lib/typescript/module/src/modules/next/bluetooth/react/bluetooth-device-picker.d.ts.map +1 -0
  542. package/lib/typescript/module/src/modules/next/bluetooth/react/context.d.ts +30 -0
  543. package/lib/typescript/module/src/modules/next/bluetooth/react/context.d.ts.map +1 -0
  544. package/lib/typescript/module/src/modules/next/bluetooth/react/hooks.d.ts +47 -0
  545. package/lib/typescript/module/src/modules/next/bluetooth/react/hooks.d.ts.map +1 -0
  546. package/lib/typescript/module/src/modules/next/bluetooth/react-native/create-bluetooth-runtime.d.ts +21 -0
  547. package/lib/typescript/module/src/modules/next/bluetooth/react-native/create-bluetooth-runtime.d.ts.map +1 -0
  548. package/lib/typescript/module/src/modules/next/bluetooth/react-native/os-permissions.d.ts +5 -0
  549. package/lib/typescript/module/src/modules/next/bluetooth/react-native/os-permissions.d.ts.map +1 -0
  550. package/lib/typescript/module/src/modules/next/bluetooth/react-native/ovok-sink.d.ts +6 -0
  551. package/lib/typescript/module/src/modules/next/bluetooth/react-native/ovok-sink.d.ts.map +1 -0
  552. package/lib/typescript/module/src/modules/next/bluetooth/readings.d.ts +21 -0
  553. package/lib/typescript/module/src/modules/next/bluetooth/readings.d.ts.map +1 -0
  554. package/lib/typescript/module/src/modules/next/bluetooth/result-policy.d.ts +9 -1
  555. package/lib/typescript/module/src/modules/next/bluetooth/result-policy.d.ts.map +1 -1
  556. package/lib/typescript/module/src/modules/next/bluetooth/runtime.d.ts +87 -0
  557. package/lib/typescript/module/src/modules/next/bluetooth/runtime.d.ts.map +1 -0
  558. package/lib/typescript/module/src/modules/next/bluetooth/scan-loop.d.ts +23 -0
  559. package/lib/typescript/module/src/modules/next/bluetooth/scan-loop.d.ts.map +1 -0
  560. package/lib/typescript/module/src/modules/next/bluetooth/sig-profiles.d.ts.map +1 -1
  561. package/lib/typescript/module/src/modules/next/bluetooth/sink.d.ts +20 -0
  562. package/lib/typescript/module/src/modules/next/bluetooth/sink.d.ts.map +1 -0
  563. package/lib/typescript/module/src/modules/next/bluetooth/snapshot.d.ts +72 -0
  564. package/lib/typescript/module/src/modules/next/bluetooth/snapshot.d.ts.map +1 -0
  565. package/lib/typescript/module/src/modules/next/bluetooth/stable-hash.d.ts +6 -0
  566. package/lib/typescript/module/src/modules/next/bluetooth/stable-hash.d.ts.map +1 -0
  567. package/lib/typescript/module/src/modules/next/bluetooth/store.d.ts +16 -0
  568. package/lib/typescript/module/src/modules/next/bluetooth/store.d.ts.map +1 -0
  569. package/lib/typescript/module/src/modules/next/bluetooth/transport.d.ts +31 -0
  570. package/lib/typescript/module/src/modules/next/bluetooth/transport.d.ts.map +1 -0
  571. package/lib/typescript/module/src/modules/next/data-sync/index.d.ts +9 -0
  572. package/lib/typescript/module/src/modules/next/data-sync/index.d.ts.map +1 -0
  573. package/package.json +12 -2
  574. package/lib/commonjs/modules/bt-management/utils/daily-total-day.js.map +0 -1
  575. package/lib/commonjs/modules/next/bluetooth/drivers.js +0 -20
  576. package/lib/commonjs/modules/next/bluetooth/drivers.js.map +0 -1
  577. package/lib/commonjs/modules/next/bluetooth/legacy-driver.js +0 -55
  578. package/lib/commonjs/modules/next/bluetooth/legacy-driver.js.map +0 -1
  579. package/lib/module/modules/bt-management/utils/daily-total-day.js.map +0 -1
  580. package/lib/module/modules/next/bluetooth/drivers.js +0 -17
  581. package/lib/module/modules/next/bluetooth/drivers.js.map +0 -1
  582. package/lib/module/modules/next/bluetooth/legacy-driver.js +0 -51
  583. package/lib/module/modules/next/bluetooth/legacy-driver.js.map +0 -1
  584. package/lib/typescript/commonjs/src/modules/bt-management/utils/daily-total-day.d.ts.map +0 -1
  585. package/lib/typescript/commonjs/src/modules/next/bluetooth/drivers.d.ts +0 -7
  586. package/lib/typescript/commonjs/src/modules/next/bluetooth/drivers.d.ts.map +0 -1
  587. package/lib/typescript/commonjs/src/modules/next/bluetooth/legacy-driver.d.ts +0 -8
  588. package/lib/typescript/commonjs/src/modules/next/bluetooth/legacy-driver.d.ts.map +0 -1
  589. package/lib/typescript/module/src/modules/bt-management/utils/daily-total-day.d.ts.map +0 -1
  590. package/lib/typescript/module/src/modules/next/bluetooth/drivers.d.ts +0 -7
  591. package/lib/typescript/module/src/modules/next/bluetooth/drivers.d.ts.map +0 -1
  592. package/lib/typescript/module/src/modules/next/bluetooth/legacy-driver.d.ts +0 -8
  593. package/lib/typescript/module/src/modules/next/bluetooth/legacy-driver.d.ts.map +0 -1
  594. /package/lib/commonjs/modules/{bt-management/utils → next/bluetooth}/daily-total-day.js +0 -0
  595. /package/lib/module/modules/{bt-management/utils → next/bluetooth}/daily-total-day.js +0 -0
  596. /package/lib/typescript/commonjs/src/modules/{bt-management/utils → next/bluetooth}/daily-total-day.d.ts +0 -0
  597. /package/lib/typescript/module/src/modules/{bt-management/utils → next/bluetooth}/daily-total-day.d.ts +0 -0
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useScanning = exports.usePairedDevices = exports.useNearbyDevices = exports.useNearbyDevice = exports.useMeasurements = exports.useBluetoothState = exports.useBluetoothPermission = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _context = require("./context.js");
10
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
11
+ /** One slice of the runtime snapshot, re-rendering only when that slice changes. */
12
+ const useSnapshot = select => {
13
+ const runtime = (0, _context.useBluetooth)();
14
+ const read = () => select(runtime.getSnapshot());
15
+ return React.useSyncExternalStore(runtime.subscribe, read, read);
16
+ };
17
+
18
+ /**
19
+ * The Bluetooth adapter state.
20
+ *
21
+ * @group Hooks
22
+ */
23
+ const useBluetoothState = () => useSnapshot(snapshot => snapshot.adapter);
24
+
25
+ /**
26
+ * The Bluetooth permission, re-checked whenever the app returns to the foreground; `unknown` until first checked.
27
+ *
28
+ * @group Hooks
29
+ */
30
+ exports.useBluetoothState = useBluetoothState;
31
+ const useBluetoothPermission = () => {
32
+ const runtime = (0, _context.useBluetooth)();
33
+ React.useEffect(() => {
34
+ const subscription = _reactNative.AppState.addEventListener("change", state => {
35
+ if (state === "active") {
36
+ runtime.checkPermission().catch(() => undefined);
37
+ }
38
+ });
39
+ return () => subscription.remove();
40
+ }, [runtime]);
41
+ return useSnapshot(snapshot => snapshot.permission);
42
+ };
43
+
44
+ /**
45
+ * Whether a scan is requested.
46
+ *
47
+ * @group Hooks
48
+ */
49
+ exports.useBluetoothPermission = useBluetoothPermission;
50
+ const useScanning = () => useSnapshot(snapshot => snapshot.scanning);
51
+
52
+ /**
53
+ * The supported devices the scan found, each with its connection state.
54
+ *
55
+ * @group Hooks
56
+ */
57
+ exports.useScanning = useScanning;
58
+ const useNearbyDevices = () => useSnapshot(snapshot => snapshot.devices);
59
+
60
+ /**
61
+ * One found device, or `null` until the scan finds it.
62
+ *
63
+ * @group Hooks
64
+ */
65
+ exports.useNearbyDevices = useNearbyDevices;
66
+ const useNearbyDevice = deviceId => useSnapshot(snapshot => snapshot.devices.find(({
67
+ id
68
+ }) => id === deviceId) ?? null);
69
+
70
+ /**
71
+ * IDs of the paired devices.
72
+ *
73
+ * @group Hooks
74
+ */
75
+ exports.useNearbyDevice = useNearbyDevice;
76
+ const usePairedDevices = () => useSnapshot(snapshot => snapshot.paired);
77
+
78
+ /**
79
+ * The recent readings, oldest first, each with its save state.
80
+ *
81
+ * @group Hooks
82
+ */
83
+ exports.usePairedDevices = usePairedDevices;
84
+ const useMeasurements = () => useSnapshot(snapshot => snapshot.readings);
85
+ exports.useMeasurements = useMeasurements;
86
+ //# sourceMappingURL=hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_context","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","useSnapshot","select","runtime","useBluetooth","read","getSnapshot","useSyncExternalStore","subscribe","useBluetoothState","snapshot","adapter","exports","useBluetoothPermission","useEffect","subscription","AppState","addEventListener","state","checkPermission","catch","undefined","remove","permission","useScanning","scanning","useNearbyDevices","devices","useNearbyDevice","deviceId","find","id","usePairedDevices","paired","useMeasurements","readings"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/react/hooks.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AAAyC,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG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AQ,CAAC;AAACvB,OAAA,CAAAsB,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createBluetoothRuntime = void 0;
7
+ var _bleScanner = require("../ble-plx/ble-scanner.js");
8
+ var _runtime = require("../runtime.js");
9
+ var _osPermissions = require("./os-permissions.js");
10
+ var _ovokSink = require("./ovok-sink.js");
11
+ /** What `createBluetoothRuntime` needs. */
12
+
13
+ /** A `BluetoothRuntime` wired for React Native: BLE through `bleManager`, OS permissions, saving through `client`. */
14
+ const createBluetoothRuntime = ({
15
+ client,
16
+ bleManager,
17
+ devices,
18
+ resultPolicy
19
+ }) => new _runtime.BluetoothRuntime({
20
+ scanner: (0, _bleScanner.bleManagerScanner)(bleManager),
21
+ permissions: (0, _osPermissions.osBluetoothPermissions)(),
22
+ sink: (0, _ovokSink.ovokReadingSink)(client),
23
+ devices,
24
+ resultPolicy,
25
+ pairedStorage: client.storage
26
+ });
27
+ exports.createBluetoothRuntime = createBluetoothRuntime;
28
+ //# sourceMappingURL=create-bluetooth-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_bleScanner","require","_runtime","_osPermissions","_ovokSink","createBluetoothRuntime","client","bleManager","devices","resultPolicy","BluetoothRuntime","scanner","bleManagerScanner","permissions","osBluetoothPermissions","sink","ovokReadingSink","pairedStorage","storage","exports"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/react-native/create-bluetooth-runtime.ts"],"mappings":";;;;;;AAIA,IAAAA,WAAA,GAAAC,OAAA;AAGA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAEA;;AAgBA;AACA,MAAMI,sBAAsB,GAAGA,CAAC;EAC9BC,MAAM;EACNC,UAAU;EACVC,OAAO;EACPC;AAC6B,CAAC,KAC9B,IAAIC,yBAAgB,CAAC;EACnBC,OAAO,EAAE,IAAAC,6BAAiB,EAACL,UAAU,CAAC;EACtCM,WAAW,EAAE,IAAAC,qCAAsB,EAAC,CAAC;EACrCC,IAAI,EAAE,IAAAC,yBAAe,EAACV,MAAM,CAAC;EAC7BE,OAAO;EACPC,YAAY;EACZQ,aAAa,EAAEX,MAAM,CAACY;AACxB,CAAC,CAAC;AAACC,OAAA,CAAAd,sBAAA,GAAAA,sBAAA","ignoreList":[]}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.osBluetoothPermissions = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _reactNativePermissions = require("react-native-permissions");
9
+ var _bluetoothPermissionList = require("../../../bt-management/utils/bluetooth-permission-list.js");
10
+ const GRANTED = new Set(["granted", "limited"]);
11
+ const permissionOf = (permissions, results) => {
12
+ const statuses = permissions.map(permission => results[permission]);
13
+ if (statuses.length > 0 && statuses.every(status => status !== undefined && GRANTED.has(status))) {
14
+ return "granted";
15
+ }
16
+ return statuses.includes("blocked") ? "blocked" : "denied";
17
+ };
18
+
19
+ /** The platform's Bluetooth permissions through `react-native-permissions`. */
20
+ const osBluetoothPermissions = () => ({
21
+ check: async () => {
22
+ const permissions = (0, _bluetoothPermissionList.bluetoothPermissionList)();
23
+ return permissionOf(permissions, await (0, _reactNativePermissions.checkMultiple)(permissions));
24
+ },
25
+ request: async () => {
26
+ const permissions = (0, _bluetoothPermissionList.bluetoothPermissionList)();
27
+ return permissionOf(permissions, await (0, _reactNativePermissions.requestMultiple)(permissions));
28
+ },
29
+ openSettings: () => _reactNative.Linking.openSettings()
30
+ });
31
+ exports.osBluetoothPermissions = osBluetoothPermissions;
32
+ //# sourceMappingURL=os-permissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_reactNativePermissions","_bluetoothPermissionList","GRANTED","Set","permissionOf","permissions","results","statuses","map","permission","length","every","status","undefined","has","includes","osBluetoothPermissions","check","bluetoothPermissionList","checkMultiple","request","requestMultiple","openSettings","Linking","exports"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/react-native/os-permissions.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AAEA,IAAAE,wBAAA,GAAAF,OAAA;AAGA,MAAMG,OAAsC,GAAG,IAAIC,GAAG,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AAE9E,MAAMC,YAAY,GAAGA,CACnBC,WAAkC,EAClCC,OAAsD,KAC9B;EACxB,MAAMC,QAAQ,GAAGF,WAAW,CAACG,GAAG,CAAEC,UAAU,IAAKH,OAAO,CAACG,UAAU,CAAC,CAAC;EAErE,IAAIF,QAAQ,CAACG,MAAM,GAAG,CAAC,IAAIH,QAAQ,CAACI,KAAK,CAAEC,MAAM,IAAKA,MAAM,KAAKC,SAAS,IAAIX,OAAO,CAACY,GAAG,CAACF,MAAM,CAAC,CAAC,EAAE;IAClG,OAAO,SAAS;EAClB;EAEA,OAAOL,QAAQ,CAACQ,QAAQ,CAAC,SAAS,CAAC,GAAG,SAAS,GAAG,QAAQ;AAC5D,CAAC;;AAED;AACA,MAAMC,sBAAsB,GAAGA,CAAA,MAA6B;EAC1DC,KAAK,EAAE,MAAAA,CAAA,KAAY;IACjB,MAAMZ,WAAW,GAAG,IAAAa,gDAAuB,EAAC,CAAC;IAE7C,OAAOd,YAAY,CAACC,WAAW,EAAE,MAAM,IAAAc,qCAAa,EAACd,WAAW,CAAC,CAAC;EACpE,CAAC;EACDe,OAAO,EAAE,MAAAA,CAAA,KAAY;IACnB,MAAMf,WAAW,GAAG,IAAAa,gDAAuB,EAAC,CAAC;IAE7C,OAAOd,YAAY,CAACC,WAAW,EAAE,MAAM,IAAAgB,uCAAe,EAAChB,WAAW,CAAC,CAAC;EACtE,CAAC;EACDiB,YAAY,EAAEA,CAAA,KAAMC,oBAAO,CAACD,YAAY,CAAC;AAC3C,CAAC,CAAC;AAACE,OAAA,CAAAR,sBAAA,GAAAA,sBAAA","ignoreList":[]}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ovokReadingSink = void 0;
7
+ /** The time the device took the reading, when it reported one. */
8
+ const recordedAtOf = measurement => {
9
+ const {
10
+ recordedAt
11
+ } = measurement;
12
+ return recordedAt instanceof Date && !Number.isNaN(recordedAt.getTime()) ? recordedAt : undefined;
13
+ };
14
+
15
+ /** Saves readings for the signed-in account through the `Ovok` measurements API. */
16
+ const ovokReadingSink = client => ({
17
+ save: async ({
18
+ id,
19
+ device,
20
+ measurement
21
+ }) => {
22
+ const result = await client.measurements.save({
23
+ measurement,
24
+ sourceId: id,
25
+ effectiveDateTime: recordedAtOf(measurement),
26
+ device: {
27
+ id: device.id,
28
+ name: device.key,
29
+ localName: device.name,
30
+ manufacturerData: "",
31
+ manufacturerName: device.information?.manufacturerName,
32
+ model: device.information?.model,
33
+ sn: device.information?.serialNumber ?? ""
34
+ }
35
+ });
36
+ return result.status === "saved" ? {
37
+ status: "saved"
38
+ } : result;
39
+ },
40
+ flushQueued: async () => Object.keys((await client.measurements.offlineQueue.flush()).responses)
41
+ });
42
+ exports.ovokReadingSink = ovokReadingSink;
43
+ //# sourceMappingURL=ovok-sink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["recordedAtOf","measurement","recordedAt","Date","Number","isNaN","getTime","undefined","ovokReadingSink","client","save","id","device","result","measurements","sourceId","effectiveDateTime","name","key","localName","manufacturerData","manufacturerName","information","model","sn","serialNumber","status","flushQueued","Object","keys","offlineQueue","flush","responses","exports"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/react-native/ovok-sink.ts"],"mappings":";;;;;;AAIA;AACA,MAAMA,YAAY,GAAIC,WAAmB,IAAuB;EAC9D,MAAM;IAAEC;EAAW,CAAC,GAAGD,WAAuC;EAE9D,OAAOC,UAAU,YAAYC,IAAI,IAAI,CAACC,MAAM,CAACC,KAAK,CAACH,UAAU,CAACI,OAAO,CAAC,CAAC,CAAC,GAAGJ,UAAU,GAAGK,SAAS;AACnG,CAAC;;AAED;AACA,MAAMC,eAAe,GAAIC,MAAY,KAAmB;EACtDC,IAAI,EAAE,MAAAA,CAAO;IAAEC,EAAE;IAAEC,MAAM;IAAEX;EAAY,CAAC,KAAK;IAC3C,MAAMY,MAAM,GAAG,MAAMJ,MAAM,CAACK,YAAY,CAACJ,IAAI,CAAC;MAC5CT,WAAW;MACXc,QAAQ,EAAEJ,EAAE;MACZK,iBAAiB,EAAEhB,YAAY,CAACC,WAAW,CAAC;MAC5CW,MAAM,EAAE;QACND,EAAE,EAAEC,MAAM,CAACD,EAAE;QACbM,IAAI,EAAEL,MAAM,CAACM,GAAG;QAChBC,SAAS,EAAEP,MAAM,CAACK,IAAI;QACtBG,gBAAgB,EAAE,EAAE;QACpBC,gBAAgB,EAAET,MAAM,CAACU,WAAW,EAAED,gBAAgB;QACtDE,KAAK,EAAEX,MAAM,CAACU,WAAW,EAAEC,KAAK;QAChCC,EAAE,EAAEZ,MAAM,CAACU,WAAW,EAAEG,YAAY,IAAI;MAC1C;IACF,CAAC,CAAC;IAEF,OAAOZ,MAAM,CAACa,MAAM,KAAK,OAAO,GAAG;MAAEA,MAAM,EAAE;IAAQ,CAAC,GAAGb,MAAM;EACjE,CAAC;EACDc,WAAW,EAAE,MAAAA,CAAA,KAAYC,MAAM,CAACC,IAAI,CAAC,CAAC,MAAMpB,MAAM,CAACK,YAAY,CAACgB,YAAY,CAACC,KAAK,CAAC,CAAC,EAAEC,SAAS;AACjG,CAAC,CAAC;AAACC,OAAA,CAAAzB,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ReadingLog = void 0;
7
+ var _errors = require("./errors.js");
8
+ const KEPT_READINGS = 100;
9
+
10
+ /** How many recent reading IDs a resend is checked against. */
11
+ const RECOGNISED_READINGS = 1_000;
12
+ const saveFailed = error => new _errors.BluetoothError("save-failed", error instanceof Error ? error.message : String(error), error);
13
+
14
+ /** Keeps the recent readings, each resend once, and saves every new one through the sink. */
15
+ class ReadingLog {
16
+ recent = new Set();
17
+ sequence = 0;
18
+ constructor(store, sink) {
19
+ this.store = store;
20
+ this.sink = sink;
21
+ }
22
+
23
+ /** `id` is `null` for a reading that cannot be recognised when resent. */
24
+ receive(device, id, measurement) {
25
+ if (id !== null && !this.remember(id)) {
26
+ return;
27
+ }
28
+ const receivedAt = new Date();
29
+ const reading = {
30
+ id: id ?? `${device.id}:${receivedAt.getTime()}:${this.sequence += 1}`,
31
+ device: {
32
+ id: device.id,
33
+ key: device.key,
34
+ name: device.name,
35
+ information: device.information
36
+ },
37
+ measurement,
38
+ receivedAt,
39
+ save: {
40
+ status: "saving"
41
+ }
42
+ };
43
+ this.store.set({
44
+ readings: [...this.store.get().readings, reading].slice(-KEPT_READINGS)
45
+ });
46
+ void this.save(reading);
47
+ }
48
+
49
+ /** Saves the readings whose save failed again and flushes the sink's offline queue. */
50
+ async retrySaves() {
51
+ const failed = this.store.get().readings.filter(({
52
+ save
53
+ }) => save.status === "failed");
54
+ this.store.updateReadings(reading => failed.includes(reading) ? {
55
+ ...reading,
56
+ save: {
57
+ status: "saving"
58
+ }
59
+ } : reading);
60
+ await Promise.all(failed.map(reading => this.save(reading)));
61
+ const flushed = new Set(await this.sink.flushQueued());
62
+ this.store.updateReadings(reading => reading.save.status === "queued" && flushed.has(reading.save.queueId) ? {
63
+ ...reading,
64
+ save: {
65
+ status: "saved"
66
+ }
67
+ } : reading);
68
+ }
69
+
70
+ /** Records `id`; false when it is a resend of a recent reading. */
71
+ remember(id) {
72
+ if (this.recent.has(id)) {
73
+ return false;
74
+ }
75
+ this.recent.add(id);
76
+ if (this.recent.size > RECOGNISED_READINGS) {
77
+ this.recent.delete(this.recent.values().next().value);
78
+ }
79
+ return true;
80
+ }
81
+ async save(reading) {
82
+ const save = await this.sink.save(reading).then(result => result, error => ({
83
+ status: "failed",
84
+ error: saveFailed(error)
85
+ }));
86
+ this.store.updateReadings(current => current.id === reading.id ? {
87
+ ...current,
88
+ save
89
+ } : current);
90
+ }
91
+ }
92
+ exports.ReadingLog = ReadingLog;
93
+ //# sourceMappingURL=readings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_errors","require","KEPT_READINGS","RECOGNISED_READINGS","saveFailed","error","BluetoothError","Error","message","String","ReadingLog","recent","Set","sequence","constructor","store","sink","receive","device","id","measurement","remember","receivedAt","Date","reading","getTime","key","name","information","save","status","set","readings","get","slice","retrySaves","failed","filter","updateReadings","includes","Promise","all","map","flushed","flushQueued","has","queueId","add","size","delete","values","next","value","then","result","current","exports"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/readings.ts"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AAKA,MAAMC,aAAa,GAAG,GAAG;;AAEzB;AACA,MAAMC,mBAAmB,GAAG,KAAK;AAEjC,MAAMC,UAAU,GAAIC,KAAc,IAChC,IAAIC,sBAAc,CAAC,aAAa,EAAED,KAAK,YAAYE,KAAK,GAAGF,KAAK,CAACG,OAAO,GAAGC,MAAM,CAACJ,KAAK,CAAC,EAAEA,KAAK,CAAC;;AAElG;AACA,MAAMK,UAAU,CAAC;EACEC,MAAM,GAAG,IAAIC,GAAG,CAAS,CAAC;EACnCC,QAAQ,GAAG,CAAC;EAEbC,WAAWA,CAAkBC,KAAoB,EAAmBC,IAAiB,EAAE;IAAA,KAA1DD,KAAoB,GAApBA,KAAoB;IAAA,KAAmBC,IAAiB,GAAjBA,IAAiB;EAAG;;EAE/F;EACOC,OAAOA,CAACC,MAAoB,EAAEC,EAAiB,EAAEC,WAAwB,EAAQ;IACtF,IAAID,EAAE,KAAK,IAAI,IAAI,CAAC,IAAI,CAACE,QAAQ,CAACF,EAAE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CAACL,EAAE,GAAG;MAAE,GAAGoC,OAAO;MAAE1B;IAAK,CAAC,GAAG0B,OAAQ,CAAC;EACtG;AACF;AAACC,OAAA,CAAA9C,UAAA,GAAAA,UAAA","ignoreList":[]}
@@ -3,13 +3,17 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.firstReadingPerKind = exports.everyReading = exports.dailyTotalsOnly = void 0;
6
+ exports.firstReadingPerKind = exports.everyReading = exports.dailyTotalsOnly = exports.acceptedMemorySlots = void 0;
7
7
  exports.keepReadings = keepReadings;
8
8
  exports.policyByKind = void 0;
9
- var _dailyTotalDay = require("../../bt-management/utils/daily-total-day.js");
9
+ var _deviceUser = require("../../bt-management/utils/device-user.js");
10
+ var _dailyTotalDay = require("./daily-total-day.js");
10
11
  /** Makes, for each connection, the test of which readings to keep. */
11
12
 
13
+ /** Keeps every reading. */
12
14
  const everyReading = () => () => true;
15
+
16
+ /** Keeps the first reading of each measurement type per connection. */
13
17
  exports.everyReading = everyReading;
14
18
  const firstReadingPerKind = () => {
15
19
  const reported = new Set();
@@ -41,7 +45,16 @@ const dailyTotalsOnly = () => {
41
45
  return true;
42
46
  };
43
47
  };
48
+
49
+ /**
50
+ * Keeps the readings of the device users in `slots` (a multi-user device reports its user as `memorySlot`, starting at
51
+ * 1), and drops the others. A reading that names no device user is kept.
52
+ */
44
53
  exports.dailyTotalsOnly = dailyTotalsOnly;
54
+ const acceptedMemorySlots = slots => () => reading => (0, _deviceUser.isFromAcceptedMemorySlot)(reading, slots);
55
+
56
+ /** Applies a policy per measurement type, and `fallback` to the other types. */
57
+ exports.acceptedMemorySlots = acceptedMemorySlots;
45
58
  const policyByKind = (policies, fallback = everyReading) => () => {
46
59
  const tests = new Map();
47
60
  const fallbackTest = fallback();
@@ -1 +1 @@
1
- {"version":3,"names":["_dailyTotalDay","require","everyReading","exports","firstReadingPerKind","reported","Set","measurementTypeKey","has","add","dailyTotalsOnly","reading","day","dailyTotalDay","Date","now","undefined","key","policyByKind","policies","fallback","tests","Map","fallbackTest","policy","test","get","set","keepReadings","events","keep","event","kind"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/result-policy.ts"],"mappings":";;;;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAIA;;AAGA,MAAMC,YAA0B,GAAGA,CAAA,KAAM,MAAM,IAAI;AAACC,OAAA,CAAAD,YAAA,GAAAA,YAAA;AAEpD,MAAME,mBAAiC,GAAGA,CAAA,KAAM;EAC9C,MAAMC,QAAQ,GAAG,IAAIC,GAAG,CAAqB,CAAC;EAE9C,OAAO,CAAC;IAAEC;EAAmB,CAAC,KAAK;IACjC,IAAIF,QAAQ,CAACG,GAAG,CAACD,kBAAkB,CAAC,EAAE;MACpC,OAAO,KAAK;IACd;IAEAF,QAAQ,CAACI,GAAG,CAACF,kBAAkB,CAAC;IAEhC,OAAO,IAAI;EACb,CAAC;AACH,CAAC;;AAED;AAAAJ,OAAA,CAAAC,mBAAA,GAAAA,mBAAA;AACA,MAAMM,eAA6B,GAAGA,CAAA,KAAM;EAC1C,MAAML,QAAQ,GAAG,IAAIC,GAAG,CAAS,CAAC;EAElC,OAAQK,OAAO,IAAK;IAClB,MAAMC,GAAG,GAAG,IAAAC,4BAAa,EAACF,OAAO,EAAEG,IAAI,CAACC,GAAG,CAAC,CAAC,CAAC;IAE9C,IAAIH,GAAG,KAAKI,SAAS,EAAE;MACrB,OAAO,IAAI;IACb;IAEA,MAAMC,GAAG,GAAG,GAAGN,OAAO,CAACJ,kBAAkB,IAAIK,GAAG,EAAE;IAElD,IAAIA,GAAG,KAAK,QAAQ,IAAIP,QAAQ,CAACG,GAAG,CAACS,GAAG,CAAC,EAAE;MACzC,OAAO,KAAK;IACd;IAEAZ,QAAQ,CAACI,GAAG,CAACQ,GAAG,CAAC;IAEjB,OAAO,IAAI;EACb,CAAC;AACH,CAAC;AAACd,OAAA,CAAAO,eAAA,GAAAA,eAAA;AAEF,MAAMQ,YAAY,GAAGA,CACnBC,QAA2D,EAC3DC,QAAsB,GAAGlB,YAAY,KAErC,MAAM;EACJ,MAAMmB,KAAK,GAAG,IAAIC,GAAG,CAAwD,CAAC;EAC9E,MAAMC,YAAY,GAAGH,QAAQ,CAAC,CAAC;EAE/B,OAAQT,OAAO,IAAK;IAClB,MAAMa,MAAM,GAAGL,QAAQ,CAACR,OAAO,CAACJ,kBAAkB,CAAC;IAEnD,IAAI,CAACiB,MAAM,EAAE;MACX,OAAOD,YAAY,CAACZ,OAAO,CAAC;IAC9B;IAEA,MAAMc,IAAI,GAAGJ,KAAK,CAACK,GAAG,CAACf,OAAO,CAACJ,kBAAkB,CAAC,IAAIiB,MAAM,CAAC,CAAC;IAE9DH,KAAK,CAACM,GAAG,CAAChB,OAAO,CAACJ,kBAAkB,EAAEkB,IAAI,CAAC;IAE3C,OAAOA,IAAI,CAACd,OAAO,CAAC;EACtB,CAAC;AACH,CAAC;;AAEH;AAAAR,OAAA,CAAAe,YAAA,GAAAA,YAAA;AACA,gBAAgBU,YAAYA,CAACC,MAAkC,EAAEL,MAAoB,EAA8B;EACjH,MAAMM,IAAI,GAAGN,MAAM,CAAC,CAAC;EAErB,WAAW,MAAMO,KAAK,IAAIF,MAAM,EAAE;IAChC,IAAIE,KAAK,CAACC,IAAI,KAAK,SAAS,IAAIF,IAAI,CAACC,KAAK,CAACpB,OAAO,CAAC,EAAE;MACnD,MAAMoB,KAAK;IACb;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_deviceUser","require","_dailyTotalDay","everyReading","exports","firstReadingPerKind","reported","Set","measurementTypeKey","has","add","dailyTotalsOnly","reading","day","dailyTotalDay","Date","now","undefined","key","acceptedMemorySlots","slots","isFromAcceptedMemorySlot","policyByKind","policies","fallback","tests","Map","fallbackTest","policy","test","get","set","keepReadings","events","keep","event","kind"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/result-policy.ts"],"mappings":";;;;;;;;AAEA,IAAAA,WAAA,GAAAC,OAAA;AAEA,I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e,mBAAA,GAAAA,mBAAA;AACA,MAAMG,YAAY,GAAGA,CACnBC,QAA2D,EAC3DC,QAAsB,GAAGrB,YAAY,KAErC,MAAM;EACJ,MAAMsB,KAAK,GAAG,IAAIC,GAAG,CAAwD,CAAC;EAC9E,MAAMC,YAAY,GAAGH,QAAQ,CAAC,CAAC;EAE/B,OAAQZ,OAAO,IAAK;IAClB,MAAMgB,MAAM,GAAGL,QAAQ,CAACX,OAAO,CAACJ,kBAAkB,CAAC;IAEnD,IAAI,CAACoB,MAAM,EAAE;MACX,OAAOD,YAAY,CAACf,OAAO,CAAC;IAC9B;IAEA,MAAMiB,IAAI,GAAGJ,KAAK,CAACK,GAAG,CAAClB,OAAO,CAACJ,kBAAkB,CAAC,IAAIoB,MAAM,CAAC,CAAC;IAE9DH,KAAK,CAACM,GAAG,CAACnB,OAAO,CAACJ,kBAAkB,EAAEqB,IAAI,CAAC;IAE3C,OAAOA,IAAI,CAACjB,OAAO,CAAC;EACtB,CAAC;AACH,CAAC;;AAEH;AAAAR,OAAA,CAAAkB,YAAA,GAAAA,YAAA;AACA,gBAAgBU,YAAYA,CAACC,MAAkC,EAAEL,MAAoB,EAA8B;EACjH,MAAMM,IAAI,GAAGN,MAAM,CAAC,CAAC;EAErB,WAAW,MAAMO,KAAK,IAAIF,MAAM,EAAE;IAChC,IAAIE,KAAK,CAACC,IAAI,KAAK,SAAS,IAAIF,IAAI,CAACC,KAAK,CAACvB,OAAO,CAAC,EAAE;MACnD,MAAMuB,KAAK;IACb;EACF;AACF","ignoreList":[]}
@@ -0,0 +1,223 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.BluetoothRuntime = void 0;
7
+ var _autoConnect = require("./auto-connect.js");
8
+ var _connections = require("./connections.js");
9
+ var _devices = require("./devices.js");
10
+ var _errors = require("./errors.js");
11
+ var _paired = require("./paired.js");
12
+ var _readings = require("./readings.js");
13
+ var _resultPolicy = require("./result-policy.js");
14
+ var _scanLoop = require("./scan-loop.js");
15
+ var _store = require("./store.js");
16
+ /** What a `BluetoothRuntime` is built from. */
17
+
18
+ /**
19
+ * Scans for supported devices, connects to them, collects their readings and saves each one. Framework-free: React
20
+ * hooks and components sit on top of it. Every failure is a `BluetoothError`. Call `dispose()` when done.
21
+ */
22
+ class BluetoothRuntime {
23
+ store = new _store.SnapshotStore();
24
+ known = new Map();
25
+ held = new Set();
26
+ backoff = new _autoConnect.AutoConnectBackoff();
27
+ retryTimers = new Set();
28
+ scanRequest = 0;
29
+ disposed = false;
30
+ constructor(options) {
31
+ this.options = options;
32
+ this.readings = new _readings.ReadingLog(this.store, options.sink);
33
+ this.connections = new _connections.Connections(this.store, this.readings, options.resultPolicy ?? _resultPolicy.everyReading, id => this.connectionEnded(id));
34
+ this.paired = new _paired.PairedDevices(paired => this.store.set({
35
+ paired
36
+ }), options.pairedStorage);
37
+ this.scan = new _scanLoop.ScanLoop(options.scanner, this.store, peripheral => this.found(peripheral));
38
+ this.unwatchAdapter = options.scanner.watchState(adapter => {
39
+ this.store.set({
40
+ adapter
41
+ });
42
+ this.scan.sync();
43
+ });
44
+ void this.checkPermission().catch(() => undefined);
45
+ }
46
+
47
+ /** The current state. */
48
+ getSnapshot = () => this.store.get();
49
+
50
+ /** Calls `listener` after every state change; returns the unsubscribe. */
51
+ subscribe = listener => this.store.subscribe(listener);
52
+
53
+ /** Reads the permission without prompting. */
54
+ async checkPermission() {
55
+ return this.recordPermission(await this.options.permissions.check());
56
+ }
57
+
58
+ /** Prompts for the permission when the OS still can. */
59
+ async requestPermission() {
60
+ return this.recordPermission(await this.options.permissions.request());
61
+ }
62
+
63
+ /** Opens the app's system settings, where a blocked permission can be granted. */
64
+ openPermissionSettings() {
65
+ return this.options.permissions.openSettings();
66
+ }
67
+
68
+ /**
69
+ * Asks for permission when needed, then scans whenever the adapter is on, until `stopScan`.
70
+ *
71
+ * @throws BluetoothError `permission-denied` when permission is not granted; `runtime-disposed` after `dispose`.
72
+ */
73
+ async startScan() {
74
+ this.assertLive();
75
+ const request = ++this.scanRequest;
76
+ const permission = this.store.get().permission === "granted" ? "granted" : await this.requestPermission();
77
+ if (permission !== "granted") {
78
+ throw new _errors.BluetoothError("permission-denied", "Bluetooth permission is not granted");
79
+ }
80
+ if (request === this.scanRequest && !this.disposed) {
81
+ this.store.set({
82
+ scanning: true
83
+ });
84
+ this.scan.sync();
85
+ }
86
+ }
87
+
88
+ /** Stops scanning; connected devices stay connected. */
89
+ stopScan() {
90
+ this.scanRequest += 1;
91
+ this.store.set({
92
+ scanning: false
93
+ });
94
+ this.scan.sync();
95
+ }
96
+
97
+ /**
98
+ * Connects to a found device for this session; resolves once connected.
99
+ *
100
+ * @throws BluetoothError `device-not-found`, `connection-failed` or the driver's failure.
101
+ */
102
+ async connect(deviceId) {
103
+ this.assertLive();
104
+ const {
105
+ peripheral,
106
+ match
107
+ } = this.require(deviceId);
108
+ this.held.delete(deviceId);
109
+ await this.connections.connect(peripheral, match.driver);
110
+ }
111
+
112
+ /** Disconnects a device; a paired one stays disconnected until `connect` or `pair` is called again. */
113
+ async disconnect(deviceId) {
114
+ this.held.add(deviceId);
115
+ await this.connections.disconnect(deviceId);
116
+ }
117
+
118
+ /** Remembers a device, so it connects whenever the scan finds it, and connects to it now. */
119
+ async pair(deviceId) {
120
+ this.require(deviceId);
121
+ await this.paired.add(deviceId);
122
+ await this.connect(deviceId);
123
+ }
124
+
125
+ /** Forgets a paired device and disconnects it. */
126
+ async forget(deviceId) {
127
+ await this.paired.remove(deviceId);
128
+ await this.disconnect(deviceId);
129
+ }
130
+
131
+ /** Saves the readings whose save failed again, and the readings the sink queued offline. */
132
+ retrySaves() {
133
+ return this.readings.retrySaves();
134
+ }
135
+
136
+ /** Stops scanning and disconnects every device; resolves once they have disconnected, after which nothing changes. */
137
+ async dispose() {
138
+ if (this.disposed) {
139
+ return;
140
+ }
141
+ this.stopScan();
142
+ this.disposed = true;
143
+ this.scan.close();
144
+ this.unwatchAdapter();
145
+ this.retryTimers.forEach(clearTimeout);
146
+ await this.connections.disconnectAll();
147
+ this.store.close();
148
+ }
149
+ recordPermission(permission) {
150
+ this.store.set({
151
+ permission
152
+ });
153
+ return permission;
154
+ }
155
+ found(peripheral) {
156
+ const known = this.known.get(peripheral.id);
157
+ const match = known?.match ?? (0, _devices.matchDevice)(this.options.devices, peripheral.advertisement);
158
+ if (!match) {
159
+ return;
160
+ }
161
+ this.known.set(peripheral.id, {
162
+ peripheral,
163
+ match
164
+ });
165
+ if (!known) {
166
+ const device = {
167
+ id: peripheral.id,
168
+ key: match.key,
169
+ name: peripheral.advertisement.name
170
+ };
171
+ this.store.set({
172
+ devices: [...this.store.get().devices, {
173
+ ...device,
174
+ connection: "idle",
175
+ error: null
176
+ }]
177
+ });
178
+ }
179
+ this.connectIfPaired(peripheral.id);
180
+ }
181
+ connectIfPaired(id) {
182
+ const waiting = this.held.has(id) || this.connections.isActive(id) || !this.backoff.allows(id);
183
+ if (this.paired.has(id) && !waiting) {
184
+ this.connect(id).catch(() => undefined);
185
+ }
186
+ }
187
+
188
+ /** A scan reports a peripheral once, so a paired device is only found again by a fresh scan. */
189
+ connectionEnded(id) {
190
+ if (!this.paired.has(id) || this.held.has(id) || this.disposed) {
191
+ return;
192
+ }
193
+ if (this.store.device(id)?.connection !== "failed") {
194
+ this.backoff.succeeded(id);
195
+ this.restartScan();
196
+ return;
197
+ }
198
+ const timer = setTimeout(() => {
199
+ this.retryTimers.delete(timer);
200
+ this.restartScan();
201
+ }, this.backoff.failed(id));
202
+ this.retryTimers.add(timer);
203
+ }
204
+ restartScan() {
205
+ if (this.scan.running) {
206
+ this.scan.restart();
207
+ }
208
+ }
209
+ require(deviceId) {
210
+ const device = this.known.get(deviceId);
211
+ if (!device) {
212
+ throw new _errors.BluetoothError("device-not-found", `No device ${deviceId} was found by the scan`);
213
+ }
214
+ return device;
215
+ }
216
+ assertLive() {
217
+ if (this.disposed) {
218
+ throw new _errors.BluetoothError("runtime-disposed", "This BluetoothRuntime was disposed");
219
+ }
220
+ }
221
+ }
222
+ exports.BluetoothRuntime = BluetoothRuntime;
223
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_autoConnect","require","_connections","_devices","_errors","_paired","_readings","_resultPolicy","_scanLoop","_store","BluetoothRuntime","store","SnapshotStore","known","Map","held","Set","backoff","AutoConnectBackoff","retryTimers","scanRequest","disposed","constructor","options","readings","ReadingLog","sink","connections","Connections","resultPolicy","everyReading","id","connectionEnded","paired","PairedDevices","set","pairedStorage","scan","ScanLoop","scanner","peripheral","found","unwatchAdapter","watchState","adapter","sync","checkPermission","catch","undefined","getSnapshot","get","subscribe","listener","recordPermission","permissions","check","requestPermission","request","openPermissionSettings","openSettings","startScan","assertLive","permission","BluetoothError","scanning","stopScan","connect","deviceId","match","delete","driver","disconnect","add","pair","forget","remove","retrySaves","dispose","close","forEach","clearTimeout","disconnectAll","matchDevice","devices","advertisement","device","key","name","connection","error","connectIfPaired","waiting","has","isActive","allows","succeeded","restartScan","timer","setTimeout","failed","running","restart","exports"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/runtime.ts"],"mappings":";;;;;;AAEA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAEA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAGA,IAAAQ,MAAA,GAAAR,OAAA;AAGA;;AAwBA;AACA;AACA;AACA;AACA,MAAMS,gBAAgB,CAAC;EACJC,KAAK,GAAG,IAAIC,oBAAa,CAAC,CAAC;EAC3BC,KAAK,GAAG,IAAIC,GAAG,CAAsB,CAAC;EACtCC,IAAI,GAAG,IAAIC,GAAG,CAAS,CAAC;EACxBC,OAAO,GAAG,I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