UNPKG

scroll-seamless

Version:

A seamless scroll library for JS, Vue, and React.

61 lines (59 loc) 1.73 kB
type ScrollDirection = 'up' | 'down' | 'left' | 'right'; type ScrollSeamlessEvent = | 'start' | 'stop' | 'destroy' | 'update' | 'reach-end' | 'reach-start'; interface PerformancePluginOptions { enabled?: boolean; fps?: boolean; memory?: boolean; timing?: boolean; onUpdate?: (metrics: any) => void; } interface AccessibilityPluginOptions { enabled?: boolean; ariaLabel?: string; keyboardNavigation?: boolean; screenReader?: boolean; focusable?: boolean; } interface ScrollSeamlessPlugin { id: string; apply: (instance: ScrollSeamlessController) => void; destroy?: () => void; } interface ScrollSeamlessOptions { data: string[]; direction?: ScrollDirection; minCountToScroll?: number; step?: number; stepWait?: number; delay?: number; bezier?: [number, number, number, number]; hoverStop?: boolean; wheelEnable?: boolean; singleLine?: boolean; rows?: number; cols?: number; onEvent?: (event: ScrollSeamlessEvent, data?: any) => void; plugins?: ScrollSeamlessPlugin[]; performance?: PerformancePluginOptions; accessibility?: AccessibilityPluginOptions; } interface ScrollSeamlessController { start: () => void; stop: () => void; destroy: () => void; updateData: () => void; setOptions: (options: Partial<ScrollSeamlessOptions>) => void; isRunning: () => boolean; getPosition?: () => number; setPosition?: (position: number) => void; addPlugin?: (plugin: ScrollSeamlessPlugin) => void; removePlugin?: (pluginId: string) => void; getPerformance?: () => any; } export type { AccessibilityPluginOptions, PerformancePluginOptions, ScrollDirection, ScrollSeamlessController, ScrollSeamlessEvent, ScrollSeamlessOptions, ScrollSeamlessPlugin };