@snapcall/stream-ui 1.9.0 → 1.10.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/dist/types.d.ts CHANGED
@@ -60,6 +60,7 @@ interface ProducerData {
60
60
  interface PeerInfo {
61
61
  id?: PeerId;
62
62
  peerId: PeerId;
63
+ muted: boolean;
63
64
  profile: Profile;
64
65
  producersData: Array<ProducerData>;
65
66
  }
@@ -87,6 +88,8 @@ interface Config {
87
88
  streamerApi: string;
88
89
  iceServers: RTCIceServer[];
89
90
  }
91
+ type Permission = 'share_link' | 'direct_pay' | 'quick_connect' | 'virtual_background' | 'screen_sharing' | 'instant_picture' | 'request_input' | 'recording';
92
+ type Permissions = Array<Permission>;
90
93
  declare global {
91
94
  interface Window {
92
95
  webkitAudioContext: Function;
@@ -155,67 +158,71 @@ interface CustomMessage {
155
158
  }
156
159
  declare global {
157
160
  export namespace SnapCall {
158
- type SnapcallEvent<T> = CustomEvent<T>;
159
- type PeersInfoEvent = SnapcallEvent<{
161
+ export { Permissions, Permission };
162
+ export type SnapcallEvent<T> = CustomEvent<T>;
163
+ export type PeersInfoEvent = SnapcallEvent<{
160
164
  peerId: string;
165
+ plan?: string;
166
+ permissions: Permissions;
161
167
  peers: {
162
168
  peerId: string;
169
+ muted: boolean;
163
170
  displayName: string;
164
171
  profile: Profile;
165
172
  }[];
166
173
  }>;
167
- type PeerInfoEvent = SnapcallEvent<{
174
+ export type PeerInfoEvent = SnapcallEvent<{
168
175
  peerId: string;
169
176
  displayName?: string;
170
177
  profile: Profile;
171
178
  }>;
172
- type ProfileUpdateEvent = SnapcallEvent<{
179
+ export type ProfileUpdateEvent = SnapcallEvent<{
173
180
  peerId: string;
174
181
  profile: Profile;
175
182
  }>;
176
- type RequestDeviceEvent = SnapcallEvent<{
183
+ export type RequestDeviceEvent = SnapcallEvent<{
177
184
  peerId: string;
178
185
  deviceType: DeviceType;
179
186
  }>;
180
- type RequestDeviceResultEvent = SnapcallEvent<{
187
+ export type RequestDeviceResultEvent = SnapcallEvent<{
181
188
  result: {
182
189
  peerId: string;
183
190
  result: boolean;
184
191
  };
185
192
  }>;
186
- type BaseEvent = SnapcallEvent<{}>;
187
- type StreamEvent = SnapcallEvent<{
193
+ export type BaseEvent = SnapcallEvent<{}>;
194
+ export type StreamEvent = SnapcallEvent<{
188
195
  peerId: string;
189
196
  }>;
190
- type RequestResultEvent = SnapcallEvent<{
197
+ export type RequestResultEvent = SnapcallEvent<{
191
198
  success: Boolean;
192
199
  }>;
193
- type AudioDeviceEvent = SnapcallEvent<MediaDeviceInfo>;
194
- type MediaEvent = SnapcallEvent<{
200
+ export type AudioDeviceEvent = SnapcallEvent<MediaDeviceInfo>;
201
+ export type MediaEvent = SnapcallEvent<{
195
202
  peerId: string;
196
- mediaId: string;
203
+ mediaId?: string;
197
204
  deviceType: DeviceType;
198
205
  paused: boolean;
199
206
  }>;
200
- type WebcamUpdateEvent = SnapcallEvent<{
207
+ export type WebcamUpdateEvent = SnapcallEvent<{
201
208
  numberOfAvailableWebcams: number;
202
209
  }>;
203
- type CriticalErrorEvent = SnapcallEvent<{
210
+ export type CriticalErrorEvent = SnapcallEvent<{
204
211
  code: string;
205
212
  }>;
206
- type CustomMessageEvent = SnapcallEvent<{
213
+ export type CustomMessageEvent = SnapcallEvent<{
207
214
  peerId: string;
208
215
  event: {
209
216
  type: string;
210
217
  } & Record<string, any>;
211
218
  }>;
212
- type localVideoChangeEvent = SnapcallEvent<{
219
+ export type localVideoChangeEvent = SnapcallEvent<{
213
220
  camera: {
214
221
  device: MediaDeviceInfo | null;
215
222
  resolution: VideoResolution;
216
223
  };
217
224
  }>;
218
- type AgentIdentityEvent = SnapcallEvent<{
225
+ export type AgentIdentityEvent = SnapcallEvent<{
219
226
  success: boolean;
220
227
  email?: string;
221
228
  }>;
@@ -315,8 +322,8 @@ declare class StreamerClient extends StreamerEventTargetType implements AudioLev
315
322
  closeMicrophoneProducer(): Promise<void>;
316
323
  onDeviceChange(): Promise<void>;
317
324
  enableMicrophone(): Promise<void>;
318
- muteMicrophone(): Promise<void>;
319
- unMuteMicrophone(): Promise<void>;
325
+ muteMicrophone(): void;
326
+ unMuteMicrophone(): void;
320
327
  toggleMute(): Promise<{
321
328
  muted: boolean;
322
329
  }>;
@@ -392,6 +399,7 @@ declare class StreamerClient extends StreamerEventTargetType implements AudioLev
392
399
  setAudioSink(sinkId: string): Promise<void>;
393
400
  dispatchEvent(event: SnapcallEvent<keyof StreamerEventMap>): boolean;
394
401
  setConfig(config: Partial<Config>): void;
402
+ getPermissions(): Permissions;
395
403
  }
396
404
  declare const streamerClient: StreamerClient;
397
405
  interface NotificationOptions {
@@ -439,11 +447,13 @@ interface StreamUIMethods {
439
447
  terminateRoom: typeof streamerClient.terminateRoom;
440
448
  generateToken: typeof streamerClient.generateToken;
441
449
  addEventListener: typeof streamerClient.addEventListener;
450
+ removeEventListener: typeof streamerClient.removeEventListener;
442
451
  dispatchEvent: typeof streamerClient.dispatchEvent;
443
452
  getState: typeof streamerClient.getState;
444
453
  setProfile: typeof streamerClient.setProfile;
445
454
  setConfig: typeof streamerClient.setConfig;
446
455
  setLogLevel: (level: number) => void;
456
+ getPermissions: () => Permissions;
447
457
  }
448
458
  interface ControlSettings {
449
459
  available?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapcall/stream-ui",
3
- "version": "1.9.0",
3
+ "version": "1.10.1",
4
4
  "description": "",
5
5
  "source": "src/index.tsx",
6
6
  "main": "dist/stream-ui.js",
@@ -44,8 +44,8 @@
44
44
  "mediasoup-client": "^3.6.52",
45
45
  "protoo-client": "^4.0.6",
46
46
  "qrcode": "^1.5.0",
47
- "react": "^17.0.2",
48
- "react-dom": "^17.0.2",
47
+ "react": "^18.2.0",
48
+ "react-dom": "^18.2.0",
49
49
  "react-hot-toast": "^2.2.0",
50
50
  "react-i18next": "^11.18.5",
51
51
  "styled-components": "^5.3.3"
@@ -55,8 +55,8 @@
55
55
  "@parcel/transformer-typescript-types": "^2.6.2",
56
56
  "@types/protoo-client": "^4.0.1",
57
57
  "@types/qrcode": "^1.4.2",
58
- "@types/react": "^17.0.43",
59
- "@types/react-dom": "^17.0.14",
58
+ "@types/react": "^18.0.26",
59
+ "@types/react-dom": "^18.0.10",
60
60
  "@types/styled-components": "^5.1.25",
61
61
  "@types/uuid": "^8.3.4",
62
62
  "eslint": "^8.16.0",
@@ -78,8 +78,8 @@
78
78
  "mediasoup-client": "^3.6.52",
79
79
  "protoo-client": "^4.0.6",
80
80
  "qrcode": "^1.5.0",
81
- "react": "^17.0.2",
82
- "react-dom": "^17.0.2",
81
+ "react": "^18.2.0",
82
+ "react-dom": "^18.2.0",
83
83
  "react-hot-toast": "^2.2.0",
84
84
  "react-i18next": "^11.18.5",
85
85
  "styled-components": "^5.3.3",