@neurodevs/node-lsl 19.0.0 → 22.0.0
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/README.md +6 -6
- package/build/__tests__/AbstractPackageTest.d.ts +12 -11
- package/build/__tests__/AbstractPackageTest.js +32 -34
- package/build/__tests__/AbstractPackageTest.js.map +1 -1
- package/build/__tests__/impl/{BleDeviceController.test.d.ts → BleGattController.test.d.ts} +3 -3
- package/build/__tests__/impl/{BleDeviceController.test.js → BleGattController.test.js} +68 -70
- package/build/__tests__/impl/BleGattController.test.js.map +1 -0
- package/build/__tests__/impl/BleObserverController.test.d.ts +12 -0
- package/build/__tests__/impl/BleObserverController.test.js +62 -0
- package/build/__tests__/impl/BleObserverController.test.js.map +1 -0
- package/build/__tests__/impl/{LslEventMarkerEmitter.test.d.ts → LslEventMarkerOutlet.test.d.ts} +3 -3
- package/build/__tests__/impl/{LslEventMarkerEmitter.test.js → LslEventMarkerOutlet.test.js} +45 -46
- package/build/__tests__/impl/LslEventMarkerOutlet.test.js.map +1 -0
- package/build/__tests__/impl/LslJsonOutlet.test.d.ts +14 -0
- package/build/__tests__/impl/LslJsonOutlet.test.js +118 -0
- package/build/__tests__/impl/LslJsonOutlet.test.js.map +1 -0
- package/build/__tests__/impl/LslStreamInfo.test.js +2 -3
- package/build/__tests__/impl/LslStreamInfo.test.js.map +1 -1
- package/build/__tests__/impl/LslStreamInlet.test.d.ts +3 -5
- package/build/__tests__/impl/LslStreamInlet.test.js +13 -47
- package/build/__tests__/impl/LslStreamInlet.test.js.map +1 -1
- package/build/__tests__/impl/LslStreamOutlet.test.js +7 -13
- package/build/__tests__/impl/LslStreamOutlet.test.js.map +1 -1
- package/build/__tests__/impl/LslWebSocketBridge.test.js +9 -11
- package/build/__tests__/impl/LslWebSocketBridge.test.js.map +1 -1
- package/build/__tests__/impl/UsbDeviceController.test.js.map +1 -1
- package/build/__tests__/impl/WindowedClockRegressor.test.js +1 -1
- package/build/__tests__/impl/WindowedClockRegressor.test.js.map +1 -1
- package/build/assertions.js +1 -1
- package/build/assertions.js.map +1 -1
- package/build/impl/LslEventMarkerOutlet.d.ts +35 -0
- package/build/impl/{LslEventMarkerEmitter.js → LslEventMarkerOutlet.js} +2 -2
- package/build/impl/LslEventMarkerOutlet.js.map +1 -0
- package/build/impl/LslJsonOutlet.d.ts +33 -0
- package/build/impl/LslJsonOutlet.js +44 -0
- package/build/impl/LslJsonOutlet.js.map +1 -0
- package/build/impl/LslStreamInfo.d.ts +7 -7
- package/build/impl/LslStreamInfo.js.map +1 -1
- package/build/impl/LslStreamInlet.d.ts +63 -21
- package/build/impl/LslStreamInlet.js +221 -65
- package/build/impl/LslStreamInlet.js.map +1 -1
- package/build/impl/LslStreamOutlet.d.ts +16 -16
- package/build/impl/LslStreamOutlet.js +32 -36
- package/build/impl/LslStreamOutlet.js.map +1 -1
- package/build/impl/LslWebSocketBridge.d.ts +10 -10
- package/build/impl/LslWebSocketBridge.js.map +1 -1
- package/build/impl/clocks/WindowedClockRegressor.js.map +1 -0
- package/build/impl/controllers/{BleDeviceController.d.ts → BleGattController.d.ts} +10 -10
- package/build/impl/controllers/{BleDeviceController.js → BleGattController.js} +19 -19
- package/build/impl/controllers/BleGattController.js.map +1 -0
- package/build/impl/controllers/BleObserverController.d.ts +20 -0
- package/build/impl/controllers/BleObserverController.js +37 -0
- package/build/impl/controllers/BleObserverController.js.map +1 -0
- package/build/impl/controllers/UsbDeviceController.d.ts +9 -9
- package/build/impl/controllers/UsbDeviceController.js +7 -7
- package/build/impl/controllers/UsbDeviceController.js.map +1 -1
- package/build/index.d.ts +43 -31
- package/build/index.js +52 -39
- package/build/index.js.map +1 -1
- package/build/scripts/{runLslEventMarkerEmitter.js → runEventMarkerOutlet.js} +4 -3
- package/build/scripts/runEventMarkerOutlet.js.map +1 -0
- package/build/scripts/{runLslStreamOutlet.js → runLslOutlet.js} +1 -1
- package/build/scripts/runLslOutlet.js.map +1 -0
- package/build/scripts/runMuse.js +2 -2
- package/build/scripts/runMuse.js.map +1 -1
- package/build/testDoubles/{BleController/FakeBleController.d.ts → BleGatt/FakeBleGatt.d.ts} +6 -6
- package/build/testDoubles/{BleController/FakeBleController.js → BleGatt/FakeBleGatt.js} +8 -8
- package/build/testDoubles/BleGatt/FakeBleGatt.js.map +1 -0
- package/build/testDoubles/{BleController/SpyBleController.d.ts → BleGatt/SpyBleGatt.d.ts} +4 -4
- package/build/testDoubles/{BleController/SpyBleController.js → BleGatt/SpyBleGatt.js} +3 -3
- package/build/testDoubles/BleGatt/SpyBleGatt.js.map +1 -0
- package/build/testDoubles/BleObserver/FakeBleObserver.d.ts +10 -0
- package/build/testDoubles/BleObserver/FakeBleObserver.js +20 -0
- package/build/testDoubles/BleObserver/FakeBleObserver.js.map +1 -0
- package/build/testDoubles/ClockRegressor/FakeClockRegressor.d.ts +1 -1
- package/build/testDoubles/{EventMarkerEmitter/FakeEventMarkerEmitter.d.ts → EventMarkerOutlet/FakeEventMarkerOutlet.d.ts} +4 -4
- package/build/testDoubles/{EventMarkerEmitter/FakeEventMarkerEmitter.js → EventMarkerOutlet/FakeEventMarkerOutlet.js} +7 -7
- package/build/testDoubles/EventMarkerOutlet/FakeEventMarkerOutlet.js.map +1 -0
- package/build/testDoubles/EventMarkerOutlet/SpyEventMarkerOutlet.d.ts +10 -0
- package/build/testDoubles/EventMarkerOutlet/SpyEventMarkerOutlet.js +23 -0
- package/build/testDoubles/EventMarkerOutlet/SpyEventMarkerOutlet.js.map +1 -0
- package/build/testDoubles/EventMarkerOutlet/ThrowingEventMarkerOutlet.d.ts +9 -0
- package/build/testDoubles/{EventMarkerEmitter/ThrowingEventMarkerEmitter.js → EventMarkerOutlet/ThrowingEventMarkerOutlet.js} +2 -2
- package/build/testDoubles/EventMarkerOutlet/ThrowingEventMarkerOutlet.js.map +1 -0
- package/build/testDoubles/JsonOutlet/FakeJsonOutlet.d.ts +10 -0
- package/build/testDoubles/JsonOutlet/FakeJsonOutlet.js +20 -0
- package/build/testDoubles/JsonOutlet/FakeJsonOutlet.js.map +1 -0
- package/build/testDoubles/{StreamInfo/FakeStreamInfo.d.ts → LslInfo/FakeLslInfo.d.ts} +4 -4
- package/build/testDoubles/{StreamInfo/FakeStreamInfo.js → LslInfo/FakeLslInfo.js} +7 -7
- package/build/testDoubles/LslInfo/FakeLslInfo.js.map +1 -0
- package/build/testDoubles/LslInfo/SpyLslInfo.d.ts +10 -0
- package/build/testDoubles/{StreamInfo/SpyStreamInfo.js → LslInfo/SpyLslInfo.js} +4 -4
- package/build/testDoubles/LslInfo/SpyLslInfo.js.map +1 -0
- package/build/testDoubles/{StreamInlet/FakeStreamInlet.d.ts → LslInlet/FakeLslInlet.d.ts} +4 -4
- package/build/testDoubles/{StreamInlet/FakeStreamInlet.js → LslInlet/FakeLslInlet.js} +12 -11
- package/build/testDoubles/LslInlet/FakeLslInlet.js.map +1 -0
- package/build/testDoubles/LslInlet/SpyLslInlet.d.ts +4 -0
- package/build/testDoubles/{StreamInlet/SpyStreamInlet.js → LslInlet/SpyLslInlet.js} +2 -2
- package/build/testDoubles/LslInlet/SpyLslInlet.js.map +1 -0
- package/build/testDoubles/{StreamOutlet/FakeStreamOutlet.d.ts → LslOutlet/FakeLslOutlet.d.ts} +5 -5
- package/build/testDoubles/{StreamOutlet/FakeStreamOutlet.js → LslOutlet/FakeLslOutlet.js} +8 -8
- package/build/testDoubles/LslOutlet/FakeLslOutlet.js.map +1 -0
- package/build/testDoubles/LslWsBridge/FakeLslWsBridge.d.ts +14 -0
- package/build/testDoubles/{WebSocketBridge/FakeWebSocketBridge.js → LslWsBridge/FakeLslWsBridge.js} +14 -14
- package/build/testDoubles/LslWsBridge/FakeLslWsBridge.js.map +1 -0
- package/build/testDoubles/LslWsBridge/SpyLslWsBridge.d.ts +4 -0
- package/build/testDoubles/{WebSocketBridge/SpyLslWebSocketBridge.js → LslWsBridge/SpyLslWsBridge.js} +2 -2
- package/build/testDoubles/LslWsBridge/SpyLslWsBridge.js.map +1 -0
- package/build/testDoubles/UsbDevice/FakeUsbDevice.d.ts +12 -0
- package/build/testDoubles/UsbDevice/FakeUsbDevice.js +25 -0
- package/build/testDoubles/UsbDevice/FakeUsbDevice.js.map +1 -0
- package/build/testDoubles/consts.d.ts +2 -12
- package/build/testDoubles/consts.js +0 -20
- package/build/testDoubles/consts.js.map +1 -1
- package/build/testDoubles/generateRandomOutletOptions.d.ts +2 -2
- package/build/testDoubles/generateRandomOutletOptions.js.map +1 -1
- package/package.json +5 -4
- package/src/__tests__/AbstractPackageTest.ts +35 -42
- package/src/__tests__/impl/{BleDeviceController.test.ts → BleGattController.test.ts} +45 -47
- package/src/__tests__/impl/BleObserverController.test.ts +72 -0
- package/src/__tests__/impl/{LslEventMarkerEmitter.test.ts → LslEventMarkerOutlet.test.ts} +33 -37
- package/src/__tests__/impl/LslJsonOutlet.test.ts +135 -0
- package/src/__tests__/impl/LslStreamInfo.test.ts +8 -9
- package/src/__tests__/impl/LslStreamInlet.test.ts +21 -79
- package/src/__tests__/impl/LslStreamOutlet.test.ts +17 -25
- package/src/__tests__/impl/LslWebSocketBridge.test.ts +15 -19
- package/src/__tests__/impl/UsbDeviceController.test.ts +2 -2
- package/src/__tests__/impl/WindowedClockRegressor.test.ts +1 -1
- package/src/assertions.ts +1 -2
- package/src/impl/{LslEventMarkerEmitter.ts → LslEventMarkerOutlet.ts} +17 -17
- package/src/impl/LslJsonOutlet.ts +87 -0
- package/src/impl/LslStreamInfo.ts +7 -9
- package/src/impl/LslStreamInlet.ts +305 -81
- package/src/impl/LslStreamOutlet.ts +62 -59
- package/src/impl/LslWebSocketBridge.ts +15 -18
- package/src/impl/controllers/{BleDeviceController.ts → BleGattController.ts} +23 -28
- package/src/impl/controllers/BleObserverController.ts +62 -0
- package/src/impl/controllers/UsbDeviceController.ts +14 -16
- package/src/index.ts +64 -44
- package/src/scripts/{runLslEventMarkerEmitter.ts → runEventMarkerOutlet.ts} +3 -2
- package/src/scripts/runMuse.ts +2 -2
- package/src/testDoubles/{BleController/FakeBleController.ts → BleGatt/FakeBleGatt.ts} +14 -14
- package/src/testDoubles/{BleController/SpyBleController.ts → BleGatt/SpyBleGatt.ts} +5 -5
- package/src/testDoubles/BleObserver/FakeBleObserver.ts +28 -0
- package/src/testDoubles/ClockRegressor/FakeClockRegressor.ts +1 -1
- package/src/testDoubles/{EventMarkerEmitter/FakeEventMarkerEmitter.ts → EventMarkerOutlet/FakeEventMarkerOutlet.ts} +11 -11
- package/src/testDoubles/EventMarkerOutlet/SpyEventMarkerOutlet.ts +31 -0
- package/src/testDoubles/{EventMarkerEmitter/ThrowingEventMarkerEmitter.ts → EventMarkerOutlet/ThrowingEventMarkerOutlet.ts} +5 -5
- package/src/testDoubles/JsonOutlet/FakeJsonOutlet.ts +25 -0
- package/src/testDoubles/{StreamInfo/FakeStreamInfo.ts → LslInfo/FakeLslInfo.ts} +9 -9
- package/src/testDoubles/{StreamInfo/SpyStreamInfo.ts → LslInfo/SpyLslInfo.ts} +5 -5
- package/src/testDoubles/{StreamInlet/FakeStreamInlet.ts → LslInlet/FakeLslInlet.ts} +15 -14
- package/src/testDoubles/LslInlet/SpyLslInlet.ts +10 -0
- package/src/testDoubles/{StreamOutlet/FakeStreamOutlet.ts → LslOutlet/FakeLslOutlet.ts} +11 -14
- package/src/testDoubles/{WebSocketBridge/FakeWebSocketBridge.ts → LslWsBridge/FakeLslWsBridge.ts} +19 -19
- package/src/testDoubles/LslWsBridge/SpyLslWsBridge.ts +9 -0
- package/src/testDoubles/UsbDevice/FakeUsbDevice.ts +34 -0
- package/src/testDoubles/consts.ts +3 -23
- package/src/testDoubles/generateRandomOutletOptions.ts +2 -2
- package/build/__tests__/impl/BleDeviceController.test.js.map +0 -1
- package/build/__tests__/impl/LslEventMarkerEmitter.test.js.map +0 -1
- package/build/consts.d.ts +0 -11
- package/build/consts.js +0 -21
- package/build/consts.js.map +0 -1
- package/build/impl/LslEventMarkerEmitter.d.ts +0 -35
- package/build/impl/LslEventMarkerEmitter.js.map +0 -1
- package/build/impl/WindowedClockRegressor.js.map +0 -1
- package/build/impl/controllers/BleDeviceController.js.map +0 -1
- package/build/impl/workers/inlet/LslStreamInlet.worker.d.ts +0 -22
- package/build/impl/workers/inlet/LslStreamInlet.worker.js +0 -42
- package/build/impl/workers/inlet/LslStreamInlet.worker.js.map +0 -1
- package/build/impl/workers/inlet/StreamInletWorker.d.ts +0 -73
- package/build/impl/workers/inlet/StreamInletWorker.js +0 -253
- package/build/impl/workers/inlet/StreamInletWorker.js.map +0 -1
- package/build/impl/workers/outlet/LslStreamOutlet.worker.d.ts +0 -32
- package/build/impl/workers/outlet/LslStreamOutlet.worker.js +0 -82
- package/build/impl/workers/outlet/LslStreamOutlet.worker.js.map +0 -1
- package/build/scripts/discoverMuse.js +0 -40
- package/build/scripts/discoverMuse.js.map +0 -1
- package/build/scripts/runLslEventMarkerEmitter.js.map +0 -1
- package/build/scripts/runLslStreamOutlet.d.ts +0 -1
- package/build/scripts/runLslStreamOutlet.js.map +0 -1
- package/build/scripts/testDestroyOutlet.d.ts +0 -1
- package/build/scripts/testDestroyOutlet.js +0 -4
- package/build/scripts/testDestroyOutlet.js.map +0 -1
- package/build/testDoubles/BleController/FakeBleController.js.map +0 -1
- package/build/testDoubles/BleController/SpyBleController.js.map +0 -1
- package/build/testDoubles/EventMarkerEmitter/FakeEventMarkerEmitter.js.map +0 -1
- package/build/testDoubles/EventMarkerEmitter/SpyEventMarkerEmitter.d.ts +0 -10
- package/build/testDoubles/EventMarkerEmitter/SpyEventMarkerEmitter.js +0 -23
- package/build/testDoubles/EventMarkerEmitter/SpyEventMarkerEmitter.js.map +0 -1
- package/build/testDoubles/EventMarkerEmitter/ThrowingEventMarkerEmitter.d.ts +0 -9
- package/build/testDoubles/EventMarkerEmitter/ThrowingEventMarkerEmitter.js.map +0 -1
- package/build/testDoubles/StreamInfo/FakeStreamInfo.js.map +0 -1
- package/build/testDoubles/StreamInfo/SpyStreamInfo.d.ts +0 -10
- package/build/testDoubles/StreamInfo/SpyStreamInfo.js.map +0 -1
- package/build/testDoubles/StreamInlet/FakeStreamInlet.js.map +0 -1
- package/build/testDoubles/StreamInlet/SpyStreamInlet.d.ts +0 -4
- package/build/testDoubles/StreamInlet/SpyStreamInlet.js.map +0 -1
- package/build/testDoubles/StreamOutlet/FakeStreamOutlet.js.map +0 -1
- package/build/testDoubles/UsbController/FakeUsbController.d.ts +0 -12
- package/build/testDoubles/UsbController/FakeUsbController.js +0 -25
- package/build/testDoubles/UsbController/FakeUsbController.js.map +0 -1
- package/build/testDoubles/WebSocketBridge/FakeWebSocketBridge.d.ts +0 -14
- package/build/testDoubles/WebSocketBridge/FakeWebSocketBridge.js.map +0 -1
- package/build/testDoubles/WebSocketBridge/SpyLslWebSocketBridge.d.ts +0 -4
- package/build/testDoubles/WebSocketBridge/SpyLslWebSocketBridge.js.map +0 -1
- package/build/testDoubles/WorkerThreads/FakeWorker.d.ts +0 -27
- package/build/testDoubles/WorkerThreads/FakeWorker.js +0 -67
- package/build/testDoubles/WorkerThreads/FakeWorker.js.map +0 -1
- package/src/consts.ts +0 -21
- package/src/impl/workers/inlet/LslStreamInlet.worker.ts +0 -74
- package/src/impl/workers/inlet/StreamInletWorker.ts +0 -348
- package/src/impl/workers/outlet/LslStreamOutlet.worker.ts +0 -144
- package/src/scripts/discoverMuse.ts +0 -50
- package/src/scripts/testDestroyOutlet.ts +0 -5
- package/src/testDoubles/EventMarkerEmitter/SpyEventMarkerEmitter.ts +0 -31
- package/src/testDoubles/StreamInlet/SpyStreamInlet.ts +0 -10
- package/src/testDoubles/UsbController/FakeUsbController.ts +0 -34
- package/src/testDoubles/WebSocketBridge/SpyLslWebSocketBridge.ts +0 -9
- package/src/testDoubles/WorkerThreads/FakeWorker.ts +0 -99
- /package/build/impl/{WindowedClockRegressor.d.ts → clocks/WindowedClockRegressor.d.ts} +0 -0
- /package/build/impl/{WindowedClockRegressor.js → clocks/WindowedClockRegressor.js} +0 -0
- /package/build/scripts/{discoverMuse.d.ts → runEventMarkerOutlet.d.ts} +0 -0
- /package/build/scripts/{runLslEventMarkerEmitter.d.ts → runLslOutlet.d.ts} +0 -0
- /package/src/impl/{WindowedClockRegressor.ts → clocks/WindowedClockRegressor.ts} +0 -0
- /package/src/scripts/{runLslStreamOutlet.ts → runLslOutlet.ts} +0 -0
package/src/index.ts
CHANGED
|
@@ -1,82 +1,102 @@
|
|
|
1
|
+
// BleObserver
|
|
2
|
+
|
|
3
|
+
export { default as BleObserverController } from './impl/controllers/BleObserverController.js'
|
|
4
|
+
export * from './impl/controllers/BleObserverController.js'
|
|
5
|
+
|
|
6
|
+
export { default as FakeBleObserver } from './testDoubles/BleObserver/FakeBleObserver.js'
|
|
7
|
+
export * from './testDoubles/BleObserver/FakeBleObserver.js'
|
|
8
|
+
|
|
1
9
|
// ClockRegressor
|
|
2
10
|
|
|
3
|
-
export { default as WindowedClockRegressor } from './impl/WindowedClockRegressor.js'
|
|
4
|
-
export * from './impl/WindowedClockRegressor.js'
|
|
11
|
+
export { default as WindowedClockRegressor } from './impl/clocks/WindowedClockRegressor.js'
|
|
12
|
+
export * from './impl/clocks/WindowedClockRegressor.js'
|
|
5
13
|
|
|
6
14
|
export { default as FakeClockRegressor } from './testDoubles/ClockRegressor/FakeClockRegressor.js'
|
|
7
15
|
export * from './testDoubles/ClockRegressor/FakeClockRegressor.js'
|
|
8
16
|
|
|
9
|
-
//
|
|
17
|
+
// BleGatt
|
|
18
|
+
|
|
19
|
+
export { default as BleGattController } from './impl/controllers/BleGattController.js'
|
|
20
|
+
export * from './impl/controllers/BleGattController.js'
|
|
21
|
+
|
|
22
|
+
export { default as SpyBleGatt } from './testDoubles/BleGatt/SpyBleGatt.js'
|
|
23
|
+
export * from './testDoubles/BleGatt/SpyBleGatt.js'
|
|
24
|
+
|
|
25
|
+
export { default as FakeBleGatt } from './testDoubles/BleGatt/FakeBleGatt.js'
|
|
26
|
+
export * from './testDoubles/BleGatt/FakeBleGatt.js'
|
|
10
27
|
|
|
11
|
-
|
|
12
|
-
export * from './impl/controllers/BleDeviceController.js'
|
|
28
|
+
// EventMarkerOutlet
|
|
13
29
|
|
|
14
|
-
export { default as
|
|
15
|
-
export * from './
|
|
30
|
+
export { default as LslEventMarkerOutlet } from './impl/LslEventMarkerOutlet.js'
|
|
31
|
+
export * from './impl/LslEventMarkerOutlet.js'
|
|
16
32
|
|
|
17
|
-
export { default as
|
|
18
|
-
export * from './testDoubles/
|
|
33
|
+
export { default as SpyEventMarkerOutlet } from './testDoubles/EventMarkerOutlet/SpyEventMarkerOutlet.js'
|
|
34
|
+
export * from './testDoubles/EventMarkerOutlet/SpyEventMarkerOutlet.js'
|
|
19
35
|
|
|
20
|
-
|
|
36
|
+
export { default as FakeEventMarkerOutlet } from './testDoubles/EventMarkerOutlet/FakeEventMarkerOutlet.js'
|
|
37
|
+
export * from './testDoubles/EventMarkerOutlet/FakeEventMarkerOutlet.js'
|
|
21
38
|
|
|
22
|
-
export { default as
|
|
23
|
-
export * from './
|
|
39
|
+
export { default as ThrowingEventMarkerOutlet } from './testDoubles/EventMarkerOutlet/ThrowingEventMarkerOutlet.js'
|
|
40
|
+
export * from './testDoubles/EventMarkerOutlet/ThrowingEventMarkerOutlet.js'
|
|
24
41
|
|
|
25
|
-
|
|
26
|
-
|
|
42
|
+
// JsonOutlet
|
|
43
|
+
|
|
44
|
+
export { default as LslJsonOutlet } from './impl/LslJsonOutlet.js'
|
|
45
|
+
export * from './impl/LslJsonOutlet.js'
|
|
46
|
+
|
|
47
|
+
export { default as FakeJsonOutlet } from './testDoubles/JsonOutlet/FakeJsonOutlet.js'
|
|
48
|
+
export * from './testDoubles/JsonOutlet/FakeJsonOutlet.js'
|
|
49
|
+
|
|
50
|
+
// LslWsBridge
|
|
51
|
+
|
|
52
|
+
export { default as LslWebSocketBridge } from './impl/LslWebSocketBridge.js'
|
|
53
|
+
export * from './impl/LslWebSocketBridge.js'
|
|
27
54
|
|
|
28
|
-
export { default as
|
|
29
|
-
export * from './testDoubles/
|
|
55
|
+
export { default as SpyLslWsBridge } from './testDoubles/LslWsBridge/SpyLslWsBridge.js'
|
|
56
|
+
export * from './testDoubles/LslWsBridge/SpyLslWsBridge.js'
|
|
30
57
|
|
|
31
|
-
export { default as
|
|
32
|
-
export * from './testDoubles/
|
|
58
|
+
export { default as FakeLslWsBridge } from './testDoubles/LslWsBridge/FakeLslWsBridge.js'
|
|
59
|
+
export * from './testDoubles/LslWsBridge/FakeLslWsBridge.js'
|
|
33
60
|
|
|
34
|
-
//
|
|
61
|
+
// LslInfo
|
|
35
62
|
|
|
36
63
|
export { default as LslStreamInfo } from './impl/LslStreamInfo.js'
|
|
37
64
|
export * from './impl/LslStreamInfo.js'
|
|
38
65
|
|
|
39
|
-
export { default as
|
|
40
|
-
export * from './testDoubles/
|
|
66
|
+
export { default as SpyLslInfo } from './testDoubles/LslInfo/SpyLslInfo.js'
|
|
67
|
+
export * from './testDoubles/LslInfo/SpyLslInfo.js'
|
|
41
68
|
|
|
42
|
-
export { default as
|
|
43
|
-
export * from './testDoubles/
|
|
69
|
+
export { default as FakeLslInfo } from './testDoubles/LslInfo/FakeLslInfo.js'
|
|
70
|
+
export * from './testDoubles/LslInfo/FakeLslInfo.js'
|
|
44
71
|
|
|
45
|
-
//
|
|
72
|
+
// LslInlet
|
|
46
73
|
|
|
47
74
|
export { default as LslStreamInlet } from './impl/LslStreamInlet.js'
|
|
48
75
|
export * from './impl/LslStreamInlet.js'
|
|
49
76
|
|
|
50
|
-
export { default as
|
|
51
|
-
export * from './testDoubles/
|
|
77
|
+
export { default as SpyLslInlet } from './testDoubles/LslInlet/SpyLslInlet.js'
|
|
78
|
+
export * from './testDoubles/LslInlet/SpyLslInlet.js'
|
|
52
79
|
|
|
53
|
-
|
|
80
|
+
export { default as FakeLslInlet } from './testDoubles/LslInlet/FakeLslInlet.js'
|
|
81
|
+
export * from './testDoubles/LslInlet/FakeLslInlet.js'
|
|
82
|
+
|
|
83
|
+
// LslOutlet
|
|
54
84
|
|
|
55
85
|
export { default as LslStreamOutlet } from './impl/LslStreamOutlet.js'
|
|
56
86
|
export * from './impl/LslStreamOutlet.js'
|
|
57
87
|
|
|
58
|
-
export { default as
|
|
59
|
-
export * from './testDoubles/
|
|
88
|
+
export { default as FakeLslOutlet } from './testDoubles/LslOutlet/FakeLslOutlet.js'
|
|
89
|
+
export * from './testDoubles/LslOutlet/FakeLslOutlet.js'
|
|
90
|
+
|
|
91
|
+
export { default as generateRandomOutletOptions } from './testDoubles/generateRandomOutletOptions.js'
|
|
60
92
|
|
|
61
|
-
//
|
|
93
|
+
// UsbDevice
|
|
62
94
|
|
|
63
95
|
export { default as UsbDeviceController } from './impl/controllers/UsbDeviceController.js'
|
|
64
96
|
export * from './impl/controllers/UsbDeviceController.js'
|
|
65
97
|
|
|
66
|
-
export { default as
|
|
67
|
-
export * from './testDoubles/
|
|
68
|
-
|
|
69
|
-
// WebSocketBridge
|
|
70
|
-
|
|
71
|
-
export { default as LslWebSocketBridge } from './impl/LslWebSocketBridge.js'
|
|
72
|
-
export * from './impl/LslWebSocketBridge.js'
|
|
73
|
-
|
|
74
|
-
export { default as FakeWebSocketBridge } from './testDoubles/WebSocketBridge/FakeWebSocketBridge.js'
|
|
75
|
-
export * from './testDoubles/WebSocketBridge/FakeWebSocketBridge.js'
|
|
76
|
-
|
|
77
|
-
// Utils
|
|
78
|
-
|
|
79
|
-
export { default as generateRandomOutletOptions } from './testDoubles/generateRandomOutletOptions.js'
|
|
98
|
+
export { default as FakeUsbDevice } from './testDoubles/UsbDevice/FakeUsbDevice.js'
|
|
99
|
+
export * from './testDoubles/UsbDevice/FakeUsbDevice.js'
|
|
80
100
|
|
|
81
101
|
// WebSockets
|
|
82
102
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import LslEventMarkerOutlet from '../impl/LslEventMarkerOutlet.js'
|
|
2
2
|
|
|
3
|
-
const outlet = await
|
|
3
|
+
const outlet = await LslEventMarkerOutlet.Create()
|
|
4
4
|
|
|
5
5
|
const markers = [
|
|
6
6
|
{ name: 'phase-1-begin', waitAfterMs: 100 },
|
|
@@ -13,3 +13,4 @@ void outlet.emitMany(markers)
|
|
|
13
13
|
await new Promise((resolve) => setTimeout(resolve, 250))
|
|
14
14
|
|
|
15
15
|
outlet.interrupt()
|
|
16
|
+
outlet.destroy()
|
package/src/scripts/runMuse.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import koffi from 'koffi'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import BleGattController from '../impl/controllers/BleGattController.js'
|
|
4
4
|
|
|
5
5
|
const MUSE_CHARACTERISTIC_UUIDS: Record<string, string> = {
|
|
6
6
|
CONTROL: '273E0001-4C4D-454D-96BE-F03BAC821358',
|
|
@@ -32,7 +32,7 @@ const charCallbacks = Object.entries(MUSE_CHARACTERISTIC_UUIDS).map(
|
|
|
32
32
|
}
|
|
33
33
|
)
|
|
34
34
|
|
|
35
|
-
const muse =
|
|
35
|
+
const muse = BleGattController.Create({
|
|
36
36
|
deviceUuid: 'CA6A61B7-B7A8-AF24-3C9E-04A6A5012554',
|
|
37
37
|
charCallbacks,
|
|
38
38
|
rssiIntervalMs: 1000,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import generateId from '@neurodevs/generate-id'
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
BleGatt,
|
|
4
|
+
BleGattOptions,
|
|
5
5
|
CharacteristicCallbacks,
|
|
6
|
-
} from '../../impl/controllers/
|
|
6
|
+
} from '../../impl/controllers/BleGattController.js'
|
|
7
7
|
|
|
8
|
-
export default class
|
|
9
|
-
public static callsToConstructor: (
|
|
8
|
+
export default class FakeBleGatt implements BleGatt {
|
|
9
|
+
public static callsToConstructor: (BleGattOptions | undefined)[] = []
|
|
10
10
|
|
|
11
11
|
public static numCallsToConnect = 0
|
|
12
12
|
|
|
@@ -26,24 +26,24 @@ export default class FakeBleController implements BleController {
|
|
|
26
26
|
private _uuid: string
|
|
27
27
|
private _name: string
|
|
28
28
|
|
|
29
|
-
public constructor(options?:
|
|
29
|
+
public constructor(options?: BleGattOptions) {
|
|
30
30
|
const { deviceUuid } = options ?? {}
|
|
31
31
|
|
|
32
32
|
this._uuid = deviceUuid ?? generateId()
|
|
33
|
-
this._name =
|
|
33
|
+
this._name = FakeBleGatt.fakeName
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
FakeBleGatt.callsToConstructor.push(options)
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
public async connect() {
|
|
39
|
-
|
|
39
|
+
FakeBleGatt.numCallsToConnect++
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
public async writeCharacteristic(
|
|
43
43
|
characteristicUuid: string,
|
|
44
44
|
value: string
|
|
45
45
|
) {
|
|
46
|
-
|
|
46
|
+
FakeBleGatt.callsToWriteCharacteristic.push({
|
|
47
47
|
characteristicUuid,
|
|
48
48
|
value,
|
|
49
49
|
})
|
|
@@ -52,11 +52,11 @@ export default class FakeBleController implements BleController {
|
|
|
52
52
|
public async subscribeCharacteristics(
|
|
53
53
|
charCallbacks: CharacteristicCallbacks
|
|
54
54
|
) {
|
|
55
|
-
|
|
55
|
+
FakeBleGatt.callsToSubscribeCharacteristics.push(charCallbacks)
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
public async disconnect() {
|
|
59
|
-
|
|
59
|
+
FakeBleGatt.numCallsToDisconnect++
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
public get uuid() {
|
|
@@ -76,6 +76,6 @@ export default class FakeBleController implements BleController {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
export interface
|
|
80
|
-
options:
|
|
79
|
+
export interface CallToBleGattConstructor {
|
|
80
|
+
options: BleGattOptions
|
|
81
81
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
} from '../../impl/controllers/
|
|
1
|
+
import BleGattController, {
|
|
2
|
+
BleGattOptions,
|
|
3
|
+
} from '../../impl/controllers/BleGattController.js'
|
|
4
4
|
|
|
5
|
-
export default class
|
|
5
|
+
export default class SpyBleGatt extends BleGattController {
|
|
6
6
|
public infoLogs: string[] = []
|
|
7
7
|
public warnLogs: string[] = []
|
|
8
8
|
public errorLogs: string[] = []
|
|
9
9
|
|
|
10
|
-
public constructor(options:
|
|
10
|
+
public constructor(options: BleGattOptions) {
|
|
11
11
|
super(options)
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BleObserver,
|
|
3
|
+
BleObserverOptions,
|
|
4
|
+
} from '../../impl/controllers/BleObserverController.js'
|
|
5
|
+
|
|
6
|
+
export default class FakeBleObserver implements BleObserver {
|
|
7
|
+
public static callsToConstructor: BleObserverOptions[] = []
|
|
8
|
+
public static numCallsToStartObserving = 0
|
|
9
|
+
public static numCallsToStopObserving = 0
|
|
10
|
+
|
|
11
|
+
public constructor(options: BleObserverOptions) {
|
|
12
|
+
FakeBleObserver.callsToConstructor.push(options)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public async startObserving() {
|
|
16
|
+
FakeBleObserver.numCallsToStartObserving++
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public async stopObserving() {
|
|
20
|
+
FakeBleObserver.numCallsToStopObserving++
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public static resetTestDouble() {
|
|
24
|
+
FakeBleObserver.callsToConstructor = []
|
|
25
|
+
FakeBleObserver.numCallsToStartObserving = 0
|
|
26
|
+
FakeBleObserver.numCallsToStopObserving = 0
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ClockRegressor,
|
|
3
3
|
WindowedClockRegressorOptions,
|
|
4
|
-
} from '../../impl/WindowedClockRegressor.js'
|
|
4
|
+
} from '../../impl/clocks/WindowedClockRegressor.js'
|
|
5
5
|
|
|
6
6
|
export default class FakeClockRegressor implements ClockRegressor {
|
|
7
7
|
public static callsToConstructor: {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
EventMarkerOutlet,
|
|
3
|
+
EmitOptions,
|
|
4
4
|
TimedEventMarker,
|
|
5
|
-
} from '../../impl/
|
|
5
|
+
} from '../../impl/LslEventMarkerOutlet.js'
|
|
6
6
|
|
|
7
|
-
export default class
|
|
7
|
+
export default class FakeEventMarkerOutlet implements EventMarkerOutlet {
|
|
8
8
|
public static numCallsToConstructor = 0
|
|
9
9
|
|
|
10
10
|
public static callsToEmit: {
|
|
11
11
|
markerName: string
|
|
12
|
-
options?:
|
|
12
|
+
options?: EmitOptions
|
|
13
13
|
}[] = []
|
|
14
14
|
|
|
15
15
|
public static callsToEmitMany: TimedEventMarker[][] = []
|
|
@@ -17,23 +17,23 @@ export default class FakeEventMarkerEmitter implements EventMarkerEmitter {
|
|
|
17
17
|
public static numCallsToDestroy = 0
|
|
18
18
|
|
|
19
19
|
public constructor() {
|
|
20
|
-
|
|
20
|
+
FakeEventMarkerOutlet.numCallsToConstructor++
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
public async emit(markerName: string, options?:
|
|
24
|
-
|
|
23
|
+
public async emit(markerName: string, options?: EmitOptions) {
|
|
24
|
+
FakeEventMarkerOutlet.callsToEmit.push({ markerName, options })
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
public async emitMany(markers: TimedEventMarker[]) {
|
|
28
|
-
|
|
28
|
+
FakeEventMarkerOutlet.callsToEmitMany.push(markers)
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
public interrupt() {
|
|
32
|
-
|
|
32
|
+
FakeEventMarkerOutlet.numCallsToInterrupt++
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
public destroy() {
|
|
36
|
-
|
|
36
|
+
FakeEventMarkerOutlet.numCallsToDestroy++
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
public static resetTestDouble() {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import LslEventMarkerOutlet from '../../impl/LslEventMarkerOutlet.js'
|
|
2
|
+
import { LslOutlet } from '../../impl/LslStreamOutlet.js'
|
|
3
|
+
|
|
4
|
+
export default class SpyEventMarkerOutlet extends LslEventMarkerOutlet {
|
|
5
|
+
public static shouldCallWaitOnSuper = false
|
|
6
|
+
|
|
7
|
+
public totalWaitAfterMs: number
|
|
8
|
+
|
|
9
|
+
public constructor(outlet: LslOutlet) {
|
|
10
|
+
super(outlet)
|
|
11
|
+
|
|
12
|
+
this.totalWaitAfterMs = 0
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public async wait(waitAfterMs: number) {
|
|
16
|
+
this.totalWaitAfterMs += waitAfterMs
|
|
17
|
+
|
|
18
|
+
if (SpyEventMarkerOutlet.shouldCallWaitOnSuper) {
|
|
19
|
+
return super.wait(waitAfterMs)
|
|
20
|
+
}
|
|
21
|
+
return Promise.resolve()
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public getStreamOutlet() {
|
|
25
|
+
return this.outlet
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public resetTestDouble() {
|
|
29
|
+
this.totalWaitAfterMs = 0
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
EventMarkerOutlet,
|
|
3
|
+
EmitOptions,
|
|
4
4
|
TimedEventMarker,
|
|
5
|
-
} from '../../impl/
|
|
5
|
+
} from '../../impl/LslEventMarkerOutlet.js'
|
|
6
6
|
|
|
7
|
-
export default class
|
|
7
|
+
export default class ThrowingEventMarkerOutlet implements EventMarkerOutlet {
|
|
8
8
|
private errorMsg = 'Intentional throwing: '
|
|
9
9
|
|
|
10
10
|
public constructor() {
|
|
11
11
|
throw new Error(this.errorMsg + 'constructor')
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
public async emit(_markerName: string, _options?:
|
|
14
|
+
public async emit(_markerName: string, _options?: EmitOptions) {
|
|
15
15
|
throw new Error(this.errorMsg + 'emit')
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Json, JsonOutlet } from '../../impl/LslJsonOutlet.js'
|
|
2
|
+
|
|
3
|
+
export default class FakeJsonOutlet implements JsonOutlet {
|
|
4
|
+
public static numCallsToConstructor = 0
|
|
5
|
+
public static callsToPushJson: Json[] = []
|
|
6
|
+
public static numCallsToDestroy = 0
|
|
7
|
+
|
|
8
|
+
public constructor() {
|
|
9
|
+
FakeJsonOutlet.numCallsToConstructor++
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public pushJson(data: Json) {
|
|
13
|
+
FakeJsonOutlet.callsToPushJson.push(data)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public destroy() {
|
|
17
|
+
FakeJsonOutlet.numCallsToDestroy++
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public static resetTestDouble() {
|
|
21
|
+
FakeJsonOutlet.numCallsToConstructor = 0
|
|
22
|
+
FakeJsonOutlet.callsToPushJson = []
|
|
23
|
+
FakeJsonOutlet.numCallsToDestroy = 0
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import generateId from '@neurodevs/generate-id'
|
|
2
2
|
import { InfoHandle } from '@neurodevs/ndx-native'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { LslInfo, LslInfoOptions } from '../../impl/LslStreamInfo.js'
|
|
5
5
|
|
|
6
|
-
export default class
|
|
7
|
-
public static callsToConstructor: (
|
|
6
|
+
export default class FakeLslInfo implements LslInfo {
|
|
7
|
+
public static callsToConstructor: (LslInfoOptions | undefined)[] = []
|
|
8
8
|
public static numCallsToDestroy = 0
|
|
9
9
|
|
|
10
10
|
public static infoHandle = {} as InfoHandle
|
|
@@ -17,12 +17,12 @@ export default class FakeStreamInfo implements StreamInfo {
|
|
|
17
17
|
public sampleRateHz = 0
|
|
18
18
|
public units = 'N/A'
|
|
19
19
|
|
|
20
|
-
public constructor(options?:
|
|
21
|
-
|
|
20
|
+
public constructor(options?: LslInfoOptions) {
|
|
21
|
+
FakeLslInfo.callsToConstructor.push(options)
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
public destroy() {
|
|
25
|
-
|
|
25
|
+
FakeLslInfo.numCallsToDestroy++
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
public get channelCount() {
|
|
@@ -30,11 +30,11 @@ export default class FakeStreamInfo implements StreamInfo {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
public get infoHandle() {
|
|
33
|
-
return
|
|
33
|
+
return FakeLslInfo.infoHandle
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
public static resetTestDouble() {
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
FakeLslInfo.callsToConstructor = []
|
|
38
|
+
FakeLslInfo.numCallsToDestroy = 0
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import LslStreamInfo, {
|
|
1
|
+
import LslStreamInfo, { LslInfoOptions } from '../../impl/LslStreamInfo.js'
|
|
2
2
|
|
|
3
|
-
export default class
|
|
3
|
+
export default class SpyLslInfo extends LslStreamInfo {
|
|
4
4
|
public static numCallsToConstructor = 0
|
|
5
5
|
|
|
6
|
-
public constructor(options:
|
|
6
|
+
public constructor(options: LslInfoOptions) {
|
|
7
7
|
super(options)
|
|
8
|
-
|
|
8
|
+
SpyLslInfo.numCallsToConstructor++
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
public getName() {
|
|
@@ -25,6 +25,6 @@ export default class SpyStreamInfo extends LslStreamInfo {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
public static resetTestDouble() {
|
|
28
|
-
|
|
28
|
+
SpyLslInfo.numCallsToConstructor = 0
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OnDataCallback,
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
LslInlet,
|
|
4
|
+
LslInletOptions,
|
|
5
5
|
} from '../../impl/LslStreamInlet.js'
|
|
6
6
|
|
|
7
|
-
export default class
|
|
7
|
+
export default class FakeLslInlet implements LslInlet {
|
|
8
8
|
public static callsToConstructor: {
|
|
9
|
-
options?:
|
|
9
|
+
options?: LslInletOptions
|
|
10
10
|
onData?: OnDataCallback
|
|
11
11
|
}[] = []
|
|
12
12
|
|
|
@@ -19,37 +19,38 @@ export default class FakeStreamInlet implements StreamInlet {
|
|
|
19
19
|
|
|
20
20
|
protected onData!: OnDataCallback
|
|
21
21
|
|
|
22
|
-
public constructor(options?:
|
|
22
|
+
public constructor(options?: LslInletOptions, onData?: OnDataCallback) {
|
|
23
23
|
this.onData = onData ?? (() => {})
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
FakeLslInlet.callsToConstructor.push({
|
|
26
26
|
options,
|
|
27
27
|
onData: this.onData,
|
|
28
28
|
})
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
public async startPulling() {
|
|
32
|
-
|
|
32
|
+
FakeLslInlet.numCallsToStartPulling++
|
|
33
33
|
this.isRunning = true
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
public stopPulling() {
|
|
37
|
-
|
|
37
|
+
FakeLslInlet.numCallsToStopPulling++
|
|
38
38
|
this.isRunning = false
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
public flushInlet() {
|
|
42
|
-
|
|
42
|
+
FakeLslInlet.numCallsToFlushInlet++
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
public destroy() {
|
|
46
|
-
|
|
46
|
+
FakeLslInlet.numCallsToDestroy++
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
public static resetTestDouble() {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
this.callsToConstructor = []
|
|
51
|
+
this.numCallsToStartPulling = 0
|
|
52
|
+
this.numCallsToStopPulling = 0
|
|
53
|
+
this.numCallsToFlushInlet = 0
|
|
54
|
+
this.numCallsToDestroy = 0
|
|
54
55
|
}
|
|
55
56
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import LslStreamInlet, {
|
|
2
|
+
OnDataCallback,
|
|
3
|
+
LslInletOptions,
|
|
4
|
+
} from '../../impl/LslStreamInlet.js'
|
|
5
|
+
|
|
6
|
+
export default class SpyLslInlet extends LslStreamInlet {
|
|
7
|
+
public constructor(options: LslInletOptions, onData: OnDataCallback) {
|
|
8
|
+
super(options, onData)
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -3,13 +3,10 @@ import { randomInt } from 'node:crypto'
|
|
|
3
3
|
import generateId from '@neurodevs/generate-id'
|
|
4
4
|
import { LslSample } from '@neurodevs/ndx-native'
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
StreamOutlet,
|
|
8
|
-
StreamOutletOptions,
|
|
9
|
-
} from '../../impl/LslStreamOutlet.js'
|
|
6
|
+
import { LslOutlet, LslOutletOptions } from '../../impl/LslStreamOutlet.js'
|
|
10
7
|
|
|
11
|
-
export default class
|
|
12
|
-
public static callsToConstructor: (
|
|
8
|
+
export default class FakeLslOutlet implements LslOutlet {
|
|
9
|
+
public static callsToConstructor: (LslOutletOptions | undefined)[] = []
|
|
13
10
|
|
|
14
11
|
public static callsToPushSample: {
|
|
15
12
|
sample: LslSample
|
|
@@ -18,19 +15,19 @@ export default class FakeStreamOutlet implements StreamOutlet {
|
|
|
18
15
|
|
|
19
16
|
public static numCallsToDestroy = 0
|
|
20
17
|
|
|
21
|
-
public options?:
|
|
18
|
+
public options?: LslOutletOptions
|
|
22
19
|
|
|
23
|
-
public constructor(options?:
|
|
24
|
-
|
|
20
|
+
public constructor(options?: LslOutletOptions) {
|
|
21
|
+
FakeLslOutlet.callsToConstructor.push(options)
|
|
25
22
|
this.options = options
|
|
26
23
|
}
|
|
27
24
|
|
|
28
25
|
public destroy() {
|
|
29
|
-
|
|
26
|
+
FakeLslOutlet.numCallsToDestroy++
|
|
30
27
|
}
|
|
31
28
|
|
|
32
29
|
public pushSample(sample: LslSample, timestampSec?: number) {
|
|
33
|
-
|
|
30
|
+
FakeLslOutlet.callsToPushSample.push({
|
|
34
31
|
sample,
|
|
35
32
|
timestampSec,
|
|
36
33
|
})
|
|
@@ -81,8 +78,8 @@ export default class FakeStreamOutlet implements StreamOutlet {
|
|
|
81
78
|
}
|
|
82
79
|
|
|
83
80
|
public static resetTestDouble() {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
FakeLslOutlet.callsToConstructor = []
|
|
82
|
+
FakeLslOutlet.callsToPushSample = []
|
|
83
|
+
FakeLslOutlet.numCallsToDestroy = 0
|
|
87
84
|
}
|
|
88
85
|
}
|