import { MaybeArray } from '../types/misc.js'; /** * Strictly typed `Object.keys` */ export declare function objectKeys(obj: T): Array<`${keyof T & (string | number | boolean | null | undefined)}`>; /** * Strictly typed `Object.entries` */ export declare function objectEntries(obj: T): Array<[keyof T, T[keyof T]]>; /** * remove undefined fields from an object (! mutates the object !) */ export declare function clearUndefined(obj: T): T; export type MergeInsertions = T extends object ? { [K in keyof T]: MergeInsertions; } : T; export type DeepMerge = MergeInsertions<{ [K in keyof F | keyof S]: K extends keyof S & keyof F ? DeepMerge : K extends keyof S ? S[K] : K extends keyof F ? F[K] : never; }>; export interface DeepMergeOptions { /** * when `undefined` value is encountered, should we **replace** the value * in the target object with `undefined` or **ignore** it? * * @default 'ignore' */ undefined?: 'replace' | 'ignore'; /** * when a property is encountered that is already present in the target object, * should we **replace** the value in the target object with the value from * the source object or **ignore** it? * * @default 'replace' */ properties?: 'replace' | 'ignore'; /** * when an array is encountered that is already present in the target object, * should we **replace** the value in the target object with the value from * the source object, **merge** the arrays together or **ignore** it? * * @default 'replace' */ arrays?: 'replace' | 'merge' | 'ignore'; /** * when an object is encountered that is already present in the target object, * should we **replace** the value in the target object with the value from * the source object, **merge** the objects together or **ignore** it? * * @default 'merge' */ objects?: 'replace' | 'merge' | 'ignore'; } export declare function deepMerge(into: T, from: MaybeArray, options?: DeepMergeOptions): T; export declare function deepMerge(into: T, from: MaybeArray, options?: DeepMergeOptions): DeepMerge;