import { ProofInnerNode } from "../proof/proof-inner-node.cjs"; import { ImmutableTree } from "../immutable-tree.cjs"; import { Node } from "ts-graphviz"; //#region src/visualization/tree-graphviz.d.ts /** * Options for customizing graph visualization. */ interface GraphOptions { /** * Maximum length for displaying keys and values */ maxLabelLength?: number; /** * Whether to show node versions */ showVersions?: boolean; /** * Whether to show node heights */ showHeights?: boolean; /** * Whether to show hash values */ showHashes?: boolean; /** * Path to highlight in the visualization */ highlightPath?: ProofInnerNode[]; /** * Whether to show node keys */ showNodeKeys?: boolean; } /** * Creates a GraphViz DOT representation of an IAVL tree. * * Based on Go IAVL WriteDotGraphv2 * * @param tree - The tree to visualize * @param options - Visualization options * @returns DOT format string */ declare function writeDOTGraph(tree: ImmutableTree, options?: GraphOptions): Promise; /** * Writes a DOT graph to a file. * * Usage: * ```typescript * await writeDOTGraphToFile("tree.dot", tree); * // Then visualize with: dot tree.dot -Tpng -o tree.png * ``` * * Based on Go IAVL WriteDOTGraphToFile * * @param filename - Output file path * @param tree - Tree to visualize * @param options - Visualization options */ declare function writeDOTGraphToFile(filename: string, tree: ImmutableTree, options?: GraphOptions): Promise; /** * Generates a simplified graph focused on tree structure. * Shows only keys and basic structure without additional metadata. * * @param tree - Tree to visualize * @returns Simplified DOT format string */ declare function writeSimpleDOTGraph(tree: ImmutableTree): Promise; /** * Generates a detailed graph with all available information. * Useful for debugging tree state and structure. * * @param tree - Tree to visualize * @returns Detailed DOT format string */ declare function writeDetailedDOTGraph(tree: ImmutableTree): Promise; /** * Creates a graph showing the path taken for a proof. * * @param tree - Tree containing the proof path * @param key - Key for which proof was generated * @returns DOT format string with highlighted proof path */ declare function writeProofPathGraph(tree: ImmutableTree, key: Uint8Array): Promise; /** * Utility class for building and manipulating tree graphs. */ declare class TreeGraphBuilder { private graph; private nodeMap; constructor(name?: string); /** * Adds a node to the graph. */ addNode(id: string, label: string, attrs?: Record): Node; /** * Adds an edge between nodes. */ addEdge(fromId: string, toId: string, label?: string): void; /** * Gets the DOT representation. */ toDot(): string; /** * Builds a graph from an IAVL tree. */ static fromTree(tree: ImmutableTree, options?: GraphOptions): Promise; } //#endregion export { GraphOptions, TreeGraphBuilder, writeDOTGraph, writeDOTGraphToFile, writeDetailedDOTGraph, writeProofPathGraph, writeSimpleDOTGraph }; //# sourceMappingURL=tree-graphviz.d.cts.map