@neurosity/sdk 6.0.0-next.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.
Files changed (312) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +46 -0
  3. package/dist/browser/neurosity.iife.js +48736 -0
  4. package/dist/browser/neurosity.js +672 -0
  5. package/dist/browser/neurosity.js.map +1 -0
  6. package/dist/cjs/Notion.d.ts +619 -0
  7. package/dist/cjs/Notion.js +1291 -0
  8. package/dist/cjs/api/bluetooth/BluetoothClient.d.ts +59 -0
  9. package/dist/cjs/api/bluetooth/BluetoothClient.js +287 -0
  10. package/dist/cjs/api/bluetooth/BluetoothTransport.d.ts +32 -0
  11. package/dist/cjs/api/bluetooth/BluetoothTransport.js +2 -0
  12. package/dist/cjs/api/bluetooth/constants.d.ts +4 -0
  13. package/dist/cjs/api/bluetooth/constants.js +9 -0
  14. package/dist/cjs/api/bluetooth/index.d.ts +4 -0
  15. package/dist/cjs/api/bluetooth/index.js +20 -0
  16. package/dist/cjs/api/bluetooth/react-native/ReactNativeTransport.d.ts +65 -0
  17. package/dist/cjs/api/bluetooth/react-native/ReactNativeTransport.js +386 -0
  18. package/dist/cjs/api/bluetooth/react-native/types/BleManagerTypes.d.ts +63 -0
  19. package/dist/cjs/api/bluetooth/react-native/types/BleManagerTypes.js +11 -0
  20. package/dist/cjs/api/bluetooth/react-native/types/ReactNativeTypes.d.ts +180 -0
  21. package/dist/cjs/api/bluetooth/react-native/types/ReactNativeTypes.js +10 -0
  22. package/dist/cjs/api/bluetooth/types/index.d.ts +31 -0
  23. package/dist/cjs/api/bluetooth/types/index.js +22 -0
  24. package/dist/cjs/api/bluetooth/utils/create6DigitPin.d.ts +1 -0
  25. package/dist/cjs/api/bluetooth/utils/create6DigitPin.js +8 -0
  26. package/dist/cjs/api/bluetooth/utils/csvBufferToEpoch.d.ts +11 -0
  27. package/dist/cjs/api/bluetooth/utils/csvBufferToEpoch.js +36 -0
  28. package/dist/cjs/api/bluetooth/utils/encoding.d.ts +3 -0
  29. package/dist/cjs/api/bluetooth/utils/encoding.js +22 -0
  30. package/dist/cjs/api/bluetooth/utils/osHasBluetoothSupport.d.ts +2 -0
  31. package/dist/cjs/api/bluetooth/utils/osHasBluetoothSupport.js +23 -0
  32. package/dist/cjs/api/bluetooth/utils/stitch.d.ts +5 -0
  33. package/dist/cjs/api/bluetooth/utils/stitch.js +22 -0
  34. package/dist/cjs/api/bluetooth/web/WebBluetoothTransport.d.ts +47 -0
  35. package/dist/cjs/api/bluetooth/web/WebBluetoothTransport.js +412 -0
  36. package/dist/cjs/api/bluetooth/web/isMaybeWebWorkerContext.d.ts +1 -0
  37. package/dist/cjs/api/bluetooth/web/isMaybeWebWorkerContext.js +8 -0
  38. package/dist/cjs/api/bluetooth/web/isWebBluetoothSupported.d.ts +1 -0
  39. package/dist/cjs/api/bluetooth/web/isWebBluetoothSupported.js +11 -0
  40. package/dist/cjs/api/firebase/FirebaseApp.d.ts +20 -0
  41. package/dist/cjs/api/firebase/FirebaseApp.js +70 -0
  42. package/dist/cjs/api/firebase/FirebaseDevice.d.ts +68 -0
  43. package/dist/cjs/api/firebase/FirebaseDevice.js +146 -0
  44. package/dist/cjs/api/firebase/FirebaseUser.d.ts +53 -0
  45. package/dist/cjs/api/firebase/FirebaseUser.js +434 -0
  46. package/dist/cjs/api/firebase/config.d.ts +8 -0
  47. package/dist/cjs/api/firebase/config.js +11 -0
  48. package/dist/cjs/api/firebase/deviceStore.d.ts +26 -0
  49. package/dist/cjs/api/firebase/deviceStore.js +191 -0
  50. package/dist/cjs/api/firebase/index.d.ts +3 -0
  51. package/dist/cjs/api/firebase/index.js +19 -0
  52. package/dist/cjs/api/https/config.d.ts +1 -0
  53. package/dist/cjs/api/https/config.js +4 -0
  54. package/dist/cjs/api/https/createOAuthURL.d.ts +3 -0
  55. package/dist/cjs/api/https/createOAuthURL.js +18 -0
  56. package/dist/cjs/api/https/getOAuthToken.d.ts +3 -0
  57. package/dist/cjs/api/https/getOAuthToken.js +34 -0
  58. package/dist/cjs/api/https/utils.d.ts +2 -0
  59. package/dist/cjs/api/https/utils.js +13 -0
  60. package/dist/cjs/api/index.d.ts +108 -0
  61. package/dist/cjs/api/index.js +306 -0
  62. package/dist/cjs/index.d.ts +3 -0
  63. package/dist/cjs/index.js +19 -0
  64. package/dist/cjs/skills/NotionOnDevice.d.ts +7 -0
  65. package/dist/cjs/skills/NotionOnDevice.js +25 -0
  66. package/dist/cjs/skills/createSkill.d.ts +7 -0
  67. package/dist/cjs/skills/createSkill.js +40 -0
  68. package/dist/cjs/skills/index.d.ts +2 -0
  69. package/dist/cjs/skills/index.js +18 -0
  70. package/dist/cjs/subscriptions/SubscriptionManager.d.ts +11 -0
  71. package/dist/cjs/subscriptions/SubscriptionManager.js +27 -0
  72. package/dist/cjs/timesync/Timesync.d.ts +20 -0
  73. package/dist/cjs/timesync/Timesync.js +78 -0
  74. package/dist/cjs/timesync/index.d.ts +1 -0
  75. package/dist/cjs/timesync/index.js +17 -0
  76. package/dist/cjs/types/accelerometer.d.ts +10 -0
  77. package/dist/cjs/types/accelerometer.js +2 -0
  78. package/dist/cjs/types/actions.d.ts +16 -0
  79. package/dist/cjs/types/actions.js +2 -0
  80. package/dist/cjs/types/awareness.d.ts +1 -0
  81. package/dist/cjs/types/awareness.js +2 -0
  82. package/dist/cjs/types/brainwaves.d.ts +26 -0
  83. package/dist/cjs/types/brainwaves.js +2 -0
  84. package/dist/cjs/types/calm.d.ts +6 -0
  85. package/dist/cjs/types/calm.js +2 -0
  86. package/dist/cjs/types/client.d.ts +22 -0
  87. package/dist/cjs/types/client.js +2 -0
  88. package/dist/cjs/types/credentials.d.ts +12 -0
  89. package/dist/cjs/types/credentials.js +2 -0
  90. package/dist/cjs/types/deviceInfo.d.ts +18 -0
  91. package/dist/cjs/types/deviceInfo.js +2 -0
  92. package/dist/cjs/types/epoch.d.ts +12 -0
  93. package/dist/cjs/types/epoch.js +2 -0
  94. package/dist/cjs/types/experiment.d.ts +9 -0
  95. package/dist/cjs/types/experiment.js +2 -0
  96. package/dist/cjs/types/focus.d.ts +6 -0
  97. package/dist/cjs/types/focus.js +2 -0
  98. package/dist/cjs/types/hapticEffects.d.ts +125 -0
  99. package/dist/cjs/types/hapticEffects.js +2 -0
  100. package/dist/cjs/types/kinesis.d.ts +6 -0
  101. package/dist/cjs/types/kinesis.js +2 -0
  102. package/dist/cjs/types/marker.d.ts +7 -0
  103. package/dist/cjs/types/marker.js +2 -0
  104. package/dist/cjs/types/metrics.d.ts +21 -0
  105. package/dist/cjs/types/metrics.js +2 -0
  106. package/dist/cjs/types/oauth.d.ts +20 -0
  107. package/dist/cjs/types/oauth.js +2 -0
  108. package/dist/cjs/types/options.d.ts +51 -0
  109. package/dist/cjs/types/options.js +2 -0
  110. package/dist/cjs/types/sample.d.ts +15 -0
  111. package/dist/cjs/types/sample.js +2 -0
  112. package/dist/cjs/types/settings.d.ts +13 -0
  113. package/dist/cjs/types/settings.js +2 -0
  114. package/dist/cjs/types/signalQuality.d.ts +13 -0
  115. package/dist/cjs/types/signalQuality.js +2 -0
  116. package/dist/cjs/types/skill.d.ts +68 -0
  117. package/dist/cjs/types/skill.js +2 -0
  118. package/dist/cjs/types/status.d.ts +26 -0
  119. package/dist/cjs/types/status.js +22 -0
  120. package/dist/cjs/types/streaming.d.ts +15 -0
  121. package/dist/cjs/types/streaming.js +20 -0
  122. package/dist/cjs/types/subscriptions.d.ts +23 -0
  123. package/dist/cjs/types/subscriptions.js +2 -0
  124. package/dist/cjs/types/training.d.ts +19 -0
  125. package/dist/cjs/types/training.js +2 -0
  126. package/dist/cjs/types/user.d.ts +12 -0
  127. package/dist/cjs/types/user.js +2 -0
  128. package/dist/cjs/utils/errors.d.ts +5 -0
  129. package/dist/cjs/utils/errors.js +17 -0
  130. package/dist/cjs/utils/filterInternalKeys.d.ts +3 -0
  131. package/dist/cjs/utils/filterInternalKeys.js +21 -0
  132. package/dist/cjs/utils/hapticEffects.d.ts +123 -0
  133. package/dist/cjs/utils/hapticEffects.js +130 -0
  134. package/dist/cjs/utils/heartbeat.d.ts +4 -0
  135. package/dist/cjs/utils/heartbeat.js +34 -0
  136. package/dist/cjs/utils/is-node.d.ts +1 -0
  137. package/dist/cjs/utils/is-node.js +9 -0
  138. package/dist/cjs/utils/metrics.d.ts +1 -0
  139. package/dist/cjs/utils/metrics.js +56 -0
  140. package/dist/cjs/utils/oauth.d.ts +9 -0
  141. package/dist/cjs/utils/oauth.js +92 -0
  142. package/dist/cjs/utils/pick.d.ts +1 -0
  143. package/dist/cjs/utils/pick.js +5 -0
  144. package/dist/cjs/utils/pipes.d.ts +46 -0
  145. package/dist/cjs/utils/pipes.js +71 -0
  146. package/dist/cjs/utils/platform.d.ts +30 -0
  147. package/dist/cjs/utils/platform.js +47 -0
  148. package/dist/cjs/utils/subscription.d.ts +6 -0
  149. package/dist/cjs/utils/subscription.js +55 -0
  150. package/dist/cjs/utils/transferDevice.d.ts +9 -0
  151. package/dist/cjs/utils/transferDevice.js +2 -0
  152. package/dist/cjs/utils/whileOnline.d.ts +8 -0
  153. package/dist/cjs/utils/whileOnline.js +15 -0
  154. package/dist/electron/index.js +92 -0
  155. package/dist/electron/index.js.map +1 -0
  156. package/dist/esm/Notion.d.ts +619 -0
  157. package/dist/esm/Notion.js +1260 -0
  158. package/dist/esm/api/bluetooth/BluetoothClient.d.ts +59 -0
  159. package/dist/esm/api/bluetooth/BluetoothClient.js +283 -0
  160. package/dist/esm/api/bluetooth/BluetoothTransport.d.ts +32 -0
  161. package/dist/esm/api/bluetooth/BluetoothTransport.js +1 -0
  162. package/dist/esm/api/bluetooth/constants.d.ts +4 -0
  163. package/dist/esm/api/bluetooth/constants.js +6 -0
  164. package/dist/esm/api/bluetooth/index.d.ts +4 -0
  165. package/dist/esm/api/bluetooth/index.js +4 -0
  166. package/dist/esm/api/bluetooth/react-native/ReactNativeTransport.d.ts +65 -0
  167. package/dist/esm/api/bluetooth/react-native/ReactNativeTransport.js +382 -0
  168. package/dist/esm/api/bluetooth/react-native/types/BleManagerTypes.d.ts +63 -0
  169. package/dist/esm/api/bluetooth/react-native/types/BleManagerTypes.js +8 -0
  170. package/dist/esm/api/bluetooth/react-native/types/ReactNativeTypes.d.ts +180 -0
  171. package/dist/esm/api/bluetooth/react-native/types/ReactNativeTypes.js +9 -0
  172. package/dist/esm/api/bluetooth/types/index.d.ts +31 -0
  173. package/dist/esm/api/bluetooth/types/index.js +19 -0
  174. package/dist/esm/api/bluetooth/utils/create6DigitPin.d.ts +1 -0
  175. package/dist/esm/api/bluetooth/utils/create6DigitPin.js +4 -0
  176. package/dist/esm/api/bluetooth/utils/csvBufferToEpoch.d.ts +11 -0
  177. package/dist/esm/api/bluetooth/utils/csvBufferToEpoch.js +31 -0
  178. package/dist/esm/api/bluetooth/utils/encoding.d.ts +3 -0
  179. package/dist/esm/api/bluetooth/utils/encoding.js +17 -0
  180. package/dist/esm/api/bluetooth/utils/osHasBluetoothSupport.d.ts +2 -0
  181. package/dist/esm/api/bluetooth/utils/osHasBluetoothSupport.js +16 -0
  182. package/dist/esm/api/bluetooth/utils/stitch.d.ts +5 -0
  183. package/dist/esm/api/bluetooth/utils/stitch.js +18 -0
  184. package/dist/esm/api/bluetooth/web/WebBluetoothTransport.d.ts +47 -0
  185. package/dist/esm/api/bluetooth/web/WebBluetoothTransport.js +408 -0
  186. package/dist/esm/api/bluetooth/web/isMaybeWebWorkerContext.d.ts +1 -0
  187. package/dist/esm/api/bluetooth/web/isMaybeWebWorkerContext.js +4 -0
  188. package/dist/esm/api/bluetooth/web/isWebBluetoothSupported.d.ts +1 -0
  189. package/dist/esm/api/bluetooth/web/isWebBluetoothSupported.js +7 -0
  190. package/dist/esm/api/firebase/FirebaseApp.d.ts +20 -0
  191. package/dist/esm/api/firebase/FirebaseApp.js +63 -0
  192. package/dist/esm/api/firebase/FirebaseDevice.d.ts +68 -0
  193. package/dist/esm/api/firebase/FirebaseDevice.js +139 -0
  194. package/dist/esm/api/firebase/FirebaseUser.d.ts +53 -0
  195. package/dist/esm/api/firebase/FirebaseUser.js +426 -0
  196. package/dist/esm/api/firebase/config.d.ts +8 -0
  197. package/dist/esm/api/firebase/config.js +8 -0
  198. package/dist/esm/api/firebase/deviceStore.d.ts +26 -0
  199. package/dist/esm/api/firebase/deviceStore.js +184 -0
  200. package/dist/esm/api/firebase/index.d.ts +3 -0
  201. package/dist/esm/api/firebase/index.js +3 -0
  202. package/dist/esm/api/https/config.d.ts +1 -0
  203. package/dist/esm/api/https/config.js +1 -0
  204. package/dist/esm/api/https/createOAuthURL.d.ts +3 -0
  205. package/dist/esm/api/https/createOAuthURL.js +11 -0
  206. package/dist/esm/api/https/getOAuthToken.d.ts +3 -0
  207. package/dist/esm/api/https/getOAuthToken.js +27 -0
  208. package/dist/esm/api/https/utils.d.ts +2 -0
  209. package/dist/esm/api/https/utils.js +9 -0
  210. package/dist/esm/api/index.d.ts +108 -0
  211. package/dist/esm/api/index.js +299 -0
  212. package/dist/esm/index.d.ts +3 -0
  213. package/dist/esm/index.js +3 -0
  214. package/dist/esm/neurosity.mjs +48722 -0
  215. package/dist/esm/skills/NotionOnDevice.d.ts +7 -0
  216. package/dist/esm/skills/NotionOnDevice.js +21 -0
  217. package/dist/esm/skills/createSkill.d.ts +7 -0
  218. package/dist/esm/skills/createSkill.js +36 -0
  219. package/dist/esm/skills/index.d.ts +2 -0
  220. package/dist/esm/skills/index.js +2 -0
  221. package/dist/esm/subscriptions/SubscriptionManager.d.ts +11 -0
  222. package/dist/esm/subscriptions/SubscriptionManager.js +23 -0
  223. package/dist/esm/timesync/Timesync.d.ts +20 -0
  224. package/dist/esm/timesync/Timesync.js +71 -0
  225. package/dist/esm/timesync/index.d.ts +1 -0
  226. package/dist/esm/timesync/index.js +1 -0
  227. package/dist/esm/types/accelerometer.d.ts +10 -0
  228. package/dist/esm/types/accelerometer.js +1 -0
  229. package/dist/esm/types/actions.d.ts +16 -0
  230. package/dist/esm/types/actions.js +1 -0
  231. package/dist/esm/types/awareness.d.ts +1 -0
  232. package/dist/esm/types/awareness.js +1 -0
  233. package/dist/esm/types/brainwaves.d.ts +26 -0
  234. package/dist/esm/types/brainwaves.js +1 -0
  235. package/dist/esm/types/calm.d.ts +6 -0
  236. package/dist/esm/types/calm.js +1 -0
  237. package/dist/esm/types/client.d.ts +22 -0
  238. package/dist/esm/types/client.js +1 -0
  239. package/dist/esm/types/credentials.d.ts +12 -0
  240. package/dist/esm/types/credentials.js +1 -0
  241. package/dist/esm/types/deviceInfo.d.ts +18 -0
  242. package/dist/esm/types/deviceInfo.js +1 -0
  243. package/dist/esm/types/epoch.d.ts +12 -0
  244. package/dist/esm/types/epoch.js +1 -0
  245. package/dist/esm/types/experiment.d.ts +9 -0
  246. package/dist/esm/types/experiment.js +1 -0
  247. package/dist/esm/types/focus.d.ts +6 -0
  248. package/dist/esm/types/focus.js +1 -0
  249. package/dist/esm/types/hapticEffects.d.ts +125 -0
  250. package/dist/esm/types/hapticEffects.js +1 -0
  251. package/dist/esm/types/kinesis.d.ts +6 -0
  252. package/dist/esm/types/kinesis.js +1 -0
  253. package/dist/esm/types/marker.d.ts +7 -0
  254. package/dist/esm/types/marker.js +1 -0
  255. package/dist/esm/types/metrics.d.ts +21 -0
  256. package/dist/esm/types/metrics.js +1 -0
  257. package/dist/esm/types/oauth.d.ts +20 -0
  258. package/dist/esm/types/oauth.js +1 -0
  259. package/dist/esm/types/options.d.ts +51 -0
  260. package/dist/esm/types/options.js +1 -0
  261. package/dist/esm/types/sample.d.ts +15 -0
  262. package/dist/esm/types/sample.js +1 -0
  263. package/dist/esm/types/settings.d.ts +13 -0
  264. package/dist/esm/types/settings.js +1 -0
  265. package/dist/esm/types/signalQuality.d.ts +13 -0
  266. package/dist/esm/types/signalQuality.js +1 -0
  267. package/dist/esm/types/skill.d.ts +68 -0
  268. package/dist/esm/types/skill.js +1 -0
  269. package/dist/esm/types/status.d.ts +26 -0
  270. package/dist/esm/types/status.js +19 -0
  271. package/dist/esm/types/streaming.d.ts +15 -0
  272. package/dist/esm/types/streaming.js +17 -0
  273. package/dist/esm/types/subscriptions.d.ts +23 -0
  274. package/dist/esm/types/subscriptions.js +1 -0
  275. package/dist/esm/types/training.d.ts +19 -0
  276. package/dist/esm/types/training.js +1 -0
  277. package/dist/esm/types/user.d.ts +12 -0
  278. package/dist/esm/types/user.js +1 -0
  279. package/dist/esm/utils/errors.d.ts +5 -0
  280. package/dist/esm/utils/errors.js +11 -0
  281. package/dist/esm/utils/filterInternalKeys.d.ts +3 -0
  282. package/dist/esm/utils/filterInternalKeys.js +17 -0
  283. package/dist/esm/utils/hapticEffects.d.ts +123 -0
  284. package/dist/esm/utils/hapticEffects.js +125 -0
  285. package/dist/esm/utils/heartbeat.d.ts +4 -0
  286. package/dist/esm/utils/heartbeat.js +29 -0
  287. package/dist/esm/utils/is-node.d.ts +1 -0
  288. package/dist/esm/utils/is-node.js +5 -0
  289. package/dist/esm/utils/metrics.d.ts +1 -0
  290. package/dist/esm/utils/metrics.js +52 -0
  291. package/dist/esm/utils/oauth.d.ts +9 -0
  292. package/dist/esm/utils/oauth.js +64 -0
  293. package/dist/esm/utils/pick.d.ts +1 -0
  294. package/dist/esm/utils/pick.js +1 -0
  295. package/dist/esm/utils/pipes.d.ts +46 -0
  296. package/dist/esm/utils/pipes.js +65 -0
  297. package/dist/esm/utils/platform.d.ts +30 -0
  298. package/dist/esm/utils/platform.js +41 -0
  299. package/dist/esm/utils/subscription.d.ts +6 -0
  300. package/dist/esm/utils/subscription.js +24 -0
  301. package/dist/esm/utils/transferDevice.d.ts +9 -0
  302. package/dist/esm/utils/transferDevice.js +1 -0
  303. package/dist/esm/utils/whileOnline.d.ts +8 -0
  304. package/dist/esm/utils/whileOnline.js +11 -0
  305. package/dist/examples/auth.html +32 -0
  306. package/dist/examples/cloud.html +17 -0
  307. package/dist/examples/index.html +1 -0
  308. package/dist/examples/neurosity.iife.js +48736 -0
  309. package/dist/examples/neurosity.js +672 -0
  310. package/dist/examples/neurosity.mjs +48722 -0
  311. package/dist/examples/training.html +49 -0
  312. package/package.json +78 -0
