import { IIterableBidirectionaly } from "@drozdik.m/common-interfaces/IIterableBidirectionaly";
import { IClonable } from "@drozdik.m/common-interfaces/IClonable";
import { IContainer } from "@drozdik.m/common-interfaces/IContainer";
import { ICountable } from "@drozdik.m/common-interfaces/ICountable";
import { IClearable } from "@drozdik.m/common-interfaces/IClearable";
import { IDisposable } from "@drozdik.m/common-interfaces/IDisposable";
import { IBidirectionalySearchableContainer } from "@drozdik.m/common-interfaces/IBidirectionalySearchableContainer";
import { IRemovableContainerByIterator } from "@drozdik.m/common-interfaces/IRemovableContainerByIterator";
import { IUpdatableContainerByIterator } from "@drozdik.m/common-interfaces/IUpdatableContainerByIterator";
import { IRandomAccessibleIterable } from "@drozdik.m/common-interfaces/IRandomAccessibleIterable";
import { IComparator } from "@drozdik.m/common-interfaces/IComparator";
import { IBuildable } from "@drozdik.m/common-interfaces/IBuildable";
import { AVLTreeNode } from "./AVLTreeNode";
import { AVLTreeIterator } from "./AVLTreeIterator";
export declare class AVLTree<T> implements IIterableBidirectionaly<T>, IClonable<AVLTree<T>>, IContainer<T>, ICountable, IClearable, IDisposable, IBidirectionalySearchableContainer<T>, IRemovableContainerByIterator<T>, IUpdatableContainerByIterator<T>, IRandomAccessibleIterable<T>, IBuildable<T> {
    private comparator;
    private root;
    /**
     * Creates new instance of the object.
     * @param items Initial items in the binary search tree.
     * @param comparator Comparator - It automatically detects IComparable classes.
     */
    constructor(items?: T[], comparator?: IComparator<T>);
    Insert(item: T): void;
    /**
     * Recursive insert method
     * @param value Value to insert
     * @param node Current node
     */
    private InsertRec;
    Find(item: T): AVLTreeIterator<T>;
    /**
     * Return node by inserted value
     * @param item
     */
    private FindNode;
    /**
     * Recursive function for searching
     * @param value Value
     * @param node Current/Initial node
     */
    private FindRec;
    RemoveAt(iterator: AVLTreeIterator<T>): void;
    Remove(item: T): void;
    /**
     * Recursive function sor deleting
     * @param value Value to delete
     * @param node Current node/Initial node
     */
    private DeleteRec;
    UpdateAt(newValue: T, iterator: AVLTreeIterator<T>): void;
    Update(oldValue: T, newValue: T): void;
    At(index: number): T;
    AtIterator(index: number): AVLTreeIterator<T>;
    /**
     * Recursive function for finding nth index
     * @param index Index
     * @param node Initial/Current node
     */
    private AtRec;
    FindMin(): AVLTreeIterator<T>;
    private FindMinRec;
    FindMax(): AVLTreeIterator<T>;
    private FindMaxRec;
    Dispose(): void;
    Clear(): void;
    First(): AVLTreeIterator<T>;
    Last(): AVLTreeIterator<T>;
    Clone(): AVLTree<T>;
    /**
     * Recursive clone function that clones nodes
     * @param node Root/Current node
     * @param parent Nodes parent node
     */
    private CloneRec;
    Build(items: T[]): void;
    Count(): number;
    IsEmpty(): boolean;
    /**
     * Rotate a node in left direction
     * @param x Node to rotate around
     * @returns Higher node in tree hierarchy
     */
    protected RotateLeft(x: AVLTreeNode<T>): AVLTreeNode<T>;
    /**
     * Rotate a node in right direction
     * @param y Node to rotate around
     * @returns Higher node in tree hierarchy
     */
    protected RotateRight(y: AVLTreeNode<T>): AVLTreeNode<T>;
    /**
     * Rotate a node to left and right
     * @param x Node to rotate around
     * @returns Higher node in tree hierarchy
     */
    protected RotateLeftRight(x: AVLTreeNode<T>): AVLTreeNode<T>;
    /**
     * Rotate a node to right and left
     * @param x Node to rotate around
     * @returns Higher node in tree hierarchy
     */
    protected RotateRightLeft(x: AVLTreeNode<T>): AVLTreeNode<T>;
    /**
     * Rotates the node if needed.
     * @param node Node to check
     * @returns Higher node in tree hierarchy
     */
    protected RotateAdvisorInsert(node: AVLTreeNode<T>): AVLTreeNode<T>;
    /**
     * Rotates the node if needed.
     * @param node Node to check
     * @returns Higher node in tree hierarchy
     */
    protected RotateAdvisorDelete(node: AVLTreeNode<T>): AVLTreeNode<T>;
}
