import { ElementType } from './constants';
/** Reads the data-type attribute from an element and returns it as a typed ElementType. */
export declare function getTokenType(element: HTMLElement): ElementType | null;
/** Checks if a token type represents a reference element (inline or pinned). */
export declare function isReferenceElementType(tokenType: ElementType | string | null): boolean;
/** Inserts a node immediately after a reference node in the DOM. */
export declare function insertAfter(newNode: Node, referenceNode: Node): void;
/** Creates a styled paragraph element for the contentEditable container. */
export declare function createParagraph(ownerDoc?: Document): HTMLParagraphElement;
/** Creates a trailing BR element used as a placeholder in empty paragraphs. */
export declare function createTrailingBreak(ownerDoc?: Document): HTMLBRElement;
/**
 * Generates a unique ID for DOM elements outside of React context.
 * Uses the same format as component-toolkit's useRandomId hook, but as a plain
 * function since token IDs are generated during DOM manipulation (not in React renders).
 */
export declare function generateTokenId(): string;
/** Strips zero-width characters used for cursor positioning. */
export declare function stripZeroWidthCharacters(text: string): string;
interface TokenQueryOptions {
    tokenType?: string | string[];
    tokenId?: string;
}
/** Finds the first element matching the given token type and/or token ID within a container. */
export declare function findElement(container: HTMLElement, options: TokenQueryOptions): HTMLElement | null;
/** Returns all paragraph elements within a container. */
export declare function findAllParagraphs(container: HTMLElement | DocumentFragment): HTMLParagraphElement[];
/** Checks if an element has no meaningful content (ignoring whitespace and trailing BRs). */
export declare function isElementEffectivelyEmpty(element: HTMLElement): boolean;
export declare function hasOnlyTrailingBR(paragraph: HTMLElement): boolean;
export declare function isEmptyState(element: HTMLElement): boolean;
/** Resets the element to a single empty paragraph with a trailing BR. */
export declare function setEmptyState(element: HTMLElement): void;
/** Checks if a token type represents a caret spot element. */
export declare function isCaretSpotType(tokenType: ElementType | string | null): boolean;
export interface AdjacentTokenResult {
    sibling: Node | null;
    isReferenceToken: boolean;
}
/**
 * Finds the adjacent sibling node in the given direction and checks if it's a reference token.
 * @param container the node where the cursor currently sits
 * @param offset cursor offset within the container
 * @param direction which direction to look
 */
export declare function findAdjacentToken(container: Node, offset: number, direction: 'backward' | 'forward'): AdjacentTokenResult;
/**
 * When the caret lands immediately after a trigger element (e.g. at offset 0 of the
 * next text node, or at the paragraph-level offset right after the trigger), nudge it
 * inside the trigger's text node so that `findActiveTrigger` detects it correctly.
 * @param cancelledIds Set of trigger IDs that are cancelled — caret won't be nudged into these.
 */
export declare function normalizeCaretIntoTrigger(editableElement: HTMLElement, cancelledIds?: Set<string>): void;
/**
 * Scrolls the caret into view within a scrollable contentEditable element.
 * Inserts a temporary span at the selection to measure position, scrolls if
 * needed, then removes the span.
 */
export declare function scrollCaretIntoView(element: HTMLElement): void;
export {};
//# sourceMappingURL=dom-utils.d.ts.map