@neurosity/sdk 6.5.10 → 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.
Files changed (130) hide show
  1. package/dist/browser/neurosity.iife.js +118 -49
  2. package/dist/browser/neurosity.js +112 -112
  3. package/dist/browser/neurosity.js.map +1 -1
  4. package/dist/cjs/__tests__/Neurosity.test.d.ts +1 -0
  5. package/dist/cjs/__tests__/Neurosity.test.js +201 -0
  6. package/dist/cjs/__tests__/WebBluetoothTransport.test.d.ts +1 -0
  7. package/dist/cjs/__tests__/WebBluetoothTransport.test.js +201 -0
  8. package/dist/cjs/__tests__/accelerometer.test.d.ts +1 -0
  9. package/dist/cjs/__tests__/accelerometer.test.js +158 -0
  10. package/dist/cjs/__tests__/auth.test.d.ts +1 -0
  11. package/dist/cjs/__tests__/auth.test.js +239 -0
  12. package/dist/cjs/__tests__/brainwaves.test.d.ts +1 -0
  13. package/dist/cjs/__tests__/brainwaves.test.js +291 -0
  14. package/dist/cjs/__tests__/device.test.d.ts +1 -0
  15. package/dist/cjs/__tests__/device.test.js +281 -0
  16. package/dist/cjs/__tests__/haptics.test.d.ts +1 -0
  17. package/dist/cjs/__tests__/haptics.test.js +162 -0
  18. package/dist/cjs/__tests__/metrics.test.d.ts +1 -0
  19. package/dist/cjs/__tests__/metrics.test.js +178 -0
  20. package/dist/cjs/__tests__/oauth.test.d.ts +1 -0
  21. package/dist/cjs/__tests__/oauth.test.js +138 -0
  22. package/dist/cjs/__tests__/settings.test.d.ts +1 -0
  23. package/dist/cjs/__tests__/settings.test.js +130 -0
  24. package/dist/cjs/__tests__/setup/webBluetooth.setup.d.ts +11 -0
  25. package/dist/cjs/__tests__/setup/webBluetooth.setup.js +35 -0
  26. package/dist/cjs/__tests__/setup.d.ts +0 -0
  27. package/dist/cjs/__tests__/setup.js +7 -0
  28. package/dist/cjs/__tests__/streaming.test.d.ts +1 -0
  29. package/dist/cjs/__tests__/streaming.test.js +259 -0
  30. package/dist/cjs/__tests__/timesync.test.d.ts +1 -0
  31. package/dist/cjs/__tests__/timesync.test.js +54 -0
  32. package/dist/cjs/__tests__/utils.test.d.ts +1 -0
  33. package/dist/cjs/__tests__/utils.test.js +281 -0
  34. package/dist/cjs/api/bluetooth/BluetoothClient.d.ts +6 -6
  35. package/dist/cjs/api/bluetooth/BluetoothTransport.d.ts +1 -1
  36. package/dist/cjs/api/bluetooth/react-native/ReactNativeTransport.d.ts +4 -4
  37. package/dist/cjs/api/bluetooth/react-native/types/ReactNativeTypes.d.ts +2 -2
  38. package/dist/cjs/api/bluetooth/types/index.d.ts +2 -2
  39. package/dist/cjs/api/bluetooth/utils/decodeJSONChunks.d.ts +1 -1
  40. package/dist/cjs/api/bluetooth/utils/stitch.d.ts +1 -1
  41. package/dist/cjs/api/bluetooth/utils/textCodec.d.ts +1 -1
  42. package/dist/cjs/api/bluetooth/web/WebBluetoothTransport.d.ts +1 -1
  43. package/dist/cjs/api/firebase/FirebaseDevice.d.ts +1 -1
  44. package/dist/cjs/api/firebase/FirebaseUser.d.ts +1 -1
  45. package/dist/cjs/api/index.js +1 -1
  46. package/dist/cjs/timesync/Timesync.d.ts +1 -1
  47. package/dist/cjs/types/awareness.d.ts +1 -1
  48. package/dist/cjs/types/brainwaves.d.ts +25 -12
  49. package/dist/cjs/types/credentials.d.ts +4 -4
  50. package/dist/cjs/types/deviceInfo.d.ts +4 -4
  51. package/dist/cjs/types/epoch.d.ts +1 -1
  52. package/dist/cjs/types/experiment.d.ts +1 -1
  53. package/dist/cjs/types/hapticEffects.d.ts +1 -1
  54. package/dist/cjs/types/marker.d.ts +1 -1
  55. package/dist/cjs/types/metrics.d.ts +2 -2
  56. package/dist/cjs/types/oauth.d.ts +4 -4
  57. package/dist/cjs/types/sample.d.ts +2 -2
  58. package/dist/cjs/types/signalQuality.d.ts +1 -1
  59. package/dist/cjs/types/skill.d.ts +2 -2
  60. package/dist/cjs/types/user.d.ts +3 -3
  61. package/dist/cjs/utils/oauth.d.ts +1 -1
  62. package/dist/cjs/utils/transferDevice.d.ts +3 -3
  63. package/dist/cjs/utils/whileOnline.d.ts +1 -1
  64. package/dist/electron/index.js +1 -1
  65. package/dist/electron/index.js.map +1 -1
  66. package/dist/esm/__tests__/Neurosity.test.d.ts +1 -0
  67. package/dist/esm/__tests__/Neurosity.test.js +199 -0
  68. package/dist/esm/__tests__/WebBluetoothTransport.test.d.ts +1 -0
  69. package/dist/esm/__tests__/WebBluetoothTransport.test.js +199 -0
  70. package/dist/esm/__tests__/accelerometer.test.d.ts +1 -0
  71. package/dist/esm/__tests__/accelerometer.test.js +156 -0
  72. package/dist/esm/__tests__/auth.test.d.ts +1 -0
  73. package/dist/esm/__tests__/auth.test.js +237 -0
  74. package/dist/esm/__tests__/brainwaves.test.d.ts +1 -0
  75. package/dist/esm/__tests__/brainwaves.test.js +289 -0
  76. package/dist/esm/__tests__/device.test.d.ts +1 -0
  77. package/dist/esm/__tests__/device.test.js +279 -0
  78. package/dist/esm/__tests__/haptics.test.d.ts +1 -0
  79. package/dist/esm/__tests__/haptics.test.js +160 -0
  80. package/dist/esm/__tests__/metrics.test.d.ts +1 -0
  81. package/dist/esm/__tests__/metrics.test.js +176 -0
  82. package/dist/esm/__tests__/oauth.test.d.ts +1 -0
  83. package/dist/esm/__tests__/oauth.test.js +133 -0
  84. package/dist/esm/__tests__/settings.test.d.ts +1 -0
  85. package/dist/esm/__tests__/settings.test.js +128 -0
  86. package/dist/esm/__tests__/setup/webBluetooth.setup.d.ts +11 -0
  87. package/dist/esm/__tests__/setup/webBluetooth.setup.js +35 -0
  88. package/dist/esm/__tests__/setup.d.ts +0 -0
  89. package/dist/esm/__tests__/setup.js +7 -0
  90. package/dist/esm/__tests__/streaming.test.d.ts +1 -0
  91. package/dist/esm/__tests__/streaming.test.js +257 -0
  92. package/dist/esm/__tests__/timesync.test.d.ts +1 -0
  93. package/dist/esm/__tests__/timesync.test.js +52 -0
  94. package/dist/esm/__tests__/utils.test.d.ts +1 -0
  95. package/dist/esm/__tests__/utils.test.js +279 -0
  96. package/dist/esm/api/bluetooth/BluetoothClient.d.ts +6 -6
  97. package/dist/esm/api/bluetooth/BluetoothTransport.d.ts +1 -1
  98. package/dist/esm/api/bluetooth/react-native/ReactNativeTransport.d.ts +4 -4
  99. package/dist/esm/api/bluetooth/react-native/types/ReactNativeTypes.d.ts +2 -2
  100. package/dist/esm/api/bluetooth/types/index.d.ts +2 -2
  101. package/dist/esm/api/bluetooth/utils/decodeJSONChunks.d.ts +1 -1
  102. package/dist/esm/api/bluetooth/utils/stitch.d.ts +1 -1
  103. package/dist/esm/api/bluetooth/utils/textCodec.d.ts +1 -1
  104. package/dist/esm/api/bluetooth/web/WebBluetoothTransport.d.ts +1 -1
  105. package/dist/esm/api/firebase/FirebaseDevice.d.ts +1 -1
  106. package/dist/esm/api/firebase/FirebaseUser.d.ts +1 -1
  107. package/dist/esm/api/index.js +2 -2
  108. package/dist/esm/neurosity.mjs +118 -49
  109. package/dist/esm/timesync/Timesync.d.ts +1 -1
  110. package/dist/esm/types/awareness.d.ts +1 -1
  111. package/dist/esm/types/brainwaves.d.ts +25 -12
  112. package/dist/esm/types/credentials.d.ts +4 -4
  113. package/dist/esm/types/deviceInfo.d.ts +4 -4
  114. package/dist/esm/types/epoch.d.ts +1 -1
  115. package/dist/esm/types/experiment.d.ts +1 -1
  116. package/dist/esm/types/hapticEffects.d.ts +1 -1
  117. package/dist/esm/types/marker.d.ts +1 -1
  118. package/dist/esm/types/metrics.d.ts +2 -2
  119. package/dist/esm/types/oauth.d.ts +4 -4
  120. package/dist/esm/types/sample.d.ts +2 -2
  121. package/dist/esm/types/signalQuality.d.ts +1 -1
  122. package/dist/esm/types/skill.d.ts +2 -2
  123. package/dist/esm/types/user.d.ts +3 -3
  124. package/dist/esm/utils/oauth.d.ts +1 -1
  125. package/dist/esm/utils/transferDevice.d.ts +3 -3
  126. package/dist/esm/utils/whileOnline.d.ts +1 -1
  127. package/dist/examples/neurosity.iife.js +118 -49
  128. package/dist/examples/neurosity.js +112 -112
  129. package/dist/examples/neurosity.mjs +118 -49
  130. package/package.json +16 -4
