@vkontakte/calls-sdk 2.8.13-dev.c70019f1.0 → 2.8.13-dev.d1c40237.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 (58) hide show
  1. package/CallsSDK.d.ts +14 -6
  2. package/abstract/BaseApi.d.ts +5 -4
  3. package/calls-sdk.cjs.js +7 -7
  4. package/calls-sdk.esm.js +2689 -2169
  5. package/classes/AudioOutput.d.ts +4 -3
  6. package/classes/CallRegistry.d.ts +5 -2
  7. package/classes/MediaSource.d.ts +8 -0
  8. package/classes/SignalingErrors.d.ts +6 -0
  9. package/classes/StatsLogger.d.ts +1 -1
  10. package/classes/conversation/Conversation.d.ts +13 -4
  11. package/classes/conversation/Conversation.testUtils.d.ts +3 -3
  12. package/classes/screenshare/ScreenCaptureSender.d.ts +2 -2
  13. package/classes/stat/BatteryStats.d.ts +25 -0
  14. package/classes/stat/CallLifecycleStats.d.ts +4 -1
  15. package/classes/stat/CallStatTail.d.ts +65 -0
  16. package/classes/stat/ClientResourceStats.d.ts +41 -0
  17. package/classes/stat/ClientStatsMeta.d.ts +16 -0
  18. package/classes/stat/CodecStatsAggregator.d.ts +4 -1
  19. package/classes/stat/ConversationStats.d.ts +14 -8
  20. package/classes/stat/MlStats.d.ts +37 -0
  21. package/classes/stat/SdpStats.d.ts +2 -0
  22. package/classes/stat/Stat.testUtils.d.ts +7 -0
  23. package/classes/stat/StatAggregator.d.ts +3 -1
  24. package/classes/stat/StatDrainScheduler.d.ts +39 -13
  25. package/classes/stat/StatEventCollector.d.ts +7 -12
  26. package/classes/stat/StatPings.d.ts +3 -1
  27. package/classes/stat/StatQueue.d.ts +45 -3
  28. package/classes/stat/StatSignalingCommands.d.ts +3 -1
  29. package/classes/transport/BaseTransport.d.ts +3 -3
  30. package/classes/transport/DirectStatReporter.d.ts +2 -2
  31. package/classes/transport/DirectTransport.d.ts +2 -2
  32. package/classes/transport/PerfStatReporter.d.ts +3 -2
  33. package/classes/transport/ServerTransport.d.ts +2 -2
  34. package/classes/transport/SimulcastSender.d.ts +2 -2
  35. package/classes/transport/Statistics.d.ts +2 -2
  36. package/classes/transport/Transport.d.ts +9 -7
  37. package/classes/transport/VadGate.d.ts +39 -0
  38. package/default/Api.d.ts +4 -3
  39. package/default/Signaling.d.ts +11 -17
  40. package/default/SignalingSession.d.ts +92 -0
  41. package/enums/ActiveFeature.d.ts +19 -0
  42. package/enums/Stat.d.ts +2 -0
  43. package/package.json +3 -3
  44. package/static/ApiTransport.d.ts +1 -1
  45. package/static/Params.d.ts +33 -10
  46. package/static/WebRTCUtils.d.ts +7 -0
  47. package/types/AddParticipantParams.d.ts +18 -0
  48. package/types/DeviceSelection.d.ts +8 -0
  49. package/types/ExternalId.d.ts +1 -1
  50. package/types/FastHangup.d.ts +4 -4
  51. package/types/Participant.d.ts +2 -2
  52. package/types/PerfStatReporter.d.ts +9 -1
  53. package/types/SignalingMessage.d.ts +2 -0
  54. package/types/Statistics.d.ts +5 -7
  55. package/utils/ErrorText.d.ts +2 -0
  56. package/abstract/BaseSignaling.d.ts +0 -143
  57. package/classes/stat/StatUnloadJournal.d.ts +0 -27
  58. package/default/SignalingTransport.d.ts +0 -80
package/CallsSDK.d.ts CHANGED
@@ -5,7 +5,7 @@ import type { IEffect, VideoEffects } from '@vkontakte/calls-video-effects';
5
5
  import type { EffectVoiceChange, VadControllerOptions, VadLib } from '@vkontakte/calls-audio-effects';
