Skip to content

Commit 864a2dd

Browse files
committed
Maybe make api-extractor happy
1 parent 38e1082 commit 864a2dd

File tree

5 files changed

+61
-2
lines changed

5 files changed

+61
-2
lines changed

packages/element-web-module-api/element-web-module-api.api.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,26 @@ export interface AliasCustomisations {
3535
//
3636
// @public
3737
export interface Api extends LegacyModuleApiExtension, LegacyCustomisationsApiExtension, DialogApiExtension, AccountAuthApiExtension, ProfileApiExtension {
38+
// @alpha
39+
readonly builtins: BuiltinsApi;
3840
readonly config: ConfigApi;
3941
createRoot(element: Element): Root;
4042
// @alpha
4143
readonly customComponents: CustomComponentsApi;
44+
// @alpha
45+
readonly extras: ExtrasApi;
4246
readonly i18n: I18nApi;
47+
// Warning: (ae-incompatible-release-tags) The symbol "navigation" is marked as @public, but its signature references "NavigationApi" which is marked as @alpha
4348
readonly navigation: NavigationApi;
4449
readonly rootNode: HTMLElement;
4550
}
4651

52+
// @alpha
53+
export interface BuiltinsApi {
54+
// (undocumented)
55+
getRoomViewComponent(): React.ComponentType<RoomViewProps>;
56+
}
57+
4758
// @alpha @deprecated (undocumented)
4859
export interface ChatExportCustomisations<ExportFormat, ExportType> {
4960
getForceChatExportParameters(): {
@@ -140,6 +151,12 @@ export interface DirectoryCustomisations {
140151
requireCanonicalAliasAccessToPublish?(): boolean;
141152
}
142153

154+
// @alpha
155+
export interface ExtrasApi {
156+
// (undocumented)
157+
addSpacePanelItem(renderer: SpacePanelItemRenderFunction): void;
158+
}
159+
143160
// @public
144161
export interface I18nApi {
145162
get language(): string;
@@ -186,6 +203,9 @@ export interface LifecycleCustomisations {
186203
onLoggedOutAndStorageCleared?(): void;
187204
}
188205

206+
// @alpha
207+
export type LocationRenderFunction = () => JSX.Element;
208+
189209
// @alpha
190210
export interface MatrixEvent {
191211
content: Record<string, unknown>;
@@ -270,8 +290,10 @@ export class ModuleLoader {
270290
start(): Promise<void>;
271291
}
272292

273-
// @public
293+
// @alpha
274294
export interface NavigationApi {
295+
// (undocumented)
296+
registerLocationRenderer(path: string, renderer: LocationRenderFunction): void;
275297
toMatrixToLink(link: string, join?: boolean): Promise<void>;
276298
}
277299

@@ -297,9 +319,20 @@ export interface RoomListCustomisations<Room> {
297319
isRoomVisible?(room: Room): boolean;
298320
}
299321

322+
// @alpha
323+
export interface RoomViewProps {
324+
// (undocumented)
325+
roomId?: string;
326+
}
327+
300328
// @alpha @deprecated (undocumented)
301329
export type RuntimeModuleConstructor = new (api: ModuleApi) => RuntimeModule;
302330

331+
// Warning: (ae-forgotten-export) The symbol "SpacePanelItemProps" needs to be exported by the entry point index.d.ts
332+
//
333+
// @alpha
334+
export type SpacePanelItemRenderFunction = (props: SpacePanelItemProps) => JSX.Element;
335+
303336
// @public
304337
export type Translations = Record<string, {
305338
[ietfLanguageTag: string]: string;

packages/element-web-module-api/src/api/builtins.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
55
Please see LICENSE files in the repository root for full details.
66
*/
77

8+
/**
9+
* The props that must be passed to a RoomView component.
10+
* @alpha Subject to change.
11+
*/
812
export interface RoomViewProps {
913
roomId?: string;
1014
}
@@ -13,6 +17,7 @@ export interface RoomViewProps {
1317
* Exposes components that are part of Element Web to allow modules to render them
1418
* as part of their custom components (because they can't import the components from
1519
* Element Web since it would cause a dependency cycle)
20+
* @alpha
1621
*/
1722
export interface BuiltinsApi {
1823
getRoomViewComponent(): React.ComponentType<RoomViewProps>;

packages/element-web-module-api/src/api/extras.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,16 @@ interface SpacePanelItemProps {
1111
isPanelCollapsed: boolean;
1212
}
1313

14+
/**
15+
* The type of the function used to render a space panel item.
16+
* @alpha
17+
*/
1418
export type SpacePanelItemRenderFunction = (props: SpacePanelItemProps) => JSX.Element;
1519

20+
/**
21+
* API for inserting extra UI into Element Web.
22+
* @alpha Subject to change.
23+
*/
1624
export interface ExtrasApi {
1725
addSpacePanelItem(renderer: SpacePanelItemRenderFunction): void;
1826
}

packages/element-web-module-api/src/api/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ export interface Api
105105
*/
106106
readonly customComponents: CustomComponentsApi;
107107

108+
/**
109+
* Allows modules to render components that are part of Element Web.
110+
* @alpha
111+
*/
108112
readonly builtins: BuiltinsApi;
109113

110114
/**
@@ -113,6 +117,10 @@ export interface Api
113117
*/
114118
readonly navigation: NavigationApi;
115119

120+
/**
121+
* Allows modules to insert extra UI into Element Web.
122+
* @alpha
123+
*/
116124
readonly extras: ExtrasApi;
117125

118126
/**

packages/element-web-module-api/src/api/navigation.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ Please see LICENSE files in the repository root for full details.
77

88
import { JSX } from "react";
99

10+
/**
11+
* A function called to render a component when a user navigates to the corresponding
12+
* location. Currently renders alongside just the SpacePanel.
13+
* @alpha
14+
*/
1015
export type LocationRenderFunction = () => JSX.Element;
1116

1217
/**
1318
* API methods to navigate the application.
14-
* @public
19+
* @alpha
1520
*/
1621
export interface NavigationApi {
1722
/**

0 commit comments

Comments
 (0)