/******************************************************************************* * Copyright (c) Lenovo 2020. * * LIMITED AND RESTRICTED RIGHTS NOTICE: If data or software is delivered * pursuant a General Services Administration (GSA) contract, use, reproduction, or * disclosure is subject to restrictions set forth in Contract No. GS-35F-05925. ******************************************************************************/ import { TreeNode } from '../../interfaces/treeNode'; /** * Add node levels to a tree * @param root * @param level */ export declare function addNodeLevels(root: TreeNode[], level: number, parentID?: string, rowIdentifier?: string): void; /** * Pre-order tree traversal visits each node using stack. * Checks if leaf node based on children === null otherwise * pushes all children into stack and continues traversal. * hashMap object literal used for deduping. * * Bonus: Because it traverses a tree - it also adds levels to the nodes * @param root - deserialized JSON root to begin traversal * @returns array - final array of nodes in order with no dups */ export declare function convertMultipleRootTreeToList(roots: any[]): any[]; /** * Pre-order tree traversal visits each node using stack. * Checks if leaf node based on children === null otherwise * pushes all children into stack and continues traversal. * hashMap object literal used for deduping. * * Bonus: Because it traverses a tree - it also adds levels to the nodes * @param root - deserialized JSON root to begin traversal * @returns array - final array of nodes in order with no dups */ export declare function convertSingleRootTreeToList(root: any, level?: number): any[]; /** * For each node visit if node not a hashMap key, insert * into array. Then append node into end of the array. * @params node - object to check * @param hashMap - object literal used for deduping * @param array - final array that nodes are inserted */ export declare function visitNode(node: any, hashMap: any, array: any): void; /** * Return hashmap where key is the id of the parent and value represents the array of nodes with that parent id * @param collection - tree collection * @returns */ export declare function groupByParentId(collection: any[]): Map;