/** * @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/aicore/aiediting */ import { type ModelRange, type ModelDocumentFragment } from '@ckeditor/ckeditor5-engine'; import { ContextPlugin, type Context, Editor } from '@ckeditor/ckeditor5-core'; export declare const AI_VISUAL_SELECTION_MARKER_NAME = "ai-selection"; export declare class AIEditing extends ContextPlugin { /** * @inheritDoc */ constructor(context: Context | Editor); /** * @inheritDoc */ static get pluginName(): "AIEditing"; /** * @inheritDoc */ static get isOfficialPlugin(): true; /** * @inheritDoc */ static get isPremiumPlugin(): true; /** * Gets the current session ID. If RTC plugin is available, uses its sessionId. * Otherwise, generates a random ID for the current (non-RTC) session. */ get sessionId(): string; /** * Returns the data and version of the current document. */ getDocumentData(): Promise<{ content: string; version: number; sessionId: string; selections: Array<{ markerName: string; start: number; end: number; htmlFragment: string; }>; }>; afterInit(): Promise; /** * Displays a fake visual selection on given ranges. * * Since multiple features may want to show and hide the selection, while at the same time, only one fake selection should be shown, * it is necessary to provide an `id` when showing fake selection. Then, when the fake selection should be hidden, `id` must be * passed as well. This mechanism prevents a feature from mistakenly hiding a fake selection set by another feature. */ showFakeVisualSelection(fakeSelectionData: FakeSelectionData): void; /** * Removes a fake visual selection from the document. * * @param id ID of the fake visual selection to remove. */ hideFakeVisualSelection(id: string): void; modelToDataWithIds(modelFragment: ModelDocumentFragment): Promise; } type FakeSelectionData = { /** * Ranges on which fake selection should be shown. */ ranges: Array; /** * Fake selection ID. * * Used when removing fake selection. * * Used as a part of CSS class set on fake selection DOM elements (`ck-fake-ai-selection-${ id }`). */ id: string; /** * Fake selection priority. * * There can be only one fake selection displayed at once. Priority is used to inform which fake selection should be displayed when * multiple features asked to show fake selection on different ranges. */ priority: number; }; export {};