import React from 'react'; import { type IconDefinition } from '@fortawesome/fontawesome-svg-core'; import './NavTabList.scss'; import { type ContextAction } from '../context-actions'; export interface NavTabItem { /** * Unique key for the tab. */ key: string; /** * Title to display on the tab. */ title: string; /** * Icon to display on the tab. */ icon?: IconDefinition | JSX.Element; /** * Whether the tab is closable. * If omitted, the tab will be closeable if onClose exists. */ isClosable?: boolean; } type NavTabListProps = { /** * The key of the active tab. * If this does not match a tab key, no tab will be active. */ activeKey: string; /** * Array of tabs to display. * @see {@link NavTabItem} for the minimum required properties. */ tabs: T[]; /** * Function called when a tab is selected. * * @param key The key of the tab to select */ onSelect: (key: string) => void; /** * Function called when a tab is closed. * If the function is provided, all tabs will be closeable by default. * Tabs may set their own closeable property to override this behavior. * * @param key The key of the tab to close */ onClose?: (key: string) => void; /** * Function called when a tab is reordered. * If the function is omitted, the tab list will not be reorderable. * * @param sourceIndex Index in the tab list the drag started from * @param destinationIndex Index in the tab list the drag ended at */ onReorder?: (sourceIndex: number, destinationIndex: number) => void; /** * Context actions to add to the tab in addition to the default actions. * The default actions are Close, Close to the Right, and Close All. * The default actions have a group value of 20. * * @param tab The tab to make context items for * @returns Additional context items for the tab */ makeContextActions?: (tab: T) => ContextAction | ContextAction[]; /** * Optional render function to render content after each tab's title. * Should be wrapped in useCallback to avoid unnecessary re-renders. * * @param tab The tab to render content for * @returns The content to render after the tab title */ renderAfterTabContent?: (tab: T) => React.ReactNode; }; declare function NavTabList({ activeKey, tabs, onSelect, onReorder, onClose, makeContextActions, renderAfterTabContent, }: NavTabListProps): React.ReactElement; export default NavTabList; //# sourceMappingURL=NavTabList.d.ts.map