/** * Get a Range from the current selection that can see into shadow DOM. * Tries `shadowRoot.getSelection` (older Chrome), then `document.getSelection` * with a containment check, then `getComposedRanges` (Safari 17+, Chrome 130+) * as a fallback when `getRangeAt` can't cross the shadow boundary. */ export declare function getShadowRange(shadowRoot: ShadowRoot | null): Range | null; /** * Whether the rich-input caret is at a valid trigger boundary (collapsed, after a * newly typed character). Returns true when the character *before* that typed * character is start-of-input, space, newline, NBSP, or an element badge — so * call from `input` once the trigger key is in the DOM and selection sits after it. */ export declare function isAtWordBoundary(shadowRoot: ShadowRoot | null): boolean; /** * Get the bounding position of the caret for overlay anchoring. * Returns the position at the trigger character (one char before the caret). */ export declare function getCaretRect(shadowRoot: ShadowRoot | null, richInputElement: HTMLElement | null): { x: number; y: number; } | null; /** * Extract the trigger search string from the rich input DOM. * Scans backwards from the caret in the current text node to find text * typed after the trigger character. */ export declare function extractTriggerSearchString(shadowRoot: ShadowRoot | null, triggerKey: string): string | null; /** * Focus the rich input and place the caret right after the badge's * trailing space node. Uses `setBaseAndExtent` for Safari shadow-DOM * compatibility, with `addRange` as a fallback. */ export declare function placeCursorAfterBadge(input: HTMLElement, badgeId: string): void; /** * Remove the trigger character and search string from a contenteditable. * First tries selection-based removal, then falls back to a text-node scan. */ export declare function removeTriggerText(shadowRoot: ShadowRoot | null, richInputElement: HTMLElement, triggerKey: string, searchString: string): void;