export type DeepMergeArrayMergeOptions = { cloneUnlessOtherwiseSpecified(value: object, options?: DeepMergeOptions): any; isMergeableObject(value: object): boolean; }; export type DeepMergeOptions = { /** * Merges two arrays. Defaults to concatenating `target` and `source`. */ arrayMerge?: (target: any[], source: any[], options: ResolvedDeepMergeOptions) => any[]; /** * When `false`, mergeable values are copied by reference instead of being deeply cloned. * @default true */ clone?: boolean; /** * Returns a custom merge function for a given key, or `undefined` to use the default merge. */ customMerge?: (key: string, options?: DeepMergeOptions) => ((x: any, y: any) => any) | undefined; /** * Determines whether a value should be merged recursively or copied as-is. */ isMergeableObject?(value: object): boolean; }; type ResolvedDeepMergeOptions = { arrayMerge: NonNullable; isMergeableObject: (value: unknown) => boolean; } & DeepMergeArrayMergeOptions & DeepMergeOptions; /** * Fully-featured deepMerge. Returns a new object and does not mutate its arguments. * * Array handling: arrays are concatenated unless `arrayMerge` is provided. * * `__proto__` keys are never copied to the result, preventing prototype poisoning of the returned * object when merging untrusted input (e.g. parsed JSON). */ export declare function deepMerge(x: Partial, y: Partial, options?: DeepMergeOptions): T; export declare function deepMerge(x: Partial, y: Partial, options?: DeepMergeOptions): T1 & T2; export declare namespace deepMerge { var all: typeof deepMergeAll; } /** * Keeps the `deepMerge.Options` / `deepMerge.ArrayMergeOptions` type references from the former * `deepmerge` dependency working. */ export declare namespace deepMerge { type ArrayMergeOptions = DeepMergeArrayMergeOptions; type Options = DeepMergeOptions; } /** * Deep-merges all objects in the array, from left to right. */ declare function deepMergeAll(objects: Partial[], options?: DeepMergeOptions): T; declare function deepMergeAll(objects: object[], options?: DeepMergeOptions): object; /** * Fully-featured deepMerge. * * Array handling: Arrays in the target object are combined with the source object's arrays. */ export declare function deepMergeWithCombinedArrays(obj1: object, obj2: object, options?: DeepMergeOptions): T; /** * Fully-featured deepMerge. * * Array handling: Arrays in the target object are replaced by the source object's arrays. */ export declare function deepMergeWithSourceArrays(obj1: object, obj2: object): T; /** * Fully-featured deepMerge. Does not clone React components by default. */ export declare function deepMergeWithReactComponents(obj1: object, obj2: object): T; export {}; //# sourceMappingURL=deepMerge.d.ts.map