52 lines
1.6 KiB
TypeScript
52 lines
1.6 KiB
TypeScript
import type { ForwardRefExoticComponent, RefAttributes } from "react";
|
||
|
||
export interface SeamlessScrollProps {
|
||
/** 是否开启自动滚动,默认 true */
|
||
value?: boolean;
|
||
/** 原始数据列表 */
|
||
list: unknown[];
|
||
/** 步进速度,step 需是单步大小的约数,值越大滚动的越快,默认 1 */
|
||
step?: number;
|
||
/** 开启滚动的数据量,默认 3 */
|
||
limitScrollNum?: number;
|
||
/** 是否开启鼠标悬停,默认 true */
|
||
hover?: boolean;
|
||
/** 控制滚动方向,默认 up */
|
||
direction?: "up" | "down" | "left" | "right";
|
||
/** 单步运动停止的高度,默认 0 */
|
||
singleHeight?: number;
|
||
/** 单步运动停止的宽度,默认 0 */
|
||
singleWidth?: number;
|
||
/** 单步停止等待时间,默认 1000ms */
|
||
singleWaitTime?: number;
|
||
/** 是否开启 rem 度量,默认 false */
|
||
isRemUnit?: boolean;
|
||
/** 开启数据更新监听,默认 true */
|
||
isWatch?: boolean;
|
||
/** 动画时间,默认 0 */
|
||
delay?: number;
|
||
/** 动画方式,默认 ease-in */
|
||
ease?: string | { x1: number; y1: number; x2: number; y2: number };
|
||
/** 动画循环次数,-1 表示一直动画,默认 -1 */
|
||
count?: number;
|
||
/** 拷贝几份滚动列表,默认 1 */
|
||
copyNum?: number;
|
||
/** 开启鼠标悬停时支持滚轮滚动,默认 false */
|
||
wheel?: boolean;
|
||
/** 启用单行滚动,默认 false */
|
||
singleLine?: boolean;
|
||
/** 自定义类名 */
|
||
className?: string;
|
||
}
|
||
|
||
export interface SeamlessScrollRef {
|
||
reset: () => void;
|
||
}
|
||
|
||
/**
|
||
* 无缝滚动组件
|
||
*/
|
||
declare const SeamlessScroll: ForwardRefExoticComponent<SeamlessScrollProps & RefAttributes<SeamlessScrollRef>>;
|
||
|
||
export default SeamlessScroll;
|