import type { MutableRefObject } from 'react';
import type { FloorMapEdge, FloorMapEdgeAnchor, FloorMapItemBase, FloorMapMergedItem, FloorMapViewConfig } from '../types';
import { type FloorMapItemPixelRect } from '../utils/edgeRouting';
export interface FloorMapEdgeDrawingState {
    fromInstanceId: string;
    fromAnchor: FloorMapEdgeAnchor;
}
export interface UseFloorMapEdgeEditingParams<T extends FloorMapItemBase> {
    enabled: boolean;
    config: FloorMapViewConfig | null;
    items: T[];
    mergedItems: FloorMapMergedItem[];
    cellSize: number;
    itemUnit: 'cell' | 'pixel';
    itemGap?: number;
    contentOffsetRef: MutableRefObject<{
        x: number;
        y: number;
    }>;
    selectedId: string | null;
    setSelectedId: (id: string | null) => void;
    commitDraft: (updater: FloorMapViewConfig | ((prev: FloorMapViewConfig) => FloorMapViewConfig)) => void;
    /** 画布内容区 DOM，用于 client → 内容坐标 */
    mapContentRef: MutableRefObject<HTMLElement | null>;
    scale?: number;
}
export declare function useFloorMapEdgeEditing<T extends FloorMapItemBase>(params: UseFloorMapEdgeEditingParams<T>): {
    edges: FloorMapEdge[];
    routes: import("../utils/edgeRouting").FloorMapEdgeRoute[];
    rectsById: Map<string, FloorMapItemPixelRect>;
    selectedEdgeId: string | null;
    selectedEdge: FloorMapEdge | null;
    selectedNodeRect: FloorMapItemPixelRect | null;
    drawing: FloorMapEdgeDrawingState | null;
    drawingTargetPreview: {
        instanceId: string;
        rect: FloorMapItemPixelRect;
        anchor: FloorMapEdgeAnchor;
    } | null;
    ghostPathD: string | null;
    selectNode: (id: string | null) => void;
    selectEdge: (edgeId: string | null) => void;
    clearEdgeSelection: () => void;
    startDrawingFromAnchor: (instanceId: string, anchor: FloorMapEdgeAnchor) => void;
    handleEdgeClick: (edgeId: string) => void;
    handleMapBackgroundClick: () => void;
    updateEdge: (edgeId: string, patch: Partial<FloorMapEdge>) => void;
    deleteEdge: (edgeId: string) => void;
    setPendingRectsById: import("react").Dispatch<import("react").SetStateAction<Record<string, Partial<FloorMapItemPixelRect>>>>;
    startDraggingSegment: (params: {
        edgeId: string;
        role: 'first' | 'last' | 'inner';
        segmentIndex: number;
        axis: 'h' | 'v';
        startPosition: number;
        clientX: number;
        clientY: number;
        /** 用于计算 stub 长度上限 */
        segmentLength?: number;
    }) => void;
};
