/** * 编辑器定位信息 */ export interface EditorPosition { editorId: string; pageNum: number; bbox: [number, number, number, number]; element?: HTMLElement; container?: HTMLElement; showConnectionLine?: boolean; strokeColor?: string; strokeWidth?: number; } /** * 连接线配置 */ export interface ConnectionLineConfig { enabled?: boolean; strokeColor?: string; strokeWidth?: number; strokeDasharray?: string; zIndex?: number; enableAnimation?: boolean; animationDuration?: number; cornerRadius?: number; } /** * 连接线管理器 */ export declare class ConnectionLineManager { private editors; private svgElement; private container; private config; private updateTimer; private resizeObserver; constructor(config?: ConnectionLineConfig); /** * 设置容器(连接线将绘制在这个容器内) */ setContainer(container: HTMLElement): void; /** * 创建 SVG 元素用于绘制连接线 */ private createSVG; /** * 注册编辑器位置 */ registerPosition(position: EditorPosition): void; /** * 移除编辑器位置 */ removePosition(editorId: string): void; /** * 清除所有位置 */ clear(): void; /** * 获取元素在视口中的实际位置(考虑滚动和变换) * @param element 文本块元素 * @param targetElement 目标元素(用于计算从哪个边缘开始) * @returns 文本块边缘的位置 */ private getElementViewportPosition; /** * 根据 bbox 和容器计算在视口中的位置 */ private getBboxViewportPosition; /** * 更新连接线 */ private updateLine; /** * 绘制连接线 */ private drawLine; /** * 创建带两个转折点的路径(Z形,两个折点都是直角) * @param x1 起点x坐标 * @param y1 起点y坐标 * @param x2 终点x坐标 * @param y2 终点y坐标 * @returns SVG path 字符串 */ private createTurnPath; /** * 更新配置 */ updateConfig(config: Partial): void; /** * 销毁 */ destroy(): void; } /** * Vue Composable: 使用连接线 */ export declare function useConnectionLine(config?: ConnectionLineConfig): { manager: ConnectionLineManager; setContainer: (container: HTMLElement) => void; registerPosition: (position: EditorPosition) => void; removePosition: (editorId: string) => void; clear: () => void; updateConfig: (newConfig: Partial) => void; };