declare type Input = Record; declare type Merger = (obj: T, key: keyof T, value: T[K], namespace: string) => any; declare type nullish = null | undefined | void; declare type MergeObjects = Destination extends Defaults ? Destination : Omit & Omit & { -readonly [Key in keyof Destination & keyof Defaults]: Destination[Key] extends nullish ? Defaults[Key] extends nullish ? nullish : Defaults[Key] : Defaults[Key] extends nullish ? Destination[Key] : Merge; }; declare type DefuFn = (source: Source, ...defaults: Defaults[]) => MergeObjects; interface Defu { (source: Source, ...defaults: Defaults[]): MergeObjects; fn: DefuFn; arrayFn: DefuFn; extend(merger?: Merger): DefuFn; } declare type MergeArrays = Destination extends Array ? Source extends Array ? Array : Source | Array : Source | Destination; declare type Merge = Destination extends nullish ? Defaults extends nullish ? nullish : Defaults : Defaults extends nullish ? Destination : Destination extends Array ? Defaults extends Array ? MergeArrays : Destination | Defaults : Destination extends Function ? Destination | Defaults : Destination extends RegExp ? Destination | Defaults : Destination extends Promise ? Destination | Defaults : Defaults extends Function ? Destination | Defaults : Defaults extends RegExp ? Destination | Defaults : Defaults extends Promise ? Destination | Defaults : Destination extends Input ? Defaults extends Input ? MergeObjects : Destination | Defaults : Destination | Defaults; declare const defu: Defu; export { defu as default };