import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core"; import type { Effort } from "@oh-my-pi/pi-ai"; import type { EditorTheme, MarkdownTheme, SelectListTheme, SymbolTheme } from "@oh-my-pi/pi-tui"; export { getLanguageFromPath } from "../../utils/lang-from-path"; export type SymbolPreset = "unicode" | "nerd" | "ascii"; /** * All available symbol keys organized by category. */ export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted" | "nav.cursor" | "nav.selected" | "nav.expand" | "nav.collapse" | "nav.back" | "tree.branch" | "tree.last" | "tree.vertical" | "tree.horizontal" | "tree.hook" | "boxRound.topLeft" | "boxRound.topRight" | "boxRound.bottomLeft" | "boxRound.bottomRight" | "boxRound.horizontal" | "boxRound.vertical" | "boxSharp.topLeft" | "boxSharp.topRight" | "boxSharp.bottomLeft" | "boxSharp.bottomRight" | "boxSharp.horizontal" | "boxSharp.vertical" | "boxSharp.cross" | "boxSharp.teeDown" | "boxSharp.teeUp" | "boxSharp.teeRight" | "boxSharp.teeLeft" | "sep.powerline" | "sep.powerlineThin" | "sep.powerlineLeft" | "sep.powerlineRight" | "sep.powerlineThinLeft" | "sep.powerlineThinRight" | "sep.block" | "sep.space" | "sep.asciiLeft" | "sep.asciiRight" | "sep.dot" | "sep.slash" | "sep.pipe" | "icon.model" | "icon.plan" | "icon.goal" | "icon.pause" | "icon.loop" | "icon.folder" | "icon.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.time" | "icon.pi" | "icon.agents" | "icon.cache" | "icon.input" | "icon.output" | "icon.host" | "icon.session" | "icon.package" | "icon.warning" | "icon.rewind" | "icon.auto" | "icon.fast" | "icon.extensionSkill" | "icon.extensionTool" | "icon.extensionSlashCommand" | "icon.extensionMcp" | "icon.extensionRule" | "icon.extensionHook" | "icon.extensionPrompt" | "icon.extensionContextFile" | "icon.extensionInstruction" | "icon.mic" | "thinking.minimal" | "thinking.low" | "thinking.medium" | "thinking.high" | "thinking.xhigh" | "checkbox.checked" | "checkbox.unchecked" | "format.bullet" | "format.dash" | "format.bracketLeft" | "format.bracketRight" | "md.quoteBorder" | "md.hrChar" | "md.bullet" | "lang.default" | "lang.typescript" | "lang.javascript" | "lang.python" | "lang.rust" | "lang.go" | "lang.java" | "lang.c" | "lang.cpp" | "lang.csharp" | "lang.ruby" | "lang.php" | "lang.swift" | "lang.kotlin" | "lang.shell" | "lang.html" | "lang.css" | "lang.json" | "lang.yaml" | "lang.markdown" | "lang.sql" | "lang.docker" | "lang.lua" | "lang.text" | "lang.env" | "lang.toml" | "lang.xml" | "lang.ini" | "lang.conf" | "lang.log" | "lang.csv" | "lang.tsv" | "lang.image" | "lang.pdf" | "lang.archive" | "lang.binary" | "tab.appearance" | "tab.model" | "tab.interaction" | "tab.context" | "tab.editing" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers"; export type SpinnerType = "status" | "activity"; export type ThemeColor = "accent" | "border" | "borderAccent" | "borderMuted" | "success" | "error" | "warning" | "muted" | "dim" | "text" | "thinkingText" | "userMessageText" | "customMessageText" | "customMessageLabel" | "toolTitle" | "toolOutput" | "mdHeading" | "mdLink" | "mdLinkUrl" | "mdCode" | "mdCodeBlock" | "mdCodeBlockBorder" | "mdQuote" | "mdQuoteBorder" | "mdHr" | "mdListBullet" | "toolDiffAdded" | "toolDiffRemoved" | "toolDiffContext" | "syntaxComment" | "syntaxKeyword" | "syntaxFunction" | "syntaxVariable" | "syntaxString" | "syntaxNumber" | "syntaxType" | "syntaxOperator" | "syntaxPunctuation" | "thinkingOff" | "thinkingMinimal" | "thinkingLow" | "thinkingMedium" | "thinkingHigh" | "thinkingXhigh" | "bashMode" | "pythonMode" | "statusLineSep" | "statusLineModel" | "statusLinePath" | "statusLineGitClean" | "statusLineGitDirty" | "statusLineContext" | "statusLineSpend" | "statusLineStaged" | "statusLineDirty" | "statusLineUntracked" | "statusLineOutput" | "statusLineCost" | "statusLineSubagents"; /** Check if a string is a valid ThemeColor value */ export declare function isValidThemeColor(color: string): color is ThemeColor; export type ThemeBg = "selectedBg" | "userMessageBg" | "customMessageBg" | "toolPendingBg" | "toolSuccessBg" | "toolErrorBg" | "statusLineBg"; type ColorMode = "truecolor" | "256color"; export declare class Theme { #private; private readonly mode; private readonly symbolPreset; constructor(fgColors: Record, bgColors: Record, mode: ColorMode, symbolPreset: SymbolPreset, symbolOverrides: Partial>); fg(color: ThemeColor, text: string): string; bg(color: ThemeBg, text: string): string; bold(text: string): string; italic(text: string): string; underline(text: string): string; strikethrough(text: string): string; inverse(text: string): string; getFgAnsi(color: ThemeColor): string; getBgAnsi(color: ThemeBg): string; getColorMode(): ColorMode; getThinkingBorderColor(level: ThinkingLevel | Effort): (str: string) => string; getBashModeBorderColor(): (str: string) => string; getPythonModeBorderColor(): (str: string) => string; /** * Get a symbol by key. */ symbol(key: SymbolKey): string; /** * Get a symbol styled with a color. */ styledSymbol(key: SymbolKey, color: ThemeColor): string; /** * Get the current symbol preset. */ getSymbolPreset(): SymbolPreset; get status(): { success: string; error: string; warning: string; info: string; pending: string; disabled: string; enabled: string; running: string; shadowed: string; aborted: string; }; get nav(): { cursor: string; selected: string; expand: string; collapse: string; back: string; }; get tree(): { branch: string; last: string; vertical: string; horizontal: string; hook: string; }; get boxRound(): { topLeft: string; topRight: string; bottomLeft: string; bottomRight: string; horizontal: string; vertical: string; }; get boxSharp(): { topLeft: string; topRight: string; bottomLeft: string; bottomRight: string; horizontal: string; vertical: string; cross: string; teeDown: string; teeUp: string; teeRight: string; teeLeft: string; }; get sep(): { powerline: string; powerlineThin: string; powerlineLeft: string; powerlineRight: string; powerlineThinLeft: string; powerlineThinRight: string; block: string; space: string; asciiLeft: string; asciiRight: string; dot: string; slash: string; pipe: string; }; get icon(): { model: string; plan: string; goal: string; pause: string; loop: string; folder: string; scratchFolder: string; file: string; git: string; branch: string; pr: string; tokens: string; context: string; cost: string; time: string; pi: string; agents: string; cache: string; input: string; output: string; host: string; session: string; package: string; warning: string; rewind: string; auto: string; fast: string; extensionSkill: string; extensionTool: string; extensionSlashCommand: string; extensionMcp: string; extensionRule: string; extensionHook: string; extensionPrompt: string; extensionContextFile: string; extensionInstruction: string; mic: string; }; get thinking(): { minimal: string; low: string; medium: string; high: string; xhigh: string; }; get checkbox(): { checked: string; unchecked: string; }; get format(): { bullet: string; dash: string; bracketLeft: string; bracketRight: string; }; get md(): { quoteBorder: string; hrChar: string; bullet: string; }; /** * Default spinner frames (status spinner). */ get spinnerFrames(): string[]; /** * Get spinner frames by type. */ getSpinnerFrames(type?: SpinnerType): string[]; /** * Get language icon for a language name. * Maps common language names to their corresponding symbol keys. */ getLangIcon(lang: string | undefined): string; } export declare function getAvailableThemes(): Promise; export interface ThemeInfo { name: string; path: string | undefined; } export declare function getAvailableThemesWithPaths(): Promise; export declare function getThemeByName(name: string): Promise; export declare var theme: Theme; /** Get the name of the currently active theme. */ export declare function getCurrentThemeName(): string | undefined; export declare function initTheme(enableWatcher?: boolean, symbolPreset?: SymbolPreset, colorBlindMode?: boolean, darkTheme?: string, lightTheme?: string): Promise; export declare function setTheme(name: string, enableWatcher?: boolean): Promise<{ success: boolean; error?: string; }>; export declare function previewTheme(name: string): Promise<{ success: boolean; error?: string; }>; /** * Enable auto-detection mode, switching to the appropriate dark/light theme. */ export declare function enableAutoTheme(): void; /** * Update the theme mappings for auto-detection mode. * When a dark/light mapping changes and auto-detection is active, re-evaluate the theme. */ export declare function setAutoThemeMapping(mode: "dark" | "light", themeName: string): void; /** * Called when the terminal detects a dark/light appearance change. * The terminal layer queries OSC 11 (background color) and computes luminance; * Mode 2031 notifications trigger re-queries rather than providing the value directly. */ export declare function onTerminalAppearanceChange(mode: "dark" | "light"): void; export declare function setThemeInstance(themeInstance: Theme): void; /** * Set the symbol preset override, recreating the theme with the new preset. */ export declare function setSymbolPreset(preset: SymbolPreset): Promise; /** * Get the current symbol preset override. */ export declare function getSymbolPresetOverride(): SymbolPreset | undefined; /** * Set color blind mode, recreating the theme with the new setting. * When enabled, uses blue instead of green for diff additions. */ export declare function setColorBlindMode(enabled: boolean): Promise; /** * Get the current color blind mode setting. */ export declare function getColorBlindMode(): boolean; export declare function onThemeChange(callback: () => void): void; /** * Get available symbol presets. */ export declare function getAvailableSymbolPresets(): SymbolPreset[]; /** * Check if a string is a valid symbol preset. */ export declare function isValidSymbolPreset(preset: string): preset is SymbolPreset; export declare function stopThemeWatcher(): void; /** * Get resolved theme colors as CSS-compatible hex strings. * Used by HTML export to generate CSS custom properties. */ export declare function getResolvedThemeColors(themeName?: string): Promise>; /** * Check if a theme is a "light" theme by analyzing its background color luminance. * Loads theme JSON synchronously (built-in or custom file) and resolves userMessageBg. */ export declare function isLightTheme(themeName?: string): boolean; /** * Get explicit export colors from theme JSON, if specified. * Returns undefined for each color that isn't explicitly set. */ export declare function getThemeExportColors(themeName?: string): Promise<{ pageBg?: string; cardBg?: string; infoBg?: string; }>; /** * Highlight code with syntax coloring based on file extension or language. * Returns array of highlighted lines. */ export declare function highlightCode(code: string, lang?: string): string[]; export declare function getSymbolTheme(): SymbolTheme; export declare function getMarkdownTheme(): MarkdownTheme; export declare function getSelectListTheme(): SelectListTheme; export declare function getEditorTheme(): EditorTheme; export declare function getSettingsListTheme(): import("@oh-my-pi/pi-tui").SettingsListTheme;