This commit is contained in:
Your Name
2026-03-11 09:49:47 +08:00
parent 02ae537b4c
commit 38ad60f4bb
290 changed files with 36917 additions and 123 deletions
@@ -0,0 +1,71 @@
import type { PinConversationParams, MuteConversationParams, SetConversationDraftParams, MarkConversationParams, DeleteConversationParams } from '../../type';
/**
* @interface TUIConversationService
*/
export interface ITUIConversationService {
/**
* 初始化 Service
* @private
*/
init(): void;
/**
* 切换会话
* @function
* @param {String} conversationID 会话 IDconversationID 生成规则:单聊(`C2C${userID}`),群聊(`GROUP${groupID}`)。
* @example
* // 切换到 public001 群会话
* let promise = TUIConversationService.switchConversation('GROUPpublic001');
* promise.catch((error) => {
* // 调用异常时业务侧可以通过 promise.catch 捕获异常进行错误处理
* });
*/
switchConversation(conversationID: string): Promise<any>;
/**
* 获取会话列表
* @function
* @private
*/
getConversationList(): Promise<any>;
/**
* 获取会话资料
* 注意:Service API 主要用于跨组件时调用
* @function
* @param {String} conversationID 会话 ID
* @example
* // 获取 public001 群会话资料
* let promise = TUIConversationService.getConversationProfile('GROUPpublic001');
* promise.then((chatResponse) => {
* console.log(chatResponse.data.conversation); // 会话资料
* });
* promise.catch((error) => {
* // 调用异常时业务侧可以通过 promise.catch 捕获异常进行错误处理
* });
*/
getConversationProfile(conversationID: string): Promise<any>;
/**
* 设置会话已读上报
* @function
* @param {String} conversationID 会话 ID
* @example
* let promise = TUIConversationService.setMessageRead('GROUPpublic001');
* promise.catch((error) => {
* // 调用异常时业务侧可以通过 promise.catch 捕获异常进行错误处理
* });
*/
setMessageRead(conversationID: string): Promise<any>;
/**
* 一键清空历史消息
* @function
* @param {String} conversationID 会话 ID
* @example
* @private
*/
clearHistoryMessage(conversationID: string): Promise<any>;
}