mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
refactor: use more standard types
See: https://github.com/mermaid-js/mermaid/pull/5974#discussion_r1806473749 See: https://github.com/mermaid-js/mermaid/pull/5974#discussion_r1808511738 Co-authored-by: saurabhg772244 <saurabh@mermaidchart.com>
This commit is contained in:
@@ -3,7 +3,7 @@ import ELK from 'elkjs/lib/elk.bundled.js';
|
||||
import type { InternalHelpers, LayoutData, RenderOptions, SVG, SVGGroup } from 'mermaid';
|
||||
import { type TreeData, findCommonAncestor } from './find-common-ancestor.js';
|
||||
|
||||
type Node = LayoutData['nodes'][0];
|
||||
type Node = LayoutData['nodes'][number];
|
||||
|
||||
interface NodeWithVertex extends Omit<Node, 'domId'> {
|
||||
children?: unknown[];
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { log } from '../../logger.js';
|
||||
import { shapes } from './shapes.js';
|
||||
import type { Node } from '../types.js';
|
||||
import type { MermaidConfig, SVGGroup } from '../../mermaid.js';
|
||||
import type { Node, ShapeRenderOptions } from '../types.js';
|
||||
import type { SVGGroup } from '../../mermaid.js';
|
||||
import type { D3Selection } from '../../types.js';
|
||||
import type { graphlib } from 'dagre-d3-es';
|
||||
|
||||
@@ -10,11 +10,7 @@ type NodeElement = D3Selection<SVGAElement> | Awaited<ReturnType<ShapeHandler>>;
|
||||
|
||||
const nodeElems = new Map<string, NodeElement>();
|
||||
|
||||
export async function insertNode(
|
||||
elem: SVGGroup,
|
||||
node: Node,
|
||||
renderOptions: { config: MermaidConfig; dir: Node['dir'] }
|
||||
) {
|
||||
export async function insertNode(elem: SVGGroup, node: Node, renderOptions: ShapeRenderOptions) {
|
||||
let newEl: NodeElement | undefined;
|
||||
let el;
|
||||
|
||||
|
Reference in New Issue
Block a user