chore(libs): add tsdoc annotations

This commit is contained in:
moklick
2025-06-23 09:30:32 +02:00
parent f9971a8fad
commit fd9851fab8
3 changed files with 40 additions and 0 deletions
+12
View File
@@ -21,8 +21,16 @@ export type ConnectionData = {
connectionStatus: string | null;
};
/**
* @inline
*/
export type FitViewOptions<NodeType extends Node = Node> = FitViewOptionsBase<NodeType>;
/**
* This type can be used to type the `onDelete` function with a custom node and edge type.
*
* @public
*/
export type OnDelete<NodeType extends Node = Node, EdgeType extends Edge = Edge> = (params: {
nodes: NodeType[];
edges: EdgeType[];
@@ -40,6 +48,10 @@ export type OnBeforeDelete<
EdgeType extends Edge = Edge
> = OnBeforeDeleteBase<NodeType, EdgeType>;
/**
* This type can be used to type the `isValidConnection` function.
* If the function returns `true`, the connection is valid and can be created.
*/
export type IsValidConnection<EdgeType extends Edge = Edge> = (
edge: EdgeType | Connection
) => boolean;