@vkontakte/calls-sdk 2.8.13-beta.13 → 2.8.13-beta.14
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 +1 -1
- package/calls-sdk.cjs.js +6 -6
- package/calls-sdk.esm.js +2351 -2319
- package/classes/AudioOutput.d.ts +2 -3
- package/classes/CallRegistry.d.ts +5 -2
- package/classes/conversation/Conversation.d.ts +1 -0
- package/classes/conversation/Conversation.testUtils.d.ts +3 -3
- package/classes/transport/Statistics.d.ts +2 -2
- package/classes/transport/Transport.d.ts +3 -3
- package/default/Signaling.d.ts +2 -1
- package/package.json +1 -1
- package/types/ExternalId.d.ts +1 -1
- package/types/Participant.d.ts +2 -2
package/classes/AudioOutput.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type DebugLogger } from '../static/Debug';
|
|
2
|
-
import { ParticipantId } from '../types/Participant';
|
|
3
2
|
import StatEventCollector from './stat/StatEventCollector';
|
|
4
3
|
import { StatFirstMediaReceived } from './stat/StatFirstMediaReceived';
|
|
5
4
|
/**
|
|
@@ -17,8 +16,8 @@ export default class AudioOutput {
|
|
|
17
16
|
private readonly _logger;
|
|
18
17
|
private _autoplayRecoveryController;
|
|
19
18
|
constructor(statFirstMediaReceived: StatFirstMediaReceived, allowMultipleTracks?: boolean, debug?: DebugLogger, logger?: StatEventCollector | null);
|
|
20
|
-
add(
|
|
21
|
-
remove(
|
|
19
|
+
add(trackId: string, track: MediaStreamTrack): void;
|
|
20
|
+
remove(trackId: string, track: MediaStreamTrack): void;
|
|
22
21
|
get volume(): number;
|
|
23
22
|
set volume(volume: number);
|
|
24
23
|
destroy(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type Conversation from './conversation';
|
|
2
1
|
import MediaSettings from '../types/MediaSettings';
|
|
2
|
+
import type Conversation from './conversation';
|
|
3
3
|
export interface HoldableConversation extends Conversation {
|
|
4
4
|
id: string;
|
|
5
5
|
hold(hold: boolean, lastActiveMediaSettings?: MediaSettings): Promise<void>;
|
|
@@ -32,11 +32,14 @@ export declare class CallRegistry {
|
|
|
32
32
|
getActiveId(): string | null;
|
|
33
33
|
has(id: string, except?: HoldableConversation): boolean;
|
|
34
34
|
getAll(): HoldableConversation[];
|
|
35
|
+
getLive(except?: HoldableConversation): HoldableConversation[];
|
|
35
36
|
get callsLength(): number;
|
|
36
|
-
|
|
37
|
+
canAcceptIncoming(next: HoldableConversation): boolean;
|
|
38
|
+
setActive(id: string, acceptingIncoming?: boolean): Promise<void>;
|
|
37
39
|
setHold(id: string): Promise<void>;
|
|
38
40
|
switchCall(id: string): Promise<void>;
|
|
39
41
|
clear(): void;
|
|
42
|
+
private _canReplaceActive;
|
|
40
43
|
private _flushPendingRemovals;
|
|
41
44
|
}
|
|
42
45
|
declare const callRegistry: CallRegistry;
|
|
@@ -104,6 +104,7 @@ export default class Conversation extends EventEmitter {
|
|
|
104
104
|
* Внешний id звонящего во входящем звонке, либо null, если звонящий не найден.
|
|
105
105
|
*/
|
|
106
106
|
getIncomingCallerExternalId(): ExternalParticipantId | null;
|
|
107
|
+
get oneToOnePeer(): CompositeUserId | null;
|
|
107
108
|
private _buildInternalParams;
|
|
108
109
|
onStart({ opponentIds, opponentType, mediaOptions, payload, joiningAllowed, requireAuthToJoin, onlyAdminCanShareMovie, externalIds, onFastStart, conversationId, }: ConversationOnStartParams): Promise<ConversationData>;
|
|
109
110
|
onJoin(joinArgs: ConversationOnJoinParams): Promise<ConversationData>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FetchMock } from 'vitest-fetch-mock';
|
|
2
2
|
import { Mock } from 'vitest';
|
|
3
3
|
import { Client, Server } from 'mock-socket';
|
|
4
|
-
import { ISharedMovieInfo, OkUserId } from '../../CallsSDK';
|
|
4
|
+
import { CompositeUserId, ISharedMovieInfo, OkUserId } from '../../CallsSDK';
|
|
5
5
|
import Api from '../../default/Api';
|
|
6
6
|
import CallDirection from '../../enums/CallDirection';
|
|
7
7
|
import ConversationOption from '../../enums/ConversationOption';
|
|
@@ -106,7 +106,7 @@ export declare function createWaitingHallConversationData(): {
|
|
|
106
106
|
asrInfoByRoom: Map<any, any>;
|
|
107
107
|
audienceMode: boolean;
|
|
108
108
|
chatId: null;
|
|
109
|
-
compositeUserId:
|
|
109
|
+
compositeUserId: `u${number}` | `g${number}`;
|
|
110
110
|
concurrent: boolean;
|
|
111
111
|
direction: CallDirection;
|
|
112
112
|
externalId: ExternalParticipantId;
|
|
@@ -147,5 +147,5 @@ export declare function createConnectionMessage(data?: Partial<SignalingMessage.
|
|
|
147
147
|
export declare function createParticipant(id: number, data?: Partial<SignalingMessage.Participant>): SignalingMessage.Participant & Required<Pick<SignalingMessage.Participant, 'markers'>>;
|
|
148
148
|
export declare function createParticipantWithMarkers(id: number, data?: Partial<SignalingMessage.Participant>): SignalingMessage.Participant & Required<Pick<SignalingMessage.Participant, 'markers'>>;
|
|
149
149
|
export declare function createMarkers(data?: Partial<ParticipantListMarkers>): ParticipantListMarkers;
|
|
150
|
-
export declare function createMovieShareInfo(initiatorId:
|
|
150
|
+
export declare function createMovieShareInfo(initiatorId: CompositeUserId, data?: Partial<ISharedMovieInfo> | null): ISharedMovieInfo;
|
|
151
151
|
export {};
|
|
@@ -12,13 +12,13 @@ declare function extractTransport(stats: RTCStats[]): StatTransport;
|
|
|
12
12
|
* Extracts media statistics from the given stats
|
|
13
13
|
* @hidden
|
|
14
14
|
*/
|
|
15
|
-
declare function extractRtps(stats: RTCStats[], ssrcMap: Record<string, string
|
|
15
|
+
declare function extractRtps(stats: RTCStats[], ssrcMap: Partial<Record<string, string>>, needToExtractRemote?: boolean): StatRtp[];
|
|
16
16
|
/**
|
|
17
17
|
* Computes delta (the difference) between two stat reports.
|
|
18
18
|
* @hidden
|
|
19
19
|
*/
|
|
20
20
|
declare function delta(current: StatItem, previous: StatItem, needToExtractRemote?: boolean): StatItem;
|
|
21
|
-
declare function collectStats(pc: RTCPeerConnection, previous: StatItem | null, ssrcMap?: Record<string, string
|
|
21
|
+
declare function collectStats(pc: RTCPeerConnection, previous: StatItem | null, ssrcMap?: Partial<Record<string, string>>, needToExtractRemote?: boolean): Promise<StatItem>;
|
|
22
22
|
declare function setMark(name: string): void;
|
|
23
23
|
declare function clearMark(name: string): void;
|
|
24
24
|
declare function measureMark(name: string): null | number;
|
|
@@ -63,10 +63,10 @@ export declare class Transport extends EventEmitter {
|
|
|
63
63
|
setRemoteHold(hold: boolean): void;
|
|
64
64
|
getTopology(): TransportTopology;
|
|
65
65
|
isAllocated(participantId: ParticipantId): boolean;
|
|
66
|
-
allocated():
|
|
67
|
-
opened():
|
|
66
|
+
allocated(): ParticipantId[];
|
|
67
|
+
opened(): ParticipantId[];
|
|
68
68
|
getState(): TransportState | undefined;
|
|
69
|
-
getStates(): Record<
|
|
69
|
+
getStates(): Record<ParticipantId, TransportState>;
|
|
70
70
|
setAnimojiSvg(participantId: ParticipantId, svgData: AnimojiSvgData): void;
|
|
71
71
|
setAnimojiFill(fill: RGBTuple | string): void;
|
|
72
72
|
onCameraResolutionChanged(): Promise<void>;
|
package/default/Signaling.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { JSONObject } from '../static/Json';
|
|
|
17
17
|
import { IAsrStartParams, IAsrStopParams } from '../types/Asr';
|
|
18
18
|
import { ChangeSimulcast } from '../types/ChangeSimulcast';
|
|
19
19
|
import ConversationResponse from '../types/ConversationResponse';
|
|
20
|
+
import { ExternalUserId } from '../types/ExternalId';
|
|
20
21
|
import MediaModifiers from '../types/MediaModifiers';
|
|
21
22
|
import MediaSettings from '../types/MediaSettings';
|
|
22
23
|
import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
|
|
@@ -76,7 +77,7 @@ export default class Signaling extends EventEmitter {
|
|
|
76
77
|
changeParticipantState(state: ParticipantStateData, compositeUserId?: CompositeUserId): Promise<SignalingMessage>;
|
|
77
78
|
hold(hold: boolean): Promise<SignalingMessage>;
|
|
78
79
|
putHandsDown(): Promise<SignalingMessage>;
|
|
79
|
-
addParticipant(externalIds:
|
|
80
|
+
addParticipant(externalIds: ExternalUserId[], params?: AddParticipantParams): Promise<SignalingMessage>;
|
|
80
81
|
addParticipantLegacy(participantIds: CompositeUserId[], params?: AddParticipantParams): Promise<SignalingMessage>;
|
|
81
82
|
removeParticipant(participantId: CompositeUserId, ban?: boolean): Promise<SignalingMessage>;
|
|
82
83
|
allocateConsumer(description: RTCSessionDescription | null, capabilities: {
|
package/package.json
CHANGED
package/types/ExternalId.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare namespace ExternalIdUtils {
|
|
|
20
20
|
function fromId(id: ExternalUserId, type?: ExternalIdType, deviceIdx?: number): ExternalParticipantId;
|
|
21
21
|
function fromSignalingParticipant(participant: SignalingMessage.Participant, useDecorative?: boolean, fallbackToNonDecorative?: boolean): ExternalParticipantId | undefined;
|
|
22
22
|
function fromSignaling(signalingId: SignalingMessage.ExternalId, deviceIdx?: number): ExternalParticipantId;
|
|
23
|
-
function toSignaling(externalId: ExternalId):
|
|
23
|
+
function toSignaling(externalId: ExternalId): ExternalUserId;
|
|
24
24
|
function toString(externalId: ExternalId): ExternalIdString;
|
|
25
25
|
function fromIdToString(id: ExternalUserId, type?: ExternalIdType, deviceIdx?: number): ExternalIdString;
|
|
26
26
|
function fromString(stringId: ExternalIdString): ExternalParticipantId;
|
package/types/Participant.d.ts
CHANGED
|
@@ -11,13 +11,13 @@ import { StreamDescriptionString } from './ParticipantStreamDescription';
|
|
|
11
11
|
/**
|
|
12
12
|
* Уникально идентифицирует пользователя или группу
|
|
13
13
|
*/
|
|
14
|
-
export type CompositeUserId =
|
|
14
|
+
export type CompositeUserId = `${'u' | 'g'}${number}`;
|
|
15
15
|
/**
|
|
16
16
|
* Уникально идентифицирует участника звонка
|
|
17
17
|
* (одному пользователю могут соответствовать несколько участников, в случае если пользователь зашёл в звонок с нескольких устройств)
|
|
18
18
|
* Включает композитный id и постфикс с номером устройства, если он не равен 0
|
|
19
19
|
*/
|
|
20
|
-
export type ParticipantId =
|
|
20
|
+
export type ParticipantId = CompositeUserId | `${CompositeUserId}:d${number}`;
|
|
21
21
|
export type OkUserId = number;
|
|
22
22
|
/**
|
|
23
23
|
* Тип списка участников в звонке
|