/** * useDraggableScroll - 拖拽滚动 Hook * * 基于 Framer Motion 实现的水平拖拽滚动功能 * * @module useDraggableScroll * @date 2026-01-29 */ export interface UseDraggableScrollOptions { /** * 拖拽速度倍数 * @default 1 */ dragSpeed?: number; /** * 是否启用惯性滚动 * @default true */ enableMomentum?: boolean; /** * 边界弹性系数(0-1,0表示无弹性) * @default 0.1 */ dragElastic?: number; } export interface UseDraggableScrollReturn { /** * 容器 ref */ containerRef: React.RefObject; /** * 是否正在拖拽 */ isDragging: boolean; /** * 滚动进度(0-100) */ scrollProgress: number; /** * 是否可以向左滚动 */ canScrollLeft: boolean; /** * 是否可以向右滚动 */ canScrollRight: boolean; /** * 滚动到指定位置 */ scrollTo: (position: number, smooth?: boolean) => void; /** * 向左滚动 */ scrollLeft: (amount?: number) => void; /** * 向右滚动 */ scrollRight: (amount?: number) => void; } /** * 拖拽滚动 Hook * * @example * ```tsx * const { containerRef, isDragging, scrollProgress } = useDraggableScroll({ * dragSpeed: 1.5, * enableMomentum: true * }) * * return ( *
* {items.map(item => )} *
* ) * ``` */ export declare function useDraggableScroll(options?: UseDraggableScrollOptions): UseDraggableScrollReturn;