/** * The viewport calculator-creation queries for `Viewport`, plus the mixin object that implements them. * * These methods build the row/column render, fully-visible, and partially-visible calculators and * decide (on a fast draw) whether the proposed visible range is already inside the rendered band. * They were extracted verbatim from `Viewport` and applied with the same `mixin()` helper the * range-query and sticky mixins use, so the public surface and behavior are unchanged; only the * private `#deps` access became the public `this.deps` getter. * * The calculator RESULT fields (`rowsRenderCalculator`, `rowsVisibleCalculator`, …) stay owned by * `Viewport`; `createCalculators` / `createVisibleCalculators` assign them through `this`. */ import type { ColumnsCalculationType, RowsCalculationType } from '../calculator/viewportBase'; import { ViewportColumnsCalculator, ViewportRowsCalculator } from '../calculator'; /** * Which viewport box a calculator reads from the layout snapshot. `'render'` is scrollbar-unaware * (covers the strip a scrollbar sits over, so `getCell` on that row/column returns a real TD); * `'visible'` is scrollbar-aware (drives the fully/partially-visible counts and scroll-to-cell). */ export type ViewportBand = 'render' | 'visible'; /** * Calculator-creation queries, mixed into `Viewport`. */ export interface CalculatorFactory { createRowsCalculator(calculatorTypes?: string[], band?: ViewportBand): ViewportRowsCalculator; createColumnsCalculator(calculatorTypes?: string[], band?: ViewportBand): ViewportColumnsCalculator; createCalculators(fastDraw?: boolean, options?: { stationaryBands?: boolean; }): boolean; createVisibleCalculators(): void; usesLayoutSnapshotForCalculators(): boolean; allowsStationaryBands(): boolean; applyRenderedColumnsBandOverscan(renderedColumns: ColumnsCalculationType | null): void; applyRenderedRowsBandOverscan(renderedRows: RowsCalculationType | null): void; stabilizeRenderedRowsBand(renderedRows: RowsCalculationType | null): void; stabilizeRenderedColumnsBand(renderedColumns: ColumnsCalculationType | null): void; areAllProposedVisibleRowsAlreadyRendered(proposedFullyVisibleRowsCalculator: RowsCalculationType | undefined, proposedPartiallyVisibleRowsCalculator: RowsCalculationType | undefined): boolean; areAllProposedVisibleColumnsAlreadyRendered(proposedFullyVisibleColumnsCalculator: ColumnsCalculationType | undefined, proposedPartiallyVisibleColumnsCalculator: ColumnsCalculationType | undefined): boolean; } /** * Decides the directional overscan for a freshly computed render band: which side of the band to * extend (toward the scroll direction) and by how many tracks. Shared by the row and column overscan * appliers — the axis methods map their field names onto this axis-agnostic arithmetic, so the * direction rules stay single-sourced. * * Direction: the sign of the scroll-offset delta between this draw and the previous full draw. * A zero delta means the OTHER axis scrolled; an existing overscan side is then preserved (so the * band comes out identical), where "existing" is proven by a recorded side offset greater than 1 — * the 'auto' offset override adds at most 1 per side, and clamps to 0 at the dataset edges, so * offset inequality alone cannot be the test. A band that was never overscanned gets none. * * Exported for direct unit coverage; the production callers are the two band-overscan appliers * in this module. * * @param {number} scrollOffsetDelta The current band's scroll offset minus the previous band's. * @param {object} previous The previous band's recorded side offsets. * @param {number} previous.startOffset The previous band's start-side offset. * @param {number} previous.endOffset The previous band's end-side offset. * @param {object} fresh The freshly computed band's geometry. * @param {number} fresh.start The band's first track index. * @param {number} fresh.end The band's last track index. * @param {number} fresh.count The band's track count. * @param {number} total The axis total track count. * @param {number} max The axis overscan cap. * @returns {{ side: -1 | 1, extension: number } | null} The side to extend (`-1` = start, `1` = * end) and the clamped track count, or `null` when no overscan applies. */ export declare function directionalBandOverscan(scrollOffsetDelta: number, previous: { startOffset: number; endOffset: number; }, fresh: { start: number; end: number; count: number; }, total: number, max: number): { side: -1 | 1; extension: number; } | null; /** * The calculator-factory mixin. Implements `CalculatorFactory`. * * @type {CalculatorFactory} */ export declare const calculatorFactory: CalculatorFactory;