@vkontakte/calls-sdk 2.6.2-dev.c3593bf.0 → 2.6.2-dev.c3887cf.0

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.
Files changed (47) hide show
  1. package/CallsSDK.d.ts +63 -14
  2. package/abstract/BaseApi.d.ts +1 -1
  3. package/abstract/BaseSignaling.d.ts +14 -5
  4. package/calls-sdk.cjs.js +8 -8
  5. package/calls-sdk.esm.js +8 -8
  6. package/classes/Conversation.d.ts +31 -8
  7. package/classes/MediaSource.d.ts +7 -2
  8. package/classes/ProducerCommandSerializationService.d.ts +2 -0
  9. package/classes/codec/IEncoder.d.ts +3 -0
  10. package/classes/codec/LibVPxEncoder.d.ts +4 -1
  11. package/classes/codec/Types.d.ts +6 -1
  12. package/classes/codec/WebCodecsEncoder.d.ts +4 -1
  13. package/classes/screenshare/PacketHistory.d.ts +30 -0
  14. package/classes/screenshare/PacketHistory.test.d.ts +1 -0
  15. package/classes/screenshare/ScreenCaptureSender.d.ts +15 -1
  16. package/classes/screenshare/ScreenCongestionControl.d.ts +25 -0
  17. package/classes/screenshare/SharingStatReport.d.ts +6 -0
  18. package/classes/screenshare/Utils.d.ts +5 -0
  19. package/classes/transport/ServerTransport.d.ts +2 -0
  20. package/default/Api.d.ts +1 -1
  21. package/default/Signaling.d.ts +14 -5
  22. package/enums/ConversationOption.d.ts +2 -1
  23. package/enums/LiveStatus.d.ts +7 -0
  24. package/enums/MediaOption.d.ts +2 -1
  25. package/enums/RoomsEventType.d.ts +6 -0
  26. package/enums/SignalingCommandType.d.ts +11 -1
  27. package/enums/SignalingNotification.d.ts +8 -1
  28. package/package.json +1 -1
  29. package/static/External.d.ts +38 -3
  30. package/static/Params.d.ts +51 -2
  31. package/static/Polyfills.d.ts +6 -0
  32. package/static/WebRTCUtils.d.ts +2 -1
  33. package/types/Asr.d.ts +5 -0
  34. package/types/Conversation.d.ts +1 -0
  35. package/types/ConversationFeature.d.ts +3 -0
  36. package/types/Feedback.d.ts +22 -0
  37. package/types/MediaSettings.d.ts +4 -0
  38. package/types/MovieShare.d.ts +18 -2
  39. package/types/Participant.d.ts +1 -0
  40. package/types/ParticipantListChunk.d.ts +2 -0
  41. package/types/ParticipantStreamDescription.d.ts +2 -1
  42. package/types/Room.d.ts +72 -0
  43. package/types/SignalingMessage.d.ts +55 -2
  44. package/types/WaitingHall.d.ts +2 -8
  45. package/utils/ArrayDequeue.d.ts +24 -0
  46. package/utils/ArrayDequeue.spec.d.ts +1 -0
  47. package/worker/LibVPxEncoderWorker.d.ts +1 -1
package/CallsSDK.d.ts CHANGED
@@ -45,10 +45,16 @@ import ParticipantLayout, { Layout, StopStream } from './types/ParticipantLayout
45
45
  import { ParticipantListChunkParameters } from './types/ParticipantListChunk';
46
46
  import ParticipantPriority from './types/ParticipantPriority';
47
47
  import { MediaType, ParticipantStreamDescription } from './types/ParticipantStreamDescription';
48
+ import { Room, RoomsUpdate, RoomParticipantUpdate } from './types/Room';
49
+ import RoomsEventType from './enums/RoomsEventType';
48
50
  import SignalingMessage from './types/SignalingMessage';
49
51
  import { WaitingHallResponse } from './types/WaitingHall';
