/** * @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 revision-history/revisionviewer */ import { Plugin, Command, type Editor } from '@ckeditor/ckeditor5-core'; import { ContextualBalloon } from '@ckeditor/ckeditor5-ui'; import { Users } from '@ckeditor/ckeditor5-collaboration-core'; import { ChangeDetailsView } from './ui/revisionviewer/changedetailsview.js'; import { RevisionsRepository } from './revisionsrepository.js'; import { RevisionHistoryUtils } from './revisionhistoryutils.js'; import { ChangeItem } from './changeitem.js'; import { RevisionDiff } from './revisiondiff.js'; import '../theme/revisionviewer.css'; import type { Revision, RevisionJSON } from './revision.js'; export declare class RevisionViewer extends Plugin { repository: RevisionsRepository; /** * @observable */ activeChange: ChangeItem | null; /** * @observable */ activeView: ChangeDetailsView | null; /** * @observable */ diff: RevisionDiff | null; /** * @observable */ isReady: boolean; /** * @observable */ isEnabled: boolean; /** * @observable */ isNavigationMode: boolean; /** * @observable */ currentChangeNumber: number; /** * @observable */ numberOfChanges: number; static get pluginName(): "RevisionViewer"; /** * @inheritDoc */ static get isOfficialPlugin(): true; /** * @inheritDoc */ static get isPremiumPlugin(): true; static get requires(): readonly [typeof Users, typeof ContextualBalloon, typeof RevisionsRepository, typeof RevisionHistoryUtils]; constructor(editor: Editor); init(): void; /** * Returns document data for given revision. * * The document data is HTML or a different format, depending on the editor configuration. * * This method returns a promise which resolves with an object, where keys are root names and values are these roots' data. Most * editor setups use just one root, which has the default name `main`. In this case, the promise will resolve with an object * similar to this: * * ```ts * { main: "
Sample document data.
" } * ``` * * If the adapter integration is used, this method will automatically load necessary * {@link module:revision-history/revision~Revision#diffData `Revision#diffData`} if it is missing. * * Please note, that the data returned by this method uses * {@link module:engine/dataprocessor/dataprocessor~DataProcessor#useFillerType marked fillers mode}. This means that some ` ` * characters in the returned data may be wrapped with ` `. Take this difference into * consideration if you plan to compare revision data with the data returned by `editor.getData()`. * * See also {@link module:revision-history/revisionviewer~RevisionViewer#getRevisionRootsAttributes}. */ getRevisionDocumentData(revision: Revision): Promise