@vkontakte/calls-sdk 2.6.2-beta.3 → 2.6.2-beta.30

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 (56) hide show
  1. package/CallsSDK.d.ts +68 -11
  2. package/abstract/BaseApi.d.ts +7 -3
  3. package/abstract/BaseSignaling.d.ts +14 -2
  4. package/calls-sdk.cjs.js +8 -8
  5. package/calls-sdk.esm.js +8 -8
  6. package/classes/Conversation.d.ts +38 -5
  7. package/classes/MediaSource.d.ts +7 -2
  8. package/classes/ProducerCommandSerializationService.d.ts +3 -1
  9. package/classes/codec/IEncoder.d.ts +3 -0
  10. package/classes/codec/LibVPxEncoder.d.ts +4 -1
  11. package/classes/codec/Types.d.ts +6 -1
  12. package/classes/codec/WebCodecsEncoder.d.ts +4 -1
  13. package/classes/screenshare/PacketHistory.d.ts +30 -0
  14. package/classes/screenshare/PacketHistory.test.d.ts +1 -0
  15. package/classes/screenshare/ScreenCaptureSender.d.ts +15 -1
  16. package/classes/screenshare/ScreenCongestionControl.d.ts +25 -0
  17. package/classes/screenshare/SharingStatReport.d.ts +6 -0
  18. package/classes/screenshare/Utils.d.ts +5 -0
  19. package/classes/transport/ServerTransport.d.ts +2 -1
  20. package/default/Api.d.ts +8 -3
  21. package/default/Api.test.d.ts +1 -0
  22. package/default/Signaling.d.ts +14 -2
  23. package/enums/ConversationFeature.d.ts +2 -1
  24. package/enums/ConversationOption.d.ts +3 -1
  25. package/enums/HangupType.d.ts +3 -1
  26. package/enums/LiveStatus.d.ts +7 -0
  27. package/enums/MediaOption.d.ts +3 -1
  28. package/enums/RoomsEventType.d.ts +6 -0
  29. package/enums/SignalingCommandType.d.ts +12 -1
  30. package/enums/SignalingNotification.d.ts +12 -1
  31. package/package.json +1 -1
  32. package/static/ApiTransport.d.ts +1 -1
  33. package/static/External.d.ts +98 -5
  34. package/static/Params.d.ts +117 -9
  35. package/static/Polyfills.d.ts +7 -0
  36. package/static/Utils.d.ts +6 -1
  37. package/static/WebRTCUtils.d.ts +44 -11
  38. package/static/WebRTCUtils.test.d.ts +1 -0
  39. package/types/Asr.d.ts +5 -0
  40. package/types/Conversation.d.ts +12 -0
  41. package/types/ConversationFeature.d.ts +3 -0
  42. package/types/ConversationParams.d.ts +1 -0
  43. package/types/ExternalId.d.ts +2 -0
  44. package/types/Feedback.d.ts +22 -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/ParticipantListChunk.d.ts +2 -0
  49. package/types/ParticipantStreamDescription.d.ts +2 -1
  50. package/types/Room.d.ts +60 -0
  51. package/types/SignalingMessage.d.ts +63 -0
  52. package/types/WaitingHall.d.ts +2 -8
  53. package/utils/ArrayDequeue.d.ts +24 -0
  54. package/utils/ArrayDequeue.spec.d.ts +1 -0
  55. package/utils/Conversation.d.ts +2 -0
  56. package/worker/LibVPxEncoderWorker.d.ts +1 -1
