1 | import { Tree, TreeNode } from './tree';
|
2 | import { TreeSelection, SelectableTreeNode } from './tree-selection';
|
3 |
|
4 |
|
5 |
|
6 | export interface FocusableTreeSelection extends TreeSelection {
|
7 | |
8 |
|
9 |
|
10 |
|
11 | readonly focus?: SelectableTreeNode;
|
12 | }
|
13 | export declare namespace FocusableTreeSelection {
|
14 | |
15 |
|
16 |
|
17 | function is(arg: unknown): arg is FocusableTreeSelection;
|
18 | |
19 |
|
20 |
|
21 |
|
22 | function focus(arg: TreeSelection | undefined): SelectableTreeNode | undefined;
|
23 | }
|
24 |
|
25 |
|
26 |
|
27 | export declare class TreeSelectionState {
|
28 | protected readonly tree: Tree;
|
29 | readonly selectionStack: ReadonlyArray<FocusableTreeSelection>;
|
30 | constructor(tree: Tree, selectionStack?: ReadonlyArray<FocusableTreeSelection>);
|
31 | nextState(selection: FocusableTreeSelection): TreeSelectionState;
|
32 | selection(): ReadonlyArray<SelectableTreeNode>;
|
33 | get focus(): SelectableTreeNode | undefined;
|
34 | get node(): SelectableTreeNode | undefined;
|
35 | protected handleDefault(state: TreeSelectionState, node: Readonly<SelectableTreeNode>): TreeSelectionState;
|
36 | protected handleToggle(state: TreeSelectionState, node: Readonly<SelectableTreeNode>): TreeSelectionState;
|
37 | protected handleRange(state: TreeSelectionState, node: Readonly<SelectableTreeNode>): TreeSelectionState;
|
38 | /**
|
39 | * Returns with an array of items representing the selection range. The from node is the `focus` the to node
|
40 | * is the selected node itself on the tree selection. Both the `from` node and the `to` node are inclusive.
|
41 | */
|
42 | protected selectionRange(selection: FocusableTreeSelection): Readonly<SelectableTreeNode>[];
|
43 | protected toSelectableTreeNode(node: TreeNode | undefined): SelectableTreeNode | undefined;
|
44 | /**
|
45 | * Checks whether the argument contains any `DEFAULT` tree selection type. If yes, throws an error, otherwise returns with a reference the argument.
|
46 | */
|
47 | protected checkNoDefaultSelection<T extends TreeSelection>(selections: ReadonlyArray<T>): ReadonlyArray<T>;
|
48 | }
|
49 | //# sourceMappingURL=tree-selection-state.d.ts.map |
\ | No newline at end of file |