50
- import { ISharedMovieInfo, ISharedMovieStoppedInfo, ISharedMovieState, ISharedMovieStateResponse, IAddMovieParams, IOnRemoteMovieData, IMoviePreview } from './types/MovieShare';
52
+ import { IFeedbackExternal } from './types/Feedback';
53
+ import { ISharedMovieInfo, ISharedMovieStoppedInfo, ISharedMovieState, ISharedMovieStateResponse, IAddMovieParams, IOnRemoteMovieData, IMoviePreview, IUpdateMovieData } from './types/MovieShare';
51
54
  import ConversationFeature from './enums/ConversationFeature';
55
+ import { IFeaturesPerRole } from './types/ConversationFeature';
56
+ import { ArrayDequeue } from './utils/ArrayDequeue';
57
+ import { AsrInfo } from './types/Asr';
52
58
  /**
53
59
  * Информация о текущем браузере
54
60
  */
@@ -244,7 +250,7 @@ export declare function joinCallInternal(conversationId: string, mediaOptions: M
244
250
  * @param mediaOptions Нужно ли включать камеру и микрофон
245
251
  * @param anonymToken Токен анонимной авторизации
246
252
  */
247
- export declare function joinCallByLink(joinLink: string, mediaOptions?: MediaOption[], anonymToken?: string, observedIds?: ExternalUserId[]): Promise<ConversationData>;
253
+ export declare function joinCallByLink(joinLink: string, mediaOptions?: MediaOption[], anonymToken?: string, observedIds?: ExternalUserId[], payload?: string): Promise<ConversationData>;
248
254
  /**
249
255
  * Завершить текущий разговор
250
256
  */
@@ -278,6 +284,13 @@ export declare function changeDevice(kind: MediaDeviceKind, deviceId: string): P
278
284
  * @param state Включить или выключить
279
285
  */
280
286
  export declare function captureScreen(state: boolean): Promise<void>;
287
+ /**
288
+ * Включить/выключить захват экрана
289
+ *
290
+ * @param screenState Включить или выключить захват экрана.
291
+ * @param audioShareState Включить или выключить захват звука. Может быть использован только вместе с захватом экрана.
292
+ */
293
+ export declare function captureScreenAndAudio(screenState: boolean, audioShareState: boolean): Promise<void>;
281
294
  /**
282
295
  * Позволяет установить кастомный стрим для видео
283
296
  * например для стрима из canvas, с наложением изображений
@@ -345,9 +358,10 @@ export declare function grantRolesInternal(uid: OkUserId, roles: UserRole[], rev
345
358
  * @param externalId Внешний ID пользователя (если не указано, сработает на всех)
346
359
  * @param muteStates Состояние устройств пользователя
347
360
  * @param requestedMedia Попросить пользователя включить устройство
361
+ * @param roomId ID сессионного зала, либо ничего если в основном зале
348
362
  */
349
- export declare function muteParticipant(externalId: string | ExternalParticipantId | null, muteStates: MuteStates, requestedMedia?: MediaOption[]): Promise<void>;
350
- export declare function muteParticipantInternal(uid: OkUserId | null, muteStates: MuteStates, requestedMedia?: MediaOption[], deviceIdx?: number): Promise<void>;
363
+ export declare function muteParticipant(externalId: string | ExternalParticipantId | null, muteStates: MuteStates, requestedMedia?: MediaOption[], roomId?: number): Promise<void>;
364
+ export declare function muteParticipantInternal(uid: OkUserId | null, muteStates: MuteStates, requestedMedia?: MediaOption[], deviceIdx?: number, roomId?: number): Promise<void>;
351
365
  /**
352
366
  * Закрепить/открепить выбранного собеседника у всех (только если есть соответствующая роль)
353
367
  *
@@ -431,8 +445,8 @@ export declare function setVolume(volume: number): void;
431
445
  * @param enabled
432
446
  */
433
447
  export declare function forceRelayPolicy(enabled: boolean): void;
434
- export declare function startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null): Promise<SignalingMessage>;
435
- export declare function stopStream(): Promise<SignalingMessage>;
448
+ export declare function startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null, roomId?: number | null): Promise<SignalingMessage>;
449
+ export declare function stopStream(roomId?: number | null): Promise<SignalingMessage>;
436
450
  /**
437
451
  * Устанавливает роль участника в запись звонка
438
452
  * Если хотя бы у одного участника звонка выставлена роль, то в записи звонка будут
@@ -443,8 +457,9 @@ export declare function stopStream(): Promise<SignalingMessage>;
443
457
  *
444
458
  * @param externalId Внешний ID пользователя
445
459
  * @param role Роль, если null, то роль удалится
460
+ * @param roomId ID сессионного зала записи. Если null, то роль применится в основном звонке
446
461
  */
