/** An element, or a way of finding one that only mounts on a later render. */ export type ScrollTarget = HTMLElement | null | (() => HTMLElement | null); export interface RevealOptions { /** Which edge to bring into view. Defaults to `"end"`, the bottom. */ block?: "start" | "end" | "center"; /** * Extra room to leave at the bottom, for something overlapping it that the * target cannot know about, such as a sticky footer. */ bottomInset?: number; } /** * Scrolling something into view once it has laid out. * * ```ts * collapse.open(); * Scroll.reveal(() => panelRef.current, { bottomInset: footerHeight }); * ``` * * Every method waits for layout, leaves the page alone when the target is * already fully visible, and honours `prefers-reduced-motion`. Only the latest * request survives: a burst of calls settles on one scroll rather than fighting * over the page. */ export declare class Scroll { private static pending; private constructor(); /** Brings the target into view, by default its bottom edge. */ static reveal(target: ScrollTarget, opts?: RevealOptions): void; /** Brings the top of the target to the top of whatever scrolls it. */ static toTop(target: ScrollTarget): void; /** Scrolls the page to the bottom, e.g. to bring a sticky action into view. */ static toPageBottom(): void; private static run; } /** `"auto"` when the user asked for less motion, `"smooth"` otherwise. */ export declare function scrollBehavior(): ScrollBehavior;