import type { HandlePosition, HandleType } from "../../editor";
export interface HandleDescriptor {
    nodeId: string;
    handleId: string;
    type: HandleType;
    side: HandlePosition;
    /** 0-based position among same-(node, side, type) handles. */
    index: number;
    /** Total handles on the same (node, side, type). */
    total: number;
}
export interface HandleRegistry {
    register(d: HandleDescriptor): () => void;
    resolve(nodeId: string, type: HandleType, handleId: string): HandleDescriptor | undefined;
    /**
     * Subscribe to registry mutations. Fires after every register /
     * unregister so listeners (typically the EdgesLayer) can re-render
     * once the new handles are present. Without this, edges resolved
     * during the same React commit as a node remount fall back to default
     * positions because the Handle's `useEffect` hasn't yet written its
     * descriptor — which is what caused the post-collapse stale-edge bug
     * inside subflows.
     */
    subscribe(listener: () => void): () => void;
}
export declare const HandleRegistryContext: import("react").Context<HandleRegistry>;
export declare function useHandleRegistry(): HandleRegistry;
/**
 * Build a registry. One per FlowCanvas instance.
 */
export declare function createHandleRegistry(): HandleRegistry;
//# sourceMappingURL=handleRegistry.d.ts.map