import { TreeMultiSelectValue, TreeSelectNode, TreeSelectValue } from "../types";
export type TreeNodeIndex = {
    rootIds: string[];
    nodeById: Map<string, TreeSelectNode>;
    parentById: Map<string, string | undefined>;
    childrenById: Map<string, string[]>;
    preorderIndexById: Map<string, number>;
    nodeIdByCodeValue: Map<string, string>;
};
export type TreeNodeSelectionState = {
    selectedIds: Set<string>;
    partialIds: Set<string>;
};
export type TreeVisibleEntry = {
    node: TreeSelectNode;
    level: number;
    parentId?: string;
    hasChildren: boolean;
    isExpanded: boolean;
    isLeaf: boolean;
};
export declare function createTreeNodeIndex(nodes: readonly TreeSelectNode[]): TreeNodeIndex;
export declare function treeSelectValueToId(value: TreeSelectValue | undefined, index: TreeNodeIndex): string | undefined;
export declare function treeMultiValueToSelectedIds(value: TreeMultiSelectValue | undefined, index: TreeNodeIndex): Set<string>;
export declare function treeSelectedIdsToMultiValue(selectedIds: Set<string>, index: TreeNodeIndex): TreeMultiSelectValue;
export declare function treeSelectValueToMultiValue(value: TreeSelectValue | undefined): TreeMultiSelectValue;
export declare function canonicalizeTreeSelection(selectedIds: Set<string>, index: TreeNodeIndex): Set<string>;
export declare function isTreeNodeSelected(nodeId: string, selectedIds: Set<string>, index: TreeNodeIndex): boolean;
export declare function getTreeNodeSelectionState(selectedIds: Set<string>, index: TreeNodeIndex): TreeNodeSelectionState;
/**
 * Строит каноническое покрытие всех доступных узлов для массового выбора.
 * Ветка схлопывается в parent только тогда, когда внутри неё нет disabled-узлов;
 * иначе выбираются доступные дочерние поддеревья, не затрагивая запреты.
 */
export declare function getSelectableTreeNodeIds(index: TreeNodeIndex, rootIds?: readonly string[]): Set<string>;
export declare function toggleTreeMultiSelection(currentValue: TreeMultiSelectValue | undefined, targetNodeId: string, index: TreeNodeIndex): TreeMultiSelectValue;
export declare function getSelectionExpandedIds(selectedIds: Set<string>, index: TreeNodeIndex): Set<string>;
export declare function filterTreeNodes(nodes: readonly TreeSelectNode[], query: string): {
    nodes: TreeSelectNode[];
    expandedIds: Set<string>;
};
export declare function flattenVisibleTreeNodes(nodes: readonly TreeSelectNode[], expandedIds: Set<string>): TreeVisibleEntry[];
//# sourceMappingURL=treeUtils.d.ts.map