@whereby.com/core 1.31.6 → 1.31.7

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/index.d.mts CHANGED
@@ -32,21 +32,53 @@ type HttpClientRequestConfig = AxiosRequestConfig | {
32
32
  interface IHttpClient {
33
33
  request(url: string, options: HttpClientRequestConfig): Promise<Response>;
34
34
  }
35
+ /**
36
+ * Class used for making http calls. This is just a pure
37
+ * wrapper around the http lib that we decide to use,
38
+ * so that we can switch implementations.
39
+ */
35
40
  declare class HttpClient implements IHttpClient {
36
41
  _baseUrl: string;
42
+ /**
43
+ * Creates an HttpClient instance.
44
+ *
45
+ * @param {string} [baseUrl] - The base URL where all requests are made.
46
+ */
37
47
  constructor({ baseUrl }: {
38
48
  baseUrl: string;
39
49
  });
40
50
  private _requestAxios;
51
+ /**
52
+ * Wrapper for the axios API
53
+ *
54
+ * @param {string} url - Required. URL (appended to base URL) where API call will be made
55
+ * @param {object} options - Required. Contains the data needed for the fetch API
56
+ * @return {Promise<Response>} - A promise which will return a Response object (https://developer.mozilla.org/en-US/docs/Web/API/Response)
57
+ */
41
58
  request(url: string, options: HttpClientRequestConfig): Promise<Response>;
42
59
  }
43
60
 
61
+ /**
62
+ * ApiClient for doing multipart/form-data requests.
63
+ */
44
64
  declare class MultipartHttpClient implements IHttpClient {
45
65
  _httpClient: IHttpClient;
46
66
  constructor({ httpClient }: {
47
67
  httpClient: IHttpClient;
48
68
  });
69
+ /**
70
+ * Convert the provided object to a FormData object containing the same keys and values.
71
+ * @param {object} data - the data to convert.
72
+ * @returns {FormData}
73
+ */
49
74
  static dataToFormData(data: Record<string, string>): FormData;
75
+ /**
76
+ * Request a resource using multipart/form-data encoding.
77
+ *
78
+ * @param {string} url - the url to request
79
+ * @param {object} options - Required. Contains the data needed for the fetch API
80
+ * @return {Promise<Response>} - A promise which will return a Response object (https://developer.mozilla.org/en-US/docs/Web/API/Response)
81
+ */
50
82
  request(url: string, options?: HttpClientRequestConfig): Promise<Response>;
51
83
  }
52
84
 
@@ -80,19 +112,40 @@ interface ApiClientOptions {
80
112
  baseUrl?: string;
81
113
  fetchDeviceCredentials?: AuthenticatedHttpClientOptions["fetchDeviceCredentials"];
82
114
  }
115
+ /**
116
+ * Class used for all Whereby API calls.
117
+ */
83
118
  declare class ApiClient {
84
119
  authenticatedHttpClient: AuthenticatedHttpClient;
85
120
  authenticatedFormDataHttpClient: MultipartHttpClient;
121
+ /**
122
+ * Create an ApiClient instance.
123
+ */
86
124
  constructor({ baseUrl, fetchDeviceCredentials, }?: ApiClientOptions);
125
+ /**
126
+ * Wrapper for the fetch API
127
+ */
87
128
  request(url: string, options: HttpClientRequestConfig): Promise<Response>;
129
+ /**
130
+ * Performs a multipart request where data is multipart/form-data encoded.
131
+ */
88
132
  requestMultipart(url: string, options: HttpClientRequestConfig): Promise<Response>;
89
133
  }
90
134
 
135
+ /**
136
+ * Related to device calls needed to obtain credentials
137
+ */
91
138
  declare class DeviceService {
92
139
  _apiClient: ApiClient;
93
140
  constructor({ apiClient }: {
94
141
  apiClient: ApiClient;
95
142
  });
143
+ /**
144
+ * Get's the device credentials needed for most of the other API services
145
+ *
146
+ * @return {Promise} A promise which is fulfilled or failed based on the
147
+ * response.
148
+ */
96
149
  getCredentials(): Promise<Credentials | null>;
97
150
  }
98
151
 
@@ -105,6 +158,11 @@ declare class CredentialsService extends EventEmitter {
105
158
  _deviceService: DeviceService;
106
159
  _credentialsStore: AbstractStore;
107
160
  credentialsPromise?: Promise<Credentials | null>;
161
+ /**
162
+ * Service to manage Whereby's Rest API credentials.
163
+ *
164
+ * @param {ObjectStore} credentialsStore - Store to manage the credentials.
165
+ */
108
166
  constructor({ deviceService, credentialsStore, }: {
109
167
  deviceService: DeviceService;
110
168
  credentialsStore: AbstractStore;
@@ -114,10 +172,38 @@ declare class CredentialsService extends EventEmitter {
114
172
  storeName?: string;
115
173
  storeType?: "localStorage" | "chromeStorage";
116
174
  }): CredentialsService;
175
+ /**
176
+ * Contacts the REST API to get new credentials. DO NOT USE directly, call getCredentials() instead.
177
+ *
178
+ * @see getCredentials
179
+ * @returns {Promise.<Credentials>} - Promise that resolves with the credentials.
180
+ */
117
181
  _fetchNewCredentialsFromApi(): Promise<Credentials | null>;
182
+ /**
183
+ * Returns the current credentials without triggering an API request to get new ones.
184
+ * If no credentials are currently available it will return null.
185
+ *
186
+ * @returns {?Credentials} - The credentials currently in use, null otherwise.
187
+ */
118
188
  getCurrentCredentials(): Promise<Credentials | null>;
189
+ /**
190
+ * Returns a promise that will contain the credentials for this client.
191
+ * If no credentials are available in local storage, new ones will be fetched from the server.
192
+ *
193
+ * @returns {Promise.<Credentials>} - Promise that resolves with the credentials.
194
+ */
119
195
  getCredentials(): Promise<Credentials | null>;
196
+ /**
197
+ * Saves new credentials which replace the existing ones and abort any pending request to get new ones.
198
+ *
199
+ * @param {Credentials} credentials - New credentials to store.
200
+ */
120
201
  saveCredentials(credentials: Credentials): Promise<Credentials>;
202
+ /**
203
+ * It will set the userId for the current credentials.
204
+ *
205
+ * @param userId - The user id to set.
206
+ */
121
207
  setUserId(userId: string | null): Promise<void>;
122
208
  }
123
209
 
@@ -255,9 +341,19 @@ declare class Organization {
255
341
  }
256
342
 
257
343
  type FetchOrganizationFunction = () => Promise<Organization | undefined>;
344
+ /**
345
+ * Class used for all Whereby organization API calls.
346
+ */
258
347
  declare class OrganizationApiClient {
259
348
  private _apiClient;
260
349
  private _fetchOrganization;
350
+ /**
351
+ * Create an OrganizationApiClient instance.
352
+ *
353
+ * @param {Object} options - The options for the OrganizationApiClient.
354
+ * @param {ApiClient} [options.apiClient] - The apiClient to use.
355
+ * @param {Function} [options.fetchOrganization] - function that returns a promise with the organization.
356
+ */
261
357
  constructor({ apiClient, fetchOrganization, }: {
262
358
  apiClient: ApiClient;
263
359
  fetchOrganization?: FetchOrganizationFunction;
@@ -278,6 +374,9 @@ declare class OrganizationService {
278
374
  constructor({ apiClient }: {
279
375
  apiClient: ApiClient;
280
376
  });
377
+ /**
378
+ * Creates an organization.
379
+ */
281
380
  createOrganization({ organizationName, subdomain, owner, }: {
282
381
  organizationName: string;
283
382
  subdomain: string;
@@ -292,8 +391,23 @@ declare class OrganizationService {
292
391
  consents?: ReadonlyArray<ConsentGrantRequest>;
293
392
  };
294
393
  }): Promise<string>;
394
+ /**
395
+ * Retrieves the organization based on the subdomain.
396
+ */
295
397
  getOrganizationBySubdomain(subdomain: string): Promise<Organization | null>;
398
+ /**
399
+ * Retrieves the organization based on the organizationId.
400
+ *
401
+ * Note: This endpoint should only be used to retrieve an organization when the device is linked
402
+ * to a user in that organization. Use getOrganizationBySubdomain instead if you just want the information
403
+ * about an organization that is mapped to a given subdomain.
404
+ */
296
405
  getOrganizationByOrganizationId(organizationId: string): Promise<Organization | null>;
406
+ /**
407
+ * Retrieves the organizations that contain a user
408
+ * matching provided the email+code or phoneNumber+code
409
+ * combination.
410
+ */
297
411
  getOrganizationsByContactPoint(options: {
298
412
  email: string;
299
413
  code: string;
@@ -301,17 +415,37 @@ declare class OrganizationService {
301
415
  phoneNumber: string;
302
416
  code: string;
303
417
  }): Promise<ReadonlyArray<Organization>>;
418
+ /**
419
+ * Retrieves the organizations that contain a user
420
+ * matching provided the idToken
421
+ */
304
422
  getOrganizationsByIdToken({ idToken }: {
305
423
  idToken: string;
306
424
  }): Promise<ReadonlyArray<Organization>>;
425
+ /**
426
+ * Retrieves the organizations containing a user
427
+ * with either the email or phoneNumber matching the logged in user.
428
+ *
429
+ * This is useful for showing the possible organization that the current
430
+ * user could log in to.
431
+ */
307
432
  getOrganizationsByLoggedInUser(): Promise<ReadonlyArray<Organization>>;
433
+ /**
434
+ * Checks if a subdomain is available and verifies its format.
435
+ */
308
436
  getSubdomainAvailability(subdomain: string): Promise<{
309
437
  status: string;
310
438
  }>;
439
+ /**
440
+ * Updates preferences of the organization.
441
+ */
311
442
  updatePreferences({ organizationId, preferences, }: {
312
443
  organizationId: string;
313
444
  preferences: OrganizationPreferences;
314
445
  }): Promise<undefined>;
446
+ /**
447
+ * Delete organization
448
+ */
315
449
  deleteOrganization({ organizationId }: {
316
450
  organizationId: string;
317
451
  }): Promise<undefined>;
@@ -334,51 +468,146 @@ declare class Room {
334
468
  constructor(properties?: {});
335
469
  }
336
470
 
471
+ /**
472
+ * Service for talking to the Room related APIs
473
+ */
337
474
  declare class RoomService {
475
+ /**
476
+ * @param {object} organizationApiClient (required)
477
+ */
338
478
  constructor({ organizationApiClient }: {
339
479
  organizationApiClient: any;
340
480
  });
481
+ /**
482
+ * Gets the list of visited rooms
483
+ *
484
+ * @param {Object} args
485
+ * @param {Array<string>} [types=["team"]] - The type of rooms that should be fetched.
486
+ * @param {Array<string>} [fields=["meeting"]] - The fields of room that should be fetched.
487
+ * @returns {Promise<array>} - It will resolve with an array.
488
+ */
341
489
  getRooms({ types, fields }?: {
342
490
  fields?: never[] | undefined;
343
491
  }): any;
492
+ /**
493
+ * Gets the specified room.
494
+ *
495
+ * Currently information is implicitly alluded to via the servers
496
+ * `/room/roomName` response. This method patches the data
497
+ * tempoarily, until the day it comes back from the server.
498
+ *
499
+ * @returns {Promise<Room>} - It will resolve with the Room.
500
+ */
344
501
  getRoom({ roomName, fields }: {
345
502
  roomName: string;
346
503
  fields?: Array<string>;
347
504
  }): Promise<Room>;
505
+ /**
506
+ * Claims the specified room.
507
+ *
508
+ * @param {Object} args
509
+ * @param {String} args.roomName - The roomName to claim
510
+ * @param {String} args.type - The type of room to claim
511
+ * @param {String} args.mode - The optional mode of room to claim
512
+ * @param {[Boolean]} args.isLocked - The optional lock status of room to claim
513
+ * @returns {Promise} - It will resolve with undefined.
514
+ */
348
515
  claimRoom({ roomName, type, mode, isLocked }: {
349
516
  roomName: any;
350
517
  type: any;
351
518
  mode: any;
352
519
  isLocked: any;
353
520
  }): any;
521
+ /**
522
+ * Unclaims the specified room.
523
+ *
524
+ * @param {string} roomName - the room name to unclaim.
525
+ * @returns {Promise.<undefined>} - It will resolve with undefined.
526
+ */
354
527
  unclaimRoom(roomName: any): any;
528
+ /**
529
+ * Changes the name of the room
530
+ *
531
+ * @param {Object} args
532
+ * @param {string} args.roomName - The name of the room to rename
533
+ * @param {string} args.newRoomName - The new name
534
+ * @returns {Promise<undefined>} - It will resolve if the room was renamed, reject for all other cases
535
+ */
355
536
  renameRoom({ roomName, newRoomName }: {
356
537
  roomName: any;
357
538
  newRoomName: any;
358
539
  }): any;
540
+ /**
541
+ * Changes the room mode (experimental)
542
+ *
543
+ * @param {string} roomName - The name of the room to change mode of
544
+ * @param {string} mode - The name of mode to set, currently only "group" is supported
545
+ * @returns {Promise<undefined>} - It will resolve if mode was changed, rejects for all other cases
546
+ */
359
547
  changeMode({ roomName, mode }: {
360
548
  roomName: any;
361
549
  mode: any;
362
550
  }): any;
551
+ /**
552
+ * Updates the room prefs
553
+ *
554
+ * @param {string} roomName - The name of the room to change mode of
555
+ * @param {object} preferences - The prefs you want to update and their values
556
+ * @returns {Promise<undefined>} - It will resolve if updated, rejects for all other cases
557
+ */
363
558
  updatePreferences({ roomName, preferences }: {
364
559
  roomName: any;
365
560
  preferences: any;
366
561
  }): any;
562
+ /**
563
+ * Updates the protected room prefs
564
+ *
565
+ * @param {string} roomName - The name of the room to change mode of
566
+ * @param {object} preferences - The protected prefs you want to update and their values
567
+ * @returns {Promise<undefined>} - It will resolve if updated, rejects for all other cases
568
+ */
367
569
  updateProtectedPreferences({ roomName, preferences }: {
368
570
  roomName: any;
369
571
  preferences: any;
370
572
  }): any;
371
573
  getRoomPermissions(roomName: any, { roomKey }?: {}): any;
574
+ /**
575
+ * Gets the specified room metrics
576
+ *
577
+ * @param {Object} args
578
+ * @param {string} args.roomName - The name of the room to get metrics from.
579
+ * @param {string} args.metrics - Comma-separated list of metrics to include.
580
+ * @param {string} args.from (optional) - Start time (inclusive) to count from in
581
+ * ISO format. Defaults to counting from the start of time.
582
+ * @param {string} args.to (optional) - End time (exclusive) to count up to in
583
+ * ISO format. Defaults to counting up to the current time.
584
+ * @returns {Promise<Object>} - It will resolve with the requested metrics.
585
+ */
372
586
  getRoomMetrics({ roomName, metrics, from, to }: {
373
587
  roomName: any;
374
588
  metrics: any;
375
589
  from: any;
376
590
  to: any;
377
591
  }): any;
592
+ /**
593
+ * Changes the room type
594
+ *
595
+ * @param {Object} args
596
+ * @param {string} args.roomName - The name of the room to change mode of
597
+ * @param {"personal" | "personal_xl"} args.type - Room type that should be set
598
+ * @returns {Promise<undefined>} - It will resolve if type was changed, rejects for all other cases
599
+ */
378
600
  changeType({ roomName, type }: {
379
601
  roomName: any;
380
602
  type: any;
381
603
  }): any;
604
+ /** Gets a Forest campaign social image
605
+ *
606
+ * @param {Object} args
607
+ * @param {string} args.roomName - The name of the room to get metrics from.
608
+ * @param {number} args.count - Number to be displayed in the image as tree count.
609
+ * @returns {Promise<string>} - It will resolve with the image url.
610
+ */
382
611
  getForestSocialImage({ roomName, count }: {
383
612
  roomName: any;
384
613
  count: any;
@@ -435,7 +664,24 @@ declare class LiveCaption {
435
664
  constructor({ resultId, senderId, text }: LiveCaptionEvent);
436
665
  }
437
666
 
667
+ /**
668
+ * Public helpers for the optional camera effects and audio denoiser features.
669
+ *
670
+ * These wrap `@whereby.com/camera-effects` and `@whereby.com/audio-denoiser`,
671
+ * which are bundled with core but loaded on demand via dynamic import. Consumers
672
+ * should reach for these instead of importing the underlying packages directly,
673
+ * so the effect code stays in a lazily-loaded chunk and is never pulled into the
674
+ * main bundle for consumers who don't use these features.
675
+ */
676
+ /**
677
+ * List the camera effect preset ids that are usable in the current environment.
678
+ * The camera effects code is loaded on demand the first time this is called.
679
+ */
438
680
  declare function getUsableCameraEffectPresets(): Promise<string[]>;
681
+ /**
682
+ * Whether audio noise suppression is supported in the current browser. The
683
+ * audio denoiser code is loaded on demand the first time this is called.
684
+ */
439
685
  declare function isAudioDenoiserSupported(): Promise<boolean>;
440
686
 
441
687
  interface RoomIntegrationContent {
@@ -454,6 +700,15 @@ declare function youtube({ url, startAt, metadata, }: {
454
700
  startAt?: number;
455
701
  metadata?: YouTubeContentMetadata;
456
702
  }): RoomIntegrationContent | null;
703
+ /**
704
+ * Builds the content for a Miro share from an embed link.
705
+ *
706
+ * Miro cannot be built from an ordinary `miro.com/app/board/...` url: access links are minted by
707
+ * Miro's board picker using Whereby's credentials. Use the hosted picker to let a user browse their
708
+ * boards; use this when you already hold a link, e.g. one pasted from Miro's own Embed dialog.
709
+ *
710
+ * @returns null for anything that is not a Miro embed link.
711
+ */
457
712
  declare function miro({ accessLink }: {
458
713
  accessLink: string;
459
714
  }): RoomIntegrationContent | null;
@@ -538,8 +793,15 @@ interface Screenshare {
538
793
  isLocal: boolean;
539
794
  }
540
795
 
796
+ /**
797
+ * Base URL overrides for `WherebyClient` and `createServices`.
798
+ *
799
+ * @internal For Whereby's own development. May change without notice.
800
+ */
541
801
  interface ServicesOptions {
802
+ /** Base URL of the Whereby API. Defaults to the URL the SDK was built with. */
542
803
  apiBaseUrl?: string;
804
+ /** Base URL of the signal server. Defaults to the URL the SDK was built with. */
543
805
  signalBaseUrl?: string;
544
806
  }
545
807
  declare function createServices({ apiBaseUrl, signalBaseUrl }?: ServicesOptions): {
@@ -567,20 +829,43 @@ interface Options {
567
829
  interface DebouncedFunction {
568
830
  (...args: any[]): void;
569
831
  }
832
+ /**
833
+ * Debounce function.
834
+ *
835
+ * @param {Function} fn - Function to debounce.
836
+ * @param {Object} [options] - Options.
837
+ * @param {number} [options.delay=500] - Delay in milliseconds.
838
+ * @param {boolean} [options.edges=false] - Whether to call the function on the
839
+ * leading and trailing edges of the wait timeout.
840
+ * @returns {Function} Debounced function.
841
+ */
570
842
  declare function debounce(fn: DebouncedFunction, { delay, edges }?: Options): DebouncedFunction;
571
843
 
844
+ /**
845
+ * Parse the raw data contained in a roomKey JWT token without verifying if the token is
846
+ * valid (i.e. we do not have the JWT signing keys in this environment)
847
+ */
572
848
  declare function parseUnverifiedRoomKeyData(roomKey: string): any;
573
849
 
850
+ /**
851
+ * Reducer
852
+ */
574
853
  interface WaitingParticipantsState {
575
854
  waitingParticipants: WaitingParticipant[];
576
855
  }
577
856
 
857
+ /**
858
+ * Reducer
859
+ */
578
860
  interface StreamingState {
579
861
  isStreaming: boolean;
580
862
  error: unknown;
581
863
  startedAt?: number;
582
864
  }
583
865
 
866
+ /**
867
+ * Reducer
868
+ */
584
869
  interface rtcAnalyticsState {
585
870
  reportedValues: {
586
871
  [key: string]: unknown;
@@ -591,6 +876,9 @@ type ChatMessage$1 = Pick<ChatMessage$2, "id" | "senderId" | "parentId" | "times
591
876
  removed: boolean;
592
877
  file?: ChatFileShare;
593
878
  };
879
+ /**
880
+ * Reducer
881
+ */
594
882
  interface ChatState {
595
883
  chatMessages: ChatMessage$1[];
596
884
  }
@@ -677,6 +965,9 @@ type NotificationEventMap = {
677
965
  };
678
966
 
679
967
  type NotificationsEventEmitter = EventEmitter<NotificationEventMap>;
968
+ /**
969
+ * Reducer
970
+ */
680
971
  interface NotificationsState {
681
972
  emitter: NotificationsEventEmitter;
682
973
  events: Array<NotificationEvent>;
@@ -695,6 +986,9 @@ interface LocalParticipantState$1 extends LocalParticipant {
695
986
  breakoutGroupAssigned: string;
696
987
  }
697
988
 
989
+ /**
990
+ * Reducer
991
+ */
698
992
  interface LiveTranscriptionState$1 {
699
993
  isInitiator: boolean;
700
994
  isTranscribing: boolean;
@@ -703,6 +997,9 @@ interface LiveTranscriptionState$1 {
703
997
  startedAt?: number;
704
998
  }
705
999
 
1000
+ /**
1001
+ * Reducer
1002
+ */
706
1003
  interface LiveCaptionsState$1 {
707
1004
  isCaptioning: boolean;
708
1005
  error?: string;
@@ -723,6 +1020,9 @@ interface FileUpload {
723
1020
  status: "uploading" | "sent" | "error";
724
1021
  error?: FileShareError;
725
1022
  }
1023
+ /**
1024
+ * Reducer
1025
+ */
726
1026
  interface FileShareState {
727
1027
  uploads: FileUpload[];
728
1028
  requestInFlight: boolean;
@@ -732,6 +1032,9 @@ interface SendFilesOptions {
732
1032
  isBroadcast?: boolean;
733
1033
  }
734
1034
 
1035
+ /**
1036
+ * Reducer
1037
+ */
735
1038
  interface CloudRecordingState$1 {
736
1039
  isInitiator: boolean;
737
1040
  isRecording: boolean;
@@ -760,6 +1063,11 @@ interface CameraEffectsState {
760
1063
 
761
1064
  type StopFn = () => void;
762
1065
  interface AudioDenoiserState {
1066
+ /**
1067
+ * User intent — true if the consumer asked for denoising on. Persists
1068
+ * across mid-flight stops triggered by device/stream switches so we can
1069
+ * auto-reapply after the switch settles.
1070
+ */
763
1071
  wanted: boolean;
764
1072
  isSwitching: boolean;
765
1073
  error?: unknown;
@@ -771,16 +1079,27 @@ interface AudioDenoiserState {
771
1079
  };
772
1080
  }
773
1081
 
1082
+ /**
1083
+ * Reducer
1084
+ */
774
1085
  interface AuthorizationState {
775
1086
  roomKey: string | null;
776
1087
  assistantKey?: string | null;
777
1088
  roleName: RoleName;
778
1089
  }
779
1090
 
1091
+ /** Seconds a breakout timer runs for when one is enabled without an explicit duration. */
780
1092
  declare const DEFAULT_BREAKOUT_TIMER_DURATION = 1800;
1093
+ /**
1094
+ * Reducer
1095
+ */
781
1096
  interface BreakoutState$1 extends BreakoutConfig {
782
1097
  error: string | null;
783
1098
  }
1099
+ /**
1100
+ * Breakout groups require an SFU ("group") room. In a peer-to-peer room, moving clients in and out
1101
+ * of groups would tear down peer connections that never get re-established, so we refuse to start.
1102
+ */
784
1103
  declare const BREAKOUT_UNAVAILABLE_ERROR = "Breakout groups are not available in peer-to-peer rooms";
785
1104
  interface BreakoutSessionSettings {
786
1105
  enforceAssignment?: boolean;
@@ -807,6 +1126,9 @@ interface UpdateBreakoutSessionOptions extends BreakoutSessionSettings {
807
1126
  [clientId: string]: string;
808
1127
  };
809
1128
  }
1129
+ /**
1130
+ * Group helpers
1131
+ */
810
1132
  declare const BREAKOUT_GROUPS_MIN_MAX: [number, number];
811
1133
  declare function defaultBreakoutGroupName(groupId: string): string;
812
1134
  declare function createBreakoutGroups(count?: number): {
@@ -861,17 +1183,26 @@ interface ConnectionMonitorState {
861
1183
  stopCallbackFunction?: () => void;
862
1184
  }
863
1185
 
1186
+ /**
1187
+ * Reducer
1188
+ */
864
1189
  interface DeviceCredentialsState {
865
1190
  isFetching: boolean;
866
1191
  data?: Credentials | null;
867
1192
  }
868
1193
 
1194
+ /**
1195
+ * Reducer
1196
+ */
869
1197
  interface OrganizationState {
870
1198
  data: Organization | null | undefined;
871
1199
  isFetching: boolean;
872
1200
  error: unknown;
873
1201
  }
874
1202
 
1203
+ /**
1204
+ * Reducer
1205
+ */
875
1206
  interface RemoteParticipantSliceState {
876
1207
  remoteParticipants: RemoteParticipant[];
877
1208
  }
@@ -894,6 +1225,9 @@ type ClientView = {
894
1225
  breakoutGroupAssigned?: string;
895
1226
  };
896
1227
 
1228
+ /**
1229
+ * Reducer
1230
+ */
897
1231
  interface RoomState {
898
1232
  isLocked: boolean;
899
1233
  mode: RoomMode | null;
@@ -903,6 +1237,9 @@ type LocalMediaOptions$1 = {
903
1237
  audio: boolean;
904
1238
  video: boolean;
905
1239
  };
1240
+ /**
1241
+ * Reducer
1242
+ */
906
1243
  interface LocalMediaState$1 {
907
1244
  beforeEffectTracks?: {
908
1245
  audio?: MediaStreamTrack;
@@ -933,6 +1270,14 @@ interface LocalMediaState$1 {
933
1270
  widescreenMode: boolean;
934
1271
  }
935
1272
 
1273
+ /**
1274
+ * Reducer
1275
+ */
1276
+ /**
1277
+ * Whether to join with the camera and/or microphone muted. The devices are still
1278
+ * acquired according to `localMediaOptions` - this only decides the state we join
1279
+ * with. `true` means muted, an omitted key leaves that device untouched.
1280
+ */
936
1281
  type InitialMuteStates = {
937
1282
  camera?: boolean;
938
1283
  microphone?: boolean;
@@ -970,6 +1315,9 @@ interface AppState {
970
1315
  type ConnectionStatus = "ready" | "connecting" | "connected" | "room_locked" | "knocking" | "knock_on_hold" | "knock_rejected" | "kicked" | "leaving" | "left" | "disconnected" | "reconnecting";
971
1316
  type JoinRoomStage = "credentials" | "organization" | "local_media" | "signal_connect" | "identify_device" | "join_room";
972
1317
  type JoinRoomErrorNames = "organization_fetch_failed" | "join_cancelled";
1318
+ /**
1319
+ * Reducer
1320
+ */
973
1321
  interface RoomConnectionState$1 {
974
1322
  session: {
975
1323
  createdAt: string;
@@ -1022,6 +1370,9 @@ interface RoomIntegrationErrorDetail {
1022
1370
  code: RoomIntegrationError;
1023
1371
  message: string;
1024
1372
  }
1373
+ /**
1374
+ * Reducer
1375
+ */
1025
1376
  interface RoomIntegrationsState$1 {
1026
1377
  available: RoomIntegration[];
1027
1378
  unavailable: RoomIntegration[];
@@ -1047,6 +1398,9 @@ declare function roomIntegrationPickerUrl({ integration, parentOrigin, featureSo
1047
1398
  featureSource?: string;
1048
1399
  }): string;
1049
1400
 
1401
+ /**
1402
+ * Reducer
1403
+ */
1050
1404
  interface StreamResolutionUpdate {
1051
1405
  streamId: string;
1052
1406
  width: number;
@@ -1070,6 +1424,9 @@ interface ToggleAudioOnlyModeOptions {
1070
1424
  autoDisableLocalCamera?: boolean;
1071
1425
  }
1072
1426
 
1427
+ /**
1428
+ * Reducer
1429
+ */
1073
1430
  interface SignalConnectionState {
1074
1431
  deviceIdentified: boolean;
1075
1432
  isIdentifyingDevice: boolean;
@@ -1077,6 +1434,9 @@ interface SignalConnectionState {
1077
1434
  socket: ServerSocket | null;
1078
1435
  }
1079
1436
 
1437
+ /**
1438
+ * Reducer
1439
+ */
1080
1440
  interface SpotlightsState {
1081
1441
  sorted: {
1082
1442
  clientId: string;
@@ -1238,10 +1598,36 @@ declare abstract class BaseClient<TState, TEvents extends Record<string, unknown
1238
1598
  protected previousState: TState;
1239
1599
  private stateSubscribers;
1240
1600
  constructor(store: Store);
1601
+ /**
1602
+ * Gets the current state of the client.
1603
+ * @returns The current state of the client.
1604
+ */
1241
1605
  abstract getState(): TState;
1606
+ /**
1607
+ * Subscribes to state changes.
1608
+ * @param callback The callback function to be called when the state changes.
1609
+ * @returns A function to unsubscribe from the state changes.
1610
+ */
1242
1611
  subscribe(callback: (state: TState) => void): () => void;
1612
+ /**
1613
+ * Handles state changes by comparing the current state with the previous state.
1614
+ * @param state The current state of the client.
1615
+ * @param previousState The previous state of the client.
1616
+ * @returns void
1617
+ * @protected
1618
+ */
1243
1619
  protected abstract handleStateChanges(state: TState, previousState: TState): void;
1620
+ /**
1621
+ * Sets up the event bridge to listen for state changes and emit events accordingly.
1622
+ * @returns void
1623
+ * @private
1624
+ */
1244
1625
  private setupEventBridge;
1626
+ /**
1627
+ * Destroys the client by clearing all subscribers and removing all listeners.
1628
+ * @returns void
1629
+ * @public
1630
+ */
1245
1631
  destroy(): void;
1246
1632
  }
1247
1633
 
@@ -1377,6 +1763,10 @@ declare class LocalMediaClient extends BaseClient<LocalMediaState, LocalMediaEve
1377
1763
  setMicrophoneDevice(deviceId: string): void;
1378
1764
  setSpeakerDevice(deviceId: string): void;
1379
1765
  stopMedia(): void;
1766
+ /**
1767
+ * Destroy the LocalMediaClient instance.
1768
+ * This method cleans up any resources and event listeners.
1769
+ */
1380
1770
  destroy(): void;
1381
1771
  }
1382
1772
 
@@ -1445,7 +1835,9 @@ type LiveStreamState = {
1445
1835
  startedAt?: number;
1446
1836
  };
1447
1837
  type BreakoutState = {
1838
+ /** Breakout groups require a group (SFU) room; false in peer-to-peer rooms. */
1448
1839
  isAvailable: boolean;
1840
+ /** Set when a breakout action was refused, e.g. starting a session in a peer-to-peer room. */
1449
1841
  error: string | null;
1450
1842
  isActive: boolean;
1451
1843
  currentGroup: {
@@ -1623,11 +2015,37 @@ declare class RoomConnectionClient extends BaseClient<RoomConnectionState, RoomC
1623
2015
  subscribeToJoinStage(callback: (joinStage: JoinRoomStage | null) => void): () => void;
1624
2016
  subscribeToRoomSessionId(callback: (roomSessionId: string | null) => void): () => void;
1625
2017
  subscribeToAudioOnlyMode(callback: (isEnabled: boolean) => void): () => void;
2018
+ /**
2019
+ * Subscribe to remote participant quality report changes.
2020
+ *
2021
+ * The report is keyed by `clientId` and has an entry for each remote client (not the local client).
2022
+ * Each entry has a `quality` level (`"ok"`, `"warning"` or `"critical"`), which is the worst of the
2023
+ * client's video and audio quality. The report is empty until the call quality monitor starts after
2024
+ * joining a room, and is reset to empty after leaving.
2025
+ *
2026
+ * @param callback - Called with the latest report whenever it changes.
2027
+ * @returns A function that removes the subscription.
2028
+ */
1626
2029
  subscribeToRemoteParticipantQualityReport(callback: (report: RemoteParticipantQualityReport) => void): () => void;
2030
+ /**
2031
+ * Subscribe to local participant quality report changes.
2032
+ *
2033
+ * The report has a `quality` level (`"ok"`, `"warning"` or `"critical"`), which is the worst of the
2034
+ * local client's video and audio quality, and a `cpu` level (`"ok"`, `"warning"` or `"critical"`) for
2035
+ * the local device's CPU pressure. `cpu` is left out when the browser can't measure CPU pressure (it
2036
+ * needs the Compute Pressure API). The report is empty until the call quality monitor starts after
2037
+ * joining a room, and is reset to empty after leaving.
2038
+ *
2039
+ * @param callback - Called with the latest report whenever it changes.
2040
+ * @returns A function that removes the subscription.
2041
+ */
1627
2042
  subscribeToLocalParticipantQualityReport(callback: (report: LocalParticipantQualityReport) => void): () => void;
1628
2043
  subscribeToLiveStream(callback: (status: {
1629
2044
  status: "streaming";
1630
2045
  } | undefined) => void): () => void;
2046
+ /**
2047
+ * @deprecated Use 'subscribeToLocalScreenshare' instead
2048
+ */
1631
2049
  subscribeToLocalScreenshareStatus(callback: (status?: LocalScreenshareStatus) => void): () => void;
1632
2050
  subscribeToLocalScreenshare(callback: (status: LocalScreenshareState | undefined) => void): () => void;
1633
2051
  subscribeToLocalParticipant(callback: (participant?: LocalParticipantState) => void): () => void;
@@ -1637,85 +2055,373 @@ declare class RoomConnectionClient extends BaseClient<RoomConnectionState, RoomC
1637
2055
  subscribeToSpotlightedParticipants(callback: (participants: ClientView[]) => void): () => void;
1638
2056
  subscribeToMicrophoneState(callback: (isMicrophoneEnabled: boolean) => void): () => void;
1639
2057
  subscribeToCameraState(callback: (isCameraEnabled: boolean) => void): () => void;
2058
+ /**
2059
+ * Get the current state of the Whereby client.
2060
+ * @return {object} - The current state of the client.
2061
+ */
1640
2062
  getState(): RoomConnectionState;
2063
+ /**
2064
+ * Get the event emitter for the Whereby client.
2065
+ * @return {EventEmitter} - The event emitter instance.
2066
+ */
1641
2067
  getNotificationsEventEmitter(): NotificationsEventEmitter;
2068
+ /**
2069
+ * Initialize the client with options.
2070
+ * This method can be called multiple times to update options.
2071
+ * @param options<WherebyClientOptions> - Options for the Whereby client.
2072
+ */
1642
2073
  initialize(options: WherebyClientOptions): void;
2074
+ /**
2075
+ * Join a Whereby room.
2076
+ * The promise rejects if the room URL is not provided, if the room can't be joined, and with `"join_cancelled"`
2077
+ * when the room is left or joined again before this join has finished.
2078
+ */
1643
2079
  joinRoom(): Promise<RoomJoinedSuccess>;
2080
+ /**
2081
+ * Send a chat message to the room.
2082
+ * @param text - The message text to send.
2083
+ * @param parentId - Optional id of the message this is a reply to.
2084
+ * @param isBroadcast - When true and a breakout session is active, the message is broadcast to all
2085
+ * breakout groups instead of only the sender's group.
2086
+ */
1644
2087
  sendChatMessage(text: string, parentId?: string, isBroadcast?: boolean): void;
2088
+ /**
2089
+ * Remove a chat message from the room.
2090
+ * @param id - The message id to remove.
2091
+ * @param sig - The message signature to use to authorize removal.
2092
+ */
1645
2093
  removeChatMessage(id: string, sig?: string | null): void;
2094
+ /**
2095
+ * Upload files and share them with the room as chat messages. Each file is shared as its own
2096
+ * chat message, so replying with both text and files means calling
2097
+ * {@link RoomConnectionClient.sendChatMessage} and this method with the same `parentId`.
2098
+ * @param files - The files to share.
2099
+ * @param options.parentId - Optional id of the message the files are a reply to.
2100
+ * @param options.isBroadcast - When true and a breakout session is active, the files are broadcast
2101
+ * to all breakout groups instead of only the sender's group.
2102
+ */
1646
2103
  sendFiles(files: File[], options?: SendFilesOptions): void;
2104
+ /**
2105
+ * Download a shared file. Resolves with the file contents as a Blob
2106
+ * @param file - The shared file to download.
2107
+ */
1647
2108
  downloadFile(file: ChatFileShare): Promise<Blob>;
2109
+ /**
2110
+ * Knock the room.
2111
+ */
1648
2112
  knock(): void;
2113
+ /**
2114
+ * Cancel the knock request.
2115
+ */
1649
2116
  cancelKnock(): void;
2117
+ /**
2118
+ * Leave the current room.
2119
+ * This method will reset the client state.
2120
+ */
1650
2121
  leaveRoom(): void;
2122
+ /**
2123
+ * Set the display name for the local participant.
2124
+ * @param displayName - The display name to set.
2125
+ */
1651
2126
  setDisplayName(displayName: string): void;
2127
+ /**
2128
+ * Toggle the camera on or off.
2129
+ * @param enabled - If true, enables the camera; if false, disables it.
2130
+ * If undefined, toggles the current state.
2131
+ */
1652
2132
  toggleCamera(enabled?: boolean): void;
2133
+ /**
2134
+ * Toggle the microphone on or off.
2135
+ * @param enabled - If true, enables the microphone; if false, disables it.
2136
+ * If undefined, toggles the current state.
2137
+ */
1653
2138
  toggleMicrophone(enabled?: boolean): void;
2139
+ /**
2140
+ * Toggle video hd mode on or off.
2141
+ * @param enabled - If true, enables hd mode; if false, disables it.
2142
+ * If undefined, toggles the current state.
2143
+ */
1654
2144
  toggleHdMode(enabled?: boolean): void;
2145
+ /**
2146
+ * Toggle low data mode on or off.
2147
+ * @param enabled - If true, enables low data mode; if false, disables it.
2148
+ * If undefined, toggles the current state.
2149
+ */
1655
2150
  toggleLowDataMode(enabled?: boolean): void;
2151
+ /**
2152
+ * Toggle audio-only mode on or off. While enabled, all incoming video is paused and only audio is received.
2153
+ * @param enabled - If true, enables audio-only mode; if false, disables it.
2154
+ * If undefined, toggles the current state.
2155
+ * @param options - Optional settings for audio-only mode.
2156
+ * @param options.autoDisableLocalCamera - If true, also turns off the local camera when enabling audio-only mode.
2157
+ * The camera is not turned back on when audio-only mode is disabled.
2158
+ */
1656
2159
  toggleAudioOnlyMode(enabled?: boolean, options?: ToggleAudioOnlyModeOptions): void;
2160
+ /**
2161
+ * Toggle video widescreen mode on or off.
2162
+ * @param enabled - If true, enables widescreen mode; if false, disables it.
2163
+ * If undefined, toggles the current state.
2164
+ */
1657
2165
  toggleWidescreenMode(enabled?: boolean): void;
2166
+ /**
2167
+ * Toggle raised hand.
2168
+ * @param enabled - If true, raises the hand; if false, lowers it.
2169
+ * If undefined, toggles the current state.
2170
+ */
1658
2171
  toggleRaiseHand(enabled?: boolean): void;
2172
+ /**
2173
+ * Ask a participant to speak.
2174
+ * @param participantId - The ID of the participant to ask.
2175
+ */
1659
2176
  askToSpeak(participantId: string): void;
2177
+ /**
2178
+ * Ask a participant to turn on their camera.
2179
+ * @param participantId - The ID of the participant to ask.
2180
+ */
1660
2181
  askToTurnOnCamera(participantId: string): void;
2182
+ /**
2183
+ * Ask a participant to share their screen.
2184
+ * @param participantId - The ID of the participant to ask.
2185
+ */
1661
2186
  askToTurnOnScreenshare(participantId: string): void;
2187
+ /**
2188
+ * Accept a waiting participant.
2189
+ * @param participantId - The ID of the participant to accept.
2190
+ */
1662
2191
  acceptWaitingParticipant(participantId: string): void;
2192
+ /**
2193
+ * Put a waiting participant on hold, optionally sending them a message.
2194
+ * The participant remains in the waiting room.
2195
+ * @param participantId - The ID of the participant to put on hold.
2196
+ * @param response - An optional message to show the waiting participant.
2197
+ */
1663
2198
  holdWaitingParticipant(participantId: string, response?: string): void;
2199
+ /**
2200
+ * Reject a waiting participant, optionally sending them a message.
2201
+ * @param participantId - The ID of the participant to reject.
2202
+ * @param response - An optional message to show the rejected participant.
2203
+ */
1664
2204
  rejectWaitingParticipant(participantId: string, response?: string): void;
2205
+ /**
2206
+ * Start cloud recording.
2207
+ */
1665
2208
  startCloudRecording(): void;
2209
+ /**
2210
+ * Stop cloud recording.
2211
+ */
1666
2212
  stopCloudRecording(): void;
2213
+ /**
2214
+ * Start live transcription.
2215
+ */
1667
2216
  startLiveTranscription(): void;
2217
+ /**
2218
+ * Stop live transcription.
2219
+ */
1668
2220
  stopLiveTranscription(): void;
2221
+ /**
2222
+ * Start live captions.
2223
+ */
1669
2224
  startLiveCaptions(): void;
2225
+ /**
2226
+ * Stop live captions.
2227
+ */
1670
2228
  stopLiveCaptions(): void;
2229
+ /**
2230
+ * Start screensharing.
2231
+ */
1671
2232
  startScreenshare(): void;
2233
+ /**
2234
+ * Stop screensharing.
2235
+ */
1672
2236
  stopScreenshare(): void;
2237
+ /**
2238
+ * Stop participant screenshare.
2239
+ * @param participantId - The ID of the participant to stop screensharing.
2240
+ */
1673
2241
  stopParticipantScreenshare(participantId: string): void;
2242
+ /**
2243
+ * Lock or unlock the room.
2244
+ * @param locked - If true, locks the room; if false, unlocks it.
2245
+ */
1674
2246
  lockRoom(locked: boolean): void;
2247
+ /**
2248
+ * Mute participants.
2249
+ * @param participantIds - An array of participant IDs to mute.
2250
+ * This method will mute the specified participants.
2251
+ */
1675
2252
  muteParticipants(participantIds: string[]): void;
2253
+ /**
2254
+ * Turn off participant cameras.
2255
+ * @param participantIds - An array of participant IDs to turn off cameras for.
2256
+ * This method will turn off the specified participants' cameras.
2257
+ */
1676
2258
  turnOffParticipantCameras(participantIds: string[]): void;
2259
+ /**
2260
+ * Spotlight a participant.
2261
+ * @param participantId - The ID of the participant to spotlight.
2262
+ */
1677
2263
  spotlightParticipant(participantId: string): void;
2264
+ /**
2265
+ * Remove spotlight from a participant.
2266
+ * @param participantId - The ID of the participant to remove spotlight from.
2267
+ */
1678
2268
  removeSpotlight(participantId: string): void;
2269
+ /**
2270
+ * Kick a participant from the room.
2271
+ * @param participantId - The ID of the participant to kick.
2272
+ */
1679
2273
  kickParticipant(participantId: string): void;
2274
+ /**
2275
+ * End the meeting.
2276
+ * @param stayBehind - If true, the local participant will stay behind; if false, they will leave.
2277
+ * If undefined, defaults to false.
2278
+ */
1680
2279
  endMeeting(stayBehind?: boolean): void;
2280
+ /**
2281
+ * Share a room integration with everyone in the room, or in the current breakout group.
2282
+ *
2283
+ * The integration must be enabled for the room. `tagName` and `props` come from the integration's
2284
+ * own bootstrap: they describe which content element to render and with which attributes.
2285
+ *
2286
+ * @param options.roomIntegrationId - The integration to start.
2287
+ * @param options.tagName - Custom element name for the content frame.
2288
+ * @param options.shareUrl - The https url of the shared content.
2289
+ * @param options.props - Optional props to pass to the content frame.
2290
+ */
1681
2291
  startRoomIntegration(options: {
1682
2292
  roomIntegrationId: string;
1683
2293
  tagName: string;
1684
2294
  shareUrl: string;
1685
2295
  props?: RoomIntegrationProps;
1686
2296
  }): void;
2297
+ /**
2298
+ * Stop a running room integration.
2299
+ *
2300
+ * @param options.roomIntegrationSessionId - The running session to stop.
2301
+ * @param options.intent - "end" when the user deliberately ended it, otherwise "stop".
2302
+ */
1687
2303
  stopRoomIntegration(options: {
1688
2304
  roomIntegrationSessionId: string;
1689
2305
  intent?: "stop" | "end";
1690
2306
  }): void;
2307
+ /**
2308
+ * Update the props of a running room integration, propagating them to everyone in the room.
2309
+ * This is how integration state such as playback position is kept in sync.
2310
+ *
2311
+ * @param options.roomIntegrationSessionId - The running session to update.
2312
+ * @param options.props - Partial patch, merged into the session's existing props.
2313
+ */
1691
2314
  updateRoomIntegrationProps(options: {
1692
2315
  roomIntegrationSessionId: string;
1693
2316
  props: RoomIntegrationProps;
1694
2317
  }): void;
2318
+ /**
2319
+ * Join a breakout group.
2320
+ * @param group - The ID of the breakout group to join.
2321
+ */
1695
2322
  joinBreakoutGroup(group: string): void;
2323
+ /**
2324
+ * Join the breakout main room.
2325
+ */
1696
2326
  joinBreakoutMainRoom(): void;
2327
+ /**
2328
+ * Start a breakout session. Requires host privileges.
2329
+ * @param options - The groups, optional participant assignments and session settings.
2330
+ */
1697
2331
  startBreakoutSession(options: StartBreakoutSessionOptions): void;
2332
+ /**
2333
+ * Update an ongoing breakout session's groups and/or settings. Requires host privileges.
2334
+ * @param options - The groups, participant assignments and session settings to update.
2335
+ */
1698
2336
  updateBreakoutSession(options: UpdateBreakoutSessionOptions): void;
2337
+ /**
2338
+ * Stop the ongoing breakout session. Requires host privileges.
2339
+ */
1699
2340
  stopBreakoutSession(): void;
2341
+ /**
2342
+ * Assign participants to breakout groups. Requires host privileges.
2343
+ * @param assignments - A map of participant `clientId -> groupId`. Merged with the current
2344
+ * assignments (participants not included keep theirs); an empty `groupId` unassigns the participant.
2345
+ */
1700
2346
  assignBreakoutParticipants(assignments: {
1701
2347
  [clientId: string]: string;
1702
2348
  }): void;
2349
+ /**
2350
+ * Randomly distribute all remote participants across the breakout groups. Requires host privileges.
2351
+ */
1703
2352
  assignAllBreakoutParticipants(): void;
2353
+ /**
2354
+ * Clear all breakout group assignments. Requires host privileges.
2355
+ */
1704
2356
  unassignAllBreakoutParticipants(): void;
2357
+ /**
2358
+ * Re-shuffle the currently-assigned participants across the breakout groups. Requires host privileges.
2359
+ */
1705
2360
  shuffleBreakoutParticipants(): void;
2361
+ /**
2362
+ * Extend the running breakout timer. Requires host privileges.
2363
+ * @param seconds - Number of seconds to add (default 60).
2364
+ */
1706
2365
  extendBreakoutTimer(seconds?: number): void;
2366
+ /**
2367
+ * Stop the running breakout timer (the session itself stays active). Requires host privileges.
2368
+ */
1707
2369
  stopBreakoutTimer(): void;
2370
+ /**
2371
+ * Broadcast a main-room participant's audio/video into all breakout groups. This spotlights the
2372
+ * participant; during an active breakout the SFU routes their stream into every group. Requires
2373
+ * host privileges.
2374
+ * @param participantId - The clientId of the participant to broadcast.
2375
+ */
1708
2376
  broadcastToGroups(participantId: string): void;
2377
+ /**
2378
+ * Stop broadcasting a participant into the breakout groups (removes their spotlight). Requires
2379
+ * host privileges.
2380
+ * @param participantId - The clientId of the participant to stop broadcasting.
2381
+ */
1709
2382
  stopBroadcastToGroups(participantId: string): void;
2383
+ /**
2384
+ * Report stream resolution.
2385
+ * @param streamId - The ID of the stream to report.
2386
+ * @param width - The width of the stream.
2387
+ * @param height - The height of the stream.
2388
+ */
1710
2389
  reportStreamResolution(streamId: string, width: number, height: number): void;
2390
+ /**
2391
+ * Replace the local stream with a new effect stream.
2392
+ * @param effectId - The ID of the effect to use.
2393
+ */
1711
2394
  switchCameraEffect(effectId: string): Promise<void>;
2395
+ /**
2396
+ * Replace the local stream with a custom image effect stream.
2397
+ * @param imageUrl - The URL of the custom image to use as the background. This needs to be a base64 encoded image or a URL accessible from the browser.
2398
+ */
1712
2399
  switchCameraEffectCustom(imageUrl: string): Promise<void>;
2400
+ /**
2401
+ * Remove the effect stream and revert to the original local stream.
2402
+ */
1713
2403
  clearCameraEffect(): Promise<void>;
2404
+ /**
2405
+ * Enable audio noise suppression on the local microphone stream. The
2406
+ * denoiser is automatically reapplied if the microphone device is later
2407
+ * switched. The denoiser code is loaded on demand the first time it is
2408
+ * enabled.
2409
+ */
1714
2410
  enableAudioDenoiser(): Promise<void>;
2411
+ /**
2412
+ * Disable audio noise suppression and revert to the raw microphone stream.
2413
+ */
1715
2414
  disableAudioDenoiser(): Promise<void>;
2415
+ /**
2416
+ * Destroy the client.
2417
+ * This method will stop the app and reset the client state.
2418
+ */
1716
2419
  destroy(): void;
1717
2420
  }
1718
2421
 
2422
+ /**
2423
+ * The credentials of the device the SDK uses to call the Whereby API.
2424
+ */
1719
2425
  interface DeviceCredentials {
1720
2426
  deviceId: string;
1721
2427
  hmac: string;
@@ -1726,10 +2432,22 @@ declare class WherebyClient {
1726
2432
  private localMediaClient;
1727
2433
  protected roomConnectionClient: RoomConnectionClient;
1728
2434
  private gridClient;
2435
+ /**
2436
+ * @param options - @internal Base URL overrides for Whereby's own development. They may change without notice.
2437
+ */
1729
2438
  constructor(options?: ServicesOptions);
1730
2439
  getLocalMedia(): LocalMediaClient;
1731
2440
  getRoomConnection(): RoomConnectionClient;
1732
2441
  getGrid(): GridClient;
2442
+ /**
2443
+ * Gets the credentials of the device this client uses for the Whereby API, for apps that call the Whereby API
2444
+ * as the same device as the SDK. Build the header as `Authorization: Basic base64(deviceId:hmac)`.
2445
+ *
2446
+ * Returns the stored credentials if there are any. Otherwise it registers a new device, as joining a room does,
2447
+ * and stores its credentials. Concurrent calls share one request.
2448
+ *
2449
+ * @returns The device credentials, or null if the API returned none.
2450
+ */
1733
2451
  getDeviceCredentials(): Promise<DeviceCredentials | null>;
1734
2452
  getStore(): Store;
1735
2453
  destroy(): void;