@core-graphics/rect
Version:
JS utilities for managing rects
14 lines (13 loc) • 454 B
TypeScript
import { Rect, RectEdge } from "./lite";
/**
* Checks if a Rect intersects another Rect
*/
export declare function intersects(a: Rect, b: Rect): boolean;
/**
* Returns a new Rect that represents the intersection between two Rects
*/
export declare function intersection(a: Rect, b: Rect): Rect;
/**
* Returns whether two rects collide along each edge
*/
export declare function collisions(a: Rect, b: Rect): Record<RectEdge, boolean>;