import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
import type { Effort } from "@oh-my-pi/pi-ai";
import type { EditorTheme, MarkdownTheme, SelectListTheme, SettingsListTheme, SymbolTheme } from "@oh-my-pi/pi-tui";
export { getLanguageFromPath } from "../../utils/lang-from-path.js";
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" | "status.done" | "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.worktree" | "icon.search" | "icon.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.time" | "icon.pi" | "icon.ghost" | "icon.agents" | "icon.job" | "icon.cache" | "icon.cacheMiss" | "icon.input" | "icon.output" | "icon.throughput" | "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" | "icon.camera" | "thinking.minimal" | "thinking.low" | "thinking.medium" | "thinking.high" | "thinking.xhigh" | "thinking.autoPending" | "checkbox.checked" | "checkbox.unchecked" | "radio.selected" | "radio.unselected" | "format.bullet" | "format.dash" | "format.bracketLeft" | "format.bracketRight" | "md.quoteBorder" | "md.hrChar" | "md.bullet" | "md.colorSwatch" | "advisor.rail" | "lang.default" | "lang.typescript" | "lang.javascript" | "lang.python" | "lang.rust" | "lang.go" | "lang.java" | "lang.c" | "lang.cpp" | "lang.csharp" | "lang.ruby" | "lang.julia" | "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.files" | "tab.shell" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers" | "tool.write" | "tool.edit" | "tool.bash" | "tool.ssh" | "tool.lsp" | "tool.gh" | "tool.webSearch" | "tool.exa" | "tool.browser" | "tool.eval" | "tool.debug" | "tool.mcp" | "tool.job" | "tool.task" | "tool.todo" | "tool.memory" | "tool.ask" | "tool.resolve" | "tool.review" | "tool.inspectImage" | "tool.goal" | "tool.irc" | "tool.delete" | "tool.move";
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;
    /**
     * Perceptual luma (0..1) of the status-line background — used to classify the
     * theme light/dark. Undefined when it can't be resolved. Classified against the
     * status line (the surface session accents render on) rather than the chat bubble
     * (`userMessageBg`), which some themes (e.g. `porcelain`) style dark on an
     * otherwise-light theme.
     */
    readonly statusLineLuminance: number | undefined;
    constructor(fgColors: Record<ThemeColor, string | number>, bgColors: Record<ThemeBg, string | number>, mode: ColorMode, symbolPreset: SymbolPreset, symbolOverrides: Partial<Record<SymbolKey, string>>, spinnerFramesOverrides?: Partial<Record<SpinnerType, string[]>>);
    /** True when the active theme has a light status-line background. */
    get isLight(): boolean;
    /**
     * Surface luminance to size session accents against on light themes; undefined on
     * dark themes so accents stay vivid. Pass straight to `getSessionAccentHex`.
     */
    get accentSurfaceLuminance(): number | undefined;
    /**
     * Get the resolved CSS hex string for a foreground theme color.
     */
    getColorHex(color: ThemeColor): string;
    /**
     * Get all foreground and background theme colors as CSS hex strings.
     * Skips colors resolved to the default terminal color (unstyled).
     */
    getAllThemeColorHexes(): string[];
    /**
     * Get the most visually dominant theme colors as CSS hex strings — accent,
     * border, success, error, warning, heading, link, diff markers, etc.
     * These are the colors the session accent could visually clash with.
     * Skips colors resolved to the default terminal color (unstyled).
     */
    getMajorThemeColorHexes(): string[];
    /**
     * Get the resolved CSS hex string for the theme's accent color.
     */
    getAccentColorHex(): string;
    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;
    /**
     * Foreground ANSI for text drawn **on top of** `fillColor` used as a solid
     * background (e.g. a powerline chip). Picks near-black or near-white by the
     * fill's perceived luminance (Rec. 601 luma) so the label stays legible on
     * both bright and dark fills, across light and dark themes.
     *
     * Reads the RGB out of the already-resolved truecolor escape; when the fill
     * is encoded as a 256-palette index (limited terminals) the RGB is
     * unavailable, so it falls back to the theme `text` color.
     */
    getContrastFgAnsi(fillColor: ThemeColor): 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;
        done: 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;
        cross: string;
        teeDown: string;
        teeUp: string;
        teeRight: string;
        teeLeft: 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;
        worktree: string;
        scratchFolder: string;
        file: string;
        git: string;
        branch: string;
        pr: string;
        tokens: string;
        context: string;
        cost: string;
        time: string;
        pi: string;
        ghost: string;
        agents: string;
        job: string;
        cache: string;
        cacheMiss: string;
        input: string;
        output: string;
        throughput: 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;
        camera: string;
    };
    get thinking(): {
        minimal: string;
        low: string;
        medium: string;
        high: string;
        xhigh: string;
        autoPending: string;
    };
    get checkbox(): {
        checked: string;
        unchecked: string;
    };
    get radio(): {
        selected: string;
        unselected: string;
    };
    get format(): {
        bullet: string;
        dash: string;
        bracketLeft: string;
        bracketRight: string;
    };
    get md(): {
        quoteBorder: string;
        hrChar: string;
        bullet: string;
        colorSwatch: 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;
    /**
     * Language icon tinted with the language's brand color (see
     * {@link LANG_BRAND_COLORS}). Falls back to the muted theme color for
     * languages without a brand entry, and returns the bare (possibly empty)
     * icon when the active symbol preset has none.
     */
    getLangIconStyled(lang: string | undefined): string;
}
export declare function getAvailableThemes(): Promise<string[]>;
export interface ThemeInfo {
    name: string;
    path: string | undefined;
}
export declare function getAvailableThemesWithPaths(): Promise<ThemeInfo[]>;
export declare function getThemeByName(name: string): Promise<Theme | undefined>;
export declare var theme: Theme;
/** Get the name of the currently active theme. */
export declare function getCurrentThemeName(): string | undefined;
/** Returns unstyled `text` before `initTheme()` assigns the global theme; use only for early-render paths. */
export declare function fgOrPlain(color: ThemeColor, text: string, styledText?: string): string;
export interface ThemeChangeEvent {
    /** Preview/presentation-only changes should repaint live UI without replacing native scrollback. */
    ephemeral?: boolean;
}
export declare function initTheme(enableWatcher?: boolean, symbolPreset?: SymbolPreset, colorBlindMode?: boolean, darkTheme?: string, lightTheme?: string): Promise<void>;
export declare function setTheme(name: string, enableWatcher?: boolean): Promise<{
    success: boolean;
    error?: string;
}>;
export declare function previewTheme(name: string, event?: ThemeChangeEvent): Promise<{
    success: boolean;
    error?: string;
}>;
/**
 * Enable auto-detection mode, switching to the appropriate dark/light theme.
 */
