Skip to content

Commit

Permalink
refactor(types): fix kanbanItem circular types
Browse files Browse the repository at this point in the history
Exclude the `node.shape` type from `kanbanItem()`, as otherwise it
causes a circular dependency in the types.
  • Loading branch information
aloisklink committed Oct 29, 2024
1 parent 0197c08 commit 34e8946
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ const colorFromPriority = (priority: NonNullable<KanbanNode['priority']>) => {
return 'lightblue';
}
};
export const kanbanItem = async <T extends SVGGraphicsElement>(
export async function kanbanItem<T extends SVGGraphicsElement>(
parent: D3Selection<T>,
kanbanNode: Node | Omit<KanbanNode, 'level'>,
// Omit the 'shape' prop since otherwise, it causes a TypeScript circular dependency error
kanbanNode: Omit<Node, 'shape'> | Omit<KanbanNode, 'level' | 'shape'>,
{ config }: ShapeRenderOptions
) => {
) {
const { labelStyles, nodeStyles } = styles2String(kanbanNode);
kanbanNode.labelStyle = labelStyles;

Expand Down Expand Up @@ -160,4 +161,4 @@ export const kanbanItem = async <T extends SVGGraphicsElement>(
};

return shapeSvg;
};
}

0 comments on commit 34e8946

Please sign in to comment.