matrix-react-sdk
Version:
SDK for matrix.org using React
65 lines (64 loc) • 2.94 kB
TypeScript
import { ListIteratee, Many } from "lodash";
import { Room } from "matrix-js-sdk/src/models/room";
import { AsyncStoreWithClient } from "./AsyncStoreWithClient";
import { ActionPayload } from "../dispatcher/payloads";
import { SpaceNotificationState } from "./notifications/SpaceNotificationState";
import { ISpaceSummaryEvent, ISpaceSummaryRoom } from "../components/structures/SpaceRoomDirectory";
interface IState {
}
export declare const SUGGESTED_ROOMS: unique symbol;
export declare const UPDATE_TOP_LEVEL_SPACES: unique symbol;
export declare const UPDATE_INVITED_SPACES: unique symbol;
export declare const UPDATE_SELECTED_SPACE: unique symbol;
export declare const getOrder: (order: string, creationTs: number, roomId: string) => Array<Many<ListIteratee<any>>>;
export declare class SpaceStoreClass extends AsyncStoreWithClient<IState> {
constructor();
private rootSpaces;
private parentMap;
private notificationStateMap;
private spaceFilteredRooms;
private _activeSpace?;
private _suggestedRooms;
private _invitedSpaces;
get invitedSpaces(): Room[];
get spacePanelSpaces(): Room[];
get activeSpace(): Room | null;
get suggestedRooms(): ISpaceSummaryRoom[];
/**
* Sets the active space, updates room list filters,
* optionally switches the user's room back to where they were when they last viewed that space.
* @param space which space to switch to.
* @param contextSwitch whether to switch the user's context,
* should not be done when the space switch is done implicitly due to another event like switching room.
*/
setActiveSpace(space: Room | null, contextSwitch?: boolean): Promise<void>;
fetchSuggestedRooms: (space: any, limit?: number) => Promise<{
rooms: ISpaceSummaryRoom[];
events: ISpaceSummaryEvent[];
}>;
addRoomToSpace(space: Room, roomId: string, via: string[], suggested?: boolean, autoJoin?: boolean): any;
private getChildren;
getChildRooms(spaceId: string): Room[];
getChildSpaces(spaceId: string): Room[];
getParents(roomId: string, canonicalOnly?: boolean): Room[];
getCanonicalParent(roomId: string): Room | null;
getSpaceFilteredRoomIds: (space: Room | null) => Set<string>;
private rebuild;
onSpaceUpdate: () => void;
private onSpaceMembersChange;
private onRoomsUpdate;
private switchToRelatedSpace;
private onRoom;
private onRoomState;
protected reset(): Promise<void>;
protected onNotReady(): Promise<void>;
protected onReady(): Promise<void>;
protected onAction(payload: ActionPayload): Promise<void>;
getNotificationState(key: string): SpaceNotificationState;
traverseSpace(spaceId: string, fn: (roomId: string) => void, includeRooms?: boolean, parentPath?: Set<string>): void;
}
export default class SpaceStore {
private static internalInstance;
static get instance(): SpaceStoreClass;
}
export {};