/**
 * Pure 2D geometry primitives used by the label layout cost function.
 *
 * Rectangles are center + half-extents; segments are flat coordinates. None of
 * these allocate, so they are safe to call inside the solver's hot loop.
 */
import type { Rect, Segment } from './types';
export declare function rectsOverlap(a: Rect, b: Rect, pad?: number): boolean;
/** Fraction of the smaller rectangle's area covered by the intersection, 0..1. */
export declare function overlapAreaFrac(a: Rect, b: Rect): number;
/**
 * Continuous penetration: how much of the segment lies inside the rectangle,
 * as a fraction of segment length (0 = disjoint, 1 = fully inside). Gives the
 * optimizer a gradient that the boolean test lacks.
 */
export declare function segmentRectPenetration(s: Segment, r: Rect): number;
/** Proper crossing of two segments (shared endpoints / collinear touching excluded). */
export declare function segmentsCross(a: Segment, b: Segment): boolean;
/** Penetration depth (viewport px) of a circle into a rectangle, 0 if disjoint. */
export declare function rectCircleOverlap(r: Rect, cx: number, cy: number, rad: number): number;
