/** * @file Settings Slice * @description User preferences and settings with batch updates and DevTools integration * * This slice manages all user-configurable settings including locale, display preferences, * notifications, accessibility options, and feature flags. Uses Immer for immutable updates. */ /** * Font size options */ export type FontSize = 'small' | 'medium' | 'large'; /** * Time format options */ export type TimeFormat = '12h' | '24h'; /** * Theme options */ export type Theme = 'light' | 'dark' | 'system'; /** * Settings state interface */ export interface SettingsState { locale: string; timezone: string; dateFormat: string; timeFormat: TimeFormat; numberFormat: string; theme: Theme; notificationsEnabled: boolean; soundEnabled: boolean; desktopNotifications: boolean; emailNotifications: boolean; reducedMotion: boolean; highContrast: boolean; fontSize: FontSize; keyboardShortcutsEnabled: boolean; features: Record; analyticsEnabled: boolean; crashReportingEnabled: boolean; } /** * Settings actions interface */ export interface SettingsActions { /** Set the user's locale (e.g., 'en-US', 'fr-FR') */ setLocale: (locale: string) => void; /** Set the user's timezone (IANA timezone, e.g., 'America/New_York') */ setTimezone: (timezone: string) => void; /** Set date format pattern (e.g., 'MM/DD/YYYY') */ setDateFormat: (format: string) => void; /** Set time format preference (12h or 24h) */ setTimeFormat: (format: TimeFormat) => void; /** Set number format locale (e.g., 'en-US' for 1,234.56) */ setNumberFormat: (format: string) => void; /** Set color theme preference */ setTheme: (theme: Theme) => void; /** Enable or disable all notifications */ setNotificationsEnabled: (enabled: boolean) => void; /** Enable or disable notification sounds */ setSoundEnabled: (enabled: boolean) => void; /** Enable or disable desktop/browser notifications */ setDesktopNotifications: (enabled: boolean) => void; /** Enable or disable email notifications */ setEmailNotifications: (enabled: boolean) => void; /** Enable or disable reduced motion for animations */ setReducedMotion: (enabled: boolean) => void; /** Enable or disable high contrast mode */ setHighContrast: (enabled: boolean) => void; /** Set font size preference */ setFontSize: (size: FontSize) => void; /** Enable or disable keyboard shortcuts */ setKeyboardShortcutsEnabled: (enabled: boolean) => void; /** Enable or disable analytics tracking */ setAnalyticsEnabled: (enabled: boolean) => void; /** Enable or disable crash reporting */ setCrashReportingEnabled: (enabled: boolean) => void; /** Update multiple settings at once */ updateSettings: (settings: Partial) => void; /** Update display-related settings as a batch */ updateDisplaySettings: (settings: Partial>) => void; /** Update accessibility settings as a batch */ updateAccessibilitySettings: (settings: Partial>) => void; /** Update notification settings as a batch */ updateNotificationSettings: (settings: Partial>) => void; /** Update privacy settings as a batch */ updatePrivacySettings: (settings: Partial>) => void; /** Set a single feature flag */ setFeatureFlag: (flag: string, enabled: boolean) => void; /** Set multiple feature flags (merges with existing) */ setFeatureFlags: (flags: Record) => void; /** Replace all feature flags from server sync */ syncFeatureFlags: (flags: Record) => void; /** Check if a feature flag is enabled */ isFeatureEnabled: (flag: string) => boolean; /** Reset all settings to defaults */ resetSettings: () => void; /** Reset display settings to defaults */ resetDisplaySettings: () => void; /** Reset accessibility settings to defaults */ resetAccessibilitySettings: () => void; /** Reset notification settings to defaults */ resetNotificationSettings: () => void; } /** * Default settings (used for reset and initial state) */ declare const defaultSettings: SettingsState; /** * Default display settings subset */ declare const defaultDisplaySettings: { locale: string; timezone: string; dateFormat: string; timeFormat: TimeFormat; numberFormat: string; theme: Theme; }; /** * Default accessibility settings subset */ declare const defaultAccessibilitySettings: { reducedMotion: boolean; highContrast: boolean; fontSize: FontSize; keyboardShortcutsEnabled: boolean; }; /** * Default notification settings subset */ declare const defaultNotificationSettings: { notificationsEnabled: boolean; soundEnabled: boolean; desktopNotifications: boolean; emailNotifications: boolean; }; /** * Settings slice using createSlice factory for automatic DevTools action naming * * All actions are automatically prefixed with "settings/" in DevTools, e.g.: * - settings/setLocale * - settings/updateDisplaySettings * - settings/setFeatureFlag */ export declare const settingsSlice: import('zustand').StateCreator unknown>, [["zustand/immer", never], ["zustand/devtools", never]], [], SettingsState & SettingsActions & Record unknown>>; export type SettingsSlice = SettingsState & SettingsActions; export { defaultSettings, defaultDisplaySettings, defaultAccessibilitySettings, defaultNotificationSettings, };