/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing'; import { MatTreeNodeHarness } from './node-harness'; import { TreeHarnessFilters, TreeNodeHarnessFilters } from './tree-harness-filters'; export declare type TextTree = { text?: string; children?: TextTree[]; }; /** Harness for interacting with a standard mat-tree in tests. */ export declare class MatTreeHarness extends ComponentHarness { /** The selector for the host element of a `MatTableHarness` instance. */ static hostSelector: string; /** * Gets a `HarnessPredicate` that can be used to search for a tree with specific attributes. * @param options Options for narrowing the search * @return a `HarnessPredicate` configured with the given options. */ static with(options?: TreeHarnessFilters): HarnessPredicate; /** Gets all of the nodes in the tree. */ getNodes(filter?: TreeNodeHarnessFilters): Promise; /** * Gets an object representation for the visible tree structure * If a node is under an unexpanded node it will not be included. * Eg. * Tree (all nodes expanded): * ` * * Node 1 * * Node 2 * * Node 2.1 * * Node 2.1.1 * * * * Node 2.2 * * * ` * * Tree structure: * { * children: [ * { * text: 'Node 1', * children: [ * { * text: 'Node 2', * children: [ * { * text: 'Node 2.1', * children: [{text: 'Node 2.1.1'}] * }, * {text: 'Node 2.2'} * ] * } * ] * } * ] * }; */ getTreeStructure(): Promise; /** * Recursively collect the structured text of the tree nodes. * @param nodes A list of tree nodes * @param level The level of nodes that are being accounted for during this iteration * @param parentExpanded Whether the parent of the first node in param nodes is expanded */ private _getTreeStructure; private _addChildToNode; }