1 |
|
2 | import { Models } from './Models';
|
3 | export interface TabBarPropsType {
|
4 |
|
5 | goToTab: (index: number) => void;
|
6 |
|
7 | tabs: Models.TabData[];
|
8 |
|
9 | activeTab: number;
|
10 |
|
11 | animated: boolean;
|
12 |
|
13 | renderTab?: (tab: Models.TabData) => React.ReactNode;
|
14 |
|
15 | renderUnderline?: (style: React.CSSProperties | any) => React.ReactNode;
|
16 |
|
17 | page?: number;
|
18 |
|
19 | onTabClick?: (tab: Models.TabData, index: number) => void;
|
20 |
|
21 | tabBarPosition?: 'top' | 'bottom' | 'left' | 'right';
|
22 |
|
23 | tabBarUnderlineStyle?: React.CSSProperties | any;
|
24 |
|
25 | tabBarBackgroundColor?: string;
|
26 |
|
27 | tabBarActiveTextColor?: string;
|
28 |
|
29 | tabBarInactiveTextColor?: string;
|
30 |
|
31 | tabBarTextStyle?: React.CSSProperties | any;
|
32 | instanceId: number;
|
33 | }
|
34 | export interface PropsType {
|
35 |
|
36 | tabs: Models.TabData[];
|
37 |
|
38 | tabBarPosition?: 'top' | 'bottom' | 'left' | 'right';
|
39 |
|
40 | renderTabBar?: ((props: TabBarPropsType) => React.ReactNode) | false;
|
41 | /** initial Tab, index or key */
|
42 | initialPage?: number | string;
|
43 | /** current tab, index or key */
|
44 | page?: number | string;
|
45 | /** whether to switch tabs with swipe gestrue in the content | default: true */
|
46 | swipeable?: boolean;
|
47 | /** use scroll follow pan | default: true */
|
48 | useOnPan?: boolean;
|
49 | /** pre-render nearby # sibling, Infinity: render all the siblings, 0: render current page | default: 1 */
|
50 | prerenderingSiblingsNumber?: number;
|
51 | /** whether to change tabs with animation | default: true */
|
52 | animated?: boolean;
|
53 | /** callback when tab is switched */
|
54 | onChange?: (tab: Models.TabData, index: number) => void;
|
55 |
|
56 | onTabClick?: (tab: Models.TabData, index: number) => void;
|
57 |
|
58 | destroyInactiveTab?: boolean;
|
59 |
|
60 | distanceToChangeTab?: number;
|
61 |
|
62 | usePaged?: boolean;
|
63 |
|
64 | tabDirection?: 'horizontal' | 'vertical';
|
65 |
|
66 | tabBarUnderlineStyle?: React.CSSProperties | any;
|
67 |
|
68 | tabBarBackgroundColor?: string;
|
69 |
|
70 | tabBarActiveTextColor?: string;
|
71 |
|
72 | tabBarInactiveTextColor?: string;
|
73 |
|
74 | tabBarTextStyle?: React.CSSProperties | any;
|
75 |
|
76 | noRenderContent?: boolean;
|
77 |
|
78 | useLeftInsteadTransform?: boolean;
|
79 | }
|