import { ReactElement, ReactNode } from 'react';
import { Key, Selection } from 'react-aria-components';
import { TreeNode } from './useSortableTree';
export type { TreeNode };
/** Per-row state handed to `renderNode` — enough to pick a node icon. */
export interface TreeNodeState {
    /** Whether this (container) row is expanded. */
    isExpanded: boolean;
    /** Whether this row has children. */
    hasChildren: boolean;
    /** Depth in the tree, 1 = top level. */
    level: number;
    /** Whether this row is selected. */
    isSelected: boolean;
}
export interface TreeProps<T extends TreeNode> {
    /** Accessible label for the tree. */
    'aria-label': string;
    /** Initial tree data (uncontrolled — use `onChange` to persist). */
    items: T[];
    /** Fires with the new nested data after a drag reorder or reparent. */
    onChange?: (items: T[]) => void;
    /** Render a row's content. Receives per-row state for icon choices. Defaults to the node id. */
    renderNode?: (node: T, state: TreeNodeState) => ReactNode;
    /** Plain-text label per node (drag preview + typeahead). Defaults to the id. */
    getLabel?: (node: T) => string;
    /**
     * Enable drag-to-reorder and drop-to-reparent (pointer + keyboard).
     * Off by default — a plain display/selection tree until you opt in.
     */
    sortable?: boolean;
    /**
     * Show the drag handle when `sortable`. When false, the whole row is the
     * drag source (matches designs without a visible handle). Default true.
     */
    dragHandle?: boolean;
    /** Row size — `sm | md | lg`, same scale as Button. @default 'md' */
    size?: 'sm' | 'md' | 'lg';
    /** Whether a node may accept children dropped onto it. Default: always. */
    canHaveChildren?: (node: T) => boolean;
    selectionMode?: 'none' | 'single' | 'multiple';
    /** `toggle` = click/checkbox selects; `replace` = click replaces selection. */
    selectionBehavior?: 'toggle' | 'replace';
    /** Render a checkbox per row. Only meaningful when selection is enabled. */
    showCheckboxes?: boolean;
    /** Controlled selection. Pair with `onSelectionChange`; omit for uncontrolled. */
    selectedKeys?: Selection;
    /** Initial selection when uncontrolled. Ignored if `selectedKeys` is set. */
    defaultSelectedKeys?: 'all' | Iterable<Key>;
    /** Fires with the new selection after a click/checkbox change. */
    onSelectionChange?: (keys: Selection) => void;
    /** Controlled expansion. Pair with `onExpandedChange`; omit for uncontrolled. */
    expandedKeys?: Iterable<Key>;
    /** Initial expansion when uncontrolled. Ignored if `expandedKeys` is set. Default `all`. */
    defaultExpandedKeys?: 'all' | Iterable<Key>;
    /** Fires with the new expanded set after an expand/collapse. */
    onExpandedChange?: (keys: Set<Key>) => void;
    className?: string;
}
/**
 * Tree — a generic, accessible hierarchical tree.
 *
 * One primitive, composable capabilities (all built on React Aria's `Tree`):
 * - **display** — the default: expand/collapse, keyboard navigation.
 * - **selection** — `selectionMode="single" | "multiple"`, optional
 *   `showCheckboxes`. Controllable via `selectedKeys`/`onSelectionChange`.
 * - **sortable** — `sortable` enables drag-to-reorder and drop-to-reparent,
 *   with pointer *and* keyboard support and screen-reader announcements.
 *
 * Expansion is controllable via `expandedKeys`/`onExpandedChange` — the hook
 * for toolbar affordances like expand-all/collapse-all or search auto-expand.
 *
 * Domain-agnostic: give it `{ id, children }` nodes and a `renderNode`. Meant
 * as the substrate for builders like a form/questionnaire editor — the domain
 * mapping stays in the consuming app.
 *
 * @beta This component is experimental — prop shape may change before release.
 */
export declare function Tree<T extends TreeNode>(props: TreeProps<T>): ReactElement;
//# sourceMappingURL=Tree.d.ts.map