/**
 * MK2 Safe Viewport - Single Source of Truth for Drawable Area
 *
 * Prevents scrollbars in CloudShell/browser terminals by enforcing insets
 * that prevent drawing on the last row/column.
 *
 * ALL dimension constants are defined here as the single source of truth.
 */
import type { Widgets } from 'neo-blessed';
/** Guard columns on the right (minimum 1, but 3 for web terminals) */
export declare const GUARD_RIGHT_WEB = 3;
export declare const GUARD_RIGHT_LOCAL = 0;
/** Guard rows on the bottom (minimum 1) */
export declare const GUARD_BOTTOM_WEB = 2;
export declare const GUARD_BOTTOM_LOCAL = 0;
/** Guard row on top (reserve for debug overlay) */
export declare const GUARD_TOP = 1;
/** Guard columns on left (none needed) */
export declare const GUARD_LEFT = 0;
/** Minimum required dimensions for layout */
export declare const MIN_COLS = 90;
export declare const MIN_ROWS = 22;
/** Panel minimum dimensions */
export declare const MIN_PANEL_W = 20;
export declare const MIN_PANEL_H = 5;
/** Command box minimum dimensions */
export declare const CMD_MIN_W = 10;
export declare const CMD_MIN_H = 3;
export interface ViewportInsets {
    left: number;
    top: number;
    right: number;
    bottom: number;
}
export interface SafeViewport {
    cols: number;
    rows: number;
    insets: ViewportInsets;
    safe: {
        x: number;
        y: number;
        w: number;
        h: number;
    };
}
/**
 * Detect if running in a web/browser terminal (CloudShell, etc.)
 *
 * Returns true if:
 * - TUI_WEB=1 (manual override)
 * - AWS_EXECUTION_ENV exists (AWS CloudShell)
 * - CLOUDSHELL exists
 */
export declare function isWebTerminal(): boolean;
/**
 * Get safe viewport for the terminal
 *
 * CloudShell/browser mode insets:
 * - right = 3 (never draw on last 3 columns - browser DOM needs extra buffer)
 * - bottom = 2 (never draw on last 2 rows - prevents vertical scrollbar)
 * - top = 1 (reserve for debug overlay)
 * - left = 0 (no left inset needed)
 *
 * Local mode insets:
 * - right = 0 (use full width)
 * - bottom = 0 (use full height)
 * - top = 1 (reserve for debug overlay)
 * - left = 0
 */
export declare function getSafeViewport(screen: Widgets.Screen): SafeViewport;
/**
 * Validate that a rect fits within the safe viewport
 *
 * HARD RULE: No widget may have:
 * - x + w > safe.w (right edge exceeds safe width)
 * - y + h > safe.h (bottom edge exceeds safe height)
 *
 * CRITICAL: Must leave 1 cell buffer (maxRight <= safeRight - 1)
 *
 * Returns true if valid, false if violates bounds
 */
export declare function validateRect(rect: {
    x: number;
    y: number;
    w: number;
    h: number;
}, viewport: SafeViewport): {
    valid: boolean;
    errors: string[];
};
//# sourceMappingURL=safeViewport.d.ts.map