bear-react-vertical-marquee
Version:
Most modern vertical marquee with hardware accelerated transitions for ReactJS
76 lines (75 loc) • 2.07 kB
TypeScript
import * as React from 'react';
import { IBearCarouselProps, IInfo } from './types';
interface IState {
}
declare class BearVerticalMarquee extends React.Component<IBearCarouselProps, IState> {
static defaultProps: {
data: any;
moveTime: number;
isEnableAutoPlay: boolean;
isGPURender: boolean;
isDebug: boolean;
autoPlayTime: number;
};
_verticalMarqueeId: string;
timer?: any;
activePage: number;
activeActualIndex: number;
info: IInfo;
rootRef: React.RefObject<HTMLDivElement>;
containerRef: React.RefObject<HTMLUListElement>;
slideItemRefs: React.RefObject<Array<HTMLDivElement>>;
pageRefs: React.RefObject<Array<HTMLDivElement>>;
constructor(props: IBearCarouselProps);
componentDidMount(): void;
componentWillUnmount(): void;
/***
* Optimized rendering
* @param nextProps
* @param nextState
*/
shouldComponentUpdate(nextProps: IBearCarouselProps, nextState: IState): boolean;
/**
* browser focus check auto play
* @private
*/
_onWindowFocus: () => void;
/**
* browser blur clean auto play timer
* @private
*/
_onWindowBlur: () => void;
/**
* Check and autoplay feature
*/
_checkAndAutoPlay: () => void;
/**
* get next page
*/
getNextPage: () => number;
/**
* Get virtual index
*/
checkActualIndexInRange: (slideIndex: number) => boolean;
/**
* go to next page
*/
toNext: () => void;
/**
* go to page
* ex: slideView: 2, slideGroup: 2, total: 4
* page1 -> (1-1) * 2) + 1 + (firstIndex -1) = 1
*/
goToPage: (page: number, isUseAnimation?: boolean) => void;
/**
* Get the target item distance width(px)
* @param slideIndex
*/
_getMoveDistance: (slideIndex: number) => number;
/**
* Go to the actual location
*/
goToActualIndex: (slideIndex: number, isUseAnimation?: boolean) => void;
render(): JSX.Element;
}
export default BearVerticalMarquee;