import BaseFilter from '../base-filter';
/**
 * An element in a MinHeap
 * @author Thomas Minier
 */
interface HeapElement {
    value: string;
    frequency: number;
}
/**
 * An element in a TopK
 * @author Thomas Minier
 */
interface TopkElement extends HeapElement {
    rank: number;
}
/**
 * A TopK computes the ranking of elements in a multiset (by an arbitrary score) and returns the `k` results with the highest scores.
 * This implementation of the TopK problem sorts items based on their estimated cardinality in the multiset.
 * It is based on a Count Min Sketch, for estimating the cardinality of items, and a MinHeap, for implementing a sliding window over the `k` results with the highest scores.
 * @author Thomas Minier
 * @author Arnaud Grall
 */
export default class TopK extends BaseFilter {
    private _k;
    private _errorRate;
    private _accuracy;
    private _sketch;
    private _heap;
    /**
     * Constructor
     * @param k - How many elements to store
     * @param errorRate - The error rate
     * @param accuracy  - The probability of accuracy
     */
    constructor(k: number, errorRate: number, accuracy: number);
    /**
     * Add an element to the TopK
     * @param element - Element to add
     */
    add(element: string, count?: number): void;
    /**
     * Clear the content of the TopK
     */
    clear(): void;
    /**
     * Get the top-k values as an array of objects {value: string, frequency: number, rank: number}
     * @return The top-k values as an array of objects {value: string, frequency: number, rank: number}
     */
    values(): TopkElement[];
    /**
     * Get the top-k values as an iterator that yields objects {value: string, frequency: number, rank: number}.
     * WARNING: With this method, values are produced on-the-fly, hence you should not modify the TopK
     * while the iteration is not completed, otherwise the generated values may not respect the TopK properties.
     * @return The top-k values as an iterator of object {value: string, frequency: number, rank: number}
     */
    iterator(): Iterator<TopkElement>;
}
export {};