@@ -0,0 +1,279 @@
1
+ import { create6DigitPin } from "../api/bluetooth/utils/create6DigitPin";
2
+ import { decodeJSONChunks } from "../api/bluetooth/utils/decodeJSONChunks";
3
+ import { stitchChunks } from "../api/bluetooth/utils/stitch";
4
+ import { TextCodec } from "../api/bluetooth/utils/textCodec";
5
+ import { TRANSPORT_TYPE } from "../api/bluetooth/types";
6
+ import { of } from "rxjs";
7
+ import { toArray } from "rxjs/operators";
8
+ describe("Bluetooth Utils", () => {
9
+ describe("create6DigitPin", () => {
10
+ it("should create a 6-digit pin", () => {
11
+ const pin = create6DigitPin();
12
+ expect(pin.toString()).toMatch(/^\d{6}$/);
13
+ });
14
+ });
15
+ describe("decodeJSONChunks", () => {
16
+ let textCodec;
17
+ let addLog;
18
+ beforeEach(() => {
19
+ textCodec = new TextCodec(TRANSPORT_TYPE.WEB);
20
+ addLog = jest.fn();
21
+ });
22
+ it("should decode complete JSON chunks", (done) => {
23
+ const chunks = [
24
+ new Uint8Array(textCodec.encode('{"id":1,"name":"test"}\n')),
25
+ new Uint8Array(textCodec.encode('{"id":2,"name":"test2"}\n'))
26
+ ];
27
+ of(...chunks)
28
+ .pipe(decodeJSONChunks({
29
+ textCodec,
30
+ characteristicName: "test",
31
+ delimiter: "\n",
32
+ addLog
33
+ }), toArray())
34
+ .subscribe((result) => {
35
+ expect(result).toEqual([
36
+ { id: 1, name: "test" },
37
+ { id: 2, name: "test2" }
38
+ ]);
39
+ done();
40
+ });
41
+ });
42
+ it("should handle invalid JSON", (done) => {
43
+ const chunks = [
44
+ new Uint8Array(textCodec.encode('{"id":1\n')),
45
+ new Uint8Array(textCodec.encode("invalid json\n"))
46
+ ];
47
+ of(...chunks)
48
+ .pipe(decodeJSONChunks({
49
+ textCodec,
50
+ characteristicName: "test",
51
+ delimiter: "\n",
52
+ addLog
53
+ }), toArray())
54
+ .subscribe((result) => {
55
+ expect(result).toEqual(['{"id":1', "invalid json"]);
56
+ done();
57
+ });
58
+ });
59
+ it("should handle empty chunks", (done) => {
60
+ const chunks = [
61
+ new Uint8Array(textCodec.encode("\n")),
62
+ new Uint8Array(textCodec.encode("\n"))
63
+ ];
64
+ of(...chunks)
65
+ .pipe(decodeJSONChunks({
66
+ textCodec,
67
+ characteristicName: "test",
68
+ delimiter: "\n",
69
+ addLog
70
+ }), toArray())
71
+ .subscribe((result) => {
72
+ expect(result).toEqual([]);
73
+ done();
74
+ });
75
+ });
76
+ it("should handle chunks without delimiters", (done) => {
77
+ const chunks = [
78
+ new Uint8Array(textCodec.encode('{"id":1}')),
79
+ new Uint8Array(textCodec.encode('{"id":2}'))
80
+ ];
81
+ of(...chunks)
82
+ .pipe(decodeJSONChunks({
83
+ textCodec,
84
+ characteristicName: "test",
85
+ delimiter: "\n",
86
+ addLog
87
+ }), toArray())
88
+ .subscribe((result) => {
89
+ expect(result).toEqual([]);
90
+ done();
91
+ });
92
+ });
93
+ it("should handle invalid JSON with custom error", (done) => {
94
+ const chunks = [
95
+ new Uint8Array(textCodec.encode('{"id":1\n')),
96
+ new Uint8Array(textCodec.encode("invalid json\n"))
97
+ ];
98
+ // Mock error without message property
99
+ const originalJSONParse = JSON.parse;
100
+ JSON.parse = jest.fn().mockImplementation(() => {
101
+ const error = Object.create(Error.prototype);
102
+ throw error;
103
+ });
104
+ of(...chunks)
105
+ .pipe(decodeJSONChunks({
106
+ textCodec,
107
+ characteristicName: "test",
108
+ delimiter: "\n",
109
+ addLog
110
+ }), toArray())
111
+ .subscribe({
112
+ next: (result) => {
113
+ expect(result).toEqual(['{"id":1', "invalid json"]);
114
+ JSON.parse = originalJSONParse;
115
+ done();
116
+ },
117
+ error: (error) => {
118
+ JSON.parse = originalJSONParse;
119
+ done(error);
120
+ }
121
+ });
122
+ });
123
+ });
124
+ describe("stitch", () => {
125
+ it("should stitch complete chunks", (done) => {
126
+ const chunks = ['{"id":1}\n', '{"id":2}\n'];
127
+ of(...chunks)
128
+ .pipe(stitchChunks({ delimiter: "\n" }), toArray())
129
+ .subscribe({
130
+ next: (result) => {
131
+ expect(result).toEqual(['{"id":1}', '{"id":2}']);
132
+ done();
133
+ },
134
+ error: (error) => {
135
+ done(error);
136
+ }
137
+ });
138
+ });
139
+ it("should stitch incomplete chunks", (done) => {
140
+ const chunks = ['{"id":', "1}\n", '{"id":2', "}\n"];
141
+ of(...chunks)
142
+ .pipe(stitchChunks({ delimiter: "\n" }), toArray())
143
+ .subscribe({
144
+ next: (result) => {
145
+ expect(result).toEqual(['{"id":1}', '{"id":2}']);
146
+ done();
147
+ },
148
+ error: (error) => {
149
+ done(error);
150
+ }
151
+ });
152
+ });
153
+ it("should handle chunks with multiple delimiters", (done) => {
154
+ const chunks = ['{"id":1}\n', '{"id":2}\n', '{"id":3}\n'];
155
+ of(...chunks)
156
+ .pipe(stitchChunks({ delimiter: "\n" }), toArray())
157
+ .subscribe({
158
+ next: (result) => {
159
+ expect(result).toEqual(['{"id":1}', '{"id":2}', '{"id":3}']);
160
+ done();
161
+ },
162
+ error: (error) => {
163
+ done(error);
164
+ }
165
+ });
166
+ });
167
+ it("should handle empty chunks", (done) => {
168
+ of()
169
+ .pipe(stitchChunks({ delimiter: "\n" }), toArray())
170
+ .subscribe({
171
+ next: (result) => {
172
+ expect(result).toEqual([]);
173
+ done();
174
+ },
175
+ error: (error) => {
176
+ done(error);
177
+ }
178
+ });
179
+ });
180
+ it("should handle chunks without delimiters", (done) => {
181
+ const chunks = ['{"id":1}', '{"id":2}'];
182
+ of(...chunks)
183
+ .pipe(stitchChunks({ delimiter: "\n" }), toArray())
184
+ .subscribe({
185
+ next: (result) => {
186
+ expect(result).toEqual([]);
187
+ done();
188
+ },
189
+ error: (error) => {
190
+ done(error);
191
+ }
192
+ });
193
+ });
194
+ it("should handle chunks ending with delimiter", (done) => {
195
+ const chunks = ['{"id":1}\n', '{"id":2}\n'];
196
+ of(...chunks)
197
+ .pipe(stitchChunks({ delimiter: "\n" }), toArray())
198
+ .subscribe({
199
+ next: (result) => {
200
+ expect(result).toEqual(['{"id":1}', '{"id":2}']);
201
+ done();
202
+ },
203
+ error: (error) => {
204
+ done(error);
205
+ }
206
+ });
207
+ });
208
+ it("should handle remainder with delimiter", (done) => {
209
+ const chunks = ['{"id":1}\n{"id', ":2}\n"];
210
+ of(...chunks)
211
+ .pipe(stitchChunks({ delimiter: "\n" }), toArray())
212
+ .subscribe({
213
+ next: (result) => {
214
+ expect(result).toEqual(['{"id":1}', '{"id:2}']);
215
+ done();
216
+ },
217
+ error: (error) => {
218
+ done(error);
219
+ }
220
+ });
221
+ });
222
+ });
223
+ describe("TextCodec", () => {
224
+ let textCodec;
225
+ beforeEach(() => {
226
+ textCodec = new TextCodec(TRANSPORT_TYPE.WEB);
227
+ });
228
+ it("should encode and decode text", () => {
229
+ const text = "Hello, World!";
230
+ const encoded = textCodec.encode(text);
231
+ const decoded = textCodec.decode(encoded);
232
+ expect(decoded).toBe(text);
233
+ });
234
+ it("should handle empty text", () => {
235
+ const text = "";
236
+ const encoded = textCodec.encode(text);
237
+ const decoded = textCodec.decode(encoded);
238
+ expect(decoded).toBe(text);
239
+ });
240
+ it("should handle special characters", () => {
241
+ const text = "Hello, 世界!";
242
+ const encoded = textCodec.encode(text);
243
+ const decoded = textCodec.decode(encoded);
244
+ expect(decoded).toBe(text);
245
+ });
246
+ it("should handle different transport types", () => {
247
+ const nativeCodec = new TextCodec(TRANSPORT_TYPE.REACT_NATIVE);
248
+ const text = "Hello, World!";
249
+ const encoded = nativeCodec.encode(text);
250
+ expect(Array.isArray(encoded)).toBe(true);
251
+ const decoded = nativeCodec.decode(Uint8Array.from(encoded));
252
+ expect(decoded).toBe(text);
253
+ });
254
+ it("should handle invalid input for decode", () => {
255
+ const invalidInput = new Uint8Array([0xff, 0xff, 0xff]);
256
+ const decoded = textCodec.decode(invalidInput);
257
+ expect(decoded).toBeDefined();
258
+ expect(typeof decoded).toBe("string");
259
+ });
260
+ it("should handle null input in decode", () => {
261
+ const emptyArray = new Uint8Array(0);
262
+ const result = textCodec.decode(emptyArray);
263
+ expect(result).toBe("");
264
+ });
265
+ it("should handle undefined input in decode", () => {
266
+ const emptyArray = new Uint8Array(0);
267
+ const result = textCodec.decode(emptyArray);
268
+ expect(result).toBe("");
269
+ });
270
+ it("should handle non-web transport type", () => {
271
+ const nodeCodec = new TextCodec("node");
272
+ const text = "Hello, World!";
273
+ const encoded = nodeCodec.encode(text);
274
+ expect(encoded).toBeDefined();
275
+ const decoded = nodeCodec.decode(encoded);
276
+ expect(decoded).toBe(text);
277
+ });
278
+ });
279
+ });
@@ -8,12 +8,12 @@ import { Epoch } from "../../types/epoch";
8
8
  import { BLUETOOTH_CONNECTION } from "./types";
