@ovok/native 1.16.1-dev.2118 → 1.16.1-dev.2129

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 (315) 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/device-picker-sheet.js +160 -0
  6. package/lib/commonjs/modules/bt-management/components/device-picker-sheet.js.map +1 -0
  7. package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-permission.js +2 -1
  8. package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-permission.js.map +1 -1
  9. package/lib/commonjs/modules/bt-management/hooks/use-measurements.js +1 -1
  10. package/lib/commonjs/modules/bt-management/hooks/use-measurements.js.map +1 -1
  11. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +1 -1
  12. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  13. package/lib/commonjs/modules/bt-management/utils/bluetooth-permission-list.js +19 -0
  14. package/lib/commonjs/modules/bt-management/utils/bluetooth-permission-list.js.map +1 -0
  15. package/lib/commonjs/modules/bt-management/utils/result-identity.js +3 -25
  16. package/lib/commonjs/modules/bt-management/utils/result-identity.js.map +1 -1
  17. package/lib/commonjs/modules/next/bluetooth/auto-connect.js +32 -0
  18. package/lib/commonjs/modules/next/bluetooth/auto-connect.js.map +1 -0
  19. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-errors.js +33 -0
  20. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-errors.js.map +1 -0
  21. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-link.js +125 -0
  22. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-link.js.map +1 -0
  23. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-scanner.js +75 -0
  24. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-scanner.js.map +1 -0
  25. package/lib/commonjs/modules/next/bluetooth/ble-plx/built-in-devices.js +34 -0
  26. package/lib/commonjs/modules/next/bluetooth/ble-plx/built-in-devices.js.map +1 -0
  27. package/lib/commonjs/modules/next/bluetooth/ble-plx/legacy-driver.js +67 -0
  28. package/lib/commonjs/modules/next/bluetooth/ble-plx/legacy-driver.js.map +1 -0
  29. package/lib/commonjs/modules/next/bluetooth/connections.js +110 -0
  30. package/lib/commonjs/modules/next/bluetooth/connections.js.map +1 -0
  31. package/lib/commonjs/modules/next/bluetooth/daily-total-day.js.map +1 -0
  32. package/lib/commonjs/modules/next/bluetooth/devices.js +41 -0
  33. package/lib/commonjs/modules/next/bluetooth/devices.js.map +1 -0
  34. package/lib/commonjs/modules/next/bluetooth/driver.js +24 -20
  35. package/lib/commonjs/modules/next/bluetooth/driver.js.map +1 -1
  36. package/lib/commonjs/modules/next/bluetooth/errors.js +26 -0
  37. package/lib/commonjs/modules/next/bluetooth/errors.js.map +1 -0
  38. package/lib/commonjs/modules/next/bluetooth/index.js +116 -11
  39. package/lib/commonjs/modules/next/bluetooth/index.js.map +1 -1
  40. package/lib/commonjs/modules/next/bluetooth/link.js +0 -103
  41. package/lib/commonjs/modules/next/bluetooth/link.js.map +1 -1
  42. package/lib/commonjs/modules/next/bluetooth/paired.js +50 -0
  43. package/lib/commonjs/modules/next/bluetooth/paired.js.map +1 -0
  44. package/lib/commonjs/modules/next/bluetooth/permissions.js +2 -0
  45. package/lib/commonjs/modules/next/bluetooth/permissions.js.map +1 -0
  46. package/lib/commonjs/modules/next/bluetooth/react/bluetooth-device-picker.js +44 -0
  47. package/lib/commonjs/modules/next/bluetooth/react/bluetooth-device-picker.js.map +1 -0
  48. package/lib/commonjs/modules/next/bluetooth/react/context.js +54 -0
  49. package/lib/commonjs/modules/next/bluetooth/react/context.js.map +1 -0
  50. package/lib/commonjs/modules/next/bluetooth/react/hooks.js +86 -0
  51. package/lib/commonjs/modules/next/bluetooth/react/hooks.js.map +1 -0
  52. package/lib/commonjs/modules/next/bluetooth/react-native/create-bluetooth-runtime.js +28 -0
  53. package/lib/commonjs/modules/next/bluetooth/react-native/create-bluetooth-runtime.js.map +1 -0
  54. package/lib/commonjs/modules/next/bluetooth/react-native/os-permissions.js +32 -0
  55. package/lib/commonjs/modules/next/bluetooth/react-native/os-permissions.js.map +1 -0
  56. package/lib/commonjs/modules/next/bluetooth/react-native/ovok-sink.js +32 -0
  57. package/lib/commonjs/modules/next/bluetooth/react-native/ovok-sink.js.map +1 -0
  58. package/lib/commonjs/modules/next/bluetooth/readings.js +92 -0
  59. package/lib/commonjs/modules/next/bluetooth/readings.js.map +1 -0
  60. package/lib/commonjs/modules/next/bluetooth/result-policy.js +6 -1
  61. package/lib/commonjs/modules/next/bluetooth/result-policy.js.map +1 -1
  62. package/lib/commonjs/modules/next/bluetooth/runtime.js +223 -0
  63. package/lib/commonjs/modules/next/bluetooth/runtime.js.map +1 -0
  64. package/lib/commonjs/modules/next/bluetooth/scan-loop.js +82 -0
  65. package/lib/commonjs/modules/next/bluetooth/scan-loop.js.map +1 -0
  66. package/lib/commonjs/modules/next/bluetooth/sink.js +6 -0
  67. package/lib/commonjs/modules/next/bluetooth/sink.js.map +1 -0
  68. package/lib/commonjs/modules/next/bluetooth/snapshot.js +6 -0
  69. package/lib/commonjs/modules/next/bluetooth/snapshot.js.map +1 -0
  70. package/lib/commonjs/modules/next/bluetooth/stable-hash.js +33 -0
  71. package/lib/commonjs/modules/next/bluetooth/stable-hash.js.map +1 -0
  72. package/lib/commonjs/modules/next/bluetooth/store.js +61 -0
  73. package/lib/commonjs/modules/next/bluetooth/store.js.map +1 -0
  74. package/lib/commonjs/modules/next/bluetooth/transport.js +6 -0
  75. package/lib/commonjs/modules/next/bluetooth/transport.js.map +1 -0
  76. package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js +3 -1
  77. package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -1
  78. package/lib/module/modules/bt-management/components/bluetooth-device-picker.js +9 -141
  79. package/lib/module/modules/bt-management/components/bluetooth-device-picker.js.map +1 -1
  80. package/lib/module/modules/bt-management/components/device-picker-sheet.js +154 -0
  81. package/lib/module/modules/bt-management/components/device-picker-sheet.js.map +1 -0
  82. package/lib/module/modules/bt-management/hooks/use-bluetooth-permission.js +4 -3
  83. package/lib/module/modules/bt-management/hooks/use-bluetooth-permission.js.map +1 -1
  84. package/lib/module/modules/bt-management/hooks/use-measurements.js +1 -1
  85. package/lib/module/modules/bt-management/hooks/use-measurements.js.map +1 -1
  86. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +1 -1
  87. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  88. package/lib/module/modules/bt-management/utils/bluetooth-permission-list.js +14 -0
  89. package/lib/module/modules/bt-management/utils/bluetooth-permission-list.js.map +1 -0
  90. package/lib/module/modules/bt-management/utils/result-identity.js +3 -25
  91. package/lib/module/modules/bt-management/utils/result-identity.js.map +1 -1
  92. package/lib/module/modules/next/bluetooth/auto-connect.js +28 -0
  93. package/lib/module/modules/next/bluetooth/auto-connect.js.map +1 -0
  94. package/lib/module/modules/next/bluetooth/ble-plx/ble-errors.js +28 -0
  95. package/lib/module/modules/next/bluetooth/ble-plx/ble-errors.js.map +1 -0
  96. package/lib/module/modules/next/bluetooth/ble-plx/ble-link.js +122 -0
  97. package/lib/module/modules/next/bluetooth/ble-plx/ble-link.js.map +1 -0
  98. package/lib/module/modules/next/bluetooth/ble-plx/ble-scanner.js +69 -0
  99. package/lib/module/modules/next/bluetooth/ble-plx/ble-scanner.js.map +1 -0
  100. package/lib/module/modules/next/bluetooth/ble-plx/built-in-devices.js +31 -0
  101. package/lib/module/modules/next/bluetooth/ble-plx/built-in-devices.js.map +1 -0
  102. package/lib/module/modules/next/bluetooth/ble-plx/legacy-driver.js +63 -0
  103. package/lib/module/modules/next/bluetooth/ble-plx/legacy-driver.js.map +1 -0
  104. package/lib/module/modules/next/bluetooth/connections.js +106 -0
  105. package/lib/module/modules/next/bluetooth/connections.js.map +1 -0
  106. package/lib/module/modules/next/bluetooth/daily-total-day.js.map +1 -0
  107. package/lib/module/modules/next/bluetooth/devices.js +37 -0
  108. package/lib/module/modules/next/bluetooth/devices.js.map +1 -0
  109. package/lib/module/modules/next/bluetooth/driver.js +23 -20
  110. package/lib/module/modules/next/bluetooth/driver.js.map +1 -1
  111. package/lib/module/modules/next/bluetooth/errors.js +21 -0
  112. package/lib/module/modules/next/bluetooth/errors.js.map +1 -0
  113. package/lib/module/modules/next/bluetooth/index.js +21 -3
  114. package/lib/module/modules/next/bluetooth/index.js.map +1 -1
  115. package/lib/module/modules/next/bluetooth/link.js +0 -101
  116. package/lib/module/modules/next/bluetooth/link.js.map +1 -1
  117. package/lib/module/modules/next/bluetooth/paired.js +46 -0
  118. package/lib/module/modules/next/bluetooth/paired.js.map +1 -0
  119. package/lib/module/modules/next/bluetooth/permissions.js +2 -0
  120. package/lib/module/modules/next/bluetooth/permissions.js.map +1 -0
  121. package/lib/module/modules/next/bluetooth/react/bluetooth-device-picker.js +39 -0
  122. package/lib/module/modules/next/bluetooth/react/bluetooth-device-picker.js.map +1 -0
  123. package/lib/module/modules/next/bluetooth/react/context.js +48 -0
  124. package/lib/module/modules/next/bluetooth/react/context.js.map +1 -0
  125. package/lib/module/modules/next/bluetooth/react/hooks.js +76 -0
  126. package/lib/module/modules/next/bluetooth/react/hooks.js.map +1 -0
  127. package/lib/module/modules/next/bluetooth/react-native/create-bluetooth-runtime.js +25 -0
  128. package/lib/module/modules/next/bluetooth/react-native/create-bluetooth-runtime.js.map +1 -0
  129. package/lib/module/modules/next/bluetooth/react-native/os-permissions.js +28 -0
  130. package/lib/module/modules/next/bluetooth/react-native/os-permissions.js.map +1 -0
  131. package/lib/module/modules/next/bluetooth/react-native/ovok-sink.js +28 -0
  132. package/lib/module/modules/next/bluetooth/react-native/ovok-sink.js.map +1 -0
  133. package/lib/module/modules/next/bluetooth/readings.js +88 -0
  134. package/lib/module/modules/next/bluetooth/readings.js.map +1 -0
  135. package/lib/module/modules/next/bluetooth/result-policy.js +6 -1
  136. package/lib/module/modules/next/bluetooth/result-policy.js.map +1 -1
  137. package/lib/module/modules/next/bluetooth/runtime.js +220 -0
  138. package/lib/module/modules/next/bluetooth/runtime.js.map +1 -0
  139. package/lib/module/modules/next/bluetooth/scan-loop.js +78 -0
  140. package/lib/module/modules/next/bluetooth/scan-loop.js.map +1 -0
  141. package/lib/module/modules/next/bluetooth/sink.js +4 -0
  142. package/lib/module/modules/next/bluetooth/sink.js.map +1 -0
  143. package/lib/module/modules/next/bluetooth/snapshot.js +4 -0
  144. package/lib/module/modules/next/bluetooth/snapshot.js.map +1 -0
  145. package/lib/module/modules/next/bluetooth/stable-hash.js +28 -0
  146. package/lib/module/modules/next/bluetooth/stable-hash.js.map +1 -0
  147. package/lib/module/modules/next/bluetooth/store.js +57 -0
  148. package/lib/module/modules/next/bluetooth/store.js.map +1 -0
  149. package/lib/module/modules/next/bluetooth/transport.js +4 -0
  150. package/lib/module/modules/next/bluetooth/transport.js.map +1 -0
  151. package/lib/typescript/commonjs/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -1
  152. package/lib/typescript/commonjs/src/modules/bt-management/components/bluetooth-device-picker.d.ts +1 -1
  153. package/lib/typescript/commonjs/src/modules/bt-management/components/bluetooth-device-picker.d.ts.map +1 -1
  154. package/lib/typescript/commonjs/src/modules/bt-management/components/device-picker-sheet.d.ts +25 -0
  155. package/lib/typescript/commonjs/src/modules/bt-management/components/device-picker-sheet.d.ts.map +1 -0
  156. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-permission.d.ts.map +1 -1
  157. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -1
  158. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  159. package/lib/typescript/commonjs/src/modules/bt-management/utils/bluetooth-permission-list.d.ts +4 -0
  160. package/lib/typescript/commonjs/src/modules/bt-management/utils/bluetooth-permission-list.d.ts.map +1 -0
  161. package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts.map +1 -1
  162. package/lib/typescript/commonjs/src/modules/next/bluetooth/auto-connect.d.ts +10 -0
  163. package/lib/typescript/commonjs/src/modules/next/bluetooth/auto-connect.d.ts.map +1 -0
  164. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-errors.d.ts +4 -0
  165. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-errors.d.ts.map +1 -0
  166. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-link.d.ts +6 -0
  167. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-link.d.ts.map +1 -0
  168. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts +10 -0
  169. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts.map +1 -0
  170. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts +6 -0
  171. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts.map +1 -0
  172. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts +8 -0
  173. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts.map +1 -0
  174. package/lib/typescript/commonjs/src/modules/next/bluetooth/connections.d.ts +25 -0
  175. package/lib/typescript/commonjs/src/modules/next/bluetooth/connections.d.ts.map +1 -0
  176. package/lib/typescript/commonjs/src/modules/next/bluetooth/daily-total-day.d.ts.map +1 -0
  177. package/lib/typescript/commonjs/src/modules/next/bluetooth/devices.d.ts +30 -0
  178. package/lib/typescript/commonjs/src/modules/next/bluetooth/devices.d.ts.map +1 -0
  179. package/lib/typescript/commonjs/src/modules/next/bluetooth/driver.d.ts +21 -19
  180. package/lib/typescript/commonjs/src/modules/next/bluetooth/driver.d.ts.map +1 -1
  181. package/lib/typescript/commonjs/src/modules/next/bluetooth/errors.d.ts +17 -0
  182. package/lib/typescript/commonjs/src/modules/next/bluetooth/errors.d.ts.map +1 -0
  183. package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts +32 -3
  184. package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts.map +1 -1
  185. package/lib/typescript/commonjs/src/modules/next/bluetooth/link.d.ts +2 -4
  186. package/lib/typescript/commonjs/src/modules/next/bluetooth/link.d.ts.map +1 -1
  187. package/lib/typescript/commonjs/src/modules/next/bluetooth/paired.d.ts +18 -0
  188. package/lib/typescript/commonjs/src/modules/next/bluetooth/paired.d.ts.map +1 -0
  189. package/lib/typescript/commonjs/src/modules/next/bluetooth/permissions.d.ts +13 -0
  190. package/lib/typescript/commonjs/src/modules/next/bluetooth/permissions.d.ts.map +1 -0
  191. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/bluetooth-device-picker.d.ts +35 -0
  192. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/bluetooth-device-picker.d.ts.map +1 -0
  193. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/context.d.ts +30 -0
  194. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/context.d.ts.map +1 -0
  195. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/hooks.d.ts +47 -0
  196. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/hooks.d.ts.map +1 -0
  197. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/create-bluetooth-runtime.d.ts +21 -0
  198. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/create-bluetooth-runtime.d.ts.map +1 -0
  199. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/os-permissions.d.ts +5 -0
  200. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/os-permissions.d.ts.map +1 -0
  201. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/ovok-sink.d.ts +6 -0
  202. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/ovok-sink.d.ts.map +1 -0
  203. package/lib/typescript/commonjs/src/modules/next/bluetooth/readings.d.ts +21 -0
  204. package/lib/typescript/commonjs/src/modules/next/bluetooth/readings.d.ts.map +1 -0
  205. package/lib/typescript/commonjs/src/modules/next/bluetooth/result-policy.d.ts +3 -0
  206. package/lib/typescript/commonjs/src/modules/next/bluetooth/result-policy.d.ts.map +1 -1
  207. package/lib/typescript/commonjs/src/modules/next/bluetooth/runtime.d.ts +87 -0
  208. package/lib/typescript/commonjs/src/modules/next/bluetooth/runtime.d.ts.map +1 -0
  209. package/lib/typescript/commonjs/src/modules/next/bluetooth/scan-loop.d.ts +23 -0
  210. package/lib/typescript/commonjs/src/modules/next/bluetooth/scan-loop.d.ts.map +1 -0
  211. package/lib/typescript/commonjs/src/modules/next/bluetooth/sink.d.ts +20 -0
  212. package/lib/typescript/commonjs/src/modules/next/bluetooth/sink.d.ts.map +1 -0
  213. package/lib/typescript/commonjs/src/modules/next/bluetooth/snapshot.d.ts +69 -0
  214. package/lib/typescript/commonjs/src/modules/next/bluetooth/snapshot.d.ts.map +1 -0
  215. package/lib/typescript/commonjs/src/modules/next/bluetooth/stable-hash.d.ts +3 -0
  216. package/lib/typescript/commonjs/src/modules/next/bluetooth/stable-hash.d.ts.map +1 -0
  217. package/lib/typescript/commonjs/src/modules/next/bluetooth/store.d.ts +16 -0
  218. package/lib/typescript/commonjs/src/modules/next/bluetooth/store.d.ts.map +1 -0
  219. package/lib/typescript/commonjs/src/modules/next/bluetooth/transport.d.ts +31 -0
  220. package/lib/typescript/commonjs/src/modules/next/bluetooth/transport.d.ts.map +1 -0
  221. package/lib/typescript/module/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -1
  222. package/lib/typescript/module/src/modules/bt-management/components/bluetooth-device-picker.d.ts +1 -1
  223. package/lib/typescript/module/src/modules/bt-management/components/bluetooth-device-picker.d.ts.map +1 -1
  224. package/lib/typescript/module/src/modules/bt-management/components/device-picker-sheet.d.ts +25 -0
  225. package/lib/typescript/module/src/modules/bt-management/components/device-picker-sheet.d.ts.map +1 -0
  226. package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-permission.d.ts.map +1 -1
  227. package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -1
  228. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  229. package/lib/typescript/module/src/modules/bt-management/utils/bluetooth-permission-list.d.ts +4 -0
  230. package/lib/typescript/module/src/modules/bt-management/utils/bluetooth-permission-list.d.ts.map +1 -0
  231. package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts.map +1 -1
  232. package/lib/typescript/module/src/modules/next/bluetooth/auto-connect.d.ts +10 -0
  233. package/lib/typescript/module/src/modules/next/bluetooth/auto-connect.d.ts.map +1 -0
  234. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-errors.d.ts +4 -0
  235. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-errors.d.ts.map +1 -0
  236. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-link.d.ts +6 -0
  237. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-link.d.ts.map +1 -0
  238. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts +10 -0
  239. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts.map +1 -0
  240. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts +6 -0
  241. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts.map +1 -0
  242. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts +8 -0
  243. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts.map +1 -0
  244. package/lib/typescript/module/src/modules/next/bluetooth/connections.d.ts +25 -0
  245. package/lib/typescript/module/src/modules/next/bluetooth/connections.d.ts.map +1 -0
  246. package/lib/typescript/module/src/modules/next/bluetooth/daily-total-day.d.ts.map +1 -0
  247. package/lib/typescript/module/src/modules/next/bluetooth/devices.d.ts +30 -0
  248. package/lib/typescript/module/src/modules/next/bluetooth/devices.d.ts.map +1 -0
  249. package/lib/typescript/module/src/modules/next/bluetooth/driver.d.ts +21 -19
  250. package/lib/typescript/module/src/modules/next/bluetooth/driver.d.ts.map +1 -1
  251. package/lib/typescript/module/src/modules/next/bluetooth/errors.d.ts +17 -0
  252. package/lib/typescript/module/src/modules/next/bluetooth/errors.d.ts.map +1 -0
  253. package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts +32 -3
  254. package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts.map +1 -1
  255. package/lib/typescript/module/src/modules/next/bluetooth/link.d.ts +2 -4
  256. package/lib/typescript/module/src/modules/next/bluetooth/link.d.ts.map +1 -1
  257. package/lib/typescript/module/src/modules/next/bluetooth/paired.d.ts +18 -0
  258. package/lib/typescript/module/src/modules/next/bluetooth/paired.d.ts.map +1 -0
  259. package/lib/typescript/module/src/modules/next/bluetooth/permissions.d.ts +13 -0
  260. package/lib/typescript/module/src/modules/next/bluetooth/permissions.d.ts.map +1 -0
  261. package/lib/typescript/module/src/modules/next/bluetooth/react/bluetooth-device-picker.d.ts +35 -0
  262. package/lib/typescript/module/src/modules/next/bluetooth/react/bluetooth-device-picker.d.ts.map +1 -0
  263. package/lib/typescript/module/src/modules/next/bluetooth/react/context.d.ts +30 -0
  264. package/lib/typescript/module/src/modules/next/bluetooth/react/context.d.ts.map +1 -0
  265. package/lib/typescript/module/src/modules/next/bluetooth/react/hooks.d.ts +47 -0
  266. package/lib/typescript/module/src/modules/next/bluetooth/react/hooks.d.ts.map +1 -0
  267. package/lib/typescript/module/src/modules/next/bluetooth/react-native/create-bluetooth-runtime.d.ts +21 -0
  268. package/lib/typescript/module/src/modules/next/bluetooth/react-native/create-bluetooth-runtime.d.ts.map +1 -0
  269. package/lib/typescript/module/src/modules/next/bluetooth/react-native/os-permissions.d.ts +5 -0
  270. package/lib/typescript/module/src/modules/next/bluetooth/react-native/os-permissions.d.ts.map +1 -0
  271. package/lib/typescript/module/src/modules/next/bluetooth/react-native/ovok-sink.d.ts +6 -0
  272. package/lib/typescript/module/src/modules/next/bluetooth/react-native/ovok-sink.d.ts.map +1 -0
  273. package/lib/typescript/module/src/modules/next/bluetooth/readings.d.ts +21 -0
  274. package/lib/typescript/module/src/modules/next/bluetooth/readings.d.ts.map +1 -0
  275. package/lib/typescript/module/src/modules/next/bluetooth/result-policy.d.ts +3 -0
  276. package/lib/typescript/module/src/modules/next/bluetooth/result-policy.d.ts.map +1 -1
  277. package/lib/typescript/module/src/modules/next/bluetooth/runtime.d.ts +87 -0
  278. package/lib/typescript/module/src/modules/next/bluetooth/runtime.d.ts.map +1 -0
  279. package/lib/typescript/module/src/modules/next/bluetooth/scan-loop.d.ts +23 -0
  280. package/lib/typescript/module/src/modules/next/bluetooth/scan-loop.d.ts.map +1 -0
  281. package/lib/typescript/module/src/modules/next/bluetooth/sink.d.ts +20 -0
  282. package/lib/typescript/module/src/modules/next/bluetooth/sink.d.ts.map +1 -0
  283. package/lib/typescript/module/src/modules/next/bluetooth/snapshot.d.ts +69 -0
  284. package/lib/typescript/module/src/modules/next/bluetooth/snapshot.d.ts.map +1 -0
  285. package/lib/typescript/module/src/modules/next/bluetooth/stable-hash.d.ts +3 -0
  286. package/lib/typescript/module/src/modules/next/bluetooth/stable-hash.d.ts.map +1 -0
  287. package/lib/typescript/module/src/modules/next/bluetooth/store.d.ts +16 -0
  288. package/lib/typescript/module/src/modules/next/bluetooth/store.d.ts.map +1 -0
  289. package/lib/typescript/module/src/modules/next/bluetooth/transport.d.ts +31 -0
  290. package/lib/typescript/module/src/modules/next/bluetooth/transport.d.ts.map +1 -0
  291. package/package.json +1 -1
  292. package/lib/commonjs/modules/bt-management/utils/daily-total-day.js.map +0 -1
  293. package/lib/commonjs/modules/next/bluetooth/drivers.js +0 -20
  294. package/lib/commonjs/modules/next/bluetooth/drivers.js.map +0 -1
  295. package/lib/commonjs/modules/next/bluetooth/legacy-driver.js +0 -55
  296. package/lib/commonjs/modules/next/bluetooth/legacy-driver.js.map +0 -1
  297. package/lib/module/modules/bt-management/utils/daily-total-day.js.map +0 -1
  298. package/lib/module/modules/next/bluetooth/drivers.js +0 -17
  299. package/lib/module/modules/next/bluetooth/drivers.js.map +0 -1
  300. package/lib/module/modules/next/bluetooth/legacy-driver.js +0 -51
  301. package/lib/module/modules/next/bluetooth/legacy-driver.js.map +0 -1
  302. package/lib/typescript/commonjs/src/modules/bt-management/utils/daily-total-day.d.ts.map +0 -1
  303. package/lib/typescript/commonjs/src/modules/next/bluetooth/drivers.d.ts +0 -7
  304. package/lib/typescript/commonjs/src/modules/next/bluetooth/drivers.d.ts.map +0 -1
  305. package/lib/typescript/commonjs/src/modules/next/bluetooth/legacy-driver.d.ts +0 -8
  306. package/lib/typescript/commonjs/src/modules/next/bluetooth/legacy-driver.d.ts.map +0 -1
  307. package/lib/typescript/module/src/modules/bt-management/utils/daily-total-day.d.ts.map +0 -1
  308. package/lib/typescript/module/src/modules/next/bluetooth/drivers.d.ts +0 -7
  309. package/lib/typescript/module/src/modules/next/bluetooth/drivers.d.ts.map +0 -1
  310. package/lib/typescript/module/src/modules/next/bluetooth/legacy-driver.d.ts +0 -8
  311. package/lib/typescript/module/src/modules/next/bluetooth/legacy-driver.d.ts.map +0 -1
  312. /package/lib/commonjs/modules/{bt-management/utils → next/bluetooth}/daily-total-day.js +0 -0
  313. /package/lib/module/modules/{bt-management/utils → next/bluetooth}/daily-total-day.js +0 -0
  314. /package/lib/typescript/commonjs/src/modules/{bt-management/utils → next/bluetooth}/daily-total-day.d.ts +0 -0
  315. /package/lib/typescript/module/src/modules/{bt-management/utils → next/bluetooth}/daily-total-day.d.ts +0 -0
@@ -0,0 +1,87 @@
1
+ import { OvokStorage } from "@ovok/core/next";
2
+ import { DeviceSupport } from "./devices";
3
+ import { BluetoothPermission, BluetoothPermissions } from "./permissions";
4
+ import { ResultPolicy } from "./result-policy";
5
+ import { ReadingSink } from "./sink";
6
+ import { BluetoothSnapshot } from "./snapshot";
7
+ import { BluetoothScanner } from "./transport";
8
+ /** What a `BluetoothRuntime` is built from. */
9
+ type BluetoothRuntimeOptions = {
10
+ /** The BLE adapter. */
11
+ scanner: BluetoothScanner;
12
+ /** The OS permission prompts. */
13
+ permissions: BluetoothPermissions;
14
+ /** Where readings are saved. */
15
+ sink: ReadingSink;
16
+ /** The devices to look for; the first support that matches a peripheral handles it. */
17
+ devices: readonly DeviceSupport[];
18
+ /** Which readings of a connection to keep; defaults to every reading. */
19
+ resultPolicy?: ResultPolicy;
20
+ /** Where the paired device IDs persist; without it pairing lasts until the runtime is disposed. */
21
+ pairedStorage?: OvokStorage;
22
+ };
23
+ /**
24
+ * Scans for supported devices, connects to them, collects their readings and saves each one. Framework-free: React
25
+ * hooks and components sit on top of it. Every failure is a `BluetoothError`. Call `dispose()` when done.
26
+ */
27
+ declare class BluetoothRuntime {
28
+ private readonly options;
29
+ private readonly store;
30
+ private readonly known;
31
+ private readonly held;
32
+ private readonly backoff;
33
+ private readonly retryTimers;
34
+ private readonly readings;
35
+ private readonly connections;
36
+ private readonly paired;
37
+ private readonly scan;
38
+ private readonly unwatchAdapter;
39
+ private scanRequest;
40
+ private disposed;
41
+ constructor(options: BluetoothRuntimeOptions);
42
+ /** The current state. */
43
+ getSnapshot: () => BluetoothSnapshot;
44
+ /** Calls `listener` after every state change; returns the unsubscribe. */
45
+ subscribe: (listener: () => void) => (() => void);
46
+ /** Reads the permission without prompting. */
47
+ checkPermission(): Promise<BluetoothPermission>;
48
+ /** Prompts for the permission when the OS still can. */
49
+ requestPermission(): Promise<BluetoothPermission>;
50
+ /** Opens the app's system settings, where a blocked permission can be granted. */
51
+ openPermissionSettings(): Promise<void>;
52
+ /**
53
+ * Asks for permission when needed, then scans whenever the adapter is on, until `stopScan`.
54
+ *
55
+ * @throws BluetoothError `permission-denied` when permission is not granted; `runtime-disposed` after `dispose`.
56
+ */
57
+ startScan(): Promise<void>;
58
+ /** Stops scanning; connected devices stay connected. */
59
+ stopScan(): void;
60
+ /**
61
+ * Connects to a found device for this session; resolves once connected.
62
+ *
63
+ * @throws BluetoothError `device-not-found`, `connection-failed` or the driver's failure.
64
+ */
65
+ connect(deviceId: string): Promise<void>;
66
+ /** Disconnects a device; a paired one stays disconnected until `connect` or `pair` is called again. */
67
+ disconnect(deviceId: string): Promise<void>;
68
+ /** Remembers a device, so it connects whenever the scan finds it, and connects to it now. */
69
+ pair(deviceId: string): Promise<void>;
70
+ /** Forgets a paired device and disconnects it. */
71
+ forget(deviceId: string): Promise<void>;
72
+ /** Saves the readings whose save failed again, and the readings the sink queued offline. */
73
+ retrySaves(): Promise<void>;
74
+ /** Stops scanning and disconnects every device; resolves once they have disconnected, after which nothing changes. */
75
+ dispose(): Promise<void>;
76
+ private recordPermission;
77
+ private found;
78
+ private connectIfPaired;
79
+ /** A scan reports a peripheral once, so a paired device is only found again by a fresh scan. */
80
+ private connectionEnded;
81
+ private restartScan;
82
+ private require;
83
+ private assertLive;
84
+ }
85
+ export { BluetoothRuntime };
86
+ export type { BluetoothRuntimeOptions };
87
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9C,OAAO,EAAe,aAAa,EAAe,MAAM,WAAW,CAAC;AAGpE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1E,OAAO,EAAgB,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAc,MAAM,aAAa,CAAC;AAE3D,+CAA+C;AAC/C,KAAK,uBAAuB,GAAG;IAE7B,uBAAuB;IACvB,OAAO,EAAE,gBAAgB,CAAC;IAE1B,iCAAiC;IACjC,WAAW,EAAE,oBAAoB,CAAC;IAElC,gCAAgC;IAChC,IAAI,EAAE,WAAW,CAAC;IAElB,uFAAuF;IACvF,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;IAElC,yEAAyE;IACzE,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B,mGAAmG;IACnG,aAAa,CAAC,EAAE,WAAW,CAAC;CAC7B,CAAC;AAIF;;;GAGG;AACH,cAAM,gBAAgB;IAcD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAb3C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAuB;IAC7C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkC;IACxD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;IAC1C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA4B;IACpD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA4C;IACxE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAa;IACtC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;IAC1C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;IACvC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAW;IAChC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAa;IAC5C,OAAO,CAAC,WAAW,CAAK;IACxB,OAAO,CAAC,QAAQ,CAAS;gBAEW,OAAO,EAAE,uBAAuB;IAapE,yBAAyB;IAClB,WAAW,QAAO,iBAAiB,CAAqB;IAE/D,0EAA0E;IACnE,SAAS,GAAI,UAAU,MAAM,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC,CAAmC;IAE1F,8CAA8C;IACjC,eAAe,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAI5D,wDAAwD;IAC3C,iBAAiB,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAI9D,kFAAkF;IAC3E,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9C;;;;OAIG;IACU,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAevC,wDAAwD;IACjD,QAAQ,IAAI,IAAI;IAMvB;;;;OAIG;IACU,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASrD,uGAAuG;IAC1F,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKxD,6FAA6F;IAChF,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMlD,kDAAkD;IACrC,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKpD,4FAA4F;IACrF,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIlC,sHAAsH;IACzG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAcrC,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,KAAK;IAiBb,OAAO,CAAC,eAAe;IAQvB,gGAAgG;IAChG,OAAO,CAAC,eAAe;IAoBvB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,OAAO;IAUf,OAAO,CAAC,UAAU;CAKnB;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,YAAY,EAAE,uBAAuB,EAAE,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { SnapshotStore } from "./store";
2
+ import { BluetoothScanner, Peripheral } from "./transport";
3
+ /** Runs the scanner while a scan is requested and the adapter is on, retrying after a scan error. */
4
+ declare class ScanLoop {
5
+ private readonly scanner;
6
+ private readonly store;
7
+ private readonly onFound;
8
+ private stop;
9
+ private retry;
10
+ private closed;
11
+ constructor(scanner: BluetoothScanner, store: SnapshotStore, onFound: (peripheral: Peripheral) => void);
12
+ get running(): boolean;
13
+ /** Starts or stops the scanner to match the snapshot. */
14
+ sync(): void;
15
+ restart(): void;
16
+ close(): void;
17
+ /** A scan can fail before `scan` returns its stop, so the stop is only kept for a scan still running. */
18
+ private start;
19
+ private failed;
20
+ private halt;
21
+ }
22
+ export { ScanLoop };
23
+ //# sourceMappingURL=scan-loop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scan-loop.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/scan-loop.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI3D,qGAAqG;AACrG,cAAM,QAAQ;IAMV,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAP1B,OAAO,CAAC,IAAI,CAA2B;IACvC,OAAO,CAAC,KAAK,CAA4C;IACzD,OAAO,CAAC,MAAM,CAAS;gBAGJ,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,aAAa,EACpB,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI;IAG5D,IAAW,OAAO,IAAI,OAAO,CAE5B;IAED,yDAAyD;IAClD,IAAI,IAAI,IAAI;IAWZ,OAAO,IAAI,IAAI;IAKf,KAAK,IAAI,IAAI;IAKpB,yGAAyG;IACzG,OAAO,CAAC,KAAK;IAqBb,OAAO,CAAC,MAAM;IASd,OAAO,CAAC,IAAI;CAMb;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { DeviceReading } from "./snapshot";
2
+ /** How a sink took a reading. */
3
+ type SaveResult = {
4
+ /** Saved. */
5
+ status: "saved";
6
+ } | {
7
+ /** Kept offline until `flushQueued` saves it. */
8
+ status: "queued";
9
+ /** Names the reading in the queue. */
10
+ queueId: string;
11
+ };
12
+ /** Where readings are saved. */
13
+ interface ReadingSink {
14
+ /** Saves one reading, or queues it offline; the same reading may be saved again after a failure. */
15
+ save(reading: DeviceReading): Promise<SaveResult>;
16
+ /** Retries the queued readings; resolves to the queue IDs now saved. */
17
+ flushQueued(): Promise<readonly string[]>;
18
+ }
19
+ export type { ReadingSink, SaveResult };
20
+ //# sourceMappingURL=sink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sink.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/sink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,iCAAiC;AACjC,KAAK,UAAU,GACX;IAEA,aAAa;IACb,MAAM,EAAE,OAAO,CAAC;CACjB,GACC;IAEA,iDAAiD;IACjD,MAAM,EAAE,QAAQ,CAAC;IAEjB,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEJ,gCAAgC;AAChC,UAAU,WAAW;IAEnB,oGAAoG;IACpG,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAElD,wEAAwE;IACxE,WAAW,IAAI,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;CAC3C;AAED,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,69 @@
1
+ import { Measurement } from "@ovok/core/next";
2
+ import { BluetoothError } from "./errors";
3
+ import { BluetoothPermission } from "./permissions";
4
+ import { AdapterState } from "./transport";
5
+ /** Where a device's connection stands. */
6
+ type ConnectionState = "idle" | "connecting" | "connected" | "measuring" | "disconnected" | "failed";
7
+ /** A supported peripheral the scan found. */
8
+ type NearbyDevice = {
9
+ /** Platform identifier of the peripheral. */
10
+ id: string;
11
+ /** Device key its support identified it as. */
12
+ key: string;
13
+ /** Name it advertised. */
14
+ name: string;
15
+ /** Its connection state. */
16
+ connection: ConnectionState;
17
+ /** The last error its connection reported, or `null`. */
18
+ error: BluetoothError | null;
19
+ };
20
+ /** Where saving a reading stands. */
21
+ type SaveState = {
22
+ /** The sink has not answered yet. */
23
+ status: "saving";
24
+ } | {
25
+ /** Saved. */
26
+ status: "saved";
27
+ } | {
28
+ /** Kept offline by the sink until a flush saves it. */
29
+ status: "queued";
30
+ /** Names the queued reading in the sink's queue. */
31
+ queueId: string;
32
+ } | {
33
+ /** The sink could not save or queue it; `retrySaves` tries again. */
34
+ status: "failed";
35
+ /** Why, with code `save-failed`. */
36
+ error: BluetoothError;
37
+ };
38
+ /** A reading a device sent, and whether it has been saved. */
39
+ type DeviceReading = {
40
+ /** Unique; the same for every resend of a stored reading that carries its time. */
41
+ id: string;
42
+ /** The device that sent it. */
43
+ device: Pick<NearbyDevice, "id" | "key" | "name">;
44
+ /** The decoded measurement. */
45
+ measurement: Measurement;
46
+ /** When the app received it. */
47
+ receivedAt: Date;
48
+ /** Where saving it stands. */
49
+ save: SaveState;
50
+ };
51
+ /** Everything the runtime knows, replaced (never mutated) on each change. */
52
+ type BluetoothSnapshot = {
53
+ /** Bluetooth adapter state. */
54
+ adapter: AdapterState;
55
+ /** Bluetooth permission; `unknown` until first checked. */
56
+ permission: BluetoothPermission | "unknown";
57
+ /** Whether a scan is requested; it runs whenever the adapter is on. */
58
+ scanning: boolean;
59
+ /** The last scan error, or `null`; cleared when a scan starts. */
60
+ scanError: BluetoothError | null;
61
+ /** Supported peripherals found, in discovery order. */
62
+ devices: readonly NearbyDevice[];
63
+ /** IDs of the paired devices, which connect whenever the scan finds them. */
64
+ paired: readonly string[];
65
+ /** Recent readings, oldest first. */
66
+ readings: readonly DeviceReading[];
67
+ };
68
+ export type { BluetoothSnapshot, ConnectionState, DeviceReading, NearbyDevice, SaveState };
69
+ //# sourceMappingURL=snapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,0CAA0C;AAC1C,KAAK,eAAe,GAAG,MAAM,GAAG,YAAY,GAAG,WAAW,GAAG,WAAW,GAAG,cAAc,GAAG,QAAQ,CAAC;AAErG,6CAA6C;AAC7C,KAAK,YAAY,GAAG;IAElB,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IAEX,+CAA+C;IAC/C,GAAG,EAAE,MAAM,CAAC;IAEZ,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IAEb,4BAA4B;IAC5B,UAAU,EAAE,eAAe,CAAC;IAE5B,yDAAyD;IACzD,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;CAC9B,CAAC;AAEF,qCAAqC;AACrC,KAAK,SAAS,GACV;IAEA,qCAAqC;IACrC,MAAM,EAAE,QAAQ,CAAC;CAClB,GACC;IAEA,aAAa;IACb,MAAM,EAAE,OAAO,CAAC;CACjB,GACC;IAEA,uDAAuD;IACvD,MAAM,EAAE,QAAQ,CAAC;IAEjB,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;CACjB,GACC;IAEA,qEAAqE;IACrE,MAAM,EAAE,QAAQ,CAAC;IAEjB,oCAAoC;IACpC,KAAK,EAAE,cAAc,CAAC;CACvB,CAAC;AAEJ,8DAA8D;AAC9D,KAAK,aAAa,GAAG;IAEnB,mFAAmF;IACnF,EAAE,EAAE,MAAM,CAAC;IAEX,+BAA+B;IAC/B,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,KAAK,GAAG,MAAM,CAAC,CAAC;IAElD,+BAA+B;IAC/B,WAAW,EAAE,WAAW,CAAC;IAEzB,gCAAgC;IAChC,UAAU,EAAE,IAAI,CAAC;IAEjB,8BAA8B;IAC9B,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,6EAA6E;AAC7E,KAAK,iBAAiB,GAAG;IAEvB,+BAA+B;IAC/B,OAAO,EAAE,YAAY,CAAC;IAEtB,2DAA2D;IAC3D,UAAU,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAE5C,uEAAuE;IACvE,QAAQ,EAAE,OAAO,CAAC;IAElB,kEAAkE;IAClE,SAAS,EAAE,cAAc,GAAG,IAAI,CAAC;IAEjC,uDAAuD;IACvD,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAEjC,6EAA6E;IAC7E,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAE1B,qCAAqC;IACrC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;CACpC,CAAC;AAEF,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** A short hash of `value` that ignores key order and is the same on every run. */
2
+ export declare const stableHash: (value: unknown) => string;
3
+ //# sourceMappingURL=stable-hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stable-hash.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/stable-hash.ts"],"names":[],"mappings":"AAoCA,mFAAmF;AACnF,eAAO,MAAM,UAAU,GAAI,OAAO,OAAO,KAAG,MAAmD,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { BluetoothSnapshot, DeviceReading, NearbyDevice } from "./snapshot";
2
+ /** The runtime's snapshot and its listeners; once closed, it no longer changes. */
3
+ declare class SnapshotStore {
4
+ private snapshot;
5
+ private readonly listeners;
6
+ private closed;
7
+ get(): BluetoothSnapshot;
8
+ subscribe(listener: () => void): () => void;
9
+ set(patch: Partial<BluetoothSnapshot>): void;
10
+ device(id: string): NearbyDevice | undefined;
11
+ updateDevice(id: string, patch: Partial<NearbyDevice>): void;
12
+ updateReadings(update: (reading: DeviceReading) => DeviceReading): void;
13
+ close(): void;
14
+ }
15
+ export { SnapshotStore };
16
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAY5E,mFAAmF;AACnF,cAAM,aAAa;IACjB,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IACnD,OAAO,CAAC,MAAM,CAAS;IAEhB,GAAG,IAAI,iBAAiB;IAIxB,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAM3C,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,IAAI;IAS5C,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAI5C,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI;IAI5D,cAAc,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,aAAa,GAAG,IAAI;IAIvE,KAAK,IAAI,IAAI;CAIrB;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { BluetoothError } from "./errors";
2
+ import { Link } from "./link";
3
+ /** Bluetooth adapter state; `unknown` until the platform reports it. */
4
+ type AdapterState = "unknown" | "on" | "off" | "unauthorized" | "unsupported";
5
+ /** What a scanned peripheral advertises. */
6
+ type Advertisement = {
7
+ /** Advertised name, or the iOS local name when the name is not known yet; empty when neither is. */
8
+ name: string;
9
+ /** Advertised service UUIDs. */
10
+ serviceUUIDs: readonly string[];
11
+ /** Advertised manufacturer data, base64 encoded, or `null`. */
12
+ manufacturerData: string | null;
13
+ };
14
+ /** A peripheral a scan found, and the way to open a connection to it. */
15
+ type Peripheral = {
16
+ /** Platform identifier of the peripheral. */
17
+ id: string;
18
+ /** What it advertised. */
19
+ advertisement: Advertisement;
20
+ /** Connects and discovers its services; aborting `signal` closes the link. */
21
+ openLink(signal: AbortSignal): Promise<Link>;
22
+ };
23
+ /** The BLE adapter as the runtime uses it: its state and scanning. */
24
+ interface BluetoothScanner {
25
+ /** Reports the adapter state now and on every change; returns the unsubscribe. */
26
+ watchState(listener: (state: AdapterState) => void): () => void;
27
+ /** Reports peripherals until the returned stop is called; `onError` may be called before `scan` returns. */
28
+ scan(onFound: (peripheral: Peripheral) => void, onError: (error: BluetoothError) => void): () => void;
29
+ }
30
+ export type { AdapterState, Advertisement, BluetoothScanner, Peripheral };
31
+ //# sourceMappingURL=transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,wEAAwE;AACxE,KAAK,YAAY,GAAG,SAAS,GAAG,IAAI,GAAG,KAAK,GAAG,cAAc,GAAG,aAAa,CAAC;AAE9E,4CAA4C;AAC5C,KAAK,aAAa,GAAG;IAEnB,oGAAoG;IACpG,IAAI,EAAE,MAAM,CAAC;IAEb,gCAAgC;IAChC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAEhC,+DAA+D;IAC/D,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC,CAAC;AAEF,yEAAyE;AACzE,KAAK,UAAU,GAAG;IAEhB,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IAEX,0BAA0B;IAC1B,aAAa,EAAE,aAAa,CAAC;IAE7B,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9C,CAAC;AAEF,sEAAsE;AACtE,UAAU,gBAAgB;IAExB,kFAAkF;IAClF,UAAU,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAEhE,4GAA4G;IAC5G,IAAI,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CACvG;AAED,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ovok/native",
3
- "version": "1.16.1-dev.2118+5bf83b7",
3
+ "version": "1.16.1-dev.2129+1115230",
4
4
  "description": "React native component sdk for OVOK",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
@@ -1 +0,0 @@
1
- {"version":3,"names":["dailyTotalDay","data","now","temporal","end","Date","getTime","day","start","recordedAt","toISOString","slice","undefined","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/daily-total-day.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACO,MAAMA,aAAa,GAAGA,CAC3BC,IAAY,EACZC,GAAW,KACY;EACvB,MAAMC,QAAQ,GAAGF,IAAuD;EAExE,IAAIE,QAAQ,CAACC,GAAG,YAAYC,IAAI,IAAIF,QAAQ,CAACC,GAAG,CAACE,OAAO,CAAC,CAAC,GAAGJ,GAAG,EAAE;IAChE,OAAO,QAAQ;EACjB;EAEA,MAAMK,GAAG,GAAGJ,QAAQ,CAACC,GAAG,IAAID,QAAQ,CAACK,KAAK,IAAIL,QAAQ,CAACM,UAAU;EAEjE,OAAOF,GAAG,YAAYF,IAAI,GAAGE,GAAG,CAACG,WAAW,CAAC,CAAC,CAACC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAGC,SAAS;AACzE,CAAC;AAACC,OAAA,CAAAb,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createDrivers = void 0;
7
- var _deviceCreator = require("../../bt-management/services/device-creator.js");
8
- var _driver = require("./driver.js");
9
- var _legacyDriver = require("./legacy-driver.js");
10
- var _sigProfiles = require("./sig-profiles.js");
11
- /** The driver for each device key `accepted` can resolve: its native protocol, else its legacy class. */
12
- const createDrivers = accepted => {
13
- const creator = new _deviceCreator.DeviceCreator(accepted);
14
- return deviceName => {
15
- const protocol = _sigProfiles.SIG_PROTOCOLS.get(String(deviceName));
16
- return protocol ? (0, _driver.gattDriver)(deviceName, protocol) : (0, _legacyDriver.legacyDriver)(creator, deviceName);
17
- };
18
- };
19
- exports.createDrivers = createDrivers;
20
- //# sourceMappingURL=drivers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_deviceCreator","require","_driver","_legacyDriver","_sigProfiles","createDrivers","accepted","creator","DeviceCreator","deviceName","protocol","SIG_PROTOCOLS","get","String","gattDriver","legacyDriver","exports"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/drivers.ts"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAIA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAEA;AACA,MAAMI,aAAa,GAAIC,QAAmC,IAA0C;EAClG,MAAMC,OAAO,GAAG,IAAIC,4BAAa,CAACF,QAAQ,CAAC;EAE3C,OAAQG,UAAU,IAAK;IACrB,MAAMC,QAAQ,GAAGC,0BAAa,CAACC,GAAG,CAACC,MAAM,CAACJ,UAAU,CAAC,CAAC;IAEtD,OAAOC,QAAQ,GAAG,IAAAI,kBAAU,EAACL,UAAU,EAAEC,QAAQ,CAAC,GAAG,IAAAK,0BAAY,EAACR,OAAO,EAAEE,UAAU,CAAC;EACxF,CAAC;AACH,CAAC;AAACO,OAAA,CAAAX,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -1,55 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.legacyDriver = void 0;
7
- var _deviceStatus = require("../../bt-management/types/device-status.js");
8
- var _channel = require("./channel.js");
9
- /** Runs a device class from `@ovok/native/bt-management` until its protocol moves to a `DeviceProtocol`. */
10
- const legacyDriver = (creator, deviceName) => (device, signal) => {
11
- const events = new _channel.Channel(() => void managed.disconnect());
12
- const managed = creator.createDevice({
13
- device,
14
- deviceName,
15
- onResult: ({
16
- id,
17
- data
18
- }) => events.push({
19
- kind: "reading",
20
- id,
21
- reading: data
22
- }),
23
- onDeviceStatusChanged: ({
24
- status
25
- }) => {
26
- events.push({
27
- kind: "status",
28
- status
29
- });
30
- if (status === _deviceStatus.DeviceStatus.DISCONNECTED) {
31
- events.end();
32
- }
33
- },
34
- onConnectionEvent: ({
35
- deviceData: _deviceData,
36
- ...event
37
- }) => events.push({
38
- kind: "connection",
39
- event
40
- }),
41
- onError: ({
42
- error
43
- }) => events.push({
44
- kind: "error",
45
- error
46
- })
47
- });
48
- signal.addEventListener("abort", () => events.end(), {
49
- once: true
50
- });
51
- managed.connect().catch(error => events.fail(error));
52
- return events;
53
- };
54
- exports.legacyDriver = legacyDriver;
55
- //# sourceMappingURL=legacy-driver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_deviceStatus","require","_channel","legacyDriver","creator","deviceName","device","signal","events","Channel","managed","disconnect","createDevice","onResult","id","data","push","kind","reading","onDeviceStatusChanged","status","DeviceStatus","DISCONNECTED","end","onConnectionEvent","deviceData","_deviceData","event","onError","error","addEventListener","once","connect","catch","fail","exports"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/legacy-driver.ts"],"mappings":";;;;;;AAKA,IAAAA,aAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAGA;AACA,MAAME,YAAY,GAAGA,CAACC,OAAiD,EAAEC,UAAqB,KAC5F,CAACC,MAAM,EAAEC,MAAM,KAAK;EAClB,MAAMC,MAAM,GAAG,IAAIC,gBAAO,CAAc,MAAM,KAAKC,OAAO,CAACC,UAAU,CAAC,CAAC,CAAC;EAExE,MAAMD,OAAO,GAAGN,OAAO,CAACQ,YAAY,CAAC;IACnCN,MAAM;IACND,UAAU;IACVQ,QAAQ,EAAEA,CAAC;MAAEC,EAAE;MAAEC;IAAK,CAAC,KAAKP,MAAM,CAACQ,IAAI,CAAC;MAAEC,IAAI,EAAE,SAAS;MAAEH,EAAE;MAAEI,OAAO,EAAEH;IAAoB,CAAC,CAAC;IAC9FI,qBAAqB,EAAEA,CAAC;MAAEC;IAAO,CAAC,KAAK;MACrCZ,MAAM,CAACQ,IAAI,CAAC;QAAEC,IAAI,EAAE,QAAQ;QAAEG;MAAO,CAAC,CAAC;MACvC,IAAIA,MAAM,KAAKC,0BAAY,CAACC,YAAY,EAAE;QACxCd,MAAM,CAACe,GAAG,CAAC,CAAC;MACd;IACF,CAAC;IACDC,iBAAiB,EAAEA,CAAC;MAAEC,UAAU,EAAEC,WAAW;MAAE,GAAGC;IAAM,CAAC,KAAKnB,MAAM,CAACQ,IAAI,CAAC;MAAEC,IAAI,EAAE,YAAY;MAAEU;IAAM,CAAC,CAAC;IACxGC,OAAO,EAAEA,CAAC;MAAEC;IAAM,CAAC,KAAKrB,MAAM,CAACQ,IAAI,CAAC;MAAEC,IAAI,EAAE,OAAO;MAAEY;IAAM,CAAC;EAC9D,CAAC,CAAC;EAEFtB,MAAM,CAACuB,gBAAgB,CAAC,OAAO,EAAE,MAAMtB,MAAM,CAACe,GAAG,CAAC,CAAC,EAAE;IAAEQ,IAAI,EAAE;EAAK,CAAC,CAAC;EACpErB,OAAO,CAACsB,OAAO,CAAC,CAAC,CAACC,KAAK,CAAEJ,KAAc,IAAKrB,MAAM,CAAC0B,IAAI,CAACL,KAAK,CAAC,CAAC;EAE/D,OAAOrB,MAAM;AACf,CAAC;AAAC2B,OAAA,CAAAhC,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["dailyTotalDay","data","now","temporal","end","Date","getTime","day","start","recordedAt","toISOString","slice","undefined"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/daily-total-day.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,aAAa,GAAGA,CAC3BC,IAAY,EACZC,GAAW,KACY;EACvB,MAAMC,QAAQ,GAAGF,IAAuD;EAExE,IAAIE,QAAQ,CAACC,GAAG,YAAYC,IAAI,IAAIF,QAAQ,CAACC,GAAG,CAACE,OAAO,CAAC,CAAC,GAAGJ,GAAG,EAAE;IAChE,OAAO,QAAQ;EACjB;EAEA,MAAMK,GAAG,GAAGJ,QAAQ,CAACC,GAAG,IAAID,QAAQ,CAACK,KAAK,IAAIL,QAAQ,CAACM,UAAU;EAEjE,OAAOF,GAAG,YAAYF,IAAI,GAAGE,GAAG,CAACG,WAAW,CAAC,CAAC,CAACC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAGC,SAAS;AACzE,CAAC","ignoreList":[]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- import { DeviceCreator } from "../../bt-management/services/device-creator.js";
4
- import { gattDriver } from "./driver.js";
5
- import { legacyDriver } from "./legacy-driver.js";
6
- import { SIG_PROTOCOLS } from "./sig-profiles.js";
7
-
8
- /** The driver for each device key `accepted` can resolve: its native protocol, else its legacy class. */
9
- const createDrivers = accepted => {
10
- const creator = new DeviceCreator(accepted);
11
- return deviceName => {
12
- const protocol = SIG_PROTOCOLS.get(String(deviceName));
13
- return protocol ? gattDriver(deviceName, protocol) : legacyDriver(creator, deviceName);
14
- };
15
- };
16
- export { createDrivers };
17
- //# sourceMappingURL=drivers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["DeviceCreator","gattDriver","legacyDriver","SIG_PROTOCOLS","createDrivers","accepted","creator","deviceName","protocol","get","String"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/drivers.ts"],"mappings":";;AAAA,SAASA,aAAa,QAAQ,gDAA6C;AAI3E,SAAiBC,UAAU,QAAQ,aAAU;AAC7C,SAASC,YAAY,QAAQ,oBAAiB;AAC9C,SAASC,aAAa,QAAQ,mBAAgB;;AAE9C;AACA,MAAMC,aAAa,GAAIC,QAAmC,IAA0C;EAClG,MAAMC,OAAO,GAAG,IAAIN,aAAa,CAACK,QAAQ,CAAC;EAE3C,OAAQE,UAAU,IAAK;IACrB,MAAMC,QAAQ,GAAGL,aAAa,CAACM,GAAG,CAACC,MAAM,CAACH,UAAU,CAAC,CAAC;IAEtD,OAAOC,QAAQ,GAAGP,UAAU,CAACM,UAAU,EAAEC,QAAQ,CAAC,GAAGN,YAAY,CAACI,OAAO,EAAEC,UAAU,CAAC;EACxF,CAAC;AACH,CAAC;AAED,SAASH,aAAa","ignoreList":[]}
@@ -1,51 +0,0 @@
1
- "use strict";
2
-
3
- import { DeviceStatus } from "../../bt-management/types/device-status.js";
4
- import { Channel } from "./channel.js";
5
- /** Runs a device class from `@ovok/native/bt-management` until its protocol moves to a `DeviceProtocol`. */
6
- const legacyDriver = (creator, deviceName) => (device, signal) => {
7
- const events = new Channel(() => void managed.disconnect());
8
- const managed = creator.createDevice({
9
- device,
10
- deviceName,
11
- onResult: ({
12
- id,
13
- data
14
- }) => events.push({
15
- kind: "reading",
16
- id,
17
- reading: data
18
- }),
19
- onDeviceStatusChanged: ({
20
- status
21
- }) => {
22
- events.push({
23
- kind: "status",
24
- status
25
- });
26
- if (status === DeviceStatus.DISCONNECTED) {
27
- events.end();
28
- }
29
- },
30
- onConnectionEvent: ({
31
- deviceData: _deviceData,
32
- ...event
33
- }) => events.push({
34
- kind: "connection",
35
- event
36
- }),
37
- onError: ({
38
- error
39
- }) => events.push({
40
- kind: "error",
41
- error
42
- })
43
- });
44
- signal.addEventListener("abort", () => events.end(), {
45
- once: true
46
- });
47
- managed.connect().catch(error => events.fail(error));
48
- return events;
49
- };
50
- export { legacyDriver };
51
- //# sourceMappingURL=legacy-driver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["DeviceStatus","Channel","legacyDriver","creator","deviceName","device","signal","events","managed","disconnect","createDevice","onResult","id","data","push","kind","reading","onDeviceStatusChanged","status","DISCONNECTED","end","onConnectionEvent","deviceData","_deviceData","event","onError","error","addEventListener","once","connect","catch","fail"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/legacy-driver.ts"],"mappings":";;AAKA,SAASA,YAAY,QAAQ,4CAAyC;AAEtE,SAASC,OAAO,QAAQ,cAAW;AAGnC;AACA,MAAMC,YAAY,GAAGA,CAACC,OAAiD,EAAEC,UAAqB,KAC5F,CAACC,MAAM,EAAEC,MAAM,KAAK;EAClB,MAAMC,MAAM,GAAG,IAAIN,OAAO,CAAc,MAAM,KAAKO,OAAO,CAACC,UAAU,CAAC,CAAC,CAAC;EAExE,MAAMD,OAAO,GAAGL,OAAO,CAACO,YAAY,CAAC;IACnCL,MAAM;IACND,UAAU;IACVO,QAAQ,EAAEA,CAAC;MAAEC,EAAE;MAAEC;IAAK,CAAC,KAAKN,MAAM,CAACO,IAAI,CAAC;MAAEC,IAAI,EAAE,SAAS;MAAEH,EAAE;MAAEI,OAAO,EAAEH;IAAoB,CAAC,CAAC;IAC9FI,qBAAqB,EAAEA,CAAC;MAAEC;IAAO,CAAC,KAAK;MACrCX,MAAM,CAACO,IAAI,CAAC;QAAEC,IAAI,EAAE,QAAQ;QAAEG;MAAO,CAAC,CAAC;MACvC,IAAIA,MAAM,KAAKlB,YAAY,CAACmB,YAAY,EAAE;QACxCZ,MAAM,CAACa,GAAG,CAAC,CAAC;MACd;IACF,CAAC;IACDC,iBAAiB,EAAEA,CAAC;MAAEC,UAAU,EAAEC,WAAW;MAAE,GAAGC;IAAM,CAAC,KAAKjB,MAAM,CAACO,IAAI,CAAC;MAAEC,IAAI,EAAE,YAAY;MAAES;IAAM,CAAC,CAAC;IACxGC,OAAO,EAAEA,CAAC;MAAEC;IAAM,CAAC,KAAKnB,MAAM,CAACO,IAAI,CAAC;MAAEC,IAAI,EAAE,OAAO;MAAEW;IAAM,CAAC;EAC9D,CAAC,CAAC;EAEFpB,MAAM,CAACqB,gBAAgB,CAAC,OAAO,EAAE,MAAMpB,MAAM,CAACa,GAAG,CAAC,CAAC,EAAE;IAAEQ,IAAI,EAAE;EAAK,CAAC,CAAC;EACpEpB,OAAO,CAACqB,OAAO,CAAC,CAAC,CAACC,KAAK,CAAEJ,KAAc,IAAKnB,MAAM,CAACwB,IAAI,CAACL,KAAK,CAAC,CAAC;EAE/D,OAAOnB,MAAM;AACf,CAAC;AAEH,SAASL,YAAY","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"daily-total-day.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/utils/daily-total-day.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACxB,MAAM,MAAM,EACZ,KAAK,MAAM,KACV,MAAM,GAAG,SAUX,CAAC"}
@@ -1,7 +0,0 @@
1
- import { AcceptedDevice } from "../../bt-management/types/accepted-device";
2
- import { DeviceKey } from "../../bt-management/types/device-key";
3
- import { Driver } from "./driver";
4
- /** The driver for each device key `accepted` can resolve: its native protocol, else its legacy class. */
5
- declare const createDrivers: (accepted: readonly AcceptedDevice[]) => ((deviceName: DeviceKey) => Driver);
6
- export { createDrivers };
7
- //# sourceMappingURL=drivers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"drivers.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/drivers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAc,MAAM,UAAU,CAAC;AAI9C,yGAAyG;AACzG,QAAA,MAAM,aAAa,GAAI,UAAU,SAAS,cAAc,EAAE,KAAG,CAAC,CAAC,UAAU,EAAE,SAAS,KAAK,MAAM,CAQ9F,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1,8 +0,0 @@
1
- import { DeviceCreator } from "../../bt-management/services/device-creator";
2
- import { AcceptedDevice } from "../../bt-management/types/accepted-device";
3
- import { DeviceKey } from "../../bt-management/types/device-key";
4
- import { Driver } from "./driver";
5
- /** Runs a device class from `@ovok/native/bt-management` until its protocol moves to a `DeviceProtocol`. */
6
- declare const legacyDriver: (creator: DeviceCreator<readonly AcceptedDevice[]>, deviceName: DeviceKey) => Driver;
7
- export { legacyDriver };
8
- //# sourceMappingURL=legacy-driver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"legacy-driver.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/legacy-driver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAIjE,OAAO,EAAe,MAAM,EAAE,MAAM,UAAU,CAAC;AAE/C,4GAA4G;AAC5G,QAAA,MAAM,YAAY,GAAI,SAAS,aAAa,CAAC,SAAS,cAAc,EAAE,CAAC,EAAE,YAAY,SAAS,KAAG,MAsB9F,CAAC;AAEJ,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"daily-total-day.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/utils/daily-total-day.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACxB,MAAM,MAAM,EACZ,KAAK,MAAM,KACV,MAAM,GAAG,SAUX,CAAC"}
@@ -1,7 +0,0 @@
1
- import { AcceptedDevice } from "../../bt-management/types/accepted-device";
2
- import { DeviceKey } from "../../bt-management/types/device-key";
3
- import { Driver } from "./driver";
4
- /** The driver for each device key `accepted` can resolve: its native protocol, else its legacy class. */
5
- declare const createDrivers: (accepted: readonly AcceptedDevice[]) => ((deviceName: DeviceKey) => Driver);
6
- export { createDrivers };
7
- //# sourceMappingURL=drivers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"drivers.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/drivers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAc,MAAM,UAAU,CAAC;AAI9C,yGAAyG;AACzG,QAAA,MAAM,aAAa,GAAI,UAAU,SAAS,cAAc,EAAE,KAAG,CAAC,CAAC,UAAU,EAAE,SAAS,KAAK,MAAM,CAQ9F,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1,8 +0,0 @@
1
- import { DeviceCreator } from "../../bt-management/services/device-creator";
2
- import { AcceptedDevice } from "../../bt-management/types/accepted-device";
3
- import { DeviceKey } from "../../bt-management/types/device-key";
4
- import { Driver } from "./driver";
5
- /** Runs a device class from `@ovok/native/bt-management` until its protocol moves to a `DeviceProtocol`. */
6
- declare const legacyDriver: (creator: DeviceCreator<readonly AcceptedDevice[]>, deviceName: DeviceKey) => Driver;
7
- export { legacyDriver };
8
- //# sourceMappingURL=legacy-driver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"legacy-driver.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/legacy-driver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAIjE,OAAO,EAAe,MAAM,EAAE,MAAM,UAAU,CAAC;AAE/C,4GAA4G;AAC5G,QAAA,MAAM,YAAY,GAAI,SAAS,aAAa,CAAC,SAAS,cAAc,EAAE,CAAC,EAAE,YAAY,SAAS,KAAG,MAsB9F,CAAC;AAEJ,OAAO,EAAE,YAAY,EAAE,CAAC"}