New interface for adding space panel items
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user