/** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ import { CollectionViewer, DataSource } from '@angular/cdk/collections'; import { FlatTreeControl, TreeControl } from '@angular/cdk/tree'; import { BehaviorSubject, Observable } from 'rxjs'; export declare class NzTreeFlattener { transformFunction: (node: T, level: number) => F; getLevel: (node: F) => number; isExpandable: (node: F) => boolean; getChildren: (node: T) => Observable | T[] | undefined | null; constructor(transformFunction: (node: T, level: number) => F, getLevel: (node: F) => number, isExpandable: (node: F) => boolean, getChildren: (node: T) => Observable | T[] | undefined | null); private flattenNode; private flattenChildren; /** * Flatten a list of node type T to flattened version of node F. * Please note that type T may be nested, and the length of `structuredData` may be different * from that of returned list `F[]`. */ flattenNodes(structuredData: T[]): F[]; /** * Expand flattened node with current expansion status. * The returned list may have different length. */ expandFlattenedNodes(nodes: F[], treeControl: TreeControl): F[]; } export declare class NzTreeFlatDataSource extends DataSource { private _treeControl; private _treeFlattener; _flattenedData: BehaviorSubject; _expandedData: BehaviorSubject; _data: BehaviorSubject; constructor(_treeControl: FlatTreeControl, _treeFlattener: NzTreeFlattener, initialData?: T[]); setData(value: T[]): void; getData(): T[]; connect(collectionViewer: CollectionViewer): Observable; disconnect(): void; private flatNodes; }