import { Port } from '../../types/core'; import { EditorPortPositions, NodePortPositions, PortPosition, PortPositionBehavior, PortPositionConfig, PortPositionNode } from '../../types/portPosition'; /** * @file Context for accessing pre-computed port positions and position calculation utilities */ import * as React from "react"; /** * Context value for port positions */ export type PortPositionContextValue = { /** All computed port positions */ portPositions: EditorPortPositions; /** Effective configuration used for position calculations */ config: PortPositionConfig; /** Optional behavior overrides supplied via props */ behavior?: PortPositionBehavior; /** Get port position for a specific port */ getPortPosition: (nodeId: string, portId: string) => PortPosition | undefined; /** Get all port positions for a node */ getNodePortPositions: (nodeId: string) => NodePortPositions | undefined; /** Compute port position dynamically */ computePortPosition: (node: PortPositionNode, port: Port) => PortPosition; /** Calculate port positions for a node on demand */ calculateNodePortPositions: (node: PortPositionNode) => NodePortPositions; }; export type PortPositionSettingsValue = { config: PortPositionConfig; behavior?: PortPositionBehavior; }; /** * Context for accessing pre-computed port positions */ export declare const PortPositionContext: React.Context; export declare const PortPositionSettingsContext: React.Context; /** * Hook to access port positions */ export declare function usePortPositions(): PortPositionContextValue; /** * Returns only the stable settings used for port position calculation (config/behavior). * Use this when you don't need to subscribe to computed `portPositions`. */ export declare function usePortPositionSettings(): PortPositionSettingsValue; /** * Hook to get a specific port position */ export declare function usePortPosition(nodeId: string, portId: string): PortPosition | undefined; /** * Hook to get all port positions for a node */ export declare function useNodePortPositions(nodeId: string): NodePortPositions | undefined;