import { ConnectionMode, type ConnectionStatus, type CoordinateExtent, type InternalNodeUpdate, type UpdateNodePositions, type NodeOrigin, type OnConnect, type OnError, type OnViewportChange, type SelectionRect, type SnapGrid, type ConnectingHandle, type Transform, type XYPosition, type PanZoomInstance, type PanBy, type OnConnectStart, type OnConnectEnd, type OnSelectionDrag, type OnMoveStart, type OnMove, type OnMoveEnd, type UpdateConnection, type EdgeLookup, type ConnectionLookup, type NodeLookup, NodeChange, EdgeChange, EdgeBase, HandleConnection, } from '@xyflow/system'; import type { Edge, Node, OnNodesChange, OnEdgesChange, DefaultEdgeOptions, FitViewOptions, OnNodesDelete, OnEdgesDelete, OnSelectionChangeFunc, UnselectNodesAndEdgesParams, OnDelete, OnNodeDrag, OnBeforeDelete, IsValidConnection, InternalNode, } from '.'; import { Writable } from '../store/initialState'; import { ReactiveMap } from '@solid-primitives/map' export type ReactiveEdgeLookup = ReactiveMap; export type ReactiveConnectionLookup = ReactiveMap>; export type SolidFlowStore = { rfId: Writable; width: Writable; height: Writable; transform: Writable; nodes: Writable; nodeLookup: ReactiveMap>; parentLookup: ReactiveMap[]>; edges: Writable; edgeLookup: ReactiveEdgeLookup; connectionLookup: ReactiveConnectionLookup; onNodesChange: Writable | null>; onEdgesChange: Writable | null>; hasDefaultNodes: Writable; hasDefaultEdges: Writable; domNode: Writable; paneDragging: Writable; noPanClassName: Writable; panZoom: Writable; minZoom: Writable; maxZoom: Writable; translateExtent: Writable; nodeExtent: Writable; nodeOrigin: Writable; nodeDragThreshold: Writable; nodesSelectionActive: Writable; userSelectionActive: Writable; userSelectionRect: Writable; connectionPosition: Writable; connectionStatus: Writable; connectionMode: Writable; snapToGrid: Writable; snapGrid: Writable; nodesDraggable: Writable; nodesConnectable: Writable; nodesFocusable: Writable; edgesFocusable: Writable; edgesUpdatable: Writable; elementsSelectable: Writable; elevateNodesOnSelect: Writable; elevateEdgesOnSelect: Writable; selectNodesOnDrag: Writable; multiSelectionActive: Writable; connectionStartHandle: Writable; connectionEndHandle: Writable; connectionClickStartHandle: Writable; onNodeDragStart?: OnNodeDrag; onNodeDrag?: OnNodeDrag; onNodeDragStop?: OnNodeDrag; onSelectionDragStart?: OnSelectionDrag; onSelectionDrag?: OnSelectionDrag; onSelectionDragStop?: OnSelectionDrag; onMoveStart?: OnMoveStart; onMove?: OnMove; onMoveEnd?: OnMoveEnd; onConnect: Writable; onConnectStart?: OnConnectStart; onConnectEnd?: OnConnectEnd; onClickConnectStart?: OnConnectStart; onClickConnectEnd?: OnConnectEnd; connectOnClick: Writable; defaultEdgeOptions?: DefaultEdgeOptions; fitViewOnInit: Writable; fitViewDone: Writable; fitViewOnInitOptions: Writable; onNodesDelete:Writable | undefined>; onEdgesDelete: Writable | undefined>; onDelete: Writable; onError: Writable; // event handlers onViewportChangeStart: Writable; onViewportChange: Writable; onViewportChangeEnd: Writable; onBeforeDelete: Writable | undefined>; onSelectionChangeHandlers: Writable; ariaLiveMessage: Writable; autoPanOnConnect: Writable; autoPanOnNodeDrag: Writable; connectionRadius: Writable; isValidConnection?: IsValidConnection; lib: Writable; debug: Writable; }; export type ReactFlowActions = { setNodes: (nodes: NodeType[]) => void; setEdges: (edges: EdgeType[]) => void; setDefaultNodesAndEdges: (nodes?: NodeType[], edges?: EdgeType[]) => void; updateNodeInternals: (updates: Map) => void; updateNodePositions: UpdateNodePositions; resetSelectedElements: () => void; unselectNodesAndEdges: (params?: UnselectNodesAndEdgesParams) => void; addSelectedNodes: (nodeIds: string[]) => void; addSelectedEdges: (edgeIds: string[]) => void; setMinZoom: (minZoom: number) => void; setMaxZoom: (maxZoom: number) => void; setTranslateExtent: (translateExtent: CoordinateExtent) => void; setNodeExtent: (nodeExtent: CoordinateExtent) => void; cancelConnection: () => void; updateConnection: UpdateConnection; reset: () => void; triggerNodeChanges: (changes: NodeChange[]) => void; triggerEdgeChanges: (changes: EdgeChange[]) => void; panBy: PanBy; fitView: (options?: FitViewOptions) => boolean; }; export type SolidFlowState = SolidFlowStore< NodeType, EdgeType > & ReactFlowActions;