@fishjam-cloud/js-server-sdk 0.22.1 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,37 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
+ }) : x)(function(x) {
10
+ if (typeof require !== "undefined") return require.apply(this, arguments);
11
+ throw Error('Dynamic require of "' + x + '" is not supported');
12
+ });
13
+ var __commonJS = (cb, mod) => function __require2() {
14
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from))
19
+ if (!__hasOwnProp.call(to, key) && key !== except)
20
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
+ mod
31
+ ));
32
+
33
+ export {
34
+ __require,
35
+ __commonJS,
36
+ __toESM
37
+ };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,44 @@
1
1
  import { BinaryWriter, BinaryReader } from '@bufbuild/protobuf/wire';
2
2
  import axios from 'axios';
3
3
 
4
+ /**
5
+ * Output audio options
6
+ * @export
7
+ * @interface AgentOutput
8
+ */
9
+ interface AgentOutput {
10
+ /**
11
+ *
12
+ * @type {AudioFormat}
13
+ * @memberof AgentOutput
14
+ */
15
+ 'audioFormat'?: AudioFormat;
16
+ /**
17
+ *
18
+ * @type {AudioSampleRate}
19
+ * @memberof AgentOutput
20
+ */
21
+ 'audioSampleRate'?: AudioSampleRate;
22
+ }
23
+ /**
24
+ * The format of the output audio
25
+ * @export
26
+ * @enum {string}
27
+ */
28
+ declare const AudioFormat: {
29
+ readonly Pcm16: "pcm16";
30
+ };
31
+ type AudioFormat = typeof AudioFormat[keyof typeof AudioFormat];
32
+ /**
33
+ * The sample rate of the output audio
34
+ * @export
35
+ * @enum {string}
36
+ */
37
+ declare const AudioSampleRate: {
38
+ readonly NUMBER_16000: 16000;
39
+ readonly NUMBER_24000: 24000;
40
+ };
41
+ type AudioSampleRate = typeof AudioSampleRate[keyof typeof AudioSampleRate];
4
42
  /**
5
43
  * Describes peer status
6
44
  * @export
@@ -32,11 +70,11 @@ interface Peer$1 {
32
70
  */
33
71
  'subscribeMode': SubscribeMode;
34
72
  /**
35
- * Describes peer\'s subscriptions in manual mode
36
- * @type {Array<string>}
73
+ *
74
+ * @type {Subscriptions}
37
75
  * @memberof Peer
38
76
  */
39
- 'subscriptions': Array<string>;
77
+ 'subscriptions': Subscriptions;
40
78
  /**
41
79
  * List of all peer\'s tracks
42
80
  * @type {Array<Track>}
@@ -64,62 +102,23 @@ type PeerOptions = PeerOptionsAgent | PeerOptionsWebRTC;
64
102
  interface PeerOptionsAgent {
65
103
  /**
66
104
  *
67
- * @type {PeerOptionsAgentOutput}
105
+ * @type {AgentOutput}
68
106
  * @memberof PeerOptionsAgent
69
107
  */
70
- 'output'?: PeerOptionsAgentOutput;
108
+ 'output'?: AgentOutput;
71
109
  /**
72
- * Configuration of peer\'s subscribing policy
73
- * @type {string}
110
+ *
111
+ * @type {SubscribeMode}
74
112
  * @memberof PeerOptionsAgent
75
113
  */
76
- 'subscribeMode'?: PeerOptionsAgentSubscribeModeEnum;
114
+ 'subscribeMode'?: SubscribeMode;
77
115
  }
