Skip to content

Commit 6949b61

Browse files
committed
add typing
1 parent cf72516 commit 6949b61

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

generatedTypes/components/carousel/CarouselPresenter.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {PropsWithChildren} from 'react';
2-
import {CarouselProps, CarouselState} from './types';
1+
import { PropsWithChildren } from 'react';
2+
import { CarouselProps, CarouselState } from './types';
33
export declare function getChildrenLength(props: PropsWithChildren<CarouselProps>): number;
44
export declare function calcOffset(props: CarouselProps, state: Omit<CarouselState, 'initialOffset' | 'prevProps'>): {
55
x: number;

generatedTypes/components/carousel/index.d.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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, PageControlPosition};
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, PageControlPosition };
55
declare type DefaultProps = Partial<CarouselProps>;
66
/**
77
* @description: Carousel for scrolling pages horizontally
@@ -19,6 +19,7 @@ declare class Carousel extends Component<CarouselProps, CarouselState> {
1919
autoplayTimer?: ReturnType<typeof setTimeout>;
2020
orientationChange?: boolean;
2121
skippedInitialScroll?: boolean;
22+
isAutoScrolled: boolean;
2223
constructor(props: CarouselProps);
2324
static getDerivedStateFromProps(nextProps: CarouselProps, prevState: CarouselState): {
2425
pageWidth: number;
@@ -48,7 +49,7 @@ declare class Carousel extends Component<CarouselProps, CarouselState> {
4849
getSnapToOffsets: () => number[] | undefined;
4950
shouldUsePageWidth(): number | false | undefined;
5051
shouldEnablePagination(): boolean | undefined;
51-
onContainerLayout: ({nativeEvent: {layout: {width: containerWidth, height: containerHeight}}}: LayoutChangeEvent) => void;
52+
onContainerLayout: ({ nativeEvent: { layout: { width: containerWidth, height: containerHeight } } }: LayoutChangeEvent) => void;
5253
shouldAllowAccessibilityLayout(): boolean | undefined;
5354
onContentSizeChange: () => void;
5455
onMomentumScrollEnd: () => void;
@@ -63,7 +64,7 @@ declare class Carousel extends Component<CarouselProps, CarouselState> {
6364
renderCarousel(): JSX.Element;
6465
render(): JSX.Element;
6566
}
66-
export {Carousel};
67+
export { Carousel };
6768
declare const _default: React.ComponentClass<CarouselProps & {
6869
useCustomTheme?: boolean | undefined;
6970
}, any> & Carousel & {

generatedTypes/components/carousel/types.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import {ScrollViewProps, StyleProp, ViewStyle, NativeSyntheticEvent, NativeScrollEvent, PointPropType, Animated} from 'react-native';
2-
import {PageControlProps} from '../pageControl';
1+
import { ScrollViewProps, StyleProp, ViewStyle, NativeSyntheticEvent, NativeScrollEvent, PointPropType, Animated } from 'react-native';
2+
import { PageControlProps } from '../pageControl';
33
export declare enum PageControlPosition {
4-
OVER = 'over',
5-
UNDER = 'under'
4+
OVER = "over",
5+
UNDER = "under"
66
}
77
export interface CarouselProps extends ScrollViewProps {
88
/**
@@ -37,7 +37,7 @@ export interface CarouselProps extends ScrollViewProps {
3737
/**
3838
* callback for when page has changed
3939
*/
40-
onChangePage?: (newPageIndex: number, oldPageIndex: number) => void;
40+
onChangePage?: (newPageIndex: number, oldPageIndex: number, isAutoScrolled: boolean) => void;
4141
/**
4242
* callback for onScroll event of the internal ScrollView
4343
*/

0 commit comments

Comments
 (0)