2025-06-23 09:32:26 +01:00
|
|
|
/*
|
|
|
|
|
Copyright 2025 New Vector Ltd.
|
|
|
|
|
|
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
|
|
|
Please see LICENSE files in the repository root for full details.
|
|
|
|
|
*/
|
|
|
|
|
|
2025-09-24 10:58:41 +01:00
|
|
|
import { JSX } from "react";
|
|
|
|
|
|
2025-09-24 16:07:31 +01:00
|
|
|
/**
|
|
|
|
|
* A function called to render a component when a user navigates to the corresponding
|
|
|
|
|
* location. Currently renders alongside just the SpacePanel.
|
|
|
|
|
* @alpha
|
|
|
|
|
*/
|
2025-09-24 10:58:41 +01:00
|
|
|
export type LocationRenderFunction = () => JSX.Element;
|
|
|
|
|
|
2025-06-23 09:32:26 +01:00
|
|
|
/**
|
|
|
|
|
* API methods to navigate the application.
|
2025-09-24 16:07:31 +01:00
|
|
|
* @alpha
|
2025-06-23 09:32:26 +01:00
|
|
|
*/
|
|
|
|
|
export interface NavigationApi {
|
|
|
|
|
/**
|
|
|
|
|
* Navigate to a permalink, optionally causing a join if the user is not already a member of the room/space.
|
|
|
|
|
* @param link - The permalink to navigate to, e.g. `https://matrix.to/#/!roomId:example.com`.
|
|
|
|
|
* @param join - If true, the user will be made to attempt to join the room/space if they are not already a member.
|
|
|
|
|
*/
|
|
|
|
|
toMatrixToLink(link: string, join?: boolean): Promise<void>;
|
2025-09-24 10:58:41 +01:00
|
|
|
|
|
|
|
|
registerLocationRenderer(path: string, renderer: LocationRenderFunction): void;
|
2025-06-23 09:32:26 +01:00
|
|
|
}
|