@stream-io/video-client 0.3.33 → 0.3.35

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 (55) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/index.browser.es.js +1400 -1356
  3. package/dist/index.browser.es.js.map +1 -1
  4. package/dist/index.cjs.js +1394 -1350
  5. package/dist/index.cjs.js.map +1 -1
  6. package/dist/index.es.js +1400 -1356
  7. package/dist/index.es.js.map +1 -1
  8. package/dist/src/coordinator/connection/insights.d.ts +1 -0
  9. package/dist/src/devices/devices.d.ts +0 -9
  10. package/dist/src/gen/coordinator/index.d.ts +33 -0
  11. package/dist/src/store/CallState.d.ts +1 -0
  12. package/dist/src/store/rxUtils.d.ts +3 -1
  13. package/package.json +12 -14
  14. package/src/__tests__/server-side/call-members.test.ts +1 -1
  15. package/src/__tests__/server-side/call-types.test.ts +2 -2
  16. package/src/__tests__/server-side/call.test.ts +1 -1
  17. package/src/__tests__/server-side/create-token.test.ts +1 -1
  18. package/src/__tests__/server-side/server-side-user.test.ts +1 -1
  19. package/src/coordinator/connection/client.ts +1 -1
  20. package/src/devices/ScreenShareState.ts +1 -2
  21. package/src/devices/devices.ts +51 -42
  22. package/src/gen/coordinator/index.ts +32 -0
  23. package/src/rtc/Publisher.ts +0 -1
  24. package/src/sorting/presets.ts +35 -19
  25. package/src/store/CallState.ts +35 -22
  26. package/src/store/__tests__/CallState.test.ts +9 -0
  27. package/src/store/rxUtils.ts +15 -7
  28. package/dist/src/__tests__/StreamVideoClient.test.d.ts +0 -1
  29. package/dist/src/__tests__/server-side/call-members.test.d.ts +0 -1
  30. package/dist/src/__tests__/server-side/call-types.test.d.ts +0 -1
  31. package/dist/src/__tests__/server-side/call.test.d.ts +0 -1
  32. package/dist/src/__tests__/server-side/create-token.test.d.ts +0 -1
  33. package/dist/src/__tests__/server-side/server-side-user.test.d.ts +0 -1
  34. package/dist/src/devices/__tests__/CameraManager.test.d.ts +0 -1
  35. package/dist/src/devices/__tests__/InputMediaDeviceManager.test.d.ts +0 -1
  36. package/dist/src/devices/__tests__/MicrophoneManager.test.d.ts +0 -1
  37. package/dist/src/devices/__tests__/ScreenShareManager.test.d.ts +0 -1
  38. package/dist/src/devices/__tests__/SpeakerManager.test.d.ts +0 -1
  39. package/dist/src/devices/__tests__/mocks.d.ts +0 -7
  40. package/dist/src/events/__tests__/call-permissions.test.d.ts +0 -1
  41. package/dist/src/events/__tests__/call.test.d.ts +0 -1
  42. package/dist/src/events/__tests__/mutes.test.d.ts +0 -1
  43. package/dist/src/events/__tests__/participant.test.d.ts +0 -1
  44. package/dist/src/helpers/__tests__/DynascaleManager.test.d.ts +0 -4
  45. package/dist/src/helpers/__tests__/hq-audio-sdp.d.ts +0 -1
  46. package/dist/src/helpers/__tests__/sdp-munging.test.d.ts +0 -1
  47. package/dist/src/rtc/__tests__/Publisher.test.d.ts +0 -1
  48. package/dist/src/rtc/__tests__/Subscriber.test.d.ts +0 -1
  49. package/dist/src/rtc/__tests__/mocks/webrtc.mocks.d.ts +0 -1
  50. package/dist/src/rtc/__tests__/videoLayers.test.d.ts +0 -1
  51. package/dist/src/sorting/__tests__/participant-data.d.ts +0 -2
  52. package/dist/src/sorting/__tests__/presets.test.d.ts +0 -1
  53. package/dist/src/sorting/__tests__/sorting.test.d.ts +0 -1
  54. package/dist/src/store/__tests__/CallState.test.d.ts +0 -1
  55. package/dist/version.d.ts +0 -1
@@ -1,9 +1,19 @@
1
- import { Observable, Subject, combineLatest } from 'rxjs';
1
+ import { combineLatest, Observable, Subject } from 'rxjs';
2
+
3
+ type FunctionPatch<T> = (currentValue: T) => T;
2
4
 
3
5
  /**
4
6
  * A value or a function which takes the current value and returns a new value.
5
7
  */
6
- export type Patch<T> = T | ((currentValue: T) => T);
8
+ export type Patch<T> = T | FunctionPatch<T>;
9
+
10
+ /**
11
+ * Checks if the provided update is a function patch.
12
+ *
13
+ * @param update the value to check.
14
+ */
15
+ const isFunctionPatch = <T>(update: Patch<T>): update is FunctionPatch<T> =>
16
+ typeof update === 'function';
7
17
 
8
18
  /**
9
19
  * Gets the current value of an observable, or undefined if the observable has
@@ -39,11 +49,9 @@ export const getCurrentValue = <T>(observable$: Observable<T>) => {
39
49
  * @return the updated value.
40
50
  */
41
51
  export const setCurrentValue = <T>(subject: Subject<T>, update: Patch<T>) => {
42
- const next =
43
- // TypeScript needs more context to infer the type of update
44
- typeof update === 'function' && update instanceof Function
45
- ? update(getCurrentValue(subject))
46
- : update;
52
+ const next = isFunctionPatch(update)
53
+ ? update(getCurrentValue(subject))
54
+ : update;
47
55
 
48
56
  subject.next(next);
49
57
  return next;
@@ -1 +0,0 @@
1
- import 'dotenv/config';
@@ -1 +0,0 @@
1
- import 'dotenv/config';
@@ -1 +0,0 @@
1
- import 'dotenv/config';
@@ -1 +0,0 @@
1
- import 'dotenv/config';
@@ -1 +0,0 @@
1
- import 'dotenv/config';
@@ -1 +0,0 @@
1
- import 'dotenv/config';
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- import { Call } from '../../Call';
2
- export declare const mockVideoDevices: MediaDeviceInfo[];
3
- export declare const mockAudioDevices: MediaDeviceInfo[];
4
- export declare const mockCall: () => Partial<Call>;
5
- export declare const mockAudioStream: () => MediaStream;
6
- export declare const mockVideoStream: () => MediaStream;
7
- export declare const mockScreenShareStream: (includeAudio?: boolean) => MediaStream;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- /**
2
- * @vitest-environment happy-dom
3
- */
4
- import '../../rtc/__tests__/mocks/webrtc.mocks';
@@ -1 +0,0 @@
1
- export declare const initialSdp: string;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- import './mocks/webrtc.mocks';
@@ -1 +0,0 @@
1
- import './mocks/webrtc.mocks';
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- import './mocks/webrtc.mocks';
@@ -1,2 +0,0 @@
1
- import { StreamVideoParticipant } from '../../types';
2
- export declare const participants: () => StreamVideoParticipant[];
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
package/dist/version.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const version = "0.3.33";