/**
 * Stderr interception for interactive TUI mode.
 *
 * When the TUI is active, raw writes to process.stderr would corrupt the
 * differential renderer's state. This module intercepts process.stderr.write
 * and routes all output through a callback instead of letting it hit the terminal.
 *
 * Analogous to output-guard.ts (which handles stdout for non-interactive modes),
 * but specifically for protecting the TUI's display in interactive mode.
 */
export type StderrCallback = (message: string, level?: "warn" | "error" | "debug") => void;
/**
 * Intercept all process.stderr.write calls and route them through the callback.
 * Idempotent — multiple calls are no-ops if already taken over.
 */
export declare function takeOverStderr(callback: StderrCallback): void;
/**
 * Write a message directly through the interceptor callback with level info.
 * Used by the logger to pass severity through without going via process.stderr.write.
 * Falls back to rawStderrWrite if stderr is not taken over.
 */
export declare function writeIntercepted(message: string, level: "warn" | "error" | "debug"): void;
/**
 * Restore the original process.stderr.write behavior.
 */
export declare function restoreStderr(): void;
/**
 * Check whether stderr is currently intercepted.
 */
export declare function isStderrTakenOver(): boolean;
/**
 * Write directly to the real stderr, bypassing interception.
 * Use for intentional writes that must reach the terminal
 * (e.g., fatal errors before exit, post-TUI teardown messages).
 */
export declare function writeRawStderr(text: string): void;
//# sourceMappingURL=stderr-guard.d.ts.map