import type { ChatError } from './ChatError'; /** * The enumeration of group types. */ export declare enum ChatGroupStyle { /** * Private groups where only the the group owner can invite users to join. */ PrivateOnlyOwnerInvite = 0, /** * Private groups where all group members can invite users to join. */ PrivateMemberCanInvite = 1, /** * Public groups where users can join only after receiving an invitation from the group owner(admin) or the joining request being approved by the group owner(admin). */ PublicJoinNeedApproval = 2, /** * Public groups where users can join freely. */ PublicOpenJoin = 3 } /** * The enumeration of group permission types. */ export declare enum ChatGroupPermissionType { /** * Unknown. */ None = -1, /** * The group member. */ Member = 0, /** * The group admin. */ Admin = 1, /** * The group owner. */ Owner = 2 } /** * The group type convert. * * @param params Integer representing group type. * @returns The group type. */ export declare function ChatGroupStyleFromNumber(params: number): ChatGroupStyle; /** * The group permission type convert. * * @param params The group permission type. * @returns String representing group permission type. */ export declare function ChatGroupStyleToString(params: ChatGroupStyle): string; /** * The group permission type convert. * * @param params Integer representing group type. * @returns The group type. */ export declare function ChatGroupPermissionTypeFromNumber(params: number): ChatGroupPermissionType; /** * The group permission type convert. * * @param params The group permission type. * @returns String representing group permission type. */ export declare function ChatGroupPermissionTypeToString(params: ChatGroupPermissionType): string; /** * The class for group message read receipts. */ export declare class ChatGroupMessageAck { /** * The group message ID. */ msg_id: string; /** * The ID of the group message read receipt. */ ack_id: string; /** * The username of the user who sends the read receipt. */ from: string; /** * The number read receipts of group messages. */ count: number; /** * The timestamp of sending read receipts of group messages. */ timestamp: number; /** * The read receipt extension. */ content?: string; constructor(params: { msg_id: string; ack_id: string; from: string; count: number; timestamp: number; ext?: { content: string; }; }); } /** * The ChatGroup class, which contains the information of the chat group. * Call {@link ChatGroupManager#fetchGroupInfoFromServer} method to obtain group information. */ export declare class ChatGroup { /** * The group ID. */ groupId: string; /** * The group name. */ groupName: string; /** * The group description. */ desc: string; /** * The user ID of the group owner. */ owner: string; /** * The content of the group announcement. */ announcement: string; /** * The member count of the group. */ memberCount: number; /** * The member list of the group. */ memberList: Array; /** * The admin list of the group. */ adminList: Array; /** * The block list of the group. */ blockList: Array; /** * The mute list of the group. */ muteList: Array; /** * Whether the group message is blocked. */ messageBlocked: boolean; /** * Whether all members are muted. */ isAllMemberMuted: boolean; /** * The current user's role in group. */ permissionType: ChatGroupPermissionType; /** * The group option. */ private options; /** * Get the maximum number of group members allowed in a group. The parameter is set when the group is created. */ get maxCount(): number; constructor(params: { groupId: string; groupName?: string; desc?: string; owner: string; announcement?: string; memberCount?: number; memberList?: Array; adminList?: Array; blockList?: Array; muteList?: Array; messageBlocked?: boolean; isAllMemberMuted?: boolean; permissionType: number; options?: ChatGroupOptions; }); } /** * The group options to be configured when the chat group is created. */ export declare class ChatGroupOptions { /** * The group style. */ style: ChatGroupStyle; /** * The maximum number of members in a group. */ maxCount: number; /** * Whether you need the approval from the user when adding this user to the chat group. * * Whether you can automatically add a user to the chat group depends on the settings of {ChatGroupOptions#inviteNeedConfirm} and {ChatOptions#autoAcceptGroupInvitation}. */ inviteNeedConfirm: boolean; /** * The group extension field. */ ext?: string; constructor(params: { style?: number; maxCount?: number; inviteNeedConfirm?: boolean; ext?: string; }); } /** * The ChatGroupSharedFile class, which manages the chat group shared files. */ export declare class ChatGroupSharedFile { /** * The shared file ID. */ fileId: string; /** * The shared file name. */ name: string; /** * The username that uploads the shared file. */ owner: string; /** * The Unix timestamp for uploading the shared file, in milliseconds. */ createTime: number; /** * The data length of the shared file, in bytes. */ fileSize: number; constructor(params: { fileId: string; name: string; owner: string; createTime: number; fileSize: number; }); } /** * The ChatGroupInfo class. */ export declare class ChatGroupInfo { /** * The group id. */ groupId: string; /** * The group name. */ groupName: string; constructor(params: { groupId: string; groupName: string; }); } /** * The file status change listener interface. */ export interface ChatGroupFileStatusCallback { /** * The progress of sending or receiving messages. * * @param groupId The group id. * @param filePath The file path. * @param progress The progress value. */ onProgress(groupId: string, filePath: string, progress: number): void; /** * Error message sending or receiving. * * @param groupId The group id. * @param filePath The file path. * @param error A description of the error. See {@link ChatError}. */ onError(groupId: string, filePath: string, error: ChatError): void; /** * The message is sent or received. * * @param groupId The group id. * @param filePath The file path. */ onSuccess(groupId: string, filePath: string): void; }