UNPKG

easemob-chat-uikit

Version:

![Static Badge](https://img.shields.io/badge/platform-React-green) ![Static Badge](https://img.shields.io/badge/language-typescript-green) ![GitHub commit activity](https://img.shields.io/github/commit-activity/y/easemob/Easemob-UIKit-web) ![GitHub last c

80 lines (79 loc) 3.76 kB
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<string, ChatSDK.MessageBody | NoticeMessageBody>; 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; sendMessage(message: ChatSDK.MessageBody | ChatSDK.ReadMsgBody | ChatSDK.DeliveryMsgBody | ChatSDK.ChannelMsgBody): Promise<void>; receiveMessage(message: BaseMessageType): void; modifyMessage(id: string, message: ChatSDK.MessageBody | NoticeMessageBody): void; sendChannelAck(cvs: CurrentConversation): Promise<ChatSDK.SendMsgResult>; 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<void>; recallMessage(cvs: CurrentConversation, messageId: string, isChatThread?: boolean, recallMySelfMsg?: boolean): Promise<void> | undefined; addReaction(cvs: CurrentConversation, messageId: string, emoji: string): Promise<void> | undefined; deleteReaction(cvs: CurrentConversation, messageId: string, emoji: string): Promise<void>; updateReactions(cvs: CurrentConversation, messageId: string, reactions: ReactionData[]): void; getReactionUserList(cvs: CurrentConversation, messageId: string, reaction: string): Promise<void> | undefined; translateMessage(cvs: CurrentConversation, messageId: string, language: string): Promise<unknown>; modifyLocalMessage(messageId: string, msg: ChatSDK.ModifiedEventMessage, isReceivedModify?: boolean): void; modifyServerMessage(messageId: string, msg: ChatSDK.ModifiedMsg): Promise<void>; 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;