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 { 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; scale?: number; } export declare function useFloorMapEdgeEditing(params: UseFloorMapEdgeEditingParams): { edges: FloorMapEdge[]; routes: import("../utils/edgeRouting").FloorMapEdgeRoute[]; rectsById: Map; 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) => void; deleteEdge: (edgeId: string) => void; setPendingRectsById: import("react").Dispatch>>>; startDraggingSegment: (params: { edgeId: string; role: 'first' | 'last' | 'inner'; segmentIndex: number; axis: 'h' | 'v'; startPosition: number; clientX: number; clientY: number; /** 用于计算 stub 长度上限 */ segmentLength?: number; }) => void; };