6
6
  import type * as Vmoji from '@vkontakte/calls-vmoji';
7
7
  import BaseLogger from './abstract/BaseLogger';
8
- import { AddParticipantParams } from './abstract/BaseSignaling';
8
+ import type { AddParticipantParams } from './types/AddParticipantParams';
9
9
  import HangupReason, { HangupReasonData, CustomError } from './classes/HangupReason';
10
10
  import { MediaTrackKind } from './classes/MediaSource';
11
11
  import { AudienceModeHandsResponse } from './types/AudienceMode';
@@ -73,6 +73,7 @@ import { FastStartHandler, FastStartParams } from './types/FastStart';
73
73
  import { FastJoinHandler, FastJoinParams, FastJoinResponse } from './types/FastJoin';
74
74
  import { FastHangupHandler, FastHangupParams, FastHangupResponse, HangupParams } from './types/FastHangup';
75
75
  import PushData from './types/PushData';
76
+ import type { DeviceSelection, DeviceSelectionMode } from './types/DeviceSelection';
76
77
  export type { CurrentLogItem, DebugLogGetParams, DebugLogSessionInfo, DebugLogStorageStats } from './utils/DebugStorage';
77
78
  /**
78
79
  * Информация о текущем браузере
@@ -114,6 +115,12 @@ export declare const browser: {
114
115
  * Возвращает сохраненное устройство вывода
115
116
  */
116
117
  getSavedOutput: typeof WebRTCUtils.getSavedOutput;
118
+ /** Возвращает способ выбора и фактически используемую камеру. */
119
+ getCameraSelection: typeof WebRTCUtils.getCameraSelection;
120
+ /** Возвращает способ выбора и фактически используемый микрофон. */
121
+ getMicrophoneSelection: typeof WebRTCUtils.getMicrophoneSelection;
122
+ /** Возвращает способ выбора и фактически используемый аудиовыход. */
123
+ getOutputSelection: typeof WebRTCUtils.getOutputSelection;
117
124
  /**
118
125
  * Проверяет получен ли доступ к камере
119
126
  */
