import type { ReactElement, ReactNode } from 'react'; import React from 'react'; import type { StyleProp, ViewProps, ViewStyle } from 'react-native'; import { Animated } from 'react-native'; import type { IconName } from '../Icon'; import type { BadgeConfigType } from './TabWithBadge'; export type ItemType = string | IconName | ((props: { color: string; }) => ReactNode); export type TabType = { key: string; activeItem: ItemType; inactiveItem?: ItemType; component: ReactNode; testID?: string; badge?: BadgeConfigType; }; export interface TabsHeaderProps { tabs: TabType[]; selectedTabKey: string; onTabPress: (key: string) => void; barStyle?: StyleProp; insets: { top: number; right: number; bottom: number; left: number; }; componentTestID?: string; tabsWidth: number; setTabsWidth: (width: number) => void; positionAnimatedValue: Animated.Value; scrollOffsetAnimatedValue: Animated.Value; } export interface TabsProps extends ViewProps { /** * Callback which is called on tab press, receiving key of upcoming active Tab. */ onTabPress: (key: string) => void; /** * Current selected tab key. */ selectedTabKey: string; /** * List of Tabs to be rendered. Each Tab must have an unique key. */ tabs: TabType[]; /** * Style for the container of Tab. */ containerStyle?: StyleProp; /** * Style for the tab navigation bar. */ barStyle?: StyleProp; /** * Whether inactive screen should be removed and unmounted in * Defaults value is `false`. */ lazy?: boolean; /** * Only work when lazy is `true`. You can specify how many adjacent screens should be preloaded. * Defaults value is `1`. */ lazyPreloadDistance?: number; /** * Boolean indicating whether to enable swipe gestures. Passing `false` will disable swipe gestures, but the user can still switch tabs by pressing the tab bar. * Defaults value is `true`. */ swipeEnabled?: boolean; /** * Testing id of the component. */ testID?: string; /** * Custom header component. */ header?: (props: TabsHeaderProps) => ReactElement; } declare const _default: (({ onTabPress, selectedTabKey, tabs, containerStyle, barStyle, lazy, lazyPreloadDistance, swipeEnabled, testID: componentTestID, header, }: TabsProps) => ReactElement) & { Header: ({ tabs, selectedTabKey, onTabPress, barStyle, insets, componentTestID, tabsWidth, setTabsWidth, positionAnimatedValue, scrollOffsetAnimatedValue, }: TabsHeaderProps) => React.JSX.Element; Scroll: ({ onTabPress, selectedTabKey, tabs, containerStyle, barStyle, lazy, lazyPreloadDistance, swipeEnabled, testID: componentTestID, variant, header, }: import("./ScrollableTabs").ScrollableTabProps) => React.JSX.Element; ScrollHeader: ({ onTabPress, selectedIndex, tabs, barStyle, testID, insets, variant, }: import("./ScrollableTabsHeader/ScrollableTabsHeader").ScrollableTabHeaderProps) => React.JSX.Element; useIsFocused: () => boolean | undefined; }; export default _default;