UNPKG

@ckeditor/ckeditor5-ai

Version:

AI features for CKEditor 5.

97 lines (96 loc) 2.78 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/aireviewmode/aireviewmode * @publicApi */ import { ContextPlugin } from 'ckeditor5/src/core.js'; import { AIReviewModeController } from './aireviewmodecontroller.js'; import { AIReviewModeUI } from './aireviewmodeui.js'; import { AIReviewModeEditing } from './aireviewmodeediting.js'; /** * The AI Review Mode feature. * * The Review feature provides users with AI-powered quality assurance for their content by automatically running checks * for grammar, style, tone, and more. * * You can configure the feature by setting the {@link module:ai/aireviewmode/aireviewmode~AIReviewModeConfig} property. * * Learn more about AI features in CKEditor in the {@glink features/ai/ckeditor-ai-overview AI Overview} documentation. */ export declare class AIReviewMode extends ContextPlugin { /** * @inheritDoc */ static get requires(): readonly [typeof AIReviewModeController, typeof AIReviewModeUI, typeof AIReviewModeEditing]; /** * @inheritDoc */ static get pluginName(): "AIReviewMode"; /** * @inheritDoc */ static get isOfficialPlugin(): true; /** * @inheritDoc */ static get isPremiumPlugin(): true; } /** * The configuration of the {@link module:ai/aireviewmode/aireviewmode~AIReviewMode AI Review Mode feature}. * * The properties defined in this config are set in the `config.ai.reviewMode` namespace. * * ```ts * ClassicEditor * .create( editorElement, { * ai: { * reviewMode: { * // AI Review Mode configuration. * } * } * } ) * .then( ... ) * .catch( ... ); * ``` * * See {@link module:ai/aiconfig~AIConfig the full AI configuration}. * * See {@link module:core/editor/editorconfig~EditorConfig all editor options}. */ export interface AIReviewModeConfig { /** * The integrator can provide a custom list of translations for the "Translate" check in the AI Review Mode feature. * * The list must be an array of objects containing the `id` and `label` properties like on example below: * * ```ts * ClassicEditor * .create( editorElement, { * ai: { * reviewMode: { * translations: [ * { * id: 'german', * label: 'German' * }, * { * id: 'french', * label: 'French' * } * ] * } * } * } ) * .then( ... ) * .catch( ... ); * ``` */ translations?: Array<AIReviewModeTranslation>; } export interface AIReviewModeTranslation { id: string; label: string; }