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

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
@@ -35,10 +35,16 @@ declare global {
35
35
 
36
36
  interface VideoViewSelfProps {
37
37
  stream: MediaStream;
38
+ muted?: boolean;
38
39
  style?: React.CSSProperties;
40
+ onResize?: ({ width, height, stream }: {
41
+ width: number;
42
+ height: number;
43
+ stream: MediaStream;
44
+ }) => void;
39
45
  }
40
46
  type VideoViewProps = VideoViewSelfProps & React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
41
- declare const _default: ({ muted, stream, ...rest }: VideoViewProps) => JSX.Element;
47
+ declare const _default: ({ muted, stream, onResize, ...rest }: VideoViewProps) => JSX.Element;
42
48
 
43
49
  type CameraEnabledEvent = {
44
50
  enabled: boolean;
@@ -231,25 +237,29 @@ type WaitingParticipantLeftEvent = {
231
237
  participantId: string;
232
238
  };
233
239
  interface RoomEventsMap {
234
- chat_message: CustomEvent<ChatMessage>;
235
- cloud_recording_started: CustomEvent<CloudRecordingState>;
236
- participant_audio_enabled: CustomEvent<ParticipantAudioEnabledEvent>;
237
- participant_joined: CustomEvent<ParticipantJoinedEvent>;
238
- participant_left: CustomEvent<ParticipantLeftEvent>;
239
- participant_metadata_changed: CustomEvent<ParticipantMetadataChangedEvent>;
240
- participant_stream_added: CustomEvent<ParticipantStreamAddedEvent>;
241
- participant_video_enabled: CustomEvent<ParticipantVideoEnabledEvent>;
242
- room_connection_status_changed: CustomEvent<RoomConnectionStatusChangedEvent>;
243
- room_joined: CustomEvent<RoomJoinedEvent>;
244
- screenshare_started: CustomEvent<ScreenshareStartedEvent>;
245
- screenshare_stopped: CustomEvent<ScreenshareStoppedEvent>;
246
- streaming_started: CustomEvent<StreamingState>;
247
- waiting_participant_joined: CustomEvent<WaitingParticipantJoinedEvent>;
248
- waiting_participant_left: CustomEvent<WaitingParticipantLeftEvent>;
240
+ chat_message: (e: CustomEvent<ChatMessage>) => void;
241
+ cloud_recording_started: (e: CustomEvent<CloudRecordingState>) => void;
242
+ cloud_recording_stopped: (e: CustomEvent<CloudRecordingState>) => void;
243
+ participant_audio_enabled: (e: CustomEvent<ParticipantAudioEnabledEvent>) => void;
244
+ participant_joined: (e: CustomEvent<ParticipantJoinedEvent>) => void;
245
+ participant_left: (e: CustomEvent<ParticipantLeftEvent>) => void;
246
+ participant_metadata_changed: (e: CustomEvent<ParticipantMetadataChangedEvent>) => void;
247
+ participant_stream_added: (e: CustomEvent<ParticipantStreamAddedEvent>) => void;
248
+ participant_video_enabled: (e: CustomEvent<ParticipantVideoEnabledEvent>) => void;
249
+ room_connection_status_changed: (e: CustomEvent<RoomConnectionStatusChangedEvent>) => void;
250
+ room_joined: (e: CustomEvent<RoomJoinedEvent>) => void;
251
+ screenshare_started: (e: CustomEvent<ScreenshareStartedEvent>) => void;
252
+ screenshare_stopped: (e: CustomEvent<ScreenshareStoppedEvent>) => void;
253
+ streaming_started: (e: CustomEvent<StreamingState>) => void;
254
+ streaming_stopped: (e: CustomEvent<StreamingState>) => void;
255
+ waiting_participant_joined: (e: CustomEvent<WaitingParticipantJoinedEvent>) => void;
256
+ waiting_participant_left: (e: CustomEvent<WaitingParticipantLeftEvent>) => void;
249
257
  }
250
258
  interface RoomEventTarget extends EventTarget {
251
- addEventListener<K extends keyof RoomEventsMap>(type: K, listener: (ev: RoomEventsMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
259
+ addEventListener<K extends keyof RoomEventsMap>(type: K, listener: RoomEventsMap[K], options?: boolean | AddEventListenerOptions): void;
252
260
  addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void;
261
+ removeEventListener<K extends keyof RoomEventsMap>(type: K, listener: RoomEventsMap[K], options?: boolean | EventListenerOptions): void;
262
+ removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void;
253
263
  }
254
264
  declare const TypedEventTarget: new () => RoomEventTarget;
255
265
  declare class RoomConnection extends TypedEventTarget {
@@ -311,6 +321,11 @@ declare class RoomConnection extends TypedEventTarget {
311
321
  setDisplayName(displayName: string): void;
312
322
  acceptWaitingParticipant(participantId: string): void;
313
323
  rejectWaitingParticipant(participantId: string): void;
324
+ updateStreamResolution({ streamId, width, height }: {
325
+ streamId?: string;
326
+ width: number;
327
+ height: number;
328
+ }): void;
314
329
  }
315
330
 
316
331
  type RemoteParticipantState = Omit<RemoteParticipant, "updateStreamState">;
@@ -339,8 +354,9 @@ interface RoomConnectionActions {
339
354
  acceptWaitingParticipant(participantId: string): void;
340
355
  rejectWaitingParticipant(participantId: string): void;
341
356
  }
357
+ type VideoViewComponentProps = Omit<React.ComponentProps<typeof _default>, "onResize">;
342
358
  interface RoomConnectionComponents {
343
- VideoView: typeof _default;
359
+ VideoView: (props: VideoViewComponentProps) => ReturnType<typeof _default>;
344
360
  }
345
361
  type RoomConnectionRef = {
346
362
  state: RoomConnectionState;
@@ -350,6 +366,6 @@ type RoomConnectionRef = {
350
366
  };
351
367
  declare function useRoomConnection(roomUrl: string, roomConnectionOptions: UseRoomConnectionOptions): RoomConnectionRef;
352
368
 
353
- declare const sdkVersion = "2.0.0-alpha17";
369
+ declare const sdkVersion = "2.0.0-alpha19";
354
370
 
355
371
  export { _default as VideoView, sdkVersion, useLocalMedia, useRoomConnection };