Skip to content

Commit 4bc70b7

Browse files
refactor: use more standard types
See: #5974 (comment) See: #5974 (comment) Co-authored-by: saurabhg772244 <[email protected]>
1 parent 606ecf8 commit 4bc70b7

File tree

2 files changed

+4
-8
lines changed
  • packages

2 files changed

+4
-8
lines changed

packages/mermaid-layout-elk/src/render.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import ELK from 'elkjs/lib/elk.bundled.js';
33
import type { InternalHelpers, LayoutData, RenderOptions, SVG, SVGGroup } from 'mermaid';
44
import { type TreeData, findCommonAncestor } from './find-common-ancestor.js';
55

6-
type Node = LayoutData['nodes'][0];
6+
type Node = LayoutData['nodes'][number];
77

88
interface NodeWithVertex extends Omit<Node, 'domId'> {
99
children?: unknown[];

packages/mermaid/src/rendering-util/rendering-elements/nodes.ts

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { log } from '../../logger.js';
22
import { shapes } from './shapes.js';
3-
import type { Node } from '../types.js';
4-
import type { MermaidConfig, SVGGroup } from '../../mermaid.js';
3+
import type { Node, ShapeRenderOptions } from '../types.js';
4+
import type { SVGGroup } from '../../mermaid.js';
55
import type { D3Selection } from '../../types.js';
66
import type { graphlib } from 'dagre-d3-es';
77

@@ -10,11 +10,7 @@ type NodeElement = D3Selection<SVGAElement> | Awaited<ReturnType<ShapeHandler>>;
1010

1111
const nodeElems = new Map<string, NodeElement>();
1212

13-
export async function insertNode(
14-
elem: SVGGroup,
15-
node: Node,
16-
renderOptions: { config: MermaidConfig; dir: Node['dir'] }
17-
) {
13+
export async function insertNode(elem: SVGGroup, node: Node, renderOptions: ShapeRenderOptions) {
1814
let newEl: NodeElement | undefined;
1915
let el;
2016

0 commit comments

Comments
 (0)