/** * Icons: every glyph chassis draws from a Nerd Font lives here, each with a plain twin that needs * no special font. The plain twin takes the same number of cells as the Nerd glyph (one, or none * where the words beside it already say it), so no layout changes between the two sets. * * Which set is used, first match wins: * 1. the PI_CHASSIS_ICONS environment variable ("nerd" or "plain") * 2. the user's setting, `/chassis icons nerd|plain`, saved in chassis.json * 3. the brand's default (`icons` in its spec: a brand that ships a font can ask for "nerd") * 4. plain, so a terminal without a Nerd Font never shows empty boxes * * The plain glyphs are ASCII or characters that exist in the common monospace fonts (DejaVu Sans * Mono, Noto Sans Mono, Consolas and Lucida Console were checked): • · ↑ ↓ → ● ○ ▲ × ▐ ▌. * * This file is the only place with Nerd Font code points. test/icons.test.ts fails on one anywhere else. */ export type IconSet = "nerd" | "plain"; /** An icon a widget supplies: one string for both sets, or one per set. */ export type IconLike = string | { nerd: string; plain?: string; }; /** nf-md-* unless noted. "" means no icon in that set. */ export declare const ICONS: { readonly provider: { readonly nerd: "󰚩"; readonly plain: "■"; }; readonly usage: { readonly nerd: "󰝦"; readonly plain: " "; }; readonly branch: { readonly nerd: ""; readonly plain: ""; }; readonly worktree: { readonly nerd: "󰓠"; readonly plain: "wt"; }; readonly cache: { readonly nerd: "⟳"; readonly plain: "cache"; }; readonly resume: { readonly nerd: "⟲"; readonly plain: ""; }; readonly levelOk: { readonly nerd: "󰗡"; readonly plain: "●"; }; readonly levelWarn: { readonly nerd: "󰀪"; readonly plain: "▲"; }; readonly levelError: { readonly nerd: "󰅚"; readonly plain: "×"; }; readonly levelOff: { readonly nerd: "󰍷"; readonly plain: "○"; }; readonly levelInfo: { readonly nerd: "󰋽"; readonly plain: "•"; }; readonly statusLsp: { readonly nerd: "󰅩"; readonly plain: "•"; }; readonly statusGraphify: { readonly nerd: "󱁊"; readonly plain: "•"; }; readonly modeBuild: { readonly nerd: "󰚩"; readonly plain: ""; }; readonly modePlan: { readonly nerd: "󰈈"; readonly plain: ""; }; readonly capLeft: { readonly nerd: ""; readonly plain: "▐"; }; readonly capRight: { readonly nerd: ""; readonly plain: "▌"; }; readonly toolRead: { readonly nerd: "󰧮"; readonly plain: "→"; }; readonly toolWrite: { readonly nerd: "󰻭"; readonly plain: "+"; }; readonly toolEdit: { readonly nerd: "󰏫"; readonly plain: "~"; }; readonly toolBash: { readonly nerd: "󰆍"; readonly plain: "$"; }; readonly toolGrep: { readonly nerd: "󰍉"; readonly plain: "?"; }; readonly toolFind: { readonly nerd: "󰱽"; readonly plain: "*"; }; readonly toolLs: { readonly nerd: "󰉖"; readonly plain: "/"; }; readonly toolOther: { readonly nerd: ""; readonly plain: "•"; }; readonly telSpeed: { readonly nerd: "󰓅"; readonly plain: ""; }; readonly telTtft: { readonly nerd: "󰔟"; readonly plain: ""; }; readonly telTotal: { readonly nerd: "󰅐"; readonly plain: ""; }; readonly telStall: { readonly nerd: "󰀪"; readonly plain: ""; }; readonly diff: { readonly nerd: "󰊢"; readonly plain: ""; }; readonly widgetContainer: { readonly nerd: "󰡨"; readonly plain: ""; }; readonly widgetK8s: { readonly nerd: "󱃾"; readonly plain: ""; }; readonly widgetMcp: { readonly nerd: "󰚥"; readonly plain: ""; }; readonly widgetSessionTodos: { readonly nerd: "󰢨"; readonly plain: ""; }; readonly widgetSubagents: { readonly nerd: "󰭘"; readonly plain: ""; }; readonly widgetTodo: { readonly nerd: "󰝖"; readonly plain: ""; }; }; export type IconName = keyof typeof ICONS; /** The saved setting from the state file (`icons`), or undefined. */ export declare function loadIconSetting(path?: string): IconSet | undefined; /** Set the user's setting for this run (undefined forgets it). Saving to the file is `saveIconSetting`. */ export declare function setIconSetting(set: IconSet | undefined): void; /** Forget what was read, so the next call reads the state file again (tests, and /reload). */ export declare function resetIconSetting(): void; /** Where the current set comes from, for `/chassis icons`. */ export declare function iconSource(): "env" | "setting" | "brand" | "default"; /** The icon set in use. */ export declare function iconSet(): IconSet; /** The glyph for `name` in the current set. May be "" (no icon). */ export declare function icon(name: IconName): string; /** `glyph`, a space, then `text`; just `text` when there is no glyph. */ export declare const withIcon: (glyph: string, text: string) => string; /** " " painted with `paint`, or nothing when the set has no glyph here. */ export declare const leadIcon: (glyph: string, paint: (s: string) => string) => string; export declare const hasPrivateUse: (s: string) => boolean; /** * A widget's or brand's icon in the current set, or undefined when it has none there. An object * gives its `nerd` or `plain` string. A bare string is used as given in the nerd set; in the plain * set it loses any private-use characters (a font the terminal may not have), and is undefined if * nothing but blanks is left. */ export declare function resolveIcon(like: IconLike | undefined): string | undefined; /** * A single-cell mark that is safe to draw: in the plain set a private-use glyph (a brand's own * font) is replaced by `fallback`. */ export declare function safeGlyph(glyph: string, fallback?: string): string; /** The usage circle for 0 to 100 percent, filled in eighths; a blank slot in the plain set. */ export declare function usageIcon(percent: number | undefined): string; /** Save the user's setting into the state file, keeping its other keys. Best effort. */ export declare function saveIconSetting(set: IconSet | undefined, path?: string): void;