import { type ReactElement } from "react";
import { type Haul } from '../haul';
export interface Node {
    key: string;
    name: string;
    renaming?: boolean;
    forcePosition?: number;
    icon?: ReactElement;
    allowRename?: boolean;
    hasChildren?: boolean;
    children?: Node[];
    haulItems?: Haul.Item[];
    canDrop?: (items: Haul.Item[]) => boolean;
    href?: string;
}
export interface NodeWithPosition extends Node {
    depth: number;
    position: number;
}
export interface FlattenedNode extends Node {
    index: number;
    depth: number;
    expanded: boolean;
}
export declare const shouldExpand: (node: Node, expanded: string[]) => boolean;
export interface FlattenProps {
    nodes: Node[];
    expanded: string[];
    depth?: number;
    sort?: boolean;
}
export declare const sortAndSplice: (nodes: Node[], sort: boolean) => Node[];
export declare const flatten: ({ nodes, expanded, depth, sort, }: FlattenProps) => FlattenedNode[];
export interface MoveNodeProps {
    tree: Node[];
    destination: string;
    keys: string | string[];
}
export declare const moveNode: ({ tree, destination, keys }: MoveNodeProps) => Node[];
export interface RemoveNodeProps {
    tree: Node[];
    keys: string | string[];
}
export declare const removeNode: ({ tree, keys }: RemoveNodeProps) => Node[];
export interface SetNodeProps {
    tree: Node[];
    destination: string;
    additions: Node | Node[];
}
export declare const setNode: ({ tree, destination, additions }: SetNodeProps) => Node[];
export interface UpdateNodeProps {
    tree: Node[];
    key: string;
    updater: (node: Node) => Node;
    throwOnMissing?: boolean;
}
export declare const updateNode: ({ tree, key, updater, throwOnMissing, }: UpdateNodeProps) => Node[];
export interface FindNodeProps {
    tree: Node[];
    key: string;
    depth?: number;
}
export declare const findNode: ({ tree, key, depth, }: FindNodeProps) => NodeWithPosition | null;
export interface FindNodesProps {
    tree: Node[];
    keys: string[];
}
export declare const findNodes: ({ tree, keys }: FindNodesProps) => NodeWithPosition[];
export interface FindNodeParentProps {
    tree: Node[];
    key: string;
}
export declare const findNodeParent: ({ tree, key }: FindNodeParentProps) => Node | null;
