import { PptxElement, TextSegment } from 'pptx-viewer-core';
/**
* Pure helpers for inline text editing. The editable surface itself is a
* Svelte component (`InlineTextEditor.svelte`); this module only holds the
* framework-agnostic logic: which elements are editable, remapping edited
* plain text back onto the original rich segments (via the shared
* `remapTextToSegments`, so per-run styles and field metadata survive), and
* reading plain text out of a contenteditable surface.
*/
/**
* Only elements that carry text (and are not locked) get the inline editor.
* Equation-bearing text NEVER enters inline editing: the editor would only see
* the literal "[Equation]" placeholder and committing would permanently drop
* the OMML (`textSegments[].equationXml`). Mirrors the vanilla/Vue/React guard.
*/
export declare function canInlineEditElement(element: PptxElement | undefined): boolean;
/** Remap edited plain text back onto the element's original segments. */
export declare function remapInlineText(element: PptxElement, text: string): {
text: string;
textSegments: TextSegment[];
};
/**
* Read the plain text of a contenteditable back out, translating `
` and
* block-element boundaries into `\n` (contenteditable normalises Enter into
* nested blocks or `
` depending on the browser).
*/
export declare function readEditableText(root: HTMLElement): string;
/**
* `a:spAutoFit` ("Resize shape to fit text") editor-commit resize: decide the
* element's new height from its text style, current height, and the live
* (still-mounted) editor DOM node - `undefined` when the element carries no
* text properties, autofit isn't `'shrink'`, or the measured height did not
* meaningfully change.
*
* `EditorElementController#commitInlineText` calls this before it replaces
* the element; `editorEl` there is found via
* `document.querySelector('[data-inline-editor]')`, which still resolves at
* that point because `InlineTextEditor.svelte`'s `close()` invokes `oncommit`
* (the call that reaches here) BEFORE `onclose()` - only `onclose()` sets
* `editingId = null`, which is what unmounts the editor on Svelte's next
* update.
*/
export declare function resolveInlineTextAutoFitHeight(element: PptxElement, editorEl: HTMLElement | null): number | undefined;
/** Initial plain text + optional font style for the inline surface. */
export interface InlineTextSurface {
text: string;
fontSize: number | undefined;
fontFamily: string | undefined;
}
/** Resolve the seed text and font hints for an element's inline editor. */
export declare function resolveInlineSurface(element: PptxElement): InlineTextSurface;
//# sourceMappingURL=inline-text.d.ts.map