import type { RawBlock } from './interfaces';
export interface PlannerConfig {
    maxSlots?: number;
    minSlots?: number;
    minAvgBytes?: number;
    maxAvgBytes?: number;
    alpha?: number;
    growThreshold?: number;
    shrinkThreshold?: number;
    resizeCooldownMs?: number;
}
export declare class CapacityPlanner {
    private emaAvgSize;
    private lastResizeAt;
    private readonly maxSlots;
    private readonly minSlots;
    private readonly minAvgBytes;
    private readonly maxAvgBytes;
    private readonly alpha;
    private readonly growThreshold;
    private readonly shrinkThreshold;
    private readonly resizeCooldownMs;
    constructor(initialAvgBytes: number, cfg?: PlannerConfig);
    observe(sampleBytes: number): void;
    getAvg(): number;
    desiredSlots(maxQueueBytes: number): number;
    shouldResize(params: {
        now: number;
        maxQueueBytes: number;
        currentCapacity: number;
        currentCount: number;
    }): {
        need: boolean;
        targetSlots: number;
    };
    markResized(now: number): void;
}
export declare class BlocksQueue<TBlock = RawBlock> {
    private _lastHeight;
    private _maxQueueSize;
    private _blockSize;
    private _size;
    private _maxBlockHeight;
    private readonly mutex;
    private native?;
    private blocks;
    private headIndex;
    private tailIndex;
    private currentBlockCount;
    private readonly heightIndex;
    private readonly hashIndex;
    private readonly planner;
    maxBlockHeight: number;
    maxQueueSize: number;
    constructor(options: {
        lastHeight: number;
        maxQueueSize: number;
        blockSize?: number;
        maxBlockHeight?: number;
        plannerConfig?: PlannerConfig;
    });
    get isQueueFull(): boolean;
    isQueueOverloaded(additionalSize: number): boolean;
    get isMaxHeightReached(): boolean;
    get currentSize(): number;
    get length(): number;
    get lastHeight(): number;
    enqueue(item: RawBlock): Promise<void>;
    dequeue(hashOrHashes: string | string[]): Promise<number>;
    findBlocks(hashSet: Set<string>): Promise<RawBlock[]>;
    getBatchUpToSize(maxSize: number): Promise<RawBlock[]>;
    clear(): void;
    reorganize(reorganizeHeight: number): Promise<void>;
    dispose(): void;
    getMemoryStats(): {
        bufferAllocated: number;
        blocksUsed: number;
        bufferEfficiency: number;
        avgBlockSize: number;
        indexesSize: number;
        memoryUsedBytes: number;
    };
    private resizeRing;
}
