/** A type alias representing an object with string keys and values of any type. */ export type ocxKey = { [key: string]: any; }; /** A generic type that extends `T` with `ocxKey`, allowing `T` to have arbitrary key-value pairs. */ export type ocxAcc = T & ocxKey; /** * A flexible mapping type that can be an: * - plain object (`ocxKey`) * - array of objects (`ocxKey[]`) * - recursive mapping (`ocxMap[]`) * - primitive value (`string`, `number`, `null`, `boolean`, `undefined`) * - function that takes an optional object (`ocxKey`) and returns an `ocxMap`. */ export type ocxMap = ocxKey | ocxKey[] | ocxMap[] | string | number | null | boolean | undefined | ((key?: ocxKey) => ocxMap); /** An object that can be processed by `ocx`. */ export type ocxObj = T | ocxMap | ocxAcc; /** * Merges multiple objects deeply, handling arrays and functions gracefully. * @template T - The base object type. * @param obj - One or more objects to merge. * @returns The deeply merged object. */ declare function baseOcx(...obj: ocxObj[]): ocxAcc; /** * Merges multiple objects deeply, handling arrays and functions gracefully **without overwriting**. * @template T - The base object type. * @param obj - One or more objects to merge. * @returns The deeply merged object **without overwriting** the value at the first key, only change the value if it does not exist. */ declare function preserveRoot(...obj: ocxObj[]): ocxAcc; interface ocxFn { /** * Merges multiple objects and removes falsy values by default. * @template T - The base object type. * @param obj - One or more objects to merge. * @returns The deeply merged object with falsy values removed. */ (...obj: ocxObj[]): ocxAcc; /** A version of `ocx` that performs deep merging **without** removing falsy values. */ raw: typeof baseOcx; /** A version of `ocx` that performs a deep join **without overwriting** the value at the first key, only change the value if it does not exist. */ preserve: typeof preserveRoot; } /** * Recursively merge objects with support for arrays, dynamic functions, and non falsy properties into a single object. * * Provides a chaining: * - {@link baseOcx raw} method to **get falsy values** from the result. * - {@link preserveRoot preserve} method to join **without overwriting** first value. * @example * @see {@link https://ilkhoeri.github.io/cretex/?id=ocx Docs} */ export declare const ocx: ocxFn; export {};