@vkontakte/calls-sdk 2.8.6-dev.6d4d9d1b.0 → 2.8.6-dev.7059c449.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 +10 -0
- package/abstract/BaseSignaling.d.ts +3 -1
- package/calls-sdk.cjs.js +8 -8
- package/calls-sdk.esm.js +8 -8
- package/classes/Conversation.d.ts +3 -6
- package/default/Signaling.d.ts +5 -2
- package/package.json +4 -1
- package/types/ConversationResponse.d.ts +4 -0
- package/types/ExternalId.d.ts +1 -0
- package/types/WebTransport.d.ts +34 -0
- package/utils/LengthPrefixed.d.ts +48 -0
- package/utils/VariableLengthInteger.d.ts +18 -0
|
@@ -37,7 +37,6 @@ export default class Conversation extends EventEmitter {
|
|
|
37
37
|
private _state;
|
|
38
38
|
private _participantState;
|
|
39
39
|
private _participants;
|
|
40
|
-
private _pendingParticipants;
|
|
41
40
|
private _transport;
|
|
42
41
|
private _debugInfo;
|
|
43
42
|
private _volumesDetector;
|
|
@@ -89,13 +88,14 @@ export default class Conversation extends EventEmitter {
|
|
|
89
88
|
accept(mediaOptions: MediaOption[]): Promise<ConversationData>;
|
|
90
89
|
decline(): Promise<void>;
|
|
91
90
|
hangup(): Promise<void>;
|
|
92
|
-
addParticipant(participantIds:
|
|
91
|
+
addParticipant(participantIds: ExternalId[], params?: AddParticipantParams): Promise<void>;
|
|
92
|
+
addParticipantLegacy(participantIds: CompositeUserId[], params?: AddParticipantParams): Promise<void>;
|
|
93
93
|
removeParticipant(participantId: CompositeUserId, ban?: boolean): Promise<void>;
|
|
94
94
|
setVolume(volume: number): void;
|
|
95
95
|
updateStatisticsInterval(): void;
|
|
96
96
|
private _openTransport;
|
|
97
97
|
private _close;
|
|
98
|
-
destroy():
|
|
98
|
+
destroy(): void;
|
|
99
99
|
private _getConversationParams;
|
|
100
100
|
private _addGeoParamsToEndpoint;
|
|
101
101
|
/**
|
|
@@ -381,9 +381,6 @@ export default class Conversation extends EventEmitter {
|
|
|
381
381
|
private _getMuteStatesForCurrentRoom;
|
|
382
382
|
private _setMuteStatesForRoomId;
|
|
383
383
|
private _forceOpenTransportForAloneInCall;
|
|
384
|
-
private _registerParticipant;
|
|
385
|
-
private _getParticipants;
|
|
386
|
-
private _getParticipant;
|
|
387
384
|
}
|
|
388
385
|
export declare class UpdateDisplayLayoutError extends Error {
|
|
389
386
|
readonly participantErrors: {
|
package/default/Signaling.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
33
33
|
private responseHandlers;
|
|
34
34
|
private reconnectCount;
|
|
35
35
|
private endpoint;
|
|
36
|
+
private wtEndpoint;
|
|
36
37
|
protected conversationResolve: Function | null;
|
|
37
38
|
protected conversationReject: Function | null;
|
|
38
39
|
private connected;
|
|
@@ -57,6 +58,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
57
58
|
private static _getCapabilityFlags;
|
|
58
59
|
get ready(): boolean;
|
|
59
60
|
setEndpoint(endpoint: string): void;
|
|
61
|
+
setWebTransportEndpoint(endpoint: string | null): void;
|
|
60
62
|
setConversationId(conversationId: string): void;
|
|
61
63
|
setParticipantIdRegistry(participantIdRegistry: ParticipantIdRegistry): void;
|
|
62
64
|
setProducerNotificationDataChannel(dataChannel: RTCDataChannel): void;
|
|
@@ -88,7 +90,8 @@ export default class Signaling extends BaseSignaling {
|
|
|
88
90
|
changeMediaSettings(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
89
91
|
changeParticipantState(state: ParticipantStateData, compositeUserId?: CompositeUserId): Promise<SignalingMessage>;
|
|
90
92
|
putHandsDown(): Promise<SignalingMessage>;
|
|
91
|
-
addParticipant(
|
|
93
|
+
addParticipant(externalIds: CompositeUserId[], params?: AddParticipantParams): Promise<SignalingMessage>;
|
|
94
|
+
addParticipantLegacy(participantIds: CompositeUserId[], params?: AddParticipantParams): Promise<SignalingMessage>;
|
|
92
95
|
removeParticipant(participantId: CompositeUserId, ban?: boolean): Promise<SignalingMessage>;
|
|
93
96
|
allocateConsumer(description: RTCSessionDescription | null, capabilities: {
|
|
94
97
|
[key: string]: number | boolean | string;
|
|
@@ -160,7 +163,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
160
163
|
startAsr(params: IAsrStartParams): Promise<SignalingMessage>;
|
|
161
164
|
stopAsr(params?: IAsrStopParams): Promise<SignalingMessage>;
|
|
162
165
|
requestAsr(request: boolean): Promise<SignalingMessage>;
|
|
163
|
-
protected _connect(connectionType: SignalingConnectionType): void;
|
|
166
|
+
protected _connect(connectionType: SignalingConnectionType, useWebTransport: boolean): void;
|
|
164
167
|
protected _disconnect(code?: number): void;
|
|
165
168
|
private _onOpen;
|
|
166
169
|
private _onMessage;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/calls-sdk",
|
|
3
|
-
"version": "2.8.6-dev.
|
|
3
|
+
"version": "2.8.6-dev.7059c449.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,11 +14,14 @@
|
|
|
14
14
|
"**/*.d.ts"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
+
"@fails-components/webtransport": "^1.3.0",
|
|
18
|
+
"@fails-components/webtransport-transport-http3-quiche": "^1.3.0",
|
|
17
19
|
"@vkontakte/calls-audio-effects": "1.2.8",
|
|
18
20
|
"@vkontakte/calls-video-effects": "2.2.3-beta.5",
|
|
19
21
|
"@vkontakte/calls-vmoji": "1.0.10-beta.17",
|
|
20
22
|
"@vkontakte/libvpx": "2.0.9",
|
|
21
23
|
"bit-buffer": "0.2.5",
|
|
24
|
+
"fflate": "^0.8.2",
|
|
22
25
|
"messagepack": "1.1.12",
|
|
23
26
|
"simple-ebml-builder": "0.2.2",
|
|
24
27
|
"webrtc-adapter": "7.7.0"
|
package/types/ExternalId.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export declare namespace ExternalIdUtils {
|
|
|
19
19
|
function fromId(id: ExternalUserId, type?: ExternalIdType, deviceIdx?: number): ExternalParticipantId;
|
|
20
20
|
function fromSignalingParticipant(participant: SignalingMessage.Participant, useDecorative?: boolean): ExternalParticipantId | undefined;
|
|
21
21
|
function fromSignaling(signalingId: SignalingMessage.ExternalId, deviceIdx?: number): ExternalParticipantId;
|
|
22
|
+
function toSignaling(externalId: ExternalId): string;
|
|
22
23
|
function toString(externalId: ExternalId): ExternalIdString;
|
|
23
24
|
function fromIdToString(id: ExternalUserId, type?: ExternalIdType, deviceIdx?: number): ExternalIdString;
|
|
24
25
|
function fromString(stringId: ExternalIdString): ExternalParticipantId;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
interface WebTransportHash {
|
|
2
|
+
algorithm?: string;
|
|
3
|
+
value?: BufferSource;
|
|
4
|
+
}
|
|
5
|
+
interface WebTransportOptions {
|
|
6
|
+
allowPooling?: boolean;
|
|
7
|
+
congestionControl?: CongestionControlType;
|
|
8
|
+
requireUnreliable?: boolean;
|
|
9
|
+
serverCertificateHashes?: WebTransportHash[];
|
|
10
|
+
}
|
|
11
|
+
type CongestionControlType = 'default' | 'low-latency' | 'throughput';
|
|
12
|
+
declare class WebTransportEventual {
|
|
13
|
+
private webTransport;
|
|
14
|
+
private stream;
|
|
15
|
+
private writer;
|
|
16
|
+
private reader;
|
|
17
|
+
private readonly url;
|
|
18
|
+
private readonly options;
|
|
19
|
+
private readonly compression;
|
|
20
|
+
private encoder;
|
|
21
|
+
private decoder;
|
|
22
|
+
onopen: ((this: WebTransportEventual, ev: Event) => any) | null;
|
|
23
|
+
onmessage: ((this: WebTransportEventual, ev: MessageEvent) => any) | null;
|
|
24
|
+
onerror: ((this: WebTransportEventual, ev: Event) => any) | null;
|
|
25
|
+
onclose: ((this: WebTransportEventual, ev: CloseEvent) => any) | null;
|
|
26
|
+
readyState: number;
|
|
27
|
+
constructor(url: string, options?: WebTransportOptions);
|
|
28
|
+
private getCompressionTypeFromUrl;
|
|
29
|
+
private connect;
|
|
30
|
+
private readLoop;
|
|
31
|
+
send(data: string): Promise<void>;
|
|
32
|
+
close(code?: number, reason?: string): void;
|
|
33
|
+
}
|
|
34
|
+
export { WebTransportEventual as WebTransport };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encodes a string into a Uint8Array, prepending the length of the string as a variable-length integer and optionally compressing it.
|
|
3
|
+
*/
|
|
4
|
+
declare class LengthPrefixedTextEncoder {
|
|
5
|
+
private readonly encoder;
|
|
6
|
+
private readonly compression;
|
|
7
|
+
private readonly lengthEncoder;
|
|
8
|
+
constructor(compression?: 'gzip' | 'deflate' | 'deflate-raw' | null);
|
|
9
|
+
/**
|
|
10
|
+
* Encodes the given string into a Uint8Array.
|
|
11
|
+
*
|
|
12
|
+
* @param data The string to encode.
|
|
13
|
+
* @returns A Uint8Array containing the length-prefixed and optionally compressed encoded string.
|
|
14
|
+
* @throws {RangeError} If the string length exceeds the maximum representable value.
|
|
15
|
+
*/
|
|
16
|
+
encode(data: string): Uint8Array;
|
|
17
|
+
private compress;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Decodes a stream of Uint8Arrays into strings, where each string
|
|
21
|
+
* is prefixed by its length as a variable-length integer and optionally decompressed.
|
|
22
|
+
*/
|
|
23
|
+
declare class LengthPrefixedTextDecoder {
|
|
24
|
+
private readonly decoder;
|
|
25
|
+
private readonly compression;
|
|
26
|
+
private readonly lengthDecoder;
|
|
27
|
+
private buffer;
|
|
28
|
+
private expectedLength;
|
|
29
|
+
private offset;
|
|
30
|
+
private lengthPrefixLength;
|
|
31
|
+
constructor(compression?: 'gzip' | 'deflate' | 'deflate-raw' | null);
|
|
32
|
+
/**
|
|
33
|
+
* Decodes a Uint8Array into a list of strings.
|
|
34
|
+
*
|
|
35
|
+
* @param data The Uint8Array to decode.
|
|
36
|
+
* @returns An array of decoded strings.
|
|
37
|
+
*/
|
|
38
|
+
decode(data: Uint8Array): string[];
|
|
39
|
+
/**
|
|
40
|
+
* Reads the length prefix from the beginning of the data.
|
|
41
|
+
*
|
|
42
|
+
* @param data The Uint8Array containing the length prefix.
|
|
43
|
+
* @returns The length of the message, or null if there's not enough data to read the length.
|
|
44
|
+
*/
|
|
45
|
+
private readLength;
|
|
46
|
+
private decompress;
|
|
47
|
+
}
|
|
48
|
+
export { LengthPrefixedTextEncoder, LengthPrefixedTextDecoder };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare class VariableLengthIntegerEncoder {
|
|
2
|
+
/**
|
|
3
|
+
* Encodes an integer using a variable-length integer encoding.
|
|
4
|
+
* @param num The number to encode.
|
|
5
|
+
* @returns A Uint8Array representing the encoded integer.
|
|
6
|
+
*/
|
|
7
|
+
encode(num: number | bigint): Uint8Array;
|
|
8
|
+
}
|
|
9
|
+
declare class VariableLengthIntegerDecoder {
|
|
10
|
+
/**
|
|
11
|
+
* Decodes an integer from a Uint8Array using variable-length integer encoding.
|
|
12
|
+
* @param data The Uint8Array to decode.
|
|
13
|
+
* @returns The decoded integer.
|
|
14
|
+
*/
|
|
15
|
+
decode(data: Uint8Array): bigint;
|
|
16
|
+
getNumBytesForLengthInteger(data: Uint8Array): number;
|
|
17
|
+
}
|
|
18
|
+
export { VariableLengthIntegerEncoder, VariableLengthIntegerDecoder };
|