diff --git a/.changeset/flat-taxis-provide.md b/.changeset/flat-taxis-provide.md new file mode 100644 index 00000000..d9856d36 --- /dev/null +++ b/.changeset/flat-taxis-provide.md @@ -0,0 +1,5 @@ +--- +'@xyflow/react': patch +--- + +fix: improve TSDoc comments for `NodeResizerProps` and `ResizeControlProps` diff --git a/packages/react/src/additional-components/NodeResizer/types.ts b/packages/react/src/additional-components/NodeResizer/types.ts index 1295440f..e34329b1 100644 --- a/packages/react/src/additional-components/NodeResizer/types.ts +++ b/packages/react/src/additional-components/NodeResizer/types.ts @@ -14,39 +14,57 @@ import type { */ export type NodeResizerProps = { /** - * Id of the node it is resizing + * Id of the node it is resizing. * @remarks optional if used inside custom node */ nodeId?: string; - /** Color of the resize handle */ + /** Color of the resize handle. */ color?: string; - /** ClassName applied to handle */ + /** Class name applied to handle. */ handleClassName?: string; - /** Style applied to handle */ + /** Style applied to handle. */ handleStyle?: CSSProperties; - /** ClassName applied to line */ + /** Class name applied to line. */ lineClassName?: string; - /** Style applied to line */ + /** Style applied to line. */ lineStyle?: CSSProperties; - /** Are the controls visible */ + /** + * Are the controls visible. + * @default true + */ isVisible?: boolean; - /** Minimum width of node */ + /** + * Minimum width of node. + * @default 10 + */ minWidth?: number; - /** Minimum height of node */ + /** + * Minimum height of node. + * @default 10 + */ minHeight?: number; - /** Maximum width of node */ + /** + * Maximum width of node. + * @default Number.MAX_VALUE + */ maxWidth?: number; - /** Maximum height of node */ + /** + * Maximum height of node. + * @default Number.MAX_VALUE + */ maxHeight?: number; - /** Keep aspect ratio when resizing */ + /** + * Keep aspect ratio when resizing. + * @default false + */ keepAspectRatio?: boolean; - /** Callback to determine if node should resize */ + /** Callback to determine if node should resize. */ shouldResize?: ShouldResize; - /** Callback called when resizing starts */ + /** Callback called when resizing starts. */ onResizeStart?: OnResizeStart; - /** Callback called when resizing */ + /** Callback called when resizing. */ onResize?: OnResize; - /** Callback called when resizing ends */ + /** Callback called when resizing ends. */ onResizeEnd?: OnResizeEnd; }; @@ -68,13 +86,14 @@ export type ResizeControlProps = Pick< | 'onResizeEnd' > & { /** - * Position of the control + * Position of the control. * @example ControlPosition.TopLeft, ControlPosition.TopRight, * ControlPosition.BottomLeft, ControlPosition.BottomRight */ position?: ControlPosition; /** - * Variant of the control + * Variant of the control. + * @default "handle" * @example ResizeControlVariant.Handle, ResizeControlVariant.Line */ variant?: ResizeControlVariant;