feat(ui): add type filter toggles
This commit is contained in:
30
node_modules/@xyflow/react/dist/esm/hooks/useReactFlow.d.ts
generated
vendored
Normal file
30
node_modules/@xyflow/react/dist/esm/hooks/useReactFlow.d.ts
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { ReactFlowInstance, Node, Edge } from '../types';
|
||||
/**
|
||||
* This hook returns a ReactFlowInstance that can be used to update nodes and edges, manipulate the viewport, or query the current state of the flow.
|
||||
*
|
||||
* @public
|
||||
* @example
|
||||
* ```jsx
|
||||
*import { useCallback, useState } from 'react';
|
||||
*import { useReactFlow } from '@xyflow/react';
|
||||
*
|
||||
*export function NodeCounter() {
|
||||
* const reactFlow = useReactFlow();
|
||||
* const [count, setCount] = useState(0);
|
||||
* const countNodes = useCallback(() => {
|
||||
* setCount(reactFlow.getNodes().length);
|
||||
* // you need to pass it as a dependency if you are using it with useEffect or useCallback
|
||||
* // because at the first render, it's not initialized yet and some functions might not work.
|
||||
* }, [reactFlow]);
|
||||
*
|
||||
* return (
|
||||
* <div>
|
||||
* <button onClick={countNodes}>Update count</button>
|
||||
* <p>There are {count} nodes in the flow.</p>
|
||||
* </div>
|
||||
* );
|
||||
*}
|
||||
*```
|
||||
*/
|
||||
export declare function useReactFlow<NodeType extends Node = Node, EdgeType extends Edge = Edge>(): ReactFlowInstance<NodeType, EdgeType>;
|
||||
//# sourceMappingURL=useReactFlow.d.ts.map
|
||||
Reference in New Issue
Block a user