diff --git a/packages/element-web-module-api/element-web-module-api.api.md b/packages/element-web-module-api/element-web-module-api.api.md index 56fa2bb06b..9b2234e377 100644 --- a/packages/element-web-module-api/element-web-module-api.api.md +++ b/packages/element-web-module-api/element-web-module-api.api.md @@ -35,15 +35,26 @@ export interface AliasCustomisations { // // @public export interface Api extends LegacyModuleApiExtension, LegacyCustomisationsApiExtension, DialogApiExtension, AccountAuthApiExtension, ProfileApiExtension { + // @alpha + readonly builtins: BuiltinsApi; readonly config: ConfigApi; createRoot(element: Element): Root; // @alpha readonly customComponents: CustomComponentsApi; + // @alpha + readonly extras: ExtrasApi; readonly i18n: I18nApi; + // Warning: (ae-incompatible-release-tags) The symbol "navigation" is marked as @public, but its signature references "NavigationApi" which is marked as @alpha readonly navigation: NavigationApi; readonly rootNode: HTMLElement; } +// @alpha +export interface BuiltinsApi { + // (undocumented) + getRoomViewComponent(): React.ComponentType; +} + // @alpha @deprecated (undocumented) export interface ChatExportCustomisations { getForceChatExportParameters(): { @@ -140,6 +151,12 @@ export interface DirectoryCustomisations { requireCanonicalAliasAccessToPublish?(): boolean; } +// @alpha +export interface ExtrasApi { + // (undocumented) + addSpacePanelItem(renderer: SpacePanelItemRenderFunction): void; +} + // @public export interface I18nApi { get language(): string; @@ -186,6 +203,9 @@ export interface LifecycleCustomisations { onLoggedOutAndStorageCleared?(): void; } +// @alpha +export type LocationRenderFunction = () => JSX.Element; + // @alpha export interface MatrixEvent { content: Record; @@ -270,8 +290,10 @@ export class ModuleLoader { start(): Promise; } -// @public +// @alpha export interface NavigationApi { + // (undocumented) + registerLocationRenderer(path: string, renderer: LocationRenderFunction): void; toMatrixToLink(link: string, join?: boolean): Promise; } @@ -297,9 +319,20 @@ export interface RoomListCustomisations { isRoomVisible?(room: Room): boolean; } +// @alpha +export interface RoomViewProps { + // (undocumented) + roomId?: string; +} + // @alpha @deprecated (undocumented) export type RuntimeModuleConstructor = new (api: ModuleApi) => RuntimeModule; +// Warning: (ae-forgotten-export) The symbol "SpacePanelItemProps" needs to be exported by the entry point index.d.ts +// +// @alpha +export type SpacePanelItemRenderFunction = (props: SpacePanelItemProps) => JSX.Element; + // @public export type Translations = Record; diff --git a/packages/element-web-module-api/src/api/extras.ts b/packages/element-web-module-api/src/api/extras.ts index c4ad313b5f..da29a61ac3 100644 --- a/packages/element-web-module-api/src/api/extras.ts +++ b/packages/element-web-module-api/src/api/extras.ts @@ -11,8 +11,16 @@ interface SpacePanelItemProps { isPanelCollapsed: boolean; } +/** + * The type of the function used to render a space panel item. + * @alpha + */ export type SpacePanelItemRenderFunction = (props: SpacePanelItemProps) => JSX.Element; +/** + * API for inserting extra UI into Element Web. + * @alpha Subject to change. + */ export interface ExtrasApi { addSpacePanelItem(renderer: SpacePanelItemRenderFunction): void; } diff --git a/packages/element-web-module-api/src/api/index.ts b/packages/element-web-module-api/src/api/index.ts index 9ad4fc614f..dacc7501be 100644 --- a/packages/element-web-module-api/src/api/index.ts +++ b/packages/element-web-module-api/src/api/index.ts @@ -105,6 +105,10 @@ export interface Api */ readonly customComponents: CustomComponentsApi; + /** + * Allows modules to render components that are part of Element Web. + * @alpha + */ readonly builtins: BuiltinsApi; /** @@ -113,6 +117,10 @@ export interface Api */ readonly navigation: NavigationApi; + /** + * Allows modules to insert extra UI into Element Web. + * @alpha + */ readonly extras: ExtrasApi; /** diff --git a/packages/element-web-module-api/src/api/navigation.ts b/packages/element-web-module-api/src/api/navigation.ts index 063b683445..e5bef01287 100644 --- a/packages/element-web-module-api/src/api/navigation.ts +++ b/packages/element-web-module-api/src/api/navigation.ts @@ -7,11 +7,16 @@ Please see LICENSE files in the repository root for full details. import { JSX } from "react"; +/** + * A function called to render a component when a user navigates to the corresponding + * location. Currently renders alongside just the SpacePanel. + * @alpha + */ export type LocationRenderFunction = () => JSX.Element; /** * API methods to navigate the application. - * @public + * @alpha */ export interface NavigationApi { /**