@clarketm/supertrie
Version:
Trie with superpowers! 💪
14 lines (11 loc) • 418 B
Flow
declare export class Trie {
_root: TrieNode;
get root(): TrieNode;
constructor(iterable?: Array<string>): void;
contains(word: string): boolean;
includes(word: string): boolean;
insert(word: string): void;
remove(word: string): boolean;
search(query: string): {isCompleteWord: boolean, isMatch: boolean, matchedChars: number, node: ?TrieNode, query: string};
startsWith(prefix: string): boolean;
}