@whereby.com/browser-sdk 1.8.1 → 2.0.0-alpha1

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.
@@ -0,0 +1,104 @@
1
+ import React from 'react';
2
+
3
+ interface WherebyEmbedAttributes {
4
+ audio: string;
5
+ avatarUrl: string;
6
+ background: string;
7
+ cameraAccess: string;
8
+ chat: string;
9
+ displayName: string;
10
+ emptyRoomInvitation: string;
11
+ floatSelf: string;
12
+ help: string;
13
+ leaveButton: string;
14
+ logo: string;
15
+ people: string;
16
+ precallReview: string;
17
+ recording: string;
18
+ screenshare: string;
19
+ video: string;
20
+ virtualBackgroundUrl: string;
21
+ room: string;
22
+ style: {
23
+ [key: string]: string;
24
+ };
25
+ }
26
+ declare global {
27
+ namespace JSX {
28
+ interface IntrinsicElements {
29
+ ["whereby-embed"]: Partial<WherebyEmbedAttributes>;
30
+ }
31
+ }
32
+ }
33
+
34
+ interface VideoElProps {
35
+ stream: MediaStream;
36
+ style?: React.CSSProperties;
37
+ }
38
+ declare const _default: ({ stream, style }: VideoElProps) => JSX.Element;
39
+
40
+ interface RoomParticipantData {
41
+ displayName: string;
42
+ id: string;
43
+ stream?: MediaStream;
44
+ isAudioEnabled: boolean;
45
+ isVideoEnabled: boolean;
46
+ }
47
+ declare class RoomParticipant {
48
+ readonly displayName: string;
49
+ readonly id: string;
50
+ readonly stream?: MediaStream;
51
+ readonly isAudioEnabled: boolean;
52
+ readonly isLocalParticipant: boolean;
53
+ readonly isVideoEnabled: boolean;
54
+ constructor({ displayName, id, stream, isAudioEnabled, isVideoEnabled }: RoomParticipantData);
55
+ }
56
+ interface RemoteParticipantData {
57
+ newJoiner: boolean;
58
+ streams: string[];
59
+ }
60
+ type StreamState = "new_accept" | "to_accept" | "old_accept" | "done_accept" | "to_unaccept" | "done_unaccept" | "auto";
61
+ interface Stream {
62
+ id: string;
63
+ state: StreamState;
64
+ }
65
+ declare class RemoteParticipant extends RoomParticipant {
66
+ readonly newJoiner: boolean;
67
+ readonly streams: Stream[];
68
+ constructor({ displayName, id, newJoiner, streams, isAudioEnabled, isVideoEnabled, }: RoomParticipantData & RemoteParticipantData);
69
+ updateStreamState(streamId: string, state: StreamState): void;
70
+ }
71
+ declare class LocalParticipant extends RoomParticipant {
72
+ readonly isLocalParticipant = true;
73
+ constructor({ displayName, id, stream, isAudioEnabled, isVideoEnabled }: RoomParticipantData);
74
+ }
75
+
76
+ type Logger = Pick<Console, "debug" | "error" | "log" | "warn">;
77
+ interface RoomConnectionOptions {
78
+ displayName?: string;
79
+ localStream?: MediaStream;
80
+ localMediaConstraints?: MediaStreamConstraints;
81
+ roomKey?: string;
82
+ logger?: Logger;
83
+ }
84
+
85
+ type RemoteParticipantState = Omit<RemoteParticipant, "updateStreamState">;
86
+ interface RoomState {
87
+ localParticipant?: LocalParticipant;
88
+ roomConnectionStatus?: "connecting" | "connected" | "disconnected";
89
+ remoteParticipants: RemoteParticipantState[];
90
+ }
91
+
92
+ interface RoomConnectionActions {
93
+ toggleCamera(enabled?: boolean): void;
94
+ toggleMicrophone(enabled?: boolean): void;
95
+ setDisplayName(displayName: string): void;
96
+ }
97
+ interface RoomConnectionComponents {
98
+ VideoView: typeof _default;
99
+ }
100
+ declare function useRoomConnection(roomUrl: string, roomConnectionOptions: RoomConnectionOptions): [state: RoomState, actions: RoomConnectionActions, components: RoomConnectionComponents];
101
+
102
+ declare const sdkVersion = "2.0.0-alpha1";
103
+
104
+ export { sdkVersion, useRoomConnection };