import { Ref } from 'react';
import { DataCell, DataNode, DataObj, DataTree } from '../../types/data-structures';
export interface ToolbarProps {
    /**
     * Toolbar data passing
     */
    data?: DataTree;
    /**
     * Optional ref assign to wrapper div
     */
    ref?: Ref<HTMLDivElement | null>;
    /**
     * Auto select the first item when loading the toolbar initial data
     * and the number of items is one
     */
    autoSelect?: boolean;
    /**
     * Callback to let the parent component decide what to do
     * when the user clicks outside of the toolbar
     */
    onToolbarClickOutside?: ToolbarClickOutsideHandler;
    /**
     * Handlers for toolbar interaction
     * - Leaf node click
     * - Dynamic node children loading
     * - Load the initial data with a callback
     *   without the need of the data-prop
     */
    onToolbarLeafNodeClick?: ToolbarLeafClickHandler;
    onToolbarLoadNodeData?: ToolbarLoadNodeHandler;
    onToolbarLoadInitialData?: ToolbarInitialDataLoadHandler;
    /**
     * Callback for then the user closes the toolbar with esc or ArrowLeft
     */
    onToolbarClose?: () => void;
}
/**
 * Reusable Toolbar callbacks types
 */
export type ToolbarLeafClickHandler = (node: DataNode) => void;
export type ToolbarLoadNodeHandler = (node: DataNode) => Promise<DataTree>;
export type ToolbarInitialDataLoadHandler = () => Promise<DataTree>;
export type ToolbarClickOutsideHandler = () => void;
export type ContextualToolbarInitialDataLoadHandler = (id: string, obj: DataObj, keyCombo?: string) => Promise<DataTree>;
/**
 * Toolbar nodes id prefix
 */
export declare const TOOLBAR_PREFIX = "smp-toolbar";
/**
 * Custom toolbar DataTree extension
 */
export interface ToolbarDataTree extends DataTree {
    children?: ToolbarDataNode[];
}
/**
 * Custom toolbar DataNode extension to allow state
 */
export interface ToolbarDataNode extends DataNode {
    children?: ToolbarDataNode[];
    isLoading?: boolean;
    isExpanded?: boolean;
}
/**
 * Managed keys in toolbar navigation
 */
export declare const ToolbarKeysToHandle: string[];
/**
 * Interface for all toolbar node handlers
 */
export interface ToolbarNodeHandlers {
    handleKeyDown: (e: React.KeyboardEvent, node: ToolbarDataNode, nodeId: string) => void;
    handleNodeExpand: (node: ToolbarDataNode, nodeId: string) => void;
    handleMouseLeave: (nodeId: string) => void;
}
/**
 * Interface for toolbar node render functions
 */
export interface ToolbarNodeRenderers {
    renderToolbarNodes: (level: number, nodes: ToolbarDataNode[], parentId?: string | null) => React.ReactNode;
}
/**
 * ToolbarPlainNode props main interface
 */
export interface ToolbarPlainNodeProps extends ToolbarNodeHandlers, ToolbarNodeRenderers {
    node: ToolbarDataNode;
    index: number;
    level: number;
    parentId: string | null;
    toolbarNodesRefs: React.RefObject<Map<string, HTMLDivElement>>;
    onToolbarLeafNodeClick?: (node: ToolbarDataNode) => void;
}
/**
 * ToolbarRadioNode props main interface
 */
export interface ToolbarRadioNodeProps extends ToolbarNodeHandlers, ToolbarNodeRenderers {
    node: ToolbarDataNode;
    index: number;
    level: number;
    parentId: string | null;
    toolbarNodesRefs: React.RefObject<Map<string, HTMLDivElement>>;
    onToolbarRadioLeafNodeClick: (node: ToolbarDataNode, nodeId: string, selectedOption: DataCell) => void;
}
//# sourceMappingURL=toolbar-types.d.ts.map