import { PlantedTree, SunburstLeaf, SunburstLevel, SunburstTree } from "./sunburst";
export declare function visit(t: SunburstLevel, visitor: (sl: SunburstLevel, depth: number) => boolean, depth?: number): void;
export declare function visitAsync(t: SunburstLevel, visitor: (sl: SunburstLevel, depth: number) => Promise<boolean>, depth?: number): Promise<void>;
export interface GroupSiblingsOptions {
    /**
     * Selector for parents to merge
     */
    parentSelector: (l: SunburstTree) => boolean;
    /**
     * Group siblings to merge under selected parents
     */
    childClassifier: (l: SunburstLevel) => string;
    /**
     * Decorator the new levels
     * @param {SunburstLevel} l
     */
    groupLayerDecorator?: (l: SunburstLevel) => void;
    /**
     * If provided, identifies new grouped node names to collapse under
     */
    collapseUnderName?: (name: string) => boolean;
}
/**
 * Merge siblings into groups by the grouper
 */
export declare function groupSiblings(tr: SunburstTree, params: GroupSiblingsOptions): SunburstTree;
/**
 * Trim the outer rim, replacing the next one with sized leaves
 */
export declare function trimOuterRim(tr: SunburstTree): SunburstTree;
export interface ClassificationLayerOptions<T> {
    /**
     * Classify a descendant. Undefined means this descendant is irrelevant.
     */
    descendantClassifier: (t: SunburstLevel & T) => string | undefined;
    /**
     * Depth at which to activate split and put in an extra layer
     */
    newLayerDepth: number;
    /**
     * What does this new layer mean?
     */
    newLayerMeaning: string;
    /**
     * Source all descendants we may be interested in classifying on.
     * Default is leaves
     * @param {SunburstTree} l
     * @return {SunburstLevel[]}
     */
    descendantFinder?: (l: SunburstTree) => SunburstLevel[];
}
/**
 * Introduce a new level splitting by by the given classifier for descendants
 */
export declare function introduceClassificationLayer<T = {}>(pt: PlantedTree, how: ClassificationLayerOptions<T>): PlantedTree;
export declare function pruneLeaves(tr: SunburstTree, toPrune: (l: SunburstLeaf) => boolean): SunburstTree;
/**
 * Return all terminals under this level
 * @param {SunburstLevel} t
 * @return {SunburstLeaf[]}
 */
export declare function leavesUnder(t: SunburstLevel): SunburstLeaf[];
export declare function descendants(t: SunburstLevel): SunburstLevel[];
export declare function childCount(l: SunburstLevel): number;
export declare function childrenOf(l: SunburstLevel): SunburstLevel[];
/**
 * Merge these trees. They must have the same name.
 * Trees may be merged in memory because they may have many nodes, but don't have much data.
 * @return {SunburstTree}
 */
export declare function mergeTrees(...trees: SunburstTree[]): SunburstTree;
export declare function validatePlantedTree(pt: PlantedTree): void;
//# sourceMappingURL=treeUtils.d.ts.map