@whereby.com/browser-sdk 2.0.0 → 2.1.0-beta.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.
@@ -1,833 +0,0 @@
1
- import * as React from 'react';
2
- import React__default from 'react';
3
- import _whereby_jslib_media_src_utils_ServerSocket, { ChatMessage as ChatMessage$2 } from '@whereby/jslib-media/src/utils/ServerSocket';
4
- import * as redux_thunk from 'redux-thunk';
5
- import { AxiosRequestConfig } from 'axios';
6
- import EventEmitter from 'events';
7
- import * as _reduxjs_toolkit from '@reduxjs/toolkit';
8
- import * as redux from 'redux';
9
- import RtcManagerDispatcher from '@whereby/jslib-media/src/webrtc/RtcManagerDispatcher';
10
- import RtcManager from '@whereby/jslib-media/src/webrtc/RtcManager';
11
-
12
- interface VideoViewSelfProps {
13
- stream: MediaStream;
14
- muted?: boolean;
15
- mirror?: boolean;
16
- style?: React__default.CSSProperties;
17
- onResize?: ({ width, height, stream }: {
18
- width: number;
19
- height: number;
20
- stream: MediaStream;
21
- }) => void;
22
- }
23
- type VideoViewProps = VideoViewSelfProps & React__default.DetailedHTMLProps<React__default.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
24
- declare const _default: ({ muted, mirror, stream, onResize, ...rest }: VideoViewProps) => React__default.JSX.Element;
25
-
26
- interface RoomParticipantData {
27
- displayName: string;
28
- id: string;
29
- stream?: MediaStream;
30
- isAudioEnabled: boolean;
31
- isVideoEnabled: boolean;
32
- }
33
- declare class RoomParticipant {
34
- readonly displayName: string;
35
- readonly id: string;
36
- readonly stream?: MediaStream;
37
- readonly isAudioEnabled: boolean;
38
- readonly isLocalParticipant: boolean;
39
- readonly isVideoEnabled: boolean;
40
- constructor({ displayName, id, stream, isAudioEnabled, isVideoEnabled }: RoomParticipantData);
41
- }
42
- type StreamState = "new_accept" | "to_accept" | "old_accept" | "done_accept" | "to_unaccept" | "done_unaccept" | "auto";
43
- interface Stream {
44
- id: string;
45
- state: StreamState;
46
- }
47
- interface RemoteParticipant {
48
- id: string;
49
- displayName: string;
50
- isAudioEnabled: boolean;
51
- isVideoEnabled: boolean;
52
- isLocalParticipant: boolean;
53
- stream: (MediaStream & {
54
- inboundId?: string;
55
- }) | null;
56
- streams: Stream[];
57
- newJoiner: boolean;
58
- presentationStream: (MediaStream & {
59
- inboundId?: string;
60
- }) | null;
61
- }
62
- declare class LocalParticipant extends RoomParticipant {
63
- readonly isLocalParticipant = true;
64
- constructor({ displayName, id, stream, isAudioEnabled, isVideoEnabled }: RoomParticipantData);
65
- }
66
- interface WaitingParticipant {
67
- id: string;
68
- displayName: string | null;
69
- }
70
- interface Screenshare {
71
- participantId: string;
72
- id: string;
73
- hasAudioTrack: boolean;
74
- stream?: MediaStream;
75
- isLocal: boolean;
76
- }
77
-
78
- type Json = string | number | boolean | null | Array<Json> | {
79
- [key: string]: Json;
80
- };
81
- interface ResponseOptions {
82
- data?: Json;
83
- headers?: Record<string, unknown>;
84
- status?: number;
85
- statusText?: string;
86
- url?: string | null;
87
- }
88
- declare class Response {
89
- data: Json;
90
- headers: Record<string, unknown>;
91
- status: number;
92
- statusText: string;
93
- url: string | null;
94
- constructor(initialValues?: ResponseOptions);
95
- }
96
-
97
- declare class EmbeddedFreeTierStatus {
98
- isExhausted: boolean;
99
- renewsAt: Date;
100
- totalMinutesLimit: number;
101
- totalMinutesUsed: number;
102
- constructor({ isExhausted, renewsAt, totalMinutesLimit, totalMinutesUsed, }: {
103
- isExhausted: boolean;
104
- renewsAt: Date;
105
- totalMinutesLimit: number;
106
- totalMinutesUsed: number;
107
- });
108
- static fromJson(data: Record<string, unknown>): EmbeddedFreeTierStatus;
109
- }
110
-
111
- interface AccountProps {
112
- basePlanId: string | null;
113
- isDeactivated: boolean;
114
- isOnTrial: boolean;
115
- onTrialUntil: Date | null;
116
- trialStatus: string | null;
117
- embeddedFreeTierStatus: EmbeddedFreeTierStatus | null;
118
- }
119
- declare class Account {
120
- basePlanId: string | null;
121
- embeddedFreeTierStatus: EmbeddedFreeTierStatus | null;
122
- isDeactivated: boolean;
123
- isOnTrial: boolean;
124
- onTrialUntil: Date | null;
125
- trialStatus: string | null;
126
- constructor({ basePlanId, embeddedFreeTierStatus, isDeactivated, isOnTrial, onTrialUntil, trialStatus, }: AccountProps);
127
- static fromJson(data: Record<string, unknown>): Account;
128
- }
129
-
130
- interface OrganizationPermissionAction {
131
- isAllowed: boolean;
132
- isSupported: boolean;
133
- }
134
- interface FullOrganizationPermissions {
135
- images: {
136
- logoImageUrl: {
137
- set: OrganizationPermissionAction;
138
- reset: OrganizationPermissionAction;
139
- };
140
- roomBackgroundImageUrl: {
141
- set: OrganizationPermissionAction;
142
- reset: OrganizationPermissionAction;
143
- };
144
- roomKnockPageBackgroundImageUrl: {
145
- set: OrganizationPermissionAction;
146
- reset: OrganizationPermissionAction;
147
- };
148
- };
149
- invitations: {
150
- add: OrganizationPermissionAction;
151
- delete: OrganizationPermissionAction;
152
- list: OrganizationPermissionAction;
153
- };
154
- roles: {
155
- set: OrganizationPermissionAction;
156
- remove: OrganizationPermissionAction;
157
- removeSelf: OrganizationPermissionAction;
158
- list: OrganizationPermissionAction;
159
- };
160
- users: {
161
- signUpWithoutInvitation: OrganizationPermissionAction;
162
- };
163
- rooms: {
164
- customize: OrganizationPermissionAction;
165
- customizeSelf: OrganizationPermissionAction;
166
- list: OrganizationPermissionAction;
167
- lock: OrganizationPermissionAction;
168
- unclaim: OrganizationPermissionAction;
169
- unclaimSelf: OrganizationPermissionAction;
170
- };
171
- subscriptions: {
172
- add: OrganizationPermissionAction;
173
- list: OrganizationPermissionAction;
174
- payLatestInvoice: OrganizationPermissionAction;
175
- updatePlan: OrganizationPermissionAction;
176
- };
177
- browserExtension: {
178
- install: OrganizationPermissionAction;
179
- };
180
- }
181
- type OrganizationPermissions = Partial<FullOrganizationPermissions>;
182
- interface OrganizationLimits {
183
- maxNumberOfInvitationsAndUsers: number | null;
184
- maxNumberOfClaimedRooms: number | null;
185
- maxRoomLimitPerOrganization: number | null;
186
- trialMinutesLimit: number | null;
187
- includedUnits: number | null;
188
- }
189
- interface OrganizationOnboardingSurvey {
190
- name: string;
191
- value: unknown;
192
- }
193
- type OrganizationPreferences = Record<string, boolean | string | null | number>;
194
- declare class Organization {
195
- static GLOBAL_ORGANIZATION_ID: string;
196
- organizationId: string;
197
- organizationName: string;
198
- subdomain: string;
199
- permissions: OrganizationPermissions;
200
- limits: OrganizationLimits;
201
- account: Account | null;
202
- logoImageUrl: string | null;
203
- roomBackgroundImageUrl: string | null;
204
- roomBackgroundThumbnailUrl: string | null;
205
- roomKnockPageBackgroundImageUrl: string | null;
206
- roomKnockPageBackgroundThumbnailUrl: string | null;
207
- preferences: OrganizationPreferences | null;
208
- onboardingSurvey: OrganizationOnboardingSurvey | null;
209
- type: string | null;
210
- constructor(properties: {
211
- account: Account | null;
212
- organizationId: string;
213
- organizationName: string;
214
- subdomain: string;
215
- permissions: OrganizationPermissions;
216
- limits: OrganizationLimits;
217
- logoImageUrl: string | null;
218
- roomBackgroundImageUrl: string | null;
219
- roomBackgroundThumbnailUrl: string | null;
220
- roomKnockPageBackgroundImageUrl: string | null;
221
- roomKnockPageBackgroundThumbnailUrl: string | null;
222
- preferences: OrganizationPreferences | null;
223
- onboardingSurvey: OrganizationOnboardingSurvey | null;
224
- type: string | null;
225
- });
226
- static fromJson(data: Json): Organization;
227
- }
228
-
229
- type HttpClientRequestConfig = AxiosRequestConfig | {
230
- [key: string]: unknown;
231
- };
232
- interface IHttpClient {
233
- request(url: string, options: HttpClientRequestConfig): Promise<Response>;
234
- }
235
- /**
236
- * Class used for making http calls. This is just a pure
237
- * wrapper around the http lib that we decide to use,
238
- * so that we can switch implementations.
239
- */
240
- declare class HttpClient implements IHttpClient {
241
- _baseUrl: string;
242
- /**
243
- * Creates an HttpClient instance.
244
- *
245
- * @param {string} [baseUrl] - The base URL where all requests are made.
246
- */
247
- constructor({ baseUrl }: {
248
- baseUrl: string;
249
- });
250
- private _requestAxios;
251
- /**
252
- * Wrapper for the axios API
253
- *
254
- * @param {string} url - Required. URL (appended to base URL) where API call will be made
255
- * @param {object} options - Required. Contains the data needed for the fetch API
256
- * @return {Promise<Response>} - A promise which will return a Response object (https://developer.mozilla.org/en-US/docs/Web/API/Response)
257
- */
258
- request(url: string, options: HttpClientRequestConfig): Promise<Response>;
259
- }
260
-
261
- /**
262
- * ApiClient for doing multipart/form-data requests.
263
- */
264
- declare class MultipartHttpClient implements IHttpClient {
265
- _httpClient: IHttpClient;
266
- constructor({ httpClient }: {
267
- httpClient: IHttpClient;
268
- });
269
- /**
270
- * Convert the provided object to a FormData object containing the same keys and values.
271
- * @param {object} data - the data to convert.
272
- * @returns {FormData}
273
- */
274
- static dataToFormData(data: Record<string, string>): FormData;
275
- /**
276
- * Request a resource using multipart/form-data encoding.
277
- *
278
- * @param {string} url - the url to request
279
- * @param {object} options - Required. Contains the data needed for the fetch API
280
- * @return {Promise<Response>} - A promise which will return a Response object (https://developer.mozilla.org/en-US/docs/Web/API/Response)
281
- */
282
- request(url: string, options?: HttpClientRequestConfig): Promise<Response>;
283
- }
284
-
285
- interface CredentialsOptions {
286
- uuid: string;
287
- hmac: string;
288
- userId?: string;
289
- }
290
- declare class Credentials {
291
- credentials: {
292
- uuid: CredentialsOptions["uuid"];
293
- };
294
- hmac: CredentialsOptions["hmac"];
295
- userId: CredentialsOptions["userId"];
296
- constructor(uuid: CredentialsOptions["uuid"], hmac: CredentialsOptions["hmac"], userId?: CredentialsOptions["userId"]);
297
- toJson(): Json;
298
- static fromJson(json: Json): Credentials;
299
- }
300
-
301
- interface AuthenticatedHttpClientOptions {
302
- httpClient: HttpClient;
303
- fetchDeviceCredentials: () => Promise<Credentials | null>;
304
- }
305
- declare class AuthenticatedHttpClient {
306
- private _httpClient;
307
- private _fetchDeviceCredentials;
308
- constructor({ httpClient, fetchDeviceCredentials }: AuthenticatedHttpClientOptions);
309
- request(url: string, options: HttpClientRequestConfig): Promise<Response>;
310
- }
311
- interface ApiClientOptions {
312
- baseUrl?: string;
313
- fetchDeviceCredentials?: AuthenticatedHttpClientOptions["fetchDeviceCredentials"];
314
- }
315
- /**
316
- * Class used for all Whereby API calls.
317
- */
318
- declare class ApiClient {
319
- authenticatedHttpClient: AuthenticatedHttpClient;
320
- authenticatedFormDataHttpClient: MultipartHttpClient;
321
- /**
322
- * Create an ApiClient instance.
323
- */
324
- constructor({ baseUrl, fetchDeviceCredentials, }?: ApiClientOptions);
325
- /**
326
- * Wrapper for the fetch API
327
- */
328
- request(url: string, options: HttpClientRequestConfig): Promise<Response>;
329
- /**
330
- * Performs a multipart request where data is multipart/form-data encoded.
331
- */
332
- requestMultipart(url: string, options: HttpClientRequestConfig): Promise<Response>;
333
- }
334
-
335
- /**
336
- * Related to device calls needed to obtain credentials
337
- */
338
- declare class DeviceService {
339
- _apiClient: ApiClient;
340
- constructor({ apiClient }: {
341
- apiClient: ApiClient;
342
- });
343
- /**
344
- * Get's the device credentials needed for most of the other API services
345
- *
346
- * @return {Promise} A promise which is fulfilled or failed based on the
347
- * response.
348
- */
349
- getCredentials(): Promise<Credentials | null>;
350
- }
351
-
352
- interface AbstractStore {
353
- loadOrDefault(defaultValue: Json): Promise<Json>;
354
- save(value: Json): Promise<void>;
355
- }
356
-
357
- declare class CredentialsService extends EventEmitter {
358
- _deviceService: DeviceService;
359
- _credentialsStore: AbstractStore;
360
- credentialsPromise?: Promise<Credentials | null>;
361
- /**
362
- * Service to manage Whereby's Rest API credentials.
363
- *
364
- * @param {ObjectStore} credentialsStore - Store to manage the credentials.
365
- */
366
- constructor({ deviceService, credentialsStore, }: {
367
- deviceService: DeviceService;
368
- credentialsStore: AbstractStore;
369
- });
370
- static create({ baseUrl, storeName, storeType, }: {
371
- baseUrl: string;
372
- storeName?: string;
373
- storeType?: "localStorage" | "chromeStorage";
374
- }): CredentialsService;
375
- /**
376
- * Contacts the REST API to get new credentials. DO NOT USE directly, call getCredentials() instead.
377
- *
378
- * @see getCredentials
379
- * @returns {Promise.<Credentials>} - Promise that resolves with the credentials.
380
- */
381
- _fetchNewCredentialsFromApi(): Promise<Credentials | null>;
382
- /**
383
- * Returns the current credentials without triggering an API request to get new ones.
384
- * If no credentials are currently available it will return null.
385
- *
386
- * @returns {?Credentials} - The credentials currently in use, null otherwise.
387
- */
388
- getCurrentCredentials(): Promise<Credentials | null>;
389
- /**
390
- * Returns a promise that will contain the credentials for this client.
391
- * If no credentials are available in local storage, new ones will be fetched from the server.
392
- *
393
- * @returns {Promise.<Credentials>} - Promise that resolves with the credentials.
394
- */
395
- getCredentials(): Promise<Credentials | null>;
396
- /**
397
- * Saves new credentials which replace the existing ones and abort any pending request to get new ones.
398
- *
399
- * @param {Credentials} credentials - New credentials to store.
400
- */
401
- saveCredentials(credentials: Credentials): Promise<Credentials>;
402
- /**
403
- * It will set the userId for the current credentials.
404
- *
405
- * @param userId - The user id to set.
406
- */
407
- setUserId(userId: string | null): Promise<void>;
408
- }
409
-
410
- type UserConsentAction = "accepted" | "rejected" | null;
411
- type ConsentGrantRequest = {
412
- readonly consentRevisionId: string;
413
- readonly action: UserConsentAction;
414
- };
415
-
416
- declare class OrganizationService {
417
- _apiClient: ApiClient;
418
- constructor({ apiClient }: {
419
- apiClient: ApiClient;
420
- });
421
- /**
422
- * Creates an organization.
423
- */
424
- createOrganization({ organizationName, subdomain, owner, }: {
425
- organizationName: string;
426
- subdomain: string;
427
- owner: {
428
- email: string;
429
- displayName: string;
430
- verificationCode: string;
431
- consents?: ReadonlyArray<ConsentGrantRequest>;
432
- } | {
433
- idToken: string;
434
- displayName: string;
435
- consents?: ReadonlyArray<ConsentGrantRequest>;
436
- };
437
- }): Promise<string>;
438
- /**
439
- * Retrieves the organization based on the subdomain.
440
- */
441
- getOrganizationBySubdomain(subdomain: string): Promise<Organization | null>;
442
- /**
443
- * Retrieves the organization based on the organizationId.
444
- *
445
- * Note: This endpoint should only be used to retrieve an organization when the device is linked
446
- * to a user in that organization. Use getOrganizationBySubdomain instead if you just want the information
447
- * about an organization that is mapped to a given subdomain.
448
- */
449
- getOrganizationByOrganizationId(organizationId: string): Promise<Organization | null>;
450
- /**
451
- * Retrieves the organizations that contain a user
452
- * matching provided the email+code or phoneNumber+code
453
- * combination.
454
- */
455
- getOrganizationsByContactPoint(options: {
456
- email: string;
457
- code: string;
458
- } | {
459
- phoneNumber: string;
460
- code: string;
461
- }): Promise<ReadonlyArray<Organization>>;
462
- /**
463
- * Retrieves the organizations that contain a user
464
- * matching provided the idToken
465
- */
466
- getOrganizationsByIdToken({ idToken }: {
467
- idToken: string;
468
- }): Promise<ReadonlyArray<Organization>>;
469
- /**
470
- * Retrieves the organizations containing a user
471
- * with either the email or phoneNumber matching the logged in user.
472
- *
473
- * This is useful for showing the possible organization that the current
474
- * user could log in to.
475
- */
476
- getOrganizationsByLoggedInUser(): Promise<ReadonlyArray<Organization>>;
477
- /**
478
- * Checks if a subdomain is available and verifies its format.
479
- */
480
- getSubdomainAvailability(subdomain: string): Promise<{
481
- status: string;
482
- }>;
483
- /**
484
- * Updates preferences of the organization.
485
- */
486
- updatePreferences({ organizationId, preferences, }: {
487
- organizationId: string;
488
- preferences: OrganizationPreferences;
489
- }): Promise<undefined>;
490
- /**
491
- * Delete organization
492
- */
493
- deleteOrganization({ organizationId }: {
494
- organizationId: string;
495
- }): Promise<undefined>;
496
- }
497
-
498
- /**
499
- * Reducer
500
- */
501
- interface StreamingState {
502
- isStreaming: boolean;
503
- error: unknown;
504
- startedAt?: number;
505
- }
506
-
507
- /**
508
- * Reducer
509
- */
510
- interface rtcAnalyticsState {
511
- reportedValues: {
512
- [key: string]: unknown;
513
- };
514
- }
515
-
516
- interface LocalScreenshareState {
517
- status: "" | "starting" | "active";
518
- stream: MediaStream | null;
519
- error: unknown | null;
520
- }
521
-
522
- interface LocalParticipantState$1 extends LocalParticipantState {
523
- isScreenSharing: boolean;
524
- roleName: string;
525
- }
526
-
527
- /**
528
- * Reducer
529
- */
530
- interface CloudRecordingState$1 {
531
- isRecording: boolean;
532
- error: unknown;
533
- status?: "recording" | "requested" | "error";
534
- startedAt?: number;
535
- }
536
-
537
- type ChatMessage$1 = Pick<ChatMessage$2, "senderId" | "timestamp" | "text">;
538
- /**
539
- * Reducer
540
- */
541
- interface ChatState {
542
- chatMessages: ChatMessage$1[];
543
- }
544
-
545
- /**
546
- * Reducer
547
- */
548
- interface AppState {
549
- wantsToJoin: boolean;
550
- roomUrl: string | null;
551
- roomName: string | null;
552
- roomKey: string | null;
553
- displayName: string | null;
554
- sdkVersion: string | null;
555
- externalId: string | null;
556
- }
557
-
558
- /**
559
- * Reducer
560
- */
561
- interface DeviceCredentialsState {
562
- isFetching: boolean;
563
- data?: Credentials | null;
564
- }
565
-
566
- /**
567
- * Reducer
568
- */
569
- interface OrganizationState {
570
- data: Organization | null | undefined;
571
- isFetching: boolean;
572
- error: unknown;
573
- }
574
-
575
- /**
576
- * Reducer
577
- */
578
- interface RemoteParticipantState$1 {
579
- remoteParticipants: RemoteParticipant[];
580
- }
581
-
582
- type ConnectionStatus$1 = "initializing" | "connecting" | "connected" | "reconnect" | "room_locked" | "knocking" | "disconnecting" | "disconnected" | "knock_rejected";
583
- /**
584
- * Reducer
585
- */
586
- interface RoomConnectionState$1 {
587
- session: {
588
- createdAt: string;
589
- id: string;
590
- } | null;
591
- status: ConnectionStatus$1;
592
- error: unknown;
593
- }
594
-
595
- /**
596
- * Reducer
597
- */
598
- interface StreamResolutionUpdate {
599
- streamId: string;
600
- width: number;
601
- height: number;
602
- }
603
- interface RtcConnectionState {
604
- dispatcherCreated: boolean;
605
- error: unknown;
606
- isCreatingDispatcher: boolean;
607
- reportedStreamResolutions: {
608
- [streamId: string]: Omit<StreamResolutionUpdate, "streamId">;
609
- };
610
- rtcManager: RtcManager | null;
611
- rtcManagerDispatcher: RtcManagerDispatcher | null;
612
- rtcManagerInitialized: boolean;
613
- status: "" | "ready" | "reconnect";
614
- isAcceptingStreams: boolean;
615
- }
616
-
617
- /**
618
- * Reducer
619
- */
620
- interface SignalConnectionState {
621
- deviceIdentified: boolean;
622
- isIdentifyingDevice: boolean;
623
- status: "connected" | "connecting" | "disconnected" | "reconnect" | "";
624
- socket: _whereby_jslib_media_src_utils_ServerSocket | null;
625
- }
626
-
627
- declare function createServices(): {
628
- credentialsService: CredentialsService;
629
- apiClient: ApiClient;
630
- organizationService: OrganizationService;
631
- fetchOrganizationFromRoomUrl: (roomUrl: string) => Promise<Organization | null>;
632
- };
633
-
634
- declare const createStore: ({ preloadedState, injectServices, }: {
635
- preloadedState?: Partial<{
636
- app: AppState;
637
- chat: ChatState;
638
- cloudRecording: CloudRecordingState$1;
639
- deviceCredentials: DeviceCredentialsState;
640
- localMedia: LocalMediaState$1;
641
- localParticipant: LocalParticipantState$1;
642
- localScreenshare: LocalScreenshareState;
643
- organization: OrganizationState;
644
- remoteParticipants: RemoteParticipantState$1;
645
- roomConnection: RoomConnectionState$1;
646
- rtcAnalytics: rtcAnalyticsState;
647
- rtcConnection: RtcConnectionState;
648
- signalConnection: SignalConnectionState;
649
- streaming: StreamingState;
650
- waitingParticipants: WaitingParticipantsState;
651
- }> | undefined;
652
- injectServices: ReturnType<typeof createServices>;
653
- }) => _reduxjs_toolkit.EnhancedStore<{
654
- app: AppState;
655
- chat: ChatState;
656
- cloudRecording: CloudRecordingState$1;
657
- deviceCredentials: DeviceCredentialsState;
658
- localMedia: LocalMediaState$1;
659
- localParticipant: LocalParticipantState$1;
660
- localScreenshare: LocalScreenshareState;
661
- organization: OrganizationState;
662
- remoteParticipants: RemoteParticipantState$1;
663
- roomConnection: RoomConnectionState$1;
664
- rtcAnalytics: rtcAnalyticsState;
665
- rtcConnection: RtcConnectionState;
666
- signalConnection: SignalConnectionState;
667
- streaming: StreamingState;
668
- waitingParticipants: WaitingParticipantsState;
669
- }, redux.UnknownAction, _reduxjs_toolkit.Tuple<[redux.StoreEnhancer<{
670
- dispatch: ((action: redux.Action<"listenerMiddleware/add">) => _reduxjs_toolkit.UnsubscribeListener) & redux_thunk.ThunkDispatch<{
671
- app: AppState;
672
- chat: ChatState;
673
- cloudRecording: CloudRecordingState$1;
674
- deviceCredentials: DeviceCredentialsState;
675
- localMedia: LocalMediaState$1;
676
- localParticipant: LocalParticipantState$1;
677
- localScreenshare: LocalScreenshareState;
678
- organization: OrganizationState;
679
- remoteParticipants: RemoteParticipantState$1;
680
- roomConnection: RoomConnectionState$1;
681
- rtcAnalytics: rtcAnalyticsState;
682
- rtcConnection: RtcConnectionState;
683
- signalConnection: SignalConnectionState;
684
- streaming: StreamingState;
685
- waitingParticipants: WaitingParticipantsState;
686
- }, {
687
- services: {
688
- credentialsService: CredentialsService;
689
- apiClient: ApiClient;
690
- organizationService: OrganizationService;
691
- fetchOrganizationFromRoomUrl: (roomUrl: string) => Promise<Organization | null>;
692
- };
693
- }, redux.UnknownAction>;
694
- }, {}>, redux.StoreEnhancer<{}, {}>]>>;
695
- type Store = ReturnType<typeof createStore>;
696
-
697
- /**
698
- * Reducer
699
- */
700
- interface WaitingParticipantsState {
701
- waitingParticipants: WaitingParticipant[];
702
- }
703
-
704
- type LocalMediaOptions = {
705
- audio: boolean;
706
- video: boolean;
707
- };
708
- /**
709
- * Reducer
710
- */
711
- interface LocalMediaState$1 {
712
- busyDeviceIds: string[];
713
- cameraDeviceError?: unknown;
714
- cameraEnabled: boolean;
715
- currentCameraDeviceId?: string;
716
- currentMicrophoneDeviceId?: string;
717
- devices: MediaDeviceInfo[];
718
- isSettingCameraDevice: boolean;
719
- isSettingMicrophoneDevice: boolean;
720
- isTogglingCamera: boolean;
721
- microphoneDeviceError?: unknown;
722
- microphoneEnabled: boolean;
723
- options?: LocalMediaOptions;
724
- status: "" | "stopped" | "starting" | "started" | "error";
725
- startError?: unknown;
726
- stream?: MediaStream;
727
- isSwitchingStream: boolean;
728
- onDeviceChange?: () => void;
729
- }
730
-
731
- interface LocalMediaState {
732
- currentCameraDeviceId?: string;
733
- currentMicrophoneDeviceId?: string;
734
- cameraDeviceError: unknown;
735
- cameraDevices: MediaDeviceInfo[];
736
- isSettingCameraDevice: boolean;
737
- isSettingMicrophoneDevice: boolean;
738
- isStarting: boolean;
739
- localStream?: MediaStream;
740
- microphoneDeviceError: unknown;
741
- microphoneDevices: MediaDeviceInfo[];
742
- speakerDevices: MediaDeviceInfo[];
743
- startError: unknown;
744
- }
745
- interface LocalMediaActions {
746
- setCameraDevice: (deviceId: string) => void;
747
- setMicrophoneDevice: (deviceId: string) => void;
748
- toggleCameraEnabled: (enabled?: boolean) => void;
749
- toggleMicrophoneEnabled: (enabled?: boolean) => void;
750
- }
751
- type UseLocalMediaResult = {
752
- state: LocalMediaState;
753
- actions: LocalMediaActions;
754
- store: Store;
755
- };
756
- type UseLocalMediaOptions = LocalMediaOptions;
757
-
758
- type RemoteParticipantState = Omit<RemoteParticipant, "newJoiner" | "streams">;
759
- type LocalParticipantState = LocalParticipant;
760
- interface WaitingParticipantState {
761
- id: string;
762
- displayName: string | null;
763
- }
764
- interface ChatMessageState {
765
- senderId: string;
766
- timestamp: string;
767
- text: string;
768
- }
769
- type ScreenshareState = Screenshare;
770
- type LocalScreenshareStatus = "starting" | "active";
771
- type ChatMessage = Pick<ChatMessage$2, "senderId" | "timestamp" | "text">;
772
- type ConnectionStatus = "initializing" | "connecting" | "connected" | "reconnect" | "room_locked" | "knocking" | "disconnecting" | "disconnected" | "knock_rejected";
773
- type CloudRecordingState = {
774
- error?: string;
775
- status: "recording" | "requested" | "error";
776
- startedAt?: number;
777
- };
778
- type LiveStreamState = {
779
- status: "streaming";
780
- startedAt?: number;
781
- };
782
- interface RoomConnectionState {
783
- chatMessages: ChatMessage[];
784
- cloudRecording?: CloudRecordingState;
785
- localScreenshareStatus?: LocalScreenshareStatus;
786
- localParticipant?: LocalParticipantState;
787
- remoteParticipants: RemoteParticipantState[];
788
- screenshares: Screenshare[];
789
- connectionStatus: ConnectionStatus;
790
- liveStream?: LiveStreamState;
791
- waitingParticipants: WaitingParticipantState[];
792
- }
793
- interface RoomConnectionOptions {
794
- displayName?: string;
795
- localMediaOptions?: LocalMediaOptions;
796
- roomKey?: string;
797
- localMedia?: UseLocalMediaResult;
798
- externalId?: string;
799
- }
800
- interface UseRoomConnectionOptions extends Omit<RoomConnectionOptions, "localMedia"> {
801
- localMedia?: UseLocalMediaResult;
802
- }
803
- interface RoomConnectionActions {
804
- sendChatMessage(text: string): void;
805
- knock(): void;
806
- setDisplayName(displayName: string): void;
807
- toggleCamera(enabled?: boolean): void;
808
- toggleMicrophone(enabled?: boolean): void;
809
- acceptWaitingParticipant(participantId: string): void;
810
- rejectWaitingParticipant(participantId: string): void;
811
- startCloudRecording(): void;
812
- startScreenshare(): void;
813
- stopCloudRecording(): void;
814
- stopScreenshare(): void;
815
- }
816
-
817
- type VideoViewComponentProps = Omit<React.ComponentProps<typeof _default>, "onResize">;
818
- interface RoomConnectionComponents {
819
- VideoView: (props: VideoViewComponentProps) => ReturnType<typeof _default>;
820
- }
821
- type RoomConnectionRef = {
822
- state: RoomConnectionState;
823
- actions: RoomConnectionActions;
824
- components: RoomConnectionComponents;
825
- _ref: Store;
826
- };
827
- declare function useRoomConnection(roomUrl: string, roomConnectionOptions?: UseRoomConnectionOptions): RoomConnectionRef;
828
-
829
- declare function useLocalMedia(optionsOrStream?: UseLocalMediaOptions | MediaStream): UseLocalMediaResult;
830
-
831
- declare const sdkVersion = "__SDK_VERSION__";
832
-
833
- export { type ChatMessageState as ChatMessage, type LocalParticipantState as LocalParticipant, type RemoteParticipantState as RemoteParticipant, type RoomConnectionState as RoomConnection, type ScreenshareState as Screenshare, type UseLocalMediaResult, _default as VideoView, type WaitingParticipantState as WaitingParticipant, sdkVersion, useLocalMedia, useRoomConnection };