/** * Ghostty-parity defaults for the restty engine. * * Restty embeds libghostty-vt (WASM) + GPU text; it is not the Ghostty app. * This module maps Ghostty’s known-good defaults onto restty’s public config * so avocado’s restty path feels as close as the web stack allows. * * References: * - Ghostty ships JetBrains Mono + built-in Nerd Fonts, default dark palette * - restty DEFAULT_FONT_INPUTS + getBuiltinTheme("Ghostty Default Style Dark") * - restty TerminalConfig (renderer, ligatures, alphaBlending, nerdIconScale, …) */ import type { TerminalViewTheme } from './types.js'; import { type ResttyFontInputLike } from './bundled-font.js'; /** Ghostty’s stock dark palette name in restty’s builtin catalog. */ export declare const GHOSTTY_DEFAULT_THEME_NAME = "Ghostty Default Style Dark"; /** * Ghostty default font-size is 13 (points). We pass CSS px; at 1x they match * closely enough that restty cells look Ghostty-sized. */ export declare const GHOSTTY_DEFAULT_FONT_SIZE = 13; /** Ghostty default window padding (px). Applied as host inset around the canvas. */ export declare const GHOSTTY_WINDOW_PADDING_PX = 2; /** Approximate Ghostty default background (#282c34). */ export declare const GHOSTTY_DEFAULT_BG = "#282c34"; export declare const GHOSTTY_DEFAULT_FG = "#ffffff"; export type ResttyRendererPref = 'auto' | 'webgpu' | 'webgl2'; export type GhosttyParityOptions = { fontSize?: number; /** restty builtin theme name (default: Ghostty Default Style Dark). */ ghosttyThemeName?: string; /** Engine-neutral avocado theme bag → converted to GhosttyTheme when set. */ theme?: TerminalViewTheme; /** Prefer WebGPU (Ghostty≈Metal). Default auto. */ renderer?: ResttyRendererPref; ligatures?: boolean; /** TrueType atlas hinting (Ghostty/mac CoreText differs; default false). */ fontHinting?: boolean; fontHintTarget?: 'auto' | 'light' | 'normal'; /** * How fontSize maps to design units. * Ghostty sizes by face height; restty "height" tracks that more closely. */ fontSizeMode?: 'em' | 'height'; /** * GPU alpha blending. Default `native` matches Ghostty’s macOS default * (Display-P3-style native blend). `linear` / `linear-corrected` often * wash out saturated UI (e.g. Claude effort bars). */ alphaBlending?: 'native' | 'linear' | 'linear-corrected'; nerdIconScale?: number; /** Scrollback cap in bytes (restty/Ghostty-scale default 10MB). */ maxScrollbackBytes?: number; }; export type BuiltGhosttyParity = { fonts: ResttyFontInputLike[]; theme: unknown | undefined; themeSourceLabel: string | undefined; terminal: Record; hostPaddingPx: number; hostBackground: string; }; type ThemeColor = { r: number; g: number; b: number; a?: number; }; /** * Convert avocado’s xterm-style theme bag into a GhosttyTheme-shaped object * restty’s applyTheme / terminal.theme accept. */ export declare function terminalViewThemeToGhostty(theme: TerminalViewTheme, name?: string): { name: string; colors: { background?: ThemeColor; foreground?: ThemeColor; cursor?: ThemeColor; cursorText?: ThemeColor; selectionBackground?: ThemeColor; palette: Array; }; raw: Record; }; export type ResttyThemeLoader = { getBuiltinTheme?: (name: string) => unknown; }; /** * Build fonts + terminal config + host chrome for maximum Ghostty likeness. */ export declare function buildGhosttyParity(options: GhosttyParityOptions, resttyMod?: ResttyThemeLoader | null): Promise; export {}; //# sourceMappingURL=ghostty-parity.d.ts.map