@whereby.com/browser-sdk 2.0.0-alpha15 → 2.0.0-alpha17

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
@@ -145,6 +145,8 @@ declare class RemoteParticipant extends RoomParticipant {
145
145
  readonly newJoiner: boolean;
146
146
  readonly streams: Stream[];
147
147
  constructor({ displayName, id, newJoiner, streams, isAudioEnabled, isVideoEnabled, }: RoomParticipantData & RemoteParticipantData);
148
+ addStream(streamId: string, state: StreamState): void;
149
+ removeStream(streamId: string): void;
148
150
  updateStreamState(streamId: string, state: StreamState): void;
149
151
  }
150
152
  declare class LocalParticipant extends RoomParticipant {
@@ -154,6 +156,13 @@ declare class LocalParticipant extends RoomParticipant {
154
156
  interface WaitingParticipant {
155
157
  id: string;
156
158
  displayName: string | null;
159
+ }
160
+ declare class Screenshare {
161
+ readonly participantId: string;
162
+ readonly id: string;
163
+ readonly hasAudioTrack: boolean;
164
+ readonly stream?: MediaStream;
165
+ constructor({ participantId, id, hasAudioTrack, stream }: Screenshare);
157
166
  }
158
167
 
159
168
  type Logger = Pick<Console, "debug" | "error" | "log" | "warn">;
@@ -204,6 +213,16 @@ type ParticipantMetadataChangedEvent = {
204
213
  participantId: string;
205
214
  displayName: string;
206
215
  };
216
+ type ScreenshareStartedEvent = {
217
+ participantId: string;
218
+ id: string;
219
+ hasAudioTrack: boolean;
220
+ stream: MediaStream;
221
+ };
222
+ type ScreenshareStoppedEvent = {
223
+ participantId: string;
224
+ id: string;
225
+ };
207
226
  type WaitingParticipantJoinedEvent = {
208
227
  participantId: string;
209
228
  displayName: string | null;
@@ -222,6 +241,8 @@ interface RoomEventsMap {
222
241
  participant_video_enabled: CustomEvent<ParticipantVideoEnabledEvent>;
223
242
  room_connection_status_changed: CustomEvent<RoomConnectionStatusChangedEvent>;
224
243
  room_joined: CustomEvent<RoomJoinedEvent>;
244
+ screenshare_started: CustomEvent<ScreenshareStartedEvent>;
245
+ screenshare_stopped: CustomEvent<ScreenshareStoppedEvent>;
225
246
  streaming_started: CustomEvent<StreamingState>;
226
247
  waiting_participant_joined: CustomEvent<WaitingParticipantJoinedEvent>;
227
248
  waiting_participant_left: CustomEvent<WaitingParticipantLeftEvent>;
@@ -236,6 +257,7 @@ declare class RoomConnection extends TypedEventTarget {
236
257
  localParticipant: LocalParticipant | null;
237
258
  roomUrl: URL;
238
259
  remoteParticipants: RemoteParticipant[];
260
+ screenshares: Screenshare[];
239
261
  readonly localMediaConstraints?: MediaStreamConstraints;
240
262
  readonly roomName: string;
241
263
  private organizationId;
@@ -274,6 +296,8 @@ declare class RoomConnection extends TypedEventTarget {
274
296
  private _handleDisconnect;
275
297
  private _handleCloudRecordingStopped;
276
298
  private _handleStreamingStopped;
299
+ private _handleScreenshareStarted;
300
+ private _handleScreenshareStopped;
277
301
  private _handleRtcEvent;
278
302
  private _handleRtcManagerCreated;
279
303
  private _handleRtcManagerDestroyed;
@@ -298,6 +322,7 @@ interface RoomConnectionState {
298
322
  localParticipant?: LocalParticipant;
299
323
  mostRecentChatMessage: ChatMessage | null;
300
324
  remoteParticipants: RemoteParticipantState[];
325
+ screenshares: Screenshare[];
301
326
  roomConnectionStatus: RoomConnectionStatus;
302
327
  streaming: StreamingState;
303
328
  waitingParticipants: WaitingParticipant[];
@@ -325,6 +350,6 @@ type RoomConnectionRef = {
325
350
  };
326
351
  declare function useRoomConnection(roomUrl: string, roomConnectionOptions: UseRoomConnectionOptions): RoomConnectionRef;
327
352
 
328
- declare const sdkVersion = "2.0.0-alpha15";
353
+ declare const sdkVersion = "2.0.0-alpha17";
329
354
 
330
355
  export { _default as VideoView, sdkVersion, useLocalMedia, useRoomConnection };