import type { Page } from "puppeteer"; export type AutoScrollOptions = { distancePx?: number; intervalMs?: number; maxIdleTicks?: number; maxSteps?: number; }; /** * Incrementally scrolls a page to the bottom until height stabilizes. * * Handles both traditional pages (window is the scroller) and SPA layouts * where the actual scrollable area is a nested container with * `overflow: auto | scroll` (e.g. Feishu, Notion, Google Docs). * * Detection logic: * 1. If `document.scrollingElement.scrollHeight > window.innerHeight`, * use `window.scrollBy` (classic path). * 2. Otherwise, find the DOM element with the largest scrollable overflow * (`scrollHeight - clientHeight`) and scroll that element instead. * * Usage: * await autoScrollToEnd(page); * await autoScrollToEnd(page, { intervalMs: 150, distancePx: 200 }); */ export declare const autoScrollToEnd: (page: Page, options?: AutoScrollOptions) => Promise;