///
import { ZegoRTMEvent } from '../../code/zh/ZegoExpressEntity.rtm';
import { RTCRoomCMDMap } from './modules/rtcRoomCmd';
import { E_CLIENT_TYPE, ERRO, RoomState } from '../common/zego.entity';
export declare const ROOMVERSION: "V1" | "V2";
export declare const CUSTOMER: string;
export declare const enum LIVEROOM_VER {
SWITCH_ONE = 1,
/**
* 信令精简版本
*/
SWITCH_TWO = 2,
RTC_ROOM_V2 = 4
}
/**
* 地理围栏类型。
*/
export interface GeoItem {
id: number;
relative_geofencings: number[];
accesshub: string;
logreport: string;
detaillog: string;
http3Accesshub: string;
wssV6Accesshub: string;
http3V6Accesshub: string;
}
export declare const ERROR_CODES: {
ROOM_SESSION_ID_ERR: number;
};
export interface DataStatisticsItemEvent {
event: string;
event_time: number;
time_consumed?: number;
msg_ext?: {
[index: string]: string | number;
};
}
export declare const enum TermType {
TT_NONE = 0,
TT_PC = 1,
TT_IOS = 2,
TT_ANDROID = 3,
TT_MAC = 4,
TT_LINUX = 5,
TT_WEB = 6,
TT_MINI_PROGRAM = 7,
TT_UNKNOWN = 32
}
export interface DataStatisticsItem {
event_time: number;
time_consumed: number;
error: number;
message: string;
events: DataStatisticsItemEvent[];
seq?: number;
event_id?: string;
msg_ext?: any;
itemtype?: string;
event?: string;
client_type?: E_CLIENT_TYPE;
}
export interface DataStatistics {
[index: string]: DataStatisticsItem;
}
export declare const enum ENUM_SIGNAL_STATE {
disconnected = 0,
connecting = 1,
connected = 2
}
export declare const MAX_TRY_CONNECT_COUNT = 1;
export declare const SEND_MSG_RESET = 2;
export declare const SEND_MSG_TIMEOUT = 1;
export declare const MAX_TRY_HEARTBEAT_COUNT = 5;
export declare const MAX_STREAM_ID_LENGTH = 256;
export declare const MAX_USER_ID_LENGTH = 64;
export declare const MAX_USER_NAME_LENGTH = 256;
export declare const MAX_ROOM_ID_LENGTH = 128;
export declare const MAX_MIX_TASK_ID_LENGTH = 256;
export declare const enum TRACER_LEVEL {
I = 0,
H = 10,
M = 100,
L = 1000
}
export declare const enum NetType {
NT_NONE = 0,
NT_LINE = 1,
NT_WIFI = 2,
NT_2G = 3,
NT_3G = 4,
NT_4G = 5,
NT_UNKNOWN = 32
}
export declare const MINIUM_HEARTBEAT_INTERVAL = 3000;
export declare const DEFAULT_HEARTBEAT_INTERVAL = 30000;
export declare const FIRST_HEARTBEAT_INTERVAL = 3000;
export declare const DEFAULT_HEARTBEAT_TIMEOUT = 100000;
export declare const ENUM_STREAM_UPDATE_CMD: {
added: number;
deleted: number;
updated: number;
};
export declare const SERVER_ERROR_CODE = 10000;
export interface ChatInfo {
id_name: string;
nick_name: string;
role: number;
msg_id: string;
msg_category: number;
msg_type: number;
msg_content: string;
send_time: number;
}
export interface UserInfo {
userID: string;
userName: string;
}
export interface OutUserInfo extends UserInfo {
role: number;
}
export interface MessageInfo {
idName: string;
nickName: string;
messageId: string;
category: number;
type: number;
content: string;
time: number;
}
export interface LiveRoomHeader {
Protocol: string;
cmd: string;
appid: number;
seq: number;
user_id: string;
session_id: string;
room_id: string;
room_session_id: string;
biz_version: string;
}
export type InnerRoomStateUpdateCallBack = (roomID: string, state: RoomState, errorCode: number, extendedData: string, reason: string, isSwitchRoom?: boolean) => void;
export interface IRoomUserBase {
idName: string;
nickName: string;
role: number;
}
export interface IRoomUserInfo extends IRoomUserBase {
action: number;
loginTime: string;
}
/**
* 房间和服务期之间的连接状态发生变化时触发
*/
export interface ZegoInnerEvent {
_roomStateUpdate: InnerRoomStateUpdateCallBack;
roomLoginResponse: (msg: any) => void;
_roomLogin: (roomID: string, token: string) => void;
_appConfigRsp: () => void;
_netAppConfigRsp: (appConfig: any) => void;
_connectChanged: (state: string, options: any) => void;
HBResponse: (msg: any, roomID: string) => void;
_getAnchorInfo: (anchorID: string, anchorName: string) => void;
_tokenRenewed: (token: string, roomID: string) => void;
_stopStream: (stopStreamList: string[], err: ERRO) => void;
_cloudSettingNotify: (file: string, setting: any) => void;
_settingCanFetch: (msg: any) => void;
_userTransUpdate: (roomID: string, transChannel: string, transResults: any) => void;
_uaHeartBeatTimeout: () => void;
_getTotalUserList: (roomID: string, userList: IRoomUserBase[]) => void;
_userStateUpdate: (roomID: string, userList: IRoomUserInfo[]) => void;
_recvBigRoomMessage: (msgList: MessageInfo[], roomID: string) => void;
_recvRoomMsg: (msgList: any, server_msg_id: any, ret_msg_id: any) => void;
_kickout: (error: RTMZegoError) => void;
roomTokenWillExpire: (roomID: string) => void;
_protoVerChanged: (from: LIVEROOM_VER, to: LIVEROOM_VER) => void;
_beforeSwitchRoom: (fromRoomID: string) => void;
_afterSwitchRoom: (toRoomID: string, isLoginSuccess: boolean) => void;
_recvRelateResult: (roomID: string, result: any, ver: LIVEROOM_VER) => void;
_experimentalAPICallback: (content: Record) => void;
_pushStreamMsg: (msg: IRTCRoomStreamNotifyMsg) => void;
_connectStream: (serverStreamList: IRTCRoomStreamData[], roomID: string) => void;
_switchRoomServer: () => void;
_userUpdateHandle: () => void;
_onGetCacheSetting: () => void;
_clearIndexDB: () => void;
_pushRoomSession: (roomID: string) => void;
_logDomainChanged: () => void;
}
/**
* @description 外部可以注册监听,但没有在文档上说明的事件
*/
export interface ZegoRTMLiveEvent {
recvReliableMessage: (type: number | string, seq: number, data: any) => void;
recvJoinLiveRequest: (requestId: string, from_userid: string, from_username: string, roomid: string) => void;
recvInviteJoinLiveRequest: (requestId: string, from_userid: string, from_username: string, roomid: string) => void;
recvEndJoinLiveCommand: (requestId: string, from_userid: string, from_username: string, roomid: string) => void;
}
export type RTMListenEvent = ZegoInnerEvent & ZegoRTMEvent & ZegoRTMLiveEvent;
export declare const MODULE_TIPS: {
MESSAGE: string;
};
export interface RTMZegoError {
code: number;
msg: string;
}
export interface ZegoProxyInfo {
ip?: string;
port?: number;
hostName: string;
userName?: string;
password?: string;
}
export interface ZegoLocalProxyConfig {
accesshubProxy: string;
loggerProxy?: string;
detaillogProxy?: string;
}
export declare const enum StrongSyncListFlag {
SSLF_NONE = 0,
SSLF_ALL = 1,
SSLF_PART = 2,
SSLF_LOCAL = 3,
SSLF_INCR = 4
}
export declare enum UserListFlag {
ULF_STRONG = 0,
ULF_WEAK = 1
}
export interface IRTCRoomReqHeader {
cmd: number;
seq: number;
timestamp: Long | number;
context_key?: number;
retry?: number;
}
export interface IRTCRoomRspHeader {
code: number;
message: string;
cmd: number;
seq: number;
context_key: number;
action_delay?: number;
}
export type RspMsgType = {
header: H & {
room_id?: string;
};
body: T & {
err_code?: number;
err_message?: string;
};
};
export type ReqMsgType = {
header: IRTCRoomReqHeader & {
room_id?: string;
};
body: T;
};
export interface SvrDomains {
accesshub_domain: string;
logreport_domain: string;
detaillog_domain: string;
accesshub_v6_domain: string;
logreport_v6_domain: string;
detaillog_v6_domain: string;
breport_domain?: string;
breport_v6_domain?: string;
}
/**
* 退出房间配置
*
*/
export interface LogoutRoomConfig {
/**
* 是否清理本地 indexDB 数据
*/
clearLocalDB?: boolean;
}
export type UnionMsgType = RspMsgType | ReqMsgType;
export interface IAppConfig {
userlist_merge_timeout: number;
userlist_interval: number;
room_hb_interval: number;
room_hb_timeout: number;
big_im_time_window: number;
}
export interface IRTCRoomLoginRsp {
server_timestamp: number;
switch_session_id: Long;
relogin_token: string;
app_config: IAppConfig;
action_rsp_list: IRTCRoomLoginActionRsp[];
}
export interface IRTCRoomLoginActionRsp {
action_cmd: number;
action_seq: number;
action_rsp: Uint8Array;
}
export interface IRTCRoomRspHead {
code: number;
message: string;
}
export interface IAnchorInfo {
id_name: string;
nickname: string;
}
export interface IRoomAttrChannel {
attr_channel: string;
attr_seq_list: IRoomAttrSeq[];
}
export interface IRoomAttrSeq {
attr_seq: number;
attr_type: string;
}
export interface IRoomAttrLocalSeq {
trans_type: string;
trans_local_seq: number;
}
export interface IRoomAttrFetchArray {
fetch_array: IRoomAttrLocalSeq[];
trans_channel: string;
}
export interface IRTCRoomUserInfo {
id_name: string;
nickname: string;
role?: number;
user_session_id: Long;
score: Long;
data_seq: number;
stream_list?: IRTCRoomStreamInfo[];
}
export interface IStreamPlayMode {
play_mode: number;
forbid_play_expire_time: Long;
}
export interface IRTCRoomStreamInfo {
stream_id: string;
stream_sid: string;
stream_title: string;
create_time: Long | number;
stream_src: number;
stream_state: number;
stream_type: number;
stream_nid: number;
extra_info: string;
sdk_custom_info: string;
stream_resource: number;
stream_codec: number;
stream_play_mode: IStreamPlayMode;
censor_flag: number;
stream_dispatch_flag: number;
dispatch_result: any;
stream_close_type: number;
}
export type IRTCRoomStreamData = IRTCRoomStreamInfo & {
id_name: string;
nick_name: string;
stream_ver: number;
sdk_custom: string;
};
export interface IRTCRoomEnterRoomRsp {
rsp_head: IRTCRoomRspHead;
user_session_id: Long;
room_session_id: Long;
online_count: number;
anchor_info: IAnchorInfo;
token_remain_time: number;
room_attr_list_seq: number;
strong_sync_seq: number;
strong_sync_count: number;
user_list: IRTCRoomUserInfo[];
next_score: Long;
strong_sync_list_flag: StrongSyncListFlag;
}
export type IRTCRoomEnterRoomRspMsgBody = IRTCRoomEnterRoomRsp & Partial> & {
hearbeat_interval?: number;
hearbeat_timeout?: number;
bigim_time_window?: number;
userlist_merge_timeout?: number;
userlist_interval?: number;
};
export type IRTCRoomEnterRoomCallBackMsg = RspMsgType;
export interface IGetRoomInfoRsp {
rsp_head: IRTCRoomRspHead;
room_session_id: Long | number;
anchor_info: IAnchorInfo;
}
export interface IGetUserListRsp {
rsp_head: IRTCRoomRspHead;
strong_sync_seq: number;
strong_sync_count: number;
user_list: IRTCRoomUserInfo[];
next_score: Long;
}
export interface IRTCRoomHbRsp {
rsp_head: IRTCRoomRspHead;
server_timestamp: Long;
strong_sync_seq: number;
online_count: number;
user_svr_attr_list_seq?: number;
room_attr_list_seq?: number;
capability_seq?: Long;
}
export declare const enum UserDataActionType {
UA_NONE = 0,
UA_Enter = 1,
UA_ReEnter = 2,
UA_Reset = 3,
UA_Quit = 4,
UA_AddStream = 5,
UA_DelStream = 6,
UA_UpdateStreamAttr = 7,
UA_InStrongList = 8,
UA_OutStrongList = 9
}
export interface IGetStrongSyncSeqInfoRsp {
rsp_head: IRTCRoomRspHead;
action_list: IUserDataAction[];
}
export type IUserDataAction = {
action: UserDataActionType;
id_name: string;
data_seq: number;
user_session_id: Long;
score: Long;
strong_sync_seq: number;
data: any;
};
export interface IRTCRoomPushReq {
qos_flag: number;
send_time: Long | number;
message_list: IRTCRoomPushInfo[];
}
export interface IRTCRoomPushInfo {
sub_cmd: RTCRoomCMDMap;
sub_seq: number;
msg_body: Uint8Array;
}
export interface IRTCRoomKickOutReq {
reason: number;
message: string;
}
export interface IPushUserDataUpdated {
user_action_list: IUserDataAction[];
}
export interface IActionUserBase {
nickname: string;
role: number;
}
export interface IActionEnterData extends IActionUserBase {
stream_list: IRTCRoomStreamInfo[];
}
export interface IActionReEnterData extends IActionUserBase {
del_stream_id_list: string[];
stream_close_type: number;
}
export interface IActionResetData extends IActionUserBase {
stream_list: IRTCRoomStreamInfo[];
}
export interface IActionAddStreamData extends IActionUserBase {
stream_list: IRTCRoomStreamInfo[];
}
export interface IActionDelStreamData extends IActionUserBase {
stream_id_list: string[];
stream_close_type: number;
}
export interface IActionUpdateStreamAttrData extends IActionUserBase {
stream_id: string;
update_flag: number;
extra_info: string;
sdk_custom_info: string;
stream_codec: number;
stream_play_mode: IStreamPlayMode;
dispatch_result: any;
}
export type IActionInStrongListData = IActionResetData;
export interface IActionOutStrongListData {
del_stream_id_list: string[];
stream_close_type: number;
}
export interface IGetRoomAttrRsp {
rsp_head: IRTCRoomRspHead;
attr_list_seq: number;
channel_list: IRoomChannelData[];
}
export interface IRoomChannelData {
attr_channel: string;
attr_list: IRTCRoomAttrData[];
}
export interface IRTCRoomAttrData {
err_code: number;
attr_type: string;
attr_data: string;
attr_send_time: Long;
attr_seq: number;
id_name: string;
nickname: string;
}
export interface IGetUserSvrAttrReq {
channel_seq_list: IRoomChannelData[];
}
export interface IGetUserSvrAttrRsp {
rsp_head: IRTCRoomRspHead;
attr_list_seq: number;
channel_list: IUserSvrChannelData[];
}
export interface IUserSvrChannelData {
attr_channel: string;
attr_list: IUserSvrAttrData[];
}
export interface IUserSvrAttrData {
err_code: number;
attr_type: string;
attr_data: string;
attr_seq: number;
}
export interface IPushBigIm {
msg_list: IBigImData[];
}
export interface IBigImData {
id_name: string;
nickname: string;
role: number;
msg_id: string;
msg_category: number;
msg_type: number;
msg_content: string;
msg_timestamp: string;
}
export interface IRTCRoomStreamNotifyMsg {
header: {
sub_cmd: number;
room_id: string;
};
body: {
stream_cmd: number;
stream_info_list: Array;
};
}
export type ReturnTransRspType = T extends {
rsp_head: IRTCRoomRspHead;
} ? Omit & {
err_code: number;
err_message: string;
} : T;
export interface IRelateResult {
service: string;
/**
*0 成功;1 pending状态(关联重试状态,有可能成功也有可能失败)
*/
relate_result: number;
}