import type { NativeEventEmitter } from 'react-native'; import type { ChatCircleChannelListener, ChatCircleServerListener } from './ChatEvents'; import { ChatCircleChannel, ChatCircleChannelRank, ChatCircleChannelType } from './common/ChatCircleChannel'; import { ChatCircleServer } from './common/ChatCircleServer'; import { ChatCircleTag } from './common/ChatCircleTag'; import { ChatCircleUser, ChatCircleUserRole } from './common/ChatCircleUser'; import { ChatCursorResult } from './common/ChatCursorResult'; import { BaseManager } from './__internal__/Base'; export declare class ChatCircleManager extends BaseManager { protected static TAG: string; private _serverListeners; private _channelListeners; private _circleSubscriptions; /** * Constructs a circle management object. */ constructor(); /** * Set the listener for event reception. * * @param event The native event emitter. */ setNativeListener(event: NativeEventEmitter): void; /** * Add a circle listener. * * @param listener The circle listener. */ addServerListener(listener: ChatCircleServerListener): void; /** * Remove a circle listener. * * @param listener The circle listener. */ removeServerListener(listener: ChatCircleServerListener): void; /** * Clear all circle listeners. */ clearServerListener(): void; /** * Add a channel listener. * * @param listener The channel listener. */ addChannelListener(listener: ChatCircleChannelListener): void; /** * Remove a channel listener. * * @param listener The channel listener. */ removeChannelListener(listener: ChatCircleChannelListener): void; /** * Clear all channel listeners. */ clearChannelListener(): void; private parseChatServer; private parseChatChannel; /** * Create a server. * * @param params - * - serverName: The server name. * - serverIcon: The server icon url. * - serverDescription: The server description. * - serverExtension: Use custom parameters in string format. * * @returns Created server and throws an exception if it fails. * * @throws A description of the exception. See {@link ChatError}. */ createServer(params: { serverName: string; serverIcon?: string; serverDescription?: string; serverExtension?: string; }): Promise; /** * Destroy a server. * * @param serverId The server ID. * * @throws A description of the exception. See {@link ChatError}. */ destroyServer(serverId: string): Promise; /** * Update a server attribute. * * @param params - * - serverId: The server ID generated when created. * - serverName: The server name. * - serverIcon: The server icon url. * - serverDescription: The server description. * - serverExtension: Use custom parameters in string format. * * @returns Updated server and throws an exception if it fails. * * @throws A description of the exception. See {@link ChatError}. */ updateServer(params: { serverId: string; serverName?: string; serverIcon?: string; serverDescription?: string; serverExtension?: string; }): Promise; /** * Join the specified server. * * @param serverId The server ID. * * @throws A description of the exception. See {@link ChatError}. */ joinServer(serverId: string): Promise; /** * Leave the specified server. * * @param serverId The server ID. * * @throws A description of the exception. See {@link ChatError}. */ leaveServer(serverId: string): Promise; /** * Remove a member from the server. * * @param params - * - serverId: The server ID generated when created. * - userId: The member ID. * * @throws A description of the exception. See {@link ChatError}. */ removeUserFromServer(params: { serverId: string; userId: string; }): Promise; /** * Invite a member to the server. * * @param params - * - serverId: The server ID generated when created. * - userId: The member ID. * - welcome: The welcome greeting. * * @throws A description of the exception. See {@link ChatError}. */ inviteUserToServer(params: { serverId: string; userId: string; welcome?: string; }): Promise; /** * Invitee accept invitation from server. * * @param params - * - serverId: The server ID generated when created. * - inviter: The inviter ID who invited user to join the server. * * @returns The server and throws an exception if it fails. * * @throws A description of the exception. See {@link ChatError}. */ acceptServerInvitation(params: { serverId: string; inviter: string; }): Promise; /** * Invitee decline invitation from server. * * @param params - * - serverId: The server ID generated when created. * - inviter: The inviter ID who invited user to join the server. * * @throws A description of the exception. See {@link ChatError}. */ declineServerInvitation(params: { serverId: string; inviter: string; }): Promise; /** * Add tag list to server. * * @param params - * - serverId: The server ID generated when created. * - serverTags: A list of string tag. * * @returns The server tags and throws an exception if it fails. * * @throws A description of the exception. See {@link ChatError}. */ addTagsToServer(params: { serverId: string; serverTags: string[]; }): Promise; /** * Remove tag list to server. * * @param params - * - serverId: The server ID generated when created. * - serverTagIds: A list of tag ID generated when created. * * @throws A description of the exception. See {@link ChatError}. */ removeTagsFromServer(params: { serverId: string; serverTagIds: string[]; }): Promise; /** * Fetch a list of server tags. * * @param serverId The server ID generated when created. * * @returns The list of server tags and throws an exception if it fails. * * @throws A description of the exception. See {@link ChatError}. */ fetchServerTags(serverId: string): Promise; /** * Change the server member role to moderator. * * @param params - * - serverId: The server ID generated when created. * - userId: The member ID. * * @throws A description of the exception. See {@link ChatError}. */ addModeratorToServer(params: { serverId: string; userId: string; }): Promise; /** * Change the server member role to user. * * @param params - * - serverId: The server ID generated when created. * - userId: The member ID. * * @throws A description of the exception. See {@link ChatError}. */ removeModeratorFromServer(params: { serverId: string; userId: string; }): Promise; /** * Fetch self role for the server. * * @param serverId The server ID generated when created. * * @returns The server role and throws an exception if it fails. * * @throws A description of the exception. See {@link ChatError}. */ fetchSelfServerRole(serverId: string): Promise; /** * Fetch list of joined server. * * @param params - * - cursor: The query cursor, pointing to the starting position of the query. After this parameter is set, the SDK will query from the specified cursor position in the positive order of users joining the community. For the first query, pass in `null` or an empty string, and the SDK will start the query from the earliest joined community. * - pageSize: The maximum amount to expect to fetch each time. The value range is [1,20]. * * @returns The result of server and throws an exception if it fails. * * @throws A description of the exception. See {@link ChatError}. */ fetchJoinedServers(params: { cursor?: string; pageSize?: number; }): Promise>; /** * Fetch server information. * * @param serverId The server ID generated when created. * * @returns The server and throws an exception if it fails. * * @throws A description of the exception. See {@link ChatError}. */ fetchServerDetail(serverId: string): Promise; /** * Fetch list of server with keyword. * * @param keyword Specifies the keyword for the search. * * @returns The server list and throws an exception if it fails. * * @throws A description of the exception. See {@link ChatError}. */ fetchServersWithKeyword(keyword: string): Promise; /** * Fetch list of server members. * * @param params - * - serverId: The server ID generated when created. * - cursor: The query cursor, pointing to the starting position of the query. After this parameter is set, the SDK will query from the specified cursor position in the positive order of users joining the community. For the first query, pass in `null` or an empty string, and the SDK will start the query from the earliest joined community. * - pageSize: The maximum amount to expect to fetch each time. The value range is [1,20]. * * @returns The result of server members and throws an exception if it fails. * * @throws A description of the exception. See {@link ChatError}. */ fetchServerMembers(params: { serverId: string; pageSize: number; cursor: string; }): Promise>; /** * Check if self is in the server. * * @param serverId The server ID generated when created. * * @returns Returns true if it is on the server, otherwise returns false. * * @throws A description of the exception. See {@link ChatError}. */ checkSelfInServer(serverId: string): Promise; /** * Create a channel. * * @param params - * - serverId: The server ID generated when created. * - channelName: The channel name. * - channelDescription: The channel description. * - channelExtension: Use custom parameters in string format. * - channelRank: The channel member max count range. see {@link ChatCircleChannelRank} * - channelType: The channel type. see {@link ChatCircleChannelType} * * @returns The created channel and throws an exception if it fails. * * @throws A description of the exception. See {@link ChatError}. */ createChannel(params: { serverId: string; channelName: string; channelDescription?: string; channelExtension?: string; channelRank?: ChatCircleChannelRank; channelType?: ChatCircleChannelType; }): Promise; /** * Destroy a special channel. * * @param params - * - serverId: The server ID generated when created. * - channelId: The channel ID generated when created. * * @throws A description of the exception. See {@link ChatError}. */ destroyChannel(params: { serverId: string; channelId: string; }): Promise; /** * Update the special channel. * * @param params - * - serverId: The server ID generated when created. * - channelId: The channel ID generated when created. * - channelName: The channel name. * - channelDescription: The channel description. * - channelExtension: Use custom parameters in string format. * - channelRank: The channel member max count range. see {@link ChatCircleChannelRank} * * @returns The updated channel and throws an exception if it fails. * * @throws A description of the exception. See {@link ChatError}. */ updateChannel(params: { serverId: string; channelId: string; channelName?: string; channelDescription?: string; channelExtension?: string; channelRank?: ChatCircleChannelRank; }): Promise; /** * Join a special channel. * * @param params - * - serverId: The server ID generated when created. * - channelId: The channel ID generated when created. * * @returns The joined channel and throws an exception if it fails. * * @throws A description of the exception. See {@link ChatError}. */ joinChannel(params: { serverId: string; channelId: string; }): Promise; /** * Leave a special channel. * * @param params - * - serverId: The server ID generated when created. * - channelId: The channel ID generated when created. * * @throws A description of the exception. See {@link ChatError}. */ leaveChannel(params: { serverId: string; channelId: string; }): Promise; /** * Remove a member from the channel. * * @param params - * - serverId: The server ID generated when created. * - channelId: The channel ID generated when created. * - userId: The member ID. * * @throws A description of the exception. See {@link ChatError}. */ removeUserFromChannel(params: { serverId: string; channelId: string; userId: string; }): Promise; /** * Invite a member to the channel. * * @param params - * - serverId: The server ID generated when created. * - channelId: The channel ID generated when created. * - userId: The member ID. * - welcome: The welcome greeting. * * @throws A description of the exception. See {@link ChatError}. */ inviteUserToChannel(params: { serverId: string; channelId: string; userId: string; welcome?: string; }): Promise; /** * Invitee accept invitation from channel. * * @param params - * - serverId: The server ID generated when created. * - channelId: The channel ID generated when created. * - inviter: The inviter ID who invited user to join the channel. * * @returns The joined channel and throws an exception if it fails. * * @throws A description of the exception. See {@link ChatError}. */ acceptChannelInvitation(params: { serverId: string; channelId: string; inviter: string; }): Promise; /** * Invitee decline invitation from channel. * * @param params - * - serverId: The server ID generated when created. * - channelId: The channel ID generated when created. * - inviter: The inviter ID who invited user to join the channel. * * @throws A description of the exception. See {@link ChatError}. */ declineChannelInvitation(params: { serverId: string; channelId: string; inviter: string; }): Promise; /** * Mute member in the special channel. * * @param params - * - serverId: The server ID generated when created. * - channelId: The channel ID generated when created. * - userId: The member ID. * - duration: The duration. The unit is milliseconds. * * @throws A description of the exception. See {@link ChatError}. */ muteUserInChannel(params: { serverId: string; channelId: string; userId: string; duration: number; }): Promise; /** * Unmute member in the special channel. * * @param params - * - serverId: The server ID generated when created. * - channelId: The channel ID generated when created. * - userId: The member ID. * * @throws A description of the exception. See {@link ChatError}. */ unmuteUserInChannel(params: { serverId: string; channelId: string; userId: string; }): Promise; /** * Fetch the special channel information. * * @param params - * - serverId: The server ID generated when created. * - channelId: The channel ID generated when created. * * @returns The channel and throws an exception if it fails. * * @throws A description of the exception. See {@link ChatError}. */ fetchChannelDetail(params: { serverId: string; channelId: string; }): Promise; /** * Fetch public channel list in the special server. * * @param params - * - serverId: The server ID generated when created. * - cursor: The query cursor, pointing to the starting position of the query. After this parameter is set, the SDK will query from the specified cursor position in the positive order of users joining the community. For the first query, pass in `null` or an empty string, and the SDK will start the query from the earliest joined community. * - pageSize: The maximum amount to expect to fetch each time. The value range is [1,20]. * * @returns The result of channel and throws an exception if it fails. * * @throws A description of the exception. See {@link ChatError}. */ fetchPublicChannelInServer(params: { serverId: string; pageSize: number; cursor: string; }): Promise>; /** * Fetch the channel members. * * @param params - * - serverId: The server ID generated when created. * - channelId: The channel ID generated when created. * - cursor: The query cursor, pointing to the starting position of the query. After this parameter is set, the SDK will query from the specified cursor position in the positive order of users joining the community. For the first query, pass in `null` or an empty string, and the SDK will start the query from the earliest joined community. * - pageSize: The maximum amount to expect to fetch each time. The value range is [1,20]. * * @returns The result of channel members and throws an exception if it fails. * * @throws A description of the exception. See {@link ChatError}. */ fetchChannelMembers(params: { serverId: string; channelId: string; pageSize: number; cursor: string; }): Promise>; /** * Fetch visible private type channels in the special server. * * @param params - * - serverId: The server ID generated when created. * - cursor: The query cursor, pointing to the starting position of the query. After this parameter is set, the SDK will query from the specified cursor position in the positive order of users joining the community. For the first query, pass in `null` or an empty string, and the SDK will start the query from the earliest joined community. * - pageSize: The maximum amount to expect to fetch each time. The value range is [1,20]. * * @returns The result of channel and throws an exception if it fails. * * @throws A description of the exception. See {@link ChatError}. */ fetchVisiblePrivateChannelInServer(params: { serverId: string; pageSize: number; cursor: string; }): Promise>; /** * Check if self is in the channel. * * @param params - * - serverId: The server ID generated when created. * - channelId: The channel ID generated when created. * * @returns Returns true if it is on the channel, otherwise returns false. * * @throws A description of the exception. See {@link ChatError}. */ checkSelfIsInChannel(params: { serverId: string; channelId: string; }): Promise; /** * Fetch the muted members in the special channel. * * @param params - * - serverId: The server ID generated when created. * - channelId: The channel ID generated when created. * * @returns The map of mute members and throws an exception if it fails. * * @throws A description of the exception. See {@link ChatError}. */ fetchChannelMuteUsers(params: { serverId: string; channelId: string; }): Promise>; }