/**
 * PatchDiff — captures alive-ness transitions during patch application.
 *
 * A diff entry is produced only when the alive-ness state of a node or edge
 * actually changes, or when an LWW property winner changes. Redundant ops
 * (e.g. NodeAdd on an already-alive node) produce no diff entries.
 *
 * @module domain/types/PatchDiff
 */
import type { PropValue } from './PropValue.ts';
type EdgeDiffEntryFields = {
    readonly from: string;
    readonly to: string;
    readonly label: string;
};
type PropDiffEntryFields = {
    readonly nodeId: string;
    readonly key: string;
    readonly value: PropValue | undefined;
    readonly prevValue: PropValue | undefined;
};
export declare class EdgeDiffEntry {
    readonly from: string;
    readonly to: string;
    readonly label: string;
    constructor({ from, to, label }: EdgeDiffEntryFields);
    static fromEntry(entry: EdgeDiffEntry | EdgeDiffEntryFields): EdgeDiffEntry;
}
export declare class PropDiffEntry {
    readonly nodeId: string;
    readonly key: string;
    readonly value: PropValue | undefined;
    readonly prevValue: PropValue | undefined;
    constructor({ nodeId, key, value, prevValue }: PropDiffEntryFields);
    static fromEntry(entry: PropDiffEntry | PropDiffEntryFields): PropDiffEntry;
}
/**
 * PatchDiff — captures alive-ness transitions during patch application.
 */
export declare class PatchDiff {
    /** Edges that transitioned not-alive -> alive */
    readonly edgesAdded: readonly EdgeDiffEntry[];
    /** Edges that transitioned alive -> not-alive */
    readonly edgesRemoved: readonly EdgeDiffEntry[];
    /** Nodes that transitioned not-alive -> alive */
    readonly nodesAdded: readonly string[];
    /** Nodes that transitioned alive -> not-alive */
    readonly nodesRemoved: readonly string[];
    /** Properties whose LWW winner actually changed */
    readonly propsChanged: readonly PropDiffEntry[];
    /**
     * Creates a PatchDiff from field values.
     */
    constructor({ nodesAdded, nodesRemoved, edgesAdded, edgesRemoved, propsChanged }: {
        nodesAdded: readonly string[];
        nodesRemoved: readonly string[];
        edgesAdded: readonly EdgeDiffEntry[];
        edgesRemoved: readonly EdgeDiffEntry[];
        propsChanged: readonly PropDiffEntry[];
    });
    /**
     * Creates an empty PatchDiff.
     */
    static empty(): PatchDiff;
}
export type MutablePatchDiff = {
    readonly edgesAdded: EdgeDiffEntry[];
    readonly edgesRemoved: EdgeDiffEntry[];
    readonly nodesAdded: string[];
    readonly nodesRemoved: string[];
    readonly propsChanged: PropDiffEntry[];
};
export declare function createPatchDiffAccumulator(): MutablePatchDiff;
/**
 * Creates an empty PatchDiff.
 */
export declare function createEmptyDiff(): PatchDiff;
/**
 * Merges two PatchDiff objects into a net diff by cancelling out
 * contradictory add/remove pairs.
 *
 * - A node that appears in `a.nodesAdded` and `b.nodesRemoved` (or vice-versa)
 *   is dropped from both lists (the transitions cancel out).
 * - Same logic applies to edges (keyed by `from\0to\0label`).
 * - For `propsChanged`, only the last entry per `(nodeId, key)` is kept.
 */
export declare function mergeDiffs(a: PatchDiff, b: PatchDiff): PatchDiff;
export {};
