matrix-react-sdk
Version:
SDK for matrix.org using React
30 lines (29 loc) • 1.1 kB
TypeScript
import { Room } from "matrix-js-sdk/src/models/room";
/**
* Approximation of a membership status for a given room.
*/
export declare enum EffectiveMembership {
/**
* The user is effectively joined to the room. For example, actually joined
* or knocking on the room (when that becomes possible).
*/
Join = "JOIN",
/**
* The user is effectively invited to the room. Currently this is a direct map
* to the invite membership as no other membership states are effectively
* invites.
*/
Invite = "INVITE",
/**
* The user is effectively no longer in the room. For example, kicked,
* banned, or voluntarily left.
*/
Leave = "LEAVE"
}
export interface MembershipSplit {
[state: EffectiveMembership]: Room[];
}
export declare function splitRoomsByMembership(rooms: Room[]): MembershipSplit;
export declare function getEffectiveMembership(membership: string): EffectiveMembership;
export declare function isJoinedOrNearlyJoined(membership: string): boolean;
export declare function leaveRoomBehaviour(roomId: string): Promise<void>;