Merge pull request #4343 from xyflow/fix-edge-type-path-options

added straight edge to path built-in-types
This commit is contained in:
Moritz Klack
2024-06-06 12:56:47 +02:00
committed by GitHub
2 changed files with 9 additions and 2 deletions

View File

@@ -60,7 +60,9 @@ type StepEdge<EdgeData extends Record<string, unknown> = Record<string, unknown>
pathOptions?: StepPathOptions;
};
export type BuiltInEdge = SmoothStepEdge | BezierEdge | StepEdge;
type StraightEdge<EdgeData extends Record<string, unknown> = Record<string, unknown>> = Edge<EdgeData, 'straight'>;
export type BuiltInEdge = SmoothStepEdge | BezierEdge | StepEdge | StraightEdge;
export type EdgeMouseHandler<EdgeType extends Edge = Edge> = (event: ReactMouseEvent, edge: EdgeType) => void;

View File

@@ -44,7 +44,12 @@ type StepEdge<EdgeData extends Record<string, unknown> = Record<string, unknown>
pathOptions?: StepPathOptions;
};
export type BuiltInEdge = SmoothStepEdge | BezierEdge | StepEdge;
type StraightEdge<EdgeData extends Record<string, unknown> = Record<string, unknown>> = Edge<
EdgeData,
'straight'
>;
export type BuiltInEdge = SmoothStepEdge | BezierEdge | StepEdge | StraightEdge;
/**
* Custom edge component props.