refactor(core): add HandleConnectableFunc type
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -22,6 +22,8 @@ export type ValidConnectionFunc = (
|
|||||||
elements: { edges: GraphEdge[]; sourceNode: GraphNode; targetNode: GraphNode },
|
elements: { edges: GraphEdge[]; sourceNode: GraphNode; targetNode: GraphNode },
|
||||||
) => boolean
|
) => boolean
|
||||||
|
|
||||||
|
export type HandleConnectableFunc = (node: GraphNode, connectedEdges: GraphEdge[]) => boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set to true to allow unlimited connections,
|
* set to true to allow unlimited connections,
|
||||||
* single for only one connection
|
* single for only one connection
|
||||||
@@ -29,7 +31,7 @@ export type ValidConnectionFunc = (
|
|||||||
*
|
*
|
||||||
* if set to single and the handle already has more than one connection, it will act the same as setting it to false
|
* if set to single and the handle already has more than one connection, it will act the same as setting it to false
|
||||||
*/
|
*/
|
||||||
export type HandleConnectable = boolean | 'single' | ((node: GraphNode, connectedEdges: GraphEdge[]) => boolean)
|
export type HandleConnectable = boolean | 'single' | HandleConnectableFunc
|
||||||
|
|
||||||
export interface HandleProps {
|
export interface HandleProps {
|
||||||
/** Unique id of handle element */
|
/** Unique id of handle element */
|
||||||
|
|||||||
Reference in New Issue
Block a user