/** * @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/toolkit/applypatch */ import { type Editor } from "@ckeditor/ckeditor5-core"; import { type DocumentComparePatch } from "./documentcompare.js"; /** * Applies a patch to the current state of the document of the given editor: the patch operations are reconciled against * everything that happened to the document since the patch was captured, validated on a copy of the document, and only then * committed. * * The patch is only applied to the document it was captured from, and never across real-time sessions. Outside collaboration * the editing session is the caller's to check, see {@link module:ai/toolkit/documentcompare~DocumentCompare#applyPatch}. * * @param editor The editor whose document the patch is applied to. * @param patch The patch to apply, as produced by {@link module:ai/toolkit/documentcompare~DocumentCompare#computePatch}. * @param sessionId The editing session the patch must still belong to. Defaults to the only one the editor itself knows. */ export declare function applyPatch(editor: Editor, patch: DocumentComparePatch, sessionId?: string | null): void; /** * The document's collaboration channel id, or an empty string when not configured. */ export declare function getChannelId(editor: Editor): string; /** * The editing session id the editor itself knows - the real-time collaboration one - or `null` when it is not in a * collaboration session. Outside collaboration the session id is generated by whoever captured the patch. */ export declare function getRealTimeSessionId(editor: Editor): string | null;