@@ -0,0 +1,619 @@
1
+ import { Observable } from "rxjs";
2
+ import { CloudClient, createUser } from "./api/index";
3
+ import { SDKOptions } from "./types/options";
4
+ import { STREAMING_MODE, STREAMING_TYPE } from "./types/streaming";
5
+ import { Training } from "./types/training";
6
+ import { Credentials } from "./types/credentials";
7
+ import { Settings } from "./types/settings";
8
+ import { SignalQuality } from "./types/signalQuality";
9
+ import { Kinesis } from "./types/kinesis";
10
+ import { Calm } from "./types/calm";
11
+ import { Focus } from "./types/focus";
12
+ import { BrainwavesLabel, Epoch, PowerByBand, PSD } from "./types/brainwaves";
13
+ import { Accelerometer } from "./types/accelerometer";
14
+ import { DeviceInfo } from "./types/deviceInfo";
15
+ import { DeviceStatus } from "./types/status";
16
+ import { Action } from "./types/actions";
17
+ import { HapticEffects } from "./types/hapticEffects";
18
+ import { OAuthConfig, OAuthQuery } from "./types/oauth";
19
+ import { OAuthQueryResult, OAuthRemoveResponse } from "./types/oauth";
20
+ import { Experiment } from "./types/experiment";
21
+ import { BluetoothClient } from "./api/bluetooth";
22
+ /**
23
+ * import StreamingModes from "@site/src/components/StreamingModes";
24
+ *
25
+ * Example
26
+ * ```typescript
27
+ * import { Neurosity } from "@neurosity/sdk";
28
+ *
29
+ * const neurosity = new Neurosity();
30
+ * ```
31
+ */
32
+ export declare class Neurosity {
33
+ /**
34
+ * @hidden
35
+ */
36
+ protected options: SDKOptions;
37
+ /**
38
+ * @hidden
39
+ */
40
+ protected cloudClient: CloudClient;
41
+ /**
42
+ * @hidden
43
+ */
44
+ protected bluetoothClient: BluetoothClient;
45
+ /**
46
+ * @hidden
47
+ */
48
+ protected isMissingBluetoothTransport: boolean;
49
+ /**
50
+ * @hidden
51
+ */
52
+ private streamingMode$;
53
+ /**
54
+ *
55
+ * @hidden
56
+ */
57
+ static credentialWithLink: Function;
58
+ /**
59
+ *
60
+ * @hidden
61
+ */
62
+ static createUser: typeof createUser;
63
+ /**
64
+ *
65
+ * @hidden
66
+ */
67
+ static SERVER_TIMESTAMP: Object;
68
+ /**
69
+ * Creates new instance of the Neurosity SDK
70
+ *
71
+ * ```typescript
72
+ * const neurosity = new Neurosity();
73
+ * ```
74
+
75
+ * @param options
76
+ */
77
+ constructor(options?: SDKOptions);
78
+ /**
79
+ *
80
+ * @hidden
81
+ */
82
+ _initStreamingMode(streamingMode: STREAMING_MODE, hasBluetoothTransport: boolean): void;
83
+ /**
84
+ * Subscribe to the device's streaming state changes and the current strategy
85
+ *
86
+ * Streams the current mode of streaming (wifi or bluetooth).
87
+ *
88
+ * ```typescript
89
+ * neurosity.streamingState().subscribe((streamingState) => {
90
+ * console.log(streamingState);
91
+ * // { streamingMode: "wifi-only", activeMode: "wifi", connected: true }
92
+ * });
93
+ * ```
94
+ */
95
+ streamingState(): Observable<{
96
+ connected: boolean;
97
+ activeMode: STREAMING_TYPE;
98
+ streamingMode: STREAMING_MODE;
99
+ }>;
100
+ /**
101
+ *
102
+ * @hidden
103
+ */
104
+ _withStreamingModeObservable<T>(streams: {
105
+ wifi: () => Observable<T>;
106
+ bluetooth: () => Observable<T>;
107
+ }): Observable<any>;
108
+ /**
109
+ *
110
+ * @hidden
111
+ */
112
+ _withStreamingModePromise<T>(promises: {
113
+ wifi: () => Promise<T>;
114
+ bluetooth: () => Promise<T>;
115
+ }): Promise<T>;
116
+ /**
117
+ *
118
+ * @hidden
119
+ */
120
+ get bluetooth(): BluetoothClient;
121
+ /**
122
+ *
123
+ * @hidden
124
+ */
125
+ private _getCloudMetricDependencies;
126
+ /**
127
+ * Starts user session
128
+ *
129
+ * ```typescript
130
+ * await neurosity.login({
131
+ * email: "...",
132
+ * password: "..."
133
+ * });
134
+ * ```
135
+ *
136
+ * @param credentials
137
+ */
138
+ login(credentials: Credentials): Promise<void>;
139
+ /**
140
+ * Ends user session
141
+ *
142
+ * ```typescript
143
+ * await neurosity.logout();
144
+ * // session has ended
145
+ * ```
146
+ *
147
+ */
148
+ logout(): Promise<void>;
149
+ /**
150
+ * Subscribe to auth state changes
151
+ *
152
+ * Streams the state of the auth session. If user has logged in, the user object will be set. When logged out, the user object will be null.
153
+ *
154
+ * ```typescript
155
+ * neurosity.onAuthStateChanged().subscribe((user) => {
156
+ * console.log(user);
157
+ * });
158
+ * ```
159
+ */
160
+ onAuthStateChanged(): Observable<any>;
161
+ /**
162
+ * Get user devices
163
+ *
164
+ * Returns a list of devices claimed by the user authenticated.
165
+ *
166
+ * ```typescript
167
+ * const devices = await neurosity.getDevices();
168
+ * console.log(devices);
169
+ * ```
170
+ */
171
+ getDevices(): Promise<DeviceInfo[]>;
172
+ /**
173
+ * Select Device
174
+ *
175
+ * Rarely necessary, but useful when the user owns multiple devices.
176
+ *
177
+ * A common use case for manually selecting a device is when you wish to build a device dropdown a user can select from, instead of collecting the Device Id from the user ahead of time.
178
+ *
179
+ * The 3 steps to manually selecting a device are:
180
+ *
181
+ * - Set `autoSelectDevice` to false when instantiating the `Neurosity` class.
182
+ * - Authenticate with your Neurosity account to access your devices by calling the `neurosity.login(...)` function.
183
+ * - Call the `neurosity.selectDevice(...)` function with a device selector function.
184
+ *
185
+ * ```typescript
186
+ * const devices = await neurosity.selectDevice((devices) =>
187
+ * devices.find((device) => device.deviceNickname === "Crown-A1B")
188
+ * );
189
+ *
190
+ * console.log(devices);
191
+ * ```
192
+ *
193
+ * > If you own multiple devices, and don't pass `autoSelectDevice`, then the first device on the list will be automatically selected.
194
+ *
195
+ * For more info, check out the "Device Selection" guide.
196
+ */
197
+ selectDevice(deviceSelector: (devices: DeviceInfo[]) => DeviceInfo): Promise<DeviceInfo>;
198
+ /**
199
+ * Get selected device
200
+ *
201
+ * ```typescript
202
+ * const selectedDevice = await neurosity.getSelectedDevice();
203
+ * console.log(selectedDevice);
204
+ * ```
205
+ */
206
+ getSelectedDevice(): Promise<DeviceInfo>;
207
+ /**
208
+ * ```typescript
209
+ * const info = await neurosity.getInfo();
210
+ * ```
211
+ */
212
+ getInfo(): Promise<DeviceInfo>;
213
+ /**
214
+ * Observes selected device
215
+ *
216
+ * ```typescript
217
+ * neurosity.onDeviceChange().subscribe(device => {
218
+ * console.log(device);
219
+ * });
220
+ * ```
221
+ */
222
+ onDeviceChange(): Observable<DeviceInfo>;
223
+ /**
224
+ * <StreamingModes wifi={true} bluetooth={true} />
225
+ *
226
+ * Ends database connection
227
+ *
228
+ * ```typescript
229
+ * await neurosity.disconnect();
230
+ * ```
231
+ */
232
+ disconnect(): Promise<void>;
233
+ /**
234
+ * <StreamingModes wifi={true} bluetooth={true} />
235
+ *
236
+ * Injects an EEG marker to data stream
237
+ *
238
+ * ```typescript
239
+ * neurosity.addMarker("eyes-closed");
240
+ *
241
+ * // later...
242
+ *
243
+ * neurosity.addMarker("eyes-open");
244
+ * ```
245
+ *
246
+ * @param label Name the label to inject
247
+ */
248
+ addMarker(label: string): Promise<Action>;
249
+ /**
250
+ * <StreamingModes wifi={true} bluetooth={true} />
251
+ *
252
+ * Queue haptic motor commands
253
+ *
254
+ * To queue haptic P7 only,
255
+ * ```typescript
256
+ * await neurosity.haptics({
257
+ * P7: ["tripleClick100"]
258
+ * });
259
+ * ```
260
+ *
261
+ * To queue both motors at the same time
262
+ * ```typescript
263
+ * await neurosity.haptics({
264
+ * P7: [neurosity.getHapticEffects().strongClick100],
265
+ * P8: [neurosity.getHapticEffects().strongClick100]
266
+ * });
267
+ * ```
268
+ *
269
+ * You can queue different commands to the motors too
270
+ * ```typescript
271
+ * const effects = neurosity.getHapticEffects();
272
+ * await neurosity.haptics({
273
+ * P7: [effects.transitionRampUpLongSmooth1_0_to_100,
274
+ * effects.transitionRampDownLongSmooth1_100_to_0],
275
+ * P8: [effects.strongClick100]
276
+ * });
277
+ * ```
278
+ *
279
+ * @param effects Effects to queue. The key of the object passed should be the location of the motor
280
+ * to queue. Each key can be an array of up to 7 commands. There is no haptic support for model
281
+ * version 1, Notion DK1. The Haptic motor's location is positioned in reference to the 10-10 EEG
282
+ * system used to label the channels of the Crown's EEG sensors. Notion 2 and Crown have haptics
283
+ * at P7 and P8. A list of haptic commands can be found on ./utils/hapticCodes.ts - there
284
+ * are about 127 of them!
285
+ */
286
+ haptics(effects: any): Promise<any>;
287
+ /**
288
+ * ```typescript
289
+ * const effects = neurosity.getHapticEffects();
290
+ * ```
291
+ */
292
+ getHapticEffects(): HapticEffects;
293
+ /**
294
+ * <StreamingModes wifi={true} bluetooth={true} />
295
+ *
296
+ * Observes accelerometer data
297
+ * Supported by the Crown and Notion 2 devices.
298
+ *
299
+ * ```typescript
300
+ * neurosity.accelerometer().subscribe(accelerometer => {
301
+ * console.log(accelerometer);
302
+ * });
303
+ *
304
+ * // { acceleration: ..., inclination: ..., orientation: ..., pitch: ..., roll: ..., x: ..., y: ..., z: ... }
305
+ * ```
306
+ *
307
+ * @returns Observable of accelerometer metric events
308
+ */
309
+ accelerometer(): Observable<Accelerometer>;
310
+ /**
311
+ * <StreamingModes wifi={true} bluetooth={true} />
312
+ *
313
+ * The `raw` brainwaves parameter emits epochs of 16 samples for Crown and 25 for Notion 1 and 2.
314
+ *
315
+ * Example
316
+ * ```typescript
317
+ * neurosity.brainwaves("raw").subscribe(brainwaves => {
318
+ * console.log(brainwaves);
319
+ * });
320
+ * ```
321
+ *
322
+ * Raw Unfiltered - The `rawUnfiltered` brainwaves parameter emits epochs of 16 samples for Crown and 25 for Notion 1 and 2.
323
+
324
+ * Example
325
+ * ```typescript
326
+ * neurosity.brainwaves("rawUnfiltered").subscribe(brainwaves => {
327
+ * console.log(brainwaves);
328
+ * });
329
+ * ```
330
+ *
331
+ * Power By Band - The `powerByBand` brainwaves parameter emits epochs 4 times a second. Every frequency label (e.g. beta) contains an average power value per channel.
332
+ *
333
+ * Example
334
+ * ```typescript
335
+ * neurosity.brainwaves("powerByBand").subscribe(brainwaves => {
336
+ * console.log(brainwaves);
337
+ * });
338
+ * ```
339
+ *
340
+ * Power Spectral Density (PSD) - The `psd` brainwaves parameter emits epochs 4 times a second. Every frequency label (e.g. alpha) contains the computed FFT (Fast Fourier transform) value per channel (see the `psd` property), as well as the frequency ranges (see the `freqs` property).
341
+ *
342
+ * Example
343
+ * ```typescript
344
+ * neurosity.brainwaves("psd").subscribe(brainwaves => {
345
+ * console.log(brainwaves);
346
+ * });
347
+ * ```
348
+ *
349
+ * @param label Name of metric properties to filter by
350
+ * @returns Observable of brainwaves metric events
351
+ */
352
+ brainwaves(label: BrainwavesLabel): Observable<Epoch | PowerByBand | PSD>;
353
+ /**
354
+ * <StreamingModes wifi={true} bluetooth={true} />
355
+ *
356
+ * Example
357
+ * ```typescript
358
+ * neurosity.calm().subscribe(calm => {
359
+ * console.log(calm.probability);
360
+ * });
361
+ *
362
+ * // 0.45
363
+ * // 0.47
364
+ * // 0.53
365
+ * // 0.51
366
+ * // ...
367
+ * ```
368
+ *
369
+ * @returns Observable of calm events - awareness/calm alias
370
+ */
371
+ calm(): Observable<Calm>;
372
+ /**
373
+ * <StreamingModes wifi={true} bluetooth={true} />
374
+ *
375
+ * Observes signal quality data where each property is the name
376
+ * of the channel and the value includes the standard deviation and
377
+ * a status set by the device
378
+ *
379
+ * ```typescript
380
+ * neurosity.signalQuality().subscribe(signalQuality => {
381
+ * console.log(signalQuality);
382
+ * });
383
+ *
384
+ * // { FC6: { standardDeviation: 3.5, status: "good" }, C3: {...}, ... }
385
+ * ```
386
+ *
387
+ * @returns Observable of signalQuality metric events
388
+ */
389
+ signalQuality(): Observable<SignalQuality>;
390
+ /**
391
+ * <StreamingModes wifi={true} />
392
+ *
393
+ * Observes last state of `settings` and all subsequent `settings` changes
394
+ *
395
+ * ```typescript
396
+ * neurosity.settings().subscribe(settings => {
397
+ * console.log(settings.lsl);
398
+ * });
399
+ *
400
+ * // true
401
+ * // ...
402
+ * ```
403
+ *
404
+ * @returns Observable of `settings` metric events
405
+ */
406
+ settings(): Observable<Settings>;
407
+ /**
408
+ * <StreamingModes wifi={true} bluetooth={true} />
409
+ *
410
+ * Example
411
+ * ```typescript
412
+ * neurosity.focus().subscribe(focus => {
413
+ * console.log(focus.probability);
414
+ * });
415
+ *
416
+ * // 0.56
417
+ * // 0.46
418
+ * // 0.31
419
+ * // 0.39
420
+ * // ...
421
+ * ```
422
+ *
423
+ * @returns Observable of focus events - awareness/focus alias
424
+ */
425
+ focus(): Observable<Focus>;
426
+ /**
427
+ * <StreamingModes wifi={true} />
428
+ *
429
+ * @param label Name of metric properties to filter by
430
+ * @returns Observable of kinesis metric events
431
+ */
432
+ kinesis(label: string): Observable<Kinesis>;
433
+ /**
434
+ * <StreamingModes wifi={true} />
435
+ *
436
+ * @param label Name of metric properties to filter by
437
+ * @returns Observable of predictions metric events
438
+ */
439
+ predictions(label: string): Observable<any>;
440
+ /**
441
+ * <StreamingModes wifi={true} bluetooth={true} />
442
+ *
443
+ * Observes last state of `status` and all subsequent `status` changes
444
+ *
445
+ * ```typescript
446
+ * neurosity.status().subscribe(status => {
447
+ * console.log(status.state);
448
+ * });
449
+ *
450
+ * // "online"
451
+ * // ...
452
+ * ```
453
+ *
454
+ * @returns Observable of `status` metric events
455
+ */
456
+ status(): Observable<DeviceStatus>;
457
+ /**
458
+ * <StreamingModes wifi={true} />
459
+ *
460
+ * ```typescript
461
+ * neurosity.training.record({
462
+ * metric: "kinesis",
463
+ * label: "push"
464
+ * });
465
+ *
466
+ * neurosity.training.stop({
467
+ * metric: "kinesis",
468
+ * label: "push"
469
+ * });
470
+ * ```
471
+ *
472
+ * @returns Training methods
473
+ */
474
+ get training(): Training;
475
+ /**
476
+ * Create OAuth URL
477
+ * 💡 OAuth requires developers to register their apps with Neurosity
478
+ * [Read full OAuth guide](/docs/oauth)
479
+ *
480
+ * Creates client-specific OAuth URL. This is the first step of the OAuth workflow. Use this function to create a URL you can use to redirect users to the Neurosity sign-in page.
481
+ * 💡 This function is designed to only run on the server side for security reasons, as it requires your client secret.
482
+ *
483
+ * ```typescript
484
+ * const { Neurosity } = require("@neurosity/sdk");
485
+ *
486
+ * const neurosity = new Neurosity({
487
+ * autoSelectDevice: false
488
+ * });
489
+ *
490
+ * exports.handler = async function (event) {
491
+ * return neurosity
492
+ * .createOAuthURL({
493
+ * clientId: process.env.NEUROSITY_OAUTH_CLIENT_ID,
494
+ * clientSecret: process.env.NEUROSITY_OAUTH_CLIENT_SECRET,
495
+ * redirectUri: process.env.NEUROSITY_OAUTH_CLIENT_REDIRECT_URI,
496
+ * responseType: "token",
497
+ * state: Math.random().toString().split(".")[1],
498
+ * scope: [
499
+ * "read:devices-info",
500
+ * "read:devices-status",
501
+ * "read:signal-quality",
502
+ * "read:brainwaves"
503
+ * ]
504
+ * })
505
+ * .then((url) => ({
506
+ * statusCode: 200,
507
+ * body: JSON.stringify({ url })
508
+ * }))
509
+ * .catch((error) => ({
510
+ * statusCode: 400,
511
+ * body: JSON.stringify(error.response.data)
512
+ * }));
513
+ * };
514
+ * ```
515
+ * @returns custom token
516
+ */
517
+ createOAuthURL(config: OAuthConfig): Promise<string>;
518
+ /**
519
+ * Get OAuth Token
520
+ * 💡 OAuth requires developers to register their apps with Neurosity
521
+ * [Read full OAuth guide](/docs/oauth)
522
+ *
523
+ * Gets client-specific OAuth token for a given userId.
524
+ *
525
+ * 💡 This function is designed to only run on the server side for security reasons, as it requires your client secret.
526
+ * Here's an example of a cloud function that receives a `userId` via query params and loads the client id and client secret securely via environment variables.
527
+ *
528
+ *
529
+ * ```typescript
530
+ * const { Neurosity } = require("@neurosity/sdk");
531
+ *
532
+ * const neurosity = new Neurosity({
533
+ * autoSelectDevice: false
534
+ * });
535
+ *
536
+ * exports.handler = async function (event) {
537
+ * const userId = event.queryStringParameters?.userId;
538
+ *
539
+ * return neurosity
540
+ * .getOAuthToken({
541
+ * clientId: process.env.NEUROSITY_OAUTH_CLIENT_ID,
542
+ * clientSecret: process.env.NEUROSITY_OAUTH_CLIENT_SECRET,
543
+ * userId
544
+ * })
545
+ * .then((token) => ({
546
+ * statusCode: 200,
547
+ * body: JSON.stringify(token)
548
+ * }))
549
+ * .catch((error) => ({
550
+ * statusCode: 200,
551
+ * body: JSON.stringify(error.response.data)
552
+ * }));
553
+ * };
554
+ * ```
555
+ * @returns custom token
556
+ */
557
+ getOAuthToken(query: OAuthQuery): Promise<OAuthQueryResult>;
558
+ /**
559
+ * Remove OAuth Access
560
+ * 💡 OAuth requires developers to register their apps with Neurosity
561
+ * [Read full OAuth guide](/docs/oauth)
562
+ *
563
+ * Removes client-specific OAuth token for a given userId. Requires SDK to be signed in with OAuth custom token.
564
+ *
565
+ * ```typescript
566
+ * await neurosity.removeOAuthAccess().catch((error) => {
567
+ * // handle error here...
568
+ * });
569
+ * ```
570
+ * @returns custom token
571
+ */
572
+ removeOAuthAccess(): Promise<OAuthRemoveResponse>;
573
+ /**
574
+ * <StreamingModes wifi={true} />
575
+ *
576
+ * Observes and returns a list of all Kinesis `experiments` and all subsequent experiment changes.
577
+ * Here's an example of how to get a list of all Kinesis labels that have been trained:
578
+ *
579
+ * ```typescript
580
+ *
581
+ * const getUniqueLabels = (experiments) => {
582
+ * const labels = experiments.flatMap((experiment) => experiment.labels);
583
+ * // only return unique labels
584
+ * return [...new Set(labels)];
585
+ * }
586
+ *
587
+ * neurosity.onUserExperiments().subscribe((experiments) => {
588
+ * console.log(experiments);
589
+ * console.log("labels", getUniqueLabels(experiments));
590
+ * });
591
+ *
592
+ * // [{ id: '...', deviceId: '...', labels: [ 'drop' ], name: 'Lightgray cheetah', timestamp: 1577908381552, totalTrials: 16, userId: '...' }]
593
+ * // ["drop", "lift", "push"]
594
+ * ```
595
+ *
596
+ * @returns Observable of `experiments` events
597
+ */
598
+ onUserExperiments(): Observable<Experiment[]>;
599
+ /**
600
+ * <StreamingModes wifi={true} />
601
+ *
602
+ * Deletes a specific experiment provided an experiment ID
603
+ *
604
+ * ```typescript
605
+ * await neurosity.deleteUserExperiment(experiment.id);
606
+ * ```
607
+ *
608
+ * @param experimentId The ID of the Experiment
609
+ * @returns void
610
+ */
611
+ deleteUserExperiment(experimentId: string): Promise<void>;
612
+ }
613
+ /**
614
+ * @hidden
615
+ * Deprecated class kept for backwards compatibility purposes.
616
+ */
617
+ export declare class Notion extends Neurosity {
618
+ constructor(options?: SDKOptions);
619
+ }