/** * Tracks whether newly mounted rows should render placeholder cells: the table * is scrolled vertically fast and rendering its rows does not keep up with it. * @internal */ export interface FastScrollTracker { /** * Updates the tracked speed with the current scroll offset. Has to run * before the rows render, as rows read the state when they mount. * @param renderedContent - Values that decide how expensive rendering a row * is, e.g. the rows and the visible columns. When one of them changes, the * measured render durations no longer apply and are forgotten. */ update: (scrollOffset: number, renderedContent: readonly unknown[]) => void; /** * Has to run once the render that called `update` is committed, e.g. in a * layout effect. Measures how long the render took, as rows only need * placeholders if rendering them does not fit into the render budget. */ commit: () => void; /** * Whether rows that mount now should render placeholder cells: the table is * scrolling fast and recent fast scroll renders exceeded the budget. */ shouldRenderPlaceholders: () => boolean; /** * Calls the listener once the current fast scroll is over, or right away * (asynchronously) if there is none. Returns a function that cancels it. */ onceFastScrollEnded: (listener: () => void) => () => void; /** * Has to run when the table unmounts. Ends the current fast scroll without * calling its listeners, so no timer outlives the table. */ dispose: () => void; } /** * Creates a {@link FastScrollTracker}. * @internal */ export declare function createFastScrollTracker(): FastScrollTracker; //# sourceMappingURL=fast-scroll-tracker.d.ts.map