forked from satya164/react-native-tab-view
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TabViewTypeDefinitions.js
63 lines (50 loc) · 1.29 KB
/
TabViewTypeDefinitions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* @flow */
import type { StyleObj } from 'react-native/Libraries/StyleSheet/StyleSheetTypes';
import { Animated } from 'react-native';
export type Route<T: { key: string, testID?: string }> = T;
export type NavigationState<T: { key: string }> = {
index: number,
routes: Array<T>,
};
export type Scene<T> = {
route: T,
focused: boolean,
index: number,
};
export type Layout = {
height: number,
width: number,
};
export type SceneRendererProps<T> = {
layout: Layout & {
measured: boolean,
},
navigationState: NavigationState<T>,
position: Animated.Value,
jumpToIndex: (index: number) => void,
getLastPosition: () => number,
subscribe: (
event: SubscriptionName,
callback: Function
) => { remove: Function },
};
export type SubscriptionName = 'reset' | 'position';
export type TransitionProps = {
progress: number,
};
export type TransitionSpec = {
timing: Function,
};
export type TransitionConfigurator = (
currentTransitionProps: TransitionProps,
nextTransitionProps: TransitionProps
) => TransitionSpec;
export type PagerProps = {
configureTransition?: TransitionConfigurator,
animationEnabled?: boolean,
swipeEnabled?: boolean,
swipeDistanceThreshold?: number,
swipeVelocityThreshold?: number,
children?: *,
};
export type Style = StyleObj;