@22g/netease-im-web-sdk
Version:
typescript netease-im-web-sdk
52 lines (49 loc) • 1.5 kB
TypeScript
import { NIMMessage, NIMSceneType } from './Message';
import { OmitStrict } from '@22g/utility-types';
/** IM会话信息对象 */
export interface NIMSession {
/**
* 会话ID
* - 对于同一个 『`to`』(p2p时为客户云信ID) 是相同的
*/
id: string;
/** 场景 */
scene: NIMSceneType;
/** 聊天对象, 账号或群ID */
to: string;
/** 会话更新的时间(ms) */
updateTime: number;
/** 未读数 */
unread: number;
/**
* 此会话的最后一条消息
*
*/
lastMsg?: NIMMessage;
/**
* 消息已读回执时间戳, 如果有此字段, 说明此时间戳之前的所有消息对方均已读
* - 目前仅对'p2p'会话起作用
* - 此字段不一定有, 只有对方发送过已读回执之后才会有
* - 调用接口sendMsgReceipt来发送消息已读回执
* - 调用接口isMsgRemoteRead来查询消息是否被对方读过了
*/
msgReceiptTime?: number;
/**
* 本地自定义扩展字段
* - 在支持数据库时可以调用更新本地会话来更新此字段, 此字段只会被更新到本地数据库, 不会被更新到服务器上
*/
localCustom: string;
/**
* 是否被置顶
* - 7.6.0 新增
*/
isTop?: boolean;
/**
* 置顶的扩展字段
* - 7.6.0 新增
*/
topCustom?: string;
}
/** 服务器会话(7.0新增) */
export interface NIMServerSession extends OmitStrict<NIMSession, 'msgReceiptTime' | 'localCustom'> {
}