From 82dddb25799426e41e40b93a0719944669ce8b91 Mon Sep 17 00:00:00 2001 From: peterkogo Date: Wed, 5 Jun 2024 17:21:41 +0200 Subject: [PATCH] added straight edge to path built-in-types --- packages/react/src/types/edges.ts | 4 +++- packages/svelte/src/lib/types/edges.ts | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/react/src/types/edges.ts b/packages/react/src/types/edges.ts index 76690161..b85612f9 100644 --- a/packages/react/src/types/edges.ts +++ b/packages/react/src/types/edges.ts @@ -60,7 +60,9 @@ type StepEdge = Record pathOptions?: StepPathOptions; }; -export type BuiltInEdge = SmoothStepEdge | BezierEdge | StepEdge; +type StraightEdge = Record> = Edge; + +export type BuiltInEdge = SmoothStepEdge | BezierEdge | StepEdge | StraightEdge; export type EdgeMouseHandler = (event: ReactMouseEvent, edge: EdgeType) => void; diff --git a/packages/svelte/src/lib/types/edges.ts b/packages/svelte/src/lib/types/edges.ts index b9700292..de1def91 100644 --- a/packages/svelte/src/lib/types/edges.ts +++ b/packages/svelte/src/lib/types/edges.ts @@ -44,7 +44,12 @@ type StepEdge = Record pathOptions?: StepPathOptions; }; -export type BuiltInEdge = SmoothStepEdge | BezierEdge | StepEdge; +type StraightEdge = Record> = Edge< + EdgeData, + 'straight' +>; + +export type BuiltInEdge = SmoothStepEdge | BezierEdge | StepEdge | StraightEdge; /** * Custom edge component props.