import Model from '../model/Model';
import List from './List';
import { DimensionLoose, ParsedValue } from '../util/types';
import { Dictionary } from 'zrender/lib/core/types';
declare type TreeTraverseOrder = 'preorder' | 'postorder';
declare type TreeTraverseCallback<Ctx> = (this: Ctx, node: TreeNode) => boolean | void;
declare type TreeTraverseOption = {
    order?: TreeTraverseOrder;
    attr?: 'children' | 'viewChildren';
};
interface TreeNodeData {
    name?: string;
    value?: any;
    children?: TreeNodeData[];
}
export declare class TreeNode {
    name: string;
    depth: number;
    height: number;
    parentNode: TreeNode;
    dataIndex: number;
    children: TreeNode[];
    viewChildren: TreeNode[];
    isExpand: boolean;
    readonly hostTree: Tree<Model, any, any>;
    constructor(name: string, hostTree: Tree<Model, any, any>);
    isRemoved(): boolean;
    eachNode<Ctx>(options: TreeTraverseOrder, cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
    eachNode<Ctx>(options: TreeTraverseOption, cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
    eachNode<Ctx>(cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
    updateDepthAndHeight(depth: number): void;
    getNodeById(id: string): TreeNode;
    contains(node: TreeNode): boolean;
    getAncestors(includeSelf?: boolean): TreeNode[];
    getAncestorsIndices(): number[];
    getDescendantIndices(): number[];
    getValue(dimension?: DimensionLoose): ParsedValue;
    setLayout(layout: any, merge?: boolean): void;
    getLayout(): any;
    getModel<T = unknown>(): Model<T>;
    getLevelModel(): Model;
    setVisual(key: string, value: any): void;
    setVisual(obj: Dictionary<any>): void;
    getVisual(key: string): any;
    getRawIndex(): number;
    getId(): string;
    isAncestorOf(node: TreeNode): boolean;
    isDescendantOf(node: TreeNode): boolean;
}
declare class Tree<HostModel extends Model = Model, LevelOption = any, LeavesOption = any> {
    type: 'tree';
    root: TreeNode;
    data: List;
    hostModel: HostModel;
    levelModels: Model<LevelOption>[];
    private _nodes;
    constructor(hostModel: HostModel, levelOptions: LevelOption[]);
    eachNode<Ctx>(options: TreeTraverseOrder, cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
    eachNode<Ctx>(options: TreeTraverseOption, cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
    eachNode<Ctx>(cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
    getNodeByDataIndex(dataIndex: number): TreeNode;
    getNodeById(name: string): TreeNode;
    update(): void;
    clearLayouts(): void;
    static createTree<T extends TreeNodeData, HostModel extends Model, LevelOption>(dataRoot: T, hostModel: HostModel, treeOptions?: {
        levels?: LevelOption[];
    }, beforeLink?: (data: List) => void): Tree<HostModel, LevelOption, any>;
}
export default Tree;
