import { LayoutNode } from '../mind-map-types';
import { NodeDimension } from '../hooks/useMindMapNodeDimensions';
/**
 * Represents the bounding box of a graph with all necessary coordinates
 * for viewport fitting calculations.
 */
export interface GraphBounds {
    /** Minimum X coordinate (left edge with padding) */
    minX: number;
    /** Minimum Y coordinate (top edge with padding) */
    minY: number;
    /** Maximum X coordinate (right edge with padding) */
    maxX: number;
    /** Maximum Y coordinate (bottom edge with padding) */
    maxY: number;
    /** Total width of the bounding box */
    width: number;
    /** Total height of the bounding box */
    height: number;
    /** Center X coordinate */
    centerX: number;
    /** Center Y coordinate */
    centerY: number;
}
/**
 * Calculates the total bounding box of all rendered nodes in the graph.
 *
 * This function iterates through all nodes and computes the minimum rectangle
 * that contains all nodes, including their full dimensions. It also applies
 * a configurable padding around the calculated bounds.
 *
 * @param nodes Array of layout nodes with positions (x, y) representing centers
 * @param nodeWidth Uniform width of all nodes (fallback if nodeDimensions not provided)
 * @param nodeHeight Uniform height of all nodes (fallback if nodeDimensions not provided)
 * @param padding Padding to add around the bounding box (default: 20)
 * @param nodeDimensions Optional map of actual measured node dimensions (nodeId -> {width, height})
 * @returns GraphBounds object with all coordinates, or null if nodes array is empty
 *
 * @example
 * ```typescript
 * const bounds = calculateGraphBounds(layoutNodes, 200, 100, 20, nodeDimensions);
 * if (bounds) {
 *   console.log(`Graph extends from (${bounds.minX}, ${bounds.minY}) to (${bounds.maxX}, ${bounds.maxY})`);
 * }
 * ```
 */
export declare function calculateGraphBounds(nodes: LayoutNode[], nodeWidth: number, nodeHeight: number, padding?: number, nodeDimensions?: Map<string, NodeDimension>): GraphBounds | null;
/**
 * Represents a viewport transform for fitting a graph.
 */
export interface FitTransform {
    /** Scale factor to apply to the graph */
    scale: number;
    /** X translation to center the graph in viewport */
    translateX: number;
    /** Y translation to center the graph in viewport */
    translateY: number;
}
/**
 * Calculates the optimal transform to fit a graph's bounding box into a viewport.
 *
 * This function computes the scale and translation needed to fit the entire graph
 * within the available viewport space while maintaining aspect ratio and applying
 * a safety padding to prevent nodes from touching viewport edges.
 *
 * @param bounds The bounding box of the graph (from calculateGraphBounds)
 * @param viewportWidth Width of the viewport in pixels
 * @param viewportHeight Height of the viewport in pixels
 * @param safePadding Padding to maintain around the graph within viewport (default: 20)
 * @returns FitTransform object with scale and translation, or null if bounds is null or viewport is invalid
 *
 * @example
 * ```typescript
 * const bounds = calculateGraphBounds(nodes, nodeWidth, nodeHeight);
 * if (bounds) {
 *   const transform = calculateFitTransform(bounds, 1000, 800);
 *   if (transform) {
 *     // Apply transform to D3 Zoom or viewport
 *     d3Zoom.transform(selection, d3.zoomIdentity
 *       .translate(transform.translateX, transform.translateY)
 *       .scale(transform.scale)
 *     );
 *   }
 * }
 * ```
 */
export declare function calculateFitTransform(bounds: GraphBounds | null, viewportWidth: number, viewportHeight: number, safePadding?: number): FitTransform | null;
//# sourceMappingURL=graph-utils.d.ts.map