@@ -0,0 +1,58 @@
1
+ import LiveStatus from '../enums/LiveStatus';
2
+ import { OkUserId, CompositeUserId } from './Participant';
3
+ import { MediaType } from './ParticipantStreamDescription';
4
+ export interface IMoviePreview {
5
+ url: string;
6
+ width: number;
7
+ height: number;
8
+ }
9
+ export interface IAddMovieParams {
10
+ movieId: string;
11
+ gain?: number;
12
+ metadata?: {
13
+ title?: string;
14
+ thumbnails?: IMoviePreview[];
15
+ };
16
+ }
17
+ export declare type ISharedMovieStateResponse = [
18
+ number,
19
+ number,
20
+ boolean,
21
+ number,
22
+ boolean,
23
+ number
24
+ ];
25
+ export interface ISharedMovieState {
26
+ participantId: CompositeUserId;
27
+ gain?: number;
28
+ pause?: boolean;
29
+ offset?: number;
30
+ mute?: boolean;
31
+ liveStatus?: LiveStatus;
32
+ }
33
+ export interface IUpdateMovieData {
34
+ movieId: string;
35
+ gain?: number;
36
+ pause?: boolean;
37
+ offset?: number;
38
+ mute?: boolean;
39
+ }
40
+ export interface ISharedMovieInfo {
41
+ movieId: OkUserId;
42
+ initiatorId: CompositeUserId;
43
+ title: string;
44
+ source: MediaType;
45
+ externalMovieId: string;
46
+ duration: number;
47
+ thumbnails: IMoviePreview[];
48
+ }
49
+ export interface ISharedMovieStoppedInfo {
50
+ movieId: OkUserId;
51
+ initiatorId: CompositeUserId;
52
+ source: MediaType;
53
+ }
54
+ export interface IOnRemoteMovieData {
55
+ streamName: string;
56
+ stream: MediaStream | null;
57
+ mediaType: MediaType;
58
+ }
@@ -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[];
@@ -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,60 @@
1
+ import { ExternalParticipantId, ExternalParticipantListChunk } from './ExternalId';
2
+ import { Participant, 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
+ export interface RoomsUpdate {
37
+ rooms?: Room[];
38
+ roomIds?: number[];
39
+ }
40
+ export interface RoomParticipantUpdate {
41
+ roomId: number;
42
+ /**
43
+ * total number of participants in the room
44
+ */
45
+ participantCount: number;
46
+ /**
47
+ * ids of added participants, always present (if any) so participants would be able
48
+ * to identify their presence in particular room
49
+ */
50
+ addedParticipantIds?: ExternalParticipantId[];
51
+ /**
52
+ * optional, data for added participants
53
+ */
54
+ addedParticipants?: Participant[];
55
+ /**
56
+ * optional, depending on the context may contain either markers
57
+ * for all (sorted) lists available or be empty (if client fails to support chunked participants)
58
+ */
59
+ removedParticipantMarkers?: ParticipantListMarkers;
60
+ }
@@ -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,21 @@ 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
+ }
79
96
  interface Notification extends SignalingMessage {
80
97
  type?: string;
81
98
  notification?: string;
@@ -148,6 +165,8 @@ declare namespace SignalingMessage {
148
165
  muteStates: MuteStates;
149
166
  unmuteOptions?: MediaOption[];
150
167
  mediaOptions: MediaOption[];
168
+ requestedMedia?: MediaOption[];
169
+ stateUpdated?: boolean;
151
170
  unmute?: boolean;
152
171
  muteAll?: boolean;
153
172
  }
@@ -184,6 +203,7 @@ declare namespace SignalingMessage {
184
203
  }
185
204
  export interface FeatureSetChanged extends Notification {
186
205
  features: ConversationFeature[];
206
+ featuresPerRole?: IFeaturesPerRole | null;
187
207
  }
188
208
  export interface MultipartyChatCreated extends Notification {
189
209
  chatId: string;
@@ -273,10 +293,53 @@ declare namespace SignalingMessage {
273
293
  mediaModifiers: MediaModifiers;
274
294
  participants?: ParticipantListChunk;
275
295
  chatRoom?: ChatRoom;
296
+ rooms?: {
297
+ rooms: Room[];
298
+ roomId?: number;
299
+ };
276
300
  }
277
301
  export interface JoinLinkChanged extends Notification {
278
302
  joinLink: string;
279
303
  }
304
+ export interface Feedback extends Notification {
305
+ feedback: IFeedback[];
306
+ }
307
+ export interface SharedMovieState extends Notification {
308
+ data: ISharedMovieState[];
309
+ }
310
+ export interface SharedMovieInfo extends Notification {
311
+ movieShareInfo: ISharedMovieInfo;
312
+ }
313
+ export interface SharedMovieStoppedInfo extends Notification, ISharedMovieStoppedInfo {
314
+ }
315
+ export interface RoomsUpdated extends Notification {
316
+ updates: Partial<Record<RoomsEventType, {
317
+ rooms?: Room;
318
+ roomIds?: number[];
319
+ }>>;
320
+ }
321
+ export interface RoomUpdated extends Notification {
322
+ events: RoomsEventType[];
323
+ room?: Room;
324
+ roomId: number;
325
+ deactivate?: boolean;
326
+ }
327
+ export interface RoomParticipantsUpdated extends Notification {
328
+ roomId: number;
329
+ participantCount: number;
330
+ addedParticipantIds?: CompositeUserId[];
331
+ addedParticipants?: Participant[];
332
+ removedParticipantMarkers?: ParticipantListMarkers;
333
+ }
334
+ export interface FeaturesPerRoleChanged extends Notification {
335
+ featuresPerRole?: IFeaturesPerRole | null;
336
+ }
337
+ export interface AsrStarted extends Notification {
338
+ asrInfo: AsrInfo;
339
+ }
340
+ export interface AsrStopped extends Notification {
341
+ movieId: number;
342
+ }
280
343
  export {};
281
344
  }
282
345
  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[];
@@ -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;