/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import type { PlanBand } from "../model.js"; import type { RowKey } from "../plan-state.js"; /** How the narrow list drives a paged source (#812). */ export interface PlanNarrowPaging { /** The unloaded run after the resident rows, when there is one — and * which of its elements are loading (#1082). */ tail: PlanBand | undefined; /** * How many of the source's elements lie past the resident rows, not read — its blocks' unloaded runs after their * rows (#1398): beside the rows read and not shown yet, what the list's `N more rows` counts. `undefined` while the * source has not counted itself, or a new narrowing's rows are read. */ beyond: number | undefined; /** Where the list is — the last row card on screen. */ onViewport: (key: RowKey) => void; /** Demand the window after the resident run. */ onLoadMore: () => void; } /** * The list's side of paged demand (#812): one `IntersectionObserver` for the * whole list, which every row card and the load-more card enrol in through * the returned ref. Whenever what is on screen changes, the LAST row card * visible is reported as the viewport; the load-more card coming into view * demands the next window. (A report that names the window the driver is * already on changes no state, so scrolling within a window re-renders * nothing.) * * @param paging - The paged demand, or `undefined` on an inline canvas * @returns The ref an observed element takes — `undefined` when there is * nothing to demand, or no `IntersectionObserver` to demand it with */ export declare function useListDemand(paging: PlanNarrowPaging | undefined): ((el: HTMLElement | null) => (() => void) | undefined) | undefined; //# sourceMappingURL=demand.d.ts.map