import { MenuOption, MultiSelectState } from '../../../types'; /** * Returns true when an option has children, whether they are already loaded or * only represented by the server-provided `totalChildCount` for lazy-loading. * Fully loaded children still count as cascade children — this helper answers * "is this a parent?", not "are there more children to load?". */ export declare function hasCascadeChildren(option: MenuOption): boolean; /** Recursively collect all leaf (childless) options from a tree. */ export declare function collectLeafOptions(options: MenuOption[]): MenuOption[]; /** * Merge two sets of leaf options, deduplicating by ID. * * Returns a single array containing every leaf from `base`, plus any leaves * from `overlay` whose ID doesn't already appear in `base`. This is used to * combine original (unfiltered) leaves with dynamically loaded (see-more) * leaves so that the full set is available for selection / checked-state logic. */ export declare function mergeLeafOptions(base: MenuOption[], overlay: MenuOption[]): MenuOption[]; /** * Count selected items, collapsing fully-selected parents to 1. * * Walks the option tree bottom-up. A parent whose leaf descendants are ALL * selected counts as 1 (replacing the individual counts of its sub-tree). * Selected leaves not under a fully-selected parent each count as 1. * * This is order-independent — it walks the tree structure directly and does * not depend on Map iteration order. */ export declare function countWithCollapsedParents(options: MenuOption[], selectedIds: Set): number; export declare function countFromSelectionState(state: MultiSelectState): number; /** * Recursively filter a tree for a search value. * * - If a node's own text matches, it is kept with all its children intact. * - If a node's own text does NOT match but one or more of its descendants do, * the node is kept as a container showing only the matching descendants. * This means a search term that matches a child will surface that child even * when the parent label itself doesn't contain the search term. * - Nodes with no match anywhere in their subtree are removed entirely. */ export declare function filterOptionsRecursive(options: MenuOption[], searchValue: string, showParentOnChildQueryMatch?: boolean): MenuOption[];