@vkontakte/calls-sdk 2.8.11-dev.d88537e0.0 → 2.8.11-dev.e63f7408.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.
@@ -0,0 +1,26 @@
1
+ import Conversation from './Conversation';
2
+ import MediaSettings from '../types/MediaSettings';
3
+ export interface HoldableConversation extends Conversation {
4
+ id: string;
5
+ hold(hold: boolean, lastActiveMediaSettings?: MediaSettings): Promise<void>;
6
+ }
7
+ export declare class CallRegistry {
8
+ private _conversations;
9
+ private _activeId;
10
+ private _mutex;
11
+ add(conversation: HoldableConversation): void;
12
+ remove(id: string | null): void;
13
+ get(id: string): HoldableConversation | undefined;
14
+ getActive(): HoldableConversation | null;
15
+ getFirst(): HoldableConversation | null;
16
+ getActiveId(): string | null;
17
+ has(id: string): boolean;
18
+ getAll(): HoldableConversation[];
19
+ get callsLength(): number;
20
+ setActive(id: string): Promise<void>;
21
+ setHold(id: string): Promise<void>;
22
+ switchCall(id: string): Promise<void>;
23
+ clear(): void;
24
+ }
25
+ declare const callRegistry: CallRegistry;
26
+ export { callRegistry };
@@ -16,7 +16,7 @@ import { ConversationData, ConversationOnStartParams } from '../types/Conversati
16
16
  import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalUserId } from '../types/ExternalId';
17
17
  import type { FastJoinHandler } from '../types/FastJoin';
18
18
  import MediaModifiers from '../types/MediaModifiers';
19
- import { IVideoDimentions } from '../types/MediaSettings';
19
+ import MediaSettings, { IVideoDimentions } from '../types/MediaSettings';
20
20
  import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
21
21
  import MuteStates from '../types/MuteStates';
22
22
  import { CompositeUserId, IGetParticipantsParameters, ParticipantId, ParticipantStateData } from '../types/Participant';
