From 74acfb84aa45687681bb16d241e29f497d4e1ba6 Mon Sep 17 00:00:00 2001 From: R Midhun Suresh Date: Tue, 28 Oct 2025 16:36:01 +0530 Subject: [PATCH] Add openRoom to Navigation --- .../src/api/navigation.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packages/element-web-module-api/src/api/navigation.ts b/packages/element-web-module-api/src/api/navigation.ts index f7d60b4263..1d8345c577 100644 --- a/packages/element-web-module-api/src/api/navigation.ts +++ b/packages/element-web-module-api/src/api/navigation.ts @@ -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; }