import type { ColorMode } from "../../app/ports/terminal-port.js"; import type { ThemeHint } from "../../ui-core/bootstrap/capabilities.js"; import type { Theme } from "../../ui-core/rendering/theme.js"; import { type Glyphs } from "./glyphs.js"; export type ThemeToken = { [K in keyof Theme]: Theme[K] extends string ? K : never; }[keyof Theme]; export interface TextStyle { readonly fg?: ThemeToken | undefined; readonly bg?: ThemeToken | undefined; readonly bold?: boolean | undefined; readonly dim?: boolean | undefined; readonly italic?: boolean | undefined; readonly inverse?: boolean | undefined; readonly underline?: boolean | undefined; } export interface InkTheme { readonly theme: Theme; readonly colorMode: ColorMode; readonly unicode: boolean; readonly italicOk: boolean; readonly glyphs: Glyphs; /** Hex for an Ink `color`/`borderColor` prop, or undefined at `none`. */ inkColor(token: ThemeToken): string | undefined; style(text: string, style: TextStyle): string; fg(token: ThemeToken, text: string): string; /** Raw hex, for colours that come from a shared presenter (syntax spans). */ hex(color: string, text: string): string; bold(text: string): string; dim(text: string): string; inverse(text: string): string; /** Plate: solid background with white bold label. */ plate(token: ThemeToken, text: string): string; } export interface InkThemeInput { readonly themeHint: ThemeHint; readonly colorMode: ColorMode; readonly unicode: boolean; /** Legacy conhost renders italic as inverse; suppress it there. */ readonly italic?: boolean | undefined; } export declare function createInkTheme(input: InkThemeInput): InkTheme; /** * Shared `ui-core` renderers (markdown, code blocks, the intro card) colour * through the ambient chalk singleton, whose level is detected from the host * process. Classic pins it to the negotiated `colorMode` for the duration of a * render so a frame never depends on whether stdout happened to be a TTY. */ export declare function withColorMode(mode: ColorMode, render: () => T): T;