@ckeditor/ckeditor5-ai
Version:
AI features for CKEditor 5.
47 lines (46 loc) • 1.73 kB
TypeScript
/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/
/**
* @module ai/aichat/ui/controls/aichatcontextitembuttonview
*/
import { ButtonView } from 'ckeditor5/src/ui.js';
import { type Locale } from 'ckeditor5/src/utils.js';
import type { AIContextItem } from '../../../aicore/model/aicontext.js';
/**
* A button view representing a context item in the AI chat interface.
*
* This component displays a context item (file, document, or URL) as a chip
* with an icon, label, and optional remove button depending on the readonly state.
*/
export declare class AIChatContextItemButtonView extends ButtonView {
id: string;
itemType: AIContextItem['type'];
label: string;
readonly: boolean;
/**
* Observable flag indicating if the context item is loading.
* @observable
*/
isLoading: boolean;
/**
* Creates an instance of the context item button view.
*
* @param locale The locale instance.
* @param contextItem The context item to display.
* @param readonly Whether the view is in readonly mode.
* @param isAnimationOnEnterEnabled Whether the enter animation is enabled.
* @param isLoading Whether the context item is loading.
*/
constructor(locale: Locale, contextItem: AIContextItem, readonly: boolean, isAnimationOnEnterEnabled: boolean, isLoading?: boolean);
/**
* @inheritDoc
*/
render(): void;
/**
* Disables the enter animation for this chip.
* This is useful when moving chips to overflow areas where animation is not desired.
*/
disableAnimationOnEnter(): void;
}