import type { TableNode, TableRecord } from '../types';
export interface Config<Item> {
    id: keyof Item;
    parentId: keyof Item;
}
type TableNodePartial = Partial<TableNode>;
/**
 * Unflattens an array to a tree with runtime O(n)
 */
export declare function arrayToTree<TData extends TableRecord>(items: readonly TData[], config: Config<TData>): TableNode<TData>[];
/**
 * Returns the number of nodes in a tree in a recursive way
 * @param tree An array of nodes (tree items), each having a field `childrenField` that contains an array of nodes
 * @returns Number of nodes in the tree
 */
export declare function countNodes(tree: TableNodePartial[]): number;
export {};
