chore(types): cleanup comments
This commit is contained in:
@@ -5,17 +5,17 @@ export type BaseEdgeProps = Pick<
|
||||
'interactionWidth' | 'label' | 'labelStyle' | 'style'
|
||||
> & {
|
||||
id?: string;
|
||||
/** svg path of the edge */
|
||||
/** SVG path of the edge */
|
||||
path: string;
|
||||
/** x coordinate of the label */
|
||||
/** The x coordinate of the label */
|
||||
labelX?: number;
|
||||
/** y coordinate of the label */
|
||||
/** The y coordinate of the label */
|
||||
labelY?: number;
|
||||
/** marker at start of edge
|
||||
/** Marker at start of edge
|
||||
* @example 'url(#arrow)'
|
||||
*/
|
||||
markerStart?: string;
|
||||
/** marker at end of edge
|
||||
/** Marker at end of edge
|
||||
* @example 'url(#arrow)'
|
||||
*/
|
||||
markerEnd?: string;
|
||||
|
||||
@@ -36,7 +36,9 @@ import type {
|
||||
import type { Writable } from 'svelte/store';
|
||||
|
||||
export type SvelteFlowProps = DOMAttributes<HTMLDivElement> & {
|
||||
/** id of the flow
|
||||
/** The id of the flow
|
||||
*
|
||||
* This is necessary if you want to render multiple flows.
|
||||
* @optional
|
||||
*/
|
||||
id?: string;
|
||||
@@ -99,7 +101,7 @@ export type SvelteFlowProps = DOMAttributes<HTMLDivElement> & {
|
||||
* @default 'Meta' for macOS, "Ctrl" for other systems
|
||||
*/
|
||||
multiSelectionKey?: KeyDefinition | null;
|
||||
/**If a key is set, you can zoom the viewport while that key is held down even if panOnScroll is set to false.
|
||||
/** If a key is set, you can zoom the viewport while that key is held down even if panOnScroll is set to false.
|
||||
*
|
||||
* By setting this prop to null you can disable this functionality.
|
||||
* @default 'Meta' for macOS, "Ctrl" for other systems
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -23,26 +23,26 @@ export type ConnectionData = {
|
||||
};
|
||||
|
||||
export type HandleComponentProps = {
|
||||
/** type of the handle
|
||||
/** Type of the handle
|
||||
* @example HandleType.Source, HandleType.Target
|
||||
*/
|
||||
type: HandleType;
|
||||
/** position of the handle
|
||||
/** Position of the handle
|
||||
* @example Position.TopLeft, Position.TopRight,
|
||||
* Position.BottomLeft, Position.BottomRight
|
||||
*/
|
||||
position?: Position;
|
||||
/** id of the handle
|
||||
/** Id of the handle
|
||||
* @remarks optional if there is only one handle of this type
|
||||
*/
|
||||
id?: string;
|
||||
class?: string;
|
||||
style?: string;
|
||||
/** should you be able to connect from/to this handle */
|
||||
/** Should you be able to connect from/to this handle */
|
||||
isConnectable?: boolean;
|
||||
/** shoould you be able to connect from this handle */
|
||||
/** Shoould you be able to connect from this handle */
|
||||
isConnectableStart?: boolean;
|
||||
/** should you be able to connect to this handle */
|
||||
/** Should you be able to connect to this handle */
|
||||
isConnectableEnd?: boolean;
|
||||
onconnect?: (connections: Connection[]) => void;
|
||||
ondisconnect?: (connections: Connection[]) => void;
|
||||
|
||||
Reference in New Issue
Block a user