phx-react
Version:
PHX REACT
39 lines (38 loc) • 1.16 kB
TypeScript
import { Point } from './point';
type ContainsPointReturn = {
result: boolean;
reason: {
isOnTopSide: boolean;
isOnBottomSide: boolean;
isOnLeftSide: boolean;
isOnRightSide: boolean;
};
};
export declare class Rect {
private readonly _left;
private readonly _top;
private readonly _right;
private readonly _bottom;
constructor(left: number, top: number, right: number, bottom: number);
get top(): number;
get right(): number;
get bottom(): number;
get left(): number;
get width(): number;
private get height();
equals({ bottom, left, right, top }: Rect): boolean;
contains({ x, y }: Point): ContainsPointReturn;
contains({ bottom, left, right, top }: Rect): boolean;
intersectsWith(rect: Rect): boolean;
generateNewRect({ bottom, left, right, top }: {
bottom?: number | undefined;
left?: number | undefined;
right?: number | undefined;
top?: number | undefined;
}): Rect;
private static fromLTRB;
private static fromLWTH;
private static fromPoints;
static fromDOM(dom: HTMLElement): Rect;
}
export {};