import { CollectionPreferencesProps } from '../interfaces';
type ContentDisplayItem = CollectionPreferencesProps.ContentDisplayItem;
type ContentDisplayOption = CollectionPreferencesProps.ContentDisplayOption;
type ContentDisplayOptionGroup = CollectionPreferencesProps.ContentDisplayOptionGroup;
export interface OptionWithVisibility extends ContentDisplayOption {
    visible: boolean;
}
export interface OptionGroupNode {
    type: 'group';
    id: string;
    label: string;
    visible: boolean;
    children: OptionTreeNode[];
}
export interface OptionLeafNode extends OptionWithVisibility {
    type: 'leaf';
}
export type OptionTreeNode = OptionGroupNode | OptionLeafNode;
/**
 * Extracts a flat ordered list of leaf items from the contentDisplay tree (depth-first).
 */
export declare function walkLeaves(items: ReadonlyArray<ContentDisplayItem>): {
    id: string;
    visible: boolean;
}[];
/**
 * Returns options ordered by contentDisplay, with visibility applied.
 * Options not in contentDisplay are appended as non-visible.
 */
export declare function getSortedOptions({ options, contentDisplay, }: {
    options: ReadonlyArray<CollectionPreferencesProps.ContentDisplayOption>;
    contentDisplay: ReadonlyArray<CollectionPreferencesProps.ContentDisplayItem>;
}): ReadonlyArray<OptionWithVisibility>;
/**
 * Converts contentDisplay tree into an internal OptionTreeNode tree,
 * resolving labels from options/groups definitions.
 */
export declare function buildOptionTree(options: ReadonlyArray<ContentDisplayOption>, groups: ReadonlyArray<ContentDisplayOptionGroup>, contentDisplay: ReadonlyArray<ContentDisplayItem>): OptionTreeNode[];
/**
 * Converts OptionTreeNode[] back to ContentDisplayItem[].
 */
export declare function toContentDisplayItems(tree: OptionTreeNode[]): ContentDisplayItem[];
/**
 * Filters tree, keeping leaves matching filterText and groups with matching descendants.
 */
export declare function getFilteredTree(tree: OptionTreeNode[], filterText: string): OptionTreeNode[];
export declare function getFilteredOptions(options: ReadonlyArray<OptionWithVisibility>, filterText: string): readonly OptionWithVisibility[];
export {};
//# sourceMappingURL=utils.d.ts.map