import { c as TerminalAppearance, s as RgbColor, t as Capabilities } from "./detect-Db6GbKOm.js"; //#region src/capabilities/query.d.ts type PixelSize = { width: number; height: number; }; type TerminalQueryResult = { foreground: RgbColor | undefined; background: RgbColor | undefined; cursorColor: RgbColor | undefined; /** The user's 16-color ANSI palette, when the terminal reports it. */ palette: RgbColor[] | undefined; /** The terminal's own appearance, derived from the actual background color's luminance — a dark terminal theme on a light OS stays "dark". Falls back to the OS color scheme report when the background is unknown. */ appearance: TerminalAppearance | undefined; /** The operating system's color preference, from the color scheme report (`CSI ? 996 n`). Independent of the terminal's own theme. */ systemAppearance: TerminalAppearance | undefined; /** The terminal answered the kitty keyboard protocol query. */ kittyKeyboard: boolean; /** The terminal answered the kitty graphics protocol probe. */ kittyGraphics: boolean; /** The terminal reports sixel graphics in its DA1 device attributes. */ sixel: boolean; /** Raw DA1 device attribute parameters, for capabilities not modeled here. */ deviceAttributes: number[] | undefined; /** The terminal confirmed truecolor via XTGETTCAP ("RGB"). */ trueColor: boolean; /** Focus in/out reporting (mode 1004). */ focusEvents: boolean; /** SGR mouse reporting (mode 1006). */ sgrMouse: boolean; /** SGR pixel-precision mouse reporting (mode 1016). */ sgrPixelMouse: boolean; /** Bracketed paste (mode 2004). */ bracketedPaste: boolean; /** Synchronized output (mode 2026). */ synchronizedOutput: boolean; /** Grapheme cluster width handling (mode 2027). */ graphemeClustering: boolean; /** Push notifications of light/dark scheme changes (mode 2031). */ colorSchemeUpdates: boolean; /** In-band window resize notifications (mode 2048). */ inBandResize: boolean; /** Text area size in pixels (XTWINOPS 14). */ textAreaPixels: PixelSize | undefined; /** Size of a single character cell in pixels (XTWINOPS 16). */ cellPixels: PixelSize | undefined; /** The terminal's self-reported name and version (XTVERSION). */ terminal: { raw: string; name: string | undefined; version: string | undefined; } | undefined; }; type TerminalQueryOptions = { /** How long to wait for the DA1 sentinel before giving up, in milliseconds. */ timeout?: number; /** Also query the 16-color palette (16 extra OSC 4 queries). @default true */ palette?: boolean; /** Which queries to send. `"full"` asks everything; `"dynamic"` asks only the facts that change over a session — colors/theme and pixel geometry — and is what `refreshTerminalQuery` uses. Mode support, protocol support, and the terminal's identity are static and never need re-asking. @default "full" */ scope?: "full" | "dynamic"; }; /** Sends a batch of terminal queries and collects the responses. Resolves when the terminal answers the DA1 sentinel, or after `timeout` with whatever was gathered. Stdin bytes that are not query responses are pushed back into the stream. The query is lazy: nothing is sent until something asks. Inside an Ink app, use `useCapabilities` — it triggers the query through Ink's input pipeline so responses can't collide with key handling. Call this directly only outside of Ink, before any other stdin consumer is attached. */ declare const queryTerminal: (stdin: NodeJS.ReadableStream, stdout: { write: (data: string) => unknown; }, { timeout, palette, scope }?: TerminalQueryOptions) => Promise; /** The completed query result for a stdout stream, if the query has finished. */ declare const getTerminalQuery: (stdout: object) => TerminalQueryResult | undefined; /** Re-asks the terminal only the dynamic questions — colors/theme and pixel geometry, which change when the user switches themes or resizes — and merges the answers into the cached result. Static facts (mode and protocol support, identity) are kept from the original query. Falls back to a full query when none has completed yet; concurrent refreshes share one round-trip. */ declare const refreshTerminalQuery: (stdin: NodeJS.ReadableStream, stdout: { write: (data: string) => unknown; }, options?: TerminalQueryOptions) => Promise; /** Merges an async query result into a synchronous capabilities snapshot, producing the complete picture. The query is authoritative where it answered: a terminal that confirms truecolor via XTGETTCAP upgrades the sniffed color level. */ declare const applyTerminalQuery: (capabilities: Capabilities, query: TerminalQueryResult) => Capabilities; //#endregion export { getTerminalQuery as a, applyTerminalQuery as i, TerminalQueryOptions as n, queryTerminal as o, TerminalQueryResult as r, refreshTerminalQuery as s, PixelSize as t };