@vkontakte/calls-sdk 2.8.11-dev.cb5b05f6.0 → 2.8.11-dev.d67d6abf.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.
@@ -0,0 +1,22 @@
1
+ import Conversation from './Conversation';
2
+ export interface HoldableConversation extends Conversation {
3
+ id: string;
4
+ hold(hold: boolean): Promise<void>;
5
+ }
6
+ export declare class CallRegistry {
7
+ private _conversations;
8
+ private _activeId;
9
+ private _mutex;
10
+ add(conversation: HoldableConversation): void;
11
+ remove(id: string | null): void;
12
+ get(id: string): HoldableConversation | undefined;
13
+ getActive(): HoldableConversation | null;
14
+ getActiveId(): string | null;
15
+ has(id: string): boolean;
16
+ getAll(): HoldableConversation[];
17
+ get callsLength(): number;
18
+ setActive(id: string): Promise<void>;
19
+ clear(): void;
20
+ }
21
+ declare const callRegistry: CallRegistry;
22
+ export { callRegistry };
@@ -16,7 +16,7 @@ import { ConversationData, ConversationOnStartParams } from '../types/Conversati
16
16
  import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalUserId } from '../types/ExternalId';
17
17
  import type { FastJoinHandler } from '../types/FastJoin';
18
18
  import MediaModifiers from '../types/MediaModifiers';
19
- import { IVideoDimentions } from '../types/MediaSettings';
19
+ import MediaSettings, { IVideoDimentions } from '../types/MediaSettings';
20
20
  import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
21
21
  import MuteStates from '../types/MuteStates';
22
22
  import { CompositeUserId, IGetParticipantsParameters, ParticipantId, ParticipantStateData } from '../types/Participant';
