@neurosity/sdk 6.5.9 → 6.5.11
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/dist/browser/neurosity.iife.js +2419 -1009
- package/dist/browser/neurosity.js +180 -148
- package/dist/browser/neurosity.js.map +1 -1
- package/dist/cjs/__tests__/Neurosity.test.d.ts +1 -0
- package/dist/cjs/__tests__/Neurosity.test.js +201 -0
- package/dist/cjs/__tests__/WebBluetoothTransport.test.d.ts +1 -0
- package/dist/cjs/__tests__/WebBluetoothTransport.test.js +201 -0
- package/dist/cjs/__tests__/accelerometer.test.d.ts +1 -0
- package/dist/cjs/__tests__/accelerometer.test.js +158 -0
- package/dist/cjs/__tests__/auth.test.d.ts +1 -0
- package/dist/cjs/__tests__/auth.test.js +239 -0
- package/dist/cjs/__tests__/brainwaves.test.d.ts +1 -0
- package/dist/cjs/__tests__/brainwaves.test.js +291 -0
- package/dist/cjs/__tests__/device.test.d.ts +1 -0
- package/dist/cjs/__tests__/device.test.js +281 -0
- package/dist/cjs/__tests__/haptics.test.d.ts +1 -0
- package/dist/cjs/__tests__/haptics.test.js +162 -0
- package/dist/cjs/__tests__/metrics.test.d.ts +1 -0
- package/dist/cjs/__tests__/metrics.test.js +178 -0
- package/dist/cjs/__tests__/oauth.test.d.ts +1 -0
- package/dist/cjs/__tests__/oauth.test.js +138 -0
- package/dist/cjs/__tests__/settings.test.d.ts +1 -0
- package/dist/cjs/__tests__/settings.test.js +130 -0
- package/dist/cjs/__tests__/setup/webBluetooth.setup.d.ts +11 -0
- package/dist/cjs/__tests__/setup/webBluetooth.setup.js +35 -0
- package/dist/cjs/__tests__/setup.d.ts +0 -0
- package/dist/cjs/__tests__/setup.js +7 -0
- package/dist/cjs/__tests__/streaming.test.d.ts +1 -0
- package/dist/cjs/__tests__/streaming.test.js +259 -0
- package/dist/cjs/__tests__/timesync.test.d.ts +1 -0
- package/dist/cjs/__tests__/timesync.test.js +54 -0
- package/dist/cjs/__tests__/utils.test.d.ts +1 -0
- package/dist/cjs/__tests__/utils.test.js +281 -0
- package/dist/cjs/api/bluetooth/BluetoothClient.d.ts +6 -6
- package/dist/cjs/api/bluetooth/BluetoothTransport.d.ts +1 -1
- package/dist/cjs/api/bluetooth/react-native/ReactNativeTransport.d.ts +4 -4
- package/dist/cjs/api/bluetooth/react-native/types/ReactNativeTypes.d.ts +2 -2
- package/dist/cjs/api/bluetooth/types/index.d.ts +2 -2
- package/dist/cjs/api/bluetooth/utils/decodeJSONChunks.d.ts +1 -1
- package/dist/cjs/api/bluetooth/utils/stitch.d.ts +1 -1
- package/dist/cjs/api/bluetooth/utils/textCodec.d.ts +1 -1
- package/dist/cjs/api/bluetooth/web/WebBluetoothTransport.d.ts +1 -1
- package/dist/cjs/api/firebase/FirebaseDevice.d.ts +1 -1
- package/dist/cjs/api/firebase/FirebaseUser.d.ts +1 -1
- package/dist/cjs/api/index.js +1 -1
- package/dist/cjs/timesync/Timesync.d.ts +1 -1
- package/dist/cjs/types/awareness.d.ts +1 -1
- package/dist/cjs/types/brainwaves.d.ts +25 -12
- package/dist/cjs/types/credentials.d.ts +4 -4
- package/dist/cjs/types/deviceInfo.d.ts +4 -4
- package/dist/cjs/types/epoch.d.ts +1 -1
- package/dist/cjs/types/experiment.d.ts +1 -1
- package/dist/cjs/types/hapticEffects.d.ts +1 -1
- package/dist/cjs/types/marker.d.ts +1 -1
- package/dist/cjs/types/metrics.d.ts +2 -2
- package/dist/cjs/types/oauth.d.ts +4 -4
- package/dist/cjs/types/sample.d.ts +2 -2
- package/dist/cjs/types/signalQuality.d.ts +1 -1
- package/dist/cjs/types/skill.d.ts +2 -2
- package/dist/cjs/types/user.d.ts +3 -3
- package/dist/cjs/utils/oauth.d.ts +1 -1
- package/dist/cjs/utils/transferDevice.d.ts +3 -3
- package/dist/cjs/utils/whileOnline.d.ts +1 -1
- package/dist/electron/index.js +1 -1
- package/dist/electron/index.js.map +1 -1
- package/dist/esm/__tests__/Neurosity.test.d.ts +1 -0
- package/dist/esm/__tests__/Neurosity.test.js +199 -0
- package/dist/esm/__tests__/WebBluetoothTransport.test.d.ts +1 -0
- package/dist/esm/__tests__/WebBluetoothTransport.test.js +199 -0
- package/dist/esm/__tests__/accelerometer.test.d.ts +1 -0
- package/dist/esm/__tests__/accelerometer.test.js +156 -0
- package/dist/esm/__tests__/auth.test.d.ts +1 -0
- package/dist/esm/__tests__/auth.test.js +237 -0
- package/dist/esm/__tests__/brainwaves.test.d.ts +1 -0
- package/dist/esm/__tests__/brainwaves.test.js +289 -0
- package/dist/esm/__tests__/device.test.d.ts +1 -0
- package/dist/esm/__tests__/device.test.js +279 -0
- package/dist/esm/__tests__/haptics.test.d.ts +1 -0
- package/dist/esm/__tests__/haptics.test.js +160 -0
- package/dist/esm/__tests__/metrics.test.d.ts +1 -0
- package/dist/esm/__tests__/metrics.test.js +176 -0
- package/dist/esm/__tests__/oauth.test.d.ts +1 -0
- package/dist/esm/__tests__/oauth.test.js +133 -0
- package/dist/esm/__tests__/settings.test.d.ts +1 -0
- package/dist/esm/__tests__/settings.test.js +128 -0
- package/dist/esm/__tests__/setup/webBluetooth.setup.d.ts +11 -0
- package/dist/esm/__tests__/setup/webBluetooth.setup.js +35 -0
- package/dist/esm/__tests__/setup.d.ts +0 -0
- package/dist/esm/__tests__/setup.js +7 -0
- package/dist/esm/__tests__/streaming.test.d.ts +1 -0
- package/dist/esm/__tests__/streaming.test.js +257 -0
- package/dist/esm/__tests__/timesync.test.d.ts +1 -0
- package/dist/esm/__tests__/timesync.test.js +52 -0
- package/dist/esm/__tests__/utils.test.d.ts +1 -0
- package/dist/esm/__tests__/utils.test.js +279 -0
- package/dist/esm/api/bluetooth/BluetoothClient.d.ts +6 -6
- package/dist/esm/api/bluetooth/BluetoothTransport.d.ts +1 -1
- package/dist/esm/api/bluetooth/react-native/ReactNativeTransport.d.ts +4 -4
- package/dist/esm/api/bluetooth/react-native/types/ReactNativeTypes.d.ts +2 -2
- package/dist/esm/api/bluetooth/types/index.d.ts +2 -2
- package/dist/esm/api/bluetooth/utils/decodeJSONChunks.d.ts +1 -1
- package/dist/esm/api/bluetooth/utils/stitch.d.ts +1 -1
- package/dist/esm/api/bluetooth/utils/textCodec.d.ts +1 -1
- package/dist/esm/api/bluetooth/web/WebBluetoothTransport.d.ts +1 -1
- package/dist/esm/api/firebase/FirebaseDevice.d.ts +1 -1
- package/dist/esm/api/firebase/FirebaseUser.d.ts +1 -1
- package/dist/esm/api/index.js +2 -2
- package/dist/esm/neurosity.mjs +2480 -1007
- package/dist/esm/timesync/Timesync.d.ts +1 -1
- package/dist/esm/types/awareness.d.ts +1 -1
- package/dist/esm/types/brainwaves.d.ts +25 -12
- package/dist/esm/types/credentials.d.ts +4 -4
- package/dist/esm/types/deviceInfo.d.ts +4 -4
- package/dist/esm/types/epoch.d.ts +1 -1
- package/dist/esm/types/experiment.d.ts +1 -1
- package/dist/esm/types/hapticEffects.d.ts +1 -1
- package/dist/esm/types/marker.d.ts +1 -1
- package/dist/esm/types/metrics.d.ts +2 -2
- package/dist/esm/types/oauth.d.ts +4 -4
- package/dist/esm/types/sample.d.ts +2 -2
- package/dist/esm/types/signalQuality.d.ts +1 -1
- package/dist/esm/types/skill.d.ts +2 -2
- package/dist/esm/types/user.d.ts +3 -3
- package/dist/esm/utils/oauth.d.ts +1 -1
- package/dist/esm/utils/transferDevice.d.ts +3 -3
- package/dist/esm/utils/whileOnline.d.ts +1 -1
- package/dist/examples/neurosity.iife.js +2419 -1009
- package/dist/examples/neurosity.js +180 -148
- package/dist/examples/neurosity.mjs +2480 -1007
- package/package.json +17 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type AwarenessLabels = "calm" | "focus";
|
|
@@ -1,26 +1,39 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type BrainwavesLabel = "raw" | "rawUnfiltered" | "powerByBand" | "psd";
|
|
2
|
+
export type AmplitudeByChannel = number[][];
|
|
3
|
+
export interface BaseInfo {
|
|
4
|
+
samplingRate: number;
|
|
5
|
+
startTime: number;
|
|
6
|
+
channelNames: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface EpochInfo extends BaseInfo {
|
|
9
|
+
notchFrequency?: string;
|
|
10
|
+
}
|
|
3
11
|
export interface Epoch {
|
|
4
12
|
data: AmplitudeByChannel;
|
|
5
|
-
info:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
13
|
+
info: EpochInfo;
|
|
14
|
+
}
|
|
15
|
+
export interface RawUnfilteredEpochInfo extends BaseInfo {
|
|
16
|
+
}
|
|
17
|
+
export interface RawUnfilteredEpoch {
|
|
18
|
+
data: AmplitudeByChannel;
|
|
19
|
+
info: RawUnfilteredEpochInfo;
|
|
20
|
+
}
|
|
21
|
+
export type PSDByChannel = number[][];
|
|
22
|
+
export interface PSDInfo extends BaseInfo {
|
|
23
|
+
notchFrequency: string;
|
|
9
24
|
}
|
|
10
|
-
export declare type PSDByChannel = number[][];
|
|
11
25
|
export interface PSD {
|
|
26
|
+
label: "psd";
|
|
12
27
|
psd: PSDByChannel;
|
|
13
28
|
freqs: number[];
|
|
14
|
-
info:
|
|
15
|
-
samplingRate: number;
|
|
16
|
-
startTime: number;
|
|
17
|
-
};
|
|
29
|
+
info: PSDInfo;
|
|
18
30
|
}
|
|
19
|
-
export
|
|
31
|
+
export type BandName = "gamma" | "beta" | "alpha" | "theta" | "delta";
|
|
20
32
|
export interface PowerByBand {
|
|
21
33
|
gamma: number[];
|
|
22
34
|
beta: number[];
|
|
23
35
|
alpha: number[];
|
|
24
36
|
theta: number[];
|
|
25
37
|
delta: number[];
|
|
38
|
+
info: BaseInfo;
|
|
26
39
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type CustomToken = {
|
|
2
2
|
customToken: string;
|
|
3
3
|
};
|
|
4
|
-
export
|
|
4
|
+
export type EmailAndPassword = {
|
|
5
5
|
email: string;
|
|
6
6
|
password: string;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type OAuthCredentials = {
|
|
9
9
|
idToken: string;
|
|
10
10
|
providerId: string;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type Credentials = EmailAndPassword | OAuthCredentials | CustomToken;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type OSVersion = string;
|
|
2
2
|
export interface DeviceInfo {
|
|
3
3
|
deviceId: string;
|
|
4
4
|
deviceNickname: string;
|
|
@@ -13,7 +13,7 @@ export interface DeviceInfo {
|
|
|
13
13
|
apiVersion: string;
|
|
14
14
|
emulator?: boolean;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export
|
|
16
|
+
type DeviceSelectorKeyValue = [string, string | number | string[]];
|
|
17
|
+
type DeviceSelectorFunction = (devices: DeviceInfo[]) => DeviceInfo;
|
|
18
|
+
export type DeviceSelector = DeviceSelectorKeyValue | DeviceSelectorFunction;
|
|
19
19
|
export {};
|
|
@@ -2,11 +2,11 @@ import { PendingSubscription, Subscription } from "./subscriptions";
|
|
|
2
2
|
/**
|
|
3
3
|
* @hidden
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
type SubscriptionListener = Function;
|
|
6
6
|
/**
|
|
7
7
|
* @hidden
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type MetricValue = {
|
|
10
10
|
[label: string]: any;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type OAuthConfig = {
|
|
2
2
|
clientId: string;
|
|
3
3
|
clientSecret?: string;
|
|
4
4
|
responseType: "token" | "code";
|
|
@@ -6,15 +6,15 @@ export declare type OAuthConfig = {
|
|
|
6
6
|
scope: string[];
|
|
7
7
|
state: string;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type OAuthQuery = {
|
|
10
10
|
clientId: string;
|
|
11
11
|
clientSecret: string;
|
|
12
12
|
userId: string;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type OAuthQueryResult = {
|
|
15
15
|
customToken: string;
|
|
16
16
|
userId: string;
|
|
17
17
|
};
|
|
18
|
-
export
|
|
18
|
+
export type OAuthRemoveResponse = {
|
|
19
19
|
ok: boolean;
|
|
20
20
|
};
|
|
@@ -2,7 +2,7 @@ import { Marker } from "./marker";
|
|
|
2
2
|
/**
|
|
3
3
|
* @hidden
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type Sample = {
|
|
6
6
|
data: number[];
|
|
7
7
|
timestamp: number;
|
|
8
8
|
count?: number;
|
|
@@ -12,4 +12,4 @@ export declare type Sample = {
|
|
|
12
12
|
/**
|
|
13
13
|
* @hidden
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export type CSVSample = number[];
|
|
@@ -2,7 +2,7 @@ import { Observable } from "rxjs";
|
|
|
2
2
|
/**
|
|
3
3
|
* @hidden
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
type SkillProps = {
|
|
6
6
|
[key: string]: string | number | boolean;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
@@ -37,7 +37,7 @@ export interface DeviceSkill {
|
|
|
37
37
|
/**
|
|
38
38
|
* @hidden
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
type SkillMetric = {
|
|
41
41
|
[key: string]: any;
|
|
42
42
|
};
|
|
43
43
|
/**
|
package/dist/esm/types/user.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type UserDevice = {
|
|
2
2
|
claimedOn: number;
|
|
3
3
|
};
|
|
4
|
-
export
|
|
4
|
+
export type UserDevices = {
|
|
5
5
|
[deviceId: string]: UserDevice;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
8
|
* @hidden
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export type UserClaims = {
|
|
11
11
|
[claimName: string]: boolean | string;
|
|
12
12
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type TransferDeviceByEmail = {
|
|
2
2
|
recipientsEmail: string;
|
|
3
3
|
deviceId: string;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type TransferDeviceByUserId = {
|
|
6
6
|
recipientsUserId: string;
|
|
7
7
|
deviceId: string;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type TransferDeviceOptions = TransferDeviceByEmail | TransferDeviceByUserId;
|