/**
 * Overlay layout resolution, compositing, and rendering utilities.
 *
 * Extracted from tui.ts — these are pure functions that compute overlay
 * positions and composite overlay content onto base terminal lines.
 */
import type { OverlayAnchor, OverlayOptions, SizeValue } from "./tui.js";
/** Parse a SizeValue into absolute value given a reference size */
export declare function parseSizeValue(value: SizeValue | undefined, referenceSize: number): number | undefined;
export declare function resolveAnchorRow(anchor: OverlayAnchor, height: number, availHeight: number, marginTop: number): number;
export declare function resolveAnchorCol(anchor: OverlayAnchor, width: number, availWidth: number, marginLeft: number): number;
export interface OverlayLayout {
    width: number;
    row: number;
    col: number;
    maxHeight: number | undefined;
}
/**
 * Resolve overlay layout from options.
 * Returns { width, row, col, maxHeight } for rendering.
 */
export declare function resolveOverlayLayout(options: OverlayOptions | undefined, overlayHeight: number, termWidth: number, termHeight: number): OverlayLayout;
/** Append reset sequences to each non-image line. */
export declare function applyLineResets(lines: string[]): string[];
/** Splice overlay content into a base line at a specific column. Single-pass optimized. */
export declare function compositeLineAt(baseLine: string, overlayLine: string, startCol: number, overlayWidth: number, totalWidth: number): string;
export interface OverlayEntry {
    component: {
        render(width: number): string[];
        invalidate?(): void;
    };
    options?: OverlayOptions;
    hidden: boolean;
    focusOrder: number;
}
/** Check if an overlay entry is currently visible */
export declare function isOverlayVisible(entry: OverlayEntry, termWidth: number, termHeight: number): boolean;
/**
 * Composite all visible overlays into content lines.
 * Sorted by focusOrder (higher = on top).
 */
export declare function compositeOverlays(lines: string[], overlayStack: OverlayEntry[], termWidth: number, termHeight: number, maxLinesRendered: number): string[];
/**
 * Find and extract cursor position from rendered lines.
 * Searches for CURSOR_MARKER, calculates its position, and strips it from the output.
 * Only scans the bottom terminal height lines (visible viewport).
 * @param lines - Rendered lines to search (mutated to strip marker)
 * @param height - Terminal height (visible viewport size)
 * @returns Cursor position { row, col } or null if no marker found
 */
export declare function extractCursorPosition(lines: string[], height: number): {
    row: number;
    col: number;
} | null;
//# sourceMappingURL=overlay-layout.d.ts.map