@vkontakte/calls-sdk 2.8.10-dev.52257705.0 → 2.8.10-dev.6360a014.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 +4 -2
- package/calls-sdk.cjs.js +10 -10
- package/calls-sdk.esm.js +10 -10
- package/classes/AudioOutput.d.ts +9 -1
- package/classes/Conversation.d.ts +2 -0
- package/classes/TransparentAudioOutput.d.ts +19 -0
- package/devtools/DevTools.d.ts +20 -0
- package/devtools/DevToolsStorage.d.ts +16 -0
- package/devtools/index.d.ts +1 -0
- package/devtools/modules/Params.d.ts +65 -0
- package/devtools/types.d.ts +15 -0
- package/enums/HangupType.d.ts +4 -0
- package/enums/TrackId.d.ts +2 -1
- package/package.json +1 -1
- package/static/Params.d.ts +8 -0
- package/types/FastJoin.d.ts +13 -0
package/classes/AudioOutput.d.ts
CHANGED
|
@@ -3,7 +3,15 @@ type ParticipantAudioOutput = {
|
|
|
3
3
|
audioElement?: HTMLAudioElement;
|
|
4
4
|
audioTrack?: MediaStreamTrack;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export interface IAudioOutput {
|
|
7
|
+
add(track: MediaStreamTrack): void;
|
|
8
|
+
remove(track: MediaStreamTrack): void;
|
|
9
|
+
get volume(): number;
|
|
10
|
+
set volume(volume: number);
|
|
11
|
+
destroy(): void;
|
|
12
|
+
changeOutput(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export default class AudioOutput implements IAudioOutput {
|
|
7
15
|
protected _output: ParticipantAudioOutput | null;
|
|
8
16
|
private _volume;
|
|
9
17
|
private readonly _features;
|
|
@@ -14,6 +14,7 @@ import { IAsrStartParams, IAsrStopParams } from '../types/Asr';
|
|
|
14
14
|
import { AudienceModeHandsResponse } from '../types/AudienceMode';
|
|
15
15
|
import { ConversationData, ConversationOnStartParams } from '../types/Conversation';
|
|
16
16
|
import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalUserId } from '../types/ExternalId';
|
|
17
|
+
import type { FastJoinHandler } from '../types/FastJoin';
|
|
17
18
|
import MediaModifiers from '../types/MediaModifiers';
|
|
18
19
|
import { IVideoDimentions } from '../types/MediaSettings';
|
|
19
20
|
import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
|
|
@@ -75,6 +76,7 @@ export default class Conversation extends EventEmitter {
|
|
|
75
76
|
joinLink?: string;
|
|
76
77
|
observedIds?: ExternalUserId[];
|
|
77
78
|
payload?: string;
|
|
79
|
+
onFastJoin?: FastJoinHandler;
|
|
78
80
|
}): Promise<ConversationData>;
|
|
79
81
|
private _onJoinPart2;
|
|
80
82
|
private _extractExternalRooms;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IAudioOutput } from './AudioOutput';
|
|
2
|
+
import { StatFirstMediaReceived } from './stat/StatFirstMediaReceived';
|
|
3
|
+
export default class TransparentAudioOutput implements IAudioOutput {
|
|
4
|
+
private audioTracks;
|
|
5
|
+
private audioElement;
|
|
6
|
+
private _volume;
|
|
7
|
+
private readonly _features;
|
|
8
|
+
private readonly _statFirstMediaReceived;
|
|
9
|
+
constructor(statFirstMediaReceived: StatFirstMediaReceived);
|
|
10
|
+
add(track: MediaStreamTrack): void;
|
|
11
|
+
remove(track: MediaStreamTrack): void;
|
|
12
|
+
get volume(): number;
|
|
13
|
+
set volume(volume: number);
|
|
14
|
+
protected _initAudioElement(): void;
|
|
15
|
+
protected _stopAudioElement(): void;
|
|
16
|
+
destroy(): void;
|
|
17
|
+
/** изменяем устройство для воспроизведения аудио */
|
|
18
|
+
changeOutput(): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DevTools for SDK
|
|
3
|
+
* Позволяет подменять значения ручек перед инициализацией SDK
|
|
4
|
+
*/
|
|
5
|
+
import Params from './modules/Params';
|
|
6
|
+
import type { DevToolsOptions } from './types';
|
|
7
|
+
export type { DevToolsOptions };
|
|
8
|
+
/**
|
|
9
|
+
* DevTools API for runtime SDK configuration
|
|
10
|
+
* Singleton class to ensure consistent state across the application
|
|
11
|
+
*/
|
|
12
|
+
declare class DevTools {
|
|
13
|
+
private static instance;
|
|
14
|
+
static getInstance(): DevTools;
|
|
15
|
+
readonly params: Params;
|
|
16
|
+
private storage;
|
|
17
|
+
private constructor();
|
|
18
|
+
}
|
|
19
|
+
declare const _default: DevTools;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storage utility for DevTools
|
|
3
|
+
* Handles persistence of DevTools options in localStorage
|
|
4
|
+
*/
|
|
5
|
+
import type { DevToolsOptions } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Storage utility for DevTools
|
|
8
|
+
*/
|
|
9
|
+
export default class DevToolsStorage {
|
|
10
|
+
set(key: string, value: any): void;
|
|
11
|
+
get<T>(key: string): T | null;
|
|
12
|
+
remove(key: string): void;
|
|
13
|
+
clear(): void;
|
|
14
|
+
getAll(): DevToolsOptions;
|
|
15
|
+
private getStorage;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as devtools } from './DevTools';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Params module for DevTools
|
|
3
|
+
* Позволяет подменять значения ручек перед инициализацией SDK
|
|
4
|
+
*/
|
|
5
|
+
import type DevToolsStorage from '../DevToolsStorage';
|
|
6
|
+
import type { DevToolsOptions } from '../types';
|
|
7
|
+
export type { DevToolsOptions };
|
|
8
|
+
export default class Params {
|
|
9
|
+
private storage;
|
|
10
|
+
constructor(storage: DevToolsStorage);
|
|
11
|
+
/**
|
|
12
|
+
* Set an option override
|
|
13
|
+
* @param key - Option name
|
|
14
|
+
* @param value - Option value
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* __CALLS_SDK.params.set('webtransport', true);
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
set<K extends keyof DevToolsOptions>(key: K, value: DevToolsOptions[K]): void;
|
|
21
|
+
/**
|
|
22
|
+
* Get an option override value
|
|
23
|
+
* @param key - Option name
|
|
24
|
+
* @returns Option value if override is set, null if not set
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const value = __CALLS_SDK.params.get('webtransport');
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
get<K extends keyof DevToolsOptions>(key: K): DevToolsOptions[K] | null;
|
|
31
|
+
/**
|
|
32
|
+
* Clear a specific option override
|
|
33
|
+
* @param key - Option name
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* __CALLS_SDK.params.clear('webtransport');
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
clear<K extends keyof DevToolsOptions>(key: K): void;
|
|
40
|
+
/**
|
|
41
|
+
* Clear all DevTools overrides
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* __CALLS_SDK.params.clearAll();
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
clearAll(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Get all current DevTools overrides
|
|
50
|
+
* @returns Current override values
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const overrides = __CALLS_SDK.params.getAll();
|
|
54
|
+
* console.log(overrides); // { webtransport: true }
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
getAll(): DevToolsOptions;
|
|
58
|
+
/**
|
|
59
|
+
* Apply DevTools overrides to client options
|
|
60
|
+
* DevTools overrides take precedence over client-provided options
|
|
61
|
+
* @param clientOptions - Original client options
|
|
62
|
+
* @returns Modified options with DevTools overrides applied
|
|
63
|
+
*/
|
|
64
|
+
applyOverrides<T extends DevToolsOptions>(clientOptions: T): T;
|
|
65
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for DevTools
|
|
3
|
+
*/
|
|
4
|
+
import type { ParamsObject } from '../static/Params';
|
|
5
|
+
type Primitive = string | number | boolean;
|
|
6
|
+
type PrimitiveKeys<T> = {
|
|
7
|
+
[K in keyof T]-?: Exclude<T[K], undefined> extends Primitive ? K : never;
|
|
8
|
+
}[keyof T];
|
|
9
|
+
export type PrimitiveParamsObject = Pick<ParamsObject, PrimitiveKeys<ParamsObject>>;
|
|
10
|
+
/**
|
|
11
|
+
* Available DevTools options that can be overridden
|
|
12
|
+
* All properties are optional
|
|
13
|
+
*/
|
|
14
|
+
export type DevToolsOptions = Partial<PrimitiveParamsObject>;
|
|
15
|
+
export {};
|
package/enums/HangupType.d.ts
CHANGED
|
@@ -38,6 +38,10 @@ declare enum HangupType {
|
|
|
38
38
|
* Проблемы при работе через FastStart
|
|
39
39
|
*/
|
|
40
40
|
FAST_START_ERROR = "FAST_START_ERROR",
|
|
41
|
+
/**
|
|
42
|
+
* Проблемы при работе через FastJoin
|
|
43
|
+
*/
|
|
44
|
+
FAST_JOIN_ERROR = "FAST_JOIN_ERROR",
|
|
41
45
|
/**
|
|
42
46
|
* Таймаут инициализации вызова – звонок не начался
|
|
43
47
|
*
|
package/enums/TrackId.d.ts
CHANGED
package/package.json
CHANGED
package/static/Params.d.ts
CHANGED
|
@@ -480,6 +480,12 @@ export type ParamsObject = {
|
|
|
480
480
|
* _По умолчанию: `false`_
|
|
481
481
|
*/
|
|
482
482
|
webtransportFF: boolean;
|
|
483
|
+
/**
|
|
484
|
+
* Включить поддержку прозрачного аудио
|
|
485
|
+
*
|
|
486
|
+
* _По умолчанию: `false`_
|
|
487
|
+
*/
|
|
488
|
+
transparentAudio: boolean;
|
|
483
489
|
/**
|
|
484
490
|
* Получен локальный стрим с камеры/микрофона
|
|
485
491
|
*/
|
|
@@ -985,6 +991,7 @@ export default abstract class Params {
|
|
|
985
991
|
static get simulcast(): boolean;
|
|
986
992
|
static get webtransport(): boolean;
|
|
987
993
|
static get webtransportFF(): boolean;
|
|
994
|
+
static get transparentAudio(): boolean;
|
|
988
995
|
static toJSON(): {
|
|
989
996
|
apiKey: string;
|
|
990
997
|
apiEnv: string;
|
|
@@ -1018,5 +1025,6 @@ export default abstract class Params {
|
|
|
1018
1025
|
simulcast: boolean;
|
|
1019
1026
|
webtransport: boolean;
|
|
1020
1027
|
webtransportFF: boolean;
|
|
1028
|
+
transparentAudio: boolean;
|
|
1021
1029
|
};
|
|
1022
1030
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Параметры для fast join
|
|
3
|
+
*/
|
|
4
|
+
export interface FastJoinParams {
|
|
5
|
+
joinLink: string;
|
|
6
|
+
isVideo: boolean;
|
|
7
|
+
internalParams: string;
|
|
8
|
+
}
|
|
9
|
+
export interface FastJoinResponse {
|
|
10
|
+
conversationId: string;
|
|
11
|
+
internalCallerParams: string;
|
|
12
|
+
}
|
|
13
|
+
export type FastJoinHandler = (params: FastJoinParams) => Promise<FastJoinResponse>;
|