78
- declare const PeerOptionsAgentSubscribeModeEnum: {
79
- readonly Auto: "auto";
80
- readonly Manual: "manual";
81
- };
82
- type PeerOptionsAgentSubscribeModeEnum = typeof PeerOptionsAgentSubscribeModeEnum[keyof typeof PeerOptionsAgentSubscribeModeEnum];
83
- /**
84
- * Output audio options
85
- * @export
86
- * @interface PeerOptionsAgentOutput
87
- */
88
- interface PeerOptionsAgentOutput {
89
- /**
90
- * The format of the output audio
91
- * @type {string}
92
- * @memberof PeerOptionsAgentOutput
93
- */
94
- 'audioFormat'?: PeerOptionsAgentOutputAudioFormatEnum;
95
- /**
96
- * The sample rate of the output audio
97
- * @type {number}
98
- * @memberof PeerOptionsAgentOutput
99
- */
100
- 'audioSampleRate'?: PeerOptionsAgentOutputAudioSampleRateEnum;
101
- }
102
- declare const PeerOptionsAgentOutputAudioFormatEnum: {
103
- readonly Pcm16: "pcm16";
104
- };
105
- type PeerOptionsAgentOutputAudioFormatEnum = typeof PeerOptionsAgentOutputAudioFormatEnum[keyof typeof PeerOptionsAgentOutputAudioFormatEnum];
106
- declare const PeerOptionsAgentOutputAudioSampleRateEnum: {
107
- readonly NUMBER_16000: 16000;
108
- readonly NUMBER_24000: 24000;
109
- };
110
- type PeerOptionsAgentOutputAudioSampleRateEnum = typeof PeerOptionsAgentOutputAudioSampleRateEnum[keyof typeof PeerOptionsAgentOutputAudioSampleRateEnum];
111
116
  /**
112
117
  * Options specific to the WebRTC peer
113
118
  * @export
114
119
  * @interface PeerOptionsWebRTC
115
120
  */
116
121
  interface PeerOptionsWebRTC {
117
- /**
118
- * Enables the peer to use simulcast
119
- * @type {boolean}
120
- * @memberof PeerOptionsWebRTC
121
- */
122
- 'enableSimulcast'?: boolean;
123
122
  /**
124
123
  * Custom peer metadata
125
124
  * @type {{ [key: string]: any; }}
@@ -129,17 +128,12 @@ interface PeerOptionsWebRTC {
129
128
  [key: string]: any;
130
129
  };
131
130
  /**
132
- * Configuration of peer\'s subscribing policy
133
- * @type {string}
131
+ *
132
+ * @type {SubscribeMode}
134
133
  * @memberof PeerOptionsWebRTC
135
134
  */
136
- 'subscribeMode'?: PeerOptionsWebRTCSubscribeModeEnum;
135
+ 'subscribeMode'?: SubscribeMode;
137
136
  }
138
- declare const PeerOptionsWebRTCSubscribeModeEnum: {
139
- readonly Auto: "auto";
140
- readonly Manual: "manual";
141
- };
142
- type PeerOptionsWebRTCSubscribeModeEnum = typeof PeerOptionsWebRTCSubscribeModeEnum[keyof typeof PeerOptionsWebRTCSubscribeModeEnum];
143
137
  /**
144
138
  * Informs about the peer status
145
139
  * @export
@@ -179,17 +173,17 @@ interface RoomConfig {
179
173
  */
180
174
  'public'?: boolean;
181
175
  /**
182
- * The use-case of the room. If not provided, this defaults to conference.
183
- * @type {string}
176
+ *
177
+ * @type {RoomType}
184
178
  * @memberof RoomConfig
185
179
  */
186
- 'roomType'?: RoomConfigRoomTypeEnum;
180
+ 'roomType'?: RoomType;
187
181
  /**
188
- * Enforces video codec for each peer in the room
189
- * @type {string}
182
+ *
183
+ * @type {VideoCodec}
190
184
  * @memberof RoomConfig
191
185
  */
192
- 'videoCodec'?: RoomConfigVideoCodecEnum;
186
+ 'videoCodec'?: VideoCodec;
193
187
  /**
194
188
  * URL where Fishjam notifications will be sent
195
189
  * @type {string}
@@ -197,7 +191,12 @@ interface RoomConfig {
197
191
  */
