import { MessageModel, ChatMessageOwner, Message } from './MessageModel'; import { ThreadMessages } from './ThreadMessages'; import { ObservableReactValue } from '../utils/observers/ObservableReactValue'; import { MessageSentParams } from './MessageSentParams'; import { IdType } from '../types'; export type NewMessageResponse = { user: Message; assistant: Message; }; export declare enum StreamResponseState { START = "start", TYPING_MESSAGE = "typingMessage", THINKING = "thinking", FINISH_MESSAGE = "finishMessage" } export type Thread = { id: IdType; title: string; date?: string; aiModel?: string; messages?: DM[]; pinnedAt?: number | null; type?: string; } & { isNew?: boolean; }; export declare class ThreadModel = any> { readonly streamMessage: (params: MessageSentParams) => void | Promise; readonly viewerUniqueKey: string; readonly messages: ThreadMessages; readonly observableTitle: ObservableReactValue; readonly isTyping: ObservableReactValue; readonly isLoadingAttachments: ObservableReactValue; readonly isEmpty: ObservableReactValue; readonly streamStatus: ObservableReactValue; readonly tool: ObservableReactValue; readonly aiModel: ObservableReactValue; readonly helloMessage: MessageModel<{ id: string; content: string; role: ChatMessageOwner.ASSISTANT; time: number; }>; /** * We can pass threads with empty history to improve performance * When opening such a thread, we need to call the getFullThread method to load the history */ readonly isLoadingFullData: ObservableReactValue; scrollY: number; readonly pinnedAt: ObservableReactValue; readonly timestamp: ObservableReactValue; private _data; constructor(data: DD, streamMessage: (params: MessageSentParams) => void | Promise); get id(): IdType; set id(value: IdType); get time(): number; get title(): string; set title(value: string); get date(): string | undefined; get isNew(): boolean | undefined; get messagesArray(): MessageModel[]; get data(): Thread; setFullData: (threadData: Thread & { messages: DM[]; }) => void; static createEmptyData: () => DD_1; protected _createPair: (content: Message['content'], parentMessage: MessageModel | undefined) => { userMessage: MessageModel; assistantMessage: MessageModel; }; }