This commit is contained in:
nik
2025-10-03 22:27:28 +03:00
parent 829fad0e17
commit 871cf7e792
16520 changed files with 2967597 additions and 3 deletions

View File

@@ -0,0 +1,3 @@
import type { ExternalDiagramDefinition } from '../../diagram-api/types.js';
declare const plugin: ExternalDiagramDefinition;
export default plugin;

View File

@@ -0,0 +1,2 @@
import type { DiagramDefinition } from '../../diagram-api/types.js';
export declare const diagram: DiagramDefinition;

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,72 @@
import type { D3Element } from '../../types.js';
import type { MindmapNode } from './mindmapTypes.js';
import type { LayoutData, Node, Edge } from '../../rendering-util/types.js';
export type MindmapLayoutNode = Node & {
level: number;
nodeId: string;
type: number;
section?: number;
};
export type MindmapLayoutEdge = Edge & {
depth: number;
section?: number;
};
declare const nodeType: {
readonly DEFAULT: 0;
readonly NO_BORDER: 0;
readonly ROUNDED_RECT: 1;
readonly RECT: 2;
readonly CIRCLE: 3;
readonly CLOUD: 4;
readonly BANG: 5;
readonly HEXAGON: 6;
};
export declare class MindmapDB {
private nodes;
private count;
private elements;
private baseLevel?;
readonly nodeType: typeof nodeType;
constructor();
clear(): void;
getParent(level: number): MindmapNode | null;
getMindmap(): MindmapNode | null;
addNode(level: number, id: string, descr: string, type: number): void;
getType(startStr: string, endStr: string): 0 | 2 | 1 | 3 | 4 | 5 | 6;
setElementForId(id: number, element: D3Element): void;
getElementById(id: number): any;
decorateNode(decoration?: {
class?: string;
icon?: string;
}): void;
type2Str(type: number): string;
/**
* Assign section numbers to nodes based on their position relative to root
* @param node - The mindmap node to process
* @param sectionNumber - The section number to assign (undefined for root)
*/
assignSections(node: MindmapNode, sectionNumber?: number): void;
/**
* Convert mindmap tree structure to flat array of nodes
* @param node - The mindmap node to process
* @param processedNodes - Array to collect processed nodes
*/
flattenNodes(node: MindmapNode, processedNodes: MindmapLayoutNode[]): void;
/**
* Generate edges from parent-child relationships in mindmap tree
* @param node - The mindmap node to process
* @param edges - Array to collect edges
*/
generateEdges(node: MindmapNode, edges: MindmapLayoutEdge[]): void;
/**
* Get structured data for layout algorithms
* Following the pattern established by ER diagrams
* @returns Structured data containing nodes, edges, and config
*/
getData(): LayoutData;
getLogger(): Record<import("../../logger.js").LogLevel, {
(...data: any[]): void;
(message?: any, ...optionalParams: any[]): void;
}>;
}
export {};

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,6 @@
import type { DrawDefinition } from '../../diagram-api/types.js';
export declare const draw: DrawDefinition;
declare const _default: {
draw: DrawDefinition;
};
export default _default;

View File

@@ -0,0 +1,19 @@
import type { RequiredDeep } from 'type-fest';
export interface MindmapNode {
id: number;
nodeId: string;
level: number;
descr: string;
type: number;
children: MindmapNode[];
width: number;
padding: number;
section?: number;
height?: number;
class?: string;
icon?: string;
x?: number;
y?: number;
isRoot?: boolean;
}
export type FilledMindMapNode = RequiredDeep<MindmapNode>;

View File

@@ -0,0 +1,3 @@
import type { DiagramStylesProvider } from '../../diagram-api/types.js';
declare const getStyles: DiagramStylesProvider;
export default getStyles;

View File

@@ -0,0 +1,14 @@
import type { FilledMindMapNode } from './mindmapTypes.js';
import type { D3Element } from '../../types.js';
import type { MermaidConfig } from '../../config.type.js';
import type { MindmapDB } from './mindmapDb.js';
/**
* @param db - The database
* @param elem - The D3 dom element in which the node is to be added
* @param node - The node to be added
* @param fullSection - ?
* @param conf - The configuration object
* @returns The height nodes dom element
*/
export declare const drawNode: (db: MindmapDB, elem: D3Element, node: FilledMindMapNode, fullSection: number, conf: MermaidConfig) => Promise<number>;
export declare const positionNode: (db: MindmapDB, node: FilledMindMapNode) => void;