@axonkit/client-sdk-js 0.1.1 → 0.2.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/dist/Room.d.ts +11 -7
- package/dist/axonkit-client.esm.js +1 -1
- package/dist/axonkit-client.umd.js +1 -1
- package/dist/events.d.ts +71 -46
- package/dist/index.d.ts +2 -2
- package/dist/participant/LocalParticipant.d.ts +2 -6
- package/dist/participant/Participant.d.ts +1 -1
- package/dist/protocol/types.d.ts +2 -2
- package/dist/room/DefaultReconnectPolicy.d.ts +17 -1
- package/dist/room/options.d.ts +27 -1
- package/dist/track/options.d.ts +0 -5
- package/package.json +1 -1
package/dist/events.d.ts
CHANGED
|
@@ -11,11 +11,13 @@
|
|
|
11
11
|
export declare enum RoomEvent {
|
|
12
12
|
/** Successfully connected to the room. */
|
|
13
13
|
Connected = "connected",
|
|
14
|
+
/** The signal channel to the server has been established (join accepted). */
|
|
15
|
+
SignalConnected = "signalConnected",
|
|
14
16
|
/**
|
|
15
17
|
* Disconnected from the room. This may be triggered by the server, by an
|
|
16
18
|
* explicit call to {@link Room.disconnect}, or because of a network failure.
|
|
17
19
|
*
|
|
18
|
-
* args: `(reason?: DisconnectReason)`
|
|
20
|
+
* args: `(reason?: {@link DisconnectReason})`
|
|
19
21
|
*/
|
|
20
22
|
Disconnected = "disconnected",
|
|
21
23
|
/** The SDK is attempting to reconnect to the room after a connection interruption. */
|
|
@@ -25,7 +27,7 @@ export declare enum RoomEvent {
|
|
|
25
27
|
/**
|
|
26
28
|
* Whenever the connection state of the room changes.
|
|
27
29
|
*
|
|
28
|
-
* args: `(state:
|
|
30
|
+
* args: `(state: {@link ConnectionState})`
|
|
29
31
|
*/
|
|
30
32
|
ConnectionStateChanged = "connectionStateChanged",
|
|
31
33
|
/**
|
|
@@ -46,109 +48,116 @@ export declare enum RoomEvent {
|
|
|
46
48
|
* args: `(error: Error)`
|
|
47
49
|
*/
|
|
48
50
|
MediaDevicesError = "mediaDevicesError",
|
|
51
|
+
/**
|
|
52
|
+
* The active device for a kind has been switched via
|
|
53
|
+
* {@link Room.switchActiveDevice}.
|
|
54
|
+
*
|
|
55
|
+
* args: `(kind: MediaDeviceKind, deviceId: string)`
|
|
56
|
+
*/
|
|
57
|
+
ActiveDeviceChanged = "activeDeviceChanged",
|
|
49
58
|
/**
|
|
50
59
|
* A remote participant has joined the room.
|
|
51
60
|
*
|
|
52
|
-
* args: `(participant: RemoteParticipant)`
|
|
61
|
+
* args: `(participant: {@link RemoteParticipant})`
|
|
53
62
|
*/
|
|
54
|
-
|
|
63
|
+
ParticipantConnected = "participantConnected",
|
|
55
64
|
/**
|
|
56
65
|
* A remote participant has left the room.
|
|
57
66
|
*
|
|
58
|
-
* args: `(participant: RemoteParticipant, reason?:
|
|
67
|
+
* args: `(participant: {@link RemoteParticipant}, reason?: {@link DisconnectReason})`
|
|
59
68
|
*/
|
|
60
|
-
|
|
69
|
+
ParticipantDisconnected = "participantDisconnected",
|
|
61
70
|
/**
|
|
62
71
|
* A remote participant's metadata or attributes have been updated.
|
|
63
72
|
*
|
|
64
|
-
* args: `(participant: RemoteParticipant)`
|
|
73
|
+
* args: `(participant: {@link RemoteParticipant})`
|
|
65
74
|
*/
|
|
66
75
|
ParticipantUpdated = "participantUpdated",
|
|
67
76
|
/**
|
|
68
77
|
* Participant metadata has changed.
|
|
69
78
|
*
|
|
70
|
-
* args: `(prevMetadata: string | undefined, participant: Participant)`
|
|
79
|
+
* args: `(prevMetadata: string | undefined, participant: {@link Participant})`
|
|
71
80
|
*/
|
|
72
81
|
ParticipantMetadataChanged = "participantMetadataChanged",
|
|
73
82
|
/**
|
|
74
83
|
* Participant's display name has changed.
|
|
75
84
|
*
|
|
76
|
-
* args: `(name: string, participant: Participant)`
|
|
85
|
+
* args: `(name: string, participant: {@link Participant})`
|
|
77
86
|
*/
|
|
78
87
|
ParticipantNameChanged = "participantNameChanged",
|
|
79
88
|
/**
|
|
80
89
|
* Participant attributes have changed.
|
|
81
90
|
*
|
|
82
|
-
* args: `(changedAttributes: Record<string, string>, participant: Participant)`
|
|
91
|
+
* args: `(changedAttributes: Record<string, string>, participant: {@link Participant})`
|
|
83
92
|
*/
|
|
84
93
|
ParticipantAttributesChanged = "participantAttributesChanged",
|
|
85
94
|
/**
|
|
86
95
|
* A remote participant has published a new track.
|
|
87
96
|
*
|
|
88
|
-
* args: `(publication: RemoteTrackPublication, participant: RemoteParticipant)`
|
|
97
|
+
* args: `(publication: {@link RemoteTrackPublication}, participant: {@link RemoteParticipant})`
|
|
89
98
|
*/
|
|
90
99
|
TrackPublished = "trackPublished",
|
|
91
100
|
/**
|
|
92
101
|
* A remote participant has unpublished a track.
|
|
93
102
|
*
|
|
94
|
-
* args: `(publication: RemoteTrackPublication, participant: RemoteParticipant)`
|
|
103
|
+
* args: `(publication: {@link RemoteTrackPublication}, participant: {@link RemoteParticipant})`
|
|
95
104
|
*/
|
|
96
105
|
TrackUnpublished = "trackUnpublished",
|
|
97
106
|
/**
|
|
98
107
|
* A remote participant has published a new data track.
|
|
99
108
|
*
|
|
100
|
-
* args: `(dataTrack: DataTrackInfo, participant: RemoteParticipant)`
|
|
109
|
+
* args: `(dataTrack: {@link DataTrackInfo}, participant: {@link RemoteParticipant})`
|
|
101
110
|
*/
|
|
102
111
|
DataTrackPublished = "dataTrackPublished",
|
|
103
112
|
/**
|
|
104
113
|
* A remote participant has unpublished a data track.
|
|
105
114
|
*
|
|
106
|
-
* args: `(dataTrackSid: string, participant: RemoteParticipant)`
|
|
115
|
+
* args: `(dataTrackSid: string, participant: {@link RemoteParticipant})`
|
|
107
116
|
*/
|
|
108
117
|
DataTrackUnpublished = "dataTrackUnpublished",
|
|
109
118
|
/**
|
|
110
119
|
* Subscribed to a new track from a remote participant. This is the event
|
|
111
120
|
* where you would typically attach the track to a media element.
|
|
112
121
|
*
|
|
113
|
-
* args: `(track: RemoteTrack, publication: RemoteTrackPublication, participant: RemoteParticipant)`
|
|
122
|
+
* args: `(track: {@link RemoteTrack}, publication: {@link RemoteTrackPublication}, participant: {@link RemoteParticipant})`
|
|
114
123
|
*/
|
|
115
124
|
TrackSubscribed = "trackSubscribed",
|
|
116
125
|
/**
|
|
117
126
|
* Could not subscribe to a track.
|
|
118
127
|
*
|
|
119
|
-
* args: `(trackSid: string, participant: RemoteParticipant)`
|
|
128
|
+
* args: `(trackSid: string, participant: {@link RemoteParticipant})`
|
|
120
129
|
*/
|
|
121
130
|
TrackSubscriptionFailed = "trackSubscriptionFailed",
|
|
122
131
|
/**
|
|
123
132
|
* Unsubscribed from a remote track. The track should be detached from any
|
|
124
133
|
* media elements at this point.
|
|
125
134
|
*
|
|
126
|
-
* args: `(track: RemoteTrack, publication: RemoteTrackPublication, participant: RemoteParticipant)`
|
|
135
|
+
* args: `(track: {@link RemoteTrack}, publication: {@link RemoteTrackPublication}, participant: {@link RemoteParticipant})`
|
|
127
136
|
*/
|
|
128
137
|
TrackUnsubscribed = "trackUnsubscribed",
|
|
129
138
|
/**
|
|
130
139
|
* A track has been muted. Fires on both remote and local participants.
|
|
131
140
|
*
|
|
132
|
-
* args: `(publication: TrackPublication, participant: Participant)`
|
|
141
|
+
* args: `(publication: {@link TrackPublication}, participant: {@link Participant})`
|
|
133
142
|
*/
|
|
134
143
|
TrackMuted = "trackMuted",
|
|
135
144
|
/**
|
|
136
145
|
* A track has been unmuted. Fires on both remote and local participants.
|
|
137
146
|
*
|
|
138
|
-
* args: `(publication: TrackPublication, participant: Participant)`
|
|
147
|
+
* args: `(publication: {@link TrackPublication}, participant: {@link Participant})`
|
|
139
148
|
*/
|
|
140
149
|
TrackUnmuted = "trackUnmuted",
|
|
141
150
|
/**
|
|
142
151
|
* A local track was published successfully.
|
|
143
152
|
*
|
|
144
|
-
* args: `(publication: LocalTrackPublication, participant: LocalParticipant)`
|
|
153
|
+
* args: `(publication: {@link LocalTrackPublication}, participant: {@link LocalParticipant})`
|
|
145
154
|
*/
|
|
146
155
|
LocalTrackPublished = "localTrackPublished",
|
|
147
156
|
/**
|
|
148
157
|
* A local track was unpublished. When a user stops sharing their screen
|
|
149
158
|
* by pressing "End" on the browser UI, this event will also fire.
|
|
150
159
|
*
|
|
151
|
-
* args: `(publication: LocalTrackPublication, participant: LocalParticipant)`
|
|
160
|
+
* args: `(publication: {@link LocalTrackPublication}, participant: {@link LocalParticipant})`
|
|
152
161
|
*/
|
|
153
162
|
LocalTrackUnpublished = "localTrackUnpublished",
|
|
154
163
|
/**
|
|
@@ -161,33 +170,49 @@ export declare enum RoomEvent {
|
|
|
161
170
|
* Active speakers changed. List of speakers ordered by audio level.
|
|
162
171
|
* Includes the local participant.
|
|
163
172
|
*
|
|
164
|
-
* args: `(speakers:
|
|
173
|
+
* args: `(speakers: {@link Participant}[])`
|
|
165
174
|
*/
|
|
166
175
|
ActiveSpeakersChanged = "activeSpeakersChanged",
|
|
167
|
-
/**
|
|
168
|
-
|
|
176
|
+
/**
|
|
177
|
+
* Room-level metadata has been updated by the server.
|
|
178
|
+
*
|
|
179
|
+
* args: `(metadata: string | undefined)`
|
|
180
|
+
*/
|
|
181
|
+
RoomMetadataChanged = "roomMetadataChanged",
|
|
169
182
|
/**
|
|
170
183
|
* Data received from a remote participant via a DataChannel.
|
|
171
184
|
*
|
|
172
|
-
* args: `(
|
|
185
|
+
* args: `(payload: Uint8Array, participant?: {@link RemoteParticipant})`
|
|
173
186
|
*/
|
|
174
187
|
DataReceived = "dataReceived",
|
|
175
188
|
/**
|
|
176
189
|
* The connection quality of a participant has changed.
|
|
177
190
|
*
|
|
178
|
-
* args: `(quality: ConnectionQuality, participant: Participant)`
|
|
191
|
+
* args: `(quality: {@link ConnectionQuality}, participant: {@link Participant})`
|
|
179
192
|
*/
|
|
180
193
|
ConnectionQualityChanged = "connectionQualityChanged",
|
|
194
|
+
/**
|
|
195
|
+
* The room's recording status has changed.
|
|
196
|
+
*
|
|
197
|
+
* args: `(recording: boolean)`
|
|
198
|
+
*/
|
|
199
|
+
RecordingStatusChanged = "recordingStatusChanged",
|
|
200
|
+
/**
|
|
201
|
+
* A participant's permissions have changed.
|
|
202
|
+
*
|
|
203
|
+
* args: `(prevPermissions: ParticipantPermission | undefined, participant: {@link Participant})`
|
|
204
|
+
*/
|
|
205
|
+
ParticipantPermissionsChanged = "participantPermissionsChanged",
|
|
181
206
|
/**
|
|
182
207
|
* Audio playback status has changed. When `canPlaybackAudio` becomes
|
|
183
208
|
* `false`, the application should display UI to prompt user interaction,
|
|
184
209
|
* then call {@link Room.startAudio}.
|
|
185
210
|
*/
|
|
186
|
-
AudioPlaybackStatusChanged = "
|
|
211
|
+
AudioPlaybackStatusChanged = "audioPlaybackChanged",
|
|
187
212
|
/**
|
|
188
213
|
* A message has been received or sent (chat, whiteboard, document, etc.).
|
|
189
214
|
*
|
|
190
|
-
* args: `(message: Message, participant?: Participant)`
|
|
215
|
+
* args: `(message: {@link Message}, participant?: {@link Participant})`
|
|
191
216
|
*/
|
|
192
217
|
ChatMessage = "chatMessage",
|
|
193
218
|
/**
|
|
@@ -219,25 +244,25 @@ export declare enum RoomEvent {
|
|
|
219
244
|
* Video playback status has changed. Similar to
|
|
220
245
|
* {@link RoomEvent.AudioPlaybackStatusChanged} but for video.
|
|
221
246
|
*/
|
|
222
|
-
VideoPlaybackStatusChanged = "
|
|
247
|
+
VideoPlaybackStatusChanged = "videoPlaybackChanged",
|
|
223
248
|
/**
|
|
224
249
|
* The stream state of a remote track has changed (e.g. the server
|
|
225
250
|
* paused or resumed forwarding media). This is distinct from
|
|
226
251
|
* {@link RoomEvent.TrackMuted} which indicates the publisher's intent.
|
|
227
252
|
*
|
|
228
|
-
* args: `(publication: RemoteTrackPublication, streamState: StreamState, participant: RemoteParticipant)`
|
|
253
|
+
* args: `(publication: {@link RemoteTrackPublication}, streamState: {@link StreamState}, participant: {@link RemoteParticipant})`
|
|
229
254
|
*/
|
|
230
255
|
TrackStreamStateChanged = "trackStreamStateChanged",
|
|
231
256
|
/**
|
|
232
257
|
* A new group (breakout room) has been created.
|
|
233
258
|
*
|
|
234
|
-
* args: `(group: GroupInfo)`
|
|
259
|
+
* args: `(group: {@link GroupInfo})`
|
|
235
260
|
*/
|
|
236
261
|
GroupCreated = "groupCreated",
|
|
237
262
|
/**
|
|
238
263
|
* A group's metadata or participant count has changed.
|
|
239
264
|
*
|
|
240
|
-
* args: `(group: GroupInfo)`
|
|
265
|
+
* args: `(group: {@link GroupInfo})`
|
|
241
266
|
*/
|
|
242
267
|
GroupUpdated = "groupUpdated",
|
|
243
268
|
/**
|
|
@@ -250,13 +275,13 @@ export declare enum RoomEvent {
|
|
|
250
275
|
/**
|
|
251
276
|
* A participant has joined a group.
|
|
252
277
|
*
|
|
253
|
-
* args: `(groupId: string, participant: RemoteParticipant | LocalParticipant)`
|
|
278
|
+
* args: `(groupId: string, participant: {@link RemoteParticipant} | {@link LocalParticipant})`
|
|
254
279
|
*/
|
|
255
280
|
GroupParticipantJoined = "groupParticipantJoined",
|
|
256
281
|
/**
|
|
257
282
|
* A participant has left a group (returned to the main room).
|
|
258
283
|
*
|
|
259
|
-
* args: `(groupId: string, participant: RemoteParticipant | LocalParticipant)`
|
|
284
|
+
* args: `(groupId: string, participant: {@link RemoteParticipant} | {@link LocalParticipant})`
|
|
260
285
|
*/
|
|
261
286
|
GroupParticipantLeft = "groupParticipantLeft"
|
|
262
287
|
}
|
|
@@ -274,13 +299,13 @@ export declare enum ParticipantEvent {
|
|
|
274
299
|
/**
|
|
275
300
|
* The participant has published a new track.
|
|
276
301
|
*
|
|
277
|
-
* args: `(publication: TrackPublication)`
|
|
302
|
+
* args: `(publication: {@link TrackPublication})`
|
|
278
303
|
*/
|
|
279
304
|
TrackPublished = "trackPublished",
|
|
280
305
|
/**
|
|
281
306
|
* The participant has unpublished a track.
|
|
282
307
|
*
|
|
283
|
-
* args: `(publication: TrackPublication)`
|
|
308
|
+
* args: `(publication: {@link TrackPublication})`
|
|
284
309
|
*/
|
|
285
310
|
TrackUnpublished = "trackUnpublished",
|
|
286
311
|
/** One of the participant's tracks has been muted. */
|
|
@@ -290,25 +315,25 @@ export declare enum ParticipantEvent {
|
|
|
290
315
|
/**
|
|
291
316
|
* Subscribed to a new track from this participant.
|
|
292
317
|
*
|
|
293
|
-
* args: `(track: RemoteTrack, publication: RemoteTrackPublication)`
|
|
318
|
+
* args: `(track: {@link RemoteTrack}, publication: {@link RemoteTrackPublication})`
|
|
294
319
|
*/
|
|
295
320
|
TrackSubscribed = "trackSubscribed",
|
|
296
321
|
/**
|
|
297
322
|
* Unsubscribed from a track of this participant.
|
|
298
323
|
*
|
|
299
|
-
* args: `(track: RemoteTrack, publication: RemoteTrackPublication)`
|
|
324
|
+
* args: `(track: {@link RemoteTrack}, publication: {@link RemoteTrackPublication})`
|
|
300
325
|
*/
|
|
301
326
|
TrackUnsubscribed = "trackUnsubscribed",
|
|
302
327
|
/**
|
|
303
328
|
* A local track was published by this participant.
|
|
304
329
|
*
|
|
305
|
-
* args: `(publication: LocalTrackPublication)`
|
|
330
|
+
* args: `(publication: {@link LocalTrackPublication})`
|
|
306
331
|
*/
|
|
307
332
|
LocalTrackPublished = "localTrackPublished",
|
|
308
333
|
/**
|
|
309
334
|
* A local track was unpublished by this participant.
|
|
310
335
|
*
|
|
311
|
-
* args: `(publication: LocalTrackPublication)`
|
|
336
|
+
* args: `(publication: {@link LocalTrackPublication})`
|
|
312
337
|
*/
|
|
313
338
|
LocalTrackUnpublished = "localTrackUnpublished",
|
|
314
339
|
/** The participant's metadata has changed. */
|
|
@@ -318,7 +343,7 @@ export declare enum ParticipantEvent {
|
|
|
318
343
|
/**
|
|
319
344
|
* The participant's attributes have changed.
|
|
320
345
|
*
|
|
321
|
-
* args: `(changedAttributes: Record<string, string>, participant: Participant)`
|
|
346
|
+
* args: `(changedAttributes: Record<string, string>, participant: {@link Participant})`
|
|
322
347
|
*/
|
|
323
348
|
AttributesChanged = "attributesChanged",
|
|
324
349
|
/** The participant's speaking status has changed. */
|
|
@@ -330,7 +355,7 @@ export declare enum ParticipantEvent {
|
|
|
330
355
|
/**
|
|
331
356
|
* The stream state of a remote track changed (server paused/resumed forwarding).
|
|
332
357
|
*
|
|
333
|
-
* args: `(publication: RemoteTrackPublication, streamState: StreamState)`
|
|
358
|
+
* args: `(publication: {@link RemoteTrackPublication}, streamState: {@link StreamState})`
|
|
334
359
|
*/
|
|
335
360
|
TrackStreamStateChanged = "trackStreamStateChanged",
|
|
336
361
|
/** Data received from this participant. */
|
|
@@ -338,7 +363,7 @@ export declare enum ParticipantEvent {
|
|
|
338
363
|
/**
|
|
339
364
|
* A chat message from this participant.
|
|
340
365
|
*
|
|
341
|
-
* args: `(message: ChatMessage)`
|
|
366
|
+
* args: `(message: {@link ChatMessage})`
|
|
342
367
|
*/
|
|
343
368
|
ChatMessage = "chatMessage"
|
|
344
369
|
}
|
|
@@ -394,13 +419,13 @@ export declare enum TrackEvent {
|
|
|
394
419
|
/**
|
|
395
420
|
* The visibility of the video element changed (adaptive stream).
|
|
396
421
|
*
|
|
397
|
-
* args: `(visible: boolean, track: RemoteVideoTrack)`
|
|
422
|
+
* args: `(visible: boolean, track: {@link RemoteVideoTrack})`
|
|
398
423
|
*/
|
|
399
424
|
VisibilityChanged = "visibilityChanged",
|
|
400
425
|
/**
|
|
401
426
|
* The dimensions of the video element changed (adaptive stream).
|
|
402
427
|
*
|
|
403
|
-
* args: `(dimensions: { width: number; height: number }, track: RemoteVideoTrack)`
|
|
428
|
+
* args: `(dimensions: { width: number; height: number }, track: {@link RemoteVideoTrack})`
|
|
404
429
|
*/
|
|
405
430
|
VideoDimensionsChanged = "videoDimensionsChanged",
|
|
406
431
|
/**
|
|
@@ -419,7 +444,7 @@ export declare enum TrackEvent {
|
|
|
419
444
|
* The stream state of this track changed (server paused/resumed forwarding).
|
|
420
445
|
* Only emitted on remote tracks.
|
|
421
446
|
*
|
|
422
|
-
* args: `(track: Track, streamState: StreamState)`
|
|
447
|
+
* args: `(track: {@link Track}, streamState: {@link StreamState})`
|
|
423
448
|
*/
|
|
424
449
|
StreamStateChanged = "streamStateChanged",
|
|
425
450
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export type { TrackProcessor, ProcessorOptions } from './track/processor/types';
|
|
|
20
20
|
export type { RoomOptions, RoomConnectOptions, InternalRoomConnectOptions, AdaptiveStreamSettings, } from './room/options';
|
|
21
21
|
export type { TrackPublishDefaults, TrackPublishOptions, DataPublishOptions, VideoCaptureOptions, AudioCaptureOptions, ScreenShareCaptureOptions, VideoEncoding, VideoResolution, VideoPresetOptions, AudioPreset, AudioOutputOptions, PublishCodecOptions, CreateLocalTracksOptions, ScalabilityMode, VideoCodec, BackupVideoCodec, AudioCodec, } from './track/options';
|
|
22
22
|
export { VideoPreset, BackupCodecPolicy, AudioPresets, VideoPresets, VideoPresets43, ScreenSharePresets, audioCodecs, videoCodecs, isBackupVideoCodec, defaultVideoCaptureOptions, defaultAudioCaptureOptions, defaultVideoEncoding, defaultScreenShareEncoding, videoSimulcastPresets, } from './track/options';
|
|
23
|
-
export {
|
|
23
|
+
export { ConnectionState, TrackKind, TrackSource, VideoQuality, DisconnectReason, ParticipantState, ParticipantKind, ConnectionQuality, StreamState, AudioTrackFeature, } from './protocol/types';
|
|
24
24
|
export type { RoomInfo, ServerInfo, ParticipantInfo, ParticipantPermission, ParticipantTrackPermission, TrackInfo, DataTrackInfo, ActiveSpeaker, GroupInfo, JoinRequest, JoinResponse, SyncState, } from './protocol/types';
|
|
25
25
|
export { AxonError, ConnectionError, TimeoutError, ErrorCode } from './protocol/errors';
|
|
26
26
|
export { RpcError, MAX_RPC_PAYLOAD_BYTES } from './rpc';
|
|
@@ -35,7 +35,7 @@ export type { BrowserDetails, AudioAnalyserOptions } from './utils/browser';
|
|
|
35
35
|
export { MediaDeviceFailure } from './utils/deviceFailure';
|
|
36
36
|
export type { DeviceFailureKind } from './utils/deviceFailure';
|
|
37
37
|
export { DefaultReconnectPolicy } from './room/DefaultReconnectPolicy';
|
|
38
|
-
export type { ReconnectContext } from './room/DefaultReconnectPolicy';
|
|
38
|
+
export type { ReconnectContext, ReconnectPolicy } from './room/DefaultReconnectPolicy';
|
|
39
39
|
export { ConnectionCheck, CheckStatus } from './connectionHelper/ConnectionCheck';
|
|
40
40
|
export type { CheckInfo } from './connectionHelper/ConnectionCheck';
|
|
41
41
|
export { VERSION, PROTOCOL_VERSION } from './version';
|
|
@@ -39,9 +39,9 @@ export declare class LocalParticipant extends Participant<LocalTrackPublication>
|
|
|
39
39
|
* Unpublish a track from the room.
|
|
40
40
|
* @param track - The track or MediaStreamTrack to unpublish.
|
|
41
41
|
* @param stopOnUnpublish - Whether to stop the track after unpublishing.
|
|
42
|
-
* Defaults to `
|
|
42
|
+
* Defaults to {@link RoomOptions.stopLocalTrackOnUnpublish} (`true`).
|
|
43
43
|
*/
|
|
44
|
-
unpublishTrack(track: LocalTrack | MediaStreamTrack): Promise<LocalTrackPublication | undefined>;
|
|
44
|
+
unpublishTrack(track: LocalTrack | MediaStreamTrack, stopOnUnpublish?: boolean): Promise<LocalTrackPublication | undefined>;
|
|
45
45
|
publishData(data: Uint8Array, options?: DataPublishOptions): Promise<void>;
|
|
46
46
|
/**
|
|
47
47
|
* Sets and updates the metadata of the local participant.
|
|
@@ -101,10 +101,6 @@ export declare class LocalParticipant extends Participant<LocalTrackPublication>
|
|
|
101
101
|
* Delete a single message by ID.
|
|
102
102
|
*/
|
|
103
103
|
deleteMessage(id: string): Promise<void>;
|
|
104
|
-
/**
|
|
105
|
-
* Delete all messages of a given type.
|
|
106
|
-
*/
|
|
107
|
-
deleteMessagesByType(type: string): Promise<void>;
|
|
108
104
|
/**
|
|
109
105
|
* Update a key in the room's shared state.
|
|
110
106
|
*/
|
|
@@ -74,7 +74,7 @@ export type ParticipantEvents<TPublication extends TrackPublication = TrackPubli
|
|
|
74
74
|
[ParticipantEvent.ConnectionQualityChanged]: (quality: ConnectionQuality) => void;
|
|
75
75
|
[ParticipantEvent.PermissionsChanged]: (prevPermissions?: ParticipantPermission) => void;
|
|
76
76
|
[ParticipantEvent.TrackStreamStateChanged]: (publication: TPublication, streamState: StreamState) => void;
|
|
77
|
-
[ParticipantEvent.DataReceived]: (
|
|
77
|
+
[ParticipantEvent.DataReceived]: (payload: Uint8Array) => void;
|
|
78
78
|
[ParticipantEvent.ChatMessage]: (message: Message) => void;
|
|
79
79
|
};
|
|
80
80
|
export declare abstract class Participant<TPublication extends TrackPublication = TrackPublication> extends TypedEmitter<ParticipantEvents<TPublication>> {
|
package/dist/protocol/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { types as mediasoupTypes } from 'mediasoup-client';
|
|
2
|
-
export declare enum
|
|
2
|
+
export declare enum ConnectionState {
|
|
3
3
|
Disconnected = "disconnected",
|
|
4
4
|
Connecting = "connecting",
|
|
5
5
|
Connected = "connected",
|
|
@@ -421,7 +421,7 @@ export interface ParticipantJoinedNotification {
|
|
|
421
421
|
}
|
|
422
422
|
export interface ParticipantLeftNotification {
|
|
423
423
|
participantSid: string;
|
|
424
|
-
reason?:
|
|
424
|
+
reason?: DisconnectReason;
|
|
425
425
|
}
|
|
426
426
|
export interface ParticipantUpdatedNotification {
|
|
427
427
|
participant: ParticipantInfo;
|
|
@@ -5,6 +5,22 @@ export interface ReconnectContext {
|
|
|
5
5
|
retryCount: number;
|
|
6
6
|
elapsedMs: number;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Custom reconnection strategy. Provide an implementation via
|
|
10
|
+
* {@link RoomOptions.reconnectPolicy} to control retry behaviour after a
|
|
11
|
+
* connection interruption.
|
|
12
|
+
*/
|
|
13
|
+
export interface ReconnectPolicy {
|
|
14
|
+
/**
|
|
15
|
+
* Returns the number of milliseconds to wait before the next reconnect
|
|
16
|
+
* attempt, or `null` if the policy says to stop trying.
|
|
17
|
+
*/
|
|
18
|
+
nextRetryDelayInMs(context: ReconnectContext): number | null;
|
|
19
|
+
/**
|
|
20
|
+
* Optional hook invoked after a successful (re)connection.
|
|
21
|
+
*/
|
|
22
|
+
reset?(): void;
|
|
23
|
+
}
|
|
8
24
|
/**
|
|
9
25
|
* Default reconnect policy with exponential back-off and jitter.
|
|
10
26
|
*
|
|
@@ -14,7 +30,7 @@ export interface ReconnectContext {
|
|
|
14
30
|
* const delay = policy.nextRetryDelayInMs({ retryCount: 1, elapsedMs: 0 });
|
|
15
31
|
* ```
|
|
16
32
|
*/
|
|
17
|
-
export declare class DefaultReconnectPolicy {
|
|
33
|
+
export declare class DefaultReconnectPolicy implements ReconnectPolicy {
|
|
18
34
|
private readonly maxRetries;
|
|
19
35
|
private readonly baseDelay;
|
|
20
36
|
private readonly maxDelay;
|
package/dist/room/options.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { VideoCaptureOptions, AudioCaptureOptions, TrackPublishDefaults } from '../track/options';
|
|
2
|
+
import type { ReconnectPolicy } from './DefaultReconnectPolicy';
|
|
2
3
|
/**
|
|
3
4
|
* Configuration for the adaptive stream feature. When enabled the SDK
|
|
4
5
|
* automatically manages video subscription quality based on element
|
|
@@ -34,6 +35,20 @@ export interface RoomOptions {
|
|
|
34
35
|
* subscribers on the server.
|
|
35
36
|
*/
|
|
36
37
|
dynacast?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Custom reconnection policy controlling retry delays after a
|
|
40
|
+
* connection interruption. See {@link DefaultReconnectPolicy}.
|
|
41
|
+
*
|
|
42
|
+
* @defaultValue `new DefaultReconnectPolicy()`
|
|
43
|
+
*/
|
|
44
|
+
reconnectPolicy?: ReconnectPolicy;
|
|
45
|
+
/**
|
|
46
|
+
* Automatically disconnect from the room when the page is being
|
|
47
|
+
* unloaded or frozen (`beforeunload` / `pagehide` / `freeze`).
|
|
48
|
+
*
|
|
49
|
+
* @defaultValue `true`
|
|
50
|
+
*/
|
|
51
|
+
disconnectOnPageLeave?: boolean;
|
|
37
52
|
/**
|
|
38
53
|
* Default capture options used when creating camera tracks.
|
|
39
54
|
*/
|
|
@@ -47,9 +62,20 @@ export interface RoomOptions {
|
|
|
47
62
|
* per-track.
|
|
48
63
|
*/
|
|
49
64
|
publishDefaults?: TrackPublishDefaults;
|
|
65
|
+
/**
|
|
66
|
+
* Automatically stop local tracks when they are unpublished, including
|
|
67
|
+
* via {@link LocalParticipant.setCameraEnabled} et al. with `false`.
|
|
68
|
+
* Pass `false` explicitly to {@link LocalParticipant.unpublishTrack} to
|
|
69
|
+
* keep a track alive across unpublish/republish cycles.
|
|
70
|
+
*
|
|
71
|
+
* @defaultValue `true`
|
|
72
|
+
*/
|
|
73
|
+
stopLocalTrackOnUnpublish?: boolean;
|
|
50
74
|
/**
|
|
51
75
|
* Room name sent in the JoinRequest for server-side routing and room
|
|
52
|
-
* creation.
|
|
76
|
+
* creation. Optional when the JWT token carries a `room` claim — the
|
|
77
|
+
* server falls back to it. Required for anonymous joins (no token).
|
|
78
|
+
* When both are present they must match.
|
|
53
79
|
*/
|
|
54
80
|
roomName?: string;
|
|
55
81
|
/**
|
package/dist/track/options.d.ts
CHANGED
|
@@ -371,11 +371,6 @@ export interface TrackPublishDefaults {
|
|
|
371
371
|
* @see {@link PublishCodecOptions}
|
|
372
372
|
*/
|
|
373
373
|
codecOptions?: PublishCodecOptions;
|
|
374
|
-
/**
|
|
375
|
-
* should local track be stopped when they are unpublished. defaults to false
|
|
376
|
-
* set this to true if you would prefer to clean up unpublished local track automatically.
|
|
377
|
-
*/
|
|
378
|
-
stopTrackOnUnpublish?: boolean;
|
|
379
374
|
}
|
|
380
375
|
/**
|
|
381
376
|
* Options when publishing tracks. Extends {@link TrackPublishDefaults} with
|