@vkontakte/calls-sdk 2.8.13-dev.0b862caf.0 → 2.8.13-dev.0c2d0c81.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 +42 -12
- package/abstract/BaseApi.d.ts +13 -9
- package/calls-sdk.cjs.js +7 -7
- package/calls-sdk.esm.js +4153 -2890
- package/classes/AudioFix.d.ts +2 -2
- package/classes/AudioOutput.d.ts +5 -3
- package/classes/MediaSource.d.ts +9 -2
- package/classes/SpecListener.d.ts +2 -2
- package/classes/StatsLogger.d.ts +1 -1
- package/classes/VolumesDetector.d.ts +0 -1
- package/classes/codec/LibVPxDecoder.d.ts +2 -2
- package/classes/codec/LibVPxEncoder.d.ts +2 -2
- package/classes/codec/WebCodecsDecoder.d.ts +2 -2
- package/classes/codec/WebCodecsEncoder.d.ts +2 -2
- package/classes/codec/WorkerBase.d.ts +3 -3
- package/classes/conversation/Conversation.d.ts +9 -1
- package/classes/screenshare/ScreenCaptureReceiver.d.ts +2 -2
- package/classes/screenshare/ScreenCaptureSender.d.ts +2 -2
- package/classes/screenshare/StreamBuilder.d.ts +2 -2
- package/classes/stat/ApiCallStats.d.ts +12 -0
- package/classes/stat/BatteryStats.d.ts +25 -0
- package/classes/stat/CallLifecycleStats.d.ts +2 -2
- package/classes/stat/ClientResourceStats.d.ts +41 -0
- package/classes/stat/CodecStatsAggregator.d.ts +2 -2
- package/classes/stat/ConversationStats.d.ts +20 -3
- package/classes/stat/NetworkAdaptationStats.d.ts +35 -0
- package/classes/stat/PeerConnectionStats.d.ts +22 -0
- package/classes/stat/SdpStats.d.ts +40 -0
- package/classes/stat/Stat.testUtils.d.ts +10 -0
- package/classes/stat/StatAggregator.d.ts +12 -3
- package/classes/stat/StatClock.d.ts +28 -0
- package/classes/stat/StatDrainScheduler.d.ts +92 -0
- package/classes/stat/StatEventCollector.d.ts +50 -0
- package/classes/stat/StatPings.d.ts +4 -2
- package/classes/stat/StatQueue.d.ts +79 -0
- package/classes/stat/StatSignalingCommands.d.ts +2 -2
- package/classes/stat/StatUnloadJournal.d.ts +27 -0
- package/classes/transport/DirectTransport.d.ts +13 -2
- package/classes/transport/PerfStatReporter.d.ts +7 -1
- package/classes/transport/ServerTransport.d.ts +6 -2
- package/classes/transport/SimulcastSender.d.ts +2 -2
- package/classes/transport/Transport.d.ts +2 -2
- package/default/Api.d.ts +13 -1
- package/default/Signaling.d.ts +11 -3
- package/enums/ActiveFeature.d.ts +19 -0
- package/enums/SessionError.d.ts +10 -0
- package/enums/Stat.d.ts +26 -1
- package/package.json +1 -1
- package/static/ApiTransport.d.ts +4 -0
- package/static/AuthData.d.ts +11 -1
- package/static/BrowserEnvironment.d.ts +90 -0
- package/static/External.d.ts +7 -0
- package/static/Params.d.ts +57 -1
- package/static/SessionStore.d.ts +29 -0
- package/static/SimulcastInfo.d.ts +1 -0
- package/static/WebRTCUtils.d.ts +12 -76
- package/types/ClientStatsEvent.d.ts +12 -0
- package/types/DeviceSelection.d.ts +8 -0
- package/types/IEventualStatLog.d.ts +1 -1
- package/types/Params.d.ts +1 -1
- package/types/PerfStatReporter.d.ts +26 -1
- package/types/SignalingMessage.d.ts +1 -0
- package/types/Statistics.d.ts +22 -7
package/CallsSDK.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ import RoomsEventType from './enums/RoomsEventType';
|
|
|
28
28
|
import SignalingCommandType from './enums/SignalingCommandType';
|
|
29
29
|
import SignalingConnectionType from './enums/SignalingConnectionType';
|
|
30
30
|
import SignalingNotification from './enums/SignalingNotification';
|
|
31
|
+
import Stat from './enums/Stat';
|
|
31
32
|
import UserRole from './enums/UserRole';
|
|
32
33
|
import UserType from './enums/UserType';
|
|
33
34
|
import { DebugMessageType } from './static/Debug';
|
|
@@ -36,7 +37,8 @@ import { ParticipantStatus } from './static/External';
|
|
|
36
37
|
import { JSONArray, JSONObject, JSONType } from './static/Json';
|
|
37
38
|
import { ParamsObject } from './static/Params';
|
|
38
39
|
import Utils from './static/Utils';
|
|
39
|
-
import
|
|
40
|
+
import BrowserEnvironment, { BrowserName } from './static/BrowserEnvironment';
|
|
41
|
+
import WebRTCUtils, { FacingMode } from './static/WebRTCUtils';
|
|
40
42
|
import { IAsrData, IAsrStartParams, IAsrStopParams } from './types/Asr';
|
|
41
43
|
import { ConversationData } from './types/Conversation';
|
|
42
44
|
import { IFeaturesPerRole } from './types/ConversationFeature';
|
|
@@ -59,6 +61,7 @@ import { IRoomId, Room, RoomParticipantUpdate, Rooms, RoomsUpdate } from './type
|
|
|
59
61
|
import { ScreenCaptureSettings } from './types/ScreenCaptureSettings';
|
|
60
62
|
import SignalingMessage, { GetRoomsSignalingResponse, GetParticipantsSignalingResponse } from './types/SignalingMessage';
|
|
61
63
|
import { StatResult } from './types/Statistics';
|
|
64
|
+
import { ClientStatsEvent } from './types/ClientStatsEvent';
|
|
62
65
|
import { IStartStreamData, IStopStreamData, IPublishStreamData } from './types/Streams';
|
|
63
66
|
import { WaitingHallResponse } from './types/WaitingHall';
|
|
64
67
|
import { ArrayDequeue } from './utils/ArrayDequeue';
|
|
@@ -70,6 +73,7 @@ import { FastStartHandler, FastStartParams } from './types/FastStart';
|
|
|
70
73
|
import { FastJoinHandler, FastJoinParams, FastJoinResponse } from './types/FastJoin';
|
|
71
74
|
import { FastHangupHandler, FastHangupParams, FastHangupResponse, HangupParams } from './types/FastHangup';
|
|
72
75
|
import PushData from './types/PushData';
|
|
76
|
+
import type { DeviceSelection, DeviceSelectionMode } from './types/DeviceSelection';
|
|
73
77
|
export type { CurrentLogItem, DebugLogGetParams, DebugLogSessionInfo, DebugLogStorageStats } from './utils/DebugStorage';
|
|
74
78
|
/**
|
|
75
79
|
* Информация о текущем браузере
|
|
@@ -111,6 +115,12 @@ export declare const browser: {
|
|
|
111
115
|
* Возвращает сохраненное устройство вывода
|
|
112
116
|
*/
|
|
113
117
|
getSavedOutput: typeof WebRTCUtils.getSavedOutput;
|
|
118
|
+
/** Возвращает способ выбора и фактически используемую камеру. */
|
|
119
|
+
getCameraSelection: typeof WebRTCUtils.getCameraSelection;
|
|
120
|
+
/** Возвращает способ выбора и фактически используемый микрофон. */
|
|
121
|
+
getMicrophoneSelection: typeof WebRTCUtils.getMicrophoneSelection;
|
|
122
|
+
/** Возвращает способ выбора и фактически используемый аудиовыход. */
|
|
123
|
+
getOutputSelection: typeof WebRTCUtils.getOutputSelection;
|
|
114
124
|
/**
|
|
115
125
|
* Проверяет получен ли доступ к камере
|
|
116
126
|
*/
|
|
@@ -144,43 +154,57 @@ export declare const browser: {
|
|
|
144
154
|
*
|
|
145
155
|
* _Метод доступен до инициализации_
|
|
146
156
|
*/
|
|
147
|
-
isBrowserSupported: typeof
|
|
157
|
+
isBrowserSupported: typeof BrowserEnvironment.isBrowserSupported;
|
|
148
158
|
/**
|
|
149
159
|
* Проверяет поддержку трансляции экрана браузером
|
|
150
160
|
*
|
|
151
161
|
* _Метод доступен до инициализации_
|
|
152
162
|
*/
|
|
153
|
-
isScreenCapturingSupported: typeof
|
|
163
|
+
isScreenCapturingSupported: typeof BrowserEnvironment.isScreenCapturingSupported;
|
|
164
|
+
/**
|
|
165
|
+
* Проверяет поддержку выбора микрофона браузером, независимо от списка устройств и разрешений.
|
|
166
|
+
* Не запрашивает разрешения и не захватывает медиа.
|
|
167
|
+
*
|
|
168
|
+
* _Метод доступен до инициализации_
|
|
169
|
+
*/
|
|
170
|
+
canSelectAudioInput: typeof BrowserEnvironment.canSelectAudioInput;
|
|
171
|
+
/**
|
|
172
|
+
* Проверяет поддержку выбора аудиовыхода браузером, независимо от списка устройств и разрешений.
|
|
173
|
+
* Не запрашивает разрешения и не меняет аудиовыход.
|
|
174
|
+
*
|
|
175
|
+
* _Метод доступен до инициализации_
|
|
176
|
+
*/
|
|
177
|
+
canSelectAudioOutput: typeof BrowserEnvironment.canSelectAudioOutput;
|
|
154
178
|
/**
|
|
155
179
|
* Имя операционной системы
|
|
156
180
|
*
|
|
157
181
|
* _Метод доступен до инициализации_
|
|
158
182
|
*/
|
|
159
|
-
os: typeof
|
|
183
|
+
os: typeof BrowserEnvironment.os;
|
|
160
184
|
/**
|
|
161
185
|
* Мобильный браузер или нет
|
|
162
186
|
*
|
|
163
187
|
* _Метод доступен до инициализации_
|
|
164
188
|
*/
|
|
165
|
-
isMobile: typeof
|
|
189
|
+
isMobile: typeof BrowserEnvironment.isMobile;
|
|
166
190
|
/**
|
|
167
191
|
* Имя браузера
|
|
168
192
|
*
|
|
169
193
|
* _Метод доступен до инициализации_
|
|
170
194
|
*/
|
|
171
|
-
browserName: typeof
|
|
195
|
+
browserName: typeof BrowserEnvironment.browserName;
|
|
172
196
|
/**
|
|
173
197
|
* Версия браузера
|
|
174
198
|
*
|
|
175
199
|
* _Метод доступен до инициализации_
|
|
176
200
|
*/
|
|
177
|
-
browserVersion: typeof
|
|
201
|
+
browserVersion: typeof BrowserEnvironment.browserVersion;
|
|
178
202
|
/**
|
|
179
203
|
* Если браузер основан на хроме - возвращает версию
|
|
180
204
|
*
|
|
181
205
|
* _Метод доступен до инициализации_
|
|
182
206
|
*/
|
|
183
|
-
baseChromeVersion: typeof
|
|
207
|
+
baseChromeVersion: typeof BrowserEnvironment.baseChromeVersion;
|
|
184
208
|
/**
|
|
185
209
|
* Возвращает AudioContext
|
|
186
210
|
*/
|
|
@@ -190,7 +214,7 @@ export declare const browser: {
|
|
|
190
214
|
*
|
|
191
215
|
* _Метод доступен до инициализации_
|
|
192
216
|
*/
|
|
193
|
-
isAudioShareSupported: typeof
|
|
217
|
+
isAudioShareSupported: typeof BrowserEnvironment.isAudioShareSupported;
|
|
194
218
|
};
|
|
195
219
|
/**
|
|
196
220
|
* Вспомогательные функции
|
|
@@ -266,6 +290,11 @@ export declare function callInternal(ids: OkUserId[], type: CallType | undefined
|
|
|
266
290
|
export declare function processPush(conversationId: string, conversationParams?: string): Promise<void>;
|
|
267
291
|
export declare function processPushInternal(conversationId: string, type?: UserType, peerId?: number, conversationParams?: string, wsEndpoint?: string, userId?: number): Promise<void>;
|
|
268
292
|
export declare function getInbounds(): Promise<PushData[]>;
|
|
293
|
+
/**
|
|
294
|
+
* Запускает отправку клиентской статистики. Нужен только при
|
|
295
|
+
* `autoStartStats: false`; повторные вызовы ничего не делают.
|
|
296
|
+
*/
|
|
297
|
+
export declare function startStats(): void;
|
|
269
298
|
/**
|
|
270
299
|
* Авторизоваться для совершения звонков
|
|
271
300
|
*
|
|
@@ -325,8 +354,9 @@ export declare function hangup(params?: HangupParams): Promise<void>;
|
|
|
325
354
|
*
|
|
326
355
|
* @param externalIds Внешние ID пользователей
|
|
327
356
|
* @param params Параметры
|
|
357
|
+
* @returns Участники из ответа сервера в публичном формате; undefined, если активного звонка нет или сигналинг не готов.
|
|
328
358
|
*/
|
|
329
|
-
export declare function addParticipant(externalIds: ExternalId | ExternalId[], params?: AddParticipantParams): Promise<
|
|
359
|
+
export declare function addParticipant(externalIds: ExternalId | ExternalId[], params?: AddParticipantParams): Promise<ExternalParticipant[] | undefined>;
|
|
330
360
|
/**
|
|
331
361
|
* @deprecated - используйте addParticipant
|
|
332
362
|
* @param uids
|
|
@@ -804,5 +834,5 @@ export declare function getSyncedTime(): number;
|
|
|
804
834
|
* Версия SDK
|
|
805
835
|
*/
|
|
806
836
|
export declare function version(): string;
|
|
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, };
|
|
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, };
|
|
837
|
+
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, };
|
|
838
|
+
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, };
|
package/abstract/BaseApi.d.ts
CHANGED
|
@@ -7,17 +7,11 @@ import ConversationResponse from '../types/ConversationResponse';
|
|
|
7
7
|
import { ExternalId, ExternalParticipantId, ExternalUserId } from '../types/ExternalId';
|
|
8
8
|
import { OkUserId, ParticipantId } from '../types/Participant';
|
|
9
9
|
import PushData from '../types/PushData';
|
|
10
|
+
import { ApiCallStats } from '../classes/stat/ApiCallStats';
|
|
10
11
|
export type ClientStats = {
|
|
11
12
|
call_topology: 'D' | 'S';
|
|
12
13
|
vcid: ConversationData['id'] | null;
|
|
13
|
-
[k: string]: string | number | boolean | null;
|
|
14
|
-
};
|
|
15
|
-
export type ClientEvent = {
|
|
16
|
-
timestamp: number;
|
|
17
|
-
call_topology: 'D' | 'S';
|
|
18
|
-
event_type: string;
|
|
19
|
-
vcid: ConversationData['id'] | null;
|
|
20
|
-
[k: string]: string | number | boolean | null;
|
|
14
|
+
[k: string]: string | string[] | number | boolean | null;
|
|
21
15
|
};
|
|
22
16
|
export type LogItem = {
|
|
23
17
|
count?: number;
|
|
@@ -33,6 +27,9 @@ export type LogItem = {
|
|
|
33
27
|
};
|
|
34
28
|
export default abstract class BaseApi {
|
|
35
29
|
protected _abortSignal?: AbortSignal;
|
|
30
|
+
protected _apiCallStats: ApiCallStats | null;
|
|
31
|
+
/** Куда писать время выполнения запросов, появляется вместе со звонком */
|
|
32
|
+
setApiCallStats(apiCallStats: ApiCallStats | null): void;
|
|
36
33
|
/**
|
|
37
34
|
* Устанавливает сигнал прерывания для запуска звонка, если не успели отменить до установки соединения с другим участником, то он больше ни как не будет использоваться
|
|
38
35
|
* @param signal - Сигнал прерывания или undefined для очистки
|
|
@@ -69,8 +66,15 @@ export default abstract class BaseApi {
|
|
|
69
66
|
log(items: LogItem[]): void;
|
|
70
67
|
/**
|
|
71
68
|
* method: vchat.clientStats
|
|
69
|
+
*
|
|
70
|
+
* Резолвится только после подтверждённой сервером отправки.
|
|
71
|
+
*/
|
|
72
|
+
logClientStats(items: ClientStats[]): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* method: vchat.clientStats под сохранённым session_key другого
|
|
75
|
+
* пользователя. Одна попытка, без перелогина; AuthData не трогает.
|
|
72
76
|
*/
|
|
73
|
-
|
|
77
|
+
logClientStatsWith(sessionKey: string, items: ClientStats[]): Promise<void>;
|
|
74
78
|
abstract uploadDebugLogs(conversationId: string, startTime: number, endTime: number, log: string): Promise<void>;
|
|
75
79
|
getCachedParticipantIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
76
80
|
getCachedExternalIdByParticipantId(participantId: ParticipantId): ExternalParticipantId | null;
|