1 |
|
2 | import type { Descriptor, NavigationHelpers, NavigationProp, ParamListBase, RouteProp, TabActionHelpers, TabNavigationState } from '@react-navigation/native';
|
3 | import type BottomNavigation from '../components/BottomNavigation/BottomNavigation';
|
4 | export type MaterialBottomTabNavigationEventMap = {
|
5 | |
6 |
|
7 |
|
8 | tabPress: {
|
9 | data: undefined;
|
10 | canPreventDefault: true;
|
11 | };
|
12 | |
13 |
|
14 |
|
15 | tabLongPress: {};
|
16 | };
|
17 | export type MaterialBottomTabNavigationHelpers = NavigationHelpers<ParamListBase, MaterialBottomTabNavigationEventMap> & TabActionHelpers<ParamListBase>;
|
18 | export type MaterialBottomTabNavigationProp<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = NavigationProp<ParamList, RouteName, NavigatorID, TabNavigationState<ParamList>, MaterialBottomTabNavigationOptions, MaterialBottomTabNavigationEventMap> & TabActionHelpers<ParamList>;
|
19 | export type MaterialBottomTabScreenProps<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = {
|
20 | navigation: MaterialBottomTabNavigationProp<ParamList, RouteName, NavigatorID>;
|
21 | route: RouteProp<ParamList, RouteName>;
|
22 | };
|
23 | export type MaterialBottomTabNavigationOptions = {
|
24 | |
25 |
|
26 |
|
27 | title?: string;
|
28 | |
29 |
|
30 |
|
31 |
|
32 | tabBarColor?: string;
|
33 | |
34 |
|
35 |
|
36 | tabBarLabel?: string;
|
37 | |
38 |
|
39 |
|
40 |
|
41 | tabBarIcon?: string | ((props: {
|
42 | focused: boolean;
|
43 | color: string;
|
44 | }) => React.ReactNode);
|
45 | |
46 |
|
47 |
|
48 | tabBarBadge?: boolean | number | string;
|
49 | |
50 |
|
51 |
|
52 | tabBarAccessibilityLabel?: string;
|
53 | |
54 |
|
55 |
|
56 | tabBarButtonTestID?: string;
|
57 | };
|
58 | export type MaterialBottomTabDescriptor = Descriptor<MaterialBottomTabNavigationOptions, MaterialBottomTabNavigationProp<ParamListBase>, RouteProp<ParamListBase>>;
|
59 | export type MaterialBottomTabDescriptorMap = Record<string, MaterialBottomTabDescriptor>;
|
60 | export type MaterialBottomTabNavigationConfig = Partial<Omit<React.ComponentProps<typeof BottomNavigation>, 'navigationState' | 'onIndexChange' | 'onTabPress' | 'onTabLongPress' | 'renderScene' | 'renderLabel' | 'renderIcon' | 'getAccessibilityLabel' | 'getBadge' | 'getColor' | 'getLabelText' | 'getTestID' | 'getLazy'>>;
|
61 |
|
\ | No newline at end of file |