export type HasParent = { id: string; parent?: { id: string; } | null; }; export type TreeNode = T & { children: Array>; expanded: boolean; }; export 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, expandedIds?: string[]): RootNode;