Merge pull request #113 from element-hq/midhun/multiroom/navigation

Add `openRoom` action to Navigation
This commit is contained in:
R Midhun Suresh
2025-10-28 21:16:39 +05:30
committed by GitHub
2 changed files with 30 additions and 0 deletions
@@ -305,11 +305,18 @@ export class ModuleLoader {
// @public
export interface NavigationApi {
openRoom(roomIdOrAlias: string, opts?: OpenRoomOptions): void;
// @alpha
registerLocationRenderer(path: string, renderer: LocationRenderFunction): void;
toMatrixToLink(link: string, join?: boolean): Promise<void>;
}
// @public
export interface OpenRoomOptions {
autoJoin?: boolean;
viaServers?: string[];
}
// @alpha
export type OriginalMessageComponentProps = {
showUrlPreview?: boolean;
@@ -14,6 +14,22 @@ import { JSX } from "react";
*/
export type LocationRenderFunction = () => JSX.Element;
/**
* The options available for changing the open behaviour.
* @public
*/
export interface OpenRoomOptions {
/**
* The list of servers to join via.
*/
viaServers?: string[];
/**
* Whether to automatically join the room if we are not already in it.
*/
autoJoin?: boolean;
}
/**
* API methods to navigate the application.
* @public
@@ -33,4 +49,11 @@ export interface NavigationApi {
* @alpha
*/
registerLocationRenderer(path: string, renderer: LocationRenderFunction): void;
/**
* Open a room in element-web.
* @param roomIdOrAlias - id/alias of the room to open
* @param opts - Options to control the open action, see {@link OpenRoomOptions}
*/
openRoom(roomIdOrAlias: string, opts?: OpenRoomOptions): void;
}