export interface ICompare { (a: T, b: T): number; } export class Heap implements Iterable { constructor(comparator: ICompare, values?: T[], leaf?: T); toArray(): T[]; [Symbol.iterator](): Iterator; insert(value: T): Heap; push(value: T): Heap; extractRoot(): T | null; pop(): T | null; sort(): T[]; fix(): Heap; isValid(): boolean; clone(): Heap; root(): T | null; top(): T | null; leaf(): T | null; size(): number; isEmpty(): boolean; clear(): void; static heapify(values: T[], comparator: ICompare): Heap; static isHeapified(values: T[], comparator: ICompare): boolean; }