File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
packages/element-web-module-api Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -305,11 +305,18 @@ export class ModuleLoader {
305305
306306// @public
307307export interface NavigationApi {
308+ openRoom(roomIdOrAlias : string , opts ? : OpenRoomOptions ): void ;
308309 // @alpha
309310 registerLocationRenderer(path : string , renderer : LocationRenderFunction ): void ;
310311 toMatrixToLink(link : string , join ? : boolean ): Promise <void >;
311312}
312313
314+ // @public
315+ export interface OpenRoomOptions {
316+ autoJoin? : boolean ;
317+ viaServers? : string [];
318+ }
319+
313320// @alpha
314321export type OriginalMessageComponentProps = {
315322 showUrlPreview? : boolean ;
Original file line number Diff line number Diff line change @@ -14,6 +14,22 @@ import { JSX } from "react";
1414 */
1515export 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}
You can’t perform that action at this time.
0 commit comments