Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,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;
Expand Down
23 changes: 23 additions & 0 deletions packages/element-web-module-api/src/api/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}