import type { HitTargets, NVL, Node, Relationship } from '@neo4j-nvl/base'; import { BaseInteraction } from './base'; /** * Options for the click interaction handler to customize its behavior. */ export type ClickInteractionOptions = { /** * Whether to select the node or relationship on click * @defaultValue false */ selectOnClick?: boolean; }; /** * Callbacks for the click interaction handler. */ export type ClickInteractionCallbacks = { /** * Called when a node is clicked * @param nodes - The node that was clicked. * @param hitElements - All elements that were hit by the click. * @param event - The original mouse event. */ onNodeClick?: ((nodes: Node, hitElements: HitTargets, event: MouseEvent) => void) | boolean; /** * Called when a relationship is clicked * @param relationship - The relationship that was clicked. * @param hitElements - All elements that were hit by the click. * @param event - The original mouse event. */ onRelationshipClick?: ((relationship: Relationship, hitElements: HitTargets, event: MouseEvent) => void) | boolean; /** * Called when the canvas is clicked * @param event - The original mouse event. */ onCanvasClick?: ((event: MouseEvent) => void) | boolean; /** * Called when a node is double clicked * @param event - The original mouse event. */ onCanvasDoubleClick?: ((event: MouseEvent) => void) | boolean; /** * Called when a relationship is right-clicked * @param event - The original mouse event. */ onCanvasRightClick?: ((event: MouseEvent) => void) | boolean; /** * Called when a node is double-clicked * @param nodes - The node that was double-clicked. * @param hitElements - All elements that were hit by the double-click. * @param event - The original mouse event. */ onNodeDoubleClick?: ((node: Node, hitElements: HitTargets, event: MouseEvent) => void) | boolean; /** * Called when a node is right-clicked * @param nodes - The node that was right-clicked. * @param hitElements - All elements that were hit by the right-click. * @param event - The original mouse event. */ onNodeRightClick?: ((node: Node, hitElements: HitTargets, event: MouseEvent) => void) | boolean; /** * Called when a relationship is double-clicked * @param relationship - The relationship that was double-clicked. * @param hitElements - All elements that were hit by the double-click. * @param event - The original mouse event. */ onRelationshipDoubleClick?: ((relationship: Relationship, hitElements: HitTargets, event: MouseEvent) => void) | boolean; /** * Called when a relationship is right-clicked * @param relationship - The relationship that was right-clicked. * @param hitElements - All elements that were hit by the right-click. * @param event - The original mouse event. */ onRelationshipRightClick?: ((relationship: Relationship, hitElements: HitTargets, event: MouseEvent) => void) | boolean; }; /** * Click interaction handler that handles click, double click and right click events on * nodes, relationships, and the scene. * * For examples, head to the {@link https://neo4j.com/docs/nvl/current/interaction-handlers/#_clickinteraction Click Interaction documentation page}. */ export declare class ClickInteraction extends BaseInteraction { private moved; private mousePosition; /** * Creates a new click interaction handler. * @param nvl - The NVL instance to attach the interaction handler to. * @param options - Options for the click interaction handler. */ constructor(nvl: NVL, options?: ClickInteractionOptions); private handleMouseDown; private handleRightClick; private handleDoubleClick; private handleClick; /** * Removes all related event listeners from the container. */ destroy: () => void; }