import { type ReactElement, type FC } from "react";
import { Haul } from '../haul';
import { List } from '../list';
import { type UseSelectProps } from '../list/useSelect';
import { state } from '../state';
import { type Node, type FlattenedNode } from './core';
import { type RenderProp } from '../util/renderProp';
export declare const HAUL_TYPE = "tree-item";
export interface HandleExpandProps {
    current: string[];
    action: "expand" | "contract";
    clicked: string;
}
export interface UseProps {
    onExpand?: (props: HandleExpandProps) => void;
    selected?: string[];
    onSelectedChange?: state.Set<string[]>;
    initialExpanded?: string[];
    nodes: Node[];
    sort?: boolean;
}
export interface UseReturn {
    selected: string[];
    expanded: string[];
    onSelect: UseSelectProps<string, FlattenedNode>["onChange"];
    nodes: FlattenedNode[];
}
export declare const use: (props: UseProps) => UseReturn;
export interface ItemProps extends List.ItemProps<string, FlattenedNode> {
    onDrop?: (key: string, props: Haul.OnDropProps) => Haul.Item[];
    onSuccessfulDrop?: (key: string, props: Haul.OnSuccessfulDropProps) => void;
    onRename?: (key: string, name: string) => void;
    onDoubleClick?: (key: string, e: React.MouseEvent) => void;
    loading?: boolean;
    useMargin?: boolean;
}
type TreePropsInheritedFromItem = Pick<ItemProps, "onDrop" | "onRename" | "onSuccessfulDrop" | "onDoubleClick" | "useMargin">;
type TreePropsInheritedFromList = Omit<List.VirtualCoreProps<string, FlattenedNode>, "onDrop" | "onSelect" | "children" | "onDoubleClick" | "itemHeight"> & {
    itemHeight?: number;
};
export interface TreeProps extends TreePropsInheritedFromItem, TreePropsInheritedFromList {
    nodes: FlattenedNode[];
    selected?: string[];
    onSelect: UseSelectProps<string, FlattenedNode>["onChange"];
    children?: RenderProp<ItemProps>;
    virtual?: boolean;
}
export type Item = FC<ItemProps>;
export declare const DefaultItem: import("react").MemoExoticComponent<({ entry, selected, onSelect, onDrop, onRename, onSuccessfulDrop, onDoubleClick, loading, useMargin, translate, }: ItemProps) => ReactElement>;
export declare const Tree: ({ nodes, selected, onSelect, onDrop, onRename, onSuccessfulDrop, onDoubleClick, className, children, itemHeight, useMargin, virtual, ...props }: TreeProps) => ReactElement;
export declare const startRenaming: (key: string) => void;
export {};
