import type { NVL, Node, Point, Relationship } from '@neo4j-nvl/base'; import { BaseInteraction } from './base'; /** * Options for the lasso interaction handler to customize its behavior. */ export type LassoInteractionOptions = { /** * If true, the selected items will be automatically selected when the gesture is finished. * @default false */ selectOnRelease?: boolean; }; /** * Callbacks for the lasso interaction handler. */ export type LassoInteractionCallbacks = { /** * Called once when the user presses the mouse on the canvas, starting the lasso. * @param event - The original mouse event. */ onLassoStarted?: ((event: MouseEvent) => void) | boolean; /** * Called once when the user releases the mouse after lasso selecting. * @param selectionObject - The selected node and relationship ids. * @param event - The original mouse event. */ onLassoSelect?: (({ nodes, rels }: { nodes: Node[]; rels: Relationship[]; }, event: MouseEvent) => void) | boolean; }; /** * @internal * @hidden */ export type Coords = [number, number]; /** * Checks if two lines defined by p1->p2 and p3->p4 are crossing. * @internal * @hidden */ export declare const checkLinesCrossing: (p1: Coords, p2: Coords, p3: Coords, p4: Coords) => boolean; /** * Checks if any line segments in the polygon intersect. * @internal * @hidden */ export declare const checkIntersection: (polygon: Coords[]) => boolean; /** * Checks if the point (x, y) is inside the polygon defined by vs. * @internal * @hidden */ export declare const checkPointInside: (x: number, y: number, vs: Point[]) => boolean; /** * An interaction handler that lets you select nodes and relationships by drawing a lasso around them. * When dragging, a line is drawn on the scene and all elements inside are selected. * * For examples, head to the {@link https://neo4j.com/docs/nvl/current/interaction-handlers/#_lassointeraction Lasso Interaction documentation page}. */ export declare class LassoInteraction extends BaseInteraction { private active; private lassoPending; private startClientPosition; private pendingPointerCanvas; private points; private overlayRenderer; /** * Creates a new instance of the lasso interaction handler. * @param nvl - The NVL instance to attach the interaction handler to. * @param options - Options for the lasso interaction handler to customize its behavior. */ constructor(nvl: NVL, options?: LassoInteractionOptions); private startLasso; private handleMouseDown; private handleDrag; private activateLasso; private handleMouseUp; private getLassoItems; private endLasso; /** * Removes all related event listeners and the overlay renderer for the box. */ destroy(): void; }