@vkontakte/calls-sdk 2.8.11-dev.3d9bb708.0 → 2.8.11-dev.3de63af6.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.
- package/CallsSDK.d.ts +49 -13
- package/abstract/BaseApi.d.ts +1 -2
- package/abstract/BaseSignaling.d.ts +1 -1
- package/calls-sdk.cjs.js +16 -13
- package/calls-sdk.esm.js +11414 -13
- package/classes/AudioFix.d.ts +5 -1
- package/classes/AudioOutput.d.ts +5 -1
- package/classes/Conversation.d.ts +11 -12
- package/classes/DebugInfo.d.ts +3 -0
- package/classes/MediaSource.d.ts +6 -5
- package/classes/ParticipantIdRegistry.d.ts +3 -0
- package/classes/ProducerCommandSerializationService.d.ts +3 -0
- package/classes/SignalingActor.d.ts +3 -1
- package/classes/SpeakerDetector.d.ts +2 -1
- package/classes/SpecListener.d.ts +5 -1
- package/classes/StatsLogger.d.ts +29 -0
- package/classes/VideoEffectsFpsLimiter.d.ts +3 -0
- package/classes/asr/AsrReceiver.d.ts +3 -1
- package/classes/codec/LibVPxDecoder.d.ts +3 -0
- package/classes/codec/LibVPxEncoder.d.ts +3 -1
- package/classes/codec/WebCodecsDecoder.d.ts +3 -0
- package/classes/codec/WebCodecsEncoder.d.ts +3 -1
- package/classes/codec/WorkerBase.d.ts +5 -0
- package/classes/screenshare/BaseStreamBuilder.d.ts +4 -1
- package/classes/screenshare/CanvasRenderer.d.ts +3 -1
- package/classes/screenshare/ScreenCaptureReceiver.d.ts +7 -1
- package/classes/screenshare/ScreenCaptureSender.d.ts +5 -1
- package/classes/screenshare/ScreenCongestionControl.d.ts +3 -1
- package/classes/screenshare/StreamBuilder.d.ts +5 -1
- package/classes/screenshare/TrackGeneratorRenderer.d.ts +3 -1
- package/classes/screenshare/WebmBuilder.d.ts +3 -1
- package/classes/stat/CodecStatsAggregator.d.ts +7 -7
- package/classes/stat/ConversationStats.d.ts +21 -0
- package/classes/stat/StatAggregator.d.ts +6 -6
- package/classes/stat/StatFirstMediaReceived.d.ts +4 -1
- package/classes/stat/StatPings.d.ts +9 -9
- package/classes/stat/StatScreenShareFirstFrame.d.ts +3 -1
- package/classes/stat/StatSignalingCommands.d.ts +8 -8
- package/classes/transport/BaseTransport.d.ts +1 -1
- package/classes/transport/DirectStatReporter.d.ts +3 -1
- package/classes/transport/DirectTransport.d.ts +9 -1
- package/classes/transport/PerfStatReporter.d.ts +5 -1
- package/classes/transport/ServerTransport.d.ts +10 -2
- package/classes/transport/Transport.d.ts +11 -14
- package/default/Api.d.ts +1 -3
- package/default/Signaling.d.ts +14 -2
- package/enums/TransportState.d.ts +10 -0
- package/enums/TransportTopology.d.ts +5 -0
- package/package.json +1 -1
- package/static/Debug.d.ts +27 -8
- package/static/External.d.ts +17 -38
- package/static/Params.d.ts +20 -22
- package/static/Utils.d.ts +3 -2
- package/static/WebRTCUtils.d.ts +6 -4
- package/types/Conversation.d.ts +1 -1
- package/types/PerfStatReporter.d.ts +2 -1
- package/types/SignalingMessage.d.ts +4 -1
- package/types/Statistics.d.ts +1 -1
- package/types/WebTransport.d.ts +1 -0
- package/utils/DebugStorage.d.ts +100 -1
- package/classes/CallRegistry.d.ts +0 -18
- package/classes/Logger.d.ts +0 -41
- package/classes/stat/EventMetricsService.d.ts +0 -9
- package/static/ConversationDebugLogger.d.ts +0 -13
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ParticipantId } from '../../types/Participant';
|
|
2
|
+
import { StatAggregator } from './StatAggregator';
|
|
2
3
|
export declare class StatScreenShareFirstFrame {
|
|
3
4
|
protected readonly _participantId: ParticipantId;
|
|
5
|
+
private readonly _statAggregator;
|
|
4
6
|
protected _firstFrameReceived: boolean;
|
|
5
|
-
constructor(participantId: ParticipantId);
|
|
7
|
+
constructor(participantId: ParticipantId, statAggregator: StatAggregator | null);
|
|
6
8
|
measure(width: number, height: number): void;
|
|
7
9
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { SignalingTransportType } from '../../enums/SignalingTransportStat';
|
|
2
|
-
import
|
|
2
|
+
import StatsLogger from '../StatsLogger';
|
|
3
|
+
import TransportTopology from '../../enums/TransportTopology';
|
|
3
4
|
export declare class StatSignalingCommands {
|
|
4
|
-
private
|
|
5
|
-
static create(): void;
|
|
6
|
-
static mark(command: string, time: number, transport: SignalingTransportType): void;
|
|
7
|
-
/** Отправляем данные в стату */
|
|
8
|
-
static logMetrics(topology?: TransportTopology): void;
|
|
9
|
-
static destroy(): void;
|
|
5
|
+
private readonly _logger;
|
|
10
6
|
private trackerByCommand;
|
|
11
|
-
|
|
7
|
+
constructor(logger: StatsLogger);
|
|
8
|
+
mark(command: string, time: number, transport: SignalingTransportType): void;
|
|
9
|
+
/** Отправляем данные в стату */
|
|
10
|
+
logMetrics(topology?: TransportTopology): void;
|
|
11
|
+
destroy(): void;
|
|
12
12
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
2
|
+
import TransportState from '../../enums/TransportState';
|
|
2
3
|
import EventEmitter from '../EventEmitter';
|
|
3
4
|
import { MediaSource } from '../MediaSource';
|
|
4
|
-
import { TransportState } from './Transport';
|
|
5
5
|
export default abstract class BaseTransport extends EventEmitter {
|
|
6
6
|
protected readonly _signaling: BaseSignaling;
|
|
7
7
|
protected readonly _mediaSource: MediaSource;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
2
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
2
3
|
import { StatResult } from '../../types/Statistics';
|
|
3
4
|
import EventEmitter from '../EventEmitter';
|
|
4
5
|
import { WeightedAverage } from '../stat/WeightedAverage';
|
|
@@ -30,7 +31,8 @@ export default class DirectStatReporter extends EventEmitter {
|
|
|
30
31
|
private readonly _networkLimits;
|
|
31
32
|
private _lastStatSentTimestamp;
|
|
32
33
|
private _currentState;
|
|
33
|
-
|
|
34
|
+
private readonly _debug;
|
|
35
|
+
constructor(signaling: BaseSignaling, debug?: DebugLogger);
|
|
34
36
|
private _calcRttRating;
|
|
35
37
|
private _calcLossRating;
|
|
36
38
|
private _calcBitrateRating;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { AnimojiReceiver, AnimojiSender } from '@vkontakte/calls-vmoji';
|
|
2
2
|
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
3
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
3
4
|
import { ParticipantId } from '../../types/Participant';
|
|
4
5
|
import ServerSettings from '../../types/ServerSettings';
|
|
6
|
+
import StatsLogger from '../StatsLogger';
|
|
5
7
|
import { MediaSource } from '../MediaSource';
|
|
8
|
+
import { CodecStatsAggregator } from '../stat/CodecStatsAggregator';
|
|
9
|
+
import { StatAggregator } from '../stat/StatAggregator';
|
|
6
10
|
import BaseTransport from './BaseTransport';
|
|
7
11
|
export default class DirectTransport extends BaseTransport {
|
|
8
12
|
private readonly _participantId;
|
|
@@ -34,7 +38,11 @@ export default class DirectTransport extends BaseTransport {
|
|
|
34
38
|
private _lastBadConnection;
|
|
35
39
|
private _perfStatReporter;
|
|
36
40
|
private _directStatReporter;
|
|
37
|
-
|
|
41
|
+
private readonly _debug;
|
|
42
|
+
private readonly _logger;
|
|
43
|
+
private readonly _statAggregator;
|
|
44
|
+
private readonly _codecStatsAggregator;
|
|
45
|
+
constructor(participantId: ParticipantId, isMaster: boolean, signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null);
|
|
38
46
|
get participantId(): ParticipantId;
|
|
39
47
|
updateStatisticsInterval(): void;
|
|
40
48
|
private _isDeadConnection;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
2
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
2
3
|
import EventEmitter from '../EventEmitter';
|
|
4
|
+
import { StatAggregator } from '../stat/StatAggregator';
|
|
3
5
|
import DirectTransport from './DirectTransport';
|
|
4
6
|
import ServerTransport from './ServerTransport';
|
|
5
7
|
export default class PerfStatReporter extends EventEmitter {
|
|
@@ -10,7 +12,9 @@ export default class PerfStatReporter extends EventEmitter {
|
|
|
10
12
|
private _screenShareStats;
|
|
11
13
|
private _signaling;
|
|
12
14
|
private readonly _directTopology;
|
|
13
|
-
|
|
15
|
+
private readonly _debug;
|
|
16
|
+
private readonly _statAggregator;
|
|
17
|
+
constructor(transport: ServerTransport | DirectTransport, signaling: BaseSignaling, statAggregator?: StatAggregator | null, directTopology?: boolean, debug?: DebugLogger);
|
|
14
18
|
destroy(): void;
|
|
15
19
|
static getEstimatedPerformanceIndex(): number;
|
|
16
20
|
private _handleStats;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { AnimojiReceiver, AnimojiSender } from '@vkontakte/calls-vmoji';
|
|
2
2
|
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
3
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
3
4
|
import { ParticipantId } from '../../types/Participant';
|
|
4
5
|
import ServerSettings from '../../types/ServerSettings';
|
|
6
|
+
import StatsLogger from '../StatsLogger';
|
|
5
7
|
import { MediaSource } from '../MediaSource';
|
|
8
|
+
import { CodecStatsAggregator } from '../stat/CodecStatsAggregator';
|
|
9
|
+
import { StatAggregator } from '../stat/StatAggregator';
|
|
6
10
|
import BaseTransport from './BaseTransport';
|
|
7
11
|
export default class ServerTransport extends BaseTransport {
|
|
8
12
|
private _producerNotification;
|
|
@@ -39,7 +43,11 @@ export default class ServerTransport extends BaseTransport {
|
|
|
39
43
|
private _producerSessionId;
|
|
40
44
|
private _newAudioShareTrack;
|
|
41
45
|
private _simulcastInfo;
|
|
42
|
-
|
|
46
|
+
private readonly _debug;
|
|
47
|
+
private readonly _logger;
|
|
48
|
+
private readonly _statAggregator;
|
|
49
|
+
private readonly _codecStatsAggregator;
|
|
50
|
+
constructor(signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null);
|
|
43
51
|
updateStatisticsInterval(): void;
|
|
44
52
|
open(observer?: boolean): void;
|
|
45
53
|
close(error?: Error): void;
|
|
@@ -88,7 +96,7 @@ export default class ServerTransport extends BaseTransport {
|
|
|
88
96
|
private _onAsrTranscription;
|
|
89
97
|
private _onProducerUpdated;
|
|
90
98
|
private _onAddTrack;
|
|
91
|
-
|
|
99
|
+
private _onSignalingStateChange;
|
|
92
100
|
private _onConnectionStateChange;
|
|
93
101
|
private _onReplacedTrack;
|
|
94
102
|
private _onSourcesChanged;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { AnimojiSvgData, RGBTuple } from '@vkontakte/calls-vmoji';
|
|
2
2
|
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
3
|
+
import TransportState from '../../enums/TransportState';
|
|
4
|
+
import TransportTopology from '../../enums/TransportTopology';
|
|
5
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
3
6
|
import { ParticipantId } from '../../types/Participant';
|
|
4
7
|
import ServerSettings from '../../types/ServerSettings';
|
|
5
8
|
import EventEmitter from '../EventEmitter';
|
|
9
|
+
import StatsLogger from '../StatsLogger';
|
|
6
10
|
import { MediaSource } from '../MediaSource';
|
|
11
|
+
import { CodecStatsAggregator } from '../stat/CodecStatsAggregator';
|
|
12
|
+
import { StatAggregator } from '../stat/StatAggregator';
|
|
7
13
|
export declare const enum TransportEvent {
|
|
8
14
|
REMOTE_TRACK_ADDED = "REMOTE_TRACK_ADDED",
|
|
9
15
|
REMOTE_TRACK_REMOVED = "REMOTE_TRACK_REMOVED",
|
|
@@ -23,19 +29,6 @@ export declare const enum TransportEvent {
|
|
|
23
29
|
ANIMOJI_ERROR = "ANIMOJI_ERROR",
|
|
24
30
|
SCREEN_SHARING_STAT = "SCREEN_SHARING_STAT"
|
|
25
31
|
}
|
|
26
|
-
export declare const enum TransportState {
|
|
27
|
-
IDLE = "IDLE",
|
|
28
|
-
OPENED = "OPENED",
|
|
29
|
-
CONNECTING = "CONNECTING",
|
|
30
|
-
RECONNECTING = "RECONNECTING",
|
|
31
|
-
CONNECTED = "CONNECTED",
|
|
32
|
-
CLOSED = "CLOSED",
|
|
33
|
-
FAILED = "FAILED"
|
|
34
|
-
}
|
|
35
|
-
export declare const enum TransportTopology {
|
|
36
|
-
DIRECT = "DIRECT",
|
|
37
|
-
SERVER = "SERVER"
|
|
38
|
-
}
|
|
39
32
|
export declare class Transport extends EventEmitter {
|
|
40
33
|
private readonly _signaling;
|
|
41
34
|
private readonly _mediaSource;
|
|
@@ -51,7 +44,11 @@ export declare class Transport extends EventEmitter {
|
|
|
51
44
|
private _localState;
|
|
52
45
|
private _animojiReceiver;
|
|
53
46
|
private _animojiSender;
|
|
54
|
-
|
|
47
|
+
private readonly _debug;
|
|
48
|
+
private readonly _logger;
|
|
49
|
+
private readonly _statAggregator;
|
|
50
|
+
private readonly _codecStatsAggregator;
|
|
51
|
+
constructor(topology: TransportTopology, signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null);
|
|
55
52
|
updateSettings(settings: ServerSettings): void;
|
|
56
53
|
updateStatisticsInterval(): void;
|
|
57
54
|
allocate(participantId: ParticipantId, isMaster?: boolean): void;
|
package/default/Api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import BaseApi, { ClientEvent, ClientStats
|
|
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;
|
package/default/Signaling.d.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import BaseSignaling, { AddParticipantParams } from '../abstract/BaseSignaling';
|
|
2
|
+
import StatsLogger from '../classes/StatsLogger';
|
|
2
3
|
import { ParticipantIdRegistry } from '../classes/ParticipantIdRegistry';
|
|
3
4
|
import { SharingStatReport } from '../classes/screenshare/SharingStatReport';
|
|
4
|
-
import {
|
|
5
|
+
import { StatAggregator } from '../classes/stat/StatAggregator';
|
|
6
|
+
import { StatPings } from '../classes/stat/StatPings';
|
|
7
|
+
import { StatSignalingCommands } from '../classes/stat/StatSignalingCommands';
|
|
8
|
+
import TransportTopology from '../enums/TransportTopology';
|
|
5
9
|
import ConversationFeature from '../enums/ConversationFeature';
|
|
6
10
|
import ConversationOption from '../enums/ConversationOption';
|
|
7
11
|
import MediaOption from '../enums/MediaOption';
|
|
8
12
|
import SignalingCommandType from '../enums/SignalingCommandType';
|
|
9
13
|
import SignalingConnectionType from '../enums/SignalingConnectionType';
|
|
10
14
|
import UserRole from '../enums/UserRole';
|
|
15
|
+
import { type DebugLogger } from '../static/Debug';
|
|
11
16
|
import { JSONObject } from '../static/Json';
|
|
12
17
|
import { IAsrStartParams, IAsrStopParams } from '../types/Asr';
|
|
13
18
|
import { ChangeSimulcast } from '../types/ChangeSimulcast';
|
|
@@ -39,7 +44,6 @@ export default class Signaling extends BaseSignaling {
|
|
|
39
44
|
protected conversationReject: Function | null;
|
|
40
45
|
private connected;
|
|
41
46
|
private listenersReady;
|
|
42
|
-
private postfix;
|
|
43
47
|
protected peerId: number | null;
|
|
44
48
|
protected conversationId: string | null;
|
|
45
49
|
private reconnectTimer;
|
|
@@ -50,12 +54,18 @@ export default class Signaling extends BaseSignaling {
|
|
|
50
54
|
private producerCommandDataChannel;
|
|
51
55
|
private producerCommandDataChannelEnabled;
|
|
52
56
|
private producerCommandSerializationService;
|
|
57
|
+
private readonly _debug;
|
|
58
|
+
private readonly _logger;
|
|
59
|
+
private readonly _statAggregator;
|
|
60
|
+
private readonly _pings;
|
|
61
|
+
private readonly _signalingCommands;
|
|
53
62
|
private static get RECONNECT_DELAY();
|
|
54
63
|
private static get RECONNECT_MAX_DELAY();
|
|
55
64
|
private static get RECONNECT_MAX_COUNT();
|
|
56
65
|
private static get WAIT_CONNECTION_DELAY();
|
|
57
66
|
private static get WAIT_RESPONSE_DELAY();
|
|
58
67
|
private static get WAIT_MESSAGE_DELAY();
|
|
68
|
+
constructor(debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, pings?: StatPings | null, signalingCommands?: StatSignalingCommands | null);
|
|
59
69
|
get ready(): boolean;
|
|
60
70
|
setEndpoint(endpoint: string): void;
|
|
61
71
|
setWebTransportEndpoint(endpoint: string | null): void;
|
|
@@ -164,6 +174,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
164
174
|
startAsr(params: IAsrStartParams): Promise<SignalingMessage>;
|
|
165
175
|
stopAsr(params?: IAsrStopParams): Promise<SignalingMessage>;
|
|
166
176
|
requestAsr(request: boolean): Promise<SignalingMessage>;
|
|
177
|
+
private _buildUrl;
|
|
167
178
|
protected _connect(connectionType: SignalingConnectionType, useWebTransport: boolean): void;
|
|
168
179
|
protected _disconnect(code?: number): void;
|
|
169
180
|
private _onOpen;
|
|
@@ -173,6 +184,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
173
184
|
protected _handleCachedMessages(): void;
|
|
174
185
|
private _throwError;
|
|
175
186
|
private _onError;
|
|
187
|
+
private _serializeErrorEvent;
|
|
176
188
|
protected _onClose(event: CloseEvent): void;
|
|
177
189
|
protected _closeSocket(error?: Error | null): void;
|
|
178
190
|
protected _reconnect(): void;
|
package/package.json
CHANGED
package/static/Debug.d.ts
CHANGED
|
@@ -7,14 +7,33 @@ export declare enum DebugMessageType {
|
|
|
7
7
|
WARN = "WARN",
|
|
8
8
|
ERROR = "ERROR"
|
|
9
9
|
}
|
|
10
|
+
export type DebugMessageContext = {
|
|
11
|
+
readonly sessionId: string | null;
|
|
12
|
+
readonly conversationId: string | null;
|
|
13
|
+
};
|
|
14
|
+
export type DebugLogger = {
|
|
15
|
+
debug(...args: any[]): void;
|
|
16
|
+
log(...args: any[]): void;
|
|
17
|
+
warn(...args: any[]): void;
|
|
18
|
+
error(...args: any[]): void;
|
|
19
|
+
};
|
|
20
|
+
export type DebugSessionLogger = DebugLogger & {
|
|
21
|
+
readonly sessionId: string | null;
|
|
22
|
+
readonly conversationId: string | null;
|
|
23
|
+
setConversationId(conversationId: string | null): void;
|
|
24
|
+
};
|
|
10
25
|
declare namespace Debug {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
function
|
|
17
|
-
function
|
|
18
|
-
function
|
|
26
|
+
type ContextProvider = () => DebugMessageContext;
|
|
27
|
+
export function debug(...args: any[]): void;
|
|
28
|
+
export function log(...args: any[]): void;
|
|
29
|
+
export function warn(...args: any[]): void;
|
|
30
|
+
export function error(...args: any[]): void;
|
|
31
|
+
export function enabled(): boolean;
|
|
32
|
+
export function toggle(enable: boolean): void;
|
|
33
|
+
export function send(type: DebugMessageType, ...args: any[]): void;
|
|
34
|
+
export function createLogger(getContext: ContextProvider): DebugLogger;
|
|
35
|
+
export function createSessionLogger(initialConversationId?: string | null): DebugSessionLogger;
|
|
36
|
+
export function test(tag: string, ...args: any[]): void;
|
|
37
|
+
export {};
|
|
19
38
|
}
|
|
20
39
|
export default Debug;
|
package/static/External.d.ts
CHANGED
|
@@ -47,9 +47,8 @@ declare namespace External {
|
|
|
47
47
|
*
|
|
48
48
|
* @param stream
|
|
49
49
|
* @param mediaSettings
|
|
50
|
-
* @param conversationId ID звонка
|
|
51
50
|
*/
|
|
52
|
-
function onLocalStream(stream: MediaStream | null, mediaSettings: MediaSettings
|
|
51
|
+
function onLocalStream(stream: MediaStream | null, mediaSettings: MediaSettings): void;
|
|
53
52
|
/**
|
|
54
53
|
* Локальный стрим с экрана добавлен/удалён
|
|
55
54
|
*
|
|
@@ -81,18 +80,16 @@ declare namespace External {
|
|
|
81
80
|
* Изменился статус локального соединения
|
|
82
81
|
*
|
|
83
82
|
* @param status
|
|
84
|
-
* @param conversationId ID звонка
|
|
85
83
|
*/
|
|
86
|
-
function onLocalStatus(status: ParticipantStatus
|
|
84
|
+
function onLocalStatus(status: ParticipantStatus): void;
|
|
87
85
|
/**
|
|
88
86
|
* Получен стрим собеседника.
|
|
89
87
|
* Если сервер закончил стримить собеседника, вместо стрима будет передан null
|
|
90
88
|
*
|
|
91
89
|
* @param userId
|
|
92
90
|
* @param stream
|
|
93
|
-
* @param conversationId ID звонка
|
|
94
91
|
*/
|
|
95
|
-
function onRemoteStream(userId: ExternalParticipantId, stream: MediaStream | null
|
|
92
|
+
function onRemoteStream(userId: ExternalParticipantId, stream: MediaStream | null): void;
|
|
96
93
|
/**
|
|
97
94
|
* Получен стрим лайв от собеседника.
|
|
98
95
|
* Если сервер закончил стримить собеседника, вместо стрима будет передан null
|
|
@@ -129,9 +126,8 @@ declare namespace External {
|
|
|
129
126
|
*
|
|
130
127
|
* @param userId
|
|
131
128
|
* @param stream
|
|
132
|
-
* @param conversationId ID звонка
|
|
133
129
|
*/
|
|
134
|
-
function onRemoteScreenStream(userId: ExternalParticipantId, stream: MediaStream | null
|
|
130
|
+
function onRemoteScreenStream(userId: ExternalParticipantId, stream: MediaStream | null): void;
|
|
135
131
|
/**
|
|
136
132
|
* Получен стрим вимоджи собеседника.
|
|
137
133
|
* Если сервер закончил стримить собеседника, вместо стрима будет передан null
|
|
@@ -156,9 +152,8 @@ declare namespace External {
|
|
|
156
152
|
* @param muteStates Состояние устройств при входе в звонок
|
|
157
153
|
* @param participants Список участников звонка
|
|
158
154
|
* @param rooms Список сессионных залов в звонке
|
|
159
|
-
* @param conversationId ID звонка
|
|
160
155
|
*/
|
|
161
|
-
function onConversation(userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms
|
|
156
|
+
function onConversation(userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms): void;
|
|
162
157
|
/**
|
|
163
158
|
* Постраничные данные про участников при начале звонка
|
|
164
159
|
* @param chunk
|
|
@@ -224,17 +219,15 @@ declare namespace External {
|
|
|
224
219
|
*
|
|
225
220
|
* @param userId
|
|
226
221
|
* @param markers
|
|
227
|
-
* @param conversationId ID звонка
|
|
228
222
|
*/
|
|
229
|
-
function onParticipantAdded(userId: ExternalId, markers: ExternalParticipantListMarkers | null
|
|
223
|
+
function onParticipantAdded(userId: ExternalId, markers: ExternalParticipantListMarkers | null): void;
|
|
230
224
|
/**
|
|
231
225
|
* Участник подключился
|
|
232
226
|
*
|
|
233
227
|
* @param userId
|
|
234
228
|
* @param markers
|
|
235
|
-
* @param conversationId ID звонка
|
|
236
229
|
*/
|
|
237
|
-
function onParticipantJoined(userId: ExternalId, markers: ExternalParticipantListMarkers | null
|
|
230
|
+
function onParticipantJoined(userId: ExternalId, markers: ExternalParticipantListMarkers | null): void;
|
|
238
231
|
function onLocalParticipantState(participantState: ParticipantStateMapped, global?: boolean): void;
|
|
239
232
|
/**
|
|
240
233
|
* Изменились данные состояний собеседника
|
|
@@ -257,9 +250,8 @@ declare namespace External {
|
|
|
257
250
|
* @param userIds
|
|
258
251
|
* @param status
|
|
259
252
|
* @param data
|
|
260
|
-
* @param conversationId ID звонка
|
|
261
253
|
*/
|
|
262
|
-
function onRemoteStatus(userIds: ExternalParticipantId[], status: ParticipantStatus, data?: any
|
|
254
|
+
function onRemoteStatus(userIds: ExternalParticipantId[], status: ParticipantStatus, data?: any): void;
|
|
263
255
|
/**
|
|
264
256
|
* Разрешения на доступы были запрошены в браузере
|
|
265
257
|
*/
|
|
@@ -276,26 +268,23 @@ declare namespace External {
|
|
|
276
268
|
*
|
|
277
269
|
* @param userId
|
|
278
270
|
* @param markers
|
|
279
|
-
* @param conversationId ID звонка
|
|
280
271
|
*/
|
|
281
|
-
function onRemoteRemoved(userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null
|
|
272
|
+
function onRemoteRemoved(userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null): void;
|
|
282
273
|
/**
|
|
283
274
|
* Изменилось состояние звонка
|
|
284
275
|
*
|
|
285
276
|
* @param isCallActive Активен ли сейчас звонок
|
|
286
277
|
* @param canAddParticipants Можно ли добавлять собеседников
|
|
287
278
|
* @param conversation Информация о звонке
|
|
288
|
-
* @param conversationId ID звонка
|
|
289
279
|
*/
|
|
290
|
-
function onCallState(isCallActive: boolean, canAddParticipants: boolean, conversation: ConversationData
|
|
280
|
+
function onCallState(isCallActive: boolean, canAddParticipants: boolean, conversation: ConversationData): void;
|
|
291
281
|
/**
|
|
292
282
|
* Изменилось состояние камеры или микрофона
|
|
293
283
|
*
|
|
294
284
|
* @param mediaOption Тип устройства
|
|
295
285
|
* @param enabled Включено или выключено
|
|
296
|
-
* @param conversationId ID звонка
|
|
297
286
|
*/
|
|
298
|
-
function onDeviceSwitched(mediaOption: MediaOption, enabled: boolean
|
|
287
|
+
function onDeviceSwitched(mediaOption: MediaOption, enabled: boolean): void;
|
|
299
288
|
/**
|
|
300
289
|
* Изменились состояния устройств пользователя или разрешения включать камеру/микрофон
|
|
301
290
|
*
|
|
@@ -350,34 +339,21 @@ declare namespace External {
|
|
|
350
339
|
function onOptionsChanged(options: ConversationOption[]): void;
|
|
351
340
|
/**
|
|
352
341
|
* Входящий звонок был принят мной
|
|
353
|
-
*
|
|
354
|
-
* @param conversationId ID звонка
|
|
355
|
-
*/
|
|
356
|
-
function onCallAccepted(conversationId?: string): void;
|
|
357
|
-
/**
|
|
358
|
-
* Входящий звонок получен во время активного звонка
|
|
359
|
-
*
|
|
360
|
-
* @param conversationId ID звонка
|
|
361
|
-
* @param externalId
|
|
362
|
-
* @param mediaSettings
|
|
363
342
|
*/
|
|
364
|
-
function
|
|
343
|
+
function onCallAccepted(): void;
|
|
365
344
|
/**
|
|
366
345
|
* Исходящий звонок был принят кем-то
|
|
367
|
-
*
|
|
368
346
|
* @param userId
|
|
369
347
|
* @param capabilities
|
|
370
|
-
* @param conversationId ID звонка
|
|
371
348
|
*/
|
|
372
|
-
function onAcceptedCall(userId: ExternalId, capabilities: ParticipantCapabilities
|
|
349
|
+
function onAcceptedCall(userId: ExternalId, capabilities: ParticipantCapabilities): void;
|
|
373
350
|
function onRateNeeded(): void;
|
|
374
351
|
/**
|
|
375
352
|
* Изменился говорящий в звонке
|
|
376
353
|
*
|
|
377
354
|
* @param userId
|
|
378
|
-
* @param conversationId ID звонка
|
|
379
355
|
*/
|
|
380
|
-
function onSpeakerChanged(userId: ExternalParticipantId
|
|
356
|
+
function onSpeakerChanged(userId: ExternalParticipantId): void;
|
|
381
357
|
/**
|
|
382
358
|
* Громкость собеседников
|
|
383
359
|
*
|
|
@@ -470,6 +446,9 @@ declare namespace External {
|
|
|
470
446
|
* @param args
|
|
471
447
|
*/
|
|
472
448
|
function onDebugMessage(type: DebugMessageType, ...args: any[]): void;
|
|
449
|
+
function onDebugMessageWithContext(type: DebugMessageType, context: {
|
|
450
|
+
conversationId: string | null;
|
|
451
|
+
}, ...args: any[]): void;
|
|
473
452
|
/**
|
|
474
453
|
* Статистика звонка
|
|
475
454
|
*
|
package/static/Params.d.ts
CHANGED
|
@@ -490,7 +490,7 @@ export type ParamsObject = {
|
|
|
490
490
|
/**
|
|
491
491
|
* Получен локальный стрим с камеры/микрофона
|
|
492
492
|
*/
|
|
493
|
-
onLocalStream?: (stream: MediaStream | null, mediaSettings: MediaSettings
|
|
493
|
+
onLocalStream?: (stream: MediaStream | null, mediaSettings: MediaSettings) => void;
|
|
494
494
|
/**
|
|
495
495
|
* Локальный стрим изменился
|
|
496
496
|
*/
|
|
@@ -510,12 +510,12 @@ export type ParamsObject = {
|
|
|
510
510
|
/**
|
|
511
511
|
* Изменился статус локального соединения
|
|
512
512
|
*/
|
|
513
|
-
onLocalStatus?: (status: ParticipantStatus
|
|
513
|
+
onLocalStatus?: (status: ParticipantStatus) => void;
|
|
514
514
|
/**
|
|
515
515
|
* Получен стрим собеседника.
|
|
516
516
|
* Если сервер закончил стримить собеседника, вместо стрима будет передан null
|
|
517
517
|
*/
|
|
518
|
-
onRemoteStream?: (userId: ExternalParticipantId, stream: MediaStream | null
|
|
518
|
+
onRemoteStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
|
|
519
519
|
/**
|
|
520
520
|
* Cтрим собеседника приостановлен/возобновлен.
|
|
521
521
|
*/
|
|
@@ -524,7 +524,7 @@ export type ParamsObject = {
|
|
|
524
524
|
* Получен стрим с экрана собеседника.
|
|
525
525
|
* Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
|
|
526
526
|
*/
|
|
527
|
-
onRemoteScreenStream?: (userId: ExternalParticipantId, stream: MediaStream | null
|
|
527
|
+
onRemoteScreenStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
|
|
528
528
|
/**
|
|
529
529
|
* Получен стрим вимоджи собеседника.
|
|
530
530
|
* Если сервер закончил стримить вимоджи собеседника, вместо стрима будет передан null
|
|
@@ -551,7 +551,7 @@ export type ParamsObject = {
|
|
|
551
551
|
/**
|
|
552
552
|
* Начат звонок
|
|
553
553
|
*/
|
|
554
|
-
onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms
|
|
554
|
+
onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms) => void;
|
|
555
555
|
/**
|
|
556
556
|
* Начальный список участников для постраничного звонка
|
|
557
557
|
*/
|
|
@@ -583,11 +583,11 @@ export type ParamsObject = {
|
|
|
583
583
|
/**
|
|
584
584
|
* Добавили участника
|
|
585
585
|
*/
|
|
586
|
-
onParticipantAdded?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null
|
|
586
|
+
onParticipantAdded?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null) => void;
|
|
587
587
|
/**
|
|
588
588
|
* Участник присоединился к звонку
|
|
589
589
|
*/
|
|
590
|
-
onParticipantJoined?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers
|
|
590
|
+
onParticipantJoined?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers) => void;
|
|
591
591
|
/**
|
|
592
592
|
* Получены данные по изменению локальных состояний со стороны админа
|
|
593
593
|
* Например, принудительно опущена рука
|
|
@@ -607,7 +607,7 @@ export type ParamsObject = {
|
|
|
607
607
|
/**
|
|
608
608
|
* Изменился статус соединения собеседников
|
|
609
609
|
*/
|
|
610
|
-
onRemoteStatus?: (userIds: ExternalParticipantId[], status: ParticipantStatus, data: any
|
|
610
|
+
onRemoteStatus?: (userIds: ExternalParticipantId[], status: ParticipantStatus, data: any) => void;
|
|
611
611
|
/**
|
|
612
612
|
* Разрешения на доступы были запрошены в браузере
|
|
613
613
|
*/
|
|
@@ -619,15 +619,15 @@ export type ParamsObject = {
|
|
|
619
619
|
/**
|
|
620
620
|
* Пользователь отключился от звонка
|
|
621
621
|
*/
|
|
622
|
-
onRemoteRemoved?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null
|
|
622
|
+
onRemoteRemoved?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null) => void;
|
|
623
623
|
/**
|
|
624
624
|
* Изменилось состояние звонка
|
|
625
625
|
*/
|
|
626
|
-
onCallState?: (isCallActive: boolean, canAddParticipants: boolean, conversation: ConversationData
|
|
626
|
+
onCallState?: (isCallActive: boolean, canAddParticipants: boolean, conversation: ConversationData) => void;
|
|
627
627
|
/**
|
|
628
628
|
* Изменилось состояние камеры или микрофона
|
|
629
629
|
*/
|
|
630
|
-
onDeviceSwitched?: (mediaOption: MediaOption, enabled: boolean
|
|
630
|
+
onDeviceSwitched?: (mediaOption: MediaOption, enabled: boolean) => void;
|
|
631
631
|
/**
|
|
632
632
|
* Изменились состояния устройств пользователя или разрешения включать камеру/микрофон
|
|
633
633
|
*/
|
|
@@ -656,7 +656,7 @@ export type ParamsObject = {
|
|
|
656
656
|
/**
|
|
657
657
|
* Изменился говорящий в звонке
|
|
658
658
|
*/
|
|
659
|
-
onSpeakerChanged?: (userId: ExternalParticipantId
|
|
659
|
+
onSpeakerChanged?: (userId: ExternalParticipantId) => void;
|
|
660
660
|
/**
|
|
661
661
|
* Громкость собеседников
|
|
662
662
|
*/
|
|
@@ -676,12 +676,12 @@ export type ParamsObject = {
|
|
|
676
676
|
/**
|
|
677
677
|
* Входящий звонок был принят мной
|
|
678
678
|
*/
|
|
679
|
-
onCallAccepted?: (
|
|
679
|
+
onCallAccepted?: () => void;
|
|
680
680
|
/**
|
|
681
681
|
* Исходящий звонок был принят кем-то
|
|
682
682
|
* @param userId
|
|
683
683
|
*/
|
|
684
|
-
onAcceptedCall?: (userId: ExternalParticipantId, capabilities: ParticipantCapabilities
|
|
684
|
+
onAcceptedCall?: (userId: ExternalParticipantId, capabilities: ParticipantCapabilities) => void;
|
|
685
685
|
/**
|
|
686
686
|
* Список устройств изменился
|
|
687
687
|
*/
|
|
@@ -730,6 +730,12 @@ export type ParamsObject = {
|
|
|
730
730
|
* Получено отладочное сообщение. Работает только при выключенном режиме отладки
|
|
731
731
|
*/
|
|
732
732
|
onDebugMessage?: (type: DebugMessageType, ...args: any[]) => void;
|
|
733
|
+
/**
|
|
734
|
+
* Получено отладочное сообщение с контекстом звонка. Работает только при выключенном режиме отладки
|
|
735
|
+
*/
|
|
736
|
+
onDebugMessageWithContext?: (type: DebugMessageType, context: {
|
|
737
|
+
conversationId: string | null;
|
|
738
|
+
}, ...args: any[]) => void;
|
|
733
739
|
/**
|
|
734
740
|
* Статистика звонка
|
|
735
741
|
*/
|
|
@@ -859,14 +865,6 @@ export type ParamsObject = {
|
|
|
859
865
|
* @param demoted участник разжалован
|
|
860
866
|
*/
|
|
861
867
|
onPromoted?: (demoted: boolean) => void;
|
|
862
|
-
/**
|
|
863
|
-
* Входящий звонок получен во время активного звонка
|
|
864
|
-
*
|
|
865
|
-
* @param conversationId ID звонка
|
|
866
|
-
* @param externalId Внешний ID вызывающего
|
|
867
|
-
* @param mediaSettings Настройки медиа
|
|
868
|
-
*/
|
|
869
|
-
onIncomingCall?: (conversationId: string, externalId: ExternalParticipantId | undefined, mediaSettings: MediaSettings | undefined) => void;
|
|
870
868
|
/**
|
|
871
869
|
* Собеседник подключился к сигналлингу
|
|
872
870
|
*/
|