import { FC, HTMLAttributes, PropsWithChildren, Ref } from 'react'; import { SnapScrollerApiRef } from './types'; export interface SnapScrollerProps extends HTMLAttributes { /** * Ref to the scroller’s element. */ ref?: Ref; /** * Ref to the scroller’s imperative API. * Provides `element`, `prev()` and `next()` methods for programmatic control. */ apiRef?: Ref; /** * Initial index of the item to snap to on mount. */ defaultIndex?: number; /** * Fired when a scroll snap operation has fully completed * and the scroller has settled on a new snap index. * * This callback is invoked after all scrolling and snapping * animations have finished and the active snap position * is considered stable. * * @param element - The root scroller element. * @param index - The resolved snap index after snapping completes. */ onScrollSnapChange?(element: HTMLElement, index: number): void; /** * Fired while a scroll snap operation is in progress and * the active snap index is still changing. * * This callback may be invoked multiple times during a * single scroll or swipe interaction as the scroller * approaches its final snap position. * * Useful for optimistic UI updates, previews, or * synchronizing transient state during scrolling. * * @param element - The root scroller element. * @param index - The current candidate snap index. */ onScrollSnapChanging?(element: HTMLElement, index: number): void; } /** * SnapScroller is a scroll container optimized for CSS Scroll Snap. * It detects the currently snapped child, exposes imperative navigation, * and supports infinite scrolling by notifying when the viewport reaches edges. * * Children must be direct scroller items and carry `data-index` so the * snapped page can be derived. */ export declare const SnapScroller: FC>;