chore(types): cleanup comments

This commit is contained in:
moklick
2024-01-16 18:09:54 +01:00
parent 897c9afdf6
commit 25576cd5d5
18 changed files with 178 additions and 162 deletions
@@ -6,21 +6,21 @@ export enum BackgroundVariant {
export type BackgroundProps = {
id?: string;
/** color of the background */
/** Color of the background */
bgColor?: string;
/** color of the pattern */
/** Color of the pattern */
patternColor?: string;
/** class applied to the pattern */
/** Class applied to the pattern */
patternClass?: string;
/** class applied to the container */
/** Class applied to the container */
class?: string;
/** gap between repetitions of the pattern */
/** Gap between repetitions of the pattern */
gap?: number | [number, number];
/** size of a single pattern element */
/** Size of a single pattern element */
size?: number;
/** line width of the Line pattern */
/** Line width of the Line pattern */
lineWidth?: number;
/** variant of the pattern
/** Variant of the pattern
* @example BackgroundVariant.Lines, BackgroundVariant.Dots, BackgroundVariant.Cross
* 'lines', 'dots', 'cross'
*/
@@ -1,16 +1,16 @@
import type { PanelPosition } from '@xyflow/system';
export type ControlsProps = {
/** position of the controls on the pane
/** Position of the controls on the pane
* @example PanelPosition.TopLeft, PanelPosition.TopRight,
* PanelPosition.BottomLeft, PanelPosition.BottomRight
*/
position?: PanelPosition;
/** show button for zoom in/out */
/** Show button for zoom in/out */
showZoom?: boolean;
/** show button for fit view */
/** Show button for fit view */
showFitView?: boolean;
/** show button for toggling interactivity */
/** Show button for toggling interactivity */
showLock?: boolean;
buttonBgColor?: string;
buttonBgColorHover?: string;
@@ -5,45 +5,45 @@ import type { Node } from '$lib/types';
export type GetMiniMapNodeAttribute = (node: Node) => string;
export type MiniMapProps = {
/** background color of minimap */
/** Background color of minimap */
bgColor?: string;
/** color of nodes on the minimap */
/** Color of nodes on the minimap */
nodeColor?: string | GetMiniMapNodeAttribute;
/** stroke color of nodes on the minimap */
/** Stroke color of nodes on the minimap */
nodeStrokeColor?: string | GetMiniMapNodeAttribute;
/** class applied to nodes on the minimap */
/** Class applied to nodes on the minimap */
nodeClass?: string | GetMiniMapNodeAttribute;
/** border radius of nodes on the minimap */
/** Border radius of nodes on the minimap */
nodeBorderRadius?: number;
/** stroke width of nodes on the minimap */
/** Stroke width of nodes on the minimap */
nodeStrokeWidth?: number;
/** color of the mask representing viewport */
/** Color of the mask representing viewport */
maskColor?: string;
/** stroke color of the mask representing viewport */
/** Stroke color of the mask representing viewport */
maskStrokeColor?: string;
/** stroke width of the mask representing viewport */
/** Stroke width of the mask representing viewport */
maskStrokeWidth?: number;
/** position of the minimap on the pane
/** Position of the minimap on the pane
* @example PanelPosition.TopLeft, PanelPosition.TopRight,
* PanelPosition.BottomLeft, PanelPosition.BottomRight
*/
position?: PanelPosition;
/** class applied to container */
/** Class applied to container */
class?: string;
/** style applied to container */
/** Style applied to container */
style?: string;
/** aria-label applied to container */
/** The aria-label applied to container */
ariaLabel?: string | null;
/** width of minimap */
/** Width of minimap */
width?: number;
/** height of minimap */
/** Height of minimap */
height?: number;
// onClick?: (event: MouseEvent, position: XYPosition) => void;
// onNodeClick?: (event: MouseEvent, node: Node) => void;
pannable?: boolean;
zoomable?: boolean;
/** invert the direction when panning the minimap viewport */
/** Invert the direction when panning the minimap viewport */
inversePan?: boolean;
/** step size for zooming in/out */
/** Step size for zooming in/out */
zoomStep?: number;
};
@@ -8,39 +8,39 @@ import type {
} from '@xyflow/system';
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;
/** class applied to handle */
/** Class applied to handle */
handleClass?: string;
/** style applied to handle */
/** Style applied to handle */
handleStyle?: string;
/** class applied to line */
/** Class applied to line */
lineClass?: string;
/** style applied to line */
/** Style applied to line */
lineStyle?: string;
/** are the controls visible */
/** Are the controls visible */
isVisible?: boolean;
/** minimum width of node */
/** Minimum width of node */
minWidth?: number;
/** minimum height of node */
/** Minimum height of node */
minHeight?: number;
/** maximum width of node */
/** Maximum width of node */
maxWidth?: number;
/** maximum height of node */
/** Maximum height of node */
maxHeight?: number;
/** keep aspect ratio when resizing */
/** Keep aspect ratio when resizing */
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;
};
@@ -58,12 +58,12 @@ export type ResizeControlProps = Pick<
| 'onResize'
| 'onResizeEnd'
> & {
/** position of control
/** Position of control
* @example ControlPosition.TopLeft, ControlPosition.TopRight,
* ControlPosition.BottomLeft, ControlPosition.BottomRight
*/
position?: ControlPosition;
/** variant of control
/** Variant of control
* @example ResizeControlVariant.Handle, ResizeControlVariant.Line
*/
variant?: ResizeControlVariant;
@@ -1,18 +1,19 @@
import type { Position, Align } from '@xyflow/system';
export type NodeToolbarProps = {
/** id of the node, or array of ids the toolbar should be displayed at */
/** The id of the node, or array of ids the toolbar should be displayed at */
nodeId?: string | string[];
/** position of the toolbar relative to the node
/** Position of the toolbar relative to the node
* @example Position.TopLeft, Position.TopRight,
* Position.BottomLeft, Position.BottomRight
*/
position?: Position;
/** align the toolbar relative to the node
/** Align the toolbar relative to the node
* @example Align.Start, Align.Center, Align.End
*/
align?: Align;
/** offset the toolbar from the node */
/** Offset the toolbar from the node */
offset?: number;
/** If true, node toolbar is visible even if node is not selected */
isVisible?: boolean;
};