livekit-client 1.4.4 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. package/dist/livekit-client.esm.mjs +510 -38
  2. package/dist/livekit-client.esm.mjs.map +1 -1
  3. package/dist/livekit-client.umd.js +1 -1
  4. package/dist/livekit-client.umd.js.map +1 -1
  5. package/dist/src/connectionHelper/ConnectionCheck.d.ts +25 -0
  6. package/dist/src/connectionHelper/ConnectionCheck.d.ts.map +1 -0
  7. package/dist/src/connectionHelper/checks/Checker.d.ts +59 -0
  8. package/dist/src/connectionHelper/checks/Checker.d.ts.map +1 -0
  9. package/dist/src/connectionHelper/checks/publishAudio.d.ts +6 -0
  10. package/dist/src/connectionHelper/checks/publishAudio.d.ts.map +1 -0
  11. package/dist/src/connectionHelper/checks/publishVideo.d.ts +6 -0
  12. package/dist/src/connectionHelper/checks/publishVideo.d.ts.map +1 -0
  13. package/dist/src/connectionHelper/checks/reconnect.d.ts +6 -0
  14. package/dist/src/connectionHelper/checks/reconnect.d.ts.map +1 -0
  15. package/dist/src/connectionHelper/checks/turn.d.ts +6 -0
  16. package/dist/src/connectionHelper/checks/turn.d.ts.map +1 -0
  17. package/dist/src/connectionHelper/checks/webrtc.d.ts +6 -0
  18. package/dist/src/connectionHelper/checks/webrtc.d.ts.map +1 -0
  19. package/dist/src/connectionHelper/checks/websocket.d.ts +6 -0
  20. package/dist/src/connectionHelper/checks/websocket.d.ts.map +1 -0
  21. package/dist/src/index.d.ts +3 -1
  22. package/dist/src/index.d.ts.map +1 -1
  23. package/dist/src/proto/livekit_rtc.d.ts +8 -0
  24. package/dist/src/proto/livekit_rtc.d.ts.map +1 -1
  25. package/dist/src/room/DeviceManager.d.ts.map +1 -1
  26. package/dist/src/room/Room.d.ts +6 -0
  27. package/dist/src/room/Room.d.ts.map +1 -1
  28. package/dist/src/room/events.d.ts +5 -1
  29. package/dist/src/room/events.d.ts.map +1 -1
  30. package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
  31. package/dist/src/room/track/LocalTrack.d.ts.map +1 -1
  32. package/dist/src/room/track/RemoteTrackPublication.d.ts +2 -0
  33. package/dist/src/room/track/RemoteTrackPublication.d.ts.map +1 -1
  34. package/dist/ts4.2/src/api/SignalClient.d.ts +85 -0
  35. package/dist/ts4.2/src/connectionHelper/ConnectionCheck.d.ts +25 -0
  36. package/dist/ts4.2/src/connectionHelper/checks/Checker.d.ts +59 -0
  37. package/dist/ts4.2/src/connectionHelper/checks/publishAudio.d.ts +6 -0
  38. package/dist/ts4.2/src/connectionHelper/checks/publishVideo.d.ts +6 -0
  39. package/dist/ts4.2/src/connectionHelper/checks/reconnect.d.ts +6 -0
  40. package/dist/ts4.2/src/connectionHelper/checks/turn.d.ts +6 -0
  41. package/dist/ts4.2/src/connectionHelper/checks/webrtc.d.ts +6 -0
  42. package/dist/ts4.2/src/connectionHelper/checks/websocket.d.ts +6 -0
  43. package/dist/ts4.2/src/index.d.ts +30 -0
  44. package/dist/ts4.2/src/logger.d.ts +26 -0
  45. package/dist/ts4.2/src/options.d.ts +91 -0
  46. package/dist/ts4.2/src/proto/google/protobuf/timestamp.d.ts +141 -0
  47. package/dist/ts4.2/src/proto/livekit_models.d.ts +1421 -0
  48. package/dist/ts4.2/src/proto/livekit_rtc.d.ts +7122 -0
  49. package/dist/ts4.2/src/room/DefaultReconnectPolicy.d.ts +8 -0
  50. package/dist/ts4.2/src/room/DeviceManager.d.ts +9 -0
  51. package/dist/ts4.2/src/room/PCTransport.d.ts +33 -0
  52. package/dist/ts4.2/src/room/RTCEngine.d.ts +96 -0
  53. package/dist/ts4.2/src/room/ReconnectPolicy.d.ts +23 -0
  54. package/dist/ts4.2/src/room/Room.d.ts +203 -0
  55. package/dist/ts4.2/src/room/defaults.d.ts +8 -0
  56. package/dist/ts4.2/src/room/errors.d.ts +39 -0
  57. package/dist/ts4.2/src/room/events.d.ts +422 -0
  58. package/dist/ts4.2/src/room/participant/LocalParticipant.d.ts +141 -0
  59. package/dist/ts4.2/src/room/participant/Participant.d.ts +92 -0
  60. package/dist/ts4.2/src/room/participant/ParticipantTrackPermission.d.ts +26 -0
  61. package/dist/ts4.2/src/room/participant/RemoteParticipant.d.ts +52 -0
  62. package/dist/ts4.2/src/room/participant/publishUtils.d.ts +19 -0
  63. package/dist/ts4.2/src/room/stats.d.ts +67 -0
  64. package/dist/ts4.2/src/room/track/LocalAudioTrack.d.ts +25 -0
  65. package/dist/ts4.2/src/room/track/LocalTrack.d.ts +42 -0
  66. package/dist/ts4.2/src/room/track/LocalTrackPublication.d.ts +38 -0
  67. package/dist/ts4.2/src/room/track/LocalVideoTrack.d.ts +53 -0
  68. package/dist/ts4.2/src/room/track/RemoteAudioTrack.d.ts +53 -0
  69. package/dist/ts4.2/src/room/track/RemoteTrack.d.ts +15 -0
  70. package/dist/ts4.2/src/room/track/RemoteTrackPublication.d.ts +61 -0
  71. package/dist/ts4.2/src/room/track/RemoteVideoTrack.d.ts +52 -0
  72. package/dist/ts4.2/src/room/track/Track.d.ts +121 -0
  73. package/dist/ts4.2/src/room/track/TrackPublication.d.ts +68 -0
  74. package/dist/ts4.2/src/room/track/create.d.ts +24 -0
  75. package/dist/ts4.2/src/room/track/options.d.ts +241 -0
  76. package/dist/ts4.2/src/room/track/types.d.ts +23 -0
  77. package/dist/ts4.2/src/room/track/utils.d.ts +14 -0
  78. package/dist/ts4.2/src/room/utils.d.ts +35 -0
  79. package/dist/ts4.2/src/test/MockMediaStreamTrack.d.ts +26 -0
  80. package/dist/ts4.2/src/test/mocks.d.ts +11 -0
  81. package/dist/ts4.2/src/version.d.ts +3 -0
  82. package/package.json +13 -3
  83. package/src/api/SignalClient.ts +2 -2
  84. package/src/connectionHelper/ConnectionCheck.ts +90 -0
  85. package/src/connectionHelper/checks/Checker.ts +164 -0
  86. package/src/connectionHelper/checks/publishAudio.ts +33 -0
  87. package/src/connectionHelper/checks/publishVideo.ts +33 -0
  88. package/src/connectionHelper/checks/reconnect.ts +45 -0
  89. package/src/connectionHelper/checks/turn.ts +53 -0
  90. package/src/connectionHelper/checks/webrtc.ts +18 -0
  91. package/src/connectionHelper/checks/websocket.ts +22 -0
  92. package/src/index.ts +3 -1
  93. package/src/proto/livekit_rtc.ts +12 -1
  94. package/src/room/DeviceManager.ts +0 -17
  95. package/src/room/Room.ts +22 -2
  96. package/src/room/events.ts +5 -0
  97. package/src/room/participant/LocalParticipant.ts +15 -8
  98. package/src/room/track/LocalTrack.ts +3 -0
  99. package/src/room/track/RemoteTrackPublication.ts +20 -0
