export declare type HasParent = { id: string; parent?: { id: string; } | null; }; export declare type TreeNode = T & { children: Array>; expanded: boolean; }; export declare type RootNode = { id?: string; children: Array>; }; /** * Builds a tree from an array of nodes which have a parent. * Based on https://stackoverflow.com/a/31247960/772859, modified to preserve ordering. */ export declare function arrayToTree(nodes: T[], currentState?: RootNode): RootNode;