import { IndexedValue, TopK, TopKChanges, TopKMoveChanges } from './topKArray.js';
/**
 * Helper class that manages the state for a single topK window.
 * Encapsulates the multiplicity tracking and topK data structure,
 * providing a clean interface for processing elements and moving the window.
 *
 * This class is used by both TopKWithFractionalIndexOperator (single instance)
 * and GroupedTopKWithFractionalIndexOperator (one instance per group).
 */
export declare class TopKState<K extends string | number, T> {
    #private;
    constructor(topK: TopK<[K, T]>);
    get size(): number;
    get isEmpty(): boolean;
    /**
     * Process an element update (insert or delete based on multiplicity change).
     * Returns the changes to the topK window.
     */
    processElement(key: K, value: T, multiplicity: number): TopKChanges<[K, T]>;
    /**
     * Move the topK window. Only works with TopKArray implementation.
     */
    move(options: {
        offset?: number;
        limit?: number;
    }): TopKMoveChanges<[K, T]>;
}
/**
 * Handles a moveIn change by adding it to the result array.
 */
export declare function handleMoveIn<K extends string | number, T>(moveIn: IndexedValue<[K, T]> | null, result: Array<[[K, IndexedValue<T>], number]>): void;
/**
 * Handles a moveOut change by adding it to the result array.
 */
export declare function handleMoveOut<K extends string | number, T>(moveOut: IndexedValue<[K, T]> | null, result: Array<[[K, IndexedValue<T>], number]>): void;
