mermaid
Version:
Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.
39 lines (38 loc) • 1.21 kB
TypeScript
import type { Selection } from 'd3-selection';
import type { TreeViewDiagramConfig } from '../../config.type.js';
import type { DiagramDBBase } from '../../diagram-api/types.js';
interface BBox {
x: number;
y: number;
width: number;
height: number;
}
export type NodeType = 'file' | 'directory';
export interface Node {
id: number;
level: number;
name: string;
nodeType: NodeType;
/** Iconify icon reference (`pack:name`), a built-in icon (`file`/`folder`), or `none` */
icon?: string;
cssClass?: string;
description?: string;
BBox?: BBox;
children: Node[];
}
export interface TreeViewDB extends DiagramDBBase<TreeViewDiagramConfig> {
addNode: (level: number, name: string, nodeType: NodeType, cssClass?: string, icon?: string, description?: string) => void;
getRoot: () => Node;
getCount: () => number;
}
export interface TreeViewDiagramStyles {
labelColor?: string;
labelFontSize?: string;
lineColor?: string;
iconColor?: string;
descriptionColor?: string;
highlightBg?: string;
highlightStroke?: string;
}
export type D3SVGElement<T extends SVGElement> = Selection<T, unknown, Element | null, unknown>;
export {};