@@ -0,0 +1,8 @@
1
+ import type { ReconnectContext, ReconnectPolicy } from './ReconnectPolicy';
2
+ declare class DefaultReconnectPolicy implements ReconnectPolicy {
3
+ private readonly _retryDelays;
4
+ constructor(retryDelays?: number[]);
5
+ nextRetryDelayInMs(context: ReconnectContext): number | null;
6
+ }
7
+ export default DefaultReconnectPolicy;
8
+ //# sourceMappingURL=DefaultReconnectPolicy.d.ts.map
@@ -0,0 +1,9 @@
1
+ export default class DeviceManager {
2
+ private static instance?;
3
+ static mediaDeviceKinds: MediaDeviceKind[];
4
+ static getInstance(): DeviceManager;
5
+ static userMediaPromiseMap: Map<MediaDeviceKind, Promise<MediaStream>>;
6
+ getDevices(kind?: MediaDeviceKind, requestPermissions?: boolean): Promise<MediaDeviceInfo[]>;
7
+ normalizeDeviceId(kind: MediaDeviceKind, deviceId?: string, groupId?: string): Promise<string | undefined>;
8
+ }
9
+ //# sourceMappingURL=DeviceManager.d.ts.map
@@ -0,0 +1,33 @@
1
+ /** @internal */
2
+ interface TrackBitrateInfo {
3
+ sid: string;
4
+ codec: string;
5
+ maxbr: number;
6
+ }
7
+ /** @internal */
8
+ export default class PCTransport {
9
+ pc: RTCPeerConnection;
10
+ pendingCandidates: RTCIceCandidateInit[];
11
+ restartingIce: boolean;
12
+ renegotiate: boolean;
13
+ trackBitrates: TrackBitrateInfo[];
14
+ remoteStereoMids: string[];
15
+ onOffer?: (offer: RTCSessionDescriptionInit) => void;
16
+ constructor(config?: RTCConfiguration);
17
+ get isICEConnected(): boolean;
18
+ addIceCandidate(candidate: RTCIceCandidateInit): Promise<void>;
19
+ setRemoteDescription(sd: RTCSessionDescriptionInit): Promise<void>;
20
+ negotiate: {
21
+ (this: unknown, ...args: [
22
+ onError?: ((e: Error) => void) | undefined
23
+ ] & any[]): Promise<void>;
24
+ cancel: (reason?: any) => void;
25
+ };
26
+ createAndSendOffer(options?: RTCOfferOptions): Promise<void>;
27
+ createAndSetAnswer(): Promise<RTCSessionDescriptionInit>;
28
+ setTrackCodecBitrate(sid: string, codec: string, maxbr: number): void;
29
+ close(): void;
30
+ private setMungedLocalDescription;
31
+ }
32
+ export {};
33
+ //# sourceMappingURL=PCTransport.d.ts.map
@@ -0,0 +1,96 @@
1
+ import type TypedEventEmitter from 'typed-emitter';
2
+ import { SignalClient, SignalOptions } from '../api/SignalClient';
3
+ import type { InternalRoomOptions } from '../options';
4
+ import { DataPacket, DataPacket_Kind, DisconnectReason, SpeakerInfo, TrackInfo, UserPacket } from '../proto/livekit_models';
5
+ import { AddTrackRequest, JoinResponse } from '../proto/livekit_rtc';
6
+ import PCTransport from './PCTransport';
7
+ import type LocalTrack from './track/LocalTrack';
8
+ import type LocalVideoTrack from './track/LocalVideoTrack';
9
+ import type { SimulcastTrackInfo } from './track/LocalVideoTrack';
10
+ import type { TrackPublishOptions } from './track/options';
11
+ declare const RTCEngine_base: new () => TypedEventEmitter<EngineEventCallbacks>;
12
+ /** @internal */
13
+ export default class RTCEngine extends RTCEngine_base {
14
+ private options;
15
+ publisher?: PCTransport;
16
+ subscriber?: PCTransport;
17
+ client: SignalClient;
18
+ rtcConfig: RTCConfiguration;
19
+ peerConnectionTimeout: number;
20
+ get isClosed(): boolean;
21
+ private lossyDC?;
22
+ private lossyDCSub?;
23
+ private reliableDC?;
24
+ private reliableDCSub?;
25
+ private subscriberPrimary;
26
+ private primaryPC?;
27
+ private pcState;
28
+ private _isClosed;
29
+ private pendingTrackResolvers;
30
+ private hasPublished;
31
+ private url?;
32
+ private token?;
33
+ private signalOpts?;
34
+ private reconnectAttempts;
35
+ private reconnectStart;
36
+ private fullReconnectOnNext;
37
+ private clientConfiguration?;
38
+ private connectedServerAddr?;
39
+ private attemptingReconnect;
40
+ private reconnectPolicy;
41
+ private reconnectTimeout?;
42
+ private participantSid?;
43
+ /** keeps track of how often an initial join connection has been tried */
44
+ private joinAttempts;
45
+ /** specifies how often an initial join connection is allowed to retry */
46
+ private maxJoinAttempts;
47
+ constructor(options: InternalRoomOptions);
48
+ join(url: string, token: string, opts: SignalOptions, abortSignal?: AbortSignal): Promise<JoinResponse>;
49
+ close(): void;
50
+ addTrack(req: AddTrackRequest): Promise<TrackInfo>;
51
+ removeTrack(sender: RTCRtpSender): void;
52
+ updateMuteStatus(trackSid: string, muted: boolean): void;
53
+ get dataSubscriberReadyState(): string | undefined;
54
+ get connectedServerAddress(): string | undefined;
55
+ private configure;
56
+ private createDataChannels;
57
+ private handleDataChannel;
58
+ private handleDataMessage;
59
+ private handleDataError;
60
+ private setPreferredCodec;
61
+ createSender(track: LocalTrack, opts: TrackPublishOptions, encodings?: RTCRtpEncodingParameters[]): Promise<RTCRtpSender>;
62
+ createSimulcastSender(track: LocalVideoTrack, simulcastTrack: SimulcastTrackInfo, opts: TrackPublishOptions, encodings?: RTCRtpEncodingParameters[]): Promise<RTCRtpSender | undefined>;
63
+ private createTransceiverRTCRtpSender;
64
+ private createSimulcastTransceiverSender;
65
+ private createRTCRtpSender;
66
+ private handleDisconnect;
67
+ private attemptReconnect;
68
+ private getNextRetryDelay;
69
+ private restartConnection;
70
+ private resumeConnection;
71
+ waitForPCConnected(): Promise<void>;
72
+ sendDataPacket(packet: DataPacket, kind: DataPacket_Kind): Promise<void>;
73
+ private ensurePublisherConnected;
74
+ /** @internal */
75
+ negotiate(): void;
76
+ dataChannelForKind(kind: DataPacket_Kind, sub?: boolean): RTCDataChannel | undefined;
77
+ private clearPendingReconnect;
78
+ private handleBrowserOnLine;
79
+ private registerOnLineListener;
80
+ private deregisterOnLineListener;
81
+ }
82
+ export declare type EngineEventCallbacks = {
83
+ connected: () => void;
84
+ disconnected: (reason?: DisconnectReason) => void;
85
+ resuming: () => void;
86
+ resumed: () => void;
87
+ restarting: () => void;
88
+ restarted: (joinResp: JoinResponse) => void;
89
+ signalResumed: () => void;
90
+ mediaTrackAdded: (track: MediaStreamTrack, streams: MediaStream, receiver?: RTCRtpReceiver) => void;
91
+ activeSpeakersUpdate: (speakers: Array<SpeakerInfo>) => void;
92
+ dataPacketReceived: (userPacket: UserPacket, kind: DataPacket_Kind) => void;
93
+ transportsCreated: (publisher: PCTransport, subscriber: PCTransport) => void;
94
+ };
95
+ export {};
96
+ //# sourceMappingURL=RTCEngine.d.ts.map
@@ -0,0 +1,23 @@
1
+ /** Controls reconnecting of the client */
2
+ export interface ReconnectPolicy {
3
+ /** Called after disconnect was detected
4
+ *
5
+ * @returns {number | null} Amount of time in milliseconds to delay the next reconnect attempt, `null` signals to stop retrying.
6
+ */
7
+ nextRetryDelayInMs(context: ReconnectContext): number | null;
8
+ }
9
+ export interface ReconnectContext {
10
+ /**
11
+ * Number of failed reconnect attempts
12
+ */
13
+ readonly retryCount: number;
14
+ /**
15
+ * Elapsed amount of time in milliseconds since the disconnect.
16
+ */
17
+ readonly elapsedMs: number;
18
+ /**
19
+ * Reason for retrying
20
+ */
21
+ readonly retryReason?: Error;
22
+ }
23
+ //# sourceMappingURL=ReconnectPolicy.d.ts.map
@@ -0,0 +1,203 @@
1
+ import type TypedEmitter from 'typed-emitter';
2
+ import type { InternalRoomOptions, RoomConnectOptions, RoomOptions } from '../options';
3
+ import { DataPacket_Kind, DisconnectReason, ParticipantPermission } from '../proto/livekit_models';
4
+ import LocalParticipant from './participant/LocalParticipant';
5
+ import type Participant from './participant/Participant';
6
+ import type { ConnectionQuality } from './participant/Participant';
7
+ import RemoteParticipant from './participant/RemoteParticipant';
8
+ import RTCEngine from './RTCEngine';
9
+ import type LocalTrackPublication from './track/LocalTrackPublication';
10
+ import type RemoteTrack from './track/RemoteTrack';
11
+ import RemoteTrackPublication from './track/RemoteTrackPublication';
12
+ import { Track } from './track/Track';
13
+ import type { TrackPublication } from './track/TrackPublication';
14
+ export declare enum ConnectionState {
15
+ Disconnected = "disconnected",
16
+ Connecting = "connecting",
17
+ Connected = "connected",
18
+ Reconnecting = "reconnecting"
19
+ }
20
+ /** @deprecated RoomState has been renamed to [[ConnectionState]] */
21
+ export declare const RoomState: typeof ConnectionState;
22
+ declare const Room_base: new () => TypedEmitter<RoomEventCallbacks>;
23
+ /**
24
+ * In LiveKit, a room is the logical grouping for a list of participants.
25
+ * Participants in a room can publish tracks, and subscribe to others' tracks.
26
+ *
27
+ * a Room fires [[RoomEvent | RoomEvents]].
28
+ *
29
+ * @noInheritDoc
30
+ */
31
+ declare class Room extends Room_base {
32
+ state: ConnectionState;
33
+ /** map of sid: [[RemoteParticipant]] */
34
+ participants: Map<string, RemoteParticipant>;
35
+ /**
36
+ * list of participants that are actively speaking. when this changes
37
+ * a [[RoomEvent.ActiveSpeakersChanged]] event is fired
38
+ */
39
+ activeSpeakers: Participant[];
40
+ /** @internal */
41
+ engine: RTCEngine;
42
+ /** server assigned unique room id */
43
+ sid: string;
44
+ /** user assigned name, derived from JWT token */
45
+ name: string;
46
+ /** the current participant */
47
+ localParticipant: LocalParticipant;
48
+ /** room metadata */
49
+ metadata: string | undefined;
50
+ /** options of room */
51
+ options: InternalRoomOptions;
52
+ private _isRecording;
53
+ private identityToSid;
54
+ /** connect options of room */
55
+ private connOptions?;
56
+ private audioEnabled;
57
+ private audioContext?;
58
+ /** used for aborting pending connections to a LiveKit server */
59
+ private abortController?;
60
+ /** future holding client initiated connection attempt */
61
+ private connectFuture?;
62
+ /**
63
+ * Creates a new Room, the primary construct for a LiveKit session.
64
+ * @param options
65
+ */
66
+ constructor(options?: RoomOptions);
67
+ private maybeCreateEngine;
68
+ /**
69
+ * getLocalDevices abstracts navigator.mediaDevices.enumerateDevices.
70
+ * In particular, it handles Chrome's unique behavior of creating `default`
71
+ * devices. When encountered, it'll be removed from the list of devices.
72
+ * The actual default device will be placed at top.
73
+ * @param kind
74
+ * @returns a list of available local devices
75
+ */
76
+ static getLocalDevices(kind?: MediaDeviceKind, requestPermissions?: boolean): Promise<MediaDeviceInfo[]>;
77
+ /**
78
+ * prepares the connection to the livekit server by sending a HEAD request in order to
79
+ * 1. speed up DNS resolution
80
+ * 2. speed up TLS setup
81
+ * on the actual connection request
82
+ * throws an error if server is not reachable after the request timeout
83
+ * @experimental
84
+ */
85
+ prepareConnection(url: string): Promise<void>;
86
+ connect: (url: string, token: string, opts?: RoomConnectOptions) => Promise<void>;
87
+ /**
88
+ * disconnects the room, emits [[RoomEvent.Disconnected]]
89
+ */
90
+ disconnect: (stopTracks?: boolean) => Promise<void>;
91
+ /**
92
+ * retrieves a participant by identity
93
+ * @param identity
94
+ * @returns
95
+ */
96
+ getParticipantByIdentity(identity: string): Participant | undefined;
97
+ private clearConnectionFutures;
98
+ /**
99
+ * if the current room has a participant with `recorder: true` in its JWT grant
100
+ **/
101
+ get isRecording(): boolean;
102
+ /**
103
+ * @internal for testing
104
+ */
105
+ simulateScenario(scenario: string): void;
106
+ private onBeforeUnload;
107
+ /**
108
+ * Browsers have different policies regarding audio playback. Most requiring
109
+ * some form of user interaction (click/tap/etc).
110
+ * In those cases, audio will be silent until a click/tap triggering one of the following
111
+ * - `startAudio`
112
+ * - `getUserMedia`
113
+ */
114
+ startAudio(): Promise<void>;
115
+ /**
116
+ * Returns true if audio playback is enabled
117
+ */
118
+ get canPlaybackAudio(): boolean;
119
+ /**
120
+ * Switches all active device used in this room to the given device.
121
+ *
122
+ * Note: setting AudioOutput is not supported on some browsers. See [setSinkId](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/setSinkId#browser_compatibility)
123
+ *
124
+ * @param kind use `videoinput` for camera track,
125
+ * `audioinput` for microphone track,
126
+ * `audiooutput` to set speaker for all incoming audio tracks
127
+ * @param deviceId
128
+ */
129
+ switchActiveDevice(kind: MediaDeviceKind, deviceId: string): Promise<void>;
130
+ private recreateEngine;
131
+ private onTrackAdded;
132
+ private handleRestarting;
133
+ private handleRestarted;
134
+ private handleDisconnect;
135
+ private handleParticipantUpdates;
136
+ private handleParticipantDisconnected;
137
+ private handleActiveSpeakersUpdate;
138
+ private handleSpeakersChanged;
139
+ private handleStreamStateUpdate;
140
+ private handleSubscriptionPermissionUpdate;
141
+ private handleDataPacket;
142
+ private handleAudioPlaybackStarted;
143
+ private handleAudioPlaybackFailed;
144
+ private handleDeviceChange;
145
+ private handleRoomUpdate;
146
+ private handleConnectionQualityUpdate;
147
+ private acquireAudioContext;
148
+ private createParticipant;
149
+ private getOrCreateParticipant;
150
+ private sendSyncState;
151
+ /**
152
+ * After resuming, we'll need to notify the server of the current
153
+ * subscription settings.
154
+ */
155
+ private updateSubscriptions;
156
+ private setAndEmitConnectionState;
157
+ private emitWhenConnected;
158
+ private onLocalParticipantMetadataChanged;
159
+ private onLocalTrackMuted;
160
+ private onLocalTrackUnmuted;
161
+ private onLocalTrackPublished;
162
+ private onLocalTrackUnpublished;
163
+ private onLocalConnectionQualityChanged;
164
+ private onMediaDevicesError;
165
+ private onLocalParticipantPermissionsChanged;
166
+ emit<E extends keyof RoomEventCallbacks>(event: E, ...args: Parameters<RoomEventCallbacks[E]>): boolean;
167
+ }
168
+ export default Room;
169
+ export declare type RoomEventCallbacks = {
170
+ connected: () => void;
171
+ reconnecting: () => void;
172
+ reconnected: () => void;
173
+ disconnected: (reason?: DisconnectReason) => void;
174
+ /** @deprecated stateChanged has been renamed to connectionStateChanged */
175
+ stateChanged: (state: ConnectionState) => void;
176
+ connectionStateChanged: (state: ConnectionState) => void;
177
+ mediaDevicesChanged: () => void;
178
+ participantConnected: (participant: RemoteParticipant) => void;
179
+ participantDisconnected: (participant: RemoteParticipant) => void;
180
+ trackPublished: (publication: RemoteTrackPublication, participant: RemoteParticipant) => void;
181
+ trackSubscribed: (track: RemoteTrack, publication: RemoteTrackPublication, participant: RemoteParticipant) => void;
182
+ trackSubscriptionFailed: (trackSid: string, participant: RemoteParticipant) => void;
183
+ trackUnpublished: (publication: RemoteTrackPublication, participant: RemoteParticipant) => void;
184
+ trackUnsubscribed: (track: RemoteTrack, publication: RemoteTrackPublication, participant: RemoteParticipant) => void;
185
+ trackMuted: (publication: TrackPublication, participant: Participant) => void;
186
+ trackUnmuted: (publication: TrackPublication, participant: Participant) => void;
187
+ localTrackPublished: (publication: LocalTrackPublication, participant: LocalParticipant) => void;
188
+ localTrackUnpublished: (publication: LocalTrackPublication, participant: LocalParticipant) => void;
189
+ participantMetadataChanged: (metadata: string | undefined, participant: RemoteParticipant | LocalParticipant) => void;
190
+ participantPermissionsChanged: (prevPermissions: ParticipantPermission, participant: RemoteParticipant | LocalParticipant) => void;
191
+ activeSpeakersChanged: (speakers: Array<Participant>) => void;
192
+ roomMetadataChanged: (metadata: string) => void;
193
+ dataReceived: (payload: Uint8Array, participant?: RemoteParticipant, kind?: DataPacket_Kind) => void;
194
+ connectionQualityChanged: (quality: ConnectionQuality, participant: Participant) => void;
195
+ mediaDevicesError: (error: Error) => void;
196
+ trackStreamStateChanged: (publication: RemoteTrackPublication, streamState: Track.StreamState, participant: RemoteParticipant) => void;
197
+ trackSubscriptionPermissionChanged: (publication: RemoteTrackPublication, status: TrackPublication.PermissionStatus, participant: RemoteParticipant) => void;
198
+ trackSubscriptionStatusChanged: (publication: RemoteTrackPublication, status: TrackPublication.SubscriptionStatus, participant: RemoteParticipant) => void;
199
+ audioPlaybackChanged: (playing: boolean) => void;
200
+ signalConnected: () => void;
201
+ recordingStatusChanged: (recording: boolean) => void;
202
+ };
203
+ //# sourceMappingURL=Room.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { InternalRoomConnectOptions, InternalRoomOptions } from '../options';
2
+ import { AudioCaptureOptions, TrackPublishDefaults, VideoCaptureOptions } from './track/options';
3
+ export declare const publishDefaults: TrackPublishDefaults;
4
+ export declare const audioDefaults: AudioCaptureOptions;
5
+ export declare const videoDefaults: VideoCaptureOptions;
6
+ export declare const roomOptionDefaults: InternalRoomOptions;
7
+ export declare const roomConnectOptionDefaults: InternalRoomConnectOptions;
8
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1,39 @@
1
+ export declare class LivekitError extends Error {
2
+ code: number;
3
+ constructor(code: number, message?: string);
4
+ }
5
+ export declare const enum ConnectionErrorReason {
6
+ NotAllowed = 0,
7
+ ServerUnreachable = 1,
8
+ InternalError = 2
9
+ }
10
+ export declare class ConnectionError extends LivekitError {
11
+ status?: number;
12
+ reason?: ConnectionErrorReason;
13
+ constructor(message?: string, reason?: ConnectionErrorReason, status?: number);
14
+ }
15
+ export declare class TrackInvalidError extends LivekitError {
16
+ constructor(message?: string);
17
+ }
18
+ export declare class UnsupportedServer extends LivekitError {
19
+ constructor(message?: string);
20
+ }
21
+ export declare class UnexpectedConnectionState extends LivekitError {
22
+ constructor(message?: string);
23
+ }
24
+ export declare class NegotiationError extends LivekitError {
25
+ constructor(message?: string);
26
+ }
27
+ export declare class PublishDataError extends LivekitError {
28
+ constructor(message?: string);
29
+ }
30
+ export declare enum MediaDeviceFailure {
31
+ PermissionDenied = "PermissionDenied",
32
+ NotFound = "NotFound",
33
+ DeviceInUse = "DeviceInUse",
34
+ Other = "Other"
35
+ }
36
+ export declare namespace MediaDeviceFailure {
37
+ function getFailure(error: any): MediaDeviceFailure | undefined;
38
+ }
39
+ //# sourceMappingURL=errors.d.ts.map