export interface RgbColor { readonly red: number; readonly green: number; readonly blue: number; } export interface UserMessageColors { readonly background: string; /** Omitted to keep the terminal's default foreground without resetting the background. */ readonly foreground?: string; } interface TerminalInput { readonly isTTY?: boolean; readonly isRaw?: boolean; readonly readableFlowing: boolean | null; readonly _readableState?: { flowing: boolean | null; }; listenerCount(eventName: string): number; on(eventName: 'data', listener: (chunk: Uint8Array | string) => void): unknown; on(eventName: 'readable', listener: () => void): unknown; removeListener(eventName: 'data', listener: (chunk: Uint8Array | string) => void): unknown; removeListener(eventName: 'readable', listener: () => void): unknown; read(): Uint8Array | string | null; pause(): unknown; resume(): unknown; unshift(chunk: Uint8Array): void; setRawMode?: (mode: boolean) => unknown; } interface TerminalOutput { readonly isTTY?: boolean; write(chunk: string): boolean; } export interface TerminalInputGuard { attach(): void; detach(): void; } export interface UserMessageColorResolution { readonly colors: UserMessageColors; readonly delayedResponseGuard?: TerminalInputGuard; } declare const TERMINAL_BACKGROUND_QUERY_TIMEOUT_MS = 50; declare const DELAYED_RESPONSE_ESCAPE_TIMEOUT_MS = 50; /** The previous fixed band remains a readable fallback when the probe cannot run. */ export declare const FALLBACK_USER_MESSAGE_COLORS: UserMessageColors; /** Reproduces Codex's dark/light terminal-background blend for the user band. */ export declare function userMessageColorsForBackground(background: RgbColor): UserMessageColors; /** Parses the rgb:rr/gg/bb or rgb:rrrr/gggg/bbbb payload used by OSC 11. */ export declare function parseTerminalBackgroundResponse(payload: string): RgbColor | null; /** * Reads one terminal background response without consuming unrelated input. * The probe is deliberately optional: a TTY can decline or ignore OSC 11. */ export declare function queryTerminalBackground(stdin: TerminalInput, stdout: TerminalOutput): Promise; export declare function resolveUserMessageColors(): Promise; export { DELAYED_RESPONSE_ESCAPE_TIMEOUT_MS, TERMINAL_BACKGROUND_QUERY_TIMEOUT_MS, }; //# sourceMappingURL=terminalColors.d.ts.map