import { Point } from './types'; export type Side = 'left' | 'right' | 'top' | 'bottom'; /** 핸들 측면이 가리키는 "바깥" 단위 방향 (진출/진입 stub 방향) */ export declare function sideDir(side: Side): Point; /** * source(측면) → (waypoints…) → target(측면) 를 직각 세그먼트로 잇는 SVG path. */ export declare function buildOrthogonalPath(source: Point, sourceSide: Side, waypoints: Point[], target: Point, targetSide: Side, stub?: number): string; /** 직각 path 중점 affordance — 꺾인 직선 세그먼트마다 중점 + 삽입 span 인덱스. */ export interface SegmentMid { point: Point; /** waypoint 삽입 인덱스 (insertPoint의 segIndex) */ segIndex: number; } /** * 직각 path의 각 직선 세그먼트 중점 — straight 모드의 segmentMidpoints에 대응하는 직각판. * 제어점 직선 중점이 아니라 실제 그려지는 꺾은선 위 점이라 affordance가 선 위에 놓인다. */ export declare function orthogonalMidpoints(source: Point, sourceSide: Side, waypoints: Point[], target: Point, targetSide: Side, stub?: number): SegmentMid[]; /** * 셀프 연관(source===target) 루프 path — 같은 변(보통 우측)의 두 지점에서 바깥으로 * `extent`만큼 나갔다 직각으로 돌아오는 사각 루프. straight/orthogonal 두 모드 공통으로 쓴다 * (self는 직선 한 가닥이면 변에 붙은 선으로 붕괴하므로 항상 직각 루프로 그린다). * * source.y와 target.y가 충분히 벌어져 있어야 루프로 보인다 — 간격 보장은 호출부 * (useFloatingRoute의 self 분기)가 담당한다. */ export declare function buildSelfLoopPath(source: Point, target: Point, extent?: number): string; /** * 직선 라우팅 — source → (waypoints…) → target 를 곧은 선분으로 잇는다. * waypoint가 없으면 두 끝점을 잇는 단일 직선(대각선). 기본 라우팅 모드. */ export declare function buildStraightPath(source: Point, waypoints: Point[], target: Point): string; export type RoutingMode = 'straight' | 'orthogonal'; export interface Rect { x: number; y: number; width: number; height: number; } /** * rect 중심에서 `toward` 방향으로 나가는 반직선이 rect 경계와 만나는 점 + 그 변(side). * 완전 floating 끝점(노트 연결·비앵커 관계)에 사용 — 노드를 옮기면 끝점이 경계를 따라 이동한다. */ export declare function rectExitPoint(rect: Rect, toward: Point): { point: Point; side: Side; }; /** * 컬럼 앵커 끝점 — y는 지정 행(rowY)에 고정, 좌/우 중 상대(towardX)를 향한 변에 부착. * "행 유지 + 측면 동적": 어느 속성의 FK인지(행)는 보존하되 노드를 옮기면 측면이 자동으로 뒤집힌다. */ export declare function anchoredEdgePoint(rect: Rect, rowY: number, towardX: number): { point: Point; side: Side; }; /** 폴리라인 중점들(제어점 사이 가운데) — 더블클릭 waypoint 추가 affordance */ export declare function segmentMidpoints(source: Point, waypoints: Point[], target: Point): Point[];