import { Queue } from "../Queue";
import { IQueueNode } from "./_types/IQueueNode";
import { TCacheKeysList } from "./_types/TCacheKeysList";
import { TCacheMap } from "./_types/TCacheMap";
declare type IMapVal<K, V> = {
    value: V;
    node: IQueueNode<K>;
};
/**
 * A class to cache items that are created for a search, such that items aren't constantly replaced
 */
export declare class SearchCache<K extends [any, ...any], V> {
    protected create: (...key: K) => V;
    protected map: TCacheMap<K, IMapVal<K, V>>;
    protected queue: Queue<K>;
    protected maxSize: number;
    /**
     * Creates a new search cache
     * @param create The function to create new values
     * @param maxSize The maximum number of items to keep in the cache
     */
    constructor(create: (...key: K) => V, maxSize?: number);
    /**
     * Retrieves multiple items, either from the cache or newly created
     * @param items The keys of the items to get
     * @returns The items
     */
    getAll(items: TCacheKeysList<K>): V[];
    /**
     * Retrieves an item, either from the cache or newly created
     * @param keys The keys to get the item for
     * @returns The item
     */
    get(...keys: K): V;
    /**
     * Adds an item to the cache map
     * @param map The map to add the value to
     * @param keys The keys to add the value under
     * @param value The value to add
     * @param node The queue node to store in the map
     */
    protected add<MKeys extends [MK, ...MKrest], MK, MKrest extends any[]>(map: Map<MK, TCacheMap<MKrest, IMapVal<K, V>>>, [key, ...keys]: MKeys, value: V, node: IQueueNode<K>): void;
    /**
     * Removes an item from the cache
     * @param map The map to add the value to
     * @param keys The keys to remove the value from
     */
    protected remove<MKeys extends [MK, ...MKrest], MK, MKrest extends any[]>(map: Map<MK, TCacheMap<MKrest, IMapVal<K, V>>>, [key, ...keys]: MKeys): void;
}
export {};
//# sourceMappingURL=SearchCache.d.ts.map