import { EastTypeValue, PatchLeafOp } from '@elaraai/east'; export type LeafOp = PatchLeafOp; /** A leaf change — one user-visible before/after pair. */ export interface LeafNode { kind: "leaf"; /** Stringified PatchPath — stable id within the binding. */ path: string; /** Last segment, for display. */ label: string; op: LeafOp; leafType: EastTypeValue | null; before: any; after: any; /** Set when the patch's expectation at this leaf disagrees with the * actual base value (overlay-mode drift). When present, the row should * render a warning badge with `actual` so the user can see what the * source has now vs what the patch expected. */ stale?: { expected: unknown; actual: unknown; }; } /** An interior change — wraps multiple leaf or group children. */ export interface GroupNode { kind: "group"; /** Stringified PatchPath. */ path: string; /** Last segment, for display. */ label: string; /** Total leaves under this subtree. */ leafCount: number; /** Flat list of every leaf path under this subtree. Pre-computed during * walk so the renderer's "discard all" handler doesn't re-traverse on * each render. */ subtreeLeafPaths: string[]; children: DiffNode[]; } export type DiffNode = LeafNode | GroupNode; /** Enumerate all leaves under a node — used for total-count tallies that * need {@link LeafNode} objects (not just paths). */ export declare function collectLeaves(node: DiffNode, into?: LeafNode[]): LeafNode[]; /** * Walk a patch and build the renderer's `DiffNode` tree. Returns `null` when * the patch is unchanged (no events fire). * * @param typeValue - Runtime EastTypeValue of the value being patched. * @param patch - The patch (`PatchTypeOf`). * @param rootLabel - Display label for the root node (the renderer fills in * the binding name here). */ export declare function walkPatchToTree(typeValue: EastTypeValue, patch: any, rootLabel: string): DiffNode | null; //# sourceMappingURL=walker.d.ts.map