import { type ItemDetail } from "../helpers/collectTableRowEntries.js";
type SubRowsProps<T> = {
    /**
     * Function to get sub-rows for a given row.
     */
    getRows: (rowData: T) => T[];
    /**
     * Controlled list of IDs of rows that should be expanded.
     */
    expandedRowIds?: string[];
    /**
     * IDs of rows that should be initially expanded.
     * Only used when `expandedRowIds` is not provided, i.e. when the expanded state is uncontrolled.
     */
    defaultExpandedRowIds?: string[];
    /**
     * Called when the list of expanded row IDs changes.
     */
    onExpandedRowIdsChange?: (ids: string[]) => void;
    /**
     * Determines whether a row should be expandable.
     * By default, all rows are expandable when `getRows` is provided.
     */
    isRowExpandable?: (rowData: T) => boolean;
};
type UseTableItemsArgs<T> = {
    items: T[];
    getRowId?: (rowData: T) => string;
    subRows?: SubRowsProps<T>;
};
type UseTableItemsReturn<T> = {
    items: T[];
    itemDetails: Map<string, ItemDetail<T>>;
    /** Row ids for the rows currently rendered in the table body. */
    visibleRowIds: string[];
    /** Direct child ids for each row, used to traverse selection groups lazily. */
    childRowIdsById: Map<string, string[]>;
    onExpandedRowIdsChange: (id: string) => void;
    isSubRowExpanded: (id: string) => boolean;
};
declare function useTableItems<T>(args: UseTableItemsArgs<T>): UseTableItemsReturn<T>;
export { useTableItems };
export type { ItemDetail, SubRowsProps, UseTableItemsReturn };