198
192
  'webhookUrl'?: string | null;
199
193
  }
200
- declare const RoomConfigRoomTypeEnum: {
194
+ /**
195
+ * The use-case of the room. If not provided, this defaults to conference.
196
+ * @export
197
+ * @enum {string}
198
+ */
199
+ declare const RoomType: {
201
200
  readonly FullFeature: "full_feature";
202
201
  readonly AudioOnly: "audio_only";
203
202
  readonly Broadcaster: "broadcaster";
@@ -205,12 +204,7 @@ declare const RoomConfigRoomTypeEnum: {
205
204
  readonly Conference: "conference";
206
205
  readonly AudioOnlyLivestream: "audio_only_livestream";
207
206
  };
208
- type RoomConfigRoomTypeEnum = typeof RoomConfigRoomTypeEnum[keyof typeof RoomConfigRoomTypeEnum];
209
- declare const RoomConfigVideoCodecEnum: {
210
- readonly H264: "h264";
211
- readonly Vp8: "vp8";
212
- };
213
- type RoomConfigVideoCodecEnum = typeof RoomConfigVideoCodecEnum[keyof typeof RoomConfigVideoCodecEnum];
207
+ type RoomType = typeof RoomType[keyof typeof RoomType];
214
208
  /**
215
209
  * Token for authorizing broadcaster streamer connection
216
210
  * @export
@@ -234,6 +228,25 @@ declare const SubscribeMode: {
234
228
  readonly Manual: "manual";
235
229
  };
236
230
  type SubscribeMode = typeof SubscribeMode[keyof typeof SubscribeMode];
231
+ /**
232
+ * Describes peer\'s subscriptions in manual mode
233
+ * @export
234
+ * @interface Subscriptions
235
+ */
236
+ interface Subscriptions {
237
+ /**
238
+ * List of peer IDs this peer subscribes to
239
+ * @type {Array<string>}
240
+ * @memberof Subscriptions
241
+ */
242
+ 'peers': Array<string>;
243
+ /**
244
+ * List of track IDs this peer subscribes to
245
+ * @type {Array<string>}
246
+ * @memberof Subscriptions
247
+ */
248
+ 'tracks': Array<string>;
249
+ }
237
250
  /**
238
251
  * Describes media track of a Peer
239
252
  * @export
@@ -254,16 +267,31 @@ interface Track$1 {
254
267
  'metadata'?: object | null;
255
268
  /**
256
269
  *
257
- * @type {string}
270
+ * @type {TrackType}
258
271
  * @memberof Track
259
272
  */
260
- 'type'?: TrackTypeEnum;
273
+ 'type'?: TrackType$2;
261
274
  }
262
- declare const TrackTypeEnum: {
275
+ /**
276
+ *
277
+ * @export
278
+ * @enum {string}
279
+ */
280
+ declare const TrackType$2: {
263
281
  readonly Audio: "audio";
264
282
  readonly Video: "video";
265
283
  };
266
- type TrackTypeEnum = typeof TrackTypeEnum[keyof typeof TrackTypeEnum];
284
+ type TrackType$2 = typeof TrackType$2[keyof typeof TrackType$2];
285
+ /**
286
+ * Enforces video codec for each peer in the room
287
+ * @export
288
+ * @enum {string}
289
+ */
290
+ declare const VideoCodec: {
291
+ readonly H264: "h264";
292
+ readonly Vp8: "vp8";
293
+ };
294
+ type VideoCodec = typeof VideoCodec[keyof typeof VideoCodec];
267
295
  /**
268
296
  * Token for authorizing broadcaster viewer connection
269
297
  * @export
@@ -737,14 +765,20 @@ type AgentEvents = {
737
765
  declare const FishjamAgent_base: new () => TypedEventEmitter<AgentEvents>;
738
766
  declare class FishjamAgent extends FishjamAgent_base {
739
767
  private readonly client;
768
+ private resolveConnectionPromise;
769
+ private readonly connectionPromise;
740
770
  constructor(config: FishjamConfig, agentToken: string, callbacks?: AgentCallbacks);
771
+ /**
772
+ * Await Agent connection to Fishjam.
773
+ */
774
+ awaitConnected(): Promise<void>;
741
775
  /**
742
776
  * Creates an outgoing audio track for the agent
743
777
  * @returns a new audio track
744
778
  */
745
779
  createTrack(codecParameters: AudioCodecParameters, metadata?: object): AgentTrack;
746
780
  /**
747
- * Interrupt track indentified by `trackId`.
781
+ * Interrupt track identified by `trackId`.
748
782
  *
749
783
  * Any audio that has been sent by the agent, but not played
750
784
  * by Fishjam will be cleared and be prevented from playing.
@@ -876,4 +910,4 @@ declare class ServiceUnavailableException extends FishjamBaseException {
876
910
  declare class UnknownException extends FishjamBaseException {
877
911
  }
878
912
 
879
- export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IncomingTrackData, MissingFishjamIdException, type NotificationEvents, type OutgoingTrackData, type Peer, type PeerAdded, type PeerConnected, type PeerCrashed, type PeerDeleted, type PeerDisconnected, type PeerId, type PeerMetadataUpdated, PeerNotFoundException, type PeerOptions, PeerStatus, type Room, type RoomConfig, RoomConfigRoomTypeEnum, RoomConfigVideoCodecEnum, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, ServerMessage, ServiceUnavailableException, type StreamConnected, type StreamDisconnected, type StreamerToken, type TrackAdded, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, type ViewerConnected, type ViewerDisconnected, type ViewerToken };
913
+ export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IncomingTrackData, MissingFishjamIdException, type NotificationEvents, type OutgoingTrackData, type Peer, type PeerAdded, type PeerConnected, type PeerCrashed, type PeerDeleted, type PeerDisconnected, type PeerId, type PeerMetadataUpdated, PeerNotFoundException, type PeerOptions, type PeerOptionsAgent, type PeerOptionsWebRTC, PeerStatus, type Room, type RoomConfig, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, RoomType, ServerMessage, ServiceUnavailableException, type StreamConnected, type StreamDisconnected, type StreamerToken, type TrackAdded, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,44 @@
1
1
  import { BinaryWriter, BinaryReader } from '@bufbuild/protobuf/wire';
2
2
  import axios from 'axios';
3
3
 
4
+ /**
5
+ * Output audio options
6
+ * @export
7
+ * @interface AgentOutput
8
+ */
9
+ interface AgentOutput {
10
+ /**
11
+ *
12
+ * @type {AudioFormat}
13
+ * @memberof AgentOutput
14
+ */
15
+ 'audioFormat'?: AudioFormat;
16
+ /**
17
+ *
18
+ * @type {AudioSampleRate}
19
+ * @memberof AgentOutput
20
+ */
21
+ 'audioSampleRate'?: AudioSampleRate;
22
+ }
23
+ /**
24
+ * The format of the output audio
25
+ * @export
26
+ * @enum {string}
27
+ */
28
+ declare const AudioFormat: {
29
+ readonly Pcm16: "pcm16";
30
+ };
31
+ type AudioFormat = typeof AudioFormat[keyof typeof AudioFormat];
32
+ /**
33
+ * The sample rate of the output audio
34
+ * @export
35
+ * @enum {string}
36
+ */
37
+ declare const AudioSampleRate: {
38
+ readonly NUMBER_16000: 16000;
39
+ readonly NUMBER_24000: 24000;
40
+ };
41
+ type AudioSampleRate = typeof AudioSampleRate[keyof typeof AudioSampleRate];
4
42
  /**
5
43
  * Describes peer status
6
44
  * @export
@@ -32,11 +70,11 @@ interface Peer$1 {
32
70
  */
33
71
  'subscribeMode': SubscribeMode;
34
72
  /**
35
- * Describes peer\'s subscriptions in manual mode
36
- * @type {Array<string>}
73
+ *
74
+ * @type {Subscriptions}
37
75
  * @memberof Peer
38
76
  */
39
- 'subscriptions': Array<string>;
77
+ 'subscriptions': Subscriptions;
40
78
  /**
41
79
  * List of all peer\'s tracks
42
80
  * @type {Array<Track>}
@@ -64,62 +102,23 @@ type PeerOptions = PeerOptionsAgent | PeerOptionsWebRTC;
64
102
  interface PeerOptionsAgent {
65
103
  /**
66
104
  *
67
- * @type {PeerOptionsAgentOutput}
105
+ * @type {AgentOutput}
68
106
  * @memberof PeerOptionsAgent
69
107
  */
70
- 'output'?: PeerOptionsAgentOutput;
108
+ 'output'?: AgentOutput;
71
109
  /**
72
- * Configuration of peer\'s subscribing policy
73
- * @type {string}
110
+ *
111
+ * @type {SubscribeMode}
74
112
  * @memberof PeerOptionsAgent
75
113
  */
76
- 'subscribeMode'?: PeerOptionsAgentSubscribeModeEnum;
114
+ 'subscribeMode'?: SubscribeMode;
77
115
  }
78
- declare const PeerOptionsAgentSubscribeModeEnum: {
79
- readonly Auto: "auto";
80
- readonly Manual: "manual";
81
- };
82
- type PeerOptionsAgentSubscribeModeEnum = typeof PeerOptionsAgentSubscribeModeEnum[keyof typeof PeerOptionsAgentSubscribeModeEnum];
83
- /**
84
- * Output audio options
85
- * @export
86
- * @interface PeerOptionsAgentOutput
87
- */
88
- interface PeerOptionsAgentOutput {
89
- /**
90
- * The format of the output audio
91
- * @type {string}
92
- * @memberof PeerOptionsAgentOutput
93
- */
94
- 'audioFormat'?: PeerOptionsAgentOutputAudioFormatEnum;
95
- /**
96
- * The sample rate of the output audio
97
- * @type {number}
98
- * @memberof PeerOptionsAgentOutput
99
- */
100
- 'audioSampleRate'?: PeerOptionsAgentOutputAudioSampleRateEnum;
101
- }
102
- declare const PeerOptionsAgentOutputAudioFormatEnum: {
103
- readonly Pcm16: "pcm16";
104
- };
105
- type PeerOptionsAgentOutputAudioFormatEnum = typeof PeerOptionsAgentOutputAudioFormatEnum[keyof typeof PeerOptionsAgentOutputAudioFormatEnum];
106
- declare const PeerOptionsAgentOutputAudioSampleRateEnum: {
107
- readonly NUMBER_16000: 16000;
108
- readonly NUMBER_24000: 24000;
109
- };
110
- type PeerOptionsAgentOutputAudioSampleRateEnum = typeof PeerOptionsAgentOutputAudioSampleRateEnum[keyof typeof PeerOptionsAgentOutputAudioSampleRateEnum];
111
116
  /**
112
117
  * Options specific to the WebRTC peer
113
118
  * @export
114
119
  * @interface PeerOptionsWebRTC
115
120
  */
116
121
  interface PeerOptionsWebRTC {
117
- /**
118
- * Enables the peer to use simulcast
119
- * @type {boolean}
120
- * @memberof PeerOptionsWebRTC
121
- */
122
- 'enableSimulcast'?: boolean;
123
122
  /**
124
123
  * Custom peer metadata
125
124
  * @type {{ [key: string]: any; }}
@@ -129,17 +128,12 @@ interface PeerOptionsWebRTC {
129
128
  [key: string]: any;
130
129
  };
131
130
  /**
132
- * Configuration of peer\'s subscribing policy
133
- * @type {string}
131
+ *
132
+ * @type {SubscribeMode}
134
133
  * @memberof PeerOptionsWebRTC
135
134
  */
136
- 'subscribeMode'?: PeerOptionsWebRTCSubscribeModeEnum;
135
+ 'subscribeMode'?: SubscribeMode;
137
136
  }
138
- declare const PeerOptionsWebRTCSubscribeModeEnum: {
139
- readonly Auto: "auto";
140
- readonly Manual: "manual";
141
- };
142
- type PeerOptionsWebRTCSubscribeModeEnum = typeof PeerOptionsWebRTCSubscribeModeEnum[keyof typeof PeerOptionsWebRTCSubscribeModeEnum];
143
137
  /**
144
138
  * Informs about the peer status
145
139
  * @export
@@ -179,17 +173,17 @@ interface RoomConfig {
179
173
  */
180
174
  'public'?: boolean;
181
175
  /**
182
- * The use-case of the room. If not provided, this defaults to conference.
183
- * @type {string}
176
+ *
177
+ * @type {RoomType}
184
178
  * @memberof RoomConfig
185
179
  */
186
- 'roomType'?: RoomConfigRoomTypeEnum;
180
+ 'roomType'?: RoomType;
187
181
  /**
188
- * Enforces video codec for each peer in the room
189
- * @type {string}
182
+ *
183
+ * @type {VideoCodec}
190
184
  * @memberof RoomConfig
191
185
  */
192
- 'videoCodec'?: RoomConfigVideoCodecEnum;
186
+ 'videoCodec'?: VideoCodec;
193
187
  /**
194
188
  * URL where Fishjam notifications will be sent
195
189
  * @type {string}
@@ -197,7 +191,12 @@ interface RoomConfig {
197
191
  */
198
192
  'webhookUrl'?: string | null;
199
193
  }
