declare const unset: unique symbol; export interface IPrefixTreeNode { /** Possible children of the node. */ children?: ReadonlyMap>; /** The value if data exists for this node in the tree. Mutable. */ value: T | undefined; } /** * A simple prefix tree implementation where a value is stored based on * well-defined prefix segments. */ export declare class WellDefinedPrefixTree { readonly root: Node; private _size; /** Tree size, not including the root. */ get size(): number; /** Gets the top-level nodes of the tree */ get nodes(): Iterable>; /** Gets the top-level nodes of the tree */ get entries(): Iterable<[ string, IPrefixTreeNode ]>; /** * Inserts a new value in the prefix tree. * @param onNode - called for each node as we descend to the insertion point, * including the insertion point itself. */ insert(key: Iterable, value: V, onNode?: (n: IPrefixTreeNode) => void): void; /** Mutates a value in the prefix tree. */ mutate(key: Iterable, mutate: (value?: V) => V): void; /** Mutates nodes along the path in the prefix tree. */ mutatePath(key: Iterable, mutate: (node: IPrefixTreeNode) => void): void; /** Deletes a node from the prefix tree, returning the value it contained. */ delete(key: Iterable): V | undefined; /** Deletes a subtree from the prefix tree, returning the values they contained. */ deleteRecursive(key: Iterable): Iterable; /** Gets a value from the tree. */ find(key: Iterable): V | undefined; /** Gets whether the tree has the key, or a parent of the key, already inserted. */ hasKeyOrParent(key: Iterable): boolean; /** Gets whether the tree has the given key or any children. */ hasKeyOrChildren(key: Iterable): boolean; /** Gets whether the tree has the given key. */ hasKey(key: Iterable): boolean; private getPathToKey; private opNode; /** Returns an iterable of the tree values in no defined order. */ values(): Generator; } declare class Node implements IPrefixTreeNode { children?: Map>; get value(): T | undefined; set value(value: T | undefined); _value: T | typeof unset; } export {};