react-flickity-component
Version:
react flickity component
38 lines (37 loc) • 1.61 kB
TypeScript
import { default as React, Component, ReactNode } from 'react';
import { default as Flickity } from 'flickity';
export type FlickityEventName = 'ready' | 'change' | 'select' | 'settle' | 'scroll' | 'dragStart' | 'dragMove' | 'dragEnd' | 'pointerDown' | 'pointerMove' | 'pointerUp' | 'staticClick' | 'lazyLoad' | 'bgLazyLoad' | 'fullscreenChange';
export interface ReactFlickityComponentProps {
className?: string;
disableImagesLoaded?: boolean;
elementType?: string;
flickityRef?: (ref: Flickity) => void;
options?: Flickity.Options;
reloadOnUpdate?: boolean;
static?: boolean;
children?: ReactNode;
}
interface FlickityComponentState {
flickityReady: boolean;
flickityCreated: boolean;
cellCount: number;
}
declare class FlickityComponent extends Component<ReactFlickityComponentProps, FlickityComponentState> {
static defaultProps: Partial<ReactFlickityComponentProps>;
private carousel;
private flkty;
constructor(props: ReactFlickityComponentProps);
static getDerivedStateFromProps(props: ReactFlickityComponentProps, state: FlickityComponentState): {
flickityReady: boolean;
cellCount: number;
} | null;
componentDidUpdate(prevProps: ReactFlickityComponentProps, prevState: FlickityComponentState): void;
componentDidMount(): Promise<void>;
setReady(): void;
renderPortal(): React.ReactPortal | null | undefined;
render(): React.ReactElement<{
className: string;
ref: (c: HTMLElement | null) => void;
}, string | React.JSXElementConstructor<any>>;
}
export default FlickityComponent;