reactflow-velocity
Version:
React Flow - A highly customizable React library for building node-based editors and interactive flow charts.
19 lines • 950 B
TypeScript
import { type Dispatch, type SetStateAction } from 'react';
import type { Node, NodeChange, Edge, EdgeChange } from '../types';
/**
* Hook for managing the state of nodes - should only be used for prototyping / simple use cases.
*
* @public
* @param initialNodes
* @returns an array [nodes, setNodes, onNodesChange]
*/
export declare function useNodesState<NodeType extends Node = Node>(initialNodes: NodeType[]): [NodeType[], Dispatch<SetStateAction<NodeType[]>>, (changes: NodeChange<NodeType>[]) => void];
/**
* Hook for managing the state of edges - should only be used for prototyping / simple use cases.
*
* @public
* @param initialEdges
* @returns an array [edges, setEdges, onEdgesChange]
*/
export declare function useEdgesState<EdgeType extends Edge = Edge>(initialEdges: EdgeType[]): [EdgeType[], Dispatch<SetStateAction<EdgeType[]>>, (changes: EdgeChange<EdgeType>[]) => void];
//# sourceMappingURL=useNodesEdgesState.d.ts.map