From 36657cd66322c911e87eb37275c584a80025adfe Mon Sep 17 00:00:00 2001 From: Dimitri POSTOLOV Date: Tue, 1 Apr 2025 20:40:41 +0200 Subject: [PATCH] fix: improve TSDoc comments for `EdgeBase` --- .changeset/itchy-terms-carry.md | 5 +++++ packages/system/src/types/edges.ts | 29 +++++++++++++---------------- 2 files changed, 18 insertions(+), 16 deletions(-) create mode 100644 .changeset/itchy-terms-carry.md diff --git a/.changeset/itchy-terms-carry.md b/.changeset/itchy-terms-carry.md new file mode 100644 index 00000000..f7760c4d --- /dev/null +++ b/.changeset/itchy-terms-carry.md @@ -0,0 +1,5 @@ +--- +'@xyflow/system': patch +--- + +fix: improve TSDoc comments for `EdgeBase` diff --git a/packages/system/src/types/edges.ts b/packages/system/src/types/edges.ts index 76382e73..c0568200 100644 --- a/packages/system/src/types/edges.ts +++ b/packages/system/src/types/edges.ts @@ -4,44 +4,41 @@ export type EdgeBase< EdgeData extends Record = Record, EdgeType extends string | undefined = string | undefined > = { - /** Unique id of an edge */ + /** Unique id of an edge. */ id: string; - /** Type of an edge defined in edgeTypes */ + /** Type of edge defined in `edgeTypes`. */ type?: EdgeType; - /** Id of source node */ + /** Id of source node. */ source: string; - /** Id of target node */ + /** Id of target node. */ target: string; - /** - * Id of source handle - * only needed if there are multiple handles per node - */ + /** Id of source handle, only needed if there are multiple handles per node. */ sourceHandle?: string | null; - /** - * Id of target handle - * only needed if there are multiple handles per node - */ + /** Id of target handle, only needed if there are multiple handles per node. */ targetHandle?: string | null; animated?: boolean; hidden?: boolean; deletable?: boolean; selectable?: boolean; - /** Arbitrary data passed to an edge */ + /** Arbitrary data passed to an edge. */ data?: EdgeData; selected?: boolean; /** - * Set the marker on the beginning of an edge + * Set the marker on the beginning of an edge. * @example 'arrow', 'arrowclosed' or custom marker */ markerStart?: EdgeMarkerType; /** - * Set the marker on the end of an edge + * Set the marker on the end of an edge. * @example 'arrow', 'arrowclosed' or custom marker */ markerEnd?: EdgeMarkerType; zIndex?: number; ariaLabel?: string; - /** Padding around the edge where interaction is still possible */ + /** + * ReactFlow renders an invisible path around each edge to make them easier to click or tap on. + * This property sets the width of that invisible path. + */ interactionWidth?: number; };