import { RafBuildOptionsWithoutRaf, RafBuildOptionsWithRaf } from "../util/RafBuildOptions"; declare const VALUES: unique symbol; declare const VALUE: unique symbol; declare const RANKING: unique symbol; declare const PARENT: unique symbol; declare const LEAF: unique symbol; declare const CHILDREN: unique symbol; declare const CHILD_INDEX: unique symbol; export interface CompletionTrieNode { [key: string]: CompletionTrieNode | undefined; [PARENT]?: CompletionTrieNode; [LEAF]?: CompletionTrieNode; [CHILDREN]?: Array; [VALUE]?: T; [RANKING]?: number; [VALUES]?: Array<[T, number]>; [CHILD_INDEX]?: number; } export interface CompletionTrieMessage { root: CompletionTrieNode; size: number; allowCollisions: boolean; } export default class CompletionTrie { private _size; private root; private _allowCollisions; constructor(allowCollisions?: boolean); get allowCollisions(): boolean; get size(): number; /** * Set a key in the trie to a value * @param key the key to set in the trie * @param value the value to set on the prefix */ set(key: string, value: T, score: number): void; /** * Get a value associated with a key in the trie or undefined if no * value is associated with the key. * @param key the key to get from the trie */ get(key: string): T | undefined; /** * Get array of values associated with a key in the trie or undefined if no * value is associated with the key. * @param key the key to get from the trie */ getArray(key: string): T[] | undefined; /** * Check to see if a key is contained in the trie * @param key the key to check in the trie */ has(key: string): boolean; /** * Empty the trie */ clear(): void; /** * Delete a key from the trie. Returns true if the key is in the trie. * @param key the key to delete in the trie */ delete(key: string): boolean; /** * Find all values in the trie which start with the prefix * @param prefix the prefix to search for in the trie. */ find(prefix: string): Generator<{ key: string; value: T; }>; /** * Find all values in the trie which start with the prefix * @param prefix the prefix to search for in the trie. */ findValues(prefix: string): Generator; topK(prefix: string, k?: number): Generator; private nodeFirstChild; private nodeNextSibling; private nodeIsLeaf; private nodeIsCollisionLeaf; private convertLeafToCollisionLeaf; /** * Get the locus node, the highest node in the trie that matches or extends * the prefix string * @param prefix the prefix to the locus */ private locusForKey; /** * Traverse the trie as far as possible for the given key * @param key the search to traverse for * @returns the node traversed to, the prefix used to get to the node, the suffix left of the key */ private traverseForKey; private setScore; private nodeSortedChildren; private nodeMinValue; toJSON(): string; private nodeToSerializableRecursive; static fromJSON(serializedTrie: string): CompletionTrie; toMessage(): CompletionTrieMessage; static fromMessage(message: CompletionTrieMessage, buildOptions?: RafBuildOptionsWithoutRaf): CompletionTrie; static fromMessage(message: CompletionTrieMessage, buildOptions: RafBuildOptionsWithRaf): Promise>; private removeSymbolsRecursively; private addSymbolsToNode; private addParentLinksRecursively; private removeParentLinksRecursively; } export {};