Installation
npm install --save @types/trie-prefix-tree
Summary
This package contains type definitions for trie-prefix-tree (https://github.com/lyndseybrowning/trie-prefix#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/trie-prefix-tree.
type RawTree =
& { "$"?: 1 | undefined }
& { [s in Exclude<string, "$">]?: RawTree | undefined };
declare function Trie(
strings: string[],
): {
dump(spacer?: number): string;
tree(): RawTree;
addWord(word: string): ReturnType<typeof Trie>;
removeWord(word: string): ReturnType<typeof Trie>;
isPrefix(word: string): boolean;
countPrefix(word: string): number;
getPrefix(word: string, sort?: boolean): string[];
getRandomWordWithPrefix(prefix: string): string;
getWords(sorted?: boolean): string[];
hasWord(word: string): boolean;
getAnagrams(word: string): string[];
getSubAnagrams(word: string): string[];
};
export = Trie;
Additional Details
- Last updated: Thu, 19 Sep 2024 17:36:27 GMT
- Dependencies: none
Credits
These definitions were written by James Lismore.