chore(types): add tsdocs

This commit is contained in:
moklick
2025-02-11 17:57:21 +01:00
parent 7b0f96f017
commit 381ed2a5bf
34 changed files with 264 additions and 100 deletions
+8 -6
View File
@@ -4,9 +4,10 @@ import { isNodeBase, isEdgeBase } from '@xyflow/system';
import type { Edge, Node } from '../types';
/**
* Test whether an object is useable as an [`Node`](/api-reference/types/node). In TypeScript
*this is a type guard that will narrow the type of whatever you pass in to
*[`Node`](/api-reference/types/node) if it returns `true`.
* Test whether an object is useable as an [`Node`](/api-reference/types/node).
* In TypeScript this is a type guard that will narrow the type of whatever you pass in to
* [`Node`](/api-reference/types/node) if it returns `true`.
*
* @public
* @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true
* @param element - The element to test
@@ -25,9 +26,10 @@ export const isNode = <NodeType extends Node = Node>(element: unknown): element
isNodeBase<NodeType>(element);
/**
* Test whether an object is useable as an [`Edge`](/api-reference/types/edge). In TypeScript
*this is a type guard that will narrow the type of whatever you pass in to
*[`Edge`](/api-reference/types/edge) if it returns `true`.
* Test whether an object is useable as an [`Edge`](/api-reference/types/edge).
* In TypeScript this is a type guard that will narrow the type of whatever you pass in to
* [`Edge`](/api-reference/types/edge) if it returns `true`.
*
* @public
* @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true
* @param element - The element to test