import { INITIAL_SMEUP_LINK_STATE, PopupPosition, SmeupLinkData } from './text-editor-types';
export type FormatType = "bold" | "italic" | "underline";
export type BlockFormatType = "h1" | "h2" | "p" | "ul" | "ol";
export declare const formatSelectors: Record<FormatType, string>;
export declare const formatTags: Record<FormatType, string>;
export declare const getSelectionBlockFormat: (selection: Selection, editorRef: React.RefObject<HTMLDivElement | null>) => BlockFormatType;
export declare const applyBlockFormat: (selection: Selection, blockFormatType: BlockFormatType, editorRef: React.RefObject<HTMLDivElement | null>) => void;
export declare const insertParagraphAfterSelection: (selection: Selection, editorRef: React.RefObject<HTMLDivElement | null>) => boolean;
export declare const isSelectionFormatted: (selection: Selection, formatType: FormatType) => boolean;
export declare const applyFormat: (selection: Selection, formatType: FormatType, editorRef: React.RefObject<HTMLDivElement | null>) => void;
export declare const removeFormat: (selection: Selection, formatType: FormatType, editorRef: React.RefObject<HTMLDivElement | null>) => void;
export declare const isSelectionLink: (selection: Selection) => boolean;
export declare const applyLink: (selection: Selection, url: string, editorRef: React.RefObject<HTMLDivElement | null>) => void;
export declare const removeLink: (selection: Selection, editorRef: React.RefObject<HTMLDivElement | null>) => void;
export declare const createBindValue: (html: string) => string;
export declare const isSmeupLink: (link: string) => boolean;
export declare const createSmeupLinkAsObject: (t: string, p: string, k: string) => string;
export declare const createSmeupLinkAsFUN: (fun: string) => string;
/**
 * Returns the closest <a> ancestor from a Range's commonAncestorContainer.
 *
 * Replaces this pattern, duplicated ~4 times across the component:
 *
 *   const container = range.commonAncestorContainer
 *   const linkElement =
 *     container.nodeType === Node.TEXT_NODE
 *       ? container.parentElement?.closest("a")
 *       : (container as Element).closest("a")
 */
export declare function getLinkElementFromRange(range: Range): HTMLAnchorElement | null;
/**
 * Extracts tabIndex / t / p / k / fun from a Smeup <a> element.
 *
 * Replaces the duplicated parsing block in handleSmeupLink and
 * handleClickInEditor.
 */
export declare function parseSmeupLinkData(linkElement: HTMLAnchorElement): SmeupLinkData;
/**
 * Computes popup position relative to the editor container.
 *
 * Replaces this three-line pattern, duplicated in handleLink, handleSmeupLink,
 * and handleClickInEditor:
 *
 *   const rect = range.getBoundingClientRect()
 *   const editorRect = editorRef.current.getBoundingClientRect()
 *   const position = { top: rect.bottom - editorRect.top, left: rect.left - editorRect.left }
 *
 * @param rect        BoundingClientRect of the selection / element
 * @param editorRect  BoundingClientRect of the editor container
 * @param offset      Extra vertical gap in px (default 8)
 */
export declare function getPopupPosition(rect: DOMRect, editorRect: DOMRect, offset?: number): PopupPosition;
/**
 * Returns true when the <a> element carries Smeup-specific data attributes.
 */
export declare function isSmeupLinkElement(element: HTMLAnchorElement): boolean;
/**
 * Applies href and data-* attributes to a Smeup link element.
 * Returns false if the fields are empty (caller should abort).
 * Replaces the duplicated obj/fun branch logic in applySmeupLink.
 */
export declare function applyAttributesToSmeupLink(el: HTMLAnchorElement, state: typeof INITIAL_SMEUP_LINK_STATE): boolean;
export declare const isValidUrl: (str: string) => boolean;
//# sourceMappingURL=text-editor-utils.d.ts.map