UNPKG

@ckeditor/ckeditor5-ai

Version:

AI features for CKEditor 5.

92 lines (91 loc) 3.2 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/aireviewmodeui */ import { type Context, type Editor, ContextPlugin } from 'ckeditor5/src/core.js'; import { AITabs } from '../aitabs/aitabs.js'; import { type AIReviewCheck } from './model/aireviewcheck.js'; import { type AIReviewCheckRunUpdatedEvent } from './model/aireviewcheckrun.js'; import { type AIReviewCheckResultChange } from './model/aireviewcheckresultchange.js'; import '../../theme/aireviewmode/aireviewmode.css'; export declare const AI_REVIEW_MODE_UI_EVENT_NAMES: readonly ["getReviewCheckList", "runReviewCheck", "abortReviewStream", "toggleDiff", "acceptAllChanges", "leaveReviewModeResultList", "activateChange", "acceptChange", "dismissChange", "learnMore", "finishReview", "retryReview"]; export declare class AIReviewModeUI extends ContextPlugin { /** * @inheritDoc */ static get requires(): readonly [typeof AITabs]; /** * @inheritDoc */ static get pluginName(): "AIReviewModeUI"; /** * @inheritDoc */ static get isOfficialPlugin(): true; /** * @inheritDoc */ static get isPremiumPlugin(): true; /** * @inheritDoc */ constructor(context: Context | Editor); /** * @inheritDoc */ init(): void; /** * @inheritDoc */ destroy(): void; /** * Sets the available checks in the AI Review Mode list view. */ setAvailableChecks(checks: Array<AIReviewCheck>): void; showReviewCheckList(): void; /** * Shows the result of a review check run. */ showCheckRunResults(data: AIReviewCheckRunUpdatedEvent['args'][0]): void; showCheckRunResult(result: { contentDiffed: string; id: string; }): void; showGeneralResultsErrorView(): void; showGeneralReviewModeErrorView(errorMessage?: string): void; showChunkErrorView(): void; setCheckResultTitle(title: string, subtitle?: string): void; setActiveStateInResults(id: string): void; resetActiveStateInResults(): void; updateChangeState(id: string, status: AIReviewCheckResultChange['status']): void; showReviewCompletedView(): void; showActionsWhenResultIsReady(): void; showNoChangesView(): void; hideActionsWhenResultIsReady(): void; showChangeBalloon(change: AIReviewCheckResultChange, target: HTMLElement, domEvent: MouseEvent | undefined, eventType: 'click' | 'hover', limiter?: HTMLElement, viewportOffset?: { top?: number; left?: number; bottom?: number; right?: number; }): void; hideChangeBalloon(): void; hideDiffInBalloon(): void; showDiffInBalloon(): void; getChangeElement(changeId: string): HTMLElement | null; deactivateChange(): void; } export type AIReviewModeUIGetReviewCheckListEvent = { name: 'getReviewCheckList'; args: []; }; export type AIReviewModeUILeaveReviewModeEvent = { name: 'leaveReviewMode'; args: []; }; export type AIReviewModeUIRetryReviewEvent = { name: 'retryReview'; args: []; };