/** * Type definitions for Node.js stdin with raw mode support */ /** Interface for stdin that supports raw mode */ export interface RawModeStream { setRawMode(mode: boolean): void; } /** * Type guard to check if stdin supports raw mode * @param stdin The stdin stream to check * @returns True if stdin supports raw mode */ export function hasRawMode(stdin: NodeJS.ReadStream): stdin is NodeJS.ReadStream & RawModeStream { return "setRawMode" in stdin && typeof (stdin as RawModeStream).setRawMode === "function"; }