import type { CoreEngine } from '../../../app/engine.js'; import { type Controller } from '../../controller/headless-controller.js'; export interface TabOptions { /** * A constant query expression or filter that the Tab should add to any outgoing query. * * **Example:** * * `@objecttype==Message` */ expression: string; /** * Whether to clear the state when the active tab changes. */ clearFiltersOnTabChange?: boolean; /** * A unique identifier for the tab. The value will be used as the originLevel2 when the tab is active. */ id: string; } export interface TabInitialState { /** * Specifies if the tab is currently selected. * Note that there can be only one active tab for a given headless engine. */ isActive: boolean; } export interface TabProps { /** * The options for the `Tab` controller. */ options: TabOptions; /** * The initial state that should be applied to this `Tab` controller. */ initialState?: TabInitialState; } /** * The `Tab` headless controller offers a high-level interface for designing a common tab UI controller. * * Example: [tab.fn.tsx](https://github.com/coveo/ui-kit/blob/main/samples/headless/search-react/src/components/tab/tab.fn.tsx) * * @group Controllers * @category Tab */ export interface Tab extends Controller { /** * Activates the tab. */ select(): void; /** * The state of the `Tab` controller. */ state: TabState; } /** * A scoped and simplified part of the headless state that is relevant to the `Tab` controller. * * @group Controllers * @category Tab */ export interface TabState { /** * Indicates whether the current tab is selected. * */ isActive: boolean; } /** * Creates a `Tab` controller instance. * * @param engine - The headless engine. * @param props - The configurable `Tab` properties. * @returns A `Tab` controller instance. */ export declare function buildCoreTab(engine: CoreEngine, props: TabProps): Tab;