import { FlowBlock, Layout, Measure } from '../../../../../../../layout-engine/contracts/src/index.js';
import { PageGeometryHelper } from '../../../../../../../layout-engine/layout-bridge/src/index.js';
import { RemoteCursorState } from '../types.js';
/**
 * Caret geometry in page-local layout space.
 */
type CaretLayout = {
    pageIndex: number;
    x: number;
    y: number;
    height: number;
};
/**
 * Style constants for remote cursor rendering.
 *
 * @remarks
 * These values are centralized to ensure consistent visual appearance across all remote cursors.
 */
type CursorStyles = {
    /** Width of the caret line in pixels */
    CARET_WIDTH: number;
    /** Font size for user name labels in pixels */
    LABEL_FONT_SIZE: number;
    /** CSS padding value for labels (e.g., "2px 4px") */
    LABEL_PADDING: string;
    /** CSS offset value for label positioning (e.g., "-18px") */
    LABEL_OFFSET: string;
    /** CSS border-radius value for selection highlights */
    SELECTION_BORDER_RADIUS: string;
    /** Maximum character length for user name labels before truncation */
    MAX_LABEL_LENGTH: number;
};
/**
 * Presence feature configuration options.
 *
 * @remarks
 * This type mirrors the public API's presence options but is defined locally to avoid
 * circular dependencies and maintain flexibility for internal implementation changes.
 */
type PresenceOptionsLike = {
    /** Whether presence rendering is enabled */
    enabled?: boolean;
    /** Maximum number of remote cursors to render simultaneously (performance guardrail) */
    maxVisible?: number;
    /** Whether to show user name labels above carets */
    showLabels?: boolean;
    /** Opacity value for selection highlights (0-1 range) */
    highlightOpacity?: number;
    /** Custom formatter for user name labels */
    labelFormatter?: (user: RemoteCursorState['user']) => string;
};
/**
 * Renders all remote cursors and selections for collaborative editing.
 *
 * This function is the main entry point for rendering presence awareness. It orchestrates
 * the rendering of carets and selection highlights for all connected remote users, applying
 * performance guardrails and managing the lifecycle of DOM elements.
 *
 * @param options - Configuration object containing all dependencies and state
 *
 * @remarks
 * Performance guardrails:
 * - Limits the number of visible remote cursors using maxVisible (default: 20)
 * - Sorts cursors by most recent update to show the most active users
 * - Limits selection rectangles per user to prevent DOM explosion
 * - Uses GPU-accelerated transforms for smooth cursor movement
 * - Reuses existing DOM elements when possible to minimize DOM churn
 *
 * Rendering strategy:
 * - Clears old selection rectangles before rendering new state to prevent "stuck" selections
 * - Distinguishes between collapsed selections (caret-only) and range selections
 * - Removes DOM elements for clients that are no longer in the visible set
 * - Gracefully handles virtualized pages by fading out cursors on unmounted pages
 *
 * The function delegates to renderRemoteCaret for caret rendering and renderRemoteSelection
 * for selection highlight rendering, maintaining separation of concerns.
 *
 * @example
 * ```typescript
 * renderRemoteCursors({
 *   layout,
 *   blocks,
 *   measures,
 *   pageGeometryHelper,
 *   presence: { enabled: true, maxVisible: 10, showLabels: true },
 *   remoteCursorState: stateMap,
 *   remoteCursorElements: elementMap,
 *   remoteCursorOverlay: overlayElement,
 *   doc: document,
 *   computeCaretLayoutRect,
 *   convertPageLocalToOverlayCoords,
 *   fallbackColors,
 *   cursorStyles,
 *   maxSelectionRectsPerUser: 50,
 *   defaultPageHeight: 792,
 *   fallbackPageHeight: 792
 * });
 * ```
 */
export declare function renderRemoteCursors(options: {
    layout: Layout;
    blocks: FlowBlock[];
    measures: Measure[];
    pageGeometryHelper: PageGeometryHelper | null;
    presence: PresenceOptionsLike | undefined;
    remoteCursorState: Map<number, RemoteCursorState>;
    remoteCursorElements: Map<number, HTMLElement>;
    remoteCursorOverlay: HTMLElement | null;
    doc: Document;
    computeCaretLayoutRect: (pos: number) => CaretLayout | null;
    convertPageLocalToOverlayCoords: (pageIndex: number, x: number, y: number) => {
        x: number;
        y: number;
    } | null;
    fallbackColors: readonly string[];
    cursorStyles: CursorStyles;
    maxSelectionRectsPerUser: number;
    defaultPageHeight: number;
    fallbackPageHeight: number;
}): void;
export {};
//# sourceMappingURL=RemoteCursorRendering.d.ts.map