Maybe make api-extractor happy

This commit is contained in:
David Baker 2025-09-24 16:07:31 +01:00
parent 2cd86f7c3d
commit 9685775528
5 changed files with 61 additions and 2 deletions

View File

@ -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<RoomViewProps>;
}
// @alpha @deprecated (undocumented)
export interface ChatExportCustomisations<ExportFormat, ExportType> {
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<string, unknown>;
@ -270,8 +290,10 @@ export class ModuleLoader {
start(): Promise<void>;
}
// @public
// @alpha
export interface NavigationApi {
// (undocumented)
registerLocationRenderer(path: string, renderer: LocationRenderFunction): void;
toMatrixToLink(link: string, join?: boolean): Promise<void>;
}
@ -297,9 +319,20 @@ export interface RoomListCustomisations<Room> {
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<string, {
[ietfLanguageTag: string]: string;

View File

@ -5,6 +5,10 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE files in the repository root for full details.
*/
/**
* The props that must be passed to a RoomView component.
* @alpha Subject to change.
*/
export interface RoomViewProps {
roomId?: string;
}
@ -13,6 +17,7 @@ export interface RoomViewProps {
* Exposes components that are part of Element Web to allow modules to render them
* as part of their custom components (because they can't import the components from
* Element Web since it would cause a dependency cycle)
* @alpha
*/
export interface BuiltinsApi {
getRoomViewComponent(): React.ComponentType<RoomViewProps>;

View File

@ -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;
}

View File

@ -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;
/**

View File

@ -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 {
/**