import * as React from "react"; import { Workbench } from "../workbench"; /** * Props of a module tray component. */ export interface IModuleTrayProps { allowMultipleSelection?: boolean; children?: React.ReactNode; onChange?: (id: string, open: boolean) => void; openDrawers?: string[]; style?: React.CSSProperties; vertical?: boolean; workbench: Workbench; } /** * State of a module tray component. */ export interface IModuleTrayState { openDrawers: string[]; visibleIds: string[]; } /** * A module tray that holds multiple module drawers, each of which can be * opened in order to reveal a set of draggable placeholders that can be used * to place new components in a workbench. */ export declare class ModuleTray extends React.Component { private _visibleIds; private _workbench; static getDerivedStateFromProps(props: IModuleTrayProps): { openDrawers: string[]; } | null; constructor(props: IModuleTrayProps); componentDidMount(): void; componentDidUpdate(): void; componentWillUnmount(): void; render(): React.JSX.Element; /** * Finds a place for a new item in the workbench if the user decides to * click on a module in the tray instead of dragging it to the workbench. */ private _addNewItemToWorkbench; /** * Commits the list of item IDs visible in the workbench to the state of * this component from the corresponding local variable. */ private _commitVisibleIdsToState; /** * Returns whether the tray is controlled. */ private _isControlled; /** * Returns whether the module with the given props is not visible in * the workbench corresponding to the tray. */ private _isModuleNotVisible; /** * Sets the Workbench object associated to the module drawer. * * Also takes care of registering or deregistering all the event handlers * that the ModuleTray instance might be interested in. */ private _setWorkbench; private _onDrawerOpened; private _onDrawerClosed; private _onItemCreated; private _onItemDestroyed; private _onItemDropped; /** * Updates the list of visible IDs by scanning the workbench. * * Note that this only updates the _visibleIds private variable but it does * not commit it ot the state yet. */ private _updateVisibleIds; }