import { Path } from "./path"; /** * Allows storage, retrieval, update and deletion of values identified by complex keys. * A complex key must be an object with one or more primitive (boolean, number, string, undefined, null) properties. * Those properties can be deeply nested and are defined when constructing the map. */ export declare class ComplexKeyMap = Record, Value = Key> { #private; /** * @param keyPropertyPaths One or more strings, where each string points to a property. Use dots for nested properties. */ constructor(keyPropertyPaths: readonly Path[]); protected readonly map: Map; protected readonly leadingPaths: Path[]; protected readonly lastPath: Path; clear(): void; has(key: Key): boolean; /** * Retrieve a value. * @param key The complex key identifying the value you want returned. * @param customKeyPropertyPaths Use these paths to read the key property values instead of the keyPropertyPaths defined during construction. * @returns The value identified by the given complex key, or undefined if not found. */ get(key: Key | Record, customKeyPropertyPaths?: readonly Path[]): Value | undefined; /** * Retrieve all stored values. * @returns All stored values. */ getAll(): Value[]; /** * Retrieve many values. * @param keys The complex keys identifying the values you want returned. * @returns The values identified by the given complex keys. */ getMany(keys: Key[]): Value[]; /** * Store a value. * @param key The complex key identifying the value you want stored. * @param value The value you want stored. * @param update A callback invoked when a value for the given key already exists which should return the value to be stored. * @returns Nothing. */ set(key: Key, value: Value, update?: (previous: Value, current: Value) => Value): void; setMany(keys: Key[], values: Value[], update?: (previous: Value, current: Value) => Value): void; delete(key: Key): boolean; }