@neurosity/sdk 6.2.0 → 6.2.1-next.1
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/package.json +19 -23
- package/CHANGELOG.md +0 -25
- package/dist/browser/neurosity.iife.js +0 -48712
- package/dist/browser/neurosity.js +0 -666
- package/dist/browser/neurosity.js.map +0 -1
- package/dist/cjs/Neurosity.d.ts +0 -619
- package/dist/cjs/Neurosity.js +0 -1244
- package/dist/cjs/api/bluetooth/BluetoothClient.d.ts +0 -72
- package/dist/cjs/api/bluetooth/BluetoothClient.js +0 -310
- package/dist/cjs/api/bluetooth/BluetoothTransport.d.ts +0 -33
- package/dist/cjs/api/bluetooth/BluetoothTransport.js +0 -2
- package/dist/cjs/api/bluetooth/constants.d.ts +0 -4
- package/dist/cjs/api/bluetooth/constants.js +0 -9
- package/dist/cjs/api/bluetooth/index.d.ts +0 -4
- package/dist/cjs/api/bluetooth/index.js +0 -20
- package/dist/cjs/api/bluetooth/react-native/ReactNativeTransport.d.ts +0 -70
- package/dist/cjs/api/bluetooth/react-native/ReactNativeTransport.js +0 -406
- package/dist/cjs/api/bluetooth/react-native/types/BleManagerTypes.d.ts +0 -63
- package/dist/cjs/api/bluetooth/react-native/types/BleManagerTypes.js +0 -11
- package/dist/cjs/api/bluetooth/react-native/types/ReactNativeTypes.d.ts +0 -180
- package/dist/cjs/api/bluetooth/react-native/types/ReactNativeTypes.js +0 -10
- package/dist/cjs/api/bluetooth/types/index.d.ts +0 -31
- package/dist/cjs/api/bluetooth/types/index.js +0 -22
- package/dist/cjs/api/bluetooth/utils/create6DigitPin.d.ts +0 -1
- package/dist/cjs/api/bluetooth/utils/create6DigitPin.js +0 -8
- package/dist/cjs/api/bluetooth/utils/csvBufferToEpoch.d.ts +0 -11
- package/dist/cjs/api/bluetooth/utils/csvBufferToEpoch.js +0 -36
- package/dist/cjs/api/bluetooth/utils/encoding.d.ts +0 -3
- package/dist/cjs/api/bluetooth/utils/encoding.js +0 -22
- package/dist/cjs/api/bluetooth/utils/osHasBluetoothSupport.d.ts +0 -2
- package/dist/cjs/api/bluetooth/utils/osHasBluetoothSupport.js +0 -23
- package/dist/cjs/api/bluetooth/utils/stitch.d.ts +0 -5
- package/dist/cjs/api/bluetooth/utils/stitch.js +0 -22
- package/dist/cjs/api/bluetooth/web/WebBluetoothTransport.d.ts +0 -54
- package/dist/cjs/api/bluetooth/web/WebBluetoothTransport.js +0 -430
- package/dist/cjs/api/bluetooth/web/isMaybeWebWorkerContext.d.ts +0 -1
- package/dist/cjs/api/bluetooth/web/isMaybeWebWorkerContext.js +0 -8
- package/dist/cjs/api/bluetooth/web/isWebBluetoothSupported.d.ts +0 -1
- package/dist/cjs/api/bluetooth/web/isWebBluetoothSupported.js +0 -11
- package/dist/cjs/api/firebase/FirebaseApp.d.ts +0 -20
- package/dist/cjs/api/firebase/FirebaseApp.js +0 -70
- package/dist/cjs/api/firebase/FirebaseDevice.d.ts +0 -68
- package/dist/cjs/api/firebase/FirebaseDevice.js +0 -146
- package/dist/cjs/api/firebase/FirebaseUser.d.ts +0 -53
- package/dist/cjs/api/firebase/FirebaseUser.js +0 -434
- package/dist/cjs/api/firebase/config.d.ts +0 -8
- package/dist/cjs/api/firebase/config.js +0 -11
- package/dist/cjs/api/firebase/deviceStore.d.ts +0 -26
- package/dist/cjs/api/firebase/deviceStore.js +0 -191
- package/dist/cjs/api/firebase/index.d.ts +0 -3
- package/dist/cjs/api/firebase/index.js +0 -19
- package/dist/cjs/api/https/config.d.ts +0 -1
- package/dist/cjs/api/https/config.js +0 -4
- package/dist/cjs/api/https/createOAuthURL.d.ts +0 -3
- package/dist/cjs/api/https/createOAuthURL.js +0 -18
- package/dist/cjs/api/https/getOAuthToken.d.ts +0 -3
- package/dist/cjs/api/https/getOAuthToken.js +0 -34
- package/dist/cjs/api/https/utils.d.ts +0 -2
- package/dist/cjs/api/https/utils.js +0 -13
- package/dist/cjs/api/index.d.ts +0 -109
- package/dist/cjs/api/index.js +0 -307
- package/dist/cjs/index.d.ts +0 -2
- package/dist/cjs/index.js +0 -18
- package/dist/cjs/subscriptions/SubscriptionManager.d.ts +0 -11
- package/dist/cjs/subscriptions/SubscriptionManager.js +0 -27
- package/dist/cjs/timesync/Timesync.d.ts +0 -20
- package/dist/cjs/timesync/Timesync.js +0 -78
- package/dist/cjs/timesync/index.d.ts +0 -1
- package/dist/cjs/timesync/index.js +0 -17
- package/dist/cjs/types/accelerometer.d.ts +0 -10
- package/dist/cjs/types/accelerometer.js +0 -2
- package/dist/cjs/types/actions.d.ts +0 -16
- package/dist/cjs/types/actions.js +0 -2
- package/dist/cjs/types/awareness.d.ts +0 -1
- package/dist/cjs/types/awareness.js +0 -2
- package/dist/cjs/types/brainwaves.d.ts +0 -26
- package/dist/cjs/types/brainwaves.js +0 -2
- package/dist/cjs/types/calm.d.ts +0 -6
- package/dist/cjs/types/calm.js +0 -2
- package/dist/cjs/types/client.d.ts +0 -22
- package/dist/cjs/types/client.js +0 -2
- package/dist/cjs/types/credentials.d.ts +0 -12
- package/dist/cjs/types/credentials.js +0 -2
- package/dist/cjs/types/deviceInfo.d.ts +0 -18
- package/dist/cjs/types/deviceInfo.js +0 -2
- package/dist/cjs/types/epoch.d.ts +0 -12
- package/dist/cjs/types/epoch.js +0 -2
- package/dist/cjs/types/experiment.d.ts +0 -9
- package/dist/cjs/types/experiment.js +0 -2
- package/dist/cjs/types/focus.d.ts +0 -6
- package/dist/cjs/types/focus.js +0 -2
- package/dist/cjs/types/hapticEffects.d.ts +0 -125
- package/dist/cjs/types/hapticEffects.js +0 -2
- package/dist/cjs/types/kinesis.d.ts +0 -6
- package/dist/cjs/types/kinesis.js +0 -2
- package/dist/cjs/types/marker.d.ts +0 -7
- package/dist/cjs/types/marker.js +0 -2
- package/dist/cjs/types/metrics.d.ts +0 -21
- package/dist/cjs/types/metrics.js +0 -2
- package/dist/cjs/types/oauth.d.ts +0 -20
- package/dist/cjs/types/oauth.js +0 -2
- package/dist/cjs/types/options.d.ts +0 -51
- package/dist/cjs/types/options.js +0 -2
- package/dist/cjs/types/sample.d.ts +0 -15
- package/dist/cjs/types/sample.js +0 -2
- package/dist/cjs/types/settings.d.ts +0 -13
- package/dist/cjs/types/settings.js +0 -2
- package/dist/cjs/types/signalQuality.d.ts +0 -13
- package/dist/cjs/types/signalQuality.js +0 -2
- package/dist/cjs/types/skill.d.ts +0 -68
- package/dist/cjs/types/skill.js +0 -2
- package/dist/cjs/types/status.d.ts +0 -26
- package/dist/cjs/types/status.js +0 -22
- package/dist/cjs/types/streaming.d.ts +0 -15
- package/dist/cjs/types/streaming.js +0 -20
- package/dist/cjs/types/subscriptions.d.ts +0 -23
- package/dist/cjs/types/subscriptions.js +0 -2
- package/dist/cjs/types/training.d.ts +0 -19
- package/dist/cjs/types/training.js +0 -2
- package/dist/cjs/types/user.d.ts +0 -12
- package/dist/cjs/types/user.js +0 -2
- package/dist/cjs/utils/errors.d.ts +0 -5
- package/dist/cjs/utils/errors.js +0 -17
- package/dist/cjs/utils/filterInternalKeys.d.ts +0 -3
- package/dist/cjs/utils/filterInternalKeys.js +0 -21
- package/dist/cjs/utils/hapticEffects.d.ts +0 -123
- package/dist/cjs/utils/hapticEffects.js +0 -130
- package/dist/cjs/utils/heartbeat.d.ts +0 -4
- package/dist/cjs/utils/heartbeat.js +0 -41
- package/dist/cjs/utils/is-node.d.ts +0 -1
- package/dist/cjs/utils/is-node.js +0 -9
- package/dist/cjs/utils/metrics.d.ts +0 -1
- package/dist/cjs/utils/metrics.js +0 -56
- package/dist/cjs/utils/oauth.d.ts +0 -9
- package/dist/cjs/utils/oauth.js +0 -92
- package/dist/cjs/utils/pick.d.ts +0 -1
- package/dist/cjs/utils/pick.js +0 -5
- package/dist/cjs/utils/pipes.d.ts +0 -46
- package/dist/cjs/utils/pipes.js +0 -71
- package/dist/cjs/utils/platform.d.ts +0 -30
- package/dist/cjs/utils/platform.js +0 -47
- package/dist/cjs/utils/subscription.d.ts +0 -6
- package/dist/cjs/utils/subscription.js +0 -55
- package/dist/cjs/utils/transferDevice.d.ts +0 -9
- package/dist/cjs/utils/transferDevice.js +0 -2
- package/dist/cjs/utils/whileOnline.d.ts +0 -8
- package/dist/cjs/utils/whileOnline.js +0 -15
- package/dist/electron/index.js +0 -86
- package/dist/electron/index.js.map +0 -1
- package/dist/esm/Neurosity.d.ts +0 -619
- package/dist/esm/Neurosity.js +0 -1213
- package/dist/esm/api/bluetooth/BluetoothClient.d.ts +0 -72
- package/dist/esm/api/bluetooth/BluetoothClient.js +0 -306
- package/dist/esm/api/bluetooth/BluetoothTransport.d.ts +0 -33
- package/dist/esm/api/bluetooth/BluetoothTransport.js +0 -1
- package/dist/esm/api/bluetooth/constants.d.ts +0 -4
- package/dist/esm/api/bluetooth/constants.js +0 -6
- package/dist/esm/api/bluetooth/index.d.ts +0 -4
- package/dist/esm/api/bluetooth/index.js +0 -4
- package/dist/esm/api/bluetooth/react-native/ReactNativeTransport.d.ts +0 -70
- package/dist/esm/api/bluetooth/react-native/ReactNativeTransport.js +0 -402
- package/dist/esm/api/bluetooth/react-native/types/BleManagerTypes.d.ts +0 -63
- package/dist/esm/api/bluetooth/react-native/types/BleManagerTypes.js +0 -8
- package/dist/esm/api/bluetooth/react-native/types/ReactNativeTypes.d.ts +0 -180
- package/dist/esm/api/bluetooth/react-native/types/ReactNativeTypes.js +0 -9
- package/dist/esm/api/bluetooth/types/index.d.ts +0 -31
- package/dist/esm/api/bluetooth/types/index.js +0 -19
- package/dist/esm/api/bluetooth/utils/create6DigitPin.d.ts +0 -1
- package/dist/esm/api/bluetooth/utils/create6DigitPin.js +0 -4
- package/dist/esm/api/bluetooth/utils/csvBufferToEpoch.d.ts +0 -11
- package/dist/esm/api/bluetooth/utils/csvBufferToEpoch.js +0 -31
- package/dist/esm/api/bluetooth/utils/encoding.d.ts +0 -3
- package/dist/esm/api/bluetooth/utils/encoding.js +0 -17
- package/dist/esm/api/bluetooth/utils/osHasBluetoothSupport.d.ts +0 -2
- package/dist/esm/api/bluetooth/utils/osHasBluetoothSupport.js +0 -16
- package/dist/esm/api/bluetooth/utils/stitch.d.ts +0 -5
- package/dist/esm/api/bluetooth/utils/stitch.js +0 -18
- package/dist/esm/api/bluetooth/web/WebBluetoothTransport.d.ts +0 -54
- package/dist/esm/api/bluetooth/web/WebBluetoothTransport.js +0 -426
- package/dist/esm/api/bluetooth/web/isMaybeWebWorkerContext.d.ts +0 -1
- package/dist/esm/api/bluetooth/web/isMaybeWebWorkerContext.js +0 -4
- package/dist/esm/api/bluetooth/web/isWebBluetoothSupported.d.ts +0 -1
- package/dist/esm/api/bluetooth/web/isWebBluetoothSupported.js +0 -7
- package/dist/esm/api/firebase/FirebaseApp.d.ts +0 -20
- package/dist/esm/api/firebase/FirebaseApp.js +0 -63
- package/dist/esm/api/firebase/FirebaseDevice.d.ts +0 -68
- package/dist/esm/api/firebase/FirebaseDevice.js +0 -139
- package/dist/esm/api/firebase/FirebaseUser.d.ts +0 -53
- package/dist/esm/api/firebase/FirebaseUser.js +0 -426
- package/dist/esm/api/firebase/config.d.ts +0 -8
- package/dist/esm/api/firebase/config.js +0 -8
- package/dist/esm/api/firebase/deviceStore.d.ts +0 -26
- package/dist/esm/api/firebase/deviceStore.js +0 -184
- package/dist/esm/api/firebase/index.d.ts +0 -3
- package/dist/esm/api/firebase/index.js +0 -3
- package/dist/esm/api/https/config.d.ts +0 -1
- package/dist/esm/api/https/config.js +0 -1
- package/dist/esm/api/https/createOAuthURL.d.ts +0 -3
- package/dist/esm/api/https/createOAuthURL.js +0 -11
- package/dist/esm/api/https/getOAuthToken.d.ts +0 -3
- package/dist/esm/api/https/getOAuthToken.js +0 -27
- package/dist/esm/api/https/utils.d.ts +0 -2
- package/dist/esm/api/https/utils.js +0 -9
- package/dist/esm/api/index.d.ts +0 -109
- package/dist/esm/api/index.js +0 -300
- package/dist/esm/index.d.ts +0 -2
- package/dist/esm/index.js +0 -2
- package/dist/esm/neurosity.mjs +0 -48700
- package/dist/esm/subscriptions/SubscriptionManager.d.ts +0 -11
- package/dist/esm/subscriptions/SubscriptionManager.js +0 -23
- package/dist/esm/timesync/Timesync.d.ts +0 -20
- package/dist/esm/timesync/Timesync.js +0 -71
- package/dist/esm/timesync/index.d.ts +0 -1
- package/dist/esm/timesync/index.js +0 -1
- package/dist/esm/types/accelerometer.d.ts +0 -10
- package/dist/esm/types/accelerometer.js +0 -1
- package/dist/esm/types/actions.d.ts +0 -16
- package/dist/esm/types/actions.js +0 -1
- package/dist/esm/types/awareness.d.ts +0 -1
- package/dist/esm/types/awareness.js +0 -1
- package/dist/esm/types/brainwaves.d.ts +0 -26
- package/dist/esm/types/brainwaves.js +0 -1
- package/dist/esm/types/calm.d.ts +0 -6
- package/dist/esm/types/calm.js +0 -1
- package/dist/esm/types/client.d.ts +0 -22
- package/dist/esm/types/client.js +0 -1
- package/dist/esm/types/credentials.d.ts +0 -12
- package/dist/esm/types/credentials.js +0 -1
- package/dist/esm/types/deviceInfo.d.ts +0 -18
- package/dist/esm/types/deviceInfo.js +0 -1
- package/dist/esm/types/epoch.d.ts +0 -12
- package/dist/esm/types/epoch.js +0 -1
- package/dist/esm/types/experiment.d.ts +0 -9
- package/dist/esm/types/experiment.js +0 -1
- package/dist/esm/types/focus.d.ts +0 -6
- package/dist/esm/types/focus.js +0 -1
- package/dist/esm/types/hapticEffects.d.ts +0 -125
- package/dist/esm/types/hapticEffects.js +0 -1
- package/dist/esm/types/kinesis.d.ts +0 -6
- package/dist/esm/types/kinesis.js +0 -1
- package/dist/esm/types/marker.d.ts +0 -7
- package/dist/esm/types/marker.js +0 -1
- package/dist/esm/types/metrics.d.ts +0 -21
- package/dist/esm/types/metrics.js +0 -1
- package/dist/esm/types/oauth.d.ts +0 -20
- package/dist/esm/types/oauth.js +0 -1
- package/dist/esm/types/options.d.ts +0 -51
- package/dist/esm/types/options.js +0 -1
- package/dist/esm/types/sample.d.ts +0 -15
- package/dist/esm/types/sample.js +0 -1
- package/dist/esm/types/settings.d.ts +0 -13
- package/dist/esm/types/settings.js +0 -1
- package/dist/esm/types/signalQuality.d.ts +0 -13
- package/dist/esm/types/signalQuality.js +0 -1
- package/dist/esm/types/skill.d.ts +0 -68
- package/dist/esm/types/skill.js +0 -1
- package/dist/esm/types/status.d.ts +0 -26
- package/dist/esm/types/status.js +0 -19
- package/dist/esm/types/streaming.d.ts +0 -15
- package/dist/esm/types/streaming.js +0 -17
- package/dist/esm/types/subscriptions.d.ts +0 -23
- package/dist/esm/types/subscriptions.js +0 -1
- package/dist/esm/types/training.d.ts +0 -19
- package/dist/esm/types/training.js +0 -1
- package/dist/esm/types/user.d.ts +0 -12
- package/dist/esm/types/user.js +0 -1
- package/dist/esm/utils/errors.d.ts +0 -5
- package/dist/esm/utils/errors.js +0 -11
- package/dist/esm/utils/filterInternalKeys.d.ts +0 -3
- package/dist/esm/utils/filterInternalKeys.js +0 -17
- package/dist/esm/utils/hapticEffects.d.ts +0 -123
- package/dist/esm/utils/hapticEffects.js +0 -125
- package/dist/esm/utils/heartbeat.d.ts +0 -4
- package/dist/esm/utils/heartbeat.js +0 -33
- package/dist/esm/utils/is-node.d.ts +0 -1
- package/dist/esm/utils/is-node.js +0 -5
- package/dist/esm/utils/metrics.d.ts +0 -1
- package/dist/esm/utils/metrics.js +0 -52
- package/dist/esm/utils/oauth.d.ts +0 -9
- package/dist/esm/utils/oauth.js +0 -64
- package/dist/esm/utils/pick.d.ts +0 -1
- package/dist/esm/utils/pick.js +0 -1
- package/dist/esm/utils/pipes.d.ts +0 -46
- package/dist/esm/utils/pipes.js +0 -65
- package/dist/esm/utils/platform.d.ts +0 -30
- package/dist/esm/utils/platform.js +0 -41
- package/dist/esm/utils/subscription.d.ts +0 -6
- package/dist/esm/utils/subscription.js +0 -24
- package/dist/esm/utils/transferDevice.d.ts +0 -9
- package/dist/esm/utils/transferDevice.js +0 -1
- package/dist/esm/utils/whileOnline.d.ts +0 -8
- package/dist/esm/utils/whileOnline.js +0 -11
- package/dist/examples/auth.html +0 -32
- package/dist/examples/cloud.html +0 -17
- package/dist/examples/index.html +0 -1
- package/dist/examples/neurosity.iife.js +0 -48712
- package/dist/examples/neurosity.js +0 -666
- package/dist/examples/neurosity.mjs +0 -48700
- package/dist/examples/training.html +0 -49
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @hidden
|
|
3
|
-
*/
|
|
4
|
-
export declare type ActionOptions = {
|
|
5
|
-
characteristicName: string;
|
|
6
|
-
action: any;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* @hidden
|
|
10
|
-
*/
|
|
11
|
-
export declare type SubscribeOptions = {
|
|
12
|
-
characteristicName: string;
|
|
13
|
-
manageNotifications?: boolean;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* @hidden
|
|
17
|
-
*/
|
|
18
|
-
export declare enum BLUETOOTH_CONNECTION {
|
|
19
|
-
SCANNING = "scanning",
|
|
20
|
-
CONNECTED = "connected",
|
|
21
|
-
CONNECTING = "connecting",
|
|
22
|
-
DISCONNECTING = "disconnecting",
|
|
23
|
-
DISCONNECTED = "disconnected"
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* @hidden
|
|
27
|
-
*/
|
|
28
|
-
export declare enum TRANSPORT_TYPE {
|
|
29
|
-
WEB = "web",
|
|
30
|
-
REACT_NATIVE = "reactNative"
|
|
31
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TRANSPORT_TYPE = exports.BLUETOOTH_CONNECTION = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @hidden
|
|
6
|
-
*/
|
|
7
|
-
var BLUETOOTH_CONNECTION;
|
|
8
|
-
(function (BLUETOOTH_CONNECTION) {
|
|
9
|
-
BLUETOOTH_CONNECTION["SCANNING"] = "scanning";
|
|
10
|
-
BLUETOOTH_CONNECTION["CONNECTED"] = "connected";
|
|
11
|
-
BLUETOOTH_CONNECTION["CONNECTING"] = "connecting";
|
|
12
|
-
BLUETOOTH_CONNECTION["DISCONNECTING"] = "disconnecting";
|
|
13
|
-
BLUETOOTH_CONNECTION["DISCONNECTED"] = "disconnected";
|
|
14
|
-
})(BLUETOOTH_CONNECTION = exports.BLUETOOTH_CONNECTION || (exports.BLUETOOTH_CONNECTION = {}));
|
|
15
|
-
/**
|
|
16
|
-
* @hidden
|
|
17
|
-
*/
|
|
18
|
-
var TRANSPORT_TYPE;
|
|
19
|
-
(function (TRANSPORT_TYPE) {
|
|
20
|
-
TRANSPORT_TYPE["WEB"] = "web";
|
|
21
|
-
TRANSPORT_TYPE["REACT_NATIVE"] = "reactNative";
|
|
22
|
-
})(TRANSPORT_TYPE = exports.TRANSPORT_TYPE || (exports.TRANSPORT_TYPE = {}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function create6DigitPin(): number;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.create6DigitPin = void 0;
|
|
4
|
-
// Creates a number of 6 digits and ensures the first digit will never be 0
|
|
5
|
-
function create6DigitPin() {
|
|
6
|
-
return Math.floor(100000 + Math.random() * 900000);
|
|
7
|
-
}
|
|
8
|
-
exports.create6DigitPin = create6DigitPin;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Observable, UnaryFunction } from "rxjs";
|
|
2
|
-
import { Epoch } from "../../../types/epoch";
|
|
3
|
-
import { DeviceInfo } from "../../../types/deviceInfo";
|
|
4
|
-
/**
|
|
5
|
-
* @hidden
|
|
6
|
-
*/
|
|
7
|
-
export declare function csvBufferToEpoch(deviceInfo: DeviceInfo): UnaryFunction<Observable<Epoch>, any>;
|
|
8
|
-
/**
|
|
9
|
-
* @hidden
|
|
10
|
-
*/
|
|
11
|
-
export declare function csvBufferToSamples(): UnaryFunction<any, any>;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.csvBufferToSamples = exports.csvBufferToEpoch = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const pipes_1 = require("../../../utils/pipes");
|
|
7
|
-
const EPOCH_BUFFER_SIZE = 16;
|
|
8
|
-
const SAMPLING_RATE_FALLBACK = 256; // Crown's sampling rate
|
|
9
|
-
/**
|
|
10
|
-
* @hidden
|
|
11
|
-
*/
|
|
12
|
-
function csvBufferToEpoch(deviceInfo) {
|
|
13
|
-
var _a;
|
|
14
|
-
if (!(deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.samplingRate)) {
|
|
15
|
-
console.warn(`Didn't receive a sampling rate, defaulting to ${SAMPLING_RATE_FALLBACK}`);
|
|
16
|
-
}
|
|
17
|
-
return (0, rxjs_1.pipe)(csvBufferToSamples(), (0, pipes_1.epoch)({
|
|
18
|
-
duration: EPOCH_BUFFER_SIZE,
|
|
19
|
-
interval: EPOCH_BUFFER_SIZE,
|
|
20
|
-
samplingRate: (_a = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.samplingRate) !== null && _a !== void 0 ? _a : SAMPLING_RATE_FALLBACK
|
|
21
|
-
}), (0, pipes_1.addInfo)({
|
|
22
|
-
channelNames: deviceInfo.channelNames,
|
|
23
|
-
samplingRate: deviceInfo.samplingRate
|
|
24
|
-
}));
|
|
25
|
-
}
|
|
26
|
-
exports.csvBufferToEpoch = csvBufferToEpoch;
|
|
27
|
-
/**
|
|
28
|
-
* @hidden
|
|
29
|
-
*/
|
|
30
|
-
function csvBufferToSamples() {
|
|
31
|
-
return (0, rxjs_1.pipe)((0, operators_1.mergeMap)((samples) => (0, rxjs_1.from)(samples)), (0, operators_1.map)(([timestamp, marker, ...data]) => ({
|
|
32
|
-
timestamp,
|
|
33
|
-
data
|
|
34
|
-
})));
|
|
35
|
-
}
|
|
36
|
-
exports.csvBufferToSamples = csvBufferToSamples;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.decode = exports.encode = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
|
-
const encoder = new TextEncoder();
|
|
6
|
-
const decoder = new TextDecoder("utf-8");
|
|
7
|
-
function encode(transportType, data) {
|
|
8
|
-
if (transportType === types_1.TRANSPORT_TYPE.REACT_NATIVE) {
|
|
9
|
-
// React Native expects a plain array of numbers and not a Uint8Array
|
|
10
|
-
return [...encoder.encode(data)];
|
|
11
|
-
}
|
|
12
|
-
return encoder.encode(data);
|
|
13
|
-
}
|
|
14
|
-
exports.encode = encode;
|
|
15
|
-
function decode(transportType, data) {
|
|
16
|
-
if (transportType === types_1.TRANSPORT_TYPE.REACT_NATIVE) {
|
|
17
|
-
// React Native outpouts a plain array of numbers and not a Uint8Array
|
|
18
|
-
return decoder.decode(new Uint8Array(data));
|
|
19
|
-
}
|
|
20
|
-
return decoder.decode(data);
|
|
21
|
-
}
|
|
22
|
-
exports.decode = decode;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.osHasBluetoothSupport = void 0;
|
|
7
|
-
const gte_1 = __importDefault(require("semver/functions/gte"));
|
|
8
|
-
function osHasBluetoothSupport(selectedDevice) {
|
|
9
|
-
if (!selectedDevice) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
// Only the Crown supports Bluetooth
|
|
13
|
-
const isCrown = Number(selectedDevice.modelVersion) >= 3;
|
|
14
|
-
if (!isCrown) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
const isEmulator = !!(selectedDevice === null || selectedDevice === void 0 ? void 0 : selectedDevice.emulator);
|
|
18
|
-
if (isEmulator) {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
return (0, gte_1.default)(selectedDevice.osVersion, "16.0.0");
|
|
22
|
-
}
|
|
23
|
-
exports.osHasBluetoothSupport = osHasBluetoothSupport;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stitchChunks = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
function stitchChunks({ delimiter }) {
|
|
7
|
-
return (0, rxjs_1.pipe)((0, operators_1.scan)(([remainder], currentBuffer) => {
|
|
8
|
-
const nextBuffer = remainder + currentBuffer;
|
|
9
|
-
if (!nextBuffer.includes(delimiter)) {
|
|
10
|
-
return [nextBuffer, ""];
|
|
11
|
-
}
|
|
12
|
-
if (nextBuffer.endsWith(delimiter)) {
|
|
13
|
-
return ["", nextBuffer];
|
|
14
|
-
}
|
|
15
|
-
const remainderStart = nextBuffer.lastIndexOf(delimiter);
|
|
16
|
-
const remainderIndex = remainderStart + delimiter.length;
|
|
17
|
-
const nextPacket = nextBuffer.slice(0, remainderIndex);
|
|
18
|
-
const nextRemainder = nextBuffer.slice(remainderIndex);
|
|
19
|
-
return [nextRemainder, nextPacket];
|
|
20
|
-
}, ["", ""]), (0, operators_1.map)(([, nextPacket]) => nextPacket.slice(0, -delimiter.length)), (0, operators_1.filter)((nextPacket) => !!nextPacket.length));
|
|
21
|
-
}
|
|
22
|
-
exports.stitchChunks = stitchChunks;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/// <reference types="web-bluetooth" />
|
|
2
|
-
import { BehaviorSubject, ReplaySubject } from "rxjs";
|
|
3
|
-
import { Observable } from "rxjs";
|
|
4
|
-
import { BluetoothTransport } from "../BluetoothTransport";
|
|
5
|
-
import { ActionOptions, SubscribeOptions } from "../types";
|
|
6
|
-
import { TRANSPORT_TYPE, BLUETOOTH_CONNECTION } from "../types";
|
|
7
|
-
import { DeviceInfo } from "../../../types/deviceInfo";
|
|
8
|
-
declare type Options = {
|
|
9
|
-
autoConnect?: boolean;
|
|
10
|
-
};
|
|
11
|
-
export declare class WebBluetoothTransport implements BluetoothTransport {
|
|
12
|
-
type: TRANSPORT_TYPE;
|
|
13
|
-
options: Options;
|
|
14
|
-
device: BluetoothDevice;
|
|
15
|
-
server: BluetoothRemoteGATTServer;
|
|
16
|
-
service: BluetoothRemoteGATTService;
|
|
17
|
-
characteristicsByName: {
|
|
18
|
-
[name: string]: BluetoothRemoteGATTCharacteristic;
|
|
19
|
-
};
|
|
20
|
-
connection$: BehaviorSubject<BLUETOOTH_CONNECTION>;
|
|
21
|
-
pendingActions$: BehaviorSubject<any[]>;
|
|
22
|
-
logs$: ReplaySubject<string>;
|
|
23
|
-
onDisconnected$: Observable<void>;
|
|
24
|
-
connectionStream$: Observable<BLUETOOTH_CONNECTION>;
|
|
25
|
-
_isAutoConnectEnabled$: ReplaySubject<boolean>;
|
|
26
|
-
constructor(options?: Options);
|
|
27
|
-
_getPairedDevices(): Promise<BluetoothDevice[]>;
|
|
28
|
-
_autoConnect(selectedDevice$: Observable<DeviceInfo>): Observable<void>;
|
|
29
|
-
enableAutoConnect(autoConnect: boolean): void;
|
|
30
|
-
addLog(log: string): void;
|
|
31
|
-
isConnected(): boolean;
|
|
32
|
-
connection(): Observable<BLUETOOTH_CONNECTION>;
|
|
33
|
-
connect(deviceNickname?: string): Promise<void>;
|
|
34
|
-
requestDevice(deviceNickname?: string): Promise<BluetoothDevice>;
|
|
35
|
-
getServerServiceAndCharacteristics(device: BluetoothDevice): Promise<never>;
|
|
36
|
-
_onDisconnected(): Observable<any>;
|
|
37
|
-
disconnect(): Promise<void>;
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
* Bluetooth GATT attributes, services, characteristics, etc. are invalidated
|
|
41
|
-
* when a device disconnects. This means your code should always retrieve
|
|
42
|
-
* (through getPrimaryService(s), getCharacteristic(s), etc.) these attributes
|
|
43
|
-
* after reconnecting.
|
|
44
|
-
*/
|
|
45
|
-
getCharacteristicByName(characteristicName: string): Promise<BluetoothRemoteGATTCharacteristic>;
|
|
46
|
-
subscribeToCharacteristic({ characteristicName, manageNotifications }: SubscribeOptions): Observable<any>;
|
|
47
|
-
readCharacteristic(characteristicName: string, parse?: boolean): Promise<any>;
|
|
48
|
-
writeCharacteristic(characteristicName: string, data: string): Promise<void>;
|
|
49
|
-
_addPendingAction(actionId: number): void;
|
|
50
|
-
_removePendingAction(actionId: number): void;
|
|
51
|
-
_autoToggleActionNotifications(selectedDevice$: Observable<DeviceInfo>): Promise<void>;
|
|
52
|
-
dispatchAction({ characteristicName, action }: ActionOptions): Promise<any>;
|
|
53
|
-
}
|
|
54
|
-
export {};
|