/** * @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/ui/aireviewcoreuicheckresultsview */ import { type Locale } from "@ckeditor/ckeditor5-utils"; import { ListItemView, type ViewCollection } from "@ckeditor/ckeditor5-ui"; import { type AIReviewCheckResultChange } from "../model/aireviewcheckresultchange.js"; export type AIReviewCoreUICheckResultsViewContents = { generalErrorText: string; }; export declare class AIReviewCoreUICheckResultsView extends ListItemView { /** * The title of the current check results. * * @observable */ headerTitle: string; /** * The subtitle of the current check results. * * @observable */ headerSubtitle: string; /** * The loading state of the controls. * * @observable */ isLoading: boolean; /** * Indicates whether the review is completed. * * @observable */ isCompleted: boolean; /** * Indicates whether the results are ready and can be interacted with. * * @observable */ isResultReady: boolean; isError: boolean; showErrorMessage: boolean; errorType: "chunk" | "general" | "unsupported-inline" | undefined; /** * Whether there are pending (unreviewed) changes — pushed by the controller. Combined with the panel's own * error state, this gates both the Accept All and Reject All bulk actions in the Complete review dropdown. * * @observable */ hasPendingChanges: boolean; /** * @observable */ isAnyResultReviewed: boolean; constructor(locale: Locale, contents: AIReviewCoreUICheckResultsViewContents); /** * @inheritDoc */ override render(): void; /** * @inheritDoc */ override destroy(): void; clearResults(): void; /** * Updates the header progress bar with the number of reviewed (accepted, rejected, outdated) changes out of the total. */ updateProgress(reviewed: number, total: number): void; getResults(): ViewCollection; /** * Marks the result showing `id` as active. */ setActiveResult(id: string): void; /** * Marks every result as inactive. */ resetActiveResults(): void; /** * Updates the summary of the user's decisions. No-op by default, only AI Review shows such a summary. * * @param accepted The number of accepted changes. * @param dismissed The number of dismissed changes. */ updateSummary(accepted: number, dismissed: number): void; /** * Scrolls the results so the one showing `id` starts at the top of the list, with the result's `scroll-margin-top` * kept above it. * * The list is given the space to scroll the last results to its top as well, * see {@link module:ai/aicore/ui/aiscrollfillerview~AIScrollFillerView}. */ scrollToResult(id: string): void; /** * Scrolls the results back to the very top of the list, where the review summary is shown once every change * is decided. * * The filler added by {@link #scrollToResult} is taken away once the list is at the top. Taking it away earlier would * shrink the scrollable area under the scroll, making the list jump. When the scroll is interrupted before it reaches * the top, the filler is kept. */ scrollToTop(): void; /** * Returns the rendered element of the result showing `id`, the one {@link #scrollToResult} brings into view. */ getResultElement(id: string): HTMLElement | null; addResult(result: AIReviewCheckResultChange, isAcceptButtonVisible: boolean, isSuggestButtonVisible: boolean): void; /** * Reflects the change status on the result showing `id`. Resolved changes (accepted, rejected, outdated) are * grayed out and stop responding to interaction, while going back to `pending` restores the result. */ updateChangeState(id: string, status: AIReviewCheckResultChange["status"]): void; /** * Sets the title of the current check results. * * @param title The title to set in the header. */ setTitle(title: string, subtitle?: string): void; showChunkErrorMessage(): void; showUnsupportedInlineChangeMessage(): void; showGeneralErrorMessage(): void; resetErrorState(): void; } export type AIAbortReviewStreamEvent = { name: "abortReviewStream"; args: []; }; export type AILeaveReviewCoreResultListEvent = { name: "leaveReviewCoreResultList"; args: []; }; export type AIAcceptAllChangesEvent = { name: "acceptAllChanges"; args: []; }; export type AIRejectAllChangesEvent = { name: "rejectAllChanges"; args: []; };