447
- export declare function recordSetRole(externalId: string | ExternalParticipantId, role: RecordRole | null): Promise<void>;
462
+ export declare function recordSetRole(externalId: string | ExternalParticipantId, role: RecordRole | null, roomId?: number | null): Promise<void>;
448
463
  export declare function getStreamInfo(): Promise<{
449
464
  movieId: any;
450
465
  preview: any;
@@ -461,18 +476,43 @@ export declare function addMovie(params: IAddMovieParams): Promise<{
461
476
  /**
462
477
  * Изменить видео/лайв в звонке
463
478
  *
464
- * @param movieId
465
- * @param gain
466
- * @param offset
467
- * @param pause
479
+ * @param params
468
480
  */
469
- export declare function updateMovie(movieId: string, gain?: number, offset?: number, pause?: boolean): Promise<void>;
481
+ export declare function updateMovie(params: IUpdateMovieData): Promise<void>;
470
482
  /**
471
483
  * Удалить видео/лайв из звонка
472
484
  *
473
485
  * @param movieId
474
486
  */
475
487
  export declare function removeMovie(movieId: string): Promise<void>;
488
+ /**
489
+ * Обновить комнаты
490
+ * @param rooms id в случае обновления комнаты
491
+ * @param assignRandomly рандомно назначить участников комнаты из свободных в соответствии с participantCount
492
+ */
493
+ export declare function updateRooms(rooms: {
494
+ id?: number;
495
+ name?: string;
496
+ participantCount?: number;
497
+ active?: boolean;
498
+ }[], assignRandomly: boolean): Promise<void>;
499
+ /**
500
+ * Активировать комнаты
501
+ * @param roomIds
502
+ * @param deactivate
503
+ */
504
+ export declare function activateRooms(roomIds: number[], deactivate: boolean): Promise<void>;
505
+ /**
506
+ * Cменить комнату
507
+ * @param toRoomId
508
+ * @param participantId
509
+ */
510
+ export declare function switchRoom(toRoomId?: number, participantId?: string | ExternalParticipantId | null): Promise<void>;
511
+ /**
512
+ * Удалить комнаты
513
+ * @param roomIds
514
+ */
515
+ export declare function removeRooms(roomIds: number[]): Promise<void>;
476
516
  /**
477
517
  * Устанавливает интервал обновления статистики и вызова `onStatistics`
478
518
  *
@@ -522,6 +562,7 @@ export declare function getWaitingHall(pageMarker?: string | null, count?: numbe
522
562
  export declare function promoteParticipant(externalId: ExternalId, demote?: boolean): Promise<void>;
523
563
  export declare function getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<import("./types/ExternalId").ExternalParticipantListChunk>;
524
564
  export declare function getParticipants(parameters: IGetParticipantsParameters): Promise<ExternalParticipant[]>;
565
+ export declare function feedback(key: string): Promise<SignalingMessage>;
525
566
  export declare function enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<void>;
526
567
  /**
527
568
  * Удаляет записи истории звонков
@@ -529,9 +570,17 @@ export declare function enableFeatureForRoles(feature: ConversationFeature, role
529
570
  * @param recordIds Идентификаторы записей истории
530
571
  */
531
572
  export declare function removeHistoryRecords(recordIds: number[]): Promise<void>;
573
+ /**
574
+ * Начинает текстовую расшифровку звонка
575
+ */
576
+ export declare function startAsr(): Promise<void>;
577
+ /**
578
+ * Заканчивает текстовую расшифровку звонка
579
+ */
580
+ export declare function stopAsr(): Promise<void>;
532
581
  /**
533
582
  * Версия SDK
534
583
  */
535
584
  export declare function version(): string;
536
- export type { AddParticipantParams, ConversationData, ConversationParams, ConversationResponse, ExternalId, ExternalParticipant, ExternalParticipantListMarkers as ExternalParticipantMarkers, ExternalParticipantId, HangupReasonData, IceServer, JSONArray, JSONObject, JSONType, Layout, MediaModifiers, MediaSettings, MuteStates, OkUserId, ParamsObject, ParticipantLayout, ParticipantPriority, ParticipantStateMapped, ParticipantStreamDescription, ParticipantListChunkParameters, IGetParticipantsParameters, SignalingMessage, StatResult, StopStream, WaitingHallResponse, IVideoDimentions, ISharedMovieInfo, ISharedMovieStoppedInfo, ISharedMovieState, ISharedMovieStateResponse, IAddMovieParams, IOnRemoteMovieData, IMoviePreview, };
537
- export { Api, BaseApi, BaseLogger, BaseSignaling, CallDirection, CallType, ChatRoomEventType, ConversationOption, DebugMessageType, ExternalIdType, FacingMode, FatalError, HangupReason, HangupType, MediaOption, MediaTrackKind, MediaType, MuteState, ParticipantState, ParticipantStatus, RecordRole, Signaling, SignalingCommandType, SignalingConnectionType, SignalingNotification, UserRole, UserType, Utils, TransportTopology, };
585
+ export type { AddParticipantParams, ConversationData, ConversationParams, ConversationResponse, ExternalId, ExternalParticipant, ExternalParticipantListMarkers as ExternalParticipantMarkers, ExternalParticipantId, HangupReasonData, IceServer, JSONArray, JSONObject, JSONType, Layout, MediaModifiers, MediaSettings, MuteStates, OkUserId, ParamsObject, ParticipantLayout, ParticipantPriority, ParticipantStateMapped, ParticipantStreamDescription, ParticipantListChunkParameters, IGetParticipantsParameters, SignalingMessage, StatResult, StopStream, WaitingHallResponse, IVideoDimentions, IFeedbackExternal, ISharedMovieInfo, ISharedMovieStoppedInfo, ISharedMovieState, ISharedMovieStateResponse, IAddMovieParams, IOnRemoteMovieData, IMoviePreview, Room, RoomsUpdate, RoomParticipantUpdate, IUpdateMovieData, IFeaturesPerRole, AsrInfo, };
586
+ export { Api, BaseApi, BaseLogger, BaseSignaling, CallDirection, CallType, ChatRoomEventType, ConversationOption, DebugMessageType, ExternalIdType, FacingMode, FatalError, HangupReason, HangupType, MediaOption, MediaTrackKind, MediaType, MuteState, ParticipantState, ParticipantStatus, RecordRole, Signaling, SignalingCommandType, SignalingConnectionType, SignalingNotification, UserRole, UserType, Utils, TransportTopology, RoomsEventType, ConversationFeature, ArrayDequeue, };
@@ -33,7 +33,7 @@ export default abstract class BaseApi {
33
33
  success: boolean;
34
34
  }>;
35
35
  getAnonymTokenByLink(joinLink: string, username?: string): Promise<string>;
36
- abstract joinConversationByLink(joinLink: string, isVideo?: boolean, observedIds?: ExternalUserId[]): Promise<ConversationResponse>;
36
+ abstract joinConversationByLink(joinLink: string, isVideo?: boolean, observedIds?: ExternalUserId[], payload?: string): Promise<ConversationResponse>;
37
37
  abstract getConversationParams(conversationId?: string): Promise<ConversationParams>;
38
38
  abstract getUserId(): OkUserId | null;
39
39
  abstract setUserId(userId: OkUserId): void;
@@ -12,13 +12,14 @@ import { JSONObject } from '../static/Json';
12
12
  import ConversationResponse from '../types/ConversationResponse';
13
13
  import MediaModifiers from '../types/MediaModifiers';
14
14
  import MediaSettings from '../types/MediaSettings';
15
- import { IAddMovieParams, ISharedMovieState } from '../types/MovieShare';
15
+ import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
16
16
  import MuteStates from '../types/MuteStates';
17
17
  import { CompositeUserId, ParticipantId } from '../types/Participant';
18
18
  import { ParticipantLayout, RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
19
19
  import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
20
20
  import SignalingMessage from '../types/SignalingMessage';
21
21
  import { WaitingParticipantId } from '../types/WaitingHall';
22
+ import { SharingStatReport } from '../classes/screenshare/SharingStatReport';
22
23
  /**
23
24
  * Параметры добавления пользователя в звонок
24
25
  */
@@ -59,19 +60,24 @@ export default abstract class BaseSignaling extends EventEmitter {
59
60
  [streamDesc: string]: ParticipantLayout | StopStream | RequestKeyFrame;
60
61
  }): Promise<SignalingMessage | void>;
61
62
  abstract addMovie(data: IAddMovieParams): Promise<SignalingMessage>;
62
- abstract updateMovie(data: ISharedMovieState): Promise<SignalingMessage>;
63
+ abstract updateMovie(data: IUpdateMovieData): Promise<SignalingMessage>;
63
64
  abstract removeMovie(data: any): Promise<SignalingMessage>;
65
+ abstract updateRooms(rooms: Record<any, any>[], assignRandomly: boolean): Promise<SignalingMessage>;
66
+ abstract activateRooms(roomIds: number[], deactivate: boolean): Promise<SignalingMessage>;
67
+ abstract switchRoom(toRoomId?: number, participantId?: ParticipantId): Promise<SignalingMessage>;
68
+ abstract removeRooms(roomIds: number[]): Promise<SignalingMessage>;
64
69
  abstract startStream(data: any): Promise<SignalingMessage>;
65
- abstract stopStream(): Promise<SignalingMessage>;
66
- abstract recordSetRole(participantId: ParticipantId, role: RecordRole | null): Promise<SignalingMessage>;
70
+ abstract stopStream(data: any): Promise<SignalingMessage>;
71
+ abstract recordSetRole(participantId: ParticipantId, role: RecordRole | null, roomId: number | null): Promise<SignalingMessage>;
67
72
  abstract getRecordStatus(): Promise<SignalingMessage>;
68
73
  abstract switchTopology(topology: TransportTopology, force?: boolean): Promise<SignalingMessage>;
69
74
  abstract reportPerfStat(report: PerfStatReport): Promise<SignalingMessage>;
75
+ abstract reportSharingStat(report: SharingStatReport): Promise<SignalingMessage>;
70
76
  abstract chatMessage(message: string, participantId: CompositeUserId | null): Promise<SignalingMessage>;
71
77
  abstract chatHistory(count: number): Promise<SignalingMessage>;
72
78
  abstract customData(data: JSONObject, participantId: ParticipantId | null): Promise<SignalingMessage>;
73
79
  abstract grantRoles(participantId: CompositeUserId, roles: UserRole[], revoke: boolean): Promise<SignalingMessage>;
74
- abstract muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia: MediaOption[]): Promise<SignalingMessage>;
80
+ abstract muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia: MediaOption[], roomId?: number): Promise<SignalingMessage>;
75
81
  abstract enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<SignalingMessage>;
