@vkontakte/calls-sdk 2.8.6-dev.645b67c1.0 → 2.8.6-dev.64c0084a.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.
Files changed (41) hide show
  1. package/CallsSDK.d.ts +23 -9
  2. package/abstract/BaseApi.d.ts +2 -1
  3. package/abstract/BaseSignaling.d.ts +3 -1
  4. package/calls-sdk.cjs.js +8 -8
  5. package/calls-sdk.esm.js +8 -8
  6. package/classes/Conversation.d.ts +19 -9
  7. package/classes/Logger.d.ts +3 -0
  8. package/classes/MediaSource.d.ts +3 -0
  9. package/classes/SignalingActor.d.ts +9 -0
  10. package/classes/codec/IEncoder.d.ts +0 -1
  11. package/classes/screenshare/BaseStreamBuilder.d.ts +1 -1
  12. package/classes/transport/Statistics.d.ts +23 -10
  13. package/default/Api.d.ts +2 -1
  14. package/default/Signaling.d.ts +18 -10
  15. package/enums/ChatRoomEventType.d.ts +1 -1
  16. package/enums/ConversationOption.d.ts +3 -3
  17. package/enums/RecordRole.d.ts +1 -1
  18. package/enums/SignalingTransportStat.d.ts +17 -0
  19. package/enums/Stat.d.ts +36 -23
  20. package/package.json +2 -1
  21. package/static/ApiTransport.d.ts +1 -1
  22. package/static/External.d.ts +2 -2
  23. package/static/Params.d.ts +48 -17
  24. package/static/SimulcastInfo.d.ts +1 -1
  25. package/static/Utils.d.ts +1 -1
  26. package/types/Conversation.d.ts +28 -1
  27. package/types/ConversationParams.d.ts +14 -1
  28. package/types/ConversationResponse.d.ts +9 -0
  29. package/types/ExternalId.d.ts +3 -0
  30. package/types/FastStart.d.ts +46 -0
  31. package/types/SignalingMessage.d.ts +2 -1
  32. package/types/Streams.d.ts +1 -0
  33. package/types/WebTransport.d.ts +25 -0
  34. package/utils/LengthPrefixed.d.ts +48 -0
  35. package/utils/Lz4.d.ts +1 -0
  36. package/utils/MsgPackerBufferUtils.d.ts +1 -1
  37. package/utils/VariableLengthInteger.d.ts +18 -0
  38. package/worker/LibVPxDecoderWorker.d.ts +0 -1
  39. package/worker/LibVPxEncoderWorker.d.ts +0 -1
  40. package/worker/WebCodecsDecoderWorker.d.ts +0 -1
  41. package/worker/WebCodecsEncoderWorker.d.ts +0 -1
@@ -1,11 +1,14 @@
1
1
  import { TransportTopology } from '../classes/transport/Transport';
2
2
  import CallDirection from '../enums/CallDirection';
3
+ import CallType from '../enums/CallType';
3
4
  import ConversationFeature from '../enums/ConversationFeature';
4
5
  import ConversationOption from '../enums/ConversationOption';
6
+ import MediaOption from '../enums/MediaOption';
5
7
  import UserRole from '../enums/UserRole';
6
8
  import { AsrInfo } from './Asr';
7
9
  import { IFeaturesPerRole } from './ConversationFeature';
8
- import { ExternalParticipantId } from './ExternalId';
10
+ import { ExternalId, ExternalParticipantId } from './ExternalId';
11
+ import { FastStartHandler } from './FastStart';
9
12
  import MediaModifiers from './MediaModifiers';
10
13
  import MuteStates from './MuteStates';
11
14
  import { OkUserId, ParticipantId } from './Participant';
@@ -68,3 +71,27 @@ export type ConversationData = {
68
71
  /** @hidden */
69
72
  urlSharingInfoByRoom: Map<IRoomId, RoomUrlSharingInfo>;
70
73
  };