9
9
  import { DeviceNicknameOrPeripheral } from "./BluetoothTransport";
10
10
  import { Peripheral } from "./react-native/types/BleManagerTypes";
11
- export declare type BluetoothTransport = WebBluetoothTransport | ReactNativeTransport;
12
- declare type IsAuthenticated = boolean;
13
- declare type ExpiresIn = number;
14
- declare type IsAuthenticatedResponse = [IsAuthenticated, ExpiresIn];
15
- declare type CreateBluetoothToken = () => Promise<string>;
16
- declare type Options = {
11
+ export type BluetoothTransport = WebBluetoothTransport | ReactNativeTransport;
12
+ type IsAuthenticated = boolean;
13
+ type ExpiresIn = number;
14
+ type IsAuthenticatedResponse = [IsAuthenticated, ExpiresIn];
15
+ type CreateBluetoothToken = () => Promise<string>;
16
+ type Options = {
17
17
  transport: BluetoothTransport;
18
18
  selectedDevice$: Observable<DeviceInfo>;
19
19
  osHasBluetoothSupport$: Observable<boolean>;
@@ -3,7 +3,7 @@ import { BLUETOOTH_CONNECTION, TRANSPORT_TYPE } from "./types";
3
3
  import { Action } from "../../types/actions";
4
4
  import { DeviceInfo, OSVersion } from "../../types/deviceInfo";
5
5
  import { Peripheral } from "./react-native/types/BleManagerTypes";
6
- export declare type DeviceNicknameOrPeripheral = string | Peripheral;
6
+ export type DeviceNicknameOrPeripheral = string | Peripheral;
7
7
  /**
8
8
  * @hidden
9
9
  */
@@ -8,21 +8,21 @@ import { Peripheral } from "./types/BleManagerTypes";
8
8
  import { NativeEventEmitter } from "./types/ReactNativeTypes";
9
9
  import { PlatformOSType } from "./types/ReactNativeTypes";
10
10
  import { DeviceInfo } from "../../../types/deviceInfo";
11
- declare type Characteristic = {
11
+ type Characteristic = {
12
12
  characteristicUUID: string;
13
13
  serviceUUID: string;
14
14
  peripheralId: string;
15
15
  };
16
- declare type CharacteristicsByName = {
16
+ type CharacteristicsByName = {
17
17
  [name: string]: Characteristic;
18
18
  };
19
- declare type Options = {
19
+ type Options = {
20
20
  BleManager: BleManager;
21
21
  bleManagerEmitter: NativeEventEmitter;
22
22
  platform: PlatformOSType;
23
23
  autoConnect?: boolean;
24
24
  };
25
- declare type BleManagerEvents = {
25
+ type BleManagerEvents = {
26
26
  stopScan$: Observable<void>;
27
27
  discoverPeripheral$: Observable<Peripheral>;
28
28
  connectPeripheral$: Observable<void>;
@@ -130,7 +130,7 @@ declare class EventEmitter {
130
130
  * The React Native implementation of the IOS RCTEventEmitter which is required when creating
131
131
  * a module that communicates with IOS
132
132
  */
133
- declare type NativeModule = {
133
+ type NativeModule = {
134
134
  /**
135
135
  * Add the provided eventType as an active listener
136
136
  * @param eventType name of the event for which we are registering listener
@@ -176,5 +176,5 @@ export declare class NativeEventEmitter extends EventEmitter {
176
176
  /**
177
177
  * @see https://reactnative.dev/docs/platform-specific-code#content
178
178
  */
179
- export declare type PlatformOSType = "ios" | "android" | "macos" | "windows" | "web" | "native";
179
+ export type PlatformOSType = "ios" | "android" | "macos" | "windows" | "web" | "native";
180
180
  export {};
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * @hidden
3
3
  */
4
- export declare type ActionOptions = {
4
+ export type ActionOptions = {
5
5
  characteristicName: string;
6
6
  action: any;
7
7
  };
8
8
  /**
9
9
  * @hidden
10
10
  */
11
- export declare type SubscribeOptions = {
11
+ export type SubscribeOptions = {
12
12
  characteristicName: string;
13
13
  manageNotifications?: boolean;
14
14
  skipJSONDecoding?: boolean;
@@ -2,7 +2,7 @@ import { TextCodec } from "./textCodec";
2
2
  /**
3
3
  * @hidden
4
4
  */
5
- declare type Options = {
5
+ type Options = {
6
6
  textCodec: TextCodec;
7
7
  characteristicName: string;
8
8
  delimiter: string;
@@ -1,4 +1,4 @@
1
- declare type StitchChunkOptions = {
1
+ type StitchChunkOptions = {
2
2
  delimiter: string;
3
3
  };
4
4
  export declare function stitchChunks({ delimiter }: StitchChunkOptions): import("rxjs").UnaryFunction<import("rxjs").Observable<string>, import("rxjs").Observable<string>>;
@@ -3,7 +3,7 @@ import { TRANSPORT_TYPE } from "../types";
3
3
  * @hidden
4
4
  * Uint8Array in Web | number[] in React Native
5
5
  */
6
- export declare type BufferLike = Uint8Array | number[];
6
+ export type BufferLike = Uint8Array | number[];
7
7
  /**
8
8
  * @hidden
9
9
  */
@@ -5,7 +5,7 @@ import { TextCodec } from "../utils/textCodec";
5
5
  import { ActionOptions, SubscribeOptions } from "../types";
6
6
  import { TRANSPORT_TYPE, BLUETOOTH_CONNECTION } from "../types";
7
7
  import { DeviceInfo } from "../../../types/deviceInfo";
8
- declare type Options = {
8
+ type Options = {
9
9
  autoConnect?: boolean;
10
10
  };
11
11
  export declare class WebBluetoothTransport implements BluetoothTransport {
@@ -1,7 +1,7 @@
1
1
  import firebase from "firebase/app";
2
2
  import { FirebaseApp } from "./FirebaseApp";
3
3
  import { SDKDependencies } from "../../types/options";
4
- declare type FirebaseDeviceOptions = {
4
+ type FirebaseDeviceOptions = {
5
5
  deviceId: string;
6
6
  firebaseApp: FirebaseApp;
7
7
  dependencies: SDKDependencies;
@@ -11,7 +11,7 @@ import { TransferDeviceOptions } from "../../utils/transferDevice";
11
11
  /**
12
12
  * @hidden
13
13
  */
14
- export declare type UserWithMetadata = User & {
14
+ export type UserWithMetadata = User & {
15
15
  selectedDevice: DeviceInfo | null;
16
16
  };
17
17
  /**
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { ReplaySubject, EMPTY } from "rxjs";
11
11
  import { fromEventPattern, firstValueFrom } from "rxjs";
12
- import { filter, shareReplay, share, switchMap } from "rxjs/operators";
12
+ import { filter, shareReplay, switchMap } from "rxjs/operators";
13
13
  import { FirebaseApp, FirebaseUser, FirebaseDevice } from "./firebase";
14
14
  import { Timesync } from "../timesync";
15
15
  import { SubscriptionManager } from "../subscriptions/SubscriptionManager";
@@ -30,7 +30,7 @@ export class CloudClient {
30
30
  this.firebaseApp = new FirebaseApp(options);
31
31
  this.firebaseUser = new FirebaseUser(this.firebaseApp);
32
32
  this._selectedDevice.next(undefined);
33
- this.status$ = heartbeatAwareStatus(this.observeNamespace("status").pipe(share())).pipe(filterInternalKeys(), shareReplay(1));
33
+ this.status$ = heartbeatAwareStatus(this.observeNamespace("status").pipe(shareReplay(1))).pipe(filterInternalKeys(), shareReplay(1));
34
34
  this.osVersion$ = this.observeNamespace("info/osVersion").pipe(shareReplay(1));
35
35
  this.firebaseUser.onAuthStateChanged().subscribe((user) => {
36
36
  this.user = user;