[6a3a178] | 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 { BaseTreeControl } from './base-tree-control';
|
---|
| 9 | /** Optional set of configuration that can be provided to the FlatTreeControl. */
|
---|
| 10 | export interface FlatTreeControlOptions<T, K> {
|
---|
| 11 | trackBy?: (dataNode: T) => K;
|
---|
| 12 | }
|
---|
| 13 | /** Flat tree control. Able to expand/collapse a subtree recursively for flattened tree. */
|
---|
| 14 | export declare class FlatTreeControl<T, K = T> extends BaseTreeControl<T, K> {
|
---|
| 15 | getLevel: (dataNode: T) => number;
|
---|
| 16 | isExpandable: (dataNode: T) => boolean;
|
---|
| 17 | options?: FlatTreeControlOptions<T, K> | undefined;
|
---|
| 18 | /** Construct with flat tree data node functions getLevel and isExpandable. */
|
---|
| 19 | constructor(getLevel: (dataNode: T) => number, isExpandable: (dataNode: T) => boolean, options?: FlatTreeControlOptions<T, K> | undefined);
|
---|
| 20 | /**
|
---|
| 21 | * Gets a list of the data node's subtree of descendent data nodes.
|
---|
| 22 | *
|
---|
| 23 | * To make this working, the `dataNodes` of the TreeControl must be flattened tree nodes
|
---|
| 24 | * with correct levels.
|
---|
| 25 | */
|
---|
| 26 | getDescendants(dataNode: T): T[];
|
---|
| 27 | /**
|
---|
| 28 | * Expands all data nodes in the tree.
|
---|
| 29 | *
|
---|
| 30 | * To make this working, the `dataNodes` variable of the TreeControl must be set to all flattened
|
---|
| 31 | * data nodes of the tree.
|
---|
| 32 | */
|
---|
| 33 | expandAll(): void;
|
---|
| 34 | }
|
---|