export interface HeapConfig<Item> {
    getPos?: (item: Item) => number;
    setPos?: (item: Item, pos: number) => void;
}
export declare class BinaryHeap<Item> {
    private compare;
    /** @param compare Compare two items, as used with Array.sort. */
    constructor(compare: (a: Item, b: Item) => number, { getPos, setPos }?: HeapConfig<Item>);
    /** Erase all contents of the heap. */
    clear(): void;
    isEmpty(): boolean;
    /** Insert a new item in the heap.
      * @return Index of the inserted item in the heap's internal array. */
    insert(item: Item): void;
    /** Update the position of an item in the heap. */
    update(item: Item): Item;
    /** Get the top item of the heap without removing it. */
    peekTop(): Item | null;
    /** Remove and return the top item of the heap. */
    extractTop(): Item | null;
    /** Move an item upwards in the heap, to its correct position.
      * @param item Item to move.
      * @param pos Index of the item in the heap's internal array. */
    bubble(item: Item, pos: number): void;
    /** Move an item downwards in the heap, to its correct position.
      * @param item Item to move.
      * @param pos Index of the item in the heap's internal array. */
    sink(item: Item, pos: number): void;
    private getPos?;
    private setPos;
    heap: Item[];
    last: number;
}