74
+ export type ConversationOnStartParams = {
75
+ opponentIds?: OkUserId[];
76
+ opponentType: CallType;
77
+ mediaOptions: MediaOption[];
78
+ payload?: string;
79
+ joiningAllowed?: boolean;
80
+ requireAuthToJoin?: boolean;
81
+ onlyAdminCanShareMovie?: boolean;
82
+ externalIds?: ExternalId[];
83
+ onFastStart?: FastStartHandler;
84
+ };
85
+ export type StartConversationParams = {
86
+ opponentIds?: OkUserId[];
87
+ opponentType: CallType;
88
+ direction: CallDirection;
89
+ mediaOptions: MediaOption[];
90
+ payload?: string;
91
+ joiningAllowed?: boolean;
92
+ requireAuthToJoin?: boolean;
93
+ onlyAdminCanShareMovie?: boolean;
94
+ externalIds?: ExternalId[];
95
+ startedTime: number;
96
+ onFastStart?: FastStartHandler;
97
+ };
@@ -2,6 +2,7 @@ import IceServer from './IceServer';
2
2
  type ConversationParams = {
3
3
  token: string;
4
4
  endpoint: string;
5
+ wt_endpoint?: string;
5
6
  turn_server?: IceServer;
6
7
  stun_server?: IceServer;
7
8
  client_type?: string;
@@ -10,6 +11,18 @@ type ConversationParams = {
10
11
  isp_as_org?: string;
11
12
  loc_cc?: string;
12
13
  loc_reg?: string;
13
- external_user_type: string;
14
+ external_user_type?: string;
15
+ };
16
+ export type ExternalConversationParams = {
17
+ et: number;
18
+ iv: boolean;
19
+ srcp: string;
20
+ stne: string;
21
+ tkn: string;
22
+ trne: string;
23
+ trnp: string;
24
+ trnu: string;
25
+ wse: string;
26
+ wte: string;
14
27
  };
15
28
  export default ConversationParams;
@@ -1,4 +1,5 @@
1
1
  import HangupType from '../enums/HangupType';
2
+ import IceServer from './IceServer';
2
3
  /**
3
4
  * Начальные данные создания звонка
4
5
  * @hidden
@@ -12,6 +13,10 @@ type ConversationResponse = {
12
13
  * URL для подключения
13
14
  */
14
15
  endpoint: string;
16
+ /**
17
+ * URL для подключения по WebTransport
18
+ */
19
+ wt_endpoint?: string;
15
20
  /**
16
21
  * Токен комнаты для подключения к звонку по ссылке
17
22
  */
@@ -27,5 +32,9 @@ type ConversationResponse = {
27
32
  * Порядковый номер, присвоенный устройству при входе в звонок
28
33
  */
29
34
  device_idx?: number;
35
+ turn_server?: IceServer;
36
+ stun_server?: IceServer;
37
+ client_type?: string;
38
+ token: string;
30
39
  };
31
40
  export default ConversationResponse;
@@ -1,4 +1,5 @@
1
1
  import MediaOption from '../enums/MediaOption';
2
+ import UserRole from '../enums/UserRole';
2
3
  import { ParticipantStatus } from '../static/External';
3
4
  import MediaSettings from './MediaSettings';
4
5
  import { ISharedMovieInfo } from './MovieShare';
@@ -19,6 +20,7 @@ export declare namespace ExternalIdUtils {
19
20
  function fromId(id: ExternalUserId, type?: ExternalIdType, deviceIdx?: number): ExternalParticipantId;
20
21
  function fromSignalingParticipant(participant: SignalingMessage.Participant, useDecorative?: boolean): ExternalParticipantId | undefined;
21
22
  function fromSignaling(signalingId: SignalingMessage.ExternalId, deviceIdx?: number): ExternalParticipantId;
23
+ function toSignaling(externalId: ExternalId): string;
22
24
  function toString(externalId: ExternalId): ExternalIdString;
23
25
  function fromIdToString(id: ExternalUserId, type?: ExternalIdType, deviceIdx?: number): ExternalIdString;
24
26
  function fromString(stringId: ExternalIdString): ExternalParticipantId;
@@ -95,6 +97,7 @@ export interface ExternalParticipant {
95
97
  unmuteOptions: MediaOption[];
96
98
  markers: ExternalParticipantListMarkers | null;
97
99
  movieShareInfos?: ISharedMovieInfo[];
100
+ roles: UserRole[];
98
101
  }
99
102
  /**
100
103
  * Позиция в чанке
@@ -0,0 +1,46 @@
1
+ import { HangupType, IceServer } from '../CallsSDK';
2
+ import CallType from '../enums/CallType';
3
+ import MediaOption from '../enums/MediaOption';
4
+ import { ExternalId } from './ExternalId';
5
+ /**
6
+ * Параметры, которые нужно вернуть для создания fastStart
7
+ */
8
+ export interface InternalParams {
9
+ platform: string;
10
+ sdkVersion: string;
11
+ clientAppKey: string;
12
+ deviceId: string;
13
+ protocolVersion: number;
14
+ domainId?: string;
15
+ }
16
+ export interface InternalCallerParams {
17
+ id: ID;
18
+ isConcurrent: boolean;
19
+ endpoint: string;
20
+ wtEndpoint: string;
21
+ clientType: string;
22
+ turn: IceServer;
23
+ stun: IceServer;
24
+ }
25
+ export interface ID {
26
+ internal: number;
27
+ external: string;
28
+ }
29
+ export interface FastStartParams {
30
+ conversationId: string;
31
+ internalParams: string;
32
+ externalIds?: ExternalId[];
33
+ opponentType: CallType;
34
+ mediaOptions: MediaOption[];
35
+ joiningAllowed?: boolean;
36
+ requireAuthToJoin?: boolean;
37
+ isVideo?: boolean;
38
+ }
39
+ export interface FastStartResponse {
40
+ internalCallerParams: string;
41
+ rejectedParticipants: {
42
+ id: string;
43
+ status: HangupType;
44
+ }[];
45
+ }
46
+ export type FastStartHandler = (params: FastStartParams) => Promise<FastStartResponse>;
@@ -133,6 +133,7 @@ declare namespace SignalingMessage {
133
133
  muteStates?: MuteStates;
134
134
  asrInfo?: AsrInfo;
135
135
  urlSharingInfo?: RoomUrlSharingInfo;
136
+ joinLink?: string;
136
137
  }
137
138
  export interface Room {
138
139
  active?: boolean;
@@ -275,7 +276,6 @@ declare namespace SignalingMessage {
275
276
  }
276
277
  export interface FeatureSetChanged extends Notification {
277
278
  features: ConversationFeature[];
278
- featuresPerRole?: IFeaturesPerRole | null;
279
279
  }
280
280
  export interface MultipartyChatCreated extends Notification {
281
281
  chatId: string;
@@ -288,6 +288,7 @@ declare namespace SignalingMessage {
288
288
  recordInfo: RecordInfo;
289
289
  }
290
290
  export interface RecordStopped extends Notification {
291
+ /** кто остановил запись или если в комнатах, то это админ */
291
292
  participant: ParticipantId;
292
293
  recordMovieId: number;
293
294
  }
@@ -9,6 +9,7 @@ export interface IStartStreamData {
9
9
  }
10
10
  export interface IStopStreamData {
11
11
  roomId: number | null;
12
+ remove?: boolean;
12
13
  }
13
14
  export interface IPublishStreamData {
14
15
  roomId: number | null;
@@ -0,0 +1,25 @@
1
+ import { WebTransportOptions } from '@fails-components/webtransport';
2
+ declare class WebTransportEventual {
3
+ private webTransport;
4
+ private stream;
5
+ private writer;
6
+ private reader;
7
+ private readonly url;
8
+ private readonly options;
9
+ private readonly compression;
10
+ private encoder;
11
+ private decoder;
12
+ onopen: ((this: WebTransportEventual, ev: Event) => any) | null;
13
+ onmessage: ((this: WebTransportEventual, ev: MessageEvent) => any) | null;
14
+ onerror: ((this: WebTransportEventual, ev: Event) => any) | null;
15
+ onclose: ((this: WebTransportEventual, ev: CloseEvent) => any) | null;
16
+ readyState: number;
17
+ constructor(url: string, options?: WebTransportOptions);
18
+ private getCompressionTypeFromUrl;
19
+ private connect;
20
+ private readLoop;
21
+ send(data: string): Promise<void>;
22
+ close(code?: number, reason?: string): void;
23
+ static isBrowserSupported(): boolean;
24
+ }
25
+ 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 };
package/utils/Lz4.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare function lz4Decompress(input: Uint8Array, outputLength: number): Uint8Array<ArrayBuffer>;
@@ -13,7 +13,7 @@ export declare function createWriteBuffer(): {
13
13
  putUi32(v: number): void;
14
14
  putUi64(v: number): void;
15
15
  putF(v: number): void;
16
- ui8array(): Uint8Array;
16
+ ui8array(): Uint8Array<ArrayBuffer>;
17
17
  };
18
18
  export declare function createReadBuffer(buf: BufferSource): {
19
19
  peek(): number;
@@ -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 | null;
16
+ getNumBytesForLengthInteger(data: Uint8Array): number;
17
+ }
18
+ export { VariableLengthIntegerEncoder, VariableLengthIntegerDecoder };
@@ -1,4 +1,3 @@
1
- /// <reference lib="webworker" />
2
1
  import type libvpx from '@vkontakte/libvpx';
3
2
  declare const _default: (vpx: typeof libvpx, urlResolver: (url: string) => string) => void;
4
3
  export default _default;
@@ -1,4 +1,3 @@
1
- /// <reference lib="webworker" />
2
1
  import type libvpx from '@vkontakte/libvpx';
3
2
  declare const _default: (vpx: typeof libvpx, urlResolver: (url: string) => string, useCongestionControl: boolean, maxBitrate: number) => void;
4
3
  export default _default;
@@ -1,3 +1,2 @@
1
- /// <reference lib="webworker" />
2
1
  declare const _default: (videoFrameTransferable: boolean) => void;
3
2
  export default _default;
@@ -1,3 +1,2 @@
1
- /// <reference lib="webworker" />
2
1
  declare const _default: () => void;
3
2
  export default _default;