Add ExtraApi#getVisibleRoomBySpaceKey (#134)

This commit is contained in:
Florian Duros
2025-11-21 15:31:17 +01:00
committed by GitHub
parent 99ee1f95ad
commit 7518d1c068
2 changed files with 12 additions and 0 deletions
@@ -167,6 +167,7 @@ export interface DirectoryCustomisations {
// @alpha
export interface ExtrasApi {
getVisibleRoomBySpaceKey(spaceKey: string, cb: () => string[]): void;
setSpacePanelItem(spaceKey: string, props: SpacePanelItemProps): void;
}
@@ -56,4 +56,15 @@ export interface ExtrasApi {
* @param props - Properties of the item to add.
*/
setSpacePanelItem(spaceKey: string, props: SpacePanelItemProps): void;
/**
* Registers a callback to get the list of visible rooms for a given space.
*
* Element Web will call this callback when checking if a room is displayed for the given space. For example in case of message editing or replying.
* If the space added by the module displays a room view and doesn't provide this callback, Element Web won't be able to determine if a room is visible in that space and will redirect to display the room in its vanilla space/metaspace.
*
* @param spaceKey - The space key to get visible rooms for.
* @param cb - A callback that returns the list of visible room IDs.
*/
getVisibleRoomBySpaceKey(spaceKey: string, cb: () => string[]): void;
}