node.d.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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 { TemplateRef } from '@angular/core';
  9. /** Context provided to the tree node component. */
  10. export declare class CdkTreeNodeOutletContext<T> {
  11. /** Data for the node. */
  12. $implicit: T;
  13. /** Depth of the node. */
  14. level: number;
  15. /** Index location of the node. */
  16. index?: number;
  17. /** Length of the number of total dataNodes. */
  18. count?: number;
  19. constructor(data: T);
  20. }
  21. /**
  22. * Data node definition for the CdkTree.
  23. * Captures the node's template and a when predicate that describes when this node should be used.
  24. */
  25. export declare class CdkTreeNodeDef<T> {
  26. template: TemplateRef<any>;
  27. /**
  28. * Function that should return true if this node template should be used for the provided node
  29. * data and index. If left undefined, this node will be considered the default node template to
  30. * use when no other when functions return true for the data.
  31. * For every node, there must be at least one when function that passes or an undefined to
  32. * default.
  33. */
  34. when: (index: number, nodeData: T) => boolean;
  35. /** @docs-private */
  36. constructor(template: TemplateRef<any>);
  37. }