/** * @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/aireviewcore/aireviewcoreui */ import { type Context, type Editor, ContextPlugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core"; import { type AIReviewCheck } from "./model/aireviewcheck.js"; import { type AIReviewCheckRunUpdatedEvent } from "./model/aireviewcheckrun.js"; import { type AIReviewCheckResultChange } from "./model/aireviewcheckresultchange.js"; import { AITabs } from "../aitabs/aitabs.js"; import { type AIReviewCoreView } from "./ui/aireviewcoreview.js"; import { type AIReviewCoreNavigationPanelShowOptions, type AIReviewCoreNavigationPosition } from "./ui/aireviewcorenavigationpanelview.js"; /** * Options describing the copy and identifier of a leave-confirmation dialog shown by * {@link module:ai/aireviewcore/aireviewcoreui~AIReviewCoreUI#showLeaveConfirmationDialog}. */ export interface AILeaveConfirmationOptions { dialogId: string; title: string; content: string; stayButton: string; exitButton: string; } export declare const AI_REVIEW_MODE_UI_EVENT_NAMES: readonly ["getReviewCheckList", "runReviewCheck", "abortReviewStream", "acceptAllChanges", "rejectAllChanges", "leaveReviewCoreResultList", "activateChange", "deactivateChange", "acceptChange", "dismissChange", "suggestChange", "learnMore", "finishReview", "retryReview"]; export declare abstract class AIReviewCoreUI extends ContextPlugin { /** * @inheritDoc */ static get requires(): PluginDependenciesOf<[AITabs]>; /** * @inheritDoc */ static override get isOfficialPlugin(): true; /** * @inheritDoc */ static override get isPremiumPlugin(): true; /** * @inheritDoc */ constructor(context: Context | Editor); /** * @inheritDoc */ init(): void; /** * Sets the available checks in the AI Review Core list view. */ setAvailableChecks(checks: ReadonlyArray): void; toggleLoadingSkeleton(isLoading: boolean): void; showReviewCheckList(): void; /** * Shows the result of a review check run. */ showCheckRunResults(data: AIReviewCheckRunUpdatedEvent["args"][0]): void; showCheckRunResult(result: AIReviewCheckResultChange): void; showGeneralResultsErrorView(): void; showGeneralReviewCoreErrorView(errorMessage?: string): void; showChunkErrorView(): void; showUnsupportedInlineChangeView(): void; setCheckResultTitle(title: string, subtitle?: string): void; setHasPendingChanges(hasPendingChanges: boolean): void; setActiveStateInResults(id: string): void; resetActiveStateInResults(): void; updateChangeState(id: string, status: AIReviewCheckResultChange["status"]): void; /** * Updates the review progress bar with the number of reviewed (accepted, rejected, outdated) changes out of the total. */ updateProgress(reviewed: number, total: number): void; /** * Updates the summary of the user's decisions, shown once every change is decided (AI Review only). */ updateSummary(accepted: number, dismissed: number): void; showReviewCompletedView(): void; showActionsWhenResultIsReady(): void; showNoChangesView(): void; hideActionsWhenResultIsReady(): void; /** * Points the navigation panel at `change` and pins it to the change's element in the content. */ showNavigationPanel(options: Omit): void; hideNavigationPanel(): void; /** * Whether the navigation panel is visible within the viewport. */ isNavigationPanelInViewport(): boolean; /** * Updates the navigation panel counter without moving the panel. */ updateNavigationPanelPosition(position: AIReviewCoreNavigationPosition): void; /** * The change the navigation panel is displaying. */ getNavigationPanelChangeId(): string; /** * Scrolls the results list so the change is at its top. */ scrollResultsToChange(changeId: string): void; /** * Scrolls the results list back to its very top. */ scrollResultsToTop(): void; /** * Shows the leave-confirmation dialog. Calls `onExit` if the user confirms leaving, or `onStay` once the * dialog is dismissed any other way (the stay button, the close button, or the Esc key). * * Wraps `options.content` in a padded container and delegates the actual dialog handling to * {@link module:ai/aireviewcore/utils/openleaveconfirmationdialog~openLeaveConfirmationDialog}. */ showLeaveConfirmationDialog(options: AILeaveConfirmationOptions, onExit: () => void, onStay?: () => void): void; abstract createMainView(): AIReviewCoreView; abstract registerTab(aiTabs: AITabs): void; } export type AIReviewCoreUIGetReviewCheckListEvent = { name: "getReviewCheckList"; args: []; }; export type AIReviewCoreUILeaveReviewEvent = { name: "leaveReview"; args: []; }; export type AIReviewCoreUIRetryReviewEvent = { name: "retryReview"; args: []; };