import { ChatSDK } from '../SDK'; import { CurrentConversation } from './ConversationStore'; import type { ReactionData } from '../reaction/ReactionMessage'; import { RootStore } from './index'; import { BaseMessageType } from '../baseMessage/BaseMessage'; import { NoticeMessageBody } from '../noticeMessage/NoticeMessage'; export interface Message { singleChat: { [key: string]: (ChatSDK.MessageBody | NoticeMessageBody)[]; }; groupChat: { [key: string]: (ChatSDK.MessageBody | NoticeMessageBody)[]; }; chatRoom: { [key: string]: (ChatSDK.MessageBody | NoticeMessageBody)[]; }; byId: Map; broadcast: ChatSDK.MessageBody[]; } export interface SelectedMessage { singleChat: { [key: string]: { selectable: boolean; selectedMessage: (ChatSDK.MessageBody | NoticeMessageBody)[]; }; }; groupChat: { [key: string]: { selectable: boolean; selectedMessage: (ChatSDK.MessageBody | NoticeMessageBody)[]; }; }; } export interface Typing { [key: string]: boolean; } declare class MessageStore { rootStore: RootStore; message: Message; selectedMessage: SelectedMessage; currentCVS: CurrentConversation; repliedMessage: ChatSDK.MessageBody | null; typing: Typing; holding: boolean; unreadMessageCount: number; constructor(rootStore: RootStore); get currentCvsMsgs(): (ChatSDK.MessageBody | NoticeMessageBody)[]; setKeyValue(key: string, value: ChatSDK.MessageBody | NoticeMessageBody): void; setCurrentCVS(currentCVS: CurrentConversation): void; addMessage(message: ChatSDK.MessageBody, chatType: 'singleChat' | 'groupChat', to: string): void; updateMessage(params: { messageId: string; chatType: 'singleChat' | 'groupChat'; to: string; msg: string; }): void; sendMessage(message: ChatSDK.MessageBody | ChatSDK.ReadMsgBody | ChatSDK.DeliveryMsgBody | ChatSDK.ChannelMsgBody): Promise; receiveMessage(message: BaseMessageType): void; modifyMessage(id: string, message: ChatSDK.MessageBody | NoticeMessageBody): void; sendChannelAck(cvs: CurrentConversation): Promise; updateMessageStatus(msgId: string, status: string): void; addHistoryMsgs(cvs: CurrentConversation, msgs: any): void; clearMessage(cvs: CurrentConversation): void; setRepliedMessage(message: ChatSDK.MessageBody | null): void; deleteMessage(cvs: CurrentConversation, messageId: string | string[]): void | Promise; recallMessage(cvs: CurrentConversation, messageId: string, isChatThread?: boolean, recallMySelfMsg?: boolean): Promise | undefined; addReaction(cvs: CurrentConversation, messageId: string, emoji: string): Promise | undefined; deleteReaction(cvs: CurrentConversation, messageId: string, emoji: string): Promise; updateReactions(cvs: CurrentConversation, messageId: string, reactions: ReactionData[]): void; getReactionUserList(cvs: CurrentConversation, messageId: string, reaction: string): Promise | undefined; translateMessage(cvs: CurrentConversation, messageId: string, language: string): Promise; modifyLocalMessage(messageId: string, msg: ChatSDK.ModifiedEventMessage, isReceivedModify?: boolean): void; modifyServerMessage(messageId: string, msg: ChatSDK.ModifiedMsg): Promise; setSelectedMessage(cvs: CurrentConversation, selectedData: { selectable: boolean; selectedMessage: (ChatSDK.MessageBody | NoticeMessageBody)[]; }): void; setTyping(cvs: CurrentConversation, typing: boolean): void; sendTypingCmd(cvs: CurrentConversation): void; setHoldingStatus(status: boolean): void; setUnreadMessageCount(count: number): void; shiftBroadcastMessage(): void; sendReadAck(messageId: string, to: string): void; clear(): void; } export default MessageStore;