市场夺宝奇兵
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.2 KiB

  1. export { i as isEqual } from '../shared/ohash.CMR0vuBX.js';
  2. /**
  3. * Calculates the difference between two objects and returns a list of differences.
  4. *
  5. * @param {any} obj1 - The first object to compare.
  6. * @param {any} obj2 - The second object to compare.
  7. * @param {HashOptions} [opts={}] - Configuration options for hashing the objects. See {@link HashOptions}.
  8. * @returns {DiffEntry[]} An array with the differences between the two objects.
  9. */
  10. declare function diff(obj1: any, obj2: any): DiffEntry[];
  11. declare class DiffEntry {
  12. key: string;
  13. type: "changed" | "added" | "removed";
  14. newValue: DiffHashedObject;
  15. oldValue?: DiffHashedObject | undefined;
  16. constructor(key: string, type: "changed" | "added" | "removed", newValue: DiffHashedObject, oldValue?: DiffHashedObject | undefined);
  17. toString(): string;
  18. toJSON(): string;
  19. }
  20. declare class DiffHashedObject {
  21. key: string;
  22. value: any;
  23. hash?: string | undefined;
  24. props?: Record<string, DiffHashedObject> | undefined;
  25. constructor(key: string, value: any, hash?: string | undefined, props?: Record<string, DiffHashedObject> | undefined);
  26. toString(): string;
  27. toJSON(): string;
  28. }
  29. export { diff };