modulo-editor
Version:
A flexible and extensible block-based editor for React applications
14 lines (13 loc) • 907 B
TypeScript
import { RichTextFormat } from "../types";
import { FormatKey } from "../types";
export declare function applyFormats(element: HTMLElement, formats: RichTextFormat): void;
export declare function findLinkElement(node: Node): HTMLAnchorElement | null;
/**
* Shared function to apply rich text formatting to a selection in a contentEditable element.
* @param contentElement The contentEditable element
* @param currentFormats The current formats object
* @param format The format key (e.g., 'bold', 'italic', 'link', etc.)
* @param value The value for the format (e.g., color, link URL)
* @param updateContentAndFormats Callback to update the content and formats in the parent tool
*/
export declare function formatRichTextSelection(contentElement: HTMLElement, currentFormats: any, format: FormatKey, value: string | undefined, updateContentAndFormats: (content: string, formats: any) => void): void;