/** * UI adapter over the schema. Reads `ui.options` declared inline in * settings-schema.ts and produces typed widget definitions for the * settings selector. * * To add a new setting to the UI: declare it in `settings-schema.ts` * with a `ui` block. If it needs a submenu, include `options: [...]` * (or `options: "runtime"` for runtime-injected lists like themes). */ import { type SettingPath, type SettingTab, type SubmenuOption } from "../../config/settings-schema"; export type SettingValue = boolean | string; interface BaseSettingDef { path: SettingPath; label: string; description: string; tab: SettingTab; /** * Optional visibility predicate. When supplied and returning false, the * setting is hidden from the UI. Applies to every variant — booleans, * enums, submenus, and text inputs. */ condition?: () => boolean; } export interface BooleanSettingDef extends BaseSettingDef { type: "boolean"; } export interface EnumSettingDef extends BaseSettingDef { type: "enum"; values: readonly string[]; } type OptionList = ReadonlyArray; export interface SubmenuSettingDef extends BaseSettingDef { type: "submenu"; options: OptionList; onPreview?: (value: string) => void; onPreviewCancel?: (originalValue: string) => void; } export interface TextInputSettingDef extends BaseSettingDef { type: "text"; } export type SettingDef = BooleanSettingDef | EnumSettingDef | SubmenuSettingDef | TextInputSettingDef; /** Get all setting definitions with UI */ export declare function getAllSettingDefs(): SettingDef[]; /** Get settings for a specific tab */ export declare function getSettingsForTab(tab: SettingTab): SettingDef[]; /** Get a setting definition by path */ export declare function getSettingDef(path: SettingPath): SettingDef | undefined; /** Get default value for display */ export declare function getDisplayDefault(path: SettingPath): string; export {};