UNPKG

1.87 kBTypeScriptView Raw
1import { Disposable, DisposableCollection } from '../../common/disposable';
2import { Event, Emitter } from '../../common/event';
3import { Tree, TreeNode } from './tree';
4import { TreeDecoration } from './tree-decorator';
5import { FuzzySearch } from './fuzzy-search';
6import { LabelProvider } from '../label-provider';
7export declare class TreeSearch implements Disposable {
8 protected readonly tree: Tree;
9 protected readonly fuzzySearch: FuzzySearch;
10 protected readonly labelProvider: LabelProvider;
11 protected readonly disposables: DisposableCollection;
12 protected readonly filteredNodesEmitter: Emitter<readonly Readonly<TreeNode>[]>;
13 protected _filterResult: FuzzySearch.Match<TreeNode>[];
14 protected _filteredNodes: ReadonlyArray<Readonly<TreeNode>>;
15 protected _filteredNodesAndParents: Set<string>;
16 protected init(): void;
17 getHighlights(): Map<string, TreeDecoration.CaptionHighlight>;
18 /**
19 * Resolves to all the visible tree nodes that match the search pattern.
20 */
21 filter(pattern: string | undefined): Promise<ReadonlyArray<Readonly<TreeNode>>>;
22 protected addAllParentsToFilteredSet(node: TreeNode): void;
23 /**
24 * Returns with the filtered nodes after invoking the `filter` method.
25 */
26 get filteredNodes(): ReadonlyArray<Readonly<TreeNode>>;
27 /**
28 * Event that is fired when the filtered nodes have been changed.
29 */
30 get onFilteredNodesChanged(): Event<ReadonlyArray<Readonly<TreeNode>>>;
31 passesFilters(node: TreeNode): boolean;
32 dispose(): void;
33 protected fireFilteredNodesChanged(nodes: ReadonlyArray<Readonly<TreeNode>>): void;
34 protected toCaptionHighlight(match: FuzzySearch.Match<TreeNode>): TreeDecoration.CaptionHighlight;
35 protected mapRange(range: FuzzySearch.Range): TreeDecoration.CaptionHighlight.Range;
36}
37//# sourceMappingURL=tree-search.d.ts.map
\No newline at end of file