import type { Vector2Like } from 'modern-path2d'; import { Vector2 } from 'modern-path2d'; export interface RectangleLike { x: number; y: number; width: number; height: number; } /** * AxisAlignedBoundingBox2D */ export declare class Aabb2D implements RectangleLike { get x(): number; set x(val: number); get y(): number; set y(val: number); get left(): number; set left(val: number); get top(): number; set top(val: number); get right(): number; set right(val: number); get bottom(): number; set bottom(val: number); get width(): number; set width(val: number); get height(): number; set height(val: number); readonly min: Vector2; readonly size: Vector2; readonly max: Vector2; constructor(); constructor(rect: RectangleLike); constructor(pointArray: Vector2Like[]); constructor(min: Vector2Like, size: Vector2Like); constructor(x: number, y: number, width: number, height: number); /** * `min`/`size` and `max` mirror each other through Vector2's onUpdate hooks, and the * recursion normally stops because `Vector2.set` skips the callback when the value is * unchanged. That check is `!==`, so a single NaN anywhere in the box never compares * equal to itself and `_updateMax` ⇄ `_updateSize` bounce until the stack blows — * which takes the render loop (and the WebGL context) down with it. * Collapsing non-finite results to 0 keeps the mirror consistent and terminates. */ protected _updateSize(): this; protected _updateMax(): this; overlap(rect: Aabb2D, axis?: 'x' | 'y'): boolean; contains(value: Aabb2D | Vector2Like): boolean; getIntersectionRect(target: Aabb2D): Aabb2D; getArea(): number; getCenter(): Vector2; toCssStyle(): { left: string; top: string; width: string; height: string; }; toArray(): number[]; toJSON(): RectangleLike; clone(): Aabb2D; destroy(): void; }