UNPKG

3.25 kBTypeScriptView Raw
1/// <reference types="react" />
2import type { Descriptor, NavigationHelpers, NavigationProp, ParamListBase, RouteProp, TabActionHelpers, TabNavigationState } from '@react-navigation/native';
3import type BottomNavigation from '../components/BottomNavigation/BottomNavigation';
4export type MaterialBottomTabNavigationEventMap = {
5 /**
6 * Event which fires on tapping on the tab in the tab bar.
7 */
8 tabPress: {
9 data: undefined;
10 canPreventDefault: true;
11 };
12 /**
13 * Event which fires on long pressing on the tab in the tab bar.
14 */
15 tabLongPress: {};
16};
17export type MaterialBottomTabNavigationHelpers = NavigationHelpers<ParamListBase, MaterialBottomTabNavigationEventMap> & TabActionHelpers<ParamListBase>;
18export 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>;
19export 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};
23export type MaterialBottomTabNavigationOptions = {
24 /**
25 * Title text for the screen.
26 */
27 title?: string;
28 /**
29 * @deprecated In v5.x works only with theme version 2.
30 * Color of the tab bar when this tab is active. Only used when `shifting` is `true`.
31 */
32 tabBarColor?: string;
33 /**
34 * Label text of the tab displayed in the navigation bar. When undefined, scene title is used.
35 */
36 tabBarLabel?: string;
37 /**
38 * String referring to an icon in the `MaterialCommunityIcons` set, or a
39 * function that given { focused: boolean, color: string } returns a React.Node to display in the navigation bar.
40 */
41 tabBarIcon?: string | ((props: {
42 focused: boolean;
43 color: string;
44 }) => React.ReactNode);
45 /**
46 * Badge to show on the tab icon, can be `true` to show a dot, `string` or `number` to show text.
47 */
48 tabBarBadge?: boolean | number | string;
49 /**
50 * Accessibility label for the tab button. This is read by the screen reader when the user taps the tab.
51 */
52 tabBarAccessibilityLabel?: string;
53 /**
54 * ID to locate this tab button in tests.
55 */
56 tabBarButtonTestID?: string;
57};
58export type MaterialBottomTabDescriptor = Descriptor<MaterialBottomTabNavigationOptions, MaterialBottomTabNavigationProp<ParamListBase>, RouteProp<ParamListBase>>;
59export type MaterialBottomTabDescriptorMap = Record<string, MaterialBottomTabDescriptor>;
60export type MaterialBottomTabNavigationConfig = Partial<Omit<React.ComponentProps<typeof BottomNavigation>, 'navigationState' | 'onIndexChange' | 'onTabPress' | 'onTabLongPress' | 'renderScene' | 'renderLabel' | 'renderIcon' | 'getAccessibilityLabel' | 'getBadge' | 'getColor' | 'getLabelText' | 'getTestID' | 'getLazy'>>;
61//# sourceMappingURL=types.d.ts.map
\No newline at end of file