@ckeditor/ckeditor5-ai
Version:
AI features for CKEditor 5.
64 lines (63 loc) • 2.4 kB
TypeScript
/**
* @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/aicore/ui/suggestioncontainer/aisuggestioncontentpartview
*/
import { type Locale } from '@ckeditor/ckeditor5-utils';
import { View } from '@ckeditor/ckeditor5-ui';
import { type AISuggestionContentPartDefinition } from '../../utils/getsuggestionpartsfromreply.js';
import { type AIReplyChangeGroupState } from '../../model/aireply.js';
import { type AISuggestionActionName } from '../../../aichat/ui/feed/aichatfeedsuggestionitemactionsview.js';
/**
* A view that displays a single part in the suggestion content.
*/
export declare class AISuggestionBodyViewContentPartView extends View<HTMLDivElement> {
/**
* The definition of the content part this content part view represents.
*/
partDefinition: AISuggestionContentPartDefinition;
/**
* The state of the content part (pending, accepted, rejected, etc.). It contributes to the `isEnabled` flag.
*/
state: AIReplyChangeGroupState;
/**
* Controls whether the content part is enabled, which means that it can be interacted with. This flag is a composition
* of `isDone`, `state` and initial `areActionsDisabled` flags.
*/
isEnabled: boolean;
/**
* The part is active when its details are open in a dialog by the user.
*/
isActive: boolean;
/**
* A flag indicating that the content part is done streaming. It contributes to the `isEnabled` flag.
*/
isDone: boolean;
/**
* Controls the visibility of the content part.
*/
isVisible: boolean;
/**
* @inheritDoc
*/
constructor(locale: Locale, { part, uiIndex, areActionsDisabled, availableActions }: {
part: AISuggestionContentPartDefinition;
uiIndex: number;
areActionsDisabled: boolean;
availableActions: Array<AISuggestionActionName>;
});
/**
* Updates the content of the content part.
*/
updateContent({ part, showUnchangedParts, abortSignal }: {
part: AISuggestionContentPartDefinition;
showUnchangedParts?: boolean;
abortSignal?: AbortSignal;
}): Promise<void>;
/**
* Marks the content part as done which means that it finished streaming.
*/
markAsDone(): void;
}