matrix-react-sdk
Version:
SDK for matrix.org using React
55 lines (54 loc) • 2.13 kB
TypeScript
import { RoomMember } from "matrix-js-sdk/src/matrix";
import { SdkContextClass } from "../contexts/SDKContext";
/**
* A class for storing application state for MemberList.
*/
export declare class MemberListStore {
private readonly stores;
private readonly sortNames;
private readonly loadedRooms;
private collator?;
constructor(stores: SdkContextClass);
/**
* Load the member list. Call this whenever the list may have changed.
* @param roomId The room to load the member list in
* @param searchQuery Optional search query to filter the list.
* @returns A list of filtered and sorted room members, grouped by membership.
*/
loadMemberList(roomId: string, searchQuery?: string): Promise<Record<"joined" | "invited", RoomMember[]>>;
private loadMembers;
private loadMembersInRoom;
/**
* Check if this room should be lazy loaded. Lazy loading means fetching the member list in
* a delayed or incremental fashion. It means the `Room` object doesn't have all the members.
* @param roomId The room to check if lazy loading is enabled
* @returns True if enabled
*/
private isLazyLoadingEnabled;
/**
* Check if lazy member storage is supported.
* @returns True if there is storage for lazy loading members
*/
private isLazyMemberStorageEnabled;
isPresenceEnabled(): boolean;
/**
* Filter out members based on an optional search query. Groups by membership state.
* @param members The list of members to filter.
* @param query The textual query to filter based on.
* @returns An object with a list of joined and invited users respectively.
*/
private filterMembers;
/**
* Sort algorithm for room members.
* @param memberA
* @param memberB
* @returns Negative if A comes before B, 0 if A and B are equivalent, Positive is A comes after B.
*/
private sortMembers;
/**
* Calculate the canonicalised name for the input name.
* @param name The member display name
* @returns The name to sort on
*/
private canonicalisedName;
}