UNPKG

2.04 kBTypeScriptView Raw
1import type { Animated, StyleProp, TextStyle, ViewStyle } from 'react-native';
2import type { PagerViewProps } from 'react-native-pager-view';
3export type TabDescriptor<T extends Route> = {
4 accessibilityLabel?: string;
5 accessible?: boolean;
6 testID?: string;
7 labelText?: string;
8 labelAllowFontScaling?: boolean;
9 href?: string;
10 label?: (props: {
11 route: T;
12 labelText?: string;
13 focused: boolean;
14 color: string;
15 allowFontScaling?: boolean;
16 style?: StyleProp<TextStyle>;
17 }) => React.ReactNode;
18 labelStyle?: StyleProp<TextStyle>;
19 icon?: (props: {
20 route: T;
21 focused: boolean;
22 color: string;
23 size: number;
24 }) => React.ReactNode;
25 badge?: (props: {
26 route: T;
27 }) => React.ReactElement;
28 sceneStyle?: StyleProp<ViewStyle>;
29};
30export type LocaleDirection = 'ltr' | 'rtl';
31export type Route = {
32 key: string;
33 icon?: string;
34 title?: string;
35 accessible?: boolean;
36 accessibilityLabel?: string;
37 testID?: string;
38};
39export type Event = {
40 defaultPrevented: boolean;
41 preventDefault(): void;
42};
43export type Scene<T extends Route> = {
44 route: T;
45};
46export type NavigationState<T extends Route> = {
47 index: number;
48 routes: T[];
49};
50export type Layout = {
51 width: number;
52 height: number;
53};
54export type Listener = (value: number) => void;
55export type SceneRendererProps = {
56 layout: Layout;
57 position: Animated.AnimatedInterpolation<number>;
58 jumpTo: (key: string) => void;
59};
60export type EventEmitterProps = {
61 addEnterListener: (listener: Listener) => () => void;
62};
63export type PagerProps = Omit<PagerViewProps, 'initialPage' | 'scrollEnabled' | 'onPageScroll' | 'onPageSelected' | 'onPageScrollStateChanged' | 'keyboardDismissMode' | 'children'> & {
64 keyboardDismissMode?: 'none' | 'on-drag' | 'auto';
65 swipeEnabled?: boolean;
66 animationEnabled?: boolean;
67 onSwipeStart?: () => void;
68 onSwipeEnd?: () => void;
69};
70//# sourceMappingURL=types.d.ts.map
\No newline at end of file