index.d.ts 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  1. import { AfterContentChecked } from '@angular/core';
  2. import { AfterContentInit } from '@angular/core';
  3. import { BehaviorSubject } from 'rxjs';
  4. import { BooleanInput } from '@angular/cdk/coercion';
  5. import { ChangeDetectorRef } from '@angular/core';
  6. import { CollectionViewer } from '@angular/cdk/collections';
  7. import { DataSource } from '@angular/cdk/collections';
  8. import { Directionality } from '@angular/cdk/bidi';
  9. import { ElementRef } from '@angular/core';
  10. import { FocusableOption } from '@angular/cdk/a11y';
  11. import * as i0 from '@angular/core';
  12. import { InjectionToken } from '@angular/core';
  13. import { IterableDiffer } from '@angular/core';
  14. import { IterableDiffers } from '@angular/core';
  15. import { NumberInput } from '@angular/cdk/coercion';
  16. import { Observable } from 'rxjs';
  17. import { OnDestroy } from '@angular/core';
  18. import { OnInit } from '@angular/core';
  19. import { QueryList } from '@angular/core';
  20. import { SelectionModel } from '@angular/cdk/collections';
  21. import { Subject } from 'rxjs';
  22. import { TemplateRef } from '@angular/core';
  23. import { TrackByFunction } from '@angular/core';
  24. import { ViewContainerRef } from '@angular/core';
  25. /** Base tree control. It has basic toggle/expand/collapse operations on a single data node. */
  26. export declare abstract class BaseTreeControl<T, K = T> implements TreeControl<T, K> {
  27. /** Gets a list of descendent data nodes of a subtree rooted at given data node recursively. */
  28. abstract getDescendants(dataNode: T): T[];
  29. /** Expands all data nodes in the tree. */
  30. abstract expandAll(): void;
  31. /** Saved data node for `expandAll` action. */
  32. dataNodes: T[];
  33. /** A selection model with multi-selection to track expansion status. */
  34. expansionModel: SelectionModel<K>;
  35. /**
  36. * Returns the identifier by which a dataNode should be tracked, should its
  37. * reference change.
  38. *
  39. * Similar to trackBy for *ngFor
  40. */
  41. trackBy?: (dataNode: T) => K;
  42. /** Get depth of a given data node, return the level number. This is for flat tree node. */
  43. getLevel: (dataNode: T) => number;
  44. /**
  45. * Whether the data node is expandable. Returns true if expandable.
  46. * This is for flat tree node.
  47. */
  48. isExpandable: (dataNode: T) => boolean;
  49. /** Gets a stream that emits whenever the given data node's children change. */
  50. getChildren: (dataNode: T) => Observable<T[]> | T[] | undefined | null;
  51. /** Toggles one single data node's expanded/collapsed state. */
  52. toggle(dataNode: T): void;
  53. /** Expands one single data node. */
  54. expand(dataNode: T): void;
  55. /** Collapses one single data node. */
  56. collapse(dataNode: T): void;
  57. /** Whether a given data node is expanded or not. Returns true if the data node is expanded. */
  58. isExpanded(dataNode: T): boolean;
  59. /** Toggles a subtree rooted at `node` recursively. */
  60. toggleDescendants(dataNode: T): void;
  61. /** Collapse all dataNodes in the tree. */
  62. collapseAll(): void;
  63. /** Expands a subtree rooted at given data node recursively. */
  64. expandDescendants(dataNode: T): void;
  65. /** Collapses a subtree rooted at given data node recursively. */
  66. collapseDescendants(dataNode: T): void;
  67. protected _trackByValue(value: T | K): K;
  68. }
  69. /**
  70. * Injection token used to provide a `CdkTreeNode` to its outlet.
  71. * Used primarily to avoid circular imports.
  72. * @docs-private
  73. */
  74. export declare const CDK_TREE_NODE_OUTLET_NODE: InjectionToken<{}>;
  75. /**
  76. * Nested node is a child of `<cdk-tree>`. It works with nested tree.
  77. * By using `cdk-nested-tree-node` component in tree node template, children of the parent node will
  78. * be added in the `cdkTreeNodeOutlet` in tree node template.
  79. * The children of node will be automatically added to `cdkTreeNodeOutlet`.
  80. */
  81. export declare class CdkNestedTreeNode<T, K = T> extends CdkTreeNode<T, K> implements AfterContentInit, OnDestroy, OnInit {
  82. protected _differs: IterableDiffers;
  83. /** Differ used to find the changes in the data provided by the data source. */
  84. private _dataDiffer;
  85. /** The children data dataNodes of current node. They will be placed in `CdkTreeNodeOutlet`. */
  86. protected _children: T[];
  87. /** The children node placeholder. */
  88. nodeOutlet: QueryList<CdkTreeNodeOutlet>;
  89. constructor(elementRef: ElementRef<HTMLElement>, tree: CdkTree<T, K>, _differs: IterableDiffers);
  90. ngAfterContentInit(): void;
  91. ngOnInit(): void;
  92. ngOnDestroy(): void;
  93. /** Add children dataNodes to the NodeOutlet */
  94. protected updateChildrenNodes(children?: T[]): void;
  95. /** Clear the children dataNodes. */
  96. protected _clear(): void;
  97. /** Gets the outlet for the current node. */
  98. private _getNodeOutlet;
  99. static ɵfac: i0.ɵɵFactoryDeclaration<CdkNestedTreeNode<any, any>, never>;
  100. static ɵdir: i0.ɵɵDirectiveDeclaration<CdkNestedTreeNode<any, any>, "cdk-nested-tree-node", ["cdkNestedTreeNode"], { "role": { "alias": "role"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; }, {}, ["nodeOutlet"], never, false, never>;
  101. }
  102. /**
  103. * CDK tree component that connects with a data source to retrieve data of type `T` and renders
  104. * dataNodes with hierarchy. Updates the dataNodes when new data is provided by the data source.
  105. */
  106. export declare class CdkTree<T, K = T> implements AfterContentChecked, CollectionViewer, OnDestroy, OnInit {
  107. private _differs;
  108. private _changeDetectorRef;
  109. /** Subject that emits when the component has been destroyed. */
  110. private readonly _onDestroy;
  111. /** Differ used to find the changes in the data provided by the data source. */
  112. private _dataDiffer;
  113. /** Stores the node definition that does not have a when predicate. */
  114. private _defaultNodeDef;
  115. /** Data subscription */
  116. private _dataSubscription;
  117. /** Level of nodes */
  118. private _levels;
  119. /**
  120. * Provides a stream containing the latest data array to render. Influenced by the tree's
  121. * stream of view window (what dataNodes are currently on screen).
  122. * Data source can be an observable of data array, or a data array to render.
  123. */
  124. get dataSource(): DataSource<T> | Observable<T[]> | T[];
  125. set dataSource(dataSource: DataSource<T> | Observable<T[]> | T[]);
  126. private _dataSource;
  127. /** The tree controller */
  128. treeControl: TreeControl<T, K>;
  129. /**
  130. * Tracking function that will be used to check the differences in data changes. Used similarly
  131. * to `ngFor` `trackBy` function. Optimize node operations by identifying a node based on its data
  132. * relative to the function to know if a node should be added/removed/moved.
  133. * Accepts a function that takes two parameters, `index` and `item`.
  134. */
  135. trackBy: TrackByFunction<T>;
  136. _nodeOutlet: CdkTreeNodeOutlet;
  137. /** The tree node template for the tree */
  138. _nodeDefs: QueryList<CdkTreeNodeDef<T>>;
  139. /**
  140. * Stream containing the latest information on what rows are being displayed on screen.
  141. * Can be used by the data source to as a heuristic of what data should be provided.
  142. */
  143. readonly viewChange: BehaviorSubject<{
  144. start: number;
  145. end: number;
  146. }>;
  147. constructor(_differs: IterableDiffers, _changeDetectorRef: ChangeDetectorRef);
  148. ngOnInit(): void;
  149. ngOnDestroy(): void;
  150. ngAfterContentChecked(): void;
  151. /**
  152. * Switch to the provided data source by resetting the data and unsubscribing from the current
  153. * render change subscription if one exists. If the data source is null, interpret this by
  154. * clearing the node outlet. Otherwise start listening for new data.
  155. */
  156. private _switchDataSource;
  157. /** Set up a subscription for the data provided by the data source. */
  158. private _observeRenderChanges;
  159. /** Check for changes made in the data and render each change (node added/removed/moved). */
  160. renderNodeChanges(data: readonly T[], dataDiffer?: IterableDiffer<T>, viewContainer?: ViewContainerRef, parentData?: T): void;
  161. /**
  162. * Finds the matching node definition that should be used for this node data. If there is only
  163. * one node definition, it is returned. Otherwise, find the node definition that has a when
  164. * predicate that returns true with the data. If none return true, return the default node
  165. * definition.
  166. */
  167. _getNodeDef(data: T, i: number): CdkTreeNodeDef<T>;
  168. /**
  169. * Create the embedded view for the data node template and place it in the correct index location
  170. * within the data node view container.
  171. */
  172. insertNode(nodeData: T, index: number, viewContainer?: ViewContainerRef, parentData?: T): void;
  173. static ɵfac: i0.ɵɵFactoryDeclaration<CdkTree<any, any>, never>;
  174. static ɵcmp: i0.ɵɵComponentDeclaration<CdkTree<any, any>, "cdk-tree", ["cdkTree"], { "dataSource": { "alias": "dataSource"; "required": false; }; "treeControl": { "alias": "treeControl"; "required": false; }; "trackBy": { "alias": "trackBy"; "required": false; }; }, {}, ["_nodeDefs"], never, false, never>;
  175. }
  176. export declare class CdkTreeModule {
  177. static ɵfac: i0.ɵɵFactoryDeclaration<CdkTreeModule, never>;
  178. static ɵmod: i0.ɵɵNgModuleDeclaration<CdkTreeModule, [typeof i1.CdkNestedTreeNode, typeof i2.CdkTreeNodeDef, typeof i3.CdkTreeNodePadding, typeof i4.CdkTreeNodeToggle, typeof i5.CdkTree, typeof i5.CdkTreeNode, typeof i6.CdkTreeNodeOutlet], never, [typeof i1.CdkNestedTreeNode, typeof i2.CdkTreeNodeDef, typeof i3.CdkTreeNodePadding, typeof i4.CdkTreeNodeToggle, typeof i5.CdkTree, typeof i5.CdkTreeNode, typeof i6.CdkTreeNodeOutlet]>;
  179. static ɵinj: i0.ɵɵInjectorDeclaration<CdkTreeModule>;
  180. }
  181. /**
  182. * Tree node for CdkTree. It contains the data in the tree node.
  183. */
  184. export declare class CdkTreeNode<T, K = T> implements FocusableOption, OnDestroy, OnInit {
  185. protected _elementRef: ElementRef<HTMLElement>;
  186. protected _tree: CdkTree<T, K>;
  187. /**
  188. * The role of the tree node.
  189. * @deprecated The correct role is 'treeitem', 'group' should not be used. This input will be
  190. * removed in a future version.
  191. * @breaking-change 12.0.0 Remove this input
  192. */
  193. get role(): 'treeitem' | 'group';
  194. set role(_role: 'treeitem' | 'group');
  195. /**
  196. * The most recently created `CdkTreeNode`. We save it in static variable so we can retrieve it
  197. * in `CdkTree` and set the data to it.
  198. */
  199. static mostRecentTreeNode: CdkTreeNode<any> | null;
  200. /** Subject that emits when the component has been destroyed. */
  201. protected readonly _destroyed: Subject<void>;
  202. /** Emits when the node's data has changed. */
  203. readonly _dataChanges: Subject<void>;
  204. private _parentNodeAriaLevel;
  205. /** The tree node's data. */
  206. get data(): T;
  207. set data(value: T);
  208. protected _data: T;
  209. get isExpanded(): boolean;
  210. get level(): number;
  211. constructor(_elementRef: ElementRef<HTMLElement>, _tree: CdkTree<T, K>);
  212. ngOnInit(): void;
  213. ngOnDestroy(): void;
  214. /** Focuses the menu item. Implements for FocusableOption. */
  215. focus(): void;
  216. protected _setRoleFromData(): void;
  217. static ɵfac: i0.ɵɵFactoryDeclaration<CdkTreeNode<any, any>, never>;
  218. static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTreeNode<any, any>, "cdk-tree-node", ["cdkTreeNode"], { "role": { "alias": "role"; "required": false; }; }, {}, never, never, false, never>;
  219. }
  220. /**
  221. * Data node definition for the CdkTree.
  222. * Captures the node's template and a when predicate that describes when this node should be used.
  223. */
  224. export declare class CdkTreeNodeDef<T> {
  225. template: TemplateRef<any>;
  226. /**
  227. * Function that should return true if this node template should be used for the provided node
  228. * data and index. If left undefined, this node will be considered the default node template to
  229. * use when no other when functions return true for the data.
  230. * For every node, there must be at least one when function that passes or an undefined to
  231. * default.
  232. */
  233. when: (index: number, nodeData: T) => boolean;
  234. /** @docs-private */
  235. constructor(template: TemplateRef<any>);
  236. static ɵfac: i0.ɵɵFactoryDeclaration<CdkTreeNodeDef<any>, never>;
  237. static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTreeNodeDef<any>, "[cdkTreeNodeDef]", never, { "when": { "alias": "cdkTreeNodeDefWhen"; "required": false; }; }, {}, never, never, false, never>;
  238. }
  239. /**
  240. * Outlet for nested CdkNode. Put `[cdkTreeNodeOutlet]` on a tag to place children dataNodes
  241. * inside the outlet.
  242. */
  243. export declare class CdkTreeNodeOutlet {
  244. viewContainer: ViewContainerRef;
  245. _node?: any;
  246. constructor(viewContainer: ViewContainerRef, _node?: any);
  247. static ɵfac: i0.ɵɵFactoryDeclaration<CdkTreeNodeOutlet, [null, { optional: true; }]>;
  248. static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTreeNodeOutlet, "[cdkTreeNodeOutlet]", never, {}, {}, never, never, false, never>;
  249. }
  250. /** Context provided to the tree node component. */
  251. export declare class CdkTreeNodeOutletContext<T> {
  252. /** Data for the node. */
  253. $implicit: T;
  254. /** Depth of the node. */
  255. level: number;
  256. /** Index location of the node. */
  257. index?: number;
  258. /** Length of the number of total dataNodes. */
  259. count?: number;
  260. constructor(data: T);
  261. }
  262. /**
  263. * Indent for the children tree dataNodes.
  264. * This directive will add left-padding to the node to show hierarchy.
  265. */
  266. export declare class CdkTreeNodePadding<T, K = T> implements OnDestroy {
  267. private _treeNode;
  268. private _tree;
  269. private _element;
  270. private _dir;
  271. /** Current padding value applied to the element. Used to avoid unnecessarily hitting the DOM. */
  272. private _currentPadding;
  273. /** Subject that emits when the component has been destroyed. */
  274. private readonly _destroyed;
  275. /** CSS units used for the indentation value. */
  276. indentUnits: string;
  277. /** The level of depth of the tree node. The padding will be `level * indent` pixels. */
  278. get level(): number;
  279. set level(value: NumberInput);
  280. _level: number;
  281. /**
  282. * The indent for each level. Can be a number or a CSS string.
  283. * Default number 40px from material design menu sub-menu spec.
  284. */
  285. get indent(): number | string;
  286. set indent(indent: number | string);
  287. _indent: number;
  288. constructor(_treeNode: CdkTreeNode<T, K>, _tree: CdkTree<T, K>, _element: ElementRef<HTMLElement>, _dir: Directionality);
  289. ngOnDestroy(): void;
  290. /** The padding indent value for the tree node. Returns a string with px numbers if not null. */
  291. _paddingIndent(): string | null;
  292. _setPadding(forceChange?: boolean): void;
  293. /**
  294. * This has been extracted to a util because of TS 4 and VE.
  295. * View Engine doesn't support property rename inheritance.
  296. * TS 4.0 doesn't allow properties to override accessors or vice-versa.
  297. * @docs-private
  298. */
  299. protected _setLevelInput(value: NumberInput): void;
  300. /**
  301. * This has been extracted to a util because of TS 4 and VE.
  302. * View Engine doesn't support property rename inheritance.
  303. * TS 4.0 doesn't allow properties to override accessors or vice-versa.
  304. * @docs-private
  305. */
  306. protected _setIndentInput(indent: number | string): void;
  307. static ɵfac: i0.ɵɵFactoryDeclaration<CdkTreeNodePadding<any, any>, [null, null, null, { optional: true; }]>;
  308. static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTreeNodePadding<any, any>, "[cdkTreeNodePadding]", never, { "level": { "alias": "cdkTreeNodePadding"; "required": false; }; "indent": { "alias": "cdkTreeNodePaddingIndent"; "required": false; }; }, {}, never, never, false, never>;
  309. }
  310. /**
  311. * Node toggle to expand/collapse the node.
  312. */
  313. export declare class CdkTreeNodeToggle<T, K = T> {
  314. protected _tree: CdkTree<T, K>;
  315. protected _treeNode: CdkTreeNode<T, K>;
  316. /** Whether expand/collapse the node recursively. */
  317. get recursive(): boolean;
  318. set recursive(value: BooleanInput);
  319. protected _recursive: boolean;
  320. constructor(_tree: CdkTree<T, K>, _treeNode: CdkTreeNode<T, K>);
  321. _toggle(event: Event): void;
  322. static ɵfac: i0.ɵɵFactoryDeclaration<CdkTreeNodeToggle<any, any>, never>;
  323. static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTreeNodeToggle<any, any>, "[cdkTreeNodeToggle]", never, { "recursive": { "alias": "cdkTreeNodeToggleRecursive"; "required": false; }; }, {}, never, never, false, never>;
  324. }
  325. /** Flat tree control. Able to expand/collapse a subtree recursively for flattened tree. */
  326. export declare class FlatTreeControl<T, K = T> extends BaseTreeControl<T, K> {
  327. getLevel: (dataNode: T) => number;
  328. isExpandable: (dataNode: T) => boolean;
  329. options?: FlatTreeControlOptions<T, K> | undefined;
  330. /** Construct with flat tree data node functions getLevel and isExpandable. */
  331. constructor(getLevel: (dataNode: T) => number, isExpandable: (dataNode: T) => boolean, options?: FlatTreeControlOptions<T, K> | undefined);
  332. /**
  333. * Gets a list of the data node's subtree of descendent data nodes.
  334. *
  335. * To make this working, the `dataNodes` of the TreeControl must be flattened tree nodes
  336. * with correct levels.
  337. */
  338. getDescendants(dataNode: T): T[];
  339. /**
  340. * Expands all data nodes in the tree.
  341. *
  342. * To make this working, the `dataNodes` variable of the TreeControl must be set to all flattened
  343. * data nodes of the tree.
  344. */
  345. expandAll(): void;
  346. }
  347. /** Optional set of configuration that can be provided to the FlatTreeControl. */
  348. export declare interface FlatTreeControlOptions<T, K> {
  349. trackBy?: (dataNode: T) => K;
  350. }
  351. /**
  352. * Returns an error to be thrown when tree control did not implement functions for flat/nested node.
  353. * @docs-private
  354. */
  355. export declare function getTreeControlFunctionsMissingError(): Error;
  356. /**
  357. * Returns an error to be thrown when there are tree control.
  358. * @docs-private
  359. */
  360. export declare function getTreeControlMissingError(): Error;
  361. /**
  362. * Returns an error to be thrown when there are no matching node defs for a particular set of data.
  363. * @docs-private
  364. */
  365. export declare function getTreeMissingMatchingNodeDefError(): Error;
  366. /**
  367. * Returns an error to be thrown when there are multiple nodes that are missing a when function.
  368. * @docs-private
  369. */
  370. export declare function getTreeMultipleDefaultNodeDefsError(): Error;
  371. /**
  372. * Returns an error to be thrown when there is no usable data.
  373. * @docs-private
  374. */
  375. export declare function getTreeNoValidDataSourceError(): Error;
  376. declare namespace i1 {
  377. export {
  378. CdkNestedTreeNode
  379. }
  380. }
  381. declare namespace i2 {
  382. export {
  383. CdkTreeNodeOutletContext,
  384. CdkTreeNodeDef
  385. }
  386. }
  387. declare namespace i3 {
  388. export {
  389. CdkTreeNodePadding
  390. }
  391. }
  392. declare namespace i4 {
  393. export {
  394. CdkTreeNodeToggle
  395. }
  396. }
  397. declare namespace i5 {
  398. export {
  399. CdkTree,
  400. CdkTreeNode
  401. }
  402. }
  403. declare namespace i6 {
  404. export {
  405. CDK_TREE_NODE_OUTLET_NODE,
  406. CdkTreeNodeOutlet
  407. }
  408. }
  409. /** Nested tree control. Able to expand/collapse a subtree recursively for NestedNode type. */
  410. export declare class NestedTreeControl<T, K = T> extends BaseTreeControl<T, K> {
  411. getChildren: (dataNode: T) => Observable<T[]> | T[] | undefined | null;
  412. options?: NestedTreeControlOptions<T, K> | undefined;
  413. /** Construct with nested tree function getChildren. */
  414. constructor(getChildren: (dataNode: T) => Observable<T[]> | T[] | undefined | null, options?: NestedTreeControlOptions<T, K> | undefined);
  415. /**
  416. * Expands all dataNodes in the tree.
  417. *
  418. * To make this working, the `dataNodes` variable of the TreeControl must be set to all root level
  419. * data nodes of the tree.
  420. */
  421. expandAll(): void;
  422. /** Gets a list of descendant dataNodes of a subtree rooted at given data node recursively. */
  423. getDescendants(dataNode: T): T[];
  424. /** A helper function to get descendants recursively. */
  425. protected _getDescendants(descendants: T[], dataNode: T): void;
  426. }
  427. /** Optional set of configuration that can be provided to the NestedTreeControl. */
  428. export declare interface NestedTreeControlOptions<T, K> {
  429. trackBy?: (dataNode: T) => K;
  430. }
  431. /**
  432. * Tree control interface. User can implement TreeControl to expand/collapse dataNodes in the tree.
  433. * The CDKTree will use this TreeControl to expand/collapse a node.
  434. * User can also use it outside the `<cdk-tree>` to control the expansion status of the tree.
  435. */
  436. export declare interface TreeControl<T, K = T> {
  437. /** The saved tree nodes data for `expandAll` action. */
  438. dataNodes: T[];
  439. /** The expansion model */
  440. expansionModel: SelectionModel<K>;
  441. /** Whether the data node is expanded or collapsed. Return true if it's expanded. */
  442. isExpanded(dataNode: T): boolean;
  443. /** Get all descendants of a data node */
  444. getDescendants(dataNode: T): any[];
  445. /** Expand or collapse data node */
  446. toggle(dataNode: T): void;
  447. /** Expand one data node */
  448. expand(dataNode: T): void;
  449. /** Collapse one data node */
  450. collapse(dataNode: T): void;
  451. /** Expand all the dataNodes in the tree */
  452. expandAll(): void;
  453. /** Collapse all the dataNodes in the tree */
  454. collapseAll(): void;
  455. /** Toggle a data node by expand/collapse it and all its descendants */
  456. toggleDescendants(dataNode: T): void;
  457. /** Expand a data node and all its descendants */
  458. expandDescendants(dataNode: T): void;
  459. /** Collapse a data node and all its descendants */
  460. collapseDescendants(dataNode: T): void;
  461. /** Get depth of a given data node, return the level number. This is for flat tree node. */
  462. readonly getLevel: (dataNode: T) => number;
  463. /**
  464. * Whether the data node is expandable. Returns true if expandable.
  465. * This is for flat tree node.
  466. */
  467. readonly isExpandable: (dataNode: T) => boolean;
  468. /** Gets a stream that emits whenever the given data node's children change. */
  469. readonly getChildren: (dataNode: T) => Observable<T[]> | T[] | undefined | null;
  470. }
  471. export { }