import { MatrixClient } from "./MatrixClient"; /** * Represents a profile for a group * @category Unstable APIs */ export interface GroupProfile { /** * The name of the group */ name: string; /** * The avatar for the group. Must be a MSC URI. */ avatar_url: string; /** * The short description for the group. Equivalent to a room's topic. */ short_description: string; /** * The long description for the group. Most clients will support HTML * in this. */ long_description: string; } /** * Unstable APIs that shouldn't be used in most circumstances. * @category Unstable APIs */ export declare class UnstableApis { private client; constructor(client: MatrixClient); /** * Creates a group. * @param {string} localpart The localpart for the group * @return {Promise} Resolves to the created group ID. */ createGroup(localpart: string): Promise; /** * Invites a user to the group. * @param {string} groupId The group ID to invite the user to. * @param {string} userId The user ID to invite to the group. * @return {Promise<"join" | "invite" | "reject">} Resolves to the invite state for * the user. This is normally "invite", but may be "join" or "reject" if the user's * homeserver accepted/rejected the invite right away. */ inviteUserToGroup(groupId: string, userId: string): Promise<"join" | "invite" | "reject">; /** * Kicks a user from a group. * @param {string} groupId The group ID to kick the user from. * @param {string} userId The user ID to kick from the group. * @return {Promise<*>} Resolves when completed. */ kickUserFromGroup(groupId: string, userId: string): Promise; /** * Updates a group's profile * @param {string} groupId The group ID to update. * @param {GroupProfile} profile The profile to update the group with. * @return {Promise<*>} Resolves when completed. */ setGroupProfile(groupId: string, profile: GroupProfile): Promise; /** * Sets a group's join policy to either be publicly joinable (open) or * require an invite (invite). * @param {string} groupId The group ID to set the policy for. * @param {"open" | "invite"} policy The policy to set. * @return {Promise<*>} Resolves when completed. */ setGroupJoinPolicy(groupId: string, policy: "open" | "invite"): Promise; /** * Adds a room to a group. * @param {string} groupId The group ID to add the room to. * @param {string} roomId The room ID to add to the group. * @param {boolean} isPublic Whether this group-room association is visible to non-members. Optional. Defaults to true. * @return {Promise<*>} Resolves when completed. */ addRoomToGroup(groupId: string, roomId: string, isPublic?: boolean): Promise; /** * Updates the visibility of a room in a group. * @param {string} groupId The group ID of the room to update. * @param {string} roomId The room ID of the room to update. * @param {boolean} isPublic Whether this group-room association is visible to non-members. * @return {Promise<*>} Resolves when completed. */ updateGroupRoomVisibility(groupId: string, roomId: string, isPublic: boolean): Promise; /** * Removes a room from a group. * @param {string} groupId The group ID to remove the room from. * @param {string} roomId The room ID to remove from the group. * @return {Promise<*>} Resolves when completed. */ removeRoomFromGroup(groupId: string, roomId: string): Promise; /** * Gets a group's profile. * @param {string} groupId The group ID to fetch the profile of. * @return {Promise} Resolves to the profile of the group. */ getGroupProfile(groupId: string): Promise; /** * Gets the users in a group. * @param {string} groupId The group ID of which to get the users. * @return {Promise<*[]>} Resolves to an array of all the users in the group. */ getGroupUsers(groupId: string): Promise; /** * Gets the invited users of a group. * @param {string} groupId The group ID of which to get the invited users. * @return {Promise<*[]>} Resolves to an array of all the users invited to the group. */ getGroupInvitedUsers(groupId: string): Promise; /** * Gets the rooms of a group. * @param {string} groupId The group ID of which to get all the rooms. * @return {Promise<*[]>} Resolves to an array of all the rooms of the group. */ getGroupRooms(groupId: string): Promise; /** * Accepts an invite to a group. * @param {string} groupId The group ID of which to accept the invite of. * @return {Promise<*>} Resolves when completed. */ acceptGroupInvite(groupId: string): Promise; /** * Joins a group. * @param {string} groupId The group ID to join. * @return {Promise<*>} Resolves when completed. */ joinGroup(groupId: string): Promise; /** * Leaves a group. * @param {string} groupId The group ID of the group to leave. * @return {Promise<*>} Resolves when completed. */ leaveGroup(groupId: string): Promise; /** * Sets the publicity of a group. * @param {string} groupId The group ID to set the publicity of. * @param {boolean} publicise If the group should be publicised. * @return {Promise<*>} Resolves when completed. */ setGroupPublicity(groupId: string, publicise: boolean): Promise; /** * Gets all group IDs joined. * @return {Promise} Resolves to the group IDs of the joined groups. */ getJoinedGroups(): Promise; /** * Gets the group IDs that the specified user has publicised. * @param {string} userId The user ID to fetch the publicised groups of. * @return {Promise} Resolves to the publicised group IDs of that user. */ getPublicisedGroups(userId: string): Promise; /** * Adds a reaction to an event. The contract for this function may change in the future. * @param {string} roomId The room ID to react in * @param {string} eventId The event ID to react against, in the given room * @param {string} emoji The emoji to react with * @returns {Promise} Resolves to the event ID of the reaction */ addReactionToEvent(roomId: string, eventId: string, emoji: string): Promise; }