/** * Settings Types for FlowDrop * * Provides comprehensive type definitions for all user-configurable settings. * Supports theme, editor, UI, behavior, and API settings with hybrid persistence. * * @module types/settings */ /** * Theme preference options * - 'light': Force light theme * - 'dark': Force dark theme * - 'auto': Follow system preference */ export type ThemePreference = 'light' | 'dark' | 'auto'; /** * Resolved theme (actual applied theme, never 'auto') */ export type ResolvedTheme = 'light' | 'dark'; /** * Theme-related settings */ export interface ThemeSettings { /** User's theme preference */ preference: ThemePreference; } /** * Editor canvas and interaction settings */ export interface EditorSettings { /** Show grid lines on the canvas */ showGrid: boolean; /** Snap nodes to grid when dragging */ snapToGrid: boolean; /** Grid cell size in pixels */ gridSize: number; /** Show minimap for navigation */ showMinimap: boolean; /** Default zoom level (1 = 100%) */ defaultZoom: number; /** Automatically fit workflow to view on load */ fitViewOnLoad: boolean; /** Enable proximity connect when dragging nodes near other nodes */ proximityConnect: boolean; /** Distance threshold in pixels for proximity connect */ proximityConnectDistance: number; } /** * UI layout and display settings */ export interface UISettings { /** Width of the node sidebar in pixels */ sidebarWidth: number; /** Whether the sidebar is collapsed */ sidebarCollapsed: boolean; /** Enable compact mode for denser UI */ compactMode: boolean; /** Active theme name — overridden by the theme prop when explicitly provided */ theme: 'default' | 'minimal'; /** Whether the command console panel is open */ consoleOpen: boolean; /** Height of the command console panel in pixels */ consoleHeight: number; /** Active tab in the bottom panel */ bottomPanelTab: 'console' | 'chat'; } /** * Application behavior and automation settings */ export interface BehaviorSettings { /** Automatically save changes */ autoSave: boolean; /** Auto-save interval in milliseconds */ autoSaveInterval: number; /** Maximum number of undo history entries */ undoHistoryLimit: number; /** Show confirmation dialog before deleting nodes */ confirmDelete: boolean; /** Automatically re-submit batch failures to the AI for self-correction */ chatAutoRetry: boolean; } /** * API connection and request settings */ export interface ApiSettings { /** Request timeout in milliseconds */ timeout: number; /** Enable automatic retry on failure */ retryEnabled: boolean; /** Maximum number of retry attempts */ retryAttempts: number; /** Enable response caching */ cacheEnabled: boolean; } /** * All FlowDrop settings organized by category */ export interface FlowDropSettings { /** Theme appearance settings */ theme: ThemeSettings; /** Editor canvas settings */ editor: EditorSettings; /** UI layout settings */ ui: UISettings; /** Application behavior settings */ behavior: BehaviorSettings; /** API connection settings */ api: ApiSettings; } /** * Settings category names for iteration and tab rendering */ export type SettingsCategory = keyof FlowDropSettings; /** * All available settings categories */ export declare const SETTINGS_CATEGORIES: SettingsCategory[]; /** * Human-readable labels for settings categories */ export declare const SETTINGS_CATEGORY_LABELS: Record; /** * Icons for settings categories (Iconify icon names) */ export declare const SETTINGS_CATEGORY_ICONS: Record; /** * Default theme settings */ export declare const DEFAULT_THEME_SETTINGS: ThemeSettings; /** * Default editor settings */ export declare const DEFAULT_EDITOR_SETTINGS: EditorSettings; /** * Default UI settings */ export declare const DEFAULT_UI_SETTINGS: UISettings; /** * Default behavior settings */ export declare const DEFAULT_BEHAVIOR_SETTINGS: BehaviorSettings; /** * Default API settings */ export declare const DEFAULT_API_SETTINGS: ApiSettings; /** * Complete default settings object */ export declare const DEFAULT_SETTINGS: FlowDropSettings; /** * Deep partial type for nested settings updates */ export type DeepPartial = { [P in keyof T]?: T[P] extends object ? DeepPartial : T[P]; }; /** * Partial settings for incremental updates */ export type PartialSettings = DeepPartial; /** * Event payload for settings changes */ export interface SettingsChangeEvent { /** The category that changed */ category: SettingsCategory; /** The key within the category that changed */ key: string; /** The previous value */ previousValue: unknown; /** The new value */ newValue: unknown; } /** * Callback type for settings change listeners */ export type SettingsChangeCallback = (event: SettingsChangeEvent) => void; /** * localStorage key for persisting settings */ export declare const SETTINGS_STORAGE_KEY = "flowdrop-settings"; /** * API sync status */ export type SyncStatus = 'idle' | 'syncing' | 'synced' | 'error'; /** * Settings store state including sync metadata */ export interface SettingsStoreState { /** Current settings values */ settings: FlowDropSettings; /** Whether settings have been loaded from storage */ initialized: boolean; /** API sync status */ syncStatus: SyncStatus; /** Last sync timestamp */ lastSyncedAt: number | null; /** Last sync error message */ syncError: string | null; }