@vkontakte/calls-sdk 2.8.12-dev.e23c81f4.0 → 2.8.12-dev.ec5956ec.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 +20 -6
- package/abstract/BaseApi.d.ts +1 -0
- package/abstract/BaseSignaling.d.ts +5 -4
- package/calls-sdk.cjs.js +9 -9
- package/calls-sdk.esm.js +3706 -2907
- package/classes/CallRegistry.d.ts +5 -1
- package/classes/ExternalIdCache.d.ts +1 -0
- package/classes/StatsLogger.d.ts +17 -2
- package/classes/{Conversation.d.ts → conversation/Conversation.d.ts} +49 -47
- package/classes/conversation/Conversation.testUtils.d.ts +148 -0
- package/classes/{ConversationResponseValidator.d.ts → conversation/ConversationResponseValidator.d.ts} +1 -1
- package/classes/{DisplayLayoutRequester.d.ts → conversation/DisplayLayoutRequester.d.ts} +5 -5
- package/classes/conversation/index.d.ts +1 -0
- package/classes/stat/CallFinishClassifier.d.ts +11 -0
- package/classes/stat/CallLifecycleStats.d.ts +42 -0
- package/classes/stat/ConversationStats.d.ts +5 -4
- package/classes/stat/FirstMediaSentProbe.d.ts +13 -0
- package/classes/stat/StatPings.d.ts +1 -2
- package/classes/stat/StatSignalingCommands.d.ts +1 -2
- package/classes/transport/BaseTransport.d.ts +7 -1
- package/classes/transport/DirectTransport.d.ts +2 -1
- package/classes/transport/ServerTransport.d.ts +2 -1
- package/classes/transport/Transport.d.ts +6 -1
- package/default/Api.d.ts +1 -2
- package/default/Signaling.d.ts +11 -14
- package/default/SignalingTransport.d.ts +10 -2
- package/enums/ClientHangupReason.d.ts +7 -0
- package/enums/HangupType.d.ts +0 -1
- package/enums/Stat.d.ts +5 -1
- package/package.json +1 -1
- package/static/AuthData.d.ts +10 -0
- package/static/Debug.d.ts +1 -0
- package/static/External.d.ts +1 -1
- package/static/Params.d.ts +1 -10
- package/static/WebRTCUtils.d.ts +4 -0
- package/types/Conversation.d.ts +12 -2
- package/types/SignalingMessage.d.ts +5 -1
- package/types/WebTransport.d.ts +17 -16
- package/utils/IceServers.d.ts +2 -0
package/default/Api.d.ts
CHANGED
|
@@ -7,11 +7,10 @@ import { ExternalId, ExternalParticipantId, ExternalUserId } from '../types/Exte
|
|
|
7
7
|
import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
|
|
8
8
|
import PushData from '../types/PushData';
|
|
9
9
|
export default class Api extends BaseApi {
|
|
10
|
-
private _userId;
|
|
11
10
|
private _uuid;
|
|
12
11
|
private _idCache;
|
|
13
12
|
private _callUnsafe;
|
|
14
|
-
protected _call(method: string, data?: any, noSession?: boolean): Promise<any>;
|
|
13
|
+
protected _call(method: string, data?: any, noSession?: boolean, allowReauthorize?: boolean): Promise<any>;
|
|
15
14
|
userId(participantId: ParticipantId): ExternalParticipantId;
|
|
16
15
|
authorize(): Promise<void>;
|
|
17
16
|
private _getAnonymLoginCacheKey;
|
package/default/Signaling.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import BaseSignaling, { AddParticipantParams } from '../abstract/BaseSignaling';
|
|
2
|
-
import StatsLogger from '../classes/StatsLogger';
|
|
3
2
|
import { ParticipantIdRegistry } from '../classes/ParticipantIdRegistry';
|
|
4
3
|
import { SharingStatReport } from '../classes/screenshare/SharingStatReport';
|
|
5
4
|
import { StatAggregator } from '../classes/stat/StatAggregator';
|
|
6
5
|
import { StatPings } from '../classes/stat/StatPings';
|
|
7
6
|
import { StatSignalingCommands } from '../classes/stat/StatSignalingCommands';
|
|
8
|
-
import
|
|
7
|
+
import StatsLogger from '../classes/StatsLogger';
|
|
9
8
|
import ConversationFeature from '../enums/ConversationFeature';
|
|
10
9
|
import ConversationOption from '../enums/ConversationOption';
|
|
11
10
|
import MediaOption from '../enums/MediaOption';
|
|
12
11
|
import SignalingConnectionType from '../enums/SignalingConnectionType';
|
|
12
|
+
import TransportTopology from '../enums/TransportTopology';
|
|
13
13
|
import UserRole from '../enums/UserRole';
|
|
14
14
|
import { type DebugLogger } from '../static/Debug';
|
|
15
15
|
import { JSONObject } from '../static/Json';
|
|
@@ -35,13 +35,13 @@ export default class Signaling extends BaseSignaling {
|
|
|
35
35
|
private datachannelCommandsQueue;
|
|
36
36
|
private incomingCache;
|
|
37
37
|
private responseHandlers;
|
|
38
|
+
private disposed;
|
|
38
39
|
private connectionType;
|
|
39
40
|
private conversationResolve;
|
|
40
41
|
private conversationReject;
|
|
41
42
|
private connected;
|
|
42
43
|
private listenersReady;
|
|
43
44
|
private peerId;
|
|
44
|
-
private conversationId;
|
|
45
45
|
private connectionMessageWaitTimer;
|
|
46
46
|
private participantIdRegistry;
|
|
47
47
|
private producerNotificationDataChannel;
|
|
@@ -60,21 +60,16 @@ export default class Signaling extends BaseSignaling {
|
|
|
60
60
|
setAbortSignal(signal: AbortSignal | undefined): void;
|
|
61
61
|
setEndpoint(endpoint: string): void;
|
|
62
62
|
setWebTransportEndpoint(endpoint: string | null): void;
|
|
63
|
-
setConversationId(conversationId: string): void;
|
|
64
63
|
setParticipantIdRegistry(participantIdRegistry: ParticipantIdRegistry): void;
|
|
65
64
|
setProducerNotificationDataChannel(dataChannel: RTCDataChannel): void;
|
|
66
65
|
setProducerCommandDataChannel(dataChannel: RTCDataChannel): void;
|
|
67
66
|
useCommandDataChannel(status: boolean): void;
|
|
68
|
-
/**
|
|
69
|
-
* Free used resources
|
|
70
|
-
*/
|
|
71
|
-
cleanup(): void;
|
|
72
67
|
/**
|
|
73
68
|
* Open a connection with a signaling server
|
|
74
69
|
*/
|
|
75
70
|
connect(connectionType: SignalingConnectionType): Promise<SignalingMessage.Connection>;
|
|
76
71
|
getNextCommandSequenceNumber(): number;
|
|
77
|
-
hangup(reason: string): Promise<SignalingMessage
|
|
72
|
+
hangup(reason: string): Promise<SignalingMessage>;
|
|
78
73
|
sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidate): Promise<SignalingMessage>;
|
|
79
74
|
requestTestMode(consumerCommand: string, producerCommand: string | null): Promise<SignalingMessage>;
|
|
80
75
|
sendSdp(participantId: ParticipantId, sdp: RTCSessionDescriptionInit, extraPayload?: Record<string, any>): Promise<SignalingMessage>;
|
|
@@ -138,10 +133,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
138
133
|
acceptPromotion(reject?: boolean): Promise<SignalingMessage>;
|
|
139
134
|
feedback(key: string): Promise<SignalingMessage>;
|
|
140
135
|
getHandQueue(): Promise<SignalingMessage>;
|
|
141
|
-
|
|
142
|
-
* Close a connection with a signaling server
|
|
143
|
-
*/
|
|
144
|
-
close(): void;
|
|
136
|
+
dispose(cause?: Error): void;
|
|
145
137
|
/**
|
|
146
138
|
* Этот метод нужен т.к. после получения сообщения "connected" устанавливается транспорт
|
|
147
139
|
* и подписывается на сигналинг. Данные приходят очень быстро и транспорт пропускает
|
|
@@ -173,20 +165,25 @@ export default class Signaling extends BaseSignaling {
|
|
|
173
165
|
private _onError;
|
|
174
166
|
private _serializeErrorEvent;
|
|
175
167
|
private _onClose;
|
|
176
|
-
private
|
|
168
|
+
private _terminate;
|
|
169
|
+
private _fail;
|
|
177
170
|
private _isRecordCommand;
|
|
178
171
|
private _resolvePendingRecordCommands;
|
|
179
172
|
private _handleCommandResponse;
|
|
180
173
|
private _handleCommandsQueue;
|
|
181
174
|
private _startResponseTimer;
|
|
175
|
+
private _resolveCommandWithoutResponse;
|
|
182
176
|
private _serializeBinary;
|
|
183
177
|
private _serializeJson;
|
|
184
178
|
private _convertDisplayLayout;
|
|
185
179
|
private _waitConnectionMessage;
|
|
186
180
|
private _stopWaitConnectionMessage;
|
|
181
|
+
private _onTransportConnecting;
|
|
187
182
|
private _onTransportFailed;
|
|
188
183
|
private _onTransportReconnectScheduled;
|
|
189
184
|
private _onTransportConnectionDead;
|
|
185
|
+
private _attachNotificationCallError;
|
|
186
|
+
private _createSignalingCallError;
|
|
190
187
|
private _getSocketType;
|
|
191
188
|
private _markTransportStat;
|
|
192
189
|
private _logTransportStat;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import SignalingConnectionType from '../enums/SignalingConnectionType';
|
|
2
2
|
import { SignalingTransportType } from '../enums/SignalingTransportStat';
|
|
3
|
+
import { DebugLogger } from '../static/Debug';
|
|
3
4
|
export declare enum SignalingTransportFailure {
|
|
4
5
|
EMPTY_ENDPOINT = "EMPTY_ENDPOINT",
|
|
5
6
|
NETWORK_ERROR = "NETWORK_ERROR",
|
|
@@ -8,13 +9,19 @@ export declare enum SignalingTransportFailure {
|
|
|
8
9
|
export type SignalingTransportFailedEvent = {
|
|
9
10
|
failure: SignalingTransportFailure;
|
|
10
11
|
message: string;
|
|
12
|
+
source: SignalingTransportType;
|
|
11
13
|
remote?: boolean;
|
|
12
14
|
};
|
|
13
15
|
export type SignalingTransportReconnectEvent = {
|
|
14
16
|
count: number;
|
|
15
17
|
delay: number;
|
|
16
18
|
};
|
|
19
|
+
export type SignalingTransportConnectingEvent = {
|
|
20
|
+
connectionType: SignalingConnectionType;
|
|
21
|
+
source: SignalingTransportType;
|
|
22
|
+
};
|
|
17
23
|
export type SignalingTransportHandlers = {
|
|
24
|
+
onConnecting: (event: SignalingTransportConnectingEvent) => void;
|
|
18
25
|
onOpen: () => void;
|
|
19
26
|
onMessage: (event: MessageEvent) => void;
|
|
20
27
|
onError: (event: Event) => void;
|
|
@@ -38,7 +45,8 @@ export default class SignalingTransport {
|
|
|
38
45
|
private abortSignal;
|
|
39
46
|
private manualClose;
|
|
40
47
|
private currentType;
|
|
41
|
-
|
|
48
|
+
private readonly _debug;
|
|
49
|
+
constructor(debug: DebugLogger | undefined, handlers: SignalingTransportHandlers);
|
|
42
50
|
get readyState(): number | null;
|
|
43
51
|
get type(): SignalingTransportType;
|
|
44
52
|
setEndpoint(endpoint: string): void;
|
|
@@ -49,7 +57,7 @@ export default class SignalingTransport {
|
|
|
49
57
|
resetReconnectCount(): void;
|
|
50
58
|
connect(connectionType: SignalingConnectionType): void;
|
|
51
59
|
close(code?: number): void;
|
|
52
|
-
send(data: string | ArrayBuffer): void
|
|
60
|
+
send(data: string | ArrayBuffer): Promise<void>;
|
|
53
61
|
private _connect;
|
|
54
62
|
private _connectWebTransport;
|
|
55
63
|
private _connectWebSocket;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import HangupType from './HangupType';
|
|
2
|
+
/**
|
|
3
|
+
* Причины завершения звонка, которые клиент может передать в {@link hangup}/{@link declineCall}
|
|
4
|
+
* и пробросить в сигналинг без маппинга.
|
|
5
|
+
*/
|
|
6
|
+
export type ClientHangupReason = HangupType.HUNGUP | HangupType.CANCELED | HangupType.REJECTED | HangupType.BUSY | HangupType.MISSED | HangupType.CALL_TIMEOUT;
|
|
7
|
+
export default ClientHangupReason;
|
package/enums/HangupType.d.ts
CHANGED
|
@@ -20,7 +20,6 @@ declare enum HangupType {
|
|
|
20
20
|
CALLER_IS_REJECTED = "CALLER_IS_REJECTED",
|
|
21
21
|
UNKNOWN_ERROR = "UNKNOWN_ERROR",
|
|
22
22
|
UNSUPPORTED = "UNSUPPORTED",
|
|
23
|
-
OLD_VERSION = "OLD_VERSION",
|
|
24
23
|
SERVICE_DISABLED = "SERVICE_DISABLED",
|
|
25
24
|
SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE",
|
|
26
25
|
EXTERNAL_API_ERROR = "EXTERNAL_API_ERROR",
|
package/enums/Stat.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
declare const enum Stat {
|
|
2
|
+
CALL_INIT = "call_init",
|
|
3
|
+
CALL_START = "call_start",
|
|
4
|
+
CALL_ACCEPTED_OUTGOING = "call_accepted_outgoing",
|
|
5
|
+
CALL_ACCEPTED_INCOMING = "call_accepted_incoming",
|
|
6
|
+
FIRST_MEDIA_SENT = "first_media_sent",
|
|
2
7
|
CALL_FINISH = "call_finish",// событие отправляемое в конце звонка
|
|
3
8
|
CODEC_USAGE = "codec_usage",// событие когда меняется кодек
|
|
4
9
|
SIGNALING_CONNECTED = "signaling_connected",// measure
|
|
@@ -7,7 +12,6 @@ declare const enum Stat {
|
|
|
7
12
|
FIRST_MEDIA_RECEIVED = "first_media_received",
|
|
8
13
|
CALL_DECLINED_OR_HANGED_LOCALLY = "CallDeclinedOrHangedLocally",
|
|
9
14
|
USER_FEEDBACK_RECEIVED = "UserFeedbackReceived",
|
|
10
|
-
CALL_START = "call_start",
|
|
11
15
|
SIGNALING_PING_SUMMARY = "signaling_ping_summary",
|
|
12
16
|
SIGNALING_COMMAND_SUMMARY = "signaling_command_summary",
|
|
13
17
|
WEBSOCKET_CONNECTED = "websocket_connected",
|
package/package.json
CHANGED
package/static/AuthData.d.ts
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
|
+
import type { OkUserId } from '../types/Participant';
|
|
1
2
|
export default abstract class AuthData {
|
|
2
3
|
private static _sessionKey;
|
|
3
4
|
private static _sessionSecretKey;
|
|
4
5
|
private static _accessToken;
|
|
6
|
+
private static _userId;
|
|
7
|
+
private static _reauthorizePromise;
|
|
5
8
|
static get sessionKey(): string | undefined;
|
|
6
9
|
static set sessionKey(value: string | undefined);
|
|
7
10
|
static get sessionSecretKey(): string | undefined;
|
|
8
11
|
static set sessionSecretKey(value: string | undefined);
|
|
9
12
|
static get accessToken(): string | undefined;
|
|
10
13
|
static set accessToken(value: string | undefined);
|
|
14
|
+
static get userId(): OkUserId | null;
|
|
15
|
+
static set userId(value: OkUserId | null);
|
|
11
16
|
static isEmpty(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Дедуплицирует одновременные попытки реавторизации из разных инстансов Api.
|
|
19
|
+
* Первый вызов выполняет authorizeFn, остальные ждут того же промиса.
|
|
20
|
+
*/
|
|
21
|
+
static reauthorize(authorizeFn: () => Promise<void>): Promise<void>;
|
|
12
22
|
}
|
package/static/Debug.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export type DebugSessionLogger = DebugLogger & {
|
|
|
21
21
|
readonly sessionId: string | null;
|
|
22
22
|
readonly conversationId: string | null;
|
|
23
23
|
setConversationId(conversationId: string | null): void;
|
|
24
|
+
send(type: DebugMessageType, ...args: any[]): void;
|
|
24
25
|
};
|
|
25
26
|
declare namespace Debug {
|
|
26
27
|
type ContextProvider = () => DebugMessageContext;
|
package/static/External.d.ts
CHANGED
|
@@ -637,6 +637,6 @@ declare namespace External {
|
|
|
637
637
|
/**
|
|
638
638
|
* Собеседник подключился к сигналлингу
|
|
639
639
|
*/
|
|
640
|
-
function onPeerRegistered(conversationId?: string): void;
|
|
640
|
+
function onPeerRegistered(conversationId?: string, externalIds?: ExternalId[]): void;
|
|
641
641
|
}
|
|
642
642
|
export default External;
|
package/static/Params.d.ts
CHANGED
|
@@ -485,13 +485,6 @@ export type ParamsObject = {
|
|
|
485
485
|
* _По умолчанию: `false`_
|
|
486
486
|
*/
|
|
487
487
|
webtransport: boolean;
|
|
488
|
-
/**
|
|
489
|
-
* Включить поддержку webtransport для сигналинга в FireFox
|
|
490
|
-
* Отдельная ручка, так как есть проблемы сейчас с FF
|
|
491
|
-
*
|
|
492
|
-
* _По умолчанию: `false`_
|
|
493
|
-
*/
|
|
494
|
-
webtransportFF: boolean;
|
|
495
488
|
/**
|
|
496
489
|
* Ждать подтверждения от бэкенда для команд startStream/stopStream.
|
|
497
490
|
* При включении: reject без соединения, resolve/reject по ответу бэкенда,
|
|
@@ -899,7 +892,7 @@ export type ParamsObject = {
|
|
|
899
892
|
/**
|
|
900
893
|
* Собеседник подключился к сигналлингу
|
|
901
894
|
*/
|
|
902
|
-
onPeerRegistered?: (conversationId?: string) => void;
|
|
895
|
+
onPeerRegistered?: (conversationId?: string, externalIds?: ExternalId[]) => void;
|
|
903
896
|
};
|
|
904
897
|
export default abstract class Params {
|
|
905
898
|
private static _params;
|
|
@@ -1031,7 +1024,6 @@ export default abstract class Params {
|
|
|
1031
1024
|
static get enableVideoEffectsFpsDegradation(): boolean;
|
|
1032
1025
|
static get simulcast(): boolean;
|
|
1033
1026
|
static get webtransport(): boolean;
|
|
1034
|
-
static get webtransportFF(): boolean;
|
|
1035
1027
|
static get waitForRecordResponse(): boolean;
|
|
1036
1028
|
static get transparentAudio(): boolean;
|
|
1037
1029
|
static get enableSessionStateUpdates(): boolean;
|
|
@@ -1068,7 +1060,6 @@ export default abstract class Params {
|
|
|
1068
1060
|
switchVideoAtBadNetwork: boolean;
|
|
1069
1061
|
simulcast: boolean;
|
|
1070
1062
|
webtransport: boolean;
|
|
1071
|
-
webtransportFF: boolean;
|
|
1072
1063
|
waitForRecordResponse: boolean;
|
|
1073
1064
|
transparentAudio: boolean;
|
|
1074
1065
|
enableSessionStateUpdates: boolean;
|
package/static/WebRTCUtils.d.ts
CHANGED
|
@@ -122,6 +122,10 @@ declare namespace WebRTCUtils {
|
|
|
122
122
|
* Проверяет поддержку WebRTC браузером
|
|
123
123
|
*/
|
|
124
124
|
function isBrowserSupported(): boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Возвращает первую отсутствующую capability в стабильном порядке.
|
|
127
|
+
*/
|
|
128
|
+
function getBrowserSupportFailure(): BrowserSupportFailure | null;
|
|
125
129
|
/**
|
|
126
130
|
* Проверяет поддержку шаринга экрана браузером
|
|
127
131
|
*/
|
package/types/Conversation.d.ts
CHANGED
|
@@ -7,7 +7,8 @@ import MediaOption from '../enums/MediaOption';
|
|
|
7
7
|
import UserRole from '../enums/UserRole';
|
|
8
8
|
import { AsrInfo } from './Asr';
|
|
9
9
|
import { IFeaturesPerRole } from './ConversationFeature';
|
|
10
|
-
import { ExternalId, ExternalParticipantId } from './ExternalId';
|
|
10
|
+
import { ExternalId, ExternalParticipantId, ExternalUserId } from './ExternalId';
|
|
11
|
+
import { FastJoinHandler } from './FastJoin';
|
|
11
12
|
import { FastStartHandler } from './FastStart';
|
|
12
13
|
import MediaModifiers from './MediaModifiers';
|
|
13
14
|
import MuteStates from './MuteStates';
|
|
@@ -84,6 +85,16 @@ export type ConversationOnStartParams = {
|
|
|
84
85
|
onFastStart?: FastStartHandler;
|
|
85
86
|
conversationId?: string;
|
|
86
87
|
};
|
|
88
|
+
export type ConversationOnJoinParams = {
|
|
89
|
+
conversationId?: string;
|
|
90
|
+
mediaOptions: MediaOption[];
|
|
91
|
+
chatId?: string;
|
|
92
|
+
joinLink?: string;
|
|
93
|
+
observedIds?: ExternalUserId[];
|
|
94
|
+
payload?: string;
|
|
95
|
+
onFastJoin?: FastJoinHandler;
|
|
96
|
+
anonymous?: boolean;
|
|
97
|
+
};
|
|
87
98
|
export type StartConversationParams = {
|
|
88
99
|
opponentIds?: OkUserId[];
|
|
89
100
|
opponentType: CallType;
|
|
@@ -94,7 +105,6 @@ export type StartConversationParams = {
|
|
|
94
105
|
requireAuthToJoin?: boolean;
|
|
95
106
|
onlyAdminCanShareMovie?: boolean;
|
|
96
107
|
externalIds?: ExternalId[];
|
|
97
|
-
startedTime: number;
|
|
98
108
|
onFastStart?: FastStartHandler;
|
|
99
109
|
conversationId?: string;
|
|
100
110
|
};
|
|
@@ -34,8 +34,11 @@ export type RecordInfo = {
|
|
|
34
34
|
recordExternalOwnerId?: string;
|
|
35
35
|
};
|
|
36
36
|
export interface SignalingResponse extends SignalingMessage {
|
|
37
|
-
response?: SignalingCommandType;
|
|
38
37
|
error?: string;
|
|
38
|
+
errorCode?: string;
|
|
39
|
+
errorMessage?: string;
|
|
40
|
+
message?: string;
|
|
41
|
+
response?: SignalingCommandType;
|
|
39
42
|
reason?: HangupType | FatalError;
|
|
40
43
|
sequence?: number;
|
|
41
44
|
type: 'response' | 'error' | 'timeout';
|
|
@@ -185,6 +188,7 @@ declare namespace SignalingMessage {
|
|
|
185
188
|
peerId: PeerId;
|
|
186
189
|
mediaSettings: Partial<MediaSettings>;
|
|
187
190
|
capabilities?: string;
|
|
191
|
+
externalId?: ExternalId;
|
|
188
192
|
}
|
|
189
193
|
export interface Hungup extends Notification {
|
|
190
194
|
participantId: OkUserId;
|
package/types/WebTransport.d.ts
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
import { WebTransportOptions } from '@fails-components/webtransport';
|
|
2
|
+
import { DebugLogger } from '../static/Debug';
|
|
2
3
|
declare class WebTransportEventual {
|
|
4
|
+
static isBrowserSupported(): boolean;
|
|
5
|
+
onopen: ((this: WebTransportEventual, ev: Event) => any) | null;
|
|
6
|
+
onmessage: ((this: WebTransportEventual, ev: MessageEvent) => any) | null;
|
|
7
|
+
onerror: ((this: WebTransportEventual, ev: Event) => any) | null;
|
|
8
|
+
onclose: ((this: WebTransportEventual, ev: CloseEvent) => any) | null;
|
|
9
|
+
readyState: number;
|
|
3
10
|
private webTransport;
|
|
4
|
-
private stream;
|
|
5
11
|
private writer;
|
|
6
|
-
private reader;
|
|
7
12
|
private readonly url;
|
|
8
13
|
private readonly options;
|
|
9
14
|
private readonly compression;
|
|
10
|
-
private closeRequested;
|
|
11
|
-
private closeEventEmitted;
|
|
12
15
|
private encoder;
|
|
13
16
|
private decoder;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
readyState: number;
|
|
19
|
-
constructor(url: string, options?: WebTransportOptions);
|
|
17
|
+
private readonly _debug;
|
|
18
|
+
constructor(url: string, options?: WebTransportOptions, debug?: DebugLogger);
|
|
19
|
+
send(data: string): Promise<void>;
|
|
20
|
+
close(code?: number, reason?: string): void;
|
|
20
21
|
private getCompressionTypeFromUrl;
|
|
21
22
|
private connect;
|
|
22
|
-
private
|
|
23
|
+
private observeClosed;
|
|
23
24
|
private readLoop;
|
|
24
|
-
|
|
25
|
+
private fail;
|
|
26
|
+
private handleStreamError;
|
|
27
|
+
private requestNativeClose;
|
|
28
|
+
private finishClose;
|
|
29
|
+
private emitEvent;
|
|
25
30
|
private createErrorEvent;
|
|
26
|
-
close(code?: number, reason?: string): void;
|
|
27
|
-
private closeConnectedTransport;
|
|
28
|
-
private emitClose;
|
|
29
|
-
static isBrowserSupported(): boolean;
|
|
30
31
|
}
|
|
31
32
|
export { WebTransportEventual as WebTransport };
|