UNPKG

@asteriskzuo/react-native-easemob

Version:
173 lines (126 loc) 4.95 kB
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } export let ChatGroupStyle; (function (ChatGroupStyle) { ChatGroupStyle[ChatGroupStyle["PrivateOnlyOwnerInvite"] = 0] = "PrivateOnlyOwnerInvite"; ChatGroupStyle[ChatGroupStyle["PrivateMemberCanInvite"] = 1] = "PrivateMemberCanInvite"; ChatGroupStyle[ChatGroupStyle["PublicJoinNeedApproval"] = 2] = "PublicJoinNeedApproval"; ChatGroupStyle[ChatGroupStyle["PublicOpenJoin"] = 3] = "PublicOpenJoin"; })(ChatGroupStyle || (ChatGroupStyle = {})); export let ChatGroupPermissionType; (function (ChatGroupPermissionType) { ChatGroupPermissionType[ChatGroupPermissionType["None"] = -1] = "None"; ChatGroupPermissionType[ChatGroupPermissionType["Member"] = 0] = "Member"; ChatGroupPermissionType[ChatGroupPermissionType["Admin"] = 1] = "Admin"; ChatGroupPermissionType[ChatGroupPermissionType["Owner"] = 2] = "Owner"; })(ChatGroupPermissionType || (ChatGroupPermissionType = {})); export function ChatGroupStyleFromNumber(params) { switch (params) { case 0: return ChatGroupStyle.PrivateOnlyOwnerInvite; case 1: return ChatGroupStyle.PrivateMemberCanInvite; case 2: return ChatGroupStyle.PublicJoinNeedApproval; case 3: return ChatGroupStyle.PublicOpenJoin; default: throw new Error(`not exist this type: ${params}`); } } export function ChatConversationTypeToString(params) { return ChatGroupStyle[params]; } export function ChatGroupPermissionTypeFromNumber(params) { switch (params) { case -1: return ChatGroupPermissionType.None; case 0: return ChatGroupPermissionType.Member; case 1: return ChatGroupPermissionType.Admin; case 2: return ChatGroupPermissionType.Owner; default: throw new Error(`not exist this type: ${params}`); } } export function ChatGroupPermissionTypeToString(params) { return ChatGroupPermissionType[params]; } export class ChatGroupMessageAck { constructor(params) { _defineProperty(this, "msg_id", void 0); _defineProperty(this, "from", void 0); _defineProperty(this, "count", void 0); _defineProperty(this, "timestamp", void 0); _defineProperty(this, "content", void 0); this.msg_id = params.msg_id; this.from = params.from; this.count = params.count; this.timestamp = params.timestamp; if (params.ext) { this.content = params.ext.content; } } } export class ChatGroup { constructor(params) { _defineProperty(this, "groupId", void 0); _defineProperty(this, "name", void 0); _defineProperty(this, "desc", void 0); _defineProperty(this, "owner", void 0); _defineProperty(this, "announcement", void 0); _defineProperty(this, "memberCount", void 0); _defineProperty(this, "memberList", void 0); _defineProperty(this, "adminList", void 0); _defineProperty(this, "blockList", void 0); _defineProperty(this, "muteList", void 0); _defineProperty(this, "noticeEnable", void 0); _defineProperty(this, "messageBlocked", void 0); _defineProperty(this, "isAllMemberMuted", void 0); _defineProperty(this, "options", void 0); _defineProperty(this, "permissionType", void 0); this.groupId = params.groupId; this.name = params.name; this.desc = params.desc; this.owner = params.owner; this.announcement = params.announcement; this.memberCount = params.memberCount; this.memberList = params.memberList; this.adminList = params.adminList; this.blockList = params.blockList; this.muteList = params.muteList; this.noticeEnable = params.noticeEnable; this.messageBlocked = params.messageBlocked; this.isAllMemberMuted = params.isAllMemberMuted; this.options = params.options; this.permissionType = ChatGroupPermissionTypeFromNumber(params.permissionType); } } export class ChatGroupOptions { constructor(params) { _defineProperty(this, "style", void 0); _defineProperty(this, "maxCount", void 0); _defineProperty(this, "inviteNeedConfirm", void 0); _defineProperty(this, "ext", void 0); this.style = ChatGroupStyleFromNumber(params.style); this.maxCount = params.maxCount; this.inviteNeedConfirm = params.inviteNeedConfirm; this.ext = params.ext; } } export class ChatGroupSharedFile { constructor(fileId, name, owner, createTime, fileSize) { _defineProperty(this, "fileId", void 0); _defineProperty(this, "name", void 0); _defineProperty(this, "owner", void 0); _defineProperty(this, "createTime", void 0); _defineProperty(this, "fileSize", void 0); this.fileId = fileId; this.name = name; this.owner = owner; this.createTime = createTime; this.fileSize = fileSize; } } //# sourceMappingURL=ChatGroup.js.map