/** * A trie (prefix tree) that stores values in maps. Very much inspired by * https://github.com/anko/array-keyed-map, but very different in some regards: * - additional `prune()` method * - no `size` (which is hard to implement when `prune()` exists) * - no support for objects in paths (for fear of memory leaks) * Use this module by importing from `@sirpepe/shed/TrieMap`. */ import type { Primitive } from "./types"; declare const DATA_KEY: unique symbol; type Backend = Map>; export declare class TrieMap { #private; [Symbol.iterator](): IterableIterator; constructor(initialEntries?: [K[], V][]); set(path: K[], value: V): void; has(path: K[]): boolean; hasPrefix(path: K[]): boolean; get(path: K[]): V | Backend | undefined; delete(path: K[]): boolean; prune(path: K[]): boolean; clear(): void; get [Symbol.toStringTag](): string; toJSON(): never; } export {};