1 | import { Emitter, Event, Disposable } from '../../common';
|
2 | import { CompositeTreeNode, TreeNode, Tree } from './tree';
|
3 | export declare const TreeExpansionService: unique symbol;
|
4 |
|
5 |
|
6 |
|
7 | export interface TreeExpansionService extends Disposable {
|
8 | |
9 |
|
10 |
|
11 | readonly onExpansionChanged: Event<Readonly<ExpandableTreeNode>>;
|
12 | |
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | expandNode(node: Readonly<ExpandableTreeNode>): Promise<Readonly<ExpandableTreeNode> | undefined>;
|
19 | |
20 |
|
21 |
|
22 |
|
23 |
|
24 | collapseNode(node: Readonly<ExpandableTreeNode>): Promise<boolean>;
|
25 | |
26 |
|
27 |
|
28 |
|
29 |
|
30 | collapseAll(node: Readonly<CompositeTreeNode>): Promise<boolean>;
|
31 | |
32 |
|
33 |
|
34 |
|
35 | toggleNodeExpansion(node: Readonly<ExpandableTreeNode>): Promise<void>;
|
36 | }
|
37 |
|
38 |
|
39 |
|
40 | export interface ExpandableTreeNode extends CompositeTreeNode {
|
41 | |
42 |
|
43 |
|
44 | expanded: boolean;
|
45 | }
|
46 | export declare namespace ExpandableTreeNode {
|
47 | function is(node: unknown): node is ExpandableTreeNode;
|
48 | function isExpanded(node: unknown): node is ExpandableTreeNode;
|
49 | function isCollapsed(node: unknown): node is ExpandableTreeNode;
|
50 | }
|
51 | export declare class TreeExpansionServiceImpl implements TreeExpansionService {
|
52 | protected readonly tree: Tree;
|
53 | protected readonly onExpansionChangedEmitter: Emitter<ExpandableTreeNode>;
|
54 | protected init(): void;
|
55 | dispose(): void;
|
56 | get onExpansionChanged(): Event<ExpandableTreeNode>;
|
57 | protected fireExpansionChanged(node: ExpandableTreeNode): void;
|
58 | expandNode(raw: ExpandableTreeNode): Promise<ExpandableTreeNode | undefined>;
|
59 | protected doExpandNode(node: ExpandableTreeNode): Promise<ExpandableTreeNode | undefined>;
|
60 | collapseNode(raw: ExpandableTreeNode): Promise<boolean>;
|
61 | collapseAll(raw: CompositeTreeNode): Promise<boolean>;
|
62 | protected doCollapseAll(node: TreeNode | undefined): boolean;
|
63 | protected doCollapseNode(node: TreeNode | undefined): boolean;
|
64 | toggleNodeExpansion(node: ExpandableTreeNode): Promise<void>;
|
65 | }
|
66 |
|
\ | No newline at end of file |