@ckeditor/ckeditor5-ai
Version:
AI features for CKEditor 5.
63 lines (62 loc) • 1.72 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/aicore/ui/aiminitoolbarview
*/
import { type Locale } from 'ckeditor5/src/utils.js';
import { ToolbarView, type ViewCollection } from 'ckeditor5/src/ui.js';
/**
* 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 is in loading state.
* When true, all buttons should be disabled.
*/
isLoading: boolean;
/**
* @inheritDoc
*/
constructor(locale: Locale, config: AIMiniToolbarConfig | undefined, showDiff: boolean);
}
export type AIMiniToolbarLikeEvent = {
name: 'like';
args: [];
};
export type AIMiniToolbarDislikeEvent = {
name: 'dislike';
args: [];
};
export type AIMiniToolbarToggleShowChangesEvent = {
name: 'toggleShowChanges';
args: [isOn: boolean];
};