/** JSON Patch operation type. */ type PatchOperation = "add" | "remove" | "replace"; /** * A single JSON Patch operation (RFC 6902 compatible; mutative's format with a string path). */ interface JsonPatchOperation { /** The operation to be performed. */ op: PatchOperation; /** JSON Pointer path (RFC 6902 format). */ path: string; /** The value for add/replace operations. */ value?: unknown; /** Source pointer for move/copy operations (backend `From`); unused by the generate/apply helpers. */ from?: string; } /** Array of JSON Patch operations. */ type JsonPatch = JsonPatchOperation[]; /** * Generates JSON Patch operations (RFC 6902). * Strictly typed, handles Date objects, and ignores key order. */ declare function generateJsonPatch(original: T, modified: T): JsonPatch; /** * Applies JSON Patch operations to an object using Mutative. * @param original - The original object * @param patches - Array of JSON Patch operations to apply * @returns The patched object (immutable) */ declare function applyJsonPatch(original: T, patches: JsonPatch): T; /** * Checks if a patch array is empty (null, undefined, or empty array). * @param patches - Array of patch operations or null/undefined * @returns True if patches is null, undefined, or empty array */ declare function isNullOrEmpty(patches: JsonPatch | null | undefined): boolean; /** * Checks if a patch array has any operations. * @param patches - Array of patch operations * @returns True if patches array has operations, false if empty */ declare function hasPatches(patches: JsonPatch): boolean; /** * Creates a deep clone of an object. * Useful for creating the "modified" version before generating patches. * @param obj - Object to clone * @returns Deep cloned object */ declare function deepClone(obj: T): T; export { type JsonPatch, type JsonPatchOperation, type PatchOperation, applyJsonPatch, deepClone, generateJsonPatch, hasPatches, isNullOrEmpty };