From 34e8946c585ac039e0c2b02947d110df1d295c25 Mon Sep 17 00:00:00 2001 From: Alois Klink Date: Tue, 29 Oct 2024 22:17:24 +0900 Subject: [PATCH] refactor(types): fix kanbanItem circular types Exclude the `node.shape` type from `kanbanItem()`, as otherwise it causes a circular dependency in the types. --- .../rendering-elements/shapes/kanbanItem.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/kanbanItem.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/kanbanItem.ts index d19ada7c4..34ba7873d 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/kanbanItem.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/kanbanItem.ts @@ -20,11 +20,12 @@ const colorFromPriority = (priority: NonNullable) => { return 'lightblue'; } }; -export const kanbanItem = async ( +export async function kanbanItem( parent: D3Selection, - kanbanNode: Node | Omit, + // Omit the 'shape' prop since otherwise, it causes a TypeScript circular dependency error + kanbanNode: Omit | Omit, { config }: ShapeRenderOptions -) => { +) { const { labelStyles, nodeStyles } = styles2String(kanbanNode); kanbanNode.labelStyle = labelStyles; @@ -160,4 +161,4 @@ export const kanbanItem = async ( }; return shapeSvg; -}; +}