/** * Borrow from https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/change.ts#L62 */ /** * Represents the difference between two objects of the same type. * * Both `deleted` and `inserted` partials represent the same set of added, removed or updated properties, where: * - `deleted` is a set of all the deleted values * - `inserted` is a set of all the inserted (added, updated) values * * Keeping it as pure object (without transient state, side-effects, etc.), so we won't have to instantiate it on load. */ export declare class Delta { readonly deleted: Partial; readonly inserted: Partial; private constructor(); static create(deleted: Partial, inserted: Partial, modifier?: (delta: Partial) => Partial, modifierOptions?: 'deleted' | 'inserted'): Delta; /** * Compares if object1 contains any different value compared to the object2. */ static isLeftDifferent(object1: T, object2: T, skipShallowCompare?: boolean): boolean; /** * Compares if object2 contains any different value compared to the object1. */ static isRightDifferent(object1: T, object2: T, skipShallowCompare?: boolean): boolean; /** * Calculates the delta between two objects. * * @param prevObject - The previous state of the object. * @param nextObject - The next state of the object. * * @returns new delta instance. */ static calculate(prevObject: T, nextObject: T, modifier?: (partial: Partial) => Partial, postProcess?: (deleted: Partial, inserted: Partial) => [Partial, Partial]): Delta; static empty(): Delta; static isEmpty(delta: Delta): boolean; /** * Iterator comparing values of object properties based on the passed joining strategy. * * @yields keys of properties with different values * * WARN: it's based on shallow compare performed only on the first level and doesn't go deeper than that. */ private static distinctKeysIterator; } /** * Returns whether object/array is shallow equal. * Considers empty object/arrays as equal (whether top-level or second-level). */ export declare const isShallowEqual: , K extends readonly unknown[]>(objA: T, objB: T, comparators?: { [key in keyof T]?: (a: T[key], b: T[key]) => boolean; } | (keyof T extends K[number] ? K extends readonly (keyof T)[] ? K : { _error: "keys are either missing or include keys not in compared obj"; } : { _error: "keys are either missing or include keys not in compared obj"; }), debug?: boolean) => boolean;