@@ -49,10 +49,9 @@ export default class Conversation extends EventEmitter {
49
49
  private _lastSignalledActiveSpeakerId;
50
50
  private _isRealTimeAsrRequested;
51
51
  private _serverSettings;
52
- private static _current;
53
- private static _activationMutex;
54
- private static _delayedHangup;
55
- private static _abortController;
52
+ private _serverTimeOffset;
53
+ private _delayedHangup;
54
+ private _abortController;
56
55
  private readonly _onUnload;
57
56
  private readonly _audioOutput;
58
57
  private _lastStalled;
@@ -69,6 +68,11 @@ export default class Conversation extends EventEmitter {
69
68
  static current(): Conversation | null;
70
69
  static hangupAfterInit(): void;
71
70
  static id(): string | null;
71
+ get id(): string;
72
+ get externalId(): ExternalParticipantId | undefined;
73
+ get mediaSettings(): MediaSettings | undefined;
74
+ get isCallHeld(): boolean;
75
+ static getSyncedTime(): number;
72
76
  onStart({ opponentIds, opponentType, mediaOptions, payload, joiningAllowed, requireAuthToJoin, onlyAdminCanShareMovie, externalIds, onFastStart, conversationId, }: ConversationOnStartParams): Promise<ConversationData>;
73
77
  onJoin(joinArgs: {
74
78
  conversationId?: string;
@@ -393,6 +397,7 @@ export default class Conversation extends EventEmitter {
393
397
  private _onFeedback;
394
398
  private _onDecorativeParticipantIdChanged;
395
399
  private _onVideoSuspendSuggest;
400
+ private _onParticipantHold;
396
401
  private _isMe;
397
402
  private _getMuteStatesForRoomId;
398
403
  private _getMuteStatesForCurrentRoom;
@@ -402,6 +407,8 @@ export default class Conversation extends EventEmitter {
402
407
  private _getParticipants;
403
408
  private _getParticipant;
404
409
  }
410
+ declare function _resetPendingInstance(): void;
411
+ export { _resetPendingInstance };
405
412
  export declare class UpdateDisplayLayoutError extends Error {
406
413
  readonly participantErrors: {
407
414
  externalId: ExternalParticipantId;
@@ -10,30 +10,25 @@ export default class Logger extends BaseLogger {
10
10
  static setConversationIdProvider(provider: () => string | null): void;
11
11
  static create(api: BaseApi, externalLogger: BaseLogger | null): void;
12
12
  static log(name: StatLog, value?: string, immediately?: boolean): void;
13
- static logCustom(name: StatLog, params: Record<string, string | number>, immediately?: boolean): void;
14
- static logClientStats(params: Record<string, string | number | undefined | null>, immediately?: boolean): void;
15
- static logClientEvent(params: Record<string, string | number | undefined | null>, immediately?: boolean): void;
13
+ static logClientStats(params: Record<string, string | number | boolean | undefined | null>, immediately?: boolean): void;
14
+ static logClientEvent(params: Record<string, string | number | boolean | undefined | null>, immediately?: boolean): void;
16
15
  static destroy(): void;
17
16
  private readonly _externalLogger;
18
17
  private readonly _api;
19
18
  private readonly _batchInterval;
20
- private _batchedLogItems;
21
19
  private _batchedClientStats;
22
20
  private _batchedClientEvents;
23
21
  private _batchTimeout;
24
22
  private _serverTimeDelta;
25
23
  constructor(api: BaseApi, externalLogger: BaseLogger | null);
26
24
  log(name: StatLog, value?: string, immediately?: boolean): void;
27
- logCustom(name: string, params: Record<string, string | number>, immediately?: boolean): void;
28
- logClientStats(data: Record<string, string | number | undefined | null>, immediately?: boolean): void;
29
- logClientEvent(data: Record<string, string | number | undefined | null>, immediately?: boolean): void;
25
+ logClientStats(data: Record<string, string | number | boolean | undefined | null>, immediately?: boolean): void;
26
+ logClientEvent(data: Record<string, string | number | boolean | undefined | null>, immediately?: boolean): void;
30
27
  destroy(): void;
31
- private _logInternal;
32
28
  private _getConversationId;
33
29
  private _sendBatch;
34
30
  private _startTimeout;
35
31
  private _stopTimeout;
36
- private _sendLogItems;
37
32
  private _sendClientStats;
38
33
  private _sendClientEvents;
39
34
  private _calculateServerTimeDelta;
@@ -45,6 +45,7 @@ export declare class MediaSource extends EventEmitter {
45
45
  /** Трек аудио эффектов. Не изменяется на протяжении всего времени */
46
46
  private _audioEffectsTrack;
47
47
  private _mediaSettings;
48
+ private _lastMediaSettings;
48
49
  private _videoStatusOnScreenCapturingEnabled;
49
50
  private _effect;
50
51
  private _audioEffectParams;
@@ -63,7 +64,11 @@ export declare class MediaSource extends EventEmitter {
63
64
  getSendAudioTrack(): MediaStreamTrack | null;
64
65
  get isAnimojiRequested(): boolean;
65
66
  addTrackToPeerConnection(pc: RTCPeerConnection, observer: boolean, noDataChannel: boolean): void;
67
+ /**
68
+ * @deprecated Используйте гетер mediaSettings
69
+ */
66
70
  getMediaSettings(): MediaSettings;
71
+ get mediaSettings(): MediaSettings;
67
72
  changeDevice(kind: MediaDeviceKind): Promise<void>;
68
73
  /**
69
74
  * Установка кастомного стрима для видео, например внешний шаринг экрана
@@ -91,6 +96,8 @@ export declare class MediaSource extends EventEmitter {
91
96
  private _setEffect;
92
97
  private _stopEffect;
93
98
  destroy(): void;
99
+ stopLocalMedia(): Promise<void>;
100
+ resumeLocalMedia(): Promise<void>;
94
101
  toggleScreenCapturing(settings: ScreenCaptureSettings): Promise<void>;
95
102
  disableScreenCapturing(): Promise<void>;
96
103
  private videoTrackMuteHandler;
@@ -59,6 +59,8 @@ export declare class Transport extends EventEmitter {
59
59
  close(participantId: ParticipantId): void;
60
60
  destroy(): void;
61
61
  getTopology(): TransportTopology;
62
+ preventRestart(): void;
63
+ allowRestart(): void;
62
64
  isAllocated(participantId: ParticipantId): boolean;
63
65
  allocated(): string[];
64
66
  opened(): string[];
package/default/Api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import BaseApi, { ClientEvent, ClientStats, LogItem } from '../abstract/BaseApi';
1
+ import BaseApi, { ClientEvent, ClientStats } from '../abstract/BaseApi';
2
2
  import CallType from '../enums/CallType';
3
3
  import HangupType from '../enums/HangupType';
4
4
  import ConversationParams from '../types/ConversationParams';
@@ -15,7 +15,6 @@ export default class Api extends BaseApi {
15
15
  protected _call(method: string, data?: any, noSession?: boolean): Promise<any>;
16
16
  userId(participantId: ParticipantId): Promise<ExternalParticipantId>;
17
17
  authorize(): Promise<void>;
18
- log(items: LogItem[]): void;
19
18
  logClientStats(items: ClientStats[]): void;
20
19
  logClientEvents(items: ClientEvent[]): void;
21
20
  uploadDebugLogs(conversationId: string, startTime: number, endTime: number, log: string): Promise<void>;
@@ -65,7 +64,6 @@ export default class Api extends BaseApi {
65
64
  getUserId(): OkUserId | null;
66
65
  setUserId(userId: OkUserId): void;
67
66
  hangupConversation(conversationId: string, reason?: HangupType): void;
68
- sendUserFeedbackStats(conversationId: string, userResponse: number, reason?: string, groupCallUsersCount?: number): void;
69
67
  removeHistoryRecords(recordIds: number[]): Promise<void>;
70
68
  cleanup(): void;
71
69
  private _getExternalIdsByOkIds;
@@ -39,7 +39,6 @@ export default class Signaling extends BaseSignaling {
39
39
  protected conversationReject: Function | null;
40
40
  private connected;
41
41
  private listenersReady;
42
- private postfix;
43
42
  protected peerId: number | null;
44
43
  protected conversationId: string | null;
45
44
  private reconnectTimer;
@@ -164,6 +163,7 @@ export default class Signaling extends BaseSignaling {
164
163
  startAsr(params: IAsrStartParams): Promise<SignalingMessage>;
165
164
  stopAsr(params?: IAsrStopParams): Promise<SignalingMessage>;
166
165
  requestAsr(request: boolean): Promise<SignalingMessage>;
166
+ private _buildUrl;
167
167
  protected _connect(connectionType: SignalingConnectionType, useWebTransport: boolean): void;
168
168
  protected _disconnect(code?: number): void;
169
169
  private _onOpen;
@@ -173,6 +173,7 @@ export default class Signaling extends BaseSignaling {
173
173
  protected _handleCachedMessages(): void;
174
174
  private _throwError;
175
175
  private _onError;
176
+ private _serializeErrorEvent;
176
177
  protected _onClose(event: CloseEvent): void;
177
178
  protected _closeSocket(error?: Error | null): void;
178
179
  protected _reconnect(): void;
@@ -50,6 +50,7 @@ declare enum SignalingNotification {
50
50
  ASR_STARTED = "asr-started",
51
51
  ASR_STOPPED = "asr-stopped",
52
52
  DECORATIVE_PARTICIPANT_ID_CHANGED = "decorative-participant-id-changed",
53
- VIDEO_SUSPEND_SUGGEST = "video-suspend-suggest"
53
+ VIDEO_SUSPEND_SUGGEST = "video-suspend-suggest",
54
+ HOLD = "hold"
54
55
  }
55
56
  export default SignalingNotification;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.8.11-dev.cb5b05f6.0",
3
+ "version": "2.8.11-dev.d67d6abf.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",
@@ -0,0 +1,5 @@
1
+ import { TCapabilities } from '../types/Capabilities';
2
+ declare namespace Capabilities {
3
+ function get(): TCapabilities;
4
+ }
5
+ export default Capabilities;
package/static/Debug.d.ts CHANGED
@@ -8,10 +8,10 @@ export declare enum DebugMessageType {
8
8
  ERROR = "ERROR"
9
9
  }
10
10
  declare namespace Debug {
11
- let debug: Function;
12
- let log: Function;
13
- let warn: Function;
14
- let error: Function;
11
+ function debug(...args: any[]): void;
12
+ function log(...args: any[]): void;
13
+ function warn(...args: any[]): void;
14
+ function error(...args: any[]): void;
15
15
  function enabled(): boolean;
16
16
  function toggle(enable: boolean): void;
17
17
  function send(type: DebugMessageType, ...args: any[]): void;