@@ -273,7 +280,7 @@ export declare function callInternal(ids: OkUserId[], type: CallType | undefined
273
280
  * Обработать пуш о входящем звонке
274
281
  *
275
282
  * Для любого входящего пуша нужно вызвать этот метод.
276
- * Если уже есть активный звонок, метод отправит "занято" вызывающему абоненту
283
+ * Если уже есть звонок с другим пользователем и удержание выключено, метод отправит "занято" вызывающему абоненту
277
284
  *
278
285
  * Перед `acceptCall` и `declineCall` необходимо дождаться успешного завершения `processPush`.
279
286
  *
@@ -307,7 +314,7 @@ export declare function acceptCall(mediaOptions?: MediaOption[], conversationId?
307
314
  * @param params Параметры завершения. `params.conversationId` — ID звонка
308
315
  * (по умолчанию текущий активный), `params.reason` — причина завершения
309
316
  * для проброса в сигналинг (по умолчанию `REJECTED`). См. {@link ClientHangupReason}.
310
- * `params.onFastHangup` — опционально: вместо Calls API hangup при отклонении.
317
+ * `params.onFastHangup` — опционально: при ответе `{ success: false }` SDK отправляет Calls API beacon.
311
318
  * На закрытии вкладки не используется. См. {@link HangupParams}.
312
319
  */
313
320
  export declare function declineCall(params?: HangupParams): Promise<void>;
@@ -337,7 +344,7 @@ export declare function joinCallByLink(joinLink: string, mediaOptions?: MediaOpt
337
344
  * (по умолчанию текущий активный), `params.reason` — причина завершения
338
345
  * для проброса в сигналинг: по умолчанию `HUNGUP` (если звонок активен) или `CANCELED`.
339
346
  * См. {@link ClientHangupReason}.
340
- * `params.onFastHangup` — опционально: вместо Calls API hangup, если обработчик передан.
347
+ * `params.onFastHangup` — опционально: при ответе `{ success: false }` SDK отправляет Calls API beacon.
341
348
  * Без него отправляется Calls API beacon, если серверный ID уже известен. На `pagehide` всегда beacon.
342
349
  * Локальное завершение и постановка onHangup в очередь происходят сразу; Promise ждёт известную SDK работу по завершению
343
350
  * в пределах waitResponseDelay, без подтверждения доставки beacon или signaling HANGUP.
@@ -350,8 +357,9 @@ export declare function hangup(params?: HangupParams): Promise<void>;
350
357
  *
351
358
  * @param externalIds Внешние ID пользователей
352
359
  * @param params Параметры
360
+ * @returns Участники из ответа сервера в публичном формате; undefined, если активного звонка нет или сигналинг не готов.
353
361
  */
354
- export declare function addParticipant(externalIds: ExternalId | ExternalId[], params?: AddParticipantParams): Promise<void>;
362
+ export declare function addParticipant(externalIds: ExternalId | ExternalId[], params?: AddParticipantParams): Promise<ExternalParticipant[] | undefined>;
355
363
  /**
356
364
  * @deprecated - используйте addParticipant
357
365
  * @param uids
@@ -829,5 +837,5 @@ export declare function getSyncedTime(): number;
829
837
  * Версия SDK
830
838
  */
831
839
  export declare function version(): string;
832
- export type { AddParticipantParams, AudienceModeHandsResponse, BrowserName, ClientHangupReason, ClientStatsEvent, CompositeUserId, ConversationData, ConversationParams, ConversationResponse, CustomError, ExternalId, ExternalParticipant, ExternalParticipantListChunk, ExternalParticipantListMarker, ExternalParticipantListMarkers as ExternalParticipantMarkers, ExternalParticipantId, DisplayLayoutRequest, GetParticipantsSignalingResponse, GetRoomsSignalingResponse, HangupReasonData, IApiEnv, IAPIBaseUrl, IAsrStartParams, IAsrStopParams, IAsrData, IceServer, JSONArray, JSONObject, JSONType, Layout, MediaModifiers, MediaSettings, MuteStates, OkUserId, ParamsObject, ParticipantId, ParticipantLayout, ParticipantListMarkers, ParticipantListType, ParticipantPriority, ParticipantsStateList, ParticipantStateData, ParticipantStateDataKey, ParticipantStateMapped, ParticipantStreamDescription, ParticipantListChunkParameters, ParticipantListMarker, RequestKeyFrame, Rooms, IGetParticipantsParameters, ScreenCaptureSettings, SignalingMessage, StatResult, StopStream, WaitingHallResponse, IMovieMetaData, IVideoDimentions, IFeedbackExternal, ISharedMovieInfo, ISharedMovieStoppedInfo, ISharedMovieState, ISharedMovieStateResponse, IAddMovieParams, IOnRemoteMovieData, IMoviePreview, IRoomId, Room, RoomsUpdate, RoomParticipantUpdate, IUpdateMovieData, IFeaturesPerRole, IMuteParticipantParams, IMuteParticipantInternalParams, IStartStreamData, IStopStreamData, IPublishStreamData, VmojiError, FastStartHandler, FastStartParams, FastJoinHandler, FastJoinParams, FastJoinResponse, FastHangupHandler, FastHangupParams, FastHangupResponse, HangupParams, };
840
+ export type { AddParticipantParams, AudienceModeHandsResponse, BrowserName, ClientHangupReason, ClientStatsEvent, CompositeUserId, ConversationData, ConversationParams, ConversationResponse, CustomError, ExternalId, ExternalParticipant, ExternalParticipantListChunk, ExternalParticipantListMarker, ExternalParticipantListMarkers as ExternalParticipantMarkers, ExternalParticipantId, DisplayLayoutRequest, GetParticipantsSignalingResponse, GetRoomsSignalingResponse, HangupReasonData, IApiEnv, IAPIBaseUrl, IAsrStartParams, IAsrStopParams, IAsrData, IceServer, JSONArray, JSONObject, JSONType, Layout, MediaModifiers, MediaSettings, MuteStates, OkUserId, ParamsObject, ParticipantId, ParticipantLayout, ParticipantListMarkers, ParticipantListType, ParticipantPriority, ParticipantsStateList, ParticipantStateData, ParticipantStateDataKey, ParticipantStateMapped, ParticipantStreamDescription, ParticipantListChunkParameters, ParticipantListMarker, RequestKeyFrame, Rooms, IGetParticipantsParameters, ScreenCaptureSettings, SignalingMessage, StatResult, StopStream, WaitingHallResponse, IMovieMetaData, IVideoDimentions, IFeedbackExternal, ISharedMovieInfo, ISharedMovieStoppedInfo, ISharedMovieState, ISharedMovieStateResponse, IAddMovieParams, IOnRemoteMovieData, IMoviePreview, IRoomId, Room, RoomsUpdate, RoomParticipantUpdate, IUpdateMovieData, IFeaturesPerRole, IMuteParticipantParams, IMuteParticipantInternalParams, IStartStreamData, IStopStreamData, IPublishStreamData, VmojiError, FastStartHandler, FastStartParams, FastJoinHandler, FastJoinParams, FastJoinResponse, FastHangupHandler, FastHangupParams, FastHangupResponse, HangupParams, DeviceSelection, DeviceSelectionMode, };
833
841
  export { Api, AuthData, BaseLogger, CallDirection, CallType, ChatRoomEventType, ConversationOption, DebugMessageType, ExternalIdType, FacingMode, FatalError, HangupReason, HangupType, MediaOption, MediaTrackKind, MediaType, MuteState, ParticipantState, ParticipantStateDataValue, ParticipantStatus, RecordRole, Signaling, SignalingCommandType, SignalingConnectionType, SignalingNotification, Stat, UserRole, UserType, TransportTopology, RoomsEventType, ConversationFeature, ArrayDequeue, ApiExternal, VolumeDetector, };
@@ -8,10 +8,11 @@ import { ExternalId, ExternalParticipantId, ExternalUserId } from '../types/Exte
8
8
  import { OkUserId, ParticipantId } from '../types/Participant';
9
9
  import PushData from '../types/PushData';
10
10
  import { ApiCallStats } from '../classes/stat/ApiCallStats';
11
+ import { ClientStatsMeta } from '../classes/stat/ClientStatsMeta';
11
12
  export type ClientStats = {
12
13
  call_topology: 'D' | 'S';
13
14
  vcid: ConversationData['id'] | null;
14
- [k: string]: string | number | boolean | null;
15
+ [k: string]: string | string[] | number | boolean | null;
15
16
  };
16
17
  export type LogItem = {
17
18
  count?: number;
@@ -69,12 +70,12 @@ export default abstract class BaseApi {
69
70
  *
70
71
  * Резолвится только после подтверждённой сервером отправки.
71
72
  */
72
- logClientStats(items: ClientStats[]): Promise<void>;
73
+ logClientStats(items: ClientStats[], meta: ClientStatsMeta): Promise<void>;
73
74
  /**
74
75
  * method: vchat.clientStats под сохранённым session_key другого
75
76
  * пользователя. Одна попытка, без перелогина; AuthData не трогает.
76
77
  */
77
- logClientStatsWith(sessionKey: string, items: ClientStats[]): Promise<void>;
78
+ logClientStatsWith(sessionKey: string, items: ClientStats[], meta: ClientStatsMeta): Promise<void>;
78
79
  abstract uploadDebugLogs(conversationId: string, startTime: number, endTime: number, log: string): Promise<void>;
79
80
  getCachedParticipantIdByExternalId(externalId: ExternalId): ParticipantId | null;
80
81
  getCachedExternalIdByParticipantId(participantId: ParticipantId): ExternalParticipantId | null;
@@ -82,7 +83,7 @@ export default abstract class BaseApi {
82
83
  mapDecorativeId(decorativeId: ParticipantId, initialId: ParticipantId): void;
83
84
  unmapDecorativeId(initialId: ParticipantId): void;
84
85
  getDecorativeIdByInitialId(initialId: ParticipantId): ParticipantId | undefined;
85
- hangupConversation(conversationId: string, reason?: HangupType, hangupParams?: Partial<IHangupParams>): void;
86
+ hangupConversation(conversationId: string, reason?: HangupType, hangupParams?: Partial<IHangupParams>): Promise<boolean>;
86
87
  removeHistoryRecords(recordIds: number[]): Promise<void>;
87
88
  getServerTime(): Promise<number>;
88
89
  cleanup(): void;