UNPKG

@cometchat/chat-uikit-react

Version:

Ready-to-use Chat UI Components for React(Javascript/Web)

46 lines (45 loc) 1.85 kB
import { CometChatAIAssistantTools } from '../modals/CometChatAIAssistantTools'; /** * Interface representing streaming message data that contains both the original message event * and the accumulated streamed text content that has been processed so far. */ export interface IStreamData { message: CometChat.AIAssistantBaseEvent; streamedMessages?: string; } /** * Observable stream for streaming state changes */ export declare const streamingState$: import("rxjs").Observable<boolean>; /** * Observable stream for message updates */ export declare const messageStream: import("rxjs").Observable<IStreamData>; /** * Starts a new streaming message session * Resets accumulated content and initializes the message processor */ export declare const startStreamingMessage: () => void; /** * Handles incoming websocket messages by adding them to the processing queue * @param msg - The message update to process */ export declare const handleWebsocketMessage: (msg: CometChat.AIAssistantBaseEvent) => void; /** * Sets the typing speed delay for text message content chunks * @param delay - The delay in milliseconds between text content chunks (default: 80ms) */ export declare const setStreamSpeed: (delay: number) => void; /** * Gets the current typing speed delay for text message content chunks * @returns The current delay in milliseconds */ export declare const getStreamSpeed: () => number; export declare const getAIAssistantTools: () => CometChatAIAssistantTools; export declare const setAIAssistantTools: (actions: CometChatAIAssistantTools) => void; /** * Stops the streaming message session and cleans up resources * Unsubscribes from the message processor and resets accumulated content */ export declare const stopStreamingMessage: () => void; export declare const emitStreamingState: (state: boolean) => void;