/**
 * @license
 * Copyright 2025 Vybestack LLC
 * SPDX-License-Identifier: Apache-2.0
 */
/**
 * Combined terminal contract sequences including:
 * - Mouse tracking
 * - Bracketed paste mode
 * - Focus tracking
 * - Show cursor
 */
export declare const TERMINAL_CONTRACT_SEQUENCES: string;
/**
 * Terminal contract sequences without mouse events.
 * Used when mouse events are disabled by user preference.
 */
export declare const TERMINAL_CONTRACT_SEQUENCES_NO_MOUSE: string;
export interface ApplyTerminalContractOptions {
    /**
     * Whether to include mouse event sequences.
     * @default true
     */
    includeMouseEvents?: boolean;
}
/**
 * Apply the expected terminal contract by writing all necessary escape sequences.
 *
 * This function (re)asserts the terminal modes that the application depends on:
 * - Mouse tracking (X11, button events, SGR extended)
 * - Bracketed paste mode
 * - Focus tracking
 * - Cursor visibility
 *
 * Call this function:
 * - At startup (after draining any garbage ANSI from stdin)
 * - After SIGCONT (tmux reattach, fg after suspend)
 * - After SIGWINCH (terminal resize - some terminals reset modes)
 * - After running subprocesses that may emit mode-changing sequences
 * - When the user explicitly requests repair via /terminal-repair
 *
 * @param stdout The output stream to write to (defaults to process.stdout)
 * @param options Configuration options
 */
export declare function applyTerminalContract(stdout?: NodeJS.WriteStream, options?: ApplyTerminalContractOptions): void;
/**
 * Drain any pending data from the stdin buffer.
 *
 * This is useful at startup to consume any garbage ANSI sequences that may have
 * been sent by the terminal before the application started processing input.
 * This addresses issue #199 where garbage ANSI on startup disrupts theme selection.
 *
 * The function reads available data from stdin without blocking indefinitely.
 * It uses a timeout to prevent hanging if stdin has no data.
 *
 * @param stdin The input stream to drain (defaults to process.stdin)
 * @param timeoutMs Maximum time to wait for data (defaults to 50ms)
 */
export declare function drainStdinBuffer(stdin?: NodeJS.ReadableStream, timeoutMs?: number): Promise<void>;
