1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { Observable } from 'rxjs';
|
---|
9 | import { BaseTreeControl } from './base-tree-control';
|
---|
10 | /** Optional set of configuration that can be provided to the NestedTreeControl. */
|
---|
11 | export interface NestedTreeControlOptions<T, K> {
|
---|
12 | trackBy?: (dataNode: T) => K;
|
---|
13 | }
|
---|
14 | /** Nested tree control. Able to expand/collapse a subtree recursively for NestedNode type. */
|
---|
15 | export declare class NestedTreeControl<T, K = T> extends BaseTreeControl<T, K> {
|
---|
16 | getChildren: (dataNode: T) => (Observable<T[]> | T[] | undefined | null);
|
---|
17 | options?: NestedTreeControlOptions<T, K> | undefined;
|
---|
18 | /** Construct with nested tree function getChildren. */
|
---|
19 | constructor(getChildren: (dataNode: T) => (Observable<T[]> | T[] | undefined | null), options?: NestedTreeControlOptions<T, K> | undefined);
|
---|
20 | /**
|
---|
21 | * Expands all dataNodes in the tree.
|
---|
22 | *
|
---|
23 | * To make this working, the `dataNodes` variable of the TreeControl must be set to all root level
|
---|
24 | * data nodes of the tree.
|
---|
25 | */
|
---|
26 | expandAll(): void;
|
---|
27 | /** Gets a list of descendant dataNodes of a subtree rooted at given data node recursively. */
|
---|
28 | getDescendants(dataNode: T): T[];
|
---|
29 | /** A helper function to get descendants recursively. */
|
---|
30 | protected _getDescendants(descendants: T[], dataNode: T): void;
|
---|
31 | }
|
---|