200
- declare const RoomConfigRoomTypeEnum: {
194
+ /**
195
+ * The use-case of the room. If not provided, this defaults to conference.
196
+ * @export
197
+ * @enum {string}
198
+ */
199
+ declare const RoomType: {
201
200
  readonly FullFeature: "full_feature";
202
201
  readonly AudioOnly: "audio_only";
203
202
  readonly Broadcaster: "broadcaster";
@@ -205,12 +204,7 @@ declare const RoomConfigRoomTypeEnum: {
205
204
  readonly Conference: "conference";
206
205
  readonly AudioOnlyLivestream: "audio_only_livestream";
207
206
  };
208
- type RoomConfigRoomTypeEnum = typeof RoomConfigRoomTypeEnum[keyof typeof RoomConfigRoomTypeEnum];
209
- declare const RoomConfigVideoCodecEnum: {
210
- readonly H264: "h264";
211
- readonly Vp8: "vp8";
212
- };
213
- type RoomConfigVideoCodecEnum = typeof RoomConfigVideoCodecEnum[keyof typeof RoomConfigVideoCodecEnum];
207
+ type RoomType = typeof RoomType[keyof typeof RoomType];
214
208
  /**
215
209
  * Token for authorizing broadcaster streamer connection
216
210
  * @export
@@ -234,6 +228,25 @@ declare const SubscribeMode: {
234
228
  readonly Manual: "manual";
235
229
  };
236
230
  type SubscribeMode = typeof SubscribeMode[keyof typeof SubscribeMode];
231
+ /**
232
+ * Describes peer\'s subscriptions in manual mode
233
+ * @export
234
+ * @interface Subscriptions
235
+ */
236
+ interface Subscriptions {
237
+ /**
238
+ * List of peer IDs this peer subscribes to
239
+ * @type {Array<string>}
240
+ * @memberof Subscriptions
241
+ */
242
+ 'peers': Array<string>;
243
+ /**
244
+ * List of track IDs this peer subscribes to
245
+ * @type {Array<string>}
246
+ * @memberof Subscriptions
247
+ */
248
+ 'tracks': Array<string>;
249
+ }
237
250
  /**
238
251
  * Describes media track of a Peer
239
252
  * @export
@@ -254,16 +267,31 @@ interface Track$1 {
254
267
  'metadata'?: object | null;
255
268
  /**
256
269
  *
257
- * @type {string}
270
+ * @type {TrackType}
258
271
  * @memberof Track
259
272
  */
260
- 'type'?: TrackTypeEnum;
273
+ 'type'?: TrackType$2;
261
274
  }
262
- declare const TrackTypeEnum: {
275
+ /**
276
+ *
277
+ * @export
278
+ * @enum {string}
279
+ */
280
+ declare const TrackType$2: {
263
281
  readonly Audio: "audio";
264
282
  readonly Video: "video";
265
283
  };
266
- type TrackTypeEnum = typeof TrackTypeEnum[keyof typeof TrackTypeEnum];
284
+ type TrackType$2 = typeof TrackType$2[keyof typeof TrackType$2];
285
+ /**
286
+ * Enforces video codec for each peer in the room
287
+ * @export
288
+ * @enum {string}
289
+ */
290
+ declare const VideoCodec: {
291
+ readonly H264: "h264";
292
+ readonly Vp8: "vp8";
293
+ };
294
+ type VideoCodec = typeof VideoCodec[keyof typeof VideoCodec];
267
295
  /**
268
296
  * Token for authorizing broadcaster viewer connection
269
297
  * @export
@@ -737,14 +765,20 @@ type AgentEvents = {
737
765
  declare const FishjamAgent_base: new () => TypedEventEmitter<AgentEvents>;
738
766
  declare class FishjamAgent extends FishjamAgent_base {
739
767
  private readonly client;
768
+ private resolveConnectionPromise;
769
+ private readonly connectionPromise;
740
770
  constructor(config: FishjamConfig, agentToken: string, callbacks?: AgentCallbacks);
771
+ /**
772
+ * Await Agent connection to Fishjam.
773
+ */
774
+ awaitConnected(): Promise<void>;
741
775
  /**
742
776
  * Creates an outgoing audio track for the agent
743
777
  * @returns a new audio track
744
778
  */
745
779
  createTrack(codecParameters: AudioCodecParameters, metadata?: object): AgentTrack;
746
780
  /**
747
- * Interrupt track indentified by `trackId`.
781
+ * Interrupt track identified by `trackId`.
748
782
  *
749
783
  * Any audio that has been sent by the agent, but not played
750
784
  * by Fishjam will be cleared and be prevented from playing.
@@ -876,4 +910,4 @@ declare class ServiceUnavailableException extends FishjamBaseException {
876
910
  declare class UnknownException extends FishjamBaseException {
877
911
  }
878
912
 
879
- export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IncomingTrackData, MissingFishjamIdException, type NotificationEvents, type OutgoingTrackData, type Peer, type PeerAdded, type PeerConnected, type PeerCrashed, type PeerDeleted, type PeerDisconnected, type PeerId, type PeerMetadataUpdated, PeerNotFoundException, type PeerOptions, PeerStatus, type Room, type RoomConfig, RoomConfigRoomTypeEnum, RoomConfigVideoCodecEnum, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, ServerMessage, ServiceUnavailableException, type StreamConnected, type StreamDisconnected, type StreamerToken, type TrackAdded, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, type ViewerConnected, type ViewerDisconnected, type ViewerToken };
913
+ export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IncomingTrackData, MissingFishjamIdException, type NotificationEvents, type OutgoingTrackData, type Peer, type PeerAdded, type PeerConnected, type PeerCrashed, type PeerDeleted, type PeerDisconnected, type PeerId, type PeerMetadataUpdated, PeerNotFoundException, type PeerOptions, type PeerOptionsAgent, type PeerOptionsWebRTC, PeerStatus, type Room, type RoomConfig, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, RoomType, ServerMessage, ServiceUnavailableException, type StreamConnected, type StreamDisconnected, type StreamerToken, type TrackAdded, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken };