/** * The member list, cut into role groups. Offline leaves its role and goes to one group at * the end: the question the list answers is who is around. */ /** * What this needs to know about a member, and no more, structurally. A `status` this does * not recognise counts as present, `undefined` included — that is an old server. */ export interface GroupableMember { nickname?: string | null; role?: string | null; status?: string | null; } /** What this needs to know about a role. `server:details` sends all four. */ export interface GroupableRole { id: string; rank: number; name?: string | null; color?: string | null; } /** * One block of the member list: a heading and the people under it. Generic over the member, * so a caller gets its own type back. `color` is the role's own, or null. */ export interface MemberGroup { key: string; title: string; color: string | null; members: M[]; } /** * The key on the group holding anybody not offline, when the server named no * roles. Exported so a caller styling that group does not spell it again. */ export declare const UNGROUPED_GROUP_KEY = "__ungrouped__"; /** The key on the offline group, which callers draw faded. */ export declare const OFFLINE_GROUP_KEY = "__offline__"; export declare function groupMembersByRole(members: readonly M[], roles: readonly R[]): MemberGroup[];