UNPKG

@ckeditor/ckeditor5-ai

Version:

AI features for CKEditor 5.

112 lines (111 loc) 3.02 kB
/** * @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/aichathistory/aichathistoryui */ import { type Context, type Editor, ContextPlugin } from 'ckeditor5/src/core.js'; import { AITabs } from '../aitabs/aitabs.js'; import '../../theme/aichat/aichathistory.css'; export declare const AI_CHAT_HISTORY_UI_EVENT_NAMES: readonly ["showConversationHistory", "removeConversation", "editConversationTitle", "setConversationPinned", "selectConversation", "openChat", "resizeTabs"]; export declare class AIChatHistoryUI extends ContextPlugin { /** * @inheritDoc */ static get requires(): readonly [typeof AITabs]; /** * @inheritDoc */ static get pluginName(): "AIChatHistoryUI"; /** * @inheritDoc */ static get isOfficialPlugin(): true; /** * @inheritDoc */ static get isPremiumPlugin(): true; /** * @inheritDoc */ constructor(context: Context | Editor); /** * Removes a conversation item from the history list. */ removeHistoryItem(id: string): void; /** * Updates the history items with categorized data. */ updateItems(categories: Array<AIChatHistoryCategoryData>): void; /** * Updates the title of a specific history item in the UI. */ updateItemTitle(itemId: string, title: string): void; /** * Updates the loading state of a specific history item in the UI. */ updateItemLoadingState(itemId: string, operation: string | null, isLoading: boolean): void; /** * Toggles the loading skeleton in the history view. */ setLoadingSkeleton(isLoading: boolean): void; /** * Shows an error message in the history view. */ showError(message: string): void; /** * Hides the error message in the history view. */ hideError(): void; setIsMaximized(isMaximized: boolean): void; } export type AIChatHistoryItemData = { id: string; title: string; createdAt: string; active: boolean; pinned?: boolean; }; export type AIChatHistoryCategoryData = { title: string; items: Array<AIChatHistoryItemData>; }; export type AIChatHistoryUIRemoveConversationEvent = { name: 'removeConversation'; args: [ { id: string; } ]; }; export type AIChatHistoryUIEditTitleEvent = { name: 'editConversationTitle'; args: [ { id: string; title: string; } ]; }; export type AIChatHistoryUISelectConversationEvent = { name: 'selectConversation'; args: [ { id: string; } ]; }; export type AIChatHistoryUISetPinnedEvent = { name: 'setConversationPinned'; args: [ { id: string; pinned: boolean; } ]; }; export type AIChatHistoryUIOpenChatEvent = { name: 'openChat'; args: []; };