@sanseng/livekit-ws-sdk 0.1.10 → 0.1.12

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/index.d.ts CHANGED
@@ -137,6 +137,16 @@ interface AudioEvents {
137
137
  'inner:audio:unmuted': void;
138
138
  }
139
139
 
140
+ /**
141
+ * Camera-related events (local camera capture)
142
+ *
143
+ * @author sansen
144
+ */
145
+ interface CameraEvents {
146
+ 'inner:camera:started': void;
147
+ 'inner:camera:stopped': void;
148
+ }
149
+
140
150
  /**
141
151
  * Conversation-related events
142
152
  *
@@ -150,6 +160,7 @@ interface ConversationEvents {
150
160
  'inner:conversation:answer:completed': { questionId: string; fullAnswer: string };
151
161
  'inner:conversation:server:message': { questionId: string; message: string; type: string };
152
162
  'inner:conversation:asr:received': { questionId: string; text: string };
163
+ 'inner:conversation:server:command': { code: number; command: string };
153
164
  }
154
165
 
155
166
  /**
@@ -205,6 +216,9 @@ interface PublicSDKEvents {
205
216
  'media:audio:captureStarted': undefined;
206
217
  'media:audio:captureStopped': undefined;
207
218
 
219
+ 'media:camera:started': undefined;
220
+ 'media:camera:stopped': undefined;
221
+
208
222
  'media:audio:volumeChanged': { volume: number };
209
223
  'media:audio:muted': undefined;
210
224
  'media:audio:unmuted': undefined;
@@ -223,7 +237,13 @@ interface PublicSDKEvents {
223
237
  * @author sansen
224
238
  * @typedef {SDKEvents}
225
239
  */
226
- type SDKEvents = PublicSDKEvents & VideoEvents & AudioEvents & ConversationEvents & ConnectionEvents & InternalConnectionFactEvents;
240
+ type SDKEvents = PublicSDKEvents &
241
+ VideoEvents &
242
+ AudioEvents &
243
+ CameraEvents &
244
+ ConversationEvents &
245
+ ConnectionEvents &
246
+ InternalConnectionFactEvents;
227
247
 
228
248
  /**
229
249
  * Event listener function type
@@ -820,6 +840,7 @@ declare class SDKContext {
820
840
  private _token;
821
841
  private _roomId;
822
842
  private _wsUrl;
843
+ private _httpToken;
823
844
  /**
824
845
  * Creates an SDK context instance
825
846
  *
@@ -836,6 +857,8 @@ declare class SDKContext {
836
857
  * @author sansen
837
858
  */
838
859
  setLivekitConfig(livekitUrl: string, token: string, roomId: string): void;
860
+ setAuthToken(token: string): void;
861
+ get authToken(): string | undefined;
839
862
  /**
840
863
  * Emits an error event and creates SDKError instance
841
864
  *
@@ -976,6 +999,11 @@ declare class SDKClient extends Disposable {
976
999
  * @author sansen
977
1000
  */
978
1001
  private _conversationController;
1002
+ /**
1003
+ * Camera controller (local camera capture + screenshot send)
1004
+ * @author sansen
1005
+ */
1006
+ private _cameraController;
979
1007
  /**
980
1008
  * LiveKit service
981
1009
  * @author sansen
@@ -1094,6 +1122,42 @@ declare class SDKClient extends Disposable {
1094
1122
  * @author sansen
1095
1123
  */
1096
1124
  get isAudioCapturing(): boolean;
1125
+ /**
1126
+ * Set authentication token
1127
+ * @param token Authentication token
1128
+ * @author sansen
1129
+ */
1130
+ setAuthToken(token: string): void;
1131
+ /**
1132
+ * Start camera capture and periodic screenshot sending over WebSocket
1133
+ * @returns Promise<void>
1134
+ * @throws SDKError if not connected or camera controller unavailable
1135
+ * @author sansen
1136
+ */
1137
+ startCamera(): Promise<void>;
1138
+ /**
1139
+ * Stop camera capture and screenshot sending
1140
+ * @author sansen
1141
+ */
1142
+ stopCamera(): void;
1143
+ /**
1144
+ * Get the local camera MediaStream (null if camera not running)
1145
+ * @returns MediaStream | null
1146
+ * @author sansen
1147
+ */
1148
+ getCameraStream(): MediaStream | null;
1149
+ /**
1150
+ * Get the local camera video track (null if camera not running)
1151
+ * @returns MediaStreamTrack | null
1152
+ * @author sansen
1153
+ */
1154
+ getCameraTrack(): MediaStreamTrack | null;
1155
+ /**
1156
+ * Attach the local camera stream to a video element for preview
1157
+ * @param videoElement HTML video element to show the stream
1158
+ * @author sansen
1159
+ */
1160
+ attachCameraTo(videoElement: HTMLVideoElement): void;
1097
1161
  /**
1098
1162
  * Pre-connect to remote services
1099
1163
  * Performs pre-connection steps: fetches auth token and LiveKit configuration