@vkontakte/calls-sdk 2.6.2-dev.1d98360.0 → 2.6.2-dev.24c50f4.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 (58) hide show
  1. package/CallsSDK.d.ts +68 -11
  2. package/abstract/BaseApi.d.ts +7 -3
  3. package/abstract/BaseSignaling.d.ts +17 -3
  4. package/calls-sdk.cjs.js +8 -8
  5. package/calls-sdk.esm.js +8 -8
  6. package/classes/Conversation.d.ts +39 -7
  7. package/classes/MediaSource.d.ts +7 -2
  8. package/classes/ParticipantIdRegistry.d.ts +2 -0
  9. package/classes/ProducerCommandSerializationService.d.ts +19 -0
  10. package/classes/codec/IEncoder.d.ts +3 -0
  11. package/classes/codec/LibVPxEncoder.d.ts +4 -1
  12. package/classes/codec/Types.d.ts +6 -1
  13. package/classes/codec/WebCodecsEncoder.d.ts +4 -1
  14. package/classes/screenshare/PacketHistory.d.ts +30 -0
  15. package/classes/screenshare/PacketHistory.test.d.ts +1 -0
  16. package/classes/screenshare/ScreenCaptureSender.d.ts +16 -1
  17. package/classes/screenshare/ScreenCongestionControl.d.ts +25 -0
  18. package/classes/screenshare/SharingStatReport.d.ts +6 -0
  19. package/classes/screenshare/Utils.d.ts +6 -0
  20. package/classes/transport/ServerTransport.d.ts +2 -0
  21. package/default/Api.d.ts +8 -3
  22. package/default/Api.test.d.ts +1 -0
  23. package/default/Signaling.d.ts +23 -4
  24. package/enums/ConversationFeature.d.ts +2 -1
  25. package/enums/ConversationOption.d.ts +3 -1
  26. package/enums/HangupType.d.ts +3 -1
  27. package/enums/LiveStatus.d.ts +7 -0
  28. package/enums/MediaOption.d.ts +3 -1
  29. package/enums/RoomsEventType.d.ts +6 -0
  30. package/enums/SignalingCommandType.d.ts +12 -1
  31. package/enums/SignalingNotification.d.ts +12 -1
  32. package/package.json +1 -1
  33. package/static/ApiTransport.d.ts +1 -1
  34. package/static/External.d.ts +98 -5
  35. package/static/Params.d.ts +110 -3
  36. package/static/Utils.d.ts +5 -1
  37. package/static/WebRTCUtils.d.ts +2 -1
  38. package/types/Asr.d.ts +5 -0
  39. package/types/Conversation.d.ts +12 -0
  40. package/types/ConversationFeature.d.ts +3 -0
  41. package/types/ConversationParams.d.ts +1 -0
  42. package/types/ExternalId.d.ts +2 -0
  43. package/types/Feedback.d.ts +22 -0
  44. package/types/LayoutUtils.d.ts +5 -0
  45. package/types/MediaSettings.d.ts +5 -1
  46. package/types/MovieShare.d.ts +58 -0
  47. package/types/Participant.d.ts +2 -0
  48. package/types/ParticipantLayout.d.ts +7 -1
  49. package/types/ParticipantListChunk.d.ts +2 -0
  50. package/types/ParticipantStreamDescription.d.ts +2 -1
  51. package/types/Room.d.ts +72 -0
  52. package/types/SignalingMessage.d.ts +67 -0
  53. package/types/WaitingHall.d.ts +2 -8
  54. package/utils/ArrayDequeue.d.ts +24 -0
  55. package/utils/ArrayDequeue.spec.d.ts +1 -0
  56. package/utils/Conversation.d.ts +2 -0
  57. package/utils/MsgPackerBufferUtils.d.ts +31 -0
  58. package/worker/LibVPxEncoderWorker.d.ts +1 -1
@@ -4,6 +4,7 @@ import UserRole from '../enums/UserRole';
4
4
  import { ParticipantStatus } from '../static/External';
5
5
  import MediaSettings from '../types/MediaSettings';
6
6
  import { ExternalId, ExternalParticipantId, ExternalParticipantListMarkers } from './ExternalId';
7
+ import { ISharedMovieInfo } from './MovieShare';
7
8
  import MuteStates from './MuteStates';
8
9
  import ParticipantLayout from './ParticipantLayout';
9
10
  /**
@@ -55,6 +56,7 @@ export interface Participant {
55
56
  unmuteOptions: MediaOption[];
56
57
  observedIds: CompositeUserId[];
57
58
  markers?: ExternalParticipantListMarkers;
59
+ movieShareInfos?: ISharedMovieInfo[];
58
60
  }
59
61
  export interface IGetParticipantsParameters {
60
62
  externalIds: ExternalId[];
@@ -31,10 +31,16 @@ export declare type StopStream = {
31
31
  */
