Skip to content

Commit 6ea5e96

Browse files
committed
Add openRoom to Navigation
1 parent 39d670d commit 6ea5e96

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

packages/element-web-module-api/src/api/navigation.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@ import { JSX } from "react";
1414
*/
1515
export type LocationRenderFunction = () => JSX.Element;
1616

17+
/**
18+
* The options available for changing the open behaviour.
19+
* @public
20+
*/
21+
export interface OpenRoomOptions {
22+
/**
23+
* The list of servers to join via.
24+
*/
25+
viaServers?: string[];
26+
27+
/**
28+
* Whether to automatically join the room if we are not already in it.
29+
*/
30+
autoJoin?: boolean;
31+
}
32+
1733
/**
1834
* API methods to navigate the application.
1935
* @public
@@ -33,4 +49,11 @@ export interface NavigationApi {
3349
* @alpha
3450
*/
3551
registerLocationRenderer(path: string, renderer: LocationRenderFunction): void;
52+
53+
/**
54+
* Open a room in element-web.
55+
* @param roomIdOrAlias - id/alias of the room to open
56+
* @param opts - Options to control the open action, see {@link OpenRoomOptions}
57+
*/
58+
openRoom(roomIdOrAlias: string, opts?: OpenRoomOptions): void;
3659
}

0 commit comments

Comments
 (0)