type Diff = { [K in keyof T]?: T[K] extends (infer U)[] ? (Diff | { curr_value: U; prev_value: U; })[] : T[K] extends object ? Diff | { curr_value: T[K]; prev_value: T[K]; } : { curr_value: T[K]; prev_value: T[K]; }; }; /** * Compares two objects and returns the differences between them. * * @template T - The type of the objects being compared. * @param {T} prev - The previous state of the object. * @param {Partial} curr - The current state of the object. * @returns {Diff} - An object representing the differences between the previous and current states. * * This function iterates over the keys of the current object and compares each value with the corresponding value in the previous object. * If the values are arrays, it compares each element in the arrays and records any differences. * If the values are objects, it recursively compares the nested objects. * If the values are primitive types, it records the current and previous values if they differ. * * @example * const prev = { name: 'Alice', age: 30, hobbies: ['reading', 'hiking'] }; * const curr = { name: 'Alice', age: 31, hobbies: ['reading', 'swimming'] }; * const differences = compareObjects(prev, curr); * // differences will be: * // { * // age: { curr_value: 31, prev_value: 30 }, * // hobbies: [{ curr_value: 'swimming', prev_value: 'hiking' }] * // } */ export declare function compareObjects(prev: T, curr: Partial): Diff; export {};