import { GridNode } from '../grid/GridCollection'; import { Key } from '@react-types/shared'; import { TableState, TableStateProps } from './useTableState'; export interface TreeGridState extends Omit, 'expandedKeys'> { /** A set of keys for items that are expanded. */ expandedKeys: 'all' | Set; /** Toggles the expanded state for a row by its key. */ toggleKey(key: Key): void; /** The key map containing nodes representing the collection's tree grid structure. */ keyMap: Map>; /** The number of leaf columns provided by the user. */ userColumnCount: number; } export interface TreeGridStateProps extends Omit, 'collection'> { /** The currently expanded keys in the collection (controlled). */ UNSTABLE_expandedKeys?: 'all' | Iterable; /** The initial expanded keys in the collection (uncontrolled). */ UNSTABLE_defaultExpandedKeys?: 'all' | Iterable; /** Handler that is called when items are expanded or collapsed. */ UNSTABLE_onExpandedChange?: (keys: Set) => any; } /** * Provides state management for a tree grid component. Handles building a collection * of columns and rows from props. In addition, it tracks and manages expanded rows, row selection, and sort order changes. */ export declare function UNSTABLE_useTreeGridState(props: TreeGridStateProps): TreeGridState;