@jalez/react-flow-smart-edge
Version:
Smart edge routing for @xyflow/react v12+ (maintained fork of @tisoap/react-flow-smart-edge)
16 lines (15 loc) • 750 B
TypeScript
import type { XYPosition } from '@xyflow/react';
import type { Grid } from 'pathfinding';
/**
* Takes source and target {x, y} points, together with an grid representation
* of the graph, and returns two arrays of number tuples [x, y]. The first
* array represents the full path from source to target, and the second array
* represents a condensed path from source to target.
*/
export type PathFindingFunction = (grid: Grid, start: XYPosition, end: XYPosition) => {
fullPath: number[][];
smoothedPath: number[][];
} | null;
export declare const pathfindingAStarDiagonal: PathFindingFunction;
export declare const pathfindingAStarNoDiagonal: PathFindingFunction;
export declare const pathfindingJumpPointNoDiagonal: PathFindingFunction;