/**
 * Structural diff and node-view comparison for visible-state diffing.
 *
 * Covers neighbor list comparison, node-view normalization, node/edge set deltas,
 * and the top-level "has anything changed" check.
 * Pure functions — no side effects, no I/O, no classes.
 *
 * @module domain/services/comparison/diffStructure
 */
import type { VisibleNodeView } from '../../types/VisibleNodeView.ts';
import type { VisibleStateNeighbor } from '../../types/VisibleStateNeighbor.ts';
import type { VisibleStateReader } from '../../types/VisibleStateReader.ts';
/**
 * Builds a map from composite neighbor key to neighbor object.
 */
export declare function neighborMap(neighbors: VisibleStateNeighbor[]): Map<string, VisibleStateNeighbor>;
/**
 * Computes the added and removed deltas between two neighbor lists.
 */
export declare function compareNeighborLists(leftNeighbors: VisibleStateNeighbor[], rightNeighbors: VisibleStateNeighbor[]): {
    added: VisibleStateNeighbor[];
    removed: VisibleStateNeighbor[];
};
/**
 * Returns true if any of the provided arrays has at least one entry.
 */
export declare function hasAnyEntries(groups: unknown[][]): boolean;
type NormalizedNodeView = {
    exists: boolean;
    nodeId: string | null;
    props: Record<string, unknown>;
    outgoing: VisibleStateNeighbor[];
    incoming: VisibleStateNeighbor[];
    content: unknown;
};
export declare const EMPTY_NODE_VIEW: NormalizedNodeView;
/**
 * Extracts fields from a non-null node view with defaults applied.
 */
export declare function extractNodeView(view: VisibleNodeView): NormalizedNodeView;
/**
 * Normalizes a nullable node view into a consistent shape with defaults.
 */
export declare function normalizeNodeView(view: VisibleNodeView | null | undefined): NormalizedNodeView;
type NodeViewChangesParams = {
    propertyDelta: {
        added: unknown[];
        removed: unknown[];
        changed: unknown[];
    };
    outgoingDelta: {
        added: unknown[];
        removed: unknown[];
    };
    incomingDelta: {
        added: unknown[];
        removed: unknown[];
    };
    contentChanged: boolean;
    leftExists: boolean;
    rightExists: boolean;
};
/**
 * Determines whether a node view comparison has any structural changes.
 */
export declare function hasNodeViewChanges({ propertyDelta, outgoingDelta, incomingDelta, contentChanged, leftExists, rightExists, }: NodeViewChangesParams): boolean;
export type NodeViewComparison = {
    targetId: string | null;
    leftExists: boolean;
    rightExists: boolean;
    changed: boolean;
    left: VisibleNodeView | null;
    right: VisibleNodeView | null;
    propertyDelta: {
        added: Array<{
            key: string;
            value: unknown;
        }>;
        removed: Array<{
            key: string;
            value: unknown;
        }>;
        changed: Array<{
            key: string;
            leftValue: unknown;
            rightValue: unknown;
        }>;
    };
    outgoingDelta: {
        added: VisibleStateNeighbor[];
        removed: VisibleStateNeighbor[];
    };
    incomingDelta: {
        added: VisibleStateNeighbor[];
        removed: VisibleStateNeighbor[];
    };
    contentChanged: boolean;
};
/**
 * Compares two nullable node views and returns a detailed diff result.
 */
export declare function compareNodeViews(left: VisibleNodeView | null, right: VisibleNodeView | null): NodeViewComparison;
/**
 * Computes the set-difference delta of node IDs between two readers.
 */
export declare function buildNodeDelta(leftReader: VisibleStateReader, rightReader: VisibleStateReader): {
    added: string[];
    removed: string[];
};
/**
 * Computes the set-difference delta of edges between two readers.
 */
export declare function buildEdgeDelta(leftReader: VisibleStateReader, rightReader: VisibleStateReader): {
    added: Array<{
        from: string;
        to: string;
        label: string;
    }>;
    removed: Array<{
        from: string;
        to: string;
        label: string;
    }>;
};
type VisibleStateDeltas = {
    nodeDelta: {
        added: string[];
        removed: string[];
    };
    edgeDelta: {
        added: Array<unknown>;
        removed: Array<unknown>;
    };
    nodePropertyDelta: {
        added: Array<unknown>;
        removed: Array<unknown>;
        changed: Array<unknown>;
    };
    edgePropertyDelta: {
        added: Array<unknown>;
        removed: Array<unknown>;
        changed: Array<unknown>;
    };
};
/**
 * Returns true if any delta array has entries, indicating visible state changes.
 */
export declare function hasVisibleStateChanges({ nodeDelta, edgeDelta, nodePropertyDelta, edgePropertyDelta, }: VisibleStateDeltas): boolean;
/**
 * Normalizes a potentially null or empty target ID to a trimmed string or null.
 */
export declare function normalizeTargetId(targetId: string | undefined | null): string | null;
/**
 * Builds a node-level comparison for a specific target, or undefined if no target.
 */
export declare function buildTargetComparison(leftReader: VisibleStateReader, rightReader: VisibleStateReader, targetId: string | null): NodeViewComparison | undefined;
export {};