export declare function enableAutoTheme(event?: ThemeChangeEvent): 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<void>;
/**
 * 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<void>;
/**
 * Get the current color blind mode setting.
 */
export declare function getColorBlindMode(): boolean;
export declare function onThemeChange(callback: (event: ThemeChangeEvent) => void): () => void;
/**
 * Monotonic counter bumped on any theme-affecting change that should invalidate
 * cached renders: theme swaps and reloads (including the invalid-theme dark
 * fallback), theme previews, symbol-preset changes, and color-blind-mode
 * changes — everything that routes through {@link notifyThemeChange}. Consumers
 * key cached renders on it so the next render re-shapes their output.
 */
export declare function getThemeEpoch(): number;
/**
 * 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<Record<string, string>>;
/**
 * Check if a theme is a "light" theme by analyzing its status-line background
 * luminance. Loads theme JSON synchronously (built-in or custom file on disk)
 * for callers in synchronous flows (settings migration, setup wizard).
 */
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, highlightTheme?: Theme): string[];
export declare function getSymbolTheme(): SymbolTheme;
export declare function setMarkdownMermaidRendering(enabled: boolean): void;
export declare function getMarkdownTheme(): MarkdownTheme;
export declare function getSelectListTheme(): SelectListTheme;
export declare function getEditorTheme(): EditorTheme;
export declare function getSettingsListTheme(): SettingsListTheme;
