import { PropsWithChildren, ComponentType, ReactNode } from 'react'; export interface IVerticalDivide { divide: true; } export interface IFixedProps { canFixed?: boolean; fixedIds?: Id[]; onFixedChange?: (ids: Id[]) => void; } export interface ITab { key: Id; title: React.ReactNode; disabled?: boolean; className?: string; canFixed?: boolean; candel?: boolean; } export type IVerticalTab = ITab | IVerticalDivide; export interface IInnerTab extends ITab, IFixedProps { actived: boolean; unmountOnHide?: boolean; panelChildren?: React.ReactNode; candel?: boolean; } export type IVerticalInnerTab = IInnerTab | IVerticalDivide; export type TabType = 'normal' | 'card' | 'button'; export type ITabOverflowMode = 'slide' | 'anchor'; export interface ITabPanelProps { id: Id; tab: React.ReactNode; className?: string; disabled?: boolean; actived?: boolean; unmountOnHide?: boolean; canFixed?: boolean; candel?: boolean; } export type IVerticalTabPanelProps = ITabPanelProps | IVerticalDivide; export type ITabPanelElement = React.ReactElement< PropsWithChildren >; export interface IBaseTabsProps { onChange: (id: Id) => void; activeId: Id; className?: string; tabs?: Array>; unmountPanelOnHide?: boolean; disableLazyMount?: boolean; children?: | ITabPanelElement | Array>; } export interface ITabsProps extends IBaseTabsProps>, IFixedProps { onDelete: (id: Id) => void; onAdd: () => void; candel: boolean; stretch: boolean; navExtraContent: React.ReactNode; type?: TabType; overflowMode?: ITabOverflowMode; renderTabBar?: ( props: ITabsNavProps, TabBar: ComponentType> ) => ReactNode; } export interface IVerticalTabsProps extends IBaseTabsProps> { scrollHeight?: React.CSSProperties['maxHeight']; } export interface IBaseTabsNavProps { onChange: (id: Id) => void; tabDataList: InnerTab[]; } export interface ITabsNavProps extends IBaseTabsNavProps>, IFixedProps { onDelete: (id: Id) => void; candel: boolean; stretch: boolean; navExtraContent: React.ReactNode; type: TabType; overflowMode: ITabOverflowMode; onAdd?: () => void; activeId: Id; className?: string; style?: React.CSSProperties; } export interface ITabNavState { fixed: boolean; } export interface IVerticalTabsNavProps extends IBaseTabsNavProps> { scrollHeight?: React.CSSProperties['maxHeight']; } export interface ITabProps extends IFixedProps { id: Id; onSelected: (id: Id) => void; onDelete?: (id: Id) => void; actived?: boolean; disabled?: boolean; candel?: boolean; }