/** * @file Object mutation helpers: a deep recursive `merge`, plus * `objectAssign` and `objectFreeze` aliasing their natives. `merge` includes * infinite-loop detection via `LOOP_SENTINEL` because `__proto__` and * self-referential graphs would otherwise blow the stack on a recursive * descent. */ /** * Deep merge source object into target object. * * Recursively merges properties from `source` into `target`. Arrays in source * completely replace arrays in target, with no element-wise merging. Objects * are merged recursively. Includes infinite loop detection for safety. * * @example * ;```ts * merge( * { config: { api: 'v1', timeout: 1000 } }, * { config: { api: 'v2', retries: 3 } }, * ) * // { config: { api: 'v2', timeout: 1000, retries: 3 } } * ``` * * @example * ;```ts * // Arrays are replaced, not merged * merge({ arr: [1, 2] }, { arr: [3] }) // { arr: [3] } * ``` * * @param target - The object to merge into, which will be modified. * @param source - The object to merge from. * * @returns The modified target object */ export declare function merge(target: T, source: U): T & U; /** * Alias for native `Object.assign`. * * Copies all enumerable own properties from one or more source objects to a * target object and returns the modified target object. * * @example * ;```ts * objectAssign({ a: 1 }, { b: 2 }) // { a: 1, b: 2 } * ``` */ export declare const objectAssign: { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }; /** * Alias for native `Object.freeze`. * * Freezes an object, preventing new properties from being added and existing * properties from being removed or modified. Makes the object immutable. * * @example * ;```ts * const obj = { a: 1 } * objectFreeze(obj) * obj.a = 2 // Silently fails (or throws in strict mode) * ``` */ export declare const objectFreeze: { (f: T): T; (o: T): Readonly; (o: T): Readonly; };