import { HoistModel, RefreshMode, RenderMode, Content, RefreshContextModel, Thunkable } from '@xh/hoist/core'; import { TabContainerConfig, TabContainerModel } from '@xh/hoist/cmp/tab'; import { ReactElement, ReactNode } from 'react'; /** * Configuration for a {@link TabModel} - a single tab within a {@link TabContainerModel}. * Passed as entries in the `tabs` array of a {@link TabContainerConfig}. * * @see TabModel * @see TabContainerConfig */ export interface TabConfig { /** Unique ID, used by container for locating tabs and generating routes. */ id: string; /** Display title for the Tab in the container's TabSwitcher. */ title?: ReactNode; /** Display icon for the Tab in the container's TabSwitcher. */ icon?: ReactElement; /** Tooltip for the Tab in the container's TabSwitcher. */ tooltip?: ReactNode; /** True to disable this tab in the TabSwitcher and block routing. */ disabled?: boolean; /** * True to hide this Tab in the TabSwitcher, but still be able to activate the tab manually * or via routing. */ excludeFromSwitcher?: boolean; /** Display an affordance to allow the user to remove this tab from its container.*/ showRemoveAction?: boolean; /** * Item to be rendered by this tab, or specification for a child tab container for this tab. */ content?: Content | TabConfig[] | TabContainerConfig; /** * Strategy for rendering this tab. If null, will default to its container's mode. See enum * for description of supported modes. */ renderMode?: RenderMode; /** * Strategy for refreshing this tab. If null, will default to its container's mode. See enum * for description of supported modes. */ refreshMode?: RefreshMode; /** True to skip this tab. */ omit?: Thunkable; /** @internal */ xhImpl?: boolean; } /** * Model for a Tab within a TabContainer. Specifies the actual content (child component) to be * rendered within a tab and manages that content's active and refresh state. * * This model is not typically created directly within applications. Instead, specify a * configuration for it via the `TabContainerModel.tabs` constructor config. */ export declare class TabModel extends HoistModel { id: string; title: ReactNode; icon: ReactElement; tooltip: ReactNode; disabled: boolean; excludeFromSwitcher: boolean; showRemoveAction: boolean; content: Content; containerModel: TabContainerModel; refreshContextModel: RefreshContextModel; /** Child TabContainerModel. For nested TabContainers only. */ childContainerModel: TabContainerModel; private _renderMode; private _refreshMode; get isTabModel(): boolean; constructor({ id, title, icon, tooltip, disabled, excludeFromSwitcher, showRemoveAction, content, refreshMode, renderMode, xhImpl }: TabConfig, containerModel: TabContainerModel); activate(): void; get renderMode(): RenderMode; get refreshMode(): RefreshMode; get isActive(): boolean; setDisabled(disabled: boolean): void; private parseContent; }