import type { AggregationFn, GroupFn, GroupIdFn, RowGroup, RowLeaf } from "@1771technologies/lytenyte-shared"; import type { HavingFilterFn, LabelFilter } from "../../use-client-data-source.js"; export interface RootNode { readonly kind: "root"; readonly children: RootMap; readonly groupLookup: Map>; readonly maxDepth: number; } export interface LeafNode { readonly parent: GroupNode | RootNode; readonly kind: "leaf"; readonly key: string | null | number; readonly row: RowLeaf; } export interface GroupNode { readonly kind: "branch"; readonly id: string; readonly row: RowGroup & { __children: Map | LeafNode>; __invalidate: boolean; }; readonly last: boolean; readonly key: string | null | number; readonly children: Map | LeafNode>; readonly path: (string | null)[]; readonly leafs: number[]; leafIds: Set; readonly parent: GroupNode | RootNode; } export type RootMap = Map | LeafNode>; export declare function useGroupTree(leafs: RowLeaf[], workingSet: number[], group: GroupFn | undefined | null, groupIdFn: GroupIdFn, rowGroupCollapseBehavior: "no-collapse" | "last-only" | "full-tree", labelFilter: (LabelFilter | null)[] | null | undefined, having: (HavingFilterFn | null)[] | null | undefined, agg: AggregationFn | undefined | null): RootNode | null;