@vkontakte/calls-sdk 2.8.12-dev.ecf77be8.0 → 2.8.12-dev.fd0aff08.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.
package/CallsSDK.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * CallsSDK
3
3
  */
4
4
  import type { IEffect, VideoEffects } from '@vkontakte/calls-video-effects';
5
- import type { EffectVoiceChange } from '@vkontakte/calls-audio-effects';
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
8
  import { AddParticipantParams } from './abstract/BaseSignaling';
@@ -68,6 +68,7 @@ import { VmojiError } from './types/Vmoji';
68
68
  import { VolumeDetector } from './classes/VolumeDetector';
69
69
  import { FastStartHandler, FastStartParams } from './types/FastStart';
70
70
  import { FastJoinHandler, FastJoinParams, FastJoinResponse } from './types/FastJoin';
71
+ import { FastHangupHandler, FastHangupParams, FastHangupResponse, HangupParams } from './types/FastHangup';
71
72
  import PushData from './types/PushData';
72
73
  export type { CurrentLogItem, DebugLogGetParams, DebugLogSessionInfo, DebugLogStorageStats } from './utils/DebugStorage';
73
74
  /**
@@ -213,6 +214,13 @@ export declare function setVideoEffects(effects: VideoEffects): void;
213
214
  * @param effects Экземпляр класса `EffectVoiceChange` из `@vkontakte/calls-audio-effects`
214
215
  */
215
216
  export declare function setAudioEffects(effects: EffectVoiceChange): void;
217
+ /**
218
+ * Устанавливает поддержку VAD
219
+ *
220
+ * @param vad принимает VadController из `@vkontakte/calls-audio-effects`
221
+ * @param options принимает VadControllerOptions из `@vkontakte/calls-audio-effects`
222
+ */
223
+ export declare function setVad(vad: VadLib, options?: VadControllerOptions): void;
216
224
  /**
217
225
  * Устанавливает библиотеку вимоджи
218
226
  *
@@ -274,13 +282,13 @@ export declare function acceptCall(mediaOptions?: MediaOption[], conversationId?
274
282
  /**
275
283
  * Отклонить входящий звонок
276
284
  *
277
- * @param conversationId ID звонка
278
- * @param params.reason Причина завершения для проброса в сигналинг
279
- * (по умолчанию `REJECTED`). См. {@link ClientHangupReason}.
285
+ * @param params Параметры завершения. `params.conversationId` ID звонка
286
+ * (по умолчанию текущий активный), `params.reason` причина завершения
287
+ * для проброса в сигналинг (по умолчанию `REJECTED`). См. {@link ClientHangupReason}.
288
+ * `params.onFastHangup` — опционально: вместо Calls API hangup при отклонении.
289
+ * На закрытии вкладки не используется. См. {@link HangupParams}.
280
290
  */
281
- export declare function declineCall(conversationId?: string, params?: {
282
- reason?: ClientHangupReason;
283
- }): Promise<void>;
291
+ export declare function declineCall(params?: HangupParams): Promise<void>;
284
292
  /**
285
293
  * Присоединиться к активному звонку
286
294
  *
@@ -303,13 +311,15 @@ export declare function joinCallByLink(joinLink: string, mediaOptions?: MediaOpt
303
311
  /**
304
312
  * Завершить текущий разговор
305
313
  *
306
- * @param conversationId ID звонка
307
- * @param params.reason Причина завершения для проброса в сигналинг.
308
- * По умолчанию `HUNGUP` (если звонок активен) или `CANCELED`. См. {@link ClientHangupReason}.
314
+ * @param params Параметры завершения. `params.conversationId` ID звонка
315
+ * (по умолчанию текущий активный), `params.reason` причина завершения
316
+ * для проброса в сигналинг: по умолчанию `HUNGUP` (если звонок активен) или `CANCELED`.
317
+ * См. {@link ClientHangupReason}.
318
+ * `params.onFastHangup` — опционально: вместо Calls API hangup, если обработчик передан.
319
+ * Без него API hangup не вызывается (signaling hangup остаётся). На `pagehide` всегда beacon.
320
+ * См. {@link HangupParams}.
309
321
  */
310
- export declare function hangup(conversationId?: string, params?: {
311
- reason?: ClientHangupReason;
312
- }): Promise<void>;
322
+ export declare function hangup(params?: HangupParams): Promise<void>;
313
323
  /**
314
324
  * Добавить собеседника в звонок
315
325
  *
@@ -794,5 +804,5 @@ export declare function getSyncedTime(): number;
794
804
  * Версия SDK
795
805
  */
796
806
  export declare function version(): string;
797
- export type { AddParticipantParams, AudienceModeHandsResponse, BrowserName, ClientHangupReason, 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, };
807
+ export type { AddParticipantParams, AudienceModeHandsResponse, BrowserName, ClientHangupReason, 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, };
798
808
  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, UserRole, UserType, TransportTopology, RoomsEventType, ConversationFeature, ArrayDequeue, ApiExternal, VolumeDetector, };
@@ -1,5 +1,6 @@
1
1
  import CallType from '../enums/CallType';
2
2
  import HangupType from '../enums/HangupType';
3
+ import { IHangupParams } from '../types/Api';
3
4
  import { ConversationData } from '../types/Conversation';
4
5
  import ConversationParams from '../types/ConversationParams';
5
6
  import ConversationResponse from '../types/ConversationResponse';
@@ -79,7 +80,7 @@ export default abstract class BaseApi {
79
80
  unmapDecorativeId(decorativeId: OkUserId | CompositeUserId | ParticipantId): void;
80
81
  getDecorativeIdByInitialId(okId: OkUserId | CompositeUserId | ParticipantId): OkUserId | undefined;
81
82
  replaceByInitialIdIdIfExists(id: OkUserId | CompositeUserId | ParticipantId): OkUserId;
82
- hangupConversation(conversationId: string, reason?: HangupType): void;
83
+ hangupConversation(conversationId: string, reason?: HangupType, hangupParams?: Partial<IHangupParams>): void;
83
84
  removeHistoryRecords(recordIds: number[]): Promise<void>;
84
85
  getServerTime(): Promise<number>;
85
86
  cleanup(): void;
@@ -45,6 +45,9 @@ export interface AddParticipantParams {
45
45
  export declare class SignalingDisposedError extends Error {
46
46
  constructor(command?: string);
47
47
  }
48
+ export declare class ProducerConnectionClosedError extends Error {
49
+ constructor(command?: string);
50
+ }
48
51
  /**
49
52
  * Should trigger SignalingEvent.NOTIFICATION on notification message and SignalingEvent.FAILED on error
50
53
  * https://wiki.odkl.ru/display/projects/Signaling+API#SignalingAPI-Notifications
@@ -122,6 +125,7 @@ export default abstract class BaseSignaling extends EventEmitter {
122
125
  abstract setProducerNotificationDataChannel(dataChannel: RTCDataChannel): void;
123
126
  abstract setProducerCommandDataChannel(dataChannel: RTCDataChannel): void;
124
127
  abstract useCommandDataChannel(status: boolean): void;
128
+ abstract resetProducerConnection(cause?: Error): void;
125
129
  abstract getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<SignalingMessage>;
126
130
  abstract getParticipants(externalIds: SignalingMessage.ExternalId[]): Promise<GetParticipantsSignalingResponse>;
127
131
  abstract getPeerId(): number | null;