import { CharNode } from "../models";
import { GveRenditionSettings } from "../settings/settings";
import { Logger } from "../core/logger";
import { AnimationEngine } from "../animation/animation-engine";
import { BoundsCache } from "./bounds-cache";
import { SpreadingEngine } from "./spreading-engine";
import { RenditionConfig } from "./feature-resolver";
/**
 * Text renderer handles rendering of base text and additional text.
 */
export declare class TextRenderer {
    private _settings;
    private _logger;
    private _animationEngine;
    private _boundsCache;
    private _spreadingEngine;
    private _textLayout;
    private _featureResolver;
    /**
     * Reference to the root SVG element for text width measurements.
     * This ensures measurements happen in the same CSS context as rendering,
     * which is critical when running inside Angular or other frameworks
     * that apply global CSS styles to document.body.
     */
    private _measurementRoot?;
    constructor(settings: GveRenditionSettings, logger: Logger, animationEngine: AnimationEngine, boundsCache: BoundsCache, spreadingEngine: SpreadingEngine);
    /**
     * Render base text (v0).
     *
     * @param nodes - Character nodes to render
     * @param rootSvg - Root SVG element
     * @param charOffsets - Optional character offset overrides
     * @returns Promise that resolves when rendering completes
     */
    renderBaseText(nodes: CharNode[], rootSvg: SVGElement, charOffsets?: Map<number, {
        x?: number | string;
        y?: number | string;
    }>): Promise<void>;
    /**
     * Render a single character node.
     */
    private renderCharacter;
    /**
     * Render additional text added by operations.
     *
     * @param nodes - Nodes to render
     * @param rootSvg - Root SVG element
     * @param config - Rendition configuration
     * @param versionTag - Version tag for class
     * @param referenceNodes - Reference nodes for RBR calculation
     * @param allBaseNodes - All base text nodes (for displaced span)
     * @param panZoomInstance - The svg-pan-zoom instance (for prolog)
     * @param viewportWidth - Width of the visible viewport (for prolog)
     * @param viewportHeight - Height of the visible viewport (for prolog)
     * @returns Promise that resolves when rendering completes
     */
    renderAdditionalText(nodes: CharNode[], rootSvg: SVGElement, config: RenditionConfig, versionTag: string, referenceNodes: CharNode[], allBaseNodes: CharNode[], panZoomInstance?: any, viewportWidth?: number, viewportHeight?: number): Promise<void>;
    /**
     * Calculate positions for additional text characters.
     * Additional text flows left to right from the base position.
     */
    private calculateAdditionalTextPositions;
    /**
     * Calculate RBRs from reference nodes.
     * Nodes on different lines create separate RBRs.
     */
    private calculateRBRs;
    /**
     * Calculate target position on the RBR based on position type.
     */
    private calculateTargetPosition;
    /**
     * Calculate bounding rectangle for a set of positioned characters.
     */
    private calculateTextBounds;
    /**
     * Update settings.
     */
    updateSettings(settings: GveRenditionSettings): void;
}
