import { ConversationType, IReceivedMessage } from '@rongcloud/engine'; import { MemberModifyType } from '../enums/MemberModifyType'; import { MsgCallStatus } from '../enums/MsgCallStatus'; import { Platform } from '../enums/Platform'; import { RCCallEndReason } from '../enums/RCCallEndReason'; import { RCCallMediaType } from '../enums/RCCallMediaType'; import { RCCallMessageType } from '../enums/RCCallMessageType'; import { IOfflineRecord } from '../OfflineRecorder'; import { IUserProfile } from './IStateMachine'; export interface ISendBaseOptions { /** * 组织 ID */ channelId: string; /** * 会话类型 */ conversationType: ConversationType; /** * 目标 ID (单聊:对方 Id;群聊: 群组 Id) */ targetId: string; } export interface IInviteMsgContent { /** * 平台 */ platform: Platform; /** * 设备 Id */ deviceId: string; /** * 呼叫 ID( RTC 房间 ID ) */ callId: string; /** * mediaServer 版本,传 4 代表音视频服务 3.0 */ engineType: number; /** * Id 为 CallId,Key 为空串。透传 push 使用? */ channelInfo: { Id: string; Key: string; }; /** * 通话媒体类型 */ mediaType: RCCallMediaType; /** * 被邀请人用户 ID 列表 */ inviteUserIds: string[]; /** * 观察者用户 ID */ observerUserIds?: string[]; /** * 用户信息 */ user?: IUserProfile; /** * 跨appkey */ roomType?: number; /** * 额外信息 */ extra?: string; } export interface IExistedUserPofiles { /** * 用户 ID */ userId: string; /** * 通话类型 */ mediaType: RCCallMediaType; /** * 与移动端一致的通话状态 */ callStatus: MsgCallStatus; /** * PC 端 mediaId 直接传 userId, mediaId iOS 需要解出来渲染视图用。 */ mediaId?: string; } export interface IMemberModifyMsgContent { /** * 平台 */ platform: Platform; /** * 设备 ID */ deviceId: string; /** * 呼叫 ID( RTC 房间 ID ) */ callId: string; /** * 本次邀请发起者 userId */ caller: string; /** * 人员修改类型,当前仅用到 MemberModifyType.ADD */ modifyMemType: MemberModifyType; /** * mediaServer 版本,传 4 代表音视频服务 3.0 */ engineType: number; /** * Id 为 CallId,Key 为空串。透传 push 使用? */ channelInfo: { Id: string; Key: string; }; /** * 通话媒体类型 */ mediaType: RCCallMediaType; /** * 额外信息 */ extra?: string; /** * 被邀请人用户 ID 列表 */ inviteUserIds: string[]; /** * 当前通话已存在用户信息列表(包含接听成功用户及响铃状态用户) */ existedUserPofiles: IExistedUserPofiles[]; /** * 观察者用户,当前 Web 未用到 */ observerUserIds?: string[]; /** * 用户信息 */ user?: IUserProfile; } export interface IAcceptMsgContent { /** * 平台 */ platform: Platform; /** * 设备 ID */ deviceId: string; /** * 呼叫 ID( RTC 房间 ID ) */ callId: string; /** * 通话媒体类型 */ mediaType: RCCallMediaType; /** * 用户信息 */ user?: IUserProfile; } export interface IHungupMsgContent { /** * 平台 */ platform: Platform; /** * 设备 ID */ deviceId: string; /** * 呼叫 ID( RTC 房间 ID ) */ callId: string; /** * 挂断原因 */ reason: RCCallEndReason; /** * 用户信息 */ user?: IUserProfile; } export interface IMediaModifyMsgContent { /** * 平台 */ platform: Platform; /** * 设备 ID */ deviceId: string; /** * 呼叫 ID( RTC 房间 ID ) */ callId: string; /** * 通话媒体类型 */ mediaType: RCCallMediaType; /** * 用户信息 */ user?: IUserProfile; } export interface IRingingMsgContent { /** * 平台 */ platform: Platform; /** * 设备 ID */ deviceId: string; /** * 呼叫 ID( RTC 房间 ID ) */ callId: string; /** * 用户信息 */ user?: IUserProfile; } export type ICallMsgContent = IInviteMsgContent | IMemberModifyMsgContent | IAcceptMsgContent | IHungupMsgContent | IMediaModifyMsgContent | IRingingMsgContent; export interface ICallMsgOption extends ISendBaseOptions { /** * call 消息内容 */ content: ICallMsgContent; /** * call 消息类型 */ messageType: RCCallMessageType; /** * 定向消息 Id 列表 */ directionalUserIdList?: string[]; /** * 推送标题 */ pushTitle?: string; /** * 推送附加数据 */ pushData?: string; /** * 对方显示的通知内容 */ pushContent?: string; } export interface IMsgListener { onInvite?: (msg: IReceivedMessage) => void; onRinging?: (msg: IReceivedMessage) => void; onAccept?: (msg: IReceivedMessage) => void; onMemberModify?: (msg: IReceivedMessage) => void; onMediaModify?: (msg: IReceivedMessage) => void; onHungup?: (msg: IReceivedMessage) => void; sendAccept?: (info: { callId: string; }) => void; onOfflineRecord?: (record: IOfflineRecord) => void; } export interface IInviteMsgOptions extends ISendBaseOptions { /** * 呼叫 ID( RTC 房间 ID ) */ callId: string; /** * 通话媒体类型 */ mediaType: RCCallMediaType; /** * 被邀请人用户 ID 列表 */ inviteUserIds: string[]; /** * 扩展信息 */ extra: string; /** * 对方显示通知的标题 */ pushTitle?: string; /** * 对方显示的通知内容 */ pushContent?: string; /** * 跨appkey参数 */ roomType?: number; } export interface IMemberModifyMsgOptions extends ISendBaseOptions { /** * 呼叫 ID( RTC 房间 ID ) */ callId: string; /** * 通话媒体类型 */ mediaType: RCCallMediaType; /** * 被邀请人用户 ID 列表 */ inviteUserIds: string[]; /** * 获取会话发起者 Id */ callerId: string; /** * 当前通话中的所有人,包含未接听用户 */ existedUserPofiles: IExistedUserPofiles[]; /** * 当前通话中的所有人,包含未接听用户 */ directionalUserIdList: string[]; /** * 扩展信息 */ extra: string; /** * 对方显示通知的标题 */ pushTitle?: string; /** * 对方显示的通知内容 */ pushContent?: string; } export interface IRingingMsgOptions extends ISendBaseOptions { /** * 呼叫 ID( RTC 房间 ID ) */ callId: string; /** * 群呼中需要接收响铃的用户 ID 列表 */ userIds?: string[]; } export interface IAcceptMsgOptions extends ISendBaseOptions { /** * 呼叫 ID( RTC 房间 ID ) */ callId: string; /** * 通话媒体类型 */ mediaType: RCCallMediaType; /** * 群呼中需要接收接听消息的用户 ID 列表 */ userIds: string[]; } export interface IHungupMsgOptions extends ISendBaseOptions { /** * 呼叫 ID( RTC 房间 ID ) */ callId: string; /** * 挂断原因 */ reason: RCCallEndReason; /** * 群呼中需要接收挂断消息的用户 ID 列表 */ userIds: string[]; /** * 对方显示通知的标题 */ pushTitle?: string; /** * 对方显示的通知内容 */ pushContent?: string; } export interface IMediaModifyMsgOptions extends ISendBaseOptions { /** * 呼叫 ID( RTC 房间 ID ) */ callId: string; /** * 通话媒体类型 */ mediaType: RCCallMediaType; /** * 群呼中需要媒体变更消息的用户 ID 列表 */ userIds: string[]; } //# sourceMappingURL=IMessageHandler.d.ts.map