import { type MapFunction } from '../value/map'; import { type POJOKey } from './object'; /** * An object with values of a specific type keyed by either string or number or symbols. */ export type ObjectMap = Record; /** * An object with values of a specific type keyed to string values. */ export type StringObjectMap = { [key: string]: T; [key: number]: never; [key: symbol]: never; }; /** * Mapped type that preserves the keys of `M` but replaces all value types with `O`. */ export type MappedObjectMap = { [key in keyof M]: O; }; /** * Converts an {@link ObjectMap} into a `Map` using `Object.entries`. * * @param object - The object map to convert * @returns A `Map` with the same key-value pairs */ export declare function objectToMap(object: ObjectMap): Map; /** * Maps an ObjectMap of one type to another ObjectMap with the mapped values. */ export type MapObjectMapFunction, I = unknown, O = unknown> = MapFunction>; /** * Creates a reusable {@link MapObjectMapFunction} that applies {@link mapObjectMap} with the given mapping function. * * @param mapFn - Function that transforms each value (receives value and key) * @returns A function that maps all values in an input object map */ export declare function mapObjectMapFunction, I = unknown, O = unknown>(mapFn: MapObjectMapValueFunction): MapObjectMapFunction; /** * Mapping function that transforms a single value from an {@link ObjectMap}, receiving both the value and its key. */ export type MapObjectMapValueFunction, I = unknown, O = unknown> = (value: M[K], key: K) => O; /** * Maps all values of an {@link ObjectMap} from one type to another, returning a new object with the same keys. * * @param object - The source object map * @param mapFn - Function that transforms each value * @returns A new object with mapped values */ export declare function mapObjectMap, I = unknown, O = unknown>(object: M, mapFn: MapObjectMapValueFunction): MappedObjectMap; /** * Maps the values of a source {@link ObjectMap} and assigns the results onto the target object, returning the target. * * @param object - The source object map * @param target - The target object to assign mapped values onto * @param mapFn - Function that transforms each value * @returns The target object with mapped values assigned */ export declare function mapObjectToTargetObject, I = unknown, O = unknown>(object: M, target: MappedObjectMap, mapFn: MapObjectMapValueFunction): MappedObjectMap; /** * Maps each key of the input object to a new object using the pre-configured function. */ export type MapObjectKeysFunction = (object: M) => unknown; /** * Map function that returns the new POJOKey using the input key/value pair. */ export type MapObjectKeyFunction = (key: K, value: M[K]) => POJOKey; /** * Creates a reusable {@link MapObjectKeysFunction} that transforms the keys of an input object using the given mapping function. * * @param mapKeyFn - Function that computes the new key from the old key and its value * @returns A function that remaps keys on any input object */ export declare function mapObjectKeysFunction(mapKeyFn: MapObjectKeyFunction): MapObjectKeysFunction; /** * Mapped type that converts all string keys of `M` to lowercase while preserving their value types. */ export type MappedKeysToLowercaseObjectMap = { [K in keyof M as K extends string ? Lowercase : K]: M[K]; }; /** * Pre-built function that maps all string keys of an object to lowercase, returning a new object. * * Non-string keys (e.g., numbers) are passed through unchanged. * When multiple keys map to the same lowercase key, the last one wins (order is undefined). */ export declare const mapObjectKeysToLowercase: (object: M) => MappedKeysToLowercaseObjectMap;