import type { UseTableTreeDataConfig } from './useTableTreeData';
export interface UseTableTreeStateConfig<T extends Record<string, unknown>> {
    /** Nested data: rows may carry child rows under `childrenKey`. */
    data: T[];
    /** Row ID accessor: property name, or a function returning a unique id. */
    idKey: (keyof T & string) | ((item: T) => string | number);
    /**
     * Property holding each row's children array.
     * @default 'children'
     */
    childrenKey?: string;
    /** Initial expanded row ids for uncontrolled mode. Ignored when `expandedIds` is provided. */
    defaultExpandedIds?: Iterable<string>;
    /**
     * Controlled set of expanded row ids. When provided, the hook uses this
     * instead of internal state. Pair with `onExpandedIdsChange`.
     */
    expandedIds?: ReadonlySet<string>;
    /** Called with the next expanded set whenever expansion changes. */
    onExpandedIdsChange?: (ids: ReadonlySet<string>) => void;
    /**
     * Should this row show an expander? Overrides the default
     * "has a non-empty children array" check — use for lazy loading, where a
     * row is expandable before its children have been fetched.
     */
    isItemExpandable?: (item: T) => boolean;
    /**
     * Sort each sibling group independently during flattening. Children always
     * stay directly under their parent — sorting never crosses levels. Pass
     * `applySort` from `useTableSortableState` to compose with column sorting.
     */
    sortSiblings?: (siblings: T[]) => T[];
    /** Indent step per level, forwarded to useTableTreeData. */
    indent?: 'sm' | 'md' | 'lg';
    /** Column that carries the tree affordance, forwarded to useTableTreeData. */
    treeColumnKey?: string;
}
export interface UseTableTreeStateResult<T extends Record<string, unknown>> {
    /** The flattened, currently-visible rows. Pass to `<Table data>`. */
    visibleData: T[];
    /** Ready-to-use config for useTableTreeData. */
    treeConfig: UseTableTreeDataConfig<T>;
    /** The current expanded row ids. */
    expandedIds: ReadonlySet<string>;
    /**
     * Aggregate expansion state across every expandable row: `true` when all are
     * expanded, `false` when none are, `'indeterminate'` when some but not all
     * are. Drives the header expand-all control. Reports `false` for flat data.
     */
    isAllExpanded: boolean | 'indeterminate';
    /** Expand every expandable row in the tree. */
    expandAll: () => void;
    /** Collapse every row. */
    collapseAll: () => void;
}
export declare function useTableTreeState<T extends Record<string, unknown>>(config: UseTableTreeStateConfig<T>): UseTableTreeStateResult<T>;
//# sourceMappingURL=useTableTreeState.d.ts.map