@@ -37,6 +37,9 @@ export default class Conversation extends EventEmitter {
37
37
  private _conversation;
38
38
  private _myLastRequestedLayouts;
39
39
  private _state;
40
+ private _previousState;
41
+ /** Если пользователь в зале ожидания, холд должен вызываться после промоута */
42
+ private _waitingHallHoldPending;
40
43
  private _participantState;
41
44
  private _participants;
42
45
  private _pendingParticipants;
@@ -52,10 +55,8 @@ export default class Conversation extends EventEmitter {
52
55
  private _isRealTimeAsrRequested;
53
56
  private _serverSettings;
54
57
  private _serverTimeOffset;
55
- private static _current;
56
- private static _activationMutex;
57
- private static _delayedHangup;
58
- private static _abortController;
58
+ private _delayedHangup;
59
+ private _abortController;
59
60
  private readonly _onUnload;
60
61
  private readonly _audioOutput;
61
62
  private readonly _stats;
@@ -73,6 +74,10 @@ export default class Conversation extends EventEmitter {
73
74
  static current(): Conversation | null;
74
75
  static hangupAfterInit(): void;
75
76
  static id(): string | null;
77
+ get id(): string;
78
+ get externalId(): ExternalParticipantId | undefined;
79
+ get mediaSettings(): MediaSettings | undefined;
80
+ get isCallHeld(): boolean;
76
81
  static debugSessionId(): string | null;
77
82
  static getSyncedTime(): number;
78
83
  get debugSessionId(): string | null;
@@ -112,7 +117,7 @@ export default class Conversation extends EventEmitter {
112
117
  destroy(): Promise<void>;
113
118
  private _getConversationParams;
114
119
  private _setConversationParams;
115
- private _addGeoParamsToEndpoint;
120
+ private _buildSignalingEndpoint;
116
121
  /**
117
122
  * @throws ErrorEvent
118
123
  */
@@ -139,7 +144,12 @@ export default class Conversation extends EventEmitter {
139
144
  private _registerParticipants;
140
145
  /** Установим состояние локальных мьютов */
141
146
  private _registerParticipantLocalMuteState;
142
- private _getStatusByTransportState;
147
+ private _remoteParticipantSessionState;
148
+ private _buildConnectionStatus;
149
+ private _isParticipantSessionStateApplicable;
150
+ private _setTransportStatus;
151
+ private _setSessionState;
152
+ private _emitParticipantTransition;
143
153
  private _registerParticipantInCache;
144
154
  private _getExistedParticipantByIdOrCreate;
145
155
  private _getExternalIdByParticipantId;
@@ -179,6 +189,7 @@ export default class Conversation extends EventEmitter {
179
189
  private _cleanupParticipants;
180
190
  private _cleanupParticipantAgnosticStreams;
181
191
  private _cleanupTransport;
192
+ private _cleanupTransportForHold;
182
193
  private _cleanupSpeakerDetector;
183
194
  private _cleanupSpecListener;
184
195
  private _cleanupSignaling;
@@ -206,7 +217,12 @@ export default class Conversation extends EventEmitter {
206
217
  */
207
218
  changePriorities(priorities: ParticipantPriority[]): Promise<void>;
208
219
  changeParticipantState(state: ParticipantStateData, compositeUserId?: CompositeUserId): Promise<void>;
209
- hold(hold: boolean): Promise<void>;
220
+ hold(hold: boolean, lastActiveMediaSettings?: MediaSettings): Promise<void>;
221
+ private _holdLocally;
222
+ private _resumeLocalMedia;
223
+ private _restoreStateAfterHold;
224
+ private _isWaitingForPromotion;
225
+ private _getWaitingForPromotionStatus;
210
226
  putHandsDown(): Promise<void>;
211
227
  requestKeyFrame(participantStreamDescription: ParticipantStreamDescription): Promise<void | SignalingMessage>;
212
228
  requestTestMode(consumerCommand: string, producerCommand: string): Promise<void>;
@@ -310,11 +326,17 @@ export default class Conversation extends EventEmitter {
310
326
  private _changeMultipleParticipantState;
311
327
  private _invokeRolesChangedCallbackIfNeeded;
312
328
  private _onSignalingNotification;
329
+ private _onSignalingTopologyChanged;
313
330
  private _onPromotionApproved;
314
331
  private _onSignalingReconnect;
315
332
  private _onSignalingFailed;
316
333
  private _onAcceptedCall;
317
334
  private _onHungup;
335
+ private _onSessionState;
336
+ private _reconcileParticipantSessionStates;
337
+ private _updateParticipantExternalId;
338
+ private _updateParticipantSessionState;
339
+ private _emitParticipantEffectiveStatusIfSessionOverridesTransport;
318
340
  private _onAddedParticipant;
319
341
  private _onJoinedParticipant;
320
342
  private _onClosedConversation;
@@ -351,6 +373,7 @@ export default class Conversation extends EventEmitter {
351
373
  private _onPinParticipant;
352
374
  private _onOptionsChanged;
353
375
  private _onNetworkStatus;
376
+ private _emitHeldParticipantsStatus;
354
377
  private _onRemoteStreamSecond;
355
378
  /**
356
379
  * Коллбек, вызывающийся при получении/остановке стрима от AnimojiReceiver
@@ -371,6 +394,7 @@ export default class Conversation extends EventEmitter {
371
394
  private _onSpeakerChanged;
372
395
  private _onTransportStateChanged;
373
396
  private _onTransportLocalStateChanged;
397
+ private _areTransportParticipantsOnHold;
374
398
  private _onRemoteTrackAdded;
375
399
  private _onRemoteTrackRemoved;
376
400
  private _removeAudioTrack;
@@ -400,6 +424,7 @@ export default class Conversation extends EventEmitter {
400
424
  private _onFeedback;
401
425
  private _onDecorativeParticipantIdChanged;
402
426
  private _onVideoSuspendSuggest;
427
+ private _onParticipantHold;
403
428
  private _isMe;
404
429
  private _getMuteStatesForRoomId;
405
430
  private _getMuteStatesForCurrentRoom;
@@ -409,6 +434,8 @@ export default class Conversation extends EventEmitter {
409
434
  private _getParticipants;
410
435
  private _getParticipant;
411
436
  }
437
+ declare function _resetPendingInstance(): void;
438
+ export { _resetPendingInstance };
412
439
  export declare class UpdateDisplayLayoutError extends Error {
413
440
  readonly participantErrors: {
414
441
  externalId: ExternalParticipantId;
@@ -0,0 +1,3 @@
1
+ import ConversationResponse from '../types/ConversationResponse';
2
+ export type ConversationResponseSource = 'startConversation' | 'joinConversation' | 'joinConversationByLink' | 'fastStart' | 'fastJoin';
3
+ export declare function assertValidConversationResponse(response: ConversationResponse | null | undefined, source: ConversationResponseSource): void;
@@ -47,6 +47,7 @@ export declare class MediaSource extends EventEmitter {
47
47
  /** Трек аудио эффектов. Не изменяется на протяжении всего времени */
48
48
  private _audioEffectsTrack;
49
49
  private _mediaSettings;
50
+ private _lastMediaSettings;
50
51
  private _videoStatusOnScreenCapturingEnabled;
51
52
  private _effect;
52
53
  private _audioEffectParams;
@@ -67,7 +68,11 @@ export declare class MediaSource extends EventEmitter {
67
68
  getSendAudioTrack(): MediaStreamTrack | null;
68
69
  get isAnimojiRequested(): boolean;
69
70
  addTrackToPeerConnection(pc: RTCPeerConnection, observer: boolean, noDataChannel: boolean): void;
71
+ /**
72
+ * @deprecated Используйте гетер mediaSettings
73
+ */
70
74
  getMediaSettings(): MediaSettings;
75
+ get mediaSettings(): MediaSettings;
71
76
  changeDevice(kind: MediaDeviceKind): Promise<void>;
72
77
  /**
73
78
  * Установка кастомного стрима для видео, например внешний шаринг экрана
@@ -95,6 +100,8 @@ export declare class MediaSource extends EventEmitter {
95
100
  private _setEffect;
96
101
  private _stopEffect;
97
102
  destroy(): void;
103
+ stopLocalMedia(): Promise<void>;
104
+ resumeLocalMedia(lastActiveMediaSettings?: MediaSettings): Promise<void>;
98
105
  toggleScreenCapturing(settings: ScreenCaptureSettings): Promise<void>;
99
106
  disableScreenCapturing(): Promise<void>;
100
107
  private videoTrackMuteHandler;
@@ -12,12 +12,17 @@ export default class SpecListener extends EventEmitter {
12
12
  private readonly _debug;
13
13
  private readonly _logger;
14
14
  private _connectionTimeout;
15
+ private _connectionTimeoutSuppressed;
15
16
  private _volumeTimeout;
16
17
  constructor(transport: Transport, volumesDetector: VolumesDetector, participants: Record<ParticipantId, Participant>, debug?: DebugLogger, logger?: StatsLogger | null);
17
18
  destroy(): void;
18
19
  onChangeRemoteMediaSettings(participantId: ParticipantId, mediaSettings: MediaSettings): void;
20
+ onParticipantHoldChanged(): void;
21
+ private _getConnectionTimeout;
22
+ private _getVolumeTimeout;
19
23
  private _onTransportStateChanged;
20
24
  private _onVolumesDetected;
21
25
  private _onConnectionTimeout;
26
+ private _reportConnectionTimeout;
22
27
  private _onVolumeTimeout;
23
28
  }
@@ -12,5 +12,7 @@ export default abstract class WorkerBase {
12
12
  protected _sendToWorker(type: string, data?: {
13
13
  [key: string]: any;
14
14
  }, transfer?: any[]): void;
15
+ private _formatWorkerError;
16
+ private _formatWorkerMessageError;
15
17
  static isBrowserSupported(): boolean;
16
18
  }
@@ -4,6 +4,7 @@ import { StatAggregator } from './StatAggregator';
4
4
  declare enum ECallType {
5
5
  DirectOutgoing = "direct_outgoing",
6
6
  DirectIncoming = "direct_incoming",
7
+ DirectJoin = "direct_join",
7
8
  ServerIncoming = "server_incoming",
8
9
  ServerJoinServer = "server_join_server",
9
10
  ServerChangeTopology = "server_change_topology"
@@ -17,8 +18,8 @@ export declare class StatFirstMediaReceived {
17
18
  constructor(statAggregator: StatAggregator);
18
19
  markAcceptCall(topology: TransportTopology): void;
19
20
  markAcceptedCall(topology?: TransportTopology): void;
20
- markParticipantJoined(topology: TransportTopology): void;
21
21
  markOnJoin(topology: TransportTopology): void;
22
+ markTopologyChanged(topology: TransportTopology): void;
22
23
  private mark;
23
24
  measure(): void;
24
25
  }
@@ -27,6 +27,7 @@ export default class DirectTransport extends BaseTransport {
27
27
  private _iceRestartTimeout;
28
28
  private _reconnectionTimeout;
29
29
  private _reconnectionPrevented;
30
+ private _remoteHold;
30
31
  private _lastStat;
31
32
  private _fingerprint;
32
33
  private _neverConnected;
@@ -50,6 +51,8 @@ export default class DirectTransport extends BaseTransport {
50
51
  updateSettings(settings: ServerSettings): void;
51
52
  preventRestart(): void;
52
53
  allowRestart(): void;
54
+ setRemoteHold(hold: boolean): void;
55
+ private _recreatePeerConnection;
53
56
  setAnimojiTransport(receiver: AnimojiReceiver, sender: AnimojiSender): void;
54
57
  close(error?: Error): void;
55
58
  private _setState;
@@ -48,7 +48,6 @@ export declare class Transport extends EventEmitter {
48
48
  private readonly _logger;
49
49
  private readonly _statAggregator;
50
50
  private readonly _codecStatsAggregator;
51
- private _vadController;
52
51
  constructor(topology: TransportTopology, signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null);
53
52
  updateSettings(settings: ServerSettings): void;
54
53
  updateStatisticsInterval(): void;
@@ -56,6 +55,8 @@ export declare class Transport extends EventEmitter {
56
55
  open(participantIds: ParticipantId[], peerId?: string | null, observer?: boolean, force?: boolean): void;
57
56
  close(participantId: ParticipantId): void;
58
57
  destroy(): void;
58
+ holdClose(): void;
59
+ setRemoteHold(hold: boolean): void;
59
60
  getTopology(): TransportTopology;
60
61
  isAllocated(participantId: ParticipantId): boolean;
61
62
  allocated(): string[];
@@ -90,8 +91,6 @@ export declare class Transport extends EventEmitter {
90
91
  private _onAnimojiStream;
91
92
  /** Обработчик, досылающий MediaSourceEvent.SOURCE_CHANGED событие до аллокации транспортов */
92
93
  private _onAnimojiStatus;
93
- private _createVad;
94
- private _updateVadTrack;
95
94
  private _createAnimojiTransport;
96
95
  private _removeAnimojiTransport;
97
96
  getStreamWaitingTimeMs(streamId: string, targetRtpTimestamp: number): number;
package/default/Api.d.ts CHANGED
@@ -5,6 +5,7 @@ import ConversationParams from '../types/ConversationParams';
5
5
  import ConversationResponse from '../types/ConversationResponse';
6
6
  import { ExternalId, ExternalParticipantId, ExternalUserId } from '../types/ExternalId';
7
7
  import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
8
+ import PushData from '../types/PushData';
8
9
  export default class Api extends BaseApi {
9
10
  private _userId;
10
11
  private _uuid;
@@ -13,6 +14,11 @@ export default class Api extends BaseApi {
13
14
  protected _call(method: string, data?: any, noSession?: boolean): Promise<any>;
14
15
  userId(participantId: ParticipantId): Promise<ExternalParticipantId>;
15
16
  authorize(): Promise<void>;
17
+ private _getAnonymLoginCacheKey;
18
+ private _getCachedAnonymLogin;
19
+ private _setCachedAnonymLogin;
20
+ private _removeCachedAnonymLogin;
21
+ private _applyAnonymLogin;
16
22
  logClientStats(items: ClientStats[]): void;
17
23
  logClientEvents(items: ClientEvent[]): void;
18
24
  uploadDebugLogs(conversationId: string, startTime: number, endTime: number, log: string): Promise<void>;
@@ -60,4 +66,5 @@ export default class Api extends BaseApi {
60
66
  cleanup(): void;
61
67
  private _getExternalIdsByOkIds;
62
68
  getServerTime(): Promise<number>;
69
+ getInbounds(): Promise<PushData[]>;
63
70
  }
@@ -9,7 +9,6 @@ import TransportTopology from '../enums/TransportTopology';
9
9
  import ConversationFeature from '../enums/ConversationFeature';
10
10
  import ConversationOption from '../enums/ConversationOption';
11
11
  import MediaOption from '../enums/MediaOption';
12
- import SignalingCommandType from '../enums/SignalingCommandType';
13
12
  import SignalingConnectionType from '../enums/SignalingConnectionType';
14
13
  import UserRole from '../enums/UserRole';
15
14
  import { type DebugLogger } from '../static/Debug';
@@ -26,29 +25,24 @@ import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/Partici
26
25
  import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
27
26
  import { StreamDescriptionString } from '../types/ParticipantStreamDescription';
28
27
  import { PerfStatReport } from '../types/PerfStatReporter';
29
- import SignalingMessage, { GetParticipantsSignalingResponse, GetRoomsSignalingResponse, SignalingSuccessResponse } from '../types/SignalingMessage';
28
+ import SignalingMessage, { GetParticipantsSignalingResponse, GetRoomsSignalingResponse } from '../types/SignalingMessage';
30
29
  import { IPublishStreamData, IStartStreamData, IStopStreamData } from '../types/Streams';
31
30
  export default class Signaling extends BaseSignaling {
32
- private socket;
33
- protected sequence: number;
31
+ private transport;
32
+ private sequence;
34
33
  private lastStamp;
35
34
  private websocketCommandsQueue;
36
35
  private datachannelCommandsQueue;
37
36
  private incomingCache;
38
37
  private responseHandlers;
39
38
  private connectionType;
40
- private reconnectCount;
41
- private endpoint;
42
- private wtEndpoint;
43
- protected conversationResolve: Function | null;
44
- protected conversationReject: Function | null;
39
+ private conversationResolve;
40
+ private conversationReject;
45
41
  private connected;
46
42
  private listenersReady;
47
- protected peerId: number | null;
48
- protected conversationId: string | null;
49
- private reconnectTimer;
43
+ private peerId;
44
+ private conversationId;
50
45
  private connectionMessageWaitTimer;
51
- private doctorTimer;
52
46
  private participantIdRegistry;
53
47
  private producerNotificationDataChannel;
54
48
  private producerCommandDataChannel;
@@ -57,16 +51,13 @@ export default class Signaling extends BaseSignaling {
57
51
  private readonly _debug;
58
52
  private readonly _logger;
59
53
  private readonly _statAggregator;
60
- private readonly _pings;
61
- private readonly _signalingCommands;
62
- private static get RECONNECT_DELAY();
63
- private static get RECONNECT_MAX_DELAY();
64
- private static get RECONNECT_MAX_COUNT();
54
+ private readonly _statPings;
55
+ private readonly _statSignalingCommands;
65
56
  private static get WAIT_CONNECTION_DELAY();
66
57
  private static get WAIT_RESPONSE_DELAY();
67
- private static get WAIT_MESSAGE_DELAY();
68
- constructor(debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, pings?: StatPings | null, signalingCommands?: StatSignalingCommands | null);
69
58
  get ready(): boolean;
59
+ constructor(debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, statPings?: StatPings | null, statSignalingCommands?: StatSignalingCommands | null);
60
+ setAbortSignal(signal: AbortSignal | undefined): void;
70
61
  setEndpoint(endpoint: string): void;
71
62
  setWebTransportEndpoint(endpoint: string | null): void;
72
63
  setConversationId(conversationId: string): void;
@@ -82,15 +73,6 @@ export default class Signaling extends BaseSignaling {
82
73
  * Open a connection with a signaling server
83
74
  */
84
75
  connect(connectionType: SignalingConnectionType): Promise<SignalingMessage.Connection>;
85
- /**
86
- * Send a command to a signaling server
87
- */
88
- protected _send<T extends SignalingSuccessResponse>(command: SignalingCommandType, params?: any, needResponse?: boolean, retryCount?: number): Promise<T>;
89
- /**
90
- * Send a raw command to a signaling server
91
- */
92
- protected _sendRaw<T extends SignalingSuccessResponse>(command: SignalingCommandType, params?: any, needResponse?: boolean, retryCount?: number): Promise<T>;
93
- private _isDataChannelCommand;
94
76
  getNextCommandSequenceNumber(): number;
95
77
  hangup(reason: string): Promise<SignalingMessage | void>;
96
78
  sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidate): Promise<SignalingMessage>;
@@ -173,34 +155,36 @@ export default class Signaling extends BaseSignaling {
173
155
  startAsr(params: IAsrStartParams): Promise<SignalingMessage>;
174
156
  stopAsr(params?: IAsrStopParams): Promise<SignalingMessage>;
175
157
  requestAsr(request: boolean): Promise<SignalingMessage>;
176
- private _buildUrl;
177
- protected _connect(connectionType: SignalingConnectionType, useWebTransport: boolean): void;
178
- protected _disconnect(code?: number): void;
158
+ /**
159
+ * Send a command to a signaling server
160
+ */
161
+ private _send;
162
+ /**
163
+ * Send a raw command to a signaling server
164
+ */
165
+ private _sendRaw;
166
+ private _isDataChannelCommand;
179
167
  private _onOpen;
180
168
  private _onMessage;
181
- protected _handleMessage(message: SignalingMessage): void;
169
+ private _handleMessage;
182
170
  private _handleErrorMessage;
183
- protected _handleCachedMessages(): void;
171
+ private _handleCachedMessages;
184
172
  private _throwError;
185
173
  private _onError;
186
174
  private _serializeErrorEvent;
187
- protected _onClose(event: CloseEvent): void;
188
- protected _closeSocket(error?: Error | null): void;
189
- protected _reconnect(): void;
175
+ private _onClose;
176
+ private _closeSocket;
190
177
  private _handleCommandResponse;
191
178
  private _handleCommandsQueue;
192
179
  private _startResponseTimer;
193
180
  private _serializeBinary;
194
181
  private _serializeJson;
195
182
  private _convertDisplayLayout;
196
- protected _waitConnectionMessage(): void;
197
- protected _stopWaitConnectionMessage(): void;
198
- /**
199
- * Отвечает за timeout логику в WebSocket, если неполучаем никаких сообщений в течении WAIT_MESSAGE_DELAY, то запускаем реконнект
200
- */
201
- private _startDoctor;
202
- private _stopDoctor;
203
- private isWebTransportAvailable;
183
+ private _waitConnectionMessage;
184
+ private _stopWaitConnectionMessage;
185
+ private _onTransportFailed;
186
+ private _onTransportReconnectScheduled;
187
+ private _onTransportConnectionDead;
204
188
  private _getSocketType;
205
189
  private _markTransportStat;
206
190
  private _logTransportStat;
@@ -0,0 +1,68 @@
1
+ import SignalingConnectionType from '../enums/SignalingConnectionType';
2
+ import { SignalingTransportType } from '../enums/SignalingTransportStat';
3
+ export declare enum SignalingTransportFailure {
4
+ EMPTY_ENDPOINT = "EMPTY_ENDPOINT",
5
+ NETWORK_ERROR = "NETWORK_ERROR",
6
+ ABORTED = "ABORTED"
7
+ }
8
+ export type SignalingTransportFailedEvent = {
9
+ failure: SignalingTransportFailure;
10
+ message: string;
11
+ remote?: boolean;
12
+ };
13
+ export type SignalingTransportReconnectEvent = {
14
+ count: number;
15
+ delay: number;
16
+ };
17
+ export type SignalingTransportHandlers = {
18
+ onOpen: () => void;
19
+ onMessage: (event: MessageEvent) => void;
20
+ onError: (event: Event) => void;
21
+ onClose: (event: CloseEvent) => void;
22
+ onFailed: (event: SignalingTransportFailedEvent) => void;
23
+ onReconnectScheduled: (event: SignalingTransportReconnectEvent) => void;
24
+ onConnectionDead: () => void;
25
+ };
26
+ export default class SignalingTransport {
27
+ private readonly handlers;
28
+ private socket;
29
+ private endpoint;
30
+ private wtEndpoint;
31
+ private peerId;
32
+ private lastStamp;
33
+ private connectionType;
34
+ private reconnectCount;
35
+ private reconnectTimer;
36
+ private doctorTimer;
37
+ private forceWebSocket;
38
+ private abortSignal;
39
+ private manualClose;
40
+ private currentType;
41
+ constructor(handlers: SignalingTransportHandlers);
42
+ get readyState(): number | null;
43
+ get type(): SignalingTransportType;
44
+ setEndpoint(endpoint: string): void;
45
+ setWebTransportEndpoint(endpoint: string | null): void;
46
+ setPeerId(peerId: number | null): void;
47
+ setLastStamp(lastStamp: number): void;
48
+ setAbortSignal(signal?: AbortSignal): void;
49
+ resetReconnectCount(): void;
50
+ connect(connectionType: SignalingConnectionType): void;
51
+ close(code?: number): void;
52
+ send(data: string | ArrayBuffer): void;
53
+ private _connect;
54
+ private _connectWebTransport;
55
+ private _connectWebSocket;
56
+ private _setSocketHandlers;
57
+ private _buildUrl;
58
+ private _canUseWebTransport;
59
+ private _onOpen;
60
+ private _onMessage;
61
+ private _onError;
62
+ private _onClose;
63
+ private _disconnect;
64
+ private _scheduleReconnect;
65
+ private _getReconnectDelay;
66
+ private _startDoctor;
67
+ private _stopDoctor;
68
+ }
@@ -53,6 +53,7 @@ declare enum HangupType {
53
53
  * - Приложение вызываемого не запущено или упало
54
54
  * - Брандмауэр или сетевые ограничения блокируют подключение
55
55
  */
56
- CALL_TIMEOUT = "CALL_TIMEOUT"
56
+ CALL_TIMEOUT = "CALL_TIMEOUT",
57
+ OBSOLETE_CLIENT = "OBSOLETE_CLIENT"
57
58
  }
58
59
  export default HangupType;
@@ -24,6 +24,7 @@ declare enum SignalingNotification {
24
24
  REALLOC_CON = "realloc-con",
25
25
  AUDIO_ACTIVITY = "audio-activity",
26
26
  SPEAKER_CHANGED = "speaker-changed",
27
+ SESSION_STATE = "session-state",
27
28
  STALLED_ACTIVITY = "stalled-activity",
28
29
  CHAT_MESSAGE = "chat-message",
29
30
  CUSTOM_DATA = "custom-data",
@@ -50,6 +51,7 @@ declare enum SignalingNotification {
50
51
  ASR_STARTED = "asr-started",
51
52
  ASR_STOPPED = "asr-stopped",
52
53
  DECORATIVE_PARTICIPANT_ID_CHANGED = "decorative-participant-id-changed",
53
- VIDEO_SUSPEND_SUGGEST = "video-suspend-suggest"
54
+ VIDEO_SUSPEND_SUGGEST = "video-suspend-suggest",
55
+ HOLD = "hold"
54
56
  }
55
57
  export default SignalingNotification;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.8.11-dev.d88537e0.0",
3
+ "version": "2.8.11-dev.e63f7408.0",
4
4
  "author": "vk.com",
5
5
  "description": "Library for video calls based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -14,7 +14,7 @@
14
14
  "**/*.d.ts"
15
15
  ],
16
16
  "dependencies": {
17
- "@vkontakte/calls-audio-effects": "1.2.10-dev.12fb226c.0",
17
+ "@vkontakte/calls-audio-effects": "1.2.8",
18
18
  "@vkontakte/calls-video-effects": "2.2.3-beta.7",
19
19
  "@vkontakte/calls-vmoji": "1.0.10-beta.17",
20
20
  "@vkontakte/libvpx": "2.0.9",
@@ -0,0 +1,5 @@
1
+ import { TCapabilities } from '../types/Capabilities';
2
+ declare namespace Capabilities {
3
+ function get(): TCapabilities;
4
+ }
5
+ export default Capabilities;