UNPKG

@jalez/react-flow-smart-edge

Version:

Smart edge routing for @xyflow/react v12+ (maintained fork of @tisoap/react-flow-smart-edge)

12 lines (11 loc) 544 B
import type { Position, XYPosition } from '@xyflow/react'; import type { Grid } from 'pathfinding'; type Direction = 'top' | 'bottom' | 'left' | 'right'; export declare const getNextPointFromPosition: (point: XYPosition, position: Direction) => XYPosition; /** * Guarantee that the path is walkable, even if the point is inside a non * walkable area, by adding a walkable path in the direction of the point's * Position. */ export declare const guaranteeWalkablePath: (grid: Grid, point: XYPosition, position: Position) => void; export {};