@microbit/microbit-connection 0.9.0-apps.alpha.2 → 0.9.0-apps.alpha.20

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 (504) hide show
  1. package/build/cjs/async-util.d.ts +3 -1
  2. package/build/cjs/async-util.js +5 -1
  3. package/build/cjs/async-util.js.map +1 -1
  4. package/build/cjs/async-util.test.d.ts +1 -0
  5. package/build/cjs/async-util.test.js +20 -0
  6. package/build/cjs/async-util.test.js.map +1 -0
  7. package/build/cjs/availability.d.ts +14 -0
  8. package/build/cjs/availability.js +44 -0
  9. package/build/cjs/availability.js.map +1 -0
  10. package/build/cjs/bluetooth/ble-error.d.ts +10 -0
  11. package/build/cjs/bluetooth/ble-error.js +47 -0
  12. package/build/cjs/bluetooth/ble-error.js.map +1 -0
  13. package/build/cjs/bluetooth/connection.d.ts +378 -0
  14. package/build/cjs/bluetooth/connection.js +623 -0
  15. package/build/cjs/bluetooth/connection.js.map +1 -0
  16. package/build/cjs/bluetooth/connection.test.d.ts +1 -0
  17. package/build/cjs/bluetooth/connection.test.js +88 -0
  18. package/build/cjs/bluetooth/connection.test.js.map +1 -0
  19. package/build/cjs/bluetooth/device-bond-state.d.ts +14 -0
  20. package/build/cjs/bluetooth/device-bond-state.js +26 -0
  21. package/build/cjs/bluetooth/device-bond-state.js.map +1 -0
  22. package/build/cjs/{bluetooth-device-wrapper.d.ts → bluetooth/device-wrapper.d.ts} +35 -19
  23. package/build/cjs/{bluetooth-device-wrapper.js → bluetooth/device-wrapper.js} +169 -101
  24. package/build/cjs/bluetooth/device-wrapper.js.map +1 -0
  25. package/build/{esm → cjs/bluetooth}/flashing/flashing-full.d.ts +2 -2
  26. package/build/cjs/{flashing → bluetooth/flashing}/flashing-full.js +6 -5
  27. package/build/cjs/bluetooth/flashing/flashing-full.js.map +1 -0
  28. package/build/cjs/bluetooth/flashing/flashing-makecode.d.ts +10 -0
  29. package/build/cjs/{flashing → bluetooth/flashing}/flashing-makecode.js +5 -2
  30. package/build/cjs/bluetooth/flashing/flashing-makecode.js.map +1 -0
  31. package/build/cjs/bluetooth/flashing/flashing-makecode.test.d.ts +1 -0
  32. package/build/cjs/bluetooth/flashing/flashing-makecode.test.js +253 -0
  33. package/build/cjs/bluetooth/flashing/flashing-makecode.test.js.map +1 -0
  34. package/build/cjs/bluetooth/flashing/flashing-partial.d.ts +10 -0
  35. package/build/cjs/bluetooth/flashing/flashing-partial.js +145 -0
  36. package/build/cjs/bluetooth/flashing/flashing-partial.js.map +1 -0
  37. package/build/cjs/bluetooth/flashing/flashing-v1.js.map +1 -0
  38. package/build/cjs/{flashing → bluetooth/flashing}/nordic-dfu.d.ts +2 -2
  39. package/build/cjs/{flashing → bluetooth/flashing}/nordic-dfu.js +40 -14
  40. package/build/cjs/bluetooth/flashing/nordic-dfu.js.map +1 -0
  41. package/build/cjs/bluetooth/flashing/zip.js.map +1 -0
  42. package/build/cjs/bluetooth/flashing/zip.test.d.ts +1 -0
  43. package/build/cjs/bluetooth/flashing/zip.test.js +96 -0
  44. package/build/cjs/bluetooth/flashing/zip.test.js.map +1 -0
  45. package/build/cjs/bluetooth/index.d.ts +5 -0
  46. package/build/cjs/bluetooth/index.js +9 -0
  47. package/build/cjs/bluetooth/index.js.map +1 -0
  48. package/build/cjs/{bluetooth-profile.d.ts → bluetooth/profile.d.ts} +8 -0
  49. package/build/cjs/{bluetooth-profile.js → bluetooth/profile.js} +7 -1
  50. package/build/cjs/bluetooth/profile.js.map +1 -0
  51. package/build/{esm → cjs/bluetooth/services}/accelerometer-service.d.ts +2 -3
  52. package/build/cjs/{accelerometer-service.js → bluetooth/services/accelerometer-service.js} +17 -12
  53. package/build/cjs/bluetooth/services/accelerometer-service.js.map +1 -0
  54. package/build/{esm → cjs/bluetooth/services}/button-service.d.ts +2 -3
  55. package/build/cjs/{button-service.js → bluetooth/services/button-service.js} +24 -14
  56. package/build/cjs/bluetooth/services/button-service.js.map +1 -0
  57. package/build/{esm → cjs/bluetooth/services}/device-information-service.d.ts +1 -1
  58. package/build/cjs/bluetooth/services/device-information-service.js +29 -0
  59. package/build/cjs/bluetooth/services/device-information-service.js.map +1 -0
  60. package/build/cjs/{dfu-service.js → bluetooth/services/dfu-service.js} +2 -2
  61. package/build/cjs/bluetooth/services/dfu-service.js.map +1 -0
  62. package/build/cjs/bluetooth/services/event-service.d.ts +48 -0
  63. package/build/cjs/bluetooth/services/event-service.js +273 -0
  64. package/build/cjs/bluetooth/services/event-service.js.map +1 -0
  65. package/build/cjs/bluetooth/services/event-service.test.d.ts +1 -0
  66. package/build/cjs/bluetooth/services/event-service.test.js +252 -0
  67. package/build/cjs/bluetooth/services/event-service.test.js.map +1 -0
  68. package/build/cjs/bluetooth/services/io-pin-service.d.ts +65 -0
  69. package/build/cjs/bluetooth/services/io-pin-service.js +173 -0
  70. package/build/cjs/bluetooth/services/io-pin-service.js.map +1 -0
  71. package/build/cjs/{led-service.d.ts → bluetooth/services/led-service.d.ts} +2 -3
  72. package/build/cjs/{led-service.js → bluetooth/services/led-service.js} +10 -7
  73. package/build/cjs/bluetooth/services/led-service.js.map +1 -0
  74. package/build/cjs/{magnetometer-service.d.ts → bluetooth/services/magnetometer-service.d.ts} +2 -3
  75. package/build/cjs/{magnetometer-service.js → bluetooth/services/magnetometer-service.js} +19 -14
  76. package/build/cjs/bluetooth/services/magnetometer-service.js.map +1 -0
  77. package/build/{esm → cjs/bluetooth/services}/partial-flashing-service.d.ts +1 -1
  78. package/build/cjs/{partial-flashing-service.js → bluetooth/services/partial-flashing-service.js} +8 -8
  79. package/build/cjs/bluetooth/services/partial-flashing-service.js.map +1 -0
  80. package/build/cjs/bluetooth/services/temperature-service.d.ts +14 -0
  81. package/build/cjs/bluetooth/services/temperature-service.js +80 -0
  82. package/build/cjs/bluetooth/services/temperature-service.js.map +1 -0
  83. package/build/cjs/{uart-service.d.ts → bluetooth/services/uart-service.d.ts} +2 -2
  84. package/build/cjs/{uart-service.js → bluetooth/services/uart-service.js} +21 -9
  85. package/build/cjs/bluetooth/services/uart-service.js.map +1 -0
  86. package/build/cjs/board-id.d.ts +1 -1
  87. package/build/cjs/board-id.js.map +1 -1
  88. package/build/cjs/device.d.ts +214 -97
  89. package/build/cjs/device.js +57 -114
  90. package/build/cjs/device.js.map +1 -1
  91. package/build/cjs/events.d.ts +8 -108
  92. package/build/cjs/events.js +27 -88
  93. package/build/cjs/events.js.map +1 -1
  94. package/build/cjs/events.test.d.ts +1 -0
  95. package/build/cjs/events.test.js +115 -0
  96. package/build/cjs/events.test.js.map +1 -0
  97. package/build/cjs/hex-util.d.ts +1 -0
  98. package/build/cjs/hex-util.js +15 -0
  99. package/build/cjs/hex-util.js.map +1 -0
  100. package/build/cjs/index.d.ts +8 -16
  101. package/build/cjs/index.js +9 -28
  102. package/build/cjs/index.js.map +1 -1
  103. package/build/cjs/logging.js.map +1 -1
  104. package/build/cjs/microbit-events.d.ts +67 -0
  105. package/build/cjs/microbit-events.js +55 -0
  106. package/build/cjs/microbit-events.js.map +1 -0
  107. package/build/cjs/radio-bridge/connection.d.ts +52 -0
  108. package/build/cjs/{usb-radio-bridge.js → radio-bridge/connection.js} +108 -97
  109. package/build/cjs/radio-bridge/connection.js.map +1 -0
  110. package/build/cjs/radio-bridge/index.d.ts +4 -0
  111. package/build/cjs/radio-bridge/index.js +9 -0
  112. package/build/cjs/radio-bridge/index.js.map +1 -0
  113. package/build/cjs/{usb-serial-protocol.js → radio-bridge/serial-protocol.js} +1 -1
  114. package/build/cjs/radio-bridge/serial-protocol.js.map +1 -0
  115. package/build/cjs/service-events.d.ts +92 -15
  116. package/build/cjs/service-events.js +6 -36
  117. package/build/cjs/service-events.js.map +1 -1
  118. package/build/cjs/setupTests.js +8 -0
  119. package/build/cjs/setupTests.js.map +1 -1
  120. package/build/{esm/hex-flash-data-source.d.ts → cjs/universal-hex/flash-data-source.d.ts} +1 -1
  121. package/build/cjs/{hex-flash-data-source.js → universal-hex/flash-data-source.js} +6 -3
  122. package/build/cjs/universal-hex/flash-data-source.js.map +1 -0
  123. package/build/cjs/universal-hex/index.d.ts +4 -0
  124. package/build/cjs/universal-hex/index.js +9 -0
  125. package/build/cjs/universal-hex/index.js.map +1 -0
  126. package/build/cjs/usb/arm-debug.d.ts +137 -0
  127. package/build/cjs/usb/arm-debug.js +414 -0
  128. package/build/cjs/usb/arm-debug.js.map +1 -0
  129. package/build/cjs/usb/arm-debug.test.d.ts +1 -0
  130. package/build/cjs/usb/arm-debug.test.js +333 -0
  131. package/build/cjs/usb/arm-debug.test.js.map +1 -0
  132. package/build/{esm → cjs/usb}/board-serial-info.d.ts +2 -1
  133. package/build/cjs/{board-serial-info.js → usb/board-serial-info.js} +10 -7
  134. package/build/cjs/usb/board-serial-info.js.map +1 -0
  135. package/build/cjs/usb/board-serial-info.test.d.ts +1 -0
  136. package/build/cjs/usb/board-serial-info.test.js +46 -0
  137. package/build/cjs/usb/board-serial-info.test.js.map +1 -0
  138. package/build/cjs/usb/cdc-saturation.d.ts +36 -0
  139. package/build/cjs/usb/cdc-saturation.js +151 -0
  140. package/build/cjs/usb/cdc-saturation.js.map +1 -0
  141. package/build/cjs/usb/cmsis-dap.d.ts +113 -0
  142. package/build/cjs/usb/cmsis-dap.js +349 -0
  143. package/build/cjs/usb/cmsis-dap.js.map +1 -0
  144. package/build/cjs/usb/cmsis-dap.test.d.ts +1 -0
  145. package/build/cjs/usb/cmsis-dap.test.js +350 -0
  146. package/build/cjs/usb/cmsis-dap.test.js.map +1 -0
  147. package/build/cjs/usb/connection.d.ts +96 -0
  148. package/build/cjs/{usb.js → usb/connection.js} +274 -193
  149. package/build/cjs/usb/connection.js.map +1 -0
  150. package/build/cjs/usb/connection.test.d.ts +1 -0
  151. package/build/cjs/usb/connection.test.js +266 -0
  152. package/build/cjs/usb/connection.test.js.map +1 -0
  153. package/build/cjs/usb/cortex-m.d.ts +72 -0
  154. package/build/cjs/usb/cortex-m.js +165 -0
  155. package/build/cjs/usb/cortex-m.js.map +1 -0
  156. package/build/cjs/usb/cortex-m.test.d.ts +1 -0
  157. package/build/cjs/usb/cortex-m.test.js +217 -0
  158. package/build/cjs/usb/cortex-m.test.js.map +1 -0
  159. package/build/cjs/usb/daplink.d.ts +69 -0
  160. package/build/cjs/usb/daplink.js +238 -0
  161. package/build/cjs/usb/daplink.js.map +1 -0
  162. package/build/cjs/usb/daplink.test.d.ts +1 -0
  163. package/build/cjs/usb/daplink.test.js +290 -0
  164. package/build/cjs/usb/daplink.test.js.map +1 -0
  165. package/build/cjs/usb/device-wrapper.d.ts +34 -0
  166. package/build/cjs/usb/device-wrapper.js +102 -0
  167. package/build/cjs/usb/device-wrapper.js.map +1 -0
  168. package/build/cjs/usb/index.d.ts +5 -0
  169. package/build/cjs/usb/index.js +10 -0
  170. package/build/cjs/usb/index.js.map +1 -0
  171. package/build/cjs/{usb-partial-flashing-utils.d.ts → usb/partial-flashing-utils.d.ts} +6 -9
  172. package/build/cjs/{usb-partial-flashing-utils.js → usb/partial-flashing-utils.js} +6 -49
  173. package/build/cjs/usb/partial-flashing-utils.js.map +1 -0
  174. package/build/cjs/{usb-partial-flashing.d.ts → usb/partial-flashing.d.ts} +37 -11
  175. package/build/cjs/{usb-partial-flashing.js → usb/partial-flashing.js} +170 -134
  176. package/build/cjs/usb/partial-flashing.js.map +1 -0
  177. package/build/cjs/usb/promise-queue.js.map +1 -0
  178. package/build/cjs/usb/promise-queue.test.d.ts +1 -0
  179. package/build/cjs/usb/promise-queue.test.js +68 -0
  180. package/build/cjs/usb/promise-queue.test.js.map +1 -0
  181. package/build/cjs/usb/serial-events.d.ts +16 -0
  182. package/build/cjs/{led.js → usb/serial-events.js} +1 -1
  183. package/build/cjs/usb/serial-events.js.map +1 -0
  184. package/build/cjs/usb/transport.d.ts +42 -0
  185. package/build/cjs/usb/transport.js +155 -0
  186. package/build/cjs/usb/transport.js.map +1 -0
  187. package/build/esm/async-util.d.ts +3 -1
  188. package/build/esm/async-util.js +5 -1
  189. package/build/esm/async-util.js.map +1 -1
  190. package/build/esm/async-util.test.d.ts +1 -0
  191. package/build/esm/async-util.test.js +18 -0
  192. package/build/esm/async-util.test.js.map +1 -0
  193. package/build/esm/availability.d.ts +14 -0
  194. package/build/esm/availability.js +40 -0
  195. package/build/esm/availability.js.map +1 -0
  196. package/build/esm/bluetooth/ble-error.d.ts +10 -0
  197. package/build/esm/bluetooth/ble-error.js +42 -0
  198. package/build/esm/bluetooth/ble-error.js.map +1 -0
  199. package/build/esm/bluetooth/connection.d.ts +378 -0
  200. package/build/esm/bluetooth/connection.js +593 -0
  201. package/build/esm/bluetooth/connection.js.map +1 -0
  202. package/build/esm/bluetooth/connection.test.d.ts +1 -0
  203. package/build/esm/bluetooth/connection.test.js +86 -0
  204. package/build/esm/bluetooth/connection.test.js.map +1 -0
  205. package/build/esm/bluetooth/device-bond-state.d.ts +14 -0
  206. package/build/esm/bluetooth/device-bond-state.js +22 -0
  207. package/build/esm/bluetooth/device-bond-state.js.map +1 -0
  208. package/build/esm/{bluetooth-device-wrapper.d.ts → bluetooth/device-wrapper.d.ts} +35 -19
  209. package/build/esm/{bluetooth-device-wrapper.js → bluetooth/device-wrapper.js} +167 -100
  210. package/build/esm/bluetooth/device-wrapper.js.map +1 -0
  211. package/build/{cjs → esm/bluetooth}/flashing/flashing-full.d.ts +2 -2
  212. package/build/esm/{flashing → bluetooth/flashing}/flashing-full.js +6 -5
  213. package/build/esm/bluetooth/flashing/flashing-full.js.map +1 -0
  214. package/build/esm/bluetooth/flashing/flashing-makecode.d.ts +10 -0
  215. package/build/esm/{flashing → bluetooth/flashing}/flashing-makecode.js +5 -2
  216. package/build/esm/bluetooth/flashing/flashing-makecode.js.map +1 -0
  217. package/build/esm/bluetooth/flashing/flashing-makecode.test.d.ts +1 -0
  218. package/build/esm/bluetooth/flashing/flashing-makecode.test.js +248 -0
  219. package/build/esm/bluetooth/flashing/flashing-makecode.test.js.map +1 -0
  220. package/build/esm/bluetooth/flashing/flashing-partial.d.ts +10 -0
  221. package/build/esm/bluetooth/flashing/flashing-partial.js +142 -0
  222. package/build/esm/bluetooth/flashing/flashing-partial.js.map +1 -0
  223. package/build/esm/bluetooth/flashing/flashing-v1.js.map +1 -0
  224. package/build/esm/{flashing → bluetooth/flashing}/nordic-dfu.d.ts +2 -2
  225. package/build/esm/{flashing → bluetooth/flashing}/nordic-dfu.js +40 -14
  226. package/build/esm/bluetooth/flashing/nordic-dfu.js.map +1 -0
  227. package/build/esm/bluetooth/flashing/zip.js.map +1 -0
  228. package/build/esm/bluetooth/flashing/zip.test.d.ts +1 -0
  229. package/build/esm/bluetooth/flashing/zip.test.js +94 -0
  230. package/build/esm/bluetooth/flashing/zip.test.js.map +1 -0
  231. package/build/esm/bluetooth/index.d.ts +5 -0
  232. package/build/esm/bluetooth/index.js +5 -0
  233. package/build/esm/bluetooth/index.js.map +1 -0
  234. package/build/esm/{bluetooth-profile.d.ts → bluetooth/profile.d.ts} +8 -0
  235. package/build/esm/{bluetooth-profile.js → bluetooth/profile.js} +7 -1
  236. package/build/{cjs/bluetooth-profile.js.map → esm/bluetooth/profile.js.map} +1 -1
  237. package/build/{cjs → esm/bluetooth/services}/accelerometer-service.d.ts +2 -3
  238. package/build/esm/{accelerometer-service.js → bluetooth/services/accelerometer-service.js} +11 -6
  239. package/build/esm/bluetooth/services/accelerometer-service.js.map +1 -0
  240. package/build/{cjs → esm/bluetooth/services}/button-service.d.ts +2 -3
  241. package/build/esm/{button-service.js → bluetooth/services/button-service.js} +20 -10
  242. package/build/esm/bluetooth/services/button-service.js.map +1 -0
  243. package/build/{cjs → esm/bluetooth/services}/device-information-service.d.ts +1 -1
  244. package/build/esm/bluetooth/services/device-information-service.js +25 -0
  245. package/build/esm/bluetooth/services/device-information-service.js.map +1 -0
  246. package/build/esm/{dfu-service.js → bluetooth/services/dfu-service.js} +1 -1
  247. package/build/esm/bluetooth/services/dfu-service.js.map +1 -0
  248. package/build/esm/bluetooth/services/event-service.d.ts +48 -0
  249. package/build/esm/bluetooth/services/event-service.js +269 -0
  250. package/build/esm/bluetooth/services/event-service.js.map +1 -0
  251. package/build/esm/bluetooth/services/event-service.test.d.ts +1 -0
  252. package/build/esm/bluetooth/services/event-service.test.js +250 -0
  253. package/build/esm/bluetooth/services/event-service.test.js.map +1 -0
  254. package/build/esm/bluetooth/services/io-pin-service.d.ts +65 -0
  255. package/build/esm/bluetooth/services/io-pin-service.js +169 -0
  256. package/build/esm/bluetooth/services/io-pin-service.js.map +1 -0
  257. package/build/esm/{led-service.d.ts → bluetooth/services/led-service.d.ts} +2 -3
  258. package/build/esm/{led-service.js → bluetooth/services/led-service.js} +4 -1
  259. package/build/esm/bluetooth/services/led-service.js.map +1 -0
  260. package/build/esm/{magnetometer-service.d.ts → bluetooth/services/magnetometer-service.d.ts} +2 -3
  261. package/build/esm/{magnetometer-service.js → bluetooth/services/magnetometer-service.js} +11 -6
  262. package/build/esm/bluetooth/services/magnetometer-service.js.map +1 -0
  263. package/build/{cjs → esm/bluetooth/services}/partial-flashing-service.d.ts +1 -1
  264. package/build/esm/{partial-flashing-service.js → bluetooth/services/partial-flashing-service.js} +4 -4
  265. package/build/esm/bluetooth/services/partial-flashing-service.js.map +1 -0
  266. package/build/esm/bluetooth/services/temperature-service.d.ts +14 -0
  267. package/build/esm/bluetooth/services/temperature-service.js +76 -0
  268. package/build/esm/bluetooth/services/temperature-service.js.map +1 -0
  269. package/build/esm/{uart-service.d.ts → bluetooth/services/uart-service.d.ts} +2 -2
  270. package/build/esm/{uart-service.js → bluetooth/services/uart-service.js} +18 -6
  271. package/build/esm/bluetooth/services/uart-service.js.map +1 -0
  272. package/build/esm/board-id.d.ts +1 -1
  273. package/build/esm/board-id.js.map +1 -1
  274. package/build/esm/device.d.ts +214 -97
  275. package/build/esm/device.js +55 -108
  276. package/build/esm/device.js.map +1 -1
  277. package/build/esm/events.d.ts +8 -108
  278. package/build/esm/events.js +26 -86
  279. package/build/esm/events.js.map +1 -1
  280. package/build/esm/events.test.d.ts +1 -0
  281. package/build/esm/events.test.js +113 -0
  282. package/build/esm/events.test.js.map +1 -0
  283. package/build/esm/hex-util.d.ts +1 -0
  284. package/build/esm/hex-util.js +11 -0
  285. package/build/esm/hex-util.js.map +1 -0
  286. package/build/esm/index.d.ts +8 -16
  287. package/build/esm/index.js +7 -11
  288. package/build/esm/index.js.map +1 -1
  289. package/build/esm/logging.js.map +1 -1
  290. package/build/esm/microbit-events.d.ts +67 -0
  291. package/build/esm/microbit-events.js +52 -0
  292. package/build/esm/microbit-events.js.map +1 -0
  293. package/build/esm/radio-bridge/connection.d.ts +52 -0
  294. package/build/esm/{usb-radio-bridge.js → radio-bridge/connection.js} +108 -97
  295. package/build/esm/radio-bridge/connection.js.map +1 -0
  296. package/build/esm/radio-bridge/index.d.ts +4 -0
  297. package/build/esm/radio-bridge/index.js +5 -0
  298. package/build/esm/radio-bridge/index.js.map +1 -0
  299. package/build/esm/{usb-serial-protocol.js → radio-bridge/serial-protocol.js} +1 -1
  300. package/build/esm/radio-bridge/serial-protocol.js.map +1 -0
  301. package/build/esm/service-events.d.ts +92 -15
  302. package/build/esm/service-events.js +5 -34
  303. package/build/esm/service-events.js.map +1 -1
  304. package/build/esm/setupTests.js +7 -0
  305. package/build/esm/setupTests.js.map +1 -1
  306. package/build/{cjs/hex-flash-data-source.d.ts → esm/universal-hex/flash-data-source.d.ts} +1 -1
  307. package/build/esm/{hex-flash-data-source.js → universal-hex/flash-data-source.js} +6 -3
  308. package/build/esm/universal-hex/flash-data-source.js.map +1 -0
  309. package/build/esm/universal-hex/index.d.ts +4 -0
  310. package/build/esm/universal-hex/index.js +5 -0
  311. package/build/esm/universal-hex/index.js.map +1 -0
  312. package/build/esm/usb/arm-debug.d.ts +137 -0
  313. package/build/esm/usb/arm-debug.js +409 -0
  314. package/build/esm/usb/arm-debug.js.map +1 -0
  315. package/build/esm/usb/arm-debug.test.d.ts +1 -0
  316. package/build/esm/usb/arm-debug.test.js +331 -0
  317. package/build/esm/usb/arm-debug.test.js.map +1 -0
  318. package/build/{cjs → esm/usb}/board-serial-info.d.ts +2 -1
  319. package/build/esm/{board-serial-info.js → usb/board-serial-info.js} +10 -7
  320. package/build/esm/usb/board-serial-info.js.map +1 -0
  321. package/build/esm/usb/board-serial-info.test.d.ts +1 -0
  322. package/build/esm/usb/board-serial-info.test.js +44 -0
  323. package/build/esm/usb/board-serial-info.test.js.map +1 -0
  324. package/build/esm/usb/cdc-saturation.d.ts +36 -0
  325. package/build/esm/usb/cdc-saturation.js +148 -0
  326. package/build/esm/usb/cdc-saturation.js.map +1 -0
  327. package/build/esm/usb/cmsis-dap.d.ts +113 -0
  328. package/build/esm/usb/cmsis-dap.js +342 -0
  329. package/build/esm/usb/cmsis-dap.js.map +1 -0
  330. package/build/esm/usb/cmsis-dap.test.d.ts +1 -0
  331. package/build/esm/usb/cmsis-dap.test.js +348 -0
  332. package/build/esm/usb/cmsis-dap.test.js.map +1 -0
  333. package/build/esm/usb/connection.d.ts +96 -0
  334. package/build/esm/{usb.js → usb/connection.js} +270 -188
  335. package/build/esm/usb/connection.js.map +1 -0
  336. package/build/esm/usb/connection.test.d.ts +1 -0
  337. package/build/esm/usb/connection.test.js +264 -0
  338. package/build/esm/usb/connection.test.js.map +1 -0
  339. package/build/esm/usb/cortex-m.d.ts +72 -0
  340. package/build/esm/usb/cortex-m.js +161 -0
  341. package/build/esm/usb/cortex-m.js.map +1 -0
  342. package/build/esm/usb/cortex-m.test.d.ts +1 -0
  343. package/build/esm/usb/cortex-m.test.js +215 -0
  344. package/build/esm/usb/cortex-m.test.js.map +1 -0
  345. package/build/esm/usb/daplink.d.ts +69 -0
  346. package/build/esm/usb/daplink.js +231 -0
  347. package/build/esm/usb/daplink.js.map +1 -0
  348. package/build/esm/usb/daplink.test.d.ts +1 -0
  349. package/build/esm/usb/daplink.test.js +288 -0
  350. package/build/esm/usb/daplink.test.js.map +1 -0
  351. package/build/esm/usb/device-wrapper.d.ts +34 -0
  352. package/build/esm/usb/device-wrapper.js +98 -0
  353. package/build/esm/usb/device-wrapper.js.map +1 -0
  354. package/build/esm/usb/index.d.ts +5 -0
  355. package/build/esm/usb/index.js +5 -0
  356. package/build/esm/usb/index.js.map +1 -0
  357. package/build/esm/{usb-partial-flashing-utils.d.ts → usb/partial-flashing-utils.d.ts} +6 -9
  358. package/build/esm/{usb-partial-flashing-utils.js → usb/partial-flashing-utils.js} +4 -44
  359. package/build/esm/usb/partial-flashing-utils.js.map +1 -0
  360. package/build/esm/{usb-partial-flashing.d.ts → usb/partial-flashing.d.ts} +37 -11
  361. package/build/esm/{usb-partial-flashing.js → usb/partial-flashing.js} +169 -110
  362. package/build/esm/usb/partial-flashing.js.map +1 -0
  363. package/build/esm/usb/promise-queue.js.map +1 -0
  364. package/build/esm/usb/promise-queue.test.d.ts +1 -0
  365. package/build/esm/usb/promise-queue.test.js +66 -0
  366. package/build/esm/usb/promise-queue.test.js.map +1 -0
  367. package/build/esm/usb/serial-events.d.ts +16 -0
  368. package/build/esm/usb/serial-events.js +2 -0
  369. package/build/esm/usb/serial-events.js.map +1 -0
  370. package/build/esm/usb/transport.d.ts +42 -0
  371. package/build/esm/usb/transport.js +151 -0
  372. package/build/esm/usb/transport.js.map +1 -0
  373. package/package.json +55 -15
  374. package/LICENSE.md +0 -21
  375. package/README.md +0 -125
  376. package/build/cjs/accelerometer-service.js.map +0 -1
  377. package/build/cjs/accelerometer.d.ts +0 -9
  378. package/build/cjs/accelerometer.js +0 -16
  379. package/build/cjs/accelerometer.js.map +0 -1
  380. package/build/cjs/bluetooth-device-wrapper.js.map +0 -1
  381. package/build/cjs/bluetooth.d.ts +0 -112
  382. package/build/cjs/bluetooth.js +0 -458
  383. package/build/cjs/bluetooth.js.map +0 -1
  384. package/build/cjs/board-serial-info.js.map +0 -1
  385. package/build/cjs/button-service.js.map +0 -1
  386. package/build/cjs/buttons.d.ts +0 -10
  387. package/build/cjs/buttons.js +0 -22
  388. package/build/cjs/buttons.js.map +0 -1
  389. package/build/cjs/constants.d.ts +0 -48
  390. package/build/cjs/constants.js +0 -73
  391. package/build/cjs/constants.js.map +0 -1
  392. package/build/cjs/device-information-service.js +0 -34
  393. package/build/cjs/device-information-service.js.map +0 -1
  394. package/build/cjs/dfu-service.js.map +0 -1
  395. package/build/cjs/flashing/flashing-full.js.map +0 -1
  396. package/build/cjs/flashing/flashing-makecode.d.ts +0 -6
  397. package/build/cjs/flashing/flashing-makecode.js.map +0 -1
  398. package/build/cjs/flashing/flashing-partial.d.ts +0 -9
  399. package/build/cjs/flashing/flashing-partial.js +0 -98
  400. package/build/cjs/flashing/flashing-partial.js.map +0 -1
  401. package/build/cjs/flashing/flashing-v1.js.map +0 -1
  402. package/build/cjs/flashing/nordic-dfu.js.map +0 -1
  403. package/build/cjs/flashing/zip.js.map +0 -1
  404. package/build/cjs/hex-flash-data-source.js.map +0 -1
  405. package/build/cjs/led-service.js.map +0 -1
  406. package/build/cjs/led.d.ts +0 -6
  407. package/build/cjs/led.js.map +0 -1
  408. package/build/cjs/magnetometer-service.js.map +0 -1
  409. package/build/cjs/magnetometer.d.ts +0 -9
  410. package/build/cjs/magnetometer.js +0 -16
  411. package/build/cjs/magnetometer.js.map +0 -1
  412. package/build/cjs/partial-flashing-service.js.map +0 -1
  413. package/build/cjs/promise-queue.js.map +0 -1
  414. package/build/cjs/serial-events.d.ts +0 -20
  415. package/build/cjs/serial-events.js +0 -69
  416. package/build/cjs/serial-events.js.map +0 -1
  417. package/build/cjs/uart-service.js.map +0 -1
  418. package/build/cjs/uart.d.ts +0 -4
  419. package/build/cjs/uart.js +0 -16
  420. package/build/cjs/uart.js.map +0 -1
  421. package/build/cjs/usb-device-wrapper.d.ts +0 -47
  422. package/build/cjs/usb-device-wrapper.js +0 -437
  423. package/build/cjs/usb-device-wrapper.js.map +0 -1
  424. package/build/cjs/usb-partial-flashing-utils.js.map +0 -1
  425. package/build/cjs/usb-partial-flashing.js.map +0 -1
  426. package/build/cjs/usb-radio-bridge.d.ts +0 -24
  427. package/build/cjs/usb-radio-bridge.js.map +0 -1
  428. package/build/cjs/usb-serial-protocol.js.map +0 -1
  429. package/build/cjs/usb.d.ts +0 -66
  430. package/build/cjs/usb.js.map +0 -1
  431. package/build/esm/accelerometer-service.js.map +0 -1
  432. package/build/esm/accelerometer.d.ts +0 -9
  433. package/build/esm/accelerometer.js +0 -12
  434. package/build/esm/accelerometer.js.map +0 -1
  435. package/build/esm/bluetooth-device-wrapper.js.map +0 -1
  436. package/build/esm/bluetooth-profile.js.map +0 -1
  437. package/build/esm/bluetooth.d.ts +0 -112
  438. package/build/esm/bluetooth.js +0 -428
  439. package/build/esm/bluetooth.js.map +0 -1
  440. package/build/esm/board-serial-info.js.map +0 -1
  441. package/build/esm/button-service.js.map +0 -1
  442. package/build/esm/buttons.d.ts +0 -10
  443. package/build/esm/buttons.js +0 -18
  444. package/build/esm/buttons.js.map +0 -1
  445. package/build/esm/constants.d.ts +0 -48
  446. package/build/esm/constants.js +0 -70
  447. package/build/esm/constants.js.map +0 -1
  448. package/build/esm/device-information-service.js +0 -30
  449. package/build/esm/device-information-service.js.map +0 -1
  450. package/build/esm/dfu-service.js.map +0 -1
  451. package/build/esm/flashing/flashing-full.js.map +0 -1
  452. package/build/esm/flashing/flashing-makecode.d.ts +0 -6
  453. package/build/esm/flashing/flashing-makecode.js.map +0 -1
  454. package/build/esm/flashing/flashing-partial.d.ts +0 -9
  455. package/build/esm/flashing/flashing-partial.js +0 -95
  456. package/build/esm/flashing/flashing-partial.js.map +0 -1
  457. package/build/esm/flashing/flashing-v1.js.map +0 -1
  458. package/build/esm/flashing/nordic-dfu.js.map +0 -1
  459. package/build/esm/flashing/zip.js.map +0 -1
  460. package/build/esm/hex-flash-data-source.js.map +0 -1
  461. package/build/esm/led-service.js.map +0 -1
  462. package/build/esm/led.d.ts +0 -6
  463. package/build/esm/led.js +0 -2
  464. package/build/esm/led.js.map +0 -1
  465. package/build/esm/magnetometer-service.js.map +0 -1
  466. package/build/esm/magnetometer.d.ts +0 -9
  467. package/build/esm/magnetometer.js +0 -12
  468. package/build/esm/magnetometer.js.map +0 -1
  469. package/build/esm/partial-flashing-service.js.map +0 -1
  470. package/build/esm/promise-queue.js.map +0 -1
  471. package/build/esm/serial-events.d.ts +0 -20
  472. package/build/esm/serial-events.js +0 -61
  473. package/build/esm/serial-events.js.map +0 -1
  474. package/build/esm/uart-service.js.map +0 -1
  475. package/build/esm/uart.d.ts +0 -4
  476. package/build/esm/uart.js +0 -12
  477. package/build/esm/uart.js.map +0 -1
  478. package/build/esm/usb-device-wrapper.d.ts +0 -47
  479. package/build/esm/usb-device-wrapper.js +0 -410
  480. package/build/esm/usb-device-wrapper.js.map +0 -1
  481. package/build/esm/usb-partial-flashing-utils.js.map +0 -1
  482. package/build/esm/usb-partial-flashing.js.map +0 -1
  483. package/build/esm/usb-radio-bridge.d.ts +0 -24
  484. package/build/esm/usb-radio-bridge.js.map +0 -1
  485. package/build/esm/usb-serial-protocol.js.map +0 -1
  486. package/build/esm/usb.d.ts +0 -66
  487. package/build/esm/usb.js.map +0 -1
  488. package/typedoc.json +0 -14
  489. /package/build/cjs/{flashing → bluetooth/flashing}/flashing-v1.d.ts +0 -0
  490. /package/build/cjs/{flashing → bluetooth/flashing}/flashing-v1.js +0 -0
  491. /package/build/cjs/{flashing → bluetooth/flashing}/zip.d.ts +0 -0
  492. /package/build/cjs/{flashing → bluetooth/flashing}/zip.js +0 -0
  493. /package/build/cjs/{dfu-service.d.ts → bluetooth/services/dfu-service.d.ts} +0 -0
  494. /package/build/cjs/{usb-serial-protocol.d.ts → radio-bridge/serial-protocol.d.ts} +0 -0
  495. /package/build/cjs/{promise-queue.d.ts → usb/promise-queue.d.ts} +0 -0
  496. /package/build/cjs/{promise-queue.js → usb/promise-queue.js} +0 -0
  497. /package/build/esm/{flashing → bluetooth/flashing}/flashing-v1.d.ts +0 -0
  498. /package/build/esm/{flashing → bluetooth/flashing}/flashing-v1.js +0 -0
  499. /package/build/esm/{flashing → bluetooth/flashing}/zip.d.ts +0 -0
  500. /package/build/esm/{flashing → bluetooth/flashing}/zip.js +0 -0
  501. /package/build/esm/{dfu-service.d.ts → bluetooth/services/dfu-service.d.ts} +0 -0
  502. /package/build/esm/{usb-serial-protocol.d.ts → radio-bridge/serial-protocol.d.ts} +0 -0
  503. /package/build/esm/{promise-queue.d.ts → usb/promise-queue.d.ts} +0 -0
  504. /package/build/esm/{promise-queue.js → usb/promise-queue.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"board-id.js","sourceRoot":"","sources":["../../lib/board-id.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAIH;;GAEG;AACH,MAAa,OAAO;IAIlB,YAAmB,EAAU;QAAjB;;;;mBAAO,EAAE;WAAQ;QAC3B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,oCAAoC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACnC,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,EAAE,KAAK,MAAM,IAAI,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC;IAClD,CAAC;IAED,IAAI;QACF,OAAO,CACL,IAAI,CAAC,EAAE,KAAK,MAAM;YAClB,IAAI,CAAC,EAAE,KAAK,MAAM;YAClB,IAAI,CAAC,EAAE,KAAK,MAAM;YAClB,IAAI,CAAC,EAAE,KAAK,MAAM,CACnB,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;IACnE,CAAC;IAED;;;;OAIG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,KAAa;QACxB,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,YAA0B;QAC1C,QAAQ,YAAY,EAAE,CAAC;YACrB,KAAK,IAAI;gBACP,OAAO,IAAI,CAAC,YAAY,CAAC;YAC3B,KAAK,IAAI;gBACP,OAAO,IAAI,CAAC,YAAY,CAAC;QAC7B,CAAC;IACH,CAAC;;AA5DH,0BA6DC;AA5DgB;;;;WAAe,IAAI,OAAO,CAAC,MAAM,CAAC;EAAtB,CAAuB;AACnC;;;;WAAe,IAAI,OAAO,CAAC,MAAM,CAAC;EAAtB,CAAuB"}
1
+ {"version":3,"file":"board-id.js","sourceRoot":"","sources":["../../src/board-id.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAIH;;GAEG;AACH,MAAa,OAAO;IAIlB,YAA4B,EAAU;QAA1B;;;;mBAAgB,EAAE;WAAQ;QACpC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,oCAAoC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACnC,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,EAAE,KAAK,MAAM,IAAI,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC;IAClD,CAAC;IAED,IAAI;QACF,OAAO,CACL,IAAI,CAAC,EAAE,KAAK,MAAM;YAClB,IAAI,CAAC,EAAE,KAAK,MAAM;YAClB,IAAI,CAAC,EAAE,KAAK,MAAM;YAClB,IAAI,CAAC,EAAE,KAAK,MAAM,CACnB,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;IACnE,CAAC;IAED;;;;OAIG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,KAAa;QACxB,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,YAA0B;QAC1C,QAAQ,YAAY,EAAE,CAAC;YACrB,KAAK,IAAI;gBACP,OAAO,IAAI,CAAC,YAAY,CAAC;YAC3B,KAAK,IAAI;gBACP,OAAO,IAAI,CAAC,YAAY,CAAC;QAC7B,CAAC;IACH,CAAC;;AA5DH,0BA6DC;AA5DgB;;;;WAAe,IAAI,OAAO,CAAC,MAAM,CAAC;EAAtB,CAAuB;AACnC;;;;WAAe,IAAI,OAAO,CAAC,MAAM,CAAC;EAAtB,CAAuB"}
@@ -3,82 +3,128 @@
3
3
  *
4
4
  * SPDX-License-Identifier: MIT
5
5
  */
6
- import { TypedEventTarget, ValueIsEvent } from "./events.js";
7
6
  /**
8
- * Specific identified error types.
7
+ * Connection availability status returned by checkAvailability().
8
+ * Used for pre-flight UX decisions before attempting to connect.
9
+ */
10
+ export type ConnectionAvailabilityStatus = "available" | "unsupported" | "disabled" | "permission-denied" | "location-disabled";
11
+ /**
12
+ * Error codes identifying specific failure modes.
13
+ *
14
+ * Each code represents a distinct category of failure that apps can
15
+ * match on to decide what message to show or what recovery to attempt.
16
+ * New codes may be added in future minor releases.
9
17
  *
10
- * New members may be added over time.
18
+ * Codes are annotated with **USB**, **BLE**, or **USB, BLE** to indicate
19
+ * which connection types can produce them. USB-only apps can ignore
20
+ * BLE-only codes.
11
21
  */
12
22
  export type DeviceErrorCode =
13
23
  /**
14
- * Device not selected, e.g. because the user cancelled the dialog.
24
+ * **BLE.** The operation was cancelled via an {@link AbortSignal}
25
+ * supplied by the caller. No user-facing error is needed.
15
26
  */
16
- "no-device-selected"
27
+ "aborted"
17
28
  /**
18
- * Device not found, perhaps because it doesn't have new enough firmware (for V1).
29
+ * **USB, BLE.** The user dismissed the device-picker dialog without
30
+ * selecting a device. Typically no error message is needed — the user
31
+ * chose not to proceed.
19
32
  */
20
- | "update-req"
33
+ | "no-device-selected"
21
34
  /**
22
- * Unable to claim the interface, usually because it's in use in another tab/window.
35
+ * **USB, BLE.** The connection type is not supported on this platform
36
+ * or browser. Corresponds to {@link ConnectionAvailabilityStatus}
37
+ * `"unsupported"`.
23
38
  */
24
- | "clear-connect"
39
+ | "unsupported"
25
40
  /**
26
- * The device was found to be disconnected.
41
+ * **BLE.** Bluetooth is turned off at the OS level. Prompt the user
42
+ * to enable it in system settings. Corresponds to
43
+ * {@link ConnectionAvailabilityStatus} `"disabled"`.
27
44
  */
28
- | "device-disconnected"
45
+ | "disabled"
29
46
  /**
30
- * A communication timeout occurred.
47
+ * **BLE.** The app does not have the required Bluetooth permissions
48
+ * (iOS/Android). Prompt the user to grant permission in system
49
+ * settings. Corresponds to {@link ConnectionAvailabilityStatus}
50
+ * `"permission-denied"`.
31
51
  */
32
- | "timeout-error"
52
+ | "permission-denied"
33
53
  /**
34
- * This is the fallback error case suggesting that the user reconnects their device.
54
+ * **BLE.** Location services are disabled. Required on Android
55
+ * versions before 12 for Bluetooth scanning. Prompt the user to
56
+ * enable location in system settings. Corresponds to
57
+ * {@link ConnectionAvailabilityStatus} `"location-disabled"`.
35
58
  */
36
- | "reconnect-microbit"
59
+ | "location-disabled"
37
60
  /**
38
- * Error occured during serial or bluetooth communication.
61
+ * **USB, BLE.** A method was called that requires an active
62
+ * connection, but no connection is currently open. Call
63
+ * {@link DeviceConnection.connect} first.
39
64
  */
40
- | "background-comms-error"
65
+ | "not-connected"
41
66
  /**
42
- * Bluetooth service is missing on device.
67
+ * **USB.** The USB interface could not be claimed, usually because
68
+ * another browser tab or application already has an open connection
69
+ * to the device.
43
70
  */
44
- | "service-missing"
71
+ | "device-in-use"
45
72
  /**
46
- * Failed to establish Bluetooth connection.
73
+ * **USB, BLE.** The device disconnected during an operation.
74
+ * The physical USB or Bluetooth connection was lost.
47
75
  */
48
- | "bluetooth-connection-failed"
76
+ | "device-disconnected"
49
77
  /**
50
- * Bluetooth is disabled on the device.
78
+ * **USB, BLE.** A communication timeout — the device did not respond
79
+ * within the expected time. This may indicate the device is busy,
80
+ * hung, or that the connection is degraded.
51
81
  */
52
- | "bluetooth-disabled"
82
+ | "timeout"
53
83
  /**
54
- * Missing required Bluetooth permissions.
84
+ * **USB, BLE.** A communication failure that does not match any more
85
+ * specific code. Typical handling: prompt the user to physically
86
+ * disconnect and reconnect the device, then retry.
55
87
  */
56
- | "bluetooth-missing-permissions"
88
+ | "connection-error"
57
89
  /**
58
- * Partial flash operation failed.
90
+ * **USB.** The USB device was found but lacks the expected CMSIS-DAP
91
+ * interface. On micro:bit V1 this indicates the DAPLink firmware is
92
+ * too old and needs updating.
59
93
  */
60
- | "flash-partial-failed"
94
+ | "firmware-update-required"
61
95
  /**
62
- * Full flash operation failed.
96
+ * **BLE.** The micro:bit's Bluetooth pairing/bonding information has
97
+ * been lost (e.g. after a firmware reflash). The user needs to
98
+ * re-pair the device. Currently only detected on iOS.
63
99
  */
64
- | "flash-full-failed"
100
+ | "pairing-information-lost";
65
101
  /**
66
- * Flash operation was cancelled.
102
+ * Stages reported by the progress callback during connection and flashing.
67
103
  */
68
- | "flash-cancelled";
69
- export declare enum ProgressStage {
70
- Initializing = "Initializing",
71
- FindingDevice = "FindingDevice",
72
- Connecting = "Connecting",
73
- PartialFlashing = "PartialFlashing",
74
- FullFlashing = "FullFlashing"
75
- }
104
+ export declare const ProgressStage: {
105
+ /** Checking permissions and availability before connecting. */
106
+ readonly Initializing: "Initializing";
107
+ /** Finding device. */
108
+ readonly FindingDevice: "FindingDevice";
109
+ /** Checking that a bond is established. Only applicable on Native platforms. */
110
+ readonly CheckingBond: "CheckingBond";
111
+ /** Resetting device in preparation for flashing. Only applicable on Native platforms. */
112
+ readonly ResettingDevice: "ResettingDevice";
113
+ /** Connecting for flashing. */
114
+ readonly Connecting: "Connecting";
115
+ /** Partial flashing. */
116
+ readonly PartialFlashing: "PartialFlashing";
117
+ /** Full flashing. */
118
+ readonly FullFlashing: "FullFlashing";
119
+ };
120
+ export type ProgressStage = (typeof ProgressStage)[keyof typeof ProgressStage];
76
121
  /**
77
122
  * Progress callback for tracking operation stages (connection and flashing).
78
123
  *
79
124
  * @param stage - The current stage of the operation
80
125
  * @param progress - Optional progress value (0-1) for PartialFlashing and FullFlashing stages.
81
- * Initializing, FindingDevice, and Connecting stages are called once
126
+ * Initializing, FindingDevice, CheckingBond (only for native platforms),
127
+ * ResettingDevice (only for native platforms), and Connecting stages are called once
82
128
  * without progress values to indicate stage entry.
83
129
  *
84
130
  * @example
@@ -102,54 +148,81 @@ export type ProgressCallback = (stage: ProgressStage, progress?: number) => void
102
148
  */
103
149
  export declare class DeviceError extends Error {
104
150
  code: DeviceErrorCode;
105
- constructor({ code, message }: {
151
+ constructor({ code, message, cause, }: {
106
152
  code: DeviceErrorCode;
107
153
  message?: string;
154
+ cause?: unknown;
108
155
  });
109
156
  }
110
157
  /**
111
- * Tracks connection status,
158
+ * Asserts that a connection is active, throwing a {@link DeviceError}
159
+ * with code `"not-connected"` if it is not.
112
160
  */
113
- export declare enum ConnectionStatus {
114
- /**
115
- * Determining whether the connection type is supported requires
116
- * initialize() to complete.
117
- */
118
- SUPPORT_NOT_KNOWN = "SUPPORT_NOT_KNOWN",
119
- /**
120
- * Not supported.
121
- */
122
- NOT_SUPPORTED = "NOT_SUPPORTED",
161
+ export declare function assertConnected<T>(connection: T | undefined): asserts connection is T;
162
+ /**
163
+ * Tracks connection status.
164
+ */
165
+ export declare const ConnectionStatus: {
123
166
  /**
124
- * Supported but no device available.
167
+ * No device available.
125
168
  *
126
- * This will be the case even when a device is physically connected
127
- * but has not been connected via the browser security UI.
128
- */
129
- NO_AUTHORIZED_DEVICE = "NO_AUTHORIZED_DEVICE",
130
- /**
131
- * Authorized device available but we haven't connected to it.
169
+ * This is the initial status and will be the case even when a device is
170
+ * physically connected but has not been connected via the browser security UI.
171
+ *
172
+ * Use checkAvailability() to determine whether the connection type is
173
+ * supported before attempting to connect.
132
174
  */
133
- DISCONNECTED = "DISCONNECTED",
175
+ readonly NoAuthorizedDevice: "NoAuthorizedDevice";
176
+ /** Authorized device available but we haven't connected to it. */
177
+ readonly Disconnected: "Disconnected";
178
+ /** Connected. */
179
+ readonly Connected: "Connected";
180
+ /** Connecting. */
181
+ readonly Connecting: "Connecting";
134
182
  /**
135
- * Connected.
183
+ * Paused due to tab visibility. The connection was temporarily suspended
184
+ * because the browser tab became hidden. Reconnection will be attempted
185
+ * automatically when the tab becomes visible again.
136
186
  */
137
- CONNECTED = "CONNECTED",
187
+ readonly Paused: "Paused";
188
+ };
189
+ export type ConnectionStatus = (typeof ConnectionStatus)[keyof typeof ConnectionStatus];
190
+ /**
191
+ * Controls bonding behaviour and post-bond device mode on native platforms.
192
+ *
193
+ * - `"pairing"` — Bond if needed, then reset the device into pairing mode.
194
+ * Use when you intend to flash immediately after connecting.
195
+ * - `"application"` — Bond if needed, then reset the device into application
196
+ * mode. Use when you want to interact with BLE services (sensors, UART, …)
197
+ * on firmware that has BLE enabled in application mode.
198
+ * - `"none"` — Skip bonding entirely and just connect. Use for open-link
199
+ * firmware where no bonding is required.
200
+ *
201
+ * Ignored on web platforms where the browser manages pairing transparently.
202
+ */
203
+ export type BondMode = "pairing" | "application" | "none";
204
+ export interface ConnectOptions {
138
205
  /**
139
- * Connecting.
206
+ * Optional progress callback for tracking connection stages.
140
207
  */
141
- CONNECTING = "CONNECTING",
208
+ progress?: ProgressCallback;
142
209
  /**
143
- * Reconnecting. When there is unexpected disruption in the connection,
144
- * a reconnection is attempted.
210
+ * Optional AbortSignal to abort the connection attempt.
211
+ * When aborted, the connect promise will reject with a DeviceError
212
+ * with code "aborted".
213
+ *
214
+ * Note: Currently only aborts during the FindingDevice stage on native
215
+ * platforms. Web platform device selection (browser picker) cannot be
216
+ * aborted programmatically.
145
217
  */
146
- RECONNECTING = "RECONNECTING"
147
- }
148
- export interface ConnectOptions {
218
+ signal?: AbortSignal;
149
219
  /**
150
- * Optional progress callback for tracking connection stages.
220
+ * Controls bonding and post-bond device mode on native platforms.
221
+ * Ignored on web. Default: `"pairing"`.
222
+ *
223
+ * @see {@link BondMode}
151
224
  */
152
- progress?: ProgressCallback;
225
+ bondMode?: BondMode;
153
226
  }
154
227
  export interface FlashOptions {
155
228
  /**
@@ -169,38 +242,62 @@ export interface FlashOptions {
169
242
  * Smallest possible progress increment to limit callback rate.
170
243
  */
171
244
  minimumProgressIncrement?: number;
245
+ /**
246
+ * Optional AbortSignal to abort the flash operation.
247
+ * When aborted, the flash promise will reject with a DeviceError
248
+ * with code "aborted".
249
+ *
250
+ * Note: Currently only aborts during the FindingDevice stage on native
251
+ * platforms. Once a device is found and flashing begins, the operation
252
+ * cannot be aborted.
253
+ */
254
+ signal?: AbortSignal;
172
255
  }
173
256
  export declare class FlashDataError extends Error {
174
257
  }
175
258
  export type FlashDataSource = (boardVersion: BoardVersion) => Promise<string | Uint8Array>;
176
259
  export type BoardVersion = "V1" | "V2";
177
- export declare class ConnectionStatusEvent extends Event {
178
- readonly status: ConnectionStatus;
179
- constructor(status: ConnectionStatus);
180
- }
181
- export declare class BeforeRequestDevice extends Event {
182
- constructor();
183
- }
184
- export declare class AfterRequestDevice extends Event {
185
- constructor();
260
+ export interface ConnectionStatusChange {
261
+ status: ConnectionStatus;
262
+ previousStatus: ConnectionStatus;
186
263
  }
187
- export declare class BackgroundErrorEvent extends Event {
188
- readonly errorMessage: string;
189
- readonly error?: unknown | undefined;
190
- constructor(errorMessage: string, error?: unknown | undefined);
264
+ export interface BackgroundErrorData {
265
+ error: DeviceError;
266
+ event?: string;
191
267
  }
192
- export declare class DeviceConnectionEventMap {
193
- "status": ConnectionStatusEvent;
194
- "backgrounderror": BackgroundErrorEvent;
195
- "beforerequestdevice": Event;
196
- "afterrequestdevice": Event;
268
+ export interface DeviceConnectionEventMap {
269
+ status: ConnectionStatusChange;
270
+ backgrounderror: BackgroundErrorData;
271
+ beforerequestdevice: void;
272
+ afterrequestdevice: void;
273
+ flash: void;
197
274
  }
198
- export interface DeviceConnection<M extends ValueIsEvent<M>> extends TypedEventTarget<DeviceConnectionEventMap & M> {
275
+ export interface DeviceConnection {
276
+ addEventListener(type: "status", listener: (data: ConnectionStatusChange) => void): void;
277
+ addEventListener(type: "backgrounderror", listener: (data: BackgroundErrorData) => void): void;
278
+ addEventListener(type: "beforerequestdevice", listener: () => void): void;
279
+ addEventListener(type: "afterrequestdevice", listener: () => void): void;
280
+ addEventListener(type: "flash", listener: () => void): void;
281
+ removeEventListener(type: "status", listener: (data: ConnectionStatusChange) => void): void;
282
+ removeEventListener(type: "backgrounderror", listener: (data: BackgroundErrorData) => void): void;
283
+ removeEventListener(type: "beforerequestdevice", listener: () => void): void;
284
+ removeEventListener(type: "afterrequestdevice", listener: () => void): void;
285
+ removeEventListener(type: "flash", listener: () => void): void;
286
+ readonly type: string;
199
287
  status: ConnectionStatus;
200
288
  /**
201
289
  * Initializes the device.
202
290
  */
203
291
  initialize(): Promise<void>;
292
+ /**
293
+ * Checks if this connection type is currently available.
294
+ *
295
+ * Use this for pre-flight UX decisions (e.g., showing "enable Bluetooth" dialog).
296
+ * Note: Even if this returns "available", connect() can still fail.
297
+ *
298
+ * @returns A promise resolving to the current availability status.
299
+ */
300
+ checkAvailability(): Promise<ConnectionAvailabilityStatus>;
204
301
  /**
205
302
  * Removes all listeners.
206
303
  */
@@ -208,29 +305,49 @@ export interface DeviceConnection<M extends ValueIsEvent<M>> extends TypedEventT
208
305
  /**
209
306
  * Connects to a currently paired device or requests pairing.
210
307
  *
211
- * @param options Optional connection options including progress callback.
308
+ * @param options Optional connection options including progress callback and abort signal.
212
309
  * @throws {DeviceError} On connection failure. The error.code property indicates the failure type.
213
310
  */
214
311
  connect(options?: ConnectOptions): Promise<void>;
215
312
  /**
216
313
  * Get the board version.
217
314
  *
218
- * @returns the board version or undefined if there is no connection.
315
+ * Cached after the first successful connection until {@link clearDevice}
316
+ * is called, so remains available after disconnection.
317
+ *
318
+ * @returns the board version.
319
+ * @throws {DeviceError} with code `not-connected` if no device has been connected.
219
320
  */
220
- getBoardVersion(): BoardVersion | undefined;
321
+ getBoardVersion(): BoardVersion;
221
322
  /**
222
323
  * Disconnect from the device.
223
324
  */
224
325
  disconnect(): Promise<void>;
225
326
  /**
226
- * Write serial data to the device.
327
+ * Flash the micro:bit.
328
+ *
329
+ * Not all connection types support flashing. For example, radio bridge
330
+ * connections do not support flashing, and Bluetooth connections only
331
+ * support flashing on native platforms (not Web).
332
+ *
333
+ * Post-flash connection state differs by transport:
334
+ *
335
+ * - **USB**: The connection remains in {@link ConnectionStatus.Connected} state.
336
+ * USB connects to the micro:bit's interface chip (running DAPLink firmware),
337
+ * which is not affected by flashing the application processor, so the
338
+ * connection persists and serial communication is automatically reinitialised.
227
339
  *
228
- * Does nothing if there is no connection.
340
+ * - **Bluetooth**: The connection is always left in {@link ConnectionStatus.Disconnected}
341
+ * state. Bluetooth connects to the application processor directly, which
342
+ * reboots after flashing, so the connection is necessarily lost. Callers
343
+ * must call {@link connect} again after flashing.
229
344
  *
230
- * @param data The data to write.
231
- * @returns A promise that resolves when the write is complete.
345
+ * @param dataSource The data to use.
346
+ * @param options Flash options and progress callback.
347
+ * @throws {DeviceError} On flash failure. The error.code property indicates the failure type.
348
+ * @throws {FlashDataError} If data preparation fails.
232
349
  */
233
- serialWrite(data: string): Promise<void>;
350
+ flash?(dataSource: FlashDataSource, options: FlashOptions): Promise<void>;
234
351
  /**
235
352
  * Clear device to enable chooseDevice.
236
353
  */
@@ -1,14 +1,31 @@
1
1
  "use strict";
2
+ /**
3
+ * (c) 2021, Micro:bit Educational Foundation and contributors
4
+ *
5
+ * SPDX-License-Identifier: MIT
6
+ */
2
7
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeviceConnectionEventMap = exports.BackgroundErrorEvent = exports.AfterRequestDevice = exports.BeforeRequestDevice = exports.ConnectionStatusEvent = exports.FlashDataError = exports.ConnectionStatus = exports.DeviceError = exports.ProgressStage = void 0;
4
- var ProgressStage;
5
- (function (ProgressStage) {
6
- ProgressStage["Initializing"] = "Initializing";
7
- ProgressStage["FindingDevice"] = "FindingDevice";
8
- ProgressStage["Connecting"] = "Connecting";
9
- ProgressStage["PartialFlashing"] = "PartialFlashing";
10
- ProgressStage["FullFlashing"] = "FullFlashing";
11
- })(ProgressStage || (exports.ProgressStage = ProgressStage = {}));
8
+ exports.FlashDataError = exports.ConnectionStatus = exports.DeviceError = exports.ProgressStage = void 0;
9
+ exports.assertConnected = assertConnected;
10
+ /**
11
+ * Stages reported by the progress callback during connection and flashing.
12
+ */
13
+ exports.ProgressStage = {
14
+ /** Checking permissions and availability before connecting. */
15
+ Initializing: "Initializing",
16
+ /** Finding device. */
17
+ FindingDevice: "FindingDevice",
18
+ /** Checking that a bond is established. Only applicable on Native platforms. */
19
+ CheckingBond: "CheckingBond",
20
+ /** Resetting device in preparation for flashing. Only applicable on Native platforms. */
21
+ ResettingDevice: "ResettingDevice",
22
+ /** Connecting for flashing. */
23
+ Connecting: "Connecting",
24
+ /** Partial flashing. */
25
+ PartialFlashing: "PartialFlashing",
26
+ /** Full flashing. */
27
+ FullFlashing: "FullFlashing",
28
+ };
12
29
  /**
13
30
  * Error type used for all interactions with this module.
14
31
  *
@@ -19,8 +36,8 @@ var ProgressStage;
19
36
  * English.
20
37
  */
21
38
  class DeviceError extends Error {
22
- constructor({ code, message }) {
23
- super(message);
39
+ constructor({ code, message, cause, }) {
40
+ super(message, { cause });
24
41
  Object.defineProperty(this, "code", {
25
42
  enumerable: true,
26
43
  configurable: true,
@@ -32,116 +49,42 @@ class DeviceError extends Error {
32
49
  }
33
50
  exports.DeviceError = DeviceError;
34
51
  /**
35
- * Tracks connection status,
52
+ * Asserts that a connection is active, throwing a {@link DeviceError}
53
+ * with code `"not-connected"` if it is not.
36
54
  */
37
- var ConnectionStatus;
38
- (function (ConnectionStatus) {
39
- /**
40
- * Determining whether the connection type is supported requires
41
- * initialize() to complete.
42
- */
43
- ConnectionStatus["SUPPORT_NOT_KNOWN"] = "SUPPORT_NOT_KNOWN";
44
- /**
45
- * Not supported.
46
- */
47
- ConnectionStatus["NOT_SUPPORTED"] = "NOT_SUPPORTED";
55
+ function assertConnected(connection) {
56
+ if (!connection) {
57
+ throw new DeviceError({ code: "not-connected", message: "Not connected" });
58
+ }
59
+ }
60
+ /**
61
+ * Tracks connection status.
62
+ */
63
+ exports.ConnectionStatus = {
48
64
  /**
49
- * Supported but no device available.
65
+ * No device available.
50
66
  *
51
- * This will be the case even when a device is physically connected
52
- * but has not been connected via the browser security UI.
53
- */
54
- ConnectionStatus["NO_AUTHORIZED_DEVICE"] = "NO_AUTHORIZED_DEVICE";
55
- /**
56
- * Authorized device available but we haven't connected to it.
57
- */
58
- ConnectionStatus["DISCONNECTED"] = "DISCONNECTED";
59
- /**
60
- * Connected.
61
- */
62
- ConnectionStatus["CONNECTED"] = "CONNECTED";
63
- /**
64
- * Connecting.
67
+ * This is the initial status and will be the case even when a device is
68
+ * physically connected but has not been connected via the browser security UI.
69
+ *
70
+ * Use checkAvailability() to determine whether the connection type is
71
+ * supported before attempting to connect.
65
72
  */
66
- ConnectionStatus["CONNECTING"] = "CONNECTING";
73
+ NoAuthorizedDevice: "NoAuthorizedDevice",
74
+ /** Authorized device available but we haven't connected to it. */
75
+ Disconnected: "Disconnected",
76
+ /** Connected. */
77
+ Connected: "Connected",
78
+ /** Connecting. */
79
+ Connecting: "Connecting",
67
80
  /**
68
- * Reconnecting. When there is unexpected disruption in the connection,
69
- * a reconnection is attempted.
81
+ * Paused due to tab visibility. The connection was temporarily suspended
82
+ * because the browser tab became hidden. Reconnection will be attempted
83
+ * automatically when the tab becomes visible again.
70
84
  */
71
- ConnectionStatus["RECONNECTING"] = "RECONNECTING";
72
- })(ConnectionStatus || (exports.ConnectionStatus = ConnectionStatus = {}));
85
+ Paused: "Paused",
86
+ };
73
87
  class FlashDataError extends Error {
74
88
  }
75
89
  exports.FlashDataError = FlashDataError;
76
- class ConnectionStatusEvent extends Event {
77
- constructor(status) {
78
- super("status");
79
- Object.defineProperty(this, "status", {
80
- enumerable: true,
81
- configurable: true,
82
- writable: true,
83
- value: status
84
- });
85
- }
86
- }
87
- exports.ConnectionStatusEvent = ConnectionStatusEvent;
88
- class BeforeRequestDevice extends Event {
89
- constructor() {
90
- super("beforerequestdevice");
91
- }
92
- }
93
- exports.BeforeRequestDevice = BeforeRequestDevice;
94
- class AfterRequestDevice extends Event {
95
- constructor() {
96
- super("afterrequestdevice");
97
- }
98
- }
99
- exports.AfterRequestDevice = AfterRequestDevice;
100
- class BackgroundErrorEvent extends Event {
101
- constructor(errorMessage, error) {
102
- super("backgrounderror");
103
- Object.defineProperty(this, "errorMessage", {
104
- enumerable: true,
105
- configurable: true,
106
- writable: true,
107
- value: errorMessage
108
- });
109
- Object.defineProperty(this, "error", {
110
- enumerable: true,
111
- configurable: true,
112
- writable: true,
113
- value: error
114
- });
115
- }
116
- }
117
- exports.BackgroundErrorEvent = BackgroundErrorEvent;
118
- class DeviceConnectionEventMap {
119
- constructor() {
120
- Object.defineProperty(this, "status", {
121
- enumerable: true,
122
- configurable: true,
123
- writable: true,
124
- value: void 0
125
- });
126
- Object.defineProperty(this, "backgrounderror", {
127
- enumerable: true,
128
- configurable: true,
129
- writable: true,
130
- value: void 0
131
- });
132
- Object.defineProperty(this, "beforerequestdevice", {
133
- enumerable: true,
134
- configurable: true,
135
- writable: true,
136
- value: void 0
137
- });
138
- Object.defineProperty(this, "afterrequestdevice", {
139
- enumerable: true,
140
- configurable: true,
141
- writable: true,
142
- value: void 0
143
- });
144
- }
145
- }
146
- exports.DeviceConnectionEventMap = DeviceConnectionEventMap;
147
90
  //# sourceMappingURL=device.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"device.js","sourceRoot":"","sources":["../../lib/device.ts"],"names":[],"mappings":";;;AAsEA,IAAY,aAMX;AAND,WAAY,aAAa;IACvB,8CAA6B,CAAA;IAC7B,gDAA+B,CAAA;IAC/B,0CAAyB,CAAA;IACzB,oDAAmC,CAAA;IACnC,8CAA6B,CAAA;AAC/B,CAAC,EANW,aAAa,6BAAb,aAAa,QAMxB;AAwBD;;;;;;;;GAQG;AACH,MAAa,WAAY,SAAQ,KAAK;IAEpC,YAAY,EAAE,IAAI,EAAE,OAAO,EAA+C;QACxE,KAAK,CAAC,OAAO,CAAC,CAAC;QAFjB;;;;;WAAsB;QAGpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAND,kCAMC;AAED;;GAEG;AACH,IAAY,gBAkCX;AAlCD,WAAY,gBAAgB;IAC1B;;;OAGG;IACH,2DAAuC,CAAA;IACvC;;OAEG;IACH,mDAA+B,CAAA;IAC/B;;;;;OAKG;IACH,iEAA6C,CAAA;IAC7C;;OAEG;IACH,iDAA6B,CAAA;IAC7B;;OAEG;IACH,2CAAuB,CAAA;IACvB;;OAEG;IACH,6CAAyB,CAAA;IACzB;;;OAGG;IACH,iDAA6B,CAAA;AAC/B,CAAC,EAlCW,gBAAgB,gCAAhB,gBAAgB,QAkC3B;AA6BD,MAAa,cAAe,SAAQ,KAAK;CAAG;AAA5C,wCAA4C;AAQ5C,MAAa,qBAAsB,SAAQ,KAAK;IAC9C,YAA4B,MAAwB;QAClD,KAAK,CAAC,QAAQ,CAAC,CAAC;QADN;;;;mBAAgB,MAAM;WAAkB;IAEpD,CAAC;CACF;AAJD,sDAIC;AAED,MAAa,mBAAoB,SAAQ,KAAK;IAC5C;QACE,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC/B,CAAC;CACF;AAJD,kDAIC;AAED,MAAa,kBAAmB,SAAQ,KAAK;IAC3C;QACE,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAC9B,CAAC;CACF;AAJD,gDAIC;AAED,MAAa,oBAAqB,SAAQ,KAAK;IAC7C,YACkB,YAAoB,EACpB,KAAe;QAE/B,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAHzB;;;;mBAAgB,YAAY;WAAQ;QACpC;;;;mBAAgB,KAAK;WAAU;IAGjC,CAAC;CACF;AAPD,oDAOC;AAED,MAAa,wBAAwB;IAArC;QACE,4BAAA,QAAQ;;;;;WAAwB;QAChC,4BAAA,iBAAiB;;;;;WAAuB;QACxC,4BAAA,qBAAqB;;;;;WAAQ;QAC7B,4BAAA,oBAAoB;;;;;WAAQ;IAC9B,CAAC;CAAA;AALD,4DAKC"}
1
+ {"version":3,"file":"device.js","sourceRoot":"","sources":["../../src/device.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAgMH,0CAMC;AAhFD;;GAEG;AACU,QAAA,aAAa,GAAG;IAC3B,+DAA+D;IAC/D,YAAY,EAAE,cAAc;IAC5B,sBAAsB;IACtB,aAAa,EAAE,eAAe;IAC9B,gFAAgF;IAChF,YAAY,EAAE,cAAc;IAC5B,yFAAyF;IACzF,eAAe,EAAE,iBAAiB;IAClC,+BAA+B;IAC/B,UAAU,EAAE,YAAY;IACxB,wBAAwB;IACxB,eAAe,EAAE,iBAAiB;IAClC,qBAAqB;IACrB,YAAY,EAAE,cAAc;CACpB,CAAC;AA2BX;;;;;;;;GAQG;AACH,MAAa,WAAY,SAAQ,KAAK;IAEpC,YAAY,EACV,IAAI,EACJ,OAAO,EACP,KAAK,GAKN;QACC,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAV5B;;;;;WAAsB;QAWpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAdD,kCAcC;AAED;;;GAGG;AACH,SAAgB,eAAe,CAC7B,UAAyB;IAEzB,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,WAAW,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;IAC7E,CAAC;AACH,CAAC;AAED;;GAEG;AACU,QAAA,gBAAgB,GAAG;IAC9B;;;;;;;;OAQG;IACH,kBAAkB,EAAE,oBAAoB;IACxC,kEAAkE;IAClE,YAAY,EAAE,cAAc;IAC5B,iBAAiB;IACjB,SAAS,EAAE,WAAW;IACtB,kBAAkB;IAClB,UAAU,EAAE,YAAY;IACxB;;;;OAIG;IACH,MAAM,EAAE,QAAQ;CACR,CAAC;AA0EX,MAAa,cAAe,SAAQ,KAAK;CAAG;AAA5C,wCAA4C"}