export declare function merge(target: A, source: [B, C], options?: merge.Options): A & B & C;
export declare function merge(target: A, source: [B, C, D], options?: merge.Options): A & B & C & D;
export declare function merge(target: A, source: [B, C, D, E], options?: merge.Options): A & B & C & D & E;
export declare function merge(target: A, source: [B, C, D, F], options?: merge.Options): A & B & C & D & F;
export declare function merge(target: A, source: B, options?: merge.Options): A & B;
/**
* @namespace
*/
export declare namespace merge {
type CallbackFn = (value: any, ctx: CallbackContext) => boolean;
interface CallbackContext {
source: any;
target: any;
key: string | symbol | number;
path: string;
}
interface Options {
/**
* Optional variable that determines the depth of an operation or inclusion behavior.
*
* - If set to `true`, it enables a deep operation for only plain objects and arrays. Non-plain objects (class instances) are assigned by reference.
* - If set to `'full'`, it enables a deep operation for all objects, including classes, excluding built-in objects.
* - If assigned a `NodeCallback` function, it provides a custom callback mechanism for handling the operation.
*
* This variable can be used to define the level of depth or customization for a given process.
* @default false
*/
deep?: boolean | 'full' | CallbackFn;
/**
* Indicates whether symbol keys should be included.
* If set to `true`, properties with symbol keys will be considered.
* If `false` or `undefined`, symbol keys will be ignored.
* @default true
*/
symbolKeys?: boolean;
/**
* Specifies the behavior for merging arrays during a particular operation.
*
* When set to `true`, all array elements will be deeply merged, preserving all duplicates.
* When set to `'unique'`, only unique elements will be preserved in the merged array.
* If a callback function (`CallbackFn`) is provided, it determines the custom merging logic for the arrays.
*/
mergeArrays?: boolean | 'unique' | CallbackFn;
/**
* Determines whether to retain pre-existing values.
* If set to `true`, existing entities are preserved without modification.
* If set to `false`, existing entities may be replaced or overridden by new ones.
* Alternatively, can be assigned a callback function (`CallbackFn`) that dynamically resolves whether to keep existing entities based on custom logic.
*/
keepExisting?: boolean | CallbackFn;
/**
* A boolean flag that determines whether property descriptors
* should be copied when transferring properties from one object
* to another.
*
* If set to true, both the value and descriptor metadata
* (e.g., writable, configurable, enumerable) of a property
* will be copied. If set to false or undefined, only the
* property values will be copied, without preserving descriptor
* details.
*
* This is typically used when needing to retain detailed control
* over property attributes during object manipulation.
*/
copyDescriptors?: boolean;
/**
* Ignores the source field if callback returns true
*/
ignoreSource?: CallbackFn;
/**
* Ignore fields which values are "undefined"
* @default true
*/
ignoreUndefined?: boolean;
/**
* Ignore fields which values are "null"
* @default false
*/
ignoreNulls?: boolean;
/**
* Ignores both target and source field if callback returns true
*/
filter?: CallbackFn;
}
}