@vkontakte/calls-sdk 2.6.2-dev.c7dda7f.0 → 2.6.2-dev.c8d6e43.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 (55) hide show
  1. package/CallsSDK.d.ts +78 -16
  2. package/abstract/BaseApi.d.ts +7 -3
  3. package/abstract/BaseSignaling.d.ts +17 -5
  4. package/calls-sdk.cjs.js +8 -8
  5. package/calls-sdk.esm.js +8 -8
  6. package/classes/Conversation.d.ts +43 -9
  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 +17 -5
  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/External.d.ts +98 -6
  33. package/static/Params.d.ts +115 -9
  34. package/static/Polyfills.d.ts +7 -0
  35. package/static/Utils.d.ts +4 -1
  36. package/static/WebRTCUtils.d.ts +44 -11
  37. package/static/WebRTCUtils.test.d.ts +1 -0
  38. package/types/Asr.d.ts +5 -0
  39. package/types/Conversation.d.ts +1 -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/MediaSettings.d.ts +5 -1
  45. package/types/MovieShare.d.ts +58 -0
  46. package/types/Participant.d.ts +3 -0
  47. package/types/ParticipantListChunk.d.ts +2 -0
  48. package/types/ParticipantStreamDescription.d.ts +2 -1
  49. package/types/Room.d.ts +77 -0
  50. package/types/SignalingMessage.d.ts +66 -0
  51. package/types/WaitingHall.d.ts +2 -8
  52. package/utils/ArrayDequeue.d.ts +24 -0
  53. package/utils/ArrayDequeue.spec.d.ts +1 -0
  54. package/utils/Conversation.d.ts +2 -0
  55. 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,8 @@ export interface Participant {
55
56
  unmuteOptions: MediaOption[];
56
57
  observedIds: CompositeUserId[];
57
58
  markers?: ExternalParticipantListMarkers;
59
+ movieShareInfos?: ISharedMovieInfo[];
60
+ isInRoom?: boolean;
58
61
  }
59
62
  export interface IGetParticipantsParameters {
60
63
  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,77 @@
1
+ import { ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk } from './ExternalId';
2
+ import MuteStates from './MuteStates';
3
+ import { ParticipantListMarkers } from './Participant';
4
+ export interface Room {
5
+ id: number;
6
+ /**
7
+ * name of this room
8
+ */
9
+ name: string;
10
+ /**
11
+ * count of participants (read/write, optional)
12
+ */
13
+ participantCount: number;
14
+ /**
15
+ * ids of all participants (read/write, optional)
16
+ */
17
+ participantIds: ExternalParticipantId[];
18
+ /**
19
+ * ids of participants to be added to this room (read/write, optional)
20
+ */
21
+ addParticipantIds?: ExternalParticipantId[];
22
+ /**
23
+ * ids of participants to be removed from this room (read/write, optional)
24
+ */
25
+ removeParticipantIds?: ExternalParticipantId[];
26
+ /**
27
+ * if participant requested then contains first chunk of participants in this rooms
28
+ * (if client fails to support chunks, then contains all participant in this room)
29
+ * (read, optional)
30
+ */
31
+ participants?: ExternalParticipantListChunk;
32
+ /**
33
+ * if this room is active (read/write, optional)
34
+ */
35
+ active?: boolean;
36
+ /**
37
+ * global (room-wide) mute state, if any
38
+ */
39
+ muteStates?: MuteStates;
40
+ }
41
+ /**
42
+ * Initial rooms state
43
+ */
44
+ export interface Rooms {
45
+ rooms: Room[];
46
+ /**
47
+ * current room id of participant. if null then the partipant is in the main call
48
+ */
49
+ roomId?: number;
50
+ }
51
+ export interface RoomsUpdate {
52
+ rooms?: Room[];
53
+ roomIds?: number[];
54
+ deactivated?: boolean;
55
+ }
56
+ export interface RoomParticipantUpdate {
57
+ roomId: number;
58
+ /**
59
+ * total number of participants in the room
60
+ */
61
+ participantCount: number;
62
+ /**
63
+ * ids of added participants, always present (if any) so participants would be able
64
+ * to identify their presence in particular room
65
+ */
66
+ addedParticipantIds?: ExternalParticipantId[];
67
+ /**
68
+ * optional, data for added participants
69
+ */
70
+ addedParticipants?: ExternalParticipant[];
71
+ /**
72
+ * optional, depending on the context may contain either markers
73
+ * for all (sorted) lists available or be empty (if client fails to support chunked participants)
74
+ */
75
+ removedParticipantMarkers?: ParticipantListMarkers[];
76
+ removedParticipantIds?: ExternalParticipantId[];
77
+ }
@@ -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,24 @@ 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
+ muteStates?: MuteStates;
98
+ }
79
99
  interface Notification extends SignalingMessage {
80
100
  type?: string;
81
101
  notification?: string;
@@ -152,6 +172,7 @@ declare namespace SignalingMessage {
152
172
  stateUpdated?: boolean;
153
173
  unmute?: boolean;
154
174
  muteAll?: boolean;
175
+ roomId?: number;
155
176
  }
156
177
  export interface PinParticipant extends Notification {
157
178
  participantId: ParticipantId;
@@ -186,6 +207,7 @@ declare namespace SignalingMessage {
186
207
  }
187
208
  export interface FeatureSetChanged extends Notification {
188
209
  features: ConversationFeature[];
210
+ featuresPerRole?: IFeaturesPerRole | null;
189
211
  }
190
212
  export interface MultipartyChatCreated extends Notification {
191
213
  chatId: string;
@@ -275,10 +297,54 @@ declare namespace SignalingMessage {
275
297
  mediaModifiers: MediaModifiers;
276
298
  participants?: ParticipantListChunk;
277
299
  chatRoom?: ChatRoom;
300
+ rooms?: {
301
+ rooms: Room[];
302
+ roomId?: number;
303
+ };
278
304
  }
279
305
  export interface JoinLinkChanged extends Notification {
280
306
  joinLink: string;
281
307
  }
308
+ export interface Feedback extends Notification {
309
+ feedback: IFeedback[];
310
+ }
311
+ export interface SharedMovieState extends Notification {
312
+ data: ISharedMovieState[];
313
+ }
314
+ export interface SharedMovieInfo extends Notification {
315
+ movieShareInfo: ISharedMovieInfo;
316
+ }
317
+ export interface SharedMovieStoppedInfo extends Notification, ISharedMovieStoppedInfo {
318
+ }
319
+ export interface RoomsUpdated extends Notification {
320
+ updates: Partial<Record<RoomsEventType, {
321
+ rooms?: Room;
322
+ roomIds?: number[];
323
+ deactivated?: boolean;
324
+ }>>;
325
+ }
326
+ export interface RoomUpdated extends Notification {
327
+ events: RoomsEventType[];
328
+ room?: Room;
329
+ roomId: number;
330
+ deactivate?: boolean;
331
+ }
332
+ export interface RoomParticipantsUpdated extends Notification {
333
+ roomId: number;
334
+ participantCount: number;
335
+ addedParticipantIds?: CompositeUserId[];
336
+ addedParticipants?: Participant[];
337
+ removedParticipantMarkers?: ParticipantListMarkers[];
338
+ }
339
+ export interface FeaturesPerRoleChanged extends Notification {
340
+ featuresPerRole?: IFeaturesPerRole | null;
341
+ }
342
+ export interface AsrStarted extends Notification {
343
+ asrInfo: AsrInfo;
344
+ }
345
+ export interface AsrStopped extends Notification {
346
+ movieId: number;
347
+ }
282
348
  export {};
283
349
  }
284
350
  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;