@ckeditor/ckeditor5-ai
Version:
AI features for CKEditor 5.
71 lines (70 loc) • 1.97 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/aiminitoolbarview
*/
import { type Locale } from '@ckeditor/ckeditor5-utils';
import { ToolbarView, type ViewCollection } from '@ckeditor/ckeditor5-ui';
import '../../../../theme/aichat/aiminitoolbar.css';
/**
* Configuration interface for AIMiniToolbarView buttons.
*/
export interface AIMiniToolbarConfig {
/**
* Whether to show the copy button.
*/
showCopy?: boolean;
/**
* Configuration for the show changes button. If undefined, the button won't be shown.
*/
showChanges?: 'icon' | 'full';
/**
* Whether to show the like button.
*/
showLike?: boolean;
/**
* Whether to show the dislike button.
*/
showDislike?: boolean;
/**
* Custom views to add to the toolbar as the last items.
*/
customView?: ViewCollection;
}
/**
* A view for the mini toolbar in the AI suggestion preview.
*
* It hosts the copy, like and dislike buttons.
*/
export declare class AIMiniToolbarView extends ToolbarView {
/**
* Observable property that indicates whether the toolbar buttons are interactive.
*/
isEnabled: boolean;
/**
* Observable property that indicates whether the show changes button is on.
*/
isShowChangesOn: boolean;
/**
* @inheritDoc
*/
constructor(locale: Locale, config?: AIMiniToolbarConfig);
/**
* Toggles the enabled state of the show changes button.
*/
toggleShowChangesEnabled(isEnabled: boolean): void;
}
export type AIMiniToolbarLikeEvent = {
name: 'like';
args: [];
};
export type AIMiniToolbarDislikeEvent = {
name: 'dislike';
args: [];
};
export type AIMiniToolbarToggleShowChangesEvent = {
name: 'toggleShowChanges';
args: [];
};