interface Rect { height: number; left: number; top: number; width: number; } export function haveIntersection(entry: Rect, target: Rect) { const top = Math.max(target.top, entry.top); const left = Math.max(target.left, entry.left); const right = Math.min(target.left + target.width, entry.left + entry.width); const bottom = Math.min(target.top + target.height, entry.top + entry.height); return left < right && top < bottom; }