import "@tiptap/extension-text-style"; import { Extension } from "@tiptap/core"; export interface FontSizeOptions { types: string[]; /** * When false, nothing can *author* a per-run size: `setFontSize` is refused and * an inline `font-size` on pasted HTML is discarded rather than adopted. Hiding * {@link FontSizeButton} is not enough on its own — paste goes straight to * `parseHTML`, so a copied `` still reached * Elemental as `font_size` with the gate off, which is exactly the write the * gate exists to prevent. * * The extension stays registered either way, so a mark already stored in the * content still loads and still round-trips. Elemental → Tiptap sets the * attribute directly rather than through `parseHTML`, so dropping the extension * (or gating the attribute itself) would silently strip values a host authored * while the gate was open. */ enabled: boolean; } declare module "@tiptap/core" { interface Commands { fontSize: { /** Size the selected run of text, e.g. "28px". Invalid values are ignored. */ setFontSize: (fontSize: string) => ReturnType; /** Drop the per-run size so the text falls back to its block/document size. */ unsetFontSize: () => ReturnType; }; } } /** * Per-run font size, stored as a `fontSize` attribute on the `textStyle` mark * (same shape as {@link Color}). Maps to `font_size` on an Elemental `string` / * `link` text-content element, which the renderer emits as an inline * ``. * * Only px values are accepted — that is the full contract the backend validates * the inline mark against, and anything else would be dropped at render time. */ export declare const FontSize: Extension;