/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type Node as FlowNode, type Edge as FlowEdge, type NodeChange, type EdgeChange } from '@xyflow/react'; import type { FlatLink, FlatNode } from './types.js'; import type { OntologyFlowNodeData } from './OntologyNode.js'; import type { OntologyFlowEdgeData } from './OntologyEdge.js'; /** * Mutation callbacks the parent renderer injects. In read-only mode the * parent passes no-ops; in editable mode each callback re-derives the * next-ontology and writes it back through `binding.write` via * `useBindingOntology`'s `mutate`. */ export interface OntologyMutations { deleteNodes(ids: Set): void; deleteLinks(ids: Set): void; } export interface UseFlowStateArgs { flatNodes: FlatNode[]; flatLinks: FlatLink[]; mutations: OntologyMutations; } export declare function useFlowState({ flatNodes, flatLinks, mutations }: UseFlowStateArgs): { nodes: FlowNode[]; edges: FlowEdge[]; onNodesChange: (changes: NodeChange[]) => void; onEdgesChange: (changes: EdgeChange[]) => void; screenToFlowPosition: (clientPosition: import("@xyflow/react").XYPosition, options?: { snapToGrid?: boolean; snapGrid?: import("@xyflow/react").SnapGrid; }) => import("@xyflow/react").XYPosition; setNodePosition: (id: string, pos: { x: number; y: number; }) => void; }; //# sourceMappingURL=flow-state.d.ts.map