TST Class
Signature
export declare class TST<T>
Type Parameters
| Parameter | Description |
|---|---|
| T |
Methods
| Method | Return Type | Description |
|---|---|---|
| get(key) | T | undefined | |
| keysWithPrefix(text) | string[] | |
| map(fn) | void | |
| neighbors(text, distance) | ProxString<T>[] | |
| pairsWithPrefix(text) | TSTResult<T>[] | |
| put(key, val) | void | |
| size() | number |
Method Details
get
Signature
get(key: string): T | undefined;
Parameters
| Parameter | Type | Description |
|---|---|---|
| key | string |
Returns
Return type: T | undefined
keysWithPrefix
Signature
keysWithPrefix(text: string): string[];
Parameters
| Parameter | Type | Description |
|---|---|---|
| text | string |
Returns
Return type: string[]
map
Signature
map(fn: (key: string, val: T) => void): void;
Parameters
| Parameter | Type | Description |
|---|---|---|
| fn | (key: string, val: T) => void |
neighbors
Signature
neighbors(text: string, distance?: number): ProxString<T>[];
Parameters
| Parameter | Modifiers | Type | Description |
|---|---|---|---|
| text | string | ||
| distance | optional | number |
Returns
Return type: ProxString<T>[]
pairsWithPrefix
Signature
pairsWithPrefix(text: string): TSTResult<T>[];
Parameters
| Parameter | Type | Description |
|---|---|---|
| text | string |
Returns
Return type: TSTResult<T>[]
put
Signature
put(key: string, val: T): void;
Parameters
| Parameter | Type | Description |
|---|---|---|
| key | string | |
| val | T |
size
Signature
size(): number;
Returns
Return type: number