import type { Node } from '../types/node.js'; /** Mnemonist TrieMap ================== JavaScript TrieMap implementation based upon plain objects. As such this structure is more a convenience building upon the trie's advantages than a real performant alternative to already existing structures. Note that the Trie is based upon the TrieMap since the underlying machine is the very same. The Trie just does not let you set values and only considers the existence of the given prefixes. */ export default class TrieMap { static SENTINEL: "\0"; mode: 'array' | 'string'; root: Node; size: number; /** Static @.from function taking an arbitrary iterable & converting it into a trie. @param iterable - Target iterable. */ static from(object: Record): TrieMap; constructor(token?: ArrayConstructor); /** Method used to clear the trie. */ clear(): void; /** Method used to set the value of the given prefix in the trie. @param prefix - Prefix to follow. @param value - Value for the prefix. */ set(prefix: string | Array, value: any): this; /** Method used to update the value of the given prefix in the trie. @param prefix - Prefix to follow. @param updateFunction - Update value visitor callback. */ update(prefix: string | Array, updateFunction: (oldValue: any | undefined) => any): this; /** Method used to return the value sitting at the end of the given prefix or undefined if none exist. @param prefix - Prefix to follow. */ get(prefix: string | Array): K | undefined; /** Method used to delete a prefix from the trie. @param prefix - Prefix to delete. */ delete(prefix: string | Array): boolean; /** Method used to assert whether the given prefix exists in the TrieMap. @param prefix - Prefix to check. */ has(prefix: string | Array): boolean; /** Method used to retrieve every item in the trie with the given prefix. @param prefix - Prefix to query. */ find(prefix: string | Array): Array<[K, V]>; /** Method returning an iterator over the trie's values. @param [prefix] - Optional starting prefix. */ values(prefix?: string | Array): Generator | undefined, unknown>; /** Method returning an iterator over the trie's prefixes. @param [prefix] - Optional starting prefix. */ prefixes(prefix?: string | Array): Generator | undefined, unknown>; /** Method returning an iterator over the trie's entries. @param [prefix] - Optional starting prefix. */ entries(prefix?: string | Array): Generator | undefined, unknown>; keys: (prefix?: string | Array) => Generator | undefined, unknown>; [Symbol.iterator]: (prefix?: string | Array) => Generator | undefined, unknown>; inspect(): any[]; toJSON(): Node; }