import type { Rectangle, Coord, Size } from '#blokkli/editor/types/geometry'; export declare function getBounds(rects: Rectangle[]): Rectangle | undefined; export declare function intersects(a: Rectangle, b: Rectangle): boolean; export declare function isInsideRect(x: number, y: number, rect: Rectangle): boolean; /** * Calculate the intersection amount of two rectangles as a value from 0 to 1. */ export declare function calculateIntersection(rectA: Rectangle, rectB: Rectangle): number; /** * Return the closest rectangle. */ export declare function findClosestRectangle(x: number, y: number, rects: T[]): T; /** * Return the distance from the given coordinates to the center of the rectangle. */ export declare function distanceToRectangle(x: number, y: number, rect: Rectangle): number; /** * Return the distance from the given coordinates to the center of the rectangle. */ export declare function distanceToClosestRectangleEdge(x: number, y: number, rect: Rectangle): number; /** * Subtracts a rectangle from a viewport and returns the remaining area as rectangles. * The viewport is assumed to have x=0 and y=0. * * @param viewport - The size of the viewport to subtract from * @param rect - The rectangle to subtract * @returns An array of 0 to 4 rectangles representing the area outside of rect */ export declare function subtractRectFromViewport(viewport: Size, rect: Rectangle): Rectangle[]; export declare function getDistance(a: Coord, b: Coord): number; /** * Position the given rectToPlace so that it doesn't overlap with any of the blockingRects. */ export declare function findIdealRectPosition(blockingRects: Rectangle[], rectToPlace: Rectangle, viewport: Rectangle, maxOverlap?: number): { x: number; y: number; }; /** * Calculate the ideal X coordinate for placing a rectangle. * * Coordinates are assumed to be 0,0 for top-left. The method returns a number that can be used to set the */ export declare const calculateCenterPosition: (blockingRects: Rectangle[], viewport: Rectangle, widthToPlace: number) => number;