1 | import type { HeaderOptions } from '@react-navigation/elements';
|
2 | import type { Descriptor, NavigationHelpers, NavigationProp, ParamListBase, RouteProp, TabActionHelpers, TabNavigationState } from '@react-navigation/native';
|
3 | import type * as React from 'react';
|
4 | import type { Animated, GestureResponderEvent, StyleProp, TextStyle, TouchableWithoutFeedbackProps, ViewStyle } from 'react-native';
|
5 | import type { EdgeInsets } from 'react-native-safe-area-context';
|
6 | export declare type Layout = {
|
7 | width: number;
|
8 | height: number;
|
9 | };
|
10 | export declare type BottomTabNavigationEventMap = {
|
11 | |
12 |
|
13 |
|
14 | tabPress: {
|
15 | data: undefined;
|
16 | canPreventDefault: true;
|
17 | };
|
18 | |
19 |
|
20 |
|
21 | tabLongPress: {
|
22 | data: undefined;
|
23 | };
|
24 | };
|
25 | export declare type LabelPosition = 'beside-icon' | 'below-icon';
|
26 | export declare type BottomTabNavigationHelpers = NavigationHelpers<ParamListBase, BottomTabNavigationEventMap> & TabActionHelpers<ParamListBase>;
|
27 | export declare type BottomTabNavigationProp<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = NavigationProp<ParamList, RouteName, NavigatorID, TabNavigationState<ParamList>, BottomTabNavigationOptions, BottomTabNavigationEventMap> & TabActionHelpers<ParamList>;
|
28 | export declare type BottomTabScreenProps<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = {
|
29 | navigation: BottomTabNavigationProp<ParamList, RouteName, NavigatorID>;
|
30 | route: RouteProp<ParamList, RouteName>;
|
31 | };
|
32 | export declare type TimingKeyboardAnimationConfig = {
|
33 | animation: 'timing';
|
34 | config?: Omit<Partial<Animated.TimingAnimationConfig>, 'toValue' | 'useNativeDriver'>;
|
35 | };
|
36 | export declare type SpringKeyboardAnimationConfig = {
|
37 | animation: 'spring';
|
38 | config?: Omit<Partial<Animated.SpringAnimationConfig>, 'toValue' | 'useNativeDriver'>;
|
39 | };
|
40 | export declare type TabBarVisibilityAnimationConfig = TimingKeyboardAnimationConfig | SpringKeyboardAnimationConfig;
|
41 | export declare type BottomTabNavigationOptions = HeaderOptions & {
|
42 | |
43 |
|
44 |
|
45 | title?: string;
|
46 | |
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 | tabBarLabel?: string | ((props: {
|
53 | focused: boolean;
|
54 | color: string;
|
55 | position: LabelPosition;
|
56 | }) => React.ReactNode);
|
57 | |
58 |
|
59 |
|
60 | tabBarShowLabel?: boolean;
|
61 | |
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 | tabBarLabelPosition?: LabelPosition;
|
70 | |
71 |
|
72 |
|
73 | tabBarLabelStyle?: StyleProp<TextStyle>;
|
74 | |
75 |
|
76 |
|
77 | tabBarAllowFontScaling?: boolean;
|
78 | |
79 |
|
80 |
|
81 | tabBarIcon?: (props: {
|
82 | focused: boolean;
|
83 | color: string;
|
84 | size: number;
|
85 | }) => React.ReactNode;
|
86 | |
87 |
|
88 |
|
89 | tabBarIconStyle?: StyleProp<TextStyle>;
|
90 | |
91 |
|
92 |
|
93 | tabBarBadge?: number | string;
|
94 | |
95 |
|
96 |
|
97 |
|
98 | tabBarBadgeStyle?: StyleProp<TextStyle>;
|
99 | |
100 |
|
101 |
|
102 |
|
103 | tabBarAccessibilityLabel?: string;
|
104 | |
105 |
|
106 |
|
107 | tabBarTestID?: string;
|
108 | |
109 |
|
110 |
|
111 |
|
112 | tabBarButton?: (props: BottomTabBarButtonProps) => React.ReactNode;
|
113 | |
114 |
|
115 |
|
116 | tabBarActiveTintColor?: string;
|
117 | |
118 |
|
119 |
|
120 | tabBarInactiveTintColor?: string;
|
121 | |
122 |
|
123 |
|
124 | tabBarActiveBackgroundColor?: string;
|
125 | |
126 |
|
127 |
|
128 | tabBarInactiveBackgroundColor?: string;
|
129 | |
130 |
|
131 |
|
132 | tabBarItemStyle?: StyleProp<ViewStyle>;
|
133 | |
134 |
|
135 |
|
136 | tabBarHideOnKeyboard?: boolean;
|
137 | |
138 |
|
139 |
|
140 | tabBarVisibilityAnimationConfig?: {
|
141 | show?: TabBarVisibilityAnimationConfig;
|
142 | hide?: TabBarVisibilityAnimationConfig;
|
143 | };
|
144 | |
145 |
|
146 |
|
147 | tabBarStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
|
148 | |
149 |
|
150 |
|
151 |
|
152 |
|
153 |
|
154 |
|
155 | tabBarBackground?: () => React.ReactNode;
|
156 | |
157 |
|
158 |
|
159 |
|
160 | lazy?: boolean;
|
161 | |
162 |
|
163 |
|
164 | header?: (props: BottomTabHeaderProps) => React.ReactNode;
|
165 | |
166 |
|
167 |
|
168 |
|
169 | headerShown?: boolean;
|
170 | |
171 |
|
172 |
|
173 |
|
174 | unmountOnBlur?: boolean;
|
175 | };
|
176 | export declare type BottomTabDescriptor = Descriptor<BottomTabNavigationOptions, BottomTabNavigationProp<ParamListBase>, RouteProp<ParamListBase>>;
|
177 | export declare type BottomTabDescriptorMap = Record<string, BottomTabDescriptor>;
|
178 | export declare type BottomTabNavigationConfig = {
|
179 | |
180 |
|
181 |
|
182 | tabBar?: (props: BottomTabBarProps) => React.ReactNode;
|
183 | |
184 |
|
185 |
|
186 |
|
187 | safeAreaInsets?: {
|
188 | top?: number;
|
189 | right?: number;
|
190 | bottom?: number;
|
191 | left?: number;
|
192 | };
|
193 | |
194 |
|
195 |
|
196 |
|
197 |
|
198 | detachInactiveScreens?: boolean;
|
199 | |
200 |
|
201 |
|
202 | sceneContainerStyle?: StyleProp<ViewStyle>;
|
203 | };
|
204 | export declare type BottomTabHeaderProps = {
|
205 | |
206 |
|
207 |
|
208 | layout: Layout;
|
209 | |
210 |
|
211 |
|
212 | options: BottomTabNavigationOptions;
|
213 | |
214 |
|
215 |
|
216 | route: RouteProp<ParamListBase>;
|
217 | |
218 |
|
219 |
|
220 | navigation: BottomTabNavigationProp<ParamListBase>;
|
221 | };
|
222 | export declare type BottomTabBarProps = {
|
223 | state: TabNavigationState<ParamListBase>;
|
224 | descriptors: BottomTabDescriptorMap;
|
225 | navigation: NavigationHelpers<ParamListBase, BottomTabNavigationEventMap>;
|
226 | insets: EdgeInsets;
|
227 | };
|
228 | export declare type BottomTabBarButtonProps = Omit<TouchableWithoutFeedbackProps, 'onPress'> & {
|
229 | to?: string;
|
230 | children: React.ReactNode;
|
231 | onPress?: (e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent) => void;
|
232 | };
|