32
32
  stopStream: true;
33
33
  };
34
+ /**
35
+ * Request key frame from source. Should not be called often, negatively impacts video quality.
36
+ */
37
+ export declare type RequestKeyFrame = {
38
+ keyFrameRequested: true;
39
+ };
34
40
  /**
35
41
  * Лейаут собеседника в звонке
36
42
  */
37
- export declare type ParticipantLayout = (Layout | StopStream) & {
43
+ export declare type ParticipantLayout = (Layout | StopStream | RequestKeyFrame) & {
38
44
  /**
39
45
  * Внешний ID пользователя
40
46
  */
@@ -10,4 +10,6 @@ export interface ParticipantListChunkParameters {
10
10
  backward?: boolean;
11
11
  /** If true then resulting chunk will start from Participant with specified marker, if such Participant (still) exists */
12
12
  includeMarker?: boolean;
13
+ /** optional, id of the room to get chunk for, main call if unspecified */
14
+ roomId?: number;
13
15
  }
@@ -6,7 +6,8 @@ export declare enum MediaType {
6
6
  CAMERA = "CAMERA",
7
7
  SCREEN = "SCREEN",
8
8
  STREAM = "STREAM",
9
- MOVIE = "MOVIE"
9
+ MOVIE = "MOVIE",
10
+ AUDIOSHARE = "AUDIOSHARE"
10
11
  }
11
12
  export declare function serializeParticipantStreamDescription(description: ParticipantStreamDescription): string;
12
13
  export declare function parseParticipantStreamDescription(descriptionString: string): ParticipantStreamDescription;
@@ -0,0 +1,72 @@
1
+ import { ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk } from './ExternalId';
2
+ import { ParticipantListMarkers } from './Participant';
3
+ export interface Room {
4
+ id: number;
5
+ /**
6
+ * name of this room
7
+ */
8
+ name: string;
9
+ /**
10
+ * count of participants (read/write, optional)
11
+ */
12
+ participantCount: number;
13
+ /**
14
+ * ids of all participants (read/write, optional)
15
+ */
16
+ participantIds: ExternalParticipantId[];
17
+ /**
18
+ * ids of participants to be added to this room (read/write, optional)
19
+ */
20
+ addParticipantIds?: ExternalParticipantId[];
21
+ /**
22
+ * ids of participants to be removed from this room (read/write, optional)
23
+ */
24
+ removeParticipantIds?: ExternalParticipantId[];
25
+ /**
26
+ * if participant requested then contains first chunk of participants in this rooms
27
+ * (if client fails to support chunks, then contains all participant in this room)
28
+ * (read, optional)
29
+ */
30
+ participants?: ExternalParticipantListChunk;
31
+ /**
32
+ * if this room is active (read/write, optional)
33
+ */
34
+ active?: boolean;
35
+ }
36
+ /**
37
+ * Initial rooms state
38
+ */
39
+ export interface Rooms {
40
+ rooms: Room[];
41
+ /**
42
+ * current room id of participant. if null then the partipant is in the main call
43
+ */
44
+ roomId?: number;
45
+ }
46
+ export interface RoomsUpdate {
47
+ rooms?: Room[];
48
+ roomIds?: number[];
49
+ deactivated?: boolean;
50
+ }
51
+ export interface RoomParticipantUpdate {
52
+ roomId: number;
53
+ /**
54
+ * total number of participants in the room
55
+ */
56
+ participantCount: number;
57
+ /**
58
+ * ids of added participants, always present (if any) so participants would be able
59
+ * to identify their presence in particular room
60
+ */
61
+ addedParticipantIds?: ExternalParticipantId[];
62
+ /**
63
+ * optional, data for added participants
64
+ */
65
+ addedParticipants?: ExternalParticipant[];
66
+ /**
67
+ * optional, depending on the context may contain either markers
68
+ * for all (sorted) lists available or be empty (if client fails to support chunked participants)
69
+ */
70
+ removedParticipantMarkers?: ParticipantListMarkers[];
71
+ removedParticipantIds?: ExternalParticipantId[];
72
+ }
@@ -5,10 +5,15 @@ import ConversationOption from '../enums/ConversationOption';
5
5
  import HangupType from '../enums/HangupType';
6
6
  import MediaOption from '../enums/MediaOption';
7
7
  import ParticipantState from '../enums/ParticipantState';
8
+ import RoomsEventType from '../enums/RoomsEventType';
8
9
  import UserRole from '../enums/UserRole';
9
10
  import UserType from '../enums/UserType';
11
+ import { IFeaturesPerRole } from './ConversationFeature';
12
+ import { IFeedback } from './Feedback';
13
+ import { AsrInfo } from './Asr';
10
14
  import MediaModifiers from './MediaModifiers';
11
15
  import MediaSettings from './MediaSettings';
16
+ import { ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from './MovieShare';
12
17
  import MuteStates from './MuteStates';
13
18
  import { CompositeUserId, OkUserId, ParticipantId, ParticipantListMarker as ParticipantParticipantListMarker, ParticipantListMarkers, ParticipantListType as ParticipantParticipantListType } from './Participant';
14
19
  import VideoSettings from './VideoSettings';
@@ -54,6 +59,7 @@ declare namespace SignalingMessage {
54
59
  unmuteOptions?: MediaOption[];
55
60
  markers?: ParticipantListMarkers;
56
61
  observedIds?: CompositeUserId[];
62
+ movieShareInfos?: ISharedMovieInfo[];
57
63
  }
58
64
  export interface ParticipantListChunk extends Notification {
59
65
  participants: (Participant & Required<Pick<Participant, 'markers'>>)[];
@@ -72,10 +78,23 @@ declare namespace SignalingMessage {
72
78
  multichatId: string | null;
73
79
  tamtamMultichatId: string | null;
74
80
  recordInfo: RecordInfo | null;
81
+ featuresPerRole?: IFeaturesPerRole | null;
75
82
  pinnedParticipantId: ParticipantId | null;
76
83
  options: ConversationOption[];
77
84
  muteStates?: MuteStates;
78
85
  }
86
+ export interface Room extends SignalingMessage {
87
+ id?: number;
88
+ name?: string;
89
+ participantCount?: number;
90
+ participantIds?: CompositeUserId[];
91
+ addParticipantIds?: CompositeUserId[];
92
+ removeParticipantIds?: CompositeUserId[];
93
+ participants?: ParticipantListChunk;
94
+ active?: boolean;
95
+ countdownSec?: number;
96
+ timeoutMs?: number;
97
+ }
79
98
  interface Notification extends SignalingMessage {
80
99
  type?: string;
81
100
  notification?: string;
@@ -148,6 +167,8 @@ declare namespace SignalingMessage {
148
167
  muteStates: MuteStates;
149
168
  unmuteOptions?: MediaOption[];
150
169
  mediaOptions: MediaOption[];
170
+ requestedMedia?: MediaOption[];
171
+ stateUpdated?: boolean;
151
172
  unmute?: boolean;
152
173
  muteAll?: boolean;
153
174
  }
@@ -184,6 +205,7 @@ declare namespace SignalingMessage {
184
205
  }
185
206
  export interface FeatureSetChanged extends Notification {
186
207
  features: ConversationFeature[];
208
+ featuresPerRole?: IFeaturesPerRole | null;
187
209
  }
188
210
  export interface MultipartyChatCreated extends Notification {
189
211
  chatId: string;
@@ -240,6 +262,7 @@ declare namespace SignalingMessage {
240
262
  demote: boolean;
241
263
  mediaModifiers: MediaModifiers;
242
264
  conversation: Conversation;
265
+ participants?: ParticipantListChunk;
243
266
  }
244
267
  export interface ChatRoomUpdated extends Notification {
245
268
  eventType: ChatRoomEventType;
@@ -272,10 +295,54 @@ declare namespace SignalingMessage {
272
295
  mediaModifiers: MediaModifiers;
273
296
  participants?: ParticipantListChunk;
274
297
  chatRoom?: ChatRoom;
298
+ rooms?: {
299
+ rooms: Room[];
300
+ roomId?: number;
301
+ };
275
302
  }
276
303
  export interface JoinLinkChanged extends Notification {
277
304
  joinLink: string;
278
305
  }
306
+ export interface Feedback extends Notification {
307
+ feedback: IFeedback[];
308
+ }
309
+ export interface SharedMovieState extends Notification {
310
+ data: ISharedMovieState[];
311
+ }
312
+ export interface SharedMovieInfo extends Notification {
313
+ movieShareInfo: ISharedMovieInfo;
314
+ }
315
+ export interface SharedMovieStoppedInfo extends Notification, ISharedMovieStoppedInfo {
316
+ }
317
+ export interface RoomsUpdated extends Notification {
318
+ updates: Partial<Record<RoomsEventType, {
319
+ rooms?: Room;
320
+ roomIds?: number[];
321
+ deactivated?: boolean;
322
+ }>>;
323
+ }
324
+ export interface RoomUpdated extends Notification {
325
+ events: RoomsEventType[];
326
+ room?: Room;
327
+ roomId: number;
328
+ deactivate?: boolean;
329
+ }
330
+ export interface RoomParticipantsUpdated extends Notification {
331
+ roomId: number;
332
+ participantCount: number;
333
+ addedParticipantIds?: CompositeUserId[];
334
+ addedParticipants?: Participant[];
335
+ removedParticipantMarkers?: ParticipantListMarkers[];
336
+ }
337
+ export interface FeaturesPerRoleChanged extends Notification {
338
+ featuresPerRole?: IFeaturesPerRole | null;
339
+ }
340
+ export interface AsrStarted extends Notification {
341
+ asrInfo: AsrInfo;
342
+ }
343
+ export interface AsrStopped extends Notification {
344
+ movieId: number;
345
+ }
279
346
  export {};
280
347
  }
281
348
  export default SignalingMessage;
@@ -1,6 +1,7 @@
1
1
  import { ExternalId } from './ExternalId';
2
2
  import { CompositeUserId } from './Participant';
3
3
  import SignalingMessage from './SignalingMessage';
4
+ import { IFeedback } from './Feedback';
4
5
  export declare type WaitingParticipantId = {
5
6
  addedTs: number;
6
7
  id: CompositeUserId;
@@ -9,18 +10,11 @@ export declare type WaitingParticipant = {
9
10
  id: WaitingParticipantId;
10
11
  externalId?: SignalingMessage.ExternalId;
11
12
  };
12
- export declare type Feedback = {
13
- key: string;
14
- totalCount: number;
15
- currentCount: number;
16
- timeout: number;
17
- participantIds: CompositeUserId[];
18
- };
19
13
  export declare type ChatRoom = {
20
14
  totalCount: number;
21
15
  firstParticipants?: WaitingParticipant[];
22
16
  handCount?: number;
23
- feedback?: Feedback[];
17
+ feedback?: IFeedback[];
24
18
  };
25
19
  /**
26
20
  * Ответ на запрос `getWaitingHall`
@@ -0,0 +1,24 @@
1
+ export declare class ArrayDequeue<T = any> {
2
+ /** очередь */
3
+ private readonly _queue;
4
+ /** курсор для чтения */
5
+ private _readCursor;
6
+ /** курсор для записи */
7
+ private _writeCursor;
8
+ /** подвинуть курсор чтения */
9
+ private _moveReadCursor;
10
+ /** сколько осталось в очереди элементов */
11
+ private _left;
12
+ constructor(length: number);
13
+ /** возвращает длину, переданную в конструктор */
14
+ get length(): number;
15
+ /** возвращает текущую длину очереди */
16
+ get left(): number;
17
+ toArray(): T[];
18
+ /** добавить элемент в очередь */
19
+ add(element: T): void;
20
+ /** вычисляет значение след курсора по кругу */
21
+ private nextCursor;
22
+ /** получить следующий элемент */
23
+ next(): T | null;
24
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { MuteState, MediaOption, MuteStates } from '../CallsSDK';
2
+ export declare const getMediaOptionsByMuteState: (muteStates: MuteStates, value: MuteState) => MediaOption[];
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Fork from messagepack internals.
3
+ * Package messagepack doesn't export createWriteBuffer and createReadBuffer methods.
4
+ */
5
+ export declare function createWriteBuffer(): {
6
+ put(v: BufferSource): void;
7
+ putI8(v: number): void;
8
+ putI16(v: number): void;
9
+ putI32(v: number): void;
10
+ putI64(v: number): void;
11
+ putUi8(v: number): void;
12
+ putUi16(v: number): void;
13
+ putUi32(v: number): void;
14
+ putUi64(v: number): void;
15
+ putF(v: number): void;
16
+ ui8array(): Uint8Array;
17
+ };
18
+ export declare function createReadBuffer(buf: BufferSource): {
19
+ peek(): number;
20
+ get(len: number): ArrayBuffer;
21
+ getI8(): number;
22
+ getI16(): number;
23
+ getI32(): number;
24
+ getI64(): number;
25
+ getUi8(): number;
26
+ getUi16(): number;
27
+ getUi32(): number;
28
+ getUi64(): number;
29
+ getF32(): number;
30
+ getF64(): number;
31
+ };
@@ -1,4 +1,4 @@
1
1
  /// <reference lib="webworker" />
2
2
  import type libvpx from '@vkontakte/libvpx';
3
- declare const _default: (vpx: typeof libvpx, urlResolver: (url: string) => string) => void;
3
+ declare const _default: (vpx: typeof libvpx, urlResolver: (url: string) => string, useCongestionControl: boolean, maxBitrate: number) => void;
4
4
  export default _default;