import { CSSProperties, ReactElement, ReactNode, SetStateAction, Dispatch } from 'react'; import { ColorPropsValue, DivProps, Id, Obj, Size } from '../../types'; import { Tab, TabProps } from './tab'; import { DragDropEvents } from '@dnd-kit/abstract'; export type TabType = TabProps & Obj; type TabsSharedProps = { variant?: 'line' | 'card'; color?: ColorPropsValue; /** 是否渲染关闭按钮,默认为`false` */ closable?: boolean; onClose?(key: Id): void; /** 是否允许拖拽排序,默认为`false` */ sortable?: boolean; }; export interface TabsProps extends TabsSharedProps, Omit { tabs?: T[]; labelKey?: keyof T; primaryKey?: keyof T; size?: Size; /** 选项卡的位置,默认为`top` */ position?: 'top' | 'bottom' | 'left' | 'right'; justifyContent?: CSSProperties['justifyContent']; fullWidth?: boolean; prefix?: ReactNode; suffix?: ReactNode; defaultValue?: Id; value?: Id; onChange?(value: Id): void; readOnly?: boolean; disabled?: boolean; /** * @param e * @param tabs 仅{@link tabs}模式支持,使用children时,该参数为`undefined` */ onSort?(e: Parameters['dragend']>[0], tabs?: T[]): void; /** 触发change事件的事件,默认为`click` */ changeEvent?: 'click' | 'pointerDown'; } interface ITabsContext extends TabsSharedProps { animating: boolean; setAnimating: Dispatch>; } export declare function useTabsContext(): ITabsContext; export declare const Tabs: { (props: TabsProps): ReactElement; Tab: typeof Tab; }; export {};