import type { SemanticLayoutGraph } from '../vein/SemanticLayoutGraph.js'; import type { InferenceResult, TruncationInfo } from '../vein/types.js'; import type { SerializedGraph } from '../../domain/types/serialized-graph.js'; export declare class GraphSerializer { /** * Serialize a SemanticLayoutGraph and its InferenceResult into * a JSON-compatible SerializedGraph. * * @param filePath - Absolute path to the analyzed file * @param graph - The Semantic Layout Graph * @param inference - The inference results * @param truncation - Optional truncation info * @returns A serialized graph ready for JSON.stringify */ serialize(filePath: string, graph: SemanticLayoutGraph, inference: InferenceResult, truncation?: TruncationInfo): SerializedGraph; /** * Build metadata for the snapshot. */ private buildMetadata; /** * Get the current git commit hash. * Falls back to "unknown" if git is not available or not a git repo. */ private getCommitHash; /** * Serialize all nodes into a flat map (keyed by node ID). * Children arrays are emptied to avoid circular references; * parent-child relationships are in the edges array. */ private serializeNodes; /** * Serialize a single LayoutNode to a SerializedNode. */ private serializeNode; /** * Serialize spacing tokens. */ private serializeSpacing; /** * Serialize layout properties. */ private serializeLayout; /** * Serialize token deviations. */ private serializeTokenDeviations; /** * Build the explicit edge list from parent-child relationships. */ private serializeEdges; /** * Build the aggregated details from the graph and inference result. */ private buildDetails; /** * Compute the complexity grade from a health score. */ private computeGrade; } /** * Default directory for storing layout graph snapshots. * Created at the project root. */ export declare const DEFAULT_SNAPSHOT_DIR = ".rhizome"; /** * Derive a snapshot filename from a file path. * E.g., "src/screens/DashboardScreen.tsx" → "dashboard-screen.json" */ export declare function deriveSnapshotName(filePath: string): string; /** * Resolve the full path for a snapshot file. * If snapshotName is provided, uses it; otherwise derives from filePath. */ export declare function resolveSnapshotPath(filePath: string, snapshotName?: string): string; /** * Ensure the .rhizome directory exists. */ export declare function ensureSnapshotDir(): void; /** * Write a serialized graph to a JSON file. */ export declare function writeSnapshot(snapshot: SerializedGraph, outputPath: string): void; /** * Read a serialized graph from a JSON file. */ export declare function readSnapshot(filePath: string): SerializedGraph; //# sourceMappingURL=GraphSerializer.d.ts.map