@vkontakte/calls-sdk 2.8.5-dev.3825785e.0 → 2.8.5-dev.3b9792bd.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 +40 -12
- package/abstract/BaseApi.d.ts +2 -1
- package/abstract/BaseSignaling.d.ts +14 -5
- package/calls-sdk.cjs.js +8 -9
- package/calls-sdk.esm.js +8 -9
- package/classes/AudioFix.d.ts +4 -0
- package/classes/AudioOutput.d.ts +3 -0
- package/classes/Conversation.d.ts +20 -20
- package/classes/HangupReason.d.ts +13 -0
- package/classes/Logger.d.ts +3 -0
- package/classes/MediaSource.d.ts +25 -5
- package/classes/ProducerCommandSerializationService.d.ts +4 -0
- package/classes/VideoEffectsFpsLimiter.d.ts +23 -0
- package/classes/codec/IDecoder.d.ts +1 -1
- package/classes/codec/LibVPxDecoder.d.ts +1 -1
- package/classes/codec/LibVPxEncoder.d.ts +0 -3
- package/classes/codec/WebCodecsDecoder.d.ts +1 -1
- package/classes/screenshare/StreamBuilder.d.ts +1 -0
- package/classes/stat/StatFirstMediaReceived.d.ts +6 -5
- package/classes/transport/DirectStatReporter.d.ts +2 -1
- package/classes/transport/DirectTransport.d.ts +6 -4
- package/classes/transport/ServerTransport.d.ts +4 -0
- package/default/Api.d.ts +2 -1
- package/default/Signaling.d.ts +7 -5
- package/enums/ConversationOption.d.ts +2 -1
- package/enums/FatalError.d.ts +2 -1
- package/enums/HangupType.d.ts +2 -1
- package/enums/SignalingCommandType.d.ts +4 -1
- package/enums/SignalingNotification.d.ts +3 -1
- package/package.json +4 -3
- package/static/ApiTransport.d.ts +1 -1
- package/static/ConversationDebugLogger.d.ts +13 -0
- package/static/External.d.ts +14 -3
- package/static/Params.d.ts +68 -25
- package/static/SimulcastInfo.d.ts +13 -0
- package/static/Utils.d.ts +5 -4
- package/static/WebRTCUtils.d.ts +9 -3
- package/types/ChangeSimulcast.d.ts +6 -0
- package/types/Conversation.d.ts +2 -14
- package/types/EnableVideoSuspendSuggest.d.ts +3 -0
- package/types/GetLogUploadUrlParams.d.ts +6 -0
- package/types/GetLogUploadUrlResponse.d.ts +3 -0
- package/types/Params.d.ts +1 -1
- package/types/Participant.d.ts +5 -0
- package/types/SignalingMessage.d.ts +21 -0
- package/types/SimulcastInfo.d.ts +10 -0
- package/types/Statistics.d.ts +11 -4
- package/types/Streams.d.ts +0 -1
- package/types/VideoSettings.d.ts +13 -1
- package/utils/Conversation.d.ts +7 -1
- package/utils/DebugStorage.d.ts +6 -0
- package/utils/Media.d.ts +1 -2
- package/utils/NavigatorPermissions.d.ts +13 -0
package/CallsSDK.d.ts
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
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
6
|
import type * as Vmoji from '@vkontakte/calls-vmoji';
|
|
6
|
-
import BaseApi from './abstract/BaseApi';
|
|
7
7
|
import BaseLogger from './abstract/BaseLogger';
|
|
8
|
-
import
|
|
8
|
+
import { AddParticipantParams } from './abstract/BaseSignaling';
|
|
9
9
|
import HangupReason, { HangupReasonData } from './classes/HangupReason';
|
|
10
10
|
import { MediaTrackKind } from './classes/MediaSource';
|
|
11
11
|
import { AudienceModeHandsResponse } from './types/AudienceMode';
|
|
@@ -48,7 +48,7 @@ import { IVideoDimentions, MediaSettings } from './types/MediaSettings';
|
|
|
48
48
|
import { IAddMovieParams, IMovieMetaData, IMoviePreview, IOnRemoteMovieData, ISharedMovieInfo, ISharedMovieState, ISharedMovieStateResponse, ISharedMovieStoppedInfo, IUpdateMovieData } from './types/MovieShare';
|
|
49
49
|
import MuteStates, { IMuteParticipantInternalParams, IMuteParticipantParams } from './types/MuteStates';
|
|
50
50
|
import { IApiEnv } from './types/Params';
|
|
51
|
-
import { CompositeUserId, IGetParticipantsParameters, OkUserId, ParticipantId, ParticipantListMarker, ParticipantListMarkers, ParticipantListType, ParticipantStateMapped } from './types/Participant';
|
|
51
|
+
import { CompositeUserId, IGetParticipantsParameters, OkUserId, ParticipantId, ParticipantListMarker, ParticipantListMarkers, ParticipantListType, ParticipantsStateList, ParticipantStateMapped } from './types/Participant';
|
|
52
52
|
import ParticipantLayout, { Layout, RequestKeyFrame, StopStream } from './types/ParticipantLayout';
|
|
53
53
|
import { ParticipantListChunkParameters } from './types/ParticipantListChunk';
|
|
54
54
|
import ParticipantPriority from './types/ParticipantPriority';
|
|
@@ -63,6 +63,7 @@ import { ArrayDequeue } from './utils/ArrayDequeue';
|
|
|
63
63
|
import { ApiExternal } from './default/ApiExternal';
|
|
64
64
|
import AuthData from './static/AuthData';
|
|
65
65
|
import { VmojiError } from './types/Vmoji';
|
|
66
|
+
import { VolumeDetector } from './classes/VolumeDetector';
|
|
66
67
|
/**
|
|
67
68
|
* Информация о текущем браузере
|
|
68
69
|
*/
|
|
@@ -193,20 +194,24 @@ export declare const utils: {
|
|
|
193
194
|
*/
|
|
194
195
|
participantMarkerCompare: typeof Utils.participantMarkerCompare;
|
|
195
196
|
};
|
|
196
|
-
export declare function setApi(api: BaseApi): void;
|
|
197
|
-
export declare function setSignalingFactory(signalingFactory: () => BaseSignaling): void;
|
|
198
197
|
export declare function setLogger(logger: BaseLogger): void;
|
|
199
198
|
/**
|
|
200
|
-
* Устанавливает библиотеку эффектов
|
|
199
|
+
* Устанавливает библиотеку видео эффектов
|
|
201
200
|
*
|
|
202
201
|
* @param effects Экземпляр класса `VideoEffects` из `@vkontakte/calls-video-effects`
|
|
203
202
|
*/
|
|
204
203
|
export declare function setVideoEffects(effects: VideoEffects): void;
|
|
204
|
+
/**
|
|
205
|
+
* Устанавливает библиотеку аудио эффектов
|
|
206
|
+
*
|
|
207
|
+
* @param effects Экземпляр класса `EffectVoiceChange` из `@vkontakte/calls-audio-effects`
|
|
208
|
+
*/
|
|
209
|
+
export declare function setAudioEffects(effects: EffectVoiceChange): void;
|
|
205
210
|
/**
|
|
206
211
|
* Устанавливает библиотеку вимоджи
|
|
207
212
|
*
|
|
208
213
|
* @param vmoji Экземпляр класса `Vmoji` из `@vkontakte/calls-vmoji`
|
|
209
|
-
* @param sdk Экземпляр модуля `@vkontakte/calls-
|
|
214
|
+
* @param sdk Экземпляр модуля `@vkontakte/calls-sdk`, нужен для проброски дебаг сообщений
|
|
210
215
|
*/
|
|
211
216
|
export declare function setVmoji(vmoji: typeof Vmoji, sdk?: Parameters<typeof Vmoji.setSDK>[0] | null, renderingOptions?: Partial<Vmoji.RenderingOptions>, protocolVersion?: Vmoji.AnimojiVersion): void;
|
|
212
217
|
/**
|
|
@@ -368,8 +373,13 @@ export declare function changePriorities(priorities: ParticipantPriority[]): Pro
|
|
|
368
373
|
* Изменяет состояния пользователя в звонке (например, "поднять руку" или "отошёл")
|
|
369
374
|
*
|
|
370
375
|
* @param state Список состояний в виде ключ-значение. Максимальная длина ключей и значений - 5 символов. Пустые значения будут пропущены
|
|
376
|
+
* @param externalId Внешний ID пользователя
|
|
371
377
|
*/
|
|
372
|
-
export declare function changeParticipantState(state: Record<string, string
|
|
378
|
+
export declare function changeParticipantState(state: Record<string, string>, externalId?: ExternalId): Promise<void>;
|
|
379
|
+
/**
|
|
380
|
+
* Принудительно опустить руки участников в текущем сессионном зале админа
|
|
381
|
+
*/
|
|
382
|
+
export declare function putHandsDown(): Promise<void>;
|
|
373
383
|
/**
|
|
374
384
|
* Изменяет лейаут.
|
|
375
385
|
* Также сообщает серверу каких участников звонка стримить на этот клиент
|
|
@@ -413,6 +423,13 @@ export declare function setMediaModifiers(mediaModifiers: MediaModifiers): Promi
|
|
|
413
423
|
* @param enabled true - включить, false - отключить
|
|
414
424
|
*/
|
|
415
425
|
export declare function enableVideoSuspend(enabled: boolean): Promise<void>;
|
|
426
|
+
/**
|
|
427
|
+
* Режим, при котором будет предложено включить автоматическое
|
|
428
|
+
* отключение приёма видео в условиях плохого соединения
|
|
429
|
+
*
|
|
430
|
+
* @param enabled true - включить, false - отключить
|
|
431
|
+
*/
|
|
432
|
+
export declare function enableVideoSuspendSuggest(enabled: boolean): Promise<void>;
|
|
416
433
|
/**
|
|
417
434
|
* Включить/выключить опции звонка
|
|
418
435
|
*
|
|
@@ -504,7 +521,7 @@ export declare function forceRelayPolicy(enabled: boolean): void;
|
|
|
504
521
|
* @param groupId
|
|
505
522
|
* @param roomId
|
|
506
523
|
*/
|
|
507
|
-
export declare function startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null, roomId?: number | null
|
|
524
|
+
export declare function startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null, roomId?: number | null): Promise<undefined>;
|
|
508
525
|
/**
|
|
509
526
|
* Завершить трансляцию звонка
|
|
510
527
|
* @param roomId
|
|
@@ -595,12 +612,23 @@ export declare function debug(enabled: boolean): void;
|
|
|
595
612
|
* @param args
|
|
596
613
|
*/
|
|
597
614
|
export declare function debugMessage(type: DebugMessageType, ...args: any[]): void;
|
|
615
|
+
/**
|
|
616
|
+
* Отправляет клиенские логи по conversationId на сервер OK
|
|
617
|
+
* @example можно посмотреть в examples/anonym/index.html
|
|
618
|
+
*/
|
|
619
|
+
export declare function uploadDebugLogs(): Promise<void>;
|
|
598
620
|
/**
|
|
599
621
|
* Эффект локального видео
|
|
600
622
|
*
|
|
601
623
|
* @param effect
|
|
602
624
|
*/
|
|
603
625
|
export declare function changeVideoEffect(effect: IEffect | null): Promise<void>;
|
|
626
|
+
/**
|
|
627
|
+
* Эффект локального аудио
|
|
628
|
+
*
|
|
629
|
+
* @param effect
|
|
630
|
+
*/
|
|
631
|
+
export declare function changeAudioEffect(effects: string[], isPreset?: boolean): Promise<void>;
|
|
604
632
|
/**
|
|
605
633
|
* Позволяет установить кастомный стрим для аудио
|
|
606
634
|
*
|
|
@@ -644,7 +672,7 @@ export declare function getAudienceModeHands(): Promise<AudienceModeHandsRespons
|
|
|
644
672
|
* @param externalId Внешний ID пользователя
|
|
645
673
|
* @param demote Запретить вход/отобрать права спикера
|
|
646
674
|
*/
|
|
647
|
-
export declare function promoteParticipant(externalId
|
|
675
|
+
export declare function promoteParticipant(externalId?: ExternalId, demote?: boolean): Promise<void>;
|
|
648
676
|
/**
|
|
649
677
|
* Запросить/отозвать запрос на получение права стать спикером в комнате в
|
|
650
678
|
* режиме Audience
|
|
@@ -696,5 +724,5 @@ export declare function sendTestCommand(name: string, params?: any): void;
|
|
|
696
724
|
* Версия SDK
|
|
697
725
|
*/
|
|
698
726
|
export declare function version(): string;
|
|
699
|
-
export type { AddParticipantParams, AudienceModeHandsResponse, BrowserName, CompositeUserId, ConversationData, ConversationParams, ConversationResponse, ExternalId, ExternalParticipant, ExternalParticipantListChunk, ExternalParticipantListMarker, ExternalParticipantListMarkers as ExternalParticipantMarkers, ExternalParticipantId, GetParticipantsSignalingResponse, GetRoomsSignalingResponse, HangupReasonData, IApiEnv, IAsrStartParams, IAsrStopParams, IAsrData, IceServer, JSONArray, JSONObject, JSONType, Layout, MediaModifiers, MediaSettings, MuteStates, OkUserId, ParamsObject, ParticipantId, ParticipantLayout, ParticipantListMarkers, ParticipantListType, ParticipantPriority, 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, };
|
|
700
|
-
export { Api, AuthData,
|
|
727
|
+
export type { AddParticipantParams, AudienceModeHandsResponse, BrowserName, CompositeUserId, ConversationData, ConversationParams, ConversationResponse, ExternalId, ExternalParticipant, ExternalParticipantListChunk, ExternalParticipantListMarker, ExternalParticipantListMarkers as ExternalParticipantMarkers, ExternalParticipantId, GetParticipantsSignalingResponse, GetRoomsSignalingResponse, HangupReasonData, IApiEnv, IAsrStartParams, IAsrStopParams, IAsrData, IceServer, JSONArray, JSONObject, JSONType, Layout, MediaModifiers, MediaSettings, MuteStates, OkUserId, ParamsObject, ParticipantId, ParticipantLayout, ParticipantListMarkers, ParticipantListType, ParticipantPriority, ParticipantsStateList, 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, };
|
|
728
|
+
export { Api, AuthData, BaseLogger, CallDirection, CallType, ChatRoomEventType, ConversationOption, DebugMessageType, ExternalIdType, FacingMode, FatalError, HangupReason, HangupType, MediaOption, MediaTrackKind, MediaType, MuteState, ParticipantState, ParticipantStatus, RecordRole, Signaling, SignalingCommandType, SignalingConnectionType, SignalingNotification, UserRole, UserType, TransportTopology, RoomsEventType, ConversationFeature, ArrayDequeue, ApiExternal, VolumeDetector, };
|
package/abstract/BaseApi.d.ts
CHANGED
|
@@ -28,7 +28,6 @@ export type LogItem = {
|
|
|
28
28
|
uid: OkUserId | null;
|
|
29
29
|
};
|
|
30
30
|
export default abstract class BaseApi {
|
|
31
|
-
abstract init(): void;
|
|
32
31
|
abstract authorize(): Promise<void>;
|
|
33
32
|
abstract userId(participantId: ParticipantId): Promise<ExternalParticipantId>;
|
|
34
33
|
abstract createConversation(conversationId: string, payload?: string, requireAuthToJoin?: boolean, createConversationParameters?: {
|
|
@@ -63,6 +62,7 @@ export default abstract class BaseApi {
|
|
|
63
62
|
* method: vchat.clientEvents
|
|
64
63
|
*/
|
|
65
64
|
logClientEvents(items: ClientEvent[]): void;
|
|
65
|
+
abstract uploadDebugLogs(conversationId: string, startTime: number, endTime: number, log: string): Promise<void>;
|
|
66
66
|
abstract getOkIdsByExternalIds(externalIds: ExternalId[]): Promise<OkUserId[]>;
|
|
67
67
|
abstract getParticipantIdsByExternalIds(externalIds: ExternalId[]): Promise<Map<ExternalId, ParticipantId>>;
|
|
68
68
|
abstract getExternalIdsByOkIds(uids: OkUserId[]): Promise<ExternalParticipantId[]>;
|
|
@@ -75,5 +75,6 @@ export default abstract class BaseApi {
|
|
|
75
75
|
hangupConversation(conversationId: string): void;
|
|
76
76
|
sendUserFeedbackStats(conversationId: string, userResponse: number, reason?: string, groupCallUsersCount?: number): void;
|
|
77
77
|
removeHistoryRecords(recordIds: number[]): Promise<void>;
|
|
78
|
+
getServerTime(): Promise<number>;
|
|
78
79
|
cleanup(): void;
|
|
79
80
|
}
|
|
@@ -20,18 +20,26 @@ import { CompositeUserId, ParticipantId } from '../types/Participant';
|
|
|
20
20
|
import { ParticipantLayout, RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
|
|
21
21
|
import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
|
|
22
22
|
import SignalingMessage, { GetParticipantsSignalingResponse, GetRoomsSignalingResponse } from '../types/SignalingMessage';
|
|
23
|
+
import { ChangeSimulcast } from '../types/ChangeSimulcast';
|
|
23
24
|
import { IPublishStreamData, IRecordConfData, IStartStreamData, IStopStreamData } from '../types/Streams';
|
|
24
25
|
import { SharingStatReport } from '../classes/screenshare/SharingStatReport';
|
|
25
26
|
/**
|
|
26
27
|
* Параметры добавления пользователя в звонок
|
|
27
28
|
*/
|
|
28
29
|
export interface AddParticipantParams {
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated
|
|
32
|
+
*/
|
|
29
33
|
showChatHistory?: boolean;
|
|
30
34
|
ttChat?: boolean;
|
|
31
35
|
/**
|
|
32
36
|
* Удалить юзера из бан-листа. Доступно только админу звонка
|
|
33
37
|
*/
|
|
34
38
|
unban?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* JSON.stringify({show_chat_history: boolean})
|
|
41
|
+
*/
|
|
42
|
+
payload?: string;
|
|
35
43
|
}
|
|
36
44
|
/**
|
|
37
45
|
* Should trigger SignalingEvent.NOTIFICATION on notification message and SignalingEvent.FAILED on error
|
|
@@ -43,12 +51,11 @@ export default abstract class BaseSignaling extends EventEmitter {
|
|
|
43
51
|
abstract close(): void;
|
|
44
52
|
abstract hangup(reason: string): Promise<SignalingMessage | void>;
|
|
45
53
|
abstract acceptCall(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
46
|
-
abstract sendSdp(participantId: ParticipantId, sdp: RTCSessionDescriptionInit): Promise<SignalingMessage>;
|
|
54
|
+
abstract sendSdp(participantId: ParticipantId, sdp: RTCSessionDescriptionInit, extraPayload?: Record<string, any>): Promise<SignalingMessage>;
|
|
47
55
|
abstract sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidate): Promise<SignalingMessage>;
|
|
48
56
|
abstract changeMediaSettings(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
49
|
-
abstract changeParticipantState(state:
|
|
50
|
-
|
|
51
|
-
}): Promise<SignalingMessage>;
|
|
57
|
+
abstract changeParticipantState(state: Record<string, string>, compositeUserId?: CompositeUserId): Promise<SignalingMessage>;
|
|
58
|
+
abstract putHandsDown(): Promise<SignalingMessage>;
|
|
52
59
|
abstract addParticipant(participantId: CompositeUserId, params?: AddParticipantParams): Promise<SignalingMessage>;
|
|
53
60
|
abstract removeParticipant(participantId: CompositeUserId, ban?: boolean): Promise<SignalingMessage>;
|
|
54
61
|
abstract allocateConsumer(description: RTCSessionDescription | null, capabilities: {
|
|
@@ -92,11 +99,13 @@ export default abstract class BaseSignaling extends EventEmitter {
|
|
|
92
99
|
abstract pinParticipant(participantId: ParticipantId, unpin: boolean, roomId: number | null): Promise<SignalingMessage>;
|
|
93
100
|
abstract updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<SignalingMessage>;
|
|
94
101
|
abstract enableVideoSuspend(enabled: boolean): Promise<SignalingMessage>;
|
|
102
|
+
abstract enableVideoSuspendSuggest(enabled: boolean): Promise<SignalingMessage>;
|
|
103
|
+
abstract changeSimulcast(changeSimulcast: ChangeSimulcast): Promise<SignalingMessage>;
|
|
95
104
|
abstract changeOptions(changes: {
|
|
96
105
|
[key in ConversationOption]?: boolean;
|
|
97
106
|
}): Promise<SignalingMessage>;
|
|
98
107
|
abstract getWaitingHall(fromId: SignalingMessage.WaitingParticipantId | null, count?: number, backward?: boolean): Promise<SignalingMessage>;
|
|
99
|
-
abstract promoteParticipant(participantId
|
|
108
|
+
abstract promoteParticipant(participantId?: CompositeUserId, demote?: boolean): Promise<SignalingMessage>;
|
|
100
109
|
abstract requestPromotion(unrequest: boolean): Promise<SignalingMessage>;
|
|
101
110
|
abstract acceptPromotion(reject: boolean): Promise<SignalingMessage>;
|
|
102
111
|
abstract feedback(key: string): Promise<SignalingMessage>;
|