/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */ /** * @module ai/aitabs/aitabsmainview * @publicApi */ import { type Locale } from "@ckeditor/ckeditor5-utils"; import { AITabsView, type AITabsViewOptions } from "./tabs/aitabsview.js"; /** * The supported types of the `AITabsView`. */ export declare const AI_TABS_VIEW_TYPES: readonly ["overlay", "sidebar", "custom"]; /** * The supported sides of the `AITabsView`. */ export declare const AI_TABS_VIEW_SIDES: readonly ["left", "right"]; /** * The view that hosts AI-powered features in the editor. * * @experimental **Experimental:** This is a production-ready API but may change in minor releases * without the standard deprecation policy. Check the changelog for migration guidance. */ export declare class AITabsMainView extends AITabsView { /** * The type of the view. */ type: AITabsMainViewOptions["type"]; /** * Whether the AI tabs view is visible. * * @observable */ isVisible: boolean; /** * @inheritDoc */ constructor(locale: Locale, options?: AITabsMainViewOptions); /** * Activates a tab by its ID. * * Note: Use {@link #getTabIds} to learn how to get the IDs of all tabs. * * Note: If `null` is passed, the current active tab will be deactivated and its panel will be hidden. * * The call may be vetoed by a listener (for example a feature warning about unresolved changes before * switching away), in which case this method is a no-op and returns `false`. Use * `forceActivateTab()` to switch tabs unconditionally, bypassing any such veto, or * `activateTabAwaitingConfirmation()` for callers that want to wait for the user's answer instead of * treating a veto as a hard failure. * * `AITabsView#activateTab()` mutates state and only notifies listeners *after* the fact (via its own * internal `activateTab:${id}` event), so it cannot be safely wrapped with `this.decorate()` — the * decorated proxy would be re-entered by that internal event under the same base event name. Overriding * the method to fire a distinctly-named event first, before delegating to `super.activateTab()`, gives * listeners a genuine pre-mutation veto point instead. * * @experimental **Experimental:** This is a production-ready API but may change in minor releases * without the standard deprecation policy. Check the changelog for migration guidance. * * @returns `true` if the tab was actually activated, `false` if a listener vetoed the switch. */ override activateTab(id: string | null): boolean; } /** * The options for the `AITabsView` class constructor. */ export type AITabsMainViewOptions = AITabsViewOptions & { /** * The type of the AI Tabs view. The possible values are: * * * `'overlay'` - the tabs are displayed as an overlay on top of the web page, * * `'sidebar'` - the tabs are displayed in a user-defined container, * * `'custom'` - the tabs are displayed as a custom UI, the integrator is responsible for the layout. */ type?: (typeof AI_TABS_VIEW_TYPES)[number]; /** * Whether the AI interface should be visible when created. */ visibleByDefault?: boolean; };