import * as React from "react";
import { ItemConfigType } from "../types";
import { Workbench } from "../workbench";
export declare function createItemConfigurationFromProps(props: IModuleProps): (() => ItemConfigType);
/**
* Props of a single module component in a module drawer.
*/
export interface IModuleProps {
/**
* The React component to show as a badge on the icon. Typically, this
* prop should be a `` component, but it may be anything else
* as long as it is absolutely positioned in CSS, assuming that its parent
* is a container that contains the icon as well.
*
* CSS effects applied to the icon in disabled state will not affect the
* badge itself.
*/
badge?: React.ReactNode;
/**
* The React component to show in the new item that will be created when the
* module is dropped on the workbench. Note that itemConfiguration
* takes precedence over this prop if both are given.
*/
component?: React.ComponentType;
/**
* Whether the module component is disabled. A disabled component cannot be
* dragged out of its drawer.
*/
disabled?: boolean;
/**
* Whether the module should produce a component that is eagerly mounted,
* i.e. that mounts itself to the DOM tree even if it is in the background
* in some tab stack.
*/
eager?: boolean;
/**
* An optional icon for the module.
*/
icon?: React.ReactNode;
/**
* A unique identifier for the module. When given, and the layout already
* contains a module with the same ID, the module component in the module
* drawer will be disabled.
*/
id?: string;
/**
* Configuration object of the new item that will be created when the module
* is dropped on the workbench. Can be omitted; in this case, the Configuration
* object will be derived from component and props.
*/
itemConfiguration?: ItemConfigType | (() => ItemConfigType);
/**
* The label of the module.
*/
label: React.ReactNode;
/**
* Callback function to call when the user clicked on the module.
*/
onClick?: (event?: React.SyntheticEvent) => void;
/**
* Callback function to call when the module has been torn out of its drawer
* by the user.
*/
onStartDrag?: () => void;
/**
* The props of the new item that will be created when the module is dropped
* on the workbench. Note that itemConfiguration takes precedence
* over this prop if both are given.
*/
props?: any;
/**
* Whether the item can be reordered on the workbench by dragging it around.
*/
reorderEnabled?: boolean;
/**
* The title of the panel that is created for the module, or a function that
* returns the title when invoked with no arguments. When omitted, it defaults
* to the label of the module when the label is a string.
*/
title?: string | (() => string);
/**
* The workbench that the module can be dragged into.
*/
workbench?: Workbench;
}
export declare class Module extends React.Component {
private _dragSource?;
private _rootNode;
private _workbench;
constructor(props: IModuleProps);
componentDidMount(): void;
componentDidUpdate(oldProps: IModuleProps): void;
componentWillUnmount(): void;
render(): React.ReactElement;
private _onClick;
private _onWorkbenchLayoutChanged;
private _setRootNode;
private _setWorkbench;
private _updateDragSourceForProps;
private _removeDragSourceFromWorkbench;
}