Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ViewPagerProps extends ScrollViewProperties and add horizontalScroll as Props #145

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 75 additions & 61 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,69 +1,83 @@
declare module 'rn-viewpager' {
declare module "rn-viewpager" {
import * as React from "react";
import {
ImageURISource,
ViewProperties,
NativeScrollEvent,
NativeSyntheticEvent,
ViewPagerAndroidOnPageScrollEventData,
ScrollViewProperties
} from "react-native";

import * as React from 'react';
import { ImageURISource, ViewProperties, NativeScrollEvent, NativeSyntheticEvent, ViewPagerAndroidOnPageScrollEventData } from 'react-native';

interface ViewPagerProps extends ViewProperties {
initialPage?: number;
keyboardDismissMode?: 'none' | 'on-drag';
onPageScroll?(e: ViewPagerAndroidOnPageScrollEventData): void;
onPageScrollStateChanged?(state: 'idle' | 'settling' | 'dragging'): void;
onPageSelected?(e: ViewPagerAndroidOnPageScrollEventData): void;
scrollEnabled?: boolean;
}

export class ViewPager extends React.Component<ViewPagerProps> {
setPage(selectedPage: number): void;
setPageWithoutAnimation(selectedPage: number): void;
}

interface IndicatorViewPagerProps extends ViewProperties {
indicator: React.ReactNode;
pagerStyle?: ViewProperties['style'];
autoPlayEnable?: boolean;
autoPlayInterval?: boolean;
horizontalScroll?: boolean;
interface ViewPagerProps extends ScrollViewProperties {
initialPage?: number;
keyboardDismissMode?: "none" | "on-drag";
onPageScroll?(e: ViewPagerAndroidOnPageScrollEventData): void;
onPageScrollStateChanged?(state: "idle" | "settling" | "dragging"): void;
onPageSelected?(e: ViewPagerAndroidOnPageScrollEventData): void;
scrollEnabled?: boolean;
horizontalScroll?: boolean;
}

}
export class IndicatorViewPager extends React.Component<IndicatorViewPagerProps> {
setPage(selectedPage: number): void;
setPageWithoutAnimation(selectedPage: number): void;
}
export class ViewPager extends React.Component<ViewPagerProps> {
setPage(selectedPage: number): void;
setPageWithoutAnimation(selectedPage: number): void;
}

interface PagerDotIndicatorProps extends ViewProperties {
pageCount: number;
dotStyle?: ViewProperties['style'];
selectedDotStyle?: ViewProperties['style'];
hideSingle?: boolean;
}
interface IndicatorViewPagerProps extends ViewProperties {
indicator: React.ReactNode;
pagerStyle?: ViewProperties["style"];
autoPlayEnable?: boolean;
autoPlayInterval?: boolean;
horizontalScroll?: boolean;
}
export class IndicatorViewPager extends React.Component<
IndicatorViewPagerProps
> {
setPage(selectedPage: number): void;
setPageWithoutAnimation(selectedPage: number): void;
}

export class PagerDotIndicator extends React.Component<PagerDotIndicatorProps> {}
interface PagerDotIndicatorProps extends ViewProperties {
pageCount: number;
dotStyle?: ViewProperties["style"];
selectedDotStyle?: ViewProperties["style"];
hideSingle?: boolean;
}

interface PageTitleIndicatorProps extends ViewProperties {
titles: string[];
trackScroll?: boolean;
itemStyle?: ViewProperties['style'];
itemTextStyle?: ViewProperties['style'];
selectedItemTextStyle?: ViewProperties['style'];
selectedBorderStyle?: ViewProperties['style'];
renderTitle(index: number, title: string, isSelected: boolean): JSX.Element;
}
export class PagerTitleIndicator extends React.Component<PageTitleIndicatorProps> {}
export class PagerDotIndicator extends React.Component<
PagerDotIndicatorProps
> {}

interface PagerTabIndicatorProps extends ViewProperties {
tabs: Array<{
text: string,
iconSource: ImageURISource,
selectedIconSource: ImageURISource
}>;
itemStyle?: ViewProperties['style'];
selectedItemStyle?: ViewProperties['style'];
iconStyle?: ViewProperties['style'];
selectedIconStyle?: ViewProperties['style'];
textStyle?: ViewProperties['style'];
selectedTextStyle?: ViewProperties['style'];
changePageWithAnimation?: boolean;
}
interface PageTitleIndicatorProps extends ViewProperties {
titles: string[];
trackScroll?: boolean;
itemStyle?: ViewProperties["style"];
itemTextStyle?: ViewProperties["style"];
selectedItemTextStyle?: ViewProperties["style"];
selectedBorderStyle?: ViewProperties["style"];
renderTitle(index: number, title: string, isSelected: boolean): JSX.Element;
}
export class PagerTitleIndicator extends React.Component<
PageTitleIndicatorProps
> {}

export class PagerTabIndicator extends React.PureComponent<PagerTabIndicatorProps> {}
interface PagerTabIndicatorProps extends ViewProperties {
tabs: Array<{
text: string;
iconSource: ImageURISource;
selectedIconSource: ImageURISource;
}>;
itemStyle?: ViewProperties["style"];
selectedItemStyle?: ViewProperties["style"];
iconStyle?: ViewProperties["style"];
selectedIconStyle?: ViewProperties["style"];
textStyle?: ViewProperties["style"];
selectedTextStyle?: ViewProperties["style"];
changePageWithAnimation?: boolean;
}

export class PagerTabIndicator extends React.PureComponent<
PagerTabIndicatorProps
> {}
}