/**
 * @license
 * Copyright 2026 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
import { type Region } from '../output.js';
import { type RenderLine } from './terminal-writer.js';
export type ScrollOperation = {
    start: number;
    end: number;
    linesToScroll: number;
    lines: RenderLine[];
    direction: 'up' | 'down';
    scrollToBackbuffer: boolean;
    regionId: string | number;
    newMaxPushed?: number;
};
/**
 * Optimized decision-making for terminal hardware scrolling.
 * Tracks what has been scrolled and pushed to the backbuffer.
 */
export declare class ScrollOptimizer {
    maxRegionScrollTops: Map<string | number, number>;
    lastRegionScrollTops: Map<string | number, number>;
    /**
     * Determines if a region scroll can be optimized with hardware scrolling.
     */
    calculateScrollOperations(region: Region, rows: number, columns: number, cameraY: number, getLinesForScroll: (scrollStart: number, count: number, start: number, end: number) => RenderLine[], calculateStuckTopHeight: (region: Region, absY: number, scrollTop: number) => number, calculateStuckBottomHeight: (region: Region, absY: number, scrollTop: number) => number, stickyHeadersInBackbuffer: boolean): ScrollOperation[];
    updateMaxPushed(regionId: string | number, maxPushed: number): void;
    setMaxPushed(regionId: string | number, maxPushed: number): void;
    resetTracking(regionId: string | number): void;
}
