import type { Action, Diagram } from './types'; type ActionIndex = number; export declare enum MoveType { AdvanceBoth = 1, DeleteLeft = 2, InsertRight = 3, Change = 4, Move = 5 } export type Position = { lNode: ActionIndex; rNode: ActionIndex; }; export declare class Move { moveType: MoveType; lNode: number; rNode: number; cost: number; constructor(position: Position, moveType: MoveType, cost?: number); } export type Diff = { baseActions: Action[]; headActions: Action[]; moves: Move[]; }; export type DiffOptions = { verbose?: boolean; }; /** * Diff two diagrams, respecting their tree structure. * * Nodes are matched only within the children of an already-matched pair of parents, * so a node can never be paired with a node under a different parent. At each level * the children lists are aligned by lowest cost (Dijkstra over the pair of lists): * * - advance both: the two nodes have the same digest; costs the alignment of their * children (0 when the whole subtrees are identical) * - change: same caller, callee, and node type, different digest (a rename, a * changed query, a different return); costs Change plus the children * - delete left / insert right: costs 2 per node in the subtree, or the Move cost * when the same subtree exists anywhere on the other side * * Then a recovery pass turns a deleted subtree and an inserted subtree with the same * subtree digest into one Move: the block relocated unchanged. The result is in * head pre-order, with deleted nodes interleaved where they were, so a parent's move * always precedes its children's. buildDiffDiagram relies on that order. */ export default function diff(baseDiagram: Diagram, headDiagram: Diagram, diffOptions?: DiffOptions): Diff; export {};