mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-22 16:59:48 +02:00
refactor(types): fix kanbanItem circular types
Exclude the `node.shape` type from `kanbanItem()`, as otherwise it causes a circular dependency in the types.
This commit is contained in:
@@ -20,11 +20,12 @@ const colorFromPriority = (priority: NonNullable<KanbanNode['priority']>) => {
|
|||||||
return 'lightblue';
|
return 'lightblue';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
export const kanbanItem = async <T extends SVGGraphicsElement>(
|
export async function kanbanItem<T extends SVGGraphicsElement>(
|
||||||
parent: D3Selection<T>,
|
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
|
{ config }: ShapeRenderOptions
|
||||||
) => {
|
) {
|
||||||
const { labelStyles, nodeStyles } = styles2String(kanbanNode);
|
const { labelStyles, nodeStyles } = styles2String(kanbanNode);
|
||||||
kanbanNode.labelStyle = labelStyles;
|
kanbanNode.labelStyle = labelStyles;
|
||||||
|
|
||||||
@@ -160,4 +161,4 @@ export const kanbanItem = async <T extends SVGGraphicsElement>(
|
|||||||
};
|
};
|
||||||
|
|
||||||
return shapeSvg;
|
return shapeSvg;
|
||||||
};
|
}
|
||||||
|
Reference in New Issue
Block a user