import { type PrimativeKey, type FieldOfType } from '../key'; import { type SetIncludesMode } from '../set/set.mode'; import { type KeyAsString } from '../type'; /** * Any valid Plain-old Javascript Object key. */ export type POJOKey = PrimativeKey | symbol; /** * This is an object that can be serialized to JSON and back and be equivalent. */ export type JsonSerializableObject = Record; /** * String key of an object. */ export type ObjectKey = string; /** * An object with no keys. */ export type EmptyObject = Record; /** * Checks whether the object has no own enumerable keys. * * @param obj - Object to check * @returns `true` if the object has zero keys */ export declare function objectHasNoKeys(obj: object): obj is EmptyObject; /** * Checks whether the object has the specified own property using `Object.prototype.hasOwnProperty`. * * @param obj - Object to check * @param key - Property key to test for * @returns `true` if the object has the key as an own property */ export declare function objectHasKey(obj: T, key: KeyAsString): boolean; export declare function objectHasKey(obj: unknown, key: string): boolean; export declare function objectHasKey(obj: T, key: K): boolean; /** * Checks whether the object has all or any of the specified keys, based on the mode. * * @param obj - Object to check * @param keys - Keys to test for * @param mode - Whether to require 'all' keys or just 'any'; defaults to 'all' * @returns `true` if the keys match the mode criteria */ export declare function objectHasKeys(obj: T, keys: KeyAsString[], mode?: SetIncludesMode): boolean; export declare function objectHasKeys(obj: unknown, keys: ObjectKey[], mode?: SetIncludesMode): boolean; export declare function objectHasKeys(obj: T, keys: K[], mode?: SetIncludesMode): boolean; /** * Creates a partial object with the same value assigned to each of the specified fields. * * @param value - The value to assign to each field * @param fields - Array of field names to set * @returns A partial object with the value set on each specified field */ export declare function applyToMultipleFields(value: X, fields: FieldOfType[]): Partial<{ [K in keyof T]: X; }>; /** * Converts a Map to a plain object by iterating entries and assigning key-value pairs. * * @param map - Map to convert * @returns A plain object with the same key-value pairs */ export declare function mapToObject(map: Map): { [key: PropertyKey]: T; }; /** * Returns a copy of the input object. */ export type CopyObjectFunction = (input: T) => T; /** * Creates a shallow copy of an object using the spread operator. * * @param input - Object to copy * @returns A new object with the same properties */ export declare function copyObject(input: T): T;