@ckeditor/ckeditor5-ai
Version:
AI features for CKEditor 5.
81 lines (80 loc) • 2.19 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/feed/aichatfeedsuggestionitemactionsview
*/
import { type Locale } from 'ckeditor5/src/utils.js';
import { View } from 'ckeditor5/src/ui.js';
export declare const AI_REPLY_ACTIONS: readonly ["applySuggestion", "insertSuggestion", "showChangeInText"];
/**
* A view for the actions of an AI suggestion item in the AI chat feed.
*
* It hosts a dropdown with actions that can be applied to the suggestion.
*/
export declare class AIChatFeedSuggestionItemActionsView extends View {
/**
* Specifies whether the view should be interactive or not.
*/
isEnabled: boolean;
/**
* Specifies whether the view should be visible or not.
*/
isVisible: boolean;
/**
* @observable
*/
isTrackChangesOn: boolean;
/**
* @inheritDoc
*/
constructor(locale: Locale, availableActions?: Array<AISuggestionActionName>);
/**
* Updates the labels of the actions based on the number of parts in the suggestion.
*/
updateLabels(partsCount?: number): void;
}
export type AIShowChangeInTextEvent = {
name: 'showChangeInText';
args: [{
replyId: string;
partIndex?: number;
}];
};
export type AIInsertSuggestionEvent = {
name: 'insertSuggestion';
args: [{
replyId: string;
partIndex?: number;
}];
};
export type AIApplySuggestionEvent = {
name: 'applySuggestion';
args: [{
replyId: string;
partIndex?: number;
}];
};
export type AIRejectSuggestionEvent = {
name: 'rejectSuggestion';
args: [{
replyId: string;
partIndex: number;
}];
};
export type AIMouseOverSuggestionEvent = {
name: 'mouseOverSuggestion';
args: [{
replyId: string;
partIndex: number;
}];
};
export type AIMouseLeaveSuggestionEvent = {
name: 'mouseLeaveSuggestion';
args: [{
replyId: string;
partIndex: number;
}];
};
export type AISuggestionActionName = typeof AI_REPLY_ACTIONS[number];