import { Point } from '../point.js'; import { Rectangle } from '../rectangle.js'; /** * Inflates the rectangle by the specified amounts on each axis. * @param {Rectangle} a - The rectangle to inflate. * @param {number} dx - The amount to inflate the rectangle horizontally. * @param {number} dy - The amount to inflate the rectangle vertically. * @returns {Rectangle} The inflated rectangle. */ export declare const inflate: (a: Rectangle, dx: number, dy: number) => Rectangle; /** * Inflates the rectangle by the specified point values on each axis. * @param {Rectangle} a - The rectangle to inflate. * @param {object} point - The point containing x and y values to inflate the rectangle by. * @returns {Rectangle} The inflated rectangle. */ export declare const inflatePoint: (a: Rectangle, point: Point) => Rectangle; /** * Gets the size of the rectangle as a point. * @param {Rectangle} a - The rectangle to get the size of. * @param {Point} output - Optional point to store the result in. * @returns {Point} The size of the rectangle as a point (width, height). */ export declare const size: (a: Rectangle, output?: Point | null) => Point; /** * Clones a rectangle. * @param {Rectangle} input - The rectangle to clone. * @param {Rectangle} output - Optional rectangle to store the result in. * @returns {Rectangle} The cloned rectangle. */ export declare const clone: (input: Rectangle, output?: Rectangle | null) => Rectangle; /** * Checks if a point is contained within the rectangle. * @param {Rectangle} a - The rectangle to check. * @param {number} x - The x coordinate of the point. * @param {number} y - The y coordinate of the point. * @returns {boolean} True if the point is contained within the rectangle, false otherwise. */ export declare const contains: (a: Rectangle, x: number, y: number) => boolean; /** * Checks if a point is contained within the rectangle (raw version). * @param {number} rx - The x coordinate of the rectangle. * @param {number} ry - The y coordinate of the rectangle. * @param {number} rw - The width of the rectangle. * @param {number} rh - The height of the rectangle. * @param {number} x - The x coordinate of the point. * @param {number} y - The y coordinate of the point. * @returns {boolean} True if the point is contained within the rectangle, false otherwise. */ export declare const containsRaw: (rx: number, ry: number, rw: number, rh: number, x: number, y: number) => boolean; /** * Checks if a point is contained within the rectangle. * @param {Rectangle} a - The rectangle to check. * @param {Point} point - The point to check. * @returns {boolean} True if the point is contained within the rectangle, false otherwise. */ export declare const containsPoint: (a: Rectangle, point: Point) => boolean; /** * Checks if rectangle a contains rectangle b. * @param {Rectangle} a - The first rectangle to check. * @param {Rectangle} b - The second rectangle to check. * @returns {boolean} True if rectangle a contains rectangle b, false otherwise. */ export declare const containsRect: (a: Rectangle, b: Rectangle) => boolean; /** * Checks if two rectangles are equal. * @param {Rectangle} a - The first rectangle to compare. * @param {Rectangle} b - The second rectangle to compare. * @returns {boolean} True if the rectangles are equal, false otherwise. */ export declare const equals: (a: Rectangle, b: Rectangle) => boolean; /** * Checks if two rectangles have the same dimensions. * @param {Rectangle} a - The first rectangle to compare. * @param {Rectangle} b - The second rectangle to compare. * @returns {boolean} True if the rectangles have the same dimensions, false otherwise. */ export declare const sameDimensions: (a: Rectangle, b: Rectangle) => boolean; /** * Checks if two rectangles intersect. * @param {Rectangle} a - The first rectangle to check. * @param {Rectangle} b - The second rectangle to check. * @returns {boolean} True if the rectangles intersect, false otherwise. */ /** Anything with an axis-aligned extent, which Line exposes as well as Rectangle. */ export type Bounds = { x: number; y: number; width: number; height: number; right: number; bottom: number; }; export declare const intersects: (a: Bounds, b: Bounds) => boolean; /** * Gets the intersection of two rectangles. * @param {Rectangle} a - The first rectangle. * @param {Rectangle} b - The second rectangle. * @param {Rectangle} output - Optional rectangle to store the result in. * @returns {Rectangle} The intersection of the rectangles, or an empty rectangle if they don't intersect. */ export declare const intersection: (a: Rectangle, b: Rectangle, output?: Rectangle | null) => Rectangle; /** * Checks if a rectangle intersects with a set of raw coordinates. * @param {Rectangle} a - The rectangle to check. * @param {number} left - The left coordinate of the area to check. * @param {number} right - The right coordinate of the area to check. * @param {number} top - The top coordinate of the area to check. * @param {number} bottom - The bottom coordinate of the area to check. * @param {number} tolerance - Optional tolerance value for intersection. * @returns {boolean} True if the rectangle intersects with the area, false otherwise. */ export declare const intersectsRaw: (a: Rectangle, left: number, right: number, top: number, bottom: number, tolerance?: number) => boolean; /** * Gets the union of two rectangles. * @param {Rectangle} a - The first rectangle. * @param {Rectangle} b - The second rectangle. * @param {Rectangle} output - Optional rectangle to store the result in. * @returns {Rectangle} The union of the rectangles. */ export declare const union: (a: Rectangle, b: Rectangle, output?: Rectangle | null) => Rectangle; /** * Gets the axis-aligned bounding box (AABB) of a set of points. * @param {Point[]} points - The array of points to calculate the AABB for. * @param {Rectangle} output - Optional rectangle to store the result in. * @returns {Rectangle} The AABB of the points. */ export declare const aabb: (points: Point[], output?: Rectangle | null) => Rectangle; /** * Gets an empty rectangle instance. * @returns {Rectangle} An empty rectangle. */ export declare const getEmptyRectangle: () => Rectangle; //# sourceMappingURL=rectangle.d.ts.map