refactor(elk): add LabelData type for layout-elk

I don't know what exactly the type does or is for, but I've tried to
type it to what it seems to be.
This commit is contained in:
Alois Klink
2024-10-21 22:10:57 +09:00
parent 4bc70b7325
commit 6cc0132e0a

View File

@@ -5,9 +5,16 @@ import { type TreeData, findCommonAncestor } from './find-common-ancestor.js';
type Node = LayoutData['nodes'][number];
interface LabelData {
width: number;
height: number;
wrappingWidth?: number;
labelNode?: SVGGElement | null;
}
interface NodeWithVertex extends Omit<Node, 'domId'> {
children?: unknown[];
labelData?: any;
labelData?: LabelData;
domId?: Node['domId'] | SVGGroup | d3.Selection<SVGAElement, unknown, Element | null, unknown>;
}
@@ -38,7 +45,7 @@ export const render = async (
nodeArr: Node[],
node: Node
) => {
const labelData: any = { width: 0, height: 0 };
const labelData: LabelData = { width: 0, height: 0 };
const config = getConfig();