|
| 1 | +import React, { Component, RefObject, ReactNode, Key } from 'react'; |
| 2 | +import { ScrollView, LayoutChangeEvent, NativeSyntheticEvent, NativeScrollEvent } from 'react-native'; |
| 3 | +import { CarouselProps, CarouselState, PageControlPosition } from './types'; |
| 4 | +export { CarouselProps }; |
| 5 | +interface DefaultProps extends Partial<CarouselProps> { |
| 6 | +} |
| 7 | +/** |
| 8 | + * @description: Carousel for scrolling pages horizontally |
| 9 | + * @gif: https://media.giphy.com/media/l0HU7f8gjpRlMRhKw/giphy.gif, https://media.giphy.com/media/3oFzmcjX9OhpyckhcQ/giphy.gif |
| 10 | + * @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/CarouselScreen.js |
| 11 | + * @extends: ScrollView |
| 12 | + * @extendsLink: https://facebook.github.io/react-native/docs/scrollview |
| 13 | + * @notes: This is screed width Component |
| 14 | + */ |
| 15 | +declare class Carousel extends Component<CarouselProps, CarouselState> { |
| 16 | + static displayName: string; |
| 17 | + static defaultProps: DefaultProps; |
| 18 | + static pageControlPositions: typeof PageControlPosition; |
| 19 | + carousel: RefObject<ScrollView>; |
| 20 | + autoplayTimer?: number; |
| 21 | + orientationChange?: boolean; |
| 22 | + skippedInitialScroll?: boolean; |
| 23 | + constructor(props: CarouselProps); |
| 24 | + static getDerivedStateFromProps(nextProps: CarouselProps, prevState: CarouselState): { |
| 25 | + pageWidth: number; |
| 26 | + initialOffset: { |
| 27 | + x: number; |
| 28 | + }; |
| 29 | + prevProps: CarouselProps; |
| 30 | + } | { |
| 31 | + prevProps: CarouselProps; |
| 32 | + pageWidth?: undefined; |
| 33 | + initialOffset?: undefined; |
| 34 | + } | null; |
| 35 | + componentDidMount(): void; |
| 36 | + componentWillUnmount(): void; |
| 37 | + componentDidUpdate(prevProps: CarouselProps): void; |
| 38 | + onOrientationChanged: () => void; |
| 39 | + getItemSpacings(props: CarouselProps): number; |
| 40 | + getContainerMarginHorizontal: () => number; |
| 41 | + getContainerPaddingVertical: () => number; |
| 42 | + updateOffset: (animated?: boolean) => void; |
| 43 | + startAutoPlay(): void; |
| 44 | + stopAutoPlay(): void; |
| 45 | + resetAutoPlay(): void; |
| 46 | + goToPage(pageIndex: number, animated?: boolean): void; |
| 47 | + getCalcIndex(index: number): number; |
| 48 | + getSnapToOffsets: () => number[] | undefined; |
| 49 | + shouldUsePageWidth(): number | false | undefined; |
| 50 | + shouldEnablePagination(): boolean | undefined; |
| 51 | + onContainerLayout: ({ nativeEvent: { layout: { width: containerWidth } } }: LayoutChangeEvent) => void; |
| 52 | + shouldAllowAccessibilityLayout(): boolean | undefined; |
| 53 | + onContentSizeChange: () => void; |
| 54 | + onMomentumScrollEnd: () => void; |
| 55 | + goToNextPage(): void; |
| 56 | + onScroll: (event: NativeSyntheticEvent<NativeScrollEvent>) => void; |
| 57 | + renderChild: (child: ReactNode, key: Key) => JSX.Element | undefined; |
| 58 | + renderChildren(): JSX.Element[] | null | undefined; |
| 59 | + renderPageControl(): JSX.Element | undefined; |
| 60 | + renderCounter(): JSX.Element | undefined; |
| 61 | + renderAccessibleLayout(): JSX.Element; |
| 62 | + renderCarousel(): JSX.Element; |
| 63 | + render(): JSX.Element; |
| 64 | +} |
| 65 | +export { Carousel }; |
| 66 | +declare const _default: React.ComponentClass<CarouselProps & { |
| 67 | + useCustomTheme?: boolean | undefined; |
| 68 | +}, any> & typeof Carousel; |
| 69 | +export default _default; |
0 commit comments