import { AABB } from '@antv/g';
import type { Node, Padding, Point, TriangleDirection } from '../types';
/**
* 获取包围盒的宽度
*
* Retrieves the width of a bounding box
* @param bbox - 包围盒 | Bounding box
* @returns 包围盒的宽度 | Width of box
*/
export declare function getBBoxWidth(bbox: AABB): number;
/**
* 获取包围盒的高度
*
* Retrieve the height of a bounding box
* @param bbox - 包围盒 | Bounding box
* @returns 包围盒的高度 | Height of box
*/
export declare function getBBoxHeight(bbox: AABB): number;
/**
* 获取包围盒的尺寸
* @param bbox - 包围盒 | Bounding box
* @returns 包围盒的尺寸 | Size of box
*/
export declare function getBBoxSize(bbox: AABB): [number, number];
/**
* 获取节点的包围盒,兼容节点为点的情况
*
* Get the bounding box of the node, compatible with the case where the node is a point
* @param node - 节点或者点 | node or point
* @param padding - 内边距 | padding
* @returns 包围盒 | bounding box
*/
export declare function getNodeBBox(node: Point | Node, padding?: Padding): AABB;
/**
* 获取单点的包围盒
*
* Get the bounding box of a single point
* @param point - 点 | Point
* @returns 包围盒 | Bounding box
*/
export declare function getPointBBox(point: Point): AABB;
/**
* 获取扩大后的包围盒
*
* Get the expanded bounding box
* @param bbox - 包围盒 | Bounding box
* @param padding - 内边距 | Padding
* @returns 扩大后的包围盒 | The expanded bounding box
*/
export declare function getExpandedBBox(bbox: AABB, padding: Padding): AABB;
/**
* 计算整体包围盒
*
* Calculate the overall bounding box
* @param bboxes - 包围盒列表 | List of bounding boxes
* @returns 整体包围盒 | Overall bounding box
*/
export declare function getCombinedBBox(bboxes: AABB[]): AABB;
/**
* 判断 bbox1 是否完全包含在 bbox2 内
*
* Determine whether bbox1 is completely contained in bbox2
* @param bbox1 - 目标包围盒 | Target bounding box
* @param bbox2 - 参考包围盒 | Reference bounding box
* @returns 如果 bbox1 完全包含在 bbox2 内返回 true,否则返回 false | Returns true if bbox1 is completely contained in bbox2, false otherwise
*/
export declare function isBBoxInside(bbox1: AABB, bbox2: AABB): boolean;
/**
* 判断点是否在给定的包围盒内
*
* Whether the point is contained in the given box
* @param point - 点 | Point
* @param bbox - 包围盒 | Bounding box
* @returns 如果点在包围盒内返回 true,否则返回 false | Returns true if the point is inside the bounding box, false otherwise
*/
export declare function isPointInBBox(point: Point, bbox: AABB): boolean;
/**
* 判断点是否在给定的包围盒的边界或边界的延长线上
*
* Whether the point is on the boundary or extension line of the given box
* @param point - 点 | Point
* @param bbox - 包围盒 | Bounding box
* @param extended - 是否判断边界的延长线 | Whether to judge the extension line of the boundary
* @returns 如果点在包围盒的边界或边界的延长线上返回 true,否则返回 false | Returns true if the point is on the boundary or extension line of the bounding box, false otherwise
*/
export declare function isPointOnBBoxBoundary(point: Point, bbox: AABB, extended?: boolean): boolean;
/**
* 判断点是否在给定的包围盒外
*
* Whether the point is outside the given box
* @param point - 点 | Point
* @param bbox - 包围盒 | Bounding box
* @returns 如果点在包围盒外返回 true,否则返回 false | Returns true if the point is outside the bounding box, false otherwise
*/
export declare function isPointOutsideBBox(point: Point, bbox: AABB): boolean;
/**
* 判断点是否位于包围盒中心
*
* When the point is at the center of the bounding box
* @param point - 点 | Point
* @param bbox - 包围盒 | Bounding box
* @returns 如果点在包围盒中心返回 true,否则返回 false | Returns true if the point is at the center of the bounding box, false otherwise
*/
export declare function isPointBBoxCenter(point: Point, bbox: AABB): boolean;
/**
* 获取包围盒上离点 `p` 最近的边
*
* Get a side of the boundary which is nearest to the point `p`
* @param bbox - 包围盒 | Bounding box
* @param p - 点 | Point
* @returns 离点 `p` 最近的边 | The side nearest to the point `p`
*/
export declare function getNearestBoundarySide(p: Point, bbox: AABB): 'left' | 'right' | 'top' | 'bottom';
/**
* 获取包围盒上离点 `p` 最近的边界点
*
* Get a point on the boundary nearest to the point `p`
* @param bbox - 包围盒 | Bounding box
* @param p - 点 | Point
* @returns 离点 `p` 最近的点 | The point nearest to the point `p`
*/
export declare function getNearestBoundaryPoint(p: Point, bbox: AABB): Point;
/**
* The triangle center point of the bounding box
* @param bbox - bounding box
* @param direction - direction
* @returns Point
*/
export declare function getTriangleCenter(bbox: AABB, direction: TriangleDirection): Point;
/**
* Get incircle radius
* @param bbox - bounding box
* @param direction - direction
* @returns number
*/
export declare function getIncircleRadius(bbox: AABB, direction: TriangleDirection): number;
/**
* 获取包围盒的四条边,顺序依次为上、右、下、左
*
* Get the four segments of the bounding box, in order from top, right, bottom, left
* @param bbox - 包围盒 | Bounding box
* @returns 包围盒的四条边 | The four segments of the bounding box
*/
export declare function getBBoxSegments(bbox: AABB): [Point, Point][];