import type { TreeItemSorter, TreeItemNode, TreeData, DefaultTreeItemNode } from "./types.js";
/**
 * A lookup to find all the child ids for a specific parent. This was added to
 * support the `*` keyboard behavior of opening all tree items at the current
 * level.
 *
 * @since 6.0.0
 * @internal
 */
export type TreeItemChildIds = Map<string | null, Set<string>>;
/**
 * @since 6.0.0
 * @internal
 */
export type RenderableTreeItemNode<T extends TreeItemNode = DefaultTreeItemNode> = T & {
    items?: readonly RenderableTreeItemNode<T>[];
};
/**
 * @since 6.0.0
 * @internal
 */
export interface BuildTreeOptions<T extends TreeItemNode> {
    sort: TreeItemSorter<T>;
    nodes: T[];
    parentId: string | null;
    treeItemChildIds: TreeItemChildIds;
}
/**
 * This util performantly builds a nested list of tree items from a giant flat
 * list of items by linking items together with the provided `parentId`. This
 * will also recursively build the tree and _hopefully_ all items will be added.
 *
 * @since 6.0.0 Updated to include the {@link TreeItemChildIds}
 */
export declare function buildTree<T extends TreeItemNode>(options: BuildTreeOptions<T>): readonly RenderableTreeItemNode<T>[] | undefined;
/**
 * @since 6.0.0
 */
export interface TreeItemOptions<T extends TreeItemNode> {
    data: TreeData<T>;
    sort: TreeItemSorter<T>;
    rootId: string | null;
}
/**
 * @since 6.0.0
 */
export interface TreeItems<T extends TreeItemNode> {
    items: readonly RenderableTreeItemNode<T>[];
    treeItemChildIds: TreeItemChildIds;
}
/**
 * This is mostly an internal hook, but can be used to build tree-like
 * data structures without the need of the `Tree` component.
 *
 * @since 6.0.0 converted to use an object argument instead of
 * multiple arguments. Also logs any orphaned items that do not have a parent
 */
export declare function useTreeItems<T extends TreeItemNode>(options: TreeItemOptions<T>): TreeItems<T>;
