/** * Diff Utility * * Functions for comparing Puck data structures to identify changes. */ import type { PuckData } from '@pantheon-systems/css-client'; import type { ComponentDiff, ComponentDiffWithPosition, PropDiff } from '../../core/types.js'; /** * Deeply compares two objects for equality, independent of key order. */ export declare function deepEqual(a: unknown, b: unknown): boolean; /** * Compares two Puck data structures and returns a list of component differences. * * @param before - The original Puck data * @param after - The modified Puck data * @returns Array of component differences * * @example * ```typescript * const diffs = diffPuckData(oldData, newData); * for (const diff of diffs) { * if (diff.type === 'added') { * console.log(`Added: ${diff.componentType}`); * } * } * ``` */ export declare function diffPuckData(before: PuckData, after: PuckData): ComponentDiff[]; /** * Filters diffs to only include changes (excludes unchanged components). */ export declare function getChangedComponents(diffs: ComponentDiff[]): ComponentDiff[]; /** * Counts the number of changes by type. */ export declare function countChanges(diffs: ComponentDiff[]): { added: number; removed: number; modified: number; unchanged: number; }; /** * Checks if the root props have changed between two Puck data objects. */ export declare function hasRootChanged(before: PuckData, after: PuckData): boolean; /** * Compares two Puck data structures with position tracking and reorder detection. * * @param before - The original Puck data * @param after - The modified Puck data * @returns Array of component differences with position info */ export declare function diffPuckDataWithPositions(before: PuckData, after: PuckData): ComponentDiffWithPosition[]; /** * Compares two prop objects and returns detailed prop-level differences. * * @param before - Props before change * @param after - Props after change * @returns Array of prop differences */ export declare function diffProps(before: Record, after: Record): PropDiff[]; /** * Filters diffs to only include reordered components. */ export declare function getReorderedComponents(diffs: ComponentDiffWithPosition[]): ComponentDiffWithPosition[];