import { OnDestroy, Signal } from '@angular/core'; import { ArrowElement } from './arrow-element'; import { ArrowBinding, Point } from '../types'; import * as i0 from "@angular/core"; /** * Manages the relationships between arrows and the shapes they are bound to. * * Responsibilities: * - Resolve binding endpoints to world coordinates * - Update arrow endpoints when bound shapes move or resize * - Attach / detach arrow endpoints to/from shapes * - Provide reverse-lookup: which arrows are bound to a given shape * - Auto-detach bindings when shapes are removed */ export declare class ArrowBindingService implements OnDestroy { private connectionPoints; private elementsService; private eventBus; private subscription; constructor(); ngOnDestroy(): void; /** * Returns all arrow elements that are currently bound to the given element id * (at either their start or end). */ getArrowsBoundTo(elementId: string): ArrowElement[]; /** * Computed signal of all arrow elements in the workspace. */ readonly arrows: Signal; /** * Resolve the world-coordinate for one end of an arrow based on its binding. * * @param binding - the ArrowBinding at this end (may be null → free point) * @param freePoint - the free (x,y) endpoint if binding is null * @param otherEnd - the other endpoint (for computing direction when using closest-edge) */ resolveEndpoint(binding: ArrowBinding | null, freePoint: Point, otherEnd: Point): Point; /** * Create a binding object for a snap result. */ createBinding(elementId: string, pointId: string | null, gap?: number): ArrowBinding; /** * Attach one end of an arrow to a specific shape. * Returns a new partial ArrowElement with updated binding + endpoint. */ attachStart(arrow: ArrowElement, elementId: string, pointId: string | null, gap?: number): Partial; attachEnd(arrow: ArrowElement, elementId: string, pointId: string | null, gap?: number): Partial; detachStart(arrow: ArrowElement): Partial; detachEnd(arrow: ArrowElement): Partial; /** * Called after one or more shapes have been moved/resized. * Recomputes all arrow endpoints that are bound to any of the moved shapes. * * @param movedIds - set of element IDs that were modified * @returns array of arrow updates to apply via `elementsService.updateElements()` */ recomputeBindingsForElements(movedIds: Set): Array & { id: string; }>; /** * When an element is about to be deleted, detach all arrows bound to it. * Returns updates to apply before the element is removed. */ detachAllFromElement(elementId: string): Array & { id: string; }>; /** * Check whether the given arrow has any active bindings. */ hasBindings(arrow: ArrowElement): boolean; /** * Get a human-readable description of bindings (useful for debugging). */ describeBindings(arrow: ArrowElement): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }