Options
All
  • Public
  • Public/Protected
  • All
Menu

Module SessionServiceInterface

Index

Type Aliases

GetSessionsOptions: { desc?: boolean; lastSessionId?: string; limit?: number }

Type declaration

  • Optional desc?: boolean

    是否逆序获取

    为 true 则逆序,获取 lastSessionId 所在记录之后的 limit 个 为 false 则正序,获取 lastSessionId 所在记录之前的 limit 个

  • Optional lastSessionId?: string

    查询的上一批最后一条 sessionId

  • Optional limit?: number

    一页的限制数量,默认 100

NIM_AddStickTopSessionOptions: { ext?: string; id: string }

Type declaration

  • Optional ext?: string

    云端置顶会话的扩展字段

  • id: string

    sessionId

    例如 p2p-cs1、team-113879441

NIM_DeleteStickTopSessionOptions: { id: string }

Type declaration

  • id: string

    sessionId

    例如 p2p-cs1、team-113879441

NIM_SessionIdsOptions: { ids: string[] }

Type declaration

  • ids: string[]

    sessionIds

    例如 ['p2p-cs1', 'team-113879441']

    • Example ['p2p-cs1', 'team-113879441']
NIM_StickTopSessionInfo: { createTime: number; ext: string; id: string; isStickOnTop: boolean; updateTime: number }

Type declaration

  • createTime: number

    会话置顶的记录创建时间

  • ext: string

    云端置顶的扩展信息

  • id: string

    会话 id

  • isStickOnTop: boolean

    是否置顶?

  • updateTime: number

    会话置顶的记录更新时间

NIM_UpdateStickTopSessionOptions: { ext: string; id: string }

Type declaration

  • ext: string

    云端置顶会话的扩展字段

  • id: string

    sessionId

    例如 p2p-cs1、team-113879441

Session: { ack?: number; id: string; lastMsg?: IMMessage | null; msgReceiptTime?: number; scene: TMsgScene; stickTopInfo?: NIM_StickTopSessionInfo; to: string; unread: number; unreadMsgs?: IMMessage[]; updateTime: number }

Type declaration

  • Optional ack?: number

    自己已读过的最近一条消息的时间

    用于判别自己已读到哪条消息了

  • id: string

    sessionId

    例如 p2p-cs1、team-113879441

  • Optional lastMsg?: IMMessage | null

    上一条消息.

    若 lastMsg 为 undefined ,那么可能是从未设置过的,会话不完整。getSessions 将过滤掉此会话

    若 lastMsg 为 null,lastMsg 为 null 则可能是撤回消息,也可能是清除了这个会话的历史消息

  • Optional msgReceiptTime?: number

    聊天对象所读过的最近一条消息的时间

    p2p 会话特有,与 msg.time 对比就能得知某条消息是否被对方已读

    被 API sendMsgReceiptsendTeamMsgReceipt 所更新

  • scene: TMsgScene

    会话场景

    p2p 单聊

    team 群组

    superTeam 超大群

  • Optional stickTopInfo?: NIM_StickTopSessionInfo

    云端置顶会话信息。若开通了云端置顶会话功能,且这个会话的确被设置为置顶会话,此对象存在。

  • to: string

    聊天对象,

    若 scene 为 p2p 单聊,则 to 为聊天对象的账号

    若 scene 为 team 或者 superTeam,则 to 为 群ID

  • unread: number

    未读数

  • Optional unreadMsgs?: IMMessage[]

    自己还没读过的此会话消息。此字段不希望开发者处理。

  • updateTime: number

    更新时间

SessionIdOptions: { id: string }

Type declaration

  • id: string

    sessionId

    例如 p2p-cs1、team-113879441