/** * @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/utils/geteditorconfig */ import { type Editor } from "@ckeditor/ckeditor5-core"; import { type AIEditorConfigSnapshot } from "../aieditorconfig.js"; /** * Recursively replaces every regular expression in a plain-data structure with its `String( regExp )` form, leaving all * other values untouched. Regular expressions serialize to `{}` (`JSON.stringify( /^a$/ ) === '{}'`), so without this * the pattern would be lost on its way to the AI agent. Arrays and plain objects are recreated, never mutated. */ export declare function stringifyRegExps(value: T): T; /** * Builds a compact, serializable snapshot of the editor's feature capabilities for the AI agent. * * The returned object is keyed by feature. A key is present only when the feature's plugin is loaded, so the agent * can tell at a glance what content the editor is able to produce: * * * For configurable features, the value is that feature's configuration with UI-only options stripped out * (toolbars, color pickers, icons, labels, keystrokes, dropdown limits, preview machinery, …), leaving only the * options that actually shape the document data. * * For features that expose no data-relevant configuration, the value is an empty object acting purely as a * presence flag. * * Knowing both which features are available and how they are configured (e.g. the allowed heading levels, font * sizes or table properties) lets the agent keep its edits within what the editor can represent. * * On top of the features, the snapshot describes the root it was gathered for in * {@link module:ai/aicore/aieditorconfig~AIEditorConfigSnapshot `rootType`} — what that root can hold and what * surrounds it. A snapshot is therefore specific to one root, which matters for editors with more than one. * * The live editor configuration is never mutated. * * @param editor The editor whose feature configuration is gathered. * @param rootName The name of the root the snapshot is gathered for. * @returns The editor's feature capabilities snapshot. */ export declare function getEditorConfig(editor: Editor, rootName?: string): AIEditorConfigSnapshot;