UNPKG

1.56 kBTypeScriptView Raw
1import URI from './uri';
2export interface IKeyIterator<K> {
3 reset(key: K): this;
4 next(): this;
5 hasNext(): boolean;
6 cmp(a: string): number;
7 value(): string;
8}
9export declare class PathIterator implements IKeyIterator<string> {
10 private readonly _splitOnBackslash;
11 private readonly _caseSensitive;
12 private _value;
13 private _from;
14 private _to;
15 constructor(_splitOnBackslash?: boolean, _caseSensitive?: boolean);
16 reset(key: string): this;
17 hasNext(): boolean;
18 next(): this;
19 cmp(a: string): number;
20 value(): string;
21}
22export declare class UriIterator implements IKeyIterator<URI> {
23 protected readonly caseSensitive: boolean;
24 private _pathIterator;
25 private _value;
26 private _states;
27 private _stateIdx;
28 constructor(caseSensitive: boolean);
29 reset(key: URI): this;
30 next(): this;
31 hasNext(): boolean;
32 cmp(a: string): number;
33 value(): string;
34}
35export declare class TernarySearchTree<K, V> {
36 static forUris<E>(caseSensitive: boolean): TernarySearchTree<URI, E>;
37 static forPaths<E>(): TernarySearchTree<string, E>;
38 private _iter;
39 private _root;
40 constructor(segments: IKeyIterator<K>);
41 clear(): void;
42 set(key: K, element: V): V | undefined;
43 get(key: K): V | undefined;
44 delete(key: K): void;
45 findSubstr(key: K): V | undefined;
46 findSuperstr(key: K): Iterator<V> | undefined;
47 private _nodeIterator;
48 forEach(callback: (value: V, index: K) => any): void;
49 private _forEach;
50}
51//# sourceMappingURL=ternary-search-tree.d.ts.map
\No newline at end of file