New interface for adding space panel items

This commit is contained in:
David Baker
2025-09-25 11:57:13 +01:00
parent 9685775528
commit 446830776f
@@ -7,20 +7,31 @@ Please see LICENSE files in the repository root for full details.
import { JSX } from "react"; import { JSX } from "react";
interface SpacePanelItemProps { /**
isPanelCollapsed: boolean; * Any kind of event that can trigger a button
} * @alpha
*/
export type ButtonEvent = React.MouseEvent<Element> | React.KeyboardEvent<Element> | React.FormEvent<Element>;
/** /**
* The type of the function used to render a space panel item. * The type of the function used to render a space panel item.
* @alpha * @alpha
*/ */
export type SpacePanelItemRenderFunction = (props: SpacePanelItemProps) => JSX.Element; export interface SpacePanelItemProps {
spaceKey?: string;
className?: string;
icon?: JSX.Element;
label: string;
contextMenuTooltip?: string;
style?: React.CSSProperties;
//notificationState?: NotificationState;
onClick?(ev?: ButtonEvent): void;
}
/** /**
* API for inserting extra UI into Element Web. * API for inserting extra UI into Element Web.
* @alpha Subject to change. * @alpha Subject to change.
*/ */
export interface ExtrasApi { export interface ExtrasApi {
addSpacePanelItem(renderer: SpacePanelItemRenderFunction): void; addSpacePanelItem(props: SpacePanelItemProps): void;
} }