circuit-bricks
Version:
A modular, Lego-style SVG circuit component system for React (ALPHA - Not for production use)
26 lines • 848 B
TypeScript
/**
* Port position utility
*
* Provides functions to get the absolute position of ports in the DOM.
* Compatible with infinite circuit canvas with panning and zooming.
* Now includes SSR-safe implementations.
*/
interface Point {
x: number;
y: number;
}
/**
* Retrieves the absolute position of a port in the SVG coordinate system,
* accounting for any viewport transformations (pan/zoom).
*
* @param componentId - The ID of the component
* @param portId - The ID of the port on the component
* @returns The position of the port or null if not found
*/
export declare function getPortPosition(componentId: string, portId: string): Point | null;
export {};
/**
* Hook version of getPortPosition for React components
* Will be implemented in a separate usePortPosition.ts file
*/
//# sourceMappingURL=getPortPosition.d.ts.map