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 9b2234e377..cbe082c791 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 @@ -153,8 +153,7 @@ export interface DirectoryCustomisations { // @alpha export interface ExtrasApi { - // (undocumented) - addSpacePanelItem(renderer: SpacePanelItemRenderFunction): void; + setSpacePanelItem(spaceKey: string, props: SpacePanelItemProps): void; } // @public @@ -328,10 +327,21 @@ export interface RoomViewProps { // @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; +export interface SpacePanelItemProps { + // (undocumented) + className?: string; + // (undocumented) + contextMenuTooltip?: string; + // (undocumented) + icon?: JSX.Element; + // (undocumented) + label: string; + // (undocumented) + onSelected?(): void; + // (undocumented) + style?: React.CSSProperties; +} // @public export type Translations = Record | React.KeyboardEvent | React.FormEvent; - -/** - * The type of the function used to render a space panel item. + * Properties of an item added to the Space panel * @alpha */ export interface SpacePanelItemProps { - spaceKey?: string; className?: string; icon?: JSX.Element; label: string; contextMenuTooltip?: string; style?: React.CSSProperties; //notificationState?: NotificationState; - onClick?(ev?: ButtonEvent): void; + onSelected?(): void; } /** @@ -33,5 +26,12 @@ export interface SpacePanelItemProps { * @alpha Subject to change. */ export interface ExtrasApi { - addSpacePanelItem(props: SpacePanelItemProps): void; + /** + * Inserts an item into the space panel as if it were a space button, below + * buttons for other spaces. + * If called again with the same spaceKey, will update the existing item. + * @param spaceKey - A key to identify this space-like item. + * @param props - Properties of the item to add. + */ + setSpacePanelItem(spaceKey: string, props: SpacePanelItemProps): void; }