chore(svelte/hooks): add docs
This commit is contained in:
@@ -17,8 +17,8 @@ type useHandleConnectionsParams = {
|
||||
*
|
||||
* @public
|
||||
* @param param.type - handle type 'source' or 'target'
|
||||
* @param param.id - the handle id (this is only needed if the node has multiple handles of the same type)
|
||||
* @param param.nodeId - node id - if not provided, the node id from the NodeIdContext is used
|
||||
* @param param.id - the handle id (this is only needed if the node has multiple handles of the same type)
|
||||
* @param param.onConnect - gets called when a connection is established
|
||||
* @param param.onDisconnect - gets called when a connection is removed
|
||||
* @returns an array with connections
|
||||
|
||||
@@ -10,7 +10,7 @@ import type { Node } from '../types';
|
||||
* @public
|
||||
* @param nodeId - The id (or ids) of the node to get the data from
|
||||
* @param guard - Optional guard function to narrow down the node type
|
||||
* @returns An array data objects
|
||||
* @returns An array od data objects
|
||||
*/
|
||||
export function useNodesData<NodeType extends Node = Node>(nodeId: string): NodeType['data'] | null;
|
||||
export function useNodesData<NodeType extends Node = Node>(nodeIds: string[]): NodeType['data'][];
|
||||
|
||||
@@ -18,7 +18,12 @@ import type {
|
||||
} from '../types';
|
||||
import { isNode } from '../utils';
|
||||
|
||||
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
||||
/**
|
||||
* Hook for accessing the ReactFlow instance.
|
||||
*
|
||||
* @public
|
||||
* @returns ReactFlowInstance
|
||||
*/
|
||||
export default function useReactFlow<NodeType extends Node = Node, EdgeType extends Edge = Edge>(): ReactFlowInstance<
|
||||
NodeType,
|
||||
EdgeType
|
||||
|
||||
Reference in New Issue
Block a user