import type { MutableRefObject } from "react"; import type { ChatMessage, ChatMessageText, FeedbackVote } from "./messages"; import type { ChatTopic } from "./options"; import type { SendMessageResponse } from "./webhook"; export interface ChatStore { initialMessages: ChatMessage[]; messages: ChatMessage[]; currentSessionId: string | null; waitingForResponse: boolean; loadPreviousSession?: () => Promise; startNewSession?: () => Promise; sendMessage: ( text: string, files?: File[], ) => Promise; sendFeedback: (messageId: string, vote: FeedbackVote) => Promise; appendMessage: (message: ChatMessage) => void; replaceMessage: (messageId: string, message: ChatMessageText) => void; setWaitingForResponse: (waiting: boolean) => void; setCurrentSessionId: (sessionId: string | null) => void; websocketRef: MutableRefObject; selectTopic: (topic: ChatTopic, acknowledgement?: string) => void; selectedTopic: ChatTopic | null; isTopicSelectionPending: boolean; isTopicSelectionRequired: boolean; }