import { type VirtualItem } from '@tanstack/virtual-core';
import type { ReactiveController, ReactiveControllerHost } from 'lit';
export interface VirtualControllerOptions {
    /** Returns the scroll container element (the grid body's scroller). */
    getScrollElement: () => HTMLElement | null;
    /** Estimated height in pixels for the row at `index` (accounts for expanded detail panels). */
    estimateSize: (index: number) => number;
    /** Extra rows to render above and below the viewport. */
    overscan?: number;
    /**
     * A row index to keep rendered even when scrolled out of the window. The grid pins the active (roving-tabindex)
     * row so the single `tabindex="0"` cell always exists — otherwise scrolling it away leaves nothing tabbable.
     */
    pinnedIndex?: number | null;
    /**
     * The offset of the row list's start within the scroll container — the in-flow sticky header's height. Without
     * it, `scrollToIndex` computes targets in a coordinate space that ignores the header and lands rows under it.
     */
    scrollMargin?: number;
    /** Sticky overlays at the viewport's start (header) that aligned scroll targets must clear. */
    scrollPaddingStart?: number;
    /** Sticky overlays at the viewport's end (footer row) that aligned scroll targets must clear. */
    scrollPaddingEnd?: number;
}
/**
 * Reactive controller wrapping a `@tanstack/virtual-core` `Virtualizer` for row virtualization. The core handles
 * measurement caching, overscan, smooth scrolling, and iOS momentum; this binds it to the host lifecycle and
 * re-renders on scroll/resize.
 */
export declare class VirtualController implements ReactiveController {
    private host;
    private virtualizer;
    private cleanup;
    private count;
    private pinnedIndex;
    /** The default window plus the pinned (active) row, so the roving tab stop is always in the DOM. */
    private extractRange;
    /** True while the viewport is actively resizing (between the first rect change and the settle timeout). */
    private resizing;
    private resizeTimer;
    /** Called when a resize burst ends so the host can re-measure and re-render exactly once. */
    private onResizeSettled;
    constructor(host: ReactiveControllerHost);
    hostConnected(): void;
    hostDisconnected(): void;
    /** Whether a viewport resize is in flight. The host reads this to skip expensive per-frame layout work. */
    get isResizing(): boolean;
    /** Registers a callback invoked once after a resize burst settles (host re-measures + re-renders there). */
    setResizeSettledCallback(cb: () => void): void;
    /**
     * Debounced replacement for virtual-core's `observeElementRect`. The raw observer fires on every ResizeObserver tick
     * during a drag, thrashing layout. We forward the first rect (so the virtualizer has a viewport), flag `resizing` to
     * suspend the host's per-render measurements, then forward only the final rect after `RESIZE_SETTLE_MS` of stability.
     */
    private observeRectDebounced;
    /** Configures the virtualizer for the current row count, creating it lazily. */
    configure(count: number, options: VirtualControllerOptions): void;
    /** The configured scrollMargin (the sticky header's height). Virtual item `start` values include it. */
    get scrollMargin(): number;
    /** The window of rows to render this frame. */
    getVirtualItems(): VirtualItem[];
    /** Total scrollable height in pixels — set this as the row container's height to preserve scrollbar geometry. */
    getTotalSize(): number;
    /** Attach to each rendered row's element so the virtualizer can record its real (measured) height. */
    measureElement: (node: Element | null) => void;
    /** Recomputes item sizes from `estimateSize`. Call when a row's height changes (e.g. detail expansion). */
    clearMeasurements(): void;
    scrollToIndex(index: number, align?: 'start' | 'center' | 'end' | 'auto' | {
        align?: 'start' | 'center' | 'end' | 'auto';
        behavior?: 'auto' | 'smooth';
    }): void;
    get rowCount(): number;
}
export type { VirtualItem };
