@ovok/native 1.17.0-dev.2213 → 1.17.0-dev.2219
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.
- package/lib/commonjs/modules/next/bluetooth/adapters/android-foreground-service.js +58 -5
- package/lib/commonjs/modules/next/bluetooth/adapters/android-foreground-service.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/ble-plx-central.js +45 -24
- package/lib/commonjs/modules/next/bluetooth/adapters/ble-plx-central.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/ecg-measurements.js +25 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/ecg-measurements.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/live-supersession.js +62 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/live-supersession.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/ovok-outbox-watch.js +42 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/ovok-outbox-watch.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/ovok-reading-sink.js +97 -96
- package/lib/commonjs/modules/next/bluetooth/adapters/ovok-reading-sink.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/reading-source-id.js +33 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/reading-source-id.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/reading-values.js +38 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/reading-values.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/series-saving.js +101 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/series-saving.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-database.js +24 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-database.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-rows.js +65 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-rows.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-schema.js +53 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-schema.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-store.js +82 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-store.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/storage-paired-devices.js +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/storage-paired-devices.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/web-bluetooth-central.js +9 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/web-bluetooth-central.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/bluetooth.js +9 -3
- package/lib/commonjs/modules/next/bluetooth/core/bluetooth.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/device-deps.js +6 -0
- package/lib/commonjs/modules/next/bluetooth/core/device-deps.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/device-link.js +2 -1
- package/lib/commonjs/modules/next/bluetooth/core/device-link.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/device-snapshot.js +3 -1
- package/lib/commonjs/modules/next/bluetooth/core/device-snapshot.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/device.js +19 -6
- package/lib/commonjs/modules/next/bluetooth/core/device.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/live-ledger.js +54 -0
- package/lib/commonjs/modules/next/bluetooth/core/live-ledger.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/measuring-watch.js +45 -0
- package/lib/commonjs/modules/next/bluetooth/core/measuring-watch.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/outbox-watch.js +17 -0
- package/lib/commonjs/modules/next/bluetooth/core/outbox-watch.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/paired-device.js +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/paired-device.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/ports.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/reading-log.js +89 -7
- package/lib/commonjs/modules/next/bluetooth/core/reading-log.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/series-slots.js +94 -0
- package/lib/commonjs/modules/next/bluetooth/core/series-slots.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/stream-recorder.js +219 -0
- package/lib/commonjs/modules/next/bluetooth/core/stream-recorder.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/waveform-segments.js +110 -0
- package/lib/commonjs/modules/next/bluetooth/core/waveform-segments.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/create-bluetooth.js +19 -11
- package/lib/commonjs/modules/next/bluetooth/create-bluetooth.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/index.js +9 -1
- package/lib/commonjs/modules/next/bluetooth/index.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/shared.js +14 -0
- package/lib/commonjs/modules/next/bluetooth/shared.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/web/create-web-bluetooth.js +2 -0
- package/lib/commonjs/modules/next/bluetooth/web/create-web-bluetooth.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/android-foreground-service.js +59 -6
- package/lib/module/modules/next/bluetooth/adapters/android-foreground-service.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/ble-plx-central.js +45 -24
- package/lib/module/modules/next/bluetooth/adapters/ble-plx-central.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/ecg-measurements.js +22 -0
- package/lib/module/modules/next/bluetooth/adapters/ecg-measurements.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/live-supersession.js +59 -0
- package/lib/module/modules/next/bluetooth/adapters/live-supersession.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/ovok-outbox-watch.js +38 -0
- package/lib/module/modules/next/bluetooth/adapters/ovok-outbox-watch.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/ovok-reading-sink.js +76 -75
- package/lib/module/modules/next/bluetooth/adapters/ovok-reading-sink.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/reading-source-id.js +27 -0
- package/lib/module/modules/next/bluetooth/adapters/reading-source-id.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/reading-values.js +33 -0
- package/lib/module/modules/next/bluetooth/adapters/reading-values.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/series-saving.js +94 -0
- package/lib/module/modules/next/bluetooth/adapters/series-saving.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-database.js +20 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-database.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-rows.js +59 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-rows.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-schema.js +49 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-schema.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-store.js +79 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-store.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/storage-paired-devices.js +1 -0
- package/lib/module/modules/next/bluetooth/adapters/storage-paired-devices.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/web-bluetooth-central.js +9 -1
- package/lib/module/modules/next/bluetooth/adapters/web-bluetooth-central.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/bluetooth.js +9 -3
- package/lib/module/modules/next/bluetooth/core/bluetooth.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/device-deps.js +4 -0
- package/lib/module/modules/next/bluetooth/core/device-deps.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/device-link.js +2 -1
- package/lib/module/modules/next/bluetooth/core/device-link.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/device-snapshot.js +3 -1
- package/lib/module/modules/next/bluetooth/core/device-snapshot.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/device.js +19 -6
- package/lib/module/modules/next/bluetooth/core/device.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/live-ledger.js +50 -0
- package/lib/module/modules/next/bluetooth/core/live-ledger.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/measuring-watch.js +41 -0
- package/lib/module/modules/next/bluetooth/core/measuring-watch.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/outbox-watch.js +14 -0
- package/lib/module/modules/next/bluetooth/core/outbox-watch.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/paired-device.js +1 -0
- package/lib/module/modules/next/bluetooth/core/paired-device.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/ports.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/reading-log.js +89 -7
- package/lib/module/modules/next/bluetooth/core/reading-log.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/series-slots.js +90 -0
- package/lib/module/modules/next/bluetooth/core/series-slots.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/stream-recorder.js +215 -0
- package/lib/module/modules/next/bluetooth/core/stream-recorder.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/waveform-segments.js +106 -0
- package/lib/module/modules/next/bluetooth/core/waveform-segments.js.map +1 -0
- package/lib/module/modules/next/bluetooth/create-bluetooth.js +19 -11
- package/lib/module/modules/next/bluetooth/create-bluetooth.js.map +1 -1
- package/lib/module/modules/next/bluetooth/index.js +1 -0
- package/lib/module/modules/next/bluetooth/index.js.map +1 -1
- package/lib/module/modules/next/bluetooth/shared.js +2 -0
- package/lib/module/modules/next/bluetooth/shared.js.map +1 -1
- package/lib/module/modules/next/bluetooth/web/create-web-bluetooth.js +2 -0
- package/lib/module/modules/next/bluetooth/web/create-web-bluetooth.js.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts +17 -4
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ble-plx-central.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/live-supersession.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/live-supersession.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts +9 -3
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-source-id.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-source-id.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-values.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-values.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/series-saving.d.ts +28 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/series-saving.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-database.d.ts +23 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-database.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts +29 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts +38 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/storage-paired-devices.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/web-bluetooth-central.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/web-bluetooth-central.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/bluetooth-options.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/bluetooth-options.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/bluetooth.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-deps.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-deps.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-snapshot.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-snapshot.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device.d.ts +6 -13
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/live-ledger.d.ts +13 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/live-ledger.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/measuring-watch.d.ts +17 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/measuring-watch.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/outbox-watch.d.ts +27 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/outbox-watch.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/paired-device.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/paired-device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/ports.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/ports.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading-log.d.ts +25 -6
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading-log.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading.d.ts +16 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/series-slots.d.ts +35 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/series-slots.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/stream-recorder.d.ts +58 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/stream-recorder.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/waveform-segments.d.ts +26 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/waveform-segments.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/create-bluetooth.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/next/bluetooth/create-bluetooth.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts +4 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/shared.d.ts +5 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts +17 -4
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ble-plx-central.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts +6 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/live-supersession.d.ts +9 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/live-supersession.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts +8 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts +9 -3
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-source-id.d.ts +9 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-source-id.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-values.d.ts +9 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-values.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/series-saving.d.ts +28 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/series-saving.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-database.d.ts +23 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-database.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts +29 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts +6 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts +38 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/storage-paired-devices.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/web-bluetooth-central.d.ts +4 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/web-bluetooth-central.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/bluetooth-options.d.ts +3 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/bluetooth-options.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/bluetooth.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-deps.d.ts +16 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-deps.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-snapshot.d.ts +5 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-snapshot.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/device.d.ts +6 -13
- package/lib/typescript/module/src/modules/next/bluetooth/core/device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/live-ledger.d.ts +13 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/live-ledger.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/measuring-watch.d.ts +17 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/measuring-watch.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/outbox-watch.d.ts +27 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/outbox-watch.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/paired-device.d.ts +3 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/paired-device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/ports.d.ts +3 -2
- package/lib/typescript/module/src/modules/next/bluetooth/core/ports.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/reading-log.d.ts +25 -6
- package/lib/typescript/module/src/modules/next/bluetooth/core/reading-log.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/reading.d.ts +16 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/reading.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/series-slots.d.ts +35 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/series-slots.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/stream-recorder.d.ts +58 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/stream-recorder.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/waveform-segments.d.ts +26 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/waveform-segments.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/create-bluetooth.d.ts +3 -2
- package/lib/typescript/module/src/modules/next/bluetooth/create-bluetooth.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts +4 -1
- package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/shared.d.ts +5 -1
- package/lib/typescript/module/src/modules/next/bluetooth/shared.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts +3 -2
- package/lib/typescript/module/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts.map +1 -1
- package/package.json +7 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DeviceModel } from "./catalog";
|
|
2
|
+
import { OutboxWatch } from "./outbox-watch";
|
|
2
3
|
import { AdapterState, AppLifecycle, BleCentral, BluetoothPermission, BluetoothPermissions, KeepAlive, Logger, PairedDeviceStore, ReadingSink } from "./ports";
|
|
3
4
|
import { DeviceProtocol } from "./protocol";
|
|
4
5
|
/** The ports and data `Bluetooth` runs on; each platform entry point fills them in. */
|
|
@@ -25,6 +26,8 @@ type BluetoothOptions = {
|
|
|
25
26
|
lifecycle?: AppLifecycle;
|
|
26
27
|
/** Keeps the process alive while devices are connected; nothing extra, by default. */
|
|
27
28
|
keepAlive?: KeepAlive;
|
|
29
|
+
/** The offline queue behind the sink; the reading log follows it, so a queued reading becomes saved. Nothing waits, by default. */
|
|
30
|
+
outbox?: OutboxWatch;
|
|
28
31
|
/** Whether paired devices sync by themselves when seen; turn it off where a scan needs the user, as in a browser. */
|
|
29
32
|
autoSync?: boolean;
|
|
30
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bluetooth-options.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/bluetooth-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,SAAS,EACT,MAAM,EACN,iBAAiB,EACjB,WAAW,EACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,uFAAuF;AACvF,KAAK,gBAAgB,GAAG;IAEtB,gCAAgC;IAChC,OAAO,EAAE,UAAU,CAAC;IAEpB,qCAAqC;IACrC,KAAK,EAAE,iBAAiB,CAAC;IAEzB,gCAAgC;IAChC,IAAI,EAAE,WAAW,CAAC;IAElB,iCAAiC;IACjC,WAAW,EAAE,oBAAoB,CAAC;IAElC,yDAAyD;IACzD,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IAE/B,gGAAgG;IAChG,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;IAErC,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IAEjB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,gEAAgE;IAChE,SAAS,CAAC,EAAE,YAAY,CAAC;IAEzB,sFAAsF;IACtF,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,qHAAqH;IACrH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,mEAAmE;AACnE,KAAK,eAAe,GAAG;IAErB,mCAAmC;IACnC,KAAK,EAAE,YAAY,CAAC;IAEpB,kCAAkC;IAClC,UAAU,EAAE,mBAAmB,CAAC;CACjC,CAAC;AAEF,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"bluetooth-options.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/bluetooth-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,SAAS,EACT,MAAM,EACN,iBAAiB,EACjB,WAAW,EACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,uFAAuF;AACvF,KAAK,gBAAgB,GAAG;IAEtB,gCAAgC;IAChC,OAAO,EAAE,UAAU,CAAC;IAEpB,qCAAqC;IACrC,KAAK,EAAE,iBAAiB,CAAC;IAEzB,gCAAgC;IAChC,IAAI,EAAE,WAAW,CAAC;IAElB,iCAAiC;IACjC,WAAW,EAAE,oBAAoB,CAAC;IAElC,yDAAyD;IACzD,MAAM,EAA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, Logger, PairedDeviceStore, ReadingSink } from "./ports";
|
|
3
|
+
import { DeviceProtocol } from "./protocol";
|
|
4
|
+
/** What a `Device` runs on. */
|
|
5
|
+
type DeviceDeps = {
|
|
6
|
+
model: DeviceModel;
|
|
7
|
+
protocol: DeviceProtocol;
|
|
8
|
+
central: BleCentral;
|
|
9
|
+
store: PairedDeviceStore;
|
|
10
|
+
/** Where the device's live recording is saved; a device without one only shows what it streams. */
|
|
11
|
+
sink?: ReadingSink;
|
|
12
|
+
now: () => Date;
|
|
13
|
+
logger: Logger;
|
|
14
|
+
};
|
|
15
|
+
export type { DeviceDeps };
|
|
16
|
+
//# sourceMappingURL=device-deps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-deps.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/device-deps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,+BAA+B;AAC/B,KAAK,UAAU,GAAG;IAChB,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,UAAU,CAAC;IACpB,KAAK,EAAE,iBAAiB,CAAC;IAEzB,mGAAmG;IACnG,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,GAAG,EAAE,MAAM,IAAI,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -30,6 +30,8 @@ type DeviceSnapshot = {
|
|
|
30
30
|
activity: Exclude<DeviceAction, "live"> | null;
|
|
31
31
|
/** Whether a live stream is running. */
|
|
32
32
|
live: boolean;
|
|
33
|
+
/** Since when live frames have kept arriving, so the device is measuring; `null` once they stop for a few seconds. */
|
|
34
|
+
measuringSince: Date | null;
|
|
33
35
|
/** How far a running sync has got; `null` when none is running. */
|
|
34
36
|
progress: {
|
|
35
37
|
/** Records fetched so far. */
|
|
@@ -63,6 +65,8 @@ type DeviceSnapshot = {
|
|
|
63
65
|
autoSync: boolean;
|
|
64
66
|
/** Whether its link stays open while the app is in the background. */
|
|
65
67
|
keepInBackground: boolean;
|
|
68
|
+
/** Whether what it streams live is recorded and saved, as well as shown. */
|
|
69
|
+
record: boolean;
|
|
66
70
|
/** The device's own run status, raw; `null` until its protocol reports one. */
|
|
67
71
|
deviceStatus: {
|
|
68
72
|
/** The status code exactly as the device sent it. */
|
|
@@ -122,6 +126,7 @@ declare const storedFields: (record: PairedDevice, model: DeviceModel) => {
|
|
|
122
126
|
identity: DeviceIdentity | null;
|
|
123
127
|
autoSync: boolean;
|
|
124
128
|
keepInBackground: boolean;
|
|
129
|
+
record: boolean;
|
|
125
130
|
};
|
|
126
131
|
declare const initialSnapshot: (record: PairedDevice, model: DeviceModel, protocol: DeviceProtocol) => DeviceSnapshot;
|
|
127
132
|
/** The display events one live frame becomes: its numbers, then its samples. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-snapshot.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/device-snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErE,mCAAmC;AACnC,KAAK,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAA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MAAM,SAAS,GAAI,UAAU,cAAc,KAAG,YAAY,EAE8C,CAAC;AAEzG,4DAA4D;AAC5D,QAAA,MAAM,YAAY,GAAI,QAAQ,YAAY,EAAE,OAAO,WAAW
|
|
1
|
+
{"version":3,"file":"device-snapshot.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/device-snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErE,mCAAmC;AACnC,KAAK,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC;AAEvE,wEAAwE;AACxE,KAAK,eAAe,GAAG,cAAc,GAAG,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,eAAe,CAAC;AAEjG,oFAAoF;AACpF,KAAK,cAAc,GAAG;IAEpB,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC;IAEhB,gDAAgD;IAChD,KAAK,EAAE;QAEL,yCAAyC;QACzC,EAAE,EAAE,MAAM,CAAC;QAEX,iCAAiC;QACjC,MAAM,EAAE,MAAM,CAAC;QAEf,gCAAgC;QAChC,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IAEF,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IAEb,gCAAgC;IAChC,QAAQ,EAAE,IAAI,CAAC;IAEf,kGAAkG;IAClG,UAAU,EAAE,eAAe,CAAC;IAE5B,6DAA6D;IAC7D,QAAQ,EAAE,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG,IAAI,CAA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@ -1,17 +1,8 @@
|
|
|
1
1
|
import { Advertisement } from "./advertisement";
|
|
2
|
-
import {
|
|
2
|
+
import { DeviceDeps } from "./device-deps";
|
|
3
3
|
import { DeviceEvent, DeviceSnapshot, SyncSummary } from "./device-snapshot";
|
|
4
4
|
import { DeviceSettings, PairedDevice } from "./paired-device";
|
|
5
|
-
import {
|
|
6
|
-
import { DeviceProtocol, RecordInfo } from "./protocol";
|
|
7
|
-
type DeviceDeps = {
|
|
8
|
-
model: DeviceModel;
|
|
9
|
-
protocol: DeviceProtocol;
|
|
10
|
-
central: BleCentral;
|
|
11
|
-
store: PairedDeviceStore;
|
|
12
|
-
now: () => Date;
|
|
13
|
-
logger: Logger;
|
|
14
|
-
};
|
|
5
|
+
import { RecordInfo } from "./protocol";
|
|
15
6
|
/** One paired device: it owns the link, queues every action on it, and reconnects when a press needs it. */
|
|
16
7
|
declare class Device {
|
|
17
8
|
private record;
|
|
@@ -22,6 +13,8 @@ declare class Device {
|
|
|
22
13
|
private readonly link;
|
|
23
14
|
private queue;
|
|
24
15
|
private readonly unacknowledged;
|
|
16
|
+
private readonly recorder;
|
|
17
|
+
private readonly measuring;
|
|
25
18
|
private readonly liveStream;
|
|
26
19
|
constructor(record: PairedDevice, deps: DeviceDeps, latestAdvertisement?: Advertisement | undefined);
|
|
27
20
|
/** The address its record is stored under. */
|
|
@@ -40,7 +33,7 @@ declare class Device {
|
|
|
40
33
|
fetch: (recordId: string) => Promise<void>;
|
|
41
34
|
/** Sets the device's clock to now. */
|
|
42
35
|
setClock: () => Promise<void>;
|
|
43
|
-
/** Starts `live` and `waveform` events, which
|
|
36
|
+
/** Starts `live` and `waveform` events, which the device also records and saves while its `record` setting is on. */
|
|
44
37
|
startLive: () => Promise<void>;
|
|
45
38
|
/** Stops the stream and waits until the device has stopped sending. */
|
|
46
39
|
stopLive: () => Promise<void>;
|
|
@@ -48,7 +41,7 @@ declare class Device {
|
|
|
48
41
|
acknowledge: (recordId: string) => Promise<void>;
|
|
49
42
|
/** Forgets a delivered record without saving it, so the next sync delivers it again. */
|
|
50
43
|
release: (recordId: string) => void;
|
|
51
|
-
/** Changes and stores whether it syncs by itself
|
|
44
|
+
/** Changes and stores whether it syncs by itself, stays connected in the background, and records what it streams. */
|
|
52
45
|
configure: (settings: Partial<DeviceSettings>) => Promise<void>;
|
|
53
46
|
/** Stops live, waits for queued actions, then closes the link. */
|
|
54
47
|
disconnect: () => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/device.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAgB,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/device.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAgB,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAGL,WAAW,EACX,cAAc,EAId,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAOxC,4GAA4G;AAC5G,cAAM,MAAM;IAcS,OAAO,CAAC,MAAM;IAAgB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAAc,OAAO,CAAC,mBAAmB,CAAC;IAbhH,OAAO,CAAC,IAAI,CAAiB;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgC;IACvD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;IAClC,OAAO,CAAC,KAAK,CAAuC;IACpD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAqB;IACpD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IAEtD,OAA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AAqH;IAC9G,IAAI,CAAC,EAAE,EAAE,aAAa,GAAG,IAAI;IAapC,OAAO,CAAC,GAAG;YAYG,OAAO;YAmBP,OAAO;YAaP,SAAS;YAaT,WAAW;IAazB,8DAA8D;IAC9D,OAAO,CAAC,KAAK,CAA2F;YAE1F,WAAW;YAIX,OAAO;IAiBrB,OAAO,CAAC,SAAS;IASjB,iGAAiG;IACjG,OAAO,CAAC,WAAW;YAIL,YAAY;IAM1B,OAAO,CAAC,KAAK;CAId;AAED,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DecodedReading, LiveSpan } from "./reading";
|
|
2
|
+
/** The live recordings that were saved and that a stored record of the same time may still replace. */
|
|
3
|
+
declare class LiveLedger {
|
|
4
|
+
private spans;
|
|
5
|
+
/** Remembers a recording that was saved whole. */
|
|
6
|
+
add(span: LiveSpan): void;
|
|
7
|
+
/** The recordings of the same metric that lie inside what a stored record covers. */
|
|
8
|
+
inside(record: DecodedReading): LiveSpan[];
|
|
9
|
+
/** Forgets recordings a stored record has replaced. */
|
|
10
|
+
remove(replaced: readonly LiveSpan[]): void;
|
|
11
|
+
}
|
|
12
|
+
export { LiveLedger };
|
|
13
|
+
//# sourceMappingURL=live-ledger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-ledger.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/live-ledger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AA+BrD,uGAAuG;AACvG,cAAM,UAAU;IACd,OAAO,CAAC,KAAK,CAA2B;IAExC,kDAAkD;IAC3C,GAAG,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI;IAIhC,qFAAqF;IAC9E,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ,EAAE;IAMjD,uDAAuD;IAChD,MAAM,CAAC,QAAQ,EAAE,SAAS,QAAQ,EAAE,GAAG,IAAI;CAGnD;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** How long a device may go without a live frame before it no longer counts as measuring. */
|
|
2
|
+
declare const QUIET_MS = 5000;
|
|
3
|
+
/** Whether live frames are arriving: the first frame starts a measurement, a quiet spell or the stream's end ends it. */
|
|
4
|
+
declare class MeasuringWatch {
|
|
5
|
+
private readonly changed;
|
|
6
|
+
private readonly now;
|
|
7
|
+
private since;
|
|
8
|
+
private quiet;
|
|
9
|
+
constructor(changed: (since: Date | null) => void, now: () => Date);
|
|
10
|
+
/** A live frame arrived. */
|
|
11
|
+
frame(): void;
|
|
12
|
+
/** Nothing is being measured any more. */
|
|
13
|
+
stop(): void;
|
|
14
|
+
private clearQuiet;
|
|
15
|
+
}
|
|
16
|
+
export { MeasuringWatch, QUIET_MS };
|
|
17
|
+
//# sourceMappingURL=measuring-watch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"measuring-watch.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/measuring-watch.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,QAAA,MAAM,QAAQ,OAAQ,CAAC;AAEvB,yHAAyH;AACzH,cAAM,cAAc;IAKhB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,GAAG;IALtB,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,KAAK,CAA8C;gBAGxC,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,EACrC,GAAG,EAAE,MAAM,IAAI;IAGlC,4BAA4B;IACrB,KAAK,IAAI,IAAI;IASpB,0CAA0C;IACnC,IAAI,IAAI,IAAI;IAQnB,OAAO,CAAC,UAAU;CAMnB;AAED,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SaveOutcome } from "./ports";
|
|
2
|
+
/** Where each outbox item stands, by id, at one moment. */
|
|
3
|
+
type OutboxView = {
|
|
4
|
+
/** Items still to be sent, including the one in flight. */
|
|
5
|
+
waiting: ReadonlySet<string>;
|
|
6
|
+
/** Items the server refused; they wait for a resend or a discard. */
|
|
7
|
+
rejected: ReadonlySet<string>;
|
|
8
|
+
/** Items the server accepted lately; an item that is in none of the three sets was discarded, or is another account's. */
|
|
9
|
+
sent: ReadonlySet<string>;
|
|
10
|
+
};
|
|
11
|
+
/** The offline queue behind a sink, which the reading log and the foreground notification watch; the sink side provides it. */
|
|
12
|
+
interface OutboxWatch {
|
|
13
|
+
/** Calls `listener` with the view now and after every change, until the returned stop is called. */
|
|
14
|
+
subscribe(listener: (view: OutboxView) => void): () => void;
|
|
15
|
+
}
|
|
16
|
+
/** What a sink says about a save: how it went and, for a queued reading, which outbox items hold it. */
|
|
17
|
+
type SaveReceipt = {
|
|
18
|
+
/** Saved, or kept in the outbox. */
|
|
19
|
+
status: SaveOutcome;
|
|
20
|
+
/** The outbox items that hold the queued part of the reading, as `ovok.outbox.items` lists them; one per queued measurement. */
|
|
21
|
+
queueIds?: readonly string[];
|
|
22
|
+
};
|
|
23
|
+
/** No offline queue: nothing is ever waiting. */
|
|
24
|
+
declare const noOutboxWatch: OutboxWatch;
|
|
25
|
+
export { noOutboxWatch };
|
|
26
|
+
export type { OutboxView, OutboxWatch, SaveReceipt };
|
|
27
|
+
//# sourceMappingURL=outbox-watch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outbox-watch.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/outbox-watch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,2DAA2D;AAC3D,KAAK,UAAU,GAAG;IAEhB,2DAA2D;IAC3D,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAE7B,qEAAqE;IACrE,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAE9B,0HAA0H;IAC1H,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC3B,CAAC;AAEF,+HAA+H;AAC/H,UAAU,WAAW;IAEnB,oGAAoG;IACpG,SAAS,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CAC7D;AAED,wGAAwG;AACxG,KAAK,WAAW,GAAG;IAEjB,oCAAoC;IACpC,MAAM,EAAE,WAAW,CAAC;IAEpB,gIAAgI;IAChI,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B,CAAC;AAEF,iDAAiD;AACjD,QAAA,MAAM,aAAa,EAAE,WAAkD,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -50,11 +50,13 @@ type PairedDevice = {
|
|
|
50
50
|
autoSync: boolean;
|
|
51
51
|
/** Whether its link stays open while the app is in the background, reconnecting when it drops. */
|
|
52
52
|
keepInBackground: boolean;
|
|
53
|
+
/** Whether what it streams live is recorded and saved, as well as shown. */
|
|
54
|
+
record: boolean;
|
|
53
55
|
/** The value the device handed over when it paired, such as a password; `null` when it gave none. */
|
|
54
56
|
secret: string | null;
|
|
55
57
|
};
|
|
56
58
|
/** The settings a user can change on a paired device. */
|
|
57
|
-
type DeviceSettings = Pick<PairedDevice, "autoSync" | "keepInBackground">;
|
|
59
|
+
type DeviceSettings = Pick<PairedDevice, "autoSync" | "keepInBackground" | "record">;
|
|
58
60
|
/** A device just paired: nothing synced, nothing reported yet. */
|
|
59
61
|
declare const newPairedDevice: (address: string, modelId: string, name: string | null, pairedAt: Date) => PairedDevice;
|
|
60
62
|
export { newPairedDevice };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paired-device.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/paired-device.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,KAAK,cAAc,GAAG;IAEpB,yBAAyB;IACzB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,6CAA6C;IAC7C,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,oFAAoF;IACpF,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB,wBAAwB;IACxB,EAAE,EAAE,IAAI,CAAC;CACV,CAAC;AAEF,mDAAmD;AACnD,KAAK,OAAO,GAAG;IAEb,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAEhB,mEAAmE;IACnE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAEzB,mCAAmC;IACnC,EAAE,EAAE,IAAI,CAAC;CACV,CAAC;AAEF,sEAAsE;AACtE,KAAK,YAAY,GAAG;IAElB,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAC;IAEhB,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAEhB,kDAAkD;IAClD,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpB,gCAAgC;IAChC,QAAQ,EAAE,IAAI,CAAC;IAEf,gGAAgG;IAChG,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAE1B,+BAA+B;IAC/B,eAAe,EAAE,IAAI,GAAG,IAAI,CAAC;IAE7B,kCAAkC;IAClC,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAE1B,0DAA0D;IAC1D,eAAe,EAAE,SAAS,GAAG,QAAQ,GAAG,IAAI,CAAC;IAE7C,wCAAwC;IACxC,aAAa,EAAE,IAAI,GAAG,IAAI,CAAC;IAE3B,iCAAiC;IACjC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAExB,kCAAkC;IAClC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAEhC,oFAAoF;IACpF,QAAQ,EAAE,OAAO,CAAC;IAElB,kGAAkG;IAClG,gBAAgB,EAAE,OAAO,CAAC;IAE1B,qGAAqG;IACrG,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,yDAAyD;AACzD,KAAK,cAAc,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,kBAAkB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"paired-device.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/paired-device.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,KAAK,cAAc,GAAG;IAEpB,yBAAyB;IACzB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,6CAA6C;IAC7C,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,oFAAoF;IACpF,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB,wBAAwB;IACxB,EAAE,EAAE,IAAI,CAAC;CACV,CAAC;AAEF,mDAAmD;AACnD,KAAK,OAAO,GAAG;IAEb,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAEhB,mEAAmE;IACnE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAEzB,mCAAmC;IACnC,EAAE,EAAE,IAAI,CAAC;CACV,CAAC;AAEF,sEAAsE;AACtE,KAAK,YAAY,GAAG;IAElB,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAC;IAEhB,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAEhB,kDAAkD;IAClD,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpB,gCAAgC;IAChC,QAAQ,EAAE,IAAI,CAAC;IAEf,gGAAgG;IAChG,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAE1B,+BAA+B;IAC/B,eAAe,EAAE,IAAI,GAAG,IAAI,CAAC;IAE7B,kCAAkC;IAClC,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAE1B,0DAA0D;IAC1D,eAAe,EAAE,SAAS,GAAG,QAAQ,GAAG,IAAI,CAAC;IAE7C,wCAAwC;IACxC,aAAa,EAAE,IAAI,GAAG,IAAI,CAAC;IAE3B,iCAAiC;IACjC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAExB,kCAAkC;IAClC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAEhC,oFAAoF;IACpF,QAAQ,EAAE,OAAO,CAAC;IAElB,kGAAkG;IAClG,gBAAgB,EAAE,OAAO,CAAC;IAE1B,4EAA4E;IAC5E,MAAM,EAAE,OAAO,CAAC;IAEhB,qGAAqG;IACrG,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,yDAAyD;AACzD,KAAK,cAAc,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,kBAAkB,GAAG,QAAQ,CAAC,CAAC;AAErF,kEAAkE;AAClE,QAAA,MAAM,eAAe,GAAI,SAAS,MAAM,EAAE,SAAS,MAAM,EAAE,MAAM,MAAM,GAAG,IAAI,EAAE,UAAU,IAAI,KAAG,YAgB/F,CAAC;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Advertisement } from "./advertisement";
|
|
2
2
|
import { DeviceSnapshot } from "./device-snapshot";
|
|
3
3
|
import { DeviceError } from "./errors";
|
|
4
|
+
import { SaveReceipt } from "./outbox-watch";
|
|
4
5
|
import { PairedDevice } from "./paired-device";
|
|
5
6
|
import { Reading } from "./reading";
|
|
6
7
|
/** The Bluetooth adapter; `unknown` until the platform reports it. */
|
|
@@ -77,8 +78,8 @@ interface PairedDeviceStore {
|
|
|
77
78
|
type SaveOutcome = "saved" | "queued";
|
|
78
79
|
/** Where readings are saved; `device` is the snapshot of the device that took it. */
|
|
79
80
|
interface ReadingSink {
|
|
80
|
-
/** Saves one reading; rejects when it could be neither saved nor queued. */
|
|
81
|
-
save(reading: Reading, device: DeviceSnapshot): Promise<SaveOutcome>;
|
|
81
|
+
/** Saves one reading, and says which outbox items hold it when it was queued; rejects when it could be neither saved nor queued. */
|
|
82
|
+
save(reading: Reading, device: DeviceSnapshot): Promise<SaveOutcome | SaveReceipt>;
|
|
82
83
|
}
|
|
83
84
|
/** Whether the app is in front of the user. */
|
|
84
85
|
type AppVisibility = "foreground" | "background";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ports.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/ports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,sEAAsE;AACtE,KAAK,YAAY,GAAG,SAAS,GAAG,IAAI,GAAG,KAAK,GAAG,cAAc,GAAG,aAAa,CAAC;AAE9E,gGAAgG;AAChG,KAAK,mBAAmB,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExE,8EAA8E;AAC9E,KAAK,aAAa,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,QAAQ,EAA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uC;IACvC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;CAClD;AAED,QAAA,MAAM,YAAY,EAAE,MAA6E,CAAC;AAElG,qEAAqE;AACrE,QAAA,MAAM,gBAAgB,EAAE,YAMvB,CAAC;AAEF,8DAA8D;AAC9D,QAAA,MAAM,WAAW,EAAE,SAAyE,CAAC;AAE7F,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;AACvD,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,QAAQ,EACR,SAAS,EACT,UAAU,EACV,MAAM,EACN,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,GACb,CAAC"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { Device } from "./device";
|
|
2
|
-
import {
|
|
2
|
+
import { DeviceSnapshot } from "./device-snapshot";
|
|
3
|
+
import { OutboxWatch, SaveReceipt } from "./outbox-watch";
|
|
4
|
+
import { Logger, SaveOutcome } from "./ports";
|
|
3
5
|
import { Reading } from "./reading";
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
+
/**
|
|
7
|
+
* `queued` means the reading waits in the outbox, and `saved` that the server has it. `rejected` means the server
|
|
8
|
+
* refused it there; it waits for a resend or a discard. `failed` means the sink threw; a stored record is then
|
|
9
|
+
* released, so the next sync delivers it again.
|
|
10
|
+
*/
|
|
11
|
+
type SaveState = "saving" | "queued" | "saved" | "rejected" | "failed";
|
|
6
12
|
/** A reading received this session and how its save went. */
|
|
7
13
|
type ReceivedReading = {
|
|
8
14
|
/** Unique in the log: the address and record id, or the receive time for a reading with no record. */
|
|
@@ -13,22 +19,35 @@ type ReceivedReading = {
|
|
|
13
19
|
receivedAt: Date;
|
|
14
20
|
/** How its save is going. */
|
|
15
21
|
save: SaveState;
|
|
22
|
+
/** The outbox items that hold the reading while it is queued or rejected, as `ovok.outbox.items` lists them. */
|
|
23
|
+
queueIds?: readonly string[];
|
|
16
24
|
};
|
|
25
|
+
/** A sink whose save may say which outbox items hold a queued reading. */
|
|
26
|
+
type ReceiptSink = {
|
|
27
|
+
save(reading: Reading, device: DeviceSnapshot): Promise<SaveOutcome | SaveReceipt>;
|
|
28
|
+
};
|
|
29
|
+
type TrackedDevice = Pick<Device, "subscribe" | "snapshot" | "acknowledge" | "release">;
|
|
17
30
|
/** Saves every reading a device delivers, then acknowledges stored records so the device cursor moves on. */
|
|
18
31
|
declare class ReadingLog {
|
|
19
32
|
private readonly sink;
|
|
20
33
|
private readonly logger;
|
|
21
34
|
private readonly now;
|
|
35
|
+
private readonly outbox;
|
|
22
36
|
private readonly kept;
|
|
23
37
|
private list;
|
|
24
38
|
private readonly changes;
|
|
25
|
-
|
|
39
|
+
private stopOutbox;
|
|
40
|
+
constructor(sink: ReceiptSink, logger: Logger, now: () => Date, outbox?: OutboxWatch, kept?: number);
|
|
26
41
|
entries: () => readonly ReceivedReading[];
|
|
27
42
|
subscribe: (listener: () => void) => (() => void);
|
|
28
43
|
/** Saves what `device` delivers until the returned stop is called. */
|
|
29
|
-
track(device:
|
|
44
|
+
track(device: TrackedDevice): () => void;
|
|
30
45
|
private receive;
|
|
31
|
-
private
|
|
46
|
+
private followOutbox;
|
|
47
|
+
private settle;
|
|
48
|
+
private releaseWhenIdle;
|
|
49
|
+
private logRejected;
|
|
50
|
+
private patch;
|
|
32
51
|
private update;
|
|
33
52
|
}
|
|
34
53
|
export { ReadingLog };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reading-log.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/reading-log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"reading-log.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth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AAO,CAAC,QAAQ,CAAC,OAAO,CAA+C;IACvE,OAAO,CAAC,UAAU,CAA6B;gBAG5B,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,IAAI,EACf,MAAM,GAAE,WAA2B,EACnC,IAAI,SAAM;IAGtB,OAAO,QAAO,SAAS,eAAe,EAAE,CAAc;IAEtD,SAAS,GAAI,UAAU,MAAM,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC,CAA+B;IAEtF,sEAAsE;IAC/D,KAAK,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,IAAI;YAQjC,OAAO;IAyBrB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,MAAM;IAkBd,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,MAAM;CAIf;AAED,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -54,6 +54,17 @@ type ReadingSource = {
|
|
|
54
54
|
/** The device's id for the stored record, `null` for a live value or a measurement it does not store. */
|
|
55
55
|
recordId: string | null;
|
|
56
56
|
};
|
|
57
|
+
/** A stretch of a live stream the app recorded; a stored record that covers it replaces it. */
|
|
58
|
+
type LiveSpan = {
|
|
59
|
+
/** What was recorded: a number's metric, or a waveform's. */
|
|
60
|
+
metric: MetricCode | Waveform["metric"];
|
|
61
|
+
/** The waveform channel it holds, `null` for numbers. */
|
|
62
|
+
channel: string | null;
|
|
63
|
+
/** When its first value or sample was taken. */
|
|
64
|
+
from: Date;
|
|
65
|
+
/** When it ends. */
|
|
66
|
+
to: Date;
|
|
67
|
+
};
|
|
57
68
|
/** One measurement, keyed by metric. */
|
|
58
69
|
type Reading = {
|
|
59
70
|
/** What was measured. */
|
|
@@ -68,6 +79,10 @@ type Reading = {
|
|
|
68
79
|
waveform?: Waveform;
|
|
69
80
|
/** Values at a fixed interval, for a measurement that records them, such as a heart rate per second. */
|
|
70
81
|
series?: Series;
|
|
82
|
+
/** Set when the app recorded this from a live stream, with the time it covers. */
|
|
83
|
+
live?: LiveSpan;
|
|
84
|
+
/** The live recordings a stored record replaces; the sink removes them before it saves the record. */
|
|
85
|
+
supersedes?: readonly LiveSpan[];
|
|
71
86
|
/** The model, protocol, address and record it came from. */
|
|
72
87
|
source: ReadingSource;
|
|
73
88
|
};
|
|
@@ -91,5 +106,5 @@ type LiveFrame = {
|
|
|
91
106
|
/** Samples to trace, when it had any. */
|
|
92
107
|
waveform?: Waveform;
|
|
93
108
|
};
|
|
94
|
-
export type { DecodedReading, DeviceFlag, LiveFrame, LiveValues, Quantity, Reading, ReadingSource, Series, Waveform };
|
|
109
|
+
export type { DecodedReading, DeviceFlag, LiveFrame, LiveSpan, LiveValues, Quantity, Reading, ReadingSource, Series, Waveform };
|
|
95
110
|
//# sourceMappingURL=reading.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reading.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/reading.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEjE,kCAAkC;AAClC,KAAK,QAAQ,GAAG;IAEd,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IAEd,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,yEAAyE;AACzE,KAAK,UAAU,GAAG;IAEhB,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IAEb,oDAAoD;IACpD,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,0GAA0G;AAC1G,KAAK,QAAQ,GAAG;IAEd,2BAA2B;IAC3B,MAAM,EAAE,cAAc,GAAG,gBAAgB,CAAC;IAE1C,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAC;IAErB,uDAAuD;IACvD,IAAI,EAAE,M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E,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { MeasurementType, MetricCode } from "./measurement-type";
|
|
2
|
+
import { Reading, ReadingSource } from "./reading";
|
|
3
|
+
/** The streamed numbers worth recording as a series, each with the measurement it belongs to. */
|
|
4
|
+
declare const RECORDED_METRICS: Partial<Record<MetricCode, MeasurementType>>;
|
|
5
|
+
/** What a series measures. */
|
|
6
|
+
type SeriesKind = {
|
|
7
|
+
metric: MetricCode;
|
|
8
|
+
type: MeasurementType;
|
|
9
|
+
unit: string;
|
|
10
|
+
};
|
|
11
|
+
/** One metric's streamed numbers, one value per second from the second the first one arrived. */
|
|
12
|
+
declare class SlotSeries {
|
|
13
|
+
private readonly kind;
|
|
14
|
+
private readonly start;
|
|
15
|
+
private readonly values;
|
|
16
|
+
private lastAt;
|
|
17
|
+
private changed;
|
|
18
|
+
constructor(kind: SeriesKind, firstAt: number);
|
|
19
|
+
/** Whether a value of `unit` taken at `at` still belongs to this series. */
|
|
20
|
+
takes(unit: string, at: number): boolean;
|
|
21
|
+
/** Puts a value in the second it was taken; of two values in one second the later stays. */
|
|
22
|
+
put(value: number, at: number): void;
|
|
23
|
+
/** Whether no value arrived for as long as a series waits before it closes. */
|
|
24
|
+
isQuiet(now: number): boolean;
|
|
25
|
+
/** Whether values arrived since the last `markSaved`. */
|
|
26
|
+
get unsaved(): boolean;
|
|
27
|
+
markSaved(): void;
|
|
28
|
+
/** The series as it is now, as a reading to save. */
|
|
29
|
+
reading(origin: ReadingSource): Reading;
|
|
30
|
+
private span;
|
|
31
|
+
private slotOf;
|
|
32
|
+
}
|
|
33
|
+
export { RECORDED_METRICS, SlotSeries };
|
|
34
|
+
export type { SeriesKind };
|
|
35
|
+
//# sourceMappingURL=series-slots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"series-slots.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/series-slots.ts"],"names":[],"mapp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";
|
|
2
|
+
import { DeviceEvent, DeviceSnapshot } from "./device-snapshot";
|
|
3
|
+
import { Listeners } from "./listeners";
|
|
4
|
+
import { ReadingSink } from "./ports";
|
|
5
|
+
import { DecodedReading } from "./reading";
|
|
6
|
+
/** The device being recorded. */
|
|
7
|
+
type RecordedDevice = {
|
|
8
|
+
/** The address its readings are saved under. */
|
|
9
|
+
address: string;
|
|
10
|
+
/** Its snapshot now; the `record` setting says whether to record. */
|
|
11
|
+
snapshot: () => DeviceSnapshot;
|
|
12
|
+
};
|
|
13
|
+
type RecorderDeps = Pick<DeviceDeps, "model" | "protocol" | "now" | "logger">;
|
|
14
|
+
/**
|
|
15
|
+
* Records what one device streams live and saves it through the sink: numbers as series of one-second slots, waveforms
|
|
16
|
+
* as segments of five minutes at the waveform's own sample rate. It does the same for every device.
|
|
17
|
+
*/
|
|
18
|
+
declare class StreamRecorder {
|
|
19
|
+
private readonly device;
|
|
20
|
+
private readonly sink;
|
|
21
|
+
private readonly deps;
|
|
22
|
+
private readonly open;
|
|
23
|
+
private readonly segments;
|
|
24
|
+
private readonly ledger;
|
|
25
|
+
private readonly replacing;
|
|
26
|
+
private readonly unsupported;
|
|
27
|
+
private saving;
|
|
28
|
+
private timer;
|
|
29
|
+
private streaming;
|
|
30
|
+
private readonly origin;
|
|
31
|
+
constructor(device: RecordedDevice, sink: ReadingSink, deps: RecorderDeps);
|
|
32
|
+
/** Records from the device's events: live numbers and samples, and the end of the stream. */
|
|
33
|
+
follow(events: Listeners<DeviceEvent>): void;
|
|
34
|
+
/** Takes one device event: numbers and samples while recording is on, and the end of the stream. */
|
|
35
|
+
observe(event: DeviceEvent): void;
|
|
36
|
+
/** Marks the live recordings a stored record replaces, which the sink removes once it has saved the record. */
|
|
37
|
+
supersede(recordId: string, record: DecodedReading): DecodedReading;
|
|
38
|
+
/** The record was saved, so the recordings it replaced are gone for good. */
|
|
39
|
+
acknowledged(recordId: string): void;
|
|
40
|
+
/** Saves everything still open, and resolves once every save has finished. */
|
|
41
|
+
close(): Promise<void>;
|
|
42
|
+
private followStream;
|
|
43
|
+
private recordNumbers;
|
|
44
|
+
private seriesFor;
|
|
45
|
+
private recordWaveform;
|
|
46
|
+
private segmentFor;
|
|
47
|
+
/** The 60-second save: an open series that grew goes out again under its own name, so the outbox keeps one copy. */
|
|
48
|
+
private saveOpenSeries;
|
|
49
|
+
private finish;
|
|
50
|
+
private saveSettled;
|
|
51
|
+
/** Saves one at a time, in the order they were made. */
|
|
52
|
+
private enqueue;
|
|
53
|
+
private failed;
|
|
54
|
+
private stopTimer;
|
|
55
|
+
}
|
|
56
|
+
export { StreamRecorder };
|
|
57
|
+
export type { RecordedDevice, RecorderDeps };
|
|
58
|
+
//# sourceMappingURL=stream-recorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream-recorder.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/stream-recorder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,cAAc,EAAoE,MAAM,WAAW,CAAC;AAO7G,iCAAiC;AACjC,KAAK,cAAc,GAAG;IAEpB,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAEhB,qEAAqE;IACrE,QAAQ,EAAE,MAAM,cAAc,CAAC;CAChC,CAAC;AAEF,KAAK,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,GAAG,KAAK,GAAG,QAAQ,CAAC,CAAC;AAE9E;;;GAGG;AACH,cAAM,cAAc;IAYhB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,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
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Reading, ReadingSource, Waveform } from "./reading";
|
|
2
|
+
/** What stays the same while one channel of a waveform streams. */
|
|
3
|
+
type ChannelShape = Pick<Waveform, "metric" | "sampleRateHz" | "unit" | "scale"> & {
|
|
4
|
+
channel: string;
|
|
5
|
+
};
|
|
6
|
+
/** One channel's samples, collected until they fill five minutes, a gap opens, or the stream ends. */
|
|
7
|
+
declare class ChannelSegment {
|
|
8
|
+
private readonly shape;
|
|
9
|
+
private readonly origin;
|
|
10
|
+
private chunks;
|
|
11
|
+
private count;
|
|
12
|
+
private from;
|
|
13
|
+
constructor(shape: ChannelShape, origin: ReadingSource);
|
|
14
|
+
/** Adds samples whose first was taken at `at`; returns the segments they completed. */
|
|
15
|
+
add(samples: Int16Array, at: number): Reading[];
|
|
16
|
+
/** Hands over what is collected as one reading, none when it is empty. */
|
|
17
|
+
flush(): Reading[];
|
|
18
|
+
private append;
|
|
19
|
+
private readingOf;
|
|
20
|
+
private capacity;
|
|
21
|
+
private endsAt;
|
|
22
|
+
private durationOf;
|
|
23
|
+
}
|
|
24
|
+
export { ChannelSegment };
|
|
25
|
+
export type { ChannelShape };
|
|
26
|
+
//# sourceMappingURL=waveform-segments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"waveform-segments.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/waveform-segments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAa7D,mEAAmE;AACnE,KAAK,YAAY,GAAG,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvG,sGAAsG;AACtG,cAAM,cAAc;IAKC,OAAO,CAAC,QAAQ,CAAC,KAAK;IAAgB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJhF,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,IAAI,CAAK;gBAEmB,KAAK,EAAE,YAAY,EAAmB,MAAM,EAAE,aAAa;IAE/F,uFAAuF;IAChF,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,EAAE;IAiBtD,0EAA0E;IACnE,KAAK,IAAI,OAAO,EAAE;IAqBzB,OAAO,CAAC,MAAM;IASd,OAAO,CAAC,SAAS;IAejB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,UAAU;CAGnB;AAED,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,YAAY,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OvokStorage } from "@ovok/core/next";
|
|
2
|
+
import { OvokSinkClient } from "./adapters/ovok-reading-sink";
|
|
2
3
|
import { Bluetooth, BluetoothOptions } from "./core/bluetooth";
|
|
3
4
|
/** What `createBluetooth` needs; every port can be swapped, for tests or a custom store or sink. */
|
|
4
5
|
type CreateBluetoothOptions = {
|
|
5
6
|
/** The Ovok client readings are saved through. */
|
|
6
|
-
ovok:
|
|
7
|
+
ovok: OvokSinkClient;
|
|
7
8
|
/** Where paired devices are kept between app starts. */
|
|
8
9
|
storage: OvokStorage;
|
|
9
10
|
} & Partial<BluetoothOptions>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-bluetooth.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/create-bluetooth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"create-bluetooth.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/create-bluetooth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAO9C,OAAO,EAAE,cAAc,EAAmB,MAAM,8BAA8B,CAAC;AAG/E,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAG/D,oGAAoG;AACpG,KAAK,sBAAsB,GAAG;IAE5B,kDAAkD;IAClD,IAAI,EAAE,cAAc,CAAC;IAErB,wDAAwD;IACxD,OAAO,EAAE,WAAW,CAAC;CACtB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAE9B,4HAA4H;AAC5H,QAAA,MAAM,eAAe,GAAI,iCAAiC,sBAAsB,KAAG,SAelF,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,YAAY,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -6,10 +6,13 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export * from "./shared";
|
|
8
8
|
export { androidForegroundService } from "./adapters/android-foreground-service";
|
|
9
|
-
export type { ForegroundServiceText } from "./adapters/android-foreground-service";
|
|
9
|
+
export type { ForegroundServiceOptions, ForegroundServiceText } from "./adapters/android-foreground-service";
|
|
10
10
|
export { blePlxCentral } from "./adapters/ble-plx-central";
|
|
11
11
|
export { osBluetoothPermissions } from "./adapters/os-permissions";
|
|
12
12
|
export { reactNativeLifecycle } from "./adapters/react-native-lifecycle";
|
|
13
13
|
export { createBluetooth } from "./create-bluetooth";
|
|
14
14
|
export type { CreateBluetoothOptions } from "./create-bluetooth";
|
|
15
|
+
export { SqliteOutboxStore } from "./adapters/sqlite-outbox-store";
|
|
16
|
+
export type { SqliteBindValue, SqliteDatabase, SqliteTransaction } from "./adapters/sqlite-database";
|
|
17
|
+
export type { SqliteOutboxOptions } from "./adapters/sqlite-outbox-store";
|
|
15
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,YAAY,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,YAAY,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC7G,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACrG,YAAY,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC"}
|