import type { Node, Point, ShortestPathRouterOptions } from '../../types';
/**
* 估算从起点到多个锚点的最小代价
*
* Estimate minimum cost from the starting point to multiple anchor points
* @param from - 起点 | source point
* @param anchors - 锚点 | anchor points
* @param distFunc - 距离函数 | distance function
* @returns 最小成本 | minimum cost
*/
export declare function estimateCost(from: Point, anchors: Point[], distFunc: (p1: Point, p2: Point) => number): number;
/**
* 已知一个点集与一个参考点,从点集中找到距离参考点最近的点
*
* Given a set of points and a reference point, find the point closest to the reference point from the set of points
* @param points - 点集 | set of points
* @param refPoint - 参考点 | reference point
* @param distFunc - 距离函数 | distance function
* @returns 最近的点 | nearest point
*/
export declare function getNearestPoint(points: Point[], refPoint: Point, distFunc: (p1: Point, p2: Point) => number): Point;
/**
* Find the shortest path between a given source node to a destination node according to A* Search Algorithm:https://www.geeksforgeeks.org/a-search-algorithm/
* @param sourceNode - 源节点 | source node
* @param targetNode - 目标节点 | target node
* @param nodes - 图上所有节点 | all nodes on the graph
* @param config - 路由配置 | router options
* @returns 控制点数组 | control point array
*/
export declare function aStarSearch(sourceNode: Node, targetNode: Node, nodes: Node[], config: ShortestPathRouterOptions): Point[];
type Item = {
id: string;
value: number;
};
/**
* 有序数组,按升序排列
*
* Sorted array, sorted in ascending order
*/
export declare class SortedArray {
arr: Item[];
private map;
constructor();
private _innerAdd;
/**
* 将新项添加到适当的索引位置
*
* Add the new item to the appropriate index
* @param item - 新项 | new item
*/
add(item: Item): void;
remove(id: string): void;
private _clearAndGetMinId;
private _findFirstId;
minId(clear: boolean): string | undefined;
}
export {};