diff --git a/packages/core/src/types/edge.ts b/packages/core/src/types/edge.ts index 7cdc7634..0ab54872 100644 --- a/packages/core/src/types/edge.ts +++ b/packages/core/src/types/edge.ts @@ -45,7 +45,20 @@ export type EdgeMarkerType = string | MarkerType | EdgeMarker export type EdgeUpdatable = boolean | 'target' | 'source' -export interface Edge = any> { +export interface EdgeLabelOptions { + /** Label styles (CSSProperties) */ + labelStyle?: CSSProperties + /** Show label bg */ + labelShowBg?: boolean + /** Label Bg styles (CSSProperties) */ + labelBgStyle?: CSSProperties + /** Label Bg padding */ + labelBgPadding?: [number, number] + /** Label Bg border radius */ + labelBgBorderRadius?: number +} + +interface DefaultEdge = any> extends EdgeLabelOptions { /** Unique edge id */ id: string /** An edge label */ @@ -60,16 +73,6 @@ export interface Edge> } +export interface SmoothStepPathOptions { + offset?: number + borderRadius?: number +} + +type SmoothStepEdgeType = any> = DefaultEdge< + Data, + CustomEvents +> & { + type: 'smoothstep' + pathOptions?: SmoothStepPathOptions +} + +export interface BezierPathOptions { + curvature?: number +} + +type BezierEdgeType = any> = DefaultEdge< + Data, + CustomEvents +> & { + type: 'default' + pathOptions?: BezierPathOptions +} + +export type Edge = any> = + | DefaultEdge + | SmoothStepEdgeType + | BezierEdgeType + export type DefaultEdgeOptions = Omit export interface EdgePositions {