import { HierarchyPointNode } from 'd3-hierarchy';
import { DataTree, DataNode, DataColumn } from '../../types/data-structures';
import { Point } from './utils/geometry-utils';
export type { DataTree, DataNode, DataColumn };
/**
 * Props for MindMap component
 */
export interface MindMapProps {
    /** Tree data in enterprise JSON format */
    data: DataTree;
    /** Width of the component (default: 100%) */
    width?: number | string;
    /** Height of the component (default: 600px) */
    height?: number | string;
    /** Callback when a node is clicked */
    onNodeClick?: (node: DataNode) => void;
    /** Callback when a node is expanded/collapsed */
    onNodeExpand?: (node: DataNode) => void;
    /** Callback when a node is right-clicked */
    onNodeContextMenu?: (node: DataNode, event: React.MouseEvent, cellInfo?: unknown) => void;
    /** Callback when an error occurs */
    onError?: (error: MindMapError) => void;
    /** Callback when rendering is complete */
    onRenderComplete?: () => void;
    /** Custom CSS class name */
    className?: string;
    /** ID of the currently selected node (controlled mode) */
    selectedNodeId?: string;
    /** Callback when selection changes */
    onSelectionChange?: (node: DataNode | null) => void;
    /**
     * Whether to expand all nodes by default on initial render.
     * If true, all nodes are expanded.
     * If false (default), only the root is expanded (or as per previous logic).
     */
    defaultExpanded?: boolean;
    /**
     * Layout mode for the mind map
     * @default 'radial'
     */
    layoutMode?: 'radial' | 'vertical';
    /** Enable zooming (default: true) */
    enableZoom?: boolean;
    /** Enable panning (default: true) */
    enablePan?: boolean;
    /**
     * Enable automatic fitting of the graph to viewport on mount/data change.
     * When true, triggers autofit once on initial load.
     * @default false
     */
    autofitOnLoad?: boolean;
}
/**
 * Imperative handle interface for MindMap component
 * Exposed via ref forwarding for programmatic control
 */
export interface MindMapHandle {
    /**
     * Triggers automatic fitting of the graph to the current viewport.
     * Calculates optimal scale and translation to fit all nodes within visible area.
     */
    triggerAutofit: () => void;
}
/**
 * Error object for tree operations
 */
export interface MindMapError {
    code: string;
    message: string;
    details?: unknown;
}
/**
 * Props for MindMapNode component
 */
export interface MindMapNodeProps {
    /** Node data */
    node: DataNode;
    /** Columns definition for rendering */
    columns: DataColumn[];
    /** Current depth level (0-indexed) */
    depth: number;
    /** Callback when node is clicked */
    onClick?: (node: DataNode) => void;
    /** Callback when node is right-clicked */
    onContextMenu?: (node: DataNode, event: React.MouseEvent, cellInfo?: unknown) => void;
    /** Whether node is currently focused */
    isFocused?: boolean;
    /** Whether node is currently selected */
    isSelected?: boolean;
}
export type { Point };
/**
 * Configuration for radial layout
 */
export interface LayoutConfig {
    /** Width of the drawing area */
    width: number;
    /** Height of the drawing area */
    height: number;
    /** Radius of the tree */
    radius?: number;
    /** Separation factor between nodes */
    separation?: (a: HierarchyPointNode<DataNode>, b: HierarchyPointNode<DataNode>) => number;
    /** Number of visible columns in the data (for calculating node height) */
    columnCount?: number;
}
/**
 * Node with layout coordinates
 */
export interface LayoutNode extends DataNode {
    /** Unique identifier for layout purposes (internal) */
    id: string;
    /** X coordinate (cartesian) */
    x: number;
    /** Y coordinate (cartesian) */
    y: number;
    /** Depth in the tree */
    depth: number;
    /** Parent node (optional) */
    parent?: LayoutNode;
    /** Whether the node is currently exiting during animation */
    isExiting?: boolean;
}
/**
 * Represents a connection line between two nodes in the layout
 */
export interface Link {
    /** Unique identifier for the link */
    id: string;
    /** Source node (parent) */
    source: LayoutNode;
    /** Target node (child) */
    target: LayoutNode;
}
/**
 * Strategy interface for Layout Engines
 */
export interface MindMapLayoutStrategy {
    /**
     * Calculates the layout for the given data
     * @param data Root data node
     * @param config Layout configuration
     * @returns Object containing calculated nodes and links
     */
    calculate: (data: DataNode, config: LayoutConfig) => {
        nodes: LayoutNode[];
        links: Link[];
    };
}
//# sourceMappingURL=mind-map-types.d.ts.map