UNPKG

360 BTypeScriptView Raw
1interface TrieInput<T> {
2 [key: string]: T;
3}
4interface TrieLeafNode<T> {
5 data: T;
6 end: true;
7 needBoundary?: true;
8}
9export interface Trie<T> {
10 [key: string]: Trie<T> | TrieLeafNode<T>;
11}
12export type TrieNode<T> = Trie<T> | TrieLeafNode<T>;
13export declare function createTrie<T = any>(input: TrieInput<T>): Trie<T>;
14export {};