js.foresight
Version:
Predicts mouse trajectory to trigger actions as users approach elements, enabling anticipatory UI updates or pre-loading. Made with vanilla javascript and usable in every framework.
12 lines • 620 B
TypeScript
import type { Point, Rect } from "../../types/types";
/**
* Determines if a line segment intersects with a given rectangle.
* This function implements the Liang-Barsky line clipping algorithm.
*
* @param p1 - The starting {@link Point} of the line segment.
* @param p2 - The ending {@link Point} of the line segment.
* @param rect - The {@link Rect} to check for intersection.
* @returns `true` if the line segment intersects the rectangle, `false` otherwise.
*/
export declare function lineSegmentIntersectsRect(p1: Point, p2: Point, rect: Rect): boolean;
//# sourceMappingURL=lineSigmentIntersectsRect.d.ts.map