@@ -15,7 +15,6 @@ let eventEmitter= new CustomEventEmitter()
1515 */
1616const cbchat = {
1717
18-
1918 /**
2019 * Retrieves the chat history from the server.
2120 * @returns {Promise<ChatMessage[]> } A promise that resolves with an array of ChatMessage objects representing the chat history.
@@ -35,8 +34,8 @@ const cbchat = {
3534 } ,
3635
3736 /**
38- * @method setupMessageListener
39- * @description Sets up a listener for incoming WebSocket messages .
37+ * Sets up a listener for incoming WebSocket messages and emits a custom event when a message is received.
38+ * @returns { EventEmitter } The event emitter used for emitting custom events .
4039 */
4140 userMessageListener : ( ) => {
4241 if ( ! cbws . getWebsocket ) return ;
@@ -85,7 +84,7 @@ const cbchat = {
8584 * Notifies the server that a process has started and sets up an event listener for stopProcessClicked events.
8685 * @returns An object containing the event emitter and a stopProcess method.
8786 */
88- processStarted ( ) {
87+ processStarted : ( ) => {
8988 // Send the process started message
9089 cbws . getWebsocket . send ( JSON . stringify ( {
9190 "type" : "processStarted"
@@ -113,6 +112,10 @@ const cbchat = {
113112 }
114113 } ;
115114 } ,
115+ /**
116+ * Stops the ongoing process.
117+ * Sends a specific message to the server to stop the process.
118+ */
116119 stopProcess : ( ) => {
117120 // Implement the logic to stop the process here
118121 console . log ( "Stopping process..." ) ;
0 commit comments