Tweak api so it can be called multiple times
to update the space item's properties.
This commit is contained in:
@@ -153,8 +153,7 @@ export interface DirectoryCustomisations {
|
|||||||
|
|
||||||
// @alpha
|
// @alpha
|
||||||
export interface ExtrasApi {
|
export interface ExtrasApi {
|
||||||
// (undocumented)
|
setSpacePanelItem(spaceKey: string, props: SpacePanelItemProps): void;
|
||||||
addSpacePanelItem(renderer: SpacePanelItemRenderFunction): void;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @public
|
// @public
|
||||||
@@ -328,10 +327,21 @@ export interface RoomViewProps {
|
|||||||
// @alpha @deprecated (undocumented)
|
// @alpha @deprecated (undocumented)
|
||||||
export type RuntimeModuleConstructor = new (api: ModuleApi) => RuntimeModule;
|
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
|
// @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
|
// @public
|
||||||
export type Translations = Record<string, {
|
export type Translations = Record<string, {
|
||||||
|
|||||||
@@ -8,24 +8,17 @@ Please see LICENSE files in the repository root for full details.
|
|||||||
import { JSX } from "react";
|
import { JSX } from "react";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Any kind of event that can trigger a button
|
* Properties of an item added to the Space panel
|
||||||
* @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.
|
|
||||||
* @alpha
|
* @alpha
|
||||||
*/
|
*/
|
||||||
export interface SpacePanelItemProps {
|
export interface SpacePanelItemProps {
|
||||||
spaceKey?: string;
|
|
||||||
className?: string;
|
className?: string;
|
||||||
icon?: JSX.Element;
|
icon?: JSX.Element;
|
||||||
label: string;
|
label: string;
|
||||||
contextMenuTooltip?: string;
|
contextMenuTooltip?: string;
|
||||||
style?: React.CSSProperties;
|
style?: React.CSSProperties;
|
||||||
//notificationState?: NotificationState;
|
//notificationState?: NotificationState;
|
||||||
onClick?(ev?: ButtonEvent): void;
|
onSelected?(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,5 +26,12 @@ export interface SpacePanelItemProps {
|
|||||||
* @alpha Subject to change.
|
* @alpha Subject to change.
|
||||||
*/
|
*/
|
||||||
export interface ExtrasApi {
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user