76
82
  abstract pinParticipant(participantId: ParticipantId, unpin: boolean): Promise<SignalingMessage>;
77
83
  abstract updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<SignalingMessage>;
@@ -80,11 +86,14 @@ export default abstract class BaseSignaling extends EventEmitter {
80
86
  }): Promise<SignalingMessage>;
81
87
  abstract getWaitingHall(fromId: WaitingParticipantId | null, count?: number, backward?: boolean): Promise<SignalingMessage>;
82
88
  abstract promoteParticipant(participantId: CompositeUserId, demote?: boolean): Promise<SignalingMessage>;
89
+ abstract feedback(key: string): Promise<SignalingMessage>;
83
90
  abstract setProducerNotificationDataChannel(dataChannel: RTCDataChannel): void;
84
91
  abstract setProducerCommandDataChannel(dataChannel: RTCDataChannel): void;
85
92
  abstract useCommandDataChannel(status: boolean): void;
86
93
  abstract getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<SignalingMessage>;
87
94
  abstract getParticipants(externalIds: SignalingMessage.ExternalId[]): Promise<SignalingMessage>;
95
+ abstract startAsr(): Promise<SignalingMessage>;
96
+ abstract stopAsr(): Promise<SignalingMessage>;
88
97
  get ready(): boolean;
89
98
  setParticipantIdRegistry(participantIdRegistry: ParticipantIdRegistry): void;
90
99
  requestRealloc(): void;