type Merged = TSource extends undefined ? TDestination : TDestination extends undefined ? TSource : TSource extends any[] ? TDestination extends any[] ? TDestination & TSource : TSource : TSource extends object ? TDestination extends object ? TDestination extends any[] ? TSource : TDestination & TSource : TSource : TSource; /** * Recursively merges `source` into `destination` in place and returns the result. * - Objects are merged key by key. * - Arrays are merged index by index. * - Primitive and class-instance values replace the destination. * - `undefined` source values leave the destination unchanged. * - Circular references in `source` are silently dropped. * * Prefer `combine` for a non-mutating deep merge or `deepClone` for a simple deep copy. * * @returns The merged value — either `destination` (mutated) or `source` when they cannot be merged. */ export declare function mergeInto(destination: D, source: S): Merged; /** * A simplistic implementation of a deep clone algorithm. * Caveats: * - It doesn't maintain prototype chains - don't use with instances of custom classes. * - It doesn't handle Map and Set * * @returns A deep copy of `value` with the same type. */ export declare function deepClone(value: T): T; type Combined = A extends null ? B : B extends null ? A : Merged; /** * Performs a non-mutating deep merge of two or more values. * - All arguments are left unchanged; the result is always a new value. * - Objects are merged key by key; arrays are merged index by index. * - `undefined` values are skipped (they do not overwrite existing values). * - `null` values replace existing values. * * @returns A new deeply-merged value of the combined type. * @example * combine({ a: 1 }, { b: 2 }) // { a: 1, b: 2 } * combine({ a: { x: 1 } }, { a: { y: 2 } }) // { a: { x: 1, y: 2 } } */ export declare function combine(a: A, b: B): Combined; export declare function combine(a: A, b: B, c: C): Combined, C>; export declare function combine(a: A, b: B, c: C, d: D): Combined, C>, D>; export declare function combine(a: A, b: B, c: C, d: D, e: E): Combined, C>, D>, E>; export declare function combine(a: A, b: B, c: C, d: D, e: E, f: F): Combined, C>, D>, E>, F>; export declare function combine(a: A, b: B, c: C, d: D, e: E, f: F, g: G): Combined, C>, D>, E>, F>, G>; export declare function combine(a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H): Combined, C>, D>, E>, F>, G>, H>; export {};