import type { ReactiveController, ReactiveControllerHost } from 'lit'; /** * Options for AutoScrollController. */ export interface AutoScrollControllerOptions { /** Pixel threshold from bottom to consider "at bottom". Default 50. */ threshold?: number; /** Called when scroll state transitions between at-bottom and away-from-bottom. */ onScrollStateChange?: (isAtBottom: boolean) => void; } /** * AutoScrollController — automatically scrolls a container to the bottom * when observed elements resize (streaming text, images loading), unless * the user has scrolled up. * * Uses ResizeObserver on **individual elements** (set via `observeElements()`) * to detect content growth. The host component is responsible for calling * `scrollToBottom()` when new child elements appear (e.g. on `slotchange`). * * Used in: loquix-message-list */ export declare class AutoScrollController implements ReactiveController { private host; private _scrollContainer; private _isUserScrolled; private _isProgrammaticScroll; private _resizeObserver; private _observedElements; private _rafId; private _scrollGuardTimer; private _options; constructor(host: ReactiveControllerHost & HTMLElement, options?: AutoScrollControllerOptions); private get _threshold(); hostConnected(): void; hostDisconnected(): void; /** * Attach to a scrollable container element. * Call this in updated() or after shadow DOM is ready. */ attach(container: HTMLElement): void; detach(): void; /** Check if the user is near the bottom */ get isAtBottom(): boolean; /** Whether the user has scrolled away from bottom */ get isUserScrolled(): boolean; /** * Observe elements for size changes (e.g. slotted message items). * When an observed element resizes (streaming text, images loading), * auto-scroll is triggered if the user hasn't scrolled away. * * Call this whenever the set of slotted elements changes (slotchange). */ observeElements(elements: Element[]): void; /** Programmatically scroll to bottom */ scrollToBottom(behavior?: ScrollBehavior): void; /** * Scroll a specific element into view (centered in the scroll container). * Uses getBoundingClientRect + scrollTo to avoid cross-shadow-DOM scrolling issues. */ scrollToElement(element: HTMLElement, behavior?: ScrollBehavior): void; private _scrollToBottomInternal; /** * Set a guard flag that suppresses user-scroll detection during programmatic scrolls. * `instant` completes immediately; `smooth` animates over ~300ms. */ private _setProgrammaticGuard; private _onScroll; } //# sourceMappingURL=autoscroll.controller.d.ts.map