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

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,82 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ScanLoop = void 0;
7
+ const SCAN_RETRY_DELAY_MS = 1_000;
8
+
9
+ /** Runs the scanner while a scan is requested and the adapter is on, retrying after a scan error. */
10
+ class ScanLoop {
11
+ closed = false;
12
+ constructor(scanner, store, onFound) {
13
+ this.scanner = scanner;
14
+ this.store = store;
15
+ this.onFound = onFound;
16
+ }
17
+ get running() {
18
+ return this.stop !== undefined;
19
+ }
20
+
21
+ /** Starts or stops the scanner to match the snapshot. */
22
+ sync() {
23
+ const {
24
+ scanning,
25
+ adapter
26
+ } = this.store.get();
27
+ const shouldScan = scanning && adapter === "on" && !this.closed;
28
+ if (shouldScan && !this.stop && !this.retry) {
29
+ this.start();
30
+ } else if (!shouldScan) {
31
+ this.halt();
32
+ }
33
+ }
34
+ restart() {
35
+ this.halt();
36
+ this.sync();
37
+ }
38
+ close() {
39
+ this.closed = true;
40
+ this.halt();
41
+ }
42
+
43
+ /** A scan can fail before `scan` returns its stop, so the stop is only kept for a scan still running. */
44
+ start() {
45
+ const scan = {
46
+ failed: false
47
+ };
48
+ const stop = this.scanner.scan(this.onFound, error => {
49
+ if (scan.stop === this.stop) {
50
+ scan.failed = true;
51
+ this.failed(error);
52
+ }
53
+ });
54
+ if (scan.failed) {
55
+ stop();
56
+ return;
57
+ }
58
+ scan.stop = stop;
59
+ this.stop = stop;
60
+ this.store.set({
61
+ scanError: null
62
+ });
63
+ }
64
+ failed(error) {
65
+ this.store.set({
66
+ scanError: error
67
+ });
68
+ this.halt();
69
+ this.retry = setTimeout(() => {
70
+ this.retry = undefined;
71
+ this.sync();
72
+ }, SCAN_RETRY_DELAY_MS);
73
+ }
74
+ halt() {
75
+ clearTimeout(this.retry);
76
+ this.retry = undefined;
77
+ this.stop?.();
78
+ this.stop = undefined;
79
+ }
80
+ }
81
+ exports.ScanLoop = ScanLoop;
82
+ //# sourceMappingURL=scan-loop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["SCAN_RETRY_DELAY_MS","ScanLoop","closed","constructor","scanner","store","onFound","running","stop","undefined","sync","scanning","adapter","get","shouldScan","retry","start","halt","restart","close","scan","failed","error","set","scanError","setTimeout","clearTimeout","exports"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/scan-loop.ts"],"mappings":";;;;;;AAIA,MAAMA,mBAAmB,GAAG,KAAK;;AAEjC;AACA,MAAMC,QAAQ,CAAC;EAGLC,MAAM,GAAG,KAAK;EAEfC,WAAWA,CACCC,OAAyB,EACzBC,KAAoB,EACpBC,OAAyC,EAC1D;IAAA,KAHiBF,OAAyB,GAAzBA,OAAyB;IAAA,KACzBC,KAAoB,GAApBA,KAAoB;IAAA,KACpBC,OAAyC,GAAzCA,OAAyC;EACzD;EAEH,IAAWC,OAAOA,CAAA,EAAY;IAC5B,OAAO,IAAI,CAACC,IAAI,KAAKC,SAAS;EAChC;;EAEA;EACOC,IAAIA,CAAA,EAAS;IAClB,MAAM;MAAEC,QAAQ;MAAEC;IAAQ,CAAC,GAAG,IAAI,CAACP,KAAK,CAACQ,GAAG,CAAC,CAAC;IAC9C,MAAMC,UAAU,GAAGH,QAAQ,IAAIC,OAAO,KAAK,IAAI,IAAI,CAAC,IAAI,CAACV,MAAM;IAE/D,IAAIY,UAAU,IAAI,CAAC,IAAI,CAACN,IAAI,IAAI,CAAC,IAAI,CAACO,KAAK,EAAE;MAC3C,IAAI,CAACC,KAAK,CAAC,CAAC;IACd,CAAC,MAAM,IAAI,CAACF,UAAU,EAAE;MACtB,IAAI,CAACG,IAAI,CAAC,CAAC;IACb;EACF;EAEOC,OAAOA,CAAA,EAAS;IACrB,IAAI,CAACD,IAAI,CAAC,CAAC;IACX,IAAI,CAACP,IAAI,CAAC,CAAC;EACb;EAEOS,KAAKA,CAAA,EAAS;IACnB,IAAI,CAACjB,MAAM,GAAG,IAAI;IAClB,IAAI,CAACe,IAAI,CAAC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
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=sink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/sink.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=snapshot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/snapshot.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.stableHash = void 0;
7
+ const canonicalize = value => {
8
+ if (value instanceof Date) {
9
+ return value.toISOString();
10
+ }
11
+ if (Array.isArray(value)) {
12
+ return value.map(canonicalize);
13
+ }
14
+ if (value && typeof value === "object") {
15
+ return Object.fromEntries(Object.entries(value).sort(([left], [right]) => left.localeCompare(right)).map(([key, nested]) => [key, canonicalize(nested)]));
16
+ }
17
+ return value;
18
+ };
19
+ const hash = value => {
20
+ let first = 0x811c9dc5;
21
+ let second = 0x01000193;
22
+ for (let index = 0; index < value.length; index += 1) {
23
+ const code = value.charCodeAt(index);
24
+ first = Math.imul(first ^ code, 0x01000193);
25
+ second = Math.imul(second ^ code + index, 0x811c9dc5);
26
+ }
27
+ return `${(first >>> 0).toString(16).padStart(8, "0")}${(second >>> 0).toString(16).padStart(8, "0")}`;
28
+ };
29
+
30
+ /** A short hash of `value` that ignores key order and is the same on every run. */
31
+ const stableHash = value => hash(JSON.stringify(canonicalize(value)));
32
+ exports.stableHash = stableHash;
33
+ //# sourceMappingURL=stable-hash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["canonicalize","value","Date","toISOString","Array","isArray","map","Object","fromEntries","entries","sort","left","right","localeCompare","key","nested","hash","first","second","index","length","code","charCodeAt","Math","imul","toString","padStart","stableHash","JSON","stringify","exports"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/stable-hash.ts"],"mappings":";;;;;;AAAA,MAAMA,YAAY,GAAIC,KAAc,IAAc;EAChD,IAAIA,KAAK,YAAYC,IAAI,EAAE;IACzB,OAAOD,KAAK,CAACE,WAAW,CAAC,CAAC;EAC5B;EAEA,IAAIC,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,EAAE;IACxB,OAAOA,KAAK,CAACK,GAAG,CAACN,YAAY,CAAC;EAChC;EAEA,IAAIC,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IACtC,OAAOM,MAAM,CAACC,WAAW,CACvBD,MAAM,CAACE,OAAO,CAACR,KAAK,CAAC,CAClBS,IAAI,CAAC,CAAC,CAACC,IAAI,CAAC,EAAE,CAACC,KAAK,CAAC,KAAKD,IAAI,CAACE,aAAa,CAACD,KAAK,CAAC,CAAC,CACpDN,GAAG,CAAC,CAAC,CAACQ,GAAG,EAAEC,MAAM,CAAC,KAAK,CAACD,GAAG,EAAEd,YAAY,CAACe,MAAM,CAAC,CAAC,CACvD,CAAC;EACH;EAEA,OAAOd,KAAK;AACd,CAAC;AAED,MAAMe,IAAI,GAAIf,KAAa,IAAa;EACtC,IAAIgB,KAAK,GAAG,UAAU;EACtB,IAAIC,MAAM,GAAG,UAAU;EAEvB,KAAK,IAAIC,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAGlB,KAAK,CAACmB,MAAM,EAAED,KAAK,IAAI,CAAC,EAAE;IACpD,MAAME,IAAI,GAAGpB,KAAK,CAACqB,UAAU,CAACH,KAAK,CAAC;IAEpCF,KAAK,GAAGM,IAAI,CAACC,IAAI,CAACP,KAAK,GAAGI,IAAI,EAAE,UAAU,CAAC;IAC3CH,MAAM,GAAGK,IAAI,CAACC,IAAI,CAACN,MAAM,GAAIG,IAAI,GAAGF,KAAM,EAAE,UAAU,CAAC;EACzD;EAEA,OAAO,GAAG,CAACF,KAAK,KAAK,CAAC,EAAEQ,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CACtDR,MAAM,KAAK,CAAC,EACZO,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE;AACnC,CAAC;;AAED;AACO,MAAMC,UAAU,GAAI1B,KAAc,IAAae,IAAI,CAACY,IAAI,CAACC,SAAS,CAAC7B,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC;AAAC6B,OAAA,CAAAH,UAAA,GAAAA,UAAA","ignoreList":[]}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SnapshotStore = void 0;
7
+ const INITIAL = {
8
+ adapter: "unknown",
9
+ permission: "unknown",
10
+ scanning: false,
11
+ scanError: null,
12
+ devices: [],
13
+ paired: [],
14
+ readings: []
15
+ };
16
+
17
+ /** The runtime's snapshot and its listeners; once closed, it no longer changes. */
18
+ class SnapshotStore {
19
+ snapshot = INITIAL;
20
+ listeners = new Set();
21
+ closed = false;
22
+ get() {
23
+ return this.snapshot;
24
+ }
25
+ subscribe(listener) {
26
+ this.listeners.add(listener);
27
+ return () => this.listeners.delete(listener);
28
+ }
29
+ set(patch) {
30
+ if (this.closed) {
31
+ return;
32
+ }
33
+ this.snapshot = {
34
+ ...this.snapshot,
35
+ ...patch
36
+ };
37
+ this.listeners.forEach(listener => listener());
38
+ }
39
+ device(id) {
40
+ return this.snapshot.devices.find(device => device.id === id);
41
+ }
42
+ updateDevice(id, patch) {
43
+ this.set({
44
+ devices: this.snapshot.devices.map(device => device.id === id ? {
45
+ ...device,
46
+ ...patch
47
+ } : device)
48
+ });
49
+ }
50
+ updateReadings(update) {
51
+ this.set({
52
+ readings: this.snapshot.readings.map(update)
53
+ });
54
+ }
55
+ close() {
56
+ this.closed = true;
57
+ this.listeners.clear();
58
+ }
59
+ }
60
+ exports.SnapshotStore = SnapshotStore;
61
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["INITIAL","adapter","permission","scanning","scanError","devices","paired","readings","SnapshotStore","snapshot","listeners","Set","closed","get","subscribe","listener","add","delete","set","patch","forEach","device","id","find","updateDevice","map","updateReadings","update","close","clear","exports"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/store.ts"],"mappings":";;;;;;AAEA,MAAMA,OAA0B,GAAG;EACjCC,OAAO,EAAE,SAAS;EAClBC,UAAU,EAAE,SAAS;EACrBC,QAAQ,EAAE,KAAK;EACfC,SAAS,EAAE,IAAI;EACfC,OAAO,EAAE,EAAE;EACXC,MAAM,EAAE,EAAE;EACVC,QAAQ,EAAE;AACZ,CAAC;;AAED;AACA,MAAMC,aAAa,CAAC;EACVC,QAAQ,GAAGT,OAAO;EACTU,SAAS,GAAG,IAAIC,GAAG,CAAa,CAAC;EAC1CC,MAAM,GAAG,KAAK;EAEfC,GAAGA,CAAA,EAAsB;IAC9B,OAAO,IAAI,CAACJ,QAAQ;EACtB;EAEOK,SAASA,CAACC,QAAoB,EAAc;IACjD,IAAI,CAACL,SAAS,CAACM,GAAG,CAACD,QAAQ,CAAC;IAE5B,OAAO,MAAM,IAAI,CAACL,SAAS,CAACO,MAAM,CAACF,QAAQ,CAAC;EAC9C;EAEOG,GAAGA,CAACC,KAAiC,EAAQ;IAClD,IAAI,IAAI,CAACP,MAAM,EAAE;MACf;IACF;IAEA,IAAI,CAACH,QAAQ,GAAG;MAAE,GAAG,IAAI,CAACA,QAAQ;MAAE,GAAGU;IAAM,CAAC;IAC9C,IAAI,CAACT,SAAS,CAACU,OAAO,CAAEL,QAAQ,IAAKA,QAAQ,CAAC,CAAC,CAAC;EAClD;EAEOM,MAAMA,CAACC,EAAU,EAA4B;IAClD,OAAO,IAAI,CAACb,QAAQ,CAACJ,OAAO,CAACkB,IAAI,CAAEF,MAAM,IAAKA,MAAM,CAACC,EAAE,KAAKA,EAAE,CAAC;EACjE;EAEOE,YAAYA,CAACF,EAAU,EAAEH,KAA4B,EAAQ;IAClE,IAAI,CAACD,GAAG,CAAC;MAAEb,OAAO,EAAE,IAAI,CAACI,QAAQ,CAACJ,OAAO,CAACoB,GAAG,CAAEJ,MAAM,IAAMA,MAAM,CAACC,EAAE,KAAKA,EAAE,GAAG;QAAE,GAAGD,MAAM;QAAE,GAAGF;MAAM,CAAC,GAAGE,MAAO;IAAE,CAAC,CAAC;EACrH;EAEOK,cAAcA,CAACC,MAAiD,EAAQ;IAC7E,IAAI,CAACT,GAAG,CAAC;MAAEX,QAAQ,EAAE,IAAI,CAACE,QAAQ,CAACF,QAAQ,CAACkB,GAAG,CAACE,MAAM;IAAE,CAAC,CAAC;EAC5D;EAEOC,KAAKA,CAAA,EAAS;IACnB,IAAI,CAAChB,MAAM,GAAG,IAAI;IAClB,IAAI,CAACF,SAAS,CAACmB,KAAK,CAAC,CAAC;EACxB;AACF;AAACC,OAAA,CAAAtB,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=transport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/transport.ts"],"mappings":"","ignoreList":[]}
@@ -71,7 +71,9 @@ export const AndroidBluetoothForegroundService = ({
71
71
  return () => {
72
72
  cancelled = true;
73
73
  foregroundSubscription?.remove();
74
- void getNativeModule().stopBluetoothForegroundService().catch(error => {
74
+
75
+ // Deferred so a missing native module reports through onError instead of throwing in cleanup.
76
+ void Promise.resolve().then(() => getNativeModule().stopBluetoothForegroundService()).catch(error => {
75
77
  onErrorRef.current?.({
76
78
  error: toBluetoothError(error)
77
79
  });
@@ -1 +1 @@
1
- {"version":3,"names":["React","AppState","NativeModules","Platform","toBluetoothError","Fragment","_Fragment","jsx","_jsx","getNativeModule","nativeModule","OvokBackgroundSync","Error","AndroidBluetoothForegroundService","enabled","children","options","onError","onErrorRef","useRef","current","notificationBody","notificationTitle","requestBatteryOptimizationExemption","useEffect","OS","cancelled","requestExemption","currentState","requestIgnoreBatteryOptimizations","error","start","startBluetoothForegroundService","undefined","foregroundSubscription","addEventListener","state","catch","remove","stopBluetoothForegroundService"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/components/android-bluetooth-foreground-service.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAIhE,SAASC,gBAAgB,QAAQ,6BAA0B;AAAC,SAAAC,QAAA,IAAAC,SAAA,EAAAC,GAAA,IAAAC,IAAA;AAgB5D,MAAMC,eAAe,GAAGA,CAAA,KAAkC;EACxD,MAAMC,YAAY,GAAGR,aAAa,CAACS,kBACK;EAExC,IAAI,CAACD,YAAY,EAAE;IACjB,MAAM,IAAIE,KAAK,CACb,8GACF,CAAC;EACH;EAEA,OAAOF,YAAY;AACrB,CAAC;AAED,OAAO,MAAMG,iCAAiC,GAAGA,CAAC;EAChDC,OAAO;EACPC,QAAQ;EACRC,OAAO;EACPC;AAKD,CAAC,KAAK;EACL,MAAMC,UAAU,GAAGlB,KAAK,CAACmB,MAAM,CAACF,OAAO,CAAC;EAExCC,UAAU,CAACE,OAAO,GAAGH,OAAO;EAE5B,MAAMI,gBAAgB,GAAGL,OAAO,EAAEK,gBAAgB;EAClD,MAAMC,iBAAiB,GAAGN,OAAO,EAAEM,iBAAiB;EAEpD,MAAMC,mCAAmC,GACvCP,OAAO,EAAEO,mCAAmC,KAAK,IAAI;EAEvDvB,KAAK,CAACwB,SAAS,CAAC,MAAM;IACpB,IAAIrB,QAAQ,CAACsB,EAAE,KAAK,SAAS,IAAI,CAACX,OAAO,EAAE;MACzC;IACF;IAEA,IAAIY,SAAS,GAAG,KAAK;IAErB,MAAMC,gBAAgB,GAAG,MAAAA,CAAA,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MAAM,CAAC,CAAC;MAChC,KAAK7B,eAAe,CAAC,CAAC,CACnB8B,8BAA8B,CAAC,CAAC,CAChCF,KAAK,CAAEP,KAAc,IAAK;QACzBZ,UAAU,CAACE,OAAO,GAAG;UAAEU,KAAK,EAAE1B,gBAAgB,CAAC0B,KAAK;QAAE,CAAC,CAAC;MAC1D,CAAC,CAAC;IACN,CAAC;EACH,CAAC,EAAE,CACDhB,OAAO,EACPO,gBAAgB,EAChBC,iBAAiB,EACjBC,mCAAmC,CACpC,CAAC;EAEF,oBAAOf,IAAA,CAAAF,SAAA;IAAAS,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","AppState","NativeModules","Platform","toBluetoothError","Fragment","_Fragment","jsx","_jsx","getNativeModule","nativeModule","OvokBackgroundSync","Error","AndroidBluetoothForegroundService","enabled","children","options","onError","onErrorRef","useRef","current","notificationBody","notificationTitle","requestBatteryOptimizationExemption","useEffect","OS","cancelled","requestExemption","currentState","requestIgnoreBatteryOptimizations","error","start","startBluetoothForegroundService","undefined","foregroundSubscription","addEventListener","state","catch","remove","Promise","resolve","then","stopBluetoothForegroundService"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/components/android-bluetooth-foreground-service.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAIhE,SAASC,gBAAgB,QAAQ,6BAA0B;AAAC,SAAAC,QAAA,IAAAC,SAAA,EAAAC,GAAA,IAAAC,IAAA;AAgB5D,MAAMC,eAAe,GAAGA,CAAA,KAAkC;EACxD,MAAMC,YAAY,GAAGR,aAAa,CAACS,kBACK;EAExC,IAAI,CAACD,YAAY,EAAE;IACjB,MAAM,IAAIE,KAAK,CACb,8GACF,CAAC;EACH;EAEA,OAAOF,YAAY;AACrB,CAAC;AAED,OAAO,MAAMG,iCAAiC,GAAGA,CAAC;E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,CAAC;MAClE,CAAC,CAAC;IACJ,CAAC;IAED,MAAMY,sBAAsB,GAAGX,mCAAmC,GAC9DtB,QAAQ,CAACkC,gBAAgB,CAAC,QAAQ,EAAGC,KAAK,IAAK;MAC7C,IAAIA,KAAK,KAAK,QAAQ,EAAE;QACtB,KAAKT,gBAAgB,CAAC,CAAC;MACzB;IACF,CAAC,CAAC,GACFM,SAAS;IAEb,KAAKF,KAAK,CAAC,CAAC,CAACM,KAAK,CAAEP,KAAc,IAAK;MACrC,IAAI,CAACJ,SAAS,EAAE;QACdR,UAAU,CAACE,OAAO,GAAG;UAAEU,KAAK,EAAE1B,gBAAgB,CAAC0B,KAAK;QAAE,CAAC,CAAC;MAC1D;IACF,CAAC,CAAC;IAEF,OAAO,MAAM;MACXJ,SAAS,GAAG,IAAI;MAChBQ,sBAAsB,EAAEI,MAAM,CAAC,CAAC;;MAEhC;MACA,KAAKC,OAAO,CAACC,OAAO,CAAC,CAAC,CACnBC,IAAI,CAAC,MAAMhC,eAAe,CAAC,CAAC,CAACiC,8BAA8B,CAAC,CAAC,CAAC,CAC9DL,KAAK,CAAEP,KAAc,IAAK;QACzBZ,UAAU,CAACE,OAAO,GAAG;UAAEU,KAAK,EAAE1B,gBAAgB,CAAC0B,KAAK;QAAE,CAAC,CAAC;MAC1D,CAAC,CAAC;IACN,CAAC;EACH,CAAC,EAAE,CACDhB,OAAO,EACPO,gBAAgB,EAChBC,iBAAiB,EACjBC,mCAAmC,CACpC,CAAC;EAEF,oBAAOf,IAAA,CAAAF,SAAA;IAAAS,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB,CAAC","ignoreList":[]}
@@ -1,158 +1,26 @@
1
1
  "use strict";
2
2
 
3
3
  import * as React from "react";
4
- import { FlatList, Image, Modal, Pressable, SafeAreaView, StyleSheet, View } from "react-native";
5
- import { Button as PaperButton, Text as PaperText } from "react-native-paper";
6
- import { useOvokUi } from "../../ui/use-ovok-ui.js";
7
4
  import { deviceTitle } from "../utils/device-title.js";
5
+ import { DevicePickerSheet } from "./device-picker-sheet.js";
8
6
 
9
7
  /** Props of {@link BluetoothDevicePicker}. */
10
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
8
+ import { jsx as _jsx } from "react/jsx-runtime";
11
9
  /**
12
10
  * A theme-aware picker for BTManager's multi-device auto-connect callback.
13
11
  *
14
12
  * @group Components
15
13
  */
16
14
  export const BluetoothDevicePicker = ({
17
- devices,
18
- visible,
19
15
  title = "Choose a device",
20
- onSelect,
21
- onDismiss,
22
16
  dismissLabel = "Not now",
23
- getDeviceImage,
24
17
  labelForDevice = device => deviceTitle(device.deviceData),
25
- renderRow,
26
- testID,
27
- ...uiProps
28
- }) => {
29
- const {
30
- theme,
31
- slots
32
- } = useOvokUi(uiProps);
33
- const Button = slots.Button ?? PaperButton;
34
- const Text = slots.Text ?? PaperText;
35
- const renderDefaultRow = item => {
36
- const image = getDeviceImage?.(item);
37
- const name = labelForDevice(item);
38
- const model = item.deviceData.model;
39
- return /*#__PURE__*/_jsxs(Pressable, {
40
- accessibilityRole: "button",
41
- onPress: () => onSelect(item),
42
- style: ({
43
- pressed
44
- }) => [styles.row, pressed && styles.pressed],
45
- children: [image ? /*#__PURE__*/_jsx(Image, {
46
- accessibilityLabel: name,
47
- source: {
48
- uri: image
49
- },
50
- style: styles.image
51
- }) : null, /*#__PURE__*/_jsxs(View, {
52
- style: styles.deviceCopy,
53
- children: [/*#__PURE__*/_jsx(Text, {
54
- theme: theme,
55
- children: name
56
- }), model && model !== name ? /*#__PURE__*/_jsx(Text, {
57
- theme: theme,
58
- variant: "bodySmall",
59
- children: model
60
- }) : null]
61
- })]
62
- });
63
- };
64
- const renderItem = ({
65
- item
66
- }) => {
67
- const row = renderRow?.(item, {
68
- select: () => onSelect(item)
69
- });
70
- return row === undefined ? renderDefaultRow(item) : /*#__PURE__*/_jsx(_Fragment, {
71
- children: row
72
- });
73
- };
74
- return /*#__PURE__*/_jsx(Modal, {
75
- visible: visible,
76
- transparent: true,
77
- animationType: "slide",
78
- onRequestClose: onDismiss,
79
- testID: testID,
80
- children: /*#__PURE__*/_jsx(Pressable, {
81
- style: styles.overlay,
82
- onPress: onDismiss,
83
- testID: testID ? `${testID}-backdrop` : undefined,
84
- children: /*#__PURE__*/_jsx(SafeAreaView, {
85
- style: styles.safeArea,
86
- onStartShouldSetResponder: () => true,
87
- children: /*#__PURE__*/_jsxs(View, {
88
- style: [styles.card, {
89
- backgroundColor: theme.colors.background
90
- }],
91
- children: [/*#__PURE__*/_jsxs(View, {
92
- style: styles.header,
93
- children: [/*#__PURE__*/_jsx(Text, {
94
- theme: theme,
95
- variant: "titleMedium",
96
- style: {
97
- color: theme.colors.onBackground
98
- },
99
- children: title
100
- }), onDismiss && /*#__PURE__*/_jsx(Button, {
101
- theme: theme,
102
- mode: "text",
103
- onPress: onDismiss,
104
- accessibilityLabel: dismissLabel,
105
- children: dismissLabel
106
- })]
107
- }), /*#__PURE__*/_jsx(FlatList, {
108
- data: devices,
109
- keyExtractor: device => device.id,
110
- renderItem: renderItem
111
- })]
112
- })
113
- })
114
- })
115
- });
116
- };
117
- const styles = StyleSheet.create({
118
- overlay: {
119
- flex: 1,
120
- justifyContent: "flex-end",
121
- backgroundColor: "#0008"
122
- },
123
- safeArea: {
124
- maxHeight: "70%"
125
- },
126
- card: {
127
- padding: 20,
128
- borderTopLeftRadius: 18,
129
- borderTopRightRadius: 18
130
- },
131
- header: {
132
- alignItems: "center",
133
- flexDirection: "row",
134
- justifyContent: "space-between",
135
- marginBottom: 12
136
- },
137
- row: {
138
- alignItems: "center",
139
- flexDirection: "row",
140
- gap: 12,
141
- paddingVertical: 16,
142
- borderBottomWidth: StyleSheet.hairlineWidth,
143
- borderBottomColor: "#8888"
144
- },
145
- image: {
146
- borderRadius: 8,
147
- height: 48,
148
- width: 48
149
- },
150
- deviceCopy: {
151
- flex: 1,
152
- gap: 2
153
- },
154
- pressed: {
155
- opacity: 0.6
156
- }
18
+ ...props
19
+ }) => /*#__PURE__*/_jsx(DevicePickerSheet, {
20
+ ...props,
21
+ title: title,
22
+ dismissLabel: dismissLabel,
23
+ labelForDevice: labelForDevice,
24
+ modelForDevice: device => device.deviceData.model
157
25
  });
158
26
  //# sourceMappingURL=bluetooth-device-picker.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","FlatList","Image","Modal","Pressable","SafeAreaView","StyleSheet","View","Button","PaperButton","Text","PaperText","useOvokUi","deviceTitle","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","BluetoothDevicePicker","devices","visible","title","onSelect","onDismiss","dismissLabel","getDeviceImage","labelForDevice","device","deviceData","renderRow","testID","uiProps","theme","slots","renderDefaultRow","item","image","name","model","accessibilityRole","onPress","style","pressed","styles","row","children","accessibilityLabel","source","uri","deviceCopy","variant","renderItem","select","undefined","transparent","animationType","onRequestClose","overlay","safeArea","onStartShouldSetResponder","card","backgroundColor","colors","background","header","color","onBackground","mode","data","keyExtractor","id","create","flex","justifyContent","maxHeight","padding","borderTopLeftRadius","borderTopRightRadius","alignItems","flexDirection","marginBottom","gap","paddingVertical","borderBottomWidth","hairlineWidth","borderBottomColor","borderRadius","height","width","opacity"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/components/bluetooth-device-picker.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SACEC,QAAQ,EACRC,KAAK,EACLC,KAAK,EACLC,SAAS,EACTC,YAAY,EACZC,UAAU,EACVC,IAAI,QACC,cAAc;AACrB,SACEC,MAAM,IAAIC,WAAW,EACrBC,IAAI,IAAIC,SAAS,QACZ,oBAAoB;AAK3B,SAASC,SAAS,QAAQ,yBAAsB;AAChD,SAASC,WAAW,QAAQ,0BAAuB;;AAEnD;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAqCA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,GAAG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Ae,EAAE,EAAE;IAAEC,iBAAiB,EAAE/E,UAAU,CAACgF,aAAa;IAAEC,iBAAiB,EAAE;EAAQ,CAAC;EAC1JjD,KAAK,EAAE;IAAEkD,YAAY,EAAE,CAAC;IAAEC,MAAM,EAAE,EAAE;IAAEC,KAAK,EAAE;EAAG,CAAC;EACjDvC,UAAU,EAAE;IAAEuB,IAAI,EAAE,CAAC;IAAES,GAAG,EAAE;EAAE,CAAC;EAC/BvC,OAAO,EAAE;IAAE+C,OAAO,EAAE;EAAI;AAC1B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","deviceTitle","DevicePickerSheet","jsx","_jsx","BluetoothDevicePicker","title","dismissLabel","labelForDevice","device","deviceData","props","modelForDevice","model"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/components/bluetooth-device-picker.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAK9B,SAASC,WAAW,QAAQ,0BAAuB;AAEnD,SAASC,iBAAiB,QAAQ,0BAAuB;;AAEzD;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAqCA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,GAAGA,CAAC;EACpCC,KAAK,GAAG,iBAAiB;EACzBC,YAAY,GAAG,SAAS;EACxBC,cAAc,GAAIC,MAAM,IAAKR,WAAW,CAACQ,MAAM,CAACC,UAAU,CAAC;EAC3D,GAAGC;AACuB,CAAC,kBAC3BP,IAAA,CAACF,iBAAiB;EAAA,GACZS,KAAK;EACTL,KAAK,EAAEA,KAAM;EACbC,YAAY,EAAEA,YAAa;EAC3BC,cAAc,EAAEA,cAAe;EAC/BI,cAAc,EAAGH,MAAM,IAAKA,MAAM,CAACC,UAAU,CAACG;AAAM,CACrD,CACF","ignoreList":[]}
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+
3
+ import * as React from "react";
4
+ import { FlatList, Image, Modal, Pressable, SafeAreaView, StyleSheet, View } from "react-native";
5
+ import { Button as PaperButton, Text as PaperText } from "react-native-paper";
6
+ import { useOvokUi } from "../../ui/use-ovok-ui.js";
7
+
8
+ /** Props of the bottom-sheet device list both Bluetooth pickers render. */
9
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
10
+ /** A theme-aware bottom sheet listing devices to pick from. */
11
+ export const DevicePickerSheet = ({
12
+ devices,
13
+ visible,
14
+ title,
15
+ onSelect,
16
+ onDismiss,
17
+ dismissLabel,
18
+ getDeviceImage,
19
+ labelForDevice,
20
+ modelForDevice,
21
+ renderRow,
22
+ testID,
23
+ ...uiProps
24
+ }) => {
25
+ const {
26
+ theme,
27
+ slots
28
+ } = useOvokUi(uiProps);
29
+ const Button = slots.Button ?? PaperButton;
30
+ const Text = slots.Text ?? PaperText;
31
+ const renderDefaultRow = item => {
32
+ const image = getDeviceImage?.(item);
33
+ const name = labelForDevice(item);
34
+ const model = modelForDevice(item);
35
+ return /*#__PURE__*/_jsxs(Pressable, {
36
+ accessibilityRole: "button",
37
+ onPress: () => onSelect(item),
38
+ style: ({
39
+ pressed
40
+ }) => [styles.row, pressed && styles.pressed],
41
+ children: [image ? /*#__PURE__*/_jsx(Image, {
42
+ accessibilityLabel: name,
43
+ source: {
44
+ uri: image
45
+ },
46
+ style: styles.image
47
+ }) : null, /*#__PURE__*/_jsxs(View, {
48
+ style: styles.deviceCopy,
49
+ children: [/*#__PURE__*/_jsx(Text, {
50
+ theme: theme,
51
+ children: name
52
+ }), model && model !== name ? /*#__PURE__*/_jsx(Text, {
53
+ theme: theme,
54
+ variant: "bodySmall",
55
+ children: model
56
+ }) : null]
57
+ })]
58
+ });
59
+ };
60
+ const renderItem = ({
61
+ item
62
+ }) => {
63
+ const row = renderRow?.(item, {
64
+ select: () => onSelect(item)
65
+ });
66
+ return row === undefined ? renderDefaultRow(item) : /*#__PURE__*/_jsx(_Fragment, {
67
+ children: row
68
+ });
69
+ };
70
+ return /*#__PURE__*/_jsx(Modal, {
71
+ visible: visible,
72
+ transparent: true,
73
+ animationType: "slide",
74
+ onRequestClose: onDismiss,
75
+ testID: testID,
76
+ children: /*#__PURE__*/_jsx(Pressable, {
77
+ style: styles.overlay,
78
+ onPress: onDismiss,
79
+ testID: testID ? `${testID}-backdrop` : undefined,
80
+ children: /*#__PURE__*/_jsx(SafeAreaView, {
81
+ style: styles.safeArea,
82
+ onStartShouldSetResponder: () => true,
83
+ children: /*#__PURE__*/_jsxs(View, {
84
+ style: [styles.card, {
85
+ backgroundColor: theme.colors.background
86
+ }],
87
+ children: [/*#__PURE__*/_jsxs(View, {
88
+ style: styles.header,
89
+ children: [/*#__PURE__*/_jsx(Text, {
90
+ theme: theme,
91
+ variant: "titleMedium",
92
+ style: {
93
+ color: theme.colors.onBackground
94
+ },
95
+ children: title
96
+ }), onDismiss && /*#__PURE__*/_jsx(Button, {
97
+ theme: theme,
98
+ mode: "text",
99
+ onPress: onDismiss,
100
+ accessibilityLabel: dismissLabel,
101
+ children: dismissLabel
102
+ })]
103
+ }), /*#__PURE__*/_jsx(FlatList, {
104
+ data: devices,
105
+ keyExtractor: device => device.id,
106
+ renderItem: renderItem
107
+ })]
108
+ })
109
+ })
110
+ })
111
+ });
112
+ };
113
+ const styles = StyleSheet.create({
114
+ overlay: {
115
+ flex: 1,
116
+ justifyContent: "flex-end",
117
+ backgroundColor: "#0008"
118
+ },
119
+ safeArea: {
120
+ maxHeight: "70%"
121
+ },
122
+ card: {
123
+ padding: 20,
124
+ borderTopLeftRadius: 18,
125
+ borderTopRightRadius: 18
126
+ },
127
+ header: {
128
+ alignItems: "center",
129
+ flexDirection: "row",
130
+ justifyContent: "space-between",
131
+ marginBottom: 12
132
+ },
133
+ row: {
134
+ alignItems: "center",
135
+ flexDirection: "row",
136
+ gap: 12,
137
+ paddingVertical: 16,
138
+ borderBottomWidth: StyleSheet.hairlineWidth,
139
+ borderBottomColor: "#8888"
140
+ },
141
+ image: {
142
+ borderRadius: 8,
143
+ height: 48,
144
+ width: 48
145
+ },
146
+ deviceCopy: {
147
+ flex: 1,
148
+ gap: 2
149
+ },
150
+ pressed: {
151
+ opacity: 0.6
152
+ }
153
+ });
154
+ //# sourceMappingURL=device-picker-sheet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","FlatList","Image","Modal","Pressable","SafeAreaView","StyleSheet","View","Button","PaperButton","Text","PaperText","useOvokUi","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","DevicePickerSheet","devices","visible","title","onSelect","onDismiss","dismissLabel","getDeviceImage","labelForDevice","modelForDevice","renderRow","testID","uiProps","theme","slots","renderDefaultRow","item","image","name","model","accessibilityRole","onPress","style","pressed","styles","row","children","accessibilityLabel","source","uri","deviceCopy","variant","renderItem","select","undefined","transparent","animationType","onRequestClose","overlay","safeArea","onStartShouldSetResponder","card","backgroundColor","colors","background","header","color","onBackground","mode","data","keyExtractor","device","id","create","flex","justifyContent","maxHeight","padding","borderTopLeftRadius","borderTopRightRadius","alignItems","flexDirection","marginBottom","gap","paddingVertical","borderBottomWidth","hairlineWidth","borderBottomColor","borderRadius","height","width","opacity"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/components/device-picker-sheet.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SACEC,QAAQ,EACRC,KAAK,EACLC,KAAK,EACLC,SAAS,EACTC,YAAY,EACZC,UAAU,EACVC,IAAI,QACC,cAAc;AACrB,SACEC,MAAM,IAAIC,WAAW,EACrBC,IAAI,IAAIC,SAAS,QACZ,oBAAoB;AAI3B,SAASC,SAAS,QAAQ,yBAAsB;;AAEhD;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAeA;AACA,OAAO,MAAMC,iBAAiB,GAAGA,CAAgC;EAC/DC,OAAO;EACPC,OAAO;EACPC,KAAK;EACLC,QAAQ;EACRC,SAAS;EACTC,YAAY;EACZC,cAAc;EACdC,cAAc;EACdC,cAAc;EACdC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AAU,EAAE;IAAEwB,IAAI,EAAE,CAAC;IAAES,GAAG,EAAE;EAAE,CAAC;EAC/BxC,OAAO,EAAE;IAAEgD,OAAO,EAAE;EAAI;AAC1B,CAAC,CAAC","ignoreList":[]}
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
 
3
3
  import * as React from "react";
4
- import { AppState, Linking, Platform } from "react-native";
5
- import { PERMISSIONS, requestMultiple } from "react-native-permissions";
4
+ import { AppState, Linking } from "react-native";
5
+ import { requestMultiple } from "react-native-permissions";
6
6
  import { BluetoothPermissionStatus } from "../types/bluetooth-permission-status.js";
7
+ import { bluetoothPermissionList } from "../utils/bluetooth-permission-list.js";
7
8
 
8
9
  /** Options for `useBluetoothPermission`. */
9
10
 
@@ -12,7 +13,7 @@ const requestBluetoothPermissionResult = () => {
12
13
  if (sharedPermissionRequest) {
13
14
  return sharedPermissionRequest;
14
15
  }
15
- const requestedPermissions = Platform.OS === "android" ? Number(Platform.Version) >= 31 ? [PERMISSIONS.ANDROID.BLUETOOTH_CONNECT, PERMISSIONS.ANDROID.BLUETOOTH_SCAN] : [PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION] : Platform.OS === "ios" ? [PERMISSIONS.IOS.BLUETOOTH] : [];
16
+ const requestedPermissions = bluetoothPermissionList();
16
17
  const permissionRequest = requestMultiple(requestedPermissions).then(results => {
17
18
  const granted = requestedPermissions.length > 0 && requestedPermissions.every(permission => results[permission] === "granted");
18
19
  return {