import type { ImageFormat } from './types.js'; export type BreakpointPresets = Record; export interface UserSettings { format?: ImageFormat; quality?: number; /** Legacy single-list default (pre-preset config files). Still honored for back-compat. */ breakpoints?: number[]; /** Named lists of breakpoints, e.g. `{ "mobile": [320,640], "retina": [480,960,1440] }`. */ presets?: BreakpointPresets; /** Name of the preset in `presets` used as the default breakpoint list. */ defaultPreset?: string; } export interface ResolvedDefaults { format: ImageFormat; quality: number; breakpoints: number[]; /** Name of the active default preset, if any. */ activePreset?: string; source: { format: 'user' | 'builtin'; quality: 'user' | 'builtin'; breakpoints: 'user' | 'builtin'; }; } export declare const SETTINGS_KEYS: readonly ["format", "quality", "breakpoints"]; export type SettingKey = (typeof SETTINGS_KEYS)[number]; /** * Cross-platform config location. * Honors `IMG_CONVERTOR_CONFIG_DIR` when set (useful for CI, sandboxed runs, * or users with non-standard home directories). Otherwise falls back to * `~/.img-convertor/config.json`. */ export declare function settingsPath(): string; export declare function loadSettings(): UserSettings; export declare function saveSettings(next: UserSettings): void; export declare function resetSettings(): boolean; export declare function resolveDefaults(settings?: UserSettings): ResolvedDefaults; /** Coerce+validate a raw key/value pair coming from the CLI. */ export declare function coerceSetting(key: SettingKey, value: string): UserSettings; export declare function mergeSettings(base: UserSettings, patch: UserSettings): UserSettings; export declare function unsetSetting(base: UserSettings, key: SettingKey): UserSettings; /** Validate a preset name. Throws with a helpful message when invalid. */ export declare function assertPresetName(name: string): string; export interface PresetEntry { name: string; values: number[]; isDefault: boolean; } export declare function listPresets(settings?: UserSettings): PresetEntry[]; export declare function getPreset(name: string, settings?: UserSettings): number[] | undefined; /** Adds (or overwrites) a preset. Returns the updated settings object. */ export declare function addPreset(name: string, values: number[]): UserSettings; /** Removes a preset. Clears `defaultPreset` if it pointed at the removed name. Returns true when something was removed. */ export declare function removePreset(name: string): boolean; /** Sets the default preset by name. Pass `null` to clear the default. */ export declare function setDefaultPreset(name: string | null): UserSettings; //# sourceMappingURL=settings.d.ts.map