fix: improve TSDoc comments for NodeResizerProps and ResizeControlProps

This commit is contained in:
Dimitri POSTOLOV
2025-04-01 20:38:33 +02:00
parent 245b6265a6
commit 754a167134
2 changed files with 42 additions and 18 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@xyflow/react': patch
---
fix: improve TSDoc comments for `NodeResizerProps` and `ResizeControlProps`
@@ -14,39 +14,57 @@ import type {
*/ */
export type NodeResizerProps = { export type NodeResizerProps = {
/** /**
* Id of the node it is resizing * Id of the node it is resizing.
* @remarks optional if used inside custom node * @remarks optional if used inside custom node
*/ */
nodeId?: string; nodeId?: string;
/** Color of the resize handle */ /** Color of the resize handle. */
color?: string; color?: string;
/** ClassName applied to handle */ /** Class name applied to handle. */
handleClassName?: string; handleClassName?: string;
/** Style applied to handle */ /** Style applied to handle. */
handleStyle?: CSSProperties; handleStyle?: CSSProperties;
/** ClassName applied to line */ /** Class name applied to line. */
lineClassName?: string; lineClassName?: string;
/** Style applied to line */ /** Style applied to line. */
lineStyle?: CSSProperties; lineStyle?: CSSProperties;
/** Are the controls visible */ /**
* Are the controls visible.
* @default true
*/
isVisible?: boolean; isVisible?: boolean;
/** Minimum width of node */ /**
* Minimum width of node.
* @default 10
*/
minWidth?: number; minWidth?: number;
/** Minimum height of node */ /**
* Minimum height of node.
* @default 10
*/
minHeight?: number; minHeight?: number;
/** Maximum width of node */ /**
* Maximum width of node.
* @default Number.MAX_VALUE
*/
maxWidth?: number; maxWidth?: number;
/** Maximum height of node */ /**
* Maximum height of node.
* @default Number.MAX_VALUE
*/
maxHeight?: number; maxHeight?: number;
/** Keep aspect ratio when resizing */ /**
* Keep aspect ratio when resizing.
* @default false
*/
keepAspectRatio?: boolean; keepAspectRatio?: boolean;
/** Callback to determine if node should resize */ /** Callback to determine if node should resize. */
shouldResize?: ShouldResize; shouldResize?: ShouldResize;
/** Callback called when resizing starts */ /** Callback called when resizing starts. */
onResizeStart?: OnResizeStart; onResizeStart?: OnResizeStart;
/** Callback called when resizing */ /** Callback called when resizing. */
onResize?: OnResize; onResize?: OnResize;
/** Callback called when resizing ends */ /** Callback called when resizing ends. */
onResizeEnd?: OnResizeEnd; onResizeEnd?: OnResizeEnd;
}; };
@@ -68,13 +86,14 @@ export type ResizeControlProps = Pick<
| 'onResizeEnd' | 'onResizeEnd'
> & { > & {
/** /**
* Position of the control * Position of the control.
* @example ControlPosition.TopLeft, ControlPosition.TopRight, * @example ControlPosition.TopLeft, ControlPosition.TopRight,
* ControlPosition.BottomLeft, ControlPosition.BottomRight * ControlPosition.BottomLeft, ControlPosition.BottomRight
*/ */
position?: ControlPosition; position?: ControlPosition;
/** /**
* Variant of the control * Variant of the control.
* @default "handle"
* @example ResizeControlVariant.Handle, ResizeControlVariant.Line * @example ResizeControlVariant.Handle, ResizeControlVariant.Line
*/ */
variant?: ResizeControlVariant; variant?: ResizeControlVariant;