import type { TablePlugin } from '../../types';
/** Structural position of one visible row within the tree. */
export interface TableTreeRowMeta {
    /** The row's id (from `idKey`). */
    id: string;
    /** 0-based depth: roots are level 0. */
    level: number;
    /** Whether the row shows an expander. */
    hasChildren: boolean;
    /** Whether the row is currently expanded. */
    isExpanded: boolean;
}
/**
 * Configuration for useTableTreeData. `useTableTreeState` returns a
 * ready-made value (`treeConfig`); consumers with server-driven or
 * pre-flattened trees can construct one directly.
 */
export interface UseTableTreeDataConfig<T extends Record<string, unknown>> {
    /** Structural meta for a visible row; undefined for unknown rows. */
    getRowMeta: (item: T) => TableTreeRowMeta | undefined;
    /** Toggle a row's expansion. */
    onToggleItem: (item: T) => void;
    /**
     * Whether any row in the dataset is expandable. When false the plugin is
     * a no-op: no expanders, no indent, no tree ARIA — flat data renders
     * identically to a Table without the plugin.
     */
    hasExpandableRows: boolean;
    /**
     * Aggregate expansion state across every expandable row. When provided
     * together with `onExpandAll`/`onCollapseAll`, the tree column header shows
     * an expand-all toggle. `useTableTreeState` supplies all three.
     */
    isAllExpanded?: boolean | 'indeterminate';
    /** Expand every expandable row. Wired to the header expand-all control. */
    onExpandAll?: () => void;
    /** Collapse every row. Wired to the header expand-all control. */
    onCollapseAll?: () => void;
    /**
     * Show the expand-all/collapse-all toggle in the tree column header. Needs
     * `isAllExpanded` and `onExpandAll`/`onCollapseAll` to be present.
     * @default false
     */
    hasExpandAllControl?: boolean;
    /**
     * Indent step per level, as spacing tokens.
     * @default 'md'
     */
    indent?: 'sm' | 'md' | 'lg';
    /** Column that carries the indent + expander. @default the first column */
    treeColumnKey?: string;
    /**
     * When true, clicking anywhere on an expandable row toggles its expansion,
     * in addition to the chevron. Leaf rows stay inert. No-op on flat data.
     *
     * This is a pointer-only convenience layered over the chevron: keyboard and
     * assistive-tech users toggle via the chevron button (which stays the
     * accessible control). Clicks originating from interactive cell content
     * (buttons, links, form controls) or a text selection do not toggle.
     * @default false (only the chevron toggles expansion).
     */
    hasRowClickExpansion?: boolean;
}
export declare function useTableTreeData<T extends Record<string, unknown>>(config: UseTableTreeDataConfig<T>): TablePlugin<T>;
//# sourceMappingURL=useTableTreeData.d.ts.map