import * as React from 'react'; import { ScrollView, ScrollViewProps, StyleProp, TextStyle, ViewStyle, } from 'react-native'; import type { IconNameType } from '../../assets'; export type TabPageHeaderRef = { toLeft: (movedCount: number) => void; toRight: (movedCount: number) => void; }; export type TabPageHeaderProps = { propRef: React.RefObject; onClicked?: (index: number) => void; titles: { title?: string; icon?: IconNameType | number; }[]; width?: number; indicatorStyle?: StyleProp; /** * Style of the container. This property can mainly change the display or hiding, position, size, background color, style, etc. */ containerStyle?: StyleProp; content?: { style?: StyleProp; /** * Style of the container. This property can mainly change the display or hiding, position, size, background color, style, etc. */ containerStyle?: StyleProp; }; initIndex?: number; }; export type TabPageBodyItemProps = ScrollViewProps; export function TabPageBodyItem(props: TabPageBodyItemProps) { const { style, children, ...others } = props; return ( {children} ); } export type TabPageBodyRef = { scrollTo: (index: number, animated?: boolean) => void; }; export type TabPageBodyProps = Omit< ScrollViewProps, | 'pagingEnabled' | 'showsHorizontalScrollIndicator' | 'bounces' | 'horizontal' | 'children' > & { propsRef: React.RefObject; children: React.ReactNode[]; height?: number; width?: number; /** * Style of the container. This property can mainly change the display or hiding, position, size, background color, style, etc. */ containerStyle?: StyleProp; initIndex?: number; onCurrentIndex?: (currentIndex: number) => void; }; export type BodyChildrenProps = Props & { /** * Provided internally, users only need to use it. */ index: number; /** * Provided internally, users only need to use it. */ currentIndex: number; }; export type TabPageBodyTRef = TabPageBodyRef; export type TabPageBodyTProps = Omit< ScrollViewProps, | 'pagingEnabled' | 'showsHorizontalScrollIndicator' | 'bounces' | 'horizontal' | 'children' > & { propsRef: React.RefObject; childrenCount: number; RenderChildren: React.ComponentType>; RenderChildrenProps: BodyChildrenProps; height?: number; width?: number; /** * Style of the container. This property can mainly change the display or hiding, position, size, background color, style, etc. */ containerStyle?: StyleProp; initIndex?: number; onCurrentIndex?: (currentIndex: number) => void; scrollEnabled?: boolean; }; export type TabPageBodyLISTRef = TabPageBodyRef; export type TabPageBodyLISTProps = Omit< ScrollViewProps, | 'pagingEnabled' | 'showsHorizontalScrollIndicator' | 'bounces' | 'horizontal' | 'children' > & { propsRef: React.RefObject; childrenCount: number; RenderChildren: React.ComponentType>[]; RenderChildrenProps: BodyChildrenProps; height?: number; width?: number; /** * Style of the container. This property can mainly change the display or hiding, position, size, background color, style, etc. */ containerStyle?: StyleProp; initIndex?: number; onCurrentIndex?: (currentIndex: number) => void; enableCurrentIndex?: boolean; scrollEnabled?: boolean; }; export type TabPageBodyLISTContentProps = { RenderChildren: React.ComponentType>[]; RenderChildrenProps: BodyChildrenProps; width?